@sonicjs-cms/core 2.0.0-alpha.6 → 2.0.0-alpha.7
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.
- package/dist/{chunk-CXZDAR6S.js → chunk-7N3HK7ZK.js} +3 -3
- package/dist/{chunk-CXZDAR6S.js.map → chunk-7N3HK7ZK.js.map} +1 -1
- package/dist/{chunk-NRSL6BQI.js → chunk-BITQ4MFX.js} +3 -3
- package/dist/{chunk-NRSL6BQI.js.map → chunk-BITQ4MFX.js.map} +1 -1
- package/dist/{chunk-24PWAFUT.cjs → chunk-BUKT6HP5.cjs} +13 -13
- package/dist/{chunk-24PWAFUT.cjs.map → chunk-BUKT6HP5.cjs.map} +1 -1
- package/dist/{chunk-L3NXO7Y4.cjs → chunk-FVMV5DKA.cjs} +49 -49
- package/dist/{chunk-L3NXO7Y4.cjs.map → chunk-FVMV5DKA.cjs.map} +1 -1
- package/dist/{chunk-EMMSS5I5.cjs → chunk-IGJUBJBW.cjs} +8 -2
- package/dist/{chunk-EMMSS5I5.cjs.map → chunk-IGJUBJBW.cjs.map} +1 -1
- package/dist/{chunk-WJ7QYVR2.cjs → chunk-RNR4HA23.cjs} +4 -4
- package/dist/{chunk-WJ7QYVR2.cjs.map → chunk-RNR4HA23.cjs.map} +1 -1
- package/dist/{chunk-G3PMV62Z.js → chunk-V4OQ3NZ2.js} +7 -3
- package/dist/{chunk-G3PMV62Z.js.map → chunk-V4OQ3NZ2.js.map} +1 -1
- package/dist/{chunk-5RDID2QZ.js → chunk-VY6FDZ6Y.js} +5301 -2361
- package/dist/chunk-VY6FDZ6Y.js.map +1 -0
- package/dist/{chunk-PTQZ5FEI.js → chunk-WESS2U3K.js} +3 -3
- package/dist/{chunk-PTQZ5FEI.js.map → chunk-WESS2U3K.js.map} +1 -1
- package/dist/{chunk-KWFUNPSQ.cjs → chunk-Y6VF3YFA.cjs} +5322 -2381
- package/dist/chunk-Y6VF3YFA.cjs.map +1 -0
- package/dist/index.cjs +94 -93
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/middleware.cjs +23 -23
- package/dist/middleware.js +3 -3
- package/dist/plugins.cjs +8 -8
- package/dist/plugins.js +2 -2
- package/dist/routes.cjs +16 -12
- package/dist/routes.js +4 -4
- package/dist/services.cjs +18 -18
- package/dist/services.js +2 -2
- package/dist/templates.cjs +1 -1
- package/dist/templates.js +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.js +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5RDID2QZ.js.map +0 -1
- package/dist/chunk-KWFUNPSQ.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkY6VF3YFA_cjs = require('./chunk-Y6VF3YFA.cjs');
|
|
4
4
|
require('./chunk-AGOE25LF.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var chunkBUKT6HP5_cjs = require('./chunk-BUKT6HP5.cjs');
|
|
6
|
+
var chunkRNR4HA23_cjs = require('./chunk-RNR4HA23.cjs');
|
|
7
7
|
var chunkBRC3F4CG_cjs = require('./chunk-BRC3F4CG.cjs');
|
|
8
|
-
var
|
|
8
|
+
var chunkFVMV5DKA_cjs = require('./chunk-FVMV5DKA.cjs');
|
|
9
9
|
var chunkRGCQSFKC_cjs = require('./chunk-RGCQSFKC.cjs');
|
|
10
10
|
var chunkKYGRJCZM_cjs = require('./chunk-KYGRJCZM.cjs');
|
|
11
|
-
require('./chunk-
|
|
11
|
+
require('./chunk-IGJUBJBW.cjs');
|
|
12
12
|
var hono = require('hono');
|
|
13
13
|
var d1 = require('drizzle-orm/d1');
|
|
14
14
|
|
|
@@ -39,12 +39,13 @@ function createSonicJSApp(config = {}) {
|
|
|
39
39
|
app.use("*", middleware);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
app.route("/api",
|
|
43
|
-
app.route("/api/media",
|
|
44
|
-
app.route("/api/system",
|
|
45
|
-
app.route("/admin/api",
|
|
46
|
-
app.route("/admin/content",
|
|
47
|
-
app.route("/
|
|
42
|
+
app.route("/api", chunkY6VF3YFA_cjs.api_default);
|
|
43
|
+
app.route("/api/media", chunkY6VF3YFA_cjs.api_media_default);
|
|
44
|
+
app.route("/api/system", chunkY6VF3YFA_cjs.api_system_default);
|
|
45
|
+
app.route("/admin/api", chunkY6VF3YFA_cjs.admin_api_default);
|
|
46
|
+
app.route("/admin/content", chunkY6VF3YFA_cjs.admin_content_default);
|
|
47
|
+
app.route("/admin", chunkY6VF3YFA_cjs.userRoutes);
|
|
48
|
+
app.route("/auth", chunkY6VF3YFA_cjs.auth_default);
|
|
48
49
|
if (config.routes) {
|
|
49
50
|
for (const route of config.routes) {
|
|
50
51
|
app.route(route.path, route.handler);
|
|
@@ -77,7 +78,7 @@ function setupCoreRoutes(_app) {
|
|
|
77
78
|
console.warn("setupCoreRoutes is deprecated. Use createSonicJSApp() instead.");
|
|
78
79
|
}
|
|
79
80
|
function createDb(d1$1) {
|
|
80
|
-
return d1.drizzle(d1$1, { schema:
|
|
81
|
+
return d1.drizzle(d1$1, { schema: chunkRNR4HA23_cjs.schema_exports });
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
// src/index.ts
|
|
@@ -85,303 +86,303 @@ var VERSION = "2.0.0-alpha.3";
|
|
|
85
86
|
|
|
86
87
|
Object.defineProperty(exports, "ROUTES_INFO", {
|
|
87
88
|
enumerable: true,
|
|
88
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunkY6VF3YFA_cjs.ROUTES_INFO; }
|
|
89
90
|
});
|
|
90
91
|
Object.defineProperty(exports, "AuthManager", {
|
|
91
92
|
enumerable: true,
|
|
92
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunkBUKT6HP5_cjs.AuthManager; }
|
|
93
94
|
});
|
|
94
95
|
Object.defineProperty(exports, "PermissionManager", {
|
|
95
96
|
enumerable: true,
|
|
96
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunkBUKT6HP5_cjs.PermissionManager; }
|
|
97
98
|
});
|
|
98
99
|
Object.defineProperty(exports, "bootstrapMiddleware", {
|
|
99
100
|
enumerable: true,
|
|
100
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunkBUKT6HP5_cjs.bootstrapMiddleware; }
|
|
101
102
|
});
|
|
102
103
|
Object.defineProperty(exports, "cacheHeaders", {
|
|
103
104
|
enumerable: true,
|
|
104
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunkBUKT6HP5_cjs.cacheHeaders; }
|
|
105
106
|
});
|
|
106
107
|
Object.defineProperty(exports, "compressionMiddleware", {
|
|
107
108
|
enumerable: true,
|
|
108
|
-
get: function () { return
|
|
109
|
+
get: function () { return chunkBUKT6HP5_cjs.compressionMiddleware; }
|
|
109
110
|
});
|
|
110
111
|
Object.defineProperty(exports, "detailedLoggingMiddleware", {
|
|
111
112
|
enumerable: true,
|
|
112
|
-
get: function () { return
|
|
113
|
+
get: function () { return chunkBUKT6HP5_cjs.detailedLoggingMiddleware; }
|
|
113
114
|
});
|
|
114
115
|
Object.defineProperty(exports, "getActivePlugins", {
|
|
115
116
|
enumerable: true,
|
|
116
|
-
get: function () { return
|
|
117
|
+
get: function () { return chunkBUKT6HP5_cjs.getActivePlugins; }
|
|
117
118
|
});
|
|
118
119
|
Object.defineProperty(exports, "isPluginActive", {
|
|
119
120
|
enumerable: true,
|
|
120
|
-
get: function () { return
|
|
121
|
+
get: function () { return chunkBUKT6HP5_cjs.isPluginActive; }
|
|
121
122
|
});
|
|
122
123
|
Object.defineProperty(exports, "logActivity", {
|
|
123
124
|
enumerable: true,
|
|
124
|
-
get: function () { return
|
|
125
|
+
get: function () { return chunkBUKT6HP5_cjs.logActivity; }
|
|
125
126
|
});
|
|
126
127
|
Object.defineProperty(exports, "loggingMiddleware", {
|
|
127
128
|
enumerable: true,
|
|
128
|
-
get: function () { return
|
|
129
|
+
get: function () { return chunkBUKT6HP5_cjs.loggingMiddleware; }
|
|
129
130
|
});
|
|
130
131
|
Object.defineProperty(exports, "optionalAuth", {
|
|
131
132
|
enumerable: true,
|
|
132
|
-
get: function () { return
|
|
133
|
+
get: function () { return chunkBUKT6HP5_cjs.optionalAuth; }
|
|
133
134
|
});
|
|
134
135
|
Object.defineProperty(exports, "performanceLoggingMiddleware", {
|
|
135
136
|
enumerable: true,
|
|
136
|
-
get: function () { return
|
|
137
|
+
get: function () { return chunkBUKT6HP5_cjs.performanceLoggingMiddleware; }
|
|
137
138
|
});
|
|
138
139
|
Object.defineProperty(exports, "requireActivePlugin", {
|
|
139
140
|
enumerable: true,
|
|
140
|
-
get: function () { return
|
|
141
|
+
get: function () { return chunkBUKT6HP5_cjs.requireActivePlugin; }
|
|
141
142
|
});
|
|
142
143
|
Object.defineProperty(exports, "requireActivePlugins", {
|
|
143
144
|
enumerable: true,
|
|
144
|
-
get: function () { return
|
|
145
|
+
get: function () { return chunkBUKT6HP5_cjs.requireActivePlugins; }
|
|
145
146
|
});
|
|
146
147
|
Object.defineProperty(exports, "requireAnyPermission", {
|
|
147
148
|
enumerable: true,
|
|
148
|
-
get: function () { return
|
|
149
|
+
get: function () { return chunkBUKT6HP5_cjs.requireAnyPermission; }
|
|
149
150
|
});
|
|
150
151
|
Object.defineProperty(exports, "requireAuth", {
|
|
151
152
|
enumerable: true,
|
|
152
|
-
get: function () { return
|
|
153
|
+
get: function () { return chunkBUKT6HP5_cjs.requireAuth; }
|
|
153
154
|
});
|
|
154
155
|
Object.defineProperty(exports, "requirePermission", {
|
|
155
156
|
enumerable: true,
|
|
156
|
-
get: function () { return
|
|
157
|
+
get: function () { return chunkBUKT6HP5_cjs.requirePermission; }
|
|
157
158
|
});
|
|
158
159
|
Object.defineProperty(exports, "requireRole", {
|
|
159
160
|
enumerable: true,
|
|
160
|
-
get: function () { return
|
|
161
|
+
get: function () { return chunkBUKT6HP5_cjs.requireRole; }
|
|
161
162
|
});
|
|
162
163
|
Object.defineProperty(exports, "securityHeaders", {
|
|
163
164
|
enumerable: true,
|
|
164
|
-
get: function () { return
|
|
165
|
+
get: function () { return chunkBUKT6HP5_cjs.securityHeaders; }
|
|
165
166
|
});
|
|
166
167
|
Object.defineProperty(exports, "securityLoggingMiddleware", {
|
|
167
168
|
enumerable: true,
|
|
168
|
-
get: function () { return
|
|
169
|
+
get: function () { return chunkBUKT6HP5_cjs.securityLoggingMiddleware; }
|
|
169
170
|
});
|
|
170
171
|
Object.defineProperty(exports, "Logger", {
|
|
171
172
|
enumerable: true,
|
|
172
|
-
get: function () { return
|
|
173
|
+
get: function () { return chunkRNR4HA23_cjs.Logger; }
|
|
173
174
|
});
|
|
174
175
|
Object.defineProperty(exports, "MigrationService", {
|
|
175
176
|
enumerable: true,
|
|
176
|
-
get: function () { return
|
|
177
|
+
get: function () { return chunkRNR4HA23_cjs.MigrationService; }
|
|
177
178
|
});
|
|
178
179
|
Object.defineProperty(exports, "PluginBootstrapService", {
|
|
179
180
|
enumerable: true,
|
|
180
|
-
get: function () { return
|
|
181
|
+
get: function () { return chunkRNR4HA23_cjs.PluginBootstrapService; }
|
|
181
182
|
});
|
|
182
183
|
Object.defineProperty(exports, "PluginServiceClass", {
|
|
183
184
|
enumerable: true,
|
|
184
|
-
get: function () { return
|
|
185
|
+
get: function () { return chunkRNR4HA23_cjs.PluginService; }
|
|
185
186
|
});
|
|
186
187
|
Object.defineProperty(exports, "apiTokens", {
|
|
187
188
|
enumerable: true,
|
|
188
|
-
get: function () { return
|
|
189
|
+
get: function () { return chunkRNR4HA23_cjs.apiTokens; }
|
|
189
190
|
});
|
|
190
191
|
Object.defineProperty(exports, "cleanupRemovedCollections", {
|
|
191
192
|
enumerable: true,
|
|
192
|
-
get: function () { return
|
|
193
|
+
get: function () { return chunkRNR4HA23_cjs.cleanupRemovedCollections; }
|
|
193
194
|
});
|
|
194
195
|
Object.defineProperty(exports, "collections", {
|
|
195
196
|
enumerable: true,
|
|
196
|
-
get: function () { return
|
|
197
|
+
get: function () { return chunkRNR4HA23_cjs.collections; }
|
|
197
198
|
});
|
|
198
199
|
Object.defineProperty(exports, "content", {
|
|
199
200
|
enumerable: true,
|
|
200
|
-
get: function () { return
|
|
201
|
+
get: function () { return chunkRNR4HA23_cjs.content; }
|
|
201
202
|
});
|
|
202
203
|
Object.defineProperty(exports, "contentVersions", {
|
|
203
204
|
enumerable: true,
|
|
204
|
-
get: function () { return
|
|
205
|
+
get: function () { return chunkRNR4HA23_cjs.contentVersions; }
|
|
205
206
|
});
|
|
206
207
|
Object.defineProperty(exports, "fullCollectionSync", {
|
|
207
208
|
enumerable: true,
|
|
208
|
-
get: function () { return
|
|
209
|
+
get: function () { return chunkRNR4HA23_cjs.fullCollectionSync; }
|
|
209
210
|
});
|
|
210
211
|
Object.defineProperty(exports, "getAvailableCollectionNames", {
|
|
211
212
|
enumerable: true,
|
|
212
|
-
get: function () { return
|
|
213
|
+
get: function () { return chunkRNR4HA23_cjs.getAvailableCollectionNames; }
|
|
213
214
|
});
|
|
214
215
|
Object.defineProperty(exports, "getLogger", {
|
|
215
216
|
enumerable: true,
|
|
216
|
-
get: function () { return
|
|
217
|
+
get: function () { return chunkRNR4HA23_cjs.getLogger; }
|
|
217
218
|
});
|
|
218
219
|
Object.defineProperty(exports, "getManagedCollections", {
|
|
219
220
|
enumerable: true,
|
|
220
|
-
get: function () { return
|
|
221
|
+
get: function () { return chunkRNR4HA23_cjs.getManagedCollections; }
|
|
221
222
|
});
|
|
222
223
|
Object.defineProperty(exports, "initLogger", {
|
|
223
224
|
enumerable: true,
|
|
224
|
-
get: function () { return
|
|
225
|
+
get: function () { return chunkRNR4HA23_cjs.initLogger; }
|
|
225
226
|
});
|
|
226
227
|
Object.defineProperty(exports, "insertCollectionSchema", {
|
|
227
228
|
enumerable: true,
|
|
228
|
-
get: function () { return
|
|
229
|
+
get: function () { return chunkRNR4HA23_cjs.insertCollectionSchema; }
|
|
229
230
|
});
|
|
230
231
|
Object.defineProperty(exports, "insertContentSchema", {
|
|
231
232
|
enumerable: true,
|
|
232
|
-
get: function () { return
|
|
233
|
+
get: function () { return chunkRNR4HA23_cjs.insertContentSchema; }
|
|
233
234
|
});
|
|
234
235
|
Object.defineProperty(exports, "insertLogConfigSchema", {
|
|
235
236
|
enumerable: true,
|
|
236
|
-
get: function () { return
|
|
237
|
+
get: function () { return chunkRNR4HA23_cjs.insertLogConfigSchema; }
|
|
237
238
|
});
|
|
238
239
|
Object.defineProperty(exports, "insertMediaSchema", {
|
|
239
240
|
enumerable: true,
|
|
240
|
-
get: function () { return
|
|
241
|
+
get: function () { return chunkRNR4HA23_cjs.insertMediaSchema; }
|
|
241
242
|
});
|
|
242
243
|
Object.defineProperty(exports, "insertPluginActivityLogSchema", {
|
|
243
244
|
enumerable: true,
|
|
244
|
-
get: function () { return
|
|
245
|
+
get: function () { return chunkRNR4HA23_cjs.insertPluginActivityLogSchema; }
|
|
245
246
|
});
|
|
246
247
|
Object.defineProperty(exports, "insertPluginAssetSchema", {
|
|
247
248
|
enumerable: true,
|
|
248
|
-
get: function () { return
|
|
249
|
+
get: function () { return chunkRNR4HA23_cjs.insertPluginAssetSchema; }
|
|
249
250
|
});
|
|
250
251
|
Object.defineProperty(exports, "insertPluginHookSchema", {
|
|
251
252
|
enumerable: true,
|
|
252
|
-
get: function () { return
|
|
253
|
+
get: function () { return chunkRNR4HA23_cjs.insertPluginHookSchema; }
|
|
253
254
|
});
|
|
254
255
|
Object.defineProperty(exports, "insertPluginRouteSchema", {
|
|
255
256
|
enumerable: true,
|
|
256
|
-
get: function () { return
|
|
257
|
+
get: function () { return chunkRNR4HA23_cjs.insertPluginRouteSchema; }
|
|
257
258
|
});
|
|
258
259
|
Object.defineProperty(exports, "insertPluginSchema", {
|
|
259
260
|
enumerable: true,
|
|
260
|
-
get: function () { return
|
|
261
|
+
get: function () { return chunkRNR4HA23_cjs.insertPluginSchema; }
|
|
261
262
|
});
|
|
262
263
|
Object.defineProperty(exports, "insertSystemLogSchema", {
|
|
263
264
|
enumerable: true,
|
|
264
|
-
get: function () { return
|
|
265
|
+
get: function () { return chunkRNR4HA23_cjs.insertSystemLogSchema; }
|
|
265
266
|
});
|
|
266
267
|
Object.defineProperty(exports, "insertUserSchema", {
|
|
267
268
|
enumerable: true,
|
|
268
|
-
get: function () { return
|
|
269
|
+
get: function () { return chunkRNR4HA23_cjs.insertUserSchema; }
|
|
269
270
|
});
|
|
270
271
|
Object.defineProperty(exports, "insertWorkflowHistorySchema", {
|
|
271
272
|
enumerable: true,
|
|
272
|
-
get: function () { return
|
|
273
|
+
get: function () { return chunkRNR4HA23_cjs.insertWorkflowHistorySchema; }
|
|
273
274
|
});
|
|
274
275
|
Object.defineProperty(exports, "isCollectionManaged", {
|
|
275
276
|
enumerable: true,
|
|
276
|
-
get: function () { return
|
|
277
|
+
get: function () { return chunkRNR4HA23_cjs.isCollectionManaged; }
|
|
277
278
|
});
|
|
278
279
|
Object.defineProperty(exports, "loadCollectionConfig", {
|
|
279
280
|
enumerable: true,
|
|
280
|
-
get: function () { return
|
|
281
|
+
get: function () { return chunkRNR4HA23_cjs.loadCollectionConfig; }
|
|
281
282
|
});
|
|
282
283
|
Object.defineProperty(exports, "loadCollectionConfigs", {
|
|
283
284
|
enumerable: true,
|
|
284
|
-
get: function () { return
|
|
285
|
+
get: function () { return chunkRNR4HA23_cjs.loadCollectionConfigs; }
|
|
285
286
|
});
|
|
286
287
|
Object.defineProperty(exports, "logConfig", {
|
|
287
288
|
enumerable: true,
|
|
288
|
-
get: function () { return
|
|
289
|
+
get: function () { return chunkRNR4HA23_cjs.logConfig; }
|
|
289
290
|
});
|
|
290
291
|
Object.defineProperty(exports, "media", {
|
|
291
292
|
enumerable: true,
|
|
292
|
-
get: function () { return
|
|
293
|
+
get: function () { return chunkRNR4HA23_cjs.media; }
|
|
293
294
|
});
|
|
294
295
|
Object.defineProperty(exports, "pluginActivityLog", {
|
|
295
296
|
enumerable: true,
|
|
296
|
-
get: function () { return
|
|
297
|
+
get: function () { return chunkRNR4HA23_cjs.pluginActivityLog; }
|
|
297
298
|
});
|
|
298
299
|
Object.defineProperty(exports, "pluginAssets", {
|
|
299
300
|
enumerable: true,
|
|
300
|
-
get: function () { return
|
|
301
|
+
get: function () { return chunkRNR4HA23_cjs.pluginAssets; }
|
|
301
302
|
});
|
|
302
303
|
Object.defineProperty(exports, "pluginHooks", {
|
|
303
304
|
enumerable: true,
|
|
304
|
-
get: function () { return
|
|
305
|
+
get: function () { return chunkRNR4HA23_cjs.pluginHooks; }
|
|
305
306
|
});
|
|
306
307
|
Object.defineProperty(exports, "pluginRoutes", {
|
|
307
308
|
enumerable: true,
|
|
308
|
-
get: function () { return
|
|
309
|
+
get: function () { return chunkRNR4HA23_cjs.pluginRoutes; }
|
|
309
310
|
});
|
|
310
311
|
Object.defineProperty(exports, "plugins", {
|
|
311
312
|
enumerable: true,
|
|
312
|
-
get: function () { return
|
|
313
|
+
get: function () { return chunkRNR4HA23_cjs.plugins; }
|
|
313
314
|
});
|
|
314
315
|
Object.defineProperty(exports, "selectCollectionSchema", {
|
|
315
316
|
enumerable: true,
|
|
316
|
-
get: function () { return
|
|
317
|
+
get: function () { return chunkRNR4HA23_cjs.selectCollectionSchema; }
|
|
317
318
|
});
|
|
318
319
|
Object.defineProperty(exports, "selectContentSchema", {
|
|
319
320
|
enumerable: true,
|
|
320
|
-
get: function () { return
|
|
321
|
+
get: function () { return chunkRNR4HA23_cjs.selectContentSchema; }
|
|
321
322
|
});
|
|
322
323
|
Object.defineProperty(exports, "selectLogConfigSchema", {
|
|
323
324
|
enumerable: true,
|
|
324
|
-
get: function () { return
|
|
325
|
+
get: function () { return chunkRNR4HA23_cjs.selectLogConfigSchema; }
|
|
325
326
|
});
|
|
326
327
|
Object.defineProperty(exports, "selectMediaSchema", {
|
|
327
328
|
enumerable: true,
|
|
328
|
-
get: function () { return
|
|
329
|
+
get: function () { return chunkRNR4HA23_cjs.selectMediaSchema; }
|
|
329
330
|
});
|
|
330
331
|
Object.defineProperty(exports, "selectPluginActivityLogSchema", {
|
|
331
332
|
enumerable: true,
|
|
332
|
-
get: function () { return
|
|
333
|
+
get: function () { return chunkRNR4HA23_cjs.selectPluginActivityLogSchema; }
|
|
333
334
|
});
|
|
334
335
|
Object.defineProperty(exports, "selectPluginAssetSchema", {
|
|
335
336
|
enumerable: true,
|
|
336
|
-
get: function () { return
|
|
337
|
+
get: function () { return chunkRNR4HA23_cjs.selectPluginAssetSchema; }
|
|
337
338
|
});
|
|
338
339
|
Object.defineProperty(exports, "selectPluginHookSchema", {
|
|
339
340
|
enumerable: true,
|
|
340
|
-
get: function () { return
|
|
341
|
+
get: function () { return chunkRNR4HA23_cjs.selectPluginHookSchema; }
|
|
341
342
|
});
|
|
342
343
|
Object.defineProperty(exports, "selectPluginRouteSchema", {
|
|
343
344
|
enumerable: true,
|
|
344
|
-
get: function () { return
|
|
345
|
+
get: function () { return chunkRNR4HA23_cjs.selectPluginRouteSchema; }
|
|
345
346
|
});
|
|
346
347
|
Object.defineProperty(exports, "selectPluginSchema", {
|
|
347
348
|
enumerable: true,
|
|
348
|
-
get: function () { return
|
|
349
|
+
get: function () { return chunkRNR4HA23_cjs.selectPluginSchema; }
|
|
349
350
|
});
|
|
350
351
|
Object.defineProperty(exports, "selectSystemLogSchema", {
|
|
351
352
|
enumerable: true,
|
|
352
|
-
get: function () { return
|
|
353
|
+
get: function () { return chunkRNR4HA23_cjs.selectSystemLogSchema; }
|
|
353
354
|
});
|
|
354
355
|
Object.defineProperty(exports, "selectUserSchema", {
|
|
355
356
|
enumerable: true,
|
|
356
|
-
get: function () { return
|
|
357
|
+
get: function () { return chunkRNR4HA23_cjs.selectUserSchema; }
|
|
357
358
|
});
|
|
358
359
|
Object.defineProperty(exports, "selectWorkflowHistorySchema", {
|
|
359
360
|
enumerable: true,
|
|
360
|
-
get: function () { return
|
|
361
|
+
get: function () { return chunkRNR4HA23_cjs.selectWorkflowHistorySchema; }
|
|
361
362
|
});
|
|
362
363
|
Object.defineProperty(exports, "syncCollection", {
|
|
363
364
|
enumerable: true,
|
|
364
|
-
get: function () { return
|
|
365
|
+
get: function () { return chunkRNR4HA23_cjs.syncCollection; }
|
|
365
366
|
});
|
|
366
367
|
Object.defineProperty(exports, "syncCollections", {
|
|
367
368
|
enumerable: true,
|
|
368
|
-
get: function () { return
|
|
369
|
+
get: function () { return chunkRNR4HA23_cjs.syncCollections; }
|
|
369
370
|
});
|
|
370
371
|
Object.defineProperty(exports, "systemLogs", {
|
|
371
372
|
enumerable: true,
|
|
372
|
-
get: function () { return
|
|
373
|
+
get: function () { return chunkRNR4HA23_cjs.systemLogs; }
|
|
373
374
|
});
|
|
374
375
|
Object.defineProperty(exports, "users", {
|
|
375
376
|
enumerable: true,
|
|
376
|
-
get: function () { return
|
|
377
|
+
get: function () { return chunkRNR4HA23_cjs.users; }
|
|
377
378
|
});
|
|
378
379
|
Object.defineProperty(exports, "validateCollectionConfig", {
|
|
379
380
|
enumerable: true,
|
|
380
|
-
get: function () { return
|
|
381
|
+
get: function () { return chunkRNR4HA23_cjs.validateCollectionConfig; }
|
|
381
382
|
});
|
|
382
383
|
Object.defineProperty(exports, "workflowHistory", {
|
|
383
384
|
enumerable: true,
|
|
384
|
-
get: function () { return
|
|
385
|
+
get: function () { return chunkRNR4HA23_cjs.workflowHistory; }
|
|
385
386
|
});
|
|
386
387
|
Object.defineProperty(exports, "getConfirmationDialogScript", {
|
|
387
388
|
enumerable: true,
|
|
@@ -417,27 +418,27 @@ Object.defineProperty(exports, "renderTable", {
|
|
|
417
418
|
});
|
|
418
419
|
Object.defineProperty(exports, "HookSystemImpl", {
|
|
419
420
|
enumerable: true,
|
|
420
|
-
get: function () { return
|
|
421
|
+
get: function () { return chunkFVMV5DKA_cjs.HookSystemImpl; }
|
|
421
422
|
});
|
|
422
423
|
Object.defineProperty(exports, "HookUtils", {
|
|
423
424
|
enumerable: true,
|
|
424
|
-
get: function () { return
|
|
425
|
+
get: function () { return chunkFVMV5DKA_cjs.HookUtils; }
|
|
425
426
|
});
|
|
426
427
|
Object.defineProperty(exports, "PluginManagerClass", {
|
|
427
428
|
enumerable: true,
|
|
428
|
-
get: function () { return
|
|
429
|
+
get: function () { return chunkFVMV5DKA_cjs.PluginManager; }
|
|
429
430
|
});
|
|
430
431
|
Object.defineProperty(exports, "PluginRegistryImpl", {
|
|
431
432
|
enumerable: true,
|
|
432
|
-
get: function () { return
|
|
433
|
+
get: function () { return chunkFVMV5DKA_cjs.PluginRegistryImpl; }
|
|
433
434
|
});
|
|
434
435
|
Object.defineProperty(exports, "PluginValidatorClass", {
|
|
435
436
|
enumerable: true,
|
|
436
|
-
get: function () { return
|
|
437
|
+
get: function () { return chunkFVMV5DKA_cjs.PluginValidator; }
|
|
437
438
|
});
|
|
438
439
|
Object.defineProperty(exports, "ScopedHookSystemClass", {
|
|
439
440
|
enumerable: true,
|
|
440
|
-
get: function () { return
|
|
441
|
+
get: function () { return chunkFVMV5DKA_cjs.ScopedHookSystem; }
|
|
441
442
|
});
|
|
442
443
|
Object.defineProperty(exports, "QueryFilterBuilder", {
|
|
443
444
|
enumerable: true,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/app.ts","../src/db/index.ts","../src/index.ts"],"names":["Hono","api_default","api_media_default","api_system_default","admin_api_default","admin_content_default","auth_default","d1","drizzle","schema_exports"],"mappings":";;;;;;;;;;;;;;AAqGO,SAAS,gBAAA,CAAiB,MAAA,GAAwB,EAAC,EAAe;AACvE,EAAA,MAAM,GAAA,GAAM,IAAIA,SAAA,EAAmD;AAGnE,EAAA,MAAM,UAAA,GAAa,OAAO,OAAA,IAAW,OAAA;AACrC,EAAA,MAAM,OAAA,GAAU,OAAO,IAAA,IAAQ,SAAA;AAG/B,EAAA,GAAA,CAAI,GAAA,CAAI,GAAA,EAAK,OAAO,CAAA,EAAG,IAAA,KAAS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AAK,gEAAgE,CAAA;AAE/E;ACnNO,SAAS,SAASC,IAAA,EAAgB;AACvC,EAAA,OAAOC,UAAA,CAAQD,IAAA,EAAI,EAAE,MAAA,EAAAE,gCAAA,EAAQ,CAAA;AAC/B;;;ACoRO,IAAM,OAAA,GAAU","file":"index.cjs","sourcesContent":["/**\n * Main Application Factory\n *\n * Creates a configured SonicJS application with all core functionality\n */\n\nimport { Hono } from 'hono'\nimport type { Context } from 'hono'\nimport type { D1Database, KVNamespace, R2Bucket } from '@cloudflare/workers-types'\nimport { apiRoutes, apiMediaRoutes, apiSystemRoutes, adminApiRoutes, authRoutes, adminContentRoutes } from './routes'\n\n// ============================================================================\n// Type Definitions\n// ============================================================================\n\nexport interface Bindings {\n DB: D1Database\n CACHE_KV: KVNamespace\n MEDIA_BUCKET: R2Bucket\n ASSETS: Fetcher\n EMAIL_QUEUE?: Queue\n SENDGRID_API_KEY?: string\n DEFAULT_FROM_EMAIL?: string\n IMAGES_ACCOUNT_ID?: string\n IMAGES_API_TOKEN?: string\n ENVIRONMENT?: string\n}\n\nexport interface Variables {\n user?: {\n userId: string\n email: string\n role: string\n exp: number\n iat: number\n }\n requestId?: string\n startTime?: number\n appVersion?: string\n}\n\nexport interface SonicJSConfig {\n // Collections configuration\n collections?: {\n directory?: string\n autoSync?: boolean\n }\n\n // Plugins configuration\n plugins?: {\n directory?: string\n autoLoad?: boolean\n }\n\n // Custom routes\n routes?: Array<{\n path: string\n handler: Hono\n }>\n\n // Custom middleware\n middleware?: {\n beforeAuth?: Array<(c: Context, next: () => Promise<void>) => Promise<void>>\n afterAuth?: Array<(c: Context, next: () => Promise<void>) => Promise<void>>\n }\n\n // App metadata\n version?: string\n name?: string\n}\n\nexport type SonicJSApp = Hono<{ Bindings: Bindings; Variables: Variables }>\n\n// ============================================================================\n// Application Factory\n// ============================================================================\n\n/**\n * Create a SonicJS application with core functionality\n *\n * @param config - Application configuration\n * @returns Configured Hono application\n *\n * @example\n * ```typescript\n * import { createSonicJSApp } from '@sonicjs/core'\n *\n * const app = createSonicJSApp({\n * collections: {\n * directory: './src/collections',\n * autoSync: true\n * },\n * plugins: {\n * directory: './src/plugins',\n * autoLoad: true\n * }\n * })\n *\n * export default app\n * ```\n */\nexport function createSonicJSApp(config: SonicJSConfig = {}): SonicJSApp {\n const app = new Hono<{ Bindings: Bindings; Variables: Variables }>()\n\n // Set app metadata\n const appVersion = config.version || '1.0.0'\n const appName = config.name || 'SonicJS'\n\n // App version middleware\n app.use('*', async (c, next) => {\n c.set('appVersion', appVersion)\n await next()\n })\n\n // Bootstrap middleware\n // Note: Implementation will be imported from middleware/bootstrap\n // This is a placeholder for the factory pattern\n app.use('*', async (_c, next) => {\n // Bootstrap logic here (migrations, collections, plugins)\n await next()\n })\n\n // Custom middleware - before auth\n if (config.middleware?.beforeAuth) {\n for (const middleware of config.middleware.beforeAuth) {\n app.use('*', middleware)\n }\n }\n\n // Logging middleware\n app.use('*', async (_c, next) => {\n // Logging logic here\n await next()\n })\n\n // Security middleware\n app.use('*', async (_c, next) => {\n // Security headers, CORS, etc.\n await next()\n })\n\n // Custom middleware - after auth\n if (config.middleware?.afterAuth) {\n for (const middleware of config.middleware.afterAuth) {\n app.use('*', middleware)\n }\n }\n\n // Core routes\n // Routes are being imported incrementally from routes/*\n // Each route is tested and migrated one-by-one\n app.route('/api', apiRoutes)\n app.route('/api/media', apiMediaRoutes)\n app.route('/api/system', apiSystemRoutes)\n app.route('/admin/api', adminApiRoutes)\n app.route('/admin/content', adminContentRoutes)\n app.route('/auth', authRoutes)\n\n // Custom routes - User-defined routes\n if (config.routes) {\n for (const route of config.routes) {\n app.route(route.path, route.handler)\n }\n }\n\n // Root redirect to login\n app.get('/', (c) => {\n return c.redirect('/auth/login')\n })\n\n // Health check\n app.get('/health', (c) => {\n return c.json({\n name: appName,\n version: appVersion,\n status: 'running',\n timestamp: new Date().toISOString()\n })\n })\n\n // 404 handler\n app.notFound((c) => {\n return c.json({ error: 'Not Found', status: 404 }, 404)\n })\n\n // Error handler\n app.onError((err, c) => {\n console.error(err)\n return c.json({ error: 'Internal Server Error', status: 500 }, 500)\n })\n\n return app\n}\n\n/**\n * Setup core middleware (backward compatibility)\n *\n * @param _app - Hono application\n * @deprecated Use createSonicJSApp() instead\n */\nexport function setupCoreMiddleware(_app: SonicJSApp): void {\n console.warn('setupCoreMiddleware is deprecated. Use createSonicJSApp() instead.')\n // Backward compatibility implementation\n}\n\n/**\n * Setup core routes (backward compatibility)\n *\n * @param _app - Hono application\n * @deprecated Use createSonicJSApp() instead\n */\nexport function setupCoreRoutes(_app: SonicJSApp): void {\n console.warn('setupCoreRoutes is deprecated. Use createSonicJSApp() instead.')\n // Backward compatibility implementation\n}\n","import { drizzle } from 'drizzle-orm/d1';\nimport * as schema from './schema';\n\nexport function createDb(d1: D1Database) {\n return drizzle(d1, { schema });\n}\n\nexport * from './schema';","/**\n * @sonicjs/core - Main Entry Point\n *\n * Core framework for SonicJS headless CMS\n * Built for Cloudflare's edge platform with TypeScript\n *\n * Phase 2 Migration Status:\n * - Week 1: Types, Utils, Database (COMPLETED ✓)\n * - Week 2: Services, Middleware, Plugins (COMPLETED ✓)\n * - Week 3: Routes, Templates (COMPLETED ✓)\n * - Week 4: Integration & Testing (COMPLETED ✓)\n *\n * Test Coverage:\n * - Utilities: 48 tests (sanitize, query-filter, metrics)\n * - Middleware: 51 tests (auth, logging, security, performance)\n * - Total: 99 tests passing\n */\n\n// ============================================================================\n// Main Application API (Phase 2 Week 1)\n// ============================================================================\n\nexport { createSonicJSApp, setupCoreMiddleware, setupCoreRoutes } from './app'\nexport type { SonicJSConfig, SonicJSApp, Bindings, Variables } from './app'\n\n// ============================================================================\n// Placeholders - To be populated in Phase 2\n// ============================================================================\n\n// Services - Week 2 (COMPLETED)\nexport {\n // Collection Management\n loadCollectionConfigs,\n loadCollectionConfig,\n getAvailableCollectionNames,\n validateCollectionConfig,\n syncCollections,\n syncCollection,\n isCollectionManaged,\n getManagedCollections,\n cleanupRemovedCollections,\n fullCollectionSync,\n // Database Migrations\n MigrationService,\n // Logging\n Logger,\n getLogger,\n initLogger,\n // Plugin Services - Class implementations\n PluginService as PluginServiceClass,\n PluginBootstrapService,\n} from './services'\n\nexport type { Migration, MigrationStatus, LogLevel, LogCategory, LogEntry, LogFilter, CorePlugin } from './services'\n\n// Middleware - Week 2 (COMPLETED)\nexport {\n // Authentication\n AuthManager,\n requireAuth,\n requireRole,\n optionalAuth,\n // Logging\n loggingMiddleware,\n detailedLoggingMiddleware,\n securityLoggingMiddleware,\n performanceLoggingMiddleware,\n // Performance\n cacheHeaders,\n compressionMiddleware,\n securityHeaders,\n // Permissions\n PermissionManager,\n requirePermission,\n requireAnyPermission,\n logActivity,\n // Plugin middleware\n requireActivePlugin,\n requireActivePlugins,\n getActivePlugins,\n isPluginActive,\n // Bootstrap\n bootstrapMiddleware,\n} from './middleware'\n\nexport type { Permission, UserPermissions } from './middleware'\n\n// Plugins - Week 2 (COMPLETED)\nexport {\n // Hook System - Class implementations\n HookSystemImpl,\n ScopedHookSystem as ScopedHookSystemClass,\n HookUtils,\n // Plugin Registry\n PluginRegistryImpl,\n // Plugin Manager - Class implementation\n PluginManager as PluginManagerClass,\n // Plugin Validator - Class implementation\n PluginValidator as PluginValidatorClass,\n} from './plugins'\n\n// Routes - Week 3 (COMPLETED)\nexport { ROUTES_INFO } from './routes'\n\n// Templates - Week 3 (COMPLETED)\nexport {\n // Form templates\n renderForm,\n renderFormField,\n // Table templates\n renderTable,\n // Pagination templates\n renderPagination,\n // Alert templates\n renderAlert,\n // Confirmation dialog templates\n renderConfirmationDialog,\n getConfirmationDialogScript,\n // Filter bar templates\n renderFilterBar,\n} from './templates'\n\nexport type {\n FormField,\n FormData,\n TableColumn,\n TableData,\n PaginationData,\n AlertData,\n ConfirmationDialogOptions,\n FilterBarData,\n Filter,\n FilterOption,\n} from './templates'\n\n// Types - Week 1 (COMPLETED)\nexport type {\n // Collection types\n FieldType,\n FieldConfig,\n CollectionSchema,\n CollectionConfig,\n CollectionConfigModule,\n CollectionSyncResult,\n // Plugin types\n Plugin,\n PluginContext,\n PluginConfig,\n PluginRoutes,\n PluginMiddleware,\n PluginModel,\n PluginService,\n PluginAdminPage,\n PluginComponent,\n PluginMenuItem,\n PluginHook,\n HookHandler,\n HookContext,\n HookSystem,\n ScopedHookSystem,\n PluginRegistry,\n PluginManager,\n PluginStatus,\n AuthService,\n ContentService,\n MediaService,\n PluginLogger,\n PluginBuilderOptions,\n PluginValidator,\n PluginValidationResult,\n HookName,\n // Plugin manifest\n PluginManifest,\n} from './types'\n\nexport { HOOKS } from './types'\n\n// Utils - Week 1 (COMPLETED)\nexport {\n // Sanitization\n escapeHtml,\n sanitizeInput,\n sanitizeObject,\n // Template rendering\n TemplateRenderer,\n templateRenderer,\n renderTemplate,\n // Query filtering\n QueryFilterBuilder,\n buildQuery,\n // Metrics\n metricsTracker,\n} from './utils'\n\nexport type {\n FilterOperator,\n FilterCondition,\n FilterGroup,\n QueryFilter,\n QueryResult,\n} from './utils'\n\n// Database - Week 1 (COMPLETED)\nexport {\n createDb,\n // Schema exports\n users,\n collections,\n content,\n contentVersions,\n media,\n apiTokens,\n workflowHistory,\n plugins,\n pluginHooks,\n pluginRoutes,\n pluginAssets,\n pluginActivityLog,\n systemLogs,\n logConfig,\n // Zod validation schemas\n insertUserSchema,\n selectUserSchema,\n insertCollectionSchema,\n selectCollectionSchema,\n insertContentSchema,\n selectContentSchema,\n insertMediaSchema,\n selectMediaSchema,\n insertWorkflowHistorySchema,\n selectWorkflowHistorySchema,\n insertPluginSchema,\n selectPluginSchema,\n insertPluginHookSchema,\n selectPluginHookSchema,\n insertPluginRouteSchema,\n selectPluginRouteSchema,\n insertPluginAssetSchema,\n selectPluginAssetSchema,\n insertPluginActivityLogSchema,\n selectPluginActivityLogSchema,\n insertSystemLogSchema,\n selectSystemLogSchema,\n insertLogConfigSchema,\n selectLogConfigSchema,\n} from './db'\n\nexport type {\n User,\n NewUser,\n Collection,\n NewCollection,\n Content,\n NewContent,\n Media,\n NewMedia,\n WorkflowHistory,\n NewWorkflowHistory,\n Plugin as DbPlugin,\n NewPlugin,\n PluginHook as DbPluginHook,\n NewPluginHook,\n PluginRoute,\n NewPluginRoute,\n PluginAsset,\n NewPluginAsset,\n PluginActivityLog,\n NewPluginActivityLog,\n SystemLog,\n NewSystemLog,\n LogConfig,\n NewLogConfig,\n} from './db'\n\n// Plugins - Week 2\n// export { PluginBuilder, HookSystem } from './plugins/sdk'\n\n// ============================================================================\n// Version\n// ============================================================================\n\nexport const VERSION = '2.0.0-alpha.3'\n\n// ============================================================================\n// Phase 2 Migration Notes\n// ============================================================================\n\n/**\n * This is a work-in-progress package being extracted from the main SonicJS codebase.\n *\n * Current Phase: 2 (Core Module Migration)\n * Current Week: 1 (Types, Utils, Database)\n *\n * Expected completion: 4 weeks from 2025-01-17\n *\n * DO NOT USE IN PRODUCTION - Alpha release for development only\n */\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/app.ts","../src/db/index.ts","../src/index.ts"],"names":["Hono","api_default","api_media_default","api_system_default","admin_api_default","admin_content_default","userRoutes","auth_default","d1","drizzle","schema_exports"],"mappings":";;;;;;;;;;;;;;AAqGO,SAAS,gBAAA,CAAiB,MAAA,GAAwB,EAAC,EAAe;AACvE,EAAA,MAAM,GAAA,GAAM,IAAIA,SAAA,EAAmD;AAGnE,EAAA,MAAM,UAAA,GAAa,OAAO,OAAA,IAAW,OAAA;AACrC,EAAA,MAAM,OAAA,GAAU,OAAO,IAAA,IAAQ,SAAA;AAG/B,EAAA,GAAA,CAAI,GAAA,CAAI,GAAA,EAAK,OAAO,CAAA,EAAG,IAAA,KAAS;AAC9B,IAAA,CAAA,CAAE,GAAA,CAAI,cAAc,UAAU,CAAA;AAC9B,IAAA,MAAM,IAAA,EAAK;AAAA,EACb,CAAC,CAAA;AAKD,EAAA,GAAA,CAAI,GAAA,CAAI,GAAA,EAAK,OAAO,EAAA,EAAI,IAAA,KAAS;AAE/B,IAAA,MA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/B;;;ACoRO,IAAM,OAAA,GAAU","file":"index.cjs","sourcesContent":["/**\n * Main Application Factory\n *\n * Creates a configured SonicJS application with all core functionality\n */\n\nimport { Hono } from 'hono'\nimport type { Context } from 'hono'\nimport type { D1Database, KVNamespace, R2Bucket } from '@cloudflare/workers-types'\nimport { apiRoutes, apiMediaRoutes, apiSystemRoutes, adminApiRoutes, authRoutes, adminContentRoutes, adminUsersRoutes } from './routes'\n\n// ============================================================================\n// Type Definitions\n// ============================================================================\n\nexport interface Bindings {\n DB: D1Database\n CACHE_KV: KVNamespace\n MEDIA_BUCKET: R2Bucket\n ASSETS: Fetcher\n EMAIL_QUEUE?: Queue\n SENDGRID_API_KEY?: string\n DEFAULT_FROM_EMAIL?: string\n IMAGES_ACCOUNT_ID?: string\n IMAGES_API_TOKEN?: string\n ENVIRONMENT?: string\n}\n\nexport interface Variables {\n user?: {\n userId: string\n email: string\n role: string\n exp: number\n iat: number\n }\n requestId?: string\n startTime?: number\n appVersion?: string\n}\n\nexport interface SonicJSConfig {\n // Collections configuration\n collections?: {\n directory?: string\n autoSync?: boolean\n }\n\n // Plugins configuration\n plugins?: {\n directory?: string\n autoLoad?: boolean\n }\n\n // Custom routes\n routes?: Array<{\n path: string\n handler: Hono\n }>\n\n // Custom middleware\n middleware?: {\n beforeAuth?: Array<(c: Context, next: () => Promise<void>) => Promise<void>>\n afterAuth?: Array<(c: Context, next: () => Promise<void>) => Promise<void>>\n }\n\n // App metadata\n version?: string\n name?: string\n}\n\nexport type SonicJSApp = Hono<{ Bindings: Bindings; Variables: Variables }>\n\n// ============================================================================\n// Application Factory\n// ============================================================================\n\n/**\n * Create a SonicJS application with core functionality\n *\n * @param config - Application configuration\n * @returns Configured Hono application\n *\n * @example\n * ```typescript\n * import { createSonicJSApp } from '@sonicjs/core'\n *\n * const app = createSonicJSApp({\n * collections: {\n * directory: './src/collections',\n * autoSync: true\n * },\n * plugins: {\n * directory: './src/plugins',\n * autoLoad: true\n * }\n * })\n *\n * export default app\n * ```\n */\nexport function createSonicJSApp(config: SonicJSConfig = {}): SonicJSApp {\n const app = new Hono<{ Bindings: Bindings; Variables: Variables }>()\n\n // Set app metadata\n const appVersion = config.version || '1.0.0'\n const appName = config.name || 'SonicJS'\n\n // App version middleware\n app.use('*', async (c, next) => {\n c.set('appVersion', appVersion)\n await next()\n })\n\n // Bootstrap middleware\n // Note: Implementation will be imported from middleware/bootstrap\n // This is a placeholder for the factory pattern\n app.use('*', async (_c, next) => {\n // Bootstrap logic here (migrations, collections, plugins)\n await next()\n })\n\n // Custom middleware - before auth\n if (config.middleware?.beforeAuth) {\n for (const middleware of config.middleware.beforeAuth) {\n app.use('*', middleware)\n }\n }\n\n // Logging middleware\n app.use('*', async (_c, next) => {\n // Logging logic here\n await next()\n })\n\n // Security middleware\n app.use('*', async (_c, next) => {\n // Security headers, CORS, etc.\n await next()\n })\n\n // Custom middleware - after auth\n if (config.middleware?.afterAuth) {\n for (const middleware of config.middleware.afterAuth) {\n app.use('*', middleware)\n }\n }\n\n // Core routes\n // Routes are being imported incrementally from routes/*\n // Each route is tested and migrated one-by-one\n app.route('/api', apiRoutes)\n app.route('/api/media', apiMediaRoutes)\n app.route('/api/system', apiSystemRoutes)\n app.route('/admin/api', adminApiRoutes)\n app.route('/admin/content', adminContentRoutes)\n app.route('/admin', adminUsersRoutes)\n app.route('/auth', authRoutes)\n\n // Custom routes - User-defined routes\n if (config.routes) {\n for (const route of config.routes) {\n app.route(route.path, route.handler)\n }\n }\n\n // Root redirect to login\n app.get('/', (c) => {\n return c.redirect('/auth/login')\n })\n\n // Health check\n app.get('/health', (c) => {\n return c.json({\n name: appName,\n version: appVersion,\n status: 'running',\n timestamp: new Date().toISOString()\n })\n })\n\n // 404 handler\n app.notFound((c) => {\n return c.json({ error: 'Not Found', status: 404 }, 404)\n })\n\n // Error handler\n app.onError((err, c) => {\n console.error(err)\n return c.json({ error: 'Internal Server Error', status: 500 }, 500)\n })\n\n return app\n}\n\n/**\n * Setup core middleware (backward compatibility)\n *\n * @param _app - Hono application\n * @deprecated Use createSonicJSApp() instead\n */\nexport function setupCoreMiddleware(_app: SonicJSApp): void {\n console.warn('setupCoreMiddleware is deprecated. Use createSonicJSApp() instead.')\n // Backward compatibility implementation\n}\n\n/**\n * Setup core routes (backward compatibility)\n *\n * @param _app - Hono application\n * @deprecated Use createSonicJSApp() instead\n */\nexport function setupCoreRoutes(_app: SonicJSApp): void {\n console.warn('setupCoreRoutes is deprecated. Use createSonicJSApp() instead.')\n // Backward compatibility implementation\n}\n","import { drizzle } from 'drizzle-orm/d1';\nimport * as schema from './schema';\n\nexport function createDb(d1: D1Database) {\n return drizzle(d1, { schema });\n}\n\nexport * from './schema';","/**\n * @sonicjs/core - Main Entry Point\n *\n * Core framework for SonicJS headless CMS\n * Built for Cloudflare's edge platform with TypeScript\n *\n * Phase 2 Migration Status:\n * - Week 1: Types, Utils, Database (COMPLETED ✓)\n * - Week 2: Services, Middleware, Plugins (COMPLETED ✓)\n * - Week 3: Routes, Templates (COMPLETED ✓)\n * - Week 4: Integration & Testing (COMPLETED ✓)\n *\n * Test Coverage:\n * - Utilities: 48 tests (sanitize, query-filter, metrics)\n * - Middleware: 51 tests (auth, logging, security, performance)\n * - Total: 99 tests passing\n */\n\n// ============================================================================\n// Main Application API (Phase 2 Week 1)\n// ============================================================================\n\nexport { createSonicJSApp, setupCoreMiddleware, setupCoreRoutes } from './app'\nexport type { SonicJSConfig, SonicJSApp, Bindings, Variables } from './app'\n\n// ============================================================================\n// Placeholders - To be populated in Phase 2\n// ============================================================================\n\n// Services - Week 2 (COMPLETED)\nexport {\n // Collection Management\n loadCollectionConfigs,\n loadCollectionConfig,\n getAvailableCollectionNames,\n validateCollectionConfig,\n syncCollections,\n syncCollection,\n isCollectionManaged,\n getManagedCollections,\n cleanupRemovedCollections,\n fullCollectionSync,\n // Database Migrations\n MigrationService,\n // Logging\n Logger,\n getLogger,\n initLogger,\n // Plugin Services - Class implementations\n PluginService as PluginServiceClass,\n PluginBootstrapService,\n} from './services'\n\nexport type { Migration, MigrationStatus, LogLevel, LogCategory, LogEntry, LogFilter, CorePlugin } from './services'\n\n// Middleware - Week 2 (COMPLETED)\nexport {\n // Authentication\n AuthManager,\n requireAuth,\n requireRole,\n optionalAuth,\n // Logging\n loggingMiddleware,\n detailedLoggingMiddleware,\n securityLoggingMiddleware,\n performanceLoggingMiddleware,\n // Performance\n cacheHeaders,\n compressionMiddleware,\n securityHeaders,\n // Permissions\n PermissionManager,\n requirePermission,\n requireAnyPermission,\n logActivity,\n // Plugin middleware\n requireActivePlugin,\n requireActivePlugins,\n getActivePlugins,\n isPluginActive,\n // Bootstrap\n bootstrapMiddleware,\n} from './middleware'\n\nexport type { Permission, UserPermissions } from './middleware'\n\n// Plugins - Week 2 (COMPLETED)\nexport {\n // Hook System - Class implementations\n HookSystemImpl,\n ScopedHookSystem as ScopedHookSystemClass,\n HookUtils,\n // Plugin Registry\n PluginRegistryImpl,\n // Plugin Manager - Class implementation\n PluginManager as PluginManagerClass,\n // Plugin Validator - Class implementation\n PluginValidator as PluginValidatorClass,\n} from './plugins'\n\n// Routes - Week 3 (COMPLETED)\nexport { ROUTES_INFO } from './routes'\n\n// Templates - Week 3 (COMPLETED)\nexport {\n // Form templates\n renderForm,\n renderFormField,\n // Table templates\n renderTable,\n // Pagination templates\n renderPagination,\n // Alert templates\n renderAlert,\n // Confirmation dialog templates\n renderConfirmationDialog,\n getConfirmationDialogScript,\n // Filter bar templates\n renderFilterBar,\n} from './templates'\n\nexport type {\n FormField,\n FormData,\n TableColumn,\n TableData,\n PaginationData,\n AlertData,\n ConfirmationDialogOptions,\n FilterBarData,\n Filter,\n FilterOption,\n} from './templates'\n\n// Types - Week 1 (COMPLETED)\nexport type {\n // Collection types\n FieldType,\n FieldConfig,\n CollectionSchema,\n CollectionConfig,\n CollectionConfigModule,\n CollectionSyncResult,\n // Plugin types\n Plugin,\n PluginContext,\n PluginConfig,\n PluginRoutes,\n PluginMiddleware,\n PluginModel,\n PluginService,\n PluginAdminPage,\n PluginComponent,\n PluginMenuItem,\n PluginHook,\n HookHandler,\n HookContext,\n HookSystem,\n ScopedHookSystem,\n PluginRegistry,\n PluginManager,\n PluginStatus,\n AuthService,\n ContentService,\n MediaService,\n PluginLogger,\n PluginBuilderOptions,\n PluginValidator,\n PluginValidationResult,\n HookName,\n // Plugin manifest\n PluginManifest,\n} from './types'\n\nexport { HOOKS } from './types'\n\n// Utils - Week 1 (COMPLETED)\nexport {\n // Sanitization\n escapeHtml,\n sanitizeInput,\n sanitizeObject,\n // Template rendering\n TemplateRenderer,\n templateRenderer,\n renderTemplate,\n // Query filtering\n QueryFilterBuilder,\n buildQuery,\n // Metrics\n metricsTracker,\n} from './utils'\n\nexport type {\n FilterOperator,\n FilterCondition,\n FilterGroup,\n QueryFilter,\n QueryResult,\n} from './utils'\n\n// Database - Week 1 (COMPLETED)\nexport {\n createDb,\n // Schema exports\n users,\n collections,\n content,\n contentVersions,\n media,\n apiTokens,\n workflowHistory,\n plugins,\n pluginHooks,\n pluginRoutes,\n pluginAssets,\n pluginActivityLog,\n systemLogs,\n logConfig,\n // Zod validation schemas\n insertUserSchema,\n selectUserSchema,\n insertCollectionSchema,\n selectCollectionSchema,\n insertContentSchema,\n selectContentSchema,\n insertMediaSchema,\n selectMediaSchema,\n insertWorkflowHistorySchema,\n selectWorkflowHistorySchema,\n insertPluginSchema,\n selectPluginSchema,\n insertPluginHookSchema,\n selectPluginHookSchema,\n insertPluginRouteSchema,\n selectPluginRouteSchema,\n insertPluginAssetSchema,\n selectPluginAssetSchema,\n insertPluginActivityLogSchema,\n selectPluginActivityLogSchema,\n insertSystemLogSchema,\n selectSystemLogSchema,\n insertLogConfigSchema,\n selectLogConfigSchema,\n} from './db'\n\nexport type {\n User,\n NewUser,\n Collection,\n NewCollection,\n Content,\n NewContent,\n Media,\n NewMedia,\n WorkflowHistory,\n NewWorkflowHistory,\n Plugin as DbPlugin,\n NewPlugin,\n PluginHook as DbPluginHook,\n NewPluginHook,\n PluginRoute,\n NewPluginRoute,\n PluginAsset,\n NewPluginAsset,\n PluginActivityLog,\n NewPluginActivityLog,\n SystemLog,\n NewSystemLog,\n LogConfig,\n NewLogConfig,\n} from './db'\n\n// Plugins - Week 2\n// export { PluginBuilder, HookSystem } from './plugins/sdk'\n\n// ============================================================================\n// Version\n// ============================================================================\n\nexport const VERSION = '2.0.0-alpha.3'\n\n// ============================================================================\n// Phase 2 Migration Notes\n// ============================================================================\n\n/**\n * This is a work-in-progress package being extracted from the main SonicJS codebase.\n *\n * Current Phase: 2 (Core Module Migration)\n * Current Week: 1 (Types, Utils, Database)\n *\n * Expected completion: 4 weeks from 2025-01-17\n *\n * DO NOT USE IN PRODUCTION - Alpha release for development only\n */\n"]}
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { api_default, api_media_default, api_system_default, admin_api_default, admin_content_default, auth_default } from './chunk-
|
|
2
|
-
export { ROUTES_INFO } from './chunk-
|
|
1
|
+
import { api_default, api_media_default, api_system_default, admin_api_default, admin_content_default, userRoutes, auth_default } from './chunk-VY6FDZ6Y.js';
|
|
2
|
+
export { ROUTES_INFO } from './chunk-VY6FDZ6Y.js';
|
|
3
3
|
import './chunk-3MNMOLSA.js';
|
|
4
|
-
export { AuthManager, PermissionManager, bootstrapMiddleware, cacheHeaders, compressionMiddleware, detailedLoggingMiddleware, getActivePlugins, isPluginActive, logActivity, loggingMiddleware, optionalAuth, performanceLoggingMiddleware, requireActivePlugin, requireActivePlugins, requireAnyPermission, requireAuth, requirePermission, requireRole, securityHeaders, securityLoggingMiddleware } from './chunk-
|
|
5
|
-
import { schema_exports } from './chunk-
|
|
6
|
-
export { Logger, MigrationService, PluginBootstrapService, PluginService as PluginServiceClass, apiTokens, cleanupRemovedCollections, collections, content, contentVersions, fullCollectionSync, getAvailableCollectionNames, getLogger, getManagedCollections, initLogger, insertCollectionSchema, insertContentSchema, insertLogConfigSchema, insertMediaSchema, insertPluginActivityLogSchema, insertPluginAssetSchema, insertPluginHookSchema, insertPluginRouteSchema, insertPluginSchema, insertSystemLogSchema, insertUserSchema, insertWorkflowHistorySchema, isCollectionManaged, loadCollectionConfig, loadCollectionConfigs, logConfig, media, pluginActivityLog, pluginAssets, pluginHooks, pluginRoutes, plugins, selectCollectionSchema, selectContentSchema, selectLogConfigSchema, selectMediaSchema, selectPluginActivityLogSchema, selectPluginAssetSchema, selectPluginHookSchema, selectPluginRouteSchema, selectPluginSchema, selectSystemLogSchema, selectUserSchema, selectWorkflowHistorySchema, syncCollection, syncCollections, systemLogs, users, validateCollectionConfig, workflowHistory } from './chunk-
|
|
4
|
+
export { AuthManager, PermissionManager, bootstrapMiddleware, cacheHeaders, compressionMiddleware, detailedLoggingMiddleware, getActivePlugins, isPluginActive, logActivity, loggingMiddleware, optionalAuth, performanceLoggingMiddleware, requireActivePlugin, requireActivePlugins, requireAnyPermission, requireAuth, requirePermission, requireRole, securityHeaders, securityLoggingMiddleware } from './chunk-WESS2U3K.js';
|
|
5
|
+
import { schema_exports } from './chunk-7N3HK7ZK.js';
|
|
6
|
+
export { Logger, MigrationService, PluginBootstrapService, PluginService as PluginServiceClass, apiTokens, cleanupRemovedCollections, collections, content, contentVersions, fullCollectionSync, getAvailableCollectionNames, getLogger, getManagedCollections, initLogger, insertCollectionSchema, insertContentSchema, insertLogConfigSchema, insertMediaSchema, insertPluginActivityLogSchema, insertPluginAssetSchema, insertPluginHookSchema, insertPluginRouteSchema, insertPluginSchema, insertSystemLogSchema, insertUserSchema, insertWorkflowHistorySchema, isCollectionManaged, loadCollectionConfig, loadCollectionConfigs, logConfig, media, pluginActivityLog, pluginAssets, pluginHooks, pluginRoutes, plugins, selectCollectionSchema, selectContentSchema, selectLogConfigSchema, selectMediaSchema, selectPluginActivityLogSchema, selectPluginAssetSchema, selectPluginHookSchema, selectPluginRouteSchema, selectPluginSchema, selectSystemLogSchema, selectUserSchema, selectWorkflowHistorySchema, syncCollection, syncCollections, systemLogs, users, validateCollectionConfig, workflowHistory } from './chunk-7N3HK7ZK.js';
|
|
7
7
|
export { getConfirmationDialogScript, renderAlert, renderConfirmationDialog, renderFilterBar, renderForm, renderFormField, renderPagination, renderTable } from './chunk-KRJMGD4E.js';
|
|
8
|
-
export { HookSystemImpl, HookUtils, PluginManager as PluginManagerClass, PluginRegistryImpl, PluginValidator as PluginValidatorClass, ScopedHookSystem as ScopedHookSystemClass } from './chunk-
|
|
8
|
+
export { HookSystemImpl, HookUtils, PluginManager as PluginManagerClass, PluginRegistryImpl, PluginValidator as PluginValidatorClass, ScopedHookSystem as ScopedHookSystemClass } from './chunk-BITQ4MFX.js';
|
|
9
9
|
export { QueryFilterBuilder, TemplateRenderer, buildQuery, escapeHtml, metricsTracker, renderTemplate, sanitizeInput, sanitizeObject, templateRenderer } from './chunk-JIINOD2W.js';
|
|
10
10
|
export { HOOKS } from './chunk-LOUJRBXV.js';
|
|
11
|
-
import './chunk-
|
|
11
|
+
import './chunk-V4OQ3NZ2.js';
|
|
12
12
|
import { Hono } from 'hono';
|
|
13
13
|
import { drizzle } from 'drizzle-orm/d1';
|
|
14
14
|
|
|
@@ -44,6 +44,7 @@ function createSonicJSApp(config = {}) {
|
|
|
44
44
|
app.route("/api/system", api_system_default);
|
|
45
45
|
app.route("/admin/api", admin_api_default);
|
|
46
46
|
app.route("/admin/content", admin_content_default);
|
|
47
|
+
app.route("/admin", userRoutes);
|
|
47
48
|
app.route("/auth", auth_default);
|
|
48
49
|
if (config.routes) {
|
|
49
50
|
for (const route of config.routes) {
|