@sonicjs-cms/core 3.0.0-beta.17 → 3.0.0-beta.18
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-RQ6N3FTV.js → chunk-2XAQTPAE.js} +3 -2
- package/dist/chunk-2XAQTPAE.js.map +1 -0
- package/dist/{chunk-4BTBSXMR.cjs → chunk-36Z3AKX3.cjs} +3 -2
- package/dist/chunk-36Z3AKX3.cjs.map +1 -0
- package/dist/{chunk-PDC7DLOV.js → chunk-3TMTYJAJ.js} +7 -3
- package/dist/chunk-3TMTYJAJ.js.map +1 -0
- package/dist/{chunk-Y34TG4TF.js → chunk-6Z7MZDDF.js} +3 -3
- package/dist/{chunk-Y34TG4TF.js.map → chunk-6Z7MZDDF.js.map} +1 -1
- package/dist/{chunk-RIFCRZYC.js → chunk-BCE6XJYG.js} +3 -3
- package/dist/{chunk-RIFCRZYC.js.map → chunk-BCE6XJYG.js.map} +1 -1
- package/dist/{chunk-MJZI3NHR.cjs → chunk-BUMHSDRW.cjs} +139 -73
- package/dist/chunk-BUMHSDRW.cjs.map +1 -0
- package/dist/{chunk-KDRHGEUF.cjs → chunk-E6LGR24C.cjs} +3 -3
- package/dist/{chunk-KDRHGEUF.cjs.map → chunk-E6LGR24C.cjs.map} +1 -1
- package/dist/{chunk-7YMMCIWY.cjs → chunk-ETRNDMB2.cjs} +3 -2
- package/dist/chunk-ETRNDMB2.cjs.map +1 -0
- package/dist/{chunk-C3KSTUEA.cjs → chunk-FAADMKJX.cjs} +4 -2
- package/dist/chunk-FAADMKJX.cjs.map +1 -0
- package/dist/{chunk-KMCLNO4K.cjs → chunk-GMMCCIQO.cjs} +3 -3
- package/dist/{chunk-KMCLNO4K.cjs.map → chunk-GMMCCIQO.cjs.map} +1 -1
- package/dist/{chunk-CYDEM6SY.js → chunk-GY2XWOG3.js} +23 -17
- package/dist/chunk-GY2XWOG3.js.map +1 -0
- package/dist/{chunk-KXTGLSFY.js → chunk-KCS65CVN.js} +133 -67
- package/dist/chunk-KCS65CVN.js.map +1 -0
- package/dist/{chunk-JEQ7FLOD.cjs → chunk-KIGVVO6N.cjs} +16 -10
- package/dist/chunk-KIGVVO6N.cjs.map +1 -0
- package/dist/{chunk-W36OZTJ5.cjs → chunk-LTZ5WYOK.cjs} +10 -6
- package/dist/chunk-LTZ5WYOK.cjs.map +1 -0
- package/dist/{chunk-ZHQP75SR.cjs → chunk-NOT5YX23.cjs} +19 -18
- package/dist/chunk-NOT5YX23.cjs.map +1 -0
- package/dist/{chunk-73KSHGOT.js → chunk-PXWT5OWC.js} +3 -2
- package/dist/chunk-PXWT5OWC.js.map +1 -0
- package/dist/{chunk-3RNDJAZ5.cjs → chunk-QSDN2CKI.cjs} +4 -4
- package/dist/{chunk-3RNDJAZ5.cjs.map → chunk-QSDN2CKI.cjs.map} +1 -1
- package/dist/{chunk-IQZA2OY5.js → chunk-SOZUG52O.js} +3 -3
- package/dist/{chunk-IQZA2OY5.js.map → chunk-SOZUG52O.js.map} +1 -1
- package/dist/{chunk-YA4V4Y5U.js → chunk-TAB4XUUP.js} +4 -2
- package/dist/chunk-TAB4XUUP.js.map +1 -0
- package/dist/{chunk-GCDZZNIN.js → chunk-UWUP2VMT.js} +16 -10
- package/dist/chunk-UWUP2VMT.js.map +1 -0
- package/dist/{chunk-NOBU34HS.cjs → chunk-V6EZYAWF.cjs} +279 -273
- package/dist/chunk-V6EZYAWF.cjs.map +1 -0
- package/dist/{chunk-OSMPF3PU.js → chunk-ZQLBHD3J.js} +8 -7
- package/dist/chunk-ZQLBHD3J.js.map +1 -0
- package/dist/config-6FB2BXMP.js +6 -0
- package/dist/{config-SM2UWSDN.js.map → config-6FB2BXMP.js.map} +1 -1
- package/dist/{config-YCRSU7ZP.cjs → config-OCH7S4WK.cjs} +5 -5
- package/dist/{config-YCRSU7ZP.cjs.map → config-OCH7S4WK.cjs.map} +1 -1
- package/dist/document-projection-4HG75S5S.js +4 -0
- package/dist/{document-projection-YYMC6I4U.js.map → document-projection-4HG75S5S.js.map} +1 -1
- package/dist/document-projection-JQHSTSFD.cjs +13 -0
- package/dist/{document-projection-TDWRJX3Z.cjs.map → document-projection-JQHSTSFD.cjs.map} +1 -1
- package/dist/index.cjs +327 -291
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +56 -20
- package/dist/index.js.map +1 -1
- package/dist/middleware.cjs +35 -35
- package/dist/middleware.js +6 -6
- package/dist/migrations-GN6H36JS.cjs +13 -0
- package/dist/{migrations-QIRBSVJJ.cjs.map → migrations-GN6H36JS.cjs.map} +1 -1
- package/dist/migrations-KFRAQ4CE.js +4 -0
- package/dist/{migrations-7G6QBDSM.js.map → migrations-KFRAQ4CE.js.map} +1 -1
- package/dist/plugins.cjs +40 -40
- package/dist/plugins.js +3 -3
- package/dist/rbac-7QZ4JZ2E.cjs +14 -0
- package/dist/{rbac-ESTOCVT2.cjs.map → rbac-7QZ4JZ2E.cjs.map} +1 -1
- package/dist/rbac-Y43IEQOP.js +5 -0
- package/dist/{rbac-4QLDXIDF.js.map → rbac-Y43IEQOP.js.map} +1 -1
- package/dist/routes.cjs +29 -29
- package/dist/routes.js +9 -9
- package/dist/services.cjs +30 -30
- package/dist/services.js +3 -3
- package/dist/utils.cjs +3 -3
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-4BTBSXMR.cjs.map +0 -1
- package/dist/chunk-73KSHGOT.js.map +0 -1
- package/dist/chunk-7YMMCIWY.cjs.map +0 -1
- package/dist/chunk-C3KSTUEA.cjs.map +0 -1
- package/dist/chunk-CYDEM6SY.js.map +0 -1
- package/dist/chunk-GCDZZNIN.js.map +0 -1
- package/dist/chunk-JEQ7FLOD.cjs.map +0 -1
- package/dist/chunk-KXTGLSFY.js.map +0 -1
- package/dist/chunk-MJZI3NHR.cjs.map +0 -1
- package/dist/chunk-NOBU34HS.cjs.map +0 -1
- package/dist/chunk-OSMPF3PU.js.map +0 -1
- package/dist/chunk-PDC7DLOV.js.map +0 -1
- package/dist/chunk-RQ6N3FTV.js.map +0 -1
- package/dist/chunk-W36OZTJ5.cjs.map +0 -1
- package/dist/chunk-YA4V4Y5U.js.map +0 -1
- package/dist/chunk-ZHQP75SR.cjs.map +0 -1
- package/dist/config-SM2UWSDN.js +0 -6
- package/dist/document-projection-TDWRJX3Z.cjs +0 -13
- package/dist/document-projection-YYMC6I4U.js +0 -4
- package/dist/migrations-7G6QBDSM.js +0 -4
- package/dist/migrations-QIRBSVJJ.cjs +0 -13
- package/dist/rbac-4QLDXIDF.js +0 -5
- package/dist/rbac-ESTOCVT2.cjs +0 -14
package/dist/index.cjs
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkGMMCCIQO_cjs = require('./chunk-GMMCCIQO.cjs');
|
|
4
|
+
var chunkV6EZYAWF_cjs = require('./chunk-V6EZYAWF.cjs');
|
|
5
5
|
require('./chunk-XWVDSM2L.cjs');
|
|
6
6
|
require('./chunk-N32OWET6.cjs');
|
|
7
|
-
var
|
|
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
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
10
|
+
var chunkNOT5YX23_cjs = require('./chunk-NOT5YX23.cjs');
|
|
11
|
+
var chunkLTZ5WYOK_cjs = require('./chunk-LTZ5WYOK.cjs');
|
|
12
|
+
var chunkKIGVVO6N_cjs = require('./chunk-KIGVVO6N.cjs');
|
|
13
|
+
var chunkFAADMKJX_cjs = require('./chunk-FAADMKJX.cjs');
|
|
14
|
+
var chunkETRNDMB2_cjs = require('./chunk-ETRNDMB2.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 chunkBUMHSDRW_cjs = require('./chunk-BUMHSDRW.cjs');
|
|
19
|
+
var chunkQSDN2CKI_cjs = require('./chunk-QSDN2CKI.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 chunkE6LGR24C_cjs = require('./chunk-E6LGR24C.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');
|
|
@@ -40,6 +40,7 @@ var DatabaseToolsService = class {
|
|
|
40
40
|
constructor(db) {
|
|
41
41
|
this.db = db;
|
|
42
42
|
}
|
|
43
|
+
db;
|
|
43
44
|
/**
|
|
44
45
|
* Get database statistics
|
|
45
46
|
*/
|
|
@@ -574,7 +575,7 @@ function formatCellValue(value) {
|
|
|
574
575
|
// src/plugins/core-plugins/database-tools-plugin/admin-routes.ts
|
|
575
576
|
function createDatabaseToolsAdminRoutes() {
|
|
576
577
|
const router3 = new hono.Hono();
|
|
577
|
-
router3.use("*",
|
|
578
|
+
router3.use("*", chunkNOT5YX23_cjs.requireAuth());
|
|
578
579
|
router3.get("/api/stats", async (c) => {
|
|
579
580
|
try {
|
|
580
581
|
const user = c.get("user");
|
|
@@ -898,6 +899,7 @@ var EmailSettingsService = class {
|
|
|
898
899
|
constructor(db) {
|
|
899
900
|
this.db = db;
|
|
900
901
|
}
|
|
902
|
+
db;
|
|
901
903
|
async load() {
|
|
902
904
|
let row = null;
|
|
903
905
|
try {
|
|
@@ -926,8 +928,10 @@ var SiteConfigService = class {
|
|
|
926
928
|
this.db = db;
|
|
927
929
|
this.env = env;
|
|
928
930
|
}
|
|
931
|
+
db;
|
|
932
|
+
env;
|
|
929
933
|
async load() {
|
|
930
|
-
const settings = new
|
|
934
|
+
const settings = new chunk36Z3AKX3_cjs.SettingsService(this.db);
|
|
931
935
|
const general = await settings.getGeneralSettings();
|
|
932
936
|
const siteUrl = this.env.PUBLIC_URL || "http://localhost:8787";
|
|
933
937
|
return {
|
|
@@ -977,7 +981,7 @@ var SiteConfigService = class {
|
|
|
977
981
|
|
|
978
982
|
// src/plugins/core-plugins/email-plugin/routes/admin.ts
|
|
979
983
|
var adminRoutes = new hono.Hono();
|
|
980
|
-
adminRoutes.use("*",
|
|
984
|
+
adminRoutes.use("*", chunkNOT5YX23_cjs.requireAuth());
|
|
981
985
|
adminRoutes.post("/settings", async (c) => {
|
|
982
986
|
if (c.get("user")?.role !== "admin") {
|
|
983
987
|
return c.json({ error: "admin role required" }, 403);
|
|
@@ -1015,7 +1019,7 @@ adminRoutes.post("/test", async (c) => {
|
|
|
1015
1019
|
const { subject, html: html4, text } = renderTestEmail({ siteName });
|
|
1016
1020
|
try {
|
|
1017
1021
|
const settingsLoaded = await settings.load();
|
|
1018
|
-
const result = await
|
|
1022
|
+
const result = await chunkV6EZYAWF_cjs.getEmailService().send({
|
|
1019
1023
|
to,
|
|
1020
1024
|
subject,
|
|
1021
1025
|
html: html4,
|
|
@@ -1097,7 +1101,7 @@ function makeOnRegistrationCompleted(env) {
|
|
|
1097
1101
|
siteName,
|
|
1098
1102
|
loginUrl: siteConfig.buildLoginUrl(siteUrl)
|
|
1099
1103
|
});
|
|
1100
|
-
const result = await
|
|
1104
|
+
const result = await chunkV6EZYAWF_cjs.getEmailService().send({
|
|
1101
1105
|
to: user.email,
|
|
1102
1106
|
subject,
|
|
1103
1107
|
html: html4,
|
|
@@ -1171,7 +1175,7 @@ function makeOnPasswordResetRequested(env) {
|
|
|
1171
1175
|
expiresAt: Date.now() + DEFAULT_EXPIRY_MS,
|
|
1172
1176
|
siteName
|
|
1173
1177
|
});
|
|
1174
|
-
const result = await
|
|
1178
|
+
const result = await chunkV6EZYAWF_cjs.getEmailService().send({
|
|
1175
1179
|
to: user.email,
|
|
1176
1180
|
subject,
|
|
1177
1181
|
html: html4,
|
|
@@ -1239,7 +1243,7 @@ function makeOnPasswordResetCompleted(env) {
|
|
|
1239
1243
|
supportEmail,
|
|
1240
1244
|
when: Date.now()
|
|
1241
1245
|
});
|
|
1242
|
-
const result = await
|
|
1246
|
+
const result = await chunkV6EZYAWF_cjs.getEmailService().send({
|
|
1243
1247
|
to: user.email,
|
|
1244
1248
|
subject,
|
|
1245
1249
|
html: html4,
|
|
@@ -1263,6 +1267,8 @@ var EmailValidationError = class extends Error {
|
|
|
1263
1267
|
this.reason = reason;
|
|
1264
1268
|
this.name = "EmailValidationError";
|
|
1265
1269
|
}
|
|
1270
|
+
field;
|
|
1271
|
+
reason;
|
|
1266
1272
|
code = "EMAIL_VALIDATION_FAILED";
|
|
1267
1273
|
};
|
|
1268
1274
|
|
|
@@ -1298,6 +1304,9 @@ var CfGraphqlClient = class {
|
|
|
1298
1304
|
throw new EmailValidationError("apiToken", "EMAIL_API_TOKEN is required for GraphQL queries");
|
|
1299
1305
|
}
|
|
1300
1306
|
}
|
|
1307
|
+
zoneId;
|
|
1308
|
+
apiToken;
|
|
1309
|
+
fetchImpl;
|
|
1301
1310
|
async queryEmailSends(input) {
|
|
1302
1311
|
const startIso = new Date(input.startSeconds * 1e3).toISOString();
|
|
1303
1312
|
const endIso = new Date(input.endSeconds * 1e3).toISOString();
|
|
@@ -1360,6 +1369,7 @@ var EmailLogService = class {
|
|
|
1360
1369
|
constructor(db) {
|
|
1361
1370
|
this.db = db;
|
|
1362
1371
|
}
|
|
1372
|
+
db;
|
|
1363
1373
|
/**
|
|
1364
1374
|
* Records a successful submission to CF Email Service. `status` =
|
|
1365
1375
|
* `'submitted'`, `delivery_state` remains NULL until reconciliation runs.
|
|
@@ -1533,6 +1543,8 @@ var ReconciliationService = class {
|
|
|
1533
1543
|
this.graphql = graphql;
|
|
1534
1544
|
this.emailLog = emailLog;
|
|
1535
1545
|
}
|
|
1546
|
+
graphql;
|
|
1547
|
+
emailLog;
|
|
1536
1548
|
async run(input = {}) {
|
|
1537
1549
|
const windowHours = input.windowHours ?? 24;
|
|
1538
1550
|
const nowMs = input.now ?? Date.now();
|
|
@@ -1941,6 +1953,7 @@ var CloudflareEmailProvider = class {
|
|
|
1941
1953
|
constructor(binding) {
|
|
1942
1954
|
this.binding = binding;
|
|
1943
1955
|
}
|
|
1956
|
+
binding;
|
|
1944
1957
|
name = "cloudflare";
|
|
1945
1958
|
isConfigured() {
|
|
1946
1959
|
return !!this.binding;
|
|
@@ -1971,7 +1984,7 @@ var CloudflareEmailProvider = class {
|
|
|
1971
1984
|
}
|
|
1972
1985
|
}
|
|
1973
1986
|
};
|
|
1974
|
-
var emailPluginV3 =
|
|
1987
|
+
var emailPluginV3 = chunkQSDN2CKI_cjs.definePlugin({
|
|
1975
1988
|
id: "email",
|
|
1976
1989
|
version: "1.0.0",
|
|
1977
1990
|
name: "Email",
|
|
@@ -1985,7 +1998,7 @@ var emailPluginV3 = chunk3RNDJAZ5_cjs.definePlugin({
|
|
|
1985
1998
|
const db = env.DB;
|
|
1986
1999
|
if (db) {
|
|
1987
2000
|
try {
|
|
1988
|
-
const typeRegistry = new
|
|
2001
|
+
const typeRegistry = new chunkNOT5YX23_cjs.DocumentTypeRegistry(db);
|
|
1989
2002
|
await typeRegistry.register({
|
|
1990
2003
|
id: "email_log",
|
|
1991
2004
|
name: "email_log",
|
|
@@ -2000,7 +2013,7 @@ var emailPluginV3 = chunk3RNDJAZ5_cjs.definePlugin({
|
|
|
2000
2013
|
} catch {
|
|
2001
2014
|
}
|
|
2002
2015
|
}
|
|
2003
|
-
if (!
|
|
2016
|
+
if (!chunkV6EZYAWF_cjs.hasEmailService()) {
|
|
2004
2017
|
const settings = db ? await new EmailSettingsService(db).load() : {};
|
|
2005
2018
|
const envResendKey = typeof env.RESEND_API_KEY === "string" && env.RESEND_API_KEY ? env.RESEND_API_KEY : void 0;
|
|
2006
2019
|
const cfEmailBinding = env.EMAIL;
|
|
@@ -2018,7 +2031,7 @@ var emailPluginV3 = chunk3RNDJAZ5_cjs.definePlugin({
|
|
|
2018
2031
|
} else {
|
|
2019
2032
|
provider = resolveEmailProvider({ env });
|
|
2020
2033
|
}
|
|
2021
|
-
|
|
2034
|
+
chunkV6EZYAWF_cjs.setEmailService(new EmailService({ ...serviceOpts, provider }));
|
|
2022
2035
|
}
|
|
2023
2036
|
ctx.hooks.on("auth:registration:completed", makeOnRegistrationCompleted(env));
|
|
2024
2037
|
ctx.hooks.on("auth:password-reset:requested", makeOnPasswordResetRequested(env));
|
|
@@ -2029,7 +2042,7 @@ var emailPluginV3 = chunk3RNDJAZ5_cjs.definePlugin({
|
|
|
2029
2042
|
var BATCH_SIZE = 100;
|
|
2030
2043
|
({
|
|
2031
2044
|
schema: zod.z.record(zod.z.string(), zod.z.unknown())});
|
|
2032
|
-
var emailReconciliationPlugin =
|
|
2045
|
+
var emailReconciliationPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
2033
2046
|
id: "email-reconciliation",
|
|
2034
2047
|
version: "1.0.0",
|
|
2035
2048
|
description: "Hourly cron that backfills email delivery state from provider status APIs. Only active for providers that implement EmailProvider.reconcile().",
|
|
@@ -2050,11 +2063,11 @@ var emailReconciliationPlugin = chunk3RNDJAZ5_cjs.definePlugin({
|
|
|
2050
2063
|
console.warn("[email-reconciliation] No DB binding in cron env \u2014 skipping.");
|
|
2051
2064
|
return;
|
|
2052
2065
|
}
|
|
2053
|
-
if (!
|
|
2066
|
+
if (!chunkV6EZYAWF_cjs.hasEmailService()) {
|
|
2054
2067
|
console.warn("[email-reconciliation] EmailService not initialized \u2014 skipping.");
|
|
2055
2068
|
return;
|
|
2056
2069
|
}
|
|
2057
|
-
const emailService =
|
|
2070
|
+
const emailService = chunkV6EZYAWF_cjs.getEmailService();
|
|
2058
2071
|
let rows = [];
|
|
2059
2072
|
try {
|
|
2060
2073
|
const result = await db.prepare(
|
|
@@ -2123,6 +2136,7 @@ var OTPService = class {
|
|
|
2123
2136
|
constructor(db) {
|
|
2124
2137
|
this.db = db;
|
|
2125
2138
|
}
|
|
2139
|
+
db;
|
|
2126
2140
|
/**
|
|
2127
2141
|
* Generate a secure random OTP code
|
|
2128
2142
|
*/
|
|
@@ -2486,7 +2500,7 @@ function buildOtpApi() {
|
|
|
2486
2500
|
console.warn("Failed to parse OTP plugin settings, using defaults");
|
|
2487
2501
|
}
|
|
2488
2502
|
}
|
|
2489
|
-
const settingsService = new
|
|
2503
|
+
const settingsService = new chunk36Z3AKX3_cjs.SettingsService(db);
|
|
2490
2504
|
const generalSettings = await settingsService.getGeneralSettings();
|
|
2491
2505
|
const siteName = generalSettings.siteName;
|
|
2492
2506
|
const canRequest = await otpService.checkRateLimit(normalizedEmail, settings);
|
|
@@ -2540,8 +2554,8 @@ function buildOtpApi() {
|
|
|
2540
2554
|
loginUrl: settings.loginUrl || "",
|
|
2541
2555
|
loginButtonText: settings.loginButtonText || ""
|
|
2542
2556
|
});
|
|
2543
|
-
if (
|
|
2544
|
-
const sent = await
|
|
2557
|
+
if (chunkV6EZYAWF_cjs.hasEmailService()) {
|
|
2558
|
+
const sent = await chunkV6EZYAWF_cjs.getEmailService().send({
|
|
2545
2559
|
to: normalizedEmail,
|
|
2546
2560
|
subject: `Your login code for ${siteName}`,
|
|
2547
2561
|
flow: "otp",
|
|
@@ -2643,21 +2657,21 @@ function buildOtpApi() {
|
|
|
2643
2657
|
error: "Account is deactivated"
|
|
2644
2658
|
}, 403);
|
|
2645
2659
|
}
|
|
2646
|
-
const tokenTtl = await
|
|
2647
|
-
const token = await
|
|
2660
|
+
const tokenTtl = await chunkNOT5YX23_cjs.getJwtExpirySecondsFromDb(db, c.env);
|
|
2661
|
+
const token = await chunkNOT5YX23_cjs.AuthManager.generateToken(user.id, user.email, user.role, c.env.JWT_SECRET, tokenTtl);
|
|
2648
2662
|
cookie.setCookie(c, "auth_token", token, {
|
|
2649
2663
|
httpOnly: true,
|
|
2650
2664
|
secure: true,
|
|
2651
2665
|
sameSite: "Strict",
|
|
2652
2666
|
maxAge: tokenTtl
|
|
2653
2667
|
});
|
|
2654
|
-
|
|
2668
|
+
chunkV6EZYAWF_cjs.dispatchHookEvent(
|
|
2655
2669
|
c,
|
|
2656
2670
|
"auth:otp:verified",
|
|
2657
2671
|
{ user: { id: user.id, email: user.email, role: user.role } },
|
|
2658
2672
|
"fire-and-forget"
|
|
2659
2673
|
);
|
|
2660
|
-
const customData = await
|
|
2674
|
+
const customData = await chunkV6EZYAWF_cjs.getCustomData(db, user.id);
|
|
2661
2675
|
const { is_active: _isActive, ...publicUser } = user;
|
|
2662
2676
|
return c.json({
|
|
2663
2677
|
success: true,
|
|
@@ -2702,7 +2716,7 @@ function buildOtpApi() {
|
|
|
2702
2716
|
});
|
|
2703
2717
|
return otpAPI;
|
|
2704
2718
|
}
|
|
2705
|
-
var otpLoginPlugin =
|
|
2719
|
+
var otpLoginPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
2706
2720
|
id: "otp-login",
|
|
2707
2721
|
version: "1.0.0",
|
|
2708
2722
|
name: "OTP Login",
|
|
@@ -2757,6 +2771,7 @@ var OAuthService = class {
|
|
|
2757
2771
|
constructor(db) {
|
|
2758
2772
|
this.db = db;
|
|
2759
2773
|
}
|
|
2774
|
+
db;
|
|
2760
2775
|
/**
|
|
2761
2776
|
* Build the authorization redirect URL for a provider.
|
|
2762
2777
|
*/
|
|
@@ -3099,15 +3114,15 @@ function buildOauthApi() {
|
|
|
3099
3114
|
if (!user || !user.is_active) {
|
|
3100
3115
|
return c.redirect("/auth/login?error=Account is deactivated");
|
|
3101
3116
|
}
|
|
3102
|
-
const tokenTtl2 = await
|
|
3103
|
-
const jwt2 = await
|
|
3117
|
+
const tokenTtl2 = await chunkNOT5YX23_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
|
|
3118
|
+
const jwt2 = await chunkNOT5YX23_cjs.AuthManager.generateToken(
|
|
3104
3119
|
user.id,
|
|
3105
3120
|
user.email,
|
|
3106
3121
|
user.role,
|
|
3107
3122
|
c.env.JWT_SECRET,
|
|
3108
3123
|
tokenTtl2
|
|
3109
3124
|
);
|
|
3110
|
-
|
|
3125
|
+
chunkNOT5YX23_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
|
|
3111
3126
|
return c.redirect("/admin");
|
|
3112
3127
|
}
|
|
3113
3128
|
const existingUser = await oauthService.findUserByEmail(profile.email);
|
|
@@ -3124,15 +3139,15 @@ function buildOauthApi() {
|
|
|
3124
3139
|
tokenExpiresAt: tokenExpiresAt ?? void 0,
|
|
3125
3140
|
profileData: JSON.stringify(profile)
|
|
3126
3141
|
});
|
|
3127
|
-
const tokenTtl2 = await
|
|
3128
|
-
const jwt2 = await
|
|
3142
|
+
const tokenTtl2 = await chunkNOT5YX23_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
|
|
3143
|
+
const jwt2 = await chunkNOT5YX23_cjs.AuthManager.generateToken(
|
|
3129
3144
|
existingUser.id,
|
|
3130
3145
|
existingUser.email,
|
|
3131
3146
|
existingUser.role,
|
|
3132
3147
|
c.env.JWT_SECRET,
|
|
3133
3148
|
tokenTtl2
|
|
3134
3149
|
);
|
|
3135
|
-
|
|
3150
|
+
chunkNOT5YX23_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
|
|
3136
3151
|
return c.redirect("/admin");
|
|
3137
3152
|
}
|
|
3138
3153
|
const newUserId = await oauthService.createUserFromOAuth(profile);
|
|
@@ -3145,15 +3160,15 @@ function buildOauthApi() {
|
|
|
3145
3160
|
tokenExpiresAt: tokenExpiresAt ?? void 0,
|
|
3146
3161
|
profileData: JSON.stringify(profile)
|
|
3147
3162
|
});
|
|
3148
|
-
const tokenTtl = await
|
|
3149
|
-
const jwt = await
|
|
3163
|
+
const tokenTtl = await chunkNOT5YX23_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
|
|
3164
|
+
const jwt = await chunkNOT5YX23_cjs.AuthManager.generateToken(
|
|
3150
3165
|
newUserId,
|
|
3151
3166
|
profile.email.toLowerCase(),
|
|
3152
3167
|
"viewer",
|
|
3153
3168
|
c.env.JWT_SECRET,
|
|
3154
3169
|
tokenTtl
|
|
3155
3170
|
);
|
|
3156
|
-
|
|
3171
|
+
chunkNOT5YX23_cjs.AuthManager.setAuthCookie(c, jwt, { sameSite: "Lax", maxAge: tokenTtl });
|
|
3157
3172
|
return c.redirect("/admin");
|
|
3158
3173
|
} catch (error) {
|
|
3159
3174
|
console.error("OAuth callback error:", error);
|
|
@@ -3248,7 +3263,7 @@ function buildOauthApi() {
|
|
|
3248
3263
|
});
|
|
3249
3264
|
return oauthAPI;
|
|
3250
3265
|
}
|
|
3251
|
-
var oauthProvidersPlugin =
|
|
3266
|
+
var oauthProvidersPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
3252
3267
|
id: "oauth-providers",
|
|
3253
3268
|
version: "1.0.0",
|
|
3254
3269
|
name: "OAuth Providers",
|
|
@@ -3273,6 +3288,7 @@ var EmbeddingService = class {
|
|
|
3273
3288
|
constructor(ai) {
|
|
3274
3289
|
this.ai = ai;
|
|
3275
3290
|
}
|
|
3291
|
+
ai;
|
|
3276
3292
|
/**
|
|
3277
3293
|
* Generate embedding for a single text
|
|
3278
3294
|
*/
|
|
@@ -3477,6 +3493,9 @@ var CustomRAGService = class {
|
|
|
3477
3493
|
this.embeddingService = new EmbeddingService(ai);
|
|
3478
3494
|
this.chunkingService = new ChunkingService();
|
|
3479
3495
|
}
|
|
3496
|
+
db;
|
|
3497
|
+
ai;
|
|
3498
|
+
vectorize;
|
|
3480
3499
|
embeddingService;
|
|
3481
3500
|
chunkingService;
|
|
3482
3501
|
/**
|
|
@@ -3767,6 +3786,9 @@ var AISearchService = class {
|
|
|
3767
3786
|
console.log("[AISearchService] Custom RAG not available, using keyword search only");
|
|
3768
3787
|
}
|
|
3769
3788
|
}
|
|
3789
|
+
db;
|
|
3790
|
+
ai;
|
|
3791
|
+
vectorize;
|
|
3770
3792
|
customRAG;
|
|
3771
3793
|
/**
|
|
3772
3794
|
* Get plugin settings
|
|
@@ -3825,7 +3847,7 @@ var AISearchService = class {
|
|
|
3825
3847
|
*/
|
|
3826
3848
|
async detectNewCollections() {
|
|
3827
3849
|
try {
|
|
3828
|
-
const allCollections =
|
|
3850
|
+
const allCollections = chunkFAADMKJX_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => ({
|
|
3829
3851
|
id: r.id,
|
|
3830
3852
|
name: r.name,
|
|
3831
3853
|
display_name: r.displayName,
|
|
@@ -3877,7 +3899,7 @@ var AISearchService = class {
|
|
|
3877
3899
|
*/
|
|
3878
3900
|
async getAllCollections() {
|
|
3879
3901
|
try {
|
|
3880
|
-
const allCollections =
|
|
3902
|
+
const allCollections = chunkFAADMKJX_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).sort((a, b) => a.displayName.localeCompare(b.displayName)).map((r) => ({
|
|
3881
3903
|
id: r.id,
|
|
3882
3904
|
name: r.name,
|
|
3883
3905
|
display_name: r.displayName,
|
|
@@ -4207,13 +4229,16 @@ var IndexManager = class {
|
|
|
4207
4229
|
console.log("[IndexManager] Custom RAG initialized");
|
|
4208
4230
|
}
|
|
4209
4231
|
}
|
|
4232
|
+
db;
|
|
4233
|
+
ai;
|
|
4234
|
+
vectorize;
|
|
4210
4235
|
customRAG;
|
|
4211
4236
|
/**
|
|
4212
4237
|
* Index all content items within a collection using Custom RAG
|
|
4213
4238
|
*/
|
|
4214
4239
|
async indexCollection(collectionId) {
|
|
4215
4240
|
try {
|
|
4216
|
-
const registry =
|
|
4241
|
+
const registry = chunkFAADMKJX_cjs.getCollectionRegistry();
|
|
4217
4242
|
const record = registry.getById(collectionId) ?? registry.getByName(collectionId);
|
|
4218
4243
|
if (!record) {
|
|
4219
4244
|
throw new Error(`Collection ${collectionId} not found`);
|
|
@@ -4840,7 +4865,7 @@ function renderSettingsPage(data) {
|
|
|
4840
4865
|
|
|
4841
4866
|
// src/plugins/core-plugins/ai-search-plugin/routes/admin.ts
|
|
4842
4867
|
var adminRoutes2 = new hono.Hono();
|
|
4843
|
-
adminRoutes2.use("*",
|
|
4868
|
+
adminRoutes2.use("*", chunkNOT5YX23_cjs.requireAuth());
|
|
4844
4869
|
adminRoutes2.get("/", async (c) => {
|
|
4845
4870
|
try {
|
|
4846
4871
|
const user = c.get("user");
|
|
@@ -5081,7 +5106,7 @@ var manifest_default = {
|
|
|
5081
5106
|
author: "SonicJS"};
|
|
5082
5107
|
|
|
5083
5108
|
// src/plugins/core-plugins/ai-search-plugin/index.ts
|
|
5084
|
-
var aiSearchPlugin =
|
|
5109
|
+
var aiSearchPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
5085
5110
|
id: manifest_default.id,
|
|
5086
5111
|
version: manifest_default.version,
|
|
5087
5112
|
name: manifest_default.name,
|
|
@@ -5134,12 +5159,14 @@ var SecurityAuditService = class {
|
|
|
5134
5159
|
constructor(db, settings = DEFAULT_SETTINGS2) {
|
|
5135
5160
|
this.db = db;
|
|
5136
5161
|
this.settings = settings;
|
|
5137
|
-
this.docsService = new
|
|
5162
|
+
this.docsService = new chunkLTZ5WYOK_cjs.DocumentsService(db, {
|
|
5138
5163
|
queryableFields: QUERYABLE_FIELDS,
|
|
5139
5164
|
maxVersionsPerRoot: 1,
|
|
5140
5165
|
tenantId: TENANT
|
|
5141
5166
|
});
|
|
5142
5167
|
}
|
|
5168
|
+
db;
|
|
5169
|
+
settings;
|
|
5143
5170
|
docsService;
|
|
5144
5171
|
async logEvent(event) {
|
|
5145
5172
|
const doc = await this.docsService.create({
|
|
@@ -5952,7 +5979,7 @@ function renderSecuritySettingsPage(data) {
|
|
|
5952
5979
|
|
|
5953
5980
|
// src/plugins/core-plugins/security-audit-plugin/routes/admin.ts
|
|
5954
5981
|
var adminRoutes3 = new hono.Hono();
|
|
5955
|
-
adminRoutes3.use("*",
|
|
5982
|
+
adminRoutes3.use("*", chunkNOT5YX23_cjs.requireAuth());
|
|
5956
5983
|
adminRoutes3.use("*", async (c, next) => {
|
|
5957
5984
|
const user = c.get("user");
|
|
5958
5985
|
if (user?.role !== "admin") {
|
|
@@ -5962,7 +5989,7 @@ adminRoutes3.use("*", async (c, next) => {
|
|
|
5962
5989
|
});
|
|
5963
5990
|
async function getSettings(db) {
|
|
5964
5991
|
try {
|
|
5965
|
-
const pluginService = new
|
|
5992
|
+
const pluginService = new chunkFAADMKJX_cjs.PluginService(db);
|
|
5966
5993
|
const plugin2 = await pluginService.getPlugin("security-audit");
|
|
5967
5994
|
if (plugin2?.settings) {
|
|
5968
5995
|
const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
@@ -6067,7 +6094,7 @@ adminRoutes3.post("/settings", async (c) => {
|
|
|
6067
6094
|
autoPurge: body["retention.autoPurge"] === "true"
|
|
6068
6095
|
}
|
|
6069
6096
|
};
|
|
6070
|
-
const pluginService = new
|
|
6097
|
+
const pluginService = new chunkFAADMKJX_cjs.PluginService(db);
|
|
6071
6098
|
await pluginService.updatePluginSettings("security-audit", settings);
|
|
6072
6099
|
if (c.req.header("HX-Request")) {
|
|
6073
6100
|
return c.json({ success: true });
|
|
@@ -6083,6 +6110,7 @@ var BruteForceDetector = class {
|
|
|
6083
6110
|
this.kv = kv;
|
|
6084
6111
|
this.settings = settings || DEFAULT_SETTINGS2.bruteForce;
|
|
6085
6112
|
}
|
|
6113
|
+
kv;
|
|
6086
6114
|
settings;
|
|
6087
6115
|
async recordFailedAttempt(ip, email) {
|
|
6088
6116
|
if (!this.settings.enabled || !this.kv) {
|
|
@@ -6228,7 +6256,7 @@ var BruteForceDetector = class {
|
|
|
6228
6256
|
|
|
6229
6257
|
// src/plugins/core-plugins/security-audit-plugin/routes/api.ts
|
|
6230
6258
|
var apiRoutes2 = new hono.Hono();
|
|
6231
|
-
apiRoutes2.use("*",
|
|
6259
|
+
apiRoutes2.use("*", chunkNOT5YX23_cjs.requireAuth());
|
|
6232
6260
|
apiRoutes2.use("*", async (c, next) => {
|
|
6233
6261
|
const user = c.get("user");
|
|
6234
6262
|
if (user?.role !== "admin") {
|
|
@@ -6238,7 +6266,7 @@ apiRoutes2.use("*", async (c, next) => {
|
|
|
6238
6266
|
});
|
|
6239
6267
|
async function getSettings2(db) {
|
|
6240
6268
|
try {
|
|
6241
|
-
const pluginService = new
|
|
6269
|
+
const pluginService = new chunkFAADMKJX_cjs.PluginService(db);
|
|
6242
6270
|
const plugin2 = await pluginService.getPlugin("security-audit");
|
|
6243
6271
|
if (plugin2?.settings) {
|
|
6244
6272
|
const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
@@ -6386,7 +6414,7 @@ function generateFingerprint(ip, userAgent) {
|
|
|
6386
6414
|
}
|
|
6387
6415
|
async function getPluginSettings(db) {
|
|
6388
6416
|
try {
|
|
6389
|
-
const pluginService = new
|
|
6417
|
+
const pluginService = new chunkFAADMKJX_cjs.PluginService(db);
|
|
6390
6418
|
const plugin2 = await pluginService.getPlugin("security-audit");
|
|
6391
6419
|
if (plugin2?.settings) {
|
|
6392
6420
|
const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
@@ -6617,7 +6645,7 @@ async function logAuthEvent(c, db, settings, ip, userAgent, countryCode, fingerp
|
|
|
6617
6645
|
|
|
6618
6646
|
// src/plugins/core-plugins/security-audit-plugin/index.ts
|
|
6619
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>`;
|
|
6620
|
-
var securityAuditPlugin =
|
|
6648
|
+
var securityAuditPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
6621
6649
|
id: "security-audit",
|
|
6622
6650
|
version: "1.0.0",
|
|
6623
6651
|
name: "Security Audit",
|
|
@@ -6664,8 +6692,10 @@ var ApiKeyService = class {
|
|
|
6664
6692
|
this.db = db;
|
|
6665
6693
|
this.tenantId = tenantId;
|
|
6666
6694
|
}
|
|
6695
|
+
db;
|
|
6696
|
+
tenantId;
|
|
6667
6697
|
docService() {
|
|
6668
|
-
return new
|
|
6698
|
+
return new chunkLTZ5WYOK_cjs.DocumentsService(this.db, {
|
|
6669
6699
|
queryableFields: API_KEY_QUERYABLE,
|
|
6670
6700
|
tenantId: this.tenantId,
|
|
6671
6701
|
maxVersionsPerRoot: 1
|
|
@@ -6691,7 +6721,7 @@ var ApiKeyService = class {
|
|
|
6691
6721
|
const prefix = secret.slice(0, DISPLAY_PREFIX_LEN);
|
|
6692
6722
|
const expiresAt = input.expiresAt ?? null;
|
|
6693
6723
|
const doc = await this.docService().create(
|
|
6694
|
-
|
|
6724
|
+
chunkV6EZYAWF_cjs.createDocumentSchema.parse({
|
|
6695
6725
|
typeId: "api_key",
|
|
6696
6726
|
tenantId: this.tenantId,
|
|
6697
6727
|
title: name,
|
|
@@ -6961,7 +6991,7 @@ var createSchema = zod.z.object({
|
|
|
6961
6991
|
});
|
|
6962
6992
|
async function getSettings3(db) {
|
|
6963
6993
|
try {
|
|
6964
|
-
const plugin2 = await new
|
|
6994
|
+
const plugin2 = await new chunkFAADMKJX_cjs.PluginService(db).getPlugin("api-keys");
|
|
6965
6995
|
if (plugin2?.settings) {
|
|
6966
6996
|
const s = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
6967
6997
|
return { ...DEFAULT_SETTINGS3, ...s };
|
|
@@ -6970,7 +7000,7 @@ async function getSettings3(db) {
|
|
|
6970
7000
|
}
|
|
6971
7001
|
return DEFAULT_SETTINGS3;
|
|
6972
7002
|
}
|
|
6973
|
-
adminRoutes4.use("*",
|
|
7003
|
+
adminRoutes4.use("*", chunkNOT5YX23_cjs.requireAuth());
|
|
6974
7004
|
adminRoutes4.use("*", async (c, next) => {
|
|
6975
7005
|
const user = c.get("user");
|
|
6976
7006
|
if (user?.role !== "admin") {
|
|
@@ -7055,7 +7085,7 @@ function apiKeyAuthMiddleware() {
|
|
|
7055
7085
|
|
|
7056
7086
|
// src/plugins/core-plugins/api-keys-plugin/index.ts
|
|
7057
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>`;
|
|
7058
|
-
var apiKeysPlugin =
|
|
7088
|
+
var apiKeysPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
7059
7089
|
id: "api-keys",
|
|
7060
7090
|
version: "1.0.0-beta.1",
|
|
7061
7091
|
name: "API Keys",
|
|
@@ -7091,6 +7121,7 @@ var SubscriptionService = class {
|
|
|
7091
7121
|
constructor(db) {
|
|
7092
7122
|
this.db = db;
|
|
7093
7123
|
}
|
|
7124
|
+
db;
|
|
7094
7125
|
/**
|
|
7095
7126
|
* Ensure the subscriptions table exists
|
|
7096
7127
|
*/
|
|
@@ -7329,6 +7360,7 @@ var StripeEventService = class {
|
|
|
7329
7360
|
constructor(db) {
|
|
7330
7361
|
this.db = db;
|
|
7331
7362
|
}
|
|
7363
|
+
db;
|
|
7332
7364
|
async ensureTable() {
|
|
7333
7365
|
await this.db.prepare(`
|
|
7334
7366
|
CREATE TABLE IF NOT EXISTS stripe_events (
|
|
@@ -7824,7 +7856,7 @@ var DEFAULT_SETTINGS4 = {
|
|
|
7824
7856
|
|
|
7825
7857
|
// src/plugins/core-plugins/stripe-plugin/routes/admin.ts
|
|
7826
7858
|
var adminRoutes5 = new hono.Hono();
|
|
7827
|
-
adminRoutes5.use("*",
|
|
7859
|
+
adminRoutes5.use("*", chunkNOT5YX23_cjs.requireAuth());
|
|
7828
7860
|
adminRoutes5.use("*", async (c, next) => {
|
|
7829
7861
|
const user = c.get("user");
|
|
7830
7862
|
if (user?.role !== "admin") {
|
|
@@ -7834,7 +7866,7 @@ adminRoutes5.use("*", async (c, next) => {
|
|
|
7834
7866
|
});
|
|
7835
7867
|
async function getSettings4(db) {
|
|
7836
7868
|
try {
|
|
7837
|
-
const pluginService = new
|
|
7869
|
+
const pluginService = new chunkFAADMKJX_cjs.PluginService(db);
|
|
7838
7870
|
const plugin2 = await pluginService.getPlugin("stripe");
|
|
7839
7871
|
if (plugin2?.settings) {
|
|
7840
7872
|
const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
@@ -8025,6 +8057,7 @@ var StripeAPI = class {
|
|
|
8025
8057
|
constructor(secretKey) {
|
|
8026
8058
|
this.secretKey = secretKey;
|
|
8027
8059
|
}
|
|
8060
|
+
secretKey;
|
|
8028
8061
|
baseUrl = "https://api.stripe.com/v1";
|
|
8029
8062
|
/**
|
|
8030
8063
|
* Verify a webhook signature
|
|
@@ -8156,7 +8189,7 @@ function timingSafeEqual(a, b) {
|
|
|
8156
8189
|
var apiRoutes3 = new hono.Hono();
|
|
8157
8190
|
async function getSettings5(db) {
|
|
8158
8191
|
try {
|
|
8159
|
-
const pluginService = new
|
|
8192
|
+
const pluginService = new chunkFAADMKJX_cjs.PluginService(db);
|
|
8160
8193
|
const plugin2 = await pluginService.getPlugin("stripe");
|
|
8161
8194
|
if (plugin2?.settings) {
|
|
8162
8195
|
const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
|
|
@@ -8307,7 +8340,7 @@ apiRoutes3.post("/webhook", async (c) => {
|
|
|
8307
8340
|
}
|
|
8308
8341
|
return c.json({ received: true });
|
|
8309
8342
|
});
|
|
8310
|
-
apiRoutes3.post("/create-checkout-session",
|
|
8343
|
+
apiRoutes3.post("/create-checkout-session", chunkNOT5YX23_cjs.requireAuth(), async (c) => {
|
|
8311
8344
|
const db = c.env.DB;
|
|
8312
8345
|
const user = c.get("user");
|
|
8313
8346
|
if (!user) return c.json({ error: "Unauthorized" }, 401);
|
|
@@ -8347,7 +8380,7 @@ apiRoutes3.post("/create-checkout-session", chunkZHQP75SR_cjs.requireAuth(), asy
|
|
|
8347
8380
|
});
|
|
8348
8381
|
return c.json({ sessionId: session.id, url: session.url });
|
|
8349
8382
|
});
|
|
8350
|
-
apiRoutes3.get("/subscription",
|
|
8383
|
+
apiRoutes3.get("/subscription", chunkNOT5YX23_cjs.requireAuth(), async (c) => {
|
|
8351
8384
|
const user = c.get("user");
|
|
8352
8385
|
if (!user) return c.json({ error: "Unauthorized" }, 401);
|
|
8353
8386
|
const db = c.env.DB;
|
|
@@ -8359,7 +8392,7 @@ apiRoutes3.get("/subscription", chunkZHQP75SR_cjs.requireAuth(), async (c) => {
|
|
|
8359
8392
|
}
|
|
8360
8393
|
return c.json({ subscription });
|
|
8361
8394
|
});
|
|
8362
|
-
apiRoutes3.get("/subscriptions",
|
|
8395
|
+
apiRoutes3.get("/subscriptions", chunkNOT5YX23_cjs.requireAuth(), async (c) => {
|
|
8363
8396
|
const user = c.get("user");
|
|
8364
8397
|
if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
|
|
8365
8398
|
const db = c.env.DB;
|
|
@@ -8375,7 +8408,7 @@ apiRoutes3.get("/subscriptions", chunkZHQP75SR_cjs.requireAuth(), async (c) => {
|
|
|
8375
8408
|
const result = await subscriptionService.list(filters);
|
|
8376
8409
|
return c.json(result);
|
|
8377
8410
|
});
|
|
8378
|
-
apiRoutes3.get("/stats",
|
|
8411
|
+
apiRoutes3.get("/stats", chunkNOT5YX23_cjs.requireAuth(), async (c) => {
|
|
8379
8412
|
const user = c.get("user");
|
|
8380
8413
|
if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
|
|
8381
8414
|
const db = c.env.DB;
|
|
@@ -8384,7 +8417,7 @@ apiRoutes3.get("/stats", chunkZHQP75SR_cjs.requireAuth(), async (c) => {
|
|
|
8384
8417
|
const stats = await subscriptionService.getStats();
|
|
8385
8418
|
return c.json(stats);
|
|
8386
8419
|
});
|
|
8387
|
-
apiRoutes3.post("/sync-subscriptions",
|
|
8420
|
+
apiRoutes3.post("/sync-subscriptions", chunkNOT5YX23_cjs.requireAuth(), async (c) => {
|
|
8388
8421
|
const user = c.get("user");
|
|
8389
8422
|
if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
|
|
8390
8423
|
const db = c.env.DB;
|
|
@@ -8432,7 +8465,7 @@ apiRoutes3.post("/sync-subscriptions", chunkZHQP75SR_cjs.requireAuth(), async (c
|
|
|
8432
8465
|
}, 500);
|
|
8433
8466
|
}
|
|
8434
8467
|
});
|
|
8435
|
-
apiRoutes3.get("/events",
|
|
8468
|
+
apiRoutes3.get("/events", chunkNOT5YX23_cjs.requireAuth(), async (c) => {
|
|
8436
8469
|
const user = c.get("user");
|
|
8437
8470
|
if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
|
|
8438
8471
|
const db = c.env.DB;
|
|
@@ -8455,7 +8488,7 @@ apiRoutes3.get("/events", chunkZHQP75SR_cjs.requireAuth(), async (c) => {
|
|
|
8455
8488
|
|
|
8456
8489
|
// src/plugins/core-plugins/stripe-plugin/index.ts
|
|
8457
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>`;
|
|
8458
|
-
var stripePlugin =
|
|
8491
|
+
var stripePlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
8459
8492
|
id: "stripe",
|
|
8460
8493
|
version: "1.0.0",
|
|
8461
8494
|
name: "Stripe",
|
|
@@ -8728,7 +8761,7 @@ function renderFormsListPage(data) {
|
|
|
8728
8761
|
|
|
8729
8762
|
<!-- Forms Table -->
|
|
8730
8763
|
<div class="bg-white dark:bg-zinc-900 rounded-lg border border-zinc-950/5 dark:border-white/10 overflow-hidden">
|
|
8731
|
-
${
|
|
8764
|
+
${chunkV6EZYAWF_cjs.renderTable(tableData)}
|
|
8732
8765
|
</div>
|
|
8733
8766
|
</div>
|
|
8734
8767
|
`;
|
|
@@ -10158,7 +10191,7 @@ function renderFormCreatePage(data) {
|
|
|
10158
10191
|
// src/routes/admin-forms.ts
|
|
10159
10192
|
var isTableMissing = (err) => String(err?.message ?? err?.cause?.message ?? "").includes("no such table: forms");
|
|
10160
10193
|
var adminFormsRoutes = new hono.Hono();
|
|
10161
|
-
adminFormsRoutes.use("*",
|
|
10194
|
+
adminFormsRoutes.use("*", chunkNOT5YX23_cjs.requireAuth());
|
|
10162
10195
|
adminFormsRoutes.get("/", async (c) => {
|
|
10163
10196
|
try {
|
|
10164
10197
|
const user = c.get("user");
|
|
@@ -10331,7 +10364,7 @@ adminFormsRoutes.get("/:id/builder", async (c) => {
|
|
|
10331
10364
|
if (!form) {
|
|
10332
10365
|
return c.html("<p>Form not found</p>", 404);
|
|
10333
10366
|
}
|
|
10334
|
-
const turnstileService = new
|
|
10367
|
+
const turnstileService = new chunkBUMHSDRW_cjs.TurnstileService(db);
|
|
10335
10368
|
const turnstileSettings = await turnstileService.getSettings();
|
|
10336
10369
|
const pageData = {
|
|
10337
10370
|
id: form.id,
|
|
@@ -10500,7 +10533,7 @@ publicFormsRoutes.get("/:identifier/turnstile-config", async (c) => {
|
|
|
10500
10533
|
if (!form) {
|
|
10501
10534
|
return c.json({ error: "Form not found" }, 404);
|
|
10502
10535
|
}
|
|
10503
|
-
const turnstileService = new
|
|
10536
|
+
const turnstileService = new chunkBUMHSDRW_cjs.TurnstileService(db);
|
|
10504
10537
|
const globalSettings = await turnstileService.getSettings();
|
|
10505
10538
|
const formSettings = form.turnstile_settings ? JSON.parse(form.turnstile_settings) : { inherit: true };
|
|
10506
10539
|
const enabled = form.turnstile_enabled === 1 || formSettings.inherit && globalSettings?.enabled;
|
|
@@ -10930,7 +10963,7 @@ publicFormsRoutes.post("/:identifier/submit", async (c) => {
|
|
|
10930
10963
|
const turnstileEnabled = form.turnstile_enabled === 1;
|
|
10931
10964
|
const turnstileSettings = form.turnstile_settings ? JSON.parse(form.turnstile_settings) : { inherit: true };
|
|
10932
10965
|
if (turnstileEnabled || turnstileSettings.inherit) {
|
|
10933
|
-
const turnstileService = new
|
|
10966
|
+
const turnstileService = new chunkBUMHSDRW_cjs.TurnstileService(db);
|
|
10934
10967
|
const globalEnabled = await turnstileService.isEnabled();
|
|
10935
10968
|
if (globalEnabled || turnstileEnabled) {
|
|
10936
10969
|
const turnstileToken = body.data?.turnstile || body.turnstile;
|
|
@@ -10992,7 +11025,7 @@ publicFormsRoutes.post("/:identifier/submit", async (c) => {
|
|
|
10992
11025
|
});
|
|
10993
11026
|
|
|
10994
11027
|
// src/plugins/core-plugins/forms-plugin/index.ts
|
|
10995
|
-
var formsPlugin =
|
|
11028
|
+
var formsPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
10996
11029
|
id: "forms",
|
|
10997
11030
|
version: "1.0.0",
|
|
10998
11031
|
name: "Forms",
|
|
@@ -11012,7 +11045,7 @@ var formsPlugin = chunk3RNDJAZ5_cjs.definePlugin({
|
|
|
11012
11045
|
});
|
|
11013
11046
|
chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
|
|
11014
11047
|
var adminRbacRoutes = new hono.Hono();
|
|
11015
|
-
adminRbacRoutes.use("*",
|
|
11048
|
+
adminRbacRoutes.use("*", chunkNOT5YX23_cjs.requireRbac("rbac", "manage"));
|
|
11016
11049
|
var esc = (s) => String(s).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
11017
11050
|
var TABS2 = `
|
|
11018
11051
|
<div class="border-b border-zinc-950/10 dark:border-white/10 mb-6">
|
|
@@ -11022,7 +11055,7 @@ var TABS2 = `
|
|
|
11022
11055
|
</nav>
|
|
11023
11056
|
</div>`;
|
|
11024
11057
|
adminRbacRoutes.get("/", async (c) => {
|
|
11025
|
-
const rbac = new
|
|
11058
|
+
const rbac = new chunkLTZ5WYOK_cjs.RbacService(c.env.DB);
|
|
11026
11059
|
const [roles, verbs, resources, grants] = await Promise.all([
|
|
11027
11060
|
rbac.getRoles(),
|
|
11028
11061
|
rbac.getVerbs(),
|
|
@@ -11320,7 +11353,7 @@ adminRbacRoutes.get("/", async (c) => {
|
|
|
11320
11353
|
title: "Roles & Permissions",
|
|
11321
11354
|
pageTitle: "Roles & Permissions",
|
|
11322
11355
|
currentPath: "/admin/users",
|
|
11323
|
-
version:
|
|
11356
|
+
version: chunkE6LGR24C_cjs.getCoreVersion(),
|
|
11324
11357
|
user: u ? { name: u.email || "Admin", email: u.email || "", role: u.role || "admin" } : void 0,
|
|
11325
11358
|
content: content2
|
|
11326
11359
|
})
|
|
@@ -11344,7 +11377,7 @@ adminRbacRoutes.post("/grants", async (c) => {
|
|
|
11344
11377
|
pairsByRole.get(roleId).push({ resource, verb, scope });
|
|
11345
11378
|
}
|
|
11346
11379
|
}
|
|
11347
|
-
const rbac = new
|
|
11380
|
+
const rbac = new chunkLTZ5WYOK_cjs.RbacService(c.env.DB);
|
|
11348
11381
|
for (const id of saveRoleIds) {
|
|
11349
11382
|
await rbac.setRoleGrants(id, pairsByRole.get(id) || []);
|
|
11350
11383
|
}
|
|
@@ -11365,7 +11398,7 @@ adminRbacRoutes.post("/grants", async (c) => {
|
|
|
11365
11398
|
adminRbacRoutes.post("/roles/bulk", async (c) => {
|
|
11366
11399
|
const form = await c.req.formData();
|
|
11367
11400
|
const roleIds = String(form.get("role_ids") || "").split(",").filter(Boolean);
|
|
11368
|
-
const rbac = new
|
|
11401
|
+
const rbac = new chunkLTZ5WYOK_cjs.RbacService(c.env.DB);
|
|
11369
11402
|
for (const roleId of roleIds) {
|
|
11370
11403
|
const displayName = String(form.get(`display_name_${roleId}`) || "").trim();
|
|
11371
11404
|
const nameVal = form.get(`name_${roleId}`) ? String(form.get(`name_${roleId}`)).trim() : void 0;
|
|
@@ -11390,7 +11423,7 @@ adminRbacRoutes.post("/roles", async (c) => {
|
|
|
11390
11423
|
const displayName = String(form.get("display_name") || "").trim();
|
|
11391
11424
|
if (name && displayName) {
|
|
11392
11425
|
try {
|
|
11393
|
-
await new
|
|
11426
|
+
await new chunkLTZ5WYOK_cjs.RbacService(c.env.DB).createRole(name, displayName);
|
|
11394
11427
|
} catch {
|
|
11395
11428
|
}
|
|
11396
11429
|
}
|
|
@@ -11405,7 +11438,7 @@ adminRbacRoutes.post("/roles/:id", async (c) => {
|
|
|
11405
11438
|
const portalAccess = form.get("portal_access") === "1";
|
|
11406
11439
|
if (displayName) {
|
|
11407
11440
|
try {
|
|
11408
|
-
const rbac = new
|
|
11441
|
+
const rbac = new chunkLTZ5WYOK_cjs.RbacService(c.env.DB);
|
|
11409
11442
|
if (roleId !== "role-admin") {
|
|
11410
11443
|
await rbac.updateRoleAndPortalAccess(roleId, displayName, name, portalAccess, description);
|
|
11411
11444
|
} else {
|
|
@@ -11417,7 +11450,7 @@ adminRbacRoutes.post("/roles/:id", async (c) => {
|
|
|
11417
11450
|
return c.redirect(`/admin/rbac#roles-verbs`);
|
|
11418
11451
|
});
|
|
11419
11452
|
adminRbacRoutes.post("/roles/:id/delete", async (c) => {
|
|
11420
|
-
await new
|
|
11453
|
+
await new chunkLTZ5WYOK_cjs.RbacService(c.env.DB).deleteRole(c.req.param("id"));
|
|
11421
11454
|
return c.redirect("/admin/rbac#roles-verbs");
|
|
11422
11455
|
});
|
|
11423
11456
|
adminRbacRoutes.post("/verbs", async (c) => {
|
|
@@ -11425,18 +11458,18 @@ adminRbacRoutes.post("/verbs", async (c) => {
|
|
|
11425
11458
|
const name = String(form.get("name") || "").trim();
|
|
11426
11459
|
if (name) {
|
|
11427
11460
|
try {
|
|
11428
|
-
await new
|
|
11461
|
+
await new chunkLTZ5WYOK_cjs.RbacService(c.env.DB).createVerb(name);
|
|
11429
11462
|
} catch {
|
|
11430
11463
|
}
|
|
11431
11464
|
}
|
|
11432
11465
|
return c.redirect("/admin/rbac#roles-verbs");
|
|
11433
11466
|
});
|
|
11434
11467
|
adminRbacRoutes.post("/verbs/:id/delete", async (c) => {
|
|
11435
|
-
await new
|
|
11468
|
+
await new chunkLTZ5WYOK_cjs.RbacService(c.env.DB).deleteVerb(c.req.param("id"));
|
|
11436
11469
|
return c.redirect("/admin/rbac#roles-verbs");
|
|
11437
11470
|
});
|
|
11438
11471
|
adminRbacRoutes.get("/check", async (c) => {
|
|
11439
|
-
const rbac = new
|
|
11472
|
+
const rbac = new chunkLTZ5WYOK_cjs.RbacService(c.env.DB);
|
|
11440
11473
|
const resource = c.req.query("resource") || "";
|
|
11441
11474
|
const verb = c.req.query("verb") || "";
|
|
11442
11475
|
const roleId = c.req.query("role");
|
|
@@ -11457,7 +11490,7 @@ adminRbacRoutes.get("/check", async (c) => {
|
|
|
11457
11490
|
});
|
|
11458
11491
|
|
|
11459
11492
|
// src/middleware/plugin-menu.ts
|
|
11460
|
-
var REGISTRY_MENU_PLUGINS = Object.values(
|
|
11493
|
+
var REGISTRY_MENU_PLUGINS = Object.values(chunkFAADMKJX_cjs.PLUGIN_REGISTRY).filter((p) => p.adminMenu !== null).map((p) => ({
|
|
11461
11494
|
id: p.id,
|
|
11462
11495
|
label: p.adminMenu.label,
|
|
11463
11496
|
path: p.adminMenu.path,
|
|
@@ -11536,7 +11569,7 @@ function pluginMenuMiddleware() {
|
|
|
11536
11569
|
} catch {
|
|
11537
11570
|
}
|
|
11538
11571
|
const user = c.get("user");
|
|
11539
|
-
const singletonItems =
|
|
11572
|
+
const singletonItems = chunkBUMHSDRW_cjs.resolvePluginMenuItems(user ? { role: user.role } : void 0);
|
|
11540
11573
|
const existingPaths = new Set(activeMenuItems.map((i) => i.path));
|
|
11541
11574
|
for (const item of singletonItems) {
|
|
11542
11575
|
if (!existingPaths.has(item.path)) {
|
|
@@ -11563,7 +11596,7 @@ function pluginMenuMiddleware() {
|
|
|
11563
11596
|
}
|
|
11564
11597
|
chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
|
|
11565
11598
|
var adminRoutes6 = new hono.Hono();
|
|
11566
|
-
adminRoutes6.use("*",
|
|
11599
|
+
adminRoutes6.use("*", chunkNOT5YX23_cjs.requireAuth());
|
|
11567
11600
|
adminRoutes6.use("*", async (c, next) => {
|
|
11568
11601
|
const user = c.get("user");
|
|
11569
11602
|
if (user?.role !== "admin") {
|
|
@@ -11710,12 +11743,13 @@ var QUERYABLE_FIELDS2 = [
|
|
|
11710
11743
|
var EventTrackingService = class {
|
|
11711
11744
|
constructor(db) {
|
|
11712
11745
|
this.db = db;
|
|
11713
|
-
this.docsService = new
|
|
11746
|
+
this.docsService = new chunkLTZ5WYOK_cjs.DocumentsService(db, {
|
|
11714
11747
|
queryableFields: QUERYABLE_FIELDS2,
|
|
11715
11748
|
maxVersionsPerRoot: 1,
|
|
11716
11749
|
tenantId: TENANT2
|
|
11717
11750
|
});
|
|
11718
11751
|
}
|
|
11752
|
+
db;
|
|
11719
11753
|
docsService;
|
|
11720
11754
|
async trackEvent(input) {
|
|
11721
11755
|
const doc = await this.docsService.create({
|
|
@@ -11918,7 +11952,7 @@ apiRoutes4.get("/stats", async (c) => {
|
|
|
11918
11952
|
});
|
|
11919
11953
|
|
|
11920
11954
|
// src/plugins/core-plugins/analytics/index.ts
|
|
11921
|
-
var analyticsPlugin =
|
|
11955
|
+
var analyticsPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
11922
11956
|
id: "core-analytics",
|
|
11923
11957
|
version: "1.0.0",
|
|
11924
11958
|
name: "Analytics",
|
|
@@ -12065,7 +12099,7 @@ function esc2(s) {
|
|
|
12065
12099
|
return (s || "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
12066
12100
|
}
|
|
12067
12101
|
async function getVariablesMap(db) {
|
|
12068
|
-
let variables =
|
|
12102
|
+
let variables = chunkV6EZYAWF_cjs.getVariablesCached();
|
|
12069
12103
|
if (variables) return variables;
|
|
12070
12104
|
try {
|
|
12071
12105
|
const { results } = await db.prepare(
|
|
@@ -12075,7 +12109,7 @@ async function getVariablesMap(db) {
|
|
|
12075
12109
|
for (const row of results || []) {
|
|
12076
12110
|
variables.set(row.key, row.value);
|
|
12077
12111
|
}
|
|
12078
|
-
|
|
12112
|
+
chunkV6EZYAWF_cjs.setVariablesCache(variables);
|
|
12079
12113
|
return variables;
|
|
12080
12114
|
} catch {
|
|
12081
12115
|
return /* @__PURE__ */ new Map();
|
|
@@ -12144,7 +12178,7 @@ apiRoutes5.post("/", async (c) => {
|
|
|
12144
12178
|
await db.prepare(
|
|
12145
12179
|
"INSERT INTO global_variables (key, value, description, category, is_active) VALUES (?, ?, ?, ?, ?)"
|
|
12146
12180
|
).bind(key, value || "", description || "", category || "general", isActive !== false ? 1 : 0).run();
|
|
12147
|
-
|
|
12181
|
+
chunkV6EZYAWF_cjs.invalidateVariablesCache();
|
|
12148
12182
|
const created = await db.prepare("SELECT * FROM global_variables WHERE key = ?").bind(key).first();
|
|
12149
12183
|
return c.json({ success: true, data: formatVariable(created) }, 201);
|
|
12150
12184
|
} catch {
|
|
@@ -12189,7 +12223,7 @@ apiRoutes5.put("/:id", async (c) => {
|
|
|
12189
12223
|
updates.push("updated_at = strftime('%s', 'now')");
|
|
12190
12224
|
params.push(id);
|
|
12191
12225
|
await db.prepare(`UPDATE global_variables SET ${updates.join(", ")} WHERE id = ?`).bind(...params).run();
|
|
12192
|
-
|
|
12226
|
+
chunkV6EZYAWF_cjs.invalidateVariablesCache();
|
|
12193
12227
|
const updated = await db.prepare("SELECT * FROM global_variables WHERE id = ?").bind(id).first();
|
|
12194
12228
|
return c.json({ success: true, data: formatVariable(updated) });
|
|
12195
12229
|
} catch {
|
|
@@ -12203,7 +12237,7 @@ apiRoutes5.delete("/:id", async (c) => {
|
|
|
12203
12237
|
const existing = await db.prepare("SELECT id FROM global_variables WHERE id = ?").bind(id).first();
|
|
12204
12238
|
if (!existing) return c.json({ error: "Variable not found" }, 404);
|
|
12205
12239
|
await db.prepare("DELETE FROM global_variables WHERE id = ?").bind(id).run();
|
|
12206
|
-
|
|
12240
|
+
chunkV6EZYAWF_cjs.invalidateVariablesCache();
|
|
12207
12241
|
return c.json({ success: true });
|
|
12208
12242
|
} catch {
|
|
12209
12243
|
return c.json({ success: false, error: "Failed to delete variable" }, 500);
|
|
@@ -12263,7 +12297,7 @@ adminRoutes7.put("/:id", async (c) => {
|
|
|
12263
12297
|
const value = body.value;
|
|
12264
12298
|
if (value !== void 0) {
|
|
12265
12299
|
await db.prepare("UPDATE global_variables SET value = ?, updated_at = strftime('%s', 'now') WHERE id = ?").bind(value, id).run();
|
|
12266
|
-
|
|
12300
|
+
chunkV6EZYAWF_cjs.invalidateVariablesCache();
|
|
12267
12301
|
}
|
|
12268
12302
|
return c.html('<span class="text-green-400 text-xs">Saved</span>');
|
|
12269
12303
|
});
|
|
@@ -12271,7 +12305,7 @@ adminRoutes7.post("/:id/toggle", async (c) => {
|
|
|
12271
12305
|
const db = c.env.DB;
|
|
12272
12306
|
const id = c.req.param("id");
|
|
12273
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();
|
|
12274
|
-
|
|
12308
|
+
chunkV6EZYAWF_cjs.invalidateVariablesCache();
|
|
12275
12309
|
c.header("HX-Redirect", "/admin/global-variables");
|
|
12276
12310
|
return c.body(null, 204);
|
|
12277
12311
|
});
|
|
@@ -12292,7 +12326,7 @@ adminRoutes7.post("/", async (c) => {
|
|
|
12292
12326
|
await db.prepare(
|
|
12293
12327
|
"INSERT INTO global_variables (key, value, description, category) VALUES (?, ?, ?, ?)"
|
|
12294
12328
|
).bind(key, value, description, category).run();
|
|
12295
|
-
|
|
12329
|
+
chunkV6EZYAWF_cjs.invalidateVariablesCache();
|
|
12296
12330
|
c.header("HX-Redirect", "/admin/global-variables");
|
|
12297
12331
|
return c.body(null, 204);
|
|
12298
12332
|
});
|
|
@@ -12311,7 +12345,7 @@ adminRoutes7.post("/settings/editor-integration", async (c) => {
|
|
|
12311
12345
|
adminRoutes7.delete("/:id", async (c) => {
|
|
12312
12346
|
const db = c.env.DB;
|
|
12313
12347
|
await db.prepare("DELETE FROM global_variables WHERE id = ?").bind(c.req.param("id")).run();
|
|
12314
|
-
|
|
12348
|
+
chunkV6EZYAWF_cjs.invalidateVariablesCache();
|
|
12315
12349
|
return c.html("");
|
|
12316
12350
|
});
|
|
12317
12351
|
function renderAdminPage(variables, editorStatus = { editorActive: false, activeEditorName: "", enableEditorIntegration: true }) {
|
|
@@ -12629,7 +12663,7 @@ function renderAdminPage(variables, editorStatus = { editorActive: false, active
|
|
|
12629
12663
|
</div>
|
|
12630
12664
|
` });
|
|
12631
12665
|
}
|
|
12632
|
-
var globalVariablesPlugin =
|
|
12666
|
+
var globalVariablesPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
12633
12667
|
id: "global-variables",
|
|
12634
12668
|
version: "1.1.0",
|
|
12635
12669
|
name: "Global Variables",
|
|
@@ -12652,7 +12686,7 @@ var globalVariablesPlugin = chunk3RNDJAZ5_cjs.definePlugin({
|
|
|
12652
12686
|
if (!db || !data) return data;
|
|
12653
12687
|
const variables = await getVariablesMap(db);
|
|
12654
12688
|
if (variables.size === 0) return data;
|
|
12655
|
-
return
|
|
12689
|
+
return chunkV6EZYAWF_cjs.resolveVariablesInObject(data, variables);
|
|
12656
12690
|
} catch {
|
|
12657
12691
|
return data;
|
|
12658
12692
|
}
|
|
@@ -12670,7 +12704,7 @@ var globalVariablesPlugin = chunk3RNDJAZ5_cjs.definePlugin({
|
|
|
12670
12704
|
},
|
|
12671
12705
|
activate: async () => console.info("[GlobalVariables] Plugin activated"),
|
|
12672
12706
|
deactivate: async () => {
|
|
12673
|
-
|
|
12707
|
+
chunkV6EZYAWF_cjs.invalidateVariablesCache();
|
|
12674
12708
|
console.info("[GlobalVariables] Plugin deactivated, cache cleared");
|
|
12675
12709
|
},
|
|
12676
12710
|
uninstall: async (ctx) => {
|
|
@@ -13236,7 +13270,7 @@ function renderAdminPage2(shortcodes, editorStatus = { editorActive: false, acti
|
|
|
13236
13270
|
</div>
|
|
13237
13271
|
` });
|
|
13238
13272
|
}
|
|
13239
|
-
var shortcodesPlugin =
|
|
13273
|
+
var shortcodesPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
13240
13274
|
id: "shortcodes",
|
|
13241
13275
|
version: "1.0.0",
|
|
13242
13276
|
name: "Shortcodes",
|
|
@@ -13320,7 +13354,7 @@ helloWorldRoutes.get("/", async (c) => {
|
|
|
13320
13354
|
</html>
|
|
13321
13355
|
`);
|
|
13322
13356
|
});
|
|
13323
|
-
var helloWorldPlugin =
|
|
13357
|
+
var helloWorldPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
13324
13358
|
id: "hello-world",
|
|
13325
13359
|
version: "1.0.0",
|
|
13326
13360
|
name: "Hello World",
|
|
@@ -13551,7 +13585,7 @@ function renderTenantForm(data) {
|
|
|
13551
13585
|
// src/plugins/core-plugins/multi-tenant-plugin/templates/tenant-members.template.ts
|
|
13552
13586
|
chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
|
|
13553
13587
|
function roleOptions(selected) {
|
|
13554
|
-
return
|
|
13588
|
+
return chunkV6EZYAWF_cjs.VALID_MEMBER_ROLES.map(
|
|
13555
13589
|
(r) => `<option value="${r}" ${r === selected ? "selected" : ""}>${r}</option>`
|
|
13556
13590
|
).join("");
|
|
13557
13591
|
}
|
|
@@ -13613,7 +13647,7 @@ function renderInvitations(slug, invitations) {
|
|
|
13613
13647
|
<div>
|
|
13614
13648
|
<label for="invite-role" class="mb-1 block text-xs font-medium text-zinc-500 dark:text-zinc-400">Role</label>
|
|
13615
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">
|
|
13616
|
-
${
|
|
13650
|
+
${chunkV6EZYAWF_cjs.VALID_MEMBER_ROLES.map((r) => `<option value="${r}" ${r === "viewer" ? "selected" : ""}>${r}</option>`).join("")}
|
|
13617
13651
|
</select>
|
|
13618
13652
|
</div>
|
|
13619
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>
|
|
@@ -13709,7 +13743,7 @@ function renderTenantMembers(data) {
|
|
|
13709
13743
|
// src/plugins/core-plugins/multi-tenant-plugin/templates/user-memberships.template.ts
|
|
13710
13744
|
chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
|
|
13711
13745
|
function roleOptions2(selected) {
|
|
13712
|
-
return
|
|
13746
|
+
return chunkV6EZYAWF_cjs.VALID_MEMBER_ROLES.map(
|
|
13713
13747
|
(r) => `<option value="${r}" ${r === selected ? "selected" : ""}>${r}</option>`
|
|
13714
13748
|
).join("");
|
|
13715
13749
|
}
|
|
@@ -13871,7 +13905,7 @@ function zodToFieldErrors(error) {
|
|
|
13871
13905
|
}
|
|
13872
13906
|
async function isMultiTenantActive(db) {
|
|
13873
13907
|
try {
|
|
13874
|
-
const plugin2 = await new
|
|
13908
|
+
const plugin2 = await new chunkFAADMKJX_cjs.PluginService(db).getPlugin(chunkFAADMKJX_cjs.MULTI_TENANT_PLUGIN_ID);
|
|
13875
13909
|
return plugin2?.status === "active";
|
|
13876
13910
|
} catch {
|
|
13877
13911
|
return false;
|
|
@@ -13879,7 +13913,7 @@ async function isMultiTenantActive(db) {
|
|
|
13879
13913
|
}
|
|
13880
13914
|
function createTenantAdminRoutes() {
|
|
13881
13915
|
const routes2 = new hono.Hono();
|
|
13882
|
-
routes2.use("*",
|
|
13916
|
+
routes2.use("*", chunkNOT5YX23_cjs.requireAuth());
|
|
13883
13917
|
routes2.use("*", async (c, next) => {
|
|
13884
13918
|
const user = c.get("user");
|
|
13885
13919
|
if (user?.role !== "admin") {
|
|
@@ -13893,7 +13927,7 @@ function createTenantAdminRoutes() {
|
|
|
13893
13927
|
const form = await c.req.formData();
|
|
13894
13928
|
const slug = String(form.get("tenant") ?? "").trim().toLowerCase();
|
|
13895
13929
|
const redirect = String(form.get("redirect") ?? "");
|
|
13896
|
-
const svc = new
|
|
13930
|
+
const svc = new chunkV6EZYAWF_cjs.TenantService(db);
|
|
13897
13931
|
const tenant = await svc.getTenantBySlug(slug);
|
|
13898
13932
|
if (!tenant || tenant.status !== "active") {
|
|
13899
13933
|
return c.json({ error: "Unknown or inactive tenant" }, 400);
|
|
@@ -13903,7 +13937,7 @@ function createTenantAdminRoutes() {
|
|
|
13903
13937
|
if (!user.isSuperAdmin && !await svc.isMember(user.userId, slug)) {
|
|
13904
13938
|
return c.json({ error: "You are not a member of this tenant" }, 403);
|
|
13905
13939
|
}
|
|
13906
|
-
cookie.setCookie(c,
|
|
13940
|
+
cookie.setCookie(c, chunkFAADMKJX_cjs.TENANT_COOKIE, slug, {
|
|
13907
13941
|
path: "/",
|
|
13908
13942
|
httpOnly: true,
|
|
13909
13943
|
sameSite: "Lax",
|
|
@@ -13920,7 +13954,7 @@ function createTenantAdminRoutes() {
|
|
|
13920
13954
|
if (!user) return c.redirect("/auth/login");
|
|
13921
13955
|
const token = c.req.query("token") ?? "";
|
|
13922
13956
|
try {
|
|
13923
|
-
const { slug } = await new
|
|
13957
|
+
const { slug } = await new chunkV6EZYAWF_cjs.TenantService(db).acceptInvitation(token, user.userId, user.email);
|
|
13924
13958
|
return c.redirect(`/admin/tenants/${slug}/members?message=Invitation accepted`);
|
|
13925
13959
|
} catch (error) {
|
|
13926
13960
|
const message = error instanceof Error ? error.message : "Failed to accept invitation";
|
|
@@ -13948,7 +13982,7 @@ function createTenantAdminRoutes() {
|
|
|
13948
13982
|
const userId = c.req.param("userId");
|
|
13949
13983
|
const target = await db.prepare("SELECT id, email FROM auth_user WHERE id = ?").bind(userId).first();
|
|
13950
13984
|
if (!target?.id) return c.redirect("/admin/users?message=User not found&type=error");
|
|
13951
|
-
const svc = new
|
|
13985
|
+
const svc = new chunkV6EZYAWF_cjs.TenantService(db);
|
|
13952
13986
|
const [memberships, allTenants] = await Promise.all([svc.listUserMemberships(userId), svc.listTenants()]);
|
|
13953
13987
|
const memberSlugs = new Set(memberships.map((m) => m.slug));
|
|
13954
13988
|
const availableTenants = allTenants.filter((t) => t.status === "active" && !memberSlugs.has(t.slug)).map((t) => ({ slug: t.slug, name: t.name }));
|
|
@@ -13973,10 +14007,10 @@ function createTenantAdminRoutes() {
|
|
|
13973
14007
|
const slug = String(form.get("slug") ?? "").trim().toLowerCase();
|
|
13974
14008
|
const role = String(form.get("role") ?? "viewer");
|
|
13975
14009
|
const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
|
|
13976
|
-
if (!
|
|
14010
|
+
if (!chunkV6EZYAWF_cjs.isValidMemberRole(role)) throw new Error(`Invalid role '${role}'`);
|
|
13977
14011
|
const target = await db.prepare("SELECT email FROM auth_user WHERE id = ?").bind(userId).first();
|
|
13978
14012
|
if (!target) throw new Error("User not found");
|
|
13979
|
-
const svc = new
|
|
14013
|
+
const svc = new chunkV6EZYAWF_cjs.TenantService(db);
|
|
13980
14014
|
if (!await svc.getTenantBySlug(slug)) throw new Error("Tenant not found");
|
|
13981
14015
|
if (await svc.isMember(userId, slug)) throw new Error(`Already a member of '${slug}'`);
|
|
13982
14016
|
await svc.addMember(slug, userId, role, target.email ?? null);
|
|
@@ -13995,7 +14029,7 @@ function createTenantAdminRoutes() {
|
|
|
13995
14029
|
const form = await c.req.formData();
|
|
13996
14030
|
const role = String(form.get("role") ?? "");
|
|
13997
14031
|
const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
|
|
13998
|
-
await new
|
|
14032
|
+
await new chunkV6EZYAWF_cjs.TenantService(db).setMemberRole(slug, userId, role);
|
|
13999
14033
|
return c.redirect(`${redirectTo}?message=Role updated`);
|
|
14000
14034
|
} catch (error) {
|
|
14001
14035
|
const message = error instanceof Error ? error.message : "Failed to update role";
|
|
@@ -14010,7 +14044,7 @@ function createTenantAdminRoutes() {
|
|
|
14010
14044
|
try {
|
|
14011
14045
|
const form = await c.req.formData();
|
|
14012
14046
|
const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
|
|
14013
|
-
await new
|
|
14047
|
+
await new chunkV6EZYAWF_cjs.TenantService(db).removeMember(slug, userId);
|
|
14014
14048
|
return c.redirect(`${redirectTo}?message=Removed from ${encodeURIComponent(slug)}`);
|
|
14015
14049
|
} catch (error) {
|
|
14016
14050
|
const message = error instanceof Error ? error.message : "Failed to remove membership";
|
|
@@ -14025,7 +14059,7 @@ function createTenantAdminRoutes() {
|
|
|
14025
14059
|
return c.html(renderTenantsInactive({ user: userShape(cur), version }));
|
|
14026
14060
|
}
|
|
14027
14061
|
const roleName = c.req.param("roleName");
|
|
14028
|
-
const assignments = await new
|
|
14062
|
+
const assignments = await new chunkV6EZYAWF_cjs.TenantService(db).listAssignmentsByRole(roleName);
|
|
14029
14063
|
return c.html(renderRoleUsage({ roleName, assignments, user: userShape(cur), version }));
|
|
14030
14064
|
});
|
|
14031
14065
|
routes2.get("/", async (c) => {
|
|
@@ -14035,7 +14069,7 @@ function createTenantAdminRoutes() {
|
|
|
14035
14069
|
if (!await isMultiTenantActive(db)) {
|
|
14036
14070
|
return c.html(renderTenantsInactive({ user: userShape(user), version }));
|
|
14037
14071
|
}
|
|
14038
|
-
const svc = new
|
|
14072
|
+
const svc = new chunkV6EZYAWF_cjs.TenantService(db);
|
|
14039
14073
|
await svc.ensureDefaultTenant();
|
|
14040
14074
|
const tenants = await svc.listTenants();
|
|
14041
14075
|
const [docRes, memberRes] = await db.batch([
|
|
@@ -14074,7 +14108,7 @@ function createTenantAdminRoutes() {
|
|
|
14074
14108
|
formEntries = Object.fromEntries(form.entries());
|
|
14075
14109
|
const validated = tenantFormSchema.parse(formEntries);
|
|
14076
14110
|
if (!validated.slug) throw new zod.z.ZodError([{ code: "custom", message: "Slug is required", path: ["slug"] }]);
|
|
14077
|
-
const svc = new
|
|
14111
|
+
const svc = new chunkV6EZYAWF_cjs.TenantService(db);
|
|
14078
14112
|
await svc.createTenant({
|
|
14079
14113
|
name: validated.name,
|
|
14080
14114
|
slug: validated.slug,
|
|
@@ -14099,7 +14133,7 @@ function createTenantAdminRoutes() {
|
|
|
14099
14133
|
if (!await isMultiTenantActive(db)) {
|
|
14100
14134
|
return c.html(renderTenantsInactive({ user: userShape(user), version }));
|
|
14101
14135
|
}
|
|
14102
|
-
const tenant = await new
|
|
14136
|
+
const tenant = await new chunkV6EZYAWF_cjs.TenantService(db).getTenantBySlug(c.req.param("slug"));
|
|
14103
14137
|
if (!tenant) return c.redirect("/admin/tenants?message=Tenant not found&type=error");
|
|
14104
14138
|
return c.html(renderTenantForm({ tenant, isEdit: true, user: userShape(user), version }));
|
|
14105
14139
|
});
|
|
@@ -14109,7 +14143,7 @@ function createTenantAdminRoutes() {
|
|
|
14109
14143
|
const version = c.get("appVersion");
|
|
14110
14144
|
const slug = c.req.param("slug");
|
|
14111
14145
|
if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
|
|
14112
|
-
const svc = new
|
|
14146
|
+
const svc = new chunkV6EZYAWF_cjs.TenantService(db);
|
|
14113
14147
|
try {
|
|
14114
14148
|
const form = await c.req.formData();
|
|
14115
14149
|
const validated = tenantFormSchema.parse(Object.fromEntries(form.entries()));
|
|
@@ -14134,7 +14168,7 @@ function createTenantAdminRoutes() {
|
|
|
14134
14168
|
const slug = c.req.param("slug");
|
|
14135
14169
|
if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
|
|
14136
14170
|
try {
|
|
14137
|
-
await new
|
|
14171
|
+
await new chunkV6EZYAWF_cjs.TenantService(db).deleteTenant(slug);
|
|
14138
14172
|
return c.redirect("/admin/tenants?message=Tenant deleted successfully");
|
|
14139
14173
|
} catch (error) {
|
|
14140
14174
|
const message = error instanceof Error ? error.message : "Failed to delete tenant";
|
|
@@ -14149,7 +14183,7 @@ function createTenantAdminRoutes() {
|
|
|
14149
14183
|
return c.html(renderTenantsInactive({ user: userShape(user), version }));
|
|
14150
14184
|
}
|
|
14151
14185
|
const slug = c.req.param("slug");
|
|
14152
|
-
const svc = new
|
|
14186
|
+
const svc = new chunkV6EZYAWF_cjs.TenantService(db);
|
|
14153
14187
|
const tenant = await svc.getTenantBySlug(slug);
|
|
14154
14188
|
if (!tenant) return c.redirect("/admin/tenants?message=Tenant not found&type=error");
|
|
14155
14189
|
const [members, invitations] = await Promise.all([svc.listMembers(slug), svc.listInvitations(slug)]);
|
|
@@ -14175,7 +14209,7 @@ function createTenantAdminRoutes() {
|
|
|
14175
14209
|
const form = await c.req.formData();
|
|
14176
14210
|
const email = String(form.get("email") ?? "");
|
|
14177
14211
|
const role = String(form.get("role") ?? "viewer");
|
|
14178
|
-
await new
|
|
14212
|
+
await new chunkV6EZYAWF_cjs.TenantService(db).addMemberByEmail(slug, email, role);
|
|
14179
14213
|
return c.redirect(`/admin/tenants/${slug}/members?message=Member added`);
|
|
14180
14214
|
} catch (error) {
|
|
14181
14215
|
const message = error instanceof Error ? error.message : "Failed to add member";
|
|
@@ -14190,7 +14224,7 @@ function createTenantAdminRoutes() {
|
|
|
14190
14224
|
try {
|
|
14191
14225
|
const form = await c.req.formData();
|
|
14192
14226
|
const role = String(form.get("role") ?? "");
|
|
14193
|
-
await new
|
|
14227
|
+
await new chunkV6EZYAWF_cjs.TenantService(db).setMemberRole(slug, userId, role);
|
|
14194
14228
|
return c.redirect(`/admin/tenants/${slug}/members?message=Role updated`);
|
|
14195
14229
|
} catch (error) {
|
|
14196
14230
|
const message = error instanceof Error ? error.message : "Failed to update role";
|
|
@@ -14203,7 +14237,7 @@ function createTenantAdminRoutes() {
|
|
|
14203
14237
|
const userId = c.req.param("userId");
|
|
14204
14238
|
if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
|
|
14205
14239
|
try {
|
|
14206
|
-
await new
|
|
14240
|
+
await new chunkV6EZYAWF_cjs.TenantService(db).removeMember(slug, userId);
|
|
14207
14241
|
return c.redirect(`/admin/tenants/${slug}/members?message=Member removed`);
|
|
14208
14242
|
} catch (error) {
|
|
14209
14243
|
const message = error instanceof Error ? error.message : "Failed to remove member";
|
|
@@ -14219,12 +14253,12 @@ function createTenantAdminRoutes() {
|
|
|
14219
14253
|
const form = await c.req.formData();
|
|
14220
14254
|
const email = String(form.get("email") ?? "");
|
|
14221
14255
|
const role = String(form.get("role") ?? "viewer");
|
|
14222
|
-
const token = await new
|
|
14256
|
+
const token = await new chunkV6EZYAWF_cjs.TenantService(db).createInvitation(slug, email, role, user?.userId ?? null);
|
|
14223
14257
|
const origin = c.req.header("origin") || new URL(c.req.url).origin;
|
|
14224
14258
|
const acceptUrl = `${origin}/join/invite?token=${encodeURIComponent(token)}`;
|
|
14225
14259
|
let note;
|
|
14226
14260
|
let noteType = "";
|
|
14227
|
-
const svc2 =
|
|
14261
|
+
const svc2 = chunkV6EZYAWF_cjs.hasEmailService() ? chunkV6EZYAWF_cjs.getEmailService() : null;
|
|
14228
14262
|
const hasRealProvider = !!svc2 && svc2.getProviderName() !== "console";
|
|
14229
14263
|
if (hasRealProvider) {
|
|
14230
14264
|
const result = await svc2.send({
|
|
@@ -14265,7 +14299,7 @@ function createTenantAdminRoutes() {
|
|
|
14265
14299
|
WHERE i.id = ? AND t.slug = ? AND i.status = 'pending'`
|
|
14266
14300
|
).bind(id, slug).first();
|
|
14267
14301
|
if (!inv) throw new Error("Invitation not found or already used");
|
|
14268
|
-
const svc2 =
|
|
14302
|
+
const svc2 = chunkV6EZYAWF_cjs.hasEmailService() ? chunkV6EZYAWF_cjs.getEmailService() : null;
|
|
14269
14303
|
const hasRealProvider = !!svc2 && svc2.getProviderName() !== "console";
|
|
14270
14304
|
if (!hasRealProvider) throw new Error("No email plugin active");
|
|
14271
14305
|
const origin = c.req.header("origin") || new URL(c.req.url).origin;
|
|
@@ -14290,7 +14324,7 @@ function createTenantAdminRoutes() {
|
|
|
14290
14324
|
const id = c.req.param("id");
|
|
14291
14325
|
if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
|
|
14292
14326
|
try {
|
|
14293
|
-
await new
|
|
14327
|
+
await new chunkV6EZYAWF_cjs.TenantService(db).revokeInvitation(slug, id);
|
|
14294
14328
|
return c.redirect(`/admin/tenants/${slug}/members?message=Invitation revoked`);
|
|
14295
14329
|
} catch (error) {
|
|
14296
14330
|
const message = error instanceof Error ? error.message : "Failed to revoke invitation";
|
|
@@ -14520,7 +14554,7 @@ function createJoinRoutes() {
|
|
|
14520
14554
|
if (existing) return rerender("An account with this email already exists. Please sign in instead.");
|
|
14521
14555
|
try {
|
|
14522
14556
|
const userId = crypto.randomUUID();
|
|
14523
|
-
const passwordHash = await
|
|
14557
|
+
const passwordHash = await chunkNOT5YX23_cjs.AuthManager.hashPassword(password);
|
|
14524
14558
|
const now = Date.now();
|
|
14525
14559
|
const nowSec = Math.floor(now / 1e3);
|
|
14526
14560
|
await db.batch([
|
|
@@ -14533,8 +14567,8 @@ function createJoinRoutes() {
|
|
|
14533
14567
|
VALUES (?, ?, ?, 'credential', ?, ?, ?)`
|
|
14534
14568
|
).bind(`cred-${userId}`, userId, userId, passwordHash, nowSec, nowSec)
|
|
14535
14569
|
]);
|
|
14536
|
-
await new
|
|
14537
|
-
const auth =
|
|
14570
|
+
await new chunkV6EZYAWF_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
|
|
14571
|
+
const auth = chunkGMMCCIQO_cjs.createAuth(c.env);
|
|
14538
14572
|
const origin = new URL(c.req.url).origin;
|
|
14539
14573
|
const baReq = new Request(`${origin}/auth/sign-in/email`, {
|
|
14540
14574
|
method: "POST",
|
|
@@ -14589,7 +14623,7 @@ function createJoinRoutes() {
|
|
|
14589
14623
|
version
|
|
14590
14624
|
}), 400);
|
|
14591
14625
|
try {
|
|
14592
|
-
const auth =
|
|
14626
|
+
const auth = chunkGMMCCIQO_cjs.createAuth(c.env);
|
|
14593
14627
|
const origin = new URL(c.req.url).origin;
|
|
14594
14628
|
const baReq = new Request(`${origin}/auth/sign-in/email`, {
|
|
14595
14629
|
method: "POST",
|
|
@@ -14601,7 +14635,7 @@ function createJoinRoutes() {
|
|
|
14601
14635
|
const baBody = await baRes.json();
|
|
14602
14636
|
const userId = baBody?.user?.id;
|
|
14603
14637
|
if (!userId) return rerender("Sign-in succeeded but could not read user ID.");
|
|
14604
|
-
await new
|
|
14638
|
+
await new chunkV6EZYAWF_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
|
|
14605
14639
|
const headers = new Headers({ Location: "/admin?message=Welcome! You have joined " + encodeURIComponent(inv.tenantName) });
|
|
14606
14640
|
copyBaCookies(baRes, headers);
|
|
14607
14641
|
return new Response(null, { status: 302, headers });
|
|
@@ -14615,7 +14649,7 @@ function createJoinRoutes() {
|
|
|
14615
14649
|
|
|
14616
14650
|
// src/plugins/core-plugins/multi-tenant-plugin/index.ts
|
|
14617
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>`;
|
|
14618
|
-
var multiTenantPlugin =
|
|
14652
|
+
var multiTenantPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
14619
14653
|
id: manifest_default2.id,
|
|
14620
14654
|
version: "1.0.0",
|
|
14621
14655
|
name: manifest_default2.name,
|
|
@@ -14630,30 +14664,30 @@ var multiTenantPlugin = chunk3RNDJAZ5_cjs.definePlugin({
|
|
|
14630
14664
|
{ label: "Tenants", path: "/admin/tenants", icon: TENANT_ICON, order: 80 }
|
|
14631
14665
|
],
|
|
14632
14666
|
activate: async () => {
|
|
14633
|
-
|
|
14667
|
+
chunkFAADMKJX_cjs.invalidateTenantCache();
|
|
14634
14668
|
console.info("\u2705 Multi-Tenant plugin activated");
|
|
14635
14669
|
},
|
|
14636
14670
|
deactivate: async () => {
|
|
14637
|
-
|
|
14671
|
+
chunkFAADMKJX_cjs.invalidateTenantCache();
|
|
14638
14672
|
console.info("\u274C Multi-Tenant plugin deactivated");
|
|
14639
14673
|
}
|
|
14640
14674
|
});
|
|
14641
14675
|
var routes = new hono.Hono();
|
|
14642
|
-
routes.use("*",
|
|
14643
|
-
routes.use("*",
|
|
14676
|
+
routes.use("*", chunkNOT5YX23_cjs.requireAuth());
|
|
14677
|
+
routes.use("*", chunkNOT5YX23_cjs.requireRole(["admin", "editor"]));
|
|
14644
14678
|
routes.get("/:rootId", async (c) => {
|
|
14645
14679
|
const { rootId } = c.req.param();
|
|
14646
14680
|
const db = c.env.DB;
|
|
14647
|
-
const scope = await
|
|
14681
|
+
const scope = await chunkV6EZYAWF_cjs.resolveDocScope(c, db, { rootId });
|
|
14648
14682
|
if (!scope) {
|
|
14649
14683
|
return c.html('<p class="text-zinc-500 dark:text-zinc-400 p-4">Document not found.</p>', 404);
|
|
14650
14684
|
}
|
|
14651
14685
|
if (!scope.docType?.settings?.versioning) {
|
|
14652
14686
|
return c.html('<p class="text-zinc-500 dark:text-zinc-400 p-4">Versioning not enabled for this type.</p>', 404);
|
|
14653
14687
|
}
|
|
14654
|
-
const denied = await
|
|
14688
|
+
const denied = await chunkV6EZYAWF_cjs.denyIfNotAllowed(c, db, rootId, "read", scope.docType?.settings, scope.tenantId);
|
|
14655
14689
|
if (denied) return denied;
|
|
14656
|
-
const repo = new
|
|
14690
|
+
const repo = new chunkV6EZYAWF_cjs.DocumentRepository(db, scope.tenantId);
|
|
14657
14691
|
const versions = await repo.getVersionHistory(rootId);
|
|
14658
14692
|
const safeRootIdAttr = chunkMNWKYY5E_cjs.escapeHtml(rootId);
|
|
14659
14693
|
const rows = versions.map((v) => {
|
|
@@ -14746,14 +14780,14 @@ routes.post("/:rootId/restore/:versionNumber", async (c) => {
|
|
|
14746
14780
|
const { rootId, versionNumber } = c.req.param();
|
|
14747
14781
|
const db = c.env.DB;
|
|
14748
14782
|
const user = c.get("user");
|
|
14749
|
-
const scope = await
|
|
14783
|
+
const scope = await chunkV6EZYAWF_cjs.resolveDocScope(c, db, { rootId });
|
|
14750
14784
|
if (!scope) {
|
|
14751
14785
|
return c.json({ error: "Document not found" }, 404);
|
|
14752
14786
|
}
|
|
14753
14787
|
if (!scope.docType?.settings?.versioning) {
|
|
14754
14788
|
return c.json({ error: "Versioning not enabled for this type" }, 404);
|
|
14755
14789
|
}
|
|
14756
|
-
const denied = await
|
|
14790
|
+
const denied = await chunkV6EZYAWF_cjs.denyIfNotAllowed(c, db, rootId, "update", scope.docType?.settings, scope.tenantId);
|
|
14757
14791
|
if (denied) return denied;
|
|
14758
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();
|
|
14759
14793
|
if (!row) {
|
|
@@ -14763,7 +14797,7 @@ routes.post("/:rootId/restore/:versionNumber", async (c) => {
|
|
|
14763
14797
|
const title = row.title ?? null;
|
|
14764
14798
|
const slug = row.slug ?? null;
|
|
14765
14799
|
const docType = scope.docType;
|
|
14766
|
-
const svc = new
|
|
14800
|
+
const svc = new chunkLTZ5WYOK_cjs.DocumentsService(db, {
|
|
14767
14801
|
queryableFields: docType?.queryableFields ?? [],
|
|
14768
14802
|
typeSchemaVersion: docType?.schemaVersion ?? 1,
|
|
14769
14803
|
maxVersionsPerRoot: docType?.settings?.maxVersionsPerRoot ?? 50,
|
|
@@ -14776,7 +14810,7 @@ routes.post("/:rootId/restore/:versionNumber", async (c) => {
|
|
|
14776
14810
|
var routes_default = routes;
|
|
14777
14811
|
|
|
14778
14812
|
// src/plugins/core-plugins/versioning-plugin/index.ts
|
|
14779
|
-
var versioningPlugin =
|
|
14813
|
+
var versioningPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
14780
14814
|
id: "versioning",
|
|
14781
14815
|
version: "1.0.0",
|
|
14782
14816
|
name: "Versioning",
|
|
@@ -14853,8 +14887,8 @@ function createMagicLinkAuthPlugin() {
|
|
|
14853
14887
|
const baseUrl = new URL(c.req.url).origin;
|
|
14854
14888
|
const magicLink = `${baseUrl}/auth/magic-link/verify?token=${token}`;
|
|
14855
14889
|
try {
|
|
14856
|
-
if (
|
|
14857
|
-
await
|
|
14890
|
+
if (chunkV6EZYAWF_cjs.hasEmailService()) {
|
|
14891
|
+
await chunkV6EZYAWF_cjs.getEmailService().send({
|
|
14858
14892
|
to: normalizedEmail,
|
|
14859
14893
|
subject: "Your Magic Link to Sign In",
|
|
14860
14894
|
flow: "magic-link",
|
|
@@ -14931,19 +14965,19 @@ function createMagicLinkAuthPlugin() {
|
|
|
14931
14965
|
SET used = 1, used_at = ?
|
|
14932
14966
|
WHERE id = ?
|
|
14933
14967
|
`).bind(Date.now(), magicLink.id).run();
|
|
14934
|
-
const tokenTtl = await
|
|
14935
|
-
const jwtToken = await
|
|
14968
|
+
const tokenTtl = await chunkNOT5YX23_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
|
|
14969
|
+
const jwtToken = await chunkNOT5YX23_cjs.AuthManager.generateToken(
|
|
14936
14970
|
user.id,
|
|
14937
14971
|
user.email,
|
|
14938
14972
|
user.role,
|
|
14939
14973
|
c.env.JWT_SECRET,
|
|
14940
14974
|
tokenTtl
|
|
14941
14975
|
);
|
|
14942
|
-
|
|
14976
|
+
chunkNOT5YX23_cjs.AuthManager.setAuthCookie(c, jwtToken, { maxAge: tokenTtl });
|
|
14943
14977
|
await db.prepare(`
|
|
14944
14978
|
UPDATE auth_user SET last_login_at = ? WHERE id = ?
|
|
14945
14979
|
`).bind(Date.now(), user.id).run();
|
|
14946
|
-
|
|
14980
|
+
chunkV6EZYAWF_cjs.dispatchHookEvent(
|
|
14947
14981
|
c,
|
|
14948
14982
|
"auth:magic-link:consumed",
|
|
14949
14983
|
{ user: { id: user.id, email: user.email, role: user.role } },
|
|
@@ -15428,7 +15462,7 @@ async function warmCollections(db) {
|
|
|
15428
15462
|
const collectionCache = chunkYA3TJ65D_cjs.getCacheService(config);
|
|
15429
15463
|
let count = 0;
|
|
15430
15464
|
try {
|
|
15431
|
-
const results =
|
|
15465
|
+
const results = chunkFAADMKJX_cjs.getCollectionRegistry().listActive().map(chunkFAADMKJX_cjs.collectionRecordToRow);
|
|
15432
15466
|
for (const collection of results) {
|
|
15433
15467
|
const key = collectionCache.generateKey("item", collection.id);
|
|
15434
15468
|
await collectionCache.set(key, collection);
|
|
@@ -15699,7 +15733,7 @@ function renderCacheDashboard(data) {
|
|
|
15699
15733
|
</script>
|
|
15700
15734
|
|
|
15701
15735
|
<!-- Confirmation Dialogs -->
|
|
15702
|
-
${
|
|
15736
|
+
${chunkV6EZYAWF_cjs.renderConfirmationDialog({
|
|
15703
15737
|
id: "clear-all-cache-confirm",
|
|
15704
15738
|
title: "Clear All Cache",
|
|
15705
15739
|
message: "Are you sure you want to clear all cache entries? This cannot be undone.",
|
|
@@ -15710,7 +15744,7 @@ function renderCacheDashboard(data) {
|
|
|
15710
15744
|
onConfirm: "performClearAllCaches()"
|
|
15711
15745
|
})}
|
|
15712
15746
|
|
|
15713
|
-
${
|
|
15747
|
+
${chunkV6EZYAWF_cjs.renderConfirmationDialog({
|
|
15714
15748
|
id: "clear-namespace-cache-confirm",
|
|
15715
15749
|
title: "Clear Namespace Cache",
|
|
15716
15750
|
message: "Clear cache for this namespace?",
|
|
@@ -15721,7 +15755,7 @@ function renderCacheDashboard(data) {
|
|
|
15721
15755
|
onConfirm: "performClearNamespaceCache()"
|
|
15722
15756
|
})}
|
|
15723
15757
|
|
|
15724
|
-
${
|
|
15758
|
+
${chunkV6EZYAWF_cjs.getConfirmationDialogScript()}
|
|
15725
15759
|
`;
|
|
15726
15760
|
const layoutData = {
|
|
15727
15761
|
title: "Cache System",
|
|
@@ -15987,7 +16021,7 @@ app.get("/", async (c) => {
|
|
|
15987
16021
|
const totalRequests = totalHits + totalMisses;
|
|
15988
16022
|
const overallHitRate = totalRequests > 0 ? totalHits / totalRequests * 100 : 0;
|
|
15989
16023
|
const DEFAULT_TTL = chunkYA3TJ65D_cjs.CACHE_CONFIGS.api?.ttl ?? 300;
|
|
15990
|
-
const collections =
|
|
16024
|
+
const collections = chunkFAADMKJX_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => {
|
|
15991
16025
|
const cacheOverride = r.cache;
|
|
15992
16026
|
const cacheEnabled = cacheOverride?.enabled !== false;
|
|
15993
16027
|
const hasCustomTtl = typeof cacheOverride?.ttl === "number";
|
|
@@ -16524,9 +16558,9 @@ var faviconSvg = `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
|
16524
16558
|
// src/app.ts
|
|
16525
16559
|
function createSonicJSApp(config = {}) {
|
|
16526
16560
|
const app2 = new hono.Hono();
|
|
16527
|
-
const appVersion = config.version ||
|
|
16561
|
+
const appVersion = config.version || chunkE6LGR24C_cjs.getCoreVersion();
|
|
16528
16562
|
const appName = config.name || "SonicJS AI";
|
|
16529
|
-
const hookSystem = new
|
|
16563
|
+
const hookSystem = new chunkBUMHSDRW_cjs.HookSystemImpl();
|
|
16530
16564
|
chunkJ6JTWD2A_cjs.setHookSystem(hookSystem);
|
|
16531
16565
|
const magicLinkPlugin = createMagicLinkAuthPlugin();
|
|
16532
16566
|
const corePluginsBeforeCatchAll = [
|
|
@@ -16534,7 +16568,7 @@ function createSonicJSApp(config = {}) {
|
|
|
16534
16568
|
apiKeysPlugin,
|
|
16535
16569
|
aiSearchPlugin,
|
|
16536
16570
|
oauthProvidersPlugin,
|
|
16537
|
-
|
|
16571
|
+
chunkV6EZYAWF_cjs.userProfilesPlugin,
|
|
16538
16572
|
otpLoginPlugin,
|
|
16539
16573
|
analyticsPlugin,
|
|
16540
16574
|
stripePlugin,
|
|
@@ -16544,23 +16578,23 @@ function createSonicJSApp(config = {}) {
|
|
|
16544
16578
|
shortcodesPlugin,
|
|
16545
16579
|
helloWorldPlugin,
|
|
16546
16580
|
multiTenantPlugin,
|
|
16547
|
-
|
|
16581
|
+
chunkV6EZYAWF_cjs.lexicalEditorPlugin,
|
|
16548
16582
|
versioningPlugin
|
|
16549
16583
|
];
|
|
16550
16584
|
const corePluginsAfterCatchAll = [emailPluginV3, magicLinkPlugin, emailReconciliationPlugin];
|
|
16551
|
-
const wirePlugins =
|
|
16585
|
+
const wirePlugins = chunkBUMHSDRW_cjs.createPluginWirer(
|
|
16552
16586
|
() => [...corePluginsBeforeCatchAll, ...corePluginsAfterCatchAll, ...config.plugins?.register ?? []],
|
|
16553
16587
|
// The capability-gated `ctx.cap.email` resolves to the app EmailService, which
|
|
16554
16588
|
// is initialized (below) just before wiring on the first request.
|
|
16555
16589
|
() => ({
|
|
16556
16590
|
hooks: hookSystem,
|
|
16557
16591
|
env: firstRequestEnv,
|
|
16558
|
-
providers: { email: () =>
|
|
16592
|
+
providers: { email: () => chunkV6EZYAWF_cjs.getEmailService() }
|
|
16559
16593
|
})
|
|
16560
16594
|
);
|
|
16561
16595
|
let firstRequestEnv;
|
|
16562
16596
|
const initEmailService = async (env = {}) => {
|
|
16563
|
-
if (
|
|
16597
|
+
if (chunkV6EZYAWF_cjs.hasEmailService()) return;
|
|
16564
16598
|
let provider;
|
|
16565
16599
|
let defaultFrom = config.email?.from;
|
|
16566
16600
|
let defaultReplyTo;
|
|
@@ -16595,14 +16629,14 @@ function createSonicJSApp(config = {}) {
|
|
|
16595
16629
|
}
|
|
16596
16630
|
}
|
|
16597
16631
|
defaultFrom = defaultFrom || env.DEFAULT_FROM_EMAIL || "noreply@sonicjs.local";
|
|
16598
|
-
|
|
16632
|
+
chunkV6EZYAWF_cjs.setEmailService(new EmailService({ provider, defaultFrom, defaultReplyTo, db: env.DB }));
|
|
16599
16633
|
};
|
|
16600
16634
|
app2.use("*", async (c, next) => {
|
|
16601
16635
|
c.set("appVersion", appVersion);
|
|
16602
16636
|
await next();
|
|
16603
16637
|
});
|
|
16604
|
-
app2.use("*",
|
|
16605
|
-
app2.use("*",
|
|
16638
|
+
app2.use("*", chunkNOT5YX23_cjs.metricsMiddleware());
|
|
16639
|
+
app2.use("*", chunkNOT5YX23_cjs.bootstrapMiddleware(config));
|
|
16606
16640
|
const boot = async (env) => {
|
|
16607
16641
|
if (config.plugins?.disableAll) return;
|
|
16608
16642
|
firstRequestEnv = env;
|
|
@@ -16640,13 +16674,13 @@ function createSonicJSApp(config = {}) {
|
|
|
16640
16674
|
allowHeaders: ["Content-Type", "Authorization", "X-API-Key"],
|
|
16641
16675
|
credentials: true
|
|
16642
16676
|
}));
|
|
16643
|
-
app2.use("*",
|
|
16644
|
-
app2.use("*",
|
|
16677
|
+
app2.use("*", chunkNOT5YX23_cjs.securityHeadersMiddleware());
|
|
16678
|
+
app2.use("*", chunkNOT5YX23_cjs.csrfProtection());
|
|
16645
16679
|
app2.use("*", async (c, next) => {
|
|
16646
16680
|
try {
|
|
16647
16681
|
const reqUrl = new URL(c.req.url);
|
|
16648
16682
|
const requestBaseURL = `${reqUrl.protocol}//${reqUrl.host}`;
|
|
16649
|
-
const auth =
|
|
16683
|
+
const auth = chunkGMMCCIQO_cjs.createAuth(c.env, config.auth?.extendBetterAuth, requestBaseURL);
|
|
16650
16684
|
const session = await auth.api.getSession({ headers: c.req.raw.headers });
|
|
16651
16685
|
if (session?.user) {
|
|
16652
16686
|
const u = session.user;
|
|
@@ -16679,9 +16713,9 @@ function createSonicJSApp(config = {}) {
|
|
|
16679
16713
|
app2.use("*", middleware);
|
|
16680
16714
|
}
|
|
16681
16715
|
}
|
|
16682
|
-
app2.use("*",
|
|
16683
|
-
app2.use("/admin/*",
|
|
16684
|
-
app2.use("/admin/*",
|
|
16716
|
+
app2.use("*", chunkFAADMKJX_cjs.tenantMiddleware());
|
|
16717
|
+
app2.use("/admin/*", chunkNOT5YX23_cjs.requireAuth());
|
|
16718
|
+
app2.use("/admin/*", chunkNOT5YX23_cjs.requireRbac("portal", "access"));
|
|
16685
16719
|
app2.use("/admin/*", pluginMenuMiddleware());
|
|
16686
16720
|
const NAV_LANDING = [
|
|
16687
16721
|
{ path: "/admin/content", perm: "content:read" },
|
|
@@ -16698,7 +16732,7 @@ function createSonicJSApp(config = {}) {
|
|
|
16698
16732
|
if (!user?.userId) return next();
|
|
16699
16733
|
let perms = [];
|
|
16700
16734
|
try {
|
|
16701
|
-
const { RbacService: RbacService2 } = await import('./rbac-
|
|
16735
|
+
const { RbacService: RbacService2 } = await import('./rbac-7QZ4JZ2E.cjs');
|
|
16702
16736
|
perms = await new RbacService2(c.env.DB, c.env.CACHE_KV).permissionsForUser(user.userId);
|
|
16703
16737
|
} catch {
|
|
16704
16738
|
return next();
|
|
@@ -16727,43 +16761,43 @@ function createSonicJSApp(config = {}) {
|
|
|
16727
16761
|
});
|
|
16728
16762
|
app2.route("/api/security-audit", apiRoutes2);
|
|
16729
16763
|
app2.route("/admin/plugins/security-audit", adminRoutes3);
|
|
16730
|
-
app2.route("/api/media",
|
|
16731
|
-
app2.route("/api/system",
|
|
16732
|
-
app2.route("/api/documents",
|
|
16733
|
-
app2.route("/api",
|
|
16734
|
-
app2.route("/admin/documents",
|
|
16735
|
-
|
|
16736
|
-
app2.route("/admin/api",
|
|
16737
|
-
app2.route("/admin/collections",
|
|
16738
|
-
app2.route("/admin/settings",
|
|
16739
|
-
app2.route("/admin/api-reference",
|
|
16764
|
+
app2.route("/api/media", chunkV6EZYAWF_cjs.api_media_default);
|
|
16765
|
+
app2.route("/api/system", chunkV6EZYAWF_cjs.api_system_default);
|
|
16766
|
+
app2.route("/api/documents", chunkV6EZYAWF_cjs.apiDocumentsRoutes);
|
|
16767
|
+
app2.route("/api", chunkV6EZYAWF_cjs.api_default);
|
|
16768
|
+
app2.route("/admin/documents", chunkV6EZYAWF_cjs.adminDocumentsRoutes);
|
|
16769
|
+
chunkBUMHSDRW_cjs.registerPluginRoutes(app2, [formsPlugin], { source: "core" });
|
|
16770
|
+
app2.route("/admin/api", chunkV6EZYAWF_cjs.admin_api_default);
|
|
16771
|
+
app2.route("/admin/collections", chunkV6EZYAWF_cjs.adminCollectionsRoutes);
|
|
16772
|
+
app2.route("/admin/settings", chunkV6EZYAWF_cjs.adminSettingsRoutes);
|
|
16773
|
+
app2.route("/admin/api-reference", chunkV6EZYAWF_cjs.router2);
|
|
16740
16774
|
app2.route("/admin/database-tools", createDatabaseToolsAdminRoutes());
|
|
16741
|
-
app2.route("/admin/content",
|
|
16742
|
-
app2.route("/admin/media",
|
|
16775
|
+
app2.route("/admin/content", chunkV6EZYAWF_cjs.admin_content_default);
|
|
16776
|
+
app2.route("/admin/media", chunkV6EZYAWF_cjs.adminMediaRoutes);
|
|
16743
16777
|
app2.use("/auth/*", securityAuditMiddleware());
|
|
16744
16778
|
if (!config.plugins?.disableAll) {
|
|
16745
|
-
|
|
16779
|
+
chunkBUMHSDRW_cjs.registerPluginRoutes(app2, corePluginsBeforeCatchAll, { source: "core" });
|
|
16746
16780
|
app2.route("/admin/cache", cache_default.getRoutes());
|
|
16747
16781
|
if (config.plugins?.register && config.plugins.register.length > 0) {
|
|
16748
|
-
|
|
16782
|
+
chunkBUMHSDRW_cjs.registerPluginRoutes(app2, config.plugins.register, { source: "user" });
|
|
16749
16783
|
}
|
|
16750
16784
|
}
|
|
16751
16785
|
app2.route("/api/events", apiRoutes4);
|
|
16752
|
-
app2.route("/admin/dashboard",
|
|
16753
|
-
app2.route("/admin/plugins",
|
|
16754
|
-
app2.route("/admin/logs",
|
|
16786
|
+
app2.route("/admin/dashboard", chunkV6EZYAWF_cjs.router);
|
|
16787
|
+
app2.route("/admin/plugins", chunkV6EZYAWF_cjs.adminPluginRoutes);
|
|
16788
|
+
app2.route("/admin/logs", chunkV6EZYAWF_cjs.adminLogsRoutes);
|
|
16755
16789
|
app2.route("/admin/rbac", adminRbacRoutes);
|
|
16756
|
-
app2.route("/admin",
|
|
16757
|
-
app2.route("/auth",
|
|
16790
|
+
app2.route("/admin", chunkV6EZYAWF_cjs.userRoutes);
|
|
16791
|
+
app2.route("/auth", chunkV6EZYAWF_cjs.auth_default);
|
|
16758
16792
|
app2.on(["GET", "POST"], "/auth/*", (c) => {
|
|
16759
16793
|
const reqUrl = new URL(c.req.url);
|
|
16760
16794
|
const requestBaseURL = `${reqUrl.protocol}//${reqUrl.host}`;
|
|
16761
|
-
const auth =
|
|
16795
|
+
const auth = chunkGMMCCIQO_cjs.createAuth(c.env, config.auth?.extendBetterAuth, requestBaseURL);
|
|
16762
16796
|
return auth.handler(c.req.raw);
|
|
16763
16797
|
});
|
|
16764
|
-
app2.route("/",
|
|
16798
|
+
app2.route("/", chunkV6EZYAWF_cjs.test_cleanup_default);
|
|
16765
16799
|
if (!config.plugins?.disableAll) {
|
|
16766
|
-
|
|
16800
|
+
chunkBUMHSDRW_cjs.registerPluginRoutes(app2, corePluginsAfterCatchAll, { source: "core" });
|
|
16767
16801
|
}
|
|
16768
16802
|
if (!config.plugins?.disableAll) {
|
|
16769
16803
|
const allMountedPlugins = [
|
|
@@ -16773,10 +16807,10 @@ function createSonicJSApp(config = {}) {
|
|
|
16773
16807
|
...config.plugins?.register ?? []
|
|
16774
16808
|
];
|
|
16775
16809
|
const userPlugins = (config.plugins?.register ?? []).filter(
|
|
16776
|
-
(p) => !
|
|
16810
|
+
(p) => !chunkFAADMKJX_cjs.PLUGIN_REGISTRY[p.id]
|
|
16777
16811
|
);
|
|
16778
|
-
|
|
16779
|
-
|
|
16812
|
+
chunkBUMHSDRW_cjs.setPluginMenu(userPlugins.flatMap((p) => p.menu ?? []));
|
|
16813
|
+
chunkQSDN2CKI_cjs.setPluginDefinitions(allMountedPlugins);
|
|
16780
16814
|
}
|
|
16781
16815
|
app2.get("/favicon.svg", (c) => {
|
|
16782
16816
|
return new Response(faviconSvg, {
|
|
@@ -16829,7 +16863,7 @@ function createSonicJSApp(config = {}) {
|
|
|
16829
16863
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
16830
16864
|
});
|
|
16831
16865
|
});
|
|
16832
|
-
|
|
16866
|
+
chunk36Z3AKX3_cjs.setAppInstance(app2);
|
|
16833
16867
|
app2.notFound((c) => {
|
|
16834
16868
|
return c.json({ error: "Not Found", status: 404 }, 404);
|
|
16835
16869
|
});
|
|
@@ -17640,9 +17674,11 @@ var RedirectService = class {
|
|
|
17640
17674
|
this.cloudflareService = new CloudflareBulkService(env);
|
|
17641
17675
|
}
|
|
17642
17676
|
}
|
|
17677
|
+
db;
|
|
17678
|
+
env;
|
|
17643
17679
|
cloudflareService = null;
|
|
17644
17680
|
getDocService() {
|
|
17645
|
-
return new
|
|
17681
|
+
return new chunkLTZ5WYOK_cjs.DocumentsService(this.db, {
|
|
17646
17682
|
queryableFields: REDIRECT_QUERYABLE_FIELDS,
|
|
17647
17683
|
maxVersionsPerRoot: 1,
|
|
17648
17684
|
tenantId: TENANT3
|
|
@@ -17758,7 +17794,7 @@ var RedirectService = class {
|
|
|
17758
17794
|
async batchCreate(rows, userId) {
|
|
17759
17795
|
const now = Math.floor(Date.now() / 1e3);
|
|
17760
17796
|
const statements = rows.map((r) => {
|
|
17761
|
-
const id =
|
|
17797
|
+
const id = chunkKIGVVO6N_cjs.nanoid();
|
|
17762
17798
|
const data = JSON.stringify({
|
|
17763
17799
|
source: r.source,
|
|
17764
17800
|
destination: r.destination,
|
|
@@ -20268,7 +20304,7 @@ function createRedirectApiRoutes() {
|
|
|
20268
20304
|
});
|
|
20269
20305
|
return api;
|
|
20270
20306
|
}
|
|
20271
|
-
var redirectPlugin =
|
|
20307
|
+
var redirectPlugin = chunkQSDN2CKI_cjs.definePlugin({
|
|
20272
20308
|
id: manifest_default3.id,
|
|
20273
20309
|
version: manifest_default3.version,
|
|
20274
20310
|
name: manifest_default3.name,
|
|
@@ -20286,7 +20322,7 @@ var redirectPlugin = chunk3RNDJAZ5_cjs.definePlugin({
|
|
|
20286
20322
|
async onBoot(ctx) {
|
|
20287
20323
|
const db = ctx.env?.DB;
|
|
20288
20324
|
if (!db) return;
|
|
20289
|
-
const registry = new
|
|
20325
|
+
const registry = new chunkNOT5YX23_cjs.DocumentTypeRegistry(db);
|
|
20290
20326
|
await registry.register({
|
|
20291
20327
|
id: "redirect",
|
|
20292
20328
|
name: "redirect",
|
|
@@ -20402,103 +20438,103 @@ function createDb(d1$1) {
|
|
|
20402
20438
|
}
|
|
20403
20439
|
|
|
20404
20440
|
// src/index.ts
|
|
20405
|
-
var VERSION =
|
|
20441
|
+
var VERSION = chunkE6LGR24C_cjs.package_default.version;
|
|
20406
20442
|
|
|
20407
20443
|
Object.defineProperty(exports, "DocumentRepository", {
|
|
20408
20444
|
enumerable: true,
|
|
20409
|
-
get: function () { return
|
|
20445
|
+
get: function () { return chunkV6EZYAWF_cjs.DocumentRepository; }
|
|
20410
20446
|
});
|
|
20411
20447
|
Object.defineProperty(exports, "ROUTES_INFO", {
|
|
20412
20448
|
enumerable: true,
|
|
20413
|
-
get: function () { return
|
|
20449
|
+
get: function () { return chunkV6EZYAWF_cjs.ROUTES_INFO; }
|
|
20414
20450
|
});
|
|
20415
20451
|
Object.defineProperty(exports, "adminApiRoutes", {
|
|
20416
20452
|
enumerable: true,
|
|
20417
|
-
get: function () { return
|
|
20453
|
+
get: function () { return chunkV6EZYAWF_cjs.admin_api_default; }
|
|
20418
20454
|
});
|
|
20419
20455
|
Object.defineProperty(exports, "adminCheckboxRoutes", {
|
|
20420
20456
|
enumerable: true,
|
|
20421
|
-
get: function () { return
|
|
20457
|
+
get: function () { return chunkV6EZYAWF_cjs.adminCheckboxRoutes; }
|
|
20422
20458
|
});
|
|
20423
20459
|
Object.defineProperty(exports, "adminCollectionsRoutes", {
|
|
20424
20460
|
enumerable: true,
|
|
20425
|
-
get: function () { return
|
|
20461
|
+
get: function () { return chunkV6EZYAWF_cjs.adminCollectionsRoutes; }
|
|
20426
20462
|
});
|
|
20427
20463
|
Object.defineProperty(exports, "adminContentRoutes", {
|
|
20428
20464
|
enumerable: true,
|
|
20429
|
-
get: function () { return
|
|
20465
|
+
get: function () { return chunkV6EZYAWF_cjs.admin_content_default; }
|
|
20430
20466
|
});
|
|
20431
20467
|
Object.defineProperty(exports, "adminDashboardRoutes", {
|
|
20432
20468
|
enumerable: true,
|
|
20433
|
-
get: function () { return
|
|
20469
|
+
get: function () { return chunkV6EZYAWF_cjs.router; }
|
|
20434
20470
|
});
|
|
20435
20471
|
Object.defineProperty(exports, "adminLogsRoutes", {
|
|
20436
20472
|
enumerable: true,
|
|
20437
|
-
get: function () { return
|
|
20473
|
+
get: function () { return chunkV6EZYAWF_cjs.adminLogsRoutes; }
|
|
20438
20474
|
});
|
|
20439
20475
|
Object.defineProperty(exports, "adminMediaRoutes", {
|
|
20440
20476
|
enumerable: true,
|
|
20441
|
-
get: function () { return
|
|
20477
|
+
get: function () { return chunkV6EZYAWF_cjs.adminMediaRoutes; }
|
|
20442
20478
|
});
|
|
20443
20479
|
Object.defineProperty(exports, "adminPluginRoutes", {
|
|
20444
20480
|
enumerable: true,
|
|
20445
|
-
get: function () { return
|
|
20481
|
+
get: function () { return chunkV6EZYAWF_cjs.adminPluginRoutes; }
|
|
20446
20482
|
});
|
|
20447
20483
|
Object.defineProperty(exports, "adminSettingsRoutes", {
|
|
20448
20484
|
enumerable: true,
|
|
20449
|
-
get: function () { return
|
|
20485
|
+
get: function () { return chunkV6EZYAWF_cjs.adminSettingsRoutes; }
|
|
20450
20486
|
});
|
|
20451
20487
|
Object.defineProperty(exports, "adminUsersRoutes", {
|
|
20452
20488
|
enumerable: true,
|
|
20453
|
-
get: function () { return
|
|
20489
|
+
get: function () { return chunkV6EZYAWF_cjs.userRoutes; }
|
|
20454
20490
|
});
|
|
20455
20491
|
Object.defineProperty(exports, "apiContentCrudRoutes", {
|
|
20456
20492
|
enumerable: true,
|
|
20457
|
-
get: function () { return
|
|
20493
|
+
get: function () { return chunkV6EZYAWF_cjs.api_content_crud_default; }
|
|
20458
20494
|
});
|
|
20459
20495
|
Object.defineProperty(exports, "apiMediaRoutes", {
|
|
20460
20496
|
enumerable: true,
|
|
20461
|
-
get: function () { return
|
|
20497
|
+
get: function () { return chunkV6EZYAWF_cjs.api_media_default; }
|
|
20462
20498
|
});
|
|
20463
20499
|
Object.defineProperty(exports, "apiRoutes", {
|
|
20464
20500
|
enumerable: true,
|
|
20465
|
-
get: function () { return
|
|
20501
|
+
get: function () { return chunkV6EZYAWF_cjs.api_default; }
|
|
20466
20502
|
});
|
|
20467
20503
|
Object.defineProperty(exports, "apiSystemRoutes", {
|
|
20468
20504
|
enumerable: true,
|
|
20469
|
-
get: function () { return
|
|
20505
|
+
get: function () { return chunkV6EZYAWF_cjs.api_system_default; }
|
|
20470
20506
|
});
|
|
20471
20507
|
Object.defineProperty(exports, "authRoutes", {
|
|
20472
20508
|
enumerable: true,
|
|
20473
|
-
get: function () { return
|
|
20509
|
+
get: function () { return chunkV6EZYAWF_cjs.auth_default; }
|
|
20474
20510
|
});
|
|
20475
20511
|
Object.defineProperty(exports, "createUserProfilesPlugin", {
|
|
20476
20512
|
enumerable: true,
|
|
20477
|
-
get: function () { return
|
|
20513
|
+
get: function () { return chunkV6EZYAWF_cjs.createUserProfilesPlugin; }
|
|
20478
20514
|
});
|
|
20479
20515
|
Object.defineProperty(exports, "defineUserProfile", {
|
|
20480
20516
|
enumerable: true,
|
|
20481
|
-
get: function () { return
|
|
20517
|
+
get: function () { return chunkV6EZYAWF_cjs.defineUserProfile; }
|
|
20482
20518
|
});
|
|
20483
20519
|
Object.defineProperty(exports, "getUserProfileConfig", {
|
|
20484
20520
|
enumerable: true,
|
|
20485
|
-
get: function () { return
|
|
20521
|
+
get: function () { return chunkV6EZYAWF_cjs.getUserProfileConfig; }
|
|
20486
20522
|
});
|
|
20487
20523
|
Object.defineProperty(exports, "userProfilesPlugin", {
|
|
20488
20524
|
enumerable: true,
|
|
20489
|
-
get: function () { return
|
|
20525
|
+
get: function () { return chunkV6EZYAWF_cjs.userProfilesPlugin; }
|
|
20490
20526
|
});
|
|
20491
20527
|
Object.defineProperty(exports, "Logger", {
|
|
20492
20528
|
enumerable: true,
|
|
20493
|
-
get: function () { return
|
|
20529
|
+
get: function () { return chunk36Z3AKX3_cjs.Logger; }
|
|
20494
20530
|
});
|
|
20495
20531
|
Object.defineProperty(exports, "getLogger", {
|
|
20496
20532
|
enumerable: true,
|
|
20497
|
-
get: function () { return
|
|
20533
|
+
get: function () { return chunk36Z3AKX3_cjs.getLogger; }
|
|
20498
20534
|
});
|
|
20499
20535
|
Object.defineProperty(exports, "initLogger", {
|
|
20500
20536
|
enumerable: true,
|
|
20501
|
-
get: function () { return
|
|
20537
|
+
get: function () { return chunk36Z3AKX3_cjs.initLogger; }
|
|
20502
20538
|
});
|
|
20503
20539
|
Object.defineProperty(exports, "apiTokens", {
|
|
20504
20540
|
enumerable: true,
|
|
@@ -20642,127 +20678,127 @@ Object.defineProperty(exports, "workflowHistory", {
|
|
|
20642
20678
|
});
|
|
20643
20679
|
Object.defineProperty(exports, "AuthManager", {
|
|
20644
20680
|
enumerable: true,
|
|
20645
|
-
get: function () { return
|
|
20681
|
+
get: function () { return chunkNOT5YX23_cjs.AuthManager; }
|
|
20646
20682
|
});
|
|
20647
20683
|
Object.defineProperty(exports, "PermissionManager", {
|
|
20648
20684
|
enumerable: true,
|
|
20649
|
-
get: function () { return
|
|
20685
|
+
get: function () { return chunkNOT5YX23_cjs.PermissionManager; }
|
|
20650
20686
|
});
|
|
20651
20687
|
Object.defineProperty(exports, "bootstrapDocumentTypes", {
|
|
20652
20688
|
enumerable: true,
|
|
20653
|
-
get: function () { return
|
|
20689
|
+
get: function () { return chunkNOT5YX23_cjs.bootstrapDocumentTypes; }
|
|
20654
20690
|
});
|
|
20655
20691
|
Object.defineProperty(exports, "bootstrapMiddleware", {
|
|
20656
20692
|
enumerable: true,
|
|
20657
|
-
get: function () { return
|
|
20693
|
+
get: function () { return chunkNOT5YX23_cjs.bootstrapMiddleware; }
|
|
20658
20694
|
});
|
|
20659
20695
|
Object.defineProperty(exports, "cacheHeaders", {
|
|
20660
20696
|
enumerable: true,
|
|
20661
|
-
get: function () { return
|
|
20697
|
+
get: function () { return chunkNOT5YX23_cjs.cacheHeaders; }
|
|
20662
20698
|
});
|
|
20663
20699
|
Object.defineProperty(exports, "compressionMiddleware", {
|
|
20664
20700
|
enumerable: true,
|
|
20665
|
-
get: function () { return
|
|
20701
|
+
get: function () { return chunkNOT5YX23_cjs.compressionMiddleware; }
|
|
20666
20702
|
});
|
|
20667
20703
|
Object.defineProperty(exports, "detailedLoggingMiddleware", {
|
|
20668
20704
|
enumerable: true,
|
|
20669
|
-
get: function () { return
|
|
20705
|
+
get: function () { return chunkNOT5YX23_cjs.detailedLoggingMiddleware; }
|
|
20670
20706
|
});
|
|
20671
20707
|
Object.defineProperty(exports, "getActivePlugins", {
|
|
20672
20708
|
enumerable: true,
|
|
20673
|
-
get: function () { return
|
|
20709
|
+
get: function () { return chunkNOT5YX23_cjs.getActivePlugins; }
|
|
20674
20710
|
});
|
|
20675
20711
|
Object.defineProperty(exports, "isPluginActive", {
|
|
20676
20712
|
enumerable: true,
|
|
20677
|
-
get: function () { return
|
|
20713
|
+
get: function () { return chunkNOT5YX23_cjs.isPluginActive; }
|
|
20678
20714
|
});
|
|
20679
20715
|
Object.defineProperty(exports, "logActivity", {
|
|
20680
20716
|
enumerable: true,
|
|
20681
|
-
get: function () { return
|
|
20717
|
+
get: function () { return chunkNOT5YX23_cjs.logActivity; }
|
|
20682
20718
|
});
|
|
20683
20719
|
Object.defineProperty(exports, "loggingMiddleware", {
|
|
20684
20720
|
enumerable: true,
|
|
20685
|
-
get: function () { return
|
|
20721
|
+
get: function () { return chunkNOT5YX23_cjs.loggingMiddleware; }
|
|
20686
20722
|
});
|
|
20687
20723
|
Object.defineProperty(exports, "optionalAuth", {
|
|
20688
20724
|
enumerable: true,
|
|
20689
|
-
get: function () { return
|
|
20725
|
+
get: function () { return chunkNOT5YX23_cjs.optionalAuth; }
|
|
20690
20726
|
});
|
|
20691
20727
|
Object.defineProperty(exports, "performanceLoggingMiddleware", {
|
|
20692
20728
|
enumerable: true,
|
|
20693
|
-
get: function () { return
|
|
20729
|
+
get: function () { return chunkNOT5YX23_cjs.performanceLoggingMiddleware; }
|
|
20694
20730
|
});
|
|
20695
20731
|
Object.defineProperty(exports, "requireActivePlugin", {
|
|
20696
20732
|
enumerable: true,
|
|
20697
|
-
get: function () { return
|
|
20733
|
+
get: function () { return chunkNOT5YX23_cjs.requireActivePlugin; }
|
|
20698
20734
|
});
|
|
20699
20735
|
Object.defineProperty(exports, "requireActivePlugins", {
|
|
20700
20736
|
enumerable: true,
|
|
20701
|
-
get: function () { return
|
|
20737
|
+
get: function () { return chunkNOT5YX23_cjs.requireActivePlugins; }
|
|
20702
20738
|
});
|
|
20703
20739
|
Object.defineProperty(exports, "requireAnyPermission", {
|
|
20704
20740
|
enumerable: true,
|
|
20705
|
-
get: function () { return
|
|
20741
|
+
get: function () { return chunkNOT5YX23_cjs.requireAnyPermission; }
|
|
20706
20742
|
});
|
|
20707
20743
|
Object.defineProperty(exports, "requireAuth", {
|
|
20708
20744
|
enumerable: true,
|
|
20709
|
-
get: function () { return
|
|
20745
|
+
get: function () { return chunkNOT5YX23_cjs.requireAuth; }
|
|
20710
20746
|
});
|
|
20711
20747
|
Object.defineProperty(exports, "requirePermission", {
|
|
20712
20748
|
enumerable: true,
|
|
20713
|
-
get: function () { return
|
|
20749
|
+
get: function () { return chunkNOT5YX23_cjs.requirePermission; }
|
|
20714
20750
|
});
|
|
20715
20751
|
Object.defineProperty(exports, "requireRole", {
|
|
20716
20752
|
enumerable: true,
|
|
20717
|
-
get: function () { return
|
|
20753
|
+
get: function () { return chunkNOT5YX23_cjs.requireRole; }
|
|
20718
20754
|
});
|
|
20719
20755
|
Object.defineProperty(exports, "securityHeaders", {
|
|
20720
20756
|
enumerable: true,
|
|
20721
|
-
get: function () { return
|
|
20757
|
+
get: function () { return chunkNOT5YX23_cjs.securityHeadersMiddleware; }
|
|
20722
20758
|
});
|
|
20723
20759
|
Object.defineProperty(exports, "securityLoggingMiddleware", {
|
|
20724
20760
|
enumerable: true,
|
|
20725
|
-
get: function () { return
|
|
20761
|
+
get: function () { return chunkNOT5YX23_cjs.securityLoggingMiddleware; }
|
|
20726
20762
|
});
|
|
20727
20763
|
Object.defineProperty(exports, "DocumentsService", {
|
|
20728
20764
|
enumerable: true,
|
|
20729
|
-
get: function () { return
|
|
20765
|
+
get: function () { return chunkLTZ5WYOK_cjs.DocumentsService; }
|
|
20730
20766
|
});
|
|
20731
20767
|
Object.defineProperty(exports, "RbacService", {
|
|
20732
20768
|
enumerable: true,
|
|
20733
|
-
get: function () { return
|
|
20769
|
+
get: function () { return chunkLTZ5WYOK_cjs.RbacService; }
|
|
20734
20770
|
});
|
|
20735
20771
|
Object.defineProperty(exports, "PluginBootstrapService", {
|
|
20736
20772
|
enumerable: true,
|
|
20737
|
-
get: function () { return
|
|
20773
|
+
get: function () { return chunkFAADMKJX_cjs.PluginBootstrapService; }
|
|
20738
20774
|
});
|
|
20739
20775
|
Object.defineProperty(exports, "PluginServiceClass", {
|
|
20740
20776
|
enumerable: true,
|
|
20741
|
-
get: function () { return
|
|
20777
|
+
get: function () { return chunkFAADMKJX_cjs.PluginService; }
|
|
20742
20778
|
});
|
|
20743
20779
|
Object.defineProperty(exports, "getAvailableCollectionNames", {
|
|
20744
20780
|
enumerable: true,
|
|
20745
|
-
get: function () { return
|
|
20781
|
+
get: function () { return chunkFAADMKJX_cjs.getAvailableCollectionNames; }
|
|
20746
20782
|
});
|
|
20747
20783
|
Object.defineProperty(exports, "loadCollectionConfig", {
|
|
20748
20784
|
enumerable: true,
|
|
20749
|
-
get: function () { return
|
|
20785
|
+
get: function () { return chunkFAADMKJX_cjs.loadCollectionConfig; }
|
|
20750
20786
|
});
|
|
20751
20787
|
Object.defineProperty(exports, "loadCollectionConfigs", {
|
|
20752
20788
|
enumerable: true,
|
|
20753
|
-
get: function () { return
|
|
20789
|
+
get: function () { return chunkFAADMKJX_cjs.loadCollectionConfigs; }
|
|
20754
20790
|
});
|
|
20755
20791
|
Object.defineProperty(exports, "registerCollections", {
|
|
20756
20792
|
enumerable: true,
|
|
20757
|
-
get: function () { return
|
|
20793
|
+
get: function () { return chunkFAADMKJX_cjs.registerCollections; }
|
|
20758
20794
|
});
|
|
20759
20795
|
Object.defineProperty(exports, "validateCollectionConfig", {
|
|
20760
20796
|
enumerable: true,
|
|
20761
|
-
get: function () { return
|
|
20797
|
+
get: function () { return chunkFAADMKJX_cjs.validateCollectionConfig; }
|
|
20762
20798
|
});
|
|
20763
20799
|
Object.defineProperty(exports, "MigrationService", {
|
|
20764
20800
|
enumerable: true,
|
|
20765
|
-
get: function () { return
|
|
20801
|
+
get: function () { return chunkETRNDMB2_cjs.MigrationService; }
|
|
20766
20802
|
});
|
|
20767
20803
|
Object.defineProperty(exports, "renderFilterBar", {
|
|
20768
20804
|
enumerable: true,
|
|
@@ -20802,99 +20838,99 @@ Object.defineProperty(exports, "renderAdminLayoutCatalyst", {
|
|
|
20802
20838
|
});
|
|
20803
20839
|
Object.defineProperty(exports, "HookSystemImpl", {
|
|
20804
20840
|
enumerable: true,
|
|
20805
|
-
get: function () { return
|
|
20841
|
+
get: function () { return chunkBUMHSDRW_cjs.HookSystemImpl; }
|
|
20806
20842
|
});
|
|
20807
20843
|
Object.defineProperty(exports, "HookUtils", {
|
|
20808
20844
|
enumerable: true,
|
|
20809
|
-
get: function () { return
|
|
20845
|
+
get: function () { return chunkBUMHSDRW_cjs.HookUtils; }
|
|
20810
20846
|
});
|
|
20811
20847
|
Object.defineProperty(exports, "PluginDependencyCycleError", {
|
|
20812
20848
|
enumerable: true,
|
|
20813
|
-
get: function () { return
|
|
20849
|
+
get: function () { return chunkBUMHSDRW_cjs.PluginDependencyCycleError; }
|
|
20814
20850
|
});
|
|
20815
20851
|
Object.defineProperty(exports, "PluginManagerClass", {
|
|
20816
20852
|
enumerable: true,
|
|
20817
|
-
get: function () { return
|
|
20853
|
+
get: function () { return chunkBUMHSDRW_cjs.PluginManager; }
|
|
20818
20854
|
});
|
|
20819
20855
|
Object.defineProperty(exports, "PluginRegistryImpl", {
|
|
20820
20856
|
enumerable: true,
|
|
20821
|
-
get: function () { return
|
|
20857
|
+
get: function () { return chunkBUMHSDRW_cjs.PluginRegistryImpl; }
|
|
20822
20858
|
});
|
|
20823
20859
|
Object.defineProperty(exports, "PluginValidatorClass", {
|
|
20824
20860
|
enumerable: true,
|
|
20825
|
-
get: function () { return
|
|
20861
|
+
get: function () { return chunkBUMHSDRW_cjs.PluginValidator; }
|
|
20826
20862
|
});
|
|
20827
20863
|
Object.defineProperty(exports, "RegisterPluginsError", {
|
|
20828
20864
|
enumerable: true,
|
|
20829
|
-
get: function () { return
|
|
20865
|
+
get: function () { return chunkBUMHSDRW_cjs.RegisterPluginsError; }
|
|
20830
20866
|
});
|
|
20831
20867
|
Object.defineProperty(exports, "ScopedHookSystemClass", {
|
|
20832
20868
|
enumerable: true,
|
|
20833
|
-
get: function () { return
|
|
20869
|
+
get: function () { return chunkBUMHSDRW_cjs.ScopedHookSystem; }
|
|
20834
20870
|
});
|
|
20835
20871
|
Object.defineProperty(exports, "collectCronSchedules", {
|
|
20836
20872
|
enumerable: true,
|
|
20837
|
-
get: function () { return
|
|
20873
|
+
get: function () { return chunkBUMHSDRW_cjs.collectCronSchedules; }
|
|
20838
20874
|
});
|
|
20839
20875
|
Object.defineProperty(exports, "collectCrons", {
|
|
20840
20876
|
enumerable: true,
|
|
20841
|
-
get: function () { return
|
|
20877
|
+
get: function () { return chunkBUMHSDRW_cjs.collectCrons; }
|
|
20842
20878
|
});
|
|
20843
20879
|
Object.defineProperty(exports, "createScheduledHandler", {
|
|
20844
20880
|
enumerable: true,
|
|
20845
|
-
get: function () { return
|
|
20881
|
+
get: function () { return chunkBUMHSDRW_cjs.createScheduledHandler; }
|
|
20846
20882
|
});
|
|
20847
20883
|
Object.defineProperty(exports, "dispatchCronTick", {
|
|
20848
20884
|
enumerable: true,
|
|
20849
|
-
get: function () { return
|
|
20885
|
+
get: function () { return chunkBUMHSDRW_cjs.dispatchCronTick; }
|
|
20850
20886
|
});
|
|
20851
20887
|
Object.defineProperty(exports, "getPluginMenu", {
|
|
20852
20888
|
enumerable: true,
|
|
20853
|
-
get: function () { return
|
|
20889
|
+
get: function () { return chunkBUMHSDRW_cjs.getPluginMenu; }
|
|
20854
20890
|
});
|
|
20855
20891
|
Object.defineProperty(exports, "registerPlugins", {
|
|
20856
20892
|
enumerable: true,
|
|
20857
|
-
get: function () { return
|
|
20893
|
+
get: function () { return chunkBUMHSDRW_cjs.registerPlugins; }
|
|
20858
20894
|
});
|
|
20859
20895
|
Object.defineProperty(exports, "resetPluginMenu", {
|
|
20860
20896
|
enumerable: true,
|
|
20861
|
-
get: function () { return
|
|
20897
|
+
get: function () { return chunkBUMHSDRW_cjs.resetPluginMenu; }
|
|
20862
20898
|
});
|
|
20863
20899
|
Object.defineProperty(exports, "resolvePluginMenuItems", {
|
|
20864
20900
|
enumerable: true,
|
|
20865
|
-
get: function () { return
|
|
20901
|
+
get: function () { return chunkBUMHSDRW_cjs.resolvePluginMenuItems; }
|
|
20866
20902
|
});
|
|
20867
20903
|
Object.defineProperty(exports, "setPluginMenu", {
|
|
20868
20904
|
enumerable: true,
|
|
20869
|
-
get: function () { return
|
|
20905
|
+
get: function () { return chunkBUMHSDRW_cjs.setPluginMenu; }
|
|
20870
20906
|
});
|
|
20871
20907
|
Object.defineProperty(exports, "topoSort", {
|
|
20872
20908
|
enumerable: true,
|
|
20873
|
-
get: function () { return
|
|
20909
|
+
get: function () { return chunkBUMHSDRW_cjs.topoSort; }
|
|
20874
20910
|
});
|
|
20875
20911
|
Object.defineProperty(exports, "applySchemaDefaults", {
|
|
20876
20912
|
enumerable: true,
|
|
20877
|
-
get: function () { return
|
|
20913
|
+
get: function () { return chunkQSDN2CKI_cjs.applySchemaDefaults; }
|
|
20878
20914
|
});
|
|
20879
20915
|
Object.defineProperty(exports, "definePlugin", {
|
|
20880
20916
|
enumerable: true,
|
|
20881
|
-
get: function () { return
|
|
20917
|
+
get: function () { return chunkQSDN2CKI_cjs.definePlugin; }
|
|
20882
20918
|
});
|
|
20883
20919
|
Object.defineProperty(exports, "isDefinedPlugin", {
|
|
20884
20920
|
enumerable: true,
|
|
20885
|
-
get: function () { return
|
|
20921
|
+
get: function () { return chunkQSDN2CKI_cjs.isDefinedPlugin; }
|
|
20886
20922
|
});
|
|
20887
20923
|
Object.defineProperty(exports, "parseConfigSchema", {
|
|
20888
20924
|
enumerable: true,
|
|
20889
|
-
get: function () { return
|
|
20925
|
+
get: function () { return chunkQSDN2CKI_cjs.parseConfigSchema; }
|
|
20890
20926
|
});
|
|
20891
20927
|
Object.defineProperty(exports, "parseFormDataToSettings", {
|
|
20892
20928
|
enumerable: true,
|
|
20893
|
-
get: function () { return
|
|
20929
|
+
get: function () { return chunkQSDN2CKI_cjs.parseFormDataToSettings; }
|
|
20894
20930
|
});
|
|
20895
20931
|
Object.defineProperty(exports, "renderSchemaFields", {
|
|
20896
20932
|
enumerable: true,
|
|
20897
|
-
get: function () { return
|
|
20933
|
+
get: function () { return chunkQSDN2CKI_cjs.renderSchemaFields; }
|
|
20898
20934
|
});
|
|
20899
20935
|
Object.defineProperty(exports, "getHookSystem", {
|
|
20900
20936
|
enumerable: true,
|
|
@@ -20942,11 +20978,11 @@ Object.defineProperty(exports, "metricsTracker", {
|
|
|
20942
20978
|
});
|
|
20943
20979
|
Object.defineProperty(exports, "SONICJS_VERSION", {
|
|
20944
20980
|
enumerable: true,
|
|
20945
|
-
get: function () { return
|
|
20981
|
+
get: function () { return chunkE6LGR24C_cjs.SONICJS_VERSION; }
|
|
20946
20982
|
});
|
|
20947
20983
|
Object.defineProperty(exports, "getCoreVersion", {
|
|
20948
20984
|
enumerable: true,
|
|
20949
|
-
get: function () { return
|
|
20985
|
+
get: function () { return chunkE6LGR24C_cjs.getCoreVersion; }
|
|
20950
20986
|
});
|
|
20951
20987
|
Object.defineProperty(exports, "escapeHtml", {
|
|
20952
20988
|
enumerable: true,
|