@sonicjs-cms/core 3.0.0-beta.15 → 3.0.0-beta.16
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-PK3ODTAL.cjs → chunk-3XFA3E2F.cjs} +3 -3
- package/dist/{chunk-PK3ODTAL.cjs.map → chunk-3XFA3E2F.cjs.map} +1 -1
- package/dist/{chunk-JRLADH5B.js → chunk-7P2IJM4K.js} +3 -3
- package/dist/{chunk-JRLADH5B.js.map → chunk-7P2IJM4K.js.map} +1 -1
- package/dist/{chunk-VOAP3KFU.js → chunk-HYO2MSFI.js} +2 -2
- package/dist/{chunk-VOAP3KFU.js.map → chunk-HYO2MSFI.js.map} +1 -1
- package/dist/{chunk-4AB3PQHF.cjs → chunk-IA24HACT.cjs} +2 -2
- package/dist/{chunk-4AB3PQHF.cjs.map → chunk-IA24HACT.cjs.map} +1 -1
- package/dist/{chunk-75WXXLAU.js → chunk-IXUNNFZZ.js} +6 -5
- package/dist/chunk-IXUNNFZZ.js.map +1 -0
- package/dist/{chunk-CE6POA7A.js → chunk-JRMBHDGM.js} +3 -3
- package/dist/{chunk-CE6POA7A.js.map → chunk-JRMBHDGM.js.map} +1 -1
- package/dist/{chunk-4ENXIP4M.js → chunk-KIB7K5LV.js} +2 -2
- package/dist/{chunk-4ENXIP4M.js.map → chunk-KIB7K5LV.js.map} +1 -1
- package/dist/{chunk-ZBDDZYA3.cjs → chunk-KMM45BTY.cjs} +15 -15
- package/dist/{chunk-ZBDDZYA3.cjs.map → chunk-KMM45BTY.cjs.map} +1 -1
- package/dist/{chunk-PTTFLUEX.cjs → chunk-KOXFYFOF.cjs} +4 -4
- package/dist/{chunk-PTTFLUEX.cjs.map → chunk-KOXFYFOF.cjs.map} +1 -1
- package/dist/{chunk-FXZSZ7C7.cjs → chunk-KZIBF2EV.cjs} +2 -2
- package/dist/{chunk-FXZSZ7C7.cjs.map → chunk-KZIBF2EV.cjs.map} +1 -1
- package/dist/{chunk-FVI3H6RG.cjs → chunk-LXYDJU6U.cjs} +12 -11
- package/dist/chunk-LXYDJU6U.cjs.map +1 -0
- package/dist/{chunk-GQXVDFIG.js → chunk-PA2UIFB7.js} +5 -5
- package/dist/{chunk-GQXVDFIG.js.map → chunk-PA2UIFB7.js.map} +1 -1
- package/dist/{chunk-BDQOPRA3.cjs → chunk-SC2WZFNQ.cjs} +291 -226
- package/dist/chunk-SC2WZFNQ.cjs.map +1 -0
- package/dist/{chunk-L3VIH6U4.js → chunk-UOFRE5PY.js} +98 -33
- package/dist/chunk-UOFRE5PY.js.map +1 -0
- package/dist/index.cjs +277 -257
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +178 -2
- package/dist/index.d.ts +178 -2
- package/dist/index.js +28 -16
- package/dist/index.js.map +1 -1
- package/dist/middleware.cjs +33 -33
- package/dist/middleware.js +4 -4
- package/dist/migrations-F4LBAHQN.js +4 -0
- package/dist/{migrations-6R2N6G2P.js.map → migrations-F4LBAHQN.js.map} +1 -1
- package/dist/migrations-KMCULV6H.cjs +13 -0
- package/dist/{migrations-X3UX24QG.cjs.map → migrations-KMCULV6H.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-75WXXLAU.js.map +0 -1
- package/dist/chunk-BDQOPRA3.cjs.map +0 -1
- package/dist/chunk-FVI3H6RG.cjs.map +0 -1
- package/dist/chunk-L3VIH6U4.js.map +0 -1
- package/dist/migrations-6R2N6G2P.js +0 -4
- package/dist/migrations-X3UX24QG.cjs +0 -13
package/dist/index.cjs
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkKMCLNO4K_cjs = require('./chunk-KMCLNO4K.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkSC2WZFNQ_cjs = require('./chunk-SC2WZFNQ.cjs');
|
|
5
5
|
require('./chunk-XWVDSM2L.cjs');
|
|
6
6
|
require('./chunk-N32OWET6.cjs');
|
|
7
7
|
var chunk4BTBSXMR_cjs = require('./chunk-4BTBSXMR.cjs');
|
|
8
8
|
var chunkYA3TJ65D_cjs = require('./chunk-YA3TJ65D.cjs');
|
|
9
9
|
var chunkYP7GW2G5_cjs = require('./chunk-YP7GW2G5.cjs');
|
|
10
|
-
var
|
|
10
|
+
var chunkKMM45BTY_cjs = require('./chunk-KMM45BTY.cjs');
|
|
11
11
|
var chunkW36OZTJ5_cjs = require('./chunk-W36OZTJ5.cjs');
|
|
12
12
|
var chunkJEQ7FLOD_cjs = require('./chunk-JEQ7FLOD.cjs');
|
|
13
|
-
var
|
|
14
|
-
var
|
|
13
|
+
var chunkKZIBF2EV_cjs = require('./chunk-KZIBF2EV.cjs');
|
|
14
|
+
var chunkIA24HACT_cjs = require('./chunk-IA24HACT.cjs');
|
|
15
15
|
var chunkCRGUD4KC_cjs = require('./chunk-CRGUD4KC.cjs');
|
|
16
16
|
var chunkPXNTCCPE_cjs = require('./chunk-PXNTCCPE.cjs');
|
|
17
17
|
var chunkK623Q6WD_cjs = require('./chunk-K623Q6WD.cjs');
|
|
18
|
-
var
|
|
19
|
-
var
|
|
18
|
+
var chunkLXYDJU6U_cjs = require('./chunk-LXYDJU6U.cjs');
|
|
19
|
+
var chunkKOXFYFOF_cjs = require('./chunk-KOXFYFOF.cjs');
|
|
20
20
|
var chunkJ6JTWD2A_cjs = require('./chunk-J6JTWD2A.cjs');
|
|
21
21
|
var chunkIXUHXTHW_cjs = require('./chunk-IXUHXTHW.cjs');
|
|
22
22
|
var chunkRCQ2HIQD_cjs = require('./chunk-RCQ2HIQD.cjs');
|
|
23
23
|
require('./chunk-P3XDZL6Q.cjs');
|
|
24
|
-
var
|
|
24
|
+
var chunk3XFA3E2F_cjs = require('./chunk-3XFA3E2F.cjs');
|
|
25
25
|
var chunkMNWKYY5E_cjs = require('./chunk-MNWKYY5E.cjs');
|
|
26
26
|
var chunkQTFKZBLC_cjs = require('./chunk-QTFKZBLC.cjs');
|
|
27
27
|
require('./chunk-IGJUBJBW.cjs');
|
|
@@ -574,7 +574,7 @@ function formatCellValue(value) {
|
|
|
574
574
|
// src/plugins/core-plugins/database-tools-plugin/admin-routes.ts
|
|
575
575
|
function createDatabaseToolsAdminRoutes() {
|
|
576
576
|
const router3 = new hono.Hono();
|
|
577
|
-
router3.use("*",
|
|
577
|
+
router3.use("*", chunkKMM45BTY_cjs.requireAuth());
|
|
578
578
|
router3.get("/api/stats", async (c) => {
|
|
579
579
|
try {
|
|
580
580
|
const user = c.get("user");
|
|
@@ -977,7 +977,7 @@ var SiteConfigService = class {
|
|
|
977
977
|
|
|
978
978
|
// src/plugins/core-plugins/email-plugin/routes/admin.ts
|
|
979
979
|
var adminRoutes = new hono.Hono();
|
|
980
|
-
adminRoutes.use("*",
|
|
980
|
+
adminRoutes.use("*", chunkKMM45BTY_cjs.requireAuth());
|
|
981
981
|
adminRoutes.post("/settings", async (c) => {
|
|
982
982
|
if (c.get("user")?.role !== "admin") {
|
|
983
983
|
return c.json({ error: "admin role required" }, 403);
|
|
@@ -1015,7 +1015,7 @@ adminRoutes.post("/test", async (c) => {
|
|
|
1015
1015
|
const { subject, html: html4, text } = renderTestEmail({ siteName });
|
|
1016
1016
|
try {
|
|
1017
1017
|
const settingsLoaded = await settings.load();
|
|
1018
|
-
const result = await
|
|
1018
|
+
const result = await chunkSC2WZFNQ_cjs.getEmailService().send({
|
|
1019
1019
|
to,
|
|
1020
1020
|
subject,
|
|
1021
1021
|
html: html4,
|
|
@@ -1097,7 +1097,7 @@ function makeOnRegistrationCompleted(env) {
|
|
|
1097
1097
|
siteName,
|
|
1098
1098
|
loginUrl: siteConfig.buildLoginUrl(siteUrl)
|
|
1099
1099
|
});
|
|
1100
|
-
const result = await
|
|
1100
|
+
const result = await chunkSC2WZFNQ_cjs.getEmailService().send({
|
|
1101
1101
|
to: user.email,
|
|
1102
1102
|
subject,
|
|
1103
1103
|
html: html4,
|
|
@@ -1171,7 +1171,7 @@ function makeOnPasswordResetRequested(env) {
|
|
|
1171
1171
|
expiresAt: Date.now() + DEFAULT_EXPIRY_MS,
|
|
1172
1172
|
siteName
|
|
1173
1173
|
});
|
|
1174
|
-
const result = await
|
|
1174
|
+
const result = await chunkSC2WZFNQ_cjs.getEmailService().send({
|
|
1175
1175
|
to: user.email,
|
|
1176
1176
|
subject,
|
|
1177
1177
|
html: html4,
|
|
@@ -1239,7 +1239,7 @@ function makeOnPasswordResetCompleted(env) {
|
|
|
1239
1239
|
supportEmail,
|
|
1240
1240
|
when: Date.now()
|
|
1241
1241
|
});
|
|
1242
|
-
const result = await
|
|
1242
|
+
const result = await chunkSC2WZFNQ_cjs.getEmailService().send({
|
|
1243
1243
|
to: user.email,
|
|
1244
1244
|
subject,
|
|
1245
1245
|
html: html4,
|
|
@@ -1971,7 +1971,7 @@ var CloudflareEmailProvider = class {
|
|
|
1971
1971
|
}
|
|
1972
1972
|
}
|
|
1973
1973
|
};
|
|
1974
|
-
var emailPluginV3 =
|
|
1974
|
+
var emailPluginV3 = chunkKOXFYFOF_cjs.definePlugin({
|
|
1975
1975
|
id: "email",
|
|
1976
1976
|
version: "1.0.0",
|
|
1977
1977
|
name: "Email",
|
|
@@ -1985,7 +1985,7 @@ var emailPluginV3 = chunkPTTFLUEX_cjs.definePlugin({
|
|
|
1985
1985
|
const db = env.DB;
|
|
1986
1986
|
if (db) {
|
|
1987
1987
|
try {
|
|
1988
|
-
const typeRegistry = new
|
|
1988
|
+
const typeRegistry = new chunkKMM45BTY_cjs.DocumentTypeRegistry(db);
|
|
1989
1989
|
await typeRegistry.register({
|
|
1990
1990
|
id: "email_log",
|
|
1991
1991
|
name: "email_log",
|
|
@@ -2000,7 +2000,7 @@ var emailPluginV3 = chunkPTTFLUEX_cjs.definePlugin({
|
|
|
2000
2000
|
} catch {
|
|
2001
2001
|
}
|
|
2002
2002
|
}
|
|
2003
|
-
if (!
|
|
2003
|
+
if (!chunkSC2WZFNQ_cjs.hasEmailService()) {
|
|
2004
2004
|
const settings = db ? await new EmailSettingsService(db).load() : {};
|
|
2005
2005
|
const envResendKey = typeof env.RESEND_API_KEY === "string" && env.RESEND_API_KEY ? env.RESEND_API_KEY : void 0;
|
|
2006
2006
|
const cfEmailBinding = env.EMAIL;
|
|
@@ -2018,7 +2018,7 @@ var emailPluginV3 = chunkPTTFLUEX_cjs.definePlugin({
|
|
|
2018
2018
|
} else {
|
|
2019
2019
|
provider = resolveEmailProvider({ env });
|
|
2020
2020
|
}
|
|
2021
|
-
|
|
2021
|
+
chunkSC2WZFNQ_cjs.setEmailService(new EmailService({ ...serviceOpts, provider }));
|
|
2022
2022
|
}
|
|
2023
2023
|
ctx.hooks.on("auth:registration:completed", makeOnRegistrationCompleted(env));
|
|
2024
2024
|
ctx.hooks.on("auth:password-reset:requested", makeOnPasswordResetRequested(env));
|
|
@@ -2029,7 +2029,7 @@ var emailPluginV3 = chunkPTTFLUEX_cjs.definePlugin({
|
|
|
2029
2029
|
var BATCH_SIZE = 100;
|
|
2030
2030
|
({
|
|
2031
2031
|
schema: zod.z.record(zod.z.string(), zod.z.unknown())});
|
|
2032
|
-
var emailReconciliationPlugin =
|
|
2032
|
+
var emailReconciliationPlugin = chunkKOXFYFOF_cjs.definePlugin({
|
|
2033
2033
|
id: "email-reconciliation",
|
|
2034
2034
|
version: "1.0.0",
|
|
2035
2035
|
description: "Hourly cron that backfills email delivery state from provider status APIs. Only active for providers that implement EmailProvider.reconcile().",
|
|
@@ -2050,11 +2050,11 @@ var emailReconciliationPlugin = chunkPTTFLUEX_cjs.definePlugin({
|
|
|
2050
2050
|
console.warn("[email-reconciliation] No DB binding in cron env \u2014 skipping.");
|
|
2051
2051
|
return;
|
|
2052
2052
|
}
|
|
2053
|
-
if (!
|
|
2053
|
+
if (!chunkSC2WZFNQ_cjs.hasEmailService()) {
|
|
2054
2054
|
console.warn("[email-reconciliation] EmailService not initialized \u2014 skipping.");
|
|
2055
2055
|
return;
|
|
2056
2056
|
}
|
|
2057
|
-
const emailService =
|
|
2057
|
+
const emailService = chunkSC2WZFNQ_cjs.getEmailService();
|
|
2058
2058
|
let rows = [];
|
|
2059
2059
|
try {
|
|
2060
2060
|
const result = await db.prepare(
|
|
@@ -2540,8 +2540,8 @@ function buildOtpApi() {
|
|
|
2540
2540
|
loginUrl: settings.loginUrl || "",
|
|
2541
2541
|
loginButtonText: settings.loginButtonText || ""
|
|
2542
2542
|
});
|
|
2543
|
-
if (
|
|
2544
|
-
const sent = await
|
|
2543
|
+
if (chunkSC2WZFNQ_cjs.hasEmailService()) {
|
|
2544
|
+
const sent = await chunkSC2WZFNQ_cjs.getEmailService().send({
|
|
2545
2545
|
to: normalizedEmail,
|
|
2546
2546
|
subject: `Your login code for ${siteName}`,
|
|
2547
2547
|
flow: "otp",
|
|
@@ -2643,21 +2643,21 @@ function buildOtpApi() {
|
|
|
2643
2643
|
error: "Account is deactivated"
|
|
2644
2644
|
}, 403);
|
|
2645
2645
|
}
|
|
2646
|
-
const tokenTtl = await
|
|
2647
|
-
const token = await
|
|
2646
|
+
const tokenTtl = await chunkKMM45BTY_cjs.getJwtExpirySecondsFromDb(db, c.env);
|
|
2647
|
+
const token = await chunkKMM45BTY_cjs.AuthManager.generateToken(user.id, user.email, user.role, c.env.JWT_SECRET, tokenTtl);
|
|
2648
2648
|
cookie.setCookie(c, "auth_token", token, {
|
|
2649
2649
|
httpOnly: true,
|
|
2650
2650
|
secure: true,
|
|
2651
2651
|
sameSite: "Strict",
|
|
2652
2652
|
maxAge: tokenTtl
|
|
2653
2653
|
});
|
|
2654
|
-
|
|
2654
|
+
chunkSC2WZFNQ_cjs.dispatchHookEvent(
|
|
2655
2655
|
c,
|
|
2656
2656
|
"auth:otp:verified",
|
|
2657
2657
|
{ user: { id: user.id, email: user.email, role: user.role } },
|
|
2658
2658
|
"fire-and-forget"
|
|
2659
2659
|
);
|
|
2660
|
-
const customData = await
|
|
2660
|
+
const customData = await chunkSC2WZFNQ_cjs.getCustomData(db, user.id);
|
|
2661
2661
|
const { is_active: _isActive, ...publicUser } = user;
|
|
2662
2662
|
return c.json({
|
|
2663
2663
|
success: true,
|
|
@@ -2702,7 +2702,7 @@ function buildOtpApi() {
|
|
|
2702
2702
|
});
|
|
2703
2703
|
return otpAPI;
|
|
2704
2704
|
}
|
|
2705
|
-
var otpLoginPlugin =
|
|
2705
|
+
var otpLoginPlugin = chunkKOXFYFOF_cjs.definePlugin({
|
|
2706
2706
|
id: "otp-login",
|
|
2707
2707
|
version: "1.0.0",
|
|
2708
2708
|
name: "OTP Login",
|
|
@@ -3099,15 +3099,15 @@ function buildOauthApi() {
|
|
|
3099
3099
|
if (!user || !user.is_active) {
|
|
3100
3100
|
return c.redirect("/auth/login?error=Account is deactivated");
|
|
3101
3101
|
}
|
|
3102
|
-
const tokenTtl2 = await
|
|
3103
|
-
const jwt2 = await
|
|
3102
|
+
const tokenTtl2 = await chunkKMM45BTY_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
|
|
3103
|
+
const jwt2 = await chunkKMM45BTY_cjs.AuthManager.generateToken(
|
|
3104
3104
|
user.id,
|
|
3105
3105
|
user.email,
|
|
3106
3106
|
user.role,
|
|
3107
3107
|
c.env.JWT_SECRET,
|
|
3108
3108
|
tokenTtl2
|
|
3109
3109
|
);
|
|
3110
|
-
|
|
3110
|
+
chunkKMM45BTY_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
|
|
3111
3111
|
return c.redirect("/admin");
|
|
3112
3112
|
}
|
|
3113
3113
|
const existingUser = await oauthService.findUserByEmail(profile.email);
|
|
@@ -3124,15 +3124,15 @@ function buildOauthApi() {
|
|
|
3124
3124
|
tokenExpiresAt: tokenExpiresAt ?? void 0,
|
|
3125
3125
|
profileData: JSON.stringify(profile)
|
|
3126
3126
|
});
|
|
3127
|
-
const tokenTtl2 = await
|
|
3128
|
-
const jwt2 = await
|
|
3127
|
+
const tokenTtl2 = await chunkKMM45BTY_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
|
|
3128
|
+
const jwt2 = await chunkKMM45BTY_cjs.AuthManager.generateToken(
|
|
3129
3129
|
existingUser.id,
|
|
3130
3130
|
existingUser.email,
|
|
3131
3131
|
existingUser.role,
|
|
3132
3132
|
c.env.JWT_SECRET,
|
|
3133
3133
|
tokenTtl2
|
|
3134
3134
|
);
|
|
3135
|
-
|
|
3135
|
+
chunkKMM45BTY_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
|
|
3136
3136
|
return c.redirect("/admin");
|
|
3137
3137
|
}
|
|
3138
3138
|
const newUserId = await oauthService.createUserFromOAuth(profile);
|
|
@@ -3145,15 +3145,15 @@ function buildOauthApi() {
|
|
|
3145
3145
|
tokenExpiresAt: tokenExpiresAt ?? void 0,
|
|
3146
3146
|
profileData: JSON.stringify(profile)
|
|
3147
3147
|
});
|
|
3148
|
-
const tokenTtl = await
|
|
3149
|
-
const jwt = await
|
|
3148
|
+
const tokenTtl = await chunkKMM45BTY_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
|
|
3149
|
+
const jwt = await chunkKMM45BTY_cjs.AuthManager.generateToken(
|
|
3150
3150
|
newUserId,
|
|
3151
3151
|
profile.email.toLowerCase(),
|
|
3152
3152
|
"viewer",
|
|
3153
3153
|
c.env.JWT_SECRET,
|
|
3154
3154
|
tokenTtl
|
|
3155
3155
|
);
|
|
3156
|
-
|
|
3156
|
+
chunkKMM45BTY_cjs.AuthManager.setAuthCookie(c, jwt, { sameSite: "Lax", maxAge: tokenTtl });
|
|
3157
3157
|
return c.redirect("/admin");
|
|
3158
3158
|
} catch (error) {
|
|
3159
3159
|
console.error("OAuth callback error:", error);
|
|
@@ -3248,7 +3248,7 @@ function buildOauthApi() {
|
|
|
3248
3248
|
});
|
|
3249
3249
|
return oauthAPI;
|
|
3250
3250
|
}
|
|
3251
|
-
var oauthProvidersPlugin =
|
|
3251
|
+
var oauthProvidersPlugin = chunkKOXFYFOF_cjs.definePlugin({
|
|
3252
3252
|
id: "oauth-providers",
|
|
3253
3253
|
version: "1.0.0",
|
|
3254
3254
|
name: "OAuth Providers",
|
|
@@ -3825,7 +3825,7 @@ var AISearchService = class {
|
|
|
3825
3825
|
*/
|
|
3826
3826
|
async detectNewCollections() {
|
|
3827
3827
|
try {
|
|
3828
|
-
const allCollections =
|
|
3828
|
+
const allCollections = chunkKZIBF2EV_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => ({
|
|
3829
3829
|
id: r.id,
|
|
3830
3830
|
name: r.name,
|
|
3831
3831
|
display_name: r.displayName,
|
|
@@ -3877,7 +3877,7 @@ var AISearchService = class {
|
|
|
3877
3877
|
*/
|
|
3878
3878
|
async getAllCollections() {
|
|
3879
3879
|
try {
|
|
3880
|
-
const allCollections =
|
|
3880
|
+
const allCollections = chunkKZIBF2EV_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).sort((a, b) => a.displayName.localeCompare(b.displayName)).map((r) => ({
|
|
3881
3881
|
id: r.id,
|
|
3882
3882
|
name: r.name,
|
|
3883
3883
|
display_name: r.displayName,
|
|
@@ -4213,7 +4213,7 @@ var IndexManager = class {
|
|
|
4213
4213
|
*/
|
|
4214
4214
|
async indexCollection(collectionId) {
|
|
4215
4215
|
try {
|
|
4216
|
-
const registry =
|
|
4216
|
+
const registry = chunkKZIBF2EV_cjs.getCollectionRegistry();
|
|
4217
4217
|
const record = registry.getById(collectionId) ?? registry.getByName(collectionId);
|
|
4218
4218
|
if (!record) {
|
|
4219
4219
|
throw new Error(`Collection ${collectionId} not found`);
|
|
@@ -4840,7 +4840,7 @@ function renderSettingsPage(data) {
|
|
|
4840
4840
|
|
|
4841
4841
|
// src/plugins/core-plugins/ai-search-plugin/routes/admin.ts
|
|
4842
4842
|
var adminRoutes2 = new hono.Hono();
|
|
4843
|
-
adminRoutes2.use("*",
|
|
4843
|
+
adminRoutes2.use("*", chunkKMM45BTY_cjs.requireAuth());
|
|
4844
4844
|
adminRoutes2.get("/", async (c) => {
|
|
4845
4845
|
try {
|
|
4846
4846
|
const user = c.get("user");
|
|
@@ -5081,7 +5081,7 @@ var manifest_default = {
|
|
|
5081
5081
|
author: "SonicJS"};
|
|
5082
5082
|
|
|
5083
5083
|
// src/plugins/core-plugins/ai-search-plugin/index.ts
|
|
5084
|
-
var aiSearchPlugin =
|
|
5084
|
+
var aiSearchPlugin = chunkKOXFYFOF_cjs.definePlugin({
|
|
5085
5085
|
id: manifest_default.id,
|
|
5086
5086
|
version: manifest_default.version,
|
|
5087
5087
|
name: manifest_default.name,
|
|
@@ -5952,7 +5952,7 @@ function renderSecuritySettingsPage(data) {
|
|
|
5952
5952
|
|
|
5953
5953
|
// src/plugins/core-plugins/security-audit-plugin/routes/admin.ts
|
|
5954
5954
|
var adminRoutes3 = new hono.Hono();
|
|
5955
|
-
adminRoutes3.use("*",
|
|
5955
|
+
adminRoutes3.use("*", chunkKMM45BTY_cjs.requireAuth());
|
|
5956
5956
|
adminRoutes3.use("*", async (c, next) => {
|
|
5957
5957
|
const user = c.get("user");
|
|
5958
5958
|
if (user?.role !== "admin") {
|
|
@@ -5962,7 +5962,7 @@ adminRoutes3.use("*", async (c, next) => {
|
|
|
5962
5962
|
});
|
|
5963
5963
|
async function getSettings(db) {
|
|
5964
5964
|
try {
|
|
5965
|
-
const pluginService = new
|
|
5965
|
+
const pluginService = new chunkKZIBF2EV_cjs.PluginService(db);
|
|
5966
5966
|
const plugin2 = await pluginService.getPlugin("security-audit");
|
|
5967
5967
|
if (plugin2?.settings) {
|
|
5968
5968
|
const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
@@ -6067,7 +6067,7 @@ adminRoutes3.post("/settings", async (c) => {
|
|
|
6067
6067
|
autoPurge: body["retention.autoPurge"] === "true"
|
|
6068
6068
|
}
|
|
6069
6069
|
};
|
|
6070
|
-
const pluginService = new
|
|
6070
|
+
const pluginService = new chunkKZIBF2EV_cjs.PluginService(db);
|
|
6071
6071
|
await pluginService.updatePluginSettings("security-audit", settings);
|
|
6072
6072
|
if (c.req.header("HX-Request")) {
|
|
6073
6073
|
return c.json({ success: true });
|
|
@@ -6228,7 +6228,7 @@ var BruteForceDetector = class {
|
|
|
6228
6228
|
|
|
6229
6229
|
// src/plugins/core-plugins/security-audit-plugin/routes/api.ts
|
|
6230
6230
|
var apiRoutes2 = new hono.Hono();
|
|
6231
|
-
apiRoutes2.use("*",
|
|
6231
|
+
apiRoutes2.use("*", chunkKMM45BTY_cjs.requireAuth());
|
|
6232
6232
|
apiRoutes2.use("*", async (c, next) => {
|
|
6233
6233
|
const user = c.get("user");
|
|
6234
6234
|
if (user?.role !== "admin") {
|
|
@@ -6238,7 +6238,7 @@ apiRoutes2.use("*", async (c, next) => {
|
|
|
6238
6238
|
});
|
|
6239
6239
|
async function getSettings2(db) {
|
|
6240
6240
|
try {
|
|
6241
|
-
const pluginService = new
|
|
6241
|
+
const pluginService = new chunkKZIBF2EV_cjs.PluginService(db);
|
|
6242
6242
|
const plugin2 = await pluginService.getPlugin("security-audit");
|
|
6243
6243
|
if (plugin2?.settings) {
|
|
6244
6244
|
const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
@@ -6386,7 +6386,7 @@ function generateFingerprint(ip, userAgent) {
|
|
|
6386
6386
|
}
|
|
6387
6387
|
async function getPluginSettings(db) {
|
|
6388
6388
|
try {
|
|
6389
|
-
const pluginService = new
|
|
6389
|
+
const pluginService = new chunkKZIBF2EV_cjs.PluginService(db);
|
|
6390
6390
|
const plugin2 = await pluginService.getPlugin("security-audit");
|
|
6391
6391
|
if (plugin2?.settings) {
|
|
6392
6392
|
const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
@@ -6617,7 +6617,7 @@ async function logAuthEvent(c, db, settings, ip, userAgent, countryCode, fingerp
|
|
|
6617
6617
|
|
|
6618
6618
|
// src/plugins/core-plugins/security-audit-plugin/index.ts
|
|
6619
6619
|
var SECURITY_ICON = `<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/></svg>`;
|
|
6620
|
-
var securityAuditPlugin =
|
|
6620
|
+
var securityAuditPlugin = chunkKOXFYFOF_cjs.definePlugin({
|
|
6621
6621
|
id: "security-audit",
|
|
6622
6622
|
version: "1.0.0",
|
|
6623
6623
|
name: "Security Audit",
|
|
@@ -6691,7 +6691,7 @@ var ApiKeyService = class {
|
|
|
6691
6691
|
const prefix = secret.slice(0, DISPLAY_PREFIX_LEN);
|
|
6692
6692
|
const expiresAt = input.expiresAt ?? null;
|
|
6693
6693
|
const doc = await this.docService().create(
|
|
6694
|
-
|
|
6694
|
+
chunkSC2WZFNQ_cjs.createDocumentSchema.parse({
|
|
6695
6695
|
typeId: "api_key",
|
|
6696
6696
|
tenantId: this.tenantId,
|
|
6697
6697
|
title: name,
|
|
@@ -6961,7 +6961,7 @@ var createSchema = zod.z.object({
|
|
|
6961
6961
|
});
|
|
6962
6962
|
async function getSettings3(db) {
|
|
6963
6963
|
try {
|
|
6964
|
-
const plugin2 = await new
|
|
6964
|
+
const plugin2 = await new chunkKZIBF2EV_cjs.PluginService(db).getPlugin("api-keys");
|
|
6965
6965
|
if (plugin2?.settings) {
|
|
6966
6966
|
const s = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
6967
6967
|
return { ...DEFAULT_SETTINGS3, ...s };
|
|
@@ -6970,7 +6970,7 @@ async function getSettings3(db) {
|
|
|
6970
6970
|
}
|
|
6971
6971
|
return DEFAULT_SETTINGS3;
|
|
6972
6972
|
}
|
|
6973
|
-
adminRoutes4.use("*",
|
|
6973
|
+
adminRoutes4.use("*", chunkKMM45BTY_cjs.requireAuth());
|
|
6974
6974
|
adminRoutes4.use("*", async (c, next) => {
|
|
6975
6975
|
const user = c.get("user");
|
|
6976
6976
|
if (user?.role !== "admin") {
|
|
@@ -7055,7 +7055,7 @@ function apiKeyAuthMiddleware() {
|
|
|
7055
7055
|
|
|
7056
7056
|
// src/plugins/core-plugins/api-keys-plugin/index.ts
|
|
7057
7057
|
var KEY_ICON = `<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"/></svg>`;
|
|
7058
|
-
var apiKeysPlugin =
|
|
7058
|
+
var apiKeysPlugin = chunkKOXFYFOF_cjs.definePlugin({
|
|
7059
7059
|
id: "api-keys",
|
|
7060
7060
|
version: "1.0.0-beta.1",
|
|
7061
7061
|
name: "API Keys",
|
|
@@ -7824,7 +7824,7 @@ var DEFAULT_SETTINGS4 = {
|
|
|
7824
7824
|
|
|
7825
7825
|
// src/plugins/core-plugins/stripe-plugin/routes/admin.ts
|
|
7826
7826
|
var adminRoutes5 = new hono.Hono();
|
|
7827
|
-
adminRoutes5.use("*",
|
|
7827
|
+
adminRoutes5.use("*", chunkKMM45BTY_cjs.requireAuth());
|
|
7828
7828
|
adminRoutes5.use("*", async (c, next) => {
|
|
7829
7829
|
const user = c.get("user");
|
|
7830
7830
|
if (user?.role !== "admin") {
|
|
@@ -7834,7 +7834,7 @@ adminRoutes5.use("*", async (c, next) => {
|
|
|
7834
7834
|
});
|
|
7835
7835
|
async function getSettings4(db) {
|
|
7836
7836
|
try {
|
|
7837
|
-
const pluginService = new
|
|
7837
|
+
const pluginService = new chunkKZIBF2EV_cjs.PluginService(db);
|
|
7838
7838
|
const plugin2 = await pluginService.getPlugin("stripe");
|
|
7839
7839
|
if (plugin2?.settings) {
|
|
7840
7840
|
const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
@@ -8156,7 +8156,7 @@ function timingSafeEqual(a, b) {
|
|
|
8156
8156
|
var apiRoutes3 = new hono.Hono();
|
|
8157
8157
|
async function getSettings5(db) {
|
|
8158
8158
|
try {
|
|
8159
|
-
const pluginService = new
|
|
8159
|
+
const pluginService = new chunkKZIBF2EV_cjs.PluginService(db);
|
|
8160
8160
|
const plugin2 = await pluginService.getPlugin("stripe");
|
|
8161
8161
|
if (plugin2?.settings) {
|
|
8162
8162
|
const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
@@ -8307,7 +8307,7 @@ apiRoutes3.post("/webhook", async (c) => {
|
|
|
8307
8307
|
}
|
|
8308
8308
|
return c.json({ received: true });
|
|
8309
8309
|
});
|
|
8310
|
-
apiRoutes3.post("/create-checkout-session",
|
|
8310
|
+
apiRoutes3.post("/create-checkout-session", chunkKMM45BTY_cjs.requireAuth(), async (c) => {
|
|
8311
8311
|
const db = c.env.DB;
|
|
8312
8312
|
const user = c.get("user");
|
|
8313
8313
|
if (!user) return c.json({ error: "Unauthorized" }, 401);
|
|
@@ -8347,7 +8347,7 @@ apiRoutes3.post("/create-checkout-session", chunkZBDDZYA3_cjs.requireAuth(), asy
|
|
|
8347
8347
|
});
|
|
8348
8348
|
return c.json({ sessionId: session.id, url: session.url });
|
|
8349
8349
|
});
|
|
8350
|
-
apiRoutes3.get("/subscription",
|
|
8350
|
+
apiRoutes3.get("/subscription", chunkKMM45BTY_cjs.requireAuth(), async (c) => {
|
|
8351
8351
|
const user = c.get("user");
|
|
8352
8352
|
if (!user) return c.json({ error: "Unauthorized" }, 401);
|
|
8353
8353
|
const db = c.env.DB;
|
|
@@ -8359,7 +8359,7 @@ apiRoutes3.get("/subscription", chunkZBDDZYA3_cjs.requireAuth(), async (c) => {
|
|
|
8359
8359
|
}
|
|
8360
8360
|
return c.json({ subscription });
|
|
8361
8361
|
});
|
|
8362
|
-
apiRoutes3.get("/subscriptions",
|
|
8362
|
+
apiRoutes3.get("/subscriptions", chunkKMM45BTY_cjs.requireAuth(), async (c) => {
|
|
8363
8363
|
const user = c.get("user");
|
|
8364
8364
|
if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
|
|
8365
8365
|
const db = c.env.DB;
|
|
@@ -8375,7 +8375,7 @@ apiRoutes3.get("/subscriptions", chunkZBDDZYA3_cjs.requireAuth(), async (c) => {
|
|
|
8375
8375
|
const result = await subscriptionService.list(filters);
|
|
8376
8376
|
return c.json(result);
|
|
8377
8377
|
});
|
|
8378
|
-
apiRoutes3.get("/stats",
|
|
8378
|
+
apiRoutes3.get("/stats", chunkKMM45BTY_cjs.requireAuth(), async (c) => {
|
|
8379
8379
|
const user = c.get("user");
|
|
8380
8380
|
if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
|
|
8381
8381
|
const db = c.env.DB;
|
|
@@ -8384,7 +8384,7 @@ apiRoutes3.get("/stats", chunkZBDDZYA3_cjs.requireAuth(), async (c) => {
|
|
|
8384
8384
|
const stats = await subscriptionService.getStats();
|
|
8385
8385
|
return c.json(stats);
|
|
8386
8386
|
});
|
|
8387
|
-
apiRoutes3.post("/sync-subscriptions",
|
|
8387
|
+
apiRoutes3.post("/sync-subscriptions", chunkKMM45BTY_cjs.requireAuth(), async (c) => {
|
|
8388
8388
|
const user = c.get("user");
|
|
8389
8389
|
if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
|
|
8390
8390
|
const db = c.env.DB;
|
|
@@ -8432,7 +8432,7 @@ apiRoutes3.post("/sync-subscriptions", chunkZBDDZYA3_cjs.requireAuth(), async (c
|
|
|
8432
8432
|
}, 500);
|
|
8433
8433
|
}
|
|
8434
8434
|
});
|
|
8435
|
-
apiRoutes3.get("/events",
|
|
8435
|
+
apiRoutes3.get("/events", chunkKMM45BTY_cjs.requireAuth(), async (c) => {
|
|
8436
8436
|
const user = c.get("user");
|
|
8437
8437
|
if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
|
|
8438
8438
|
const db = c.env.DB;
|
|
@@ -8455,7 +8455,7 @@ apiRoutes3.get("/events", chunkZBDDZYA3_cjs.requireAuth(), async (c) => {
|
|
|
8455
8455
|
|
|
8456
8456
|
// src/plugins/core-plugins/stripe-plugin/index.ts
|
|
8457
8457
|
var STRIPE_ICON = `<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"/></svg>`;
|
|
8458
|
-
var stripePlugin =
|
|
8458
|
+
var stripePlugin = chunkKOXFYFOF_cjs.definePlugin({
|
|
8459
8459
|
id: "stripe",
|
|
8460
8460
|
version: "1.0.0",
|
|
8461
8461
|
name: "Stripe",
|
|
@@ -8728,7 +8728,7 @@ function renderFormsListPage(data) {
|
|
|
8728
8728
|
|
|
8729
8729
|
<!-- Forms Table -->
|
|
8730
8730
|
<div class="bg-white dark:bg-zinc-900 rounded-lg border border-zinc-950/5 dark:border-white/10 overflow-hidden">
|
|
8731
|
-
${
|
|
8731
|
+
${chunkSC2WZFNQ_cjs.renderTable(tableData)}
|
|
8732
8732
|
</div>
|
|
8733
8733
|
</div>
|
|
8734
8734
|
`;
|
|
@@ -10158,7 +10158,7 @@ function renderFormCreatePage(data) {
|
|
|
10158
10158
|
// src/routes/admin-forms.ts
|
|
10159
10159
|
var isTableMissing = (err) => String(err?.message ?? err?.cause?.message ?? "").includes("no such table: forms");
|
|
10160
10160
|
var adminFormsRoutes = new hono.Hono();
|
|
10161
|
-
adminFormsRoutes.use("*",
|
|
10161
|
+
adminFormsRoutes.use("*", chunkKMM45BTY_cjs.requireAuth());
|
|
10162
10162
|
adminFormsRoutes.get("/", async (c) => {
|
|
10163
10163
|
try {
|
|
10164
10164
|
const user = c.get("user");
|
|
@@ -10331,7 +10331,7 @@ adminFormsRoutes.get("/:id/builder", async (c) => {
|
|
|
10331
10331
|
if (!form) {
|
|
10332
10332
|
return c.html("<p>Form not found</p>", 404);
|
|
10333
10333
|
}
|
|
10334
|
-
const turnstileService = new
|
|
10334
|
+
const turnstileService = new chunkLXYDJU6U_cjs.TurnstileService(db);
|
|
10335
10335
|
const turnstileSettings = await turnstileService.getSettings();
|
|
10336
10336
|
const pageData = {
|
|
10337
10337
|
id: form.id,
|
|
@@ -10500,7 +10500,7 @@ publicFormsRoutes.get("/:identifier/turnstile-config", async (c) => {
|
|
|
10500
10500
|
if (!form) {
|
|
10501
10501
|
return c.json({ error: "Form not found" }, 404);
|
|
10502
10502
|
}
|
|
10503
|
-
const turnstileService = new
|
|
10503
|
+
const turnstileService = new chunkLXYDJU6U_cjs.TurnstileService(db);
|
|
10504
10504
|
const globalSettings = await turnstileService.getSettings();
|
|
10505
10505
|
const formSettings = form.turnstile_settings ? JSON.parse(form.turnstile_settings) : { inherit: true };
|
|
10506
10506
|
const enabled = form.turnstile_enabled === 1 || formSettings.inherit && globalSettings?.enabled;
|
|
@@ -10930,7 +10930,7 @@ publicFormsRoutes.post("/:identifier/submit", async (c) => {
|
|
|
10930
10930
|
const turnstileEnabled = form.turnstile_enabled === 1;
|
|
10931
10931
|
const turnstileSettings = form.turnstile_settings ? JSON.parse(form.turnstile_settings) : { inherit: true };
|
|
10932
10932
|
if (turnstileEnabled || turnstileSettings.inherit) {
|
|
10933
|
-
const turnstileService = new
|
|
10933
|
+
const turnstileService = new chunkLXYDJU6U_cjs.TurnstileService(db);
|
|
10934
10934
|
const globalEnabled = await turnstileService.isEnabled();
|
|
10935
10935
|
if (globalEnabled || turnstileEnabled) {
|
|
10936
10936
|
const turnstileToken = body.data?.turnstile || body.turnstile;
|
|
@@ -10992,7 +10992,7 @@ publicFormsRoutes.post("/:identifier/submit", async (c) => {
|
|
|
10992
10992
|
});
|
|
10993
10993
|
|
|
10994
10994
|
// src/plugins/core-plugins/forms-plugin/index.ts
|
|
10995
|
-
var formsPlugin =
|
|
10995
|
+
var formsPlugin = chunkKOXFYFOF_cjs.definePlugin({
|
|
10996
10996
|
id: "forms",
|
|
10997
10997
|
version: "1.0.0",
|
|
10998
10998
|
name: "Forms",
|
|
@@ -11012,7 +11012,7 @@ var formsPlugin = chunkPTTFLUEX_cjs.definePlugin({
|
|
|
11012
11012
|
});
|
|
11013
11013
|
chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
|
|
11014
11014
|
var adminRbacRoutes = new hono.Hono();
|
|
11015
|
-
adminRbacRoutes.use("*",
|
|
11015
|
+
adminRbacRoutes.use("*", chunkKMM45BTY_cjs.requireRbac("rbac", "manage"));
|
|
11016
11016
|
var esc = (s) => String(s).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
11017
11017
|
var TABS2 = `
|
|
11018
11018
|
<div class="border-b border-zinc-950/10 dark:border-white/10 mb-6">
|
|
@@ -11320,7 +11320,7 @@ adminRbacRoutes.get("/", async (c) => {
|
|
|
11320
11320
|
title: "Roles & Permissions",
|
|
11321
11321
|
pageTitle: "Roles & Permissions",
|
|
11322
11322
|
currentPath: "/admin/users",
|
|
11323
|
-
version:
|
|
11323
|
+
version: chunk3XFA3E2F_cjs.getCoreVersion(),
|
|
11324
11324
|
user: u ? { name: u.email || "Admin", email: u.email || "", role: u.role || "admin" } : void 0,
|
|
11325
11325
|
content: content2
|
|
11326
11326
|
})
|
|
@@ -11457,7 +11457,7 @@ adminRbacRoutes.get("/check", async (c) => {
|
|
|
11457
11457
|
});
|
|
11458
11458
|
|
|
11459
11459
|
// src/middleware/plugin-menu.ts
|
|
11460
|
-
var REGISTRY_MENU_PLUGINS = Object.values(
|
|
11460
|
+
var REGISTRY_MENU_PLUGINS = Object.values(chunkKZIBF2EV_cjs.PLUGIN_REGISTRY).filter((p) => p.adminMenu !== null).map((p) => ({
|
|
11461
11461
|
id: p.id,
|
|
11462
11462
|
label: p.adminMenu.label,
|
|
11463
11463
|
path: p.adminMenu.path,
|
|
@@ -11535,7 +11535,16 @@ function pluginMenuMiddleware() {
|
|
|
11535
11535
|
}
|
|
11536
11536
|
} catch {
|
|
11537
11537
|
}
|
|
11538
|
-
|
|
11538
|
+
const user = c.get("user");
|
|
11539
|
+
const singletonItems = chunkLXYDJU6U_cjs.resolvePluginMenuItems(user ? { role: user.role } : void 0);
|
|
11540
|
+
const existingPaths = new Set(activeMenuItems.map((i) => i.path));
|
|
11541
|
+
for (const item of singletonItems) {
|
|
11542
|
+
if (!existingPaths.has(item.path)) {
|
|
11543
|
+
activeMenuItems.push({ label: item.label, path: item.path, icon: item.icon, order: item.order });
|
|
11544
|
+
}
|
|
11545
|
+
}
|
|
11546
|
+
activeMenuItems.sort((a, b) => a.order - b.order);
|
|
11547
|
+
c.set("pluginMenuItems", activeMenuItems.map((m) => ({ label: m.label, path: m.path, icon: resolveIcon(m.icon) || m.icon || "" })));
|
|
11539
11548
|
await next();
|
|
11540
11549
|
const finalItems = c.get("pluginMenuItems") ?? [];
|
|
11541
11550
|
if (finalItems.length > 0 && c.res.headers.get("content-type")?.includes("text/html")) {
|
|
@@ -11554,7 +11563,7 @@ function pluginMenuMiddleware() {
|
|
|
11554
11563
|
}
|
|
11555
11564
|
chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
|
|
11556
11565
|
var adminRoutes6 = new hono.Hono();
|
|
11557
|
-
adminRoutes6.use("*",
|
|
11566
|
+
adminRoutes6.use("*", chunkKMM45BTY_cjs.requireAuth());
|
|
11558
11567
|
adminRoutes6.use("*", async (c, next) => {
|
|
11559
11568
|
const user = c.get("user");
|
|
11560
11569
|
if (user?.role !== "admin") {
|
|
@@ -11909,7 +11918,7 @@ apiRoutes4.get("/stats", async (c) => {
|
|
|
11909
11918
|
});
|
|
11910
11919
|
|
|
11911
11920
|
// src/plugins/core-plugins/analytics/index.ts
|
|
11912
|
-
var analyticsPlugin =
|
|
11921
|
+
var analyticsPlugin = chunkKOXFYFOF_cjs.definePlugin({
|
|
11913
11922
|
id: "core-analytics",
|
|
11914
11923
|
version: "1.0.0",
|
|
11915
11924
|
name: "Analytics",
|
|
@@ -12056,7 +12065,7 @@ function esc2(s) {
|
|
|
12056
12065
|
return (s || "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
12057
12066
|
}
|
|
12058
12067
|
async function getVariablesMap(db) {
|
|
12059
|
-
let variables =
|
|
12068
|
+
let variables = chunkSC2WZFNQ_cjs.getVariablesCached();
|
|
12060
12069
|
if (variables) return variables;
|
|
12061
12070
|
try {
|
|
12062
12071
|
const { results } = await db.prepare(
|
|
@@ -12066,7 +12075,7 @@ async function getVariablesMap(db) {
|
|
|
12066
12075
|
for (const row of results || []) {
|
|
12067
12076
|
variables.set(row.key, row.value);
|
|
12068
12077
|
}
|
|
12069
|
-
|
|
12078
|
+
chunkSC2WZFNQ_cjs.setVariablesCache(variables);
|
|
12070
12079
|
return variables;
|
|
12071
12080
|
} catch {
|
|
12072
12081
|
return /* @__PURE__ */ new Map();
|
|
@@ -12135,7 +12144,7 @@ apiRoutes5.post("/", async (c) => {
|
|
|
12135
12144
|
await db.prepare(
|
|
12136
12145
|
"INSERT INTO global_variables (key, value, description, category, is_active) VALUES (?, ?, ?, ?, ?)"
|
|
12137
12146
|
).bind(key, value || "", description || "", category || "general", isActive !== false ? 1 : 0).run();
|
|
12138
|
-
|
|
12147
|
+
chunkSC2WZFNQ_cjs.invalidateVariablesCache();
|
|
12139
12148
|
const created = await db.prepare("SELECT * FROM global_variables WHERE key = ?").bind(key).first();
|
|
12140
12149
|
return c.json({ success: true, data: formatVariable(created) }, 201);
|
|
12141
12150
|
} catch {
|
|
@@ -12180,7 +12189,7 @@ apiRoutes5.put("/:id", async (c) => {
|
|
|
12180
12189
|
updates.push("updated_at = strftime('%s', 'now')");
|
|
12181
12190
|
params.push(id);
|
|
12182
12191
|
await db.prepare(`UPDATE global_variables SET ${updates.join(", ")} WHERE id = ?`).bind(...params).run();
|
|
12183
|
-
|
|
12192
|
+
chunkSC2WZFNQ_cjs.invalidateVariablesCache();
|
|
12184
12193
|
const updated = await db.prepare("SELECT * FROM global_variables WHERE id = ?").bind(id).first();
|
|
12185
12194
|
return c.json({ success: true, data: formatVariable(updated) });
|
|
12186
12195
|
} catch {
|
|
@@ -12194,7 +12203,7 @@ apiRoutes5.delete("/:id", async (c) => {
|
|
|
12194
12203
|
const existing = await db.prepare("SELECT id FROM global_variables WHERE id = ?").bind(id).first();
|
|
12195
12204
|
if (!existing) return c.json({ error: "Variable not found" }, 404);
|
|
12196
12205
|
await db.prepare("DELETE FROM global_variables WHERE id = ?").bind(id).run();
|
|
12197
|
-
|
|
12206
|
+
chunkSC2WZFNQ_cjs.invalidateVariablesCache();
|
|
12198
12207
|
return c.json({ success: true });
|
|
12199
12208
|
} catch {
|
|
12200
12209
|
return c.json({ success: false, error: "Failed to delete variable" }, 500);
|
|
@@ -12254,7 +12263,7 @@ adminRoutes7.put("/:id", async (c) => {
|
|
|
12254
12263
|
const value = body.value;
|
|
12255
12264
|
if (value !== void 0) {
|
|
12256
12265
|
await db.prepare("UPDATE global_variables SET value = ?, updated_at = strftime('%s', 'now') WHERE id = ?").bind(value, id).run();
|
|
12257
|
-
|
|
12266
|
+
chunkSC2WZFNQ_cjs.invalidateVariablesCache();
|
|
12258
12267
|
}
|
|
12259
12268
|
return c.html('<span class="text-green-400 text-xs">Saved</span>');
|
|
12260
12269
|
});
|
|
@@ -12262,7 +12271,7 @@ adminRoutes7.post("/:id/toggle", async (c) => {
|
|
|
12262
12271
|
const db = c.env.DB;
|
|
12263
12272
|
const id = c.req.param("id");
|
|
12264
12273
|
await db.prepare("UPDATE global_variables SET is_active = CASE WHEN is_active = 1 THEN 0 ELSE 1 END, updated_at = strftime('%s', 'now') WHERE id = ?").bind(id).run();
|
|
12265
|
-
|
|
12274
|
+
chunkSC2WZFNQ_cjs.invalidateVariablesCache();
|
|
12266
12275
|
c.header("HX-Redirect", "/admin/global-variables");
|
|
12267
12276
|
return c.body(null, 204);
|
|
12268
12277
|
});
|
|
@@ -12283,7 +12292,7 @@ adminRoutes7.post("/", async (c) => {
|
|
|
12283
12292
|
await db.prepare(
|
|
12284
12293
|
"INSERT INTO global_variables (key, value, description, category) VALUES (?, ?, ?, ?)"
|
|
12285
12294
|
).bind(key, value, description, category).run();
|
|
12286
|
-
|
|
12295
|
+
chunkSC2WZFNQ_cjs.invalidateVariablesCache();
|
|
12287
12296
|
c.header("HX-Redirect", "/admin/global-variables");
|
|
12288
12297
|
return c.body(null, 204);
|
|
12289
12298
|
});
|
|
@@ -12302,7 +12311,7 @@ adminRoutes7.post("/settings/editor-integration", async (c) => {
|
|
|
12302
12311
|
adminRoutes7.delete("/:id", async (c) => {
|
|
12303
12312
|
const db = c.env.DB;
|
|
12304
12313
|
await db.prepare("DELETE FROM global_variables WHERE id = ?").bind(c.req.param("id")).run();
|
|
12305
|
-
|
|
12314
|
+
chunkSC2WZFNQ_cjs.invalidateVariablesCache();
|
|
12306
12315
|
return c.html("");
|
|
12307
12316
|
});
|
|
12308
12317
|
function renderAdminPage(variables, editorStatus = { editorActive: false, activeEditorName: "", enableEditorIntegration: true }) {
|
|
@@ -12620,7 +12629,7 @@ function renderAdminPage(variables, editorStatus = { editorActive: false, active
|
|
|
12620
12629
|
</div>
|
|
12621
12630
|
` });
|
|
12622
12631
|
}
|
|
12623
|
-
var globalVariablesPlugin =
|
|
12632
|
+
var globalVariablesPlugin = chunkKOXFYFOF_cjs.definePlugin({
|
|
12624
12633
|
id: "global-variables",
|
|
12625
12634
|
version: "1.1.0",
|
|
12626
12635
|
name: "Global Variables",
|
|
@@ -12643,7 +12652,7 @@ var globalVariablesPlugin = chunkPTTFLUEX_cjs.definePlugin({
|
|
|
12643
12652
|
if (!db || !data) return data;
|
|
12644
12653
|
const variables = await getVariablesMap(db);
|
|
12645
12654
|
if (variables.size === 0) return data;
|
|
12646
|
-
return
|
|
12655
|
+
return chunkSC2WZFNQ_cjs.resolveVariablesInObject(data, variables);
|
|
12647
12656
|
} catch {
|
|
12648
12657
|
return data;
|
|
12649
12658
|
}
|
|
@@ -12661,7 +12670,7 @@ var globalVariablesPlugin = chunkPTTFLUEX_cjs.definePlugin({
|
|
|
12661
12670
|
},
|
|
12662
12671
|
activate: async () => console.info("[GlobalVariables] Plugin activated"),
|
|
12663
12672
|
deactivate: async () => {
|
|
12664
|
-
|
|
12673
|
+
chunkSC2WZFNQ_cjs.invalidateVariablesCache();
|
|
12665
12674
|
console.info("[GlobalVariables] Plugin deactivated, cache cleared");
|
|
12666
12675
|
},
|
|
12667
12676
|
uninstall: async (ctx) => {
|
|
@@ -13227,7 +13236,7 @@ function renderAdminPage2(shortcodes, editorStatus = { editorActive: false, acti
|
|
|
13227
13236
|
</div>
|
|
13228
13237
|
` });
|
|
13229
13238
|
}
|
|
13230
|
-
var shortcodesPlugin =
|
|
13239
|
+
var shortcodesPlugin = chunkKOXFYFOF_cjs.definePlugin({
|
|
13231
13240
|
id: "shortcodes",
|
|
13232
13241
|
version: "1.0.0",
|
|
13233
13242
|
name: "Shortcodes",
|
|
@@ -13311,7 +13320,7 @@ helloWorldRoutes.get("/", async (c) => {
|
|
|
13311
13320
|
</html>
|
|
13312
13321
|
`);
|
|
13313
13322
|
});
|
|
13314
|
-
var helloWorldPlugin =
|
|
13323
|
+
var helloWorldPlugin = chunkKOXFYFOF_cjs.definePlugin({
|
|
13315
13324
|
id: "hello-world",
|
|
13316
13325
|
version: "1.0.0",
|
|
13317
13326
|
name: "Hello World",
|
|
@@ -13542,7 +13551,7 @@ function renderTenantForm(data) {
|
|
|
13542
13551
|
// src/plugins/core-plugins/multi-tenant-plugin/templates/tenant-members.template.ts
|
|
13543
13552
|
chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
|
|
13544
13553
|
function roleOptions(selected) {
|
|
13545
|
-
return
|
|
13554
|
+
return chunkSC2WZFNQ_cjs.VALID_MEMBER_ROLES.map(
|
|
13546
13555
|
(r) => `<option value="${r}" ${r === selected ? "selected" : ""}>${r}</option>`
|
|
13547
13556
|
).join("");
|
|
13548
13557
|
}
|
|
@@ -13604,7 +13613,7 @@ function renderInvitations(slug, invitations) {
|
|
|
13604
13613
|
<div>
|
|
13605
13614
|
<label for="invite-role" class="mb-1 block text-xs font-medium text-zinc-500 dark:text-zinc-400">Role</label>
|
|
13606
13615
|
<select id="invite-role" name="role" class="rounded-lg border border-zinc-950/10 bg-white px-2 py-2 text-sm text-zinc-950 dark:border-white/10 dark:bg-zinc-800 dark:text-white">
|
|
13607
|
-
${
|
|
13616
|
+
${chunkSC2WZFNQ_cjs.VALID_MEMBER_ROLES.map((r) => `<option value="${r}" ${r === "viewer" ? "selected" : ""}>${r}</option>`).join("")}
|
|
13608
13617
|
</select>
|
|
13609
13618
|
</div>
|
|
13610
13619
|
<button type="submit" data-send-invite class="rounded-lg bg-zinc-950 px-3.5 py-2 text-sm font-semibold text-white hover:bg-zinc-800 dark:bg-white dark:text-zinc-950 dark:hover:bg-zinc-200">Invite</button>
|
|
@@ -13700,7 +13709,7 @@ function renderTenantMembers(data) {
|
|
|
13700
13709
|
// src/plugins/core-plugins/multi-tenant-plugin/templates/user-memberships.template.ts
|
|
13701
13710
|
chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
|
|
13702
13711
|
function roleOptions2(selected) {
|
|
13703
|
-
return
|
|
13712
|
+
return chunkSC2WZFNQ_cjs.VALID_MEMBER_ROLES.map(
|
|
13704
13713
|
(r) => `<option value="${r}" ${r === selected ? "selected" : ""}>${r}</option>`
|
|
13705
13714
|
).join("");
|
|
13706
13715
|
}
|
|
@@ -13862,7 +13871,7 @@ function zodToFieldErrors(error) {
|
|
|
13862
13871
|
}
|
|
13863
13872
|
async function isMultiTenantActive(db) {
|
|
13864
13873
|
try {
|
|
13865
|
-
const plugin2 = await new
|
|
13874
|
+
const plugin2 = await new chunkKZIBF2EV_cjs.PluginService(db).getPlugin(chunkKZIBF2EV_cjs.MULTI_TENANT_PLUGIN_ID);
|
|
13866
13875
|
return plugin2?.status === "active";
|
|
13867
13876
|
} catch {
|
|
13868
13877
|
return false;
|
|
@@ -13870,7 +13879,7 @@ async function isMultiTenantActive(db) {
|
|
|
13870
13879
|
}
|
|
13871
13880
|
function createTenantAdminRoutes() {
|
|
13872
13881
|
const routes2 = new hono.Hono();
|
|
13873
|
-
routes2.use("*",
|
|
13882
|
+
routes2.use("*", chunkKMM45BTY_cjs.requireAuth());
|
|
13874
13883
|
routes2.use("*", async (c, next) => {
|
|
13875
13884
|
const user = c.get("user");
|
|
13876
13885
|
if (user?.role !== "admin") {
|
|
@@ -13884,7 +13893,7 @@ function createTenantAdminRoutes() {
|
|
|
13884
13893
|
const form = await c.req.formData();
|
|
13885
13894
|
const slug = String(form.get("tenant") ?? "").trim().toLowerCase();
|
|
13886
13895
|
const redirect = String(form.get("redirect") ?? "");
|
|
13887
|
-
const svc = new
|
|
13896
|
+
const svc = new chunkSC2WZFNQ_cjs.TenantService(db);
|
|
13888
13897
|
const tenant = await svc.getTenantBySlug(slug);
|
|
13889
13898
|
if (!tenant || tenant.status !== "active") {
|
|
13890
13899
|
return c.json({ error: "Unknown or inactive tenant" }, 400);
|
|
@@ -13894,7 +13903,7 @@ function createTenantAdminRoutes() {
|
|
|
13894
13903
|
if (!user.isSuperAdmin && !await svc.isMember(user.userId, slug)) {
|
|
13895
13904
|
return c.json({ error: "You are not a member of this tenant" }, 403);
|
|
13896
13905
|
}
|
|
13897
|
-
cookie.setCookie(c,
|
|
13906
|
+
cookie.setCookie(c, chunkKZIBF2EV_cjs.TENANT_COOKIE, slug, {
|
|
13898
13907
|
path: "/",
|
|
13899
13908
|
httpOnly: true,
|
|
13900
13909
|
sameSite: "Lax",
|
|
@@ -13911,7 +13920,7 @@ function createTenantAdminRoutes() {
|
|
|
13911
13920
|
if (!user) return c.redirect("/auth/login");
|
|
13912
13921
|
const token = c.req.query("token") ?? "";
|
|
13913
13922
|
try {
|
|
13914
|
-
const { slug } = await new
|
|
13923
|
+
const { slug } = await new chunkSC2WZFNQ_cjs.TenantService(db).acceptInvitation(token, user.userId, user.email);
|
|
13915
13924
|
return c.redirect(`/admin/tenants/${slug}/members?message=Invitation accepted`);
|
|
13916
13925
|
} catch (error) {
|
|
13917
13926
|
const message = error instanceof Error ? error.message : "Failed to accept invitation";
|
|
@@ -13939,7 +13948,7 @@ function createTenantAdminRoutes() {
|
|
|
13939
13948
|
const userId = c.req.param("userId");
|
|
13940
13949
|
const target = await db.prepare("SELECT id, email FROM auth_user WHERE id = ?").bind(userId).first();
|
|
13941
13950
|
if (!target?.id) return c.redirect("/admin/users?message=User not found&type=error");
|
|
13942
|
-
const svc = new
|
|
13951
|
+
const svc = new chunkSC2WZFNQ_cjs.TenantService(db);
|
|
13943
13952
|
const [memberships, allTenants] = await Promise.all([svc.listUserMemberships(userId), svc.listTenants()]);
|
|
13944
13953
|
const memberSlugs = new Set(memberships.map((m) => m.slug));
|
|
13945
13954
|
const availableTenants = allTenants.filter((t) => t.status === "active" && !memberSlugs.has(t.slug)).map((t) => ({ slug: t.slug, name: t.name }));
|
|
@@ -13964,10 +13973,10 @@ function createTenantAdminRoutes() {
|
|
|
13964
13973
|
const slug = String(form.get("slug") ?? "").trim().toLowerCase();
|
|
13965
13974
|
const role = String(form.get("role") ?? "viewer");
|
|
13966
13975
|
const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
|
|
13967
|
-
if (!
|
|
13976
|
+
if (!chunkSC2WZFNQ_cjs.isValidMemberRole(role)) throw new Error(`Invalid role '${role}'`);
|
|
13968
13977
|
const target = await db.prepare("SELECT email FROM auth_user WHERE id = ?").bind(userId).first();
|
|
13969
13978
|
if (!target) throw new Error("User not found");
|
|
13970
|
-
const svc = new
|
|
13979
|
+
const svc = new chunkSC2WZFNQ_cjs.TenantService(db);
|
|
13971
13980
|
if (!await svc.getTenantBySlug(slug)) throw new Error("Tenant not found");
|
|
13972
13981
|
if (await svc.isMember(userId, slug)) throw new Error(`Already a member of '${slug}'`);
|
|
13973
13982
|
await svc.addMember(slug, userId, role, target.email ?? null);
|
|
@@ -13986,7 +13995,7 @@ function createTenantAdminRoutes() {
|
|
|
13986
13995
|
const form = await c.req.formData();
|
|
13987
13996
|
const role = String(form.get("role") ?? "");
|
|
13988
13997
|
const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
|
|
13989
|
-
await new
|
|
13998
|
+
await new chunkSC2WZFNQ_cjs.TenantService(db).setMemberRole(slug, userId, role);
|
|
13990
13999
|
return c.redirect(`${redirectTo}?message=Role updated`);
|
|
13991
14000
|
} catch (error) {
|
|
13992
14001
|
const message = error instanceof Error ? error.message : "Failed to update role";
|
|
@@ -14001,7 +14010,7 @@ function createTenantAdminRoutes() {
|
|
|
14001
14010
|
try {
|
|
14002
14011
|
const form = await c.req.formData();
|
|
14003
14012
|
const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
|
|
14004
|
-
await new
|
|
14013
|
+
await new chunkSC2WZFNQ_cjs.TenantService(db).removeMember(slug, userId);
|
|
14005
14014
|
return c.redirect(`${redirectTo}?message=Removed from ${encodeURIComponent(slug)}`);
|
|
14006
14015
|
} catch (error) {
|
|
14007
14016
|
const message = error instanceof Error ? error.message : "Failed to remove membership";
|
|
@@ -14016,7 +14025,7 @@ function createTenantAdminRoutes() {
|
|
|
14016
14025
|
return c.html(renderTenantsInactive({ user: userShape(cur), version }));
|
|
14017
14026
|
}
|
|
14018
14027
|
const roleName = c.req.param("roleName");
|
|
14019
|
-
const assignments = await new
|
|
14028
|
+
const assignments = await new chunkSC2WZFNQ_cjs.TenantService(db).listAssignmentsByRole(roleName);
|
|
14020
14029
|
return c.html(renderRoleUsage({ roleName, assignments, user: userShape(cur), version }));
|
|
14021
14030
|
});
|
|
14022
14031
|
routes2.get("/", async (c) => {
|
|
@@ -14026,7 +14035,7 @@ function createTenantAdminRoutes() {
|
|
|
14026
14035
|
if (!await isMultiTenantActive(db)) {
|
|
14027
14036
|
return c.html(renderTenantsInactive({ user: userShape(user), version }));
|
|
14028
14037
|
}
|
|
14029
|
-
const svc = new
|
|
14038
|
+
const svc = new chunkSC2WZFNQ_cjs.TenantService(db);
|
|
14030
14039
|
await svc.ensureDefaultTenant();
|
|
14031
14040
|
const tenants = await svc.listTenants();
|
|
14032
14041
|
const [docRes, memberRes] = await db.batch([
|
|
@@ -14065,7 +14074,7 @@ function createTenantAdminRoutes() {
|
|
|
14065
14074
|
formEntries = Object.fromEntries(form.entries());
|
|
14066
14075
|
const validated = tenantFormSchema.parse(formEntries);
|
|
14067
14076
|
if (!validated.slug) throw new zod.z.ZodError([{ code: "custom", message: "Slug is required", path: ["slug"] }]);
|
|
14068
|
-
const svc = new
|
|
14077
|
+
const svc = new chunkSC2WZFNQ_cjs.TenantService(db);
|
|
14069
14078
|
await svc.createTenant({
|
|
14070
14079
|
name: validated.name,
|
|
14071
14080
|
slug: validated.slug,
|
|
@@ -14090,7 +14099,7 @@ function createTenantAdminRoutes() {
|
|
|
14090
14099
|
if (!await isMultiTenantActive(db)) {
|
|
14091
14100
|
return c.html(renderTenantsInactive({ user: userShape(user), version }));
|
|
14092
14101
|
}
|
|
14093
|
-
const tenant = await new
|
|
14102
|
+
const tenant = await new chunkSC2WZFNQ_cjs.TenantService(db).getTenantBySlug(c.req.param("slug"));
|
|
14094
14103
|
if (!tenant) return c.redirect("/admin/tenants?message=Tenant not found&type=error");
|
|
14095
14104
|
return c.html(renderTenantForm({ tenant, isEdit: true, user: userShape(user), version }));
|
|
14096
14105
|
});
|
|
@@ -14100,7 +14109,7 @@ function createTenantAdminRoutes() {
|
|
|
14100
14109
|
const version = c.get("appVersion");
|
|
14101
14110
|
const slug = c.req.param("slug");
|
|
14102
14111
|
if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
|
|
14103
|
-
const svc = new
|
|
14112
|
+
const svc = new chunkSC2WZFNQ_cjs.TenantService(db);
|
|
14104
14113
|
try {
|
|
14105
14114
|
const form = await c.req.formData();
|
|
14106
14115
|
const validated = tenantFormSchema.parse(Object.fromEntries(form.entries()));
|
|
@@ -14125,7 +14134,7 @@ function createTenantAdminRoutes() {
|
|
|
14125
14134
|
const slug = c.req.param("slug");
|
|
14126
14135
|
if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
|
|
14127
14136
|
try {
|
|
14128
|
-
await new
|
|
14137
|
+
await new chunkSC2WZFNQ_cjs.TenantService(db).deleteTenant(slug);
|
|
14129
14138
|
return c.redirect("/admin/tenants?message=Tenant deleted successfully");
|
|
14130
14139
|
} catch (error) {
|
|
14131
14140
|
const message = error instanceof Error ? error.message : "Failed to delete tenant";
|
|
@@ -14140,7 +14149,7 @@ function createTenantAdminRoutes() {
|
|
|
14140
14149
|
return c.html(renderTenantsInactive({ user: userShape(user), version }));
|
|
14141
14150
|
}
|
|
14142
14151
|
const slug = c.req.param("slug");
|
|
14143
|
-
const svc = new
|
|
14152
|
+
const svc = new chunkSC2WZFNQ_cjs.TenantService(db);
|
|
14144
14153
|
const tenant = await svc.getTenantBySlug(slug);
|
|
14145
14154
|
if (!tenant) return c.redirect("/admin/tenants?message=Tenant not found&type=error");
|
|
14146
14155
|
const [members, invitations] = await Promise.all([svc.listMembers(slug), svc.listInvitations(slug)]);
|
|
@@ -14166,7 +14175,7 @@ function createTenantAdminRoutes() {
|
|
|
14166
14175
|
const form = await c.req.formData();
|
|
14167
14176
|
const email = String(form.get("email") ?? "");
|
|
14168
14177
|
const role = String(form.get("role") ?? "viewer");
|
|
14169
|
-
await new
|
|
14178
|
+
await new chunkSC2WZFNQ_cjs.TenantService(db).addMemberByEmail(slug, email, role);
|
|
14170
14179
|
return c.redirect(`/admin/tenants/${slug}/members?message=Member added`);
|
|
14171
14180
|
} catch (error) {
|
|
14172
14181
|
const message = error instanceof Error ? error.message : "Failed to add member";
|
|
@@ -14181,7 +14190,7 @@ function createTenantAdminRoutes() {
|
|
|
14181
14190
|
try {
|
|
14182
14191
|
const form = await c.req.formData();
|
|
14183
14192
|
const role = String(form.get("role") ?? "");
|
|
14184
|
-
await new
|
|
14193
|
+
await new chunkSC2WZFNQ_cjs.TenantService(db).setMemberRole(slug, userId, role);
|
|
14185
14194
|
return c.redirect(`/admin/tenants/${slug}/members?message=Role updated`);
|
|
14186
14195
|
} catch (error) {
|
|
14187
14196
|
const message = error instanceof Error ? error.message : "Failed to update role";
|
|
@@ -14194,7 +14203,7 @@ function createTenantAdminRoutes() {
|
|
|
14194
14203
|
const userId = c.req.param("userId");
|
|
14195
14204
|
if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
|
|
14196
14205
|
try {
|
|
14197
|
-
await new
|
|
14206
|
+
await new chunkSC2WZFNQ_cjs.TenantService(db).removeMember(slug, userId);
|
|
14198
14207
|
return c.redirect(`/admin/tenants/${slug}/members?message=Member removed`);
|
|
14199
14208
|
} catch (error) {
|
|
14200
14209
|
const message = error instanceof Error ? error.message : "Failed to remove member";
|
|
@@ -14210,12 +14219,12 @@ function createTenantAdminRoutes() {
|
|
|
14210
14219
|
const form = await c.req.formData();
|
|
14211
14220
|
const email = String(form.get("email") ?? "");
|
|
14212
14221
|
const role = String(form.get("role") ?? "viewer");
|
|
14213
|
-
const token = await new
|
|
14222
|
+
const token = await new chunkSC2WZFNQ_cjs.TenantService(db).createInvitation(slug, email, role, user?.userId ?? null);
|
|
14214
14223
|
const origin = c.req.header("origin") || new URL(c.req.url).origin;
|
|
14215
14224
|
const acceptUrl = `${origin}/join/invite?token=${encodeURIComponent(token)}`;
|
|
14216
14225
|
let note;
|
|
14217
14226
|
let noteType = "";
|
|
14218
|
-
const svc2 =
|
|
14227
|
+
const svc2 = chunkSC2WZFNQ_cjs.hasEmailService() ? chunkSC2WZFNQ_cjs.getEmailService() : null;
|
|
14219
14228
|
const hasRealProvider = !!svc2 && svc2.getProviderName() !== "console";
|
|
14220
14229
|
if (hasRealProvider) {
|
|
14221
14230
|
const result = await svc2.send({
|
|
@@ -14256,7 +14265,7 @@ function createTenantAdminRoutes() {
|
|
|
14256
14265
|
WHERE i.id = ? AND t.slug = ? AND i.status = 'pending'`
|
|
14257
14266
|
).bind(id, slug).first();
|
|
14258
14267
|
if (!inv) throw new Error("Invitation not found or already used");
|
|
14259
|
-
const svc2 =
|
|
14268
|
+
const svc2 = chunkSC2WZFNQ_cjs.hasEmailService() ? chunkSC2WZFNQ_cjs.getEmailService() : null;
|
|
14260
14269
|
const hasRealProvider = !!svc2 && svc2.getProviderName() !== "console";
|
|
14261
14270
|
if (!hasRealProvider) throw new Error("No email plugin active");
|
|
14262
14271
|
const origin = c.req.header("origin") || new URL(c.req.url).origin;
|
|
@@ -14281,7 +14290,7 @@ function createTenantAdminRoutes() {
|
|
|
14281
14290
|
const id = c.req.param("id");
|
|
14282
14291
|
if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
|
|
14283
14292
|
try {
|
|
14284
|
-
await new
|
|
14293
|
+
await new chunkSC2WZFNQ_cjs.TenantService(db).revokeInvitation(slug, id);
|
|
14285
14294
|
return c.redirect(`/admin/tenants/${slug}/members?message=Invitation revoked`);
|
|
14286
14295
|
} catch (error) {
|
|
14287
14296
|
const message = error instanceof Error ? error.message : "Failed to revoke invitation";
|
|
@@ -14511,7 +14520,7 @@ function createJoinRoutes() {
|
|
|
14511
14520
|
if (existing) return rerender("An account with this email already exists. Please sign in instead.");
|
|
14512
14521
|
try {
|
|
14513
14522
|
const userId = crypto.randomUUID();
|
|
14514
|
-
const passwordHash = await
|
|
14523
|
+
const passwordHash = await chunkKMM45BTY_cjs.AuthManager.hashPassword(password);
|
|
14515
14524
|
const now = Date.now();
|
|
14516
14525
|
const nowSec = Math.floor(now / 1e3);
|
|
14517
14526
|
await db.batch([
|
|
@@ -14524,7 +14533,7 @@ function createJoinRoutes() {
|
|
|
14524
14533
|
VALUES (?, ?, ?, 'credential', ?, ?, ?)`
|
|
14525
14534
|
).bind(`cred-${userId}`, userId, userId, passwordHash, nowSec, nowSec)
|
|
14526
14535
|
]);
|
|
14527
|
-
await new
|
|
14536
|
+
await new chunkSC2WZFNQ_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
|
|
14528
14537
|
const auth = chunkKMCLNO4K_cjs.createAuth(c.env);
|
|
14529
14538
|
const origin = new URL(c.req.url).origin;
|
|
14530
14539
|
const baReq = new Request(`${origin}/auth/sign-in/email`, {
|
|
@@ -14592,7 +14601,7 @@ function createJoinRoutes() {
|
|
|
14592
14601
|
const baBody = await baRes.json();
|
|
14593
14602
|
const userId = baBody?.user?.id;
|
|
14594
14603
|
if (!userId) return rerender("Sign-in succeeded but could not read user ID.");
|
|
14595
|
-
await new
|
|
14604
|
+
await new chunkSC2WZFNQ_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
|
|
14596
14605
|
const headers = new Headers({ Location: "/admin?message=Welcome! You have joined " + encodeURIComponent(inv.tenantName) });
|
|
14597
14606
|
copyBaCookies(baRes, headers);
|
|
14598
14607
|
return new Response(null, { status: 302, headers });
|
|
@@ -14606,7 +14615,7 @@ function createJoinRoutes() {
|
|
|
14606
14615
|
|
|
14607
14616
|
// src/plugins/core-plugins/multi-tenant-plugin/index.ts
|
|
14608
14617
|
var TENANT_ICON = `<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3.75 21h16.5M4.5 3h15M5.25 3v18m13.5-18v18M9 6.75h1.5m-1.5 3h1.5m-1.5 3h1.5m3-6H15m-1.5 3H15m-1.5 3H15M9 21v-3.375c0-.621.504-1.125 1.125-1.125h3.75c.621 0 1.125.504 1.125 1.125V21"/></svg>`;
|
|
14609
|
-
var multiTenantPlugin =
|
|
14618
|
+
var multiTenantPlugin = chunkKOXFYFOF_cjs.definePlugin({
|
|
14610
14619
|
id: manifest_default2.id,
|
|
14611
14620
|
version: "1.0.0",
|
|
14612
14621
|
name: manifest_default2.name,
|
|
@@ -14621,30 +14630,30 @@ var multiTenantPlugin = chunkPTTFLUEX_cjs.definePlugin({
|
|
|
14621
14630
|
{ label: "Tenants", path: "/admin/tenants", icon: TENANT_ICON, order: 80 }
|
|
14622
14631
|
],
|
|
14623
14632
|
activate: async () => {
|
|
14624
|
-
|
|
14633
|
+
chunkKZIBF2EV_cjs.invalidateTenantCache();
|
|
14625
14634
|
console.info("\u2705 Multi-Tenant plugin activated");
|
|
14626
14635
|
},
|
|
14627
14636
|
deactivate: async () => {
|
|
14628
|
-
|
|
14637
|
+
chunkKZIBF2EV_cjs.invalidateTenantCache();
|
|
14629
14638
|
console.info("\u274C Multi-Tenant plugin deactivated");
|
|
14630
14639
|
}
|
|
14631
14640
|
});
|
|
14632
14641
|
var routes = new hono.Hono();
|
|
14633
|
-
routes.use("*",
|
|
14634
|
-
routes.use("*",
|
|
14642
|
+
routes.use("*", chunkKMM45BTY_cjs.requireAuth());
|
|
14643
|
+
routes.use("*", chunkKMM45BTY_cjs.requireRole(["admin", "editor"]));
|
|
14635
14644
|
routes.get("/:rootId", async (c) => {
|
|
14636
14645
|
const { rootId } = c.req.param();
|
|
14637
14646
|
const db = c.env.DB;
|
|
14638
|
-
const scope = await
|
|
14647
|
+
const scope = await chunkSC2WZFNQ_cjs.resolveDocScope(c, db, { rootId });
|
|
14639
14648
|
if (!scope) {
|
|
14640
14649
|
return c.html('<p class="text-zinc-500 dark:text-zinc-400 p-4">Document not found.</p>', 404);
|
|
14641
14650
|
}
|
|
14642
14651
|
if (!scope.docType?.settings?.versioning) {
|
|
14643
14652
|
return c.html('<p class="text-zinc-500 dark:text-zinc-400 p-4">Versioning not enabled for this type.</p>', 404);
|
|
14644
14653
|
}
|
|
14645
|
-
const denied = await
|
|
14654
|
+
const denied = await chunkSC2WZFNQ_cjs.denyIfNotAllowed(c, db, rootId, "read", scope.docType?.settings, scope.tenantId);
|
|
14646
14655
|
if (denied) return denied;
|
|
14647
|
-
const repo = new
|
|
14656
|
+
const repo = new chunkSC2WZFNQ_cjs.DocumentRepository(db, scope.tenantId);
|
|
14648
14657
|
const versions = await repo.getVersionHistory(rootId);
|
|
14649
14658
|
const safeRootIdAttr = chunkMNWKYY5E_cjs.escapeHtml(rootId);
|
|
14650
14659
|
const rows = versions.map((v) => {
|
|
@@ -14737,14 +14746,14 @@ routes.post("/:rootId/restore/:versionNumber", async (c) => {
|
|
|
14737
14746
|
const { rootId, versionNumber } = c.req.param();
|
|
14738
14747
|
const db = c.env.DB;
|
|
14739
14748
|
const user = c.get("user");
|
|
14740
|
-
const scope = await
|
|
14749
|
+
const scope = await chunkSC2WZFNQ_cjs.resolveDocScope(c, db, { rootId });
|
|
14741
14750
|
if (!scope) {
|
|
14742
14751
|
return c.json({ error: "Document not found" }, 404);
|
|
14743
14752
|
}
|
|
14744
14753
|
if (!scope.docType?.settings?.versioning) {
|
|
14745
14754
|
return c.json({ error: "Versioning not enabled for this type" }, 404);
|
|
14746
14755
|
}
|
|
14747
|
-
const denied = await
|
|
14756
|
+
const denied = await chunkSC2WZFNQ_cjs.denyIfNotAllowed(c, db, rootId, "update", scope.docType?.settings, scope.tenantId);
|
|
14748
14757
|
if (denied) return denied;
|
|
14749
14758
|
const row = await db.prepare("SELECT * FROM documents WHERE root_id = ? AND tenant_id = ? AND version_number = ? LIMIT 1").bind(rootId, scope.tenantId, Number(versionNumber)).first();
|
|
14750
14759
|
if (!row) {
|
|
@@ -14767,7 +14776,7 @@ routes.post("/:rootId/restore/:versionNumber", async (c) => {
|
|
|
14767
14776
|
var routes_default = routes;
|
|
14768
14777
|
|
|
14769
14778
|
// src/plugins/core-plugins/versioning-plugin/index.ts
|
|
14770
|
-
var versioningPlugin =
|
|
14779
|
+
var versioningPlugin = chunkKOXFYFOF_cjs.definePlugin({
|
|
14771
14780
|
id: "versioning",
|
|
14772
14781
|
version: "1.0.0",
|
|
14773
14782
|
name: "Versioning",
|
|
@@ -14844,8 +14853,8 @@ function createMagicLinkAuthPlugin() {
|
|
|
14844
14853
|
const baseUrl = new URL(c.req.url).origin;
|
|
14845
14854
|
const magicLink = `${baseUrl}/auth/magic-link/verify?token=${token}`;
|
|
14846
14855
|
try {
|
|
14847
|
-
if (
|
|
14848
|
-
await
|
|
14856
|
+
if (chunkSC2WZFNQ_cjs.hasEmailService()) {
|
|
14857
|
+
await chunkSC2WZFNQ_cjs.getEmailService().send({
|
|
14849
14858
|
to: normalizedEmail,
|
|
14850
14859
|
subject: "Your Magic Link to Sign In",
|
|
14851
14860
|
flow: "magic-link",
|
|
@@ -14922,19 +14931,19 @@ function createMagicLinkAuthPlugin() {
|
|
|
14922
14931
|
SET used = 1, used_at = ?
|
|
14923
14932
|
WHERE id = ?
|
|
14924
14933
|
`).bind(Date.now(), magicLink.id).run();
|
|
14925
|
-
const tokenTtl = await
|
|
14926
|
-
const jwtToken = await
|
|
14934
|
+
const tokenTtl = await chunkKMM45BTY_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
|
|
14935
|
+
const jwtToken = await chunkKMM45BTY_cjs.AuthManager.generateToken(
|
|
14927
14936
|
user.id,
|
|
14928
14937
|
user.email,
|
|
14929
14938
|
user.role,
|
|
14930
14939
|
c.env.JWT_SECRET,
|
|
14931
14940
|
tokenTtl
|
|
14932
14941
|
);
|
|
14933
|
-
|
|
14942
|
+
chunkKMM45BTY_cjs.AuthManager.setAuthCookie(c, jwtToken, { maxAge: tokenTtl });
|
|
14934
14943
|
await db.prepare(`
|
|
14935
14944
|
UPDATE auth_user SET last_login_at = ? WHERE id = ?
|
|
14936
14945
|
`).bind(Date.now(), user.id).run();
|
|
14937
|
-
|
|
14946
|
+
chunkSC2WZFNQ_cjs.dispatchHookEvent(
|
|
14938
14947
|
c,
|
|
14939
14948
|
"auth:magic-link:consumed",
|
|
14940
14949
|
{ user: { id: user.id, email: user.email, role: user.role } },
|
|
@@ -15419,7 +15428,7 @@ async function warmCollections(db) {
|
|
|
15419
15428
|
const collectionCache = chunkYA3TJ65D_cjs.getCacheService(config);
|
|
15420
15429
|
let count = 0;
|
|
15421
15430
|
try {
|
|
15422
|
-
const results =
|
|
15431
|
+
const results = chunkKZIBF2EV_cjs.getCollectionRegistry().listActive().map(chunkKZIBF2EV_cjs.collectionRecordToRow);
|
|
15423
15432
|
for (const collection of results) {
|
|
15424
15433
|
const key = collectionCache.generateKey("item", collection.id);
|
|
15425
15434
|
await collectionCache.set(key, collection);
|
|
@@ -15690,7 +15699,7 @@ function renderCacheDashboard(data) {
|
|
|
15690
15699
|
</script>
|
|
15691
15700
|
|
|
15692
15701
|
<!-- Confirmation Dialogs -->
|
|
15693
|
-
${
|
|
15702
|
+
${chunkSC2WZFNQ_cjs.renderConfirmationDialog({
|
|
15694
15703
|
id: "clear-all-cache-confirm",
|
|
15695
15704
|
title: "Clear All Cache",
|
|
15696
15705
|
message: "Are you sure you want to clear all cache entries? This cannot be undone.",
|
|
@@ -15701,7 +15710,7 @@ function renderCacheDashboard(data) {
|
|
|
15701
15710
|
onConfirm: "performClearAllCaches()"
|
|
15702
15711
|
})}
|
|
15703
15712
|
|
|
15704
|
-
${
|
|
15713
|
+
${chunkSC2WZFNQ_cjs.renderConfirmationDialog({
|
|
15705
15714
|
id: "clear-namespace-cache-confirm",
|
|
15706
15715
|
title: "Clear Namespace Cache",
|
|
15707
15716
|
message: "Clear cache for this namespace?",
|
|
@@ -15712,7 +15721,7 @@ function renderCacheDashboard(data) {
|
|
|
15712
15721
|
onConfirm: "performClearNamespaceCache()"
|
|
15713
15722
|
})}
|
|
15714
15723
|
|
|
15715
|
-
${
|
|
15724
|
+
${chunkSC2WZFNQ_cjs.getConfirmationDialogScript()}
|
|
15716
15725
|
`;
|
|
15717
15726
|
const layoutData = {
|
|
15718
15727
|
title: "Cache System",
|
|
@@ -15978,7 +15987,7 @@ app.get("/", async (c) => {
|
|
|
15978
15987
|
const totalRequests = totalHits + totalMisses;
|
|
15979
15988
|
const overallHitRate = totalRequests > 0 ? totalHits / totalRequests * 100 : 0;
|
|
15980
15989
|
const DEFAULT_TTL = chunkYA3TJ65D_cjs.CACHE_CONFIGS.api?.ttl ?? 300;
|
|
15981
|
-
const collections =
|
|
15990
|
+
const collections = chunkKZIBF2EV_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => {
|
|
15982
15991
|
const cacheOverride = r.cache;
|
|
15983
15992
|
const cacheEnabled = cacheOverride?.enabled !== false;
|
|
15984
15993
|
const hasCustomTtl = typeof cacheOverride?.ttl === "number";
|
|
@@ -16515,9 +16524,9 @@ var faviconSvg = `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
|
16515
16524
|
// src/app.ts
|
|
16516
16525
|
function createSonicJSApp(config = {}) {
|
|
16517
16526
|
const app2 = new hono.Hono();
|
|
16518
|
-
const appVersion = config.version ||
|
|
16527
|
+
const appVersion = config.version || chunk3XFA3E2F_cjs.getCoreVersion();
|
|
16519
16528
|
const appName = config.name || "SonicJS AI";
|
|
16520
|
-
const hookSystem = new
|
|
16529
|
+
const hookSystem = new chunkLXYDJU6U_cjs.HookSystemImpl();
|
|
16521
16530
|
chunkJ6JTWD2A_cjs.setHookSystem(hookSystem);
|
|
16522
16531
|
const magicLinkPlugin = createMagicLinkAuthPlugin();
|
|
16523
16532
|
const corePluginsBeforeCatchAll = [
|
|
@@ -16525,7 +16534,7 @@ function createSonicJSApp(config = {}) {
|
|
|
16525
16534
|
apiKeysPlugin,
|
|
16526
16535
|
aiSearchPlugin,
|
|
16527
16536
|
oauthProvidersPlugin,
|
|
16528
|
-
|
|
16537
|
+
chunkSC2WZFNQ_cjs.userProfilesPlugin,
|
|
16529
16538
|
otpLoginPlugin,
|
|
16530
16539
|
analyticsPlugin,
|
|
16531
16540
|
stripePlugin,
|
|
@@ -16535,23 +16544,23 @@ function createSonicJSApp(config = {}) {
|
|
|
16535
16544
|
shortcodesPlugin,
|
|
16536
16545
|
helloWorldPlugin,
|
|
16537
16546
|
multiTenantPlugin,
|
|
16538
|
-
|
|
16547
|
+
chunkSC2WZFNQ_cjs.lexicalEditorPlugin,
|
|
16539
16548
|
versioningPlugin
|
|
16540
16549
|
];
|
|
16541
16550
|
const corePluginsAfterCatchAll = [emailPluginV3, magicLinkPlugin, emailReconciliationPlugin];
|
|
16542
|
-
const wirePlugins =
|
|
16551
|
+
const wirePlugins = chunkLXYDJU6U_cjs.createPluginWirer(
|
|
16543
16552
|
() => [...corePluginsBeforeCatchAll, ...corePluginsAfterCatchAll, ...config.plugins?.register ?? []],
|
|
16544
16553
|
// The capability-gated `ctx.cap.email` resolves to the app EmailService, which
|
|
16545
16554
|
// is initialized (below) just before wiring on the first request.
|
|
16546
16555
|
() => ({
|
|
16547
16556
|
hooks: hookSystem,
|
|
16548
16557
|
env: firstRequestEnv,
|
|
16549
|
-
providers: { email: () =>
|
|
16558
|
+
providers: { email: () => chunkSC2WZFNQ_cjs.getEmailService() }
|
|
16550
16559
|
})
|
|
16551
16560
|
);
|
|
16552
16561
|
let firstRequestEnv;
|
|
16553
16562
|
const initEmailService = async (env = {}) => {
|
|
16554
|
-
if (
|
|
16563
|
+
if (chunkSC2WZFNQ_cjs.hasEmailService()) return;
|
|
16555
16564
|
let provider;
|
|
16556
16565
|
let defaultFrom = config.email?.from;
|
|
16557
16566
|
let defaultReplyTo;
|
|
@@ -16586,14 +16595,14 @@ function createSonicJSApp(config = {}) {
|
|
|
16586
16595
|
}
|
|
16587
16596
|
}
|
|
16588
16597
|
defaultFrom = defaultFrom || env.DEFAULT_FROM_EMAIL || "noreply@sonicjs.local";
|
|
16589
|
-
|
|
16598
|
+
chunkSC2WZFNQ_cjs.setEmailService(new EmailService({ provider, defaultFrom, defaultReplyTo, db: env.DB }));
|
|
16590
16599
|
};
|
|
16591
16600
|
app2.use("*", async (c, next) => {
|
|
16592
16601
|
c.set("appVersion", appVersion);
|
|
16593
16602
|
await next();
|
|
16594
16603
|
});
|
|
16595
|
-
app2.use("*",
|
|
16596
|
-
app2.use("*",
|
|
16604
|
+
app2.use("*", chunkKMM45BTY_cjs.metricsMiddleware());
|
|
16605
|
+
app2.use("*", chunkKMM45BTY_cjs.bootstrapMiddleware(config));
|
|
16597
16606
|
const boot = async (env) => {
|
|
16598
16607
|
if (config.plugins?.disableAll) return;
|
|
16599
16608
|
firstRequestEnv = env;
|
|
@@ -16631,8 +16640,8 @@ function createSonicJSApp(config = {}) {
|
|
|
16631
16640
|
allowHeaders: ["Content-Type", "Authorization", "X-API-Key"],
|
|
16632
16641
|
credentials: true
|
|
16633
16642
|
}));
|
|
16634
|
-
app2.use("*",
|
|
16635
|
-
app2.use("*",
|
|
16643
|
+
app2.use("*", chunkKMM45BTY_cjs.securityHeadersMiddleware());
|
|
16644
|
+
app2.use("*", chunkKMM45BTY_cjs.csrfProtection());
|
|
16636
16645
|
app2.use("*", async (c, next) => {
|
|
16637
16646
|
try {
|
|
16638
16647
|
const reqUrl = new URL(c.req.url);
|
|
@@ -16670,9 +16679,9 @@ function createSonicJSApp(config = {}) {
|
|
|
16670
16679
|
app2.use("*", middleware);
|
|
16671
16680
|
}
|
|
16672
16681
|
}
|
|
16673
|
-
app2.use("*",
|
|
16674
|
-
app2.use("/admin/*",
|
|
16675
|
-
app2.use("/admin/*",
|
|
16682
|
+
app2.use("*", chunkKZIBF2EV_cjs.tenantMiddleware());
|
|
16683
|
+
app2.use("/admin/*", chunkKMM45BTY_cjs.requireAuth());
|
|
16684
|
+
app2.use("/admin/*", chunkKMM45BTY_cjs.requireRbac("portal", "access"));
|
|
16676
16685
|
app2.use("/admin/*", pluginMenuMiddleware());
|
|
16677
16686
|
const NAV_LANDING = [
|
|
16678
16687
|
{ path: "/admin/content", perm: "content:read" },
|
|
@@ -16718,43 +16727,43 @@ function createSonicJSApp(config = {}) {
|
|
|
16718
16727
|
});
|
|
16719
16728
|
app2.route("/api/security-audit", apiRoutes2);
|
|
16720
16729
|
app2.route("/admin/plugins/security-audit", adminRoutes3);
|
|
16721
|
-
app2.route("/api/media",
|
|
16722
|
-
app2.route("/api/system",
|
|
16723
|
-
app2.route("/api/documents",
|
|
16724
|
-
app2.route("/api",
|
|
16725
|
-
app2.route("/admin/documents",
|
|
16726
|
-
|
|
16727
|
-
app2.route("/admin/api",
|
|
16728
|
-
app2.route("/admin/collections",
|
|
16729
|
-
app2.route("/admin/settings",
|
|
16730
|
-
app2.route("/admin/api-reference",
|
|
16730
|
+
app2.route("/api/media", chunkSC2WZFNQ_cjs.api_media_default);
|
|
16731
|
+
app2.route("/api/system", chunkSC2WZFNQ_cjs.api_system_default);
|
|
16732
|
+
app2.route("/api/documents", chunkSC2WZFNQ_cjs.apiDocumentsRoutes);
|
|
16733
|
+
app2.route("/api", chunkSC2WZFNQ_cjs.api_default);
|
|
16734
|
+
app2.route("/admin/documents", chunkSC2WZFNQ_cjs.adminDocumentsRoutes);
|
|
16735
|
+
chunkLXYDJU6U_cjs.registerPluginRoutes(app2, [formsPlugin], { source: "core" });
|
|
16736
|
+
app2.route("/admin/api", chunkSC2WZFNQ_cjs.admin_api_default);
|
|
16737
|
+
app2.route("/admin/collections", chunkSC2WZFNQ_cjs.adminCollectionsRoutes);
|
|
16738
|
+
app2.route("/admin/settings", chunkSC2WZFNQ_cjs.adminSettingsRoutes);
|
|
16739
|
+
app2.route("/admin/api-reference", chunkSC2WZFNQ_cjs.router2);
|
|
16731
16740
|
app2.route("/admin/database-tools", createDatabaseToolsAdminRoutes());
|
|
16732
|
-
app2.route("/admin/content",
|
|
16733
|
-
app2.route("/admin/media",
|
|
16741
|
+
app2.route("/admin/content", chunkSC2WZFNQ_cjs.admin_content_default);
|
|
16742
|
+
app2.route("/admin/media", chunkSC2WZFNQ_cjs.adminMediaRoutes);
|
|
16734
16743
|
app2.use("/auth/*", securityAuditMiddleware());
|
|
16735
16744
|
if (!config.plugins?.disableAll) {
|
|
16736
|
-
|
|
16745
|
+
chunkLXYDJU6U_cjs.registerPluginRoutes(app2, corePluginsBeforeCatchAll, { source: "core" });
|
|
16737
16746
|
app2.route("/admin/cache", cache_default.getRoutes());
|
|
16738
16747
|
if (config.plugins?.register && config.plugins.register.length > 0) {
|
|
16739
|
-
|
|
16748
|
+
chunkLXYDJU6U_cjs.registerPluginRoutes(app2, config.plugins.register, { source: "user" });
|
|
16740
16749
|
}
|
|
16741
16750
|
}
|
|
16742
16751
|
app2.route("/api/events", apiRoutes4);
|
|
16743
|
-
app2.route("/admin/dashboard",
|
|
16744
|
-
app2.route("/admin/plugins",
|
|
16745
|
-
app2.route("/admin/logs",
|
|
16752
|
+
app2.route("/admin/dashboard", chunkSC2WZFNQ_cjs.router);
|
|
16753
|
+
app2.route("/admin/plugins", chunkSC2WZFNQ_cjs.adminPluginRoutes);
|
|
16754
|
+
app2.route("/admin/logs", chunkSC2WZFNQ_cjs.adminLogsRoutes);
|
|
16746
16755
|
app2.route("/admin/rbac", adminRbacRoutes);
|
|
16747
|
-
app2.route("/admin",
|
|
16748
|
-
app2.route("/auth",
|
|
16756
|
+
app2.route("/admin", chunkSC2WZFNQ_cjs.userRoutes);
|
|
16757
|
+
app2.route("/auth", chunkSC2WZFNQ_cjs.auth_default);
|
|
16749
16758
|
app2.on(["GET", "POST"], "/auth/*", (c) => {
|
|
16750
16759
|
const reqUrl = new URL(c.req.url);
|
|
16751
16760
|
const requestBaseURL = `${reqUrl.protocol}//${reqUrl.host}`;
|
|
16752
16761
|
const auth = chunkKMCLNO4K_cjs.createAuth(c.env, config.auth?.extendBetterAuth, requestBaseURL);
|
|
16753
16762
|
return auth.handler(c.req.raw);
|
|
16754
16763
|
});
|
|
16755
|
-
app2.route("/",
|
|
16764
|
+
app2.route("/", chunkSC2WZFNQ_cjs.test_cleanup_default);
|
|
16756
16765
|
if (!config.plugins?.disableAll) {
|
|
16757
|
-
|
|
16766
|
+
chunkLXYDJU6U_cjs.registerPluginRoutes(app2, corePluginsAfterCatchAll, { source: "core" });
|
|
16758
16767
|
}
|
|
16759
16768
|
if (!config.plugins?.disableAll) {
|
|
16760
16769
|
const allMountedPlugins = [
|
|
@@ -16763,8 +16772,11 @@ function createSonicJSApp(config = {}) {
|
|
|
16763
16772
|
...corePluginsAfterCatchAll,
|
|
16764
16773
|
...config.plugins?.register ?? []
|
|
16765
16774
|
];
|
|
16766
|
-
|
|
16767
|
-
|
|
16775
|
+
const userPlugins = (config.plugins?.register ?? []).filter(
|
|
16776
|
+
(p) => !chunkKZIBF2EV_cjs.PLUGIN_REGISTRY[p.id]
|
|
16777
|
+
);
|
|
16778
|
+
chunkLXYDJU6U_cjs.setPluginMenu(userPlugins.flatMap((p) => p.menu ?? []));
|
|
16779
|
+
chunkKOXFYFOF_cjs.setPluginDefinitions(allMountedPlugins);
|
|
16768
16780
|
}
|
|
16769
16781
|
app2.get("/favicon.svg", (c) => {
|
|
16770
16782
|
return new Response(faviconSvg, {
|
|
@@ -20256,7 +20268,7 @@ function createRedirectApiRoutes() {
|
|
|
20256
20268
|
});
|
|
20257
20269
|
return api;
|
|
20258
20270
|
}
|
|
20259
|
-
var redirectPlugin =
|
|
20271
|
+
var redirectPlugin = chunkKOXFYFOF_cjs.definePlugin({
|
|
20260
20272
|
id: manifest_default3.id,
|
|
20261
20273
|
version: manifest_default3.version,
|
|
20262
20274
|
name: manifest_default3.name,
|
|
@@ -20274,7 +20286,7 @@ var redirectPlugin = chunkPTTFLUEX_cjs.definePlugin({
|
|
|
20274
20286
|
async onBoot(ctx) {
|
|
20275
20287
|
const db = ctx.env?.DB;
|
|
20276
20288
|
if (!db) return;
|
|
20277
|
-
const registry = new
|
|
20289
|
+
const registry = new chunkKMM45BTY_cjs.DocumentTypeRegistry(db);
|
|
20278
20290
|
await registry.register({
|
|
20279
20291
|
id: "redirect",
|
|
20280
20292
|
name: "redirect",
|
|
@@ -20390,87 +20402,91 @@ function createDb(d1$1) {
|
|
|
20390
20402
|
}
|
|
20391
20403
|
|
|
20392
20404
|
// src/index.ts
|
|
20393
|
-
var VERSION =
|
|
20405
|
+
var VERSION = chunk3XFA3E2F_cjs.package_default.version;
|
|
20394
20406
|
|
|
20407
|
+
Object.defineProperty(exports, "DocumentRepository", {
|
|
20408
|
+
enumerable: true,
|
|
20409
|
+
get: function () { return chunkSC2WZFNQ_cjs.DocumentRepository; }
|
|
20410
|
+
});
|
|
20395
20411
|
Object.defineProperty(exports, "ROUTES_INFO", {
|
|
20396
20412
|
enumerable: true,
|
|
20397
|
-
get: function () { return
|
|
20413
|
+
get: function () { return chunkSC2WZFNQ_cjs.ROUTES_INFO; }
|
|
20398
20414
|
});
|
|
20399
20415
|
Object.defineProperty(exports, "adminApiRoutes", {
|
|
20400
20416
|
enumerable: true,
|
|
20401
|
-
get: function () { return
|
|
20417
|
+
get: function () { return chunkSC2WZFNQ_cjs.admin_api_default; }
|
|
20402
20418
|
});
|
|
20403
20419
|
Object.defineProperty(exports, "adminCheckboxRoutes", {
|
|
20404
20420
|
enumerable: true,
|
|
20405
|
-
get: function () { return
|
|
20421
|
+
get: function () { return chunkSC2WZFNQ_cjs.adminCheckboxRoutes; }
|
|
20406
20422
|
});
|
|
20407
20423
|
Object.defineProperty(exports, "adminCollectionsRoutes", {
|
|
20408
20424
|
enumerable: true,
|
|
20409
|
-
get: function () { return
|
|
20425
|
+
get: function () { return chunkSC2WZFNQ_cjs.adminCollectionsRoutes; }
|
|
20410
20426
|
});
|
|
20411
20427
|
Object.defineProperty(exports, "adminContentRoutes", {
|
|
20412
20428
|
enumerable: true,
|
|
20413
|
-
get: function () { return
|
|
20429
|
+
get: function () { return chunkSC2WZFNQ_cjs.admin_content_default; }
|
|
20414
20430
|
});
|
|
20415
20431
|
Object.defineProperty(exports, "adminDashboardRoutes", {
|
|
20416
20432
|
enumerable: true,
|
|
20417
|
-
get: function () { return
|
|
20433
|
+
get: function () { return chunkSC2WZFNQ_cjs.router; }
|
|
20418
20434
|
});
|
|
20419
20435
|
Object.defineProperty(exports, "adminLogsRoutes", {
|
|
20420
20436
|
enumerable: true,
|
|
20421
|
-
get: function () { return
|
|
20437
|
+
get: function () { return chunkSC2WZFNQ_cjs.adminLogsRoutes; }
|
|
20422
20438
|
});
|
|
20423
20439
|
Object.defineProperty(exports, "adminMediaRoutes", {
|
|
20424
20440
|
enumerable: true,
|
|
20425
|
-
get: function () { return
|
|
20441
|
+
get: function () { return chunkSC2WZFNQ_cjs.adminMediaRoutes; }
|
|
20426
20442
|
});
|
|
20427
20443
|
Object.defineProperty(exports, "adminPluginRoutes", {
|
|
20428
20444
|
enumerable: true,
|
|
20429
|
-
get: function () { return
|
|
20445
|
+
get: function () { return chunkSC2WZFNQ_cjs.adminPluginRoutes; }
|
|
20430
20446
|
});
|
|
20431
20447
|
Object.defineProperty(exports, "adminSettingsRoutes", {
|
|
20432
20448
|
enumerable: true,
|
|
20433
|
-
get: function () { return
|
|
20449
|
+
get: function () { return chunkSC2WZFNQ_cjs.adminSettingsRoutes; }
|
|
20434
20450
|
});
|
|
20435
20451
|
Object.defineProperty(exports, "adminUsersRoutes", {
|
|
20436
20452
|
enumerable: true,
|
|
20437
|
-
get: function () { return
|
|
20453
|
+
get: function () { return chunkSC2WZFNQ_cjs.userRoutes; }
|
|
20438
20454
|
});
|
|
20439
20455
|
Object.defineProperty(exports, "apiContentCrudRoutes", {
|
|
20440
20456
|
enumerable: true,
|
|
20441
|
-
get: function () { return
|
|
20457
|
+
get: function () { return chunkSC2WZFNQ_cjs.api_content_crud_default; }
|
|
20442
20458
|
});
|
|
20443
20459
|
Object.defineProperty(exports, "apiMediaRoutes", {
|
|
20444
20460
|
enumerable: true,
|
|
20445
|
-
get: function () { return
|
|
20461
|
+
get: function () { return chunkSC2WZFNQ_cjs.api_media_default; }
|
|
20446
20462
|
});
|
|
20447
20463
|
Object.defineProperty(exports, "apiRoutes", {
|
|
20448
20464
|
enumerable: true,
|
|
20449
|
-
get: function () { return
|
|
20465
|
+
get: function () { return chunkSC2WZFNQ_cjs.api_default; }
|
|
20450
20466
|
});
|
|
20451
20467
|
Object.defineProperty(exports, "apiSystemRoutes", {
|
|
20452
20468
|
enumerable: true,
|
|
20453
|
-
get: function () { return
|
|
20469
|
+
get: function () { return chunkSC2WZFNQ_cjs.api_system_default; }
|
|
20454
20470
|
});
|
|
20455
20471
|
Object.defineProperty(exports, "authRoutes", {
|
|
20456
20472
|
enumerable: true,
|
|
20457
|
-
get: function () { return
|
|
20473
|
+
get: function () { return chunkSC2WZFNQ_cjs.auth_default; }
|
|
20458
20474
|
});
|
|
20459
20475
|
Object.defineProperty(exports, "createUserProfilesPlugin", {
|
|
20460
20476
|
enumerable: true,
|
|
20461
|
-
get: function () { return
|
|
20477
|
+
get: function () { return chunkSC2WZFNQ_cjs.createUserProfilesPlugin; }
|
|
20462
20478
|
});
|
|
20463
20479
|
Object.defineProperty(exports, "defineUserProfile", {
|
|
20464
20480
|
enumerable: true,
|
|
20465
|
-
get: function () { return
|
|
20481
|
+
get: function () { return chunkSC2WZFNQ_cjs.defineUserProfile; }
|
|
20466
20482
|
});
|
|
20467
20483
|
Object.defineProperty(exports, "getUserProfileConfig", {
|
|
20468
20484
|
enumerable: true,
|
|
20469
|
-
get: function () { return
|
|
20485
|
+
get: function () { return chunkSC2WZFNQ_cjs.getUserProfileConfig; }
|
|
20470
20486
|
});
|
|
20471
20487
|
Object.defineProperty(exports, "userProfilesPlugin", {
|
|
20472
20488
|
enumerable: true,
|
|
20473
|
-
get: function () { return
|
|
20489
|
+
get: function () { return chunkSC2WZFNQ_cjs.userProfilesPlugin; }
|
|
20474
20490
|
});
|
|
20475
20491
|
Object.defineProperty(exports, "Logger", {
|
|
20476
20492
|
enumerable: true,
|
|
@@ -20626,87 +20642,91 @@ Object.defineProperty(exports, "workflowHistory", {
|
|
|
20626
20642
|
});
|
|
20627
20643
|
Object.defineProperty(exports, "AuthManager", {
|
|
20628
20644
|
enumerable: true,
|
|
20629
|
-
get: function () { return
|
|
20645
|
+
get: function () { return chunkKMM45BTY_cjs.AuthManager; }
|
|
20630
20646
|
});
|
|
20631
20647
|
Object.defineProperty(exports, "PermissionManager", {
|
|
20632
20648
|
enumerable: true,
|
|
20633
|
-
get: function () { return
|
|
20649
|
+
get: function () { return chunkKMM45BTY_cjs.PermissionManager; }
|
|
20634
20650
|
});
|
|
20635
20651
|
Object.defineProperty(exports, "bootstrapDocumentTypes", {
|
|
20636
20652
|
enumerable: true,
|
|
20637
|
-
get: function () { return
|
|
20653
|
+
get: function () { return chunkKMM45BTY_cjs.bootstrapDocumentTypes; }
|
|
20638
20654
|
});
|
|
20639
20655
|
Object.defineProperty(exports, "bootstrapMiddleware", {
|
|
20640
20656
|
enumerable: true,
|
|
20641
|
-
get: function () { return
|
|
20657
|
+
get: function () { return chunkKMM45BTY_cjs.bootstrapMiddleware; }
|
|
20642
20658
|
});
|
|
20643
20659
|
Object.defineProperty(exports, "cacheHeaders", {
|
|
20644
20660
|
enumerable: true,
|
|
20645
|
-
get: function () { return
|
|
20661
|
+
get: function () { return chunkKMM45BTY_cjs.cacheHeaders; }
|
|
20646
20662
|
});
|
|
20647
20663
|
Object.defineProperty(exports, "compressionMiddleware", {
|
|
20648
20664
|
enumerable: true,
|
|
20649
|
-
get: function () { return
|
|
20665
|
+
get: function () { return chunkKMM45BTY_cjs.compressionMiddleware; }
|
|
20650
20666
|
});
|
|
20651
20667
|
Object.defineProperty(exports, "detailedLoggingMiddleware", {
|
|
20652
20668
|
enumerable: true,
|
|
20653
|
-
get: function () { return
|
|
20669
|
+
get: function () { return chunkKMM45BTY_cjs.detailedLoggingMiddleware; }
|
|
20654
20670
|
});
|
|
20655
20671
|
Object.defineProperty(exports, "getActivePlugins", {
|
|
20656
20672
|
enumerable: true,
|
|
20657
|
-
get: function () { return
|
|
20673
|
+
get: function () { return chunkKMM45BTY_cjs.getActivePlugins; }
|
|
20658
20674
|
});
|
|
20659
20675
|
Object.defineProperty(exports, "isPluginActive", {
|
|
20660
20676
|
enumerable: true,
|
|
20661
|
-
get: function () { return
|
|
20677
|
+
get: function () { return chunkKMM45BTY_cjs.isPluginActive; }
|
|
20662
20678
|
});
|
|
20663
20679
|
Object.defineProperty(exports, "logActivity", {
|
|
20664
20680
|
enumerable: true,
|
|
20665
|
-
get: function () { return
|
|
20681
|
+
get: function () { return chunkKMM45BTY_cjs.logActivity; }
|
|
20666
20682
|
});
|
|
20667
20683
|
Object.defineProperty(exports, "loggingMiddleware", {
|
|
20668
20684
|
enumerable: true,
|
|
20669
|
-
get: function () { return
|
|
20685
|
+
get: function () { return chunkKMM45BTY_cjs.loggingMiddleware; }
|
|
20670
20686
|
});
|
|
20671
20687
|
Object.defineProperty(exports, "optionalAuth", {
|
|
20672
20688
|
enumerable: true,
|
|
20673
|
-
get: function () { return
|
|
20689
|
+
get: function () { return chunkKMM45BTY_cjs.optionalAuth; }
|
|
20674
20690
|
});
|
|
20675
20691
|
Object.defineProperty(exports, "performanceLoggingMiddleware", {
|
|
20676
20692
|
enumerable: true,
|
|
20677
|
-
get: function () { return
|
|
20693
|
+
get: function () { return chunkKMM45BTY_cjs.performanceLoggingMiddleware; }
|
|
20678
20694
|
});
|
|
20679
20695
|
Object.defineProperty(exports, "requireActivePlugin", {
|
|
20680
20696
|
enumerable: true,
|
|
20681
|
-
get: function () { return
|
|
20697
|
+
get: function () { return chunkKMM45BTY_cjs.requireActivePlugin; }
|
|
20682
20698
|
});
|
|
20683
20699
|
Object.defineProperty(exports, "requireActivePlugins", {
|
|
20684
20700
|
enumerable: true,
|
|
20685
|
-
get: function () { return
|
|
20701
|
+
get: function () { return chunkKMM45BTY_cjs.requireActivePlugins; }
|
|
20686
20702
|
});
|
|
20687
20703
|
Object.defineProperty(exports, "requireAnyPermission", {
|
|
20688
20704
|
enumerable: true,
|
|
20689
|
-
get: function () { return
|
|
20705
|
+
get: function () { return chunkKMM45BTY_cjs.requireAnyPermission; }
|
|
20690
20706
|
});
|
|
20691
20707
|
Object.defineProperty(exports, "requireAuth", {
|
|
20692
20708
|
enumerable: true,
|
|
20693
|
-
get: function () { return
|
|
20709
|
+
get: function () { return chunkKMM45BTY_cjs.requireAuth; }
|
|
20694
20710
|
});
|
|
20695
20711
|
Object.defineProperty(exports, "requirePermission", {
|
|
20696
20712
|
enumerable: true,
|
|
20697
|
-
get: function () { return
|
|
20713
|
+
get: function () { return chunkKMM45BTY_cjs.requirePermission; }
|
|
20698
20714
|
});
|
|
20699
20715
|
Object.defineProperty(exports, "requireRole", {
|
|
20700
20716
|
enumerable: true,
|
|
20701
|
-
get: function () { return
|
|
20717
|
+
get: function () { return chunkKMM45BTY_cjs.requireRole; }
|
|
20702
20718
|
});
|
|
20703
20719
|
Object.defineProperty(exports, "securityHeaders", {
|
|
20704
20720
|
enumerable: true,
|
|
20705
|
-
get: function () { return
|
|
20721
|
+
get: function () { return chunkKMM45BTY_cjs.securityHeadersMiddleware; }
|
|
20706
20722
|
});
|
|
20707
20723
|
Object.defineProperty(exports, "securityLoggingMiddleware", {
|
|
20708
20724
|
enumerable: true,
|
|
20709
|
-
get: function () { return
|
|
20725
|
+
get: function () { return chunkKMM45BTY_cjs.securityLoggingMiddleware; }
|
|
20726
|
+
});
|
|
20727
|
+
Object.defineProperty(exports, "DocumentsService", {
|
|
20728
|
+
enumerable: true,
|
|
20729
|
+
get: function () { return chunkW36OZTJ5_cjs.DocumentsService; }
|
|
20710
20730
|
});
|
|
20711
20731
|
Object.defineProperty(exports, "RbacService", {
|
|
20712
20732
|
enumerable: true,
|
|
@@ -20714,35 +20734,35 @@ Object.defineProperty(exports, "RbacService", {
|
|
|
20714
20734
|
});
|
|
20715
20735
|
Object.defineProperty(exports, "PluginBootstrapService", {
|
|
20716
20736
|
enumerable: true,
|
|
20717
|
-
get: function () { return
|
|
20737
|
+
get: function () { return chunkKZIBF2EV_cjs.PluginBootstrapService; }
|
|
20718
20738
|
});
|
|
20719
20739
|
Object.defineProperty(exports, "PluginServiceClass", {
|
|
20720
20740
|
enumerable: true,
|
|
20721
|
-
get: function () { return
|
|
20741
|
+
get: function () { return chunkKZIBF2EV_cjs.PluginService; }
|
|
20722
20742
|
});
|
|
20723
20743
|
Object.defineProperty(exports, "getAvailableCollectionNames", {
|
|
20724
20744
|
enumerable: true,
|
|
20725
|
-
get: function () { return
|
|
20745
|
+
get: function () { return chunkKZIBF2EV_cjs.getAvailableCollectionNames; }
|
|
20726
20746
|
});
|
|
20727
20747
|
Object.defineProperty(exports, "loadCollectionConfig", {
|
|
20728
20748
|
enumerable: true,
|
|
20729
|
-
get: function () { return
|
|
20749
|
+
get: function () { return chunkKZIBF2EV_cjs.loadCollectionConfig; }
|
|
20730
20750
|
});
|
|
20731
20751
|
Object.defineProperty(exports, "loadCollectionConfigs", {
|
|
20732
20752
|
enumerable: true,
|
|
20733
|
-
get: function () { return
|
|
20753
|
+
get: function () { return chunkKZIBF2EV_cjs.loadCollectionConfigs; }
|
|
20734
20754
|
});
|
|
20735
20755
|
Object.defineProperty(exports, "registerCollections", {
|
|
20736
20756
|
enumerable: true,
|
|
20737
|
-
get: function () { return
|
|
20757
|
+
get: function () { return chunkKZIBF2EV_cjs.registerCollections; }
|
|
20738
20758
|
});
|
|
20739
20759
|
Object.defineProperty(exports, "validateCollectionConfig", {
|
|
20740
20760
|
enumerable: true,
|
|
20741
|
-
get: function () { return
|
|
20761
|
+
get: function () { return chunkKZIBF2EV_cjs.validateCollectionConfig; }
|
|
20742
20762
|
});
|
|
20743
20763
|
Object.defineProperty(exports, "MigrationService", {
|
|
20744
20764
|
enumerable: true,
|
|
20745
|
-
get: function () { return
|
|
20765
|
+
get: function () { return chunkIA24HACT_cjs.MigrationService; }
|
|
20746
20766
|
});
|
|
20747
20767
|
Object.defineProperty(exports, "renderFilterBar", {
|
|
20748
20768
|
enumerable: true,
|
|
@@ -20782,99 +20802,99 @@ Object.defineProperty(exports, "renderAdminLayoutCatalyst", {
|
|
|
20782
20802
|
});
|
|
20783
20803
|
Object.defineProperty(exports, "HookSystemImpl", {
|
|
20784
20804
|
enumerable: true,
|
|
20785
|
-
get: function () { return
|
|
20805
|
+
get: function () { return chunkLXYDJU6U_cjs.HookSystemImpl; }
|
|
20786
20806
|
});
|
|
20787
20807
|
Object.defineProperty(exports, "HookUtils", {
|
|
20788
20808
|
enumerable: true,
|
|
20789
|
-
get: function () { return
|
|
20809
|
+
get: function () { return chunkLXYDJU6U_cjs.HookUtils; }
|
|
20790
20810
|
});
|
|
20791
20811
|
Object.defineProperty(exports, "PluginDependencyCycleError", {
|
|
20792
20812
|
enumerable: true,
|
|
20793
|
-
get: function () { return
|
|
20813
|
+
get: function () { return chunkLXYDJU6U_cjs.PluginDependencyCycleError; }
|
|
20794
20814
|
});
|
|
20795
20815
|
Object.defineProperty(exports, "PluginManagerClass", {
|
|
20796
20816
|
enumerable: true,
|
|
20797
|
-
get: function () { return
|
|
20817
|
+
get: function () { return chunkLXYDJU6U_cjs.PluginManager; }
|
|
20798
20818
|
});
|
|
20799
20819
|
Object.defineProperty(exports, "PluginRegistryImpl", {
|
|
20800
20820
|
enumerable: true,
|
|
20801
|
-
get: function () { return
|
|
20821
|
+
get: function () { return chunkLXYDJU6U_cjs.PluginRegistryImpl; }
|
|
20802
20822
|
});
|
|
20803
20823
|
Object.defineProperty(exports, "PluginValidatorClass", {
|
|
20804
20824
|
enumerable: true,
|
|
20805
|
-
get: function () { return
|
|
20825
|
+
get: function () { return chunkLXYDJU6U_cjs.PluginValidator; }
|
|
20806
20826
|
});
|
|
20807
20827
|
Object.defineProperty(exports, "RegisterPluginsError", {
|
|
20808
20828
|
enumerable: true,
|
|
20809
|
-
get: function () { return
|
|
20829
|
+
get: function () { return chunkLXYDJU6U_cjs.RegisterPluginsError; }
|
|
20810
20830
|
});
|
|
20811
20831
|
Object.defineProperty(exports, "ScopedHookSystemClass", {
|
|
20812
20832
|
enumerable: true,
|
|
20813
|
-
get: function () { return
|
|
20833
|
+
get: function () { return chunkLXYDJU6U_cjs.ScopedHookSystem; }
|
|
20814
20834
|
});
|
|
20815
20835
|
Object.defineProperty(exports, "collectCronSchedules", {
|
|
20816
20836
|
enumerable: true,
|
|
20817
|
-
get: function () { return
|
|
20837
|
+
get: function () { return chunkLXYDJU6U_cjs.collectCronSchedules; }
|
|
20818
20838
|
});
|
|
20819
20839
|
Object.defineProperty(exports, "collectCrons", {
|
|
20820
20840
|
enumerable: true,
|
|
20821
|
-
get: function () { return
|
|
20841
|
+
get: function () { return chunkLXYDJU6U_cjs.collectCrons; }
|
|
20822
20842
|
});
|
|
20823
20843
|
Object.defineProperty(exports, "createScheduledHandler", {
|
|
20824
20844
|
enumerable: true,
|
|
20825
|
-
get: function () { return
|
|
20845
|
+
get: function () { return chunkLXYDJU6U_cjs.createScheduledHandler; }
|
|
20826
20846
|
});
|
|
20827
20847
|
Object.defineProperty(exports, "dispatchCronTick", {
|
|
20828
20848
|
enumerable: true,
|
|
20829
|
-
get: function () { return
|
|
20849
|
+
get: function () { return chunkLXYDJU6U_cjs.dispatchCronTick; }
|
|
20830
20850
|
});
|
|
20831
20851
|
Object.defineProperty(exports, "getPluginMenu", {
|
|
20832
20852
|
enumerable: true,
|
|
20833
|
-
get: function () { return
|
|
20853
|
+
get: function () { return chunkLXYDJU6U_cjs.getPluginMenu; }
|
|
20834
20854
|
});
|
|
20835
20855
|
Object.defineProperty(exports, "registerPlugins", {
|
|
20836
20856
|
enumerable: true,
|
|
20837
|
-
get: function () { return
|
|
20857
|
+
get: function () { return chunkLXYDJU6U_cjs.registerPlugins; }
|
|
20838
20858
|
});
|
|
20839
20859
|
Object.defineProperty(exports, "resetPluginMenu", {
|
|
20840
20860
|
enumerable: true,
|
|
20841
|
-
get: function () { return
|
|
20861
|
+
get: function () { return chunkLXYDJU6U_cjs.resetPluginMenu; }
|
|
20842
20862
|
});
|
|
20843
20863
|
Object.defineProperty(exports, "resolvePluginMenuItems", {
|
|
20844
20864
|
enumerable: true,
|
|
20845
|
-
get: function () { return
|
|
20865
|
+
get: function () { return chunkLXYDJU6U_cjs.resolvePluginMenuItems; }
|
|
20846
20866
|
});
|
|
20847
20867
|
Object.defineProperty(exports, "setPluginMenu", {
|
|
20848
20868
|
enumerable: true,
|
|
20849
|
-
get: function () { return
|
|
20869
|
+
get: function () { return chunkLXYDJU6U_cjs.setPluginMenu; }
|
|
20850
20870
|
});
|
|
20851
20871
|
Object.defineProperty(exports, "topoSort", {
|
|
20852
20872
|
enumerable: true,
|
|
20853
|
-
get: function () { return
|
|
20873
|
+
get: function () { return chunkLXYDJU6U_cjs.topoSort; }
|
|
20854
20874
|
});
|
|
20855
20875
|
Object.defineProperty(exports, "applySchemaDefaults", {
|
|
20856
20876
|
enumerable: true,
|
|
20857
|
-
get: function () { return
|
|
20877
|
+
get: function () { return chunkKOXFYFOF_cjs.applySchemaDefaults; }
|
|
20858
20878
|
});
|
|
20859
20879
|
Object.defineProperty(exports, "definePlugin", {
|
|
20860
20880
|
enumerable: true,
|
|
20861
|
-
get: function () { return
|
|
20881
|
+
get: function () { return chunkKOXFYFOF_cjs.definePlugin; }
|
|
20862
20882
|
});
|
|
20863
20883
|
Object.defineProperty(exports, "isDefinedPlugin", {
|
|
20864
20884
|
enumerable: true,
|
|
20865
|
-
get: function () { return
|
|
20885
|
+
get: function () { return chunkKOXFYFOF_cjs.isDefinedPlugin; }
|
|
20866
20886
|
});
|
|
20867
20887
|
Object.defineProperty(exports, "parseConfigSchema", {
|
|
20868
20888
|
enumerable: true,
|
|
20869
|
-
get: function () { return
|
|
20889
|
+
get: function () { return chunkKOXFYFOF_cjs.parseConfigSchema; }
|
|
20870
20890
|
});
|
|
20871
20891
|
Object.defineProperty(exports, "parseFormDataToSettings", {
|
|
20872
20892
|
enumerable: true,
|
|
20873
|
-
get: function () { return
|
|
20893
|
+
get: function () { return chunkKOXFYFOF_cjs.parseFormDataToSettings; }
|
|
20874
20894
|
});
|
|
20875
20895
|
Object.defineProperty(exports, "renderSchemaFields", {
|
|
20876
20896
|
enumerable: true,
|
|
20877
|
-
get: function () { return
|
|
20897
|
+
get: function () { return chunkKOXFYFOF_cjs.renderSchemaFields; }
|
|
20878
20898
|
});
|
|
20879
20899
|
Object.defineProperty(exports, "getHookSystem", {
|
|
20880
20900
|
enumerable: true,
|
|
@@ -20922,11 +20942,11 @@ Object.defineProperty(exports, "metricsTracker", {
|
|
|
20922
20942
|
});
|
|
20923
20943
|
Object.defineProperty(exports, "SONICJS_VERSION", {
|
|
20924
20944
|
enumerable: true,
|
|
20925
|
-
get: function () { return
|
|
20945
|
+
get: function () { return chunk3XFA3E2F_cjs.SONICJS_VERSION; }
|
|
20926
20946
|
});
|
|
20927
20947
|
Object.defineProperty(exports, "getCoreVersion", {
|
|
20928
20948
|
enumerable: true,
|
|
20929
|
-
get: function () { return
|
|
20949
|
+
get: function () { return chunk3XFA3E2F_cjs.getCoreVersion; }
|
|
20930
20950
|
});
|
|
20931
20951
|
Object.defineProperty(exports, "escapeHtml", {
|
|
20932
20952
|
enumerable: true,
|