/** * One-time generator: writes backend/src/config/permissions/*.json from the canonical catalog. * Run: node backend/scripts/generate-permission-json-files.js */ const fs = require('fs'); const path = require('path'); const DIR = path.join(__dirname, '../src/config/permissions'); const FEATURES = [ ['participants', 'Participants', 'portfolio'], ['event_website', 'Event Website', 'website'], ['customise_event_website', 'Customise event website', 'website'], ['custom_domain', 'Custom Domain', 'website'], ['invites_rsvp', 'Invites +RSVP', 'registration'], ['registration_forms_with_custom_fields', 'Registration forms with Custom fields', 'registration'], ['custom_registration_workflow', 'Custom Registration workflow', 'registration'], ['email_confirmation_reminders', 'Email Confirmation & Reminders', 'comms'], ['email_outreach_campaigns', 'Email outreach campaigns', 'comms'], ['custom_badge_and_print_file_creation', 'Custom Badge and print file creation', 'design'], ['whatsapp_confirmation_reminders', 'WhatsApp confirmation & reminders', 'comms'], ['bring_your_wa_number', 'Bring your WA number', 'comms'], ['custom_template_for_wa_messaging', 'Custom template for WA messaging', 'comms'], ['agenda_builder', 'Agenda builder', 'agenda'], ['multi_track_agenda', 'Multi track agenda', 'agenda'], ['speaker_management', 'Speaker management', 'agenda'], ['abstract_management', 'Abstract management', 'agenda'], ['ticketing_free_and_paid', 'Ticketing free & paid', 'payments'], ['collect_payment_using_your_upi_qr', 'Collect Payment using your UPI QR', 'payments'], ['payment_gateway_integration', 'Payment gateway integration', 'payments'], ['qna_with_moderation', 'QnA with moderation', 'engagement'], ['live_polls', 'Live Polls', 'engagement'], ['multiple_quiz_modes', 'Multiple Quiz modes', 'engagement'], ['word_cloud', 'Word Cloud', 'engagement'], ['custom_theme', 'Custom Theme', 'branding'], ['ai_summarization', 'AI Summarization', 'ai'], ['ai_engagement_insights', 'AI Engagement insights', 'ai'], ['content_management', 'Content management', 'content'], ['ratings_for_sessions_and_speakers', 'Ratings for sessions and speakers', 'feedback'], ['feedback_forms_and_surveys', 'Feedback forms & Surveys', 'feedback'], ['gamification', 'Gamification', 'engagement'], ['push_notifications', 'Push Notifications', 'comms'], ]; fs.mkdirSync(DIR, { recursive: true }); for (const [key, label, category] of FEATURES) { const file = path.join(DIR, `${key}.json`); const doc = { key, label, description: '', category, }; fs.writeFileSync(file, `${JSON.stringify(doc, null, 2)}\n`, 'utf8'); console.log('wrote', path.basename(file)); } console.log('done', FEATURES.length, 'files');