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