@sonicjs-cms/core 2.12.0 → 2.13.0

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 (53) hide show
  1. package/dist/{chunk-RBXFXT7H.cjs → chunk-3QCEYJLK.cjs} +9 -9
  2. package/dist/{chunk-RBXFXT7H.cjs.map → chunk-3QCEYJLK.cjs.map} +1 -1
  3. package/dist/{chunk-U3ZMGBVC.js → chunk-3VAKUFNQ.js} +10 -3
  4. package/dist/chunk-3VAKUFNQ.js.map +1 -0
  5. package/dist/{chunk-BWZBKLOC.js → chunk-CB7ONLGB.js} +3 -3
  6. package/dist/{chunk-BWZBKLOC.js.map → chunk-CB7ONLGB.js.map} +1 -1
  7. package/dist/{chunk-6R6LAUR7.js → chunk-CO4B5EYF.js} +5 -5
  8. package/dist/{chunk-6R6LAUR7.js.map → chunk-CO4B5EYF.js.map} +1 -1
  9. package/dist/{chunk-HXIYYE57.js → chunk-DB2GJJTM.js} +3 -3
  10. package/dist/{chunk-HXIYYE57.js.map → chunk-DB2GJJTM.js.map} +1 -1
  11. package/dist/{chunk-VHNTCB2X.cjs → chunk-EGUDIX6Q.cjs} +4 -4
  12. package/dist/{chunk-VHNTCB2X.cjs.map → chunk-EGUDIX6Q.cjs.map} +1 -1
  13. package/dist/{chunk-ZV6ZCJ74.cjs → chunk-HVTSE2SF.cjs} +247 -210
  14. package/dist/chunk-HVTSE2SF.cjs.map +1 -0
  15. package/dist/{chunk-NDFHQOPP.js → chunk-IYFSNRZN.js} +84 -47
  16. package/dist/chunk-IYFSNRZN.js.map +1 -0
  17. package/dist/{chunk-76TX6XND.js → chunk-JTUCC6WZ.js} +18 -10
  18. package/dist/chunk-JTUCC6WZ.js.map +1 -0
  19. package/dist/{chunk-H4NHRZ6Y.cjs → chunk-QP3OHHON.cjs} +18 -10
  20. package/dist/chunk-QP3OHHON.cjs.map +1 -0
  21. package/dist/{chunk-AG3SIPP7.cjs → chunk-SER23XI4.cjs} +10 -3
  22. package/dist/chunk-SER23XI4.cjs.map +1 -0
  23. package/dist/{chunk-RXNLGINR.cjs → chunk-XCP5GCBE.cjs} +5 -5
  24. package/dist/{chunk-RXNLGINR.cjs.map → chunk-XCP5GCBE.cjs.map} +1 -1
  25. package/dist/index.cjs +131 -119
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.js +23 -11
  28. package/dist/index.js.map +1 -1
  29. package/dist/middleware.cjs +28 -28
  30. package/dist/middleware.js +2 -2
  31. package/dist/migrations-GMHTJI7D.cjs +13 -0
  32. package/dist/{migrations-ZE6IZNLB.cjs.map → migrations-GMHTJI7D.cjs.map} +1 -1
  33. package/dist/migrations-IVFIDOSO.js +4 -0
  34. package/dist/{migrations-USSEHJC7.js.map → migrations-IVFIDOSO.js.map} +1 -1
  35. package/dist/routes.cjs +28 -28
  36. package/dist/routes.js +5 -5
  37. package/dist/services.cjs +2 -2
  38. package/dist/services.js +1 -1
  39. package/dist/templates.cjs +19 -19
  40. package/dist/templates.js +2 -2
  41. package/dist/utils.cjs +11 -11
  42. package/dist/utils.js +1 -1
  43. package/migrations/032_user_profiles.sql +1 -0
  44. package/migrations/035_user_profiles_data_column.sql +17 -0
  45. package/package.json +3 -3
  46. package/dist/chunk-76TX6XND.js.map +0 -1
  47. package/dist/chunk-AG3SIPP7.cjs.map +0 -1
  48. package/dist/chunk-H4NHRZ6Y.cjs.map +0 -1
  49. package/dist/chunk-NDFHQOPP.js.map +0 -1
  50. package/dist/chunk-U3ZMGBVC.js.map +0 -1
  51. package/dist/chunk-ZV6ZCJ74.cjs.map +0 -1
  52. package/dist/migrations-USSEHJC7.js +0 -4
  53. package/dist/migrations-ZE6IZNLB.cjs +0 -13
package/dist/index.cjs CHANGED
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var chunkZV6ZCJ74_cjs = require('./chunk-ZV6ZCJ74.cjs');
3
+ var chunkHVTSE2SF_cjs = require('./chunk-HVTSE2SF.cjs');
4
4
  var chunkNZWFCUDA_cjs = require('./chunk-NZWFCUDA.cjs');
5
- var chunkVHNTCB2X_cjs = require('./chunk-VHNTCB2X.cjs');
5
+ var chunkEGUDIX6Q_cjs = require('./chunk-EGUDIX6Q.cjs');
6
6
  var chunkI6FFGQIT_cjs = require('./chunk-I6FFGQIT.cjs');
7
- var chunkAG3SIPP7_cjs = require('./chunk-AG3SIPP7.cjs');
8
- var chunkRBXFXT7H_cjs = require('./chunk-RBXFXT7H.cjs');
9
- var chunkH4NHRZ6Y_cjs = require('./chunk-H4NHRZ6Y.cjs');
7
+ var chunkSER23XI4_cjs = require('./chunk-SER23XI4.cjs');
8
+ var chunk3QCEYJLK_cjs = require('./chunk-3QCEYJLK.cjs');
9
+ var chunkQP3OHHON_cjs = require('./chunk-QP3OHHON.cjs');
10
10
  var chunk56GUBLJE_cjs = require('./chunk-56GUBLJE.cjs');
11
11
  var chunk6FHNRRJ3_cjs = require('./chunk-6FHNRRJ3.cjs');
12
- var chunkRXNLGINR_cjs = require('./chunk-RXNLGINR.cjs');
12
+ var chunkXCP5GCBE_cjs = require('./chunk-XCP5GCBE.cjs');
13
13
  require('./chunk-P3XDZL6Q.cjs');
14
14
  var chunkRCQ2HIQD_cjs = require('./chunk-RCQ2HIQD.cjs');
15
15
  var chunkMNWKYY5E_cjs = require('./chunk-MNWKYY5E.cjs');
@@ -235,7 +235,7 @@ var DatabaseToolsService = class {
235
235
  };
236
236
 
237
237
  // src/templates/pages/admin-database-table.template.ts
238
- chunkH4NHRZ6Y_cjs.init_admin_layout_catalyst_template();
238
+ chunkQP3OHHON_cjs.init_admin_layout_catalyst_template();
239
239
  function renderDatabaseTablePage(data) {
240
240
  const totalPages = Math.ceil(data.totalRows / data.pageSize);
241
241
  const startRow = (data.currentPage - 1) * data.pageSize + 1;
@@ -484,7 +484,7 @@ function renderDatabaseTablePage(data) {
484
484
  user: data.user,
485
485
  content: pageContent
486
486
  };
487
- return chunkH4NHRZ6Y_cjs.renderAdminLayoutCatalyst(layoutData);
487
+ return chunkQP3OHHON_cjs.renderAdminLayoutCatalyst(layoutData);
488
488
  }
489
489
  function generatePageNumbers(currentPage, totalPages) {
490
490
  const pages = [];
@@ -559,7 +559,7 @@ function formatCellValue(value) {
559
559
  // src/plugins/core-plugins/database-tools-plugin/admin-routes.ts
560
560
  function createDatabaseToolsAdminRoutes() {
561
561
  const router3 = new hono.Hono();
562
- router3.use("*", chunkVHNTCB2X_cjs.requireAuth());
562
+ router3.use("*", chunkEGUDIX6Q_cjs.requireAuth());
563
563
  router3.get("/api/stats", async (c) => {
564
564
  try {
565
565
  const user = c.get("user");
@@ -1911,11 +1911,23 @@ function createOTPLoginPlugin() {
1911
1911
  attemptsRemaining: verification.attemptsRemaining
1912
1912
  }, 401);
1913
1913
  }
1914
- const user = await db.prepare(`
1914
+ let user = await db.prepare(`
1915
1915
  SELECT id, email, role, is_active
1916
1916
  FROM users
1917
1917
  WHERE email = ?
1918
1918
  `).bind(normalizedEmail).first();
1919
+ if (!user && settings.allowNewUserRegistration) {
1920
+ const userId = crypto.randomUUID();
1921
+ const now = Date.now();
1922
+ const username = normalizedEmail.split("@")[0] + "_" + userId.slice(0, 6);
1923
+ await db.prepare(`
1924
+ INSERT INTO users (
1925
+ id, email, username, first_name, last_name,
1926
+ password_hash, role, is_active, email_verified, created_at, updated_at
1927
+ ) VALUES (?, ?, ?, '', '', NULL, 'viewer', 1, 1, ?, ?)
1928
+ `).bind(userId, normalizedEmail, username, now, now).run();
1929
+ user = { id: userId, email: normalizedEmail, role: "viewer", is_active: 1 };
1930
+ }
1919
1931
  if (!user) {
1920
1932
  return c.json({
1921
1933
  error: "User not found"
@@ -1926,7 +1938,7 @@ function createOTPLoginPlugin() {
1926
1938
  error: "Account is deactivated"
1927
1939
  }, 403);
1928
1940
  }
1929
- const token = await chunkVHNTCB2X_cjs.AuthManager.generateToken(user.id, user.email, user.role, c.env.JWT_SECRET);
1941
+ const token = await chunkEGUDIX6Q_cjs.AuthManager.generateToken(user.id, user.email, user.role, c.env.JWT_SECRET);
1930
1942
  cookie.setCookie(c, "auth_token", token, {
1931
1943
  httpOnly: true,
1932
1944
  secure: true,
@@ -2396,13 +2408,13 @@ function createOAuthProvidersPlugin() {
2396
2408
  if (!user || !user.is_active) {
2397
2409
  return c.redirect("/auth/login?error=Account is deactivated");
2398
2410
  }
2399
- const jwt2 = await chunkVHNTCB2X_cjs.AuthManager.generateToken(
2411
+ const jwt2 = await chunkEGUDIX6Q_cjs.AuthManager.generateToken(
2400
2412
  user.id,
2401
2413
  user.email,
2402
2414
  user.role,
2403
2415
  c.env.JWT_SECRET
2404
2416
  );
2405
- chunkVHNTCB2X_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax" });
2417
+ chunkEGUDIX6Q_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax" });
2406
2418
  return c.redirect("/admin");
2407
2419
  }
2408
2420
  const existingUser = await oauthService.findUserByEmail(profile.email);
@@ -2419,13 +2431,13 @@ function createOAuthProvidersPlugin() {
2419
2431
  tokenExpiresAt: tokenExpiresAt ?? void 0,
2420
2432
  profileData: JSON.stringify(profile)
2421
2433
  });
2422
- const jwt2 = await chunkVHNTCB2X_cjs.AuthManager.generateToken(
2434
+ const jwt2 = await chunkEGUDIX6Q_cjs.AuthManager.generateToken(
2423
2435
  existingUser.id,
2424
2436
  existingUser.email,
2425
2437
  existingUser.role,
2426
2438
  c.env.JWT_SECRET
2427
2439
  );
2428
- chunkVHNTCB2X_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax" });
2440
+ chunkEGUDIX6Q_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax" });
2429
2441
  return c.redirect("/admin");
2430
2442
  }
2431
2443
  const newUserId = await oauthService.createUserFromOAuth(profile);
@@ -2438,13 +2450,13 @@ function createOAuthProvidersPlugin() {
2438
2450
  tokenExpiresAt: tokenExpiresAt ?? void 0,
2439
2451
  profileData: JSON.stringify(profile)
2440
2452
  });
2441
- const jwt = await chunkVHNTCB2X_cjs.AuthManager.generateToken(
2453
+ const jwt = await chunkEGUDIX6Q_cjs.AuthManager.generateToken(
2442
2454
  newUserId,
2443
2455
  profile.email.toLowerCase(),
2444
2456
  "viewer",
2445
2457
  c.env.JWT_SECRET
2446
2458
  );
2447
- chunkVHNTCB2X_cjs.AuthManager.setAuthCookie(c, jwt, { sameSite: "Lax" });
2459
+ chunkEGUDIX6Q_cjs.AuthManager.setAuthCookie(c, jwt, { sameSite: "Lax" });
2448
2460
  return c.redirect("/admin");
2449
2461
  } catch (error) {
2450
2462
  console.error("OAuth callback error:", error);
@@ -4126,7 +4138,7 @@ function renderSettingsPage(data) {
4126
4138
  }, 30000);
4127
4139
  </script>
4128
4140
  `;
4129
- return chunkH4NHRZ6Y_cjs.renderAdminLayout({
4141
+ return chunkQP3OHHON_cjs.renderAdminLayout({
4130
4142
  title: "AI Search Settings",
4131
4143
  pageTitle: "AI Search Settings",
4132
4144
  currentPath: "/admin/plugins/ai-search/settings",
@@ -4137,7 +4149,7 @@ function renderSettingsPage(data) {
4137
4149
 
4138
4150
  // src/plugins/core-plugins/ai-search-plugin/routes/admin.ts
4139
4151
  var adminRoutes = new hono.Hono();
4140
- adminRoutes.use("*", chunkVHNTCB2X_cjs.requireAuth());
4152
+ adminRoutes.use("*", chunkEGUDIX6Q_cjs.requireAuth());
4141
4153
  adminRoutes.get("/", async (c) => {
4142
4154
  try {
4143
4155
  const user = c.get("user");
@@ -4538,13 +4550,13 @@ function createMagicLinkAuthPlugin() {
4538
4550
  SET used = 1, used_at = ?
4539
4551
  WHERE id = ?
4540
4552
  `).bind(Date.now(), magicLink.id).run();
4541
- const jwtToken = await chunkVHNTCB2X_cjs.AuthManager.generateToken(
4553
+ const jwtToken = await chunkEGUDIX6Q_cjs.AuthManager.generateToken(
4542
4554
  user.id,
4543
4555
  user.email,
4544
4556
  user.role,
4545
4557
  c.env.JWT_SECRET
4546
4558
  );
4547
- chunkVHNTCB2X_cjs.AuthManager.setAuthCookie(c, jwtToken);
4559
+ chunkEGUDIX6Q_cjs.AuthManager.setAuthCookie(c, jwtToken);
4548
4560
  await db.prepare(`
4549
4561
  UPDATE users SET last_login_at = ? WHERE id = ?
4550
4562
  `).bind(Date.now(), user.id).run();
@@ -4982,7 +4994,7 @@ var SecurityAuditService = class {
4982
4994
  };
4983
4995
 
4984
4996
  // src/plugins/core-plugins/security-audit-plugin/components/dashboard-page.ts
4985
- chunkH4NHRZ6Y_cjs.init_admin_layout_catalyst_template();
4997
+ chunkQP3OHHON_cjs.init_admin_layout_catalyst_template();
4986
4998
  function formatTimestamp(ts) {
4987
4999
  const date = new Date(ts);
4988
5000
  const now = Date.now();
@@ -5181,11 +5193,11 @@ function renderSecurityDashboard(data) {
5181
5193
  version,
5182
5194
  dynamicMenuItems
5183
5195
  };
5184
- return chunkH4NHRZ6Y_cjs.renderAdminLayoutCatalyst(layoutData);
5196
+ return chunkQP3OHHON_cjs.renderAdminLayoutCatalyst(layoutData);
5185
5197
  }
5186
5198
 
5187
5199
  // src/plugins/core-plugins/security-audit-plugin/components/event-log-page.ts
5188
- chunkH4NHRZ6Y_cjs.init_admin_layout_catalyst_template();
5200
+ chunkQP3OHHON_cjs.init_admin_layout_catalyst_template();
5189
5201
  function formatTimestamp2(ts) {
5190
5202
  const date = new Date(ts);
5191
5203
  return date.toLocaleDateString("en-US", {
@@ -5392,11 +5404,11 @@ function renderEventLogPage(data) {
5392
5404
  version,
5393
5405
  dynamicMenuItems
5394
5406
  };
5395
- return chunkH4NHRZ6Y_cjs.renderAdminLayoutCatalyst(layoutData);
5407
+ return chunkQP3OHHON_cjs.renderAdminLayoutCatalyst(layoutData);
5396
5408
  }
5397
5409
 
5398
5410
  // src/plugins/core-plugins/security-audit-plugin/components/settings-page.ts
5399
- chunkH4NHRZ6Y_cjs.init_admin_layout_catalyst_template();
5411
+ chunkQP3OHHON_cjs.init_admin_layout_catalyst_template();
5400
5412
  function renderSecuritySettingsPage(data) {
5401
5413
  const { settings, user, version, message, dynamicMenuItems } = data;
5402
5414
  const content2 = `
@@ -5549,12 +5561,12 @@ function renderSecuritySettingsPage(data) {
5549
5561
  version,
5550
5562
  dynamicMenuItems
5551
5563
  };
5552
- return chunkH4NHRZ6Y_cjs.renderAdminLayoutCatalyst(layoutData);
5564
+ return chunkQP3OHHON_cjs.renderAdminLayoutCatalyst(layoutData);
5553
5565
  }
5554
5566
 
5555
5567
  // src/plugins/core-plugins/security-audit-plugin/routes/admin.ts
5556
5568
  var adminRoutes2 = new hono.Hono();
5557
- adminRoutes2.use("*", chunkVHNTCB2X_cjs.requireAuth());
5569
+ adminRoutes2.use("*", chunkEGUDIX6Q_cjs.requireAuth());
5558
5570
  adminRoutes2.use("*", async (c, next) => {
5559
5571
  const user = c.get("user");
5560
5572
  if (user?.role !== "admin") {
@@ -5824,7 +5836,7 @@ var BruteForceDetector = class {
5824
5836
 
5825
5837
  // src/plugins/core-plugins/security-audit-plugin/routes/api.ts
5826
5838
  var apiRoutes2 = new hono.Hono();
5827
- apiRoutes2.use("*", chunkVHNTCB2X_cjs.requireAuth());
5839
+ apiRoutes2.use("*", chunkEGUDIX6Q_cjs.requireAuth());
5828
5840
  apiRoutes2.use("*", async (c, next) => {
5829
5841
  const user = c.get("user");
5830
5842
  if (user?.role !== "admin") {
@@ -7281,7 +7293,7 @@ async function warmNamespace(namespace, entries) {
7281
7293
  }
7282
7294
 
7283
7295
  // src/templates/pages/admin-cache.template.ts
7284
- chunkH4NHRZ6Y_cjs.init_admin_layout_catalyst_template();
7296
+ chunkQP3OHHON_cjs.init_admin_layout_catalyst_template();
7285
7297
  function renderCacheDashboard(data) {
7286
7298
  const pageContent = `
7287
7299
  <div class="space-y-6">
@@ -7460,7 +7472,7 @@ function renderCacheDashboard(data) {
7460
7472
  </script>
7461
7473
 
7462
7474
  <!-- Confirmation Dialogs -->
7463
- ${chunkZV6ZCJ74_cjs.renderConfirmationDialog({
7475
+ ${chunkHVTSE2SF_cjs.renderConfirmationDialog({
7464
7476
  id: "clear-all-cache-confirm",
7465
7477
  title: "Clear All Cache",
7466
7478
  message: "Are you sure you want to clear all cache entries? This cannot be undone.",
@@ -7471,7 +7483,7 @@ function renderCacheDashboard(data) {
7471
7483
  onConfirm: "performClearAllCaches()"
7472
7484
  })}
7473
7485
 
7474
- ${chunkZV6ZCJ74_cjs.renderConfirmationDialog({
7486
+ ${chunkHVTSE2SF_cjs.renderConfirmationDialog({
7475
7487
  id: "clear-namespace-cache-confirm",
7476
7488
  title: "Clear Namespace Cache",
7477
7489
  message: "Clear cache for this namespace?",
@@ -7482,7 +7494,7 @@ function renderCacheDashboard(data) {
7482
7494
  onConfirm: "performClearNamespaceCache()"
7483
7495
  })}
7484
7496
 
7485
- ${chunkZV6ZCJ74_cjs.getConfirmationDialogScript()}
7497
+ ${chunkHVTSE2SF_cjs.getConfirmationDialogScript()}
7486
7498
  `;
7487
7499
  const layoutData = {
7488
7500
  title: "Cache System",
@@ -7492,7 +7504,7 @@ function renderCacheDashboard(data) {
7492
7504
  version: data.version,
7493
7505
  content: pageContent
7494
7506
  };
7495
- return chunkH4NHRZ6Y_cjs.renderAdminLayoutCatalyst(layoutData);
7507
+ return chunkQP3OHHON_cjs.renderAdminLayoutCatalyst(layoutData);
7496
7508
  }
7497
7509
  function renderStatCard(label, value, color, icon, colorOverride) {
7498
7510
  const finalColor = colorOverride || color;
@@ -8168,14 +8180,14 @@ var faviconSvg = `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
8168
8180
  // src/app.ts
8169
8181
  function createSonicJSApp(config = {}) {
8170
8182
  const app2 = new hono.Hono();
8171
- const appVersion = config.version || chunkRXNLGINR_cjs.getCoreVersion();
8183
+ const appVersion = config.version || chunkXCP5GCBE_cjs.getCoreVersion();
8172
8184
  const appName = config.name || "SonicJS AI";
8173
8185
  app2.use("*", async (c, next) => {
8174
8186
  c.set("appVersion", appVersion);
8175
8187
  await next();
8176
8188
  });
8177
- app2.use("*", chunkVHNTCB2X_cjs.metricsMiddleware());
8178
- app2.use("*", chunkVHNTCB2X_cjs.bootstrapMiddleware(config));
8189
+ app2.use("*", chunkEGUDIX6Q_cjs.metricsMiddleware());
8190
+ app2.use("*", chunkEGUDIX6Q_cjs.bootstrapMiddleware(config));
8179
8191
  if (config.middleware?.beforeAuth) {
8180
8192
  for (const middleware of config.middleware.beforeAuth) {
8181
8193
  app2.use("*", middleware);
@@ -8184,29 +8196,29 @@ function createSonicJSApp(config = {}) {
8184
8196
  app2.use("*", async (_c, next) => {
8185
8197
  await next();
8186
8198
  });
8187
- app2.use("*", chunkVHNTCB2X_cjs.securityHeadersMiddleware());
8188
- app2.use("*", chunkVHNTCB2X_cjs.csrfProtection());
8199
+ app2.use("*", chunkEGUDIX6Q_cjs.securityHeadersMiddleware());
8200
+ app2.use("*", chunkEGUDIX6Q_cjs.csrfProtection());
8189
8201
  if (config.middleware?.afterAuth) {
8190
8202
  for (const middleware of config.middleware.afterAuth) {
8191
8203
  app2.use("*", middleware);
8192
8204
  }
8193
8205
  }
8194
8206
  app2.use("/admin/*", pluginMenuMiddleware());
8195
- app2.route("/api", chunkZV6ZCJ74_cjs.api_default);
8196
- app2.route("/api/media", chunkZV6ZCJ74_cjs.api_media_default);
8197
- app2.route("/api/system", chunkZV6ZCJ74_cjs.api_system_default);
8198
- app2.route("/admin/api", chunkZV6ZCJ74_cjs.admin_api_default);
8199
- app2.route("/admin/dashboard", chunkZV6ZCJ74_cjs.router);
8200
- app2.route("/admin/collections", chunkZV6ZCJ74_cjs.adminCollectionsRoutes);
8201
- app2.route("/admin/forms", chunkZV6ZCJ74_cjs.adminFormsRoutes);
8202
- app2.route("/admin/settings", chunkZV6ZCJ74_cjs.adminSettingsRoutes);
8203
- app2.route("/forms", chunkZV6ZCJ74_cjs.public_forms_default);
8204
- app2.route("/api/forms", chunkZV6ZCJ74_cjs.public_forms_default);
8205
- app2.route("/admin/api-reference", chunkZV6ZCJ74_cjs.router2);
8207
+ app2.route("/api", chunkHVTSE2SF_cjs.api_default);
8208
+ app2.route("/api/media", chunkHVTSE2SF_cjs.api_media_default);
8209
+ app2.route("/api/system", chunkHVTSE2SF_cjs.api_system_default);
8210
+ app2.route("/admin/api", chunkHVTSE2SF_cjs.admin_api_default);
8211
+ app2.route("/admin/dashboard", chunkHVTSE2SF_cjs.router);
8212
+ app2.route("/admin/collections", chunkHVTSE2SF_cjs.adminCollectionsRoutes);
8213
+ app2.route("/admin/forms", chunkHVTSE2SF_cjs.adminFormsRoutes);
8214
+ app2.route("/admin/settings", chunkHVTSE2SF_cjs.adminSettingsRoutes);
8215
+ app2.route("/forms", chunkHVTSE2SF_cjs.public_forms_default);
8216
+ app2.route("/api/forms", chunkHVTSE2SF_cjs.public_forms_default);
8217
+ app2.route("/admin/api-reference", chunkHVTSE2SF_cjs.router2);
8206
8218
  app2.route("/admin/database-tools", createDatabaseToolsAdminRoutes());
8207
8219
  app2.route("/admin/seed-data", createSeedDataAdminRoutes());
8208
- app2.route("/admin/content", chunkZV6ZCJ74_cjs.admin_content_default);
8209
- app2.route("/admin/media", chunkZV6ZCJ74_cjs.adminMediaRoutes);
8220
+ app2.route("/admin/content", chunkHVTSE2SF_cjs.admin_content_default);
8221
+ app2.route("/admin/media", chunkHVTSE2SF_cjs.adminMediaRoutes);
8210
8222
  app2.use("/auth/*", securityAuditMiddleware());
8211
8223
  if (securityAuditPlugin.routes && securityAuditPlugin.routes.length > 0) {
8212
8224
  for (const route of securityAuditPlugin.routes) {
@@ -8224,8 +8236,8 @@ function createSonicJSApp(config = {}) {
8224
8236
  app2.route(route.path, route.handler);
8225
8237
  }
8226
8238
  }
8227
- if (chunkZV6ZCJ74_cjs.userProfilesPlugin.routes && chunkZV6ZCJ74_cjs.userProfilesPlugin.routes.length > 0) {
8228
- for (const route of chunkZV6ZCJ74_cjs.userProfilesPlugin.routes) {
8239
+ if (chunkHVTSE2SF_cjs.userProfilesPlugin.routes && chunkHVTSE2SF_cjs.userProfilesPlugin.routes.length > 0) {
8240
+ for (const route of chunkHVTSE2SF_cjs.userProfilesPlugin.routes) {
8229
8241
  app2.route(route.path, route.handler);
8230
8242
  }
8231
8243
  }
@@ -8234,11 +8246,11 @@ function createSonicJSApp(config = {}) {
8234
8246
  app2.route(route.path, route.handler);
8235
8247
  }
8236
8248
  }
8237
- app2.route("/admin/plugins", chunkZV6ZCJ74_cjs.adminPluginRoutes);
8238
- app2.route("/admin/logs", chunkZV6ZCJ74_cjs.adminLogsRoutes);
8239
- app2.route("/admin", chunkZV6ZCJ74_cjs.userRoutes);
8240
- app2.route("/auth", chunkZV6ZCJ74_cjs.auth_default);
8241
- app2.route("/", chunkZV6ZCJ74_cjs.test_cleanup_default);
8249
+ app2.route("/admin/plugins", chunkHVTSE2SF_cjs.adminPluginRoutes);
8250
+ app2.route("/admin/logs", chunkHVTSE2SF_cjs.adminLogsRoutes);
8251
+ app2.route("/admin", chunkHVTSE2SF_cjs.userRoutes);
8252
+ app2.route("/auth", chunkHVTSE2SF_cjs.auth_default);
8253
+ app2.route("/", chunkHVTSE2SF_cjs.test_cleanup_default);
8242
8254
  if (emailPlugin.routes && emailPlugin.routes.length > 0) {
8243
8255
  for (const route of emailPlugin.routes) {
8244
8256
  app2.route(route.path, route.handler);
@@ -8322,99 +8334,99 @@ function createDb(d1$1) {
8322
8334
  }
8323
8335
 
8324
8336
  // src/index.ts
8325
- var VERSION = chunkRXNLGINR_cjs.package_default.version;
8337
+ var VERSION = chunkXCP5GCBE_cjs.package_default.version;
8326
8338
 
8327
8339
  Object.defineProperty(exports, "ROUTES_INFO", {
8328
8340
  enumerable: true,
8329
- get: function () { return chunkZV6ZCJ74_cjs.ROUTES_INFO; }
8341
+ get: function () { return chunkHVTSE2SF_cjs.ROUTES_INFO; }
8330
8342
  });
8331
8343
  Object.defineProperty(exports, "adminApiRoutes", {
8332
8344
  enumerable: true,
8333
- get: function () { return chunkZV6ZCJ74_cjs.admin_api_default; }
8345
+ get: function () { return chunkHVTSE2SF_cjs.admin_api_default; }
8334
8346
  });
8335
8347
  Object.defineProperty(exports, "adminCheckboxRoutes", {
8336
8348
  enumerable: true,
8337
- get: function () { return chunkZV6ZCJ74_cjs.adminCheckboxRoutes; }
8349
+ get: function () { return chunkHVTSE2SF_cjs.adminCheckboxRoutes; }
8338
8350
  });
8339
8351
  Object.defineProperty(exports, "adminCodeExamplesRoutes", {
8340
8352
  enumerable: true,
8341
- get: function () { return chunkZV6ZCJ74_cjs.admin_code_examples_default; }
8353
+ get: function () { return chunkHVTSE2SF_cjs.admin_code_examples_default; }
8342
8354
  });
8343
8355
  Object.defineProperty(exports, "adminCollectionsRoutes", {
8344
8356
  enumerable: true,
8345
- get: function () { return chunkZV6ZCJ74_cjs.adminCollectionsRoutes; }
8357
+ get: function () { return chunkHVTSE2SF_cjs.adminCollectionsRoutes; }
8346
8358
  });
8347
8359
  Object.defineProperty(exports, "adminContentRoutes", {
8348
8360
  enumerable: true,
8349
- get: function () { return chunkZV6ZCJ74_cjs.admin_content_default; }
8361
+ get: function () { return chunkHVTSE2SF_cjs.admin_content_default; }
8350
8362
  });
8351
8363
  Object.defineProperty(exports, "adminDashboardRoutes", {
8352
8364
  enumerable: true,
8353
- get: function () { return chunkZV6ZCJ74_cjs.router; }
8365
+ get: function () { return chunkHVTSE2SF_cjs.router; }
8354
8366
  });
8355
8367
  Object.defineProperty(exports, "adminDesignRoutes", {
8356
8368
  enumerable: true,
8357
- get: function () { return chunkZV6ZCJ74_cjs.adminDesignRoutes; }
8369
+ get: function () { return chunkHVTSE2SF_cjs.adminDesignRoutes; }
8358
8370
  });
8359
8371
  Object.defineProperty(exports, "adminLogsRoutes", {
8360
8372
  enumerable: true,
8361
- get: function () { return chunkZV6ZCJ74_cjs.adminLogsRoutes; }
8373
+ get: function () { return chunkHVTSE2SF_cjs.adminLogsRoutes; }
8362
8374
  });
8363
8375
  Object.defineProperty(exports, "adminMediaRoutes", {
8364
8376
  enumerable: true,
8365
- get: function () { return chunkZV6ZCJ74_cjs.adminMediaRoutes; }
8377
+ get: function () { return chunkHVTSE2SF_cjs.adminMediaRoutes; }
8366
8378
  });
8367
8379
  Object.defineProperty(exports, "adminPluginRoutes", {
8368
8380
  enumerable: true,
8369
- get: function () { return chunkZV6ZCJ74_cjs.adminPluginRoutes; }
8381
+ get: function () { return chunkHVTSE2SF_cjs.adminPluginRoutes; }
8370
8382
  });
8371
8383
  Object.defineProperty(exports, "adminSettingsRoutes", {
8372
8384
  enumerable: true,
8373
- get: function () { return chunkZV6ZCJ74_cjs.adminSettingsRoutes; }
8385
+ get: function () { return chunkHVTSE2SF_cjs.adminSettingsRoutes; }
8374
8386
  });
8375
8387
  Object.defineProperty(exports, "adminTestimonialsRoutes", {
8376
8388
  enumerable: true,
8377
- get: function () { return chunkZV6ZCJ74_cjs.admin_testimonials_default; }
8389
+ get: function () { return chunkHVTSE2SF_cjs.admin_testimonials_default; }
8378
8390
  });
8379
8391
  Object.defineProperty(exports, "adminUsersRoutes", {
8380
8392
  enumerable: true,
8381
- get: function () { return chunkZV6ZCJ74_cjs.userRoutes; }
8393
+ get: function () { return chunkHVTSE2SF_cjs.userRoutes; }
8382
8394
  });
8383
8395
  Object.defineProperty(exports, "apiContentCrudRoutes", {
8384
8396
  enumerable: true,
8385
- get: function () { return chunkZV6ZCJ74_cjs.api_content_crud_default; }
8397
+ get: function () { return chunkHVTSE2SF_cjs.api_content_crud_default; }
8386
8398
  });
8387
8399
  Object.defineProperty(exports, "apiMediaRoutes", {
8388
8400
  enumerable: true,
8389
- get: function () { return chunkZV6ZCJ74_cjs.api_media_default; }
8401
+ get: function () { return chunkHVTSE2SF_cjs.api_media_default; }
8390
8402
  });
8391
8403
  Object.defineProperty(exports, "apiRoutes", {
8392
8404
  enumerable: true,
8393
- get: function () { return chunkZV6ZCJ74_cjs.api_default; }
8405
+ get: function () { return chunkHVTSE2SF_cjs.api_default; }
8394
8406
  });
8395
8407
  Object.defineProperty(exports, "apiSystemRoutes", {
8396
8408
  enumerable: true,
8397
- get: function () { return chunkZV6ZCJ74_cjs.api_system_default; }
8409
+ get: function () { return chunkHVTSE2SF_cjs.api_system_default; }
8398
8410
  });
8399
8411
  Object.defineProperty(exports, "authRoutes", {
8400
8412
  enumerable: true,
8401
- get: function () { return chunkZV6ZCJ74_cjs.auth_default; }
8413
+ get: function () { return chunkHVTSE2SF_cjs.auth_default; }
8402
8414
  });
8403
8415
  Object.defineProperty(exports, "createUserProfilesPlugin", {
8404
8416
  enumerable: true,
8405
- get: function () { return chunkZV6ZCJ74_cjs.createUserProfilesPlugin; }
8417
+ get: function () { return chunkHVTSE2SF_cjs.createUserProfilesPlugin; }
8406
8418
  });
8407
8419
  Object.defineProperty(exports, "defineUserProfile", {
8408
8420
  enumerable: true,
8409
- get: function () { return chunkZV6ZCJ74_cjs.defineUserProfile; }
8421
+ get: function () { return chunkHVTSE2SF_cjs.defineUserProfile; }
8410
8422
  });
8411
8423
  Object.defineProperty(exports, "getUserProfileConfig", {
8412
8424
  enumerable: true,
8413
- get: function () { return chunkZV6ZCJ74_cjs.getUserProfileConfig; }
8425
+ get: function () { return chunkHVTSE2SF_cjs.getUserProfileConfig; }
8414
8426
  });
8415
8427
  Object.defineProperty(exports, "userProfilesPlugin", {
8416
8428
  enumerable: true,
8417
- get: function () { return chunkZV6ZCJ74_cjs.userProfilesPlugin; }
8429
+ get: function () { return chunkHVTSE2SF_cjs.userProfilesPlugin; }
8418
8430
  });
8419
8431
  Object.defineProperty(exports, "Logger", {
8420
8432
  enumerable: true,
@@ -8582,83 +8594,83 @@ Object.defineProperty(exports, "workflowHistory", {
8582
8594
  });
8583
8595
  Object.defineProperty(exports, "AuthManager", {
8584
8596
  enumerable: true,
8585
- get: function () { return chunkVHNTCB2X_cjs.AuthManager; }
8597
+ get: function () { return chunkEGUDIX6Q_cjs.AuthManager; }
8586
8598
  });
8587
8599
  Object.defineProperty(exports, "PermissionManager", {
8588
8600
  enumerable: true,
8589
- get: function () { return chunkVHNTCB2X_cjs.PermissionManager; }
8601
+ get: function () { return chunkEGUDIX6Q_cjs.PermissionManager; }
8590
8602
  });
8591
8603
  Object.defineProperty(exports, "bootstrapMiddleware", {
8592
8604
  enumerable: true,
8593
- get: function () { return chunkVHNTCB2X_cjs.bootstrapMiddleware; }
8605
+ get: function () { return chunkEGUDIX6Q_cjs.bootstrapMiddleware; }
8594
8606
  });
8595
8607
  Object.defineProperty(exports, "cacheHeaders", {
8596
8608
  enumerable: true,
8597
- get: function () { return chunkVHNTCB2X_cjs.cacheHeaders; }
8609
+ get: function () { return chunkEGUDIX6Q_cjs.cacheHeaders; }
8598
8610
  });
8599
8611
  Object.defineProperty(exports, "compressionMiddleware", {
8600
8612
  enumerable: true,
8601
- get: function () { return chunkVHNTCB2X_cjs.compressionMiddleware; }
8613
+ get: function () { return chunkEGUDIX6Q_cjs.compressionMiddleware; }
8602
8614
  });
8603
8615
  Object.defineProperty(exports, "detailedLoggingMiddleware", {
8604
8616
  enumerable: true,
8605
- get: function () { return chunkVHNTCB2X_cjs.detailedLoggingMiddleware; }
8617
+ get: function () { return chunkEGUDIX6Q_cjs.detailedLoggingMiddleware; }
8606
8618
  });
8607
8619
  Object.defineProperty(exports, "getActivePlugins", {
8608
8620
  enumerable: true,
8609
- get: function () { return chunkVHNTCB2X_cjs.getActivePlugins; }
8621
+ get: function () { return chunkEGUDIX6Q_cjs.getActivePlugins; }
8610
8622
  });
8611
8623
  Object.defineProperty(exports, "isPluginActive", {
8612
8624
  enumerable: true,
8613
- get: function () { return chunkVHNTCB2X_cjs.isPluginActive; }
8625
+ get: function () { return chunkEGUDIX6Q_cjs.isPluginActive; }
8614
8626
  });
8615
8627
  Object.defineProperty(exports, "logActivity", {
8616
8628
  enumerable: true,
8617
- get: function () { return chunkVHNTCB2X_cjs.logActivity; }
8629
+ get: function () { return chunkEGUDIX6Q_cjs.logActivity; }
8618
8630
  });
8619
8631
  Object.defineProperty(exports, "loggingMiddleware", {
8620
8632
  enumerable: true,
8621
- get: function () { return chunkVHNTCB2X_cjs.loggingMiddleware; }
8633
+ get: function () { return chunkEGUDIX6Q_cjs.loggingMiddleware; }
8622
8634
  });
8623
8635
  Object.defineProperty(exports, "optionalAuth", {
8624
8636
  enumerable: true,
8625
- get: function () { return chunkVHNTCB2X_cjs.optionalAuth; }
8637
+ get: function () { return chunkEGUDIX6Q_cjs.optionalAuth; }
8626
8638
  });
8627
8639
  Object.defineProperty(exports, "performanceLoggingMiddleware", {
8628
8640
  enumerable: true,
8629
- get: function () { return chunkVHNTCB2X_cjs.performanceLoggingMiddleware; }
8641
+ get: function () { return chunkEGUDIX6Q_cjs.performanceLoggingMiddleware; }
8630
8642
  });
8631
8643
  Object.defineProperty(exports, "requireActivePlugin", {
8632
8644
  enumerable: true,
8633
- get: function () { return chunkVHNTCB2X_cjs.requireActivePlugin; }
8645
+ get: function () { return chunkEGUDIX6Q_cjs.requireActivePlugin; }
8634
8646
  });
8635
8647
  Object.defineProperty(exports, "requireActivePlugins", {
8636
8648
  enumerable: true,
8637
- get: function () { return chunkVHNTCB2X_cjs.requireActivePlugins; }
8649
+ get: function () { return chunkEGUDIX6Q_cjs.requireActivePlugins; }
8638
8650
  });
8639
8651
  Object.defineProperty(exports, "requireAnyPermission", {
8640
8652
  enumerable: true,
8641
- get: function () { return chunkVHNTCB2X_cjs.requireAnyPermission; }
8653
+ get: function () { return chunkEGUDIX6Q_cjs.requireAnyPermission; }
8642
8654
  });
8643
8655
  Object.defineProperty(exports, "requireAuth", {
8644
8656
  enumerable: true,
8645
- get: function () { return chunkVHNTCB2X_cjs.requireAuth; }
8657
+ get: function () { return chunkEGUDIX6Q_cjs.requireAuth; }
8646
8658
  });
8647
8659
  Object.defineProperty(exports, "requirePermission", {
8648
8660
  enumerable: true,
8649
- get: function () { return chunkVHNTCB2X_cjs.requirePermission; }
8661
+ get: function () { return chunkEGUDIX6Q_cjs.requirePermission; }
8650
8662
  });
8651
8663
  Object.defineProperty(exports, "requireRole", {
8652
8664
  enumerable: true,
8653
- get: function () { return chunkVHNTCB2X_cjs.requireRole; }
8665
+ get: function () { return chunkEGUDIX6Q_cjs.requireRole; }
8654
8666
  });
8655
8667
  Object.defineProperty(exports, "securityHeaders", {
8656
8668
  enumerable: true,
8657
- get: function () { return chunkVHNTCB2X_cjs.securityHeadersMiddleware; }
8669
+ get: function () { return chunkEGUDIX6Q_cjs.securityHeadersMiddleware; }
8658
8670
  });
8659
8671
  Object.defineProperty(exports, "securityLoggingMiddleware", {
8660
8672
  enumerable: true,
8661
- get: function () { return chunkVHNTCB2X_cjs.securityLoggingMiddleware; }
8673
+ get: function () { return chunkEGUDIX6Q_cjs.securityLoggingMiddleware; }
8662
8674
  });
8663
8675
  Object.defineProperty(exports, "PluginBootstrapService", {
8664
8676
  enumerable: true,
@@ -8742,39 +8754,39 @@ Object.defineProperty(exports, "validateCollectionConfig", {
8742
8754
  });
8743
8755
  Object.defineProperty(exports, "MigrationService", {
8744
8756
  enumerable: true,
8745
- get: function () { return chunkAG3SIPP7_cjs.MigrationService; }
8757
+ get: function () { return chunkSER23XI4_cjs.MigrationService; }
8746
8758
  });
8747
8759
  Object.defineProperty(exports, "renderFilterBar", {
8748
8760
  enumerable: true,
8749
- get: function () { return chunkRBXFXT7H_cjs.renderFilterBar; }
8761
+ get: function () { return chunk3QCEYJLK_cjs.renderFilterBar; }
8750
8762
  });
8751
8763
  Object.defineProperty(exports, "getConfirmationDialogScript", {
8752
8764
  enumerable: true,
8753
- get: function () { return chunkH4NHRZ6Y_cjs.getConfirmationDialogScript; }
8765
+ get: function () { return chunkQP3OHHON_cjs.getConfirmationDialogScript; }
8754
8766
  });
8755
8767
  Object.defineProperty(exports, "renderAlert", {
8756
8768
  enumerable: true,
8757
- get: function () { return chunkH4NHRZ6Y_cjs.renderAlert; }
8769
+ get: function () { return chunkQP3OHHON_cjs.renderAlert; }
8758
8770
  });
8759
8771
  Object.defineProperty(exports, "renderConfirmationDialog", {
8760
8772
  enumerable: true,
8761
- get: function () { return chunkH4NHRZ6Y_cjs.renderConfirmationDialog; }
8773
+ get: function () { return chunkQP3OHHON_cjs.renderConfirmationDialog; }
8762
8774
  });
8763
8775
  Object.defineProperty(exports, "renderForm", {
8764
8776
  enumerable: true,
8765
- get: function () { return chunkH4NHRZ6Y_cjs.renderForm; }
8777
+ get: function () { return chunkQP3OHHON_cjs.renderForm; }
8766
8778
  });
8767
8779
  Object.defineProperty(exports, "renderFormField", {
8768
8780
  enumerable: true,
8769
- get: function () { return chunkH4NHRZ6Y_cjs.renderFormField; }
8781
+ get: function () { return chunkQP3OHHON_cjs.renderFormField; }
8770
8782
  });
8771
8783
  Object.defineProperty(exports, "renderPagination", {
8772
8784
  enumerable: true,
8773
- get: function () { return chunkH4NHRZ6Y_cjs.renderPagination; }
8785
+ get: function () { return chunkQP3OHHON_cjs.renderPagination; }
8774
8786
  });
8775
8787
  Object.defineProperty(exports, "renderTable", {
8776
8788
  enumerable: true,
8777
- get: function () { return chunkH4NHRZ6Y_cjs.renderTable; }
8789
+ get: function () { return chunkQP3OHHON_cjs.renderTable; }
8778
8790
  });
8779
8791
  Object.defineProperty(exports, "HookSystemImpl", {
8780
8792
  enumerable: true,
@@ -8810,31 +8822,31 @@ Object.defineProperty(exports, "PluginHelpers", {
8810
8822
  });
8811
8823
  Object.defineProperty(exports, "QueryFilterBuilder", {
8812
8824
  enumerable: true,
8813
- get: function () { return chunkRXNLGINR_cjs.QueryFilterBuilder; }
8825
+ get: function () { return chunkXCP5GCBE_cjs.QueryFilterBuilder; }
8814
8826
  });
8815
8827
  Object.defineProperty(exports, "SONICJS_VERSION", {
8816
8828
  enumerable: true,
8817
- get: function () { return chunkRXNLGINR_cjs.SONICJS_VERSION; }
8829
+ get: function () { return chunkXCP5GCBE_cjs.SONICJS_VERSION; }
8818
8830
  });
8819
8831
  Object.defineProperty(exports, "TemplateRenderer", {
8820
8832
  enumerable: true,
8821
- get: function () { return chunkRXNLGINR_cjs.TemplateRenderer; }
8833
+ get: function () { return chunkXCP5GCBE_cjs.TemplateRenderer; }
8822
8834
  });
8823
8835
  Object.defineProperty(exports, "buildQuery", {
8824
8836
  enumerable: true,
8825
- get: function () { return chunkRXNLGINR_cjs.buildQuery; }
8837
+ get: function () { return chunkXCP5GCBE_cjs.buildQuery; }
8826
8838
  });
8827
8839
  Object.defineProperty(exports, "getCoreVersion", {
8828
8840
  enumerable: true,
8829
- get: function () { return chunkRXNLGINR_cjs.getCoreVersion; }
8841
+ get: function () { return chunkXCP5GCBE_cjs.getCoreVersion; }
8830
8842
  });
8831
8843
  Object.defineProperty(exports, "renderTemplate", {
8832
8844
  enumerable: true,
8833
- get: function () { return chunkRXNLGINR_cjs.renderTemplate; }
8845
+ get: function () { return chunkXCP5GCBE_cjs.renderTemplate; }
8834
8846
  });
8835
8847
  Object.defineProperty(exports, "templateRenderer", {
8836
8848
  enumerable: true,
8837
- get: function () { return chunkRXNLGINR_cjs.templateRenderer; }
8849
+ get: function () { return chunkXCP5GCBE_cjs.templateRenderer; }
8838
8850
  });
8839
8851
  Object.defineProperty(exports, "metricsTracker", {
8840
8852
  enumerable: true,