@sonicjs-cms/core 2.13.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 (83) 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-HVTSE2SF.cjs → chunk-26HYU7MX.cjs} +233 -660
  6. package/dist/chunk-26HYU7MX.cjs.map +1 -0
  7. package/dist/{chunk-DB2GJJTM.js → chunk-2BL2A62D.js} +4 -4
  8. package/dist/{chunk-DB2GJJTM.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-3VAKUFNQ.js → chunk-5SOFMH66.js} +22 -5
  16. package/dist/chunk-5SOFMH66.js.map +1 -0
  17. package/dist/{chunk-6FHNRRJ3.cjs → chunk-635JAMSE.cjs} +76 -17
  18. package/dist/chunk-635JAMSE.cjs.map +1 -0
  19. package/dist/{chunk-IYFSNRZN.js → chunk-7MMD5WMK.js} +49 -476
  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-CO4B5EYF.js → chunk-EWXV2KG2.js} +3 -3
  24. package/dist/{chunk-CO4B5EYF.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-SER23XI4.cjs → chunk-RVD7PLMU.cjs} +22 -5
  34. package/dist/chunk-RVD7PLMU.cjs.map +1 -0
  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-EGUDIX6Q.cjs → chunk-UFPT5KCQ.cjs} +8 -8
  38. package/dist/{chunk-EGUDIX6Q.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-XCP5GCBE.cjs → chunk-VUISYUHY.cjs} +3 -3
  42. package/dist/{chunk-XCP5GCBE.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 +1604 -173
  46. package/dist/index.cjs.map +1 -1
  47. package/dist/index.d.cts +2 -2
  48. package/dist/index.d.ts +2 -2
  49. package/dist/index.js +1461 -30
  50. package/dist/index.js.map +1 -1
  51. package/dist/middleware.cjs +29 -29
  52. package/dist/middleware.js +3 -3
  53. package/dist/migrations-APFGYCB6.cjs +13 -0
  54. package/dist/{migrations-GMHTJI7D.cjs.map → migrations-APFGYCB6.cjs.map} +1 -1
  55. package/dist/migrations-YB52SLW7.js +4 -0
  56. package/dist/{migrations-IVFIDOSO.js.map → migrations-YB52SLW7.js.map} +1 -1
  57. package/dist/{plugin-bootstrap-DVGLQrcO.d.cts → plugin-bootstrap-DfVerYV4.d.cts} +3 -1
  58. package/dist/{plugin-bootstrap-CZ1GDum7.d.ts → plugin-bootstrap-P_ciLp_C.d.ts} +3 -1
  59. package/dist/plugins.cjs +11 -11
  60. package/dist/plugins.js +2 -2
  61. package/dist/routes.cjs +31 -30
  62. package/dist/routes.js +8 -7
  63. package/dist/services.cjs +23 -23
  64. package/dist/services.d.cts +1 -1
  65. package/dist/services.d.ts +1 -1
  66. package/dist/services.js +2 -2
  67. package/dist/templates.cjs +26 -25
  68. package/dist/templates.js +3 -2
  69. package/dist/utils.cjs +11 -11
  70. package/dist/utils.js +1 -1
  71. package/package.json +1 -1
  72. package/dist/chunk-3VAKUFNQ.js.map +0 -1
  73. package/dist/chunk-6FHNRRJ3.cjs.map +0 -1
  74. package/dist/chunk-H3XXBAMO.js.map +0 -1
  75. package/dist/chunk-HVTSE2SF.cjs.map +0 -1
  76. package/dist/chunk-I6FFGQIT.cjs.map +0 -1
  77. package/dist/chunk-IYFSNRZN.js.map +0 -1
  78. package/dist/chunk-J5WGMRSU.js.map +0 -1
  79. package/dist/chunk-JTUCC6WZ.js.map +0 -1
  80. package/dist/chunk-QP3OHHON.cjs.map +0 -1
  81. package/dist/chunk-SER23XI4.cjs.map +0 -1
  82. package/dist/migrations-GMHTJI7D.cjs +0 -13
  83. package/dist/migrations-IVFIDOSO.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-DB2GJJTM.js';
3
- import { PluginService, createContentFromSubmission } from './chunk-H3XXBAMO.js';
4
- import { MigrationService } from './chunk-3VAKUFNQ.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-CO4B5EYF.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-IVFIDOSO.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,26 +2376,29 @@ 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-IVFIDOSO.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();
2382
2383
  return c.json({
2383
2384
  success: result.success,
2384
2385
  message: result.message,
2385
- applied: result.applied
2386
+ applied: result.applied,
2387
+ errors: result.errors
2386
2388
  });
2387
2389
  } catch (error) {
2388
2390
  console.error("Error running migrations:", error);
2391
+ const errorMessage = error instanceof Error ? error.message : String(error);
2389
2392
  return c.json({
2390
2393
  success: false,
2391
- error: "Failed to run migrations"
2394
+ error: `Failed to run migrations: ${errorMessage}`,
2395
+ errors: [errorMessage]
2392
2396
  }, 500);
2393
2397
  }
2394
2398
  });
2395
2399
  adminApiRoutes.get("/migrations/validate", async (c) => {
2396
2400
  try {
2397
- const { MigrationService: MigrationService2 } = await import('./migrations-IVFIDOSO.js');
2401
+ const { MigrationService: MigrationService2 } = await import('./migrations-YB52SLW7.js');
2398
2402
  const db = c.env.DB;
2399
2403
  const migrationService = new MigrationService2(db);
2400
2404
  const validation = await migrationService.validateSchema();
@@ -18208,151 +18212,19 @@ function renderEmailSettingsContent(plugin, settings) {
18208
18212
  // src/routes/admin-plugins.ts
18209
18213
  var adminPluginRoutes = new Hono();
18210
18214
  adminPluginRoutes.use("*", requireAuth());
18211
- var AVAILABLE_PLUGINS = [
18212
- {
18213
- id: "third-party-faq",
18214
- name: "faq-plugin",
18215
- display_name: "FAQ System",
18216
- description: "Frequently Asked Questions management system with categories, search, and custom styling",
18217
- version: "2.0.0",
18218
- author: "Community Developer",
18219
- category: "content",
18220
- icon: "\xE2\x9D\x93",
18221
- permissions: ["manage:faqs"],
18222
- dependencies: [],
18223
- is_core: false
18224
- },
18225
- {
18226
- id: "demo-login-prefill",
18227
- name: "demo-login-plugin",
18228
- display_name: "Demo Login Prefill",
18229
- description: "Prefills login form with demo credentials (admin@sonicjs.com/sonicjs!) for easy site demonstration",
18230
- version: "1.0.0-beta.1",
18231
- author: "SonicJS",
18232
- category: "demo",
18233
- icon: "\xF0\x9F\x8E\xAF",
18234
- permissions: [],
18235
- dependencies: [],
18236
- is_core: false
18237
- },
18238
- {
18239
- id: "database-tools",
18240
- name: "database-tools",
18241
- display_name: "Database Tools",
18242
- description: "Database management tools including truncate, backup, and validation",
18243
- version: "1.0.0-beta.1",
18244
- author: "SonicJS Team",
18245
- category: "system",
18246
- icon: "\xF0\x9F\x97\x84\xEF\xB8\x8F",
18247
- permissions: ["manage:database", "admin"],
18248
- dependencies: [],
18249
- is_core: false
18250
- },
18251
- {
18252
- id: "seed-data",
18253
- name: "seed-data",
18254
- display_name: "Seed Data",
18255
- description: "Generate realistic example users and content for testing and development",
18256
- version: "1.0.0-beta.1",
18257
- author: "SonicJS Team",
18258
- category: "development",
18259
- icon: "\xF0\x9F\x8C\xB1",
18260
- permissions: ["admin"],
18261
- dependencies: [],
18262
- is_core: false
18263
- },
18264
- {
18265
- id: "quill-editor",
18266
- name: "quill-editor",
18267
- display_name: "Quill Rich Text Editor",
18268
- description: "Quill WYSIWYG editor integration for rich text editing. Lightweight, modern editor with customizable toolbars and dark mode support.",
18269
- version: "1.0.0",
18270
- author: "SonicJS Team",
18271
- category: "editor",
18272
- icon: "\xE2\x9C\x8D\xEF\xB8\x8F",
18273
- permissions: [],
18274
- dependencies: [],
18275
- is_core: true
18276
- },
18277
- {
18278
- id: "tinymce-plugin",
18279
- name: "tinymce-plugin",
18280
- display_name: "TinyMCE Rich Text Editor",
18281
- description: "Powerful WYSIWYG rich text editor for content creation. Provides a full-featured editor with formatting, media embedding, and customizable toolbars for richtext fields.",
18282
- version: "1.0.0",
18283
- author: "SonicJS Team",
18284
- category: "editor",
18285
- icon: "\xF0\x9F\x93\x9D",
18286
- permissions: [],
18287
- dependencies: [],
18288
- is_core: false
18289
- },
18290
- {
18291
- id: "easy-mdx",
18292
- name: "easy-mdx",
18293
- display_name: "EasyMDE Markdown Editor",
18294
- description: "Lightweight markdown editor with live preview. Provides a simple and efficient editor with markdown support for richtext fields.",
18295
- version: "1.0.0",
18296
- author: "SonicJS Team",
18297
- category: "editor",
18298
- icon: "\xF0\x9F\x93\x9D",
18299
- permissions: [],
18300
- dependencies: [],
18301
- is_core: false
18302
- },
18303
- {
18304
- id: "turnstile",
18305
- name: "turnstile-plugin",
18306
- display_name: "Cloudflare Turnstile",
18307
- description: "CAPTCHA-free bot protection for forms using Cloudflare Turnstile. Provides seamless spam prevention with configurable modes, themes, and pre-clearance options.",
18308
- version: "1.0.0",
18309
- author: "SonicJS Team",
18310
- category: "security",
18311
- icon: "\xF0\x9F\x9B\xA1\xEF\xB8\x8F",
18312
- permissions: [],
18313
- dependencies: [],
18314
- is_core: true
18315
- },
18316
- {
18317
- id: "security-audit",
18318
- name: "security-audit",
18319
- display_name: "Security Audit",
18320
- description: "Security event logging, brute-force detection, and analytics dashboard. Monitors login attempts, registrations, lockouts, and suspicious activity.",
18321
- version: "1.0.0-beta.1",
18322
- author: "SonicJS Team",
18323
- category: "security",
18324
- icon: "\xF0\x9F\x9B\xA1\xEF\xB8\x8F",
18325
- permissions: ["security-audit:view", "security-audit:manage"],
18326
- dependencies: [],
18327
- is_core: false
18328
- },
18329
- {
18330
- id: "ai-search",
18331
- name: "ai-search-plugin",
18332
- display_name: "AI Search",
18333
- description: "Advanced search with Cloudflare AI Search. Full-text search, semantic search, and advanced filtering across all content collections.",
18334
- version: "1.0.0",
18335
- author: "SonicJS Team",
18336
- category: "search",
18337
- icon: "\xF0\x9F\x94\x8D",
18338
- permissions: [],
18339
- dependencies: [],
18340
- is_core: true
18341
- },
18342
- {
18343
- id: "form-builder",
18344
- name: "form-builder",
18345
- display_name: "Form Builder",
18346
- description: "Drag-and-drop form builder with conditional logic, file uploads, and email notifications. Create contact forms, surveys, and data collection forms.",
18347
- version: "1.0.0",
18348
- author: "SonicJS Team",
18349
- category: "content",
18350
- icon: "\u{1F4DD}",
18351
- permissions: ["forms:create", "forms:manage", "forms:submissions"],
18352
- dependencies: [],
18353
- is_core: false
18354
- }
18355
- ];
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
+ }));
18356
18228
  adminPluginRoutes.get("/", async (c) => {
18357
18229
  try {
18358
18230
  const user = c.get("user");
@@ -18429,10 +18301,6 @@ adminPluginRoutes.get("/:id", async (c) => {
18429
18301
  const user = c.get("user");
18430
18302
  const db = c.env.DB;
18431
18303
  const pluginId = c.req.param("id");
18432
- const pluginsWithCustomPages = ["ai-search", "security-audit"];
18433
- if (pluginsWithCustomPages.includes(pluginId)) {
18434
- return c.text("", 404);
18435
- }
18436
18304
  if (user?.role !== "admin") {
18437
18305
  return c.redirect("/admin/plugins");
18438
18306
  }
@@ -18547,320 +18415,25 @@ adminPluginRoutes.post("/install", async (c) => {
18547
18415
  }
18548
18416
  const body = await c.req.json();
18549
18417
  const pluginService = new PluginService(db);
18550
- if (body.name === "faq-plugin") {
18551
- const faqPlugin = await pluginService.installPlugin({
18552
- id: "third-party-faq",
18553
- name: "faq-plugin",
18554
- display_name: "FAQ System",
18555
- description: "Frequently Asked Questions management system with categories, search, and custom styling",
18556
- version: "2.0.0",
18557
- author: "Community Developer",
18558
- category: "content",
18559
- icon: "\xE2\x9D\x93",
18560
- permissions: ["manage:faqs"],
18561
- dependencies: [],
18562
- settings: {
18563
- enableSearch: true,
18564
- enableCategories: true,
18565
- questionsPerPage: 10
18566
- }
18567
- });
18568
- return c.json({ success: true, plugin: faqPlugin });
18569
- }
18570
- if (body.name === "demo-login-plugin") {
18571
- const demoPlugin = await pluginService.installPlugin({
18572
- id: "demo-login-prefill",
18573
- name: "demo-login-plugin",
18574
- display_name: "Demo Login Prefill",
18575
- description: "Prefills login form with demo credentials (admin@sonicjs.com/sonicjs!) for easy site demonstration",
18576
- version: "1.0.0-beta.1",
18577
- author: "SonicJS",
18578
- category: "demo",
18579
- icon: "\xF0\x9F\x8E\xAF",
18580
- permissions: [],
18581
- dependencies: [],
18582
- settings: {
18583
- enableNotice: true,
18584
- demoEmail: "admin@sonicjs.com",
18585
- demoPassword: "sonicjs!"
18586
- }
18587
- });
18588
- return c.json({ success: true, plugin: demoPlugin });
18589
- }
18590
- if (body.name === "core-auth") {
18591
- const authPlugin = await pluginService.installPlugin({
18592
- id: "core-auth",
18593
- name: "core-auth",
18594
- display_name: "Authentication System",
18595
- description: "Core authentication and user management system",
18596
- version: "1.0.0-beta.1",
18597
- author: "SonicJS Team",
18598
- category: "security",
18599
- icon: "\xF0\x9F\x94\x90",
18600
- permissions: ["manage:users", "manage:roles", "manage:permissions"],
18601
- dependencies: [],
18602
- is_core: true,
18603
- settings: {}
18604
- });
18605
- return c.json({ success: true, plugin: authPlugin });
18606
- }
18607
- if (body.name === "core-media") {
18608
- const mediaPlugin = await pluginService.installPlugin({
18609
- id: "core-media",
18610
- name: "core-media",
18611
- display_name: "Media Manager",
18612
- description: "Core media upload and management system",
18613
- version: "1.0.0-beta.1",
18614
- author: "SonicJS Team",
18615
- category: "media",
18616
- icon: "\xF0\x9F\x93\xB8",
18617
- permissions: ["manage:media", "upload:files"],
18618
- dependencies: [],
18619
- is_core: true,
18620
- settings: {}
18621
- });
18622
- return c.json({ success: true, plugin: mediaPlugin });
18623
- }
18624
- if (body.name === "core-workflow") {
18625
- const workflowPlugin = await pluginService.installPlugin({
18626
- id: "core-workflow",
18627
- name: "core-workflow",
18628
- display_name: "Workflow Engine",
18629
- description: "Content workflow and approval system",
18630
- version: "1.0.0-beta.1",
18631
- author: "SonicJS Team",
18632
- category: "content",
18633
- icon: "\xF0\x9F\x94\x84",
18634
- permissions: ["manage:workflows", "approve:content"],
18635
- dependencies: [],
18636
- is_core: true,
18637
- settings: {}
18638
- });
18639
- return c.json({ success: true, plugin: workflowPlugin });
18640
- }
18641
- if (body.name === "database-tools") {
18642
- const databaseToolsPlugin = await pluginService.installPlugin({
18643
- id: "database-tools",
18644
- name: "database-tools",
18645
- display_name: "Database Tools",
18646
- description: "Database management tools including truncate, backup, and validation",
18647
- version: "1.0.0-beta.1",
18648
- author: "SonicJS Team",
18649
- category: "system",
18650
- icon: "\xF0\x9F\x97\x84\xEF\xB8\x8F",
18651
- permissions: ["manage:database", "admin"],
18652
- dependencies: [],
18653
- is_core: false,
18654
- settings: {
18655
- enableTruncate: true,
18656
- enableBackup: true,
18657
- enableValidation: true,
18658
- requireConfirmation: true
18659
- }
18660
- });
18661
- return c.json({ success: true, plugin: databaseToolsPlugin });
18662
- }
18663
- if (body.name === "seed-data") {
18664
- const seedDataPlugin = await pluginService.installPlugin({
18665
- id: "seed-data",
18666
- name: "seed-data",
18667
- display_name: "Seed Data",
18668
- description: "Generate realistic example users and content for testing and development",
18669
- version: "1.0.0-beta.1",
18670
- author: "SonicJS Team",
18671
- category: "development",
18672
- icon: "\xF0\x9F\x8C\xB1",
18673
- permissions: ["admin"],
18674
- dependencies: [],
18675
- is_core: false,
18676
- settings: {
18677
- userCount: 20,
18678
- contentCount: 200,
18679
- defaultPassword: "password123"
18680
- }
18681
- });
18682
- return c.json({ success: true, plugin: seedDataPlugin });
18683
- }
18684
- if (body.name === "quill-editor") {
18685
- const quillPlugin = await pluginService.installPlugin({
18686
- id: "quill-editor",
18687
- name: "quill-editor",
18688
- display_name: "Quill Rich Text Editor",
18689
- description: "Quill WYSIWYG editor integration for rich text editing. Lightweight, modern editor with customizable toolbars and dark mode support.",
18690
- version: "1.0.0",
18691
- author: "SonicJS Team",
18692
- category: "editor",
18693
- icon: "\xE2\x9C\x8D\xEF\xB8\x8F",
18694
- permissions: [],
18695
- dependencies: [],
18696
- is_core: true,
18697
- settings: {
18698
- version: "2.0.2",
18699
- defaultHeight: 300,
18700
- defaultToolbar: "full",
18701
- theme: "snow"
18702
- }
18703
- });
18704
- return c.json({ success: true, plugin: quillPlugin });
18705
- }
18706
- if (body.name === "tinymce-plugin") {
18707
- const tinymcePlugin2 = await pluginService.installPlugin({
18708
- id: "tinymce-plugin",
18709
- name: "tinymce-plugin",
18710
- display_name: "TinyMCE Rich Text Editor",
18711
- description: "Powerful WYSIWYG rich text editor for content creation. Provides a full-featured editor with formatting, media embedding, and customizable toolbars for richtext fields.",
18712
- version: "1.0.0",
18713
- author: "SonicJS Team",
18714
- category: "editor",
18715
- icon: "\xF0\x9F\x93\x9D",
18716
- permissions: [],
18717
- dependencies: [],
18718
- is_core: false,
18719
- settings: {
18720
- apiKey: "no-api-key",
18721
- defaultHeight: 300,
18722
- defaultToolbar: "full",
18723
- skin: "oxide-dark"
18724
- }
18725
- });
18726
- return c.json({ success: true, plugin: tinymcePlugin2 });
18727
- }
18728
- if (body.name === "easy-mdx") {
18729
- const easyMdxPlugin2 = await pluginService.installPlugin({
18730
- id: "easy-mdx",
18731
- name: "easy-mdx",
18732
- display_name: "EasyMDE Markdown Editor",
18733
- description: "Lightweight markdown editor with live preview. Provides a simple and efficient editor with markdown support for richtext fields.",
18734
- version: "1.0.0",
18735
- author: "SonicJS Team",
18736
- category: "editor",
18737
- icon: "\xF0\x9F\x93\x9D",
18738
- permissions: [],
18739
- dependencies: [],
18740
- is_core: false,
18741
- settings: {
18742
- defaultHeight: 400,
18743
- theme: "dark",
18744
- toolbar: "full",
18745
- placeholder: "Start writing your content..."
18746
- }
18747
- });
18748
- return c.json({ success: true, plugin: easyMdxPlugin2 });
18749
- }
18750
- if (body.name === "security-audit") {
18751
- const securityAuditPlugin = await pluginService.installPlugin({
18752
- id: "security-audit",
18753
- name: "security-audit",
18754
- display_name: "Security Audit",
18755
- description: "Security event logging, brute-force detection, and analytics dashboard. Monitors login attempts, registrations, lockouts, and suspicious activity.",
18756
- version: "1.0.0-beta.1",
18757
- author: "SonicJS Team",
18758
- category: "security",
18759
- icon: "\xF0\x9F\x9B\xA1\xEF\xB8\x8F",
18760
- permissions: ["security-audit:view", "security-audit:manage"],
18761
- dependencies: [],
18762
- is_core: false,
18763
- settings: {
18764
- retention: {
18765
- daysToKeep: 90,
18766
- maxEvents: 1e5,
18767
- autoPurge: true
18768
- },
18769
- bruteForce: {
18770
- enabled: true,
18771
- maxFailedAttemptsPerIP: 10,
18772
- maxFailedAttemptsPerEmail: 5,
18773
- windowMinutes: 15,
18774
- lockoutDurationMinutes: 30,
18775
- alertThreshold: 20
18776
- },
18777
- logging: {
18778
- logSuccessfulLogins: true,
18779
- logLogouts: true,
18780
- logRegistrations: true,
18781
- logPasswordResets: true,
18782
- logPermissionDenied: true
18783
- }
18784
- }
18785
- });
18786
- return c.json({ success: true, plugin: securityAuditPlugin });
18787
- }
18788
- if (body.name === "ai-search-plugin" || body.name === "ai-search") {
18789
- const defaultSettings = {
18790
- enabled: true,
18791
- ai_mode_enabled: true,
18792
- selected_collections: [],
18793
- dismissed_collections: [],
18794
- autocomplete_enabled: true,
18795
- cache_duration: 1,
18796
- results_limit: 20,
18797
- index_media: false
18798
- };
18799
- const aiSearchPlugin = await pluginService.installPlugin({
18800
- id: "ai-search",
18801
- name: "ai-search-plugin",
18802
- display_name: "AI Search",
18803
- description: "Advanced search with Cloudflare AI Search. Full-text search, semantic search, and advanced filtering across all content collections.",
18804
- version: "1.0.0",
18805
- author: "SonicJS Team",
18806
- category: "search",
18807
- icon: "\xF0\x9F\x94\x8D",
18808
- permissions: [],
18809
- dependencies: [],
18810
- is_core: true,
18811
- settings: defaultSettings
18812
- });
18813
- return c.json({ success: true, plugin: aiSearchPlugin });
18814
- }
18815
- if (body.name === "turnstile-plugin") {
18816
- const turnstilePlugin = await pluginService.installPlugin({
18817
- id: "turnstile",
18818
- name: "turnstile-plugin",
18819
- display_name: "Cloudflare Turnstile",
18820
- description: "CAPTCHA-free bot protection for forms using Cloudflare Turnstile. Provides seamless spam prevention with configurable modes, themes, and pre-clearance options.",
18821
- version: "1.0.0",
18822
- author: "SonicJS Team",
18823
- category: "security",
18824
- icon: "\xF0\x9F\x9B\xA1\xEF\xB8\x8F",
18825
- permissions: [],
18826
- dependencies: [],
18827
- is_core: true,
18828
- settings: {
18829
- siteKey: "",
18830
- secretKey: "",
18831
- theme: "auto",
18832
- size: "normal",
18833
- mode: "managed",
18834
- appearance: "always",
18835
- preClearanceEnabled: false,
18836
- preClearanceLevel: "managed",
18837
- enabled: false
18838
- }
18839
- });
18840
- return c.json({ success: true, plugin: turnstilePlugin });
18841
- }
18842
- if (body.name === "form-builder") {
18843
- const formBuilderPlugin = await pluginService.installPlugin({
18844
- id: "form-builder",
18845
- name: "form-builder",
18846
- display_name: "Form Builder",
18847
- description: "Drag-and-drop form builder with conditional logic, file uploads, and email notifications. Create contact forms, surveys, and data collection forms.",
18848
- version: "1.0.0",
18849
- author: "SonicJS Team",
18850
- category: "content",
18851
- icon: "\u{1F4DD}",
18852
- permissions: ["forms:create", "forms:manage", "forms:submissions"],
18853
- dependencies: [],
18854
- settings: {
18855
- enableNotifications: true,
18856
- enableFileUploads: true,
18857
- maxSubmissionsPerForm: 0,
18858
- submissionRetentionDays: 90
18859
- }
18860
- });
18861
- return c.json({ success: true, plugin: formBuilderPlugin });
18862
- }
18863
- 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 });
18864
18437
  } catch (error) {
18865
18438
  console.error("Error installing plugin:", error);
18866
18439
  const message = error instanceof Error ? error.message : "Failed to install plugin";
@@ -29387,5 +28960,5 @@ var ROUTES_INFO = {
29387
28960
  };
29388
28961
 
29389
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 };
29390
- //# sourceMappingURL=chunk-IYFSNRZN.js.map
29391
- //# sourceMappingURL=chunk-IYFSNRZN.js.map
28963
+ //# sourceMappingURL=chunk-7MMD5WMK.js.map
28964
+ //# sourceMappingURL=chunk-7MMD5WMK.js.map