@sonicjs-cms/core 2.18.1 → 3.0.0-beta.2

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 (225) hide show
  1. package/README.md +4 -3
  2. package/dist/admin-documents-form.template-KN7JF66Q.cjs +19 -0
  3. package/dist/{admin-layout-catalyst.template-UMTIN66R.js.map → admin-documents-form.template-KN7JF66Q.cjs.map} +1 -1
  4. package/dist/admin-documents-form.template-NLSI6Z42.js +6 -0
  5. package/dist/{admin-layout-catalyst.template-HFD37TY5.cjs.map → admin-documents-form.template-NLSI6Z42.js.map} +1 -1
  6. package/dist/admin-layout-catalyst.template-WHJGSWWD.js +7 -0
  7. package/dist/admin-layout-catalyst.template-WHJGSWWD.js.map +1 -0
  8. package/dist/admin-layout-catalyst.template-ZK5HD545.cjs +17 -0
  9. package/dist/admin-layout-catalyst.template-ZK5HD545.cjs.map +1 -0
  10. package/dist/app-Bo0X1OWX.d.ts +1268 -0
  11. package/dist/app-Do66yCcV.d.cts +1268 -0
  12. package/dist/cache-DDARE4QE.js +4 -0
  13. package/dist/cache-DDARE4QE.js.map +1 -0
  14. package/dist/cache-LVYS4BPL.cjs +33 -0
  15. package/dist/cache-LVYS4BPL.cjs.map +1 -0
  16. package/dist/chunk-2CB4KY7I.cjs +771 -0
  17. package/dist/chunk-2CB4KY7I.cjs.map +1 -0
  18. package/dist/{chunk-55RDMDOP.js → chunk-3TB6AT6X.js} +148 -55
  19. package/dist/chunk-3TB6AT6X.js.map +1 -0
  20. package/dist/{chunk-ON5ZMSU4.js → chunk-6JQOUUOB.js} +3 -3
  21. package/dist/chunk-6JQOUUOB.js.map +1 -0
  22. package/dist/chunk-6OUHGKFD.js +387 -0
  23. package/dist/chunk-6OUHGKFD.js.map +1 -0
  24. package/dist/{chunk-DSUJ5YQH.cjs → chunk-AAWNRBRB.cjs} +537 -92
  25. package/dist/chunk-AAWNRBRB.cjs.map +1 -0
  26. package/dist/chunk-AI663NBO.js +821 -0
  27. package/dist/chunk-AI663NBO.js.map +1 -0
  28. package/dist/chunk-BDDABDAB.cjs +1149 -0
  29. package/dist/chunk-BDDABDAB.cjs.map +1 -0
  30. package/dist/chunk-BLMTL57B.js +767 -0
  31. package/dist/chunk-BLMTL57B.js.map +1 -0
  32. package/dist/chunk-DNQCEKUK.cjs +327 -0
  33. package/dist/chunk-DNQCEKUK.cjs.map +1 -0
  34. package/dist/chunk-DSA4UX5B.cjs +276 -0
  35. package/dist/chunk-DSA4UX5B.cjs.map +1 -0
  36. package/dist/chunk-EF2NQUIQ.js +323 -0
  37. package/dist/chunk-EF2NQUIQ.js.map +1 -0
  38. package/dist/chunk-GCDZZNIN.js +192 -0
  39. package/dist/chunk-GCDZZNIN.js.map +1 -0
  40. package/dist/{chunk-ABB34XUS.cjs → chunk-H2AXVCLS.cjs} +667 -19
  41. package/dist/chunk-H2AXVCLS.cjs.map +1 -0
  42. package/dist/{chunk-XWIA3HVX.js → chunk-HDWE5FRJ.js} +6 -1249
  43. package/dist/chunk-HDWE5FRJ.js.map +1 -0
  44. package/dist/chunk-HIKBY7MS.cjs +70 -0
  45. package/dist/chunk-HIKBY7MS.cjs.map +1 -0
  46. package/dist/chunk-IESEVHXL.js +66 -0
  47. package/dist/chunk-IESEVHXL.js.map +1 -0
  48. package/dist/chunk-IVPRUGTY.js +242 -0
  49. package/dist/chunk-IVPRUGTY.js.map +1 -0
  50. package/dist/{chunk-SQ6FNXU2.cjs → chunk-IXUHXTHW.cjs} +2 -151
  51. package/dist/chunk-IXUHXTHW.cjs.map +1 -0
  52. package/dist/chunk-J6JTWD2A.cjs +100 -0
  53. package/dist/chunk-J6JTWD2A.cjs.map +1 -0
  54. package/dist/chunk-JEQ7FLOD.cjs +199 -0
  55. package/dist/chunk-JEQ7FLOD.cjs.map +1 -0
  56. package/dist/chunk-K25XHMM3.js +566 -0
  57. package/dist/chunk-K25XHMM3.js.map +1 -0
  58. package/dist/chunk-LRZIAW7U.cjs +158 -0
  59. package/dist/chunk-LRZIAW7U.cjs.map +1 -0
  60. package/dist/{chunk-OHYBNCVL.cjs → chunk-MVIZJOO5.cjs} +10 -1256
  61. package/dist/chunk-MVIZJOO5.cjs.map +1 -0
  62. package/dist/{chunk-UYJ6TJHX.cjs → chunk-NAVPFIG5.cjs} +148 -55
  63. package/dist/chunk-NAVPFIG5.cjs.map +1 -0
  64. package/dist/chunk-NLJVSER2.js +273 -0
  65. package/dist/chunk-NLJVSER2.js.map +1 -0
  66. package/dist/chunk-NMPEMSU4.js +154 -0
  67. package/dist/chunk-NMPEMSU4.js.map +1 -0
  68. package/dist/chunk-NUKJ54GA.cjs +245 -0
  69. package/dist/chunk-NUKJ54GA.cjs.map +1 -0
  70. package/dist/{chunk-T3Q5V33G.cjs → chunk-QAYFOER6.cjs} +621 -829
  71. package/dist/chunk-QAYFOER6.cjs.map +1 -0
  72. package/dist/{chunk-MGFRZO24.js → chunk-QZGABF2M.js} +3 -149
  73. package/dist/chunk-QZGABF2M.js.map +1 -0
  74. package/dist/chunk-RNZFGN4R.js +88 -0
  75. package/dist/chunk-RNZFGN4R.js.map +1 -0
  76. package/dist/chunk-RZ6H7OZK.js +1134 -0
  77. package/dist/chunk-RZ6H7OZK.js.map +1 -0
  78. package/dist/{chunk-XXDFQERJ.js → chunk-VD2EA3WT.js} +7192 -9806
  79. package/dist/chunk-VD2EA3WT.js.map +1 -0
  80. package/dist/{chunk-SXXTQETM.cjs → chunk-VXE42MYF.cjs} +8722 -11323
  81. package/dist/chunk-VXE42MYF.cjs.map +1 -0
  82. package/dist/{chunk-4ZSNJDLS.cjs → chunk-WULONYGB.cjs} +9 -9
  83. package/dist/chunk-WULONYGB.cjs.map +1 -0
  84. package/dist/chunk-XW56B23A.cjs +408 -0
  85. package/dist/chunk-XW56B23A.cjs.map +1 -0
  86. package/dist/chunk-YA3TJ65D.cjs +575 -0
  87. package/dist/chunk-YA3TJ65D.cjs.map +1 -0
  88. package/dist/{chunk-TFNTM3OA.js → chunk-YHSQVQXX.js} +645 -15
  89. package/dist/chunk-YHSQVQXX.js.map +1 -0
  90. package/dist/chunk-YP7GW2G5.cjs +866 -0
  91. package/dist/chunk-YP7GW2G5.cjs.map +1 -0
  92. package/dist/{chunk-QFWHAFEO.js → chunk-ZEZ245PW.js} +148 -858
  93. package/dist/chunk-ZEZ245PW.js.map +1 -0
  94. package/dist/{chunk-EW5NOBVU.js → chunk-ZGGXCFR6.js} +611 -817
  95. package/dist/chunk-ZGGXCFR6.js.map +1 -0
  96. package/dist/{collection-config-B4PG-AaF.d.cts → collection-config-JgHOpFCG.d.cts} +30 -2
  97. package/dist/{collection-config-B4PG-AaF.d.ts → collection-config-JgHOpFCG.d.ts} +30 -2
  98. package/dist/config-HFXANXCC.js +6 -0
  99. package/dist/config-HFXANXCC.js.map +1 -0
  100. package/dist/config-ON6FNMYX.cjs +19 -0
  101. package/dist/config-ON6FNMYX.cjs.map +1 -0
  102. package/dist/define-plugin-BzNHc1ZI.d.ts +1321 -0
  103. package/dist/define-plugin-IWDKYaVm.d.cts +1321 -0
  104. package/dist/document-projection-TDWRJX3Z.cjs +13 -0
  105. package/dist/document-projection-TDWRJX3Z.cjs.map +1 -0
  106. package/dist/document-projection-YYMC6I4U.js +4 -0
  107. package/dist/document-projection-YYMC6I4U.js.map +1 -0
  108. package/dist/index.cjs +13735 -4329
  109. package/dist/index.cjs.map +1 -1
  110. package/dist/index.d.cts +329 -492
  111. package/dist/index.d.ts +329 -492
  112. package/dist/index.js +13386 -3999
  113. package/dist/index.js.map +1 -1
  114. package/dist/middleware.cjs +36 -32
  115. package/dist/middleware.d.cts +69 -7
  116. package/dist/middleware.d.ts +69 -7
  117. package/dist/middleware.js +7 -3
  118. package/dist/migrations-NJJWQUKK.cjs +13 -0
  119. package/dist/{migrations-IYNTWDC6.cjs.map → migrations-NJJWQUKK.cjs.map} +1 -1
  120. package/dist/migrations-WCAVBD7C.js +4 -0
  121. package/dist/{migrations-R337UD46.js.map → migrations-WCAVBD7C.js.map} +1 -1
  122. package/dist/{plugin-bootstrap-DfVerYV4.d.cts → plugin-bootstrap-B8ThJU21.d.cts} +4315 -1661
  123. package/dist/{plugin-bootstrap-P_ciLp_C.d.ts → plugin-bootstrap-qu8hJgUt.d.ts} +4315 -1661
  124. package/dist/plugins.cjs +171 -12
  125. package/dist/plugins.d.cts +36 -2
  126. package/dist/plugins.d.ts +36 -2
  127. package/dist/plugins.js +5 -2
  128. package/dist/rbac-O73MFKDA.js +5 -0
  129. package/dist/rbac-O73MFKDA.js.map +1 -0
  130. package/dist/rbac-VONLJJKB.cjs +14 -0
  131. package/dist/rbac-VONLJJKB.cjs.map +1 -0
  132. package/dist/routes.cjs +41 -45
  133. package/dist/routes.d.cts +56 -146
  134. package/dist/routes.d.ts +56 -146
  135. package/dist/routes.js +17 -9
  136. package/dist/services.cjs +39 -72
  137. package/dist/services.d.cts +79 -54
  138. package/dist/services.d.ts +79 -54
  139. package/dist/services.js +6 -3
  140. package/dist/templates.cjs +17 -29
  141. package/dist/templates.d.cts +1 -66
  142. package/dist/templates.d.ts +1 -66
  143. package/dist/templates.js +3 -3
  144. package/dist/types-Dea1eNxU.d.cts +286 -0
  145. package/dist/types-Dea1eNxU.d.ts +286 -0
  146. package/dist/types.d.cts +1 -1
  147. package/dist/types.d.ts +1 -1
  148. package/dist/utils.cjs +18 -17
  149. package/dist/utils.d.cts +1 -1
  150. package/dist/utils.d.ts +1 -1
  151. package/dist/utils.js +2 -1
  152. package/migrations/0001_core.sql +184 -0
  153. package/migrations/0002_documents.sql +163 -0
  154. package/package.json +12 -7
  155. package/dist/admin-layout-catalyst.template-HFD37TY5.cjs +0 -17
  156. package/dist/admin-layout-catalyst.template-UMTIN66R.js +0 -7
  157. package/dist/app-C9esKLmh.d.cts +0 -112
  158. package/dist/app-C9esKLmh.d.ts +0 -112
  159. package/dist/chunk-4R3NOOL3.js +0 -2217
  160. package/dist/chunk-4R3NOOL3.js.map +0 -1
  161. package/dist/chunk-4ZSNJDLS.cjs.map +0 -1
  162. package/dist/chunk-55RDMDOP.js.map +0 -1
  163. package/dist/chunk-635JAMSE.cjs +0 -653
  164. package/dist/chunk-635JAMSE.cjs.map +0 -1
  165. package/dist/chunk-ABB34XUS.cjs.map +0 -1
  166. package/dist/chunk-C54YUA23.cjs +0 -2219
  167. package/dist/chunk-C54YUA23.cjs.map +0 -1
  168. package/dist/chunk-DSUJ5YQH.cjs.map +0 -1
  169. package/dist/chunk-EW5NOBVU.js.map +0 -1
  170. package/dist/chunk-EXNEW5US.js +0 -648
  171. package/dist/chunk-EXNEW5US.js.map +0 -1
  172. package/dist/chunk-I2H5NGJQ.js +0 -692
  173. package/dist/chunk-I2H5NGJQ.js.map +0 -1
  174. package/dist/chunk-MGFRZO24.js.map +0 -1
  175. package/dist/chunk-OHYBNCVL.cjs.map +0 -1
  176. package/dist/chunk-ON5ZMSU4.js.map +0 -1
  177. package/dist/chunk-QFWHAFEO.js.map +0 -1
  178. package/dist/chunk-SQ6FNXU2.cjs.map +0 -1
  179. package/dist/chunk-SXXTQETM.cjs.map +0 -1
  180. package/dist/chunk-T3Q5V33G.cjs.map +0 -1
  181. package/dist/chunk-TFNTM3OA.js.map +0 -1
  182. package/dist/chunk-UYJ6TJHX.cjs.map +0 -1
  183. package/dist/chunk-WAEQXGCX.cjs +0 -1898
  184. package/dist/chunk-WAEQXGCX.cjs.map +0 -1
  185. package/dist/chunk-XWIA3HVX.js.map +0 -1
  186. package/dist/chunk-XXDFQERJ.js.map +0 -1
  187. package/dist/migrations-IYNTWDC6.cjs +0 -13
  188. package/dist/migrations-R337UD46.js +0 -4
  189. package/dist/plugin-manager-BoM3Q7o7.d.cts +0 -328
  190. package/dist/plugin-manager-Efx9RyDX.d.ts +0 -328
  191. package/migrations/001_initial_schema.sql +0 -170
  192. package/migrations/002_faq_plugin.sql +0 -86
  193. package/migrations/003_stage5_enhancements.sql +0 -121
  194. package/migrations/004_stage6_user_management.sql +0 -183
  195. package/migrations/005_stage7_workflow_automation.sql +0 -294
  196. package/migrations/006_plugin_system.sql +0 -155
  197. package/migrations/007_demo_login_plugin.sql +0 -23
  198. package/migrations/008_fix_slug_validation.sql +0 -22
  199. package/migrations/009_system_logging.sql +0 -57
  200. package/migrations/011_config_managed_collections.sql +0 -15
  201. package/migrations/012_testimonials_plugin.sql +0 -80
  202. package/migrations/013_code_examples_plugin.sql +0 -177
  203. package/migrations/014_fix_plugin_registry.sql +0 -88
  204. package/migrations/015_add_remaining_plugins.sql +0 -89
  205. package/migrations/016_remove_duplicate_cache_plugin.sql +0 -17
  206. package/migrations/017_auth_configurable_fields.sql +0 -49
  207. package/migrations/018_settings_table.sql +0 -23
  208. package/migrations/019_remove_blog_posts_collection.sql +0 -15
  209. package/migrations/020_add_email_plugin.sql +0 -22
  210. package/migrations/021_add_magic_link_auth_plugin.sql +0 -42
  211. package/migrations/022_add_tinymce_plugin.sql +0 -25
  212. package/migrations/023_add_easy_mdx_plugin.sql +0 -25
  213. package/migrations/024_add_quill_editor_plugin.sql +0 -25
  214. package/migrations/025_add_easymde_plugin.sql +0 -25
  215. package/migrations/026_add_otp_login.sql +0 -42
  216. package/migrations/027_fix_slug_field_type.sql +0 -18
  217. package/migrations/028_fix_slug_field_type_in_schemas.sql +0 -30
  218. package/migrations/029_add_forms_system.sql +0 -184
  219. package/migrations/030_add_turnstile_to_forms.sql +0 -14
  220. package/migrations/031_ai_search_plugin.sql +0 -45
  221. package/migrations/032_user_profiles.sql +0 -37
  222. package/migrations/033_form_content_integration.sql +0 -19
  223. package/migrations/034_security_audit_plugin.sql +0 -27
  224. package/migrations/035_user_profiles_data_column.sql +0 -16
  225. package/migrations/036_analytics_events.sql +0 -22
@@ -1,128 +1,132 @@
1
1
  'use strict';
2
2
 
3
- var chunkDSUJ5YQH_cjs = require('./chunk-DSUJ5YQH.cjs');
4
- require('./chunk-T3Q5V33G.cjs');
5
- require('./chunk-C54YUA23.cjs');
3
+ var chunkAAWNRBRB_cjs = require('./chunk-AAWNRBRB.cjs');
4
+ require('./chunk-2CB4KY7I.cjs');
5
+ require('./chunk-JEQ7FLOD.cjs');
6
+ require('./chunk-QAYFOER6.cjs');
7
+ require('./chunk-DSA4UX5B.cjs');
8
+ require('./chunk-J6JTWD2A.cjs');
6
9
  require('./chunk-RCQ2HIQD.cjs');
10
+ require('./chunk-MNWKYY5E.cjs');
7
11
  require('./chunk-IGJUBJBW.cjs');
8
12
 
9
13
 
10
14
 
11
15
  Object.defineProperty(exports, "AuthManager", {
12
16
  enumerable: true,
13
- get: function () { return chunkDSUJ5YQH_cjs.AuthManager; }
17
+ get: function () { return chunkAAWNRBRB_cjs.AuthManager; }
14
18
  });
15
19
  Object.defineProperty(exports, "PermissionManager", {
16
20
  enumerable: true,
17
- get: function () { return chunkDSUJ5YQH_cjs.PermissionManager; }
21
+ get: function () { return chunkAAWNRBRB_cjs.PermissionManager; }
18
22
  });
19
23
  Object.defineProperty(exports, "bootstrapMiddleware", {
20
24
  enumerable: true,
21
- get: function () { return chunkDSUJ5YQH_cjs.bootstrapMiddleware; }
25
+ get: function () { return chunkAAWNRBRB_cjs.bootstrapMiddleware; }
22
26
  });
23
27
  Object.defineProperty(exports, "cacheHeaders", {
24
28
  enumerable: true,
25
- get: function () { return chunkDSUJ5YQH_cjs.cacheHeaders; }
29
+ get: function () { return chunkAAWNRBRB_cjs.cacheHeaders; }
26
30
  });
27
31
  Object.defineProperty(exports, "compressionMiddleware", {
28
32
  enumerable: true,
29
- get: function () { return chunkDSUJ5YQH_cjs.compressionMiddleware; }
33
+ get: function () { return chunkAAWNRBRB_cjs.compressionMiddleware; }
30
34
  });
31
35
  Object.defineProperty(exports, "csrfProtection", {
32
36
  enumerable: true,
33
- get: function () { return chunkDSUJ5YQH_cjs.csrfProtection; }
37
+ get: function () { return chunkAAWNRBRB_cjs.csrfProtection; }
34
38
  });
35
39
  Object.defineProperty(exports, "detailedLoggingMiddleware", {
36
40
  enumerable: true,
37
- get: function () { return chunkDSUJ5YQH_cjs.detailedLoggingMiddleware; }
41
+ get: function () { return chunkAAWNRBRB_cjs.detailedLoggingMiddleware; }
38
42
  });
39
43
  Object.defineProperty(exports, "generateCsrfToken", {
40
44
  enumerable: true,
41
- get: function () { return chunkDSUJ5YQH_cjs.generateCsrfToken; }
45
+ get: function () { return chunkAAWNRBRB_cjs.generateCsrfToken; }
42
46
  });
43
47
  Object.defineProperty(exports, "getActivePlugins", {
44
48
  enumerable: true,
45
- get: function () { return chunkDSUJ5YQH_cjs.getActivePlugins; }
49
+ get: function () { return chunkAAWNRBRB_cjs.getActivePlugins; }
46
50
  });
47
51
  Object.defineProperty(exports, "getJwtExpirySeconds", {
48
52
  enumerable: true,
49
- get: function () { return chunkDSUJ5YQH_cjs.getJwtExpirySeconds; }
53
+ get: function () { return chunkAAWNRBRB_cjs.getJwtExpirySeconds; }
50
54
  });
51
55
  Object.defineProperty(exports, "getJwtExpirySecondsFromDb", {
52
56
  enumerable: true,
53
- get: function () { return chunkDSUJ5YQH_cjs.getJwtExpirySecondsFromDb; }
57
+ get: function () { return chunkAAWNRBRB_cjs.getJwtExpirySecondsFromDb; }
54
58
  });
55
59
  Object.defineProperty(exports, "getJwtRefreshGraceSecondsFromDb", {
56
60
  enumerable: true,
57
- get: function () { return chunkDSUJ5YQH_cjs.getJwtRefreshGraceSecondsFromDb; }
61
+ get: function () { return chunkAAWNRBRB_cjs.getJwtRefreshGraceSecondsFromDb; }
58
62
  });
59
63
  Object.defineProperty(exports, "isPluginActive", {
60
64
  enumerable: true,
61
- get: function () { return chunkDSUJ5YQH_cjs.isPluginActive; }
65
+ get: function () { return chunkAAWNRBRB_cjs.isPluginActive; }
62
66
  });
63
67
  Object.defineProperty(exports, "logActivity", {
64
68
  enumerable: true,
65
- get: function () { return chunkDSUJ5YQH_cjs.logActivity; }
69
+ get: function () { return chunkAAWNRBRB_cjs.logActivity; }
66
70
  });
67
71
  Object.defineProperty(exports, "loggingMiddleware", {
68
72
  enumerable: true,
69
- get: function () { return chunkDSUJ5YQH_cjs.loggingMiddleware; }
73
+ get: function () { return chunkAAWNRBRB_cjs.loggingMiddleware; }
70
74
  });
71
75
  Object.defineProperty(exports, "metricsMiddleware", {
72
76
  enumerable: true,
73
- get: function () { return chunkDSUJ5YQH_cjs.metricsMiddleware; }
77
+ get: function () { return chunkAAWNRBRB_cjs.metricsMiddleware; }
74
78
  });
75
79
  Object.defineProperty(exports, "optionalAuth", {
76
80
  enumerable: true,
77
- get: function () { return chunkDSUJ5YQH_cjs.optionalAuth; }
81
+ get: function () { return chunkAAWNRBRB_cjs.optionalAuth; }
78
82
  });
79
83
  Object.defineProperty(exports, "performanceLoggingMiddleware", {
80
84
  enumerable: true,
81
- get: function () { return chunkDSUJ5YQH_cjs.performanceLoggingMiddleware; }
85
+ get: function () { return chunkAAWNRBRB_cjs.performanceLoggingMiddleware; }
82
86
  });
83
87
  Object.defineProperty(exports, "rateLimit", {
84
88
  enumerable: true,
85
- get: function () { return chunkDSUJ5YQH_cjs.rateLimit; }
89
+ get: function () { return chunkAAWNRBRB_cjs.rateLimit; }
86
90
  });
87
91
  Object.defineProperty(exports, "requireActivePlugin", {
88
92
  enumerable: true,
89
- get: function () { return chunkDSUJ5YQH_cjs.requireActivePlugin; }
93
+ get: function () { return chunkAAWNRBRB_cjs.requireActivePlugin; }
90
94
  });
91
95
  Object.defineProperty(exports, "requireActivePlugins", {
92
96
  enumerable: true,
93
- get: function () { return chunkDSUJ5YQH_cjs.requireActivePlugins; }
97
+ get: function () { return chunkAAWNRBRB_cjs.requireActivePlugins; }
94
98
  });
95
99
  Object.defineProperty(exports, "requireAnyPermission", {
96
100
  enumerable: true,
97
- get: function () { return chunkDSUJ5YQH_cjs.requireAnyPermission; }
101
+ get: function () { return chunkAAWNRBRB_cjs.requireAnyPermission; }
98
102
  });
99
103
  Object.defineProperty(exports, "requireAuth", {
100
104
  enumerable: true,
101
- get: function () { return chunkDSUJ5YQH_cjs.requireAuth; }
105
+ get: function () { return chunkAAWNRBRB_cjs.requireAuth; }
102
106
  });
103
107
  Object.defineProperty(exports, "requirePermission", {
104
108
  enumerable: true,
105
- get: function () { return chunkDSUJ5YQH_cjs.requirePermission; }
109
+ get: function () { return chunkAAWNRBRB_cjs.requirePermission; }
106
110
  });
107
111
  Object.defineProperty(exports, "requireRole", {
108
112
  enumerable: true,
109
- get: function () { return chunkDSUJ5YQH_cjs.requireRole; }
113
+ get: function () { return chunkAAWNRBRB_cjs.requireRole; }
110
114
  });
111
115
  Object.defineProperty(exports, "securityHeaders", {
112
116
  enumerable: true,
113
- get: function () { return chunkDSUJ5YQH_cjs.securityHeadersMiddleware; }
117
+ get: function () { return chunkAAWNRBRB_cjs.securityHeadersMiddleware; }
114
118
  });
115
119
  Object.defineProperty(exports, "securityLoggingMiddleware", {
116
120
  enumerable: true,
117
- get: function () { return chunkDSUJ5YQH_cjs.securityLoggingMiddleware; }
121
+ get: function () { return chunkAAWNRBRB_cjs.securityLoggingMiddleware; }
118
122
  });
119
123
  Object.defineProperty(exports, "validateCsrfToken", {
120
124
  enumerable: true,
121
- get: function () { return chunkDSUJ5YQH_cjs.validateCsrfToken; }
125
+ get: function () { return chunkAAWNRBRB_cjs.validateCsrfToken; }
122
126
  });
123
127
  Object.defineProperty(exports, "verifySecurityConfig", {
124
128
  enumerable: true,
125
- get: function () { return chunkDSUJ5YQH_cjs.verifySecurityConfig; }
129
+ get: function () { return chunkAAWNRBRB_cjs.verifySecurityConfig; }
126
130
  });
127
131
  //# sourceMappingURL=middleware.cjs.map
128
132
  //# sourceMappingURL=middleware.cjs.map
@@ -1,7 +1,15 @@
1
1
  import * as hono from 'hono';
2
2
  import { Context, Next, MiddlewareHandler } from 'hono';
3
- import { S as SonicJSConfig } from './app-C9esKLmh.cjs';
4
- import '@cloudflare/workers-types';
3
+ import { S as SonicJSConfig } from './app-Do66yCcV.cjs';
4
+ import { D1Database as D1Database$1 } from '@cloudflare/workers-types';
5
+ import 'better-auth/client';
6
+ import 'better-auth/plugins/email-otp';
7
+ import 'better-auth';
8
+ import 'better-auth/plugins/magic-link';
9
+ import 'better-call';
10
+ import 'zod/v4/core';
11
+ import 'zod';
12
+ import './types-Dea1eNxU.cjs';
5
13
 
6
14
  type Bindings = {
7
15
  DB: D1Database;
@@ -22,6 +30,9 @@ declare function verifySecurityConfig(env: Bindings): void;
22
30
  */
23
31
  declare function bootstrapMiddleware(config?: SonicJSConfig): (c: Context<{
24
32
  Bindings: Bindings;
33
+ Variables: {
34
+ hookSystem?: unknown;
35
+ };
25
36
  }>, next: Next) => Promise<void>;
26
37
 
27
38
  type JWTPayload = {
@@ -62,12 +73,31 @@ declare class AuthManager {
62
73
  /**
63
74
  * Verify a token's signature and expiration.
64
75
  *
76
+ * IMPORTANT: pass the `JWT_SECRET` binding (e.g. `c.env.JWT_SECRET`) as the
77
+ * `secret` argument. If omitted, this falls back to a development-only
78
+ * placeholder secret — tokens signed with the real `JWT_SECRET` will then
79
+ * silently fail verification. From inside a Hono handler prefer
80
+ * `AuthManager.verifyAuthRequest(c)`, which handles header/cookie extraction
81
+ * and pulls the secret from `c.env` for you.
82
+ *
65
83
  * If `graceSeconds` > 0, tokens whose `exp` is within the grace window
66
84
  * (i.e. expired by no more than `graceSeconds`) are still returned. This
67
85
  * supports a sliding-session refresh endpoint that accepts recently-expired
68
86
  * tokens. Signature failures always return null.
69
87
  */
70
88
  static verifyToken(token: string, secret?: string, graceSeconds?: number): Promise<JWTPayload | null>;
89
+ /**
90
+ * Verify the JWT on an incoming Hono request using the `JWT_SECRET`
91
+ * binding from `c.env`. Reads the token from the `Authorization: Bearer …`
92
+ * header first, then falls back to the `auth_token` cookie. Returns the
93
+ * decoded payload, or null when the token is missing, malformed, expired,
94
+ * or signed with a different secret.
95
+ *
96
+ * Use this from custom Hono routes mounted alongside SonicJS — it
97
+ * resolves the secret the same way `requireAuth()` does, without forcing
98
+ * the caller to plumb it through manually.
99
+ */
100
+ static verifyAuthRequest(c: Context): Promise<JWTPayload | null>;
71
101
  static hashPassword(password: string): Promise<string>;
72
102
  static hashPasswordLegacy(password: string): Promise<string>;
73
103
  static verifyPassword(password: string, storedHash: string): Promise<boolean>;
@@ -93,7 +123,7 @@ declare const requireRole: (requiredRole: string | string[]) => (c: Context, nex
93
123
  }, 401, "json">) | (Response & hono.TypedResponse<{
94
124
  error: string;
95
125
  }, 403, "json">)>;
96
- declare const optionalAuth: () => (c: Context, next: Next) => Promise<void>;
126
+ declare const optionalAuth: () => (_c: Context, next: Next) => Promise<void>;
97
127
 
98
128
  /**
99
129
  * Middleware to track all HTTP requests for real-time analytics
@@ -170,6 +200,42 @@ declare function rateLimit(options: RateLimitOptions): (c: Context, next: Next)
170
200
  */
171
201
  declare const securityHeadersMiddleware: () => (c: Context, next: Next) => Promise<void>;
172
202
 
203
+ /**
204
+ * Plugin Middleware
205
+ *
206
+ * Provides middleware functions for checking plugin status and enforcing plugin requirements
207
+ */
208
+
209
+ /**
210
+ * Check if a plugin is active
211
+ * @param db - The D1 database instance
212
+ * @param pluginId - The plugin ID to check
213
+ * @returns Promise<boolean> - True if the plugin is active, false otherwise
214
+ */
215
+ declare function isPluginActive(db: D1Database$1, pluginId: string): Promise<boolean>;
216
+ /**
217
+ * Middleware to require a plugin to be active
218
+ * Throws an error if the plugin is not active
219
+ * @param db - The D1 database instance
220
+ * @param pluginId - The plugin ID to check
221
+ * @throws Error if plugin is not active
222
+ */
223
+ declare function requireActivePlugin(db: D1Database$1, pluginId: string): Promise<void>;
224
+ /**
225
+ * Middleware to require multiple plugins to be active
226
+ * Throws an error if any plugin is not active
227
+ * @param db - The D1 database instance
228
+ * @param pluginIds - Array of plugin IDs to check
229
+ * @throws Error if any plugin is not active
230
+ */
231
+ declare function requireActivePlugins(db: D1Database$1, pluginIds: string[]): Promise<void>;
232
+ /**
233
+ * Get all active plugins
234
+ * @param db - The D1 database instance
235
+ * @returns Promise<any[]> - Array of active plugin records
236
+ */
237
+ declare function getActivePlugins(db: D1Database$1): Promise<any[]>;
238
+
173
239
  /**
174
240
  * Middleware Module Exports
175
241
  *
@@ -195,9 +261,5 @@ declare const PermissionManager: any;
195
261
  declare const requirePermission: any;
196
262
  declare const requireAnyPermission: any;
197
263
  declare const logActivity: any;
198
- declare const requireActivePlugin: any;
199
- declare const requireActivePlugins: any;
200
- declare const getActivePlugins: any;
201
- declare const isPluginActive: any;
202
264
 
203
265
  export { AuthManager, type Permission, PermissionManager, type UserPermissions, bootstrapMiddleware, cacheHeaders, compressionMiddleware, csrfProtection, detailedLoggingMiddleware, generateCsrfToken, getActivePlugins, getJwtExpirySeconds, getJwtExpirySecondsFromDb, getJwtRefreshGraceSecondsFromDb, isPluginActive, logActivity, loggingMiddleware, metricsMiddleware, optionalAuth, performanceLoggingMiddleware, rateLimit, requireActivePlugin, requireActivePlugins, requireAnyPermission, requireAuth, requirePermission, requireRole, securityHeadersMiddleware as securityHeaders, securityLoggingMiddleware, validateCsrfToken, verifySecurityConfig };
@@ -1,7 +1,15 @@
1
1
  import * as hono from 'hono';
2
2
  import { Context, Next, MiddlewareHandler } from 'hono';
3
- import { S as SonicJSConfig } from './app-C9esKLmh.js';
4
- import '@cloudflare/workers-types';
3
+ import { S as SonicJSConfig } from './app-Bo0X1OWX.js';
4
+ import { D1Database as D1Database$1 } from '@cloudflare/workers-types';
5
+ import 'better-auth/client';
6
+ import 'better-auth/plugins/email-otp';
7
+ import 'better-auth';
8
+ import 'better-auth/plugins/magic-link';
9
+ import 'better-call';
10
+ import 'zod/v4/core';
11
+ import 'zod';
12
+ import './types-Dea1eNxU.js';
5
13
 
6
14
  type Bindings = {
7
15
  DB: D1Database;
@@ -22,6 +30,9 @@ declare function verifySecurityConfig(env: Bindings): void;
22
30
  */
23
31
  declare function bootstrapMiddleware(config?: SonicJSConfig): (c: Context<{
24
32
  Bindings: Bindings;
33
+ Variables: {
34
+ hookSystem?: unknown;
35
+ };
25
36
  }>, next: Next) => Promise<void>;
26
37
 
27
38
  type JWTPayload = {
@@ -62,12 +73,31 @@ declare class AuthManager {
62
73
  /**
63
74
  * Verify a token's signature and expiration.
64
75
  *
76
+ * IMPORTANT: pass the `JWT_SECRET` binding (e.g. `c.env.JWT_SECRET`) as the
77
+ * `secret` argument. If omitted, this falls back to a development-only
78
+ * placeholder secret — tokens signed with the real `JWT_SECRET` will then
79
+ * silently fail verification. From inside a Hono handler prefer
80
+ * `AuthManager.verifyAuthRequest(c)`, which handles header/cookie extraction
81
+ * and pulls the secret from `c.env` for you.
82
+ *
65
83
  * If `graceSeconds` > 0, tokens whose `exp` is within the grace window
66
84
  * (i.e. expired by no more than `graceSeconds`) are still returned. This
67
85
  * supports a sliding-session refresh endpoint that accepts recently-expired
68
86
  * tokens. Signature failures always return null.
69
87
  */
70
88
  static verifyToken(token: string, secret?: string, graceSeconds?: number): Promise<JWTPayload | null>;
89
+ /**
90
+ * Verify the JWT on an incoming Hono request using the `JWT_SECRET`
91
+ * binding from `c.env`. Reads the token from the `Authorization: Bearer …`
92
+ * header first, then falls back to the `auth_token` cookie. Returns the
93
+ * decoded payload, or null when the token is missing, malformed, expired,
94
+ * or signed with a different secret.
95
+ *
96
+ * Use this from custom Hono routes mounted alongside SonicJS — it
97
+ * resolves the secret the same way `requireAuth()` does, without forcing
98
+ * the caller to plumb it through manually.
99
+ */
100
+ static verifyAuthRequest(c: Context): Promise<JWTPayload | null>;
71
101
  static hashPassword(password: string): Promise<string>;
72
102
  static hashPasswordLegacy(password: string): Promise<string>;
73
103
  static verifyPassword(password: string, storedHash: string): Promise<boolean>;
@@ -93,7 +123,7 @@ declare const requireRole: (requiredRole: string | string[]) => (c: Context, nex
93
123
  }, 401, "json">) | (Response & hono.TypedResponse<{
94
124
  error: string;
95
125
  }, 403, "json">)>;
96
- declare const optionalAuth: () => (c: Context, next: Next) => Promise<void>;
126
+ declare const optionalAuth: () => (_c: Context, next: Next) => Promise<void>;
97
127
 
98
128
  /**
99
129
  * Middleware to track all HTTP requests for real-time analytics
@@ -170,6 +200,42 @@ declare function rateLimit(options: RateLimitOptions): (c: Context, next: Next)
170
200
  */
171
201
  declare const securityHeadersMiddleware: () => (c: Context, next: Next) => Promise<void>;
172
202
 
203
+ /**
204
+ * Plugin Middleware
205
+ *
206
+ * Provides middleware functions for checking plugin status and enforcing plugin requirements
207
+ */
208
+
209
+ /**
210
+ * Check if a plugin is active
211
+ * @param db - The D1 database instance
212
+ * @param pluginId - The plugin ID to check
213
+ * @returns Promise<boolean> - True if the plugin is active, false otherwise
214
+ */
215
+ declare function isPluginActive(db: D1Database$1, pluginId: string): Promise<boolean>;
216
+ /**
217
+ * Middleware to require a plugin to be active
218
+ * Throws an error if the plugin is not active
219
+ * @param db - The D1 database instance
220
+ * @param pluginId - The plugin ID to check
221
+ * @throws Error if plugin is not active
222
+ */
223
+ declare function requireActivePlugin(db: D1Database$1, pluginId: string): Promise<void>;
224
+ /**
225
+ * Middleware to require multiple plugins to be active
226
+ * Throws an error if any plugin is not active
227
+ * @param db - The D1 database instance
228
+ * @param pluginIds - Array of plugin IDs to check
229
+ * @throws Error if any plugin is not active
230
+ */
231
+ declare function requireActivePlugins(db: D1Database$1, pluginIds: string[]): Promise<void>;
232
+ /**
233
+ * Get all active plugins
234
+ * @param db - The D1 database instance
235
+ * @returns Promise<any[]> - Array of active plugin records
236
+ */
237
+ declare function getActivePlugins(db: D1Database$1): Promise<any[]>;
238
+
173
239
  /**
174
240
  * Middleware Module Exports
175
241
  *
@@ -195,9 +261,5 @@ declare const PermissionManager: any;
195
261
  declare const requirePermission: any;
196
262
  declare const requireAnyPermission: any;
197
263
  declare const logActivity: any;
198
- declare const requireActivePlugin: any;
199
- declare const requireActivePlugins: any;
200
- declare const getActivePlugins: any;
201
- declare const isPluginActive: any;
202
264
 
203
265
  export { AuthManager, type Permission, PermissionManager, type UserPermissions, bootstrapMiddleware, cacheHeaders, compressionMiddleware, csrfProtection, detailedLoggingMiddleware, generateCsrfToken, getActivePlugins, getJwtExpirySeconds, getJwtExpirySecondsFromDb, getJwtRefreshGraceSecondsFromDb, isPluginActive, logActivity, loggingMiddleware, metricsMiddleware, optionalAuth, performanceLoggingMiddleware, rateLimit, requireActivePlugin, requireActivePlugins, requireAnyPermission, requireAuth, requirePermission, requireRole, securityHeadersMiddleware as securityHeaders, securityLoggingMiddleware, validateCsrfToken, verifySecurityConfig };
@@ -1,7 +1,11 @@
1
- export { AuthManager, PermissionManager, bootstrapMiddleware, cacheHeaders, compressionMiddleware, csrfProtection, detailedLoggingMiddleware, generateCsrfToken, getActivePlugins, getJwtExpirySeconds, getJwtExpirySecondsFromDb, getJwtRefreshGraceSecondsFromDb, isPluginActive, logActivity, loggingMiddleware, metricsMiddleware, optionalAuth, performanceLoggingMiddleware, rateLimit, requireActivePlugin, requireActivePlugins, requireAnyPermission, requireAuth, requirePermission, requireRole, securityHeadersMiddleware as securityHeaders, securityLoggingMiddleware, validateCsrfToken, verifySecurityConfig } from './chunk-I2H5NGJQ.js';
2
- import './chunk-EW5NOBVU.js';
3
- import './chunk-4R3NOOL3.js';
1
+ export { AuthManager, PermissionManager, bootstrapMiddleware, cacheHeaders, compressionMiddleware, csrfProtection, detailedLoggingMiddleware, generateCsrfToken, getActivePlugins, getJwtExpirySeconds, getJwtExpirySecondsFromDb, getJwtRefreshGraceSecondsFromDb, isPluginActive, logActivity, loggingMiddleware, metricsMiddleware, optionalAuth, performanceLoggingMiddleware, rateLimit, requireActivePlugin, requireActivePlugins, requireAnyPermission, requireAuth, requirePermission, requireRole, securityHeadersMiddleware as securityHeaders, securityLoggingMiddleware, validateCsrfToken, verifySecurityConfig } from './chunk-RZ6H7OZK.js';
2
+ import './chunk-BLMTL57B.js';
3
+ import './chunk-GCDZZNIN.js';
4
+ import './chunk-ZGGXCFR6.js';
5
+ import './chunk-NLJVSER2.js';
6
+ import './chunk-RNZFGN4R.js';
4
7
  import './chunk-FICTAGD4.js';
8
+ import './chunk-TQABQWOP.js';
5
9
  import './chunk-V4OQ3NZ2.js';
6
10
  //# sourceMappingURL=middleware.js.map
7
11
  //# sourceMappingURL=middleware.js.map
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var chunkDSA4UX5B_cjs = require('./chunk-DSA4UX5B.cjs');
4
+ require('./chunk-IGJUBJBW.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "MigrationService", {
9
+ enumerable: true,
10
+ get: function () { return chunkDSA4UX5B_cjs.MigrationService; }
11
+ });
12
+ //# sourceMappingURL=migrations-NJJWQUKK.cjs.map
13
+ //# sourceMappingURL=migrations-NJJWQUKK.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"migrations-IYNTWDC6.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"migrations-NJJWQUKK.cjs"}
@@ -0,0 +1,4 @@
1
+ export { MigrationService } from './chunk-NLJVSER2.js';
2
+ import './chunk-V4OQ3NZ2.js';
3
+ //# sourceMappingURL=migrations-WCAVBD7C.js.map
4
+ //# sourceMappingURL=migrations-WCAVBD7C.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"migrations-R337UD46.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"migrations-WCAVBD7C.js"}