@sonicjs-cms/core 3.0.0-beta.11 → 3.0.0-beta.13
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-SXLVXD2X.js → chunk-3FBZFYSQ.js} +25 -21
- package/dist/chunk-3FBZFYSQ.js.map +1 -0
- package/dist/{chunk-KV3CM5RK.cjs → chunk-6CKXZFED.cjs} +3 -3
- package/dist/{chunk-KV3CM5RK.cjs.map → chunk-6CKXZFED.cjs.map} +1 -1
- package/dist/{chunk-PDYRDYXI.js → chunk-6KFX4LAT.js} +4 -4
- package/dist/{chunk-PDYRDYXI.js.map → chunk-6KFX4LAT.js.map} +1 -1
- package/dist/{chunk-3PU4WVU6.js → chunk-BK3NB35S.js} +4 -4
- package/dist/{chunk-3PU4WVU6.js.map → chunk-BK3NB35S.js.map} +1 -1
- package/dist/{chunk-HPAJKZAQ.js → chunk-EKMN6W5B.js} +3 -3
- package/dist/{chunk-HPAJKZAQ.js.map → chunk-EKMN6W5B.js.map} +1 -1
- package/dist/{chunk-MKKGA3C4.cjs → chunk-IM3UG4QW.cjs} +10 -10
- package/dist/{chunk-MKKGA3C4.cjs.map → chunk-IM3UG4QW.cjs.map} +1 -1
- package/dist/{chunk-6H66MSSL.js → chunk-IV3NA6WZ.js} +2 -2
- package/dist/{chunk-6H66MSSL.js.map → chunk-IV3NA6WZ.js.map} +1 -1
- package/dist/{chunk-QLFTG3QJ.js → chunk-KG6GQE6B.js} +2 -2
- package/dist/{chunk-QLFTG3QJ.js.map → chunk-KG6GQE6B.js.map} +1 -1
- package/dist/{chunk-QJNKSFDJ.cjs → chunk-KPQ57HAH.cjs} +2 -2
- package/dist/{chunk-QJNKSFDJ.cjs.map → chunk-KPQ57HAH.cjs.map} +1 -1
- package/dist/{chunk-ZUEIQFE5.js → chunk-PPFQDMZE.js} +3 -3
- package/dist/{chunk-ZUEIQFE5.js.map → chunk-PPFQDMZE.js.map} +1 -1
- package/dist/{chunk-UHRHZXVR.cjs → chunk-PZGGIJI6.cjs} +4 -4
- package/dist/{chunk-UHRHZXVR.cjs.map → chunk-PZGGIJI6.cjs.map} +1 -1
- package/dist/{chunk-YJEBDJDV.cjs → chunk-VMBQ6NQB.cjs} +13 -13
- package/dist/{chunk-YJEBDJDV.cjs.map → chunk-VMBQ6NQB.cjs.map} +1 -1
- package/dist/{chunk-K342JMA3.cjs → chunk-VT77YUTP.cjs} +216 -212
- package/dist/chunk-VT77YUTP.cjs.map +1 -0
- package/dist/{chunk-ORF4CT74.cjs → chunk-YNYEQP3K.cjs} +2 -2
- package/dist/{chunk-ORF4CT74.cjs.map → chunk-YNYEQP3K.cjs.map} +1 -1
- package/dist/index.cjs +283 -252
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +44 -13
- package/dist/index.js.map +1 -1
- package/dist/middleware.cjs +32 -32
- package/dist/middleware.js +3 -3
- package/dist/migrations-KKLQ2CEF.js +4 -0
- package/dist/{migrations-XQLBY7E5.js.map → migrations-KKLQ2CEF.js.map} +1 -1
- package/dist/migrations-XOXYLHHU.cjs +13 -0
- package/dist/{migrations-ZXJEUTFA.cjs.map → migrations-XOXYLHHU.cjs.map} +1 -1
- package/dist/plugins.cjs +40 -40
- package/dist/plugins.js +3 -3
- package/dist/routes.cjs +26 -26
- package/dist/routes.js +6 -6
- package/dist/services.cjs +18 -18
- package/dist/services.js +2 -2
- package/dist/utils.cjs +3 -3
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-K342JMA3.cjs.map +0 -1
- package/dist/chunk-SXLVXD2X.js.map +0 -1
- package/dist/migrations-XQLBY7E5.js +0 -4
- package/dist/migrations-ZXJEUTFA.cjs +0 -13
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { isFirstUserRegistration, isRegistrationEnabled, authValidationService } from './chunk-IESEVHXL.js';
|
|
2
2
|
import { renderDocumentFormPage, renderAlert } from './chunk-RMRJGMDE.js';
|
|
3
3
|
import { getCacheService, CACHE_CONFIGS, SettingsService, getLogger, getAppInstance, buildRouteList, CATEGORY_INFO } from './chunk-RQ6N3FTV.js';
|
|
4
|
-
import { DocumentTypeRegistry, requireAuth, requireRole, optionalAuth, isPluginActive, rateLimit, AuthManager, getJwtExpirySecondsFromDb, getJwtRefreshGraceSecondsFromDb, logActivity, generateCsrfToken } from './chunk-
|
|
4
|
+
import { DocumentTypeRegistry, requireAuth, requireRole, optionalAuth, isPluginActive, rateLimit, AuthManager, getJwtExpirySecondsFromDb, getJwtRefreshGraceSecondsFromDb, logActivity, generateCsrfToken } from './chunk-BK3NB35S.js';
|
|
5
5
|
import { DocumentsService, documentSecondsToMs, RbacService } from './chunk-BLMTL57B.js';
|
|
6
6
|
import { nanoid } from './chunk-GCDZZNIN.js';
|
|
7
|
-
import { getCollectionRegistry, collectionRecordToRow, loadCollectionConfigs, getVisibleCollections, PluginService, PLUGIN_REGISTRY, findPluginByCodeName, isCodeCollectionInternal, isDbDocTypeInternal, invalidateTenantCache } from './chunk-
|
|
8
|
-
import { MigrationService } from './chunk-
|
|
7
|
+
import { getCollectionRegistry, collectionRecordToRow, loadCollectionConfigs, getVisibleCollections, PluginService, PLUGIN_REGISTRY, findPluginByCodeName, isCodeCollectionInternal, isDbDocTypeInternal, invalidateTenantCache } from './chunk-KG6GQE6B.js';
|
|
8
|
+
import { MigrationService } from './chunk-IV3NA6WZ.js';
|
|
9
9
|
import { renderCheckboxPage, renderAlert as renderAlert$1, renderTable, renderPagination, renderConfirmationDialog, getConfirmationDialogScript, renderAdminLayout, adminLayoutV2, renderForm } from './chunk-OBA2RYZN.js';
|
|
10
10
|
import { init_admin_layout_catalyst_template, renderAdminLayoutCatalyst } from './chunk-5V62WT6M.js';
|
|
11
|
-
import { createServiceSingleton, definePlugin, getPluginDefinition, applySchemaDefaults, renderSchemaFields, parseFormDataToSettings } from './chunk-
|
|
11
|
+
import { createServiceSingleton, definePlugin, getPluginDefinition, applySchemaDefaults, renderSchemaFields, parseFormDataToSettings } from './chunk-EKMN6W5B.js';
|
|
12
12
|
import { hasHookSystem, getTypedHooks } from './chunk-RNZFGN4R.js';
|
|
13
13
|
import { QueryFilterBuilder, getBlocksFieldConfig, parseBlocksValue } from './chunk-QZGABF2M.js';
|
|
14
14
|
import { metricsTracker } from './chunk-FICTAGD4.js';
|
|
15
|
-
import { getCoreVersion } from './chunk-
|
|
15
|
+
import { getCoreVersion } from './chunk-PPFQDMZE.js';
|
|
16
16
|
import { escapeHtml, sanitizeRichText, sanitizeInput } from './chunk-TQABQWOP.js';
|
|
17
17
|
import { Hono } from 'hono';
|
|
18
18
|
import { z } from 'zod';
|
|
19
|
-
import { cors } from 'hono/cors';
|
|
20
19
|
import { setCookie, getCookie } from 'hono/cookie';
|
|
21
20
|
import { html, raw } from 'hono/html';
|
|
22
21
|
|
|
@@ -1260,16 +1259,6 @@ apiRoutes.use("*", async (c, next) => {
|
|
|
1260
1259
|
c.set("cacheEnabled", cacheEnabled);
|
|
1261
1260
|
await next();
|
|
1262
1261
|
});
|
|
1263
|
-
apiRoutes.use("*", cors({
|
|
1264
|
-
origin: (origin, c) => {
|
|
1265
|
-
const allowed = c.env?.CORS_ORIGINS;
|
|
1266
|
-
if (!allowed) return null;
|
|
1267
|
-
const list = allowed.split(",").map((s) => s.trim());
|
|
1268
|
-
return list.includes(origin) ? origin : null;
|
|
1269
|
-
},
|
|
1270
|
-
allowMethods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
|
1271
|
-
allowHeaders: ["Content-Type", "Authorization", "X-API-Key"]
|
|
1272
|
-
}));
|
|
1273
1262
|
function addTimingMeta(c, meta = {}, executionStartTime) {
|
|
1274
1263
|
const totalTime = Date.now() - c.get("startTime");
|
|
1275
1264
|
const executionTime = executionStartTime ? Date.now() - executionStartTime : void 0;
|
|
@@ -3400,7 +3389,7 @@ adminApiRoutes.patch("/collections/:id", collectionsReadOnly);
|
|
|
3400
3389
|
adminApiRoutes.delete("/collections/:id", collectionsReadOnly);
|
|
3401
3390
|
adminApiRoutes.get("/migrations/status", async (c) => {
|
|
3402
3391
|
try {
|
|
3403
|
-
const { MigrationService: MigrationService2 } = await import('./migrations-
|
|
3392
|
+
const { MigrationService: MigrationService2 } = await import('./migrations-KKLQ2CEF.js');
|
|
3404
3393
|
const db = c.env.DB;
|
|
3405
3394
|
const migrationService = new MigrationService2(db);
|
|
3406
3395
|
const status = await migrationService.getMigrationStatus();
|
|
@@ -3443,7 +3432,7 @@ adminApiRoutes.post("/migrations/run", async (c) => {
|
|
|
3443
3432
|
});
|
|
3444
3433
|
adminApiRoutes.get("/migrations/validate", async (c) => {
|
|
3445
3434
|
try {
|
|
3446
|
-
const { MigrationService: MigrationService2 } = await import('./migrations-
|
|
3435
|
+
const { MigrationService: MigrationService2 } = await import('./migrations-KKLQ2CEF.js');
|
|
3447
3436
|
const db = c.env.DB;
|
|
3448
3437
|
const migrationService = new MigrationService2(db);
|
|
3449
3438
|
const validation = await migrationService.validateSchema();
|
|
@@ -7115,6 +7104,20 @@ authRoutes.post(
|
|
|
7115
7104
|
await setCsrfCookie(c);
|
|
7116
7105
|
const baBody = await baRes.json();
|
|
7117
7106
|
const user = baBody.user ?? {};
|
|
7107
|
+
const tokenTtl = await getJwtExpirySecondsFromDb(c.env.DB, c.env);
|
|
7108
|
+
const token = await AuthManager.generateToken(
|
|
7109
|
+
user.id,
|
|
7110
|
+
user.email,
|
|
7111
|
+
user.role ?? "viewer",
|
|
7112
|
+
c.env.JWT_SECRET,
|
|
7113
|
+
tokenTtl
|
|
7114
|
+
);
|
|
7115
|
+
setCookie(c, "auth_token", token, {
|
|
7116
|
+
httpOnly: true,
|
|
7117
|
+
secure: true,
|
|
7118
|
+
sameSite: "Strict",
|
|
7119
|
+
maxAge: tokenTtl
|
|
7120
|
+
});
|
|
7118
7121
|
return c.json({
|
|
7119
7122
|
user: {
|
|
7120
7123
|
id: user.id,
|
|
@@ -7122,7 +7125,8 @@ authRoutes.post(
|
|
|
7122
7125
|
firstName: user.name?.split(" ")[0] ?? "",
|
|
7123
7126
|
lastName: user.name?.split(" ").slice(1).join(" ") ?? "",
|
|
7124
7127
|
role: user.role ?? "viewer"
|
|
7125
|
-
}
|
|
7128
|
+
},
|
|
7129
|
+
token
|
|
7126
7130
|
});
|
|
7127
7131
|
} catch (error) {
|
|
7128
7132
|
console.error("Login error:", error);
|
|
@@ -26639,5 +26643,5 @@ var ROUTES_INFO = {
|
|
|
26639
26643
|
};
|
|
26640
26644
|
|
|
26641
26645
|
export { DocumentRepository, ROUTES_INFO, TenantService, VALID_MEMBER_ROLES, adminCheckboxRoutes, adminCollectionsRoutes, adminDocumentsRoutes, adminLogsRoutes, adminMediaRoutes, adminPluginRoutes, adminSettingsRoutes, admin_api_default, admin_content_default, apiDocumentsRoutes, api_content_crud_default, api_default, api_media_default, api_system_default, auth_default, createUserProfilesPlugin, defineUserProfile, denyIfNotAllowed, dispatchHookEvent, getConfirmationDialogScript2 as getConfirmationDialogScript, getCustomData, getEmailService, getUserProfileConfig, getVariablesCached, hasEmailService, invalidateVariablesCache, isValidMemberRole, lexicalEditorPlugin, renderConfirmationDialog2 as renderConfirmationDialog, renderTable2 as renderTable, resolveDocScope, resolveVariablesInObject, router, router2, setEmailService, setVariablesCache, test_cleanup_default, userProfilesPlugin, userRoutes };
|
|
26642
|
-
//# sourceMappingURL=chunk-
|
|
26643
|
-
//# sourceMappingURL=chunk-
|
|
26646
|
+
//# sourceMappingURL=chunk-3FBZFYSQ.js.map
|
|
26647
|
+
//# sourceMappingURL=chunk-3FBZFYSQ.js.map
|