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

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 (170) hide show
  1. package/README.md +48 -49
  2. package/dist/admin-documents-form.template-DDSH6ROU.js +6 -0
  3. package/dist/{admin-documents-form.template-NLSI6Z42.js.map → admin-documents-form.template-DDSH6ROU.js.map} +1 -1
  4. package/dist/admin-documents-form.template-LSZKGA5J.cjs +19 -0
  5. package/dist/{admin-layout-catalyst.template-WHJGSWWD.js.map → admin-documents-form.template-LSZKGA5J.cjs.map} +1 -1
  6. package/dist/{filter-bar.template-DlVYMk-T.d.ts → admin-layout-catalyst.template-DrwDUfsE.d.cts} +25 -1
  7. package/dist/{filter-bar.template-DlVYMk-T.d.cts → admin-layout-catalyst.template-DrwDUfsE.d.ts} +25 -1
  8. package/dist/admin-layout-catalyst.template-KDHKVLXR.cjs +21 -0
  9. package/dist/{admin-layout-catalyst.template-ZK5HD545.cjs.map → admin-layout-catalyst.template-KDHKVLXR.cjs.map} +1 -1
  10. package/dist/admin-layout-catalyst.template-YQ4EMF2J.js +7 -0
  11. package/dist/{admin-documents-form.template-KN7JF66Q.cjs.map → admin-layout-catalyst.template-YQ4EMF2J.js.map} +1 -1
  12. package/dist/{app-Bo0X1OWX.d.ts → app-01M0dIwt.d.ts} +1 -1
  13. package/dist/{app-Do66yCcV.d.cts → app-aj39TGHB.d.cts} +1 -1
  14. package/dist/{chunk-ZEZ245PW.js → chunk-2XAQTPAE.js} +4 -236
  15. package/dist/chunk-2XAQTPAE.js.map +1 -0
  16. package/dist/{chunk-BDDABDAB.cjs → chunk-36Z3AKX3.cjs} +3 -239
  17. package/dist/chunk-36Z3AKX3.cjs.map +1 -0
  18. package/dist/{chunk-BLMTL57B.js → chunk-3TMTYJAJ.js} +26 -4
  19. package/dist/chunk-3TMTYJAJ.js.map +1 -0
  20. package/dist/{chunk-ZGGXCFR6.js → chunk-4LVVMVQI.js} +282 -4
  21. package/dist/chunk-4LVVMVQI.js.map +1 -0
  22. package/dist/{chunk-RZ6H7OZK.js → chunk-4UYJPHSV.js} +87 -12
  23. package/dist/chunk-4UYJPHSV.js.map +1 -0
  24. package/dist/{chunk-NLJVSER2.js → chunk-5U75XP74.js} +3 -2
  25. package/dist/chunk-5U75XP74.js.map +1 -0
  26. package/dist/{chunk-H2AXVCLS.cjs → chunk-5UXU3LP4.cjs} +141 -74
  27. package/dist/chunk-5UXU3LP4.cjs.map +1 -0
  28. package/dist/{chunk-3TB6AT6X.js → chunk-5V62WT6M.js} +35 -4
  29. package/dist/chunk-5V62WT6M.js.map +1 -0
  30. package/dist/{chunk-6OUHGKFD.js → chunk-7OTOXWEB.js} +3 -3
  31. package/dist/{chunk-6OUHGKFD.js.map → chunk-7OTOXWEB.js.map} +1 -1
  32. package/dist/{chunk-VXE42MYF.cjs → chunk-7RUW244J.cjs} +710 -434
  33. package/dist/chunk-7RUW244J.cjs.map +1 -0
  34. package/dist/{chunk-XW56B23A.cjs → chunk-A4KUJ3LD.cjs} +4 -4
  35. package/dist/{chunk-XW56B23A.cjs.map → chunk-A4KUJ3LD.cjs.map} +1 -1
  36. package/dist/{chunk-LRZIAW7U.cjs → chunk-AOUVUF32.cjs} +3 -3
  37. package/dist/chunk-AOUVUF32.cjs.map +1 -0
  38. package/dist/{chunk-WULONYGB.cjs → chunk-CRGUD4KC.cjs} +9 -9
  39. package/dist/{chunk-WULONYGB.cjs.map → chunk-CRGUD4KC.cjs.map} +1 -1
  40. package/dist/{chunk-AAWNRBRB.cjs → chunk-FCLKX2OS.cjs} +95 -20
  41. package/dist/chunk-FCLKX2OS.cjs.map +1 -0
  42. package/dist/{chunk-YHSQVQXX.js → chunk-GICS5AIO.js} +135 -68
  43. package/dist/chunk-GICS5AIO.js.map +1 -0
  44. package/dist/{chunk-NUKJ54GA.cjs → chunk-GMMCCIQO.cjs} +6 -6
  45. package/dist/{chunk-NUKJ54GA.cjs.map → chunk-GMMCCIQO.cjs.map} +1 -1
  46. package/dist/{chunk-NMPEMSU4.js → chunk-JEX3UPZL.js} +3 -3
  47. package/dist/chunk-JEX3UPZL.js.map +1 -0
  48. package/dist/{chunk-6JQOUUOB.js → chunk-JQISFW6U.js} +3 -3
  49. package/dist/{chunk-6JQOUUOB.js.map → chunk-JQISFW6U.js.map} +1 -1
  50. package/dist/{chunk-NAVPFIG5.cjs → chunk-K623Q6WD.cjs} +35 -3
  51. package/dist/chunk-K623Q6WD.cjs.map +1 -0
  52. package/dist/{chunk-JEQ7FLOD.cjs → chunk-KIGVVO6N.cjs} +16 -10
  53. package/dist/chunk-KIGVVO6N.cjs.map +1 -0
  54. package/dist/{chunk-QAYFOER6.cjs → chunk-KVBHB7QP.cjs} +285 -3
  55. package/dist/chunk-KVBHB7QP.cjs.map +1 -0
  56. package/dist/{chunk-2CB4KY7I.cjs → chunk-LTZ5WYOK.cjs} +29 -7
  57. package/dist/chunk-LTZ5WYOK.cjs.map +1 -0
  58. package/dist/{chunk-DNQCEKUK.cjs → chunk-N32OWET6.cjs} +5 -5
  59. package/dist/{chunk-DNQCEKUK.cjs.map → chunk-N32OWET6.cjs.map} +1 -1
  60. package/dist/{chunk-HDWE5FRJ.js → chunk-OBA2RYZN.js} +3 -3
  61. package/dist/{chunk-HDWE5FRJ.js.map → chunk-OBA2RYZN.js.map} +1 -1
  62. package/dist/{chunk-DSA4UX5B.cjs → chunk-OJC4G5JE.cjs} +3 -2
  63. package/dist/chunk-OJC4G5JE.cjs.map +1 -0
  64. package/dist/{chunk-MVIZJOO5.cjs → chunk-PXNTCCPE.cjs} +8 -8
  65. package/dist/{chunk-MVIZJOO5.cjs.map → chunk-PXNTCCPE.cjs.map} +1 -1
  66. package/dist/{chunk-EF2NQUIQ.js → chunk-RMRJGMDE.js} +3 -3
  67. package/dist/{chunk-EF2NQUIQ.js.map → chunk-RMRJGMDE.js.map} +1 -1
  68. package/dist/{chunk-IVPRUGTY.js → chunk-SOZUG52O.js} +4 -4
  69. package/dist/{chunk-IVPRUGTY.js.map → chunk-SOZUG52O.js.map} +1 -1
  70. package/dist/{chunk-GCDZZNIN.js → chunk-UWUP2VMT.js} +16 -10
  71. package/dist/chunk-UWUP2VMT.js.map +1 -0
  72. package/dist/{chunk-IESEVHXL.js → chunk-VVYVFCML.js} +12 -3
  73. package/dist/chunk-VVYVFCML.js.map +1 -0
  74. package/dist/{chunk-HIKBY7MS.cjs → chunk-XWVDSM2L.cjs} +12 -3
  75. package/dist/chunk-XWVDSM2L.cjs.map +1 -0
  76. package/dist/{chunk-VD2EA3WT.js → chunk-ZP77LTN4.js} +343 -68
  77. package/dist/chunk-ZP77LTN4.js.map +1 -0
  78. package/dist/{collection-config-JgHOpFCG.d.ts → collection-config-BTzAvKt2.d.cts} +25 -0
  79. package/dist/{collection-config-JgHOpFCG.d.cts → collection-config-BTzAvKt2.d.ts} +25 -0
  80. package/dist/config-6FB2BXMP.js +6 -0
  81. package/dist/{config-HFXANXCC.js.map → config-6FB2BXMP.js.map} +1 -1
  82. package/dist/config-OCH7S4WK.cjs +19 -0
  83. package/dist/{config-ON6FNMYX.cjs.map → config-OCH7S4WK.cjs.map} +1 -1
  84. package/dist/{define-plugin-BzNHc1ZI.d.ts → define-plugin-BYIey6sp.d.ts} +1 -1
  85. package/dist/{define-plugin-IWDKYaVm.d.cts → define-plugin-DsKiGu1q.d.cts} +1 -1
  86. package/dist/document-projection-4HG75S5S.js +4 -0
  87. package/dist/{document-projection-YYMC6I4U.js.map → document-projection-4HG75S5S.js.map} +1 -1
  88. package/dist/document-projection-JQHSTSFD.cjs +13 -0
  89. package/dist/{document-projection-TDWRJX3Z.cjs.map → document-projection-JQHSTSFD.cjs.map} +1 -1
  90. package/dist/index.cjs +1119 -440
  91. package/dist/index.cjs.map +1 -1
  92. package/dist/index.d.cts +200 -12
  93. package/dist/index.d.ts +200 -12
  94. package/dist/index.js +803 -137
  95. package/dist/index.js.map +1 -1
  96. package/dist/middleware.cjs +37 -34
  97. package/dist/middleware.d.cts +2 -2
  98. package/dist/middleware.d.ts +2 -2
  99. package/dist/middleware.js +8 -5
  100. package/dist/migrations-HMX5SPN2.js +4 -0
  101. package/dist/{migrations-WCAVBD7C.js.map → migrations-HMX5SPN2.js.map} +1 -1
  102. package/dist/migrations-V73ARYV5.cjs +13 -0
  103. package/dist/{migrations-NJJWQUKK.cjs.map → migrations-V73ARYV5.cjs.map} +1 -1
  104. package/dist/{plugin-bootstrap-B8ThJU21.d.cts → plugin-bootstrap-BHWQ2df8.d.cts} +1 -1
  105. package/dist/{plugin-bootstrap-qu8hJgUt.d.ts → plugin-bootstrap-Bj4fxX1q.d.ts} +1 -1
  106. package/dist/plugins.cjs +40 -40
  107. package/dist/plugins.d.cts +2 -2
  108. package/dist/plugins.d.ts +2 -2
  109. package/dist/plugins.js +3 -3
  110. package/dist/rbac-7QZ4JZ2E.cjs +14 -0
  111. package/dist/{rbac-VONLJJKB.cjs.map → rbac-7QZ4JZ2E.cjs.map} +1 -1
  112. package/dist/rbac-Y43IEQOP.js +5 -0
  113. package/dist/{rbac-O73MFKDA.js.map → rbac-Y43IEQOP.js.map} +1 -1
  114. package/dist/routes.cjs +34 -34
  115. package/dist/routes.d.cts +2 -2
  116. package/dist/routes.d.ts +2 -2
  117. package/dist/routes.js +14 -14
  118. package/dist/services.cjs +42 -42
  119. package/dist/services.d.cts +16 -3
  120. package/dist/services.d.ts +16 -3
  121. package/dist/services.js +3 -3
  122. package/dist/{telemetry-B9vIV4wh.d.cts → telemetry-Cku1ax74.d.cts} +1 -1
  123. package/dist/{telemetry-B9vIV4wh.d.ts → telemetry-Cku1ax74.d.ts} +1 -1
  124. package/dist/templates.cjs +17 -17
  125. package/dist/templates.d.cts +2 -24
  126. package/dist/templates.d.ts +2 -24
  127. package/dist/templates.js +3 -3
  128. package/dist/{types-Dea1eNxU.d.ts → types-DT7XN5TX.d.cts} +1 -1
  129. package/dist/{types-Dea1eNxU.d.cts → types-DT7XN5TX.d.ts} +1 -1
  130. package/dist/types.d.cts +2 -2
  131. package/dist/types.d.ts +2 -2
  132. package/dist/utils.cjs +8 -8
  133. package/dist/utils.d.cts +2 -2
  134. package/dist/utils.d.ts +2 -2
  135. package/dist/utils.js +2 -2
  136. package/package.json +1 -1
  137. package/dist/admin-documents-form.template-KN7JF66Q.cjs +0 -19
  138. package/dist/admin-documents-form.template-NLSI6Z42.js +0 -6
  139. package/dist/admin-layout-catalyst.template-WHJGSWWD.js +0 -7
  140. package/dist/admin-layout-catalyst.template-ZK5HD545.cjs +0 -17
  141. package/dist/chunk-2CB4KY7I.cjs.map +0 -1
  142. package/dist/chunk-3TB6AT6X.js.map +0 -1
  143. package/dist/chunk-AAWNRBRB.cjs.map +0 -1
  144. package/dist/chunk-BDDABDAB.cjs.map +0 -1
  145. package/dist/chunk-BLMTL57B.js.map +0 -1
  146. package/dist/chunk-DSA4UX5B.cjs.map +0 -1
  147. package/dist/chunk-GCDZZNIN.js.map +0 -1
  148. package/dist/chunk-H2AXVCLS.cjs.map +0 -1
  149. package/dist/chunk-HIKBY7MS.cjs.map +0 -1
  150. package/dist/chunk-IESEVHXL.js.map +0 -1
  151. package/dist/chunk-JEQ7FLOD.cjs.map +0 -1
  152. package/dist/chunk-LRZIAW7U.cjs.map +0 -1
  153. package/dist/chunk-NAVPFIG5.cjs.map +0 -1
  154. package/dist/chunk-NLJVSER2.js.map +0 -1
  155. package/dist/chunk-NMPEMSU4.js.map +0 -1
  156. package/dist/chunk-QAYFOER6.cjs.map +0 -1
  157. package/dist/chunk-RZ6H7OZK.js.map +0 -1
  158. package/dist/chunk-VD2EA3WT.js.map +0 -1
  159. package/dist/chunk-VXE42MYF.cjs.map +0 -1
  160. package/dist/chunk-YHSQVQXX.js.map +0 -1
  161. package/dist/chunk-ZEZ245PW.js.map +0 -1
  162. package/dist/chunk-ZGGXCFR6.js.map +0 -1
  163. package/dist/config-HFXANXCC.js +0 -6
  164. package/dist/config-ON6FNMYX.cjs +0 -19
  165. package/dist/document-projection-TDWRJX3Z.cjs +0 -13
  166. package/dist/document-projection-YYMC6I4U.js +0 -4
  167. package/dist/migrations-NJJWQUKK.cjs +0 -13
  168. package/dist/migrations-WCAVBD7C.js +0 -4
  169. package/dist/rbac-O73MFKDA.js +0 -5
  170. package/dist/rbac-VONLJJKB.cjs +0 -14
package/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
  To create a new SonicJS project, use:
15
15
 
16
16
  ```bash
17
- npx create-sonicjs my-app
17
+ npx create-sonicjs@latest my-app
18
18
  ```
19
19
 
20
20
  This is the recommended way to get started with SonicJS. It sets up everything you need with a single command.
@@ -28,9 +28,9 @@ This is the recommended way to get started with SonicJS. It sets up everything y
28
28
  - 🔒 **Type-Safe**: Full TypeScript support with comprehensive type definitions
29
29
  - 🔌 **Plugin System**: Extensible architecture with hooks and middleware
30
30
  - ⚡ **Three-Tier Caching**: Memory, KV, and database layers for optimal performance
31
- - 🎨 **Admin Interface**: Beautiful glass morphism design system
32
- - 🔐 **Authentication**: JWT-based auth with role-based permissions
33
- - 📝 **Content Management**: Dynamic collections with versioning and workflows
31
+ - 🎨 **Admin Interface**: Glass-morphism design system
32
+ - 🔐 **Authentication**: Better Auth with session management and role-based permissions
33
+ - 📝 **Content Management**: Document-model collections with versioning
34
34
  - 🖼️ **Media Management**: R2 storage with automatic optimization
35
35
  - 🌐 **REST API**: Auto-generated endpoints for all collections
36
36
 
@@ -54,22 +54,24 @@ npm install wrangler drizzle-kit # For development
54
54
 
55
55
  ## 🚀 Quick Start
56
56
 
57
- ### 1. Create Your Application
57
+ ### 1. Register Collections and Create Your Application
58
58
 
59
59
  ```typescript
60
60
  // src/index.ts
61
- import { createSonicJSApp } from '@sonicjs-cms/core'
61
+ import {
62
+ createSonicJSApp,
63
+ registerCollections,
64
+ } from '@sonicjs-cms/core'
62
65
  import type { SonicJSConfig } from '@sonicjs-cms/core'
66
+ import blogPostsCollection from './collections/blog-posts.collection'
67
+
68
+ // Register code-defined collections before creating the app
69
+ registerCollections([blogPostsCollection])
63
70
 
64
71
  const config: SonicJSConfig = {
65
- collections: {
66
- directory: './src/collections',
67
- autoSync: true
68
- },
69
72
  plugins: {
70
- directory: './src/plugins',
71
- autoLoad: false
72
- }
73
+ register: [/* your plugins here */],
74
+ },
73
75
  }
74
76
 
75
77
  export default createSonicJSApp(config)
@@ -77,13 +79,16 @@ export default createSonicJSApp(config)
77
79
 
78
80
  ### 2. Define Collections
79
81
 
82
+ Collections are TypeScript config objects — no database table required.
83
+
80
84
  ```typescript
81
85
  // src/collections/blog-posts.collection.ts
82
86
  import type { CollectionConfig } from '@sonicjs-cms/core'
83
87
 
84
88
  export default {
85
- name: 'blog-posts',
86
- displayName: 'Blog Posts',
89
+ name: 'blog_post',
90
+ displayName: 'Blog Post',
91
+ slug: 'blog-posts',
87
92
  description: 'Manage your blog posts',
88
93
 
89
94
  schema: {
@@ -93,26 +98,23 @@ export default {
93
98
  type: 'string',
94
99
  title: 'Title',
95
100
  required: true,
96
- maxLength: 200
101
+ maxLength: 200,
97
102
  },
98
103
  content: {
99
- type: 'markdown',
104
+ type: 'lexical',
100
105
  title: 'Content',
101
- required: true
106
+ required: true,
102
107
  },
103
108
  publishedAt: {
104
109
  type: 'datetime',
105
- title: 'Published Date'
110
+ title: 'Published Date',
106
111
  },
107
- status: {
108
- type: 'select',
109
- title: 'Status',
110
- enum: ['draft', 'published', 'archived'],
111
- default: 'draft'
112
- }
113
112
  },
114
- required: ['title', 'content']
115
- }
113
+ required: ['title', 'content'],
114
+ },
115
+
116
+ managed: true,
117
+ isActive: true,
116
118
  } satisfies CollectionConfig
117
119
  ```
118
120
 
@@ -131,7 +133,7 @@ database_id = "your-database-id"
131
133
  migrations_dir = "./node_modules/@sonicjs-cms/core/migrations"
132
134
 
133
135
  [[r2_buckets]]
134
- binding = "BUCKET"
136
+ binding = "MEDIA_BUCKET"
135
137
  bucket_name = "my-sonicjs-media"
136
138
  ```
137
139
 
@@ -152,7 +154,7 @@ Visit `http://localhost:8787/admin` to access the admin interface.
152
154
  ### Main Application
153
155
 
154
156
  ```typescript
155
- import { createSonicJSApp } from '@sonicjs-cms/core'
157
+ import { createSonicJSApp, registerCollections } from '@sonicjs-cms/core'
156
158
  import type { SonicJSConfig, SonicJSApp, Bindings, Variables } from '@sonicjs-cms/core'
157
159
  ```
158
160
 
@@ -161,7 +163,6 @@ import type { SonicJSConfig, SonicJSApp, Bindings, Variables } from '@sonicjs-cm
161
163
  ```typescript
162
164
  import {
163
165
  loadCollectionConfigs,
164
- syncCollections,
165
166
  MigrationService,
166
167
  Logger,
167
168
  PluginService
@@ -223,8 +224,8 @@ import {
223
224
  import {
224
225
  createDb,
225
226
  users,
226
- collections,
227
227
  content,
228
+ contentVersions,
228
229
  media
229
230
  } from '@sonicjs-cms/core'
230
231
  ```
@@ -272,31 +273,29 @@ customRoutes.get('/api/custom', requireAuth(), async (c) => {
272
273
 
273
274
  // In your app config
274
275
  export default createSonicJSApp({
275
- routes: [{ path: '/custom', handler: customRoutes }]
276
+ plugins: {
277
+ register: [{ name: 'custom', version: '1.0.0', register: (app) => app.route('/custom', customRoutes) }],
278
+ },
276
279
  })
277
280
  ```
278
281
 
279
282
  ### Custom Plugin
280
283
 
281
284
  ```typescript
282
- import type { Plugin } from '@sonicjs-cms/core'
285
+ import type { Plugin, PluginContext } from '@sonicjs-cms/core'
283
286
 
284
287
  export default {
285
288
  name: 'my-plugin',
286
289
  version: '1.0.0',
287
290
  description: 'My custom plugin',
288
291
 
289
- async onActivate() {
292
+ async activate(context: PluginContext) {
290
293
  console.log('Plugin activated!')
291
294
  },
292
295
 
293
- hooks: {
294
- 'content.beforeSave': async (content) => {
295
- // Transform content before saving
296
- content.metadata = { modified: new Date() }
297
- return content
298
- }
299
- }
296
+ async install(context: PluginContext) {
297
+ // Run once on install — migrations, seed data, etc.
298
+ },
300
299
  } satisfies Plugin
301
300
  ```
302
301
 
@@ -409,16 +408,16 @@ The `generate-migrations.ts` script:
409
408
 
410
409
  SonicJS follows semantic versioning:
411
410
 
412
- - **v2.x.x** - Current npm package (core extracted)
413
- - **v1.x.x** - Legacy monolith (deprecated)
411
+ - **v3.x.x** - Current (document model, Better Auth, edge-first)
412
+ - **v2.x.x** - Legacy monolith (deprecated)
414
413
 
415
- **Current Version**: `2.0.0-alpha.1`
414
+ **Current Version**: `3.0.0-beta.9`
416
415
 
417
416
  ### Upgrade Path
418
417
 
419
418
  ```bash
420
- # Install the new package
421
- npm install @sonicjs-cms/core@2.0.0-alpha.1
419
+ # Install the latest package
420
+ npm install @sonicjs-cms/core@latest
422
421
 
423
422
  # Run any new migrations
424
423
  wrangler d1 migrations apply DB
@@ -467,12 +466,12 @@ MIT © SonicJS Team - See [LICENSE](./LICENSE) for details.
467
466
 
468
467
  ## 🛡️ Security
469
468
 
470
- - JWT authentication
471
- - Role-based access control (RBAC)
469
+ - Better Auth (sessions + RBAC)
470
+ - Role-based access control
472
471
  - Permission system
473
472
  - Secure headers
474
473
  - Input sanitization
475
474
 
476
475
  ---
477
476
 
478
- **Built with ❤️ for the edge** | v2.0.0-alpha.1
477
+ **Built with ❤️ for the edge** | v3.0.0-beta.9
@@ -0,0 +1,6 @@
1
+ export { renderDocumentFormPage, renderVersionHistoryFragment } from './chunk-RMRJGMDE.js';
2
+ import './chunk-5V62WT6M.js';
3
+ import './chunk-TQABQWOP.js';
4
+ import './chunk-V4OQ3NZ2.js';
5
+ //# sourceMappingURL=admin-documents-form.template-DDSH6ROU.js.map
6
+ //# sourceMappingURL=admin-documents-form.template-DDSH6ROU.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"admin-documents-form.template-NLSI6Z42.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"admin-documents-form.template-DDSH6ROU.js"}
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var chunkN32OWET6_cjs = require('./chunk-N32OWET6.cjs');
4
+ require('./chunk-K623Q6WD.cjs');
5
+ require('./chunk-MNWKYY5E.cjs');
6
+ require('./chunk-IGJUBJBW.cjs');
7
+
8
+
9
+
10
+ Object.defineProperty(exports, "renderDocumentFormPage", {
11
+ enumerable: true,
12
+ get: function () { return chunkN32OWET6_cjs.renderDocumentFormPage; }
13
+ });
14
+ Object.defineProperty(exports, "renderVersionHistoryFragment", {
15
+ enumerable: true,
16
+ get: function () { return chunkN32OWET6_cjs.renderVersionHistoryFragment; }
17
+ });
18
+ //# sourceMappingURL=admin-documents-form.template-LSZKGA5J.cjs.map
19
+ //# sourceMappingURL=admin-documents-form.template-LSZKGA5J.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"admin-layout-catalyst.template-WHJGSWWD.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"admin-documents-form.template-LSZKGA5J.cjs"}
@@ -1,3 +1,5 @@
1
+ import { HtmlEscapedString } from 'hono/utils/html';
2
+
1
3
  interface FormField {
2
4
  name: string;
3
5
  label: string;
@@ -138,4 +140,26 @@ interface FilterBarData {
138
140
  }
139
141
  declare function renderFilterBar(data: FilterBarData): string;
140
142
 
141
- export { type AlertData as A, type ConfirmationDialogOptions as C, type Filter as F, type PaginationData as P, type TableColumn as T, type FilterBarData as a, type FilterOption as b, type FormData as c, type FormField as d, type TableData as e, renderConfirmationDialog as f, getConfirmationDialogScript as g, renderFilterBar as h, renderForm as i, renderFormField as j, renderPagination as k, renderTable as l, renderAlert as r };
143
+ interface AdminLayoutCatalystData {
144
+ title: string;
145
+ pageTitle?: string;
146
+ currentPath?: string;
147
+ version?: string;
148
+ enableExperimentalFeatures?: boolean;
149
+ user?: {
150
+ name: string;
151
+ email: string;
152
+ role: string;
153
+ };
154
+ scripts?: string[];
155
+ styles?: string[];
156
+ content: string | HtmlEscapedString;
157
+ dynamicMenuItems?: Array<{
158
+ label: string;
159
+ path: string;
160
+ icon: string;
161
+ }>;
162
+ }
163
+ declare function renderAdminLayoutCatalyst(data: AdminLayoutCatalystData): string;
164
+
165
+ export { type AdminLayoutCatalystData as A, type ConfirmationDialogOptions as C, type Filter as F, type PaginationData as P, type TableColumn as T, type AlertData as a, type FilterBarData as b, type FilterOption as c, type FormData as d, type FormField as e, type TableData as f, getConfirmationDialogScript as g, renderAlert as h, renderConfirmationDialog as i, renderFilterBar as j, renderForm as k, renderFormField as l, renderPagination as m, renderTable as n, renderAdminLayoutCatalyst as r };
@@ -1,3 +1,5 @@
1
+ import { HtmlEscapedString } from 'hono/utils/html';
2
+
1
3
  interface FormField {
2
4
  name: string;
3
5
  label: string;
@@ -138,4 +140,26 @@ interface FilterBarData {
138
140
  }
139
141
  declare function renderFilterBar(data: FilterBarData): string;
140
142
 
141
- export { type AlertData as A, type ConfirmationDialogOptions as C, type Filter as F, type PaginationData as P, type TableColumn as T, type FilterBarData as a, type FilterOption as b, type FormData as c, type FormField as d, type TableData as e, renderConfirmationDialog as f, getConfirmationDialogScript as g, renderFilterBar as h, renderForm as i, renderFormField as j, renderPagination as k, renderTable as l, renderAlert as r };
143
+ interface AdminLayoutCatalystData {
144
+ title: string;
145
+ pageTitle?: string;
146
+ currentPath?: string;
147
+ version?: string;
148
+ enableExperimentalFeatures?: boolean;
149
+ user?: {
150
+ name: string;
151
+ email: string;
152
+ role: string;
153
+ };
154
+ scripts?: string[];
155
+ styles?: string[];
156
+ content: string | HtmlEscapedString;
157
+ dynamicMenuItems?: Array<{
158
+ label: string;
159
+ path: string;
160
+ icon: string;
161
+ }>;
162
+ }
163
+ declare function renderAdminLayoutCatalyst(data: AdminLayoutCatalystData): string;
164
+
165
+ export { type AdminLayoutCatalystData as A, type ConfirmationDialogOptions as C, type Filter as F, type PaginationData as P, type TableColumn as T, type AlertData as a, type FilterBarData as b, type FilterOption as c, type FormData as d, type FormField as e, type TableData as f, getConfirmationDialogScript as g, renderAlert as h, renderConfirmationDialog as i, renderFilterBar as j, renderForm as k, renderFormField as l, renderPagination as m, renderTable as n, renderAdminLayoutCatalyst as r };
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+
3
+ var chunkK623Q6WD_cjs = require('./chunk-K623Q6WD.cjs');
4
+ require('./chunk-IGJUBJBW.cjs');
5
+
6
+ chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
7
+
8
+ Object.defineProperty(exports, "renderAdminLayoutCatalyst", {
9
+ enumerable: true,
10
+ get: function () { return chunkK623Q6WD_cjs.renderAdminLayoutCatalyst; }
11
+ });
12
+ Object.defineProperty(exports, "renderCatalystCheckbox", {
13
+ enumerable: true,
14
+ get: function () { return chunkK623Q6WD_cjs.renderCatalystCheckbox; }
15
+ });
16
+ Object.defineProperty(exports, "setBranchLabel", {
17
+ enumerable: true,
18
+ get: function () { return chunkK623Q6WD_cjs.setBranchLabel; }
19
+ });
20
+ //# sourceMappingURL=admin-layout-catalyst.template-KDHKVLXR.cjs.map
21
+ //# sourceMappingURL=admin-layout-catalyst.template-KDHKVLXR.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"admin-layout-catalyst.template-ZK5HD545.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"admin-layout-catalyst.template-KDHKVLXR.cjs"}
@@ -0,0 +1,7 @@
1
+ import { init_admin_layout_catalyst_template } from './chunk-5V62WT6M.js';
2
+ export { renderAdminLayoutCatalyst, renderCatalystCheckbox, setBranchLabel } from './chunk-5V62WT6M.js';
3
+ import './chunk-V4OQ3NZ2.js';
4
+
5
+ init_admin_layout_catalyst_template();
6
+ //# sourceMappingURL=admin-layout-catalyst.template-YQ4EMF2J.js.map
7
+ //# sourceMappingURL=admin-layout-catalyst.template-YQ4EMF2J.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"admin-documents-form.template-KN7JF66Q.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"admin-layout-catalyst.template-YQ4EMF2J.js"}
@@ -6,7 +6,7 @@ import * as better_call from 'better-call';
6
6
  import * as zod_v4_core from 'zod/v4/core';
7
7
  import * as zod from 'zod';
8
8
  import { z } from 'zod';
9
- import { i as HookSystemLike, E as EmailProvider } from './types-Dea1eNxU.js';
9
+ import { i as HookSystemLike, E as EmailProvider } from './types-DT7XN5TX.js';
10
10
  import { Hono, MiddlewareHandler, Context } from 'hono';
11
11
  import { D1Database, KVNamespace, R2Bucket } from '@cloudflare/workers-types';
12
12
 
@@ -6,7 +6,7 @@ import * as better_call from 'better-call';
6
6
  import * as zod_v4_core from 'zod/v4/core';
7
7
  import * as zod from 'zod';
8
8
  import { z } from 'zod';
9
- import { i as HookSystemLike, E as EmailProvider } from './types-Dea1eNxU.cjs';
9
+ import { i as HookSystemLike, E as EmailProvider } from './types-DT7XN5TX.cjs';
10
10
  import { Hono, MiddlewareHandler, Context } from 'hono';
11
11
  import { D1Database, KVNamespace, R2Bucket } from '@cloudflare/workers-types';
12
12
 
@@ -1,6 +1,5 @@
1
1
  import { getCacheService } from './chunk-K25XHMM3.js';
2
2
  import { systemLogs, logConfig } from './chunk-AI663NBO.js';
3
- import { getTelemetryConfig, sanitizeErrorMessage, sanitizeRoute, generateInstallationId, generateProjectId } from './chunk-X7ZAEI5S.js';
4
3
  import { drizzle } from 'drizzle-orm/d1';
5
4
  import { inArray, eq, like, gte, lte, and, count, asc, desc } from 'drizzle-orm';
6
5
  import { inspectRoutes } from 'hono/dev';
@@ -428,6 +427,7 @@ var SettingsService = class {
428
427
  constructor(db) {
429
428
  this.db = db;
430
429
  }
430
+ db;
431
431
  /**
432
432
  * Get settings document for a category (general or security)
433
433
  */
@@ -551,238 +551,6 @@ var SettingsService = class {
551
551
  return await this.saveSettingsDocument("security", merged);
552
552
  }
553
553
  };
554
-
555
- // src/services/telemetry-service.ts
556
- var TelemetryService = class {
557
- config;
558
- identity = null;
559
- enabled = true;
560
- eventQueue = [];
561
- isInitialized = false;
562
- constructor(config) {
563
- this.config = {
564
- ...getTelemetryConfig(),
565
- ...config
566
- };
567
- this.enabled = this.config.enabled;
568
- }
569
- /**
570
- * Initialize the telemetry service
571
- */
572
- async initialize(identity) {
573
- if (!this.enabled) {
574
- if (this.config.debug) {
575
- console.log("[Telemetry] Disabled via configuration");
576
- }
577
- return;
578
- }
579
- try {
580
- this.identity = identity;
581
- if (this.config.debug) {
582
- console.log("[Telemetry] Initialized with installation ID:", identity.installationId);
583
- }
584
- this.isInitialized = true;
585
- await this.flushQueue();
586
- } catch (error) {
587
- if (this.config.debug) {
588
- console.error("[Telemetry] Initialization failed:", error);
589
- }
590
- this.enabled = false;
591
- }
592
- }
593
- /**
594
- * Track a telemetry event
595
- */
596
- async track(event, properties) {
597
- if (!this.enabled) return;
598
- try {
599
- const sanitizedProps = this.sanitizeProperties(properties);
600
- const enrichedProps = {
601
- ...sanitizedProps,
602
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
603
- version: this.getVersion()
604
- };
605
- if (!this.isInitialized) {
606
- this.eventQueue.push({ event, properties: enrichedProps });
607
- if (this.config.debug) {
608
- console.log("[Telemetry] Queued event:", event, enrichedProps);
609
- }
610
- return;
611
- }
612
- if (this.identity && this.config.host) {
613
- const payload = {
614
- data: {
615
- installation_id: this.identity.installationId,
616
- event_type: event,
617
- properties: enrichedProps,
618
- timestamp: enrichedProps.timestamp
619
- }
620
- };
621
- fetch(`${this.config.host}/v1/events`, {
622
- method: "POST",
623
- headers: { "Content-Type": "application/json" },
624
- body: JSON.stringify(payload)
625
- }).catch(() => {
626
- });
627
- if (this.config.debug) {
628
- console.log("[Telemetry] Tracked event:", event, enrichedProps);
629
- }
630
- } else if (this.config.debug) {
631
- console.log("[Telemetry] Event (no endpoint):", event, enrichedProps);
632
- }
633
- } catch (error) {
634
- if (this.config.debug) {
635
- console.error("[Telemetry] Failed to track event:", error);
636
- }
637
- }
638
- }
639
- /**
640
- * Track installation started
641
- */
642
- async trackInstallationStarted(properties) {
643
- await this.track("installation_started", properties);
644
- }
645
- /**
646
- * Track installation completed
647
- */
648
- async trackInstallationCompleted(properties) {
649
- await this.track("installation_completed", properties);
650
- }
651
- /**
652
- * Track installation failed
653
- */
654
- async trackInstallationFailed(error, properties) {
655
- await this.track("installation_failed", {
656
- ...properties,
657
- errorType: sanitizeErrorMessage(error)
658
- });
659
- }
660
- /**
661
- * Track dev server started
662
- */
663
- async trackDevServerStarted(properties) {
664
- await this.track("dev_server_started", properties);
665
- }
666
- /**
667
- * Track page view in admin UI
668
- */
669
- async trackPageView(route, properties) {
670
- await this.track("page_viewed", {
671
- ...properties,
672
- route: sanitizeRoute(route)
673
- });
674
- }
675
- /**
676
- * Track error (sanitized)
677
- */
678
- async trackError(error, properties) {
679
- await this.track("error_occurred", {
680
- ...properties,
681
- errorType: sanitizeErrorMessage(error)
682
- });
683
- }
684
- /**
685
- * Track plugin activation
686
- */
687
- async trackPluginActivated(properties) {
688
- await this.track("plugin_activated", properties);
689
- }
690
- /**
691
- * Track migration run
692
- */
693
- async trackMigrationRun(properties) {
694
- await this.track("migration_run", properties);
695
- }
696
- /**
697
- * Flush queued events
698
- */
699
- async flushQueue() {
700
- if (this.eventQueue.length === 0) return;
701
- const queue = [...this.eventQueue];
702
- this.eventQueue = [];
703
- for (const { event, properties } of queue) {
704
- await this.track(event, properties);
705
- }
706
- }
707
- /**
708
- * Sanitize properties to ensure no PII
709
- */
710
- sanitizeProperties(properties) {
711
- if (!properties) return {};
712
- const sanitized = {};
713
- for (const [key, value] of Object.entries(properties)) {
714
- if (value === void 0) continue;
715
- if (key === "route" && typeof value === "string") {
716
- sanitized[key] = sanitizeRoute(value);
717
- continue;
718
- }
719
- if (key.toLowerCase().includes("error") && typeof value === "string") {
720
- sanitized[key] = sanitizeErrorMessage(value);
721
- continue;
722
- }
723
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
724
- sanitized[key] = value;
725
- }
726
- }
727
- return sanitized;
728
- }
729
- /**
730
- * Get SonicJS version
731
- */
732
- getVersion() {
733
- try {
734
- if (typeof process !== "undefined" && process.env) {
735
- return process.env.SONICJS_VERSION || "2.0.0";
736
- }
737
- return "2.0.0";
738
- } catch {
739
- return "unknown";
740
- }
741
- }
742
- /**
743
- * Shutdown the telemetry service (no-op for fetch-based telemetry)
744
- */
745
- async shutdown() {
746
- }
747
- /**
748
- * Enable telemetry
749
- */
750
- enable() {
751
- this.enabled = true;
752
- }
753
- /**
754
- * Disable telemetry
755
- */
756
- disable() {
757
- this.enabled = false;
758
- }
759
- /**
760
- * Check if telemetry is enabled
761
- */
762
- isEnabled() {
763
- return this.enabled;
764
- }
765
- };
766
- var telemetryInstance = null;
767
- function getTelemetryService(config) {
768
- if (!telemetryInstance) {
769
- telemetryInstance = new TelemetryService(config);
770
- }
771
- return telemetryInstance;
772
- }
773
- async function initTelemetry(identity, config) {
774
- const service = getTelemetryService(config);
775
- await service.initialize(identity);
776
- return service;
777
- }
778
- function createInstallationIdentity(projectName) {
779
- const installationId = generateInstallationId();
780
- const identity = { installationId };
781
- if (projectName) {
782
- identity.projectId = generateProjectId(projectName);
783
- }
784
- return identity;
785
- }
786
554
  var appInstance = null;
787
555
  function setAppInstance(app) {
788
556
  appInstance = app;
@@ -1128,6 +896,6 @@ function buildRouteList(app) {
1128
896
  }
1129
897
  }
1130
898
 
1131
- export { CACHE_CONFIGS, CATEGORY_INFO, CacheService, Logger, SettingsService, TelemetryService, buildRouteList, createInstallationIdentity, getAppInstance, getCacheService2 as getCacheService, getLogger, getTelemetryService, initLogger, initTelemetry, setAppInstance };
1132
- //# sourceMappingURL=chunk-ZEZ245PW.js.map
1133
- //# sourceMappingURL=chunk-ZEZ245PW.js.map
899
+ export { CACHE_CONFIGS, CATEGORY_INFO, CacheService, Logger, SettingsService, buildRouteList, getAppInstance, getCacheService2 as getCacheService, getLogger, initLogger, setAppInstance };
900
+ //# sourceMappingURL=chunk-2XAQTPAE.js.map
901
+ //# sourceMappingURL=chunk-2XAQTPAE.js.map