@sonicjs-cms/core 2.19.0 → 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 (224) 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-7A4CB7T3.cjs → chunk-AAWNRBRB.cjs} +509 -91
  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-JZVHLLSI.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-E4YFJBM2.cjs → chunk-QAYFOER6.cjs} +621 -829
  71. package/dist/chunk-QAYFOER6.cjs.map +1 -0
  72. package/dist/{chunk-BU7SFHGP.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-4NPCDK6B.js → chunk-RZ6H7OZK.js} +505 -90
  77. package/dist/chunk-RZ6H7OZK.js.map +1 -0
  78. package/dist/{chunk-OCL3HMEG.js → chunk-VD2EA3WT.js} +7004 -9807
  79. package/dist/chunk-VD2EA3WT.js.map +1 -0
  80. package/dist/{chunk-R4FOLLFB.cjs → chunk-VXE42MYF.cjs} +8730 -11520
  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-JZV22DEV.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 +13734 -4328
  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 +13385 -3998
  113. package/dist/index.js.map +1 -1
  114. package/dist/middleware.cjs +36 -32
  115. package/dist/middleware.d.cts +50 -7
  116. package/dist/middleware.d.ts +50 -7
  117. package/dist/middleware.js +7 -3
  118. package/dist/migrations-NJJWQUKK.cjs +13 -0
  119. package/dist/{migrations-566IIPS2.cjs.map → migrations-NJJWQUKK.cjs.map} +1 -1
  120. package/dist/migrations-WCAVBD7C.js +4 -0
  121. package/dist/{migrations-H5IXZNCO.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-4NPCDK6B.js.map +0 -1
  160. package/dist/chunk-4ZSNJDLS.cjs.map +0 -1
  161. package/dist/chunk-55RDMDOP.js.map +0 -1
  162. package/dist/chunk-635JAMSE.cjs +0 -653
  163. package/dist/chunk-635JAMSE.cjs.map +0 -1
  164. package/dist/chunk-7A4CB7T3.cjs.map +0 -1
  165. package/dist/chunk-ABB34XUS.cjs.map +0 -1
  166. package/dist/chunk-BU7SFHGP.js.map +0 -1
  167. package/dist/chunk-E4YFJBM2.cjs.map +0 -1
  168. package/dist/chunk-EXNEW5US.js +0 -648
  169. package/dist/chunk-EXNEW5US.js.map +0 -1
  170. package/dist/chunk-JZV22DEV.js.map +0 -1
  171. package/dist/chunk-JZVHLLSI.cjs.map +0 -1
  172. package/dist/chunk-OCL3HMEG.js.map +0 -1
  173. package/dist/chunk-OHYBNCVL.cjs.map +0 -1
  174. package/dist/chunk-ON5ZMSU4.js.map +0 -1
  175. package/dist/chunk-QFWHAFEO.js.map +0 -1
  176. package/dist/chunk-R4FOLLFB.cjs.map +0 -1
  177. package/dist/chunk-RLMUFFUD.cjs +0 -2219
  178. package/dist/chunk-RLMUFFUD.cjs.map +0 -1
  179. package/dist/chunk-TFNTM3OA.js.map +0 -1
  180. package/dist/chunk-UYJ6TJHX.cjs.map +0 -1
  181. package/dist/chunk-WAEQXGCX.cjs +0 -1898
  182. package/dist/chunk-WAEQXGCX.cjs.map +0 -1
  183. package/dist/chunk-XWIA3HVX.js.map +0 -1
  184. package/dist/chunk-ZYAYUIZE.js +0 -2217
  185. package/dist/chunk-ZYAYUIZE.js.map +0 -1
  186. package/dist/migrations-566IIPS2.cjs +0 -13
  187. package/dist/migrations-H5IXZNCO.js +0 -4
  188. package/dist/plugin-manager-BoM3Q7o7.d.cts +0 -328
  189. package/dist/plugin-manager-Efx9RyDX.d.ts +0 -328
  190. package/migrations/001_initial_schema.sql +0 -170
  191. package/migrations/002_faq_plugin.sql +0 -86
  192. package/migrations/003_stage5_enhancements.sql +0 -121
  193. package/migrations/004_stage6_user_management.sql +0 -183
  194. package/migrations/005_stage7_workflow_automation.sql +0 -294
  195. package/migrations/006_plugin_system.sql +0 -155
  196. package/migrations/007_demo_login_plugin.sql +0 -23
  197. package/migrations/008_fix_slug_validation.sql +0 -22
  198. package/migrations/009_system_logging.sql +0 -57
  199. package/migrations/011_config_managed_collections.sql +0 -15
  200. package/migrations/012_testimonials_plugin.sql +0 -80
  201. package/migrations/013_code_examples_plugin.sql +0 -177
  202. package/migrations/014_fix_plugin_registry.sql +0 -88
  203. package/migrations/015_add_remaining_plugins.sql +0 -89
  204. package/migrations/016_remove_duplicate_cache_plugin.sql +0 -17
  205. package/migrations/017_auth_configurable_fields.sql +0 -49
  206. package/migrations/018_settings_table.sql +0 -23
  207. package/migrations/019_remove_blog_posts_collection.sql +0 -15
  208. package/migrations/020_add_email_plugin.sql +0 -22
  209. package/migrations/021_add_magic_link_auth_plugin.sql +0 -42
  210. package/migrations/022_add_tinymce_plugin.sql +0 -25
  211. package/migrations/023_add_easy_mdx_plugin.sql +0 -25
  212. package/migrations/024_add_quill_editor_plugin.sql +0 -25
  213. package/migrations/025_add_easymde_plugin.sql +0 -25
  214. package/migrations/026_add_otp_login.sql +0 -42
  215. package/migrations/027_fix_slug_field_type.sql +0 -18
  216. package/migrations/028_fix_slug_field_type_in_schemas.sql +0 -30
  217. package/migrations/029_add_forms_system.sql +0 -184
  218. package/migrations/030_add_turnstile_to_forms.sql +0 -14
  219. package/migrations/031_ai_search_plugin.sql +0 -45
  220. package/migrations/032_user_profiles.sql +0 -37
  221. package/migrations/033_form_content_integration.sql +0 -19
  222. package/migrations/034_security_audit_plugin.sql +0 -27
  223. package/migrations/035_user_profiles_data_column.sql +0 -16
  224. package/migrations/036_analytics_events.sql +0 -22
package/dist/services.cjs CHANGED
@@ -1,156 +1,123 @@
1
1
  'use strict';
2
2
 
3
- var chunkWAEQXGCX_cjs = require('./chunk-WAEQXGCX.cjs');
4
- var chunkE4YFJBM2_cjs = require('./chunk-E4YFJBM2.cjs');
5
- var chunkRLMUFFUD_cjs = require('./chunk-RLMUFFUD.cjs');
3
+ var chunkBDDABDAB_cjs = require('./chunk-BDDABDAB.cjs');
4
+ require('./chunk-YA3TJ65D.cjs');
5
+ require('./chunk-YP7GW2G5.cjs');
6
+ var chunkQAYFOER6_cjs = require('./chunk-QAYFOER6.cjs');
7
+ var chunkDSA4UX5B_cjs = require('./chunk-DSA4UX5B.cjs');
6
8
  require('./chunk-P3XDZL6Q.cjs');
9
+ require('./chunk-MNWKYY5E.cjs');
7
10
  require('./chunk-IGJUBJBW.cjs');
8
11
 
9
12
 
10
13
 
11
14
  Object.defineProperty(exports, "CACHE_CONFIGS", {
12
15
  enumerable: true,
13
- get: function () { return chunkWAEQXGCX_cjs.CACHE_CONFIGS; }
16
+ get: function () { return chunkBDDABDAB_cjs.CACHE_CONFIGS; }
14
17
  });
15
18
  Object.defineProperty(exports, "CATEGORY_INFO", {
16
19
  enumerable: true,
17
- get: function () { return chunkWAEQXGCX_cjs.CATEGORY_INFO; }
20
+ get: function () { return chunkBDDABDAB_cjs.CATEGORY_INFO; }
18
21
  });
19
22
  Object.defineProperty(exports, "CacheService", {
20
23
  enumerable: true,
21
- get: function () { return chunkWAEQXGCX_cjs.CacheService; }
24
+ get: function () { return chunkBDDABDAB_cjs.CacheService; }
22
25
  });
23
26
  Object.defineProperty(exports, "Logger", {
24
27
  enumerable: true,
25
- get: function () { return chunkWAEQXGCX_cjs.Logger; }
28
+ get: function () { return chunkBDDABDAB_cjs.Logger; }
26
29
  });
27
30
  Object.defineProperty(exports, "SettingsService", {
28
31
  enumerable: true,
29
- get: function () { return chunkWAEQXGCX_cjs.SettingsService; }
32
+ get: function () { return chunkBDDABDAB_cjs.SettingsService; }
30
33
  });
31
34
  Object.defineProperty(exports, "TelemetryService", {
32
35
  enumerable: true,
33
- get: function () { return chunkWAEQXGCX_cjs.TelemetryService; }
36
+ get: function () { return chunkBDDABDAB_cjs.TelemetryService; }
34
37
  });
35
38
  Object.defineProperty(exports, "buildRouteList", {
36
39
  enumerable: true,
37
- get: function () { return chunkWAEQXGCX_cjs.buildRouteList; }
40
+ get: function () { return chunkBDDABDAB_cjs.buildRouteList; }
38
41
  });
39
42
  Object.defineProperty(exports, "createInstallationIdentity", {
40
43
  enumerable: true,
41
- get: function () { return chunkWAEQXGCX_cjs.createInstallationIdentity; }
44
+ get: function () { return chunkBDDABDAB_cjs.createInstallationIdentity; }
42
45
  });
43
46
  Object.defineProperty(exports, "getAppInstance", {
44
47
  enumerable: true,
45
- get: function () { return chunkWAEQXGCX_cjs.getAppInstance; }
48
+ get: function () { return chunkBDDABDAB_cjs.getAppInstance; }
46
49
  });
47
50
  Object.defineProperty(exports, "getCacheService", {
48
51
  enumerable: true,
49
- get: function () { return chunkWAEQXGCX_cjs.getCacheService; }
52
+ get: function () { return chunkBDDABDAB_cjs.getCacheService; }
50
53
  });
51
54
  Object.defineProperty(exports, "getLogger", {
52
55
  enumerable: true,
53
- get: function () { return chunkWAEQXGCX_cjs.getLogger; }
56
+ get: function () { return chunkBDDABDAB_cjs.getLogger; }
54
57
  });
55
58
  Object.defineProperty(exports, "getTelemetryService", {
56
59
  enumerable: true,
57
- get: function () { return chunkWAEQXGCX_cjs.getTelemetryService; }
60
+ get: function () { return chunkBDDABDAB_cjs.getTelemetryService; }
58
61
  });
59
62
  Object.defineProperty(exports, "initLogger", {
60
63
  enumerable: true,
61
- get: function () { return chunkWAEQXGCX_cjs.initLogger; }
64
+ get: function () { return chunkBDDABDAB_cjs.initLogger; }
62
65
  });
63
66
  Object.defineProperty(exports, "initTelemetry", {
64
67
  enumerable: true,
65
- get: function () { return chunkWAEQXGCX_cjs.initTelemetry; }
68
+ get: function () { return chunkBDDABDAB_cjs.initTelemetry; }
66
69
  });
67
70
  Object.defineProperty(exports, "setAppInstance", {
68
71
  enumerable: true,
69
- get: function () { return chunkWAEQXGCX_cjs.setAppInstance; }
72
+ get: function () { return chunkBDDABDAB_cjs.setAppInstance; }
70
73
  });
71
- Object.defineProperty(exports, "PluginBootstrapService", {
72
- enumerable: true,
73
- get: function () { return chunkE4YFJBM2_cjs.PluginBootstrapService; }
74
- });
75
- Object.defineProperty(exports, "PluginService", {
76
- enumerable: true,
77
- get: function () { return chunkE4YFJBM2_cjs.PluginService; }
78
- });
79
- Object.defineProperty(exports, "backfillFormSubmissions", {
74
+ Object.defineProperty(exports, "CollectionRegistry", {
80
75
  enumerable: true,
81
- get: function () { return chunkE4YFJBM2_cjs.backfillFormSubmissions; }
76
+ get: function () { return chunkQAYFOER6_cjs.CollectionRegistry; }
82
77
  });
83
- Object.defineProperty(exports, "cleanupRemovedCollections", {
84
- enumerable: true,
85
- get: function () { return chunkE4YFJBM2_cjs.cleanupRemovedCollections; }
86
- });
87
- Object.defineProperty(exports, "createContentFromSubmission", {
88
- enumerable: true,
89
- get: function () { return chunkE4YFJBM2_cjs.createContentFromSubmission; }
90
- });
91
- Object.defineProperty(exports, "deriveCollectionSchemaFromFormio", {
78
+ Object.defineProperty(exports, "PluginBootstrapService", {
92
79
  enumerable: true,
93
- get: function () { return chunkE4YFJBM2_cjs.deriveCollectionSchemaFromFormio; }
80
+ get: function () { return chunkQAYFOER6_cjs.PluginBootstrapService; }
94
81
  });
95
- Object.defineProperty(exports, "deriveSubmissionTitle", {
82
+ Object.defineProperty(exports, "PluginService", {
96
83
  enumerable: true,
97
- get: function () { return chunkE4YFJBM2_cjs.deriveSubmissionTitle; }
84
+ get: function () { return chunkQAYFOER6_cjs.PluginService; }
98
85
  });
99
- Object.defineProperty(exports, "fullCollectionSync", {
86
+ Object.defineProperty(exports, "collectionRecordToRow", {
100
87
  enumerable: true,
101
- get: function () { return chunkE4YFJBM2_cjs.fullCollectionSync; }
88
+ get: function () { return chunkQAYFOER6_cjs.collectionRecordToRow; }
102
89
  });
103
90
  Object.defineProperty(exports, "getAvailableCollectionNames", {
104
91
  enumerable: true,
105
- get: function () { return chunkE4YFJBM2_cjs.getAvailableCollectionNames; }
106
- });
107
- Object.defineProperty(exports, "getManagedCollections", {
108
- enumerable: true,
109
- get: function () { return chunkE4YFJBM2_cjs.getManagedCollections; }
92
+ get: function () { return chunkQAYFOER6_cjs.getAvailableCollectionNames; }
110
93
  });
111
- Object.defineProperty(exports, "isCollectionManaged", {
94
+ Object.defineProperty(exports, "getCollectionRegistry", {
112
95
  enumerable: true,
113
- get: function () { return chunkE4YFJBM2_cjs.isCollectionManaged; }
96
+ get: function () { return chunkQAYFOER6_cjs.getCollectionRegistry; }
114
97
  });
115
98
  Object.defineProperty(exports, "loadCollectionConfig", {
116
99
  enumerable: true,
117
- get: function () { return chunkE4YFJBM2_cjs.loadCollectionConfig; }
100
+ get: function () { return chunkQAYFOER6_cjs.loadCollectionConfig; }
118
101
  });
119
102
  Object.defineProperty(exports, "loadCollectionConfigs", {
120
103
  enumerable: true,
121
- get: function () { return chunkE4YFJBM2_cjs.loadCollectionConfigs; }
122
- });
123
- Object.defineProperty(exports, "mapFormStatusToContentStatus", {
124
- enumerable: true,
125
- get: function () { return chunkE4YFJBM2_cjs.mapFormStatusToContentStatus; }
104
+ get: function () { return chunkQAYFOER6_cjs.loadCollectionConfigs; }
126
105
  });
127
106
  Object.defineProperty(exports, "registerCollections", {
128
107
  enumerable: true,
129
- get: function () { return chunkE4YFJBM2_cjs.registerCollections; }
130
- });
131
- Object.defineProperty(exports, "syncAllFormCollections", {
132
- enumerable: true,
133
- get: function () { return chunkE4YFJBM2_cjs.syncAllFormCollections; }
134
- });
135
- Object.defineProperty(exports, "syncCollection", {
136
- enumerable: true,
137
- get: function () { return chunkE4YFJBM2_cjs.syncCollection; }
138
- });
139
- Object.defineProperty(exports, "syncCollections", {
140
- enumerable: true,
141
- get: function () { return chunkE4YFJBM2_cjs.syncCollections; }
108
+ get: function () { return chunkQAYFOER6_cjs.registerCollections; }
142
109
  });
143
- Object.defineProperty(exports, "syncFormCollection", {
110
+ Object.defineProperty(exports, "resetCollectionRegistry", {
144
111
  enumerable: true,
145
- get: function () { return chunkE4YFJBM2_cjs.syncFormCollection; }
112
+ get: function () { return chunkQAYFOER6_cjs.resetCollectionRegistry; }
146
113
  });
147
114
  Object.defineProperty(exports, "validateCollectionConfig", {
148
115
  enumerable: true,
149
- get: function () { return chunkE4YFJBM2_cjs.validateCollectionConfig; }
116
+ get: function () { return chunkQAYFOER6_cjs.validateCollectionConfig; }
150
117
  });
151
118
  Object.defineProperty(exports, "MigrationService", {
152
119
  enumerable: true,
153
- get: function () { return chunkRLMUFFUD_cjs.MigrationService; }
120
+ get: function () { return chunkDSA4UX5B_cjs.MigrationService; }
154
121
  });
155
122
  //# sourceMappingURL=services.cjs.map
156
123
  //# sourceMappingURL=services.cjs.map
@@ -1,15 +1,79 @@
1
- export { C as CorePlugin, L as LogCategory, a as LogEntry, b as LogFilter, c as LogLevel, d as Logger, M as Migration, e as MigrationService, f as MigrationStatus, P as PluginBootstrapService, g as PluginService, h as backfillFormSubmissions, i as cleanupRemovedCollections, j as createContentFromSubmission, k as deriveCollectionSchemaFromFormio, l as deriveSubmissionTitle, m as fullCollectionSync, n as getAvailableCollectionNames, o as getLogger, p as getManagedCollections, q as initLogger, r as isCollectionManaged, s as loadCollectionConfig, t as loadCollectionConfigs, u as mapFormStatusToContentStatus, v as registerCollections, w as syncAllFormCollections, x as syncCollection, y as syncCollections, z as syncFormCollection, A as validateCollectionConfig } from './plugin-bootstrap-DfVerYV4.cjs';
1
+ export { C as CorePlugin, L as LogCategory, a as LogEntry, b as LogFilter, c as LogLevel, d as Logger, M as Migration, e as MigrationService, f as MigrationStatus, P as PluginBootstrapService, g as PluginService, h as getAvailableCollectionNames, i as getLogger, j as initLogger, l as loadCollectionConfig, k as loadCollectionConfigs, r as registerCollections, v as validateCollectionConfig } from './plugin-bootstrap-B8ThJU21.cjs';
2
+ import { C as CollectionConfig } from './collection-config-JgHOpFCG.cjs';
2
3
  import { T as TelemetryConfig, b as TelemetryIdentity, a as TelemetryEvent, c as TelemetryProperties } from './telemetry-B9vIV4wh.cjs';
3
- import './collection-config-B4PG-AaF.cjs';
4
4
  import '@cloudflare/workers-types';
5
5
  import 'drizzle-zod';
6
6
  import 'drizzle-orm/sqlite-core';
7
7
 
8
8
  /**
9
- * Simple Cache Service
9
+ * CollectionRegistry in-memory registry of code-defined collections.
10
10
  *
11
- * Provides basic caching functionality for the core package
12
- * Can be extended with KV or other storage backends
11
+ * Replaces the DB `collections` table as the source of truth for collection
12
+ * metadata. Populated once at bootstrap from `loadCollectionConfigs()` (which
13
+ * reads code-registered collections). Code-defined IDs are stable across envs:
14
+ * `collection.id === collection.name`.
15
+ */
16
+
17
+ interface CollectionRecord extends CollectionConfig {
18
+ /** Stable id = collection.name. Always equals `name` for code-defined collections. */
19
+ id: string;
20
+ }
21
+ declare class CollectionRegistry {
22
+ private byName;
23
+ private bySlug;
24
+ /**
25
+ * Replace the registry contents with the given configs. Idempotent —
26
+ * calling with the same configs twice yields the same state.
27
+ */
28
+ register(configs: CollectionConfig[]): void;
29
+ /** All registered collections (including inactive). */
30
+ list(): CollectionRecord[];
31
+ /** Active collections only. */
32
+ listActive(): CollectionRecord[];
33
+ getByName(name: string): CollectionRecord | undefined;
34
+ /** For code-defined collections, id === name. */
35
+ getById(id: string): CollectionRecord | undefined;
36
+ /** Look up by the URL slug (set in CollectionConfig.slug). Falls back to getByName if needed. */
37
+ getBySlug(slug: string): CollectionRecord | undefined;
38
+ /** Resolve a path segment to a record — tries slug first, then name. */
39
+ getBySlugOrName(slugOrName: string): CollectionRecord | undefined;
40
+ isActive(name: string): boolean;
41
+ size(): number;
42
+ /** Test helper — wipe state. */
43
+ clear(): void;
44
+ }
45
+ /**
46
+ * Map a registry record to the snake_case shape historically returned by
47
+ * `SELECT * FROM collections`. Used by API routes during the consumer
48
+ * migration so downstream clients see no schema drift.
49
+ */
50
+ interface CollectionRowShape {
51
+ id: string;
52
+ name: string;
53
+ display_name: string;
54
+ description: string | null;
55
+ schema: any;
56
+ is_active: number;
57
+ managed: number;
58
+ source_type: string;
59
+ source_id: string | null;
60
+ created_at: number;
61
+ updated_at: number;
62
+ }
63
+ declare function collectionRecordToRow(record: CollectionRecord): CollectionRowShape;
64
+ declare function getCollectionRegistry(): CollectionRegistry;
65
+ /** Test helper — reset singleton between tests. */
66
+ declare function resetCollectionRegistry(): void;
67
+
68
+ /**
69
+ * Cache Service Adapter
70
+ *
71
+ * Thin facade over the cache plugin's `CacheService` so route code can keep its
72
+ * legacy `{ ttl, keyPrefix }` contract while writes land in the plugin's
73
+ * singleton — that's the same registry the admin dashboard at /admin/cache reads
74
+ * via `getAllCacheStats()`. Without this adapter the two caches would be split:
75
+ * routes would write to one, the dashboard would read from another, and the UI
76
+ * would always show zero entries.
13
77
  */
14
78
  interface CacheConfig {
15
79
  ttl: number;
@@ -17,49 +81,25 @@ interface CacheConfig {
17
81
  }
18
82
  declare class CacheService {
19
83
  private config;
20
- private memoryCache;
84
+ private inner;
85
+ private keyExpiry;
21
86
  constructor(config: CacheConfig);
22
- /**
23
- * Generate cache key with prefix
24
- */
25
87
  generateKey(type: string, identifier?: string): string;
26
- /**
27
- * Get value from cache
28
- */
29
88
  get<T>(key: string): Promise<T | null>;
30
- /**
31
- * Get value from cache with source information
32
- */
33
89
  getWithSource<T>(key: string): Promise<{
34
90
  hit: boolean;
35
91
  data: T | null;
36
92
  source: string;
37
93
  ttl?: number;
38
94
  }>;
39
- /**
40
- * Set value in cache
41
- */
42
95
  set(key: string, value: any, ttl?: number): Promise<void>;
43
- /**
44
- * Delete specific key from cache
45
- */
46
96
  delete(key: string): Promise<void>;
47
- /**
48
- * Invalidate cache keys matching a pattern
49
- * For memory cache, we do simple string matching
50
- */
51
97
  invalidate(pattern: string): Promise<void>;
52
- /**
53
- * Clear all cache
54
- */
55
98
  clear(): Promise<void>;
56
- /**
57
- * Get value from cache or set it using a callback
58
- */
59
99
  getOrSet<T>(key: string, callback: () => Promise<T>, ttl?: number): Promise<T>;
60
100
  }
61
101
  /**
62
- * Cache configurations for different data types
102
+ * Default cache configurations for different data types.
63
103
  */
64
104
  declare const CACHE_CONFIGS: {
65
105
  api: {
@@ -80,18 +120,11 @@ declare const CACHE_CONFIGS: {
80
120
  };
81
121
  };
82
122
  /**
83
- * Get cache service instance for a config
123
+ * Resolve a cache service for a config. Wraps the plugin's singleton so admin
124
+ * dashboard stats and route-side writes share the same store.
84
125
  */
85
126
  declare function getCacheService(config: CacheConfig): CacheService;
86
127
 
87
- interface Setting {
88
- id: string;
89
- category: string;
90
- key: string;
91
- value: string;
92
- created_at: number;
93
- updated_at: number;
94
- }
95
128
  interface GeneralSettings {
96
129
  siteName: string;
97
130
  siteDescription: string;
@@ -108,21 +141,13 @@ declare class SettingsService {
108
141
  private db;
109
142
  constructor(db: D1Database);
110
143
  /**
111
- * Get a setting value by category and key
112
- */
113
- getSetting(category: string, key: string): Promise<any | null>;
114
- /**
115
- * Get all settings for a category
116
- */
117
- getCategorySettings(category: string): Promise<Record<string, any>>;
118
- /**
119
- * Set a setting value
144
+ * Get settings document for a category (general or security)
120
145
  */
121
- setSetting(category: string, key: string, value: any): Promise<boolean>;
146
+ private getSettingsDocument;
122
147
  /**
123
- * Set multiple settings at once
148
+ * Save settings document for a category (general or security)
124
149
  */
125
- setMultipleSettings(category: string, settings: Record<string, any>): Promise<boolean>;
150
+ private saveSettingsDocument;
126
151
  /**
127
152
  * Get general settings with defaults
128
153
  */
@@ -269,4 +294,4 @@ declare function getAppInstance(): any;
269
294
  declare const CATEGORY_INFO: Record<string, CategoryInfo>;
270
295
  declare function buildRouteList(app: any): RouteMetadata[];
271
296
 
272
- export { CACHE_CONFIGS, CATEGORY_INFO, type CacheConfig, CacheService, type GeneralSettings, type RouteMetadata, type Setting, SettingsService, TelemetryService, buildRouteList, createInstallationIdentity, getAppInstance, getCacheService, getTelemetryService, initTelemetry, setAppInstance };
297
+ export { CACHE_CONFIGS, CATEGORY_INFO, type CacheConfig, CacheService, type CollectionRecord, CollectionRegistry, type CollectionRowShape, type GeneralSettings, type RouteMetadata, type SecuritySettings, SettingsService, TelemetryService, buildRouteList, collectionRecordToRow, createInstallationIdentity, getAppInstance, getCacheService, getCollectionRegistry, getTelemetryService, initTelemetry, resetCollectionRegistry, setAppInstance };
@@ -1,15 +1,79 @@
1
- export { C as CorePlugin, L as LogCategory, a as LogEntry, b as LogFilter, c as LogLevel, d as Logger, M as Migration, e as MigrationService, f as MigrationStatus, P as PluginBootstrapService, g as PluginService, h as backfillFormSubmissions, i as cleanupRemovedCollections, j as createContentFromSubmission, k as deriveCollectionSchemaFromFormio, l as deriveSubmissionTitle, m as fullCollectionSync, n as getAvailableCollectionNames, o as getLogger, p as getManagedCollections, q as initLogger, r as isCollectionManaged, s as loadCollectionConfig, t as loadCollectionConfigs, u as mapFormStatusToContentStatus, v as registerCollections, w as syncAllFormCollections, x as syncCollection, y as syncCollections, z as syncFormCollection, A as validateCollectionConfig } from './plugin-bootstrap-P_ciLp_C.js';
1
+ export { C as CorePlugin, L as LogCategory, a as LogEntry, b as LogFilter, c as LogLevel, d as Logger, M as Migration, e as MigrationService, f as MigrationStatus, P as PluginBootstrapService, g as PluginService, h as getAvailableCollectionNames, i as getLogger, j as initLogger, l as loadCollectionConfig, k as loadCollectionConfigs, r as registerCollections, v as validateCollectionConfig } from './plugin-bootstrap-qu8hJgUt.js';
2
+ import { C as CollectionConfig } from './collection-config-JgHOpFCG.js';
2
3
  import { T as TelemetryConfig, b as TelemetryIdentity, a as TelemetryEvent, c as TelemetryProperties } from './telemetry-B9vIV4wh.js';
3
- import './collection-config-B4PG-AaF.js';
4
4
  import '@cloudflare/workers-types';
5
5
  import 'drizzle-zod';
6
6
  import 'drizzle-orm/sqlite-core';
7
7
 
8
8
  /**
9
- * Simple Cache Service
9
+ * CollectionRegistry in-memory registry of code-defined collections.
10
10
  *
11
- * Provides basic caching functionality for the core package
12
- * Can be extended with KV or other storage backends
11
+ * Replaces the DB `collections` table as the source of truth for collection
12
+ * metadata. Populated once at bootstrap from `loadCollectionConfigs()` (which
13
+ * reads code-registered collections). Code-defined IDs are stable across envs:
14
+ * `collection.id === collection.name`.
15
+ */
16
+
17
+ interface CollectionRecord extends CollectionConfig {
18
+ /** Stable id = collection.name. Always equals `name` for code-defined collections. */
19
+ id: string;
20
+ }
21
+ declare class CollectionRegistry {
22
+ private byName;
23
+ private bySlug;
24
+ /**
25
+ * Replace the registry contents with the given configs. Idempotent —
26
+ * calling with the same configs twice yields the same state.
27
+ */
28
+ register(configs: CollectionConfig[]): void;
29
+ /** All registered collections (including inactive). */
30
+ list(): CollectionRecord[];
31
+ /** Active collections only. */
32
+ listActive(): CollectionRecord[];
33
+ getByName(name: string): CollectionRecord | undefined;
34
+ /** For code-defined collections, id === name. */
35
+ getById(id: string): CollectionRecord | undefined;
36
+ /** Look up by the URL slug (set in CollectionConfig.slug). Falls back to getByName if needed. */
37
+ getBySlug(slug: string): CollectionRecord | undefined;
38
+ /** Resolve a path segment to a record — tries slug first, then name. */
39
+ getBySlugOrName(slugOrName: string): CollectionRecord | undefined;
40
+ isActive(name: string): boolean;
41
+ size(): number;
42
+ /** Test helper — wipe state. */
43
+ clear(): void;
44
+ }
45
+ /**
46
+ * Map a registry record to the snake_case shape historically returned by
47
+ * `SELECT * FROM collections`. Used by API routes during the consumer
48
+ * migration so downstream clients see no schema drift.
49
+ */
50
+ interface CollectionRowShape {
51
+ id: string;
52
+ name: string;
53
+ display_name: string;
54
+ description: string | null;
55
+ schema: any;
56
+ is_active: number;
57
+ managed: number;
58
+ source_type: string;
59
+ source_id: string | null;
60
+ created_at: number;
61
+ updated_at: number;
62
+ }
63
+ declare function collectionRecordToRow(record: CollectionRecord): CollectionRowShape;
64
+ declare function getCollectionRegistry(): CollectionRegistry;
65
+ /** Test helper — reset singleton between tests. */
66
+ declare function resetCollectionRegistry(): void;
67
+
68
+ /**
69
+ * Cache Service Adapter
70
+ *
71
+ * Thin facade over the cache plugin's `CacheService` so route code can keep its
72
+ * legacy `{ ttl, keyPrefix }` contract while writes land in the plugin's
73
+ * singleton — that's the same registry the admin dashboard at /admin/cache reads
74
+ * via `getAllCacheStats()`. Without this adapter the two caches would be split:
75
+ * routes would write to one, the dashboard would read from another, and the UI
76
+ * would always show zero entries.
13
77
  */
14
78
  interface CacheConfig {
15
79
  ttl: number;
@@ -17,49 +81,25 @@ interface CacheConfig {
17
81
  }
18
82
  declare class CacheService {
19
83
  private config;
20
- private memoryCache;
84
+ private inner;
85
+ private keyExpiry;
21
86
  constructor(config: CacheConfig);
22
- /**
23
- * Generate cache key with prefix
24
- */
25
87
  generateKey(type: string, identifier?: string): string;
26
- /**
27
- * Get value from cache
28
- */
29
88
  get<T>(key: string): Promise<T | null>;
30
- /**
31
- * Get value from cache with source information
32
- */
33
89
  getWithSource<T>(key: string): Promise<{
34
90
  hit: boolean;
35
91
  data: T | null;
36
92
  source: string;
37
93
  ttl?: number;
38
94
  }>;
39
- /**
40
- * Set value in cache
41
- */
42
95
  set(key: string, value: any, ttl?: number): Promise<void>;
43
- /**
44
- * Delete specific key from cache
45
- */
46
96
  delete(key: string): Promise<void>;
47
- /**
48
- * Invalidate cache keys matching a pattern
49
- * For memory cache, we do simple string matching
50
- */
51
97
  invalidate(pattern: string): Promise<void>;
52
- /**
53
- * Clear all cache
54
- */
55
98
  clear(): Promise<void>;
56
- /**
57
- * Get value from cache or set it using a callback
58
- */
59
99
  getOrSet<T>(key: string, callback: () => Promise<T>, ttl?: number): Promise<T>;
60
100
  }
61
101
  /**
62
- * Cache configurations for different data types
102
+ * Default cache configurations for different data types.
63
103
  */
64
104
  declare const CACHE_CONFIGS: {
65
105
  api: {
@@ -80,18 +120,11 @@ declare const CACHE_CONFIGS: {
80
120
  };
81
121
  };
82
122
  /**
83
- * Get cache service instance for a config
123
+ * Resolve a cache service for a config. Wraps the plugin's singleton so admin
124
+ * dashboard stats and route-side writes share the same store.
84
125
  */
85
126
  declare function getCacheService(config: CacheConfig): CacheService;
86
127
 
87
- interface Setting {
88
- id: string;
89
- category: string;
90
- key: string;
91
- value: string;
92
- created_at: number;
93
- updated_at: number;
94
- }
95
128
  interface GeneralSettings {
96
129
  siteName: string;
97
130
  siteDescription: string;
@@ -108,21 +141,13 @@ declare class SettingsService {
108
141
  private db;
109
142
  constructor(db: D1Database);
110
143
  /**
111
- * Get a setting value by category and key
112
- */
113
- getSetting(category: string, key: string): Promise<any | null>;
114
- /**
115
- * Get all settings for a category
116
- */
117
- getCategorySettings(category: string): Promise<Record<string, any>>;
118
- /**
119
- * Set a setting value
144
+ * Get settings document for a category (general or security)
120
145
  */
121
- setSetting(category: string, key: string, value: any): Promise<boolean>;
146
+ private getSettingsDocument;
122
147
  /**
123
- * Set multiple settings at once
148
+ * Save settings document for a category (general or security)
124
149
  */
125
- setMultipleSettings(category: string, settings: Record<string, any>): Promise<boolean>;
150
+ private saveSettingsDocument;
126
151
  /**
127
152
  * Get general settings with defaults
128
153
  */
@@ -269,4 +294,4 @@ declare function getAppInstance(): any;
269
294
  declare const CATEGORY_INFO: Record<string, CategoryInfo>;
270
295
  declare function buildRouteList(app: any): RouteMetadata[];
271
296
 
272
- export { CACHE_CONFIGS, CATEGORY_INFO, type CacheConfig, CacheService, type GeneralSettings, type RouteMetadata, type Setting, SettingsService, TelemetryService, buildRouteList, createInstallationIdentity, getAppInstance, getCacheService, getTelemetryService, initTelemetry, setAppInstance };
297
+ export { CACHE_CONFIGS, CATEGORY_INFO, type CacheConfig, CacheService, type CollectionRecord, CollectionRegistry, type CollectionRowShape, type GeneralSettings, type RouteMetadata, type SecuritySettings, SettingsService, TelemetryService, buildRouteList, collectionRecordToRow, createInstallationIdentity, getAppInstance, getCacheService, getCollectionRegistry, getTelemetryService, initTelemetry, resetCollectionRegistry, setAppInstance };
package/dist/services.js CHANGED
@@ -1,7 +1,10 @@
1
- export { CACHE_CONFIGS, CATEGORY_INFO, CacheService, Logger, SettingsService, TelemetryService, buildRouteList, createInstallationIdentity, getAppInstance, getCacheService, getLogger, getTelemetryService, initLogger, initTelemetry, setAppInstance } from './chunk-QFWHAFEO.js';
2
- export { PluginBootstrapService, PluginService, backfillFormSubmissions, cleanupRemovedCollections, createContentFromSubmission, deriveCollectionSchemaFromFormio, deriveSubmissionTitle, fullCollectionSync, getAvailableCollectionNames, getManagedCollections, isCollectionManaged, loadCollectionConfig, loadCollectionConfigs, mapFormStatusToContentStatus, registerCollections, syncAllFormCollections, syncCollection, syncCollections, syncFormCollection, validateCollectionConfig } from './chunk-JZV22DEV.js';
3
- export { MigrationService } from './chunk-ZYAYUIZE.js';
1
+ export { CACHE_CONFIGS, CATEGORY_INFO, CacheService, Logger, SettingsService, TelemetryService, buildRouteList, createInstallationIdentity, getAppInstance, getCacheService, getLogger, getTelemetryService, initLogger, initTelemetry, setAppInstance } from './chunk-ZEZ245PW.js';
2
+ import './chunk-K25XHMM3.js';
3
+ import './chunk-AI663NBO.js';
4
+ export { CollectionRegistry, PluginBootstrapService, PluginService, collectionRecordToRow, getAvailableCollectionNames, getCollectionRegistry, loadCollectionConfig, loadCollectionConfigs, registerCollections, resetCollectionRegistry, validateCollectionConfig } from './chunk-ZGGXCFR6.js';
5
+ export { MigrationService } from './chunk-NLJVSER2.js';
4
6
  import './chunk-X7ZAEI5S.js';
7
+ import './chunk-TQABQWOP.js';
5
8
  import './chunk-V4OQ3NZ2.js';
6
9
  //# sourceMappingURL=services.js.map
7
10
  //# sourceMappingURL=services.js.map