@sonicjs-cms/core 2.3.7 → 2.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/{chunk-47G6TMTB.js → chunk-624OTQ55.js} +2 -2
- package/dist/{chunk-47G6TMTB.js.map → chunk-624OTQ55.js.map} +1 -1
- package/dist/{chunk-CDQWX6HG.js → chunk-AUU4H5MP.js} +3 -3
- package/dist/{chunk-CDQWX6HG.js.map → chunk-AUU4H5MP.js.map} +1 -1
- package/dist/{chunk-THBO2XL6.js → chunk-HNHKS2XF.js} +3 -3
- package/dist/{chunk-THBO2XL6.js.map → chunk-HNHKS2XF.js.map} +1 -1
- package/dist/{chunk-N6HQSHY5.js → chunk-I3M6I2FY.js} +82 -66
- package/dist/chunk-I3M6I2FY.js.map +1 -0
- package/dist/{chunk-F3GLWP7L.cjs → chunk-N3EHA3AX.cjs} +3 -3
- package/dist/{chunk-F3GLWP7L.cjs.map → chunk-N3EHA3AX.cjs.map} +1 -1
- package/dist/{chunk-PFGBXSNH.cjs → chunk-O446Q45G.cjs} +2 -2
- package/dist/{chunk-PFGBXSNH.cjs.map → chunk-O446Q45G.cjs.map} +1 -1
- package/dist/{chunk-ULWF6BZ6.cjs → chunk-T7HDJE2H.cjs} +164 -148
- package/dist/chunk-T7HDJE2H.cjs.map +1 -0
- package/dist/{chunk-DAKMORAN.cjs → chunk-YLFQXTTX.cjs} +4 -4
- package/dist/{chunk-DAKMORAN.cjs.map → chunk-YLFQXTTX.cjs.map} +1 -1
- package/dist/index.cjs +74 -74
- package/dist/index.js +7 -7
- package/dist/middleware.cjs +23 -23
- package/dist/middleware.js +2 -2
- package/dist/migrations-ALSBVBV5.js +4 -0
- package/dist/{migrations-WXG46MGL.js.map → migrations-ALSBVBV5.js.map} +1 -1
- package/dist/migrations-RMI7TLPG.cjs +13 -0
- package/dist/{migrations-GLSUA5KH.cjs.map → migrations-RMI7TLPG.cjs.map} +1 -1
- package/dist/routes.cjs +24 -24
- package/dist/routes.js +4 -4
- package/dist/services.cjs +2 -2
- package/dist/services.js +1 -1
- package/dist/utils.cjs +11 -11
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-N6HQSHY5.js.map +0 -1
- package/dist/chunk-ULWF6BZ6.cjs.map +0 -1
- package/dist/migrations-GLSUA5KH.cjs +0 -13
- package/dist/migrations-WXG46MGL.js +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkNAYD76QF_cjs = require('./chunk-NAYD76QF.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkO446Q45G_cjs = require('./chunk-O446Q45G.cjs');
|
|
5
5
|
var chunkRCQ2HIQD_cjs = require('./chunk-RCQ2HIQD.cjs');
|
|
6
6
|
var jwt = require('hono/jwt');
|
|
7
7
|
var cookie = require('hono/cookie');
|
|
@@ -20,7 +20,7 @@ function bootstrapMiddleware(config = {}) {
|
|
|
20
20
|
try {
|
|
21
21
|
console.log("[Bootstrap] Starting system initialization...");
|
|
22
22
|
console.log("[Bootstrap] Running database migrations...");
|
|
23
|
-
const migrationService = new
|
|
23
|
+
const migrationService = new chunkO446Q45G_cjs.MigrationService(c.env.DB);
|
|
24
24
|
await migrationService.runPendingMigrations();
|
|
25
25
|
console.log("[Bootstrap] Syncing collection configurations...");
|
|
26
26
|
try {
|
|
@@ -239,5 +239,5 @@ exports.requirePermission = requirePermission;
|
|
|
239
239
|
exports.requireRole = requireRole;
|
|
240
240
|
exports.securityHeaders = securityHeaders;
|
|
241
241
|
exports.securityLoggingMiddleware = securityLoggingMiddleware;
|
|
242
|
-
//# sourceMappingURL=chunk-
|
|
243
|
-
//# sourceMappingURL=chunk-
|
|
242
|
+
//# sourceMappingURL=chunk-YLFQXTTX.cjs.map
|
|
243
|
+
//# sourceMappingURL=chunk-YLFQXTTX.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/middleware/bootstrap.ts","../src/middleware/auth.ts","../src/middleware/metrics.ts","../src/middleware/index.ts"],"names":["MigrationService","syncCollections","PluginBootstrapService","sign","verify","setCookie","getCookie","metricsTracker"],"mappings":";;;;;;;;;AAYA,IAAI,iBAAA,GAAoB,KAAA;AAMjB,SAAS,mBAAA,CAAoB,MAAA,GAAwB,EAAC,EAAG;AAC9D,EAAA,OAAO,OAAO,GAAoC,IAAA,KAAe;AAE/D,IAAA,IAAI,iBAAA,EAAmB;AACrB,MAAA,OAAO,IAAA,EAAK;AAAA,IACd;AAGA,IAAA,MAAM,IAAA,GAAO,EAAE,GAAA,CAAI,IAAA;AACnB,IAAA,IACE,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,IAC1B,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,IAC1B,IAAA,KAAS,SAAA,IACT,IAAA,CAAK,QAAA,CAAS,KAAK,CAAA,IACnB,IAAA,CAAK,QAAA,CAAS,MAAM,CAAA,IACpB,IAAA,CAAK,QAAA,CAAS,MAAM,CAAA,IACpB,IAAA,CAAK,QAAA,CAAS,MAAM,CAAA,IACpB,IAAA,CAAK,QAAA,CAAS,MAAM,CAAA,EACpB;AACA,MAAA,OAAO,IAAA,EAAK;AAAA,IACd;AAEA,IAAA,IAAI;AACF,MAAA,OAAA,CAAQ,IAAI,+CAA+C,CAAA;AAG3D,MAAA,OAAA,CAAQ,IAAI,4CAA4C,CAAA;AACxD,MAAA,MAAM,gBAAA,GAAmB,IAAIA,kCAAA,CAAiB,CAAA,CAAE,IAAI,EAAE,CAAA;AACtD,MAAA,MAAM,iBAAiB,oBAAA,EAAqB;AAG5C,MAAA,OAAA,CAAQ,IAAI,kDAAkD,CAAA;AAC9D,MAAA,IAAI;AACF,QAAA,MAAMC,iCAAA,CAAgB,CAAA,CAAE,GAAA,CAAI,EAAE,CAAA;AAAA,MAChC,SAAS,KAAA,EAAO;AACd,QAAA,OAAA,CAAQ,KAAA,CAAM,0CAA0C,KAAK,C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IAAM,qBAAA,GAA6B,OAAO,EAAA,EAAS,IAAA,KAAc,MAAM,IAAA;AACvE,IAAM,kBAAuB,MAAM,OAAO,EAAA,EAAS,IAAA,KAAc,MAAM,IAAA;AAGvE,IAAM,oBAAyB;AAC/B,IAAM,oBAAyB,MAAM,OAAO,EAAA,EAAS,IAAA,KAAc,MAAM,IAAA;AACzE,IAAM,uBAA4B,MAAM,OAAO,EAAA,EAAS,IAAA,KAAc,MAAM,IAAA;AAC5E,IAAM,cAAmB,MAAM;AAAC;AAChC,IAAM,sBAA2B,MAAM,OAAO,EAAA,EAAS,IAAA,KAAc,MAAM,IAAA;AAC3E,IAAM,uBAA4B,MAAM,OAAO,EAAA,EAAS,IAAA,KAAc,MAAM,IAAA;AAC5E,IAAM,gBAAA,GAAwB,MAAM;AACpC,IAAM,iBAAsB,MAAM","file":"chunk-DAKMORAN.cjs","sourcesContent":["import { Context, Next } from \"hono\";\nimport { syncCollections } from \"../services/collection-sync\";\nimport { MigrationService } from \"../services/migrations\";\nimport { PluginBootstrapService } from \"../services/plugin-bootstrap\";\nimport type { SonicJSConfig } from \"../app\";\n\ntype Bindings = {\n DB: D1Database;\n KV: KVNamespace;\n};\n\n// Track if bootstrap has been run in this worker instance\nlet bootstrapComplete = false;\n\n/**\n * Bootstrap middleware that ensures system initialization\n * Runs once per worker instance\n */\nexport function bootstrapMiddleware(config: SonicJSConfig = {}) {\n return async (c: Context<{ Bindings: Bindings }>, next: Next) => {\n // Skip if already bootstrapped in this worker instance\n if (bootstrapComplete) {\n return next();\n }\n\n // Skip bootstrap for static assets and health checks\n const path = c.req.path;\n if (\n path.startsWith(\"/images/\") ||\n path.startsWith(\"/assets/\") ||\n path === \"/health\" ||\n path.endsWith(\".js\") ||\n path.endsWith(\".css\") ||\n path.endsWith(\".png\") ||\n path.endsWith(\".jpg\") ||\n path.endsWith(\".ico\")\n ) {\n return next();\n }\n\n try {\n console.log(\"[Bootstrap] Starting system initialization...\");\n\n // 1. Run database migrations first\n console.log(\"[Bootstrap] Running database migrations...\");\n const migrationService = new MigrationService(c.env.DB);\n await migrationService.runPendingMigrations();\n\n // 2. Sync collection configurations\n console.log(\"[Bootstrap] Syncing collection configurations...\");\n try {\n await syncCollections(c.env.DB);\n } catch (error) {\n console.error(\"[Bootstrap] Error syncing collections:\", error);\n // Continue bootstrap even if collection sync fails\n }\n\n // 3. Bootstrap core plugins (unless disableAll is set)\n if (!config.plugins?.disableAll) {\n console.log(\"[Bootstrap] Bootstrapping core plugins...\");\n const bootstrapService = new PluginBootstrapService(c.env.DB);\n\n // Check if bootstrap is needed\n const needsBootstrap = await bootstrapService.isBootstrapNeeded();\n if (needsBootstrap) {\n await bootstrapService.bootstrapCorePlugins();\n }\n } else {\n console.log(\"[Bootstrap] Plugin bootstrap skipped (disableAll is true)\");\n }\n\n // Mark bootstrap as complete for this worker instance\n bootstrapComplete = true;\n console.log(\"[Bootstrap] System initialization completed\");\n } catch (error) {\n console.error(\"[Bootstrap] Error during system initialization:\", error);\n // Don't prevent the app from starting, but log the error\n }\n\n return next();\n };\n}\n\n/**\n * Reset bootstrap flag (useful for testing)\n */\nexport function resetBootstrap() {\n bootstrapComplete = false;\n}\n","import { sign, verify } from 'hono/jwt'\nimport { Context, Next } from 'hono'\nimport { getCookie, setCookie } from 'hono/cookie'\n\ntype JWTPayload = {\n userId: string\n email: string\n role: string\n exp: number\n iat: number\n}\n\n// JWT secret - in production this should come from environment variables\nconst JWT_SECRET = 'your-super-secret-jwt-key-change-in-production'\n\nexport class AuthManager {\n static async generateToken(userId: string, email: string, role: string): Promise<string> {\n const payload: JWTPayload = {\n userId,\n email,\n role,\n exp: Math.floor(Date.now() / 1000) + (60 * 60 * 24), // 24 hours\n iat: Math.floor(Date.now() / 1000)\n }\n \n return await sign(payload, JWT_SECRET)\n }\n\n static async verifyToken(token: string): Promise<JWTPayload | null> {\n try {\n const payload = await verify(token, JWT_SECRET) as JWTPayload\n \n // Check if token is expired\n if (payload.exp < Math.floor(Date.now() / 1000)) {\n return null\n }\n \n return payload\n } catch (error) {\n console.error('Token verification failed:', error)\n return null\n }\n }\n\n static async hashPassword(password: string): Promise<string> {\n // In Cloudflare Workers, we'll use Web Crypto API\n const encoder = new TextEncoder()\n const data = encoder.encode(password + 'salt-change-in-production')\n const hashBuffer = await crypto.subtle.digest('SHA-256', data)\n const hashArray = Array.from(new Uint8Array(hashBuffer))\n return hashArray.map(b => b.toString(16).padStart(2, '0')).join('')\n }\n\n static async verifyPassword(password: string, hash: string): Promise<boolean> {\n const passwordHash = await this.hashPassword(password)\n return passwordHash === hash\n }\n\n /**\n * Set authentication cookie - useful for plugins implementing alternative auth methods\n * @param c - Hono context\n * @param token - JWT token to set in cookie\n * @param options - Optional cookie configuration\n */\n static setAuthCookie(c: Context, token: string, options?: {\n maxAge?: number\n secure?: boolean\n httpOnly?: boolean\n sameSite?: 'Strict' | 'Lax' | 'None'\n }): void {\n setCookie(c, 'auth_token', token, {\n httpOnly: options?.httpOnly ?? true,\n secure: options?.secure ?? true,\n sameSite: options?.sameSite ?? 'Strict',\n maxAge: options?.maxAge ?? (60 * 60 * 24) // 24 hours default\n })\n }\n}\n\n// Middleware to require authentication\nexport const requireAuth = () => {\n return async (c: Context, next: Next) => {\n try {\n // Try to get token from Authorization header\n let token = c.req.header('Authorization')?.replace('Bearer ', '')\n\n // If no header token, try cookie\n if (!token) {\n token = getCookie(c, 'auth_token')\n }\n\n if (!token) {\n // Check if this is a browser request (HTML accept header)\n const acceptHeader = c.req.header('Accept') || ''\n if (acceptHeader.includes('text/html')) {\n return c.redirect('/auth/login?error=Please login to access the admin area')\n }\n return c.json({ error: 'Authentication required' }, 401)\n }\n\n // Try to get cached token verification from KV\n const kv = c.env?.KV\n let payload: JWTPayload | null = null\n\n if (kv) {\n const cacheKey = `auth:${token.substring(0, 20)}` // Use token prefix as key\n const cached = await kv.get(cacheKey, 'json')\n if (cached) {\n payload = cached as JWTPayload\n }\n }\n\n // If not cached, verify token\n if (!payload) {\n payload = await AuthManager.verifyToken(token)\n\n // Cache the verified payload for 5 minutes\n if (payload && kv) {\n const cacheKey = `auth:${token.substring(0, 20)}`\n await kv.put(cacheKey, JSON.stringify(payload), { expirationTtl: 300 })\n }\n }\n\n if (!payload) {\n // Check if this is a browser request (HTML accept header)\n const acceptHeader = c.req.header('Accept') || ''\n if (acceptHeader.includes('text/html')) {\n return c.redirect('/auth/login?error=Your session has expired, please login again')\n }\n return c.json({ error: 'Invalid or expired token' }, 401)\n }\n\n // Add user info to context\n c.set('user', payload)\n\n return await next()\n } catch (error) {\n console.error('Auth middleware error:', error)\n // Check if this is a browser request (HTML accept header)\n const acceptHeader = c.req.header('Accept') || ''\n if (acceptHeader.includes('text/html')) {\n return c.redirect('/auth/login?error=Authentication failed, please login again')\n }\n return c.json({ error: 'Authentication failed' }, 401)\n }\n }\n}\n\n// Middleware to require specific role\nexport const requireRole = (requiredRole: string | string[]) => {\n return async (c: Context, next: Next) => {\n const user = c.get('user') as JWTPayload\n \n if (!user) {\n // Check if this is a browser request (HTML accept header)\n const acceptHeader = c.req.header('Accept') || ''\n if (acceptHeader.includes('text/html')) {\n return c.redirect('/auth/login?error=Please login to access the admin area')\n }\n return c.json({ error: 'Authentication required' }, 401)\n }\n \n const roles = Array.isArray(requiredRole) ? requiredRole : [requiredRole]\n \n if (!roles.includes(user.role)) {\n // Check if this is a browser request (HTML accept header)\n const acceptHeader = c.req.header('Accept') || ''\n if (acceptHeader.includes('text/html')) {\n return c.redirect('/auth/login?error=You do not have permission to access this area')\n }\n return c.json({ error: 'Insufficient permissions' }, 403)\n }\n \n return await next()\n }\n}\n\n// Optional auth middleware (doesn't block if no token)\nexport const optionalAuth = () => {\n return async (c: Context, next: Next) => {\n try {\n let token = c.req.header('Authorization')?.replace('Bearer ', '')\n \n if (!token) {\n token = getCookie(c, 'auth_token')\n }\n \n if (token) {\n const payload = await AuthManager.verifyToken(token)\n if (payload) {\n c.set('user', payload)\n }\n }\n \n return await next()\n } catch (error) {\n // Don't block on auth errors in optional auth\n console.error('Optional auth error:', error)\n return await next()\n }\n }\n}","import { MiddlewareHandler } from 'hono'\nimport { metricsTracker } from '../utils/metrics'\n\n/**\n * Middleware to track all HTTP requests for real-time analytics\n * Excludes the metrics endpoint itself to avoid inflating the count\n */\nexport const metricsMiddleware = (): MiddlewareHandler => {\n return async (c, next) => {\n const path = new URL(c.req.url).pathname\n\n // Don't track the metrics endpoint itself to avoid self-inflating counts\n if (path !== '/admin/dashboard/api/metrics') {\n metricsTracker.recordRequest()\n }\n\n // Continue with the request\n await next()\n }\n}\n","/**\n * Middleware Module Exports\n *\n * Request processing middleware for SonicJS\n *\n * Note: Most middleware is currently in the monolith and will be migrated later.\n * For now, we only export the bootstrap middleware which is used for system initialization.\n */\n\n// Bootstrap middleware\nexport { bootstrapMiddleware } from './bootstrap'\n\n// Auth middleware\nexport { AuthManager, requireAuth, requireRole, optionalAuth } from './auth'\n\n// Metrics middleware\nexport { metricsMiddleware } from './metrics'\n\n// Re-export types and functions that are referenced but implemented in monolith\n// These are placeholder exports to maintain API compatibility\nexport type Permission = string\nexport type UserPermissions = {\n userId: string\n permissions: Permission[]\n}\n\n// Middleware stubs - these return pass-through middleware that call next()\nexport const loggingMiddleware: any = () => async (_c: any, next: any) => await next()\nexport const detailedLoggingMiddleware: any = () => async (_c: any, next: any) => await next()\nexport const securityLoggingMiddleware: any = () => async (_c: any, next: any) => await next()\nexport const performanceLoggingMiddleware: any = () => async (_c: any, next: any) => await next()\nexport const cacheHeaders: any = () => async (_c: any, next: any) => await next()\nexport const compressionMiddleware: any = async (_c: any, next: any) => await next()\nexport const securityHeaders: any = () => async (_c: any, next: any) => await next()\n\n// Other stubs\nexport const PermissionManager: any = {}\nexport const requirePermission: any = () => async (_c: any, next: any) => await next()\nexport const requireAnyPermission: any = () => async (_c: any, next: any) => await next()\nexport const logActivity: any = () => {}\nexport const requireActivePlugin: any = () => async (_c: any, next: any) => await next()\nexport const requireActivePlugins: any = () => async (_c: any, next: any) => await next()\nexport const getActivePlugins: any = () => []\nexport const isPluginActive: any = () => false\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/middleware/bootstrap.ts","../src/middleware/auth.ts","../src/middleware/metrics.ts","../src/middleware/index.ts"],"names":["MigrationService","syncCollections","PluginBootstrapService","sign","verify","setCookie","getCookie","metricsTracker"],"mappings":";;;;;;;;;AAYA,IAAI,iBAAA,GAAoB,KAAA;AAMjB,SAAS,mBAAA,CAAoB,MAAA,GAAwB,EAAC,EAAG;AAC9D,EAAA,OAAO,OAAO,GAAoC,IAAA,KAAe;AAE/D,IAAA,IAAI,iBAAA,EAAmB;AACrB,MAAA,OAAO,IAAA,EAAK;AAAA,IACd;AAGA,IAAA,MAAM,IAAA,GAAO,EAAE,GAAA,CAAI,IAAA;AACnB,IAAA,IACE,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,IAC1B,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,IAC1B,IAAA,KAAS,SAAA,IACT,IAAA,CAAK,QAAA,CAAS,KAAK,CAAA,IACnB,IAAA,CAAK,QAAA,CAAS,MAAM,CAAA,IACpB,IAAA,CAAK,QAAA,CAAS,MAAM,CAAA,IACpB,IAAA,CAAK,QAAA,CAAS,MAAM,CAAA,IACpB,IAAA,CAAK,QAAA,CAAS,MAAM,CAAA,EACpB;AACA,MAAA,OAAO,IAAA,EAAK;AAAA,IACd;AAEA,IAAA,IAAI;AACF,MAAA,OAAA,CAAQ,IAAI,+CAA+C,CAAA;AAG3D,MAAA,OAAA,CAAQ,IAAI,4CAA4C,CAAA;AACxD,MAAA,MAAM,gBAAA,GAAmB,IAAIA,kCAAA,CAAiB,CAAA,CAAE,IAAI,EAAE,CAAA;AACtD,MAAA,MAAM,iBAAiB,oBAAA,EAAqB;AAG5C,MAAA,OAAA,CAAQ,IAAI,kDAAkD,CAAA;AAC9D,MAAA,IAAI;AACF,QAAA,MAAMC,iCAAA,CAAgB,CAAA,CAAE,GAAA,CAAI,EAAE,CAAA;AAAA,MAChC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pF,IAAM,eAAoB,MAAM,OAAO,EAAA,EAAS,IAAA,KAAc,MAAM,IAAA;AACpE,IAAM,qBAAA,GAA6B,OAAO,EAAA,EAAS,IAAA,KAAc,MAAM,IAAA;AACvE,IAAM,kBAAuB,MAAM,OAAO,EAAA,EAAS,IAAA,KAAc,MAAM,IAAA;AAGvE,IAAM,oBAAyB;AAC/B,IAAM,oBAAyB,MAAM,OAAO,EAAA,EAAS,IAAA,KAAc,MAAM,IAAA;AACzE,IAAM,uBAA4B,MAAM,OAAO,EAAA,EAAS,IAAA,KAAc,MAAM,IAAA;AAC5E,IAAM,cAAmB,MAAM;AAAC;AAChC,IAAM,sBAA2B,MAAM,OAAO,EAAA,EAAS,IAAA,KAAc,MAAM,IAAA;AAC3E,IAAM,uBAA4B,MAAM,OAAO,EAAA,EAAS,IAAA,KAAc,MAAM,IAAA;AAC5E,IAAM,gBAAA,GAAwB,MAAM;AACpC,IAAM,iBAAsB,MAAM","file":"chunk-YLFQXTTX.cjs","sourcesContent":["import { Context, Next } from \"hono\";\nimport { syncCollections } from \"../services/collection-sync\";\nimport { MigrationService } from \"../services/migrations\";\nimport { PluginBootstrapService } from \"../services/plugin-bootstrap\";\nimport type { SonicJSConfig } from \"../app\";\n\ntype Bindings = {\n DB: D1Database;\n KV: KVNamespace;\n};\n\n// Track if bootstrap has been run in this worker instance\nlet bootstrapComplete = false;\n\n/**\n * Bootstrap middleware that ensures system initialization\n * Runs once per worker instance\n */\nexport function bootstrapMiddleware(config: SonicJSConfig = {}) {\n return async (c: Context<{ Bindings: Bindings }>, next: Next) => {\n // Skip if already bootstrapped in this worker instance\n if (bootstrapComplete) {\n return next();\n }\n\n // Skip bootstrap for static assets and health checks\n const path = c.req.path;\n if (\n path.startsWith(\"/images/\") ||\n path.startsWith(\"/assets/\") ||\n path === \"/health\" ||\n path.endsWith(\".js\") ||\n path.endsWith(\".css\") ||\n path.endsWith(\".png\") ||\n path.endsWith(\".jpg\") ||\n path.endsWith(\".ico\")\n ) {\n return next();\n }\n\n try {\n console.log(\"[Bootstrap] Starting system initialization...\");\n\n // 1. Run database migrations first\n console.log(\"[Bootstrap] Running database migrations...\");\n const migrationService = new MigrationService(c.env.DB);\n await migrationService.runPendingMigrations();\n\n // 2. Sync collection configurations\n console.log(\"[Bootstrap] Syncing collection configurations...\");\n try {\n await syncCollections(c.env.DB);\n } catch (error) {\n console.error(\"[Bootstrap] Error syncing collections:\", error);\n // Continue bootstrap even if collection sync fails\n }\n\n // 3. Bootstrap core plugins (unless disableAll is set)\n if (!config.plugins?.disableAll) {\n console.log(\"[Bootstrap] Bootstrapping core plugins...\");\n const bootstrapService = new PluginBootstrapService(c.env.DB);\n\n // Check if bootstrap is needed\n const needsBootstrap = await bootstrapService.isBootstrapNeeded();\n if (needsBootstrap) {\n await bootstrapService.bootstrapCorePlugins();\n }\n } else {\n console.log(\"[Bootstrap] Plugin bootstrap skipped (disableAll is true)\");\n }\n\n // Mark bootstrap as complete for this worker instance\n bootstrapComplete = true;\n console.log(\"[Bootstrap] System initialization completed\");\n } catch (error) {\n console.error(\"[Bootstrap] Error during system initialization:\", error);\n // Don't prevent the app from starting, but log the error\n }\n\n return next();\n };\n}\n\n/**\n * Reset bootstrap flag (useful for testing)\n */\nexport function resetBootstrap() {\n bootstrapComplete = false;\n}\n","import { sign, verify } from 'hono/jwt'\nimport { Context, Next } from 'hono'\nimport { getCookie, setCookie } from 'hono/cookie'\n\ntype JWTPayload = {\n userId: string\n email: string\n role: string\n exp: number\n iat: number\n}\n\n// JWT secret - in production this should come from environment variables\nconst JWT_SECRET = 'your-super-secret-jwt-key-change-in-production'\n\nexport class AuthManager {\n static async generateToken(userId: string, email: string, role: string): Promise<string> {\n const payload: JWTPayload = {\n userId,\n email,\n role,\n exp: Math.floor(Date.now() / 1000) + (60 * 60 * 24), // 24 hours\n iat: Math.floor(Date.now() / 1000)\n }\n \n return await sign(payload, JWT_SECRET)\n }\n\n static async verifyToken(token: string): Promise<JWTPayload | null> {\n try {\n const payload = await verify(token, JWT_SECRET) as JWTPayload\n \n // Check if token is expired\n if (payload.exp < Math.floor(Date.now() / 1000)) {\n return null\n }\n \n return payload\n } catch (error) {\n console.error('Token verification failed:', error)\n return null\n }\n }\n\n static async hashPassword(password: string): Promise<string> {\n // In Cloudflare Workers, we'll use Web Crypto API\n const encoder = new TextEncoder()\n const data = encoder.encode(password + 'salt-change-in-production')\n const hashBuffer = await crypto.subtle.digest('SHA-256', data)\n const hashArray = Array.from(new Uint8Array(hashBuffer))\n return hashArray.map(b => b.toString(16).padStart(2, '0')).join('')\n }\n\n static async verifyPassword(password: string, hash: string): Promise<boolean> {\n const passwordHash = await this.hashPassword(password)\n return passwordHash === hash\n }\n\n /**\n * Set authentication cookie - useful for plugins implementing alternative auth methods\n * @param c - Hono context\n * @param token - JWT token to set in cookie\n * @param options - Optional cookie configuration\n */\n static setAuthCookie(c: Context, token: string, options?: {\n maxAge?: number\n secure?: boolean\n httpOnly?: boolean\n sameSite?: 'Strict' | 'Lax' | 'None'\n }): void {\n setCookie(c, 'auth_token', token, {\n httpOnly: options?.httpOnly ?? true,\n secure: options?.secure ?? true,\n sameSite: options?.sameSite ?? 'Strict',\n maxAge: options?.maxAge ?? (60 * 60 * 24) // 24 hours default\n })\n }\n}\n\n// Middleware to require authentication\nexport const requireAuth = () => {\n return async (c: Context, next: Next) => {\n try {\n // Try to get token from Authorization header\n let token = c.req.header('Authorization')?.replace('Bearer ', '')\n\n // If no header token, try cookie\n if (!token) {\n token = getCookie(c, 'auth_token')\n }\n\n if (!token) {\n // Check if this is a browser request (HTML accept header)\n const acceptHeader = c.req.header('Accept') || ''\n if (acceptHeader.includes('text/html')) {\n return c.redirect('/auth/login?error=Please login to access the admin area')\n }\n return c.json({ error: 'Authentication required' }, 401)\n }\n\n // Try to get cached token verification from KV\n const kv = c.env?.KV\n let payload: JWTPayload | null = null\n\n if (kv) {\n const cacheKey = `auth:${token.substring(0, 20)}` // Use token prefix as key\n const cached = await kv.get(cacheKey, 'json')\n if (cached) {\n payload = cached as JWTPayload\n }\n }\n\n // If not cached, verify token\n if (!payload) {\n payload = await AuthManager.verifyToken(token)\n\n // Cache the verified payload for 5 minutes\n if (payload && kv) {\n const cacheKey = `auth:${token.substring(0, 20)}`\n await kv.put(cacheKey, JSON.stringify(payload), { expirationTtl: 300 })\n }\n }\n\n if (!payload) {\n // Check if this is a browser request (HTML accept header)\n const acceptHeader = c.req.header('Accept') || ''\n if (acceptHeader.includes('text/html')) {\n return c.redirect('/auth/login?error=Your session has expired, please login again')\n }\n return c.json({ error: 'Invalid or expired token' }, 401)\n }\n\n // Add user info to context\n c.set('user', payload)\n\n return await next()\n } catch (error) {\n console.error('Auth middleware error:', error)\n // Check if this is a browser request (HTML accept header)\n const acceptHeader = c.req.header('Accept') || ''\n if (acceptHeader.includes('text/html')) {\n return c.redirect('/auth/login?error=Authentication failed, please login again')\n }\n return c.json({ error: 'Authentication failed' }, 401)\n }\n }\n}\n\n// Middleware to require specific role\nexport const requireRole = (requiredRole: string | string[]) => {\n return async (c: Context, next: Next) => {\n const user = c.get('user') as JWTPayload\n \n if (!user) {\n // Check if this is a browser request (HTML accept header)\n const acceptHeader = c.req.header('Accept') || ''\n if (acceptHeader.includes('text/html')) {\n return c.redirect('/auth/login?error=Please login to access the admin area')\n }\n return c.json({ error: 'Authentication required' }, 401)\n }\n \n const roles = Array.isArray(requiredRole) ? requiredRole : [requiredRole]\n \n if (!roles.includes(user.role)) {\n // Check if this is a browser request (HTML accept header)\n const acceptHeader = c.req.header('Accept') || ''\n if (acceptHeader.includes('text/html')) {\n return c.redirect('/auth/login?error=You do not have permission to access this area')\n }\n return c.json({ error: 'Insufficient permissions' }, 403)\n }\n \n return await next()\n }\n}\n\n// Optional auth middleware (doesn't block if no token)\nexport const optionalAuth = () => {\n return async (c: Context, next: Next) => {\n try {\n let token = c.req.header('Authorization')?.replace('Bearer ', '')\n \n if (!token) {\n token = getCookie(c, 'auth_token')\n }\n \n if (token) {\n const payload = await AuthManager.verifyToken(token)\n if (payload) {\n c.set('user', payload)\n }\n }\n \n return await next()\n } catch (error) {\n // Don't block on auth errors in optional auth\n console.error('Optional auth error:', error)\n return await next()\n }\n }\n}","import { MiddlewareHandler } from 'hono'\nimport { metricsTracker } from '../utils/metrics'\n\n/**\n * Middleware to track all HTTP requests for real-time analytics\n * Excludes the metrics endpoint itself to avoid inflating the count\n */\nexport const metricsMiddleware = (): MiddlewareHandler => {\n return async (c, next) => {\n const path = new URL(c.req.url).pathname\n\n // Don't track the metrics endpoint itself to avoid self-inflating counts\n if (path !== '/admin/dashboard/api/metrics') {\n metricsTracker.recordRequest()\n }\n\n // Continue with the request\n await next()\n }\n}\n","/**\n * Middleware Module Exports\n *\n * Request processing middleware for SonicJS\n *\n * Note: Most middleware is currently in the monolith and will be migrated later.\n * For now, we only export the bootstrap middleware which is used for system initialization.\n */\n\n// Bootstrap middleware\nexport { bootstrapMiddleware } from './bootstrap'\n\n// Auth middleware\nexport { AuthManager, requireAuth, requireRole, optionalAuth } from './auth'\n\n// Metrics middleware\nexport { metricsMiddleware } from './metrics'\n\n// Re-export types and functions that are referenced but implemented in monolith\n// These are placeholder exports to maintain API compatibility\nexport type Permission = string\nexport type UserPermissions = {\n userId: string\n permissions: Permission[]\n}\n\n// Middleware stubs - these return pass-through middleware that call next()\nexport const loggingMiddleware: any = () => async (_c: any, next: any) => await next()\nexport const detailedLoggingMiddleware: any = () => async (_c: any, next: any) => await next()\nexport const securityLoggingMiddleware: any = () => async (_c: any, next: any) => await next()\nexport const performanceLoggingMiddleware: any = () => async (_c: any, next: any) => await next()\nexport const cacheHeaders: any = () => async (_c: any, next: any) => await next()\nexport const compressionMiddleware: any = async (_c: any, next: any) => await next()\nexport const securityHeaders: any = () => async (_c: any, next: any) => await next()\n\n// Other stubs\nexport const PermissionManager: any = {}\nexport const requirePermission: any = () => async (_c: any, next: any) => await next()\nexport const requireAnyPermission: any = () => async (_c: any, next: any) => await next()\nexport const logActivity: any = () => {}\nexport const requireActivePlugin: any = () => async (_c: any, next: any) => await next()\nexport const requireActivePlugins: any = () => async (_c: any, next: any) => await next()\nexport const getActivePlugins: any = () => []\nexport const isPluginActive: any = () => false\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkT7HDJE2H_cjs = require('./chunk-T7HDJE2H.cjs');
|
|
4
4
|
var chunkES3BRZQJ_cjs = require('./chunk-ES3BRZQJ.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkYLFQXTTX_cjs = require('./chunk-YLFQXTTX.cjs');
|
|
6
6
|
var chunkNAYD76QF_cjs = require('./chunk-NAYD76QF.cjs');
|
|
7
|
-
var
|
|
7
|
+
var chunkO446Q45G_cjs = require('./chunk-O446Q45G.cjs');
|
|
8
8
|
var chunkZMSYKV62_cjs = require('./chunk-ZMSYKV62.cjs');
|
|
9
9
|
var chunkYU6QFFI4_cjs = require('./chunk-YU6QFFI4.cjs');
|
|
10
10
|
var chunkDTLB6UIH_cjs = require('./chunk-DTLB6UIH.cjs');
|
|
11
|
-
var
|
|
11
|
+
var chunkN3EHA3AX_cjs = require('./chunk-N3EHA3AX.cjs');
|
|
12
12
|
require('./chunk-7KCDFDRI.cjs');
|
|
13
13
|
var chunkRCQ2HIQD_cjs = require('./chunk-RCQ2HIQD.cjs');
|
|
14
14
|
var chunkKYGRJCZM_cjs = require('./chunk-KYGRJCZM.cjs');
|
|
@@ -556,7 +556,7 @@ function formatCellValue(value) {
|
|
|
556
556
|
// src/plugins/core-plugins/database-tools-plugin/admin-routes.ts
|
|
557
557
|
function createDatabaseToolsAdminRoutes() {
|
|
558
558
|
const router2 = new hono.Hono();
|
|
559
|
-
router2.use("*",
|
|
559
|
+
router2.use("*", chunkYLFQXTTX_cjs.requireAuth());
|
|
560
560
|
router2.get("/api/stats", async (c) => {
|
|
561
561
|
try {
|
|
562
562
|
const user = c.get("user");
|
|
@@ -737,7 +737,7 @@ function createDatabaseToolsAdminRoutes() {
|
|
|
737
737
|
return router2;
|
|
738
738
|
}
|
|
739
739
|
function createEmailPlugin() {
|
|
740
|
-
const builder =
|
|
740
|
+
const builder = chunkT7HDJE2H_cjs.PluginBuilder.create({
|
|
741
741
|
name: "email",
|
|
742
742
|
version: "1.0.0-beta.1",
|
|
743
743
|
description: "Send transactional emails using Resend"
|
|
@@ -1113,14 +1113,14 @@ var emailPlugin = createEmailPlugin();
|
|
|
1113
1113
|
// src/app.ts
|
|
1114
1114
|
function createSonicJSApp(config = {}) {
|
|
1115
1115
|
const app = new hono.Hono();
|
|
1116
|
-
const appVersion = config.version ||
|
|
1116
|
+
const appVersion = config.version || chunkN3EHA3AX_cjs.getCoreVersion();
|
|
1117
1117
|
const appName = config.name || "SonicJS AI";
|
|
1118
1118
|
app.use("*", async (c, next) => {
|
|
1119
1119
|
c.set("appVersion", appVersion);
|
|
1120
1120
|
await next();
|
|
1121
1121
|
});
|
|
1122
|
-
app.use("*",
|
|
1123
|
-
app.use("*",
|
|
1122
|
+
app.use("*", chunkYLFQXTTX_cjs.metricsMiddleware());
|
|
1123
|
+
app.use("*", chunkYLFQXTTX_cjs.bootstrapMiddleware(config));
|
|
1124
1124
|
if (config.middleware?.beforeAuth) {
|
|
1125
1125
|
for (const middleware of config.middleware.beforeAuth) {
|
|
1126
1126
|
app.use("*", middleware);
|
|
@@ -1137,21 +1137,21 @@ function createSonicJSApp(config = {}) {
|
|
|
1137
1137
|
app.use("*", middleware);
|
|
1138
1138
|
}
|
|
1139
1139
|
}
|
|
1140
|
-
app.route("/api",
|
|
1141
|
-
app.route("/api/media",
|
|
1142
|
-
app.route("/api/system",
|
|
1143
|
-
app.route("/admin/api",
|
|
1144
|
-
app.route("/admin/dashboard",
|
|
1145
|
-
app.route("/admin/collections",
|
|
1146
|
-
app.route("/admin/settings",
|
|
1140
|
+
app.route("/api", chunkT7HDJE2H_cjs.api_default);
|
|
1141
|
+
app.route("/api/media", chunkT7HDJE2H_cjs.api_media_default);
|
|
1142
|
+
app.route("/api/system", chunkT7HDJE2H_cjs.api_system_default);
|
|
1143
|
+
app.route("/admin/api", chunkT7HDJE2H_cjs.admin_api_default);
|
|
1144
|
+
app.route("/admin/dashboard", chunkT7HDJE2H_cjs.router);
|
|
1145
|
+
app.route("/admin/collections", chunkT7HDJE2H_cjs.adminCollectionsRoutes);
|
|
1146
|
+
app.route("/admin/settings", chunkT7HDJE2H_cjs.adminSettingsRoutes);
|
|
1147
1147
|
app.route("/admin/database-tools", createDatabaseToolsAdminRoutes());
|
|
1148
|
-
app.route("/admin/content",
|
|
1149
|
-
app.route("/admin/media",
|
|
1150
|
-
app.route("/admin/plugins",
|
|
1151
|
-
app.route("/admin/logs",
|
|
1152
|
-
app.route("/admin",
|
|
1153
|
-
app.route("/auth",
|
|
1154
|
-
app.route("/",
|
|
1148
|
+
app.route("/admin/content", chunkT7HDJE2H_cjs.admin_content_default);
|
|
1149
|
+
app.route("/admin/media", chunkT7HDJE2H_cjs.adminMediaRoutes);
|
|
1150
|
+
app.route("/admin/plugins", chunkT7HDJE2H_cjs.adminPluginRoutes);
|
|
1151
|
+
app.route("/admin/logs", chunkT7HDJE2H_cjs.adminLogsRoutes);
|
|
1152
|
+
app.route("/admin", chunkT7HDJE2H_cjs.userRoutes);
|
|
1153
|
+
app.route("/auth", chunkT7HDJE2H_cjs.auth_default);
|
|
1154
|
+
app.route("/", chunkT7HDJE2H_cjs.test_cleanup_default);
|
|
1155
1155
|
if (emailPlugin.routes && emailPlugin.routes.length > 0) {
|
|
1156
1156
|
for (const route of emailPlugin.routes) {
|
|
1157
1157
|
app.route(route.path, route.handler);
|
|
@@ -1220,83 +1220,83 @@ function createDb(d1$1) {
|
|
|
1220
1220
|
}
|
|
1221
1221
|
|
|
1222
1222
|
// src/index.ts
|
|
1223
|
-
var VERSION =
|
|
1223
|
+
var VERSION = chunkN3EHA3AX_cjs.package_default.version;
|
|
1224
1224
|
|
|
1225
1225
|
Object.defineProperty(exports, "ROUTES_INFO", {
|
|
1226
1226
|
enumerable: true,
|
|
1227
|
-
get: function () { return
|
|
1227
|
+
get: function () { return chunkT7HDJE2H_cjs.ROUTES_INFO; }
|
|
1228
1228
|
});
|
|
1229
1229
|
Object.defineProperty(exports, "adminApiRoutes", {
|
|
1230
1230
|
enumerable: true,
|
|
1231
|
-
get: function () { return
|
|
1231
|
+
get: function () { return chunkT7HDJE2H_cjs.admin_api_default; }
|
|
1232
1232
|
});
|
|
1233
1233
|
Object.defineProperty(exports, "adminCheckboxRoutes", {
|
|
1234
1234
|
enumerable: true,
|
|
1235
|
-
get: function () { return
|
|
1235
|
+
get: function () { return chunkT7HDJE2H_cjs.adminCheckboxRoutes; }
|
|
1236
1236
|
});
|
|
1237
1237
|
Object.defineProperty(exports, "adminCodeExamplesRoutes", {
|
|
1238
1238
|
enumerable: true,
|
|
1239
|
-
get: function () { return
|
|
1239
|
+
get: function () { return chunkT7HDJE2H_cjs.admin_code_examples_default; }
|
|
1240
1240
|
});
|
|
1241
1241
|
Object.defineProperty(exports, "adminCollectionsRoutes", {
|
|
1242
1242
|
enumerable: true,
|
|
1243
|
-
get: function () { return
|
|
1243
|
+
get: function () { return chunkT7HDJE2H_cjs.adminCollectionsRoutes; }
|
|
1244
1244
|
});
|
|
1245
1245
|
Object.defineProperty(exports, "adminContentRoutes", {
|
|
1246
1246
|
enumerable: true,
|
|
1247
|
-
get: function () { return
|
|
1247
|
+
get: function () { return chunkT7HDJE2H_cjs.admin_content_default; }
|
|
1248
1248
|
});
|
|
1249
1249
|
Object.defineProperty(exports, "adminDashboardRoutes", {
|
|
1250
1250
|
enumerable: true,
|
|
1251
|
-
get: function () { return
|
|
1251
|
+
get: function () { return chunkT7HDJE2H_cjs.router; }
|
|
1252
1252
|
});
|
|
1253
1253
|
Object.defineProperty(exports, "adminDesignRoutes", {
|
|
1254
1254
|
enumerable: true,
|
|
1255
|
-
get: function () { return
|
|
1255
|
+
get: function () { return chunkT7HDJE2H_cjs.adminDesignRoutes; }
|
|
1256
1256
|
});
|
|
1257
1257
|
Object.defineProperty(exports, "adminLogsRoutes", {
|
|
1258
1258
|
enumerable: true,
|
|
1259
|
-
get: function () { return
|
|
1259
|
+
get: function () { return chunkT7HDJE2H_cjs.adminLogsRoutes; }
|
|
1260
1260
|
});
|
|
1261
1261
|
Object.defineProperty(exports, "adminMediaRoutes", {
|
|
1262
1262
|
enumerable: true,
|
|
1263
|
-
get: function () { return
|
|
1263
|
+
get: function () { return chunkT7HDJE2H_cjs.adminMediaRoutes; }
|
|
1264
1264
|
});
|
|
1265
1265
|
Object.defineProperty(exports, "adminPluginRoutes", {
|
|
1266
1266
|
enumerable: true,
|
|
1267
|
-
get: function () { return
|
|
1267
|
+
get: function () { return chunkT7HDJE2H_cjs.adminPluginRoutes; }
|
|
1268
1268
|
});
|
|
1269
1269
|
Object.defineProperty(exports, "adminSettingsRoutes", {
|
|
1270
1270
|
enumerable: true,
|
|
1271
|
-
get: function () { return
|
|
1271
|
+
get: function () { return chunkT7HDJE2H_cjs.adminSettingsRoutes; }
|
|
1272
1272
|
});
|
|
1273
1273
|
Object.defineProperty(exports, "adminTestimonialsRoutes", {
|
|
1274
1274
|
enumerable: true,
|
|
1275
|
-
get: function () { return
|
|
1275
|
+
get: function () { return chunkT7HDJE2H_cjs.admin_testimonials_default; }
|
|
1276
1276
|
});
|
|
1277
1277
|
Object.defineProperty(exports, "adminUsersRoutes", {
|
|
1278
1278
|
enumerable: true,
|
|
1279
|
-
get: function () { return
|
|
1279
|
+
get: function () { return chunkT7HDJE2H_cjs.userRoutes; }
|
|
1280
1280
|
});
|
|
1281
1281
|
Object.defineProperty(exports, "apiContentCrudRoutes", {
|
|
1282
1282
|
enumerable: true,
|
|
1283
|
-
get: function () { return
|
|
1283
|
+
get: function () { return chunkT7HDJE2H_cjs.api_content_crud_default; }
|
|
1284
1284
|
});
|
|
1285
1285
|
Object.defineProperty(exports, "apiMediaRoutes", {
|
|
1286
1286
|
enumerable: true,
|
|
1287
|
-
get: function () { return
|
|
1287
|
+
get: function () { return chunkT7HDJE2H_cjs.api_media_default; }
|
|
1288
1288
|
});
|
|
1289
1289
|
Object.defineProperty(exports, "apiRoutes", {
|
|
1290
1290
|
enumerable: true,
|
|
1291
|
-
get: function () { return
|
|
1291
|
+
get: function () { return chunkT7HDJE2H_cjs.api_default; }
|
|
1292
1292
|
});
|
|
1293
1293
|
Object.defineProperty(exports, "apiSystemRoutes", {
|
|
1294
1294
|
enumerable: true,
|
|
1295
|
-
get: function () { return
|
|
1295
|
+
get: function () { return chunkT7HDJE2H_cjs.api_system_default; }
|
|
1296
1296
|
});
|
|
1297
1297
|
Object.defineProperty(exports, "authRoutes", {
|
|
1298
1298
|
enumerable: true,
|
|
1299
|
-
get: function () { return
|
|
1299
|
+
get: function () { return chunkT7HDJE2H_cjs.auth_default; }
|
|
1300
1300
|
});
|
|
1301
1301
|
Object.defineProperty(exports, "Logger", {
|
|
1302
1302
|
enumerable: true,
|
|
@@ -1464,83 +1464,83 @@ Object.defineProperty(exports, "workflowHistory", {
|
|
|
1464
1464
|
});
|
|
1465
1465
|
Object.defineProperty(exports, "AuthManager", {
|
|
1466
1466
|
enumerable: true,
|
|
1467
|
-
get: function () { return
|
|
1467
|
+
get: function () { return chunkYLFQXTTX_cjs.AuthManager; }
|
|
1468
1468
|
});
|
|
1469
1469
|
Object.defineProperty(exports, "PermissionManager", {
|
|
1470
1470
|
enumerable: true,
|
|
1471
|
-
get: function () { return
|
|
1471
|
+
get: function () { return chunkYLFQXTTX_cjs.PermissionManager; }
|
|
1472
1472
|
});
|
|
1473
1473
|
Object.defineProperty(exports, "bootstrapMiddleware", {
|
|
1474
1474
|
enumerable: true,
|
|
1475
|
-
get: function () { return
|
|
1475
|
+
get: function () { return chunkYLFQXTTX_cjs.bootstrapMiddleware; }
|
|
1476
1476
|
});
|
|
1477
1477
|
Object.defineProperty(exports, "cacheHeaders", {
|
|
1478
1478
|
enumerable: true,
|
|
1479
|
-
get: function () { return
|
|
1479
|
+
get: function () { return chunkYLFQXTTX_cjs.cacheHeaders; }
|
|
1480
1480
|
});
|
|
1481
1481
|
Object.defineProperty(exports, "compressionMiddleware", {
|
|
1482
1482
|
enumerable: true,
|
|
1483
|
-
get: function () { return
|
|
1483
|
+
get: function () { return chunkYLFQXTTX_cjs.compressionMiddleware; }
|
|
1484
1484
|
});
|
|
1485
1485
|
Object.defineProperty(exports, "detailedLoggingMiddleware", {
|
|
1486
1486
|
enumerable: true,
|
|
1487
|
-
get: function () { return
|
|
1487
|
+
get: function () { return chunkYLFQXTTX_cjs.detailedLoggingMiddleware; }
|
|
1488
1488
|
});
|
|
1489
1489
|
Object.defineProperty(exports, "getActivePlugins", {
|
|
1490
1490
|
enumerable: true,
|
|
1491
|
-
get: function () { return
|
|
1491
|
+
get: function () { return chunkYLFQXTTX_cjs.getActivePlugins; }
|
|
1492
1492
|
});
|
|
1493
1493
|
Object.defineProperty(exports, "isPluginActive", {
|
|
1494
1494
|
enumerable: true,
|
|
1495
|
-
get: function () { return
|
|
1495
|
+
get: function () { return chunkYLFQXTTX_cjs.isPluginActive; }
|
|
1496
1496
|
});
|
|
1497
1497
|
Object.defineProperty(exports, "logActivity", {
|
|
1498
1498
|
enumerable: true,
|
|
1499
|
-
get: function () { return
|
|
1499
|
+
get: function () { return chunkYLFQXTTX_cjs.logActivity; }
|
|
1500
1500
|
});
|
|
1501
1501
|
Object.defineProperty(exports, "loggingMiddleware", {
|
|
1502
1502
|
enumerable: true,
|
|
1503
|
-
get: function () { return
|
|
1503
|
+
get: function () { return chunkYLFQXTTX_cjs.loggingMiddleware; }
|
|
1504
1504
|
});
|
|
1505
1505
|
Object.defineProperty(exports, "optionalAuth", {
|
|
1506
1506
|
enumerable: true,
|
|
1507
|
-
get: function () { return
|
|
1507
|
+
get: function () { return chunkYLFQXTTX_cjs.optionalAuth; }
|
|
1508
1508
|
});
|
|
1509
1509
|
Object.defineProperty(exports, "performanceLoggingMiddleware", {
|
|
1510
1510
|
enumerable: true,
|
|
1511
|
-
get: function () { return
|
|
1511
|
+
get: function () { return chunkYLFQXTTX_cjs.performanceLoggingMiddleware; }
|
|
1512
1512
|
});
|
|
1513
1513
|
Object.defineProperty(exports, "requireActivePlugin", {
|
|
1514
1514
|
enumerable: true,
|
|
1515
|
-
get: function () { return
|
|
1515
|
+
get: function () { return chunkYLFQXTTX_cjs.requireActivePlugin; }
|
|
1516
1516
|
});
|
|
1517
1517
|
Object.defineProperty(exports, "requireActivePlugins", {
|
|
1518
1518
|
enumerable: true,
|
|
1519
|
-
get: function () { return
|
|
1519
|
+
get: function () { return chunkYLFQXTTX_cjs.requireActivePlugins; }
|
|
1520
1520
|
});
|
|
1521
1521
|
Object.defineProperty(exports, "requireAnyPermission", {
|
|
1522
1522
|
enumerable: true,
|
|
1523
|
-
get: function () { return
|
|
1523
|
+
get: function () { return chunkYLFQXTTX_cjs.requireAnyPermission; }
|
|
1524
1524
|
});
|
|
1525
1525
|
Object.defineProperty(exports, "requireAuth", {
|
|
1526
1526
|
enumerable: true,
|
|
1527
|
-
get: function () { return
|
|
1527
|
+
get: function () { return chunkYLFQXTTX_cjs.requireAuth; }
|
|
1528
1528
|
});
|
|
1529
1529
|
Object.defineProperty(exports, "requirePermission", {
|
|
1530
1530
|
enumerable: true,
|
|
1531
|
-
get: function () { return
|
|
1531
|
+
get: function () { return chunkYLFQXTTX_cjs.requirePermission; }
|
|
1532
1532
|
});
|
|
1533
1533
|
Object.defineProperty(exports, "requireRole", {
|
|
1534
1534
|
enumerable: true,
|
|
1535
|
-
get: function () { return
|
|
1535
|
+
get: function () { return chunkYLFQXTTX_cjs.requireRole; }
|
|
1536
1536
|
});
|
|
1537
1537
|
Object.defineProperty(exports, "securityHeaders", {
|
|
1538
1538
|
enumerable: true,
|
|
1539
|
-
get: function () { return
|
|
1539
|
+
get: function () { return chunkYLFQXTTX_cjs.securityHeaders; }
|
|
1540
1540
|
});
|
|
1541
1541
|
Object.defineProperty(exports, "securityLoggingMiddleware", {
|
|
1542
1542
|
enumerable: true,
|
|
1543
|
-
get: function () { return
|
|
1543
|
+
get: function () { return chunkYLFQXTTX_cjs.securityLoggingMiddleware; }
|
|
1544
1544
|
});
|
|
1545
1545
|
Object.defineProperty(exports, "PluginBootstrapService", {
|
|
1546
1546
|
enumerable: true,
|
|
@@ -1596,7 +1596,7 @@ Object.defineProperty(exports, "validateCollectionConfig", {
|
|
|
1596
1596
|
});
|
|
1597
1597
|
Object.defineProperty(exports, "MigrationService", {
|
|
1598
1598
|
enumerable: true,
|
|
1599
|
-
get: function () { return
|
|
1599
|
+
get: function () { return chunkO446Q45G_cjs.MigrationService; }
|
|
1600
1600
|
});
|
|
1601
1601
|
Object.defineProperty(exports, "renderFilterBar", {
|
|
1602
1602
|
enumerable: true,
|
|
@@ -1656,43 +1656,43 @@ Object.defineProperty(exports, "ScopedHookSystemClass", {
|
|
|
1656
1656
|
});
|
|
1657
1657
|
Object.defineProperty(exports, "QueryFilterBuilder", {
|
|
1658
1658
|
enumerable: true,
|
|
1659
|
-
get: function () { return
|
|
1659
|
+
get: function () { return chunkN3EHA3AX_cjs.QueryFilterBuilder; }
|
|
1660
1660
|
});
|
|
1661
1661
|
Object.defineProperty(exports, "SONICJS_VERSION", {
|
|
1662
1662
|
enumerable: true,
|
|
1663
|
-
get: function () { return
|
|
1663
|
+
get: function () { return chunkN3EHA3AX_cjs.SONICJS_VERSION; }
|
|
1664
1664
|
});
|
|
1665
1665
|
Object.defineProperty(exports, "TemplateRenderer", {
|
|
1666
1666
|
enumerable: true,
|
|
1667
|
-
get: function () { return
|
|
1667
|
+
get: function () { return chunkN3EHA3AX_cjs.TemplateRenderer; }
|
|
1668
1668
|
});
|
|
1669
1669
|
Object.defineProperty(exports, "buildQuery", {
|
|
1670
1670
|
enumerable: true,
|
|
1671
|
-
get: function () { return
|
|
1671
|
+
get: function () { return chunkN3EHA3AX_cjs.buildQuery; }
|
|
1672
1672
|
});
|
|
1673
1673
|
Object.defineProperty(exports, "escapeHtml", {
|
|
1674
1674
|
enumerable: true,
|
|
1675
|
-
get: function () { return
|
|
1675
|
+
get: function () { return chunkN3EHA3AX_cjs.escapeHtml; }
|
|
1676
1676
|
});
|
|
1677
1677
|
Object.defineProperty(exports, "getCoreVersion", {
|
|
1678
1678
|
enumerable: true,
|
|
1679
|
-
get: function () { return
|
|
1679
|
+
get: function () { return chunkN3EHA3AX_cjs.getCoreVersion; }
|
|
1680
1680
|
});
|
|
1681
1681
|
Object.defineProperty(exports, "renderTemplate", {
|
|
1682
1682
|
enumerable: true,
|
|
1683
|
-
get: function () { return
|
|
1683
|
+
get: function () { return chunkN3EHA3AX_cjs.renderTemplate; }
|
|
1684
1684
|
});
|
|
1685
1685
|
Object.defineProperty(exports, "sanitizeInput", {
|
|
1686
1686
|
enumerable: true,
|
|
1687
|
-
get: function () { return
|
|
1687
|
+
get: function () { return chunkN3EHA3AX_cjs.sanitizeInput; }
|
|
1688
1688
|
});
|
|
1689
1689
|
Object.defineProperty(exports, "sanitizeObject", {
|
|
1690
1690
|
enumerable: true,
|
|
1691
|
-
get: function () { return
|
|
1691
|
+
get: function () { return chunkN3EHA3AX_cjs.sanitizeObject; }
|
|
1692
1692
|
});
|
|
1693
1693
|
Object.defineProperty(exports, "templateRenderer", {
|
|
1694
1694
|
enumerable: true,
|
|
1695
|
-
get: function () { return
|
|
1695
|
+
get: function () { return chunkN3EHA3AX_cjs.templateRenderer; }
|
|
1696
1696
|
});
|
|
1697
1697
|
Object.defineProperty(exports, "metricsTracker", {
|
|
1698
1698
|
enumerable: true,
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { PluginBuilder, api_default, api_media_default, api_system_default, admin_api_default, router, adminCollectionsRoutes, adminSettingsRoutes, admin_content_default, adminMediaRoutes, adminPluginRoutes, adminLogsRoutes, userRoutes, auth_default, test_cleanup_default } from './chunk-
|
|
2
|
-
export { ROUTES_INFO, admin_api_default as adminApiRoutes, adminCheckboxRoutes, admin_code_examples_default as adminCodeExamplesRoutes, adminCollectionsRoutes, admin_content_default as adminContentRoutes, router as adminDashboardRoutes, adminDesignRoutes, adminLogsRoutes, adminMediaRoutes, adminPluginRoutes, adminSettingsRoutes, admin_testimonials_default as adminTestimonialsRoutes, userRoutes as adminUsersRoutes, api_content_crud_default as apiContentCrudRoutes, api_media_default as apiMediaRoutes, api_default as apiRoutes, api_system_default as apiSystemRoutes, auth_default as authRoutes } from './chunk-
|
|
1
|
+
import { PluginBuilder, api_default, api_media_default, api_system_default, admin_api_default, router, adminCollectionsRoutes, adminSettingsRoutes, admin_content_default, adminMediaRoutes, adminPluginRoutes, adminLogsRoutes, userRoutes, auth_default, test_cleanup_default } from './chunk-I3M6I2FY.js';
|
|
2
|
+
export { ROUTES_INFO, admin_api_default as adminApiRoutes, adminCheckboxRoutes, admin_code_examples_default as adminCodeExamplesRoutes, adminCollectionsRoutes, admin_content_default as adminContentRoutes, router as adminDashboardRoutes, adminDesignRoutes, adminLogsRoutes, adminMediaRoutes, adminPluginRoutes, adminSettingsRoutes, admin_testimonials_default as adminTestimonialsRoutes, userRoutes as adminUsersRoutes, api_content_crud_default as apiContentCrudRoutes, api_media_default as apiMediaRoutes, api_default as apiRoutes, api_system_default as apiSystemRoutes, auth_default as authRoutes } from './chunk-I3M6I2FY.js';
|
|
3
3
|
import { schema_exports } from './chunk-Q52ZQFMB.js';
|
|
4
4
|
export { Logger, apiTokens, collections, content, contentVersions, getLogger, initLogger, insertCollectionSchema, insertContentSchema, insertLogConfigSchema, insertMediaSchema, insertPluginActivityLogSchema, insertPluginAssetSchema, insertPluginHookSchema, insertPluginRouteSchema, insertPluginSchema, insertSystemLogSchema, insertUserSchema, insertWorkflowHistorySchema, logConfig, media, pluginActivityLog, pluginAssets, pluginHooks, pluginRoutes, plugins, selectCollectionSchema, selectContentSchema, selectLogConfigSchema, selectMediaSchema, selectPluginActivityLogSchema, selectPluginAssetSchema, selectPluginHookSchema, selectPluginRouteSchema, selectPluginSchema, selectSystemLogSchema, selectUserSchema, selectWorkflowHistorySchema, systemLogs, users, workflowHistory } from './chunk-Q52ZQFMB.js';
|
|
5
|
-
import { metricsMiddleware, bootstrapMiddleware, requireAuth } from './chunk-
|
|
6
|
-
export { AuthManager, PermissionManager, bootstrapMiddleware, cacheHeaders, compressionMiddleware, detailedLoggingMiddleware, getActivePlugins, isPluginActive, logActivity, loggingMiddleware, optionalAuth, performanceLoggingMiddleware, requireActivePlugin, requireActivePlugins, requireAnyPermission, requireAuth, requirePermission, requireRole, securityHeaders, securityLoggingMiddleware } from './chunk-
|
|
5
|
+
import { metricsMiddleware, bootstrapMiddleware, requireAuth } from './chunk-AUU4H5MP.js';
|
|
6
|
+
export { AuthManager, PermissionManager, bootstrapMiddleware, cacheHeaders, compressionMiddleware, detailedLoggingMiddleware, getActivePlugins, isPluginActive, logActivity, loggingMiddleware, optionalAuth, performanceLoggingMiddleware, requireActivePlugin, requireActivePlugins, requireAnyPermission, requireAuth, requirePermission, requireRole, securityHeaders, securityLoggingMiddleware } from './chunk-AUU4H5MP.js';
|
|
7
7
|
export { PluginBootstrapService, PluginService as PluginServiceClass, cleanupRemovedCollections, fullCollectionSync, getAvailableCollectionNames, getManagedCollections, isCollectionManaged, loadCollectionConfig, loadCollectionConfigs, registerCollections, syncCollection, syncCollections, validateCollectionConfig } from './chunk-7CXL5K7N.js';
|
|
8
|
-
export { MigrationService } from './chunk-
|
|
8
|
+
export { MigrationService } from './chunk-624OTQ55.js';
|
|
9
9
|
export { renderFilterBar } from './chunk-QNWYQZ55.js';
|
|
10
10
|
import { init_admin_layout_catalyst_template, renderAdminLayout, renderAdminLayoutCatalyst } from './chunk-5RKQB2JG.js';
|
|
11
11
|
export { getConfirmationDialogScript, renderAlert, renderConfirmationDialog, renderForm, renderFormField, renderPagination, renderTable } from './chunk-5RKQB2JG.js';
|
|
12
12
|
export { HookSystemImpl, HookUtils, PluginManager as PluginManagerClass, PluginRegistryImpl, PluginValidator as PluginValidatorClass, ScopedHookSystem as ScopedHookSystemClass } from './chunk-CPXAVWCU.js';
|
|
13
|
-
import { package_default, getCoreVersion } from './chunk-
|
|
14
|
-
export { QueryFilterBuilder, SONICJS_VERSION, TemplateRenderer, buildQuery, escapeHtml, getCoreVersion, renderTemplate, sanitizeInput, sanitizeObject, templateRenderer } from './chunk-
|
|
13
|
+
import { package_default, getCoreVersion } from './chunk-HNHKS2XF.js';
|
|
14
|
+
export { QueryFilterBuilder, SONICJS_VERSION, TemplateRenderer, buildQuery, escapeHtml, getCoreVersion, renderTemplate, sanitizeInput, sanitizeObject, templateRenderer } from './chunk-HNHKS2XF.js';
|
|
15
15
|
import './chunk-RRKXFGIO.js';
|
|
16
16
|
export { metricsTracker } from './chunk-FICTAGD4.js';
|
|
17
17
|
export { HOOKS } from './chunk-LOUJRBXV.js';
|
package/dist/middleware.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkYLFQXTTX_cjs = require('./chunk-YLFQXTTX.cjs');
|
|
4
4
|
require('./chunk-NAYD76QF.cjs');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-O446Q45G.cjs');
|
|
6
6
|
require('./chunk-RCQ2HIQD.cjs');
|
|
7
7
|
require('./chunk-IGJUBJBW.cjs');
|
|
8
8
|
|
|
@@ -10,87 +10,87 @@ require('./chunk-IGJUBJBW.cjs');
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "AuthManager", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkYLFQXTTX_cjs.AuthManager; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "PermissionManager", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkYLFQXTTX_cjs.PermissionManager; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "bootstrapMiddleware", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkYLFQXTTX_cjs.bootstrapMiddleware; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "cacheHeaders", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkYLFQXTTX_cjs.cacheHeaders; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "compressionMiddleware", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkYLFQXTTX_cjs.compressionMiddleware; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "detailedLoggingMiddleware", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkYLFQXTTX_cjs.detailedLoggingMiddleware; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "getActivePlugins", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunkYLFQXTTX_cjs.getActivePlugins; }
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "isPluginActive", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunkYLFQXTTX_cjs.isPluginActive; }
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "logActivity", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunkYLFQXTTX_cjs.logActivity; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "loggingMiddleware", {
|
|
48
48
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunkYLFQXTTX_cjs.loggingMiddleware; }
|
|
50
50
|
});
|
|
51
51
|
Object.defineProperty(exports, "metricsMiddleware", {
|
|
52
52
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunkYLFQXTTX_cjs.metricsMiddleware; }
|
|
54
54
|
});
|
|
55
55
|
Object.defineProperty(exports, "optionalAuth", {
|
|
56
56
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
57
|
+
get: function () { return chunkYLFQXTTX_cjs.optionalAuth; }
|
|
58
58
|
});
|
|
59
59
|
Object.defineProperty(exports, "performanceLoggingMiddleware", {
|
|
60
60
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
61
|
+
get: function () { return chunkYLFQXTTX_cjs.performanceLoggingMiddleware; }
|
|
62
62
|
});
|
|
63
63
|
Object.defineProperty(exports, "requireActivePlugin", {
|
|
64
64
|
enumerable: true,
|
|
65
|
-
get: function () { return
|
|
65
|
+
get: function () { return chunkYLFQXTTX_cjs.requireActivePlugin; }
|
|
66
66
|
});
|
|
67
67
|
Object.defineProperty(exports, "requireActivePlugins", {
|
|
68
68
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
69
|
+
get: function () { return chunkYLFQXTTX_cjs.requireActivePlugins; }
|
|
70
70
|
});
|
|
71
71
|
Object.defineProperty(exports, "requireAnyPermission", {
|
|
72
72
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
73
|
+
get: function () { return chunkYLFQXTTX_cjs.requireAnyPermission; }
|
|
74
74
|
});
|
|
75
75
|
Object.defineProperty(exports, "requireAuth", {
|
|
76
76
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunkYLFQXTTX_cjs.requireAuth; }
|
|
78
78
|
});
|
|
79
79
|
Object.defineProperty(exports, "requirePermission", {
|
|
80
80
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
81
|
+
get: function () { return chunkYLFQXTTX_cjs.requirePermission; }
|
|
82
82
|
});
|
|
83
83
|
Object.defineProperty(exports, "requireRole", {
|
|
84
84
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunkYLFQXTTX_cjs.requireRole; }
|
|
86
86
|
});
|
|
87
87
|
Object.defineProperty(exports, "securityHeaders", {
|
|
88
88
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunkYLFQXTTX_cjs.securityHeaders; }
|
|
90
90
|
});
|
|
91
91
|
Object.defineProperty(exports, "securityLoggingMiddleware", {
|
|
92
92
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunkYLFQXTTX_cjs.securityLoggingMiddleware; }
|
|
94
94
|
});
|
|
95
95
|
//# sourceMappingURL=middleware.cjs.map
|
|
96
96
|
//# sourceMappingURL=middleware.cjs.map
|