@sonicjs-cms/core 2.3.2 → 2.3.3

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.
Files changed (35) hide show
  1. package/dist/{chunk-LWGJWWVV.cjs → chunk-33WVERFH.cjs} +90 -90
  2. package/dist/{chunk-LWGJWWVV.cjs.map → chunk-33WVERFH.cjs.map} +1 -1
  3. package/dist/{chunk-DAY5XPQC.js → chunk-73KQVU4R.js} +3 -3
  4. package/dist/{chunk-DAY5XPQC.js.map → chunk-73KQVU4R.js.map} +1 -1
  5. package/dist/{chunk-BARJXFBB.cjs → chunk-FNODBJ4I.cjs} +31 -7
  6. package/dist/chunk-FNODBJ4I.cjs.map +1 -0
  7. package/dist/{chunk-ES7DYKEM.js → chunk-KID6B3NC.js} +3 -3
  8. package/dist/{chunk-ES7DYKEM.js.map → chunk-KID6B3NC.js.map} +1 -1
  9. package/dist/{chunk-FSYW6HZV.cjs → chunk-NSGYDNNC.cjs} +3 -3
  10. package/dist/{chunk-FSYW6HZV.cjs.map → chunk-NSGYDNNC.cjs.map} +1 -1
  11. package/dist/{chunk-3FYCRI7Q.js → chunk-POF4PJI2.js} +31 -7
  12. package/dist/chunk-POF4PJI2.js.map +1 -0
  13. package/dist/{chunk-ZCAPRT76.js → chunk-S3HV6SMQ.js} +8 -8
  14. package/dist/{chunk-ZCAPRT76.js.map → chunk-S3HV6SMQ.js.map} +1 -1
  15. package/dist/{chunk-UYMASN2Z.cjs → chunk-W5TX4DX4.cjs} +4 -4
  16. package/dist/{chunk-UYMASN2Z.cjs.map → chunk-W5TX4DX4.cjs.map} +1 -1
  17. package/dist/index.cjs +74 -74
  18. package/dist/index.js +7 -7
  19. package/dist/middleware.cjs +23 -23
  20. package/dist/middleware.js +2 -2
  21. package/dist/migrations-HMNQBOHY.js +4 -0
  22. package/dist/{migrations-6TOOBUO5.js.map → migrations-HMNQBOHY.js.map} +1 -1
  23. package/dist/migrations-MN533MCV.cjs +13 -0
  24. package/dist/{migrations-GLNXD53E.cjs.map → migrations-MN533MCV.cjs.map} +1 -1
  25. package/dist/routes.cjs +24 -24
  26. package/dist/routes.js +4 -4
  27. package/dist/services.cjs +2 -2
  28. package/dist/services.js +1 -1
  29. package/dist/utils.cjs +11 -11
  30. package/dist/utils.js +1 -1
  31. package/package.json +1 -1
  32. package/dist/chunk-3FYCRI7Q.js.map +0 -1
  33. package/dist/chunk-BARJXFBB.cjs.map +0 -1
  34. package/dist/migrations-6TOOBUO5.js +0 -4
  35. package/dist/migrations-GLNXD53E.cjs +0 -13
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkES3BRZQJ_cjs = require('./chunk-ES3BRZQJ.cjs');
4
- var chunkUYMASN2Z_cjs = require('./chunk-UYMASN2Z.cjs');
4
+ var chunkW5TX4DX4_cjs = require('./chunk-W5TX4DX4.cjs');
5
5
  var chunkNAYD76QF_cjs = require('./chunk-NAYD76QF.cjs');
6
- var chunkBARJXFBB_cjs = require('./chunk-BARJXFBB.cjs');
6
+ var chunkFNODBJ4I_cjs = require('./chunk-FNODBJ4I.cjs');
7
7
  var chunkYU6QFFI4_cjs = require('./chunk-YU6QFFI4.cjs');
8
- var chunkFSYW6HZV_cjs = require('./chunk-FSYW6HZV.cjs');
8
+ var chunkNSGYDNNC_cjs = require('./chunk-NSGYDNNC.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("/", chunkUYMASN2Z_cjs.requireAuth(), async (c) => {
47
+ apiContentCrudRoutes.post("/", chunkW5TX4DX4_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("/", chunkUYMASN2Z_cjs.requireAuth(), async (c) => {
110
110
  }, 500);
111
111
  }
112
112
  });
113
- apiContentCrudRoutes.put("/:id", chunkUYMASN2Z_cjs.requireAuth(), async (c) => {
113
+ apiContentCrudRoutes.put("/:id", chunkW5TX4DX4_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", chunkUYMASN2Z_cjs.requireAuth(), async (c) => {
174
174
  }, 500);
175
175
  }
176
176
  });
177
- apiContentCrudRoutes.delete("/:id", chunkUYMASN2Z_cjs.requireAuth(), async (c) => {
177
+ apiContentCrudRoutes.delete("/:id", chunkW5TX4DX4_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 chunkUYMASN2Z_cjs.isPluginActive(c.env.DB, "core-cache");
213
+ const cacheEnabled = await chunkW5TX4DX4_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 = chunkFSYW6HZV_cjs.QueryFilterBuilder.parseFromQuery(queryParams);
338
+ const filter = chunkNSGYDNNC_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 chunkFSYW6HZV_cjs.QueryFilterBuilder();
343
+ const builder3 = new chunkNSGYDNNC_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 = chunkFSYW6HZV_cjs.QueryFilterBuilder.parseFromQuery(queryParams);
430
+ const filter = chunkNSGYDNNC_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 chunkFSYW6HZV_cjs.QueryFilterBuilder();
446
+ const builder3 = new chunkNSGYDNNC_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("*", chunkUYMASN2Z_cjs.requireAuth());
571
+ apiMediaRoutes.use("*", chunkW5TX4DX4_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("*", chunkUYMASN2Z_cjs.requireAuth());
1316
- adminApiRoutes.use("*", chunkUYMASN2Z_cjs.requireRole(["admin", "editor"]));
1315
+ adminApiRoutes.use("*", chunkW5TX4DX4_cjs.requireAuth());
1316
+ adminApiRoutes.use("*", chunkW5TX4DX4_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-GLNXD53E.cjs');
1725
+ const { MigrationService: MigrationService2 } = await import('./migrations-MN533MCV.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-GLNXD53E.cjs');
1750
+ const { MigrationService: MigrationService2 } = await import('./migrations-MN533MCV.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-GLNXD53E.cjs');
1769
+ const { MigrationService: MigrationService2 } = await import('./migrations-MN533MCV.cjs');
1770
1770
  const db = c.env.DB;
1771
1771
  const migrationService = new MigrationService2(db);
1772
1772
  const validation = await migrationService.validateSchema();
@@ -2212,7 +2212,7 @@ authRoutes.post(
2212
2212
  if (existingUser) {
2213
2213
  return c.json({ error: "User with this email or username already exists" }, 400);
2214
2214
  }
2215
- const passwordHash = await chunkUYMASN2Z_cjs.AuthManager.hashPassword(password);
2215
+ const passwordHash = await chunkW5TX4DX4_cjs.AuthManager.hashPassword(password);
2216
2216
  const userId = crypto.randomUUID();
2217
2217
  const now = /* @__PURE__ */ new Date();
2218
2218
  await db.prepare(`
@@ -2232,7 +2232,7 @@ authRoutes.post(
2232
2232
  now.getTime(),
2233
2233
  now.getTime()
2234
2234
  ).run();
2235
- const token = await chunkUYMASN2Z_cjs.AuthManager.generateToken(userId, normalizedEmail, "viewer");
2235
+ const token = await chunkW5TX4DX4_cjs.AuthManager.generateToken(userId, normalizedEmail, "viewer");
2236
2236
  cookie.setCookie(c, "auth_token", token, {
2237
2237
  httpOnly: true,
2238
2238
  secure: true,
@@ -2285,11 +2285,11 @@ authRoutes.post("/login", async (c) => {
2285
2285
  if (!user) {
2286
2286
  return c.json({ error: "Invalid email or password" }, 401);
2287
2287
  }
2288
- const isValidPassword = await chunkUYMASN2Z_cjs.AuthManager.verifyPassword(password, user.password_hash);
2288
+ const isValidPassword = await chunkW5TX4DX4_cjs.AuthManager.verifyPassword(password, user.password_hash);
2289
2289
  if (!isValidPassword) {
2290
2290
  return c.json({ error: "Invalid email or password" }, 401);
2291
2291
  }
2292
- const token = await chunkUYMASN2Z_cjs.AuthManager.generateToken(user.id, user.email, user.role);
2292
+ const token = await chunkW5TX4DX4_cjs.AuthManager.generateToken(user.id, user.email, user.role);
2293
2293
  cookie.setCookie(c, "auth_token", token, {
2294
2294
  httpOnly: true,
2295
2295
  secure: true,
@@ -2338,7 +2338,7 @@ authRoutes.get("/logout", (c) => {
2338
2338
  });
2339
2339
  return c.redirect("/auth/login?message=You have been logged out successfully");
2340
2340
  });
2341
- authRoutes.get("/me", chunkUYMASN2Z_cjs.requireAuth(), async (c) => {
2341
+ authRoutes.get("/me", chunkW5TX4DX4_cjs.requireAuth(), async (c) => {
2342
2342
  try {
2343
2343
  const user = c.get("user");
2344
2344
  if (!user) {
@@ -2355,13 +2355,13 @@ authRoutes.get("/me", chunkUYMASN2Z_cjs.requireAuth(), async (c) => {
2355
2355
  return c.json({ error: "Failed to get user" }, 500);
2356
2356
  }
2357
2357
  });
2358
- authRoutes.post("/refresh", chunkUYMASN2Z_cjs.requireAuth(), async (c) => {
2358
+ authRoutes.post("/refresh", chunkW5TX4DX4_cjs.requireAuth(), async (c) => {
2359
2359
  try {
2360
2360
  const user = c.get("user");
2361
2361
  if (!user) {
2362
2362
  return c.json({ error: "Not authenticated" }, 401);
2363
2363
  }
2364
- const token = await chunkUYMASN2Z_cjs.AuthManager.generateToken(user.userId, user.email, user.role);
2364
+ const token = await chunkW5TX4DX4_cjs.AuthManager.generateToken(user.userId, user.email, user.role);
2365
2365
  cookie.setCookie(c, "auth_token", token, {
2366
2366
  httpOnly: true,
2367
2367
  secure: true,
@@ -2410,7 +2410,7 @@ authRoutes.post("/register/form", async (c) => {
2410
2410
  </div>
2411
2411
  `);
2412
2412
  }
2413
- const passwordHash = await chunkUYMASN2Z_cjs.AuthManager.hashPassword(password);
2413
+ const passwordHash = await chunkW5TX4DX4_cjs.AuthManager.hashPassword(password);
2414
2414
  const userId = crypto.randomUUID();
2415
2415
  const now = /* @__PURE__ */ new Date();
2416
2416
  await db.prepare(`
@@ -2430,7 +2430,7 @@ authRoutes.post("/register/form", async (c) => {
2430
2430
  now.getTime(),
2431
2431
  now.getTime()
2432
2432
  ).run();
2433
- const token = await chunkUYMASN2Z_cjs.AuthManager.generateToken(userId, normalizedEmail, "admin");
2433
+ const token = await chunkW5TX4DX4_cjs.AuthManager.generateToken(userId, normalizedEmail, "admin");
2434
2434
  cookie.setCookie(c, "auth_token", token, {
2435
2435
  httpOnly: true,
2436
2436
  secure: false,
@@ -2481,7 +2481,7 @@ authRoutes.post("/login/form", async (c) => {
2481
2481
  </div>
2482
2482
  `);
2483
2483
  }
2484
- const isValidPassword = await chunkUYMASN2Z_cjs.AuthManager.verifyPassword(password, user.password_hash);
2484
+ const isValidPassword = await chunkW5TX4DX4_cjs.AuthManager.verifyPassword(password, user.password_hash);
2485
2485
  if (!isValidPassword) {
2486
2486
  return c.html(html.html`
2487
2487
  <div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded">
@@ -2489,7 +2489,7 @@ authRoutes.post("/login/form", async (c) => {
2489
2489
  </div>
2490
2490
  `);
2491
2491
  }
2492
- const token = await chunkUYMASN2Z_cjs.AuthManager.generateToken(user.id, user.email, user.role);
2492
+ const token = await chunkW5TX4DX4_cjs.AuthManager.generateToken(user.id, user.email, user.role);
2493
2493
  cookie.setCookie(c, "auth_token", token, {
2494
2494
  httpOnly: true,
2495
2495
  secure: false,
@@ -2548,7 +2548,7 @@ authRoutes.post("/seed-admin", async (c) => {
2548
2548
  `).run();
2549
2549
  const existingAdmin = await db.prepare("SELECT id FROM users WHERE email = ? OR username = ?").bind("admin@sonicjs.com", "admin").first();
2550
2550
  if (existingAdmin) {
2551
- const passwordHash2 = await chunkUYMASN2Z_cjs.AuthManager.hashPassword("sonicjs!");
2551
+ const passwordHash2 = await chunkW5TX4DX4_cjs.AuthManager.hashPassword("sonicjs!");
2552
2552
  await db.prepare("UPDATE users SET password_hash = ?, updated_at = ? WHERE id = ?").bind(passwordHash2, Date.now(), existingAdmin.id).run();
2553
2553
  return c.json({
2554
2554
  message: "Admin user already exists (password updated)",
@@ -2560,7 +2560,7 @@ authRoutes.post("/seed-admin", async (c) => {
2560
2560
  }
2561
2561
  });
2562
2562
  }
2563
- const passwordHash = await chunkUYMASN2Z_cjs.AuthManager.hashPassword("sonicjs!");
2563
+ const passwordHash = await chunkW5TX4DX4_cjs.AuthManager.hashPassword("sonicjs!");
2564
2564
  const userId = "admin-user-id";
2565
2565
  const now = Date.now();
2566
2566
  const adminEmail = "admin@sonicjs.com".toLowerCase();
@@ -2780,7 +2780,7 @@ authRoutes.post("/accept-invitation", async (c) => {
2780
2780
  if (existingUsername) {
2781
2781
  return c.json({ error: "Username is already taken" }, 400);
2782
2782
  }
2783
- const passwordHash = await chunkUYMASN2Z_cjs.AuthManager.hashPassword(password);
2783
+ const passwordHash = await chunkW5TX4DX4_cjs.AuthManager.hashPassword(password);
2784
2784
  const updateStmt = db.prepare(`
2785
2785
  UPDATE users SET
2786
2786
  username = ?,
@@ -2799,7 +2799,7 @@ authRoutes.post("/accept-invitation", async (c) => {
2799
2799
  Date.now(),
2800
2800
  invitedUser.id
2801
2801
  ).run();
2802
- const authToken = await chunkUYMASN2Z_cjs.AuthManager.generateToken(invitedUser.id, invitedUser.email, invitedUser.role);
2802
+ const authToken = await chunkW5TX4DX4_cjs.AuthManager.generateToken(invitedUser.id, invitedUser.email, invitedUser.role);
2803
2803
  cookie.setCookie(c, "auth_token", authToken, {
2804
2804
  httpOnly: true,
2805
2805
  secure: true,
@@ -3029,7 +3029,7 @@ authRoutes.post("/reset-password", async (c) => {
3029
3029
  if (Date.now() > user.password_reset_expires) {
3030
3030
  return c.json({ error: "Reset token has expired" }, 400);
3031
3031
  }
3032
- const newPasswordHash = await chunkUYMASN2Z_cjs.AuthManager.hashPassword(password);
3032
+ const newPasswordHash = await chunkW5TX4DX4_cjs.AuthManager.hashPassword(password);
3033
3033
  try {
3034
3034
  const historyStmt = db.prepare(`
3035
3035
  INSERT INTO password_history (id, user_id, password_hash, created_at)
@@ -5924,7 +5924,7 @@ async function isPluginActive2(db, pluginId) {
5924
5924
 
5925
5925
  // src/routes/admin-content.ts
5926
5926
  var adminContentRoutes = new hono.Hono();
5927
- adminContentRoutes.use("*", chunkUYMASN2Z_cjs.requireAuth());
5927
+ adminContentRoutes.use("*", chunkW5TX4DX4_cjs.requireAuth());
5928
5928
  async function getCollectionFields(db, collectionId) {
5929
5929
  const cache = chunkES3BRZQJ_cjs.getCacheService(chunkES3BRZQJ_cjs.CACHE_CONFIGS.collection);
5930
5930
  return cache.getOrSet(
@@ -7991,7 +7991,7 @@ function renderUserEditPage(data) {
7991
7991
  <input
7992
7992
  type="text"
7993
7993
  name="first_name"
7994
- value="${chunkFSYW6HZV_cjs.escapeHtml(data.userToEdit.firstName || "")}"
7994
+ value="${chunkNSGYDNNC_cjs.escapeHtml(data.userToEdit.firstName || "")}"
7995
7995
  required
7996
7996
  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"
7997
7997
  />
@@ -8002,7 +8002,7 @@ function renderUserEditPage(data) {
8002
8002
  <input
8003
8003
  type="text"
8004
8004
  name="last_name"
8005
- value="${chunkFSYW6HZV_cjs.escapeHtml(data.userToEdit.lastName || "")}"
8005
+ value="${chunkNSGYDNNC_cjs.escapeHtml(data.userToEdit.lastName || "")}"
8006
8006
  required
8007
8007
  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"
8008
8008
  />
@@ -8013,7 +8013,7 @@ function renderUserEditPage(data) {
8013
8013
  <input
8014
8014
  type="text"
8015
8015
  name="username"
8016
- value="${chunkFSYW6HZV_cjs.escapeHtml(data.userToEdit.username || "")}"
8016
+ value="${chunkNSGYDNNC_cjs.escapeHtml(data.userToEdit.username || "")}"
8017
8017
  required
8018
8018
  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"
8019
8019
  />
@@ -8024,7 +8024,7 @@ function renderUserEditPage(data) {
8024
8024
  <input
8025
8025
  type="email"
8026
8026
  name="email"
8027
- value="${chunkFSYW6HZV_cjs.escapeHtml(data.userToEdit.email || "")}"
8027
+ value="${chunkNSGYDNNC_cjs.escapeHtml(data.userToEdit.email || "")}"
8028
8028
  required
8029
8029
  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"
8030
8030
  />
@@ -8035,7 +8035,7 @@ function renderUserEditPage(data) {
8035
8035
  <input
8036
8036
  type="tel"
8037
8037
  name="phone"
8038
- value="${chunkFSYW6HZV_cjs.escapeHtml(data.userToEdit.phone || "")}"
8038
+ value="${chunkNSGYDNNC_cjs.escapeHtml(data.userToEdit.phone || "")}"
8039
8039
  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"
8040
8040
  />
8041
8041
  </div>
@@ -8049,7 +8049,7 @@ function renderUserEditPage(data) {
8049
8049
  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"
8050
8050
  >
8051
8051
  ${data.roles.map((role) => `
8052
- <option value="${chunkFSYW6HZV_cjs.escapeHtml(role.value)}" ${data.userToEdit.role === role.value ? "selected" : ""}>${chunkFSYW6HZV_cjs.escapeHtml(role.label)}</option>
8052
+ <option value="${chunkNSGYDNNC_cjs.escapeHtml(role.value)}" ${data.userToEdit.role === role.value ? "selected" : ""}>${chunkNSGYDNNC_cjs.escapeHtml(role.label)}</option>
8053
8053
  `).join("")}
8054
8054
  </select>
8055
8055
  <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">
@@ -8065,7 +8065,7 @@ function renderUserEditPage(data) {
8065
8065
  name="bio"
8066
8066
  rows="3"
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
- >${chunkFSYW6HZV_cjs.escapeHtml(data.userToEdit.bio || "")}</textarea>
8068
+ >${chunkNSGYDNNC_cjs.escapeHtml(data.userToEdit.bio || "")}</textarea>
8069
8069
  </div>
8070
8070
  </div>
8071
8071
 
@@ -8965,7 +8965,7 @@ function renderUsersListPage(data) {
8965
8965
 
8966
8966
  // src/routes/admin-users.ts
8967
8967
  var userRoutes = new hono.Hono();
8968
- userRoutes.use("*", chunkUYMASN2Z_cjs.requireAuth());
8968
+ userRoutes.use("*", chunkW5TX4DX4_cjs.requireAuth());
8969
8969
  userRoutes.get("/", (c) => {
8970
8970
  return c.redirect("/admin/dashboard");
8971
8971
  });
@@ -9064,12 +9064,12 @@ userRoutes.put("/profile", async (c) => {
9064
9064
  const db = c.env.DB;
9065
9065
  try {
9066
9066
  const formData = await c.req.formData();
9067
- const firstName = chunkFSYW6HZV_cjs.sanitizeInput(formData.get("first_name")?.toString());
9068
- const lastName = chunkFSYW6HZV_cjs.sanitizeInput(formData.get("last_name")?.toString());
9069
- const username = chunkFSYW6HZV_cjs.sanitizeInput(formData.get("username")?.toString());
9067
+ const firstName = chunkNSGYDNNC_cjs.sanitizeInput(formData.get("first_name")?.toString());
9068
+ const lastName = chunkNSGYDNNC_cjs.sanitizeInput(formData.get("last_name")?.toString());
9069
+ const username = chunkNSGYDNNC_cjs.sanitizeInput(formData.get("username")?.toString());
9070
9070
  const email = formData.get("email")?.toString()?.trim().toLowerCase() || "";
9071
- const phone = chunkFSYW6HZV_cjs.sanitizeInput(formData.get("phone")?.toString()) || null;
9072
- const bio = chunkFSYW6HZV_cjs.sanitizeInput(formData.get("bio")?.toString()) || null;
9071
+ const phone = chunkNSGYDNNC_cjs.sanitizeInput(formData.get("phone")?.toString()) || null;
9072
+ const bio = chunkNSGYDNNC_cjs.sanitizeInput(formData.get("bio")?.toString()) || null;
9073
9073
  const timezone = formData.get("timezone")?.toString() || "UTC";
9074
9074
  const language = formData.get("language")?.toString() || "en";
9075
9075
  const emailNotifications = formData.get("email_notifications") === "1";
@@ -9120,7 +9120,7 @@ userRoutes.put("/profile", async (c) => {
9120
9120
  Date.now(),
9121
9121
  user.userId
9122
9122
  ).run();
9123
- await chunkUYMASN2Z_cjs.logActivity(
9123
+ await chunkW5TX4DX4_cjs.logActivity(
9124
9124
  db,
9125
9125
  user.userId,
9126
9126
  "profile.update",
@@ -9183,7 +9183,7 @@ userRoutes.post("/profile/avatar", async (c) => {
9183
9183
  SELECT first_name, last_name FROM users WHERE id = ?
9184
9184
  `);
9185
9185
  const userData = await userStmt.bind(user.userId).first();
9186
- await chunkUYMASN2Z_cjs.logActivity(
9186
+ await chunkW5TX4DX4_cjs.logActivity(
9187
9187
  db,
9188
9188
  user.userId,
9189
9189
  "profile.avatar_update",
@@ -9254,7 +9254,7 @@ userRoutes.post("/profile/password", async (c) => {
9254
9254
  dismissible: true
9255
9255
  }));
9256
9256
  }
9257
- const validPassword = await chunkUYMASN2Z_cjs.AuthManager.verifyPassword(currentPassword, userData.password_hash);
9257
+ const validPassword = await chunkW5TX4DX4_cjs.AuthManager.verifyPassword(currentPassword, userData.password_hash);
9258
9258
  if (!validPassword) {
9259
9259
  return c.html(renderAlert2({
9260
9260
  type: "error",
@@ -9262,7 +9262,7 @@ userRoutes.post("/profile/password", async (c) => {
9262
9262
  dismissible: true
9263
9263
  }));
9264
9264
  }
9265
- const newPasswordHash = await chunkUYMASN2Z_cjs.AuthManager.hashPassword(newPassword);
9265
+ const newPasswordHash = await chunkW5TX4DX4_cjs.AuthManager.hashPassword(newPassword);
9266
9266
  const historyStmt = db.prepare(`
9267
9267
  INSERT INTO password_history (id, user_id, password_hash, created_at)
9268
9268
  VALUES (?, ?, ?, ?)
@@ -9278,7 +9278,7 @@ userRoutes.post("/profile/password", async (c) => {
9278
9278
  WHERE id = ?
9279
9279
  `);
9280
9280
  await updateStmt.bind(newPasswordHash, Date.now(), user.userId).run();
9281
- await chunkUYMASN2Z_cjs.logActivity(
9281
+ await chunkW5TX4DX4_cjs.logActivity(
9282
9282
  db,
9283
9283
  user.userId,
9284
9284
  "profile.password_change",
@@ -9345,7 +9345,7 @@ userRoutes.get("/users", async (c) => {
9345
9345
  `);
9346
9346
  const countResult = await countStmt.bind(...params).first();
9347
9347
  const totalUsers = countResult?.total || 0;
9348
- await chunkUYMASN2Z_cjs.logActivity(
9348
+ await chunkW5TX4DX4_cjs.logActivity(
9349
9349
  db,
9350
9350
  user.userId,
9351
9351
  "users.list_view",
@@ -9447,12 +9447,12 @@ userRoutes.post("/users/new", async (c) => {
9447
9447
  const user = c.get("user");
9448
9448
  try {
9449
9449
  const formData = await c.req.formData();
9450
- const firstName = chunkFSYW6HZV_cjs.sanitizeInput(formData.get("first_name")?.toString());
9451
- const lastName = chunkFSYW6HZV_cjs.sanitizeInput(formData.get("last_name")?.toString());
9452
- const username = chunkFSYW6HZV_cjs.sanitizeInput(formData.get("username")?.toString());
9450
+ const firstName = chunkNSGYDNNC_cjs.sanitizeInput(formData.get("first_name")?.toString());
9451
+ const lastName = chunkNSGYDNNC_cjs.sanitizeInput(formData.get("last_name")?.toString());
9452
+ const username = chunkNSGYDNNC_cjs.sanitizeInput(formData.get("username")?.toString());
9453
9453
  const email = formData.get("email")?.toString()?.trim().toLowerCase() || "";
9454
- const phone = chunkFSYW6HZV_cjs.sanitizeInput(formData.get("phone")?.toString()) || null;
9455
- const bio = chunkFSYW6HZV_cjs.sanitizeInput(formData.get("bio")?.toString()) || null;
9454
+ const phone = chunkNSGYDNNC_cjs.sanitizeInput(formData.get("phone")?.toString()) || null;
9455
+ const bio = chunkNSGYDNNC_cjs.sanitizeInput(formData.get("bio")?.toString()) || null;
9456
9456
  const role = formData.get("role")?.toString() || "viewer";
9457
9457
  const password = formData.get("password")?.toString() || "";
9458
9458
  const confirmPassword = formData.get("confirm_password")?.toString() || "";
@@ -9499,7 +9499,7 @@ userRoutes.post("/users/new", async (c) => {
9499
9499
  dismissible: true
9500
9500
  }));
9501
9501
  }
9502
- const passwordHash = await chunkUYMASN2Z_cjs.AuthManager.hashPassword(password);
9502
+ const passwordHash = await chunkW5TX4DX4_cjs.AuthManager.hashPassword(password);
9503
9503
  const userId = crypto.randomUUID();
9504
9504
  const createStmt = db.prepare(`
9505
9505
  INSERT INTO users (
@@ -9522,7 +9522,7 @@ userRoutes.post("/users/new", async (c) => {
9522
9522
  Date.now(),
9523
9523
  Date.now()
9524
9524
  ).run();
9525
- await chunkUYMASN2Z_cjs.logActivity(
9525
+ await chunkW5TX4DX4_cjs.logActivity(
9526
9526
  db,
9527
9527
  user.userId,
9528
9528
  "user!.create",
@@ -9560,7 +9560,7 @@ userRoutes.get("/users/:id", async (c) => {
9560
9560
  if (!userRecord) {
9561
9561
  return c.json({ error: "User not found" }, 404);
9562
9562
  }
9563
- await chunkUYMASN2Z_cjs.logActivity(
9563
+ await chunkW5TX4DX4_cjs.logActivity(
9564
9564
  db,
9565
9565
  user.userId,
9566
9566
  "user!.view",
@@ -9653,12 +9653,12 @@ userRoutes.put("/users/:id", async (c) => {
9653
9653
  const userId = c.req.param("id");
9654
9654
  try {
9655
9655
  const formData = await c.req.formData();
9656
- const firstName = chunkFSYW6HZV_cjs.sanitizeInput(formData.get("first_name")?.toString());
9657
- const lastName = chunkFSYW6HZV_cjs.sanitizeInput(formData.get("last_name")?.toString());
9658
- const username = chunkFSYW6HZV_cjs.sanitizeInput(formData.get("username")?.toString());
9656
+ const firstName = chunkNSGYDNNC_cjs.sanitizeInput(formData.get("first_name")?.toString());
9657
+ const lastName = chunkNSGYDNNC_cjs.sanitizeInput(formData.get("last_name")?.toString());
9658
+ const username = chunkNSGYDNNC_cjs.sanitizeInput(formData.get("username")?.toString());
9659
9659
  const email = formData.get("email")?.toString()?.trim().toLowerCase() || "";
9660
- const phone = chunkFSYW6HZV_cjs.sanitizeInput(formData.get("phone")?.toString()) || null;
9661
- const bio = chunkFSYW6HZV_cjs.sanitizeInput(formData.get("bio")?.toString()) || null;
9660
+ const phone = chunkNSGYDNNC_cjs.sanitizeInput(formData.get("phone")?.toString()) || null;
9661
+ const bio = chunkNSGYDNNC_cjs.sanitizeInput(formData.get("bio")?.toString()) || null;
9662
9662
  const role = formData.get("role")?.toString() || "viewer";
9663
9663
  const isActive = formData.get("is_active") === "1";
9664
9664
  const emailVerified = formData.get("email_verified") === "1";
@@ -9709,7 +9709,7 @@ userRoutes.put("/users/:id", async (c) => {
9709
9709
  Date.now(),
9710
9710
  userId
9711
9711
  ).run();
9712
- await chunkUYMASN2Z_cjs.logActivity(
9712
+ await chunkW5TX4DX4_cjs.logActivity(
9713
9713
  db,
9714
9714
  user.userId,
9715
9715
  "user!.update",
@@ -9754,7 +9754,7 @@ userRoutes.post("/users/:id/toggle", async (c) => {
9754
9754
  UPDATE users SET is_active = ?, updated_at = ? WHERE id = ?
9755
9755
  `);
9756
9756
  await toggleStmt.bind(active ? 1 : 0, Date.now(), userId).run();
9757
- await chunkUYMASN2Z_cjs.logActivity(
9757
+ await chunkW5TX4DX4_cjs.logActivity(
9758
9758
  db,
9759
9759
  user.userId,
9760
9760
  active ? "user.activate" : "user.deactivate",
@@ -9795,7 +9795,7 @@ userRoutes.delete("/users/:id", async (c) => {
9795
9795
  DELETE FROM users WHERE id = ?
9796
9796
  `);
9797
9797
  await deleteStmt.bind(userId).run();
9798
- await chunkUYMASN2Z_cjs.logActivity(
9798
+ await chunkW5TX4DX4_cjs.logActivity(
9799
9799
  db,
9800
9800
  user.userId,
9801
9801
  "user!.hard_delete",
@@ -9814,7 +9814,7 @@ userRoutes.delete("/users/:id", async (c) => {
9814
9814
  UPDATE users SET is_active = 0, updated_at = ? WHERE id = ?
9815
9815
  `);
9816
9816
  await deleteStmt.bind(Date.now(), userId).run();
9817
- await chunkUYMASN2Z_cjs.logActivity(
9817
+ await chunkW5TX4DX4_cjs.logActivity(
9818
9818
  db,
9819
9819
  user.userId,
9820
9820
  "user!.soft_delete",
@@ -9841,8 +9841,8 @@ userRoutes.post("/invite-user", async (c) => {
9841
9841
  const formData = await c.req.formData();
9842
9842
  const email = formData.get("email")?.toString()?.trim().toLowerCase() || "";
9843
9843
  const role = formData.get("role")?.toString()?.trim() || "viewer";
9844
- const firstName = chunkFSYW6HZV_cjs.sanitizeInput(formData.get("first_name")?.toString());
9845
- const lastName = chunkFSYW6HZV_cjs.sanitizeInput(formData.get("last_name")?.toString());
9844
+ const firstName = chunkNSGYDNNC_cjs.sanitizeInput(formData.get("first_name")?.toString());
9845
+ const lastName = chunkNSGYDNNC_cjs.sanitizeInput(formData.get("last_name")?.toString());
9846
9846
  if (!email || !firstName || !lastName) {
9847
9847
  return c.json({ error: "Email, first name, and last name are required" }, 400);
9848
9848
  }
@@ -9880,7 +9880,7 @@ userRoutes.post("/invite-user", async (c) => {
9880
9880
  Date.now(),
9881
9881
  Date.now()
9882
9882
  ).run();
9883
- await chunkUYMASN2Z_cjs.logActivity(
9883
+ await chunkW5TX4DX4_cjs.logActivity(
9884
9884
  db,
9885
9885
  user.userId,
9886
9886
  "user!.invite_sent",
@@ -9937,7 +9937,7 @@ userRoutes.post("/resend-invitation/:id", async (c) => {
9937
9937
  Date.now(),
9938
9938
  userId
9939
9939
  ).run();
9940
- await chunkUYMASN2Z_cjs.logActivity(
9940
+ await chunkW5TX4DX4_cjs.logActivity(
9941
9941
  db,
9942
9942
  user.userId,
9943
9943
  "user!.invitation_resent",
@@ -9973,7 +9973,7 @@ userRoutes.delete("/cancel-invitation/:id", async (c) => {
9973
9973
  }
9974
9974
  const deleteStmt = db.prepare(`DELETE FROM users WHERE id = ?`);
9975
9975
  await deleteStmt.bind(userId).run();
9976
- await chunkUYMASN2Z_cjs.logActivity(
9976
+ await chunkW5TX4DX4_cjs.logActivity(
9977
9977
  db,
9978
9978
  user.userId,
9979
9979
  "user!.invitation_cancelled",
@@ -10056,7 +10056,7 @@ userRoutes.get("/activity-logs", async (c) => {
10056
10056
  ...log,
10057
10057
  details: log.details ? JSON.parse(log.details) : null
10058
10058
  }));
10059
- await chunkUYMASN2Z_cjs.logActivity(
10059
+ await chunkW5TX4DX4_cjs.logActivity(
10060
10060
  db,
10061
10061
  user.userId,
10062
10062
  "activity.logs_viewed",
@@ -10163,7 +10163,7 @@ userRoutes.get("/activity-logs/export", async (c) => {
10163
10163
  csvRows.push(row.join(","));
10164
10164
  }
10165
10165
  const csvContent = csvRows.join("\n");
10166
- await chunkUYMASN2Z_cjs.logActivity(
10166
+ await chunkW5TX4DX4_cjs.logActivity(
10167
10167
  db,
10168
10168
  user.userId,
10169
10169
  "activity.logs_exported",
@@ -11502,7 +11502,7 @@ var fileValidationSchema2 = zod.z.object({
11502
11502
  // 50MB max
11503
11503
  });
11504
11504
  var adminMediaRoutes = new hono.Hono();
11505
- adminMediaRoutes.use("*", chunkUYMASN2Z_cjs.requireAuth());
11505
+ adminMediaRoutes.use("*", chunkW5TX4DX4_cjs.requireAuth());
11506
11506
  adminMediaRoutes.get("/", async (c) => {
11507
11507
  try {
11508
11508
  const user = c.get("user");
@@ -12088,7 +12088,7 @@ adminMediaRoutes.put("/:id", async (c) => {
12088
12088
  `);
12089
12089
  }
12090
12090
  });
12091
- adminMediaRoutes.delete("/cleanup", chunkUYMASN2Z_cjs.requireRole("admin"), async (c) => {
12091
+ adminMediaRoutes.delete("/cleanup", chunkW5TX4DX4_cjs.requireRole("admin"), async (c) => {
12092
12092
  try {
12093
12093
  const db = c.env.DB;
12094
12094
  const allMediaStmt = db.prepare("SELECT id, r2_key, filename FROM media WHERE deleted_at IS NULL");
@@ -13693,7 +13693,7 @@ function formatTimestamp(timestamp) {
13693
13693
 
13694
13694
  // src/routes/admin-plugins.ts
13695
13695
  var adminPluginRoutes = new hono.Hono();
13696
- adminPluginRoutes.use("*", chunkUYMASN2Z_cjs.requireAuth());
13696
+ adminPluginRoutes.use("*", chunkW5TX4DX4_cjs.requireAuth());
13697
13697
  var AVAILABLE_PLUGINS = [
13698
13698
  {
13699
13699
  id: "third-party-faq",
@@ -14984,7 +14984,7 @@ function renderLogConfigPage(data) {
14984
14984
 
14985
14985
  // src/routes/admin-logs.ts
14986
14986
  var adminLogsRoutes = new hono.Hono();
14987
- adminLogsRoutes.use("*", chunkUYMASN2Z_cjs.requireAuth());
14987
+ adminLogsRoutes.use("*", chunkW5TX4DX4_cjs.requireAuth());
14988
14988
  adminLogsRoutes.get("/", async (c) => {
14989
14989
  try {
14990
14990
  const user = c.get("user");
@@ -17312,9 +17312,9 @@ function renderStorageUsage(databaseSizeBytes, mediaSizeBytes) {
17312
17312
  }
17313
17313
 
17314
17314
  // src/routes/admin-dashboard.ts
17315
- var VERSION = chunkFSYW6HZV_cjs.getCoreVersion();
17315
+ var VERSION = chunkNSGYDNNC_cjs.getCoreVersion();
17316
17316
  var router = new hono.Hono();
17317
- router.use("*", chunkUYMASN2Z_cjs.requireAuth());
17317
+ router.use("*", chunkW5TX4DX4_cjs.requireAuth());
17318
17318
  router.get("/", async (c) => {
17319
17319
  const user = c.get("user");
17320
17320
  try {
@@ -19068,7 +19068,7 @@ function renderCollectionFormPage(data) {
19068
19068
 
19069
19069
  // src/routes/admin-collections.ts
19070
19070
  var adminCollectionsRoutes = new hono.Hono();
19071
- adminCollectionsRoutes.use("*", chunkUYMASN2Z_cjs.requireAuth());
19071
+ adminCollectionsRoutes.use("*", chunkW5TX4DX4_cjs.requireAuth());
19072
19072
  adminCollectionsRoutes.get("/", async (c) => {
19073
19073
  try {
19074
19074
  const user = c.get("user");
@@ -21129,7 +21129,7 @@ function renderDatabaseToolsSettings(settings) {
21129
21129
 
21130
21130
  // src/routes/admin-settings.ts
21131
21131
  var adminSettingsRoutes = new hono.Hono();
21132
- adminSettingsRoutes.use("*", chunkUYMASN2Z_cjs.requireAuth());
21132
+ adminSettingsRoutes.use("*", chunkW5TX4DX4_cjs.requireAuth());
21133
21133
  function getMockSettings(user) {
21134
21134
  return {
21135
21135
  general: {
@@ -21297,7 +21297,7 @@ adminSettingsRoutes.get("/database-tools", (c) => {
21297
21297
  adminSettingsRoutes.get("/api/migrations/status", async (c) => {
21298
21298
  try {
21299
21299
  const db = c.env.DB;
21300
- const migrationService = new chunkBARJXFBB_cjs.MigrationService(db);
21300
+ const migrationService = new chunkFNODBJ4I_cjs.MigrationService(db);
21301
21301
  const status = await migrationService.getMigrationStatus();
21302
21302
  return c.json({
21303
21303
  success: true,
@@ -21321,7 +21321,7 @@ adminSettingsRoutes.post("/api/migrations/run", async (c) => {
21321
21321
  }, 403);
21322
21322
  }
21323
21323
  const db = c.env.DB;
21324
- const migrationService = new chunkBARJXFBB_cjs.MigrationService(db);
21324
+ const migrationService = new chunkFNODBJ4I_cjs.MigrationService(db);
21325
21325
  const result = await migrationService.runPendingMigrations();
21326
21326
  return c.json({
21327
21327
  success: result.success,
@@ -21339,7 +21339,7 @@ adminSettingsRoutes.post("/api/migrations/run", async (c) => {
21339
21339
  adminSettingsRoutes.get("/api/migrations/validate", async (c) => {
21340
21340
  try {
21341
21341
  const db = c.env.DB;
21342
- const migrationService = new chunkBARJXFBB_cjs.MigrationService(db);
21342
+ const migrationService = new chunkFNODBJ4I_cjs.MigrationService(db);
21343
21343
  const validation = await migrationService.validateSchema();
21344
21344
  return c.json({
21345
21345
  success: true,
@@ -21584,5 +21584,5 @@ exports.auth_default = auth_default;
21584
21584
  exports.router = router;
21585
21585
  exports.test_cleanup_default = test_cleanup_default;
21586
21586
  exports.userRoutes = userRoutes;
21587
- //# sourceMappingURL=chunk-LWGJWWVV.cjs.map
21588
- //# sourceMappingURL=chunk-LWGJWWVV.cjs.map
21587
+ //# sourceMappingURL=chunk-33WVERFH.cjs.map
21588
+ //# sourceMappingURL=chunk-33WVERFH.cjs.map