@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
@@ -906,225 +906,737 @@ var PluginService = class {
906
906
  }
907
907
  };
908
908
 
909
- // src/services/plugin-bootstrap.ts
910
- var PluginBootstrapService = class {
911
- constructor(db) {
912
- this.db = db;
913
- this.pluginService = new PluginService(db);
914
- }
915
- pluginService;
916
- /**
917
- * Core plugins that should always be available in the system
918
- */
919
- CORE_PLUGINS = [
920
- {
921
- id: "core-auth",
922
- name: "core-auth",
923
- display_name: "Authentication System",
924
- description: "Core authentication and user management system",
925
- version: "1.0.0",
926
- author: "SonicJS Team",
927
- category: "security",
928
- icon: "\u{1F510}",
929
- permissions: ["manage:users", "manage:roles", "manage:permissions"],
930
- dependencies: [],
931
- settings: {
932
- requiredFields: {
933
- email: { required: true, minLength: 5, label: "Email", type: "email" },
934
- password: { required: true, minLength: 8, label: "Password", type: "password" },
935
- username: { required: true, minLength: 3, label: "Username", type: "text" },
936
- firstName: { required: true, minLength: 1, label: "First Name", type: "text" },
937
- lastName: { required: true, minLength: 1, label: "Last Name", type: "text" }
909
+ // src/plugins/manifest-registry.ts
910
+ var PLUGIN_REGISTRY = {
911
+ "ai-search": {
912
+ "id": "ai-search",
913
+ "codeName": "ai-search-plugin",
914
+ "displayName": "AI Search",
915
+ "description": "Advanced search with Cloudflare AI Search. Full-text search, semantic search, and advanced filtering across all content collections.",
916
+ "version": "1.0.0",
917
+ "author": "SonicJS",
918
+ "category": "content",
919
+ "iconEmoji": "\u{1F50D}",
920
+ "is_core": true,
921
+ "permissions": [
922
+ "settings:write",
923
+ "admin:access",
924
+ "content:read"
925
+ ],
926
+ "dependencies": [],
927
+ "defaultSettings": {
928
+ "enabled": true,
929
+ "ai_mode_enabled": true,
930
+ "selected_collections": [],
931
+ "dismissed_collections": [],
932
+ "autocomplete_enabled": true,
933
+ "cache_duration": 1,
934
+ "results_limit": 20,
935
+ "index_media": false
936
+ },
937
+ "adminMenu": {
938
+ "label": "AI Search",
939
+ "icon": "magnifying-glass",
940
+ "path": "/admin/plugins/ai-search",
941
+ "order": 50
942
+ }
943
+ },
944
+ "code-examples-plugin": {
945
+ "id": "code-examples-plugin",
946
+ "codeName": "code-examples-plugin",
947
+ "displayName": "Code Examples",
948
+ "description": "Code snippets and examples library with syntax highlighting and categorization",
949
+ "version": "1.0.0-beta.1",
950
+ "author": "SonicJS Team",
951
+ "category": "content",
952
+ "iconEmoji": "\u{1F4BB}",
953
+ "is_core": false,
954
+ "permissions": [
955
+ "code-examples:manage"
956
+ ],
957
+ "dependencies": [],
958
+ "defaultSettings": {},
959
+ "adminMenu": null
960
+ },
961
+ "core-analytics": {
962
+ "id": "core-analytics",
963
+ "codeName": "core-analytics",
964
+ "displayName": "Analytics & Insights",
965
+ "description": "Core analytics system for tracking page views, user behavior, and content performance. Provides dashboards and reports with real-time metrics",
966
+ "version": "1.0.0-beta.1",
967
+ "author": "SonicJS Team",
968
+ "category": "seo",
969
+ "iconEmoji": "\u{1F4CA}",
970
+ "is_core": true,
971
+ "permissions": [
972
+ "analytics:view",
973
+ "analytics:export"
974
+ ],
975
+ "dependencies": [],
976
+ "defaultSettings": {},
977
+ "adminMenu": {
978
+ "label": "Analytics",
979
+ "icon": "chart-bar",
980
+ "path": "/admin/analytics",
981
+ "order": 50
982
+ }
983
+ },
984
+ "core-auth": {
985
+ "id": "core-auth",
986
+ "codeName": "core-auth",
987
+ "displayName": "Authentication System",
988
+ "description": "Core authentication and user management system with role-based access control, session management, and security features",
989
+ "version": "1.0.0-beta.1",
990
+ "author": "SonicJS Team",
991
+ "category": "security",
992
+ "iconEmoji": "\u{1F510}",
993
+ "is_core": true,
994
+ "permissions": [
995
+ "manage:users",
996
+ "manage:roles",
997
+ "manage:permissions"
998
+ ],
999
+ "dependencies": [],
1000
+ "defaultSettings": {
1001
+ "requiredFields": {
1002
+ "email": {
1003
+ "required": true,
1004
+ "minLength": 5,
1005
+ "label": "Email",
1006
+ "type": "email"
938
1007
  },
939
- validation: {
940
- emailFormat: true,
941
- allowDuplicateUsernames: false,
942
- passwordRequirements: {
943
- requireUppercase: false,
944
- requireLowercase: false,
945
- requireNumbers: false,
946
- requireSpecialChars: false
947
- }
1008
+ "password": {
1009
+ "required": true,
1010
+ "minLength": 8,
1011
+ "label": "Password",
1012
+ "type": "password"
1013
+ },
1014
+ "username": {
1015
+ "required": true,
1016
+ "minLength": 3,
1017
+ "label": "Username",
1018
+ "type": "text"
948
1019
  },
949
- registration: {
950
- enabled: true,
951
- requireEmailVerification: false,
952
- defaultRole: "viewer"
1020
+ "firstName": {
1021
+ "required": true,
1022
+ "minLength": 1,
1023
+ "label": "First Name",
1024
+ "type": "text"
1025
+ },
1026
+ "lastName": {
1027
+ "required": true,
1028
+ "minLength": 1,
1029
+ "label": "Last Name",
1030
+ "type": "text"
1031
+ }
1032
+ },
1033
+ "validation": {
1034
+ "emailFormat": true,
1035
+ "allowDuplicateUsernames": false,
1036
+ "passwordRequirements": {
1037
+ "requireUppercase": false,
1038
+ "requireLowercase": false,
1039
+ "requireNumbers": false,
1040
+ "requireSpecialChars": false
953
1041
  }
1042
+ },
1043
+ "registration": {
1044
+ "enabled": true,
1045
+ "requireEmailVerification": false,
1046
+ "defaultRole": "viewer"
954
1047
  }
955
1048
  },
956
- {
957
- id: "core-media",
958
- name: "core-media",
959
- display_name: "Media Manager",
960
- description: "Core media upload and management system",
961
- version: "1.0.0",
962
- author: "SonicJS Team",
963
- category: "media",
964
- icon: "\u{1F4F8}",
965
- permissions: ["manage:media", "upload:files"],
966
- dependencies: [],
967
- settings: {}
1049
+ "adminMenu": null
1050
+ },
1051
+ "core-cache": {
1052
+ "id": "core-cache",
1053
+ "codeName": "core-cache",
1054
+ "displayName": "Cache System",
1055
+ "description": "Three-tiered caching system with in-memory and KV storage. Provides automatic caching for content, users, media, and API responses with configurable TTL and invalidation patterns.",
1056
+ "version": "1.0.0-beta.1",
1057
+ "author": "SonicJS",
1058
+ "category": "system",
1059
+ "iconEmoji": "\u26A1",
1060
+ "is_core": true,
1061
+ "permissions": [
1062
+ "cache.view",
1063
+ "cache.clear",
1064
+ "cache.invalidate"
1065
+ ],
1066
+ "dependencies": [],
1067
+ "defaultSettings": {
1068
+ "enableMemoryCache": true,
1069
+ "enableKVCache": true,
1070
+ "enableDatabaseCache": true,
1071
+ "defaultTTL": 3600
968
1072
  },
969
- {
970
- id: "database-tools",
971
- name: "database-tools",
972
- display_name: "Database Tools",
973
- description: "Database management tools including truncate, backup, and validation",
974
- version: "1.0.0",
975
- author: "SonicJS Team",
976
- category: "system",
977
- icon: "\u{1F5C4}\uFE0F",
978
- permissions: ["manage:database", "admin"],
979
- dependencies: [],
980
- settings: {
981
- enableTruncate: true,
982
- enableBackup: true,
983
- enableValidation: true,
984
- requireConfirmation: true
985
- }
1073
+ "adminMenu": null
1074
+ },
1075
+ "core-media": {
1076
+ "id": "core-media",
1077
+ "codeName": "core-media",
1078
+ "displayName": "Media Manager",
1079
+ "description": "Core media upload and management system with support for images, videos, and documents. Includes automatic optimization, thumbnail generation, and cloud storage integration",
1080
+ "version": "1.0.0-beta.1",
1081
+ "author": "SonicJS Team",
1082
+ "category": "media",
1083
+ "iconEmoji": "\u{1F4F8}",
1084
+ "is_core": true,
1085
+ "permissions": [
1086
+ "manage:media",
1087
+ "upload:files"
1088
+ ],
1089
+ "dependencies": [],
1090
+ "defaultSettings": {},
1091
+ "adminMenu": {
1092
+ "label": "Media",
1093
+ "icon": "image",
1094
+ "path": "/admin/media",
1095
+ "order": 30
1096
+ }
1097
+ },
1098
+ "database-tools": {
1099
+ "id": "database-tools",
1100
+ "codeName": "database-tools",
1101
+ "displayName": "Database Tools",
1102
+ "description": "Database management and administration tools including migrations, backups, and query execution",
1103
+ "version": "1.0.0-beta.1",
1104
+ "author": "SonicJS Team",
1105
+ "category": "development",
1106
+ "iconEmoji": "\u{1F5C4}\uFE0F",
1107
+ "is_core": false,
1108
+ "permissions": [
1109
+ "database:admin"
1110
+ ],
1111
+ "dependencies": [],
1112
+ "defaultSettings": {
1113
+ "enableTruncate": true,
1114
+ "enableBackup": true,
1115
+ "enableValidation": true,
1116
+ "requireConfirmation": true
986
1117
  },
987
- {
988
- id: "seed-data",
989
- name: "seed-data",
990
- display_name: "Seed Data",
991
- description: "Generate realistic example users and content for testing and development",
992
- version: "1.0.0",
993
- author: "SonicJS Team",
994
- category: "development",
995
- icon: "\u{1F331}",
996
- permissions: ["admin"],
997
- dependencies: [],
998
- settings: {
999
- userCount: 20,
1000
- contentCount: 200,
1001
- defaultPassword: "password123"
1002
- }
1118
+ "adminMenu": null
1119
+ },
1120
+ "demo-login-plugin": {
1121
+ "id": "demo-login-plugin",
1122
+ "codeName": "demo-login-plugin",
1123
+ "displayName": "Demo Login",
1124
+ "description": "Quick demo login functionality for testing and demonstrations",
1125
+ "version": "1.0.0-beta.1",
1126
+ "author": "SonicJS Team",
1127
+ "category": "utilities",
1128
+ "iconEmoji": "\u{1F3AF}",
1129
+ "is_core": false,
1130
+ "permissions": [],
1131
+ "dependencies": [
1132
+ "core-auth"
1133
+ ],
1134
+ "defaultSettings": {
1135
+ "enableNotice": true,
1136
+ "demoEmail": "admin@sonicjs.com",
1137
+ "demoPassword": "sonicjs!"
1003
1138
  },
1004
- {
1005
- id: "core-cache",
1006
- name: "core-cache",
1007
- display_name: "Cache System",
1008
- description: "Three-tiered caching system with memory, KV, and database layers",
1009
- version: "1.0.0",
1010
- author: "SonicJS Team",
1011
- category: "performance",
1012
- icon: "\u26A1",
1013
- permissions: ["manage:cache", "view:stats"],
1014
- dependencies: [],
1015
- settings: {
1016
- enableMemoryCache: true,
1017
- enableKVCache: true,
1018
- enableDatabaseCache: true,
1019
- defaultTTL: 3600
1020
- }
1139
+ "adminMenu": null
1140
+ },
1141
+ "design": {
1142
+ "id": "design",
1143
+ "codeName": "design",
1144
+ "displayName": "Design System",
1145
+ "description": "Design system management including themes, components, and UI customization. Provides a visual interface for managing design tokens, typography, colors, and component library.",
1146
+ "version": "1.0.0-beta.1",
1147
+ "author": "SonicJS",
1148
+ "category": "utilities",
1149
+ "iconEmoji": "\u{1F3A8}",
1150
+ "is_core": false,
1151
+ "permissions": [
1152
+ "design.view",
1153
+ "design.edit"
1154
+ ],
1155
+ "dependencies": [],
1156
+ "defaultSettings": {
1157
+ "defaultTheme": "light",
1158
+ "customCSS": ""
1021
1159
  },
1022
- {
1023
- id: "workflow-plugin",
1024
- name: "workflow-plugin",
1025
- display_name: "Workflow Management",
1026
- description: "Content workflow management with approval chains, scheduling, and automation",
1027
- version: "1.0.0-beta.1",
1028
- author: "SonicJS Team",
1029
- category: "content",
1030
- icon: "\u{1F504}",
1031
- permissions: ["manage:workflows", "view:workflows", "transition:content"],
1032
- dependencies: ["content-plugin"],
1033
- settings: {
1034
- enableApprovalChains: true,
1035
- enableScheduling: true,
1036
- enableAutomation: true,
1037
- enableNotifications: true
1038
- }
1160
+ "adminMenu": {
1161
+ "label": "Design",
1162
+ "icon": "palette",
1163
+ "path": "/admin/design",
1164
+ "order": 80
1165
+ }
1166
+ },
1167
+ "easy-mdx": {
1168
+ "id": "easy-mdx",
1169
+ "codeName": "easy-mdx",
1170
+ "displayName": "EasyMDE Markdown Editor",
1171
+ "description": "Lightweight markdown editor with live preview. Provides a simple and efficient editor with markdown support for richtext fields.",
1172
+ "version": "1.0.0",
1173
+ "author": "SonicJS Team",
1174
+ "category": "editor",
1175
+ "iconEmoji": "\u{1F4DD}",
1176
+ "is_core": false,
1177
+ "permissions": [],
1178
+ "dependencies": [],
1179
+ "defaultSettings": {
1180
+ "defaultHeight": 400,
1181
+ "theme": "dark",
1182
+ "toolbar": "full",
1183
+ "placeholder": "Start writing your content..."
1039
1184
  },
1040
- {
1041
- id: "easy-mdx",
1042
- name: "easy-mdx",
1043
- display_name: "EasyMDE Editor",
1044
- description: "Lightweight markdown editor with live preview for richtext fields",
1045
- version: "1.0.0",
1046
- author: "SonicJS Team",
1047
- category: "editor",
1048
- icon: "\u270D\uFE0F",
1049
- permissions: [],
1050
- dependencies: [],
1051
- settings: {
1052
- defaultHeight: 400,
1053
- toolbar: "full",
1054
- placeholder: "Start writing your content..."
1055
- }
1185
+ "adminMenu": null
1186
+ },
1187
+ "email": {
1188
+ "id": "email",
1189
+ "codeName": "email",
1190
+ "displayName": "Email",
1191
+ "description": "Send transactional emails using Resend",
1192
+ "version": "1.0.0-beta.1",
1193
+ "author": "SonicJS Team",
1194
+ "category": "utilities",
1195
+ "iconEmoji": "\u{1F4E7}",
1196
+ "is_core": false,
1197
+ "permissions": [
1198
+ "email:manage",
1199
+ "email:send",
1200
+ "email:view-logs"
1201
+ ],
1202
+ "dependencies": [],
1203
+ "defaultSettings": {
1204
+ "apiKey": "",
1205
+ "fromEmail": "",
1206
+ "fromName": "",
1207
+ "replyTo": "",
1208
+ "logoUrl": ""
1056
1209
  },
1057
- {
1058
- id: "ai-search",
1059
- name: "ai-search-plugin",
1060
- display_name: "AI Search",
1061
- description: "Advanced search with Cloudflare AI Search. Full-text search, semantic search, and advanced filtering across all content collections.",
1062
- version: "1.0.0",
1063
- author: "SonicJS Team",
1064
- category: "search",
1065
- icon: "\u{1F50D}",
1066
- permissions: ["settings:write", "admin:access", "content:read"],
1067
- dependencies: [],
1068
- settings: {
1069
- enabled: false,
1070
- ai_mode_enabled: true,
1071
- selected_collections: [],
1072
- dismissed_collections: [],
1073
- autocomplete_enabled: true,
1074
- cache_duration: 1,
1075
- results_limit: 20,
1076
- index_media: false
1077
- }
1210
+ "adminMenu": {
1211
+ "label": "Email",
1212
+ "icon": "envelope",
1213
+ "path": "/admin/plugins/email/settings",
1214
+ "order": 80
1215
+ }
1216
+ },
1217
+ "global-variables": {
1218
+ "id": "global-variables",
1219
+ "codeName": "global-variables",
1220
+ "displayName": "Global Variables",
1221
+ "description": "Dynamic content variables that can be referenced as inline tokens in rich text fields. Supports {variable_key} syntax with server-side resolution.",
1222
+ "version": "1.0.0-beta.1",
1223
+ "author": "SonicJS Team",
1224
+ "category": "content",
1225
+ "iconEmoji": "\u{1F524}",
1226
+ "is_core": false,
1227
+ "permissions": [
1228
+ "global-variables:manage",
1229
+ "global-variables:view"
1230
+ ],
1231
+ "dependencies": [],
1232
+ "defaultSettings": {
1233
+ "enableResolution": true,
1234
+ "cacheEnabled": true,
1235
+ "cacheTTL": 300
1236
+ },
1237
+ "adminMenu": null
1238
+ },
1239
+ "hello-world": {
1240
+ "id": "hello-world",
1241
+ "codeName": "hello-world",
1242
+ "displayName": "Hello World",
1243
+ "description": "A simple Hello World plugin demonstration",
1244
+ "version": "1.0.0-beta.1",
1245
+ "author": "SonicJS Team",
1246
+ "category": "utilities",
1247
+ "iconEmoji": "\u{1F44B}",
1248
+ "is_core": false,
1249
+ "permissions": [
1250
+ "hello-world:view"
1251
+ ],
1252
+ "dependencies": [],
1253
+ "defaultSettings": {},
1254
+ "adminMenu": {
1255
+ "label": "Hello World",
1256
+ "icon": "hand-raised",
1257
+ "path": "/admin/hello-world",
1258
+ "order": 90
1259
+ }
1260
+ },
1261
+ "magic-link-auth": {
1262
+ "id": "magic-link-auth",
1263
+ "codeName": "magic-link-auth",
1264
+ "displayName": "Magic Link Authentication",
1265
+ "description": "Passwordless authentication via email magic links. Users receive a secure one-time link to sign in without entering a password.",
1266
+ "version": "1.0.0",
1267
+ "author": "SonicJS Team",
1268
+ "category": "security",
1269
+ "iconEmoji": "\u{1F517}",
1270
+ "is_core": false,
1271
+ "permissions": [],
1272
+ "dependencies": [
1273
+ "email"
1274
+ ],
1275
+ "defaultSettings": {
1276
+ "linkExpiryMinutes": 15,
1277
+ "rateLimitPerHour": 5,
1278
+ "allowNewUsers": true
1078
1279
  },
1079
- {
1080
- id: "oauth-providers",
1081
- name: "oauth-providers",
1082
- display_name: "OAuth Providers",
1083
- description: "OAuth2/OIDC social login with GitHub, Google, and more",
1084
- version: "1.0.0-beta.1",
1085
- author: "SonicJS Team",
1086
- category: "authentication",
1087
- icon: "\u{1F511}",
1088
- permissions: ["oauth:manage"],
1089
- dependencies: [],
1090
- settings: {
1091
- providers: {
1092
- github: { clientId: "", clientSecret: "", enabled: false },
1093
- google: { clientId: "", clientSecret: "", enabled: false }
1280
+ "adminMenu": null
1281
+ },
1282
+ "oauth-providers": {
1283
+ "id": "oauth-providers",
1284
+ "codeName": "oauth-providers",
1285
+ "displayName": "OAuth Providers",
1286
+ "description": "OAuth2/OIDC social login with GitHub, Google, and more",
1287
+ "version": "1.0.0-beta.1",
1288
+ "author": "SonicJS Team",
1289
+ "category": "authentication",
1290
+ "iconEmoji": "\u{1F511}",
1291
+ "is_core": true,
1292
+ "permissions": [],
1293
+ "dependencies": [],
1294
+ "defaultSettings": {
1295
+ "providers": {
1296
+ "github": {
1297
+ "clientId": "",
1298
+ "clientSecret": "",
1299
+ "enabled": false
1300
+ },
1301
+ "google": {
1302
+ "clientId": "",
1303
+ "clientSecret": "",
1304
+ "enabled": false
1094
1305
  }
1095
1306
  }
1096
1307
  },
1097
- {
1098
- id: "global-variables",
1099
- name: "global-variables",
1100
- display_name: "Global Variables",
1101
- description: "Dynamic content variables with inline token support. Use {variable_key} syntax in rich text fields for server-side resolution.",
1102
- version: "1.0.0-beta.1",
1103
- author: "SonicJS Team",
1104
- category: "content",
1105
- icon: "\u{1F524}",
1106
- permissions: ["global-variables:manage", "global-variables:view"],
1107
- dependencies: [],
1108
- settings: {
1109
- enableResolution: true,
1110
- cacheEnabled: true,
1111
- cacheTTL: 300
1308
+ "adminMenu": null
1309
+ },
1310
+ "otp-login": {
1311
+ "id": "otp-login",
1312
+ "codeName": "otp-login",
1313
+ "displayName": "OTP Login",
1314
+ "description": "Passwordless authentication via email one-time codes",
1315
+ "version": "1.0.0-beta.1",
1316
+ "author": "SonicJS Team",
1317
+ "category": "security",
1318
+ "iconEmoji": "\u{1F522}",
1319
+ "is_core": false,
1320
+ "permissions": [
1321
+ "otp:manage",
1322
+ "otp:request",
1323
+ "otp:verify"
1324
+ ],
1325
+ "dependencies": [
1326
+ "email"
1327
+ ],
1328
+ "defaultSettings": {
1329
+ "codeLength": 6,
1330
+ "codeExpiryMinutes": 10,
1331
+ "maxAttempts": 3,
1332
+ "rateLimitPerHour": 5,
1333
+ "allowNewUserRegistration": false
1334
+ },
1335
+ "adminMenu": {
1336
+ "label": "OTP Login",
1337
+ "icon": "key",
1338
+ "path": "/admin/plugins/otp-login/settings",
1339
+ "order": 85
1340
+ }
1341
+ },
1342
+ "quill-editor": {
1343
+ "id": "quill-editor",
1344
+ "codeName": "quill-editor",
1345
+ "displayName": "Quill Rich Text Editor",
1346
+ "description": "Quill WYSIWYG editor integration for rich text editing. Lightweight, modern editor with customizable toolbars and dark mode support.",
1347
+ "version": "1.0.0",
1348
+ "author": "SonicJS Team",
1349
+ "category": "editor",
1350
+ "iconEmoji": "\u270D\uFE0F",
1351
+ "is_core": true,
1352
+ "permissions": [],
1353
+ "dependencies": [],
1354
+ "defaultSettings": {
1355
+ "version": "2.0.2",
1356
+ "defaultHeight": 300,
1357
+ "defaultToolbar": "full",
1358
+ "theme": "snow"
1359
+ },
1360
+ "adminMenu": null
1361
+ },
1362
+ "redirect-management": {
1363
+ "id": "redirect-management",
1364
+ "codeName": "redirect-management",
1365
+ "displayName": "Redirect Management",
1366
+ "description": "URL redirect management with exact, partial, and regex matching",
1367
+ "version": "1.0.0",
1368
+ "author": "ahaas",
1369
+ "category": "utilities",
1370
+ "iconEmoji": "\u21AA\uFE0F",
1371
+ "is_core": false,
1372
+ "permissions": [
1373
+ "redirect.manage",
1374
+ "redirect.view"
1375
+ ],
1376
+ "dependencies": [],
1377
+ "defaultSettings": {
1378
+ "enabled": true,
1379
+ "autoOffloadEnabled": false
1380
+ },
1381
+ "adminMenu": {
1382
+ "label": "Redirects",
1383
+ "icon": "arrow-right",
1384
+ "path": "/admin/redirects",
1385
+ "order": 85
1386
+ }
1387
+ },
1388
+ "security-audit": {
1389
+ "id": "security-audit",
1390
+ "codeName": "security-audit",
1391
+ "displayName": "Security Audit",
1392
+ "description": "Security event logging, brute-force detection, and analytics dashboard. Monitors login attempts, registrations, lockouts, and suspicious activity.",
1393
+ "version": "1.0.0-beta.1",
1394
+ "author": "SonicJS Team",
1395
+ "category": "security",
1396
+ "iconEmoji": "\u{1F6E1}\uFE0F",
1397
+ "is_core": false,
1398
+ "permissions": [
1399
+ "security-audit:view",
1400
+ "security-audit:manage"
1401
+ ],
1402
+ "dependencies": [],
1403
+ "defaultSettings": {
1404
+ "retention": {
1405
+ "daysToKeep": 90,
1406
+ "maxEvents": 1e5,
1407
+ "autoPurge": true
1408
+ },
1409
+ "bruteForce": {
1410
+ "enabled": true,
1411
+ "maxFailedAttemptsPerIP": 10,
1412
+ "maxFailedAttemptsPerEmail": 5,
1413
+ "windowMinutes": 15,
1414
+ "lockoutDurationMinutes": 30,
1415
+ "alertThreshold": 20
1416
+ },
1417
+ "logging": {
1418
+ "logSuccessfulLogins": true,
1419
+ "logLogouts": true,
1420
+ "logRegistrations": true,
1421
+ "logPasswordResets": true,
1422
+ "logPermissionDenied": true
1112
1423
  }
1113
1424
  },
1114
- {
1115
- id: "user-profiles",
1116
- name: "user-profiles",
1117
- display_name: "User Profiles",
1118
- description: "Configurable custom profile fields for users",
1119
- version: "1.0.0-beta.1",
1120
- author: "SonicJS Team",
1121
- category: "users",
1122
- icon: "\u{1F464}",
1123
- permissions: ["user-profiles:manage"],
1124
- dependencies: [],
1125
- settings: {}
1425
+ "adminMenu": {
1426
+ "label": "Security Audit",
1427
+ "icon": "shield-check",
1428
+ "path": "/admin/plugins/security-audit",
1429
+ "order": 85
1430
+ }
1431
+ },
1432
+ "seed-data": {
1433
+ "id": "seed-data",
1434
+ "codeName": "seed-data",
1435
+ "displayName": "Seed Data Generator",
1436
+ "description": "Development tool for generating sample data and testing content. Useful for demos and development environments",
1437
+ "version": "1.0.0-beta.1",
1438
+ "author": "SonicJS Team",
1439
+ "category": "development",
1440
+ "iconEmoji": "\u{1F331}",
1441
+ "is_core": false,
1442
+ "permissions": [
1443
+ "seed-data:generate"
1444
+ ],
1445
+ "dependencies": [],
1446
+ "defaultSettings": {
1447
+ "userCount": 20,
1448
+ "contentCount": 200,
1449
+ "defaultPassword": "password123"
1450
+ },
1451
+ "adminMenu": null
1452
+ },
1453
+ "stripe": {
1454
+ "id": "stripe",
1455
+ "codeName": "stripe",
1456
+ "displayName": "Stripe Subscriptions",
1457
+ "description": "Stripe subscription management with webhook handling, checkout sessions, and subscription gating",
1458
+ "version": "1.0.0-beta.1",
1459
+ "author": "SonicJS Team",
1460
+ "category": "payments",
1461
+ "iconEmoji": "\u{1F4B3}",
1462
+ "is_core": true,
1463
+ "permissions": [
1464
+ "stripe:manage",
1465
+ "stripe:view"
1466
+ ],
1467
+ "dependencies": [],
1468
+ "defaultSettings": {
1469
+ "stripeSecretKey": "",
1470
+ "stripeWebhookSecret": "",
1471
+ "stripePriceId": "",
1472
+ "successUrl": "/admin/dashboard",
1473
+ "cancelUrl": "/admin/dashboard"
1474
+ },
1475
+ "adminMenu": {
1476
+ "label": "Stripe",
1477
+ "icon": "credit-card",
1478
+ "path": "/admin/plugins/stripe",
1479
+ "order": 90
1126
1480
  }
1127
- ];
1481
+ },
1482
+ "testimonials-plugin": {
1483
+ "id": "testimonials-plugin",
1484
+ "codeName": "testimonials-plugin",
1485
+ "displayName": "Testimonials",
1486
+ "description": "Customer testimonials and reviews management with display widgets and ratings",
1487
+ "version": "1.0.0-beta.1",
1488
+ "author": "SonicJS Team",
1489
+ "category": "content",
1490
+ "iconEmoji": "\u{1F4AC}",
1491
+ "is_core": false,
1492
+ "permissions": [
1493
+ "testimonials:manage"
1494
+ ],
1495
+ "dependencies": [],
1496
+ "defaultSettings": {},
1497
+ "adminMenu": null
1498
+ },
1499
+ "tinymce-plugin": {
1500
+ "id": "tinymce-plugin",
1501
+ "codeName": "tinymce-plugin",
1502
+ "displayName": "TinyMCE Rich Text Editor",
1503
+ "description": "Powerful WYSIWYG rich text editor for content creation. Provides a full-featured editor with formatting, media embedding, and customizable toolbars for richtext fields.",
1504
+ "version": "1.0.0",
1505
+ "author": "SonicJS Team",
1506
+ "category": "editor",
1507
+ "iconEmoji": "\u{1F4DD}",
1508
+ "is_core": false,
1509
+ "permissions": [],
1510
+ "dependencies": [],
1511
+ "defaultSettings": {
1512
+ "apiKey": "no-api-key",
1513
+ "defaultHeight": 300,
1514
+ "defaultToolbar": "full",
1515
+ "skin": "oxide-dark"
1516
+ },
1517
+ "adminMenu": null
1518
+ },
1519
+ "turnstile": {
1520
+ "id": "turnstile",
1521
+ "codeName": "turnstile-plugin",
1522
+ "displayName": "Cloudflare Turnstile",
1523
+ "description": "CAPTCHA-free bot protection using Cloudflare Turnstile. Provides reusable verification for any form.",
1524
+ "version": "1.0.0",
1525
+ "author": "SonicJS",
1526
+ "category": "security",
1527
+ "iconEmoji": "\u{1F6E1}\uFE0F",
1528
+ "is_core": true,
1529
+ "permissions": [
1530
+ "settings:write",
1531
+ "admin:access"
1532
+ ],
1533
+ "dependencies": [],
1534
+ "defaultSettings": {
1535
+ "siteKey": "",
1536
+ "secretKey": "",
1537
+ "theme": "auto",
1538
+ "size": "normal",
1539
+ "mode": "managed",
1540
+ "appearance": "always",
1541
+ "preClearanceEnabled": false,
1542
+ "preClearanceLevel": "managed",
1543
+ "enabled": false
1544
+ },
1545
+ "adminMenu": {
1546
+ "label": "Turnstile",
1547
+ "icon": "shield-check",
1548
+ "path": "/admin/plugins/turnstile/settings",
1549
+ "order": 100
1550
+ }
1551
+ },
1552
+ "user-profiles": {
1553
+ "id": "user-profiles",
1554
+ "codeName": "user-profiles",
1555
+ "displayName": "User Profiles",
1556
+ "description": "Configurable custom profile fields for users",
1557
+ "version": "1.0.0-beta.1",
1558
+ "author": "SonicJS Team",
1559
+ "category": "users",
1560
+ "iconEmoji": "\u{1F464}",
1561
+ "is_core": true,
1562
+ "permissions": [],
1563
+ "dependencies": [],
1564
+ "defaultSettings": {},
1565
+ "adminMenu": null
1566
+ },
1567
+ "workflow-plugin": {
1568
+ "id": "workflow-plugin",
1569
+ "codeName": "workflow-plugin",
1570
+ "displayName": "Workflow Engine",
1571
+ "description": "Content workflow and approval system with customizable states, transitions, and review processes",
1572
+ "version": "1.0.0-beta.1",
1573
+ "author": "SonicJS Team",
1574
+ "category": "content",
1575
+ "iconEmoji": "\u{1F504}",
1576
+ "is_core": false,
1577
+ "permissions": [
1578
+ "workflow:manage",
1579
+ "workflow:approve"
1580
+ ],
1581
+ "dependencies": [],
1582
+ "defaultSettings": {
1583
+ "enableApprovalChains": true,
1584
+ "enableScheduling": true,
1585
+ "enableAutomation": true,
1586
+ "enableNotifications": true
1587
+ },
1588
+ "adminMenu": null
1589
+ }
1590
+ };
1591
+ var ALL_PLUGIN_IDS = Object.keys(PLUGIN_REGISTRY);
1592
+ ALL_PLUGIN_IDS.filter(
1593
+ (id) => PLUGIN_REGISTRY[id]?.adminMenu !== null
1594
+ );
1595
+ function findPluginByCodeName(codeName) {
1596
+ return Object.values(PLUGIN_REGISTRY).find((p) => p.codeName === codeName) || PLUGIN_REGISTRY[codeName];
1597
+ }
1598
+
1599
+ // src/services/plugin-bootstrap.ts
1600
+ var BOOTSTRAP_PLUGIN_IDS = [
1601
+ "core-auth",
1602
+ "core-media",
1603
+ "database-tools",
1604
+ "seed-data",
1605
+ "core-cache",
1606
+ "workflow-plugin",
1607
+ "easy-mdx",
1608
+ "ai-search",
1609
+ "oauth-providers",
1610
+ "global-variables",
1611
+ "user-profiles",
1612
+ "stripe"
1613
+ ];
1614
+ function registryToCorePlugin(entry) {
1615
+ return {
1616
+ id: entry.id,
1617
+ name: entry.codeName,
1618
+ display_name: entry.displayName,
1619
+ description: entry.description,
1620
+ version: entry.version,
1621
+ author: entry.author,
1622
+ category: entry.category,
1623
+ icon: entry.iconEmoji,
1624
+ permissions: entry.permissions,
1625
+ dependencies: entry.dependencies,
1626
+ settings: entry.defaultSettings
1627
+ };
1628
+ }
1629
+ var PluginBootstrapService = class {
1630
+ constructor(db) {
1631
+ this.db = db;
1632
+ this.pluginService = new PluginService(db);
1633
+ }
1634
+ pluginService;
1635
+ /**
1636
+ * Core plugins derived from the auto-generated plugin registry.
1637
+ * Only plugins listed in BOOTSTRAP_PLUGIN_IDS are included.
1638
+ */
1639
+ CORE_PLUGINS = BOOTSTRAP_PLUGIN_IDS.filter((id) => PLUGIN_REGISTRY[id] !== void 0).map((id) => registryToCorePlugin(PLUGIN_REGISTRY[id]));
1128
1640
  /**
1129
1641
  * Bootstrap all core plugins - install them if they don't exist
1130
1642
  */
@@ -1172,12 +1684,10 @@ var PluginBootstrapService = class {
1172
1684
  ...plugin,
1173
1685
  is_core: plugin.name.startsWith("core-")
1174
1686
  });
1175
- if (plugin.name.startsWith("core-")) {
1176
- console.log(
1177
- `[PluginBootstrap] Activating newly installed core plugin: ${plugin.display_name}`
1178
- );
1179
- await this.pluginService.activatePlugin(plugin.id);
1180
- }
1687
+ console.log(
1688
+ `[PluginBootstrap] Activating newly installed plugin: ${plugin.display_name}`
1689
+ );
1690
+ await this.pluginService.activatePlugin(plugin.id);
1181
1691
  }
1182
1692
  } catch (error) {
1183
1693
  console.error(
@@ -1192,8 +1702,8 @@ var PluginBootstrapService = class {
1192
1702
  async updatePlugin(plugin) {
1193
1703
  const now = Math.floor(Date.now() / 1e3);
1194
1704
  const stmt = this.db.prepare(`
1195
- UPDATE plugins
1196
- SET
1705
+ UPDATE plugins
1706
+ SET
1197
1707
  version = ?,
1198
1708
  description = ?,
1199
1709
  permissions = ?,
@@ -1234,6 +1744,6 @@ var PluginBootstrapService = class {
1234
1744
  }
1235
1745
  };
1236
1746
 
1237
- export { PluginBootstrapService, PluginService, backfillFormSubmissions, cleanupRemovedCollections, createContentFromSubmission, deriveCollectionSchemaFromFormio, deriveSubmissionTitle, fullCollectionSync, getAvailableCollectionNames, getManagedCollections, isCollectionManaged, loadCollectionConfig, loadCollectionConfigs, mapFormStatusToContentStatus, registerCollections, syncAllFormCollections, syncCollection, syncCollections, syncFormCollection, validateCollectionConfig };
1238
- //# sourceMappingURL=chunk-H3XXBAMO.js.map
1239
- //# sourceMappingURL=chunk-H3XXBAMO.js.map
1747
+ export { PLUGIN_REGISTRY, PluginBootstrapService, PluginService, backfillFormSubmissions, cleanupRemovedCollections, createContentFromSubmission, deriveCollectionSchemaFromFormio, deriveSubmissionTitle, findPluginByCodeName, fullCollectionSync, getAvailableCollectionNames, getManagedCollections, isCollectionManaged, loadCollectionConfig, loadCollectionConfigs, mapFormStatusToContentStatus, registerCollections, syncAllFormCollections, syncCollection, syncCollections, syncFormCollection, validateCollectionConfig };
1748
+ //# sourceMappingURL=chunk-G7XSN72O.js.map
1749
+ //# sourceMappingURL=chunk-G7XSN72O.js.map