@sonicjs-cms/core 3.0.0-beta.14 → 3.0.0-beta.15
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/{app-Bo0X1OWX.d.ts → app-01M0dIwt.d.ts} +1 -1
- package/dist/{app-Do66yCcV.d.cts → app-aj39TGHB.d.cts} +1 -1
- package/dist/{chunk-H5FB6GKR.cjs → chunk-4AB3PQHF.cjs} +2 -2
- package/dist/{chunk-H5FB6GKR.cjs.map → chunk-4AB3PQHF.cjs.map} +1 -1
- package/dist/{chunk-INE5E3SL.js → chunk-4ENXIP4M.js} +27 -2
- package/dist/chunk-4ENXIP4M.js.map +1 -0
- package/dist/{chunk-5L6EMI7A.js → chunk-75WXXLAU.js} +4 -4
- package/dist/{chunk-5L6EMI7A.js.map → chunk-75WXXLAU.js.map} +1 -1
- package/dist/{chunk-SSOP7G4R.cjs → chunk-BDQOPRA3.cjs} +220 -219
- package/dist/chunk-BDQOPRA3.cjs.map +1 -0
- package/dist/{chunk-U7T5EOHJ.js → chunk-CE6POA7A.js} +4 -4
- package/dist/{chunk-U7T5EOHJ.js.map → chunk-CE6POA7A.js.map} +1 -1
- package/dist/{chunk-G5LC7MYH.cjs → chunk-FVI3H6RG.cjs} +10 -10
- package/dist/{chunk-G5LC7MYH.cjs.map → chunk-FVI3H6RG.cjs.map} +1 -1
- package/dist/{chunk-WIV3R2MJ.cjs → chunk-FXZSZ7C7.cjs} +27 -2
- package/dist/chunk-FXZSZ7C7.cjs.map +1 -0
- package/dist/{chunk-O32IZ6JS.js → chunk-GQXVDFIG.js} +43 -5
- package/dist/chunk-GQXVDFIG.js.map +1 -0
- package/dist/{chunk-75JKPNUZ.js → chunk-IQZA2OY5.js} +3 -3
- package/dist/{chunk-75JKPNUZ.js.map → chunk-IQZA2OY5.js.map} +1 -1
- package/dist/{chunk-QNPT6BQP.js → chunk-JRLADH5B.js} +3 -3
- package/dist/{chunk-QNPT6BQP.js.map → chunk-JRLADH5B.js.map} +1 -1
- package/dist/{chunk-ZTEJHSYS.cjs → chunk-KMCLNO4K.cjs} +5 -5
- package/dist/{chunk-ZTEJHSYS.cjs.map → chunk-KMCLNO4K.cjs.map} +1 -1
- package/dist/{chunk-HNUGMALL.js → chunk-L3VIH6U4.js} +15 -15
- package/dist/chunk-L3VIH6U4.js.map +1 -0
- package/dist/{chunk-SIPBHWMG.cjs → chunk-PK3ODTAL.cjs} +4 -4
- package/dist/{chunk-SIPBHWMG.cjs.map → chunk-PK3ODTAL.cjs.map} +1 -1
- package/dist/{chunk-4YRYGDCQ.cjs → chunk-PTTFLUEX.cjs} +4 -4
- package/dist/{chunk-4YRYGDCQ.cjs.map → chunk-PTTFLUEX.cjs.map} +1 -1
- package/dist/{chunk-32SDMKZ7.js → chunk-VOAP3KFU.js} +2 -2
- package/dist/{chunk-32SDMKZ7.js.map → chunk-VOAP3KFU.js.map} +1 -1
- package/dist/{chunk-IESEVHXL.js → chunk-VVYVFCML.js} +12 -3
- package/dist/chunk-VVYVFCML.js.map +1 -0
- package/dist/{chunk-HIKBY7MS.cjs → chunk-XWVDSM2L.cjs} +12 -3
- package/dist/chunk-XWVDSM2L.cjs.map +1 -0
- package/dist/{chunk-L3KHLEHL.cjs → chunk-ZBDDZYA3.cjs} +53 -15
- package/dist/chunk-ZBDDZYA3.cjs.map +1 -0
- package/dist/config-SM2UWSDN.js +6 -0
- package/dist/{config-PLJTDINX.js.map → config-SM2UWSDN.js.map} +1 -1
- package/dist/config-YCRSU7ZP.cjs +19 -0
- package/dist/{config-FLOUCYHH.cjs.map → config-YCRSU7ZP.cjs.map} +1 -1
- package/dist/{define-plugin-BzNHc1ZI.d.ts → define-plugin-BYIey6sp.d.ts} +1 -1
- package/dist/{define-plugin-IWDKYaVm.d.cts → define-plugin-DsKiGu1q.d.cts} +1 -1
- package/dist/index.cjs +754 -296
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -6
- package/dist/index.d.ts +17 -6
- package/dist/index.js +512 -56
- package/dist/index.js.map +1 -1
- package/dist/middleware.cjs +33 -33
- package/dist/middleware.d.cts +2 -2
- package/dist/middleware.d.ts +2 -2
- package/dist/middleware.js +4 -4
- package/dist/migrations-6R2N6G2P.js +4 -0
- package/dist/{migrations-DOPZXFK3.js.map → migrations-6R2N6G2P.js.map} +1 -1
- package/dist/migrations-X3UX24QG.cjs +13 -0
- package/dist/{migrations-TYYC66P4.cjs.map → migrations-X3UX24QG.cjs.map} +1 -1
- package/dist/plugins.cjs +40 -40
- package/dist/plugins.d.cts +2 -2
- package/dist/plugins.d.ts +2 -2
- package/dist/plugins.js +3 -3
- package/dist/routes.cjs +27 -27
- package/dist/routes.d.cts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/routes.js +7 -7
- package/dist/services.cjs +18 -18
- package/dist/services.js +2 -2
- package/dist/{types-Dea1eNxU.d.cts → types-DT7XN5TX.d.cts} +1 -1
- package/dist/{types-Dea1eNxU.d.ts → types-DT7XN5TX.d.ts} +1 -1
- package/dist/utils.cjs +3 -3
- package/dist/utils.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-HIKBY7MS.cjs.map +0 -1
- package/dist/chunk-HNUGMALL.js.map +0 -1
- package/dist/chunk-IESEVHXL.js.map +0 -1
- package/dist/chunk-INE5E3SL.js.map +0 -1
- package/dist/chunk-L3KHLEHL.cjs.map +0 -1
- package/dist/chunk-O32IZ6JS.js.map +0 -1
- package/dist/chunk-SSOP7G4R.cjs.map +0 -1
- package/dist/chunk-WIV3R2MJ.cjs.map +0 -1
- package/dist/config-FLOUCYHH.cjs +0 -19
- package/dist/config-PLJTDINX.js +0 -6
- package/dist/migrations-DOPZXFK3.js +0 -4
- package/dist/migrations-TYYC66P4.cjs +0 -13
package/dist/routes.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as hono_types from 'hono/types';
|
|
2
2
|
import { Hono } from 'hono';
|
|
3
|
-
import { B as Bindings$5, V as Variables$6 } from './app-
|
|
3
|
+
import { B as Bindings$5, V as Variables$6 } from './app-aj39TGHB.cjs';
|
|
4
4
|
import { D1Database as D1Database$1, KVNamespace as KVNamespace$1, R2Bucket as R2Bucket$1 } from '@cloudflare/workers-types';
|
|
5
5
|
import 'better-auth/client';
|
|
6
6
|
import 'better-auth/plugins/email-otp';
|
|
@@ -9,7 +9,7 @@ import 'better-auth/plugins/magic-link';
|
|
|
9
9
|
import 'better-call';
|
|
10
10
|
import 'zod/v4/core';
|
|
11
11
|
import 'zod';
|
|
12
|
-
import './types-
|
|
12
|
+
import './types-DT7XN5TX.cjs';
|
|
13
13
|
|
|
14
14
|
declare const apiDocumentsRoutes: Hono<{
|
|
15
15
|
Bindings: Bindings$5;
|
package/dist/routes.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as hono_types from 'hono/types';
|
|
2
2
|
import { Hono } from 'hono';
|
|
3
|
-
import { B as Bindings$5, V as Variables$6 } from './app-
|
|
3
|
+
import { B as Bindings$5, V as Variables$6 } from './app-01M0dIwt.js';
|
|
4
4
|
import { D1Database as D1Database$1, KVNamespace as KVNamespace$1, R2Bucket as R2Bucket$1 } from '@cloudflare/workers-types';
|
|
5
5
|
import 'better-auth/client';
|
|
6
6
|
import 'better-auth/plugins/email-otp';
|
|
@@ -9,7 +9,7 @@ import 'better-auth/plugins/magic-link';
|
|
|
9
9
|
import 'better-call';
|
|
10
10
|
import 'zod/v4/core';
|
|
11
11
|
import 'zod';
|
|
12
|
-
import './types-
|
|
12
|
+
import './types-DT7XN5TX.js';
|
|
13
13
|
|
|
14
14
|
declare const apiDocumentsRoutes: Hono<{
|
|
15
15
|
Bindings: Bindings$5;
|
package/dist/routes.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export { ROUTES_INFO, router2 as adminApiReferenceRoutes, admin_api_default as adminApiRoutes, adminCheckboxRoutes, adminCollectionsRoutes, admin_content_default as adminContentRoutes, router as adminDashboardRoutes, adminDocumentsRoutes, adminLogsRoutes, adminMediaRoutes, adminPluginRoutes, adminSettingsRoutes, userRoutes as adminUsersRoutes, api_content_crud_default as apiContentCrudRoutes, apiDocumentsRoutes, api_media_default as apiMediaRoutes, api_default as apiRoutes, api_system_default as apiSystemRoutes, auth_default as authRoutes, test_cleanup_default as testCleanupRoutes } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { ROUTES_INFO, router2 as adminApiReferenceRoutes, admin_api_default as adminApiRoutes, adminCheckboxRoutes, adminCollectionsRoutes, admin_content_default as adminContentRoutes, router as adminDashboardRoutes, adminDocumentsRoutes, adminLogsRoutes, adminMediaRoutes, adminPluginRoutes, adminSettingsRoutes, userRoutes as adminUsersRoutes, api_content_crud_default as apiContentCrudRoutes, apiDocumentsRoutes, api_media_default as apiMediaRoutes, api_default as apiRoutes, api_system_default as apiSystemRoutes, auth_default as authRoutes, test_cleanup_default as testCleanupRoutes } from './chunk-L3VIH6U4.js';
|
|
2
|
+
import './chunk-VVYVFCML.js';
|
|
3
3
|
import './chunk-RMRJGMDE.js';
|
|
4
4
|
import './chunk-RQ6N3FTV.js';
|
|
5
5
|
import './chunk-K25XHMM3.js';
|
|
6
6
|
import './chunk-AI663NBO.js';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-GQXVDFIG.js';
|
|
8
8
|
import './chunk-PDC7DLOV.js';
|
|
9
9
|
import './chunk-GCDZZNIN.js';
|
|
10
|
-
import './chunk-
|
|
11
|
-
import './chunk-
|
|
10
|
+
import './chunk-4ENXIP4M.js';
|
|
11
|
+
import './chunk-VOAP3KFU.js';
|
|
12
12
|
import './chunk-OBA2RYZN.js';
|
|
13
13
|
import './chunk-5V62WT6M.js';
|
|
14
|
-
import './chunk-
|
|
14
|
+
import './chunk-JRLADH5B.js';
|
|
15
15
|
import './chunk-RNZFGN4R.js';
|
|
16
16
|
import './chunk-QZGABF2M.js';
|
|
17
17
|
import './chunk-FICTAGD4.js';
|
|
18
18
|
import './chunk-X7ZAEI5S.js';
|
|
19
|
-
import './chunk-
|
|
19
|
+
import './chunk-CE6POA7A.js';
|
|
20
20
|
import './chunk-TQABQWOP.js';
|
|
21
21
|
import './chunk-V4OQ3NZ2.js';
|
|
22
22
|
//# sourceMappingURL=routes.js.map
|
package/dist/services.cjs
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var chunk4BTBSXMR_cjs = require('./chunk-4BTBSXMR.cjs');
|
|
4
4
|
require('./chunk-YA3TJ65D.cjs');
|
|
5
5
|
require('./chunk-YP7GW2G5.cjs');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
6
|
+
var chunkFXZSZ7C7_cjs = require('./chunk-FXZSZ7C7.cjs');
|
|
7
|
+
var chunk4AB3PQHF_cjs = require('./chunk-4AB3PQHF.cjs');
|
|
8
8
|
require('./chunk-P3XDZL6Q.cjs');
|
|
9
9
|
require('./chunk-MNWKYY5E.cjs');
|
|
10
10
|
require('./chunk-IGJUBJBW.cjs');
|
|
@@ -57,67 +57,67 @@ Object.defineProperty(exports, "setAppInstance", {
|
|
|
57
57
|
});
|
|
58
58
|
Object.defineProperty(exports, "CollectionRegistry", {
|
|
59
59
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunkFXZSZ7C7_cjs.CollectionRegistry; }
|
|
61
61
|
});
|
|
62
62
|
Object.defineProperty(exports, "PluginBootstrapService", {
|
|
63
63
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
64
|
+
get: function () { return chunkFXZSZ7C7_cjs.PluginBootstrapService; }
|
|
65
65
|
});
|
|
66
66
|
Object.defineProperty(exports, "PluginService", {
|
|
67
67
|
enumerable: true,
|
|
68
|
-
get: function () { return
|
|
68
|
+
get: function () { return chunkFXZSZ7C7_cjs.PluginService; }
|
|
69
69
|
});
|
|
70
70
|
Object.defineProperty(exports, "TelemetryService", {
|
|
71
71
|
enumerable: true,
|
|
72
|
-
get: function () { return
|
|
72
|
+
get: function () { return chunkFXZSZ7C7_cjs.TelemetryService; }
|
|
73
73
|
});
|
|
74
74
|
Object.defineProperty(exports, "collectionRecordToRow", {
|
|
75
75
|
enumerable: true,
|
|
76
|
-
get: function () { return
|
|
76
|
+
get: function () { return chunkFXZSZ7C7_cjs.collectionRecordToRow; }
|
|
77
77
|
});
|
|
78
78
|
Object.defineProperty(exports, "createInstallationIdentity", {
|
|
79
79
|
enumerable: true,
|
|
80
|
-
get: function () { return
|
|
80
|
+
get: function () { return chunkFXZSZ7C7_cjs.createInstallationIdentity; }
|
|
81
81
|
});
|
|
82
82
|
Object.defineProperty(exports, "getAvailableCollectionNames", {
|
|
83
83
|
enumerable: true,
|
|
84
|
-
get: function () { return
|
|
84
|
+
get: function () { return chunkFXZSZ7C7_cjs.getAvailableCollectionNames; }
|
|
85
85
|
});
|
|
86
86
|
Object.defineProperty(exports, "getCollectionRegistry", {
|
|
87
87
|
enumerable: true,
|
|
88
|
-
get: function () { return
|
|
88
|
+
get: function () { return chunkFXZSZ7C7_cjs.getCollectionRegistry; }
|
|
89
89
|
});
|
|
90
90
|
Object.defineProperty(exports, "getTelemetryService", {
|
|
91
91
|
enumerable: true,
|
|
92
|
-
get: function () { return
|
|
92
|
+
get: function () { return chunkFXZSZ7C7_cjs.getTelemetryService; }
|
|
93
93
|
});
|
|
94
94
|
Object.defineProperty(exports, "initTelemetry", {
|
|
95
95
|
enumerable: true,
|
|
96
|
-
get: function () { return
|
|
96
|
+
get: function () { return chunkFXZSZ7C7_cjs.initTelemetry; }
|
|
97
97
|
});
|
|
98
98
|
Object.defineProperty(exports, "loadCollectionConfig", {
|
|
99
99
|
enumerable: true,
|
|
100
|
-
get: function () { return
|
|
100
|
+
get: function () { return chunkFXZSZ7C7_cjs.loadCollectionConfig; }
|
|
101
101
|
});
|
|
102
102
|
Object.defineProperty(exports, "loadCollectionConfigs", {
|
|
103
103
|
enumerable: true,
|
|
104
|
-
get: function () { return
|
|
104
|
+
get: function () { return chunkFXZSZ7C7_cjs.loadCollectionConfigs; }
|
|
105
105
|
});
|
|
106
106
|
Object.defineProperty(exports, "registerCollections", {
|
|
107
107
|
enumerable: true,
|
|
108
|
-
get: function () { return
|
|
108
|
+
get: function () { return chunkFXZSZ7C7_cjs.registerCollections; }
|
|
109
109
|
});
|
|
110
110
|
Object.defineProperty(exports, "resetCollectionRegistry", {
|
|
111
111
|
enumerable: true,
|
|
112
|
-
get: function () { return
|
|
112
|
+
get: function () { return chunkFXZSZ7C7_cjs.resetCollectionRegistry; }
|
|
113
113
|
});
|
|
114
114
|
Object.defineProperty(exports, "validateCollectionConfig", {
|
|
115
115
|
enumerable: true,
|
|
116
|
-
get: function () { return
|
|
116
|
+
get: function () { return chunkFXZSZ7C7_cjs.validateCollectionConfig; }
|
|
117
117
|
});
|
|
118
118
|
Object.defineProperty(exports, "MigrationService", {
|
|
119
119
|
enumerable: true,
|
|
120
|
-
get: function () { return
|
|
120
|
+
get: function () { return chunk4AB3PQHF_cjs.MigrationService; }
|
|
121
121
|
});
|
|
122
122
|
//# sourceMappingURL=services.cjs.map
|
|
123
123
|
//# sourceMappingURL=services.cjs.map
|
package/dist/services.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { CACHE_CONFIGS, CATEGORY_INFO, CacheService, Logger, SettingsService, buildRouteList, getAppInstance, getCacheService, getLogger, initLogger, setAppInstance } from './chunk-RQ6N3FTV.js';
|
|
2
2
|
import './chunk-K25XHMM3.js';
|
|
3
3
|
import './chunk-AI663NBO.js';
|
|
4
|
-
export { CollectionRegistry, PluginBootstrapService, PluginService, TelemetryService, collectionRecordToRow, createInstallationIdentity, getAvailableCollectionNames, getCollectionRegistry, getTelemetryService, initTelemetry, loadCollectionConfig, loadCollectionConfigs, registerCollections, resetCollectionRegistry, validateCollectionConfig } from './chunk-
|
|
5
|
-
export { MigrationService } from './chunk-
|
|
4
|
+
export { CollectionRegistry, PluginBootstrapService, PluginService, TelemetryService, collectionRecordToRow, createInstallationIdentity, getAvailableCollectionNames, getCollectionRegistry, getTelemetryService, initTelemetry, loadCollectionConfig, loadCollectionConfigs, registerCollections, resetCollectionRegistry, validateCollectionConfig } from './chunk-4ENXIP4M.js';
|
|
5
|
+
export { MigrationService } from './chunk-VOAP3KFU.js';
|
|
6
6
|
import './chunk-X7ZAEI5S.js';
|
|
7
7
|
import './chunk-TQABQWOP.js';
|
|
8
8
|
import './chunk-V4OQ3NZ2.js';
|
|
@@ -283,4 +283,4 @@ interface EmailProvider {
|
|
|
283
283
|
}>>;
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
-
export { type AuthMagicLinkConsumedPayload as A, type ContentEventPayload as C, type EmailProvider as E, HOOK_EVENT_NAMES as H, LEGACY_EVENT_ALIASES as L, type NormalizedEmailMessage as N, type PayloadForEvent as P, type SubscribableEvent as S, type TypedHookContext as T, type AuthOtpVerifiedPayload as a, type AuthPasswordResetCompletedPayload as b, type AuthPasswordResetRequestedPayload as c, type AuthRegistrationCompletedPayload as d, type HookActor as e, type HookEventName as f, type HookEventPayloads as g, type HookPayload as h, type HookSystemLike as i, type LegacyHookEventName as j, type LegacyHookEventPayloads as k, type TypedHookHandler as l, type TypedHooks as m, createTypedHooks as n, isKnownHookEvent as o, isLegacyHookEvent as p, type
|
|
286
|
+
export { type AuthMagicLinkConsumedPayload as A, type ContentEventPayload as C, type EmailProvider as E, HOOK_EVENT_NAMES as H, LEGACY_EVENT_ALIASES as L, type NormalizedEmailMessage as N, type PayloadForEvent as P, type SubscribableEvent as S, type TypedHookContext as T, type AuthOtpVerifiedPayload as a, type AuthPasswordResetCompletedPayload as b, type AuthPasswordResetRequestedPayload as c, type AuthRegistrationCompletedPayload as d, type HookActor as e, type HookEventName as f, type HookEventPayloads as g, type HookPayload as h, type HookSystemLike as i, type LegacyHookEventName as j, type LegacyHookEventPayloads as k, type TypedHookHandler as l, type TypedHooks as m, createTypedHooks as n, isKnownHookEvent as o, isLegacyHookEvent as p, type EmailLogRow as q, resolveHookEventName as r, type EmailMessage as s, type SendResult as t };
|
|
@@ -283,4 +283,4 @@ interface EmailProvider {
|
|
|
283
283
|
}>>;
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
-
export { type AuthMagicLinkConsumedPayload as A, type ContentEventPayload as C, type EmailProvider as E, HOOK_EVENT_NAMES as H, LEGACY_EVENT_ALIASES as L, type NormalizedEmailMessage as N, type PayloadForEvent as P, type SubscribableEvent as S, type TypedHookContext as T, type AuthOtpVerifiedPayload as a, type AuthPasswordResetCompletedPayload as b, type AuthPasswordResetRequestedPayload as c, type AuthRegistrationCompletedPayload as d, type HookActor as e, type HookEventName as f, type HookEventPayloads as g, type HookPayload as h, type HookSystemLike as i, type LegacyHookEventName as j, type LegacyHookEventPayloads as k, type TypedHookHandler as l, type TypedHooks as m, createTypedHooks as n, isKnownHookEvent as o, isLegacyHookEvent as p, type
|
|
286
|
+
export { type AuthMagicLinkConsumedPayload as A, type ContentEventPayload as C, type EmailProvider as E, HOOK_EVENT_NAMES as H, LEGACY_EVENT_ALIASES as L, type NormalizedEmailMessage as N, type PayloadForEvent as P, type SubscribableEvent as S, type TypedHookContext as T, type AuthOtpVerifiedPayload as a, type AuthPasswordResetCompletedPayload as b, type AuthPasswordResetRequestedPayload as c, type AuthRegistrationCompletedPayload as d, type HookActor as e, type HookEventName as f, type HookEventPayloads as g, type HookPayload as h, type HookSystemLike as i, type LegacyHookEventName as j, type LegacyHookEventPayloads as k, type TypedHookHandler as l, type TypedHooks as m, createTypedHooks as n, isKnownHookEvent as o, isLegacyHookEvent as p, type EmailLogRow as q, resolveHookEventName as r, type EmailMessage as s, type SendResult as t };
|
package/dist/utils.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var chunkIXUHXTHW_cjs = require('./chunk-IXUHXTHW.cjs');
|
|
4
4
|
var chunkRCQ2HIQD_cjs = require('./chunk-RCQ2HIQD.cjs');
|
|
5
5
|
var chunkP3XDZL6Q_cjs = require('./chunk-P3XDZL6Q.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkPK3ODTAL_cjs = require('./chunk-PK3ODTAL.cjs');
|
|
7
7
|
var chunkMNWKYY5E_cjs = require('./chunk-MNWKYY5E.cjs');
|
|
8
8
|
require('./chunk-IGJUBJBW.cjs');
|
|
9
9
|
|
|
@@ -79,11 +79,11 @@ Object.defineProperty(exports, "shouldSkipEvent", {
|
|
|
79
79
|
});
|
|
80
80
|
Object.defineProperty(exports, "SONICJS_VERSION", {
|
|
81
81
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunkPK3ODTAL_cjs.SONICJS_VERSION; }
|
|
83
83
|
});
|
|
84
84
|
Object.defineProperty(exports, "getCoreVersion", {
|
|
85
85
|
enumerable: true,
|
|
86
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunkPK3ODTAL_cjs.getCoreVersion; }
|
|
87
87
|
});
|
|
88
88
|
Object.defineProperty(exports, "escapeHtml", {
|
|
89
89
|
enumerable: true,
|
package/dist/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { QueryFilterBuilder, TemplateRenderer, buildQuery, generateSlug, getBlocksFieldConfig, parseBlocksValue, renderTemplate, templateRenderer } from './chunk-QZGABF2M.js';
|
|
2
2
|
export { metricsTracker } from './chunk-FICTAGD4.js';
|
|
3
3
|
export { generateInstallationId, generateProjectId, getDefaultTelemetryConfig, getTelemetryConfig, isTelemetryEnabled, sanitizeErrorMessage, sanitizeRoute, shouldSkipEvent } from './chunk-X7ZAEI5S.js';
|
|
4
|
-
export { SONICJS_VERSION, getCoreVersion } from './chunk-
|
|
4
|
+
export { SONICJS_VERSION, getCoreVersion } from './chunk-CE6POA7A.js';
|
|
5
5
|
export { escapeHtml, sanitizeInput, sanitizeObject } from './chunk-TQABQWOP.js';
|
|
6
6
|
import './chunk-V4OQ3NZ2.js';
|
|
7
7
|
//# sourceMappingURL=utils.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonicjs-cms/core",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.15",
|
|
4
4
|
"description": "Core framework for SonicJS headless CMS - Edge-first, TypeScript-native CMS built for Cloudflare Workers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
106
|
"@cf-wasm/resvg": "^0.3.3",
|
|
107
|
-
"better-auth": "^1.6.
|
|
107
|
+
"better-auth": "^1.6.13",
|
|
108
108
|
"better-auth-cloudflare": "^0.3.0",
|
|
109
109
|
"csv-parse": "^6.2.1",
|
|
110
110
|
"drizzle-zod": "^0.8.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/services/auth-validation.ts"],"names":["z"],"mappings":";;;;;AAyBA,eAAsB,sBAAsB,EAAA,EAAkC;AAK5E,EAAA,IAAI;AACF,IAAA,MAAM,GAAA,GAAM,MAAM,EAAA,CACf,OAAA;AAAA,MACC;AAAA,MAED,KAAA,EAAM;AACT,IAAA,IAAI,KAAK,IAAA,EAAM;AACb,MAAA,MAAM,IAAA,GAAO,OAAO,GAAA,CAAI,IAAA,KAAS,QAAA,GAAW,KAAK,KAAA,CAAM,GAAA,CAAI,IAAI,CAAA,GAAI,GAAA,CAAI,IAAA;AACvE,MAAA,MAAM,OAAA,GAAU,IAAA,EAAM,QAAA,EAAU,YAAA,EAAc,OAAA;AAC9C,MAAA,OAAO,OAAA,KAAY,SAAS,OAAA,KAAY,CAAA;AAAA,IAC1C;AAAA,EACF,CAAA,CAAA,MAAQ;AAAA,EAER;AAGA,EAAA,IAAI;AACF,IAAA,MAAM,MAAA,GAAS,MAAM,EAAA,CAAG,OAAA,CAAQ,2CAA2C,CAAA,CACxE,IAAA,CAAK,WAAW,CAAA,CAChB,KAAA,EAAM;AACT,IAAA,IAAI,QAAQ,QAAA,EAAU;AAEpB,MAAA,MAAM,QAAA,GAAW,IAAA,CAAK,KAAA,CAAM,MAAA,CAAO,QAAQ,CAAA;AAC3C,MAAA,MAAM,OAAA,GAAU,UAAU,YAAA,EAAc,OAAA;AACxC,MAAA,OAAO,OAAA,KAAY,SAAS,OAAA,KAAY,CAAA;AAAA,IAC1C;AAAA,EACF,CAAA,CAAA,MAAQ;AAAA,EAER;AAEA,EAAA,OAAO,IAAA;AACT;AAQA,eAAsB,wBAAwB,EAAA,EAAkC;AAC9E,EAAA,IAAI;AACF,IAAA,MAAM,SAAS,MAAM,EAAA,CAAG,OAAA,CAAQ,yCAAyC,EAAE,KAAA,EAAM;AACjF,IAAA,OAAO,QAAQ,KAAA,KAAU,CAAA;AAAA,EAC3B,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,KAAA;AAAA,EACT;AACF;AA6CA,IAAM,sBAAA,GAAyBA,MAAE,MAAA,CAAO;AAAA,EACtC,KAAA,EAAOA,KAAA,CAAE,MAAA,EAAO,CAAE,MAAM,yBAAyB,CAAA;AAAA,EACjD,UAAUA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,GAAG,wCAAwC,CAAA;AAAA,EACpE,SAAA,EAAWA,MAAE,MAAA,EAAO,CAAE,IAAI,CAAA,EAAG,wBAAwB,EAAE,QAAA,EAAS;AAAA,EAChE,QAAA,EAAUA,MAAE,MAAA,EAAO,CAAE,IAAI,CAAA,EAAG,uBAAuB,EAAE,QAAA;AACvD,CAAC,CAAA;AAKM,IAAM,qBAAA,GAAwB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKnC,MAAM,wBAAwB,GAAA,EAA8C;AAG1E,IAAA,OAAO,sBAAA;AAAA,EACT,CAAA;AAAA;AAAA;AAAA;AAAA,EAKA,oBAAA,CAAqB,OAAe,IAAA,EAAmB;AACrD,IAAA,QAAQ,KAAA;AAAO,MACb,KAAK,WAAA;AACH,QAAA,OAAO,MAAA;AAAA,MACT,KAAK,UAAA;AACH,QAAA,OAAO,IAAA,CAAK,QAAQ,IAAA,CAAK,KAAA,CAAM,MAAM,GAAG,CAAA,CAAE,CAAC,CAAA,GAAI,SAAA;AAAA,MACjD;AACE,QAAA,OAAO,EAAA;AAAA;AACX,EACF;AACF","file":"chunk-HIKBY7MS.cjs","sourcesContent":["/**\n * Auth Validation Service\n *\n * Provides validation schemas for authentication operations\n */\n\nimport { z } from 'zod'\nimport type { D1Database } from '@cloudflare/workers-types'\n\n// In-memory cache for admin existence check (lazy initialization pattern)\nlet adminExistsCache: boolean | null = null\n\nexport interface AuthSettings {\n enablePasswordLogin?: boolean\n enableOAuthLogin?: boolean\n requireEmailVerification?: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any\n}\n\n/**\n * Check if user registration is enabled in the auth plugin settings\n * @param db - D1 database instance\n * @returns true if registration is enabled, false if disabled\n */\nexport async function isRegistrationEnabled(db: D1Database): Promise<boolean> {\n // Plugin settings live on the plugin's document (type_id='plugin', slug=pluginId) since the\n // document-model migration — the legacy `plugins` table no longer exists on greenfield. The\n // /admin/plugins/core-auth/settings write goes through PluginService.updatePluginSettings (doc model),\n // so the read must come from the same place or \"disable registration\" silently no-ops.\n try {\n const row = await db\n .prepare(\n \"SELECT data FROM documents WHERE slug = 'core-auth' AND type_id = 'plugin' AND tenant_id = 'default' AND is_current_draft = 1 AND deleted_at IS NULL\",\n )\n .first() as { data: string } | null\n if (row?.data) {\n const data = typeof row.data === 'string' ? JSON.parse(row.data) : row.data\n const enabled = data?.settings?.registration?.enabled\n return enabled !== false && enabled !== 0\n }\n } catch {\n // fall through to the legacy table for installs that still have it\n }\n\n // Legacy fallback: the dropped `plugins` table (guarded — absent on greenfield).\n try {\n const plugin = await db.prepare('SELECT settings FROM plugins WHERE id = ?')\n .bind('core-auth')\n .first() as { settings: string } | null\n if (plugin?.settings) {\n // SQLite stores booleans as 0/1, so check for both false and 0.\n const settings = JSON.parse(plugin.settings)\n const enabled = settings?.registration?.enabled\n return enabled !== false && enabled !== 0\n }\n } catch {\n // no legacy table either\n }\n\n return true // Default to enabled when no setting is found\n}\n\n/**\n * Check if this would be the first user registration (bootstrap scenario)\n * The first user should always be allowed to register even if registration is disabled\n * @param db - D1 database instance\n * @returns true if no users exist in the database\n */\nexport async function isFirstUserRegistration(db: D1Database): Promise<boolean> {\n try {\n const result = await db.prepare('SELECT COUNT(*) as count FROM auth_user').first() as { count: number } | null\n return result?.count === 0\n } catch {\n return false // Default to not first user on error\n }\n}\n\n/**\n * Check if an admin user exists in the database (with in-memory caching)\n * Uses lazy initialization - only queries DB on first call, then caches result\n * @param db - D1 database instance\n * @returns true if an admin user exists\n */\nexport async function checkAdminUserExists(db: D1Database): Promise<boolean> {\n // Return cached value if already checked\n if (adminExistsCache !== null) {\n return adminExistsCache\n }\n\n try {\n const result = await db.prepare('SELECT id FROM auth_user WHERE role = ?')\n .bind('admin')\n .first()\n adminExistsCache = !!result\n return adminExistsCache\n } catch {\n // On error (e.g., table doesn't exist yet), assume no admin exists\n return false\n }\n}\n\n/**\n * Set the admin exists cache to true\n * Call this after successfully creating the first admin user\n */\nexport function setAdminExists(): void {\n adminExistsCache = true\n}\n\n/**\n * Reset the admin exists cache (for testing purposes)\n */\nexport function resetAdminExistsCache(): void {\n adminExistsCache = null\n}\n\n/**\n * Auth Validation Service\n * Provides dynamic validation schemas for registration based on database settings\n */\nconst baseRegistrationSchema = z.object({\n email: z.string().email('Valid email is required'),\n password: z.string().min(8, 'Password must be at least 8 characters'),\n firstName: z.string().min(1, 'First name is required').optional(),\n lastName: z.string().min(1, 'Last name is required').optional()\n})\n\nexport type RegistrationSchema = typeof baseRegistrationSchema\nexport type RegistrationData = z.infer<RegistrationSchema>\n\nexport const authValidationService = {\n /**\n * Build registration schema dynamically based on auth settings\n * For now, returns a static schema with standard fields\n */\n async buildRegistrationSchema(_db: D1Database): Promise<RegistrationSchema> {\n // TODO: Load settings from database to make fields optional/required dynamically\n // For now, use a static schema with common registration fields\n return baseRegistrationSchema\n },\n\n /**\n * Generate default values for optional fields\n */\n generateDefaultValue(field: string, data: any): string {\n switch (field) {\n case 'firstName':\n return 'User'\n case 'lastName':\n return data.email ? data.email.split('@')[0] : 'Account'\n default:\n return ''\n }\n }\n}\n"]}
|