@sonicjs-cms/core 2.10.0 → 2.11.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 (82) hide show
  1. package/dist/{chunk-CJYFSKH7.js → chunk-2MXF4RYZ.js} +3 -3
  2. package/dist/{chunk-CJYFSKH7.js.map → chunk-2MXF4RYZ.js.map} +1 -1
  3. package/dist/{chunk-MNFY6DWY.cjs → chunk-56GUBLJE.cjs} +7 -7
  4. package/dist/{chunk-MNFY6DWY.cjs.map → chunk-56GUBLJE.cjs.map} +1 -1
  5. package/dist/{chunk-IIBRG5S5.cjs → chunk-6BVLPACH.cjs} +408 -2
  6. package/dist/chunk-6BVLPACH.cjs.map +1 -0
  7. package/dist/{chunk-RCA6R6VE.cjs → chunk-ASAEJ4B7.cjs} +315 -162
  8. package/dist/chunk-ASAEJ4B7.cjs.map +1 -0
  9. package/dist/{chunk-IT2TC4ZD.cjs → chunk-B2ASV5RD.cjs} +13 -7
  10. package/dist/chunk-B2ASV5RD.cjs.map +1 -0
  11. package/dist/{chunk-IZWNIUJI.js → chunk-BUU2US2Z.js} +3 -3
  12. package/dist/{chunk-IZWNIUJI.js.map → chunk-BUU2US2Z.js.map} +1 -1
  13. package/dist/{chunk-ZMVWMJ3S.cjs → chunk-DE5YTNCD.cjs} +9 -2
  14. package/dist/chunk-DE5YTNCD.cjs.map +1 -0
  15. package/dist/{chunk-4TTMQQC7.js → chunk-GKRGDJGG.js} +10 -4
  16. package/dist/chunk-GKRGDJGG.js.map +1 -0
  17. package/dist/{chunk-6O3RJV3C.js → chunk-H55AYIRI.js} +9 -2
  18. package/dist/chunk-H55AYIRI.js.map +1 -0
  19. package/dist/{chunk-JTNUM7JE.js → chunk-JTQBNSZX.js} +187 -34
  20. package/dist/chunk-JTQBNSZX.js.map +1 -0
  21. package/dist/{chunk-64APW3DW.cjs → chunk-LFAQUR7P.cjs} +9 -2
  22. package/dist/chunk-LFAQUR7P.cjs.map +1 -0
  23. package/dist/{chunk-27AOVQTR.js → chunk-NMLFKXWW.js} +402 -3
  24. package/dist/chunk-NMLFKXWW.js.map +1 -0
  25. package/dist/{chunk-EKPLKUZT.cjs → chunk-QLPFENZ2.cjs} +3 -3
  26. package/dist/{chunk-EKPLKUZT.cjs.map → chunk-QLPFENZ2.cjs.map} +1 -1
  27. package/dist/{chunk-KYGRJCZM.cjs → chunk-QTFKZBLC.cjs} +3 -2
  28. package/dist/chunk-QTFKZBLC.cjs.map +1 -0
  29. package/dist/{chunk-LOUJRBXV.js → chunk-QXOZI5Q2.js} +3 -2
  30. package/dist/chunk-QXOZI5Q2.js.map +1 -0
  31. package/dist/{chunk-7JMMLHPQ.js → chunk-VJCLJH3X.js} +9 -2
  32. package/dist/chunk-VJCLJH3X.js.map +1 -0
  33. package/dist/index.cjs +751 -152
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.cts +125 -5
  36. package/dist/index.d.ts +125 -5
  37. package/dist/index.js +582 -15
  38. package/dist/index.js.map +1 -1
  39. package/dist/middleware.cjs +29 -29
  40. package/dist/middleware.js +3 -3
  41. package/dist/migrations-UFVJTPVT.js +4 -0
  42. package/dist/{migrations-N2C2VPJU.js.map → migrations-UFVJTPVT.js.map} +1 -1
  43. package/dist/migrations-VNYOSUNE.cjs +13 -0
  44. package/dist/{migrations-ONIAY6GK.cjs.map → migrations-VNYOSUNE.cjs.map} +1 -1
  45. package/dist/{plugin-0Xogrln-.d.cts → plugin-DDYetMF-.d.cts} +1 -0
  46. package/dist/{plugin-0Xogrln-.d.ts → plugin-DDYetMF-.d.ts} +1 -0
  47. package/dist/{plugin-bootstrap-fpG98Otb.d.cts → plugin-bootstrap-DCXpeQVb.d.cts} +229 -1
  48. package/dist/{plugin-bootstrap-WmpvYM5w.d.ts → plugin-bootstrap-DXBAYaqM.d.ts} +229 -1
  49. package/dist/{plugin-manager-GcIeb226.d.cts → plugin-manager-BoM3Q7o7.d.cts} +1 -1
  50. package/dist/{plugin-manager-Clf2gXwj.d.ts → plugin-manager-Efx9RyDX.d.ts} +1 -1
  51. package/dist/plugins.cjs +10 -10
  52. package/dist/plugins.d.cts +2 -2
  53. package/dist/plugins.d.ts +2 -2
  54. package/dist/plugins.js +2 -2
  55. package/dist/routes.cjs +29 -29
  56. package/dist/routes.js +6 -6
  57. package/dist/services.cjs +60 -32
  58. package/dist/services.d.cts +1 -1
  59. package/dist/services.d.ts +1 -1
  60. package/dist/services.js +3 -3
  61. package/dist/types.cjs +2 -2
  62. package/dist/types.d.cts +1 -1
  63. package/dist/types.d.ts +1 -1
  64. package/dist/types.js +1 -1
  65. package/dist/utils.cjs +11 -11
  66. package/dist/utils.js +1 -1
  67. package/migrations/033_form_content_integration.sql +19 -0
  68. package/package.json +1 -1
  69. package/dist/chunk-27AOVQTR.js.map +0 -1
  70. package/dist/chunk-4TTMQQC7.js.map +0 -1
  71. package/dist/chunk-64APW3DW.cjs.map +0 -1
  72. package/dist/chunk-6O3RJV3C.js.map +0 -1
  73. package/dist/chunk-7JMMLHPQ.js.map +0 -1
  74. package/dist/chunk-IIBRG5S5.cjs.map +0 -1
  75. package/dist/chunk-IT2TC4ZD.cjs.map +0 -1
  76. package/dist/chunk-JTNUM7JE.js.map +0 -1
  77. package/dist/chunk-KYGRJCZM.cjs.map +0 -1
  78. package/dist/chunk-LOUJRBXV.js.map +0 -1
  79. package/dist/chunk-RCA6R6VE.cjs.map +0 -1
  80. package/dist/chunk-ZMVWMJ3S.cjs.map +0 -1
  81. package/dist/migrations-N2C2VPJU.js +0 -4
  82. package/dist/migrations-ONIAY6GK.cjs +0 -13
package/dist/index.cjs CHANGED
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
 
3
- var chunkRCA6R6VE_cjs = require('./chunk-RCA6R6VE.cjs');
4
- var chunk64APW3DW_cjs = require('./chunk-64APW3DW.cjs');
5
- var chunkIT2TC4ZD_cjs = require('./chunk-IT2TC4ZD.cjs');
6
- var chunkIIBRG5S5_cjs = require('./chunk-IIBRG5S5.cjs');
7
- var chunkZMVWMJ3S_cjs = require('./chunk-ZMVWMJ3S.cjs');
3
+ var chunkASAEJ4B7_cjs = require('./chunk-ASAEJ4B7.cjs');
4
+ var chunkLFAQUR7P_cjs = require('./chunk-LFAQUR7P.cjs');
5
+ var chunkB2ASV5RD_cjs = require('./chunk-B2ASV5RD.cjs');
6
+ var chunk6BVLPACH_cjs = require('./chunk-6BVLPACH.cjs');
7
+ var chunkDE5YTNCD_cjs = require('./chunk-DE5YTNCD.cjs');
8
8
  var chunk3G7XX4UI_cjs = require('./chunk-3G7XX4UI.cjs');
9
9
  var chunkLTKV7AE5_cjs = require('./chunk-LTKV7AE5.cjs');
10
- var chunkMNFY6DWY_cjs = require('./chunk-MNFY6DWY.cjs');
10
+ var chunk56GUBLJE_cjs = require('./chunk-56GUBLJE.cjs');
11
11
  var chunk6FHNRRJ3_cjs = require('./chunk-6FHNRRJ3.cjs');
12
- var chunkEKPLKUZT_cjs = require('./chunk-EKPLKUZT.cjs');
12
+ var chunkQLPFENZ2_cjs = require('./chunk-QLPFENZ2.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');
16
- var chunkKYGRJCZM_cjs = require('./chunk-KYGRJCZM.cjs');
16
+ var chunkQTFKZBLC_cjs = require('./chunk-QTFKZBLC.cjs');
17
17
  require('./chunk-IGJUBJBW.cjs');
18
18
  var hono = require('hono');
19
19
  var cookie = require('hono/cookie');
@@ -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("*", chunkIT2TC4ZD_cjs.requireAuth());
562
+ router3.use("*", chunkB2ASV5RD_cjs.requireAuth());
563
563
  router3.get("/api/stats", async (c) => {
564
564
  try {
565
565
  const user = c.get("user");
@@ -1776,7 +1776,7 @@ function createOTPLoginPlugin() {
1776
1776
  console.warn("Failed to parse OTP plugin settings, using defaults");
1777
1777
  }
1778
1778
  }
1779
- const settingsService = new chunk64APW3DW_cjs.SettingsService(db);
1779
+ const settingsService = new chunkLFAQUR7P_cjs.SettingsService(db);
1780
1780
  const generalSettings = await settingsService.getGeneralSettings();
1781
1781
  const siteName = generalSettings.siteName;
1782
1782
  const canRequest = await otpService.checkRateLimit(normalizedEmail, settings);
@@ -1822,7 +1822,8 @@ function createOTPLoginPlugin() {
1822
1822
  email: normalizedEmail,
1823
1823
  ipAddress,
1824
1824
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1825
- appName: siteName
1825
+ appName: siteName,
1826
+ logoUrl: settings.logoUrl || ""
1826
1827
  });
1827
1828
  const emailPlugin2 = await db.prepare(`
1828
1829
  SELECT settings FROM plugins WHERE id = 'email'
@@ -1925,7 +1926,7 @@ function createOTPLoginPlugin() {
1925
1926
  error: "Account is deactivated"
1926
1927
  }, 403);
1927
1928
  }
1928
- const token = await chunkIT2TC4ZD_cjs.AuthManager.generateToken(user.id, user.email, user.role, c.env.JWT_SECRET);
1929
+ const token = await chunkB2ASV5RD_cjs.AuthManager.generateToken(user.id, user.email, user.role, c.env.JWT_SECRET);
1929
1930
  cookie.setCookie(c, "auth_token", token, {
1930
1931
  httpOnly: true,
1931
1932
  secure: true,
@@ -1997,6 +1998,567 @@ function createOTPLoginPlugin() {
1997
1998
  }
1998
1999
  var otpLoginPlugin = createOTPLoginPlugin();
1999
2000
 
2001
+ // src/plugins/core-plugins/oauth-providers/oauth-service.ts
2002
+ var GITHUB_PROVIDER = {
2003
+ id: "github",
2004
+ name: "GitHub",
2005
+ authorizeUrl: "https://github.com/login/oauth/authorize",
2006
+ tokenUrl: "https://github.com/login/oauth/access_token",
2007
+ userInfoUrl: "https://api.github.com/user",
2008
+ scopes: ["read:user", "user:email"],
2009
+ mapProfile: (profile) => ({
2010
+ providerAccountId: String(profile.id),
2011
+ email: profile.email || "",
2012
+ name: profile.name || profile.login || "",
2013
+ avatar: profile.avatar_url || void 0
2014
+ })
2015
+ };
2016
+ var GOOGLE_PROVIDER = {
2017
+ id: "google",
2018
+ name: "Google",
2019
+ authorizeUrl: "https://accounts.google.com/o/oauth2/v2/auth",
2020
+ tokenUrl: "https://oauth2.googleapis.com/token",
2021
+ userInfoUrl: "https://www.googleapis.com/oauth2/v2/userinfo",
2022
+ scopes: ["openid", "email", "profile"],
2023
+ mapProfile: (profile) => ({
2024
+ providerAccountId: String(profile.id),
2025
+ email: profile.email || "",
2026
+ name: profile.name || "",
2027
+ avatar: profile.picture || void 0
2028
+ })
2029
+ };
2030
+ var BUILT_IN_PROVIDERS = {
2031
+ github: GITHUB_PROVIDER,
2032
+ google: GOOGLE_PROVIDER
2033
+ };
2034
+ var OAuthService = class {
2035
+ constructor(db) {
2036
+ this.db = db;
2037
+ }
2038
+ /**
2039
+ * Build the authorization redirect URL for a provider.
2040
+ */
2041
+ buildAuthorizeUrl(provider, clientId, redirectUri, state) {
2042
+ const params = new URLSearchParams({
2043
+ client_id: clientId,
2044
+ redirect_uri: redirectUri,
2045
+ response_type: "code",
2046
+ scope: provider.scopes.join(" "),
2047
+ state
2048
+ });
2049
+ if (provider.id === "google") {
2050
+ params.set("access_type", "offline");
2051
+ params.set("prompt", "consent");
2052
+ }
2053
+ return `${provider.authorizeUrl}?${params.toString()}`;
2054
+ }
2055
+ /**
2056
+ * Exchange authorization code for tokens using native fetch.
2057
+ */
2058
+ async exchangeCode(provider, clientId, clientSecret, code, redirectUri) {
2059
+ const body = {
2060
+ client_id: clientId,
2061
+ client_secret: clientSecret,
2062
+ code,
2063
+ redirect_uri: redirectUri,
2064
+ grant_type: "authorization_code"
2065
+ };
2066
+ const response = await fetch(provider.tokenUrl, {
2067
+ method: "POST",
2068
+ headers: {
2069
+ "Content-Type": "application/x-www-form-urlencoded",
2070
+ "Accept": "application/json"
2071
+ },
2072
+ body: new URLSearchParams(body).toString()
2073
+ });
2074
+ if (!response.ok) {
2075
+ const errorText = await response.text();
2076
+ throw new Error(`Token exchange failed (${response.status}): ${errorText}`);
2077
+ }
2078
+ const data = await response.json();
2079
+ if (data.error) {
2080
+ throw new Error(`Token exchange error: ${data.error_description || data.error}`);
2081
+ }
2082
+ return {
2083
+ access_token: data.access_token,
2084
+ refresh_token: data.refresh_token,
2085
+ expires_in: data.expires_in ? Number(data.expires_in) : void 0
2086
+ };
2087
+ }
2088
+ /**
2089
+ * Fetch user profile from the provider's userinfo endpoint.
2090
+ */
2091
+ async fetchUserProfile(provider, accessToken) {
2092
+ const headers = {
2093
+ "Authorization": `Bearer ${accessToken}`,
2094
+ "Accept": "application/json"
2095
+ };
2096
+ if (provider.id === "github") {
2097
+ headers["Authorization"] = `token ${accessToken}`;
2098
+ }
2099
+ const response = await fetch(provider.userInfoUrl, { headers });
2100
+ if (!response.ok) {
2101
+ throw new Error(`Failed to fetch user profile (${response.status})`);
2102
+ }
2103
+ const profile = await response.json();
2104
+ if (provider.id === "github" && !profile.email) {
2105
+ const emailResponse = await fetch("https://api.github.com/user/emails", {
2106
+ headers: {
2107
+ "Authorization": `token ${accessToken}`,
2108
+ "Accept": "application/json"
2109
+ }
2110
+ });
2111
+ if (emailResponse.ok) {
2112
+ const emails = await emailResponse.json();
2113
+ const primaryEmail = emails.find((e) => e.primary && e.verified);
2114
+ if (primaryEmail) {
2115
+ profile.email = primaryEmail.email;
2116
+ }
2117
+ }
2118
+ }
2119
+ return provider.mapProfile(profile);
2120
+ }
2121
+ // ─── Database Operations ────────────────────────────────────────────────
2122
+ /**
2123
+ * Find an existing OAuth account link.
2124
+ */
2125
+ async findOAuthAccount(provider, providerAccountId) {
2126
+ return await this.db.prepare(`
2127
+ SELECT * FROM oauth_accounts
2128
+ WHERE provider = ? AND provider_account_id = ?
2129
+ `).bind(provider, providerAccountId).first();
2130
+ }
2131
+ /**
2132
+ * Find all OAuth accounts for a user.
2133
+ */
2134
+ async findUserOAuthAccounts(userId) {
2135
+ const result = await this.db.prepare(`
2136
+ SELECT * FROM oauth_accounts WHERE user_id = ?
2137
+ `).bind(userId).all();
2138
+ return result.results || [];
2139
+ }
2140
+ /**
2141
+ * Create a new OAuth account link.
2142
+ */
2143
+ async createOAuthAccount(params) {
2144
+ const id = crypto.randomUUID();
2145
+ const now = Date.now();
2146
+ await this.db.prepare(`
2147
+ INSERT INTO oauth_accounts (
2148
+ id, user_id, provider, provider_account_id,
2149
+ access_token, refresh_token, token_expires_at,
2150
+ profile_data, created_at, updated_at
2151
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2152
+ `).bind(
2153
+ id,
2154
+ params.userId,
2155
+ params.provider,
2156
+ params.providerAccountId,
2157
+ params.accessToken,
2158
+ params.refreshToken || null,
2159
+ params.tokenExpiresAt || null,
2160
+ params.profileData || null,
2161
+ now,
2162
+ now
2163
+ ).run();
2164
+ return {
2165
+ id,
2166
+ user_id: params.userId,
2167
+ provider: params.provider,
2168
+ provider_account_id: params.providerAccountId,
2169
+ access_token: params.accessToken,
2170
+ refresh_token: params.refreshToken || null,
2171
+ token_expires_at: params.tokenExpiresAt || null,
2172
+ profile_data: params.profileData || null,
2173
+ created_at: now,
2174
+ updated_at: now
2175
+ };
2176
+ }
2177
+ /**
2178
+ * Update tokens for an existing OAuth account.
2179
+ */
2180
+ async updateOAuthTokens(id, accessToken, refreshToken, tokenExpiresAt) {
2181
+ await this.db.prepare(`
2182
+ UPDATE oauth_accounts
2183
+ SET access_token = ?, refresh_token = ?, token_expires_at = ?, updated_at = ?
2184
+ WHERE id = ?
2185
+ `).bind(accessToken, refreshToken || null, tokenExpiresAt || null, Date.now(), id).run();
2186
+ }
2187
+ /**
2188
+ * Unlink an OAuth account from a user (only if they have another auth method).
2189
+ */
2190
+ async unlinkOAuthAccount(userId, provider) {
2191
+ const user = await this.db.prepare(`
2192
+ SELECT password_hash FROM users WHERE id = ?
2193
+ `).bind(userId).first();
2194
+ const otherLinks = await this.db.prepare(`
2195
+ SELECT COUNT(*) as count FROM oauth_accounts
2196
+ WHERE user_id = ? AND provider != ?
2197
+ `).bind(userId, provider).first();
2198
+ const hasPassword = !!user?.password_hash;
2199
+ const hasOtherLinks = (otherLinks?.count || 0) > 0;
2200
+ if (!hasPassword && !hasOtherLinks) {
2201
+ return false;
2202
+ }
2203
+ await this.db.prepare(`
2204
+ DELETE FROM oauth_accounts WHERE user_id = ? AND provider = ?
2205
+ `).bind(userId, provider).run();
2206
+ return true;
2207
+ }
2208
+ /**
2209
+ * Find a user by email.
2210
+ */
2211
+ async findUserByEmail(email) {
2212
+ return await this.db.prepare(`
2213
+ SELECT id, email, role, is_active, first_name, last_name
2214
+ FROM users WHERE email = ?
2215
+ `).bind(email.toLowerCase()).first();
2216
+ }
2217
+ /**
2218
+ * Create a new user from an OAuth profile.
2219
+ */
2220
+ async createUserFromOAuth(profile) {
2221
+ const id = crypto.randomUUID();
2222
+ const now = Date.now();
2223
+ const email = profile.email.toLowerCase();
2224
+ const nameParts = (profile.name || email.split("@")[0] || "User").split(" ");
2225
+ const firstName = nameParts[0] || "User";
2226
+ const lastName = nameParts.slice(1).join(" ") || "";
2227
+ const username = email.split("@")[0] || id.substring(0, 8);
2228
+ const existing = await this.db.prepare(
2229
+ "SELECT id FROM users WHERE username = ?"
2230
+ ).bind(username).first();
2231
+ const finalUsername = existing ? `${username}-${id.substring(0, 6)}` : username;
2232
+ await this.db.prepare(`
2233
+ INSERT INTO users (
2234
+ id, email, username, first_name, last_name,
2235
+ password_hash, role, avatar, is_active, created_at, updated_at
2236
+ ) VALUES (?, ?, ?, ?, ?, NULL, 'viewer', ?, 1, ?, ?)
2237
+ `).bind(
2238
+ id,
2239
+ email,
2240
+ finalUsername,
2241
+ firstName,
2242
+ lastName,
2243
+ profile.avatar || null,
2244
+ now,
2245
+ now
2246
+ ).run();
2247
+ return id;
2248
+ }
2249
+ /**
2250
+ * Generate a cryptographically random state parameter for CSRF protection.
2251
+ */
2252
+ generateState() {
2253
+ const bytes = new Uint8Array(32);
2254
+ crypto.getRandomValues(bytes);
2255
+ return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
2256
+ }
2257
+ };
2258
+
2259
+ // src/plugins/core-plugins/oauth-providers/index.ts
2260
+ var STATE_COOKIE_NAME = "oauth_state";
2261
+ var STATE_COOKIE_MAX_AGE = 600;
2262
+ function createOAuthProvidersPlugin() {
2263
+ const builder = chunk6FHNRRJ3_cjs.PluginBuilder.create({
2264
+ name: "oauth-providers",
2265
+ version: "1.0.0-beta.1",
2266
+ description: "OAuth2/OIDC social login with GitHub, Google, and more"
2267
+ });
2268
+ builder.metadata({
2269
+ author: {
2270
+ name: "SonicJS Team",
2271
+ email: "team@sonicjs.com"
2272
+ },
2273
+ license: "MIT",
2274
+ compatibility: "^2.0.0"
2275
+ });
2276
+ function getCallbackUrl(c, provider) {
2277
+ const proto = c.req.header("x-forwarded-proto") || "https";
2278
+ const host = c.req.header("host") || "localhost";
2279
+ return `${proto}://${host}/auth/oauth/${provider}/callback`;
2280
+ }
2281
+ async function loadSettings(db) {
2282
+ const row = await db.prepare(
2283
+ `SELECT settings FROM plugins WHERE id = 'oauth-providers'`
2284
+ ).first();
2285
+ if (!row?.settings) return null;
2286
+ try {
2287
+ return JSON.parse(row.settings);
2288
+ } catch {
2289
+ return null;
2290
+ }
2291
+ }
2292
+ function getProviderCredentials(settings, providerId) {
2293
+ if (!settings?.providers?.[providerId]) return null;
2294
+ const p = settings.providers[providerId];
2295
+ if (!p.enabled || !p.clientId || !p.clientSecret) return null;
2296
+ return { clientId: p.clientId, clientSecret: p.clientSecret };
2297
+ }
2298
+ const oauthAPI = new hono.Hono();
2299
+ oauthAPI.get("/:provider", async (c) => {
2300
+ try {
2301
+ const providerId = c.req.param("provider");
2302
+ const providerConfig = BUILT_IN_PROVIDERS[providerId];
2303
+ if (!providerConfig) {
2304
+ return c.json({ error: `Unknown OAuth provider: ${providerId}` }, 400);
2305
+ }
2306
+ const db = c.env.DB;
2307
+ const settings = await loadSettings(db);
2308
+ const creds = getProviderCredentials(settings, providerId);
2309
+ if (!creds) {
2310
+ return c.json({
2311
+ error: `OAuth provider "${providerId}" is not configured or not enabled`
2312
+ }, 400);
2313
+ }
2314
+ const oauthService = new OAuthService(db);
2315
+ const state = oauthService.generateState();
2316
+ const redirectUri = getCallbackUrl(c, providerId);
2317
+ cookie.setCookie(c, STATE_COOKIE_NAME, state, {
2318
+ httpOnly: true,
2319
+ secure: true,
2320
+ sameSite: "Lax",
2321
+ // Lax required for OAuth redirect flow
2322
+ maxAge: STATE_COOKIE_MAX_AGE,
2323
+ path: "/auth/oauth"
2324
+ });
2325
+ const authorizeUrl = oauthService.buildAuthorizeUrl(
2326
+ providerConfig,
2327
+ creds.clientId,
2328
+ redirectUri,
2329
+ state
2330
+ );
2331
+ return c.redirect(authorizeUrl);
2332
+ } catch (error) {
2333
+ console.error("OAuth authorize error:", error);
2334
+ return c.json({ error: "Failed to initiate OAuth flow" }, 500);
2335
+ }
2336
+ });
2337
+ oauthAPI.get("/:provider/callback", async (c) => {
2338
+ try {
2339
+ const providerId = c.req.param("provider");
2340
+ const providerConfig = BUILT_IN_PROVIDERS[providerId];
2341
+ if (!providerConfig) {
2342
+ return c.redirect("/auth/login?error=Unknown OAuth provider");
2343
+ }
2344
+ const stateParam = c.req.query("state");
2345
+ const stateCookie = cookie.getCookie(c, STATE_COOKIE_NAME);
2346
+ if (!stateParam || !stateCookie || stateParam !== stateCookie) {
2347
+ return c.redirect("/auth/login?error=Invalid OAuth state. Please try again.");
2348
+ }
2349
+ cookie.setCookie(c, STATE_COOKIE_NAME, "", {
2350
+ httpOnly: true,
2351
+ secure: true,
2352
+ sameSite: "Lax",
2353
+ maxAge: 0,
2354
+ path: "/auth/oauth"
2355
+ });
2356
+ const errorParam = c.req.query("error");
2357
+ if (errorParam) {
2358
+ const errorDesc = c.req.query("error_description") || errorParam;
2359
+ return c.redirect(`/auth/login?error=${encodeURIComponent(errorDesc)}`);
2360
+ }
2361
+ const code = c.req.query("code");
2362
+ if (!code) {
2363
+ return c.redirect("/auth/login?error=No authorization code received");
2364
+ }
2365
+ const db = c.env.DB;
2366
+ const settings = await loadSettings(db);
2367
+ const creds = getProviderCredentials(settings, providerId);
2368
+ if (!creds) {
2369
+ return c.redirect("/auth/login?error=OAuth provider not configured");
2370
+ }
2371
+ const oauthService = new OAuthService(db);
2372
+ const redirectUri = getCallbackUrl(c, providerId);
2373
+ const tokens = await oauthService.exchangeCode(
2374
+ providerConfig,
2375
+ creds.clientId,
2376
+ creds.clientSecret,
2377
+ code,
2378
+ redirectUri
2379
+ );
2380
+ const profile = await oauthService.fetchUserProfile(providerConfig, tokens.access_token);
2381
+ if (!profile.email) {
2382
+ return c.redirect("/auth/login?error=Could not retrieve email from OAuth provider. Please ensure your email is public or grant email permission.");
2383
+ }
2384
+ const tokenExpiresAt = tokens.expires_in ? Date.now() + tokens.expires_in * 1e3 : null;
2385
+ const existingOAuth = await oauthService.findOAuthAccount(providerId, profile.providerAccountId);
2386
+ if (existingOAuth) {
2387
+ await oauthService.updateOAuthTokens(
2388
+ existingOAuth.id,
2389
+ tokens.access_token,
2390
+ tokens.refresh_token,
2391
+ tokenExpiresAt ?? void 0
2392
+ );
2393
+ const user = await db.prepare(
2394
+ "SELECT id, email, role, is_active FROM users WHERE id = ?"
2395
+ ).bind(existingOAuth.user_id).first();
2396
+ if (!user || !user.is_active) {
2397
+ return c.redirect("/auth/login?error=Account is deactivated");
2398
+ }
2399
+ const jwt2 = await chunkB2ASV5RD_cjs.AuthManager.generateToken(
2400
+ user.id,
2401
+ user.email,
2402
+ user.role,
2403
+ c.env.JWT_SECRET
2404
+ );
2405
+ chunkB2ASV5RD_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax" });
2406
+ return c.redirect("/admin");
2407
+ }
2408
+ const existingUser = await oauthService.findUserByEmail(profile.email);
2409
+ if (existingUser) {
2410
+ if (!existingUser.is_active) {
2411
+ return c.redirect("/auth/login?error=Account is deactivated");
2412
+ }
2413
+ await oauthService.createOAuthAccount({
2414
+ userId: existingUser.id,
2415
+ provider: providerId,
2416
+ providerAccountId: profile.providerAccountId,
2417
+ accessToken: tokens.access_token,
2418
+ refreshToken: tokens.refresh_token,
2419
+ tokenExpiresAt: tokenExpiresAt ?? void 0,
2420
+ profileData: JSON.stringify(profile)
2421
+ });
2422
+ const jwt2 = await chunkB2ASV5RD_cjs.AuthManager.generateToken(
2423
+ existingUser.id,
2424
+ existingUser.email,
2425
+ existingUser.role,
2426
+ c.env.JWT_SECRET
2427
+ );
2428
+ chunkB2ASV5RD_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax" });
2429
+ return c.redirect("/admin");
2430
+ }
2431
+ const newUserId = await oauthService.createUserFromOAuth(profile);
2432
+ await oauthService.createOAuthAccount({
2433
+ userId: newUserId,
2434
+ provider: providerId,
2435
+ providerAccountId: profile.providerAccountId,
2436
+ accessToken: tokens.access_token,
2437
+ refreshToken: tokens.refresh_token,
2438
+ tokenExpiresAt: tokenExpiresAt ?? void 0,
2439
+ profileData: JSON.stringify(profile)
2440
+ });
2441
+ const jwt = await chunkB2ASV5RD_cjs.AuthManager.generateToken(
2442
+ newUserId,
2443
+ profile.email.toLowerCase(),
2444
+ "viewer",
2445
+ c.env.JWT_SECRET
2446
+ );
2447
+ chunkB2ASV5RD_cjs.AuthManager.setAuthCookie(c, jwt, { sameSite: "Lax" });
2448
+ return c.redirect("/admin");
2449
+ } catch (error) {
2450
+ console.error("OAuth callback error:", error);
2451
+ const message = error instanceof Error ? error.message : "OAuth authentication failed";
2452
+ return c.redirect(`/auth/login?error=${encodeURIComponent(message)}`);
2453
+ }
2454
+ });
2455
+ oauthAPI.post("/link", async (c) => {
2456
+ try {
2457
+ const user = c.get("user");
2458
+ if (!user) {
2459
+ return c.json({ error: "Authentication required" }, 401);
2460
+ }
2461
+ const body = await c.req.json();
2462
+ const { provider } = body;
2463
+ if (!provider || !BUILT_IN_PROVIDERS[provider]) {
2464
+ return c.json({ error: "Invalid provider" }, 400);
2465
+ }
2466
+ const db = c.env.DB;
2467
+ const settings = await loadSettings(db);
2468
+ const creds = getProviderCredentials(settings, provider);
2469
+ if (!creds) {
2470
+ return c.json({ error: `OAuth provider "${provider}" is not configured` }, 400);
2471
+ }
2472
+ const oauthService = new OAuthService(db);
2473
+ const state = oauthService.generateState();
2474
+ const redirectUri = getCallbackUrl(c, provider);
2475
+ cookie.setCookie(c, STATE_COOKIE_NAME, state, {
2476
+ httpOnly: true,
2477
+ secure: true,
2478
+ sameSite: "Lax",
2479
+ maxAge: STATE_COOKIE_MAX_AGE,
2480
+ path: "/auth/oauth"
2481
+ });
2482
+ const authorizeUrl = oauthService.buildAuthorizeUrl(
2483
+ BUILT_IN_PROVIDERS[provider],
2484
+ creds.clientId,
2485
+ redirectUri,
2486
+ state
2487
+ );
2488
+ return c.json({ redirectUrl: authorizeUrl });
2489
+ } catch (error) {
2490
+ console.error("OAuth link error:", error);
2491
+ return c.json({ error: "Failed to initiate account linking" }, 500);
2492
+ }
2493
+ });
2494
+ oauthAPI.post("/unlink", async (c) => {
2495
+ try {
2496
+ const user = c.get("user");
2497
+ if (!user) {
2498
+ return c.json({ error: "Authentication required" }, 401);
2499
+ }
2500
+ const body = await c.req.json();
2501
+ const { provider } = body;
2502
+ if (!provider) {
2503
+ return c.json({ error: "Provider is required" }, 400);
2504
+ }
2505
+ const db = c.env.DB;
2506
+ const oauthService = new OAuthService(db);
2507
+ const success = await oauthService.unlinkOAuthAccount(user.userId, provider);
2508
+ if (!success) {
2509
+ return c.json({
2510
+ error: "Cannot unlink the only authentication method. Set a password first."
2511
+ }, 400);
2512
+ }
2513
+ return c.json({ success: true, message: `${provider} account unlinked` });
2514
+ } catch (error) {
2515
+ console.error("OAuth unlink error:", error);
2516
+ return c.json({ error: "Failed to unlink account" }, 500);
2517
+ }
2518
+ });
2519
+ oauthAPI.get("/accounts", async (c) => {
2520
+ try {
2521
+ const user = c.get("user");
2522
+ if (!user) {
2523
+ return c.json({ error: "Authentication required" }, 401);
2524
+ }
2525
+ const db = c.env.DB;
2526
+ const oauthService = new OAuthService(db);
2527
+ const accounts = await oauthService.findUserOAuthAccounts(user.userId);
2528
+ return c.json({
2529
+ accounts: accounts.map((a) => ({
2530
+ provider: a.provider,
2531
+ providerAccountId: a.provider_account_id,
2532
+ linkedAt: a.created_at
2533
+ }))
2534
+ });
2535
+ } catch (error) {
2536
+ console.error("OAuth accounts error:", error);
2537
+ return c.json({ error: "Failed to fetch linked accounts" }, 500);
2538
+ }
2539
+ });
2540
+ builder.addRoute("/auth/oauth", oauthAPI, {
2541
+ description: "OAuth2 social login endpoints",
2542
+ requiresAuth: false,
2543
+ priority: 100
2544
+ });
2545
+ builder.addMenuItem("OAuth Providers", "/admin/plugins/oauth-providers", {
2546
+ icon: "shield",
2547
+ order: 86,
2548
+ permissions: ["oauth:manage"]
2549
+ });
2550
+ builder.lifecycle({
2551
+ activate: async () => {
2552
+ console.info("\u2705 OAuth Providers plugin activated");
2553
+ },
2554
+ deactivate: async () => {
2555
+ console.info("\u274C OAuth Providers plugin deactivated");
2556
+ }
2557
+ });
2558
+ return builder.build();
2559
+ }
2560
+ var oauthProvidersPlugin = createOAuthProvidersPlugin();
2561
+
2000
2562
  // src/plugins/core-plugins/ai-search-plugin/services/embedding.service.ts
2001
2563
  var EmbeddingService = class {
2002
2564
  constructor(ai) {
@@ -3575,7 +4137,7 @@ function renderSettingsPage(data) {
3575
4137
 
3576
4138
  // src/plugins/core-plugins/ai-search-plugin/routes/admin.ts
3577
4139
  var adminRoutes = new hono.Hono();
3578
- adminRoutes.use("*", chunkIT2TC4ZD_cjs.requireAuth());
4140
+ adminRoutes.use("*", chunkB2ASV5RD_cjs.requireAuth());
3579
4141
  adminRoutes.get("/", async (c) => {
3580
4142
  try {
3581
4143
  const user = c.get("user");
@@ -3976,13 +4538,13 @@ function createMagicLinkAuthPlugin() {
3976
4538
  SET used = 1, used_at = ?
3977
4539
  WHERE id = ?
3978
4540
  `).bind(Date.now(), magicLink.id).run();
3979
- const jwtToken = await chunkIT2TC4ZD_cjs.AuthManager.generateToken(
4541
+ const jwtToken = await chunkB2ASV5RD_cjs.AuthManager.generateToken(
3980
4542
  user.id,
3981
4543
  user.email,
3982
4544
  user.role,
3983
4545
  c.env.JWT_SECRET
3984
4546
  );
3985
- chunkIT2TC4ZD_cjs.AuthManager.setAuthCookie(c, jwtToken);
4547
+ chunkB2ASV5RD_cjs.AuthManager.setAuthCookie(c, jwtToken);
3986
4548
  await db.prepare(`
3987
4549
  UPDATE users SET last_login_at = ? WHERE id = ?
3988
4550
  `).bind(Date.now(), user.id).run();
@@ -5268,7 +5830,7 @@ function renderCacheDashboard(data) {
5268
5830
  </script>
5269
5831
 
5270
5832
  <!-- Confirmation Dialogs -->
5271
- ${chunkRCA6R6VE_cjs.renderConfirmationDialog({
5833
+ ${chunkASAEJ4B7_cjs.renderConfirmationDialog({
5272
5834
  id: "clear-all-cache-confirm",
5273
5835
  title: "Clear All Cache",
5274
5836
  message: "Are you sure you want to clear all cache entries? This cannot be undone.",
@@ -5279,7 +5841,7 @@ function renderCacheDashboard(data) {
5279
5841
  onConfirm: "performClearAllCaches()"
5280
5842
  })}
5281
5843
 
5282
- ${chunkRCA6R6VE_cjs.renderConfirmationDialog({
5844
+ ${chunkASAEJ4B7_cjs.renderConfirmationDialog({
5283
5845
  id: "clear-namespace-cache-confirm",
5284
5846
  title: "Clear Namespace Cache",
5285
5847
  message: "Clear cache for this namespace?",
@@ -5290,7 +5852,7 @@ function renderCacheDashboard(data) {
5290
5852
  onConfirm: "performClearNamespaceCache()"
5291
5853
  })}
5292
5854
 
5293
- ${chunkRCA6R6VE_cjs.getConfirmationDialogScript()}
5855
+ ${chunkASAEJ4B7_cjs.getConfirmationDialogScript()}
5294
5856
  `;
5295
5857
  const layoutData = {
5296
5858
  title: "Cache System",
@@ -5976,14 +6538,14 @@ var faviconSvg = `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
5976
6538
  // src/app.ts
5977
6539
  function createSonicJSApp(config = {}) {
5978
6540
  const app2 = new hono.Hono();
5979
- const appVersion = config.version || chunkEKPLKUZT_cjs.getCoreVersion();
6541
+ const appVersion = config.version || chunkQLPFENZ2_cjs.getCoreVersion();
5980
6542
  const appName = config.name || "SonicJS AI";
5981
6543
  app2.use("*", async (c, next) => {
5982
6544
  c.set("appVersion", appVersion);
5983
6545
  await next();
5984
6546
  });
5985
- app2.use("*", chunkIT2TC4ZD_cjs.metricsMiddleware());
5986
- app2.use("*", chunkIT2TC4ZD_cjs.bootstrapMiddleware(config));
6547
+ app2.use("*", chunkB2ASV5RD_cjs.metricsMiddleware());
6548
+ app2.use("*", chunkB2ASV5RD_cjs.bootstrapMiddleware(config));
5987
6549
  if (config.middleware?.beforeAuth) {
5988
6550
  for (const middleware of config.middleware.beforeAuth) {
5989
6551
  app2.use("*", middleware);
@@ -5992,44 +6554,49 @@ function createSonicJSApp(config = {}) {
5992
6554
  app2.use("*", async (_c, next) => {
5993
6555
  await next();
5994
6556
  });
5995
- app2.use("*", chunkIT2TC4ZD_cjs.securityHeadersMiddleware());
5996
- app2.use("*", chunkIT2TC4ZD_cjs.csrfProtection());
6557
+ app2.use("*", chunkB2ASV5RD_cjs.securityHeadersMiddleware());
6558
+ app2.use("*", chunkB2ASV5RD_cjs.csrfProtection());
5997
6559
  if (config.middleware?.afterAuth) {
5998
6560
  for (const middleware of config.middleware.afterAuth) {
5999
6561
  app2.use("*", middleware);
6000
6562
  }
6001
6563
  }
6002
- app2.route("/api", chunkRCA6R6VE_cjs.api_default);
6003
- app2.route("/api/media", chunkRCA6R6VE_cjs.api_media_default);
6004
- app2.route("/api/system", chunkRCA6R6VE_cjs.api_system_default);
6005
- app2.route("/admin/api", chunkRCA6R6VE_cjs.admin_api_default);
6006
- app2.route("/admin/dashboard", chunkRCA6R6VE_cjs.router);
6007
- app2.route("/admin/collections", chunkRCA6R6VE_cjs.adminCollectionsRoutes);
6008
- app2.route("/admin/forms", chunkRCA6R6VE_cjs.adminFormsRoutes);
6009
- app2.route("/admin/settings", chunkRCA6R6VE_cjs.adminSettingsRoutes);
6010
- app2.route("/forms", chunkRCA6R6VE_cjs.public_forms_default);
6011
- app2.route("/api/forms", chunkRCA6R6VE_cjs.public_forms_default);
6012
- app2.route("/admin/api-reference", chunkRCA6R6VE_cjs.router2);
6564
+ app2.route("/api", chunkASAEJ4B7_cjs.api_default);
6565
+ app2.route("/api/media", chunkASAEJ4B7_cjs.api_media_default);
6566
+ app2.route("/api/system", chunkASAEJ4B7_cjs.api_system_default);
6567
+ app2.route("/admin/api", chunkASAEJ4B7_cjs.admin_api_default);
6568
+ app2.route("/admin/dashboard", chunkASAEJ4B7_cjs.router);
6569
+ app2.route("/admin/collections", chunkASAEJ4B7_cjs.adminCollectionsRoutes);
6570
+ app2.route("/admin/forms", chunkASAEJ4B7_cjs.adminFormsRoutes);
6571
+ app2.route("/admin/settings", chunkASAEJ4B7_cjs.adminSettingsRoutes);
6572
+ app2.route("/forms", chunkASAEJ4B7_cjs.public_forms_default);
6573
+ app2.route("/api/forms", chunkASAEJ4B7_cjs.public_forms_default);
6574
+ app2.route("/admin/api-reference", chunkASAEJ4B7_cjs.router2);
6013
6575
  app2.route("/admin/database-tools", createDatabaseToolsAdminRoutes());
6014
6576
  app2.route("/admin/seed-data", createSeedDataAdminRoutes());
6015
- app2.route("/admin/content", chunkRCA6R6VE_cjs.admin_content_default);
6016
- app2.route("/admin/media", chunkRCA6R6VE_cjs.adminMediaRoutes);
6577
+ app2.route("/admin/content", chunkASAEJ4B7_cjs.admin_content_default);
6578
+ app2.route("/admin/media", chunkASAEJ4B7_cjs.adminMediaRoutes);
6017
6579
  if (aiSearchPlugin.routes && aiSearchPlugin.routes.length > 0) {
6018
6580
  for (const route of aiSearchPlugin.routes) {
6019
6581
  app2.route(route.path, route.handler);
6020
6582
  }
6021
6583
  }
6022
6584
  app2.route("/admin/cache", cache_default.getRoutes());
6585
+ if (oauthProvidersPlugin.routes && oauthProvidersPlugin.routes.length > 0) {
6586
+ for (const route of oauthProvidersPlugin.routes) {
6587
+ app2.route(route.path, route.handler);
6588
+ }
6589
+ }
6023
6590
  if (otpLoginPlugin.routes && otpLoginPlugin.routes.length > 0) {
6024
6591
  for (const route of otpLoginPlugin.routes) {
6025
6592
  app2.route(route.path, route.handler);
6026
6593
  }
6027
6594
  }
6028
- app2.route("/admin/plugins", chunkRCA6R6VE_cjs.adminPluginRoutes);
6029
- app2.route("/admin/logs", chunkRCA6R6VE_cjs.adminLogsRoutes);
6030
- app2.route("/admin", chunkRCA6R6VE_cjs.userRoutes);
6031
- app2.route("/auth", chunkRCA6R6VE_cjs.auth_default);
6032
- app2.route("/", chunkRCA6R6VE_cjs.test_cleanup_default);
6595
+ app2.route("/admin/plugins", chunkASAEJ4B7_cjs.adminPluginRoutes);
6596
+ app2.route("/admin/logs", chunkASAEJ4B7_cjs.adminLogsRoutes);
6597
+ app2.route("/admin", chunkASAEJ4B7_cjs.userRoutes);
6598
+ app2.route("/auth", chunkASAEJ4B7_cjs.auth_default);
6599
+ app2.route("/", chunkASAEJ4B7_cjs.test_cleanup_default);
6033
6600
  if (emailPlugin.routes && emailPlugin.routes.length > 0) {
6034
6601
  for (const route of emailPlugin.routes) {
6035
6602
  app2.route(route.path, route.handler);
@@ -6092,7 +6659,7 @@ function createSonicJSApp(config = {}) {
6092
6659
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
6093
6660
  });
6094
6661
  });
6095
- chunk64APW3DW_cjs.setAppInstance(app2);
6662
+ chunkLFAQUR7P_cjs.setAppInstance(app2);
6096
6663
  app2.notFound((c) => {
6097
6664
  return c.json({ error: "Not Found", status: 404 }, 404);
6098
6665
  });
@@ -6109,387 +6676,415 @@ function setupCoreRoutes(_app) {
6109
6676
  console.warn("setupCoreRoutes is deprecated. Use createSonicJSApp() instead.");
6110
6677
  }
6111
6678
  function createDb(d1$1) {
6112
- return d1.drizzle(d1$1, { schema: chunk64APW3DW_cjs.schema_exports });
6679
+ return d1.drizzle(d1$1, { schema: chunkLFAQUR7P_cjs.schema_exports });
6113
6680
  }
6114
6681
 
6115
6682
  // src/index.ts
6116
- var VERSION = chunkEKPLKUZT_cjs.package_default.version;
6683
+ var VERSION = chunkQLPFENZ2_cjs.package_default.version;
6117
6684
 
6118
6685
  Object.defineProperty(exports, "ROUTES_INFO", {
6119
6686
  enumerable: true,
6120
- get: function () { return chunkRCA6R6VE_cjs.ROUTES_INFO; }
6687
+ get: function () { return chunkASAEJ4B7_cjs.ROUTES_INFO; }
6121
6688
  });
6122
6689
  Object.defineProperty(exports, "adminApiRoutes", {
6123
6690
  enumerable: true,
6124
- get: function () { return chunkRCA6R6VE_cjs.admin_api_default; }
6691
+ get: function () { return chunkASAEJ4B7_cjs.admin_api_default; }
6125
6692
  });
6126
6693
  Object.defineProperty(exports, "adminCheckboxRoutes", {
6127
6694
  enumerable: true,
6128
- get: function () { return chunkRCA6R6VE_cjs.adminCheckboxRoutes; }
6695
+ get: function () { return chunkASAEJ4B7_cjs.adminCheckboxRoutes; }
6129
6696
  });
6130
6697
  Object.defineProperty(exports, "adminCodeExamplesRoutes", {
6131
6698
  enumerable: true,
6132
- get: function () { return chunkRCA6R6VE_cjs.admin_code_examples_default; }
6699
+ get: function () { return chunkASAEJ4B7_cjs.admin_code_examples_default; }
6133
6700
  });
6134
6701
  Object.defineProperty(exports, "adminCollectionsRoutes", {
6135
6702
  enumerable: true,
6136
- get: function () { return chunkRCA6R6VE_cjs.adminCollectionsRoutes; }
6703
+ get: function () { return chunkASAEJ4B7_cjs.adminCollectionsRoutes; }
6137
6704
  });
6138
6705
  Object.defineProperty(exports, "adminContentRoutes", {
6139
6706
  enumerable: true,
6140
- get: function () { return chunkRCA6R6VE_cjs.admin_content_default; }
6707
+ get: function () { return chunkASAEJ4B7_cjs.admin_content_default; }
6141
6708
  });
6142
6709
  Object.defineProperty(exports, "adminDashboardRoutes", {
6143
6710
  enumerable: true,
6144
- get: function () { return chunkRCA6R6VE_cjs.router; }
6711
+ get: function () { return chunkASAEJ4B7_cjs.router; }
6145
6712
  });
6146
6713
  Object.defineProperty(exports, "adminDesignRoutes", {
6147
6714
  enumerable: true,
6148
- get: function () { return chunkRCA6R6VE_cjs.adminDesignRoutes; }
6715
+ get: function () { return chunkASAEJ4B7_cjs.adminDesignRoutes; }
6149
6716
  });
6150
6717
  Object.defineProperty(exports, "adminLogsRoutes", {
6151
6718
  enumerable: true,
6152
- get: function () { return chunkRCA6R6VE_cjs.adminLogsRoutes; }
6719
+ get: function () { return chunkASAEJ4B7_cjs.adminLogsRoutes; }
6153
6720
  });
6154
6721
  Object.defineProperty(exports, "adminMediaRoutes", {
6155
6722
  enumerable: true,
6156
- get: function () { return chunkRCA6R6VE_cjs.adminMediaRoutes; }
6723
+ get: function () { return chunkASAEJ4B7_cjs.adminMediaRoutes; }
6157
6724
  });
6158
6725
  Object.defineProperty(exports, "adminPluginRoutes", {
6159
6726
  enumerable: true,
6160
- get: function () { return chunkRCA6R6VE_cjs.adminPluginRoutes; }
6727
+ get: function () { return chunkASAEJ4B7_cjs.adminPluginRoutes; }
6161
6728
  });
6162
6729
  Object.defineProperty(exports, "adminSettingsRoutes", {
6163
6730
  enumerable: true,
6164
- get: function () { return chunkRCA6R6VE_cjs.adminSettingsRoutes; }
6731
+ get: function () { return chunkASAEJ4B7_cjs.adminSettingsRoutes; }
6165
6732
  });
6166
6733
  Object.defineProperty(exports, "adminTestimonialsRoutes", {
6167
6734
  enumerable: true,
6168
- get: function () { return chunkRCA6R6VE_cjs.admin_testimonials_default; }
6735
+ get: function () { return chunkASAEJ4B7_cjs.admin_testimonials_default; }
6169
6736
  });
6170
6737
  Object.defineProperty(exports, "adminUsersRoutes", {
6171
6738
  enumerable: true,
6172
- get: function () { return chunkRCA6R6VE_cjs.userRoutes; }
6739
+ get: function () { return chunkASAEJ4B7_cjs.userRoutes; }
6173
6740
  });
6174
6741
  Object.defineProperty(exports, "apiContentCrudRoutes", {
6175
6742
  enumerable: true,
6176
- get: function () { return chunkRCA6R6VE_cjs.api_content_crud_default; }
6743
+ get: function () { return chunkASAEJ4B7_cjs.api_content_crud_default; }
6177
6744
  });
6178
6745
  Object.defineProperty(exports, "apiMediaRoutes", {
6179
6746
  enumerable: true,
6180
- get: function () { return chunkRCA6R6VE_cjs.api_media_default; }
6747
+ get: function () { return chunkASAEJ4B7_cjs.api_media_default; }
6181
6748
  });
6182
6749
  Object.defineProperty(exports, "apiRoutes", {
6183
6750
  enumerable: true,
6184
- get: function () { return chunkRCA6R6VE_cjs.api_default; }
6751
+ get: function () { return chunkASAEJ4B7_cjs.api_default; }
6185
6752
  });
6186
6753
  Object.defineProperty(exports, "apiSystemRoutes", {
6187
6754
  enumerable: true,
6188
- get: function () { return chunkRCA6R6VE_cjs.api_system_default; }
6755
+ get: function () { return chunkASAEJ4B7_cjs.api_system_default; }
6189
6756
  });
6190
6757
  Object.defineProperty(exports, "authRoutes", {
6191
6758
  enumerable: true,
6192
- get: function () { return chunkRCA6R6VE_cjs.auth_default; }
6759
+ get: function () { return chunkASAEJ4B7_cjs.auth_default; }
6193
6760
  });
6194
6761
  Object.defineProperty(exports, "Logger", {
6195
6762
  enumerable: true,
6196
- get: function () { return chunk64APW3DW_cjs.Logger; }
6763
+ get: function () { return chunkLFAQUR7P_cjs.Logger; }
6197
6764
  });
6198
6765
  Object.defineProperty(exports, "apiTokens", {
6199
6766
  enumerable: true,
6200
- get: function () { return chunk64APW3DW_cjs.apiTokens; }
6767
+ get: function () { return chunkLFAQUR7P_cjs.apiTokens; }
6201
6768
  });
6202
6769
  Object.defineProperty(exports, "collections", {
6203
6770
  enumerable: true,
6204
- get: function () { return chunk64APW3DW_cjs.collections; }
6771
+ get: function () { return chunkLFAQUR7P_cjs.collections; }
6205
6772
  });
6206
6773
  Object.defineProperty(exports, "content", {
6207
6774
  enumerable: true,
6208
- get: function () { return chunk64APW3DW_cjs.content; }
6775
+ get: function () { return chunkLFAQUR7P_cjs.content; }
6209
6776
  });
6210
6777
  Object.defineProperty(exports, "contentVersions", {
6211
6778
  enumerable: true,
6212
- get: function () { return chunk64APW3DW_cjs.contentVersions; }
6779
+ get: function () { return chunkLFAQUR7P_cjs.contentVersions; }
6213
6780
  });
6214
6781
  Object.defineProperty(exports, "getLogger", {
6215
6782
  enumerable: true,
6216
- get: function () { return chunk64APW3DW_cjs.getLogger; }
6783
+ get: function () { return chunkLFAQUR7P_cjs.getLogger; }
6217
6784
  });
6218
6785
  Object.defineProperty(exports, "initLogger", {
6219
6786
  enumerable: true,
6220
- get: function () { return chunk64APW3DW_cjs.initLogger; }
6787
+ get: function () { return chunkLFAQUR7P_cjs.initLogger; }
6221
6788
  });
6222
6789
  Object.defineProperty(exports, "insertCollectionSchema", {
6223
6790
  enumerable: true,
6224
- get: function () { return chunk64APW3DW_cjs.insertCollectionSchema; }
6791
+ get: function () { return chunkLFAQUR7P_cjs.insertCollectionSchema; }
6225
6792
  });
6226
6793
  Object.defineProperty(exports, "insertContentSchema", {
6227
6794
  enumerable: true,
6228
- get: function () { return chunk64APW3DW_cjs.insertContentSchema; }
6795
+ get: function () { return chunkLFAQUR7P_cjs.insertContentSchema; }
6229
6796
  });
6230
6797
  Object.defineProperty(exports, "insertLogConfigSchema", {
6231
6798
  enumerable: true,
6232
- get: function () { return chunk64APW3DW_cjs.insertLogConfigSchema; }
6799
+ get: function () { return chunkLFAQUR7P_cjs.insertLogConfigSchema; }
6233
6800
  });
6234
6801
  Object.defineProperty(exports, "insertMediaSchema", {
6235
6802
  enumerable: true,
6236
- get: function () { return chunk64APW3DW_cjs.insertMediaSchema; }
6803
+ get: function () { return chunkLFAQUR7P_cjs.insertMediaSchema; }
6237
6804
  });
6238
6805
  Object.defineProperty(exports, "insertPluginActivityLogSchema", {
6239
6806
  enumerable: true,
6240
- get: function () { return chunk64APW3DW_cjs.insertPluginActivityLogSchema; }
6807
+ get: function () { return chunkLFAQUR7P_cjs.insertPluginActivityLogSchema; }
6241
6808
  });
6242
6809
  Object.defineProperty(exports, "insertPluginAssetSchema", {
6243
6810
  enumerable: true,
6244
- get: function () { return chunk64APW3DW_cjs.insertPluginAssetSchema; }
6811
+ get: function () { return chunkLFAQUR7P_cjs.insertPluginAssetSchema; }
6245
6812
  });
6246
6813
  Object.defineProperty(exports, "insertPluginHookSchema", {
6247
6814
  enumerable: true,
6248
- get: function () { return chunk64APW3DW_cjs.insertPluginHookSchema; }
6815
+ get: function () { return chunkLFAQUR7P_cjs.insertPluginHookSchema; }
6249
6816
  });
6250
6817
  Object.defineProperty(exports, "insertPluginRouteSchema", {
6251
6818
  enumerable: true,
6252
- get: function () { return chunk64APW3DW_cjs.insertPluginRouteSchema; }
6819
+ get: function () { return chunkLFAQUR7P_cjs.insertPluginRouteSchema; }
6253
6820
  });
6254
6821
  Object.defineProperty(exports, "insertPluginSchema", {
6255
6822
  enumerable: true,
6256
- get: function () { return chunk64APW3DW_cjs.insertPluginSchema; }
6823
+ get: function () { return chunkLFAQUR7P_cjs.insertPluginSchema; }
6257
6824
  });
6258
6825
  Object.defineProperty(exports, "insertSystemLogSchema", {
6259
6826
  enumerable: true,
6260
- get: function () { return chunk64APW3DW_cjs.insertSystemLogSchema; }
6827
+ get: function () { return chunkLFAQUR7P_cjs.insertSystemLogSchema; }
6261
6828
  });
6262
6829
  Object.defineProperty(exports, "insertUserSchema", {
6263
6830
  enumerable: true,
6264
- get: function () { return chunk64APW3DW_cjs.insertUserSchema; }
6831
+ get: function () { return chunkLFAQUR7P_cjs.insertUserSchema; }
6265
6832
  });
6266
6833
  Object.defineProperty(exports, "insertWorkflowHistorySchema", {
6267
6834
  enumerable: true,
6268
- get: function () { return chunk64APW3DW_cjs.insertWorkflowHistorySchema; }
6835
+ get: function () { return chunkLFAQUR7P_cjs.insertWorkflowHistorySchema; }
6269
6836
  });
6270
6837
  Object.defineProperty(exports, "logConfig", {
6271
6838
  enumerable: true,
6272
- get: function () { return chunk64APW3DW_cjs.logConfig; }
6839
+ get: function () { return chunkLFAQUR7P_cjs.logConfig; }
6273
6840
  });
6274
6841
  Object.defineProperty(exports, "media", {
6275
6842
  enumerable: true,
6276
- get: function () { return chunk64APW3DW_cjs.media; }
6843
+ get: function () { return chunkLFAQUR7P_cjs.media; }
6277
6844
  });
6278
6845
  Object.defineProperty(exports, "pluginActivityLog", {
6279
6846
  enumerable: true,
6280
- get: function () { return chunk64APW3DW_cjs.pluginActivityLog; }
6847
+ get: function () { return chunkLFAQUR7P_cjs.pluginActivityLog; }
6281
6848
  });
6282
6849
  Object.defineProperty(exports, "pluginAssets", {
6283
6850
  enumerable: true,
6284
- get: function () { return chunk64APW3DW_cjs.pluginAssets; }
6851
+ get: function () { return chunkLFAQUR7P_cjs.pluginAssets; }
6285
6852
  });
6286
6853
  Object.defineProperty(exports, "pluginHooks", {
6287
6854
  enumerable: true,
6288
- get: function () { return chunk64APW3DW_cjs.pluginHooks; }
6855
+ get: function () { return chunkLFAQUR7P_cjs.pluginHooks; }
6289
6856
  });
6290
6857
  Object.defineProperty(exports, "pluginRoutes", {
6291
6858
  enumerable: true,
6292
- get: function () { return chunk64APW3DW_cjs.pluginRoutes; }
6859
+ get: function () { return chunkLFAQUR7P_cjs.pluginRoutes; }
6293
6860
  });
6294
6861
  Object.defineProperty(exports, "plugins", {
6295
6862
  enumerable: true,
6296
- get: function () { return chunk64APW3DW_cjs.plugins; }
6863
+ get: function () { return chunkLFAQUR7P_cjs.plugins; }
6297
6864
  });
6298
6865
  Object.defineProperty(exports, "selectCollectionSchema", {
6299
6866
  enumerable: true,
6300
- get: function () { return chunk64APW3DW_cjs.selectCollectionSchema; }
6867
+ get: function () { return chunkLFAQUR7P_cjs.selectCollectionSchema; }
6301
6868
  });
6302
6869
  Object.defineProperty(exports, "selectContentSchema", {
6303
6870
  enumerable: true,
6304
- get: function () { return chunk64APW3DW_cjs.selectContentSchema; }
6871
+ get: function () { return chunkLFAQUR7P_cjs.selectContentSchema; }
6305
6872
  });
6306
6873
  Object.defineProperty(exports, "selectLogConfigSchema", {
6307
6874
  enumerable: true,
6308
- get: function () { return chunk64APW3DW_cjs.selectLogConfigSchema; }
6875
+ get: function () { return chunkLFAQUR7P_cjs.selectLogConfigSchema; }
6309
6876
  });
6310
6877
  Object.defineProperty(exports, "selectMediaSchema", {
6311
6878
  enumerable: true,
6312
- get: function () { return chunk64APW3DW_cjs.selectMediaSchema; }
6879
+ get: function () { return chunkLFAQUR7P_cjs.selectMediaSchema; }
6313
6880
  });
6314
6881
  Object.defineProperty(exports, "selectPluginActivityLogSchema", {
6315
6882
  enumerable: true,
6316
- get: function () { return chunk64APW3DW_cjs.selectPluginActivityLogSchema; }
6883
+ get: function () { return chunkLFAQUR7P_cjs.selectPluginActivityLogSchema; }
6317
6884
  });
6318
6885
  Object.defineProperty(exports, "selectPluginAssetSchema", {
6319
6886
  enumerable: true,
6320
- get: function () { return chunk64APW3DW_cjs.selectPluginAssetSchema; }
6887
+ get: function () { return chunkLFAQUR7P_cjs.selectPluginAssetSchema; }
6321
6888
  });
6322
6889
  Object.defineProperty(exports, "selectPluginHookSchema", {
6323
6890
  enumerable: true,
6324
- get: function () { return chunk64APW3DW_cjs.selectPluginHookSchema; }
6891
+ get: function () { return chunkLFAQUR7P_cjs.selectPluginHookSchema; }
6325
6892
  });
6326
6893
  Object.defineProperty(exports, "selectPluginRouteSchema", {
6327
6894
  enumerable: true,
6328
- get: function () { return chunk64APW3DW_cjs.selectPluginRouteSchema; }
6895
+ get: function () { return chunkLFAQUR7P_cjs.selectPluginRouteSchema; }
6329
6896
  });
6330
6897
  Object.defineProperty(exports, "selectPluginSchema", {
6331
6898
  enumerable: true,
6332
- get: function () { return chunk64APW3DW_cjs.selectPluginSchema; }
6899
+ get: function () { return chunkLFAQUR7P_cjs.selectPluginSchema; }
6333
6900
  });
6334
6901
  Object.defineProperty(exports, "selectSystemLogSchema", {
6335
6902
  enumerable: true,
6336
- get: function () { return chunk64APW3DW_cjs.selectSystemLogSchema; }
6903
+ get: function () { return chunkLFAQUR7P_cjs.selectSystemLogSchema; }
6337
6904
  });
6338
6905
  Object.defineProperty(exports, "selectUserSchema", {
6339
6906
  enumerable: true,
6340
- get: function () { return chunk64APW3DW_cjs.selectUserSchema; }
6907
+ get: function () { return chunkLFAQUR7P_cjs.selectUserSchema; }
6341
6908
  });
6342
6909
  Object.defineProperty(exports, "selectWorkflowHistorySchema", {
6343
6910
  enumerable: true,
6344
- get: function () { return chunk64APW3DW_cjs.selectWorkflowHistorySchema; }
6911
+ get: function () { return chunkLFAQUR7P_cjs.selectWorkflowHistorySchema; }
6345
6912
  });
6346
6913
  Object.defineProperty(exports, "systemLogs", {
6347
6914
  enumerable: true,
6348
- get: function () { return chunk64APW3DW_cjs.systemLogs; }
6915
+ get: function () { return chunkLFAQUR7P_cjs.systemLogs; }
6349
6916
  });
6350
6917
  Object.defineProperty(exports, "users", {
6351
6918
  enumerable: true,
6352
- get: function () { return chunk64APW3DW_cjs.users; }
6919
+ get: function () { return chunkLFAQUR7P_cjs.users; }
6353
6920
  });
6354
6921
  Object.defineProperty(exports, "workflowHistory", {
6355
6922
  enumerable: true,
6356
- get: function () { return chunk64APW3DW_cjs.workflowHistory; }
6923
+ get: function () { return chunkLFAQUR7P_cjs.workflowHistory; }
6357
6924
  });
6358
6925
  Object.defineProperty(exports, "AuthManager", {
6359
6926
  enumerable: true,
6360
- get: function () { return chunkIT2TC4ZD_cjs.AuthManager; }
6927
+ get: function () { return chunkB2ASV5RD_cjs.AuthManager; }
6361
6928
  });
6362
6929
  Object.defineProperty(exports, "PermissionManager", {
6363
6930
  enumerable: true,
6364
- get: function () { return chunkIT2TC4ZD_cjs.PermissionManager; }
6931
+ get: function () { return chunkB2ASV5RD_cjs.PermissionManager; }
6365
6932
  });
6366
6933
  Object.defineProperty(exports, "bootstrapMiddleware", {
6367
6934
  enumerable: true,
6368
- get: function () { return chunkIT2TC4ZD_cjs.bootstrapMiddleware; }
6935
+ get: function () { return chunkB2ASV5RD_cjs.bootstrapMiddleware; }
6369
6936
  });
6370
6937
  Object.defineProperty(exports, "cacheHeaders", {
6371
6938
  enumerable: true,
6372
- get: function () { return chunkIT2TC4ZD_cjs.cacheHeaders; }
6939
+ get: function () { return chunkB2ASV5RD_cjs.cacheHeaders; }
6373
6940
  });
6374
6941
  Object.defineProperty(exports, "compressionMiddleware", {
6375
6942
  enumerable: true,
6376
- get: function () { return chunkIT2TC4ZD_cjs.compressionMiddleware; }
6943
+ get: function () { return chunkB2ASV5RD_cjs.compressionMiddleware; }
6377
6944
  });
6378
6945
  Object.defineProperty(exports, "detailedLoggingMiddleware", {
6379
6946
  enumerable: true,
6380
- get: function () { return chunkIT2TC4ZD_cjs.detailedLoggingMiddleware; }
6947
+ get: function () { return chunkB2ASV5RD_cjs.detailedLoggingMiddleware; }
6381
6948
  });
6382
6949
  Object.defineProperty(exports, "getActivePlugins", {
6383
6950
  enumerable: true,
6384
- get: function () { return chunkIT2TC4ZD_cjs.getActivePlugins; }
6951
+ get: function () { return chunkB2ASV5RD_cjs.getActivePlugins; }
6385
6952
  });
6386
6953
  Object.defineProperty(exports, "isPluginActive", {
6387
6954
  enumerable: true,
6388
- get: function () { return chunkIT2TC4ZD_cjs.isPluginActive; }
6955
+ get: function () { return chunkB2ASV5RD_cjs.isPluginActive; }
6389
6956
  });
6390
6957
  Object.defineProperty(exports, "logActivity", {
6391
6958
  enumerable: true,
6392
- get: function () { return chunkIT2TC4ZD_cjs.logActivity; }
6959
+ get: function () { return chunkB2ASV5RD_cjs.logActivity; }
6393
6960
  });
6394
6961
  Object.defineProperty(exports, "loggingMiddleware", {
6395
6962
  enumerable: true,
6396
- get: function () { return chunkIT2TC4ZD_cjs.loggingMiddleware; }
6963
+ get: function () { return chunkB2ASV5RD_cjs.loggingMiddleware; }
6397
6964
  });
6398
6965
  Object.defineProperty(exports, "optionalAuth", {
6399
6966
  enumerable: true,
6400
- get: function () { return chunkIT2TC4ZD_cjs.optionalAuth; }
6967
+ get: function () { return chunkB2ASV5RD_cjs.optionalAuth; }
6401
6968
  });
6402
6969
  Object.defineProperty(exports, "performanceLoggingMiddleware", {
6403
6970
  enumerable: true,
6404
- get: function () { return chunkIT2TC4ZD_cjs.performanceLoggingMiddleware; }
6971
+ get: function () { return chunkB2ASV5RD_cjs.performanceLoggingMiddleware; }
6405
6972
  });
6406
6973
  Object.defineProperty(exports, "requireActivePlugin", {
6407
6974
  enumerable: true,
6408
- get: function () { return chunkIT2TC4ZD_cjs.requireActivePlugin; }
6975
+ get: function () { return chunkB2ASV5RD_cjs.requireActivePlugin; }
6409
6976
  });
6410
6977
  Object.defineProperty(exports, "requireActivePlugins", {
6411
6978
  enumerable: true,
6412
- get: function () { return chunkIT2TC4ZD_cjs.requireActivePlugins; }
6979
+ get: function () { return chunkB2ASV5RD_cjs.requireActivePlugins; }
6413
6980
  });
6414
6981
  Object.defineProperty(exports, "requireAnyPermission", {
6415
6982
  enumerable: true,
6416
- get: function () { return chunkIT2TC4ZD_cjs.requireAnyPermission; }
6983
+ get: function () { return chunkB2ASV5RD_cjs.requireAnyPermission; }
6417
6984
  });
6418
6985
  Object.defineProperty(exports, "requireAuth", {
6419
6986
  enumerable: true,
6420
- get: function () { return chunkIT2TC4ZD_cjs.requireAuth; }
6987
+ get: function () { return chunkB2ASV5RD_cjs.requireAuth; }
6421
6988
  });
6422
6989
  Object.defineProperty(exports, "requirePermission", {
6423
6990
  enumerable: true,
6424
- get: function () { return chunkIT2TC4ZD_cjs.requirePermission; }
6991
+ get: function () { return chunkB2ASV5RD_cjs.requirePermission; }
6425
6992
  });
6426
6993
  Object.defineProperty(exports, "requireRole", {
6427
6994
  enumerable: true,
6428
- get: function () { return chunkIT2TC4ZD_cjs.requireRole; }
6995
+ get: function () { return chunkB2ASV5RD_cjs.requireRole; }
6429
6996
  });
6430
6997
  Object.defineProperty(exports, "securityHeaders", {
6431
6998
  enumerable: true,
6432
- get: function () { return chunkIT2TC4ZD_cjs.securityHeadersMiddleware; }
6999
+ get: function () { return chunkB2ASV5RD_cjs.securityHeadersMiddleware; }
6433
7000
  });
6434
7001
  Object.defineProperty(exports, "securityLoggingMiddleware", {
6435
7002
  enumerable: true,
6436
- get: function () { return chunkIT2TC4ZD_cjs.securityLoggingMiddleware; }
7003
+ get: function () { return chunkB2ASV5RD_cjs.securityLoggingMiddleware; }
6437
7004
  });
6438
7005
  Object.defineProperty(exports, "PluginBootstrapService", {
6439
7006
  enumerable: true,
6440
- get: function () { return chunkIIBRG5S5_cjs.PluginBootstrapService; }
7007
+ get: function () { return chunk6BVLPACH_cjs.PluginBootstrapService; }
6441
7008
  });
6442
7009
  Object.defineProperty(exports, "PluginServiceClass", {
6443
7010
  enumerable: true,
6444
- get: function () { return chunkIIBRG5S5_cjs.PluginService; }
7011
+ get: function () { return chunk6BVLPACH_cjs.PluginService; }
7012
+ });
7013
+ Object.defineProperty(exports, "backfillFormSubmissions", {
7014
+ enumerable: true,
7015
+ get: function () { return chunk6BVLPACH_cjs.backfillFormSubmissions; }
6445
7016
  });
6446
7017
  Object.defineProperty(exports, "cleanupRemovedCollections", {
6447
7018
  enumerable: true,
6448
- get: function () { return chunkIIBRG5S5_cjs.cleanupRemovedCollections; }
7019
+ get: function () { return chunk6BVLPACH_cjs.cleanupRemovedCollections; }
7020
+ });
7021
+ Object.defineProperty(exports, "createContentFromSubmission", {
7022
+ enumerable: true,
7023
+ get: function () { return chunk6BVLPACH_cjs.createContentFromSubmission; }
7024
+ });
7025
+ Object.defineProperty(exports, "deriveCollectionSchemaFromFormio", {
7026
+ enumerable: true,
7027
+ get: function () { return chunk6BVLPACH_cjs.deriveCollectionSchemaFromFormio; }
7028
+ });
7029
+ Object.defineProperty(exports, "deriveSubmissionTitle", {
7030
+ enumerable: true,
7031
+ get: function () { return chunk6BVLPACH_cjs.deriveSubmissionTitle; }
6449
7032
  });
6450
7033
  Object.defineProperty(exports, "fullCollectionSync", {
6451
7034
  enumerable: true,
6452
- get: function () { return chunkIIBRG5S5_cjs.fullCollectionSync; }
7035
+ get: function () { return chunk6BVLPACH_cjs.fullCollectionSync; }
6453
7036
  });
6454
7037
  Object.defineProperty(exports, "getAvailableCollectionNames", {
6455
7038
  enumerable: true,
6456
- get: function () { return chunkIIBRG5S5_cjs.getAvailableCollectionNames; }
7039
+ get: function () { return chunk6BVLPACH_cjs.getAvailableCollectionNames; }
6457
7040
  });
6458
7041
  Object.defineProperty(exports, "getManagedCollections", {
6459
7042
  enumerable: true,
6460
- get: function () { return chunkIIBRG5S5_cjs.getManagedCollections; }
7043
+ get: function () { return chunk6BVLPACH_cjs.getManagedCollections; }
6461
7044
  });
6462
7045
  Object.defineProperty(exports, "isCollectionManaged", {
6463
7046
  enumerable: true,
6464
- get: function () { return chunkIIBRG5S5_cjs.isCollectionManaged; }
7047
+ get: function () { return chunk6BVLPACH_cjs.isCollectionManaged; }
6465
7048
  });
6466
7049
  Object.defineProperty(exports, "loadCollectionConfig", {
6467
7050
  enumerable: true,
6468
- get: function () { return chunkIIBRG5S5_cjs.loadCollectionConfig; }
7051
+ get: function () { return chunk6BVLPACH_cjs.loadCollectionConfig; }
6469
7052
  });
6470
7053
  Object.defineProperty(exports, "loadCollectionConfigs", {
6471
7054
  enumerable: true,
6472
- get: function () { return chunkIIBRG5S5_cjs.loadCollectionConfigs; }
7055
+ get: function () { return chunk6BVLPACH_cjs.loadCollectionConfigs; }
7056
+ });
7057
+ Object.defineProperty(exports, "mapFormStatusToContentStatus", {
7058
+ enumerable: true,
7059
+ get: function () { return chunk6BVLPACH_cjs.mapFormStatusToContentStatus; }
6473
7060
  });
6474
7061
  Object.defineProperty(exports, "registerCollections", {
6475
7062
  enumerable: true,
6476
- get: function () { return chunkIIBRG5S5_cjs.registerCollections; }
7063
+ get: function () { return chunk6BVLPACH_cjs.registerCollections; }
7064
+ });
7065
+ Object.defineProperty(exports, "syncAllFormCollections", {
7066
+ enumerable: true,
7067
+ get: function () { return chunk6BVLPACH_cjs.syncAllFormCollections; }
6477
7068
  });
6478
7069
  Object.defineProperty(exports, "syncCollection", {
6479
7070
  enumerable: true,
6480
- get: function () { return chunkIIBRG5S5_cjs.syncCollection; }
7071
+ get: function () { return chunk6BVLPACH_cjs.syncCollection; }
6481
7072
  });
6482
7073
  Object.defineProperty(exports, "syncCollections", {
6483
7074
  enumerable: true,
6484
- get: function () { return chunkIIBRG5S5_cjs.syncCollections; }
7075
+ get: function () { return chunk6BVLPACH_cjs.syncCollections; }
7076
+ });
7077
+ Object.defineProperty(exports, "syncFormCollection", {
7078
+ enumerable: true,
7079
+ get: function () { return chunk6BVLPACH_cjs.syncFormCollection; }
6485
7080
  });
6486
7081
  Object.defineProperty(exports, "validateCollectionConfig", {
6487
7082
  enumerable: true,
6488
- get: function () { return chunkIIBRG5S5_cjs.validateCollectionConfig; }
7083
+ get: function () { return chunk6BVLPACH_cjs.validateCollectionConfig; }
6489
7084
  });
6490
7085
  Object.defineProperty(exports, "MigrationService", {
6491
7086
  enumerable: true,
6492
- get: function () { return chunkZMVWMJ3S_cjs.MigrationService; }
7087
+ get: function () { return chunkDE5YTNCD_cjs.MigrationService; }
6493
7088
  });
6494
7089
  Object.defineProperty(exports, "renderFilterBar", {
6495
7090
  enumerable: true,
@@ -6525,27 +7120,27 @@ Object.defineProperty(exports, "renderTable", {
6525
7120
  });
6526
7121
  Object.defineProperty(exports, "HookSystemImpl", {
6527
7122
  enumerable: true,
6528
- get: function () { return chunkMNFY6DWY_cjs.HookSystemImpl; }
7123
+ get: function () { return chunk56GUBLJE_cjs.HookSystemImpl; }
6529
7124
  });
6530
7125
  Object.defineProperty(exports, "HookUtils", {
6531
7126
  enumerable: true,
6532
- get: function () { return chunkMNFY6DWY_cjs.HookUtils; }
7127
+ get: function () { return chunk56GUBLJE_cjs.HookUtils; }
6533
7128
  });
6534
7129
  Object.defineProperty(exports, "PluginManagerClass", {
6535
7130
  enumerable: true,
6536
- get: function () { return chunkMNFY6DWY_cjs.PluginManager; }
7131
+ get: function () { return chunk56GUBLJE_cjs.PluginManager; }
6537
7132
  });
6538
7133
  Object.defineProperty(exports, "PluginRegistryImpl", {
6539
7134
  enumerable: true,
6540
- get: function () { return chunkMNFY6DWY_cjs.PluginRegistryImpl; }
7135
+ get: function () { return chunk56GUBLJE_cjs.PluginRegistryImpl; }
6541
7136
  });
6542
7137
  Object.defineProperty(exports, "PluginValidatorClass", {
6543
7138
  enumerable: true,
6544
- get: function () { return chunkMNFY6DWY_cjs.PluginValidator; }
7139
+ get: function () { return chunk56GUBLJE_cjs.PluginValidator; }
6545
7140
  });
6546
7141
  Object.defineProperty(exports, "ScopedHookSystemClass", {
6547
7142
  enumerable: true,
6548
- get: function () { return chunkMNFY6DWY_cjs.ScopedHookSystem; }
7143
+ get: function () { return chunk56GUBLJE_cjs.ScopedHookSystem; }
6549
7144
  });
6550
7145
  Object.defineProperty(exports, "PluginBuilder", {
6551
7146
  enumerable: true,
@@ -6557,31 +7152,31 @@ Object.defineProperty(exports, "PluginHelpers", {
6557
7152
  });
6558
7153
  Object.defineProperty(exports, "QueryFilterBuilder", {
6559
7154
  enumerable: true,
6560
- get: function () { return chunkEKPLKUZT_cjs.QueryFilterBuilder; }
7155
+ get: function () { return chunkQLPFENZ2_cjs.QueryFilterBuilder; }
6561
7156
  });
6562
7157
  Object.defineProperty(exports, "SONICJS_VERSION", {
6563
7158
  enumerable: true,
6564
- get: function () { return chunkEKPLKUZT_cjs.SONICJS_VERSION; }
7159
+ get: function () { return chunkQLPFENZ2_cjs.SONICJS_VERSION; }
6565
7160
  });
6566
7161
  Object.defineProperty(exports, "TemplateRenderer", {
6567
7162
  enumerable: true,
6568
- get: function () { return chunkEKPLKUZT_cjs.TemplateRenderer; }
7163
+ get: function () { return chunkQLPFENZ2_cjs.TemplateRenderer; }
6569
7164
  });
6570
7165
  Object.defineProperty(exports, "buildQuery", {
6571
7166
  enumerable: true,
6572
- get: function () { return chunkEKPLKUZT_cjs.buildQuery; }
7167
+ get: function () { return chunkQLPFENZ2_cjs.buildQuery; }
6573
7168
  });
6574
7169
  Object.defineProperty(exports, "getCoreVersion", {
6575
7170
  enumerable: true,
6576
- get: function () { return chunkEKPLKUZT_cjs.getCoreVersion; }
7171
+ get: function () { return chunkQLPFENZ2_cjs.getCoreVersion; }
6577
7172
  });
6578
7173
  Object.defineProperty(exports, "renderTemplate", {
6579
7174
  enumerable: true,
6580
- get: function () { return chunkEKPLKUZT_cjs.renderTemplate; }
7175
+ get: function () { return chunkQLPFENZ2_cjs.renderTemplate; }
6581
7176
  });
6582
7177
  Object.defineProperty(exports, "templateRenderer", {
6583
7178
  enumerable: true,
6584
- get: function () { return chunkEKPLKUZT_cjs.templateRenderer; }
7179
+ get: function () { return chunkQLPFENZ2_cjs.templateRenderer; }
6585
7180
  });
6586
7181
  Object.defineProperty(exports, "metricsTracker", {
6587
7182
  enumerable: true,
@@ -6601,11 +7196,15 @@ Object.defineProperty(exports, "sanitizeObject", {
6601
7196
  });
6602
7197
  Object.defineProperty(exports, "HOOKS", {
6603
7198
  enumerable: true,
6604
- get: function () { return chunkKYGRJCZM_cjs.HOOKS; }
7199
+ get: function () { return chunkQTFKZBLC_cjs.HOOKS; }
6605
7200
  });
7201
+ exports.BUILT_IN_PROVIDERS = BUILT_IN_PROVIDERS;
7202
+ exports.OAuthService = OAuthService;
6606
7203
  exports.VERSION = VERSION;
6607
7204
  exports.createDb = createDb;
7205
+ exports.createOAuthProvidersPlugin = createOAuthProvidersPlugin;
6608
7206
  exports.createSonicJSApp = createSonicJSApp;
7207
+ exports.oauthProvidersPlugin = oauthProvidersPlugin;
6609
7208
  exports.setupCoreMiddleware = setupCoreMiddleware;
6610
7209
  exports.setupCoreRoutes = setupCoreRoutes;
6611
7210
  //# sourceMappingURL=index.cjs.map