@sonicjs-cms/core 2.3.14 → 2.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-T4XRPNX2.js → chunk-4M2UOUXV.js} +8 -8
- package/dist/{chunk-T4XRPNX2.js.map → chunk-4M2UOUXV.js.map} +1 -1
- package/dist/{chunk-D4PJFFOV.cjs → chunk-5OLN5JO3.cjs} +90 -90
- package/dist/{chunk-D4PJFFOV.cjs.map → chunk-5OLN5JO3.cjs.map} +1 -1
- package/dist/{chunk-ETS5XSAG.cjs → chunk-63LV4YVI.cjs} +2 -2
- package/dist/{chunk-ETS5XSAG.cjs.map → chunk-63LV4YVI.cjs.map} +1 -1
- package/dist/{chunk-SKPETEM5.js → chunk-67SKO5RQ.js} +3 -3
- package/dist/{chunk-SKPETEM5.js.map → chunk-67SKO5RQ.js.map} +1 -1
- package/dist/{chunk-CAJOP354.js → chunk-72I2MOSH.js} +2 -2
- package/dist/{chunk-CAJOP354.js.map → chunk-72I2MOSH.js.map} +1 -1
- package/dist/{chunk-H34L445M.js → chunk-A27RBGBA.js} +3 -3
- package/dist/{chunk-H34L445M.js.map → chunk-A27RBGBA.js.map} +1 -1
- package/dist/{chunk-SZE3XVET.cjs → chunk-H2X4BFCW.cjs} +3 -3
- package/dist/{chunk-SZE3XVET.cjs.map → chunk-H2X4BFCW.cjs.map} +1 -1
- package/dist/{chunk-XWPGIFS7.cjs → chunk-QG3YQKL4.cjs} +4 -4
- package/dist/{chunk-XWPGIFS7.cjs.map → chunk-QG3YQKL4.cjs.map} +1 -1
- package/dist/index.cjs +108 -77
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +38 -7
- package/dist/index.js.map +1 -1
- package/dist/middleware.cjs +23 -23
- package/dist/middleware.js +2 -2
- package/dist/migrations-H3Q5FZGZ.js +4 -0
- package/dist/{migrations-WF6VIVU2.js.map → migrations-H3Q5FZGZ.js.map} +1 -1
- package/dist/migrations-VN5VTX3C.cjs +13 -0
- package/dist/{migrations-3A53GREK.cjs.map → migrations-VN5VTX3C.cjs.map} +1 -1
- package/dist/{plugin-manifest-BCMx9CAq.d.cts → plugin-manifest-Dpy8wxIB.d.cts} +2 -2
- package/dist/{plugin-manifest-BCMx9CAq.d.ts → plugin-manifest-Dpy8wxIB.d.ts} +2 -2
- package/dist/routes.cjs +24 -24
- package/dist/routes.js +4 -4
- package/dist/services.cjs +2 -2
- package/dist/services.js +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils.cjs +11 -11
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/dist/migrations-3A53GREK.cjs +0 -13
- package/dist/migrations-WF6VIVU2.js +0 -4
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk7FOAMNTI_cjs = require('./chunk-7FOAMNTI.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkQG3YQKL4_cjs = require('./chunk-QG3YQKL4.cjs');
|
|
5
5
|
var chunkILZ3DP4I_cjs = require('./chunk-ILZ3DP4I.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunk63LV4YVI_cjs = require('./chunk-63LV4YVI.cjs');
|
|
7
7
|
var chunkAZLU3ROK_cjs = require('./chunk-AZLU3ROK.cjs');
|
|
8
|
-
var
|
|
8
|
+
var chunkH2X4BFCW_cjs = require('./chunk-H2X4BFCW.cjs');
|
|
9
9
|
var chunkRCQ2HIQD_cjs = require('./chunk-RCQ2HIQD.cjs');
|
|
10
10
|
var hono = require('hono');
|
|
11
11
|
var cors = require('hono/cors');
|
|
@@ -44,7 +44,7 @@ apiContentCrudRoutes.get("/:id", async (c) => {
|
|
|
44
44
|
}, 500);
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
|
-
apiContentCrudRoutes.post("/",
|
|
47
|
+
apiContentCrudRoutes.post("/", chunkQG3YQKL4_cjs.requireAuth(), async (c) => {
|
|
48
48
|
try {
|
|
49
49
|
const db = c.env.DB;
|
|
50
50
|
const user = c.get("user");
|
|
@@ -110,7 +110,7 @@ apiContentCrudRoutes.post("/", chunkXWPGIFS7_cjs.requireAuth(), async (c) => {
|
|
|
110
110
|
}, 500);
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
|
-
apiContentCrudRoutes.put("/:id",
|
|
113
|
+
apiContentCrudRoutes.put("/:id", chunkQG3YQKL4_cjs.requireAuth(), async (c) => {
|
|
114
114
|
try {
|
|
115
115
|
const id = c.req.param("id");
|
|
116
116
|
const db = c.env.DB;
|
|
@@ -174,7 +174,7 @@ apiContentCrudRoutes.put("/:id", chunkXWPGIFS7_cjs.requireAuth(), async (c) => {
|
|
|
174
174
|
}, 500);
|
|
175
175
|
}
|
|
176
176
|
});
|
|
177
|
-
apiContentCrudRoutes.delete("/:id",
|
|
177
|
+
apiContentCrudRoutes.delete("/:id", chunkQG3YQKL4_cjs.requireAuth(), async (c) => {
|
|
178
178
|
try {
|
|
179
179
|
const id = c.req.param("id");
|
|
180
180
|
const db = c.env.DB;
|
|
@@ -210,7 +210,7 @@ apiRoutes.use("*", async (c, next) => {
|
|
|
210
210
|
c.header("X-Response-Time", `${totalTime}ms`);
|
|
211
211
|
});
|
|
212
212
|
apiRoutes.use("*", async (c, next) => {
|
|
213
|
-
const cacheEnabled = await
|
|
213
|
+
const cacheEnabled = await chunkQG3YQKL4_cjs.isPluginActive(c.env.DB, "core-cache");
|
|
214
214
|
c.set("cacheEnabled", cacheEnabled);
|
|
215
215
|
await next();
|
|
216
216
|
});
|
|
@@ -335,12 +335,12 @@ apiRoutes.get("/content", async (c) => {
|
|
|
335
335
|
});
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
const filter =
|
|
338
|
+
const filter = chunkH2X4BFCW_cjs.QueryFilterBuilder.parseFromQuery(queryParams);
|
|
339
339
|
if (!filter.limit) {
|
|
340
340
|
filter.limit = 50;
|
|
341
341
|
}
|
|
342
342
|
filter.limit = Math.min(filter.limit, 1e3);
|
|
343
|
-
const builder3 = new
|
|
343
|
+
const builder3 = new chunkH2X4BFCW_cjs.QueryFilterBuilder();
|
|
344
344
|
const queryResult = builder3.build("content", filter);
|
|
345
345
|
if (queryResult.errors.length > 0) {
|
|
346
346
|
return c.json({
|
|
@@ -427,7 +427,7 @@ apiRoutes.get("/collections/:collection/content", async (c) => {
|
|
|
427
427
|
if (!collectionResult) {
|
|
428
428
|
return c.json({ error: "Collection not found" }, 404);
|
|
429
429
|
}
|
|
430
|
-
const filter =
|
|
430
|
+
const filter = chunkH2X4BFCW_cjs.QueryFilterBuilder.parseFromQuery(queryParams);
|
|
431
431
|
if (!filter.where) {
|
|
432
432
|
filter.where = { and: [] };
|
|
433
433
|
}
|
|
@@ -443,7 +443,7 @@ apiRoutes.get("/collections/:collection/content", async (c) => {
|
|
|
443
443
|
filter.limit = 50;
|
|
444
444
|
}
|
|
445
445
|
filter.limit = Math.min(filter.limit, 1e3);
|
|
446
|
-
const builder3 = new
|
|
446
|
+
const builder3 = new chunkH2X4BFCW_cjs.QueryFilterBuilder();
|
|
447
447
|
const queryResult = builder3.build("content", filter);
|
|
448
448
|
if (queryResult.errors.length > 0) {
|
|
449
449
|
return c.json({
|
|
@@ -568,7 +568,7 @@ var fileValidationSchema = zod.z.object({
|
|
|
568
568
|
// 50MB max
|
|
569
569
|
});
|
|
570
570
|
var apiMediaRoutes = new hono.Hono();
|
|
571
|
-
apiMediaRoutes.use("*",
|
|
571
|
+
apiMediaRoutes.use("*", chunkQG3YQKL4_cjs.requireAuth());
|
|
572
572
|
apiMediaRoutes.post("/upload", async (c) => {
|
|
573
573
|
try {
|
|
574
574
|
const user = c.get("user");
|
|
@@ -1312,8 +1312,8 @@ apiSystemRoutes.get("/env", (c) => {
|
|
|
1312
1312
|
});
|
|
1313
1313
|
var api_system_default = apiSystemRoutes;
|
|
1314
1314
|
var adminApiRoutes = new hono.Hono();
|
|
1315
|
-
adminApiRoutes.use("*",
|
|
1316
|
-
adminApiRoutes.use("*",
|
|
1315
|
+
adminApiRoutes.use("*", chunkQG3YQKL4_cjs.requireAuth());
|
|
1316
|
+
adminApiRoutes.use("*", chunkQG3YQKL4_cjs.requireRole(["admin", "editor"]));
|
|
1317
1317
|
adminApiRoutes.get("/stats", async (c) => {
|
|
1318
1318
|
try {
|
|
1319
1319
|
const db = c.env.DB;
|
|
@@ -1722,7 +1722,7 @@ adminApiRoutes.delete("/collections/:id", async (c) => {
|
|
|
1722
1722
|
});
|
|
1723
1723
|
adminApiRoutes.get("/migrations/status", async (c) => {
|
|
1724
1724
|
try {
|
|
1725
|
-
const { MigrationService: MigrationService2 } = await import('./migrations-
|
|
1725
|
+
const { MigrationService: MigrationService2 } = await import('./migrations-VN5VTX3C.cjs');
|
|
1726
1726
|
const db = c.env.DB;
|
|
1727
1727
|
const migrationService = new MigrationService2(db);
|
|
1728
1728
|
const status = await migrationService.getMigrationStatus();
|
|
@@ -1747,7 +1747,7 @@ adminApiRoutes.post("/migrations/run", async (c) => {
|
|
|
1747
1747
|
error: "Unauthorized. Admin access required."
|
|
1748
1748
|
}, 403);
|
|
1749
1749
|
}
|
|
1750
|
-
const { MigrationService: MigrationService2 } = await import('./migrations-
|
|
1750
|
+
const { MigrationService: MigrationService2 } = await import('./migrations-VN5VTX3C.cjs');
|
|
1751
1751
|
const db = c.env.DB;
|
|
1752
1752
|
const migrationService = new MigrationService2(db);
|
|
1753
1753
|
const result = await migrationService.runPendingMigrations();
|
|
@@ -1766,7 +1766,7 @@ adminApiRoutes.post("/migrations/run", async (c) => {
|
|
|
1766
1766
|
});
|
|
1767
1767
|
adminApiRoutes.get("/migrations/validate", async (c) => {
|
|
1768
1768
|
try {
|
|
1769
|
-
const { MigrationService: MigrationService2 } = await import('./migrations-
|
|
1769
|
+
const { MigrationService: MigrationService2 } = await import('./migrations-VN5VTX3C.cjs');
|
|
1770
1770
|
const db = c.env.DB;
|
|
1771
1771
|
const migrationService = new MigrationService2(db);
|
|
1772
1772
|
const validation = await migrationService.validateSchema();
|
|
@@ -2248,7 +2248,7 @@ authRoutes.post(
|
|
|
2248
2248
|
if (existingUser) {
|
|
2249
2249
|
return c.json({ error: "User with this email or username already exists" }, 400);
|
|
2250
2250
|
}
|
|
2251
|
-
const passwordHash = await
|
|
2251
|
+
const passwordHash = await chunkQG3YQKL4_cjs.AuthManager.hashPassword(password);
|
|
2252
2252
|
const userId = crypto.randomUUID();
|
|
2253
2253
|
const now = /* @__PURE__ */ new Date();
|
|
2254
2254
|
await db.prepare(`
|
|
@@ -2268,7 +2268,7 @@ authRoutes.post(
|
|
|
2268
2268
|
now.getTime(),
|
|
2269
2269
|
now.getTime()
|
|
2270
2270
|
).run();
|
|
2271
|
-
const token = await
|
|
2271
|
+
const token = await chunkQG3YQKL4_cjs.AuthManager.generateToken(userId, normalizedEmail, "viewer");
|
|
2272
2272
|
cookie.setCookie(c, "auth_token", token, {
|
|
2273
2273
|
httpOnly: true,
|
|
2274
2274
|
secure: true,
|
|
@@ -2321,11 +2321,11 @@ authRoutes.post("/login", async (c) => {
|
|
|
2321
2321
|
if (!user) {
|
|
2322
2322
|
return c.json({ error: "Invalid email or password" }, 401);
|
|
2323
2323
|
}
|
|
2324
|
-
const isValidPassword = await
|
|
2324
|
+
const isValidPassword = await chunkQG3YQKL4_cjs.AuthManager.verifyPassword(password, user.password_hash);
|
|
2325
2325
|
if (!isValidPassword) {
|
|
2326
2326
|
return c.json({ error: "Invalid email or password" }, 401);
|
|
2327
2327
|
}
|
|
2328
|
-
const token = await
|
|
2328
|
+
const token = await chunkQG3YQKL4_cjs.AuthManager.generateToken(user.id, user.email, user.role);
|
|
2329
2329
|
cookie.setCookie(c, "auth_token", token, {
|
|
2330
2330
|
httpOnly: true,
|
|
2331
2331
|
secure: true,
|
|
@@ -2374,7 +2374,7 @@ authRoutes.get("/logout", (c) => {
|
|
|
2374
2374
|
});
|
|
2375
2375
|
return c.redirect("/auth/login?message=You have been logged out successfully");
|
|
2376
2376
|
});
|
|
2377
|
-
authRoutes.get("/me",
|
|
2377
|
+
authRoutes.get("/me", chunkQG3YQKL4_cjs.requireAuth(), async (c) => {
|
|
2378
2378
|
try {
|
|
2379
2379
|
const user = c.get("user");
|
|
2380
2380
|
if (!user) {
|
|
@@ -2391,13 +2391,13 @@ authRoutes.get("/me", chunkXWPGIFS7_cjs.requireAuth(), async (c) => {
|
|
|
2391
2391
|
return c.json({ error: "Failed to get user" }, 500);
|
|
2392
2392
|
}
|
|
2393
2393
|
});
|
|
2394
|
-
authRoutes.post("/refresh",
|
|
2394
|
+
authRoutes.post("/refresh", chunkQG3YQKL4_cjs.requireAuth(), async (c) => {
|
|
2395
2395
|
try {
|
|
2396
2396
|
const user = c.get("user");
|
|
2397
2397
|
if (!user) {
|
|
2398
2398
|
return c.json({ error: "Not authenticated" }, 401);
|
|
2399
2399
|
}
|
|
2400
|
-
const token = await
|
|
2400
|
+
const token = await chunkQG3YQKL4_cjs.AuthManager.generateToken(user.userId, user.email, user.role);
|
|
2401
2401
|
cookie.setCookie(c, "auth_token", token, {
|
|
2402
2402
|
httpOnly: true,
|
|
2403
2403
|
secure: true,
|
|
@@ -2457,7 +2457,7 @@ authRoutes.post("/register/form", async (c) => {
|
|
|
2457
2457
|
</div>
|
|
2458
2458
|
`);
|
|
2459
2459
|
}
|
|
2460
|
-
const passwordHash = await
|
|
2460
|
+
const passwordHash = await chunkQG3YQKL4_cjs.AuthManager.hashPassword(password);
|
|
2461
2461
|
const role = isFirstUser ? "admin" : "viewer";
|
|
2462
2462
|
const userId = crypto.randomUUID();
|
|
2463
2463
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -2477,7 +2477,7 @@ authRoutes.post("/register/form", async (c) => {
|
|
|
2477
2477
|
now.getTime(),
|
|
2478
2478
|
now.getTime()
|
|
2479
2479
|
).run();
|
|
2480
|
-
const token = await
|
|
2480
|
+
const token = await chunkQG3YQKL4_cjs.AuthManager.generateToken(userId, normalizedEmail, role);
|
|
2481
2481
|
cookie.setCookie(c, "auth_token", token, {
|
|
2482
2482
|
httpOnly: true,
|
|
2483
2483
|
secure: false,
|
|
@@ -2529,7 +2529,7 @@ authRoutes.post("/login/form", async (c) => {
|
|
|
2529
2529
|
</div>
|
|
2530
2530
|
`);
|
|
2531
2531
|
}
|
|
2532
|
-
const isValidPassword = await
|
|
2532
|
+
const isValidPassword = await chunkQG3YQKL4_cjs.AuthManager.verifyPassword(password, user.password_hash);
|
|
2533
2533
|
if (!isValidPassword) {
|
|
2534
2534
|
return c.html(html.html`
|
|
2535
2535
|
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded">
|
|
@@ -2537,7 +2537,7 @@ authRoutes.post("/login/form", async (c) => {
|
|
|
2537
2537
|
</div>
|
|
2538
2538
|
`);
|
|
2539
2539
|
}
|
|
2540
|
-
const token = await
|
|
2540
|
+
const token = await chunkQG3YQKL4_cjs.AuthManager.generateToken(user.id, user.email, user.role);
|
|
2541
2541
|
cookie.setCookie(c, "auth_token", token, {
|
|
2542
2542
|
httpOnly: true,
|
|
2543
2543
|
secure: false,
|
|
@@ -2596,7 +2596,7 @@ authRoutes.post("/seed-admin", async (c) => {
|
|
|
2596
2596
|
`).run();
|
|
2597
2597
|
const existingAdmin = await db.prepare("SELECT id FROM users WHERE email = ? OR username = ?").bind("admin@sonicjs.com", "admin").first();
|
|
2598
2598
|
if (existingAdmin) {
|
|
2599
|
-
const passwordHash2 = await
|
|
2599
|
+
const passwordHash2 = await chunkQG3YQKL4_cjs.AuthManager.hashPassword("sonicjs!");
|
|
2600
2600
|
await db.prepare("UPDATE users SET password_hash = ?, updated_at = ? WHERE id = ?").bind(passwordHash2, Date.now(), existingAdmin.id).run();
|
|
2601
2601
|
return c.json({
|
|
2602
2602
|
message: "Admin user already exists (password updated)",
|
|
@@ -2608,7 +2608,7 @@ authRoutes.post("/seed-admin", async (c) => {
|
|
|
2608
2608
|
}
|
|
2609
2609
|
});
|
|
2610
2610
|
}
|
|
2611
|
-
const passwordHash = await
|
|
2611
|
+
const passwordHash = await chunkQG3YQKL4_cjs.AuthManager.hashPassword("sonicjs!");
|
|
2612
2612
|
const userId = "admin-user-id";
|
|
2613
2613
|
const now = Date.now();
|
|
2614
2614
|
const adminEmail = "admin@sonicjs.com".toLowerCase();
|
|
@@ -2828,7 +2828,7 @@ authRoutes.post("/accept-invitation", async (c) => {
|
|
|
2828
2828
|
if (existingUsername) {
|
|
2829
2829
|
return c.json({ error: "Username is already taken" }, 400);
|
|
2830
2830
|
}
|
|
2831
|
-
const passwordHash = await
|
|
2831
|
+
const passwordHash = await chunkQG3YQKL4_cjs.AuthManager.hashPassword(password);
|
|
2832
2832
|
const updateStmt = db.prepare(`
|
|
2833
2833
|
UPDATE users SET
|
|
2834
2834
|
username = ?,
|
|
@@ -2847,7 +2847,7 @@ authRoutes.post("/accept-invitation", async (c) => {
|
|
|
2847
2847
|
Date.now(),
|
|
2848
2848
|
invitedUser.id
|
|
2849
2849
|
).run();
|
|
2850
|
-
const authToken = await
|
|
2850
|
+
const authToken = await chunkQG3YQKL4_cjs.AuthManager.generateToken(invitedUser.id, invitedUser.email, invitedUser.role);
|
|
2851
2851
|
cookie.setCookie(c, "auth_token", authToken, {
|
|
2852
2852
|
httpOnly: true,
|
|
2853
2853
|
secure: true,
|
|
@@ -3077,7 +3077,7 @@ authRoutes.post("/reset-password", async (c) => {
|
|
|
3077
3077
|
if (Date.now() > user.password_reset_expires) {
|
|
3078
3078
|
return c.json({ error: "Reset token has expired" }, 400);
|
|
3079
3079
|
}
|
|
3080
|
-
const newPasswordHash = await
|
|
3080
|
+
const newPasswordHash = await chunkQG3YQKL4_cjs.AuthManager.hashPassword(password);
|
|
3081
3081
|
try {
|
|
3082
3082
|
const historyStmt = db.prepare(`
|
|
3083
3083
|
INSERT INTO password_history (id, user_id, password_hash, created_at)
|
|
@@ -5979,7 +5979,7 @@ async function isPluginActive2(db, pluginId) {
|
|
|
5979
5979
|
|
|
5980
5980
|
// src/routes/admin-content.ts
|
|
5981
5981
|
var adminContentRoutes = new hono.Hono();
|
|
5982
|
-
adminContentRoutes.use("*",
|
|
5982
|
+
adminContentRoutes.use("*", chunkQG3YQKL4_cjs.requireAuth());
|
|
5983
5983
|
async function getCollectionFields(db, collectionId) {
|
|
5984
5984
|
const cache = chunk7FOAMNTI_cjs.getCacheService(chunk7FOAMNTI_cjs.CACHE_CONFIGS.collection);
|
|
5985
5985
|
return cache.getOrSet(
|
|
@@ -8040,7 +8040,7 @@ function renderUserEditPage(data) {
|
|
|
8040
8040
|
<input
|
|
8041
8041
|
type="text"
|
|
8042
8042
|
name="first_name"
|
|
8043
|
-
value="${
|
|
8043
|
+
value="${chunkH2X4BFCW_cjs.escapeHtml(data.userToEdit.firstName || "")}"
|
|
8044
8044
|
required
|
|
8045
8045
|
class="w-full rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 placeholder:text-zinc-400 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-zinc-950 dark:focus:ring-white transition-shadow"
|
|
8046
8046
|
/>
|
|
@@ -8051,7 +8051,7 @@ function renderUserEditPage(data) {
|
|
|
8051
8051
|
<input
|
|
8052
8052
|
type="text"
|
|
8053
8053
|
name="last_name"
|
|
8054
|
-
value="${
|
|
8054
|
+
value="${chunkH2X4BFCW_cjs.escapeHtml(data.userToEdit.lastName || "")}"
|
|
8055
8055
|
required
|
|
8056
8056
|
class="w-full rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 placeholder:text-zinc-400 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-zinc-950 dark:focus:ring-white transition-shadow"
|
|
8057
8057
|
/>
|
|
@@ -8062,7 +8062,7 @@ function renderUserEditPage(data) {
|
|
|
8062
8062
|
<input
|
|
8063
8063
|
type="text"
|
|
8064
8064
|
name="username"
|
|
8065
|
-
value="${
|
|
8065
|
+
value="${chunkH2X4BFCW_cjs.escapeHtml(data.userToEdit.username || "")}"
|
|
8066
8066
|
required
|
|
8067
8067
|
class="w-full rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 placeholder:text-zinc-400 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-zinc-950 dark:focus:ring-white transition-shadow"
|
|
8068
8068
|
/>
|
|
@@ -8073,7 +8073,7 @@ function renderUserEditPage(data) {
|
|
|
8073
8073
|
<input
|
|
8074
8074
|
type="email"
|
|
8075
8075
|
name="email"
|
|
8076
|
-
value="${
|
|
8076
|
+
value="${chunkH2X4BFCW_cjs.escapeHtml(data.userToEdit.email || "")}"
|
|
8077
8077
|
required
|
|
8078
8078
|
class="w-full rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 placeholder:text-zinc-400 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-zinc-950 dark:focus:ring-white transition-shadow"
|
|
8079
8079
|
/>
|
|
@@ -8084,7 +8084,7 @@ function renderUserEditPage(data) {
|
|
|
8084
8084
|
<input
|
|
8085
8085
|
type="tel"
|
|
8086
8086
|
name="phone"
|
|
8087
|
-
value="${
|
|
8087
|
+
value="${chunkH2X4BFCW_cjs.escapeHtml(data.userToEdit.phone || "")}"
|
|
8088
8088
|
class="w-full rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 placeholder:text-zinc-400 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-zinc-950 dark:focus:ring-white transition-shadow"
|
|
8089
8089
|
/>
|
|
8090
8090
|
</div>
|
|
@@ -8098,7 +8098,7 @@ function renderUserEditPage(data) {
|
|
|
8098
8098
|
class="col-start-1 row-start-1 w-full appearance-none rounded-md bg-white/5 dark:bg-white/5 py-1.5 pl-3 pr-8 text-base text-zinc-950 dark:text-white outline outline-1 -outline-offset-1 outline-zinc-500/30 dark:outline-zinc-400/30 *:bg-white dark:*:bg-zinc-800 focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-zinc-500 dark:focus-visible:outline-zinc-400 sm:text-sm/6"
|
|
8099
8099
|
>
|
|
8100
8100
|
${data.roles.map((role) => `
|
|
8101
|
-
<option value="${
|
|
8101
|
+
<option value="${chunkH2X4BFCW_cjs.escapeHtml(role.value)}" ${data.userToEdit.role === role.value ? "selected" : ""}>${chunkH2X4BFCW_cjs.escapeHtml(role.label)}</option>
|
|
8102
8102
|
`).join("")}
|
|
8103
8103
|
</select>
|
|
8104
8104
|
<svg viewBox="0 0 16 16" fill="currentColor" data-slot="icon" aria-hidden="true" class="pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end text-zinc-600 dark:text-zinc-400 sm:size-4">
|
|
@@ -8114,7 +8114,7 @@ function renderUserEditPage(data) {
|
|
|
8114
8114
|
name="bio"
|
|
8115
8115
|
rows="3"
|
|
8116
8116
|
class="w-full rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 placeholder:text-zinc-400 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-zinc-950 dark:focus:ring-white transition-shadow"
|
|
8117
|
-
>${
|
|
8117
|
+
>${chunkH2X4BFCW_cjs.escapeHtml(data.userToEdit.bio || "")}</textarea>
|
|
8118
8118
|
</div>
|
|
8119
8119
|
</div>
|
|
8120
8120
|
|
|
@@ -9014,7 +9014,7 @@ function renderUsersListPage(data) {
|
|
|
9014
9014
|
|
|
9015
9015
|
// src/routes/admin-users.ts
|
|
9016
9016
|
var userRoutes = new hono.Hono();
|
|
9017
|
-
userRoutes.use("*",
|
|
9017
|
+
userRoutes.use("*", chunkQG3YQKL4_cjs.requireAuth());
|
|
9018
9018
|
userRoutes.get("/", (c) => {
|
|
9019
9019
|
return c.redirect("/admin/dashboard");
|
|
9020
9020
|
});
|
|
@@ -9113,12 +9113,12 @@ userRoutes.put("/profile", async (c) => {
|
|
|
9113
9113
|
const db = c.env.DB;
|
|
9114
9114
|
try {
|
|
9115
9115
|
const formData = await c.req.formData();
|
|
9116
|
-
const firstName =
|
|
9117
|
-
const lastName =
|
|
9118
|
-
const username =
|
|
9116
|
+
const firstName = chunkH2X4BFCW_cjs.sanitizeInput(formData.get("first_name")?.toString());
|
|
9117
|
+
const lastName = chunkH2X4BFCW_cjs.sanitizeInput(formData.get("last_name")?.toString());
|
|
9118
|
+
const username = chunkH2X4BFCW_cjs.sanitizeInput(formData.get("username")?.toString());
|
|
9119
9119
|
const email = formData.get("email")?.toString()?.trim().toLowerCase() || "";
|
|
9120
|
-
const phone =
|
|
9121
|
-
const bio =
|
|
9120
|
+
const phone = chunkH2X4BFCW_cjs.sanitizeInput(formData.get("phone")?.toString()) || null;
|
|
9121
|
+
const bio = chunkH2X4BFCW_cjs.sanitizeInput(formData.get("bio")?.toString()) || null;
|
|
9122
9122
|
const timezone = formData.get("timezone")?.toString() || "UTC";
|
|
9123
9123
|
const language = formData.get("language")?.toString() || "en";
|
|
9124
9124
|
const emailNotifications = formData.get("email_notifications") === "1";
|
|
@@ -9169,7 +9169,7 @@ userRoutes.put("/profile", async (c) => {
|
|
|
9169
9169
|
Date.now(),
|
|
9170
9170
|
user.userId
|
|
9171
9171
|
).run();
|
|
9172
|
-
await
|
|
9172
|
+
await chunkQG3YQKL4_cjs.logActivity(
|
|
9173
9173
|
db,
|
|
9174
9174
|
user.userId,
|
|
9175
9175
|
"profile.update",
|
|
@@ -9232,7 +9232,7 @@ userRoutes.post("/profile/avatar", async (c) => {
|
|
|
9232
9232
|
SELECT first_name, last_name FROM users WHERE id = ?
|
|
9233
9233
|
`);
|
|
9234
9234
|
const userData = await userStmt.bind(user.userId).first();
|
|
9235
|
-
await
|
|
9235
|
+
await chunkQG3YQKL4_cjs.logActivity(
|
|
9236
9236
|
db,
|
|
9237
9237
|
user.userId,
|
|
9238
9238
|
"profile.avatar_update",
|
|
@@ -9303,7 +9303,7 @@ userRoutes.post("/profile/password", async (c) => {
|
|
|
9303
9303
|
dismissible: true
|
|
9304
9304
|
}));
|
|
9305
9305
|
}
|
|
9306
|
-
const validPassword = await
|
|
9306
|
+
const validPassword = await chunkQG3YQKL4_cjs.AuthManager.verifyPassword(currentPassword, userData.password_hash);
|
|
9307
9307
|
if (!validPassword) {
|
|
9308
9308
|
return c.html(renderAlert2({
|
|
9309
9309
|
type: "error",
|
|
@@ -9311,7 +9311,7 @@ userRoutes.post("/profile/password", async (c) => {
|
|
|
9311
9311
|
dismissible: true
|
|
9312
9312
|
}));
|
|
9313
9313
|
}
|
|
9314
|
-
const newPasswordHash = await
|
|
9314
|
+
const newPasswordHash = await chunkQG3YQKL4_cjs.AuthManager.hashPassword(newPassword);
|
|
9315
9315
|
const historyStmt = db.prepare(`
|
|
9316
9316
|
INSERT INTO password_history (id, user_id, password_hash, created_at)
|
|
9317
9317
|
VALUES (?, ?, ?, ?)
|
|
@@ -9327,7 +9327,7 @@ userRoutes.post("/profile/password", async (c) => {
|
|
|
9327
9327
|
WHERE id = ?
|
|
9328
9328
|
`);
|
|
9329
9329
|
await updateStmt.bind(newPasswordHash, Date.now(), user.userId).run();
|
|
9330
|
-
await
|
|
9330
|
+
await chunkQG3YQKL4_cjs.logActivity(
|
|
9331
9331
|
db,
|
|
9332
9332
|
user.userId,
|
|
9333
9333
|
"profile.password_change",
|
|
@@ -9394,7 +9394,7 @@ userRoutes.get("/users", async (c) => {
|
|
|
9394
9394
|
`);
|
|
9395
9395
|
const countResult = await countStmt.bind(...params).first();
|
|
9396
9396
|
const totalUsers = countResult?.total || 0;
|
|
9397
|
-
await
|
|
9397
|
+
await chunkQG3YQKL4_cjs.logActivity(
|
|
9398
9398
|
db,
|
|
9399
9399
|
user.userId,
|
|
9400
9400
|
"users.list_view",
|
|
@@ -9496,12 +9496,12 @@ userRoutes.post("/users/new", async (c) => {
|
|
|
9496
9496
|
const user = c.get("user");
|
|
9497
9497
|
try {
|
|
9498
9498
|
const formData = await c.req.formData();
|
|
9499
|
-
const firstName =
|
|
9500
|
-
const lastName =
|
|
9501
|
-
const username =
|
|
9499
|
+
const firstName = chunkH2X4BFCW_cjs.sanitizeInput(formData.get("first_name")?.toString());
|
|
9500
|
+
const lastName = chunkH2X4BFCW_cjs.sanitizeInput(formData.get("last_name")?.toString());
|
|
9501
|
+
const username = chunkH2X4BFCW_cjs.sanitizeInput(formData.get("username")?.toString());
|
|
9502
9502
|
const email = formData.get("email")?.toString()?.trim().toLowerCase() || "";
|
|
9503
|
-
const phone =
|
|
9504
|
-
const bio =
|
|
9503
|
+
const phone = chunkH2X4BFCW_cjs.sanitizeInput(formData.get("phone")?.toString()) || null;
|
|
9504
|
+
const bio = chunkH2X4BFCW_cjs.sanitizeInput(formData.get("bio")?.toString()) || null;
|
|
9505
9505
|
const role = formData.get("role")?.toString() || "viewer";
|
|
9506
9506
|
const password = formData.get("password")?.toString() || "";
|
|
9507
9507
|
const confirmPassword = formData.get("confirm_password")?.toString() || "";
|
|
@@ -9548,7 +9548,7 @@ userRoutes.post("/users/new", async (c) => {
|
|
|
9548
9548
|
dismissible: true
|
|
9549
9549
|
}));
|
|
9550
9550
|
}
|
|
9551
|
-
const passwordHash = await
|
|
9551
|
+
const passwordHash = await chunkQG3YQKL4_cjs.AuthManager.hashPassword(password);
|
|
9552
9552
|
const userId = crypto.randomUUID();
|
|
9553
9553
|
const createStmt = db.prepare(`
|
|
9554
9554
|
INSERT INTO users (
|
|
@@ -9571,7 +9571,7 @@ userRoutes.post("/users/new", async (c) => {
|
|
|
9571
9571
|
Date.now(),
|
|
9572
9572
|
Date.now()
|
|
9573
9573
|
).run();
|
|
9574
|
-
await
|
|
9574
|
+
await chunkQG3YQKL4_cjs.logActivity(
|
|
9575
9575
|
db,
|
|
9576
9576
|
user.userId,
|
|
9577
9577
|
"user!.create",
|
|
@@ -9609,7 +9609,7 @@ userRoutes.get("/users/:id", async (c) => {
|
|
|
9609
9609
|
if (!userRecord) {
|
|
9610
9610
|
return c.json({ error: "User not found" }, 404);
|
|
9611
9611
|
}
|
|
9612
|
-
await
|
|
9612
|
+
await chunkQG3YQKL4_cjs.logActivity(
|
|
9613
9613
|
db,
|
|
9614
9614
|
user.userId,
|
|
9615
9615
|
"user!.view",
|
|
@@ -9702,12 +9702,12 @@ userRoutes.put("/users/:id", async (c) => {
|
|
|
9702
9702
|
const userId = c.req.param("id");
|
|
9703
9703
|
try {
|
|
9704
9704
|
const formData = await c.req.formData();
|
|
9705
|
-
const firstName =
|
|
9706
|
-
const lastName =
|
|
9707
|
-
const username =
|
|
9705
|
+
const firstName = chunkH2X4BFCW_cjs.sanitizeInput(formData.get("first_name")?.toString());
|
|
9706
|
+
const lastName = chunkH2X4BFCW_cjs.sanitizeInput(formData.get("last_name")?.toString());
|
|
9707
|
+
const username = chunkH2X4BFCW_cjs.sanitizeInput(formData.get("username")?.toString());
|
|
9708
9708
|
const email = formData.get("email")?.toString()?.trim().toLowerCase() || "";
|
|
9709
|
-
const phone =
|
|
9710
|
-
const bio =
|
|
9709
|
+
const phone = chunkH2X4BFCW_cjs.sanitizeInput(formData.get("phone")?.toString()) || null;
|
|
9710
|
+
const bio = chunkH2X4BFCW_cjs.sanitizeInput(formData.get("bio")?.toString()) || null;
|
|
9711
9711
|
const role = formData.get("role")?.toString() || "viewer";
|
|
9712
9712
|
const isActive = formData.get("is_active") === "1";
|
|
9713
9713
|
const emailVerified = formData.get("email_verified") === "1";
|
|
@@ -9758,7 +9758,7 @@ userRoutes.put("/users/:id", async (c) => {
|
|
|
9758
9758
|
Date.now(),
|
|
9759
9759
|
userId
|
|
9760
9760
|
).run();
|
|
9761
|
-
await
|
|
9761
|
+
await chunkQG3YQKL4_cjs.logActivity(
|
|
9762
9762
|
db,
|
|
9763
9763
|
user.userId,
|
|
9764
9764
|
"user!.update",
|
|
@@ -9803,7 +9803,7 @@ userRoutes.post("/users/:id/toggle", async (c) => {
|
|
|
9803
9803
|
UPDATE users SET is_active = ?, updated_at = ? WHERE id = ?
|
|
9804
9804
|
`);
|
|
9805
9805
|
await toggleStmt.bind(active ? 1 : 0, Date.now(), userId).run();
|
|
9806
|
-
await
|
|
9806
|
+
await chunkQG3YQKL4_cjs.logActivity(
|
|
9807
9807
|
db,
|
|
9808
9808
|
user.userId,
|
|
9809
9809
|
active ? "user.activate" : "user.deactivate",
|
|
@@ -9844,7 +9844,7 @@ userRoutes.delete("/users/:id", async (c) => {
|
|
|
9844
9844
|
DELETE FROM users WHERE id = ?
|
|
9845
9845
|
`);
|
|
9846
9846
|
await deleteStmt.bind(userId).run();
|
|
9847
|
-
await
|
|
9847
|
+
await chunkQG3YQKL4_cjs.logActivity(
|
|
9848
9848
|
db,
|
|
9849
9849
|
user.userId,
|
|
9850
9850
|
"user!.hard_delete",
|
|
@@ -9863,7 +9863,7 @@ userRoutes.delete("/users/:id", async (c) => {
|
|
|
9863
9863
|
UPDATE users SET is_active = 0, updated_at = ? WHERE id = ?
|
|
9864
9864
|
`);
|
|
9865
9865
|
await deleteStmt.bind(Date.now(), userId).run();
|
|
9866
|
-
await
|
|
9866
|
+
await chunkQG3YQKL4_cjs.logActivity(
|
|
9867
9867
|
db,
|
|
9868
9868
|
user.userId,
|
|
9869
9869
|
"user!.soft_delete",
|
|
@@ -9890,8 +9890,8 @@ userRoutes.post("/invite-user", async (c) => {
|
|
|
9890
9890
|
const formData = await c.req.formData();
|
|
9891
9891
|
const email = formData.get("email")?.toString()?.trim().toLowerCase() || "";
|
|
9892
9892
|
const role = formData.get("role")?.toString()?.trim() || "viewer";
|
|
9893
|
-
const firstName =
|
|
9894
|
-
const lastName =
|
|
9893
|
+
const firstName = chunkH2X4BFCW_cjs.sanitizeInput(formData.get("first_name")?.toString());
|
|
9894
|
+
const lastName = chunkH2X4BFCW_cjs.sanitizeInput(formData.get("last_name")?.toString());
|
|
9895
9895
|
if (!email || !firstName || !lastName) {
|
|
9896
9896
|
return c.json({ error: "Email, first name, and last name are required" }, 400);
|
|
9897
9897
|
}
|
|
@@ -9929,7 +9929,7 @@ userRoutes.post("/invite-user", async (c) => {
|
|
|
9929
9929
|
Date.now(),
|
|
9930
9930
|
Date.now()
|
|
9931
9931
|
).run();
|
|
9932
|
-
await
|
|
9932
|
+
await chunkQG3YQKL4_cjs.logActivity(
|
|
9933
9933
|
db,
|
|
9934
9934
|
user.userId,
|
|
9935
9935
|
"user!.invite_sent",
|
|
@@ -9986,7 +9986,7 @@ userRoutes.post("/resend-invitation/:id", async (c) => {
|
|
|
9986
9986
|
Date.now(),
|
|
9987
9987
|
userId
|
|
9988
9988
|
).run();
|
|
9989
|
-
await
|
|
9989
|
+
await chunkQG3YQKL4_cjs.logActivity(
|
|
9990
9990
|
db,
|
|
9991
9991
|
user.userId,
|
|
9992
9992
|
"user!.invitation_resent",
|
|
@@ -10022,7 +10022,7 @@ userRoutes.delete("/cancel-invitation/:id", async (c) => {
|
|
|
10022
10022
|
}
|
|
10023
10023
|
const deleteStmt = db.prepare(`DELETE FROM users WHERE id = ?`);
|
|
10024
10024
|
await deleteStmt.bind(userId).run();
|
|
10025
|
-
await
|
|
10025
|
+
await chunkQG3YQKL4_cjs.logActivity(
|
|
10026
10026
|
db,
|
|
10027
10027
|
user.userId,
|
|
10028
10028
|
"user!.invitation_cancelled",
|
|
@@ -10105,7 +10105,7 @@ userRoutes.get("/activity-logs", async (c) => {
|
|
|
10105
10105
|
...log,
|
|
10106
10106
|
details: log.details ? JSON.parse(log.details) : null
|
|
10107
10107
|
}));
|
|
10108
|
-
await
|
|
10108
|
+
await chunkQG3YQKL4_cjs.logActivity(
|
|
10109
10109
|
db,
|
|
10110
10110
|
user.userId,
|
|
10111
10111
|
"activity.logs_viewed",
|
|
@@ -10212,7 +10212,7 @@ userRoutes.get("/activity-logs/export", async (c) => {
|
|
|
10212
10212
|
csvRows.push(row.join(","));
|
|
10213
10213
|
}
|
|
10214
10214
|
const csvContent = csvRows.join("\n");
|
|
10215
|
-
await
|
|
10215
|
+
await chunkQG3YQKL4_cjs.logActivity(
|
|
10216
10216
|
db,
|
|
10217
10217
|
user.userId,
|
|
10218
10218
|
"activity.logs_exported",
|
|
@@ -11551,7 +11551,7 @@ var fileValidationSchema2 = zod.z.object({
|
|
|
11551
11551
|
// 50MB max
|
|
11552
11552
|
});
|
|
11553
11553
|
var adminMediaRoutes = new hono.Hono();
|
|
11554
|
-
adminMediaRoutes.use("*",
|
|
11554
|
+
adminMediaRoutes.use("*", chunkQG3YQKL4_cjs.requireAuth());
|
|
11555
11555
|
adminMediaRoutes.get("/", async (c) => {
|
|
11556
11556
|
try {
|
|
11557
11557
|
const user = c.get("user");
|
|
@@ -12137,7 +12137,7 @@ adminMediaRoutes.put("/:id", async (c) => {
|
|
|
12137
12137
|
`);
|
|
12138
12138
|
}
|
|
12139
12139
|
});
|
|
12140
|
-
adminMediaRoutes.delete("/cleanup",
|
|
12140
|
+
adminMediaRoutes.delete("/cleanup", chunkQG3YQKL4_cjs.requireRole("admin"), async (c) => {
|
|
12141
12141
|
try {
|
|
12142
12142
|
const db = c.env.DB;
|
|
12143
12143
|
const allMediaStmt = db.prepare("SELECT id, r2_key, filename FROM media WHERE deleted_at IS NULL");
|
|
@@ -13782,7 +13782,7 @@ function formatTimestamp(timestamp) {
|
|
|
13782
13782
|
|
|
13783
13783
|
// src/routes/admin-plugins.ts
|
|
13784
13784
|
var adminPluginRoutes = new hono.Hono();
|
|
13785
|
-
adminPluginRoutes.use("*",
|
|
13785
|
+
adminPluginRoutes.use("*", chunkQG3YQKL4_cjs.requireAuth());
|
|
13786
13786
|
var AVAILABLE_PLUGINS = [
|
|
13787
13787
|
{
|
|
13788
13788
|
id: "third-party-faq",
|
|
@@ -15073,7 +15073,7 @@ function renderLogConfigPage(data) {
|
|
|
15073
15073
|
|
|
15074
15074
|
// src/routes/admin-logs.ts
|
|
15075
15075
|
var adminLogsRoutes = new hono.Hono();
|
|
15076
|
-
adminLogsRoutes.use("*",
|
|
15076
|
+
adminLogsRoutes.use("*", chunkQG3YQKL4_cjs.requireAuth());
|
|
15077
15077
|
adminLogsRoutes.get("/", async (c) => {
|
|
15078
15078
|
try {
|
|
15079
15079
|
const user = c.get("user");
|
|
@@ -17401,9 +17401,9 @@ function renderStorageUsage(databaseSizeBytes, mediaSizeBytes) {
|
|
|
17401
17401
|
}
|
|
17402
17402
|
|
|
17403
17403
|
// src/routes/admin-dashboard.ts
|
|
17404
|
-
var VERSION =
|
|
17404
|
+
var VERSION = chunkH2X4BFCW_cjs.getCoreVersion();
|
|
17405
17405
|
var router = new hono.Hono();
|
|
17406
|
-
router.use("*",
|
|
17406
|
+
router.use("*", chunkQG3YQKL4_cjs.requireAuth());
|
|
17407
17407
|
router.get("/", async (c) => {
|
|
17408
17408
|
const user = c.get("user");
|
|
17409
17409
|
try {
|
|
@@ -19161,7 +19161,7 @@ function renderCollectionFormPage(data) {
|
|
|
19161
19161
|
|
|
19162
19162
|
// src/routes/admin-collections.ts
|
|
19163
19163
|
var adminCollectionsRoutes = new hono.Hono();
|
|
19164
|
-
adminCollectionsRoutes.use("*",
|
|
19164
|
+
adminCollectionsRoutes.use("*", chunkQG3YQKL4_cjs.requireAuth());
|
|
19165
19165
|
adminCollectionsRoutes.get("/", async (c) => {
|
|
19166
19166
|
try {
|
|
19167
19167
|
const user = c.get("user");
|
|
@@ -21324,7 +21324,7 @@ function renderDatabaseToolsSettings(settings) {
|
|
|
21324
21324
|
|
|
21325
21325
|
// src/routes/admin-settings.ts
|
|
21326
21326
|
var adminSettingsRoutes = new hono.Hono();
|
|
21327
|
-
adminSettingsRoutes.use("*",
|
|
21327
|
+
adminSettingsRoutes.use("*", chunkQG3YQKL4_cjs.requireAuth());
|
|
21328
21328
|
function getMockSettings(user) {
|
|
21329
21329
|
return {
|
|
21330
21330
|
general: {
|
|
@@ -21492,7 +21492,7 @@ adminSettingsRoutes.get("/database-tools", (c) => {
|
|
|
21492
21492
|
adminSettingsRoutes.get("/api/migrations/status", async (c) => {
|
|
21493
21493
|
try {
|
|
21494
21494
|
const db = c.env.DB;
|
|
21495
|
-
const migrationService = new
|
|
21495
|
+
const migrationService = new chunk63LV4YVI_cjs.MigrationService(db);
|
|
21496
21496
|
const status = await migrationService.getMigrationStatus();
|
|
21497
21497
|
return c.json({
|
|
21498
21498
|
success: true,
|
|
@@ -21516,7 +21516,7 @@ adminSettingsRoutes.post("/api/migrations/run", async (c) => {
|
|
|
21516
21516
|
}, 403);
|
|
21517
21517
|
}
|
|
21518
21518
|
const db = c.env.DB;
|
|
21519
|
-
const migrationService = new
|
|
21519
|
+
const migrationService = new chunk63LV4YVI_cjs.MigrationService(db);
|
|
21520
21520
|
const result = await migrationService.runPendingMigrations();
|
|
21521
21521
|
return c.json({
|
|
21522
21522
|
success: result.success,
|
|
@@ -21534,7 +21534,7 @@ adminSettingsRoutes.post("/api/migrations/run", async (c) => {
|
|
|
21534
21534
|
adminSettingsRoutes.get("/api/migrations/validate", async (c) => {
|
|
21535
21535
|
try {
|
|
21536
21536
|
const db = c.env.DB;
|
|
21537
|
-
const migrationService = new
|
|
21537
|
+
const migrationService = new chunk63LV4YVI_cjs.MigrationService(db);
|
|
21538
21538
|
const validation = await migrationService.validateSchema();
|
|
21539
21539
|
return c.json({
|
|
21540
21540
|
success: true,
|
|
@@ -21779,5 +21779,5 @@ exports.auth_default = auth_default;
|
|
|
21779
21779
|
exports.router = router;
|
|
21780
21780
|
exports.test_cleanup_default = test_cleanup_default;
|
|
21781
21781
|
exports.userRoutes = userRoutes;
|
|
21782
|
-
//# sourceMappingURL=chunk-
|
|
21783
|
-
//# sourceMappingURL=chunk-
|
|
21782
|
+
//# sourceMappingURL=chunk-5OLN5JO3.cjs.map
|
|
21783
|
+
//# sourceMappingURL=chunk-5OLN5JO3.cjs.map
|