@sonicjs-cms/core 3.0.0-beta.18 → 3.0.0-beta.19
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-FAADMKJX.cjs → chunk-2DSRS3VA.cjs} +2 -2
- package/dist/{chunk-FAADMKJX.cjs.map → chunk-2DSRS3VA.cjs.map} +1 -1
- package/dist/{chunk-PXWT5OWC.js → chunk-52DAVKDM.js} +2 -2
- package/dist/{chunk-PXWT5OWC.js.map → chunk-52DAVKDM.js.map} +1 -1
- package/dist/{chunk-KCS65CVN.js → chunk-64MTTVX2.js} +4 -4
- package/dist/{chunk-KCS65CVN.js.map → chunk-64MTTVX2.js.map} +1 -1
- package/dist/{chunk-QSDN2CKI.cjs → chunk-EHTBXFTA.cjs} +4 -4
- package/dist/{chunk-QSDN2CKI.cjs.map → chunk-EHTBXFTA.cjs.map} +1 -1
- package/dist/{chunk-ZQLBHD3J.js → chunk-HUDG4GS6.js} +5 -5
- package/dist/{chunk-ZQLBHD3J.js.map → chunk-HUDG4GS6.js.map} +1 -1
- package/dist/{chunk-ETRNDMB2.cjs → chunk-IDMHRCZS.cjs} +2 -2
- package/dist/{chunk-ETRNDMB2.cjs.map → chunk-IDMHRCZS.cjs.map} +1 -1
- package/dist/{chunk-V6EZYAWF.cjs → chunk-JJ6HE4J4.cjs} +202 -202
- package/dist/{chunk-V6EZYAWF.cjs.map → chunk-JJ6HE4J4.cjs.map} +1 -1
- package/dist/{chunk-TAB4XUUP.js → chunk-L6IPQIWU.js} +2 -2
- package/dist/{chunk-TAB4XUUP.js.map → chunk-L6IPQIWU.js.map} +1 -1
- package/dist/{chunk-GY2XWOG3.js → chunk-LGZHS6WW.js} +9 -9
- package/dist/{chunk-GY2XWOG3.js.map → chunk-LGZHS6WW.js.map} +1 -1
- package/dist/{chunk-E6LGR24C.cjs → chunk-NZF3THNY.cjs} +3 -3
- package/dist/{chunk-E6LGR24C.cjs.map → chunk-NZF3THNY.cjs.map} +1 -1
- package/dist/{chunk-BCE6XJYG.js → chunk-OJHJ4I34.js} +3 -3
- package/dist/{chunk-BCE6XJYG.js.map → chunk-OJHJ4I34.js.map} +1 -1
- package/dist/{chunk-6Z7MZDDF.js → chunk-PMEV7CWP.js} +3 -3
- package/dist/{chunk-6Z7MZDDF.js.map → chunk-PMEV7CWP.js.map} +1 -1
- package/dist/{chunk-NOT5YX23.cjs → chunk-SYAUCKSD.cjs} +15 -15
- package/dist/{chunk-NOT5YX23.cjs.map → chunk-SYAUCKSD.cjs.map} +1 -1
- package/dist/{chunk-BUMHSDRW.cjs → chunk-YS5S47VV.cjs} +10 -10
- package/dist/{chunk-BUMHSDRW.cjs.map → chunk-YS5S47VV.cjs.map} +1 -1
- package/dist/index.cjs +259 -259
- package/dist/index.js +13 -13
- package/dist/middleware.cjs +33 -33
- package/dist/middleware.js +4 -4
- package/dist/migrations-HUR2YY4Q.js +4 -0
- package/dist/{migrations-KFRAQ4CE.js.map → migrations-HUR2YY4Q.js.map} +1 -1
- package/dist/migrations-RYH2MGG4.cjs +13 -0
- package/dist/{migrations-GN6H36JS.cjs.map → migrations-RYH2MGG4.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/migrations-GN6H36JS.cjs +0 -13
- package/dist/migrations-KFRAQ4CE.js +0 -4
package/dist/index.cjs
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkGMMCCIQO_cjs = require('./chunk-GMMCCIQO.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkJJ6HE4J4_cjs = require('./chunk-JJ6HE4J4.cjs');
|
|
5
5
|
require('./chunk-XWVDSM2L.cjs');
|
|
6
6
|
require('./chunk-N32OWET6.cjs');
|
|
7
7
|
var chunk36Z3AKX3_cjs = require('./chunk-36Z3AKX3.cjs');
|
|
8
8
|
var chunkYA3TJ65D_cjs = require('./chunk-YA3TJ65D.cjs');
|
|
9
9
|
var chunkYP7GW2G5_cjs = require('./chunk-YP7GW2G5.cjs');
|
|
10
|
-
var
|
|
10
|
+
var chunkSYAUCKSD_cjs = require('./chunk-SYAUCKSD.cjs');
|
|
11
11
|
var chunkLTZ5WYOK_cjs = require('./chunk-LTZ5WYOK.cjs');
|
|
12
12
|
var chunkKIGVVO6N_cjs = require('./chunk-KIGVVO6N.cjs');
|
|
13
|
-
var
|
|
14
|
-
var
|
|
13
|
+
var chunk2DSRS3VA_cjs = require('./chunk-2DSRS3VA.cjs');
|
|
14
|
+
var chunkIDMHRCZS_cjs = require('./chunk-IDMHRCZS.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 chunkYS5S47VV_cjs = require('./chunk-YS5S47VV.cjs');
|
|
19
|
+
var chunkEHTBXFTA_cjs = require('./chunk-EHTBXFTA.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 chunkNZF3THNY_cjs = require('./chunk-NZF3THNY.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');
|
|
@@ -575,7 +575,7 @@ function formatCellValue(value) {
|
|
|
575
575
|
// src/plugins/core-plugins/database-tools-plugin/admin-routes.ts
|
|
576
576
|
function createDatabaseToolsAdminRoutes() {
|
|
577
577
|
const router3 = new hono.Hono();
|
|
578
|
-
router3.use("*",
|
|
578
|
+
router3.use("*", chunkSYAUCKSD_cjs.requireAuth());
|
|
579
579
|
router3.get("/api/stats", async (c) => {
|
|
580
580
|
try {
|
|
581
581
|
const user = c.get("user");
|
|
@@ -981,7 +981,7 @@ var SiteConfigService = class {
|
|
|
981
981
|
|
|
982
982
|
// src/plugins/core-plugins/email-plugin/routes/admin.ts
|
|
983
983
|
var adminRoutes = new hono.Hono();
|
|
984
|
-
adminRoutes.use("*",
|
|
984
|
+
adminRoutes.use("*", chunkSYAUCKSD_cjs.requireAuth());
|
|
985
985
|
adminRoutes.post("/settings", async (c) => {
|
|
986
986
|
if (c.get("user")?.role !== "admin") {
|
|
987
987
|
return c.json({ error: "admin role required" }, 403);
|
|
@@ -1019,7 +1019,7 @@ adminRoutes.post("/test", async (c) => {
|
|
|
1019
1019
|
const { subject, html: html4, text } = renderTestEmail({ siteName });
|
|
1020
1020
|
try {
|
|
1021
1021
|
const settingsLoaded = await settings.load();
|
|
1022
|
-
const result = await
|
|
1022
|
+
const result = await chunkJJ6HE4J4_cjs.getEmailService().send({
|
|
1023
1023
|
to,
|
|
1024
1024
|
subject,
|
|
1025
1025
|
html: html4,
|
|
@@ -1101,7 +1101,7 @@ function makeOnRegistrationCompleted(env) {
|
|
|
1101
1101
|
siteName,
|
|
1102
1102
|
loginUrl: siteConfig.buildLoginUrl(siteUrl)
|
|
1103
1103
|
});
|
|
1104
|
-
const result = await
|
|
1104
|
+
const result = await chunkJJ6HE4J4_cjs.getEmailService().send({
|
|
1105
1105
|
to: user.email,
|
|
1106
1106
|
subject,
|
|
1107
1107
|
html: html4,
|
|
@@ -1175,7 +1175,7 @@ function makeOnPasswordResetRequested(env) {
|
|
|
1175
1175
|
expiresAt: Date.now() + DEFAULT_EXPIRY_MS,
|
|
1176
1176
|
siteName
|
|
1177
1177
|
});
|
|
1178
|
-
const result = await
|
|
1178
|
+
const result = await chunkJJ6HE4J4_cjs.getEmailService().send({
|
|
1179
1179
|
to: user.email,
|
|
1180
1180
|
subject,
|
|
1181
1181
|
html: html4,
|
|
@@ -1243,7 +1243,7 @@ function makeOnPasswordResetCompleted(env) {
|
|
|
1243
1243
|
supportEmail,
|
|
1244
1244
|
when: Date.now()
|
|
1245
1245
|
});
|
|
1246
|
-
const result = await
|
|
1246
|
+
const result = await chunkJJ6HE4J4_cjs.getEmailService().send({
|
|
1247
1247
|
to: user.email,
|
|
1248
1248
|
subject,
|
|
1249
1249
|
html: html4,
|
|
@@ -1984,7 +1984,7 @@ var CloudflareEmailProvider = class {
|
|
|
1984
1984
|
}
|
|
1985
1985
|
}
|
|
1986
1986
|
};
|
|
1987
|
-
var emailPluginV3 =
|
|
1987
|
+
var emailPluginV3 = chunkEHTBXFTA_cjs.definePlugin({
|
|
1988
1988
|
id: "email",
|
|
1989
1989
|
version: "1.0.0",
|
|
1990
1990
|
name: "Email",
|
|
@@ -1998,7 +1998,7 @@ var emailPluginV3 = chunkQSDN2CKI_cjs.definePlugin({
|
|
|
1998
1998
|
const db = env.DB;
|
|
1999
1999
|
if (db) {
|
|
2000
2000
|
try {
|
|
2001
|
-
const typeRegistry = new
|
|
2001
|
+
const typeRegistry = new chunkSYAUCKSD_cjs.DocumentTypeRegistry(db);
|
|
2002
2002
|
await typeRegistry.register({
|
|
2003
2003
|
id: "email_log",
|
|
2004
2004
|
name: "email_log",
|
|
@@ -2013,7 +2013,7 @@ var emailPluginV3 = chunkQSDN2CKI_cjs.definePlugin({
|
|
|
2013
2013
|
} catch {
|
|
2014
2014
|
}
|
|
2015
2015
|
}
|
|
2016
|
-
if (!
|
|
2016
|
+
if (!chunkJJ6HE4J4_cjs.hasEmailService()) {
|
|
2017
2017
|
const settings = db ? await new EmailSettingsService(db).load() : {};
|
|
2018
2018
|
const envResendKey = typeof env.RESEND_API_KEY === "string" && env.RESEND_API_KEY ? env.RESEND_API_KEY : void 0;
|
|
2019
2019
|
const cfEmailBinding = env.EMAIL;
|
|
@@ -2031,7 +2031,7 @@ var emailPluginV3 = chunkQSDN2CKI_cjs.definePlugin({
|
|
|
2031
2031
|
} else {
|
|
2032
2032
|
provider = resolveEmailProvider({ env });
|
|
2033
2033
|
}
|
|
2034
|
-
|
|
2034
|
+
chunkJJ6HE4J4_cjs.setEmailService(new EmailService({ ...serviceOpts, provider }));
|
|
2035
2035
|
}
|
|
2036
2036
|
ctx.hooks.on("auth:registration:completed", makeOnRegistrationCompleted(env));
|
|
2037
2037
|
ctx.hooks.on("auth:password-reset:requested", makeOnPasswordResetRequested(env));
|
|
@@ -2042,7 +2042,7 @@ var emailPluginV3 = chunkQSDN2CKI_cjs.definePlugin({
|
|
|
2042
2042
|
var BATCH_SIZE = 100;
|
|
2043
2043
|
({
|
|
2044
2044
|
schema: zod.z.record(zod.z.string(), zod.z.unknown())});
|
|
2045
|
-
var emailReconciliationPlugin =
|
|
2045
|
+
var emailReconciliationPlugin = chunkEHTBXFTA_cjs.definePlugin({
|
|
2046
2046
|
id: "email-reconciliation",
|
|
2047
2047
|
version: "1.0.0",
|
|
2048
2048
|
description: "Hourly cron that backfills email delivery state from provider status APIs. Only active for providers that implement EmailProvider.reconcile().",
|
|
@@ -2063,11 +2063,11 @@ var emailReconciliationPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
|
2063
2063
|
console.warn("[email-reconciliation] No DB binding in cron env \u2014 skipping.");
|
|
2064
2064
|
return;
|
|
2065
2065
|
}
|
|
2066
|
-
if (!
|
|
2066
|
+
if (!chunkJJ6HE4J4_cjs.hasEmailService()) {
|
|
2067
2067
|
console.warn("[email-reconciliation] EmailService not initialized \u2014 skipping.");
|
|
2068
2068
|
return;
|
|
2069
2069
|
}
|
|
2070
|
-
const emailService =
|
|
2070
|
+
const emailService = chunkJJ6HE4J4_cjs.getEmailService();
|
|
2071
2071
|
let rows = [];
|
|
2072
2072
|
try {
|
|
2073
2073
|
const result = await db.prepare(
|
|
@@ -2554,8 +2554,8 @@ function buildOtpApi() {
|
|
|
2554
2554
|
loginUrl: settings.loginUrl || "",
|
|
2555
2555
|
loginButtonText: settings.loginButtonText || ""
|
|
2556
2556
|
});
|
|
2557
|
-
if (
|
|
2558
|
-
const sent = await
|
|
2557
|
+
if (chunkJJ6HE4J4_cjs.hasEmailService()) {
|
|
2558
|
+
const sent = await chunkJJ6HE4J4_cjs.getEmailService().send({
|
|
2559
2559
|
to: normalizedEmail,
|
|
2560
2560
|
subject: `Your login code for ${siteName}`,
|
|
2561
2561
|
flow: "otp",
|
|
@@ -2657,21 +2657,21 @@ function buildOtpApi() {
|
|
|
2657
2657
|
error: "Account is deactivated"
|
|
2658
2658
|
}, 403);
|
|
2659
2659
|
}
|
|
2660
|
-
const tokenTtl = await
|
|
2661
|
-
const token = await
|
|
2660
|
+
const tokenTtl = await chunkSYAUCKSD_cjs.getJwtExpirySecondsFromDb(db, c.env);
|
|
2661
|
+
const token = await chunkSYAUCKSD_cjs.AuthManager.generateToken(user.id, user.email, user.role, c.env.JWT_SECRET, tokenTtl);
|
|
2662
2662
|
cookie.setCookie(c, "auth_token", token, {
|
|
2663
2663
|
httpOnly: true,
|
|
2664
2664
|
secure: true,
|
|
2665
2665
|
sameSite: "Strict",
|
|
2666
2666
|
maxAge: tokenTtl
|
|
2667
2667
|
});
|
|
2668
|
-
|
|
2668
|
+
chunkJJ6HE4J4_cjs.dispatchHookEvent(
|
|
2669
2669
|
c,
|
|
2670
2670
|
"auth:otp:verified",
|
|
2671
2671
|
{ user: { id: user.id, email: user.email, role: user.role } },
|
|
2672
2672
|
"fire-and-forget"
|
|
2673
2673
|
);
|
|
2674
|
-
const customData = await
|
|
2674
|
+
const customData = await chunkJJ6HE4J4_cjs.getCustomData(db, user.id);
|
|
2675
2675
|
const { is_active: _isActive, ...publicUser } = user;
|
|
2676
2676
|
return c.json({
|
|
2677
2677
|
success: true,
|
|
@@ -2716,7 +2716,7 @@ function buildOtpApi() {
|
|
|
2716
2716
|
});
|
|
2717
2717
|
return otpAPI;
|
|
2718
2718
|
}
|
|
2719
|
-
var otpLoginPlugin =
|
|
2719
|
+
var otpLoginPlugin = chunkEHTBXFTA_cjs.definePlugin({
|
|
2720
2720
|
id: "otp-login",
|
|
2721
2721
|
version: "1.0.0",
|
|
2722
2722
|
name: "OTP Login",
|
|
@@ -3114,15 +3114,15 @@ function buildOauthApi() {
|
|
|
3114
3114
|
if (!user || !user.is_active) {
|
|
3115
3115
|
return c.redirect("/auth/login?error=Account is deactivated");
|
|
3116
3116
|
}
|
|
3117
|
-
const tokenTtl2 = await
|
|
3118
|
-
const jwt2 = await
|
|
3117
|
+
const tokenTtl2 = await chunkSYAUCKSD_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
|
|
3118
|
+
const jwt2 = await chunkSYAUCKSD_cjs.AuthManager.generateToken(
|
|
3119
3119
|
user.id,
|
|
3120
3120
|
user.email,
|
|
3121
3121
|
user.role,
|
|
3122
3122
|
c.env.JWT_SECRET,
|
|
3123
3123
|
tokenTtl2
|
|
3124
3124
|
);
|
|
3125
|
-
|
|
3125
|
+
chunkSYAUCKSD_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
|
|
3126
3126
|
return c.redirect("/admin");
|
|
3127
3127
|
}
|
|
3128
3128
|
const existingUser = await oauthService.findUserByEmail(profile.email);
|
|
@@ -3139,15 +3139,15 @@ function buildOauthApi() {
|
|
|
3139
3139
|
tokenExpiresAt: tokenExpiresAt ?? void 0,
|
|
3140
3140
|
profileData: JSON.stringify(profile)
|
|
3141
3141
|
});
|
|
3142
|
-
const tokenTtl2 = await
|
|
3143
|
-
const jwt2 = await
|
|
3142
|
+
const tokenTtl2 = await chunkSYAUCKSD_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
|
|
3143
|
+
const jwt2 = await chunkSYAUCKSD_cjs.AuthManager.generateToken(
|
|
3144
3144
|
existingUser.id,
|
|
3145
3145
|
existingUser.email,
|
|
3146
3146
|
existingUser.role,
|
|
3147
3147
|
c.env.JWT_SECRET,
|
|
3148
3148
|
tokenTtl2
|
|
3149
3149
|
);
|
|
3150
|
-
|
|
3150
|
+
chunkSYAUCKSD_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
|
|
3151
3151
|
return c.redirect("/admin");
|
|
3152
3152
|
}
|
|
3153
3153
|
const newUserId = await oauthService.createUserFromOAuth(profile);
|
|
@@ -3160,15 +3160,15 @@ function buildOauthApi() {
|
|
|
3160
3160
|
tokenExpiresAt: tokenExpiresAt ?? void 0,
|
|
3161
3161
|
profileData: JSON.stringify(profile)
|
|
3162
3162
|
});
|
|
3163
|
-
const tokenTtl = await
|
|
3164
|
-
const jwt = await
|
|
3163
|
+
const tokenTtl = await chunkSYAUCKSD_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
|
|
3164
|
+
const jwt = await chunkSYAUCKSD_cjs.AuthManager.generateToken(
|
|
3165
3165
|
newUserId,
|
|
3166
3166
|
profile.email.toLowerCase(),
|
|
3167
3167
|
"viewer",
|
|
3168
3168
|
c.env.JWT_SECRET,
|
|
3169
3169
|
tokenTtl
|
|
3170
3170
|
);
|
|
3171
|
-
|
|
3171
|
+
chunkSYAUCKSD_cjs.AuthManager.setAuthCookie(c, jwt, { sameSite: "Lax", maxAge: tokenTtl });
|
|
3172
3172
|
return c.redirect("/admin");
|
|
3173
3173
|
} catch (error) {
|
|
3174
3174
|
console.error("OAuth callback error:", error);
|
|
@@ -3263,7 +3263,7 @@ function buildOauthApi() {
|
|
|
3263
3263
|
});
|
|
3264
3264
|
return oauthAPI;
|
|
3265
3265
|
}
|
|
3266
|
-
var oauthProvidersPlugin =
|
|
3266
|
+
var oauthProvidersPlugin = chunkEHTBXFTA_cjs.definePlugin({
|
|
3267
3267
|
id: "oauth-providers",
|
|
3268
3268
|
version: "1.0.0",
|
|
3269
3269
|
name: "OAuth Providers",
|
|
@@ -3847,7 +3847,7 @@ var AISearchService = class {
|
|
|
3847
3847
|
*/
|
|
3848
3848
|
async detectNewCollections() {
|
|
3849
3849
|
try {
|
|
3850
|
-
const allCollections =
|
|
3850
|
+
const allCollections = chunk2DSRS3VA_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => ({
|
|
3851
3851
|
id: r.id,
|
|
3852
3852
|
name: r.name,
|
|
3853
3853
|
display_name: r.displayName,
|
|
@@ -3899,7 +3899,7 @@ var AISearchService = class {
|
|
|
3899
3899
|
*/
|
|
3900
3900
|
async getAllCollections() {
|
|
3901
3901
|
try {
|
|
3902
|
-
const allCollections =
|
|
3902
|
+
const allCollections = chunk2DSRS3VA_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).sort((a, b) => a.displayName.localeCompare(b.displayName)).map((r) => ({
|
|
3903
3903
|
id: r.id,
|
|
3904
3904
|
name: r.name,
|
|
3905
3905
|
display_name: r.displayName,
|
|
@@ -4238,7 +4238,7 @@ var IndexManager = class {
|
|
|
4238
4238
|
*/
|
|
4239
4239
|
async indexCollection(collectionId) {
|
|
4240
4240
|
try {
|
|
4241
|
-
const registry =
|
|
4241
|
+
const registry = chunk2DSRS3VA_cjs.getCollectionRegistry();
|
|
4242
4242
|
const record = registry.getById(collectionId) ?? registry.getByName(collectionId);
|
|
4243
4243
|
if (!record) {
|
|
4244
4244
|
throw new Error(`Collection ${collectionId} not found`);
|
|
@@ -4865,7 +4865,7 @@ function renderSettingsPage(data) {
|
|
|
4865
4865
|
|
|
4866
4866
|
// src/plugins/core-plugins/ai-search-plugin/routes/admin.ts
|
|
4867
4867
|
var adminRoutes2 = new hono.Hono();
|
|
4868
|
-
adminRoutes2.use("*",
|
|
4868
|
+
adminRoutes2.use("*", chunkSYAUCKSD_cjs.requireAuth());
|
|
4869
4869
|
adminRoutes2.get("/", async (c) => {
|
|
4870
4870
|
try {
|
|
4871
4871
|
const user = c.get("user");
|
|
@@ -5106,7 +5106,7 @@ var manifest_default = {
|
|
|
5106
5106
|
author: "SonicJS"};
|
|
5107
5107
|
|
|
5108
5108
|
// src/plugins/core-plugins/ai-search-plugin/index.ts
|
|
5109
|
-
var aiSearchPlugin =
|
|
5109
|
+
var aiSearchPlugin = chunkEHTBXFTA_cjs.definePlugin({
|
|
5110
5110
|
id: manifest_default.id,
|
|
5111
5111
|
version: manifest_default.version,
|
|
5112
5112
|
name: manifest_default.name,
|
|
@@ -5979,7 +5979,7 @@ function renderSecuritySettingsPage(data) {
|
|
|
5979
5979
|
|
|
5980
5980
|
// src/plugins/core-plugins/security-audit-plugin/routes/admin.ts
|
|
5981
5981
|
var adminRoutes3 = new hono.Hono();
|
|
5982
|
-
adminRoutes3.use("*",
|
|
5982
|
+
adminRoutes3.use("*", chunkSYAUCKSD_cjs.requireAuth());
|
|
5983
5983
|
adminRoutes3.use("*", async (c, next) => {
|
|
5984
5984
|
const user = c.get("user");
|
|
5985
5985
|
if (user?.role !== "admin") {
|
|
@@ -5989,7 +5989,7 @@ adminRoutes3.use("*", async (c, next) => {
|
|
|
5989
5989
|
});
|
|
5990
5990
|
async function getSettings(db) {
|
|
5991
5991
|
try {
|
|
5992
|
-
const pluginService = new
|
|
5992
|
+
const pluginService = new chunk2DSRS3VA_cjs.PluginService(db);
|
|
5993
5993
|
const plugin2 = await pluginService.getPlugin("security-audit");
|
|
5994
5994
|
if (plugin2?.settings) {
|
|
5995
5995
|
const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
@@ -6094,7 +6094,7 @@ adminRoutes3.post("/settings", async (c) => {
|
|
|
6094
6094
|
autoPurge: body["retention.autoPurge"] === "true"
|
|
6095
6095
|
}
|
|
6096
6096
|
};
|
|
6097
|
-
const pluginService = new
|
|
6097
|
+
const pluginService = new chunk2DSRS3VA_cjs.PluginService(db);
|
|
6098
6098
|
await pluginService.updatePluginSettings("security-audit", settings);
|
|
6099
6099
|
if (c.req.header("HX-Request")) {
|
|
6100
6100
|
return c.json({ success: true });
|
|
@@ -6256,7 +6256,7 @@ var BruteForceDetector = class {
|
|
|
6256
6256
|
|
|
6257
6257
|
// src/plugins/core-plugins/security-audit-plugin/routes/api.ts
|
|
6258
6258
|
var apiRoutes2 = new hono.Hono();
|
|
6259
|
-
apiRoutes2.use("*",
|
|
6259
|
+
apiRoutes2.use("*", chunkSYAUCKSD_cjs.requireAuth());
|
|
6260
6260
|
apiRoutes2.use("*", async (c, next) => {
|
|
6261
6261
|
const user = c.get("user");
|
|
6262
6262
|
if (user?.role !== "admin") {
|
|
@@ -6266,7 +6266,7 @@ apiRoutes2.use("*", async (c, next) => {
|
|
|
6266
6266
|
});
|
|
6267
6267
|
async function getSettings2(db) {
|
|
6268
6268
|
try {
|
|
6269
|
-
const pluginService = new
|
|
6269
|
+
const pluginService = new chunk2DSRS3VA_cjs.PluginService(db);
|
|
6270
6270
|
const plugin2 = await pluginService.getPlugin("security-audit");
|
|
6271
6271
|
if (plugin2?.settings) {
|
|
6272
6272
|
const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
@@ -6414,7 +6414,7 @@ function generateFingerprint(ip, userAgent) {
|
|
|
6414
6414
|
}
|
|
6415
6415
|
async function getPluginSettings(db) {
|
|
6416
6416
|
try {
|
|
6417
|
-
const pluginService = new
|
|
6417
|
+
const pluginService = new chunk2DSRS3VA_cjs.PluginService(db);
|
|
6418
6418
|
const plugin2 = await pluginService.getPlugin("security-audit");
|
|
6419
6419
|
if (plugin2?.settings) {
|
|
6420
6420
|
const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
@@ -6645,7 +6645,7 @@ async function logAuthEvent(c, db, settings, ip, userAgent, countryCode, fingerp
|
|
|
6645
6645
|
|
|
6646
6646
|
// src/plugins/core-plugins/security-audit-plugin/index.ts
|
|
6647
6647
|
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>`;
|
|
6648
|
-
var securityAuditPlugin =
|
|
6648
|
+
var securityAuditPlugin = chunkEHTBXFTA_cjs.definePlugin({
|
|
6649
6649
|
id: "security-audit",
|
|
6650
6650
|
version: "1.0.0",
|
|
6651
6651
|
name: "Security Audit",
|
|
@@ -6721,7 +6721,7 @@ var ApiKeyService = class {
|
|
|
6721
6721
|
const prefix = secret.slice(0, DISPLAY_PREFIX_LEN);
|
|
6722
6722
|
const expiresAt = input.expiresAt ?? null;
|
|
6723
6723
|
const doc = await this.docService().create(
|
|
6724
|
-
|
|
6724
|
+
chunkJJ6HE4J4_cjs.createDocumentSchema.parse({
|
|
6725
6725
|
typeId: "api_key",
|
|
6726
6726
|
tenantId: this.tenantId,
|
|
6727
6727
|
title: name,
|
|
@@ -6991,7 +6991,7 @@ var createSchema = zod.z.object({
|
|
|
6991
6991
|
});
|
|
6992
6992
|
async function getSettings3(db) {
|
|
6993
6993
|
try {
|
|
6994
|
-
const plugin2 = await new
|
|
6994
|
+
const plugin2 = await new chunk2DSRS3VA_cjs.PluginService(db).getPlugin("api-keys");
|
|
6995
6995
|
if (plugin2?.settings) {
|
|
6996
6996
|
const s = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
6997
6997
|
return { ...DEFAULT_SETTINGS3, ...s };
|
|
@@ -7000,7 +7000,7 @@ async function getSettings3(db) {
|
|
|
7000
7000
|
}
|
|
7001
7001
|
return DEFAULT_SETTINGS3;
|
|
7002
7002
|
}
|
|
7003
|
-
adminRoutes4.use("*",
|
|
7003
|
+
adminRoutes4.use("*", chunkSYAUCKSD_cjs.requireAuth());
|
|
7004
7004
|
adminRoutes4.use("*", async (c, next) => {
|
|
7005
7005
|
const user = c.get("user");
|
|
7006
7006
|
if (user?.role !== "admin") {
|
|
@@ -7085,7 +7085,7 @@ function apiKeyAuthMiddleware() {
|
|
|
7085
7085
|
|
|
7086
7086
|
// src/plugins/core-plugins/api-keys-plugin/index.ts
|
|
7087
7087
|
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>`;
|
|
7088
|
-
var apiKeysPlugin =
|
|
7088
|
+
var apiKeysPlugin = chunkEHTBXFTA_cjs.definePlugin({
|
|
7089
7089
|
id: "api-keys",
|
|
7090
7090
|
version: "1.0.0-beta.1",
|
|
7091
7091
|
name: "API Keys",
|
|
@@ -7856,7 +7856,7 @@ var DEFAULT_SETTINGS4 = {
|
|
|
7856
7856
|
|
|
7857
7857
|
// src/plugins/core-plugins/stripe-plugin/routes/admin.ts
|
|
7858
7858
|
var adminRoutes5 = new hono.Hono();
|
|
7859
|
-
adminRoutes5.use("*",
|
|
7859
|
+
adminRoutes5.use("*", chunkSYAUCKSD_cjs.requireAuth());
|
|
7860
7860
|
adminRoutes5.use("*", async (c, next) => {
|
|
7861
7861
|
const user = c.get("user");
|
|
7862
7862
|
if (user?.role !== "admin") {
|
|
@@ -7866,7 +7866,7 @@ adminRoutes5.use("*", async (c, next) => {
|
|
|
7866
7866
|
});
|
|
7867
7867
|
async function getSettings4(db) {
|
|
7868
7868
|
try {
|
|
7869
|
-
const pluginService = new
|
|
7869
|
+
const pluginService = new chunk2DSRS3VA_cjs.PluginService(db);
|
|
7870
7870
|
const plugin2 = await pluginService.getPlugin("stripe");
|
|
7871
7871
|
if (plugin2?.settings) {
|
|
7872
7872
|
const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
@@ -8189,7 +8189,7 @@ function timingSafeEqual(a, b) {
|
|
|
8189
8189
|
var apiRoutes3 = new hono.Hono();
|
|
8190
8190
|
async function getSettings5(db) {
|
|
8191
8191
|
try {
|
|
8192
|
-
const pluginService = new
|
|
8192
|
+
const pluginService = new chunk2DSRS3VA_cjs.PluginService(db);
|
|
8193
8193
|
const plugin2 = await pluginService.getPlugin("stripe");
|
|
8194
8194
|
if (plugin2?.settings) {
|
|
8195
8195
|
const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
@@ -8340,7 +8340,7 @@ apiRoutes3.post("/webhook", async (c) => {
|
|
|
8340
8340
|
}
|
|
8341
8341
|
return c.json({ received: true });
|
|
8342
8342
|
});
|
|
8343
|
-
apiRoutes3.post("/create-checkout-session",
|
|
8343
|
+
apiRoutes3.post("/create-checkout-session", chunkSYAUCKSD_cjs.requireAuth(), async (c) => {
|
|
8344
8344
|
const db = c.env.DB;
|
|
8345
8345
|
const user = c.get("user");
|
|
8346
8346
|
if (!user) return c.json({ error: "Unauthorized" }, 401);
|
|
@@ -8380,7 +8380,7 @@ apiRoutes3.post("/create-checkout-session", chunkNOT5YX23_cjs.requireAuth(), asy
|
|
|
8380
8380
|
});
|
|
8381
8381
|
return c.json({ sessionId: session.id, url: session.url });
|
|
8382
8382
|
});
|
|
8383
|
-
apiRoutes3.get("/subscription",
|
|
8383
|
+
apiRoutes3.get("/subscription", chunkSYAUCKSD_cjs.requireAuth(), async (c) => {
|
|
8384
8384
|
const user = c.get("user");
|
|
8385
8385
|
if (!user) return c.json({ error: "Unauthorized" }, 401);
|
|
8386
8386
|
const db = c.env.DB;
|
|
@@ -8392,7 +8392,7 @@ apiRoutes3.get("/subscription", chunkNOT5YX23_cjs.requireAuth(), async (c) => {
|
|
|
8392
8392
|
}
|
|
8393
8393
|
return c.json({ subscription });
|
|
8394
8394
|
});
|
|
8395
|
-
apiRoutes3.get("/subscriptions",
|
|
8395
|
+
apiRoutes3.get("/subscriptions", chunkSYAUCKSD_cjs.requireAuth(), async (c) => {
|
|
8396
8396
|
const user = c.get("user");
|
|
8397
8397
|
if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
|
|
8398
8398
|
const db = c.env.DB;
|
|
@@ -8408,7 +8408,7 @@ apiRoutes3.get("/subscriptions", chunkNOT5YX23_cjs.requireAuth(), async (c) => {
|
|
|
8408
8408
|
const result = await subscriptionService.list(filters);
|
|
8409
8409
|
return c.json(result);
|
|
8410
8410
|
});
|
|
8411
|
-
apiRoutes3.get("/stats",
|
|
8411
|
+
apiRoutes3.get("/stats", chunkSYAUCKSD_cjs.requireAuth(), async (c) => {
|
|
8412
8412
|
const user = c.get("user");
|
|
8413
8413
|
if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
|
|
8414
8414
|
const db = c.env.DB;
|
|
@@ -8417,7 +8417,7 @@ apiRoutes3.get("/stats", chunkNOT5YX23_cjs.requireAuth(), async (c) => {
|
|
|
8417
8417
|
const stats = await subscriptionService.getStats();
|
|
8418
8418
|
return c.json(stats);
|
|
8419
8419
|
});
|
|
8420
|
-
apiRoutes3.post("/sync-subscriptions",
|
|
8420
|
+
apiRoutes3.post("/sync-subscriptions", chunkSYAUCKSD_cjs.requireAuth(), async (c) => {
|
|
8421
8421
|
const user = c.get("user");
|
|
8422
8422
|
if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
|
|
8423
8423
|
const db = c.env.DB;
|
|
@@ -8465,7 +8465,7 @@ apiRoutes3.post("/sync-subscriptions", chunkNOT5YX23_cjs.requireAuth(), async (c
|
|
|
8465
8465
|
}, 500);
|
|
8466
8466
|
}
|
|
8467
8467
|
});
|
|
8468
|
-
apiRoutes3.get("/events",
|
|
8468
|
+
apiRoutes3.get("/events", chunkSYAUCKSD_cjs.requireAuth(), async (c) => {
|
|
8469
8469
|
const user = c.get("user");
|
|
8470
8470
|
if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
|
|
8471
8471
|
const db = c.env.DB;
|
|
@@ -8488,7 +8488,7 @@ apiRoutes3.get("/events", chunkNOT5YX23_cjs.requireAuth(), async (c) => {
|
|
|
8488
8488
|
|
|
8489
8489
|
// src/plugins/core-plugins/stripe-plugin/index.ts
|
|
8490
8490
|
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>`;
|
|
8491
|
-
var stripePlugin =
|
|
8491
|
+
var stripePlugin = chunkEHTBXFTA_cjs.definePlugin({
|
|
8492
8492
|
id: "stripe",
|
|
8493
8493
|
version: "1.0.0",
|
|
8494
8494
|
name: "Stripe",
|
|
@@ -8761,7 +8761,7 @@ function renderFormsListPage(data) {
|
|
|
8761
8761
|
|
|
8762
8762
|
<!-- Forms Table -->
|
|
8763
8763
|
<div class="bg-white dark:bg-zinc-900 rounded-lg border border-zinc-950/5 dark:border-white/10 overflow-hidden">
|
|
8764
|
-
${
|
|
8764
|
+
${chunkJJ6HE4J4_cjs.renderTable(tableData)}
|
|
8765
8765
|
</div>
|
|
8766
8766
|
</div>
|
|
8767
8767
|
`;
|
|
@@ -10191,7 +10191,7 @@ function renderFormCreatePage(data) {
|
|
|
10191
10191
|
// src/routes/admin-forms.ts
|
|
10192
10192
|
var isTableMissing = (err) => String(err?.message ?? err?.cause?.message ?? "").includes("no such table: forms");
|
|
10193
10193
|
var adminFormsRoutes = new hono.Hono();
|
|
10194
|
-
adminFormsRoutes.use("*",
|
|
10194
|
+
adminFormsRoutes.use("*", chunkSYAUCKSD_cjs.requireAuth());
|
|
10195
10195
|
adminFormsRoutes.get("/", async (c) => {
|
|
10196
10196
|
try {
|
|
10197
10197
|
const user = c.get("user");
|
|
@@ -10364,7 +10364,7 @@ adminFormsRoutes.get("/:id/builder", async (c) => {
|
|
|
10364
10364
|
if (!form) {
|
|
10365
10365
|
return c.html("<p>Form not found</p>", 404);
|
|
10366
10366
|
}
|
|
10367
|
-
const turnstileService = new
|
|
10367
|
+
const turnstileService = new chunkYS5S47VV_cjs.TurnstileService(db);
|
|
10368
10368
|
const turnstileSettings = await turnstileService.getSettings();
|
|
10369
10369
|
const pageData = {
|
|
10370
10370
|
id: form.id,
|
|
@@ -10533,7 +10533,7 @@ publicFormsRoutes.get("/:identifier/turnstile-config", async (c) => {
|
|
|
10533
10533
|
if (!form) {
|
|
10534
10534
|
return c.json({ error: "Form not found" }, 404);
|
|
10535
10535
|
}
|
|
10536
|
-
const turnstileService = new
|
|
10536
|
+
const turnstileService = new chunkYS5S47VV_cjs.TurnstileService(db);
|
|
10537
10537
|
const globalSettings = await turnstileService.getSettings();
|
|
10538
10538
|
const formSettings = form.turnstile_settings ? JSON.parse(form.turnstile_settings) : { inherit: true };
|
|
10539
10539
|
const enabled = form.turnstile_enabled === 1 || formSettings.inherit && globalSettings?.enabled;
|
|
@@ -10963,7 +10963,7 @@ publicFormsRoutes.post("/:identifier/submit", async (c) => {
|
|
|
10963
10963
|
const turnstileEnabled = form.turnstile_enabled === 1;
|
|
10964
10964
|
const turnstileSettings = form.turnstile_settings ? JSON.parse(form.turnstile_settings) : { inherit: true };
|
|
10965
10965
|
if (turnstileEnabled || turnstileSettings.inherit) {
|
|
10966
|
-
const turnstileService = new
|
|
10966
|
+
const turnstileService = new chunkYS5S47VV_cjs.TurnstileService(db);
|
|
10967
10967
|
const globalEnabled = await turnstileService.isEnabled();
|
|
10968
10968
|
if (globalEnabled || turnstileEnabled) {
|
|
10969
10969
|
const turnstileToken = body.data?.turnstile || body.turnstile;
|
|
@@ -11025,7 +11025,7 @@ publicFormsRoutes.post("/:identifier/submit", async (c) => {
|
|
|
11025
11025
|
});
|
|
11026
11026
|
|
|
11027
11027
|
// src/plugins/core-plugins/forms-plugin/index.ts
|
|
11028
|
-
var formsPlugin =
|
|
11028
|
+
var formsPlugin = chunkEHTBXFTA_cjs.definePlugin({
|
|
11029
11029
|
id: "forms",
|
|
11030
11030
|
version: "1.0.0",
|
|
11031
11031
|
name: "Forms",
|
|
@@ -11045,7 +11045,7 @@ var formsPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
|
11045
11045
|
});
|
|
11046
11046
|
chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
|
|
11047
11047
|
var adminRbacRoutes = new hono.Hono();
|
|
11048
|
-
adminRbacRoutes.use("*",
|
|
11048
|
+
adminRbacRoutes.use("*", chunkSYAUCKSD_cjs.requireRbac("rbac", "manage"));
|
|
11049
11049
|
var esc = (s) => String(s).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
11050
11050
|
var TABS2 = `
|
|
11051
11051
|
<div class="border-b border-zinc-950/10 dark:border-white/10 mb-6">
|
|
@@ -11353,7 +11353,7 @@ adminRbacRoutes.get("/", async (c) => {
|
|
|
11353
11353
|
title: "Roles & Permissions",
|
|
11354
11354
|
pageTitle: "Roles & Permissions",
|
|
11355
11355
|
currentPath: "/admin/users",
|
|
11356
|
-
version:
|
|
11356
|
+
version: chunkNZF3THNY_cjs.getCoreVersion(),
|
|
11357
11357
|
user: u ? { name: u.email || "Admin", email: u.email || "", role: u.role || "admin" } : void 0,
|
|
11358
11358
|
content: content2
|
|
11359
11359
|
})
|
|
@@ -11490,7 +11490,7 @@ adminRbacRoutes.get("/check", async (c) => {
|
|
|
11490
11490
|
});
|
|
11491
11491
|
|
|
11492
11492
|
// src/middleware/plugin-menu.ts
|
|
11493
|
-
var REGISTRY_MENU_PLUGINS = Object.values(
|
|
11493
|
+
var REGISTRY_MENU_PLUGINS = Object.values(chunk2DSRS3VA_cjs.PLUGIN_REGISTRY).filter((p) => p.adminMenu !== null).map((p) => ({
|
|
11494
11494
|
id: p.id,
|
|
11495
11495
|
label: p.adminMenu.label,
|
|
11496
11496
|
path: p.adminMenu.path,
|
|
@@ -11569,7 +11569,7 @@ function pluginMenuMiddleware() {
|
|
|
11569
11569
|
} catch {
|
|
11570
11570
|
}
|
|
11571
11571
|
const user = c.get("user");
|
|
11572
|
-
const singletonItems =
|
|
11572
|
+
const singletonItems = chunkYS5S47VV_cjs.resolvePluginMenuItems(user ? { role: user.role } : void 0);
|
|
11573
11573
|
const existingPaths = new Set(activeMenuItems.map((i) => i.path));
|
|
11574
11574
|
for (const item of singletonItems) {
|
|
11575
11575
|
if (!existingPaths.has(item.path)) {
|
|
@@ -11596,7 +11596,7 @@ function pluginMenuMiddleware() {
|
|
|
11596
11596
|
}
|
|
11597
11597
|
chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
|
|
11598
11598
|
var adminRoutes6 = new hono.Hono();
|
|
11599
|
-
adminRoutes6.use("*",
|
|
11599
|
+
adminRoutes6.use("*", chunkSYAUCKSD_cjs.requireAuth());
|
|
11600
11600
|
adminRoutes6.use("*", async (c, next) => {
|
|
11601
11601
|
const user = c.get("user");
|
|
11602
11602
|
if (user?.role !== "admin") {
|
|
@@ -11952,7 +11952,7 @@ apiRoutes4.get("/stats", async (c) => {
|
|
|
11952
11952
|
});
|
|
11953
11953
|
|
|
11954
11954
|
// src/plugins/core-plugins/analytics/index.ts
|
|
11955
|
-
var analyticsPlugin =
|
|
11955
|
+
var analyticsPlugin = chunkEHTBXFTA_cjs.definePlugin({
|
|
11956
11956
|
id: "core-analytics",
|
|
11957
11957
|
version: "1.0.0",
|
|
11958
11958
|
name: "Analytics",
|
|
@@ -12099,7 +12099,7 @@ function esc2(s) {
|
|
|
12099
12099
|
return (s || "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
12100
12100
|
}
|
|
12101
12101
|
async function getVariablesMap(db) {
|
|
12102
|
-
let variables =
|
|
12102
|
+
let variables = chunkJJ6HE4J4_cjs.getVariablesCached();
|
|
12103
12103
|
if (variables) return variables;
|
|
12104
12104
|
try {
|
|
12105
12105
|
const { results } = await db.prepare(
|
|
@@ -12109,7 +12109,7 @@ async function getVariablesMap(db) {
|
|
|
12109
12109
|
for (const row of results || []) {
|
|
12110
12110
|
variables.set(row.key, row.value);
|
|
12111
12111
|
}
|
|
12112
|
-
|
|
12112
|
+
chunkJJ6HE4J4_cjs.setVariablesCache(variables);
|
|
12113
12113
|
return variables;
|
|
12114
12114
|
} catch {
|
|
12115
12115
|
return /* @__PURE__ */ new Map();
|
|
@@ -12178,7 +12178,7 @@ apiRoutes5.post("/", async (c) => {
|
|
|
12178
12178
|
await db.prepare(
|
|
12179
12179
|
"INSERT INTO global_variables (key, value, description, category, is_active) VALUES (?, ?, ?, ?, ?)"
|
|
12180
12180
|
).bind(key, value || "", description || "", category || "general", isActive !== false ? 1 : 0).run();
|
|
12181
|
-
|
|
12181
|
+
chunkJJ6HE4J4_cjs.invalidateVariablesCache();
|
|
12182
12182
|
const created = await db.prepare("SELECT * FROM global_variables WHERE key = ?").bind(key).first();
|
|
12183
12183
|
return c.json({ success: true, data: formatVariable(created) }, 201);
|
|
12184
12184
|
} catch {
|
|
@@ -12223,7 +12223,7 @@ apiRoutes5.put("/:id", async (c) => {
|
|
|
12223
12223
|
updates.push("updated_at = strftime('%s', 'now')");
|
|
12224
12224
|
params.push(id);
|
|
12225
12225
|
await db.prepare(`UPDATE global_variables SET ${updates.join(", ")} WHERE id = ?`).bind(...params).run();
|
|
12226
|
-
|
|
12226
|
+
chunkJJ6HE4J4_cjs.invalidateVariablesCache();
|
|
12227
12227
|
const updated = await db.prepare("SELECT * FROM global_variables WHERE id = ?").bind(id).first();
|
|
12228
12228
|
return c.json({ success: true, data: formatVariable(updated) });
|
|
12229
12229
|
} catch {
|
|
@@ -12237,7 +12237,7 @@ apiRoutes5.delete("/:id", async (c) => {
|
|
|
12237
12237
|
const existing = await db.prepare("SELECT id FROM global_variables WHERE id = ?").bind(id).first();
|
|
12238
12238
|
if (!existing) return c.json({ error: "Variable not found" }, 404);
|
|
12239
12239
|
await db.prepare("DELETE FROM global_variables WHERE id = ?").bind(id).run();
|
|
12240
|
-
|
|
12240
|
+
chunkJJ6HE4J4_cjs.invalidateVariablesCache();
|
|
12241
12241
|
return c.json({ success: true });
|
|
12242
12242
|
} catch {
|
|
12243
12243
|
return c.json({ success: false, error: "Failed to delete variable" }, 500);
|
|
@@ -12297,7 +12297,7 @@ adminRoutes7.put("/:id", async (c) => {
|
|
|
12297
12297
|
const value = body.value;
|
|
12298
12298
|
if (value !== void 0) {
|
|
12299
12299
|
await db.prepare("UPDATE global_variables SET value = ?, updated_at = strftime('%s', 'now') WHERE id = ?").bind(value, id).run();
|
|
12300
|
-
|
|
12300
|
+
chunkJJ6HE4J4_cjs.invalidateVariablesCache();
|
|
12301
12301
|
}
|
|
12302
12302
|
return c.html('<span class="text-green-400 text-xs">Saved</span>');
|
|
12303
12303
|
});
|
|
@@ -12305,7 +12305,7 @@ adminRoutes7.post("/:id/toggle", async (c) => {
|
|
|
12305
12305
|
const db = c.env.DB;
|
|
12306
12306
|
const id = c.req.param("id");
|
|
12307
12307
|
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();
|
|
12308
|
-
|
|
12308
|
+
chunkJJ6HE4J4_cjs.invalidateVariablesCache();
|
|
12309
12309
|
c.header("HX-Redirect", "/admin/global-variables");
|
|
12310
12310
|
return c.body(null, 204);
|
|
12311
12311
|
});
|
|
@@ -12326,7 +12326,7 @@ adminRoutes7.post("/", async (c) => {
|
|
|
12326
12326
|
await db.prepare(
|
|
12327
12327
|
"INSERT INTO global_variables (key, value, description, category) VALUES (?, ?, ?, ?)"
|
|
12328
12328
|
).bind(key, value, description, category).run();
|
|
12329
|
-
|
|
12329
|
+
chunkJJ6HE4J4_cjs.invalidateVariablesCache();
|
|
12330
12330
|
c.header("HX-Redirect", "/admin/global-variables");
|
|
12331
12331
|
return c.body(null, 204);
|
|
12332
12332
|
});
|
|
@@ -12345,7 +12345,7 @@ adminRoutes7.post("/settings/editor-integration", async (c) => {
|
|
|
12345
12345
|
adminRoutes7.delete("/:id", async (c) => {
|
|
12346
12346
|
const db = c.env.DB;
|
|
12347
12347
|
await db.prepare("DELETE FROM global_variables WHERE id = ?").bind(c.req.param("id")).run();
|
|
12348
|
-
|
|
12348
|
+
chunkJJ6HE4J4_cjs.invalidateVariablesCache();
|
|
12349
12349
|
return c.html("");
|
|
12350
12350
|
});
|
|
12351
12351
|
function renderAdminPage(variables, editorStatus = { editorActive: false, activeEditorName: "", enableEditorIntegration: true }) {
|
|
@@ -12663,7 +12663,7 @@ function renderAdminPage(variables, editorStatus = { editorActive: false, active
|
|
|
12663
12663
|
</div>
|
|
12664
12664
|
` });
|
|
12665
12665
|
}
|
|
12666
|
-
var globalVariablesPlugin =
|
|
12666
|
+
var globalVariablesPlugin = chunkEHTBXFTA_cjs.definePlugin({
|
|
12667
12667
|
id: "global-variables",
|
|
12668
12668
|
version: "1.1.0",
|
|
12669
12669
|
name: "Global Variables",
|
|
@@ -12686,7 +12686,7 @@ var globalVariablesPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
|
12686
12686
|
if (!db || !data) return data;
|
|
12687
12687
|
const variables = await getVariablesMap(db);
|
|
12688
12688
|
if (variables.size === 0) return data;
|
|
12689
|
-
return
|
|
12689
|
+
return chunkJJ6HE4J4_cjs.resolveVariablesInObject(data, variables);
|
|
12690
12690
|
} catch {
|
|
12691
12691
|
return data;
|
|
12692
12692
|
}
|
|
@@ -12704,7 +12704,7 @@ var globalVariablesPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
|
12704
12704
|
},
|
|
12705
12705
|
activate: async () => console.info("[GlobalVariables] Plugin activated"),
|
|
12706
12706
|
deactivate: async () => {
|
|
12707
|
-
|
|
12707
|
+
chunkJJ6HE4J4_cjs.invalidateVariablesCache();
|
|
12708
12708
|
console.info("[GlobalVariables] Plugin deactivated, cache cleared");
|
|
12709
12709
|
},
|
|
12710
12710
|
uninstall: async (ctx) => {
|
|
@@ -13270,7 +13270,7 @@ function renderAdminPage2(shortcodes, editorStatus = { editorActive: false, acti
|
|
|
13270
13270
|
</div>
|
|
13271
13271
|
` });
|
|
13272
13272
|
}
|
|
13273
|
-
var shortcodesPlugin =
|
|
13273
|
+
var shortcodesPlugin = chunkEHTBXFTA_cjs.definePlugin({
|
|
13274
13274
|
id: "shortcodes",
|
|
13275
13275
|
version: "1.0.0",
|
|
13276
13276
|
name: "Shortcodes",
|
|
@@ -13354,7 +13354,7 @@ helloWorldRoutes.get("/", async (c) => {
|
|
|
13354
13354
|
</html>
|
|
13355
13355
|
`);
|
|
13356
13356
|
});
|
|
13357
|
-
var helloWorldPlugin =
|
|
13357
|
+
var helloWorldPlugin = chunkEHTBXFTA_cjs.definePlugin({
|
|
13358
13358
|
id: "hello-world",
|
|
13359
13359
|
version: "1.0.0",
|
|
13360
13360
|
name: "Hello World",
|
|
@@ -13585,7 +13585,7 @@ function renderTenantForm(data) {
|
|
|
13585
13585
|
// src/plugins/core-plugins/multi-tenant-plugin/templates/tenant-members.template.ts
|
|
13586
13586
|
chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
|
|
13587
13587
|
function roleOptions(selected) {
|
|
13588
|
-
return
|
|
13588
|
+
return chunkJJ6HE4J4_cjs.VALID_MEMBER_ROLES.map(
|
|
13589
13589
|
(r) => `<option value="${r}" ${r === selected ? "selected" : ""}>${r}</option>`
|
|
13590
13590
|
).join("");
|
|
13591
13591
|
}
|
|
@@ -13647,7 +13647,7 @@ function renderInvitations(slug, invitations) {
|
|
|
13647
13647
|
<div>
|
|
13648
13648
|
<label for="invite-role" class="mb-1 block text-xs font-medium text-zinc-500 dark:text-zinc-400">Role</label>
|
|
13649
13649
|
<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">
|
|
13650
|
-
${
|
|
13650
|
+
${chunkJJ6HE4J4_cjs.VALID_MEMBER_ROLES.map((r) => `<option value="${r}" ${r === "viewer" ? "selected" : ""}>${r}</option>`).join("")}
|
|
13651
13651
|
</select>
|
|
13652
13652
|
</div>
|
|
13653
13653
|
<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>
|
|
@@ -13743,7 +13743,7 @@ function renderTenantMembers(data) {
|
|
|
13743
13743
|
// src/plugins/core-plugins/multi-tenant-plugin/templates/user-memberships.template.ts
|
|
13744
13744
|
chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
|
|
13745
13745
|
function roleOptions2(selected) {
|
|
13746
|
-
return
|
|
13746
|
+
return chunkJJ6HE4J4_cjs.VALID_MEMBER_ROLES.map(
|
|
13747
13747
|
(r) => `<option value="${r}" ${r === selected ? "selected" : ""}>${r}</option>`
|
|
13748
13748
|
).join("");
|
|
13749
13749
|
}
|
|
@@ -13905,7 +13905,7 @@ function zodToFieldErrors(error) {
|
|
|
13905
13905
|
}
|
|
13906
13906
|
async function isMultiTenantActive(db) {
|
|
13907
13907
|
try {
|
|
13908
|
-
const plugin2 = await new
|
|
13908
|
+
const plugin2 = await new chunk2DSRS3VA_cjs.PluginService(db).getPlugin(chunk2DSRS3VA_cjs.MULTI_TENANT_PLUGIN_ID);
|
|
13909
13909
|
return plugin2?.status === "active";
|
|
13910
13910
|
} catch {
|
|
13911
13911
|
return false;
|
|
@@ -13913,7 +13913,7 @@ async function isMultiTenantActive(db) {
|
|
|
13913
13913
|
}
|
|
13914
13914
|
function createTenantAdminRoutes() {
|
|
13915
13915
|
const routes2 = new hono.Hono();
|
|
13916
|
-
routes2.use("*",
|
|
13916
|
+
routes2.use("*", chunkSYAUCKSD_cjs.requireAuth());
|
|
13917
13917
|
routes2.use("*", async (c, next) => {
|
|
13918
13918
|
const user = c.get("user");
|
|
13919
13919
|
if (user?.role !== "admin") {
|
|
@@ -13927,7 +13927,7 @@ function createTenantAdminRoutes() {
|
|
|
13927
13927
|
const form = await c.req.formData();
|
|
13928
13928
|
const slug = String(form.get("tenant") ?? "").trim().toLowerCase();
|
|
13929
13929
|
const redirect = String(form.get("redirect") ?? "");
|
|
13930
|
-
const svc = new
|
|
13930
|
+
const svc = new chunkJJ6HE4J4_cjs.TenantService(db);
|
|
13931
13931
|
const tenant = await svc.getTenantBySlug(slug);
|
|
13932
13932
|
if (!tenant || tenant.status !== "active") {
|
|
13933
13933
|
return c.json({ error: "Unknown or inactive tenant" }, 400);
|
|
@@ -13937,7 +13937,7 @@ function createTenantAdminRoutes() {
|
|
|
13937
13937
|
if (!user.isSuperAdmin && !await svc.isMember(user.userId, slug)) {
|
|
13938
13938
|
return c.json({ error: "You are not a member of this tenant" }, 403);
|
|
13939
13939
|
}
|
|
13940
|
-
cookie.setCookie(c,
|
|
13940
|
+
cookie.setCookie(c, chunk2DSRS3VA_cjs.TENANT_COOKIE, slug, {
|
|
13941
13941
|
path: "/",
|
|
13942
13942
|
httpOnly: true,
|
|
13943
13943
|
sameSite: "Lax",
|
|
@@ -13954,7 +13954,7 @@ function createTenantAdminRoutes() {
|
|
|
13954
13954
|
if (!user) return c.redirect("/auth/login");
|
|
13955
13955
|
const token = c.req.query("token") ?? "";
|
|
13956
13956
|
try {
|
|
13957
|
-
const { slug } = await new
|
|
13957
|
+
const { slug } = await new chunkJJ6HE4J4_cjs.TenantService(db).acceptInvitation(token, user.userId, user.email);
|
|
13958
13958
|
return c.redirect(`/admin/tenants/${slug}/members?message=Invitation accepted`);
|
|
13959
13959
|
} catch (error) {
|
|
13960
13960
|
const message = error instanceof Error ? error.message : "Failed to accept invitation";
|
|
@@ -13982,7 +13982,7 @@ function createTenantAdminRoutes() {
|
|
|
13982
13982
|
const userId = c.req.param("userId");
|
|
13983
13983
|
const target = await db.prepare("SELECT id, email FROM auth_user WHERE id = ?").bind(userId).first();
|
|
13984
13984
|
if (!target?.id) return c.redirect("/admin/users?message=User not found&type=error");
|
|
13985
|
-
const svc = new
|
|
13985
|
+
const svc = new chunkJJ6HE4J4_cjs.TenantService(db);
|
|
13986
13986
|
const [memberships, allTenants] = await Promise.all([svc.listUserMemberships(userId), svc.listTenants()]);
|
|
13987
13987
|
const memberSlugs = new Set(memberships.map((m) => m.slug));
|
|
13988
13988
|
const availableTenants = allTenants.filter((t) => t.status === "active" && !memberSlugs.has(t.slug)).map((t) => ({ slug: t.slug, name: t.name }));
|
|
@@ -14007,10 +14007,10 @@ function createTenantAdminRoutes() {
|
|
|
14007
14007
|
const slug = String(form.get("slug") ?? "").trim().toLowerCase();
|
|
14008
14008
|
const role = String(form.get("role") ?? "viewer");
|
|
14009
14009
|
const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
|
|
14010
|
-
if (!
|
|
14010
|
+
if (!chunkJJ6HE4J4_cjs.isValidMemberRole(role)) throw new Error(`Invalid role '${role}'`);
|
|
14011
14011
|
const target = await db.prepare("SELECT email FROM auth_user WHERE id = ?").bind(userId).first();
|
|
14012
14012
|
if (!target) throw new Error("User not found");
|
|
14013
|
-
const svc = new
|
|
14013
|
+
const svc = new chunkJJ6HE4J4_cjs.TenantService(db);
|
|
14014
14014
|
if (!await svc.getTenantBySlug(slug)) throw new Error("Tenant not found");
|
|
14015
14015
|
if (await svc.isMember(userId, slug)) throw new Error(`Already a member of '${slug}'`);
|
|
14016
14016
|
await svc.addMember(slug, userId, role, target.email ?? null);
|
|
@@ -14029,7 +14029,7 @@ function createTenantAdminRoutes() {
|
|
|
14029
14029
|
const form = await c.req.formData();
|
|
14030
14030
|
const role = String(form.get("role") ?? "");
|
|
14031
14031
|
const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
|
|
14032
|
-
await new
|
|
14032
|
+
await new chunkJJ6HE4J4_cjs.TenantService(db).setMemberRole(slug, userId, role);
|
|
14033
14033
|
return c.redirect(`${redirectTo}?message=Role updated`);
|
|
14034
14034
|
} catch (error) {
|
|
14035
14035
|
const message = error instanceof Error ? error.message : "Failed to update role";
|
|
@@ -14044,7 +14044,7 @@ function createTenantAdminRoutes() {
|
|
|
14044
14044
|
try {
|
|
14045
14045
|
const form = await c.req.formData();
|
|
14046
14046
|
const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
|
|
14047
|
-
await new
|
|
14047
|
+
await new chunkJJ6HE4J4_cjs.TenantService(db).removeMember(slug, userId);
|
|
14048
14048
|
return c.redirect(`${redirectTo}?message=Removed from ${encodeURIComponent(slug)}`);
|
|
14049
14049
|
} catch (error) {
|
|
14050
14050
|
const message = error instanceof Error ? error.message : "Failed to remove membership";
|
|
@@ -14059,7 +14059,7 @@ function createTenantAdminRoutes() {
|
|
|
14059
14059
|
return c.html(renderTenantsInactive({ user: userShape(cur), version }));
|
|
14060
14060
|
}
|
|
14061
14061
|
const roleName = c.req.param("roleName");
|
|
14062
|
-
const assignments = await new
|
|
14062
|
+
const assignments = await new chunkJJ6HE4J4_cjs.TenantService(db).listAssignmentsByRole(roleName);
|
|
14063
14063
|
return c.html(renderRoleUsage({ roleName, assignments, user: userShape(cur), version }));
|
|
14064
14064
|
});
|
|
14065
14065
|
routes2.get("/", async (c) => {
|
|
@@ -14069,7 +14069,7 @@ function createTenantAdminRoutes() {
|
|
|
14069
14069
|
if (!await isMultiTenantActive(db)) {
|
|
14070
14070
|
return c.html(renderTenantsInactive({ user: userShape(user), version }));
|
|
14071
14071
|
}
|
|
14072
|
-
const svc = new
|
|
14072
|
+
const svc = new chunkJJ6HE4J4_cjs.TenantService(db);
|
|
14073
14073
|
await svc.ensureDefaultTenant();
|
|
14074
14074
|
const tenants = await svc.listTenants();
|
|
14075
14075
|
const [docRes, memberRes] = await db.batch([
|
|
@@ -14108,7 +14108,7 @@ function createTenantAdminRoutes() {
|
|
|
14108
14108
|
formEntries = Object.fromEntries(form.entries());
|
|
14109
14109
|
const validated = tenantFormSchema.parse(formEntries);
|
|
14110
14110
|
if (!validated.slug) throw new zod.z.ZodError([{ code: "custom", message: "Slug is required", path: ["slug"] }]);
|
|
14111
|
-
const svc = new
|
|
14111
|
+
const svc = new chunkJJ6HE4J4_cjs.TenantService(db);
|
|
14112
14112
|
await svc.createTenant({
|
|
14113
14113
|
name: validated.name,
|
|
14114
14114
|
slug: validated.slug,
|
|
@@ -14133,7 +14133,7 @@ function createTenantAdminRoutes() {
|
|
|
14133
14133
|
if (!await isMultiTenantActive(db)) {
|
|
14134
14134
|
return c.html(renderTenantsInactive({ user: userShape(user), version }));
|
|
14135
14135
|
}
|
|
14136
|
-
const tenant = await new
|
|
14136
|
+
const tenant = await new chunkJJ6HE4J4_cjs.TenantService(db).getTenantBySlug(c.req.param("slug"));
|
|
14137
14137
|
if (!tenant) return c.redirect("/admin/tenants?message=Tenant not found&type=error");
|
|
14138
14138
|
return c.html(renderTenantForm({ tenant, isEdit: true, user: userShape(user), version }));
|
|
14139
14139
|
});
|
|
@@ -14143,7 +14143,7 @@ function createTenantAdminRoutes() {
|
|
|
14143
14143
|
const version = c.get("appVersion");
|
|
14144
14144
|
const slug = c.req.param("slug");
|
|
14145
14145
|
if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
|
|
14146
|
-
const svc = new
|
|
14146
|
+
const svc = new chunkJJ6HE4J4_cjs.TenantService(db);
|
|
14147
14147
|
try {
|
|
14148
14148
|
const form = await c.req.formData();
|
|
14149
14149
|
const validated = tenantFormSchema.parse(Object.fromEntries(form.entries()));
|
|
@@ -14168,7 +14168,7 @@ function createTenantAdminRoutes() {
|
|
|
14168
14168
|
const slug = c.req.param("slug");
|
|
14169
14169
|
if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
|
|
14170
14170
|
try {
|
|
14171
|
-
await new
|
|
14171
|
+
await new chunkJJ6HE4J4_cjs.TenantService(db).deleteTenant(slug);
|
|
14172
14172
|
return c.redirect("/admin/tenants?message=Tenant deleted successfully");
|
|
14173
14173
|
} catch (error) {
|
|
14174
14174
|
const message = error instanceof Error ? error.message : "Failed to delete tenant";
|
|
@@ -14183,7 +14183,7 @@ function createTenantAdminRoutes() {
|
|
|
14183
14183
|
return c.html(renderTenantsInactive({ user: userShape(user), version }));
|
|
14184
14184
|
}
|
|
14185
14185
|
const slug = c.req.param("slug");
|
|
14186
|
-
const svc = new
|
|
14186
|
+
const svc = new chunkJJ6HE4J4_cjs.TenantService(db);
|
|
14187
14187
|
const tenant = await svc.getTenantBySlug(slug);
|
|
14188
14188
|
if (!tenant) return c.redirect("/admin/tenants?message=Tenant not found&type=error");
|
|
14189
14189
|
const [members, invitations] = await Promise.all([svc.listMembers(slug), svc.listInvitations(slug)]);
|
|
@@ -14209,7 +14209,7 @@ function createTenantAdminRoutes() {
|
|
|
14209
14209
|
const form = await c.req.formData();
|
|
14210
14210
|
const email = String(form.get("email") ?? "");
|
|
14211
14211
|
const role = String(form.get("role") ?? "viewer");
|
|
14212
|
-
await new
|
|
14212
|
+
await new chunkJJ6HE4J4_cjs.TenantService(db).addMemberByEmail(slug, email, role);
|
|
14213
14213
|
return c.redirect(`/admin/tenants/${slug}/members?message=Member added`);
|
|
14214
14214
|
} catch (error) {
|
|
14215
14215
|
const message = error instanceof Error ? error.message : "Failed to add member";
|
|
@@ -14224,7 +14224,7 @@ function createTenantAdminRoutes() {
|
|
|
14224
14224
|
try {
|
|
14225
14225
|
const form = await c.req.formData();
|
|
14226
14226
|
const role = String(form.get("role") ?? "");
|
|
14227
|
-
await new
|
|
14227
|
+
await new chunkJJ6HE4J4_cjs.TenantService(db).setMemberRole(slug, userId, role);
|
|
14228
14228
|
return c.redirect(`/admin/tenants/${slug}/members?message=Role updated`);
|
|
14229
14229
|
} catch (error) {
|
|
14230
14230
|
const message = error instanceof Error ? error.message : "Failed to update role";
|
|
@@ -14237,7 +14237,7 @@ function createTenantAdminRoutes() {
|
|
|
14237
14237
|
const userId = c.req.param("userId");
|
|
14238
14238
|
if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
|
|
14239
14239
|
try {
|
|
14240
|
-
await new
|
|
14240
|
+
await new chunkJJ6HE4J4_cjs.TenantService(db).removeMember(slug, userId);
|
|
14241
14241
|
return c.redirect(`/admin/tenants/${slug}/members?message=Member removed`);
|
|
14242
14242
|
} catch (error) {
|
|
14243
14243
|
const message = error instanceof Error ? error.message : "Failed to remove member";
|
|
@@ -14253,12 +14253,12 @@ function createTenantAdminRoutes() {
|
|
|
14253
14253
|
const form = await c.req.formData();
|
|
14254
14254
|
const email = String(form.get("email") ?? "");
|
|
14255
14255
|
const role = String(form.get("role") ?? "viewer");
|
|
14256
|
-
const token = await new
|
|
14256
|
+
const token = await new chunkJJ6HE4J4_cjs.TenantService(db).createInvitation(slug, email, role, user?.userId ?? null);
|
|
14257
14257
|
const origin = c.req.header("origin") || new URL(c.req.url).origin;
|
|
14258
14258
|
const acceptUrl = `${origin}/join/invite?token=${encodeURIComponent(token)}`;
|
|
14259
14259
|
let note;
|
|
14260
14260
|
let noteType = "";
|
|
14261
|
-
const svc2 =
|
|
14261
|
+
const svc2 = chunkJJ6HE4J4_cjs.hasEmailService() ? chunkJJ6HE4J4_cjs.getEmailService() : null;
|
|
14262
14262
|
const hasRealProvider = !!svc2 && svc2.getProviderName() !== "console";
|
|
14263
14263
|
if (hasRealProvider) {
|
|
14264
14264
|
const result = await svc2.send({
|
|
@@ -14299,7 +14299,7 @@ function createTenantAdminRoutes() {
|
|
|
14299
14299
|
WHERE i.id = ? AND t.slug = ? AND i.status = 'pending'`
|
|
14300
14300
|
).bind(id, slug).first();
|
|
14301
14301
|
if (!inv) throw new Error("Invitation not found or already used");
|
|
14302
|
-
const svc2 =
|
|
14302
|
+
const svc2 = chunkJJ6HE4J4_cjs.hasEmailService() ? chunkJJ6HE4J4_cjs.getEmailService() : null;
|
|
14303
14303
|
const hasRealProvider = !!svc2 && svc2.getProviderName() !== "console";
|
|
14304
14304
|
if (!hasRealProvider) throw new Error("No email plugin active");
|
|
14305
14305
|
const origin = c.req.header("origin") || new URL(c.req.url).origin;
|
|
@@ -14324,7 +14324,7 @@ function createTenantAdminRoutes() {
|
|
|
14324
14324
|
const id = c.req.param("id");
|
|
14325
14325
|
if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
|
|
14326
14326
|
try {
|
|
14327
|
-
await new
|
|
14327
|
+
await new chunkJJ6HE4J4_cjs.TenantService(db).revokeInvitation(slug, id);
|
|
14328
14328
|
return c.redirect(`/admin/tenants/${slug}/members?message=Invitation revoked`);
|
|
14329
14329
|
} catch (error) {
|
|
14330
14330
|
const message = error instanceof Error ? error.message : "Failed to revoke invitation";
|
|
@@ -14554,7 +14554,7 @@ function createJoinRoutes() {
|
|
|
14554
14554
|
if (existing) return rerender("An account with this email already exists. Please sign in instead.");
|
|
14555
14555
|
try {
|
|
14556
14556
|
const userId = crypto.randomUUID();
|
|
14557
|
-
const passwordHash = await
|
|
14557
|
+
const passwordHash = await chunkSYAUCKSD_cjs.AuthManager.hashPassword(password);
|
|
14558
14558
|
const now = Date.now();
|
|
14559
14559
|
const nowSec = Math.floor(now / 1e3);
|
|
14560
14560
|
await db.batch([
|
|
@@ -14567,7 +14567,7 @@ function createJoinRoutes() {
|
|
|
14567
14567
|
VALUES (?, ?, ?, 'credential', ?, ?, ?)`
|
|
14568
14568
|
).bind(`cred-${userId}`, userId, userId, passwordHash, nowSec, nowSec)
|
|
14569
14569
|
]);
|
|
14570
|
-
await new
|
|
14570
|
+
await new chunkJJ6HE4J4_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
|
|
14571
14571
|
const auth = chunkGMMCCIQO_cjs.createAuth(c.env);
|
|
14572
14572
|
const origin = new URL(c.req.url).origin;
|
|
14573
14573
|
const baReq = new Request(`${origin}/auth/sign-in/email`, {
|
|
@@ -14635,7 +14635,7 @@ function createJoinRoutes() {
|
|
|
14635
14635
|
const baBody = await baRes.json();
|
|
14636
14636
|
const userId = baBody?.user?.id;
|
|
14637
14637
|
if (!userId) return rerender("Sign-in succeeded but could not read user ID.");
|
|
14638
|
-
await new
|
|
14638
|
+
await new chunkJJ6HE4J4_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
|
|
14639
14639
|
const headers = new Headers({ Location: "/admin?message=Welcome! You have joined " + encodeURIComponent(inv.tenantName) });
|
|
14640
14640
|
copyBaCookies(baRes, headers);
|
|
14641
14641
|
return new Response(null, { status: 302, headers });
|
|
@@ -14649,7 +14649,7 @@ function createJoinRoutes() {
|
|
|
14649
14649
|
|
|
14650
14650
|
// src/plugins/core-plugins/multi-tenant-plugin/index.ts
|
|
14651
14651
|
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>`;
|
|
14652
|
-
var multiTenantPlugin =
|
|
14652
|
+
var multiTenantPlugin = chunkEHTBXFTA_cjs.definePlugin({
|
|
14653
14653
|
id: manifest_default2.id,
|
|
14654
14654
|
version: "1.0.0",
|
|
14655
14655
|
name: manifest_default2.name,
|
|
@@ -14664,30 +14664,30 @@ var multiTenantPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
|
14664
14664
|
{ label: "Tenants", path: "/admin/tenants", icon: TENANT_ICON, order: 80 }
|
|
14665
14665
|
],
|
|
14666
14666
|
activate: async () => {
|
|
14667
|
-
|
|
14667
|
+
chunk2DSRS3VA_cjs.invalidateTenantCache();
|
|
14668
14668
|
console.info("\u2705 Multi-Tenant plugin activated");
|
|
14669
14669
|
},
|
|
14670
14670
|
deactivate: async () => {
|
|
14671
|
-
|
|
14671
|
+
chunk2DSRS3VA_cjs.invalidateTenantCache();
|
|
14672
14672
|
console.info("\u274C Multi-Tenant plugin deactivated");
|
|
14673
14673
|
}
|
|
14674
14674
|
});
|
|
14675
14675
|
var routes = new hono.Hono();
|
|
14676
|
-
routes.use("*",
|
|
14677
|
-
routes.use("*",
|
|
14676
|
+
routes.use("*", chunkSYAUCKSD_cjs.requireAuth());
|
|
14677
|
+
routes.use("*", chunkSYAUCKSD_cjs.requireRole(["admin", "editor"]));
|
|
14678
14678
|
routes.get("/:rootId", async (c) => {
|
|
14679
14679
|
const { rootId } = c.req.param();
|
|
14680
14680
|
const db = c.env.DB;
|
|
14681
|
-
const scope = await
|
|
14681
|
+
const scope = await chunkJJ6HE4J4_cjs.resolveDocScope(c, db, { rootId });
|
|
14682
14682
|
if (!scope) {
|
|
14683
14683
|
return c.html('<p class="text-zinc-500 dark:text-zinc-400 p-4">Document not found.</p>', 404);
|
|
14684
14684
|
}
|
|
14685
14685
|
if (!scope.docType?.settings?.versioning) {
|
|
14686
14686
|
return c.html('<p class="text-zinc-500 dark:text-zinc-400 p-4">Versioning not enabled for this type.</p>', 404);
|
|
14687
14687
|
}
|
|
14688
|
-
const denied = await
|
|
14688
|
+
const denied = await chunkJJ6HE4J4_cjs.denyIfNotAllowed(c, db, rootId, "read", scope.docType?.settings, scope.tenantId);
|
|
14689
14689
|
if (denied) return denied;
|
|
14690
|
-
const repo = new
|
|
14690
|
+
const repo = new chunkJJ6HE4J4_cjs.DocumentRepository(db, scope.tenantId);
|
|
14691
14691
|
const versions = await repo.getVersionHistory(rootId);
|
|
14692
14692
|
const safeRootIdAttr = chunkMNWKYY5E_cjs.escapeHtml(rootId);
|
|
14693
14693
|
const rows = versions.map((v) => {
|
|
@@ -14780,14 +14780,14 @@ routes.post("/:rootId/restore/:versionNumber", async (c) => {
|
|
|
14780
14780
|
const { rootId, versionNumber } = c.req.param();
|
|
14781
14781
|
const db = c.env.DB;
|
|
14782
14782
|
const user = c.get("user");
|
|
14783
|
-
const scope = await
|
|
14783
|
+
const scope = await chunkJJ6HE4J4_cjs.resolveDocScope(c, db, { rootId });
|
|
14784
14784
|
if (!scope) {
|
|
14785
14785
|
return c.json({ error: "Document not found" }, 404);
|
|
14786
14786
|
}
|
|
14787
14787
|
if (!scope.docType?.settings?.versioning) {
|
|
14788
14788
|
return c.json({ error: "Versioning not enabled for this type" }, 404);
|
|
14789
14789
|
}
|
|
14790
|
-
const denied = await
|
|
14790
|
+
const denied = await chunkJJ6HE4J4_cjs.denyIfNotAllowed(c, db, rootId, "update", scope.docType?.settings, scope.tenantId);
|
|
14791
14791
|
if (denied) return denied;
|
|
14792
14792
|
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();
|
|
14793
14793
|
if (!row) {
|
|
@@ -14810,7 +14810,7 @@ routes.post("/:rootId/restore/:versionNumber", async (c) => {
|
|
|
14810
14810
|
var routes_default = routes;
|
|
14811
14811
|
|
|
14812
14812
|
// src/plugins/core-plugins/versioning-plugin/index.ts
|
|
14813
|
-
var versioningPlugin =
|
|
14813
|
+
var versioningPlugin = chunkEHTBXFTA_cjs.definePlugin({
|
|
14814
14814
|
id: "versioning",
|
|
14815
14815
|
version: "1.0.0",
|
|
14816
14816
|
name: "Versioning",
|
|
@@ -14887,8 +14887,8 @@ function createMagicLinkAuthPlugin() {
|
|
|
14887
14887
|
const baseUrl = new URL(c.req.url).origin;
|
|
14888
14888
|
const magicLink = `${baseUrl}/auth/magic-link/verify?token=${token}`;
|
|
14889
14889
|
try {
|
|
14890
|
-
if (
|
|
14891
|
-
await
|
|
14890
|
+
if (chunkJJ6HE4J4_cjs.hasEmailService()) {
|
|
14891
|
+
await chunkJJ6HE4J4_cjs.getEmailService().send({
|
|
14892
14892
|
to: normalizedEmail,
|
|
14893
14893
|
subject: "Your Magic Link to Sign In",
|
|
14894
14894
|
flow: "magic-link",
|
|
@@ -14965,19 +14965,19 @@ function createMagicLinkAuthPlugin() {
|
|
|
14965
14965
|
SET used = 1, used_at = ?
|
|
14966
14966
|
WHERE id = ?
|
|
14967
14967
|
`).bind(Date.now(), magicLink.id).run();
|
|
14968
|
-
const tokenTtl = await
|
|
14969
|
-
const jwtToken = await
|
|
14968
|
+
const tokenTtl = await chunkSYAUCKSD_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
|
|
14969
|
+
const jwtToken = await chunkSYAUCKSD_cjs.AuthManager.generateToken(
|
|
14970
14970
|
user.id,
|
|
14971
14971
|
user.email,
|
|
14972
14972
|
user.role,
|
|
14973
14973
|
c.env.JWT_SECRET,
|
|
14974
14974
|
tokenTtl
|
|
14975
14975
|
);
|
|
14976
|
-
|
|
14976
|
+
chunkSYAUCKSD_cjs.AuthManager.setAuthCookie(c, jwtToken, { maxAge: tokenTtl });
|
|
14977
14977
|
await db.prepare(`
|
|
14978
14978
|
UPDATE auth_user SET last_login_at = ? WHERE id = ?
|
|
14979
14979
|
`).bind(Date.now(), user.id).run();
|
|
14980
|
-
|
|
14980
|
+
chunkJJ6HE4J4_cjs.dispatchHookEvent(
|
|
14981
14981
|
c,
|
|
14982
14982
|
"auth:magic-link:consumed",
|
|
14983
14983
|
{ user: { id: user.id, email: user.email, role: user.role } },
|
|
@@ -15462,7 +15462,7 @@ async function warmCollections(db) {
|
|
|
15462
15462
|
const collectionCache = chunkYA3TJ65D_cjs.getCacheService(config);
|
|
15463
15463
|
let count = 0;
|
|
15464
15464
|
try {
|
|
15465
|
-
const results =
|
|
15465
|
+
const results = chunk2DSRS3VA_cjs.getCollectionRegistry().listActive().map(chunk2DSRS3VA_cjs.collectionRecordToRow);
|
|
15466
15466
|
for (const collection of results) {
|
|
15467
15467
|
const key = collectionCache.generateKey("item", collection.id);
|
|
15468
15468
|
await collectionCache.set(key, collection);
|
|
@@ -15733,7 +15733,7 @@ function renderCacheDashboard(data) {
|
|
|
15733
15733
|
</script>
|
|
15734
15734
|
|
|
15735
15735
|
<!-- Confirmation Dialogs -->
|
|
15736
|
-
${
|
|
15736
|
+
${chunkJJ6HE4J4_cjs.renderConfirmationDialog({
|
|
15737
15737
|
id: "clear-all-cache-confirm",
|
|
15738
15738
|
title: "Clear All Cache",
|
|
15739
15739
|
message: "Are you sure you want to clear all cache entries? This cannot be undone.",
|
|
@@ -15744,7 +15744,7 @@ function renderCacheDashboard(data) {
|
|
|
15744
15744
|
onConfirm: "performClearAllCaches()"
|
|
15745
15745
|
})}
|
|
15746
15746
|
|
|
15747
|
-
${
|
|
15747
|
+
${chunkJJ6HE4J4_cjs.renderConfirmationDialog({
|
|
15748
15748
|
id: "clear-namespace-cache-confirm",
|
|
15749
15749
|
title: "Clear Namespace Cache",
|
|
15750
15750
|
message: "Clear cache for this namespace?",
|
|
@@ -15755,7 +15755,7 @@ function renderCacheDashboard(data) {
|
|
|
15755
15755
|
onConfirm: "performClearNamespaceCache()"
|
|
15756
15756
|
})}
|
|
15757
15757
|
|
|
15758
|
-
${
|
|
15758
|
+
${chunkJJ6HE4J4_cjs.getConfirmationDialogScript()}
|
|
15759
15759
|
`;
|
|
15760
15760
|
const layoutData = {
|
|
15761
15761
|
title: "Cache System",
|
|
@@ -16021,7 +16021,7 @@ app.get("/", async (c) => {
|
|
|
16021
16021
|
const totalRequests = totalHits + totalMisses;
|
|
16022
16022
|
const overallHitRate = totalRequests > 0 ? totalHits / totalRequests * 100 : 0;
|
|
16023
16023
|
const DEFAULT_TTL = chunkYA3TJ65D_cjs.CACHE_CONFIGS.api?.ttl ?? 300;
|
|
16024
|
-
const collections =
|
|
16024
|
+
const collections = chunk2DSRS3VA_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => {
|
|
16025
16025
|
const cacheOverride = r.cache;
|
|
16026
16026
|
const cacheEnabled = cacheOverride?.enabled !== false;
|
|
16027
16027
|
const hasCustomTtl = typeof cacheOverride?.ttl === "number";
|
|
@@ -16558,9 +16558,9 @@ var faviconSvg = `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
|
16558
16558
|
// src/app.ts
|
|
16559
16559
|
function createSonicJSApp(config = {}) {
|
|
16560
16560
|
const app2 = new hono.Hono();
|
|
16561
|
-
const appVersion = config.version ||
|
|
16561
|
+
const appVersion = config.version || chunkNZF3THNY_cjs.getCoreVersion();
|
|
16562
16562
|
const appName = config.name || "SonicJS AI";
|
|
16563
|
-
const hookSystem = new
|
|
16563
|
+
const hookSystem = new chunkYS5S47VV_cjs.HookSystemImpl();
|
|
16564
16564
|
chunkJ6JTWD2A_cjs.setHookSystem(hookSystem);
|
|
16565
16565
|
const magicLinkPlugin = createMagicLinkAuthPlugin();
|
|
16566
16566
|
const corePluginsBeforeCatchAll = [
|
|
@@ -16568,7 +16568,7 @@ function createSonicJSApp(config = {}) {
|
|
|
16568
16568
|
apiKeysPlugin,
|
|
16569
16569
|
aiSearchPlugin,
|
|
16570
16570
|
oauthProvidersPlugin,
|
|
16571
|
-
|
|
16571
|
+
chunkJJ6HE4J4_cjs.userProfilesPlugin,
|
|
16572
16572
|
otpLoginPlugin,
|
|
16573
16573
|
analyticsPlugin,
|
|
16574
16574
|
stripePlugin,
|
|
@@ -16578,23 +16578,23 @@ function createSonicJSApp(config = {}) {
|
|
|
16578
16578
|
shortcodesPlugin,
|
|
16579
16579
|
helloWorldPlugin,
|
|
16580
16580
|
multiTenantPlugin,
|
|
16581
|
-
|
|
16581
|
+
chunkJJ6HE4J4_cjs.lexicalEditorPlugin,
|
|
16582
16582
|
versioningPlugin
|
|
16583
16583
|
];
|
|
16584
16584
|
const corePluginsAfterCatchAll = [emailPluginV3, magicLinkPlugin, emailReconciliationPlugin];
|
|
16585
|
-
const wirePlugins =
|
|
16585
|
+
const wirePlugins = chunkYS5S47VV_cjs.createPluginWirer(
|
|
16586
16586
|
() => [...corePluginsBeforeCatchAll, ...corePluginsAfterCatchAll, ...config.plugins?.register ?? []],
|
|
16587
16587
|
// The capability-gated `ctx.cap.email` resolves to the app EmailService, which
|
|
16588
16588
|
// is initialized (below) just before wiring on the first request.
|
|
16589
16589
|
() => ({
|
|
16590
16590
|
hooks: hookSystem,
|
|
16591
16591
|
env: firstRequestEnv,
|
|
16592
|
-
providers: { email: () =>
|
|
16592
|
+
providers: { email: () => chunkJJ6HE4J4_cjs.getEmailService() }
|
|
16593
16593
|
})
|
|
16594
16594
|
);
|
|
16595
16595
|
let firstRequestEnv;
|
|
16596
16596
|
const initEmailService = async (env = {}) => {
|
|
16597
|
-
if (
|
|
16597
|
+
if (chunkJJ6HE4J4_cjs.hasEmailService()) return;
|
|
16598
16598
|
let provider;
|
|
16599
16599
|
let defaultFrom = config.email?.from;
|
|
16600
16600
|
let defaultReplyTo;
|
|
@@ -16629,14 +16629,14 @@ function createSonicJSApp(config = {}) {
|
|
|
16629
16629
|
}
|
|
16630
16630
|
}
|
|
16631
16631
|
defaultFrom = defaultFrom || env.DEFAULT_FROM_EMAIL || "noreply@sonicjs.local";
|
|
16632
|
-
|
|
16632
|
+
chunkJJ6HE4J4_cjs.setEmailService(new EmailService({ provider, defaultFrom, defaultReplyTo, db: env.DB }));
|
|
16633
16633
|
};
|
|
16634
16634
|
app2.use("*", async (c, next) => {
|
|
16635
16635
|
c.set("appVersion", appVersion);
|
|
16636
16636
|
await next();
|
|
16637
16637
|
});
|
|
16638
|
-
app2.use("*",
|
|
16639
|
-
app2.use("*",
|
|
16638
|
+
app2.use("*", chunkSYAUCKSD_cjs.metricsMiddleware());
|
|
16639
|
+
app2.use("*", chunkSYAUCKSD_cjs.bootstrapMiddleware(config));
|
|
16640
16640
|
const boot = async (env) => {
|
|
16641
16641
|
if (config.plugins?.disableAll) return;
|
|
16642
16642
|
firstRequestEnv = env;
|
|
@@ -16674,8 +16674,8 @@ function createSonicJSApp(config = {}) {
|
|
|
16674
16674
|
allowHeaders: ["Content-Type", "Authorization", "X-API-Key"],
|
|
16675
16675
|
credentials: true
|
|
16676
16676
|
}));
|
|
16677
|
-
app2.use("*",
|
|
16678
|
-
app2.use("*",
|
|
16677
|
+
app2.use("*", chunkSYAUCKSD_cjs.securityHeadersMiddleware());
|
|
16678
|
+
app2.use("*", chunkSYAUCKSD_cjs.csrfProtection());
|
|
16679
16679
|
app2.use("*", async (c, next) => {
|
|
16680
16680
|
try {
|
|
16681
16681
|
const reqUrl = new URL(c.req.url);
|
|
@@ -16713,9 +16713,9 @@ function createSonicJSApp(config = {}) {
|
|
|
16713
16713
|
app2.use("*", middleware);
|
|
16714
16714
|
}
|
|
16715
16715
|
}
|
|
16716
|
-
app2.use("*",
|
|
16717
|
-
app2.use("/admin/*",
|
|
16718
|
-
app2.use("/admin/*",
|
|
16716
|
+
app2.use("*", chunk2DSRS3VA_cjs.tenantMiddleware());
|
|
16717
|
+
app2.use("/admin/*", chunkSYAUCKSD_cjs.requireAuth());
|
|
16718
|
+
app2.use("/admin/*", chunkSYAUCKSD_cjs.requireRbac("portal", "access"));
|
|
16719
16719
|
app2.use("/admin/*", pluginMenuMiddleware());
|
|
16720
16720
|
const NAV_LANDING = [
|
|
16721
16721
|
{ path: "/admin/content", perm: "content:read" },
|
|
@@ -16761,43 +16761,43 @@ function createSonicJSApp(config = {}) {
|
|
|
16761
16761
|
});
|
|
16762
16762
|
app2.route("/api/security-audit", apiRoutes2);
|
|
16763
16763
|
app2.route("/admin/plugins/security-audit", adminRoutes3);
|
|
16764
|
-
app2.route("/api/media",
|
|
16765
|
-
app2.route("/api/system",
|
|
16766
|
-
app2.route("/api/documents",
|
|
16767
|
-
app2.route("/api",
|
|
16768
|
-
app2.route("/admin/documents",
|
|
16769
|
-
|
|
16770
|
-
app2.route("/admin/api",
|
|
16771
|
-
app2.route("/admin/collections",
|
|
16772
|
-
app2.route("/admin/settings",
|
|
16773
|
-
app2.route("/admin/api-reference",
|
|
16764
|
+
app2.route("/api/media", chunkJJ6HE4J4_cjs.api_media_default);
|
|
16765
|
+
app2.route("/api/system", chunkJJ6HE4J4_cjs.api_system_default);
|
|
16766
|
+
app2.route("/api/documents", chunkJJ6HE4J4_cjs.apiDocumentsRoutes);
|
|
16767
|
+
app2.route("/api", chunkJJ6HE4J4_cjs.api_default);
|
|
16768
|
+
app2.route("/admin/documents", chunkJJ6HE4J4_cjs.adminDocumentsRoutes);
|
|
16769
|
+
chunkYS5S47VV_cjs.registerPluginRoutes(app2, [formsPlugin], { source: "core" });
|
|
16770
|
+
app2.route("/admin/api", chunkJJ6HE4J4_cjs.admin_api_default);
|
|
16771
|
+
app2.route("/admin/collections", chunkJJ6HE4J4_cjs.adminCollectionsRoutes);
|
|
16772
|
+
app2.route("/admin/settings", chunkJJ6HE4J4_cjs.adminSettingsRoutes);
|
|
16773
|
+
app2.route("/admin/api-reference", chunkJJ6HE4J4_cjs.router2);
|
|
16774
16774
|
app2.route("/admin/database-tools", createDatabaseToolsAdminRoutes());
|
|
16775
|
-
app2.route("/admin/content",
|
|
16776
|
-
app2.route("/admin/media",
|
|
16775
|
+
app2.route("/admin/content", chunkJJ6HE4J4_cjs.admin_content_default);
|
|
16776
|
+
app2.route("/admin/media", chunkJJ6HE4J4_cjs.adminMediaRoutes);
|
|
16777
16777
|
app2.use("/auth/*", securityAuditMiddleware());
|
|
16778
16778
|
if (!config.plugins?.disableAll) {
|
|
16779
|
-
|
|
16779
|
+
chunkYS5S47VV_cjs.registerPluginRoutes(app2, corePluginsBeforeCatchAll, { source: "core" });
|
|
16780
16780
|
app2.route("/admin/cache", cache_default.getRoutes());
|
|
16781
16781
|
if (config.plugins?.register && config.plugins.register.length > 0) {
|
|
16782
|
-
|
|
16782
|
+
chunkYS5S47VV_cjs.registerPluginRoutes(app2, config.plugins.register, { source: "user" });
|
|
16783
16783
|
}
|
|
16784
16784
|
}
|
|
16785
16785
|
app2.route("/api/events", apiRoutes4);
|
|
16786
|
-
app2.route("/admin/dashboard",
|
|
16787
|
-
app2.route("/admin/plugins",
|
|
16788
|
-
app2.route("/admin/logs",
|
|
16786
|
+
app2.route("/admin/dashboard", chunkJJ6HE4J4_cjs.router);
|
|
16787
|
+
app2.route("/admin/plugins", chunkJJ6HE4J4_cjs.adminPluginRoutes);
|
|
16788
|
+
app2.route("/admin/logs", chunkJJ6HE4J4_cjs.adminLogsRoutes);
|
|
16789
16789
|
app2.route("/admin/rbac", adminRbacRoutes);
|
|
16790
|
-
app2.route("/admin",
|
|
16791
|
-
app2.route("/auth",
|
|
16790
|
+
app2.route("/admin", chunkJJ6HE4J4_cjs.userRoutes);
|
|
16791
|
+
app2.route("/auth", chunkJJ6HE4J4_cjs.auth_default);
|
|
16792
16792
|
app2.on(["GET", "POST"], "/auth/*", (c) => {
|
|
16793
16793
|
const reqUrl = new URL(c.req.url);
|
|
16794
16794
|
const requestBaseURL = `${reqUrl.protocol}//${reqUrl.host}`;
|
|
16795
16795
|
const auth = chunkGMMCCIQO_cjs.createAuth(c.env, config.auth?.extendBetterAuth, requestBaseURL);
|
|
16796
16796
|
return auth.handler(c.req.raw);
|
|
16797
16797
|
});
|
|
16798
|
-
app2.route("/",
|
|
16798
|
+
app2.route("/", chunkJJ6HE4J4_cjs.test_cleanup_default);
|
|
16799
16799
|
if (!config.plugins?.disableAll) {
|
|
16800
|
-
|
|
16800
|
+
chunkYS5S47VV_cjs.registerPluginRoutes(app2, corePluginsAfterCatchAll, { source: "core" });
|
|
16801
16801
|
}
|
|
16802
16802
|
if (!config.plugins?.disableAll) {
|
|
16803
16803
|
const allMountedPlugins = [
|
|
@@ -16807,10 +16807,10 @@ function createSonicJSApp(config = {}) {
|
|
|
16807
16807
|
...config.plugins?.register ?? []
|
|
16808
16808
|
];
|
|
16809
16809
|
const userPlugins = (config.plugins?.register ?? []).filter(
|
|
16810
|
-
(p) => !
|
|
16810
|
+
(p) => !chunk2DSRS3VA_cjs.PLUGIN_REGISTRY[p.id]
|
|
16811
16811
|
);
|
|
16812
|
-
|
|
16813
|
-
|
|
16812
|
+
chunkYS5S47VV_cjs.setPluginMenu(userPlugins.flatMap((p) => p.menu ?? []));
|
|
16813
|
+
chunkEHTBXFTA_cjs.setPluginDefinitions(allMountedPlugins);
|
|
16814
16814
|
}
|
|
16815
16815
|
app2.get("/favicon.svg", (c) => {
|
|
16816
16816
|
return new Response(faviconSvg, {
|
|
@@ -20304,7 +20304,7 @@ function createRedirectApiRoutes() {
|
|
|
20304
20304
|
});
|
|
20305
20305
|
return api;
|
|
20306
20306
|
}
|
|
20307
|
-
var redirectPlugin =
|
|
20307
|
+
var redirectPlugin = chunkEHTBXFTA_cjs.definePlugin({
|
|
20308
20308
|
id: manifest_default3.id,
|
|
20309
20309
|
version: manifest_default3.version,
|
|
20310
20310
|
name: manifest_default3.name,
|
|
@@ -20322,7 +20322,7 @@ var redirectPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
|
20322
20322
|
async onBoot(ctx) {
|
|
20323
20323
|
const db = ctx.env?.DB;
|
|
20324
20324
|
if (!db) return;
|
|
20325
|
-
const registry = new
|
|
20325
|
+
const registry = new chunkSYAUCKSD_cjs.DocumentTypeRegistry(db);
|
|
20326
20326
|
await registry.register({
|
|
20327
20327
|
id: "redirect",
|
|
20328
20328
|
name: "redirect",
|
|
@@ -20438,91 +20438,91 @@ function createDb(d1$1) {
|
|
|
20438
20438
|
}
|
|
20439
20439
|
|
|
20440
20440
|
// src/index.ts
|
|
20441
|
-
var VERSION =
|
|
20441
|
+
var VERSION = chunkNZF3THNY_cjs.package_default.version;
|
|
20442
20442
|
|
|
20443
20443
|
Object.defineProperty(exports, "DocumentRepository", {
|
|
20444
20444
|
enumerable: true,
|
|
20445
|
-
get: function () { return
|
|
20445
|
+
get: function () { return chunkJJ6HE4J4_cjs.DocumentRepository; }
|
|
20446
20446
|
});
|
|
20447
20447
|
Object.defineProperty(exports, "ROUTES_INFO", {
|
|
20448
20448
|
enumerable: true,
|
|
20449
|
-
get: function () { return
|
|
20449
|
+
get: function () { return chunkJJ6HE4J4_cjs.ROUTES_INFO; }
|
|
20450
20450
|
});
|
|
20451
20451
|
Object.defineProperty(exports, "adminApiRoutes", {
|
|
20452
20452
|
enumerable: true,
|
|
20453
|
-
get: function () { return
|
|
20453
|
+
get: function () { return chunkJJ6HE4J4_cjs.admin_api_default; }
|
|
20454
20454
|
});
|
|
20455
20455
|
Object.defineProperty(exports, "adminCheckboxRoutes", {
|
|
20456
20456
|
enumerable: true,
|
|
20457
|
-
get: function () { return
|
|
20457
|
+
get: function () { return chunkJJ6HE4J4_cjs.adminCheckboxRoutes; }
|
|
20458
20458
|
});
|
|
20459
20459
|
Object.defineProperty(exports, "adminCollectionsRoutes", {
|
|
20460
20460
|
enumerable: true,
|
|
20461
|
-
get: function () { return
|
|
20461
|
+
get: function () { return chunkJJ6HE4J4_cjs.adminCollectionsRoutes; }
|
|
20462
20462
|
});
|
|
20463
20463
|
Object.defineProperty(exports, "adminContentRoutes", {
|
|
20464
20464
|
enumerable: true,
|
|
20465
|
-
get: function () { return
|
|
20465
|
+
get: function () { return chunkJJ6HE4J4_cjs.admin_content_default; }
|
|
20466
20466
|
});
|
|
20467
20467
|
Object.defineProperty(exports, "adminDashboardRoutes", {
|
|
20468
20468
|
enumerable: true,
|
|
20469
|
-
get: function () { return
|
|
20469
|
+
get: function () { return chunkJJ6HE4J4_cjs.router; }
|
|
20470
20470
|
});
|
|
20471
20471
|
Object.defineProperty(exports, "adminLogsRoutes", {
|
|
20472
20472
|
enumerable: true,
|
|
20473
|
-
get: function () { return
|
|
20473
|
+
get: function () { return chunkJJ6HE4J4_cjs.adminLogsRoutes; }
|
|
20474
20474
|
});
|
|
20475
20475
|
Object.defineProperty(exports, "adminMediaRoutes", {
|
|
20476
20476
|
enumerable: true,
|
|
20477
|
-
get: function () { return
|
|
20477
|
+
get: function () { return chunkJJ6HE4J4_cjs.adminMediaRoutes; }
|
|
20478
20478
|
});
|
|
20479
20479
|
Object.defineProperty(exports, "adminPluginRoutes", {
|
|
20480
20480
|
enumerable: true,
|
|
20481
|
-
get: function () { return
|
|
20481
|
+
get: function () { return chunkJJ6HE4J4_cjs.adminPluginRoutes; }
|
|
20482
20482
|
});
|
|
20483
20483
|
Object.defineProperty(exports, "adminSettingsRoutes", {
|
|
20484
20484
|
enumerable: true,
|
|
20485
|
-
get: function () { return
|
|
20485
|
+
get: function () { return chunkJJ6HE4J4_cjs.adminSettingsRoutes; }
|
|
20486
20486
|
});
|
|
20487
20487
|
Object.defineProperty(exports, "adminUsersRoutes", {
|
|
20488
20488
|
enumerable: true,
|
|
20489
|
-
get: function () { return
|
|
20489
|
+
get: function () { return chunkJJ6HE4J4_cjs.userRoutes; }
|
|
20490
20490
|
});
|
|
20491
20491
|
Object.defineProperty(exports, "apiContentCrudRoutes", {
|
|
20492
20492
|
enumerable: true,
|
|
20493
|
-
get: function () { return
|
|
20493
|
+
get: function () { return chunkJJ6HE4J4_cjs.api_content_crud_default; }
|
|
20494
20494
|
});
|
|
20495
20495
|
Object.defineProperty(exports, "apiMediaRoutes", {
|
|
20496
20496
|
enumerable: true,
|
|
20497
|
-
get: function () { return
|
|
20497
|
+
get: function () { return chunkJJ6HE4J4_cjs.api_media_default; }
|
|
20498
20498
|
});
|
|
20499
20499
|
Object.defineProperty(exports, "apiRoutes", {
|
|
20500
20500
|
enumerable: true,
|
|
20501
|
-
get: function () { return
|
|
20501
|
+
get: function () { return chunkJJ6HE4J4_cjs.api_default; }
|
|
20502
20502
|
});
|
|
20503
20503
|
Object.defineProperty(exports, "apiSystemRoutes", {
|
|
20504
20504
|
enumerable: true,
|
|
20505
|
-
get: function () { return
|
|
20505
|
+
get: function () { return chunkJJ6HE4J4_cjs.api_system_default; }
|
|
20506
20506
|
});
|
|
20507
20507
|
Object.defineProperty(exports, "authRoutes", {
|
|
20508
20508
|
enumerable: true,
|
|
20509
|
-
get: function () { return
|
|
20509
|
+
get: function () { return chunkJJ6HE4J4_cjs.auth_default; }
|
|
20510
20510
|
});
|
|
20511
20511
|
Object.defineProperty(exports, "createUserProfilesPlugin", {
|
|
20512
20512
|
enumerable: true,
|
|
20513
|
-
get: function () { return
|
|
20513
|
+
get: function () { return chunkJJ6HE4J4_cjs.createUserProfilesPlugin; }
|
|
20514
20514
|
});
|
|
20515
20515
|
Object.defineProperty(exports, "defineUserProfile", {
|
|
20516
20516
|
enumerable: true,
|
|
20517
|
-
get: function () { return
|
|
20517
|
+
get: function () { return chunkJJ6HE4J4_cjs.defineUserProfile; }
|
|
20518
20518
|
});
|
|
20519
20519
|
Object.defineProperty(exports, "getUserProfileConfig", {
|
|
20520
20520
|
enumerable: true,
|
|
20521
|
-
get: function () { return
|
|
20521
|
+
get: function () { return chunkJJ6HE4J4_cjs.getUserProfileConfig; }
|
|
20522
20522
|
});
|
|
20523
20523
|
Object.defineProperty(exports, "userProfilesPlugin", {
|
|
20524
20524
|
enumerable: true,
|
|
20525
|
-
get: function () { return
|
|
20525
|
+
get: function () { return chunkJJ6HE4J4_cjs.userProfilesPlugin; }
|
|
20526
20526
|
});
|
|
20527
20527
|
Object.defineProperty(exports, "Logger", {
|
|
20528
20528
|
enumerable: true,
|
|
@@ -20678,87 +20678,87 @@ Object.defineProperty(exports, "workflowHistory", {
|
|
|
20678
20678
|
});
|
|
20679
20679
|
Object.defineProperty(exports, "AuthManager", {
|
|
20680
20680
|
enumerable: true,
|
|
20681
|
-
get: function () { return
|
|
20681
|
+
get: function () { return chunkSYAUCKSD_cjs.AuthManager; }
|
|
20682
20682
|
});
|
|
20683
20683
|
Object.defineProperty(exports, "PermissionManager", {
|
|
20684
20684
|
enumerable: true,
|
|
20685
|
-
get: function () { return
|
|
20685
|
+
get: function () { return chunkSYAUCKSD_cjs.PermissionManager; }
|
|
20686
20686
|
});
|
|
20687
20687
|
Object.defineProperty(exports, "bootstrapDocumentTypes", {
|
|
20688
20688
|
enumerable: true,
|
|
20689
|
-
get: function () { return
|
|
20689
|
+
get: function () { return chunkSYAUCKSD_cjs.bootstrapDocumentTypes; }
|
|
20690
20690
|
});
|
|
20691
20691
|
Object.defineProperty(exports, "bootstrapMiddleware", {
|
|
20692
20692
|
enumerable: true,
|
|
20693
|
-
get: function () { return
|
|
20693
|
+
get: function () { return chunkSYAUCKSD_cjs.bootstrapMiddleware; }
|
|
20694
20694
|
});
|
|
20695
20695
|
Object.defineProperty(exports, "cacheHeaders", {
|
|
20696
20696
|
enumerable: true,
|
|
20697
|
-
get: function () { return
|
|
20697
|
+
get: function () { return chunkSYAUCKSD_cjs.cacheHeaders; }
|
|
20698
20698
|
});
|
|
20699
20699
|
Object.defineProperty(exports, "compressionMiddleware", {
|
|
20700
20700
|
enumerable: true,
|
|
20701
|
-
get: function () { return
|
|
20701
|
+
get: function () { return chunkSYAUCKSD_cjs.compressionMiddleware; }
|
|
20702
20702
|
});
|
|
20703
20703
|
Object.defineProperty(exports, "detailedLoggingMiddleware", {
|
|
20704
20704
|
enumerable: true,
|
|
20705
|
-
get: function () { return
|
|
20705
|
+
get: function () { return chunkSYAUCKSD_cjs.detailedLoggingMiddleware; }
|
|
20706
20706
|
});
|
|
20707
20707
|
Object.defineProperty(exports, "getActivePlugins", {
|
|
20708
20708
|
enumerable: true,
|
|
20709
|
-
get: function () { return
|
|
20709
|
+
get: function () { return chunkSYAUCKSD_cjs.getActivePlugins; }
|
|
20710
20710
|
});
|
|
20711
20711
|
Object.defineProperty(exports, "isPluginActive", {
|
|
20712
20712
|
enumerable: true,
|
|
20713
|
-
get: function () { return
|
|
20713
|
+
get: function () { return chunkSYAUCKSD_cjs.isPluginActive; }
|
|
20714
20714
|
});
|
|
20715
20715
|
Object.defineProperty(exports, "logActivity", {
|
|
20716
20716
|
enumerable: true,
|
|
20717
|
-
get: function () { return
|
|
20717
|
+
get: function () { return chunkSYAUCKSD_cjs.logActivity; }
|
|
20718
20718
|
});
|
|
20719
20719
|
Object.defineProperty(exports, "loggingMiddleware", {
|
|
20720
20720
|
enumerable: true,
|
|
20721
|
-
get: function () { return
|
|
20721
|
+
get: function () { return chunkSYAUCKSD_cjs.loggingMiddleware; }
|
|
20722
20722
|
});
|
|
20723
20723
|
Object.defineProperty(exports, "optionalAuth", {
|
|
20724
20724
|
enumerable: true,
|
|
20725
|
-
get: function () { return
|
|
20725
|
+
get: function () { return chunkSYAUCKSD_cjs.optionalAuth; }
|
|
20726
20726
|
});
|
|
20727
20727
|
Object.defineProperty(exports, "performanceLoggingMiddleware", {
|
|
20728
20728
|
enumerable: true,
|
|
20729
|
-
get: function () { return
|
|
20729
|
+
get: function () { return chunkSYAUCKSD_cjs.performanceLoggingMiddleware; }
|
|
20730
20730
|
});
|
|
20731
20731
|
Object.defineProperty(exports, "requireActivePlugin", {
|
|
20732
20732
|
enumerable: true,
|
|
20733
|
-
get: function () { return
|
|
20733
|
+
get: function () { return chunkSYAUCKSD_cjs.requireActivePlugin; }
|
|
20734
20734
|
});
|
|
20735
20735
|
Object.defineProperty(exports, "requireActivePlugins", {
|
|
20736
20736
|
enumerable: true,
|
|
20737
|
-
get: function () { return
|
|
20737
|
+
get: function () { return chunkSYAUCKSD_cjs.requireActivePlugins; }
|
|
20738
20738
|
});
|
|
20739
20739
|
Object.defineProperty(exports, "requireAnyPermission", {
|
|
20740
20740
|
enumerable: true,
|
|
20741
|
-
get: function () { return
|
|
20741
|
+
get: function () { return chunkSYAUCKSD_cjs.requireAnyPermission; }
|
|
20742
20742
|
});
|
|
20743
20743
|
Object.defineProperty(exports, "requireAuth", {
|
|
20744
20744
|
enumerable: true,
|
|
20745
|
-
get: function () { return
|
|
20745
|
+
get: function () { return chunkSYAUCKSD_cjs.requireAuth; }
|
|
20746
20746
|
});
|
|
20747
20747
|
Object.defineProperty(exports, "requirePermission", {
|
|
20748
20748
|
enumerable: true,
|
|
20749
|
-
get: function () { return
|
|
20749
|
+
get: function () { return chunkSYAUCKSD_cjs.requirePermission; }
|
|
20750
20750
|
});
|
|
20751
20751
|
Object.defineProperty(exports, "requireRole", {
|
|
20752
20752
|
enumerable: true,
|
|
20753
|
-
get: function () { return
|
|
20753
|
+
get: function () { return chunkSYAUCKSD_cjs.requireRole; }
|
|
20754
20754
|
});
|
|
20755
20755
|
Object.defineProperty(exports, "securityHeaders", {
|
|
20756
20756
|
enumerable: true,
|
|
20757
|
-
get: function () { return
|
|
20757
|
+
get: function () { return chunkSYAUCKSD_cjs.securityHeadersMiddleware; }
|
|
20758
20758
|
});
|
|
20759
20759
|
Object.defineProperty(exports, "securityLoggingMiddleware", {
|
|
20760
20760
|
enumerable: true,
|
|
20761
|
-
get: function () { return
|
|
20761
|
+
get: function () { return chunkSYAUCKSD_cjs.securityLoggingMiddleware; }
|
|
20762
20762
|
});
|
|
20763
20763
|
Object.defineProperty(exports, "DocumentsService", {
|
|
20764
20764
|
enumerable: true,
|
|
@@ -20770,35 +20770,35 @@ Object.defineProperty(exports, "RbacService", {
|
|
|
20770
20770
|
});
|
|
20771
20771
|
Object.defineProperty(exports, "PluginBootstrapService", {
|
|
20772
20772
|
enumerable: true,
|
|
20773
|
-
get: function () { return
|
|
20773
|
+
get: function () { return chunk2DSRS3VA_cjs.PluginBootstrapService; }
|
|
20774
20774
|
});
|
|
20775
20775
|
Object.defineProperty(exports, "PluginServiceClass", {
|
|
20776
20776
|
enumerable: true,
|
|
20777
|
-
get: function () { return
|
|
20777
|
+
get: function () { return chunk2DSRS3VA_cjs.PluginService; }
|
|
20778
20778
|
});
|
|
20779
20779
|
Object.defineProperty(exports, "getAvailableCollectionNames", {
|
|
20780
20780
|
enumerable: true,
|
|
20781
|
-
get: function () { return
|
|
20781
|
+
get: function () { return chunk2DSRS3VA_cjs.getAvailableCollectionNames; }
|
|
20782
20782
|
});
|
|
20783
20783
|
Object.defineProperty(exports, "loadCollectionConfig", {
|
|
20784
20784
|
enumerable: true,
|
|
20785
|
-
get: function () { return
|
|
20785
|
+
get: function () { return chunk2DSRS3VA_cjs.loadCollectionConfig; }
|
|
20786
20786
|
});
|
|
20787
20787
|
Object.defineProperty(exports, "loadCollectionConfigs", {
|
|
20788
20788
|
enumerable: true,
|
|
20789
|
-
get: function () { return
|
|
20789
|
+
get: function () { return chunk2DSRS3VA_cjs.loadCollectionConfigs; }
|
|
20790
20790
|
});
|
|
20791
20791
|
Object.defineProperty(exports, "registerCollections", {
|
|
20792
20792
|
enumerable: true,
|
|
20793
|
-
get: function () { return
|
|
20793
|
+
get: function () { return chunk2DSRS3VA_cjs.registerCollections; }
|
|
20794
20794
|
});
|
|
20795
20795
|
Object.defineProperty(exports, "validateCollectionConfig", {
|
|
20796
20796
|
enumerable: true,
|
|
20797
|
-
get: function () { return
|
|
20797
|
+
get: function () { return chunk2DSRS3VA_cjs.validateCollectionConfig; }
|
|
20798
20798
|
});
|
|
20799
20799
|
Object.defineProperty(exports, "MigrationService", {
|
|
20800
20800
|
enumerable: true,
|
|
20801
|
-
get: function () { return
|
|
20801
|
+
get: function () { return chunkIDMHRCZS_cjs.MigrationService; }
|
|
20802
20802
|
});
|
|
20803
20803
|
Object.defineProperty(exports, "renderFilterBar", {
|
|
20804
20804
|
enumerable: true,
|
|
@@ -20838,99 +20838,99 @@ Object.defineProperty(exports, "renderAdminLayoutCatalyst", {
|
|
|
20838
20838
|
});
|
|
20839
20839
|
Object.defineProperty(exports, "HookSystemImpl", {
|
|
20840
20840
|
enumerable: true,
|
|
20841
|
-
get: function () { return
|
|
20841
|
+
get: function () { return chunkYS5S47VV_cjs.HookSystemImpl; }
|
|
20842
20842
|
});
|
|
20843
20843
|
Object.defineProperty(exports, "HookUtils", {
|
|
20844
20844
|
enumerable: true,
|
|
20845
|
-
get: function () { return
|
|
20845
|
+
get: function () { return chunkYS5S47VV_cjs.HookUtils; }
|
|
20846
20846
|
});
|
|
20847
20847
|
Object.defineProperty(exports, "PluginDependencyCycleError", {
|
|
20848
20848
|
enumerable: true,
|
|
20849
|
-
get: function () { return
|
|
20849
|
+
get: function () { return chunkYS5S47VV_cjs.PluginDependencyCycleError; }
|
|
20850
20850
|
});
|
|
20851
20851
|
Object.defineProperty(exports, "PluginManagerClass", {
|
|
20852
20852
|
enumerable: true,
|
|
20853
|
-
get: function () { return
|
|
20853
|
+
get: function () { return chunkYS5S47VV_cjs.PluginManager; }
|
|
20854
20854
|
});
|
|
20855
20855
|
Object.defineProperty(exports, "PluginRegistryImpl", {
|
|
20856
20856
|
enumerable: true,
|
|
20857
|
-
get: function () { return
|
|
20857
|
+
get: function () { return chunkYS5S47VV_cjs.PluginRegistryImpl; }
|
|
20858
20858
|
});
|
|
20859
20859
|
Object.defineProperty(exports, "PluginValidatorClass", {
|
|
20860
20860
|
enumerable: true,
|
|
20861
|
-
get: function () { return
|
|
20861
|
+
get: function () { return chunkYS5S47VV_cjs.PluginValidator; }
|
|
20862
20862
|
});
|
|
20863
20863
|
Object.defineProperty(exports, "RegisterPluginsError", {
|
|
20864
20864
|
enumerable: true,
|
|
20865
|
-
get: function () { return
|
|
20865
|
+
get: function () { return chunkYS5S47VV_cjs.RegisterPluginsError; }
|
|
20866
20866
|
});
|
|
20867
20867
|
Object.defineProperty(exports, "ScopedHookSystemClass", {
|
|
20868
20868
|
enumerable: true,
|
|
20869
|
-
get: function () { return
|
|
20869
|
+
get: function () { return chunkYS5S47VV_cjs.ScopedHookSystem; }
|
|
20870
20870
|
});
|
|
20871
20871
|
Object.defineProperty(exports, "collectCronSchedules", {
|
|
20872
20872
|
enumerable: true,
|
|
20873
|
-
get: function () { return
|
|
20873
|
+
get: function () { return chunkYS5S47VV_cjs.collectCronSchedules; }
|
|
20874
20874
|
});
|
|
20875
20875
|
Object.defineProperty(exports, "collectCrons", {
|
|
20876
20876
|
enumerable: true,
|
|
20877
|
-
get: function () { return
|
|
20877
|
+
get: function () { return chunkYS5S47VV_cjs.collectCrons; }
|
|
20878
20878
|
});
|
|
20879
20879
|
Object.defineProperty(exports, "createScheduledHandler", {
|
|
20880
20880
|
enumerable: true,
|
|
20881
|
-
get: function () { return
|
|
20881
|
+
get: function () { return chunkYS5S47VV_cjs.createScheduledHandler; }
|
|
20882
20882
|
});
|
|
20883
20883
|
Object.defineProperty(exports, "dispatchCronTick", {
|
|
20884
20884
|
enumerable: true,
|
|
20885
|
-
get: function () { return
|
|
20885
|
+
get: function () { return chunkYS5S47VV_cjs.dispatchCronTick; }
|
|
20886
20886
|
});
|
|
20887
20887
|
Object.defineProperty(exports, "getPluginMenu", {
|
|
20888
20888
|
enumerable: true,
|
|
20889
|
-
get: function () { return
|
|
20889
|
+
get: function () { return chunkYS5S47VV_cjs.getPluginMenu; }
|
|
20890
20890
|
});
|
|
20891
20891
|
Object.defineProperty(exports, "registerPlugins", {
|
|
20892
20892
|
enumerable: true,
|
|
20893
|
-
get: function () { return
|
|
20893
|
+
get: function () { return chunkYS5S47VV_cjs.registerPlugins; }
|
|
20894
20894
|
});
|
|
20895
20895
|
Object.defineProperty(exports, "resetPluginMenu", {
|
|
20896
20896
|
enumerable: true,
|
|
20897
|
-
get: function () { return
|
|
20897
|
+
get: function () { return chunkYS5S47VV_cjs.resetPluginMenu; }
|
|
20898
20898
|
});
|
|
20899
20899
|
Object.defineProperty(exports, "resolvePluginMenuItems", {
|
|
20900
20900
|
enumerable: true,
|
|
20901
|
-
get: function () { return
|
|
20901
|
+
get: function () { return chunkYS5S47VV_cjs.resolvePluginMenuItems; }
|
|
20902
20902
|
});
|
|
20903
20903
|
Object.defineProperty(exports, "setPluginMenu", {
|
|
20904
20904
|
enumerable: true,
|
|
20905
|
-
get: function () { return
|
|
20905
|
+
get: function () { return chunkYS5S47VV_cjs.setPluginMenu; }
|
|
20906
20906
|
});
|
|
20907
20907
|
Object.defineProperty(exports, "topoSort", {
|
|
20908
20908
|
enumerable: true,
|
|
20909
|
-
get: function () { return
|
|
20909
|
+
get: function () { return chunkYS5S47VV_cjs.topoSort; }
|
|
20910
20910
|
});
|
|
20911
20911
|
Object.defineProperty(exports, "applySchemaDefaults", {
|
|
20912
20912
|
enumerable: true,
|
|
20913
|
-
get: function () { return
|
|
20913
|
+
get: function () { return chunkEHTBXFTA_cjs.applySchemaDefaults; }
|
|
20914
20914
|
});
|
|
20915
20915
|
Object.defineProperty(exports, "definePlugin", {
|
|
20916
20916
|
enumerable: true,
|
|
20917
|
-
get: function () { return
|
|
20917
|
+
get: function () { return chunkEHTBXFTA_cjs.definePlugin; }
|
|
20918
20918
|
});
|
|
20919
20919
|
Object.defineProperty(exports, "isDefinedPlugin", {
|
|
20920
20920
|
enumerable: true,
|
|
20921
|
-
get: function () { return
|
|
20921
|
+
get: function () { return chunkEHTBXFTA_cjs.isDefinedPlugin; }
|
|
20922
20922
|
});
|
|
20923
20923
|
Object.defineProperty(exports, "parseConfigSchema", {
|
|
20924
20924
|
enumerable: true,
|
|
20925
|
-
get: function () { return
|
|
20925
|
+
get: function () { return chunkEHTBXFTA_cjs.parseConfigSchema; }
|
|
20926
20926
|
});
|
|
20927
20927
|
Object.defineProperty(exports, "parseFormDataToSettings", {
|
|
20928
20928
|
enumerable: true,
|
|
20929
|
-
get: function () { return
|
|
20929
|
+
get: function () { return chunkEHTBXFTA_cjs.parseFormDataToSettings; }
|
|
20930
20930
|
});
|
|
20931
20931
|
Object.defineProperty(exports, "renderSchemaFields", {
|
|
20932
20932
|
enumerable: true,
|
|
20933
|
-
get: function () { return
|
|
20933
|
+
get: function () { return chunkEHTBXFTA_cjs.renderSchemaFields; }
|
|
20934
20934
|
});
|
|
20935
20935
|
Object.defineProperty(exports, "getHookSystem", {
|
|
20936
20936
|
enumerable: true,
|
|
@@ -20978,11 +20978,11 @@ Object.defineProperty(exports, "metricsTracker", {
|
|
|
20978
20978
|
});
|
|
20979
20979
|
Object.defineProperty(exports, "SONICJS_VERSION", {
|
|
20980
20980
|
enumerable: true,
|
|
20981
|
-
get: function () { return
|
|
20981
|
+
get: function () { return chunkNZF3THNY_cjs.SONICJS_VERSION; }
|
|
20982
20982
|
});
|
|
20983
20983
|
Object.defineProperty(exports, "getCoreVersion", {
|
|
20984
20984
|
enumerable: true,
|
|
20985
|
-
get: function () { return
|
|
20985
|
+
get: function () { return chunkNZF3THNY_cjs.getCoreVersion; }
|
|
20986
20986
|
});
|
|
20987
20987
|
Object.defineProperty(exports, "escapeHtml", {
|
|
20988
20988
|
enumerable: true,
|