@sonicjs-cms/core 2.14.0 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/admin-layout-catalyst.template-HFD37TY5.cjs +17 -0
  2. package/dist/admin-layout-catalyst.template-HFD37TY5.cjs.map +1 -0
  3. package/dist/admin-layout-catalyst.template-UMTIN66R.js +7 -0
  4. package/dist/admin-layout-catalyst.template-UMTIN66R.js.map +1 -0
  5. package/dist/{chunk-DRWSHIFG.cjs → chunk-26HYU7MX.cjs} +228 -658
  6. package/dist/chunk-26HYU7MX.cjs.map +1 -0
  7. package/dist/{chunk-AFGOH2F6.js → chunk-2BL2A62D.js} +4 -4
  8. package/dist/{chunk-AFGOH2F6.js.map → chunk-2BL2A62D.js.map} +1 -1
  9. package/dist/{chunk-I6FFGQIT.cjs → chunk-43AB4EH4.cjs} +723 -211
  10. package/dist/chunk-43AB4EH4.cjs.map +1 -0
  11. package/dist/{chunk-3QCEYJLK.cjs → chunk-4ZSNJDLS.cjs} +9 -9
  12. package/dist/{chunk-3QCEYJLK.cjs.map → chunk-4ZSNJDLS.cjs.map} +1 -1
  13. package/dist/chunk-55RDMDOP.js +684 -0
  14. package/dist/chunk-55RDMDOP.js.map +1 -0
  15. package/dist/{chunk-JKNKO6LA.js → chunk-5SOFMH66.js} +2 -2
  16. package/dist/{chunk-JKNKO6LA.js.map → chunk-5SOFMH66.js.map} +1 -1
  17. package/dist/{chunk-6FHNRRJ3.cjs → chunk-635JAMSE.cjs} +76 -17
  18. package/dist/chunk-635JAMSE.cjs.map +1 -0
  19. package/dist/{chunk-23DP6TO5.js → chunk-7MMD5WMK.js} +44 -474
  20. package/dist/chunk-7MMD5WMK.js.map +1 -0
  21. package/dist/{chunk-56GUBLJE.cjs → chunk-ABB34XUS.cjs} +13 -13
  22. package/dist/{chunk-56GUBLJE.cjs.map → chunk-ABB34XUS.cjs.map} +1 -1
  23. package/dist/{chunk-GAVTTYMC.js → chunk-EWXV2KG2.js} +3 -3
  24. package/dist/{chunk-GAVTTYMC.js.map → chunk-EWXV2KG2.js.map} +1 -1
  25. package/dist/{chunk-J5WGMRSU.js → chunk-EXNEW5US.js} +76 -17
  26. package/dist/chunk-EXNEW5US.js.map +1 -0
  27. package/dist/{chunk-H3XXBAMO.js → chunk-G7XSN72O.js} +722 -212
  28. package/dist/chunk-G7XSN72O.js.map +1 -0
  29. package/dist/{chunk-QP3OHHON.cjs → chunk-OHYBNCVL.cjs} +18 -696
  30. package/dist/chunk-OHYBNCVL.cjs.map +1 -0
  31. package/dist/{chunk-CB7ONLGB.js → chunk-ON5ZMSU4.js} +3 -3
  32. package/dist/{chunk-CB7ONLGB.js.map → chunk-ON5ZMSU4.js.map} +1 -1
  33. package/dist/{chunk-KZ2MFGET.cjs → chunk-RVD7PLMU.cjs} +2 -2
  34. package/dist/{chunk-KZ2MFGET.cjs.map → chunk-RVD7PLMU.cjs.map} +1 -1
  35. package/dist/{chunk-2MXF4RYZ.js → chunk-TFNTM3OA.js} +3 -3
  36. package/dist/{chunk-2MXF4RYZ.js.map → chunk-TFNTM3OA.js.map} +1 -1
  37. package/dist/{chunk-YYMPHM3I.cjs → chunk-UFPT5KCQ.cjs} +8 -8
  38. package/dist/{chunk-YYMPHM3I.cjs.map → chunk-UFPT5KCQ.cjs.map} +1 -1
  39. package/dist/chunk-UYJ6TJHX.cjs +691 -0
  40. package/dist/chunk-UYJ6TJHX.cjs.map +1 -0
  41. package/dist/{chunk-YULUPQZV.cjs → chunk-VUISYUHY.cjs} +3 -3
  42. package/dist/{chunk-YULUPQZV.cjs.map → chunk-VUISYUHY.cjs.map} +1 -1
  43. package/dist/{chunk-JTUCC6WZ.js → chunk-XWIA3HVX.js} +9 -683
  44. package/dist/chunk-XWIA3HVX.js.map +1 -0
  45. package/dist/index.cjs +910 -233
  46. package/dist/index.cjs.map +1 -1
  47. package/dist/index.js +765 -88
  48. package/dist/index.js.map +1 -1
  49. package/dist/middleware.cjs +29 -29
  50. package/dist/middleware.js +3 -3
  51. package/dist/migrations-APFGYCB6.cjs +13 -0
  52. package/dist/{migrations-F7KVA74T.cjs.map → migrations-APFGYCB6.cjs.map} +1 -1
  53. package/dist/migrations-YB52SLW7.js +4 -0
  54. package/dist/{migrations-WKONKRN7.js.map → migrations-YB52SLW7.js.map} +1 -1
  55. package/dist/{plugin-bootstrap-BGwBraaN.d.cts → plugin-bootstrap-DfVerYV4.d.cts} +2 -1
  56. package/dist/{plugin-bootstrap-Drns7X9w.d.ts → plugin-bootstrap-P_ciLp_C.d.ts} +2 -1
  57. package/dist/plugins.cjs +11 -11
  58. package/dist/plugins.js +2 -2
  59. package/dist/routes.cjs +31 -30
  60. package/dist/routes.js +8 -7
  61. package/dist/services.cjs +23 -23
  62. package/dist/services.js +2 -2
  63. package/dist/templates.cjs +26 -25
  64. package/dist/templates.js +3 -2
  65. package/dist/utils.cjs +11 -11
  66. package/dist/utils.js +1 -1
  67. package/package.json +1 -1
  68. package/dist/chunk-23DP6TO5.js.map +0 -1
  69. package/dist/chunk-6FHNRRJ3.cjs.map +0 -1
  70. package/dist/chunk-DRWSHIFG.cjs.map +0 -1
  71. package/dist/chunk-H3XXBAMO.js.map +0 -1
  72. package/dist/chunk-I6FFGQIT.cjs.map +0 -1
  73. package/dist/chunk-J5WGMRSU.js.map +0 -1
  74. package/dist/chunk-JTUCC6WZ.js.map +0 -1
  75. package/dist/chunk-QP3OHHON.cjs.map +0 -1
  76. package/dist/migrations-F7KVA74T.cjs +0 -13
  77. package/dist/migrations-WKONKRN7.js +0 -4
@@ -1,10 +1,11 @@
1
1
  import { getCacheService, CACHE_CONFIGS, SettingsService, getLogger, getAppInstance, buildRouteList, CATEGORY_INFO } from './chunk-TBJY2FF7.js';
2
- import { requireAuth, requireRole, isPluginActive, optionalAuth, rateLimit, AuthManager, logActivity, generateCsrfToken } from './chunk-AFGOH2F6.js';
3
- import { PluginService, createContentFromSubmission } from './chunk-H3XXBAMO.js';
4
- import { MigrationService } from './chunk-JKNKO6LA.js';
5
- import { init_admin_layout_catalyst_template, renderDesignPage, renderCheckboxPage, renderTestimonialsList, renderCodeExamplesList, renderAlert, renderTable, renderPagination, renderConfirmationDialog, getConfirmationDialogScript, renderAdminLayoutCatalyst, renderAdminLayout, adminLayoutV2, renderForm } from './chunk-JTUCC6WZ.js';
6
- import { PluginBuilder, TurnstileService } from './chunk-J5WGMRSU.js';
7
- import { QueryFilterBuilder, getCoreVersion, getBlocksFieldConfig, parseBlocksValue } from './chunk-GAVTTYMC.js';
2
+ import { requireAuth, requireRole, isPluginActive, optionalAuth, rateLimit, AuthManager, logActivity, generateCsrfToken } from './chunk-2BL2A62D.js';
3
+ import { PluginService, PLUGIN_REGISTRY, findPluginByCodeName, createContentFromSubmission } from './chunk-G7XSN72O.js';
4
+ import { MigrationService } from './chunk-5SOFMH66.js';
5
+ import { renderDesignPage, renderCheckboxPage, renderTestimonialsList, renderCodeExamplesList, renderAlert, renderTable, renderPagination, renderConfirmationDialog, getConfirmationDialogScript, renderAdminLayout, adminLayoutV2, renderForm } from './chunk-XWIA3HVX.js';
6
+ import { init_admin_layout_catalyst_template, renderAdminLayoutCatalyst } from './chunk-55RDMDOP.js';
7
+ import { PluginBuilder, TurnstileService } from './chunk-EXNEW5US.js';
8
+ import { QueryFilterBuilder, getCoreVersion, getBlocksFieldConfig, parseBlocksValue } from './chunk-EWXV2KG2.js';
8
9
  import { metricsTracker } from './chunk-FICTAGD4.js';
9
10
  import { escapeHtml, sanitizeRichText, sanitizeInput } from './chunk-TQABQWOP.js';
10
11
  import { Hono } from 'hono';
@@ -2350,7 +2351,7 @@ adminApiRoutes.delete("/collections/:id", async (c) => {
2350
2351
  });
2351
2352
  adminApiRoutes.get("/migrations/status", async (c) => {
2352
2353
  try {
2353
- const { MigrationService: MigrationService2 } = await import('./migrations-WKONKRN7.js');
2354
+ const { MigrationService: MigrationService2 } = await import('./migrations-YB52SLW7.js');
2354
2355
  const db = c.env.DB;
2355
2356
  const migrationService = new MigrationService2(db);
2356
2357
  const status = await migrationService.getMigrationStatus();
@@ -2375,7 +2376,7 @@ adminApiRoutes.post("/migrations/run", async (c) => {
2375
2376
  error: "Unauthorized. Admin access required."
2376
2377
  }, 403);
2377
2378
  }
2378
- const { MigrationService: MigrationService2 } = await import('./migrations-WKONKRN7.js');
2379
+ const { MigrationService: MigrationService2 } = await import('./migrations-YB52SLW7.js');
2379
2380
  const db = c.env.DB;
2380
2381
  const migrationService = new MigrationService2(db);
2381
2382
  const result = await migrationService.runPendingMigrations();
@@ -2397,7 +2398,7 @@ adminApiRoutes.post("/migrations/run", async (c) => {
2397
2398
  });
2398
2399
  adminApiRoutes.get("/migrations/validate", async (c) => {
2399
2400
  try {
2400
- const { MigrationService: MigrationService2 } = await import('./migrations-WKONKRN7.js');
2401
+ const { MigrationService: MigrationService2 } = await import('./migrations-YB52SLW7.js');
2401
2402
  const db = c.env.DB;
2402
2403
  const migrationService = new MigrationService2(db);
2403
2404
  const validation = await migrationService.validateSchema();
@@ -18211,151 +18212,19 @@ function renderEmailSettingsContent(plugin, settings) {
18211
18212
  // src/routes/admin-plugins.ts
18212
18213
  var adminPluginRoutes = new Hono();
18213
18214
  adminPluginRoutes.use("*", requireAuth());
18214
- var AVAILABLE_PLUGINS = [
18215
- {
18216
- id: "third-party-faq",
18217
- name: "faq-plugin",
18218
- display_name: "FAQ System",
18219
- description: "Frequently Asked Questions management system with categories, search, and custom styling",
18220
- version: "2.0.0",
18221
- author: "Community Developer",
18222
- category: "content",
18223
- icon: "\xE2\x9D\x93",
18224
- permissions: ["manage:faqs"],
18225
- dependencies: [],
18226
- is_core: false
18227
- },
18228
- {
18229
- id: "demo-login-prefill",
18230
- name: "demo-login-plugin",
18231
- display_name: "Demo Login Prefill",
18232
- description: "Prefills login form with demo credentials (admin@sonicjs.com/sonicjs!) for easy site demonstration",
18233
- version: "1.0.0-beta.1",
18234
- author: "SonicJS",
18235
- category: "demo",
18236
- icon: "\xF0\x9F\x8E\xAF",
18237
- permissions: [],
18238
- dependencies: [],
18239
- is_core: false
18240
- },
18241
- {
18242
- id: "database-tools",
18243
- name: "database-tools",
18244
- display_name: "Database Tools",
18245
- description: "Database management tools including truncate, backup, and validation",
18246
- version: "1.0.0-beta.1",
18247
- author: "SonicJS Team",
18248
- category: "system",
18249
- icon: "\xF0\x9F\x97\x84\xEF\xB8\x8F",
18250
- permissions: ["manage:database", "admin"],
18251
- dependencies: [],
18252
- is_core: false
18253
- },
18254
- {
18255
- id: "seed-data",
18256
- name: "seed-data",
18257
- display_name: "Seed Data",
18258
- description: "Generate realistic example users and content for testing and development",
18259
- version: "1.0.0-beta.1",
18260
- author: "SonicJS Team",
18261
- category: "development",
18262
- icon: "\xF0\x9F\x8C\xB1",
18263
- permissions: ["admin"],
18264
- dependencies: [],
18265
- is_core: false
18266
- },
18267
- {
18268
- id: "quill-editor",
18269
- name: "quill-editor",
18270
- display_name: "Quill Rich Text Editor",
18271
- description: "Quill WYSIWYG editor integration for rich text editing. Lightweight, modern editor with customizable toolbars and dark mode support.",
18272
- version: "1.0.0",
18273
- author: "SonicJS Team",
18274
- category: "editor",
18275
- icon: "\xE2\x9C\x8D\xEF\xB8\x8F",
18276
- permissions: [],
18277
- dependencies: [],
18278
- is_core: true
18279
- },
18280
- {
18281
- id: "tinymce-plugin",
18282
- name: "tinymce-plugin",
18283
- display_name: "TinyMCE Rich Text Editor",
18284
- description: "Powerful WYSIWYG rich text editor for content creation. Provides a full-featured editor with formatting, media embedding, and customizable toolbars for richtext fields.",
18285
- version: "1.0.0",
18286
- author: "SonicJS Team",
18287
- category: "editor",
18288
- icon: "\xF0\x9F\x93\x9D",
18289
- permissions: [],
18290
- dependencies: [],
18291
- is_core: false
18292
- },
18293
- {
18294
- id: "easy-mdx",
18295
- name: "easy-mdx",
18296
- display_name: "EasyMDE Markdown Editor",
18297
- description: "Lightweight markdown editor with live preview. Provides a simple and efficient editor with markdown support for richtext fields.",
18298
- version: "1.0.0",
18299
- author: "SonicJS Team",
18300
- category: "editor",
18301
- icon: "\xF0\x9F\x93\x9D",
18302
- permissions: [],
18303
- dependencies: [],
18304
- is_core: false
18305
- },
18306
- {
18307
- id: "turnstile",
18308
- name: "turnstile-plugin",
18309
- display_name: "Cloudflare Turnstile",
18310
- description: "CAPTCHA-free bot protection for forms using Cloudflare Turnstile. Provides seamless spam prevention with configurable modes, themes, and pre-clearance options.",
18311
- version: "1.0.0",
18312
- author: "SonicJS Team",
18313
- category: "security",
18314
- icon: "\xF0\x9F\x9B\xA1\xEF\xB8\x8F",
18315
- permissions: [],
18316
- dependencies: [],
18317
- is_core: true
18318
- },
18319
- {
18320
- id: "security-audit",
18321
- name: "security-audit",
18322
- display_name: "Security Audit",
18323
- description: "Security event logging, brute-force detection, and analytics dashboard. Monitors login attempts, registrations, lockouts, and suspicious activity.",
18324
- version: "1.0.0-beta.1",
18325
- author: "SonicJS Team",
18326
- category: "security",
18327
- icon: "\xF0\x9F\x9B\xA1\xEF\xB8\x8F",
18328
- permissions: ["security-audit:view", "security-audit:manage"],
18329
- dependencies: [],
18330
- is_core: false
18331
- },
18332
- {
18333
- id: "ai-search",
18334
- name: "ai-search-plugin",
18335
- display_name: "AI Search",
18336
- description: "Advanced search with Cloudflare AI Search. Full-text search, semantic search, and advanced filtering across all content collections.",
18337
- version: "1.0.0",
18338
- author: "SonicJS Team",
18339
- category: "search",
18340
- icon: "\xF0\x9F\x94\x8D",
18341
- permissions: [],
18342
- dependencies: [],
18343
- is_core: true
18344
- },
18345
- {
18346
- id: "form-builder",
18347
- name: "form-builder",
18348
- display_name: "Form Builder",
18349
- description: "Drag-and-drop form builder with conditional logic, file uploads, and email notifications. Create contact forms, surveys, and data collection forms.",
18350
- version: "1.0.0",
18351
- author: "SonicJS Team",
18352
- category: "content",
18353
- icon: "\u{1F4DD}",
18354
- permissions: ["forms:create", "forms:manage", "forms:submissions"],
18355
- dependencies: [],
18356
- is_core: false
18357
- }
18358
- ];
18215
+ var AVAILABLE_PLUGINS = Object.values(PLUGIN_REGISTRY).map((p) => ({
18216
+ id: p.id,
18217
+ name: p.codeName,
18218
+ display_name: p.displayName,
18219
+ description: p.description,
18220
+ version: p.version,
18221
+ author: p.author,
18222
+ category: p.category,
18223
+ icon: p.iconEmoji,
18224
+ permissions: p.permissions,
18225
+ dependencies: p.dependencies,
18226
+ is_core: p.is_core
18227
+ }));
18359
18228
  adminPluginRoutes.get("/", async (c) => {
18360
18229
  try {
18361
18230
  const user = c.get("user");
@@ -18432,10 +18301,6 @@ adminPluginRoutes.get("/:id", async (c) => {
18432
18301
  const user = c.get("user");
18433
18302
  const db = c.env.DB;
18434
18303
  const pluginId = c.req.param("id");
18435
- const pluginsWithCustomPages = ["ai-search", "security-audit"];
18436
- if (pluginsWithCustomPages.includes(pluginId)) {
18437
- return c.text("", 404);
18438
- }
18439
18304
  if (user?.role !== "admin") {
18440
18305
  return c.redirect("/admin/plugins");
18441
18306
  }
@@ -18550,320 +18415,25 @@ adminPluginRoutes.post("/install", async (c) => {
18550
18415
  }
18551
18416
  const body = await c.req.json();
18552
18417
  const pluginService = new PluginService(db);
18553
- if (body.name === "faq-plugin") {
18554
- const faqPlugin = await pluginService.installPlugin({
18555
- id: "third-party-faq",
18556
- name: "faq-plugin",
18557
- display_name: "FAQ System",
18558
- description: "Frequently Asked Questions management system with categories, search, and custom styling",
18559
- version: "2.0.0",
18560
- author: "Community Developer",
18561
- category: "content",
18562
- icon: "\xE2\x9D\x93",
18563
- permissions: ["manage:faqs"],
18564
- dependencies: [],
18565
- settings: {
18566
- enableSearch: true,
18567
- enableCategories: true,
18568
- questionsPerPage: 10
18569
- }
18570
- });
18571
- return c.json({ success: true, plugin: faqPlugin });
18572
- }
18573
- if (body.name === "demo-login-plugin") {
18574
- const demoPlugin = await pluginService.installPlugin({
18575
- id: "demo-login-prefill",
18576
- name: "demo-login-plugin",
18577
- display_name: "Demo Login Prefill",
18578
- description: "Prefills login form with demo credentials (admin@sonicjs.com/sonicjs!) for easy site demonstration",
18579
- version: "1.0.0-beta.1",
18580
- author: "SonicJS",
18581
- category: "demo",
18582
- icon: "\xF0\x9F\x8E\xAF",
18583
- permissions: [],
18584
- dependencies: [],
18585
- settings: {
18586
- enableNotice: true,
18587
- demoEmail: "admin@sonicjs.com",
18588
- demoPassword: "sonicjs!"
18589
- }
18590
- });
18591
- return c.json({ success: true, plugin: demoPlugin });
18592
- }
18593
- if (body.name === "core-auth") {
18594
- const authPlugin = await pluginService.installPlugin({
18595
- id: "core-auth",
18596
- name: "core-auth",
18597
- display_name: "Authentication System",
18598
- description: "Core authentication and user management system",
18599
- version: "1.0.0-beta.1",
18600
- author: "SonicJS Team",
18601
- category: "security",
18602
- icon: "\xF0\x9F\x94\x90",
18603
- permissions: ["manage:users", "manage:roles", "manage:permissions"],
18604
- dependencies: [],
18605
- is_core: true,
18606
- settings: {}
18607
- });
18608
- return c.json({ success: true, plugin: authPlugin });
18609
- }
18610
- if (body.name === "core-media") {
18611
- const mediaPlugin = await pluginService.installPlugin({
18612
- id: "core-media",
18613
- name: "core-media",
18614
- display_name: "Media Manager",
18615
- description: "Core media upload and management system",
18616
- version: "1.0.0-beta.1",
18617
- author: "SonicJS Team",
18618
- category: "media",
18619
- icon: "\xF0\x9F\x93\xB8",
18620
- permissions: ["manage:media", "upload:files"],
18621
- dependencies: [],
18622
- is_core: true,
18623
- settings: {}
18624
- });
18625
- return c.json({ success: true, plugin: mediaPlugin });
18626
- }
18627
- if (body.name === "core-workflow") {
18628
- const workflowPlugin = await pluginService.installPlugin({
18629
- id: "core-workflow",
18630
- name: "core-workflow",
18631
- display_name: "Workflow Engine",
18632
- description: "Content workflow and approval system",
18633
- version: "1.0.0-beta.1",
18634
- author: "SonicJS Team",
18635
- category: "content",
18636
- icon: "\xF0\x9F\x94\x84",
18637
- permissions: ["manage:workflows", "approve:content"],
18638
- dependencies: [],
18639
- is_core: true,
18640
- settings: {}
18641
- });
18642
- return c.json({ success: true, plugin: workflowPlugin });
18643
- }
18644
- if (body.name === "database-tools") {
18645
- const databaseToolsPlugin = await pluginService.installPlugin({
18646
- id: "database-tools",
18647
- name: "database-tools",
18648
- display_name: "Database Tools",
18649
- description: "Database management tools including truncate, backup, and validation",
18650
- version: "1.0.0-beta.1",
18651
- author: "SonicJS Team",
18652
- category: "system",
18653
- icon: "\xF0\x9F\x97\x84\xEF\xB8\x8F",
18654
- permissions: ["manage:database", "admin"],
18655
- dependencies: [],
18656
- is_core: false,
18657
- settings: {
18658
- enableTruncate: true,
18659
- enableBackup: true,
18660
- enableValidation: true,
18661
- requireConfirmation: true
18662
- }
18663
- });
18664
- return c.json({ success: true, plugin: databaseToolsPlugin });
18665
- }
18666
- if (body.name === "seed-data") {
18667
- const seedDataPlugin = await pluginService.installPlugin({
18668
- id: "seed-data",
18669
- name: "seed-data",
18670
- display_name: "Seed Data",
18671
- description: "Generate realistic example users and content for testing and development",
18672
- version: "1.0.0-beta.1",
18673
- author: "SonicJS Team",
18674
- category: "development",
18675
- icon: "\xF0\x9F\x8C\xB1",
18676
- permissions: ["admin"],
18677
- dependencies: [],
18678
- is_core: false,
18679
- settings: {
18680
- userCount: 20,
18681
- contentCount: 200,
18682
- defaultPassword: "password123"
18683
- }
18684
- });
18685
- return c.json({ success: true, plugin: seedDataPlugin });
18686
- }
18687
- if (body.name === "quill-editor") {
18688
- const quillPlugin = await pluginService.installPlugin({
18689
- id: "quill-editor",
18690
- name: "quill-editor",
18691
- display_name: "Quill Rich Text Editor",
18692
- description: "Quill WYSIWYG editor integration for rich text editing. Lightweight, modern editor with customizable toolbars and dark mode support.",
18693
- version: "1.0.0",
18694
- author: "SonicJS Team",
18695
- category: "editor",
18696
- icon: "\xE2\x9C\x8D\xEF\xB8\x8F",
18697
- permissions: [],
18698
- dependencies: [],
18699
- is_core: true,
18700
- settings: {
18701
- version: "2.0.2",
18702
- defaultHeight: 300,
18703
- defaultToolbar: "full",
18704
- theme: "snow"
18705
- }
18706
- });
18707
- return c.json({ success: true, plugin: quillPlugin });
18708
- }
18709
- if (body.name === "tinymce-plugin") {
18710
- const tinymcePlugin2 = await pluginService.installPlugin({
18711
- id: "tinymce-plugin",
18712
- name: "tinymce-plugin",
18713
- display_name: "TinyMCE Rich Text Editor",
18714
- description: "Powerful WYSIWYG rich text editor for content creation. Provides a full-featured editor with formatting, media embedding, and customizable toolbars for richtext fields.",
18715
- version: "1.0.0",
18716
- author: "SonicJS Team",
18717
- category: "editor",
18718
- icon: "\xF0\x9F\x93\x9D",
18719
- permissions: [],
18720
- dependencies: [],
18721
- is_core: false,
18722
- settings: {
18723
- apiKey: "no-api-key",
18724
- defaultHeight: 300,
18725
- defaultToolbar: "full",
18726
- skin: "oxide-dark"
18727
- }
18728
- });
18729
- return c.json({ success: true, plugin: tinymcePlugin2 });
18730
- }
18731
- if (body.name === "easy-mdx") {
18732
- const easyMdxPlugin2 = await pluginService.installPlugin({
18733
- id: "easy-mdx",
18734
- name: "easy-mdx",
18735
- display_name: "EasyMDE Markdown Editor",
18736
- description: "Lightweight markdown editor with live preview. Provides a simple and efficient editor with markdown support for richtext fields.",
18737
- version: "1.0.0",
18738
- author: "SonicJS Team",
18739
- category: "editor",
18740
- icon: "\xF0\x9F\x93\x9D",
18741
- permissions: [],
18742
- dependencies: [],
18743
- is_core: false,
18744
- settings: {
18745
- defaultHeight: 400,
18746
- theme: "dark",
18747
- toolbar: "full",
18748
- placeholder: "Start writing your content..."
18749
- }
18750
- });
18751
- return c.json({ success: true, plugin: easyMdxPlugin2 });
18752
- }
18753
- if (body.name === "security-audit") {
18754
- const securityAuditPlugin = await pluginService.installPlugin({
18755
- id: "security-audit",
18756
- name: "security-audit",
18757
- display_name: "Security Audit",
18758
- description: "Security event logging, brute-force detection, and analytics dashboard. Monitors login attempts, registrations, lockouts, and suspicious activity.",
18759
- version: "1.0.0-beta.1",
18760
- author: "SonicJS Team",
18761
- category: "security",
18762
- icon: "\xF0\x9F\x9B\xA1\xEF\xB8\x8F",
18763
- permissions: ["security-audit:view", "security-audit:manage"],
18764
- dependencies: [],
18765
- is_core: false,
18766
- settings: {
18767
- retention: {
18768
- daysToKeep: 90,
18769
- maxEvents: 1e5,
18770
- autoPurge: true
18771
- },
18772
- bruteForce: {
18773
- enabled: true,
18774
- maxFailedAttemptsPerIP: 10,
18775
- maxFailedAttemptsPerEmail: 5,
18776
- windowMinutes: 15,
18777
- lockoutDurationMinutes: 30,
18778
- alertThreshold: 20
18779
- },
18780
- logging: {
18781
- logSuccessfulLogins: true,
18782
- logLogouts: true,
18783
- logRegistrations: true,
18784
- logPasswordResets: true,
18785
- logPermissionDenied: true
18786
- }
18787
- }
18788
- });
18789
- return c.json({ success: true, plugin: securityAuditPlugin });
18790
- }
18791
- if (body.name === "ai-search-plugin" || body.name === "ai-search") {
18792
- const defaultSettings = {
18793
- enabled: true,
18794
- ai_mode_enabled: true,
18795
- selected_collections: [],
18796
- dismissed_collections: [],
18797
- autocomplete_enabled: true,
18798
- cache_duration: 1,
18799
- results_limit: 20,
18800
- index_media: false
18801
- };
18802
- const aiSearchPlugin = await pluginService.installPlugin({
18803
- id: "ai-search",
18804
- name: "ai-search-plugin",
18805
- display_name: "AI Search",
18806
- description: "Advanced search with Cloudflare AI Search. Full-text search, semantic search, and advanced filtering across all content collections.",
18807
- version: "1.0.0",
18808
- author: "SonicJS Team",
18809
- category: "search",
18810
- icon: "\xF0\x9F\x94\x8D",
18811
- permissions: [],
18812
- dependencies: [],
18813
- is_core: true,
18814
- settings: defaultSettings
18815
- });
18816
- return c.json({ success: true, plugin: aiSearchPlugin });
18817
- }
18818
- if (body.name === "turnstile-plugin") {
18819
- const turnstilePlugin = await pluginService.installPlugin({
18820
- id: "turnstile",
18821
- name: "turnstile-plugin",
18822
- display_name: "Cloudflare Turnstile",
18823
- description: "CAPTCHA-free bot protection for forms using Cloudflare Turnstile. Provides seamless spam prevention with configurable modes, themes, and pre-clearance options.",
18824
- version: "1.0.0",
18825
- author: "SonicJS Team",
18826
- category: "security",
18827
- icon: "\xF0\x9F\x9B\xA1\xEF\xB8\x8F",
18828
- permissions: [],
18829
- dependencies: [],
18830
- is_core: true,
18831
- settings: {
18832
- siteKey: "",
18833
- secretKey: "",
18834
- theme: "auto",
18835
- size: "normal",
18836
- mode: "managed",
18837
- appearance: "always",
18838
- preClearanceEnabled: false,
18839
- preClearanceLevel: "managed",
18840
- enabled: false
18841
- }
18842
- });
18843
- return c.json({ success: true, plugin: turnstilePlugin });
18844
- }
18845
- if (body.name === "form-builder") {
18846
- const formBuilderPlugin = await pluginService.installPlugin({
18847
- id: "form-builder",
18848
- name: "form-builder",
18849
- display_name: "Form Builder",
18850
- description: "Drag-and-drop form builder with conditional logic, file uploads, and email notifications. Create contact forms, surveys, and data collection forms.",
18851
- version: "1.0.0",
18852
- author: "SonicJS Team",
18853
- category: "content",
18854
- icon: "\u{1F4DD}",
18855
- permissions: ["forms:create", "forms:manage", "forms:submissions"],
18856
- dependencies: [],
18857
- settings: {
18858
- enableNotifications: true,
18859
- enableFileUploads: true,
18860
- maxSubmissionsPerForm: 0,
18861
- submissionRetentionDays: 90
18862
- }
18863
- });
18864
- return c.json({ success: true, plugin: formBuilderPlugin });
18865
- }
18866
- return c.json({ error: "Plugin not found in registry" }, 404);
18418
+ const registryEntry = findPluginByCodeName(body.name) || PLUGIN_REGISTRY[body.name] || PLUGIN_REGISTRY[body.id];
18419
+ if (!registryEntry) {
18420
+ return c.json({ error: "Plugin not found in registry" }, 404);
18421
+ }
18422
+ const plugin = await pluginService.installPlugin({
18423
+ id: registryEntry.id,
18424
+ name: registryEntry.codeName,
18425
+ display_name: registryEntry.displayName,
18426
+ description: registryEntry.description,
18427
+ version: registryEntry.version,
18428
+ author: registryEntry.author,
18429
+ category: registryEntry.category,
18430
+ icon: registryEntry.iconEmoji,
18431
+ permissions: registryEntry.permissions,
18432
+ dependencies: registryEntry.dependencies,
18433
+ is_core: registryEntry.is_core,
18434
+ settings: registryEntry.defaultSettings
18435
+ });
18436
+ return c.json({ success: true, plugin });
18867
18437
  } catch (error) {
18868
18438
  console.error("Error installing plugin:", error);
18869
18439
  const message = error instanceof Error ? error.message : "Failed to install plugin";
@@ -29390,5 +28960,5 @@ var ROUTES_INFO = {
29390
28960
  };
29391
28961
 
29392
28962
  export { ROUTES_INFO, adminCheckboxRoutes, adminCollectionsRoutes, adminDesignRoutes, adminFormsRoutes, adminLogsRoutes, adminMediaRoutes, adminPluginRoutes, adminSettingsRoutes, admin_api_default, admin_code_examples_default, admin_content_default, admin_testimonials_default, api_content_crud_default, api_default, api_media_default, api_system_default, auth_default, createUserProfilesPlugin, defineUserProfile, getConfirmationDialogScript2 as getConfirmationDialogScript, getUserProfileConfig, public_forms_default, renderConfirmationDialog2 as renderConfirmationDialog, router, router2, test_cleanup_default, userProfilesPlugin, userRoutes };
29393
- //# sourceMappingURL=chunk-23DP6TO5.js.map
29394
- //# sourceMappingURL=chunk-23DP6TO5.js.map
28963
+ //# sourceMappingURL=chunk-7MMD5WMK.js.map
28964
+ //# sourceMappingURL=chunk-7MMD5WMK.js.map