@sonicjs-cms/core 2.8.2 → 2.9.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.
- package/dist/{app-DnQ26Lho.d.cts → app-Ozl9agJG.d.cts} +1 -1
- package/dist/{app-DnQ26Lho.d.ts → app-Ozl9agJG.d.ts} +1 -1
- package/dist/{chunk-FUUVSYVQ.js → chunk-25YNV4RK.js} +3 -3
- package/dist/{chunk-FUUVSYVQ.js.map → chunk-25YNV4RK.js.map} +1 -1
- package/dist/{chunk-4Z5BQZT6.js → chunk-2JGQKF7B.js} +324 -301
- package/dist/chunk-2JGQKF7B.js.map +1 -0
- package/dist/{chunk-WI5ESQKT.js → chunk-3FHMXGLF.js} +7 -5
- package/dist/chunk-3FHMXGLF.js.map +1 -0
- package/dist/{chunk-VNLR35GO.cjs → chunk-64APW3DW.cjs} +339 -2
- package/dist/chunk-64APW3DW.cjs.map +1 -0
- package/dist/{chunk-G44QUVNM.js → chunk-7JMMLHPQ.js} +337 -4
- package/dist/chunk-7JMMLHPQ.js.map +1 -0
- package/dist/chunk-CJYFSKH7.js +54 -54
- package/dist/chunk-CJYFSKH7.js.map +1 -1
- package/dist/{chunk-ZWKCL46S.cjs → chunk-DQZVU3WB.cjs} +4 -4
- package/dist/{chunk-ZWKCL46S.cjs.map → chunk-DQZVU3WB.cjs.map} +1 -1
- package/dist/{chunk-3U5YHS4G.cjs → chunk-KSB6FXOP.cjs} +425 -402
- package/dist/chunk-KSB6FXOP.cjs.map +1 -0
- package/dist/{chunk-VGSZWZP3.cjs → chunk-LDFMYRG6.cjs} +2 -2
- package/dist/{chunk-VGSZWZP3.cjs.map → chunk-LDFMYRG6.cjs.map} +1 -1
- package/dist/chunk-MNFY6DWY.cjs +54 -54
- package/dist/chunk-MNFY6DWY.cjs.map +1 -1
- package/dist/{chunk-JSHIGVIF.cjs → chunk-SHU7Q66Q.cjs} +7 -5
- package/dist/chunk-SHU7Q66Q.cjs.map +1 -0
- package/dist/{chunk-I6REMSMF.js → chunk-STTZVLY2.js} +2 -2
- package/dist/{chunk-I6REMSMF.js.map → chunk-STTZVLY2.js.map} +1 -1
- package/dist/{collection-config-BF95LgQb.d.cts → collection-config-DckWhkdL.d.cts} +3 -2
- package/dist/{collection-config-BF95LgQb.d.ts → collection-config-DckWhkdL.d.ts} +3 -2
- package/dist/{filter-bar.template-Daw8ZDoq.d.cts → filter-bar.template-DlVYMk-T.d.cts} +1 -1
- package/dist/{filter-bar.template-Daw8ZDoq.d.ts → filter-bar.template-DlVYMk-T.d.ts} +1 -1
- package/dist/index.cjs +128 -127
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/middleware.cjs +28 -28
- package/dist/middleware.d.cts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/middleware.js +2 -2
- package/dist/migrations-QQWGDWGB.cjs +13 -0
- package/dist/{migrations-F3G6CTRS.cjs.map → migrations-QQWGDWGB.cjs.map} +1 -1
- package/dist/migrations-SZSR3C3G.js +4 -0
- package/dist/{migrations-LLNEST75.js.map → migrations-SZSR3C3G.js.map} +1 -1
- package/dist/{plugin-zvZpaiP5.d.cts → plugin-0Xogrln-.d.cts} +1 -1
- package/dist/{plugin-zvZpaiP5.d.ts → plugin-0Xogrln-.d.ts} +1 -1
- package/dist/{plugin-bootstrap-C7Mj00Ud.d.ts → plugin-bootstrap-BAz7NY0H.d.cts} +2 -2
- package/dist/{plugin-bootstrap-DKB5f8-E.d.cts → plugin-bootstrap-Cz3-bj8X.d.ts} +2 -2
- package/dist/{plugin-manager-Baa6xXqB.d.ts → plugin-manager-Clf2gXwj.d.ts} +2 -2
- package/dist/{plugin-manager-vBal9Zip.d.cts → plugin-manager-GcIeb226.d.cts} +2 -2
- package/dist/plugins.d.cts +2 -2
- package/dist/plugins.d.ts +2 -2
- package/dist/routes.cjs +28 -28
- package/dist/routes.d.cts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.js +5 -5
- package/dist/services.cjs +30 -14
- package/dist/services.d.cts +29 -4
- package/dist/services.d.ts +29 -4
- package/dist/services.js +2 -2
- package/dist/{telemetry-UiD1i9GS.d.cts → telemetry-B9vIV4wh.d.cts} +1 -1
- package/dist/{telemetry-UiD1i9GS.d.ts → telemetry-B9vIV4wh.d.ts} +1 -1
- package/dist/templates.d.cts +1 -1
- package/dist/templates.d.ts +1 -1
- package/dist/types.d.cts +3 -3
- package/dist/types.d.ts +3 -3
- package/dist/utils.cjs +11 -11
- package/dist/utils.d.cts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +1 -1
- package/dist/{version-C_CXrN_T.d.cts → version-ChpccWQ1.d.cts} +1 -1
- package/dist/{version-C_CXrN_T.d.ts → version-ChpccWQ1.d.ts} +1 -1
- package/package.json +5 -3
- package/dist/chunk-3U5YHS4G.cjs.map +0 -1
- package/dist/chunk-4Z5BQZT6.js.map +0 -1
- package/dist/chunk-G44QUVNM.js.map +0 -1
- package/dist/chunk-JSHIGVIF.cjs.map +0 -1
- package/dist/chunk-VNLR35GO.cjs.map +0 -1
- package/dist/chunk-WI5ESQKT.js.map +0 -1
- package/dist/migrations-F3G6CTRS.cjs +0 -13
- package/dist/migrations-LLNEST75.js +0 -4
|
@@ -415,7 +415,7 @@ function buildQuery(table, filter) {
|
|
|
415
415
|
// package.json
|
|
416
416
|
var package_default = {
|
|
417
417
|
name: "@sonicjs-cms/core",
|
|
418
|
-
version: "2.
|
|
418
|
+
version: "2.9.0",
|
|
419
419
|
description: "Core framework for SonicJS headless CMS - Edge-first, TypeScript-native CMS built for Cloudflare Workers",
|
|
420
420
|
type: "module",
|
|
421
421
|
main: "./dist/index.cjs",
|
|
@@ -517,17 +517,19 @@ var package_default = {
|
|
|
517
517
|
zod: "^3.0.0 || ^4.0.0"
|
|
518
518
|
},
|
|
519
519
|
dependencies: {
|
|
520
|
+
"csv-parse": "^6.2.1",
|
|
520
521
|
"drizzle-zod": "^0.8.3",
|
|
521
522
|
"highlight.js": "^11.11.1",
|
|
522
523
|
marked: "^16.4.1",
|
|
523
|
-
semver: "^7.7.3"
|
|
524
|
+
semver: "^7.7.3",
|
|
525
|
+
"tiny-lru": "^13.0.0"
|
|
524
526
|
},
|
|
525
527
|
devDependencies: {
|
|
526
|
-
"@vitest/coverage-v8": "^4.0.5",
|
|
527
528
|
"@cloudflare/workers-types": "^4.20251014.0",
|
|
528
529
|
"@types/node": "^24.9.2",
|
|
529
530
|
"@typescript-eslint/eslint-plugin": "^8.50.0",
|
|
530
531
|
"@typescript-eslint/parser": "^8.50.0",
|
|
532
|
+
"@vitest/coverage-v8": "^4.0.5",
|
|
531
533
|
"drizzle-orm": "^0.44.7",
|
|
532
534
|
eslint: "^9.39.2",
|
|
533
535
|
glob: "^10.5.0",
|
|
@@ -598,5 +600,5 @@ function parseBlocksValue(value, config) {
|
|
|
598
600
|
}
|
|
599
601
|
|
|
600
602
|
export { QueryFilterBuilder, SONICJS_VERSION, TemplateRenderer, buildQuery, generateSlug, getBlocksFieldConfig, getCoreVersion, package_default, parseBlocksValue, renderTemplate, templateRenderer };
|
|
601
|
-
//# sourceMappingURL=chunk-
|
|
602
|
-
//# sourceMappingURL=chunk-
|
|
603
|
+
//# sourceMappingURL=chunk-3FHMXGLF.js.map
|
|
604
|
+
//# sourceMappingURL=chunk-3FHMXGLF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/slug-utils.ts","../src/utils/template-renderer.ts","../src/utils/query-filter.ts","../package.json","../src/utils/version.ts","../src/utils/blocks.ts"],"names":[],"mappings":";AAyBO,SAAS,aAAa,IAAA,EAAsB;AACjD,EAAA,IAAI,CAAC,MAAM,OAAO,EAAA;AAElB,EAAA,OAAO,IAAA,CACJ,WAAA,EAAY,CACZ,SAAA,CAAU,KAAK,CAAA,CACf,OAAA,CAAQ,kBAAA,EAAoB,EAAE,CAAA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AAU;AAC/C,IAAA,IAAI,CAAC,IAAA,IAAQ,OAAO,IAAA,KAAS,QAAA,EAAU;AACrC,MAAA,MAAA,CAAO,IAAA,CAAK,CAAA,OAAA,EAAU,KAAA,GAAQ,CAAC,CAAA,kBAAA,CAAoB,CAAA;AACnD,MAAA,OAAO,IAAA;AAAA,IACT;AAEA,IAAA,IAAK,KAAa,SAAA,IAAc,IAAA,CAAa,QAAQ,OAAQ,IAAA,CAAa,SAAS,QAAA,EAAU;AAC3F,MAAA,OAAO,EAAE,CAAC,MAAA,CAAO,aAAa,GAAI,IAAA,CAAa,SAAA,EAAW,GAAI,IAAA,CAAa,IAAA,EAAK;AAAA,IAClF;AAEA,IAAA,IAAI,EAAE,MAAA,CAAO,aAAA,IAAkB,IAAA,CAAA,EAAe;AAC5C,MAAA,MAAA,CAAO,KAAK,CAAA,OAAA,EAAU,KAAA,GAAQ,CAAC,CAAA,aAAA,EAAgB,MAAA,CAAO,aAAa,CAAA,CAAA,CAAG,CAAA;AAAA,IACxE;AAEA,IAAA,OAAO,IAAA;AAAA,EACT,CAAC,CAAA,CAAE,MAAA,CAAO,CAAC,IAAA,KAAS,SAAS,IAAI,CAAA;AAEjC,EAAA,OAAO,EAAE,KAAA,EAAO,UAAA,EAAY,MAAA,EAAO;AACrC","file":"chunk-3FHMXGLF.js","sourcesContent":["/**\n * Slug generation utilities for creating URL-friendly slugs\n */\n\n/**\n * Generate URL-friendly slug from text\n * \n * Features:\n * - Converts to lowercase\n * - Handles accented characters (NFD normalization)\n * - Removes diacritics\n * - Keeps only alphanumeric, spaces, underscores, and hyphens\n * - Replaces spaces with hyphens\n * - Collapses multiple hyphens/underscores\n * - Trims leading/trailing hyphens/underscores\n * - Limits length to 100 characters\n * \n * @param text - Text to slugify\n * @returns URL-safe slug\n * \n * @example\n * generateSlug('Hello World!') // 'hello-world'\n * generateSlug('Café París 2024') // 'cafe-paris-2024'\n * generateSlug('Multiple Spaces') // 'multiple-spaces'\n */\nexport function generateSlug(text: string): string {\n if (!text) return '';\n \n return text\n .toLowerCase()\n .normalize('NFD') // Decompose combined characters (e.g., é -> e + ́)\n .replace(/[\\u0300-\\u036f]/g, '') // Remove diacritics\n .replace(/[^a-z0-9\\s_-]/g, '') // Keep only alphanumeric, spaces, underscores, hyphens\n .replace(/\\s+/g, '-') // Replace spaces with hyphens\n .replace(/[-_]+/g, '-') // Collapse multiple hyphens/underscores\n .replace(/^[-_]+|[-_]+$/g, '') // Trim leading/trailing hyphens/underscores\n .substring(0, 100); // Limit length for URL safety\n}\n","// Template renderer compatible with Cloudflare Workers\n// No filesystem access available\n\ninterface TemplateData {\n [key: string]: any\n}\n\nexport class TemplateRenderer {\n private templateCache = new Map<string, string>()\n\n constructor() {\n // Cloudflare Workers compatible - no filesystem access\n }\n\n /**\n * Simple Handlebars-like template engine\n */\n private renderTemplate(template: string, data: TemplateData): string {\n let rendered = template\n\n // Handle each loops - process outermost loops first for proper nesting\n rendered = rendered.replace(/\\{\\{#each\\s+([^}]+)\\}\\}([\\s\\S]*?)\\{\\{\\/each\\}\\}/g, (_match, arrayName, content) => {\n const array = this.getNestedValue(data, arrayName.trim())\n if (!Array.isArray(array)) return ''\n \n return array.map((item, index) => {\n // Create context with array item and special variables\n const itemContext = {\n ...data,\n // Handle primitive items (for {{.}} syntax)\n '.': item,\n // Spread item properties if it's an object\n ...(typeof item === 'object' && item !== null ? item : {}),\n '@index': index,\n '@first': index === 0,\n '@last': index === array.length - 1\n }\n return this.renderTemplate(content, itemContext)\n }).join('')\n })\n\n // Second pass: Handle conditionals\n let ifCount = 0\n while (rendered.includes('{{#if ') && ifCount < 100) {\n const previousRendered = rendered\n rendered = rendered.replace(/\\{\\{#if\\s+([^}]+)\\}\\}([\\s\\S]*?)\\{\\{\\/if\\}\\}/g, (_match, condition, content) => {\n const value = this.getNestedValue(data, condition.trim())\n // Handle boolean values properly - @first/@last are explicitly boolean\n const isTruthy = value === true || (value && value !== 0 && value !== '' && value !== null && value !== undefined)\n return isTruthy ? this.renderTemplate(content, data) : ''\n })\n if (previousRendered === rendered) break\n ifCount++\n }\n\n // Third pass: Handle triple braces for raw HTML {{{variable}}}\n rendered = rendered.replace(/\\{\\{\\{([^}]+)\\}\\}\\}/g, (_match, variable) => {\n const value = this.getNestedValue(data, variable.trim())\n return value !== undefined && value !== null ? String(value) : ''\n })\n\n // Fourth pass: Handle helper functions like {{titleCase field}}\n rendered = rendered.replace(/\\{\\{([^}#\\/]+)\\s+([^}]+)\\}\\}/g, (match, helper, variable) => {\n const helperName = helper.trim()\n const varName = variable.trim()\n \n if (helperName === 'titleCase') {\n const value = this.getNestedValue(data, varName)\n if (value !== undefined && value !== null) {\n return this.titleCase(String(value))\n }\n }\n \n return match // Return original if helper not found\n })\n\n // Final pass: Handle simple variables {{variable}}\n rendered = rendered.replace(/\\{\\{([^}#\\/]+)\\}\\}/g, (match, variable) => {\n const trimmed = variable.trim()\n \n // Skip if it's a helper function (has spaces)\n if (trimmed.includes(' ')) {\n return match\n }\n \n const value = this.getNestedValue(data, trimmed)\n if (value === null) return ''\n if (value === undefined) return ''\n return String(value)\n })\n\n return rendered\n }\n\n /**\n * Get nested value from object using dot notation\n */\n private getNestedValue(obj: any, path: string): any {\n if (!obj || path === '') return undefined\n \n return path.split('.').reduce((current, key) => {\n if (current === null || current === undefined) return undefined\n return current[key]\n }, obj)\n }\n\n /**\n * Title case helper function\n */\n private titleCase(str: string): string {\n return str\n .replace(/_/g, ' ')\n .replace(/\\b\\w/g, l => l.toUpperCase())\n }\n\n /**\n * Render a template string with data\n */\n render(template: string, data: TemplateData = {}): string {\n return this.renderTemplate(template, data)\n }\n\n /**\n * Clear template cache (useful for development)\n */\n clearCache(): void {\n this.templateCache.clear()\n }\n}\n\n// Export singleton instance\nexport const templateRenderer = new TemplateRenderer()\n\n// Utility function to render template strings directly\nexport function renderTemplate(template: string, data: TemplateData = {}): string {\n return templateRenderer.render(template, data)\n}","/**\n * Query Filter Builder for SonicJS AI\n * Supports comprehensive filtering with AND/OR logic\n * Compatible with D1 Database (SQLite)\n */\n\nexport type FilterOperator =\n | 'equals'\n | 'not_equals'\n | 'greater_than'\n | 'greater_than_equal'\n | 'less_than'\n | 'less_than_equal'\n | 'like'\n | 'contains'\n | 'in'\n | 'not_in'\n | 'all'\n | 'exists'\n | 'near'\n | 'within'\n | 'intersects'\n\nexport interface FilterCondition {\n field: string\n operator: FilterOperator\n value: any\n}\n\nexport interface FilterGroup {\n and?: FilterCondition[]\n or?: FilterCondition[]\n}\n\nexport interface QueryFilter {\n where?: FilterGroup\n limit?: number\n offset?: number\n sort?: {\n field: string\n order: 'asc' | 'desc'\n }[]\n}\n\nexport interface QueryResult {\n sql: string\n params: any[]\n errors: string[]\n}\n\n/**\n * Validate sort order value - only 'asc' or 'desc' are allowed.\n * Returns the validated lowercase value, defaulting to 'asc' for invalid input.\n */\nexport function validateSortOrder(order: any): 'asc' | 'desc' {\n if (typeof order === 'string') {\n const normalized = order.toLowerCase().trim()\n if (normalized === 'asc' || normalized === 'desc') {\n return normalized\n }\n }\n return 'asc'\n}\n\n/**\n * Query Filter Builder\n * Converts filter objects into SQL WHERE clauses with parameterized queries\n */\nexport class QueryFilterBuilder {\n private params: any[] = []\n private errors: string[] = []\n\n /**\n * Build a complete SQL query from filter object\n */\n build(baseTable: string, filter: QueryFilter): QueryResult {\n this.params = []\n this.errors = []\n\n let sql = `SELECT * FROM ${baseTable}`\n\n // Build WHERE clause\n if (filter.where) {\n const whereClause = this.buildWhereClause(filter.where)\n if (whereClause) {\n sql += ` WHERE ${whereClause}`\n }\n }\n\n // Build ORDER BY clause\n if (filter.sort && filter.sort.length > 0) {\n const orderClauses = filter.sort\n .map(s => `${this.sanitizeFieldName(s.field)} ${this.sanitizeSortOrder(s.order)}`)\n .join(', ')\n sql += ` ORDER BY ${orderClauses}`\n }\n\n // Build LIMIT clause\n if (filter.limit) {\n sql += ` LIMIT ?`\n this.params.push(filter.limit)\n }\n\n // Build OFFSET clause\n if (filter.offset) {\n sql += ` OFFSET ?`\n this.params.push(filter.offset)\n }\n\n return {\n sql,\n params: this.params,\n errors: this.errors\n }\n }\n\n /**\n * Build WHERE clause from filter group\n */\n private buildWhereClause(group: FilterGroup): string {\n const clauses: string[] = []\n\n // Handle AND conditions\n if (group.and && group.and.length > 0) {\n const andClauses = group.and\n .map(condition => this.buildCondition(condition))\n .filter(clause => clause !== null)\n\n if (andClauses.length > 0) {\n clauses.push(`(${andClauses.join(' AND ')})`)\n }\n }\n\n // Handle OR conditions\n if (group.or && group.or.length > 0) {\n const orClauses = group.or\n .map(condition => this.buildCondition(condition))\n .filter(clause => clause !== null)\n\n if (orClauses.length > 0) {\n clauses.push(`(${orClauses.join(' OR ')})`)\n }\n }\n\n return clauses.join(' AND ')\n }\n\n /**\n * Build a single condition\n */\n private buildCondition(condition: FilterCondition): string | null {\n const field = this.sanitizeFieldName(condition.field)\n\n switch (condition.operator) {\n case 'equals':\n return this.buildEquals(field, condition.value)\n\n case 'not_equals':\n return this.buildNotEquals(field, condition.value)\n\n case 'greater_than':\n return this.buildComparison(field, '>', condition.value)\n\n case 'greater_than_equal':\n return this.buildComparison(field, '>=', condition.value)\n\n case 'less_than':\n return this.buildComparison(field, '<', condition.value)\n\n case 'less_than_equal':\n return this.buildComparison(field, '<=', condition.value)\n\n case 'like':\n return this.buildLike(field, condition.value)\n\n case 'contains':\n return this.buildContains(field, condition.value)\n\n case 'in':\n return this.buildIn(field, condition.value)\n\n case 'not_in':\n return this.buildNotIn(field, condition.value)\n\n case 'all':\n return this.buildAll(field, condition.value)\n\n case 'exists':\n return this.buildExists(field, condition.value)\n\n case 'near':\n this.errors.push(`'near' operator not supported in SQLite. Use spatial extension or application-level filtering.`)\n return null\n\n case 'within':\n this.errors.push(`'within' operator not supported in SQLite. Use spatial extension or application-level filtering.`)\n return null\n\n case 'intersects':\n this.errors.push(`'intersects' operator not supported in SQLite. Use spatial extension or application-level filtering.`)\n return null\n\n default:\n this.errors.push(`Unknown operator: ${condition.operator}`)\n return null\n }\n }\n\n /**\n * Build equals condition\n */\n private buildEquals(field: string, value: any): string {\n if (value === null) {\n return `${field} IS NULL`\n }\n this.params.push(value)\n return `${field} = ?`\n }\n\n /**\n * Build not equals condition\n */\n private buildNotEquals(field: string, value: any): string {\n if (value === null) {\n return `${field} IS NOT NULL`\n }\n this.params.push(value)\n return `${field} != ?`\n }\n\n /**\n * Build comparison condition (>, >=, <, <=)\n */\n private buildComparison(field: string, operator: string, value: any): string {\n this.params.push(value)\n return `${field} ${operator} ?`\n }\n\n /**\n * Build LIKE condition (case-insensitive, all words must be present)\n */\n private buildLike(field: string, value: string): string {\n const words = value.split(/\\s+/).filter(w => w.length > 0)\n\n if (words.length === 0) {\n return `1=1` // No-op condition\n }\n\n const conditions = words.map(word => {\n this.params.push(`%${word}%`)\n return `${field} LIKE ?`\n })\n\n return `(${conditions.join(' AND ')})`\n }\n\n /**\n * Build CONTAINS condition (case-insensitive substring)\n */\n private buildContains(field: string, value: string): string {\n this.params.push(`%${value}%`)\n return `${field} LIKE ?`\n }\n\n /**\n * Build IN condition\n */\n private buildIn(field: string, value: any): string {\n let values: any[]\n\n if (typeof value === 'string') {\n // Parse comma-delimited string\n values = value.split(',').map(v => v.trim()).filter(v => v.length > 0)\n } else if (Array.isArray(value)) {\n values = value\n } else {\n values = [value]\n }\n\n if (values.length === 0) {\n return `1=0` // No values means no matches\n }\n\n const placeholders = values.map(v => {\n this.params.push(v)\n return '?'\n }).join(', ')\n\n return `${field} IN (${placeholders})`\n }\n\n /**\n * Build NOT IN condition\n */\n private buildNotIn(field: string, value: any): string {\n let values: any[]\n\n if (typeof value === 'string') {\n // Parse comma-delimited string\n values = value.split(',').map(v => v.trim()).filter(v => v.length > 0)\n } else if (Array.isArray(value)) {\n values = value\n } else {\n values = [value]\n }\n\n if (values.length === 0) {\n return `1=1` // No values means all match\n }\n\n const placeholders = values.map(v => {\n this.params.push(v)\n return '?'\n }).join(', ')\n\n return `${field} NOT IN (${placeholders})`\n }\n\n /**\n * Build ALL condition (value must contain all items in list)\n * For SQLite, we'll check if a JSON array contains all values\n */\n private buildAll(field: string, value: any): string {\n let values: any[]\n\n if (typeof value === 'string') {\n values = value.split(',').map(v => v.trim()).filter(v => v.length > 0)\n } else if (Array.isArray(value)) {\n values = value\n } else {\n values = [value]\n }\n\n if (values.length === 0) {\n return `1=1`\n }\n\n // For SQLite, check if field contains all values using JSON functions\n // This assumes the field is a JSON array or comma-separated string\n const conditions = values.map(val => {\n this.params.push(`%${val}%`)\n return `${field} LIKE ?`\n })\n\n return `(${conditions.join(' AND ')})`\n }\n\n /**\n * Build EXISTS condition\n */\n private buildExists(field: string, value: boolean): string {\n if (value) {\n return `${field} IS NOT NULL AND ${field} != ''`\n } else {\n return `(${field} IS NULL OR ${field} = '')`\n }\n }\n\n /**\n * Sanitize field names to prevent SQL injection\n */\n private sanitizeFieldName(field: string): string {\n // Allow alphanumeric, underscores, dots (for JSON fields)\n const sanitized = field.replace(/[^a-zA-Z0-9_$.]/g, '')\n\n // Handle JSON field access (e.g., data.title -> json_extract(data, '$.title'))\n if (sanitized.includes('.')) {\n const [table, ...path] = sanitized.split('.')\n return `json_extract(${table}, '$.${path.join('.')}')`\n }\n\n return sanitized\n }\n\n /**\n * Sanitize sort order to prevent SQL injection\n * Only allows 'ASC' or 'DESC', defaults to 'ASC' for any other value\n */\n private sanitizeSortOrder(order: string): string {\n const normalized = String(order).toUpperCase().trim()\n if (normalized === 'ASC' || normalized === 'DESC') {\n return normalized\n }\n return 'ASC'\n }\n\n /**\n * Parse filter from query string\n */\n static parseFromQuery(query: Record<string, any>): QueryFilter {\n const filter: QueryFilter = {}\n\n // Parse where clause from 'where' parameter (JSON string)\n if (query.where) {\n try {\n filter.where = typeof query.where === 'string'\n ? JSON.parse(query.where)\n : query.where\n } catch (e) {\n console.error('Failed to parse where clause:', e)\n }\n }\n\n // Initialize where clause if not present\n if (!filter.where) {\n filter.where = { and: [] }\n }\n if (!filter.where.and) {\n filter.where.and = []\n }\n\n // Parse simple field filters (status, collection_id, etc.)\n // These are convenience parameters that get converted to WHERE conditions\n const simpleFieldMappings: Record<string, string> = {\n 'status': 'status',\n 'collection_id': 'collection_id'\n }\n\n for (const [queryParam, dbField] of Object.entries(simpleFieldMappings)) {\n if (query[queryParam]) {\n filter.where.and.push({\n field: dbField,\n operator: 'equals',\n value: query[queryParam]\n })\n }\n }\n\n // Parse limit\n if (query.limit) {\n filter.limit = Math.min(parseInt(query.limit), 1000) // Max 1000\n }\n\n // Parse offset\n if (query.offset) {\n filter.offset = parseInt(query.offset)\n }\n\n // Parse sort\n if (query.sort) {\n try {\n const parsed = typeof query.sort === 'string'\n ? JSON.parse(query.sort)\n : query.sort\n // Validate and sanitize sort entries\n if (Array.isArray(parsed)) {\n filter.sort = parsed\n .filter((s: any) => s && typeof s.field === 'string')\n .map((s: any) => ({\n field: s.field,\n order: validateSortOrder(s.order)\n }))\n }\n } catch (e) {\n console.error('Failed to parse sort clause:', e)\n }\n }\n\n return filter\n }\n}\n\n/**\n * Helper function to build query from filter\n */\nexport function buildQuery(table: string, filter: QueryFilter): QueryResult {\n const builder = new QueryFilterBuilder()\n return builder.build(table, filter)\n}\n","{\n \"name\": \"@sonicjs-cms/core\",\n \"version\": \"2.9.0\",\n \"description\": \"Core framework for SonicJS headless CMS - Edge-first, TypeScript-native CMS built for Cloudflare Workers\",\n \"type\": \"module\",\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"bin\": {\n \"sonicjs-db-reset\": \"./bin/db-reset.js\"\n },\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\",\n \"require\": \"./dist/index.cjs\"\n },\n \"./services\": {\n \"types\": \"./dist/services.d.ts\",\n \"import\": \"./dist/services.js\",\n \"require\": \"./dist/services.cjs\"\n },\n \"./middleware\": {\n \"types\": \"./dist/middleware.d.ts\",\n \"import\": \"./dist/middleware.js\",\n \"require\": \"./dist/middleware.cjs\"\n },\n \"./routes\": {\n \"types\": \"./dist/routes.d.ts\",\n \"import\": \"./dist/routes.js\",\n \"require\": \"./dist/routes.cjs\"\n },\n \"./templates\": {\n \"types\": \"./dist/templates.d.ts\",\n \"import\": \"./dist/templates.js\",\n \"require\": \"./dist/templates.cjs\"\n },\n \"./plugins\": {\n \"types\": \"./dist/plugins.d.ts\",\n \"import\": \"./dist/plugins.js\",\n \"require\": \"./dist/plugins.cjs\"\n },\n \"./utils\": {\n \"types\": \"./dist/utils.d.ts\",\n \"import\": \"./dist/utils.js\",\n \"require\": \"./dist/utils.cjs\"\n },\n \"./types\": {\n \"types\": \"./dist/types.d.ts\",\n \"import\": \"./dist/types.js\",\n \"require\": \"./dist/types.cjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"bin\",\n \"dist\",\n \"migrations\",\n \"README.md\",\n \"LICENSE\"\n ],\n \"scripts\": {\n \"generate:migrations\": \"npx tsx scripts/generate-migrations.ts\",\n \"prebuild\": \"npm run generate:migrations\",\n \"build\": \"tsup\",\n \"dev\": \"tsup --watch\",\n \"type-check\": \"tsc --noEmit\",\n \"lint\": \"eslint src/\",\n \"lint:fix\": \"eslint src/ --fix\",\n \"test\": \"vitest --run\",\n \"test:cov\": \"vitest --run --coverage\",\n \"test:watch\": \"vitest\",\n \"prepublishOnly\": \"npm run build\"\n },\n \"keywords\": [\n \"cms\",\n \"headless-cms\",\n \"cloudflare\",\n \"workers\",\n \"edge\",\n \"typescript\",\n \"hono\",\n \"content-management\",\n \"api\",\n \"sonicjs\"\n ],\n \"author\": \"SonicJS Team\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/sonicjs/sonicjs.git\",\n \"directory\": \"packages/core\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/sonicjs/sonicjs/issues\"\n },\n \"homepage\": \"https://sonicjs.com\",\n \"peerDependencies\": {\n \"@cloudflare/workers-types\": \"^4.0.0\",\n \"drizzle-orm\": \"^0.44.0\",\n \"hono\": \"^4.0.0\",\n \"zod\": \"^3.0.0 || ^4.0.0\"\n },\n \"dependencies\": {\n \"csv-parse\": \"^6.2.1\",\n \"drizzle-zod\": \"^0.8.3\",\n \"highlight.js\": \"^11.11.1\",\n \"marked\": \"^16.4.1\",\n \"semver\": \"^7.7.3\",\n \"tiny-lru\": \"^13.0.0\"\n },\n \"devDependencies\": {\n \"@cloudflare/workers-types\": \"^4.20251014.0\",\n \"@types/node\": \"^24.9.2\",\n \"@typescript-eslint/eslint-plugin\": \"^8.50.0\",\n \"@typescript-eslint/parser\": \"^8.50.0\",\n \"@vitest/coverage-v8\": \"^4.0.5\",\n \"drizzle-orm\": \"^0.44.7\",\n \"eslint\": \"^9.39.2\",\n \"glob\": \"^10.5.0\",\n \"hono\": \"^4.12.7\",\n \"tsup\": \"^8.5.0\",\n \"typescript\": \"^5.9.3\",\n \"vitest\": \"^4.0.5\",\n \"zod\": \"^4.1.12\"\n },\n \"engines\": {\n \"node\": \">=18.0.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\",\n \"registry\": \"https://registry.npmjs.org/\"\n }\n}\n","/**\n * Version utility\n *\n * Provides the current version of @sonicjs-cms/core package\n */\n\nimport pkg from '../../package.json'\n\nexport const SONICJS_VERSION = pkg.version\n\n/**\n * Get the current SonicJS core version\n */\nexport function getCoreVersion(): string {\n return SONICJS_VERSION\n}\n","import type { BlockDefinitions } from '../types/collection-config'\n\nexport type BlocksFieldConfig = {\n blocks: BlockDefinitions\n discriminator: string\n}\n\nexport function getBlocksFieldConfig(fieldOptions: any): BlocksFieldConfig | null {\n if (!fieldOptions || typeof fieldOptions !== 'object') return null\n\n const itemsConfig = fieldOptions.items && typeof fieldOptions.items === 'object'\n ? fieldOptions.items\n : null\n\n if (!itemsConfig || !itemsConfig.blocks || typeof itemsConfig.blocks !== 'object') {\n return null\n }\n\n const discriminator = typeof itemsConfig.discriminator === 'string' && itemsConfig.discriminator\n ? itemsConfig.discriminator\n : 'blockType'\n\n return {\n blocks: itemsConfig.blocks as BlockDefinitions,\n discriminator\n }\n}\n\nexport function parseBlocksValue(value: unknown, config: BlocksFieldConfig) {\n const errors: string[] = []\n let rawValue = value\n\n if (rawValue === null || rawValue === undefined || rawValue === '') {\n return { value: [] as any[], errors }\n }\n\n if (typeof rawValue === 'string') {\n try {\n rawValue = JSON.parse(rawValue)\n } catch {\n return { value: [] as any[], errors: ['Blocks value must be valid JSON'] }\n }\n }\n\n if (!Array.isArray(rawValue)) {\n return { value: [] as any[], errors: ['Blocks value must be an array'] }\n }\n\n const normalized = rawValue.map((item, index) => {\n if (!item || typeof item !== 'object') {\n errors.push(`Block #${index + 1} must be an object`)\n return null\n }\n\n if ((item as any).blockType && (item as any).data && typeof (item as any).data === 'object') {\n return { [config.discriminator]: (item as any).blockType, ...(item as any).data }\n }\n\n if (!(config.discriminator in (item as any))) {\n errors.push(`Block #${index + 1} is missing \"${config.discriminator}\"`)\n }\n\n return item as any\n }).filter((item) => item !== null)\n\n return { value: normalized, errors }\n}\n"]}
|
|
@@ -6,6 +6,7 @@ var sqliteCore = require('drizzle-orm/sqlite-core');
|
|
|
6
6
|
var v4 = require('zod/v4');
|
|
7
7
|
var drizzleOrm = require('drizzle-orm');
|
|
8
8
|
var d1 = require('drizzle-orm/d1');
|
|
9
|
+
var dev = require('hono/dev');
|
|
9
10
|
|
|
10
11
|
// src/db/schema.ts
|
|
11
12
|
var schema_exports = {};
|
|
@@ -1455,17 +1456,352 @@ function createInstallationIdentity(projectName) {
|
|
|
1455
1456
|
}
|
|
1456
1457
|
return identity;
|
|
1457
1458
|
}
|
|
1459
|
+
var appInstance = null;
|
|
1460
|
+
function setAppInstance(app) {
|
|
1461
|
+
appInstance = app;
|
|
1462
|
+
}
|
|
1463
|
+
function getAppInstance() {
|
|
1464
|
+
return appInstance;
|
|
1465
|
+
}
|
|
1466
|
+
var CATEGORY_INFO = {
|
|
1467
|
+
"Auth": {
|
|
1468
|
+
title: "Authentication",
|
|
1469
|
+
description: "User authentication and authorization endpoints",
|
|
1470
|
+
icon: "🔐"
|
|
1471
|
+
},
|
|
1472
|
+
"Content": {
|
|
1473
|
+
title: "Content Management",
|
|
1474
|
+
description: "Content creation, retrieval, and management",
|
|
1475
|
+
icon: "📝"
|
|
1476
|
+
},
|
|
1477
|
+
"Media": {
|
|
1478
|
+
title: "Media Management",
|
|
1479
|
+
description: "File upload, storage, and media operations",
|
|
1480
|
+
icon: "🖼️"
|
|
1481
|
+
},
|
|
1482
|
+
"Admin": {
|
|
1483
|
+
title: "Admin Interface",
|
|
1484
|
+
description: "Administrative panel and management features",
|
|
1485
|
+
icon: "⚙️"
|
|
1486
|
+
},
|
|
1487
|
+
"System": {
|
|
1488
|
+
title: "System",
|
|
1489
|
+
description: "Health checks and system information",
|
|
1490
|
+
icon: "🔧"
|
|
1491
|
+
},
|
|
1492
|
+
"Search": {
|
|
1493
|
+
title: "Search",
|
|
1494
|
+
description: "AI-powered search, full-text search, and analytics",
|
|
1495
|
+
icon: "🔍"
|
|
1496
|
+
},
|
|
1497
|
+
"API Keys": {
|
|
1498
|
+
title: "API Keys",
|
|
1499
|
+
description: "API key management and authentication",
|
|
1500
|
+
icon: "🔑"
|
|
1501
|
+
},
|
|
1502
|
+
"Workflow": {
|
|
1503
|
+
title: "Workflow",
|
|
1504
|
+
description: "Content workflow and approval processes",
|
|
1505
|
+
icon: "🔄"
|
|
1506
|
+
},
|
|
1507
|
+
"Cache": {
|
|
1508
|
+
title: "Cache",
|
|
1509
|
+
description: "Cache management and invalidation",
|
|
1510
|
+
icon: "⚡"
|
|
1511
|
+
},
|
|
1512
|
+
"Forms": {
|
|
1513
|
+
title: "Forms",
|
|
1514
|
+
description: "Form submissions and management",
|
|
1515
|
+
icon: "📋"
|
|
1516
|
+
},
|
|
1517
|
+
"Files": {
|
|
1518
|
+
title: "Files",
|
|
1519
|
+
description: "File serving from R2 storage",
|
|
1520
|
+
icon: "📁"
|
|
1521
|
+
}
|
|
1522
|
+
};
|
|
1523
|
+
var ROUTE_METADATA = {
|
|
1524
|
+
// Auth endpoints
|
|
1525
|
+
"POST /auth/login": { description: "Authenticate user with email and password (returns JWT)", category: "Auth", authentication: false },
|
|
1526
|
+
"POST /auth/login/form": { description: "Form-based login (sets session cookie)", category: "Auth", authentication: false },
|
|
1527
|
+
"POST /auth/register": { description: "Register a new user account", category: "Auth", authentication: false },
|
|
1528
|
+
"POST /auth/logout": { description: "Log out the current user and invalidate session", category: "Auth", authentication: true },
|
|
1529
|
+
"GET /auth/me": { description: "Get current authenticated user information", category: "Auth", authentication: true },
|
|
1530
|
+
"POST /auth/refresh": { description: "Refresh authentication token", category: "Auth", authentication: true },
|
|
1531
|
+
"POST /auth/seed-admin": { description: "Create or reset the admin user account", category: "Auth", authentication: false },
|
|
1532
|
+
"POST /auth/magic-link/request": { description: "Request a magic link login email", category: "Auth", authentication: false },
|
|
1533
|
+
"GET /auth/magic-link/verify": { description: "Verify magic link token and authenticate", category: "Auth", authentication: false },
|
|
1534
|
+
"POST /auth/otp/request": { description: "Request a one-time password via email", category: "Auth", authentication: false },
|
|
1535
|
+
"POST /auth/otp/verify": { description: "Verify OTP code and authenticate", category: "Auth", authentication: false },
|
|
1536
|
+
// Content endpoints
|
|
1537
|
+
"GET /api/collections": { description: "List all available collections", category: "Content", authentication: false },
|
|
1538
|
+
"GET /api/collections/:collection/content": { description: "Get all content items from a specific collection", category: "Content", authentication: false },
|
|
1539
|
+
"GET /api/content/:id": { description: "Get a specific content item by ID", category: "Content", authentication: false },
|
|
1540
|
+
"POST /api/content": { description: "Create a new content item", category: "Content", authentication: true },
|
|
1541
|
+
"PUT /api/content/:id": { description: "Update an existing content item", category: "Content", authentication: true },
|
|
1542
|
+
"DELETE /api/content/:id": { description: "Delete a content item", category: "Content", authentication: true },
|
|
1543
|
+
"GET /api/content/:id/versions": { description: "Get version history for a content item", category: "Content", authentication: true },
|
|
1544
|
+
"POST /api/content/:id/restore/:versionId": { description: "Restore a content item to a previous version", category: "Content", authentication: true },
|
|
1545
|
+
// Media endpoints
|
|
1546
|
+
"GET /api/media": { description: "List all media files with pagination", category: "Media", authentication: false },
|
|
1547
|
+
"GET /api/media/:id": { description: "Get a specific media file by ID", category: "Media", authentication: false },
|
|
1548
|
+
"POST /api/media/upload": { description: "Upload a new media file to R2 storage", category: "Media", authentication: true },
|
|
1549
|
+
"DELETE /api/media/:id": { description: "Delete a media file from storage", category: "Media", authentication: true },
|
|
1550
|
+
// Admin API endpoints
|
|
1551
|
+
"GET /admin/api/stats": { description: "Get dashboard statistics (collections, content, media, users)", category: "Admin", authentication: true },
|
|
1552
|
+
"GET /admin/api/storage": { description: "Get storage usage information", category: "Admin", authentication: true },
|
|
1553
|
+
"GET /admin/api/activity": { description: "Get recent activity logs", category: "Admin", authentication: true },
|
|
1554
|
+
"GET /admin/api/collections": { description: "List all collections with field counts", category: "Admin", authentication: true },
|
|
1555
|
+
"POST /admin/api/collections": { description: "Create a new collection", category: "Admin", authentication: true },
|
|
1556
|
+
"GET /admin/api/collections/:id": { description: "Get a specific collection with its fields", category: "Admin", authentication: true },
|
|
1557
|
+
"PATCH /admin/api/collections/:id": { description: "Update an existing collection", category: "Admin", authentication: true },
|
|
1558
|
+
"DELETE /admin/api/collections/:id": { description: "Delete a collection (must be empty)", category: "Admin", authentication: true },
|
|
1559
|
+
"GET /admin/api/collections/:id/fields": { description: "Get fields for a specific collection", category: "Admin", authentication: true },
|
|
1560
|
+
"POST /admin/api/collections/:id/fields": { description: "Add a field to a collection", category: "Admin", authentication: true },
|
|
1561
|
+
"PATCH /admin/api/collections/:id/fields/:fieldId": { description: "Update a collection field", category: "Admin", authentication: true },
|
|
1562
|
+
"DELETE /admin/api/collections/:id/fields/:fieldId": { description: "Remove a field from a collection", category: "Admin", authentication: true },
|
|
1563
|
+
"POST /admin/api/collections/:id/fields/reorder": { description: "Reorder fields in a collection", category: "Admin", authentication: true },
|
|
1564
|
+
"GET /admin/api/migrations/status": { description: "Get database migration status", category: "Admin", authentication: true },
|
|
1565
|
+
"POST /admin/api/migrations/run": { description: "Run pending database migrations", category: "Admin", authentication: true },
|
|
1566
|
+
"GET /admin/api/content": { description: "List content items with filtering and pagination", category: "Admin", authentication: true },
|
|
1567
|
+
"GET /admin/api/content/:id": { description: "Get a content item for admin editing", category: "Admin", authentication: true },
|
|
1568
|
+
"POST /admin/api/content": { description: "Create content via admin API", category: "Admin", authentication: true },
|
|
1569
|
+
"PUT /admin/api/content/:id": { description: "Update content via admin API", category: "Admin", authentication: true },
|
|
1570
|
+
"DELETE /admin/api/content/:id": { description: "Delete content via admin API", category: "Admin", authentication: true },
|
|
1571
|
+
"GET /admin/api/media": { description: "List media files for admin management", category: "Admin", authentication: true },
|
|
1572
|
+
"POST /admin/api/media/upload": { description: "Upload media via admin interface", category: "Admin", authentication: true },
|
|
1573
|
+
"DELETE /admin/api/media/:id": { description: "Delete media via admin interface", category: "Admin", authentication: true },
|
|
1574
|
+
"GET /admin/api/users": { description: "List all users", category: "Admin", authentication: true },
|
|
1575
|
+
"POST /admin/api/users": { description: "Create a new user", category: "Admin", authentication: true },
|
|
1576
|
+
"PUT /admin/api/users/:id": { description: "Update a user", category: "Admin", authentication: true },
|
|
1577
|
+
"DELETE /admin/api/users/:id": { description: "Delete a user", category: "Admin", authentication: true },
|
|
1578
|
+
"GET /admin/api/logs": { description: "Get application logs with filtering", category: "Admin", authentication: true },
|
|
1579
|
+
"GET /admin/api/plugins": { description: "List all registered plugins", category: "Admin", authentication: true },
|
|
1580
|
+
"POST /admin/api/plugins/:id/toggle": { description: "Enable or disable a plugin", category: "Admin", authentication: true },
|
|
1581
|
+
"GET /admin/api/settings": { description: "Get application settings", category: "Admin", authentication: true },
|
|
1582
|
+
"PUT /admin/api/settings": { description: "Update application settings", category: "Admin", authentication: true },
|
|
1583
|
+
"GET /admin/api/forms": { description: "List all forms", category: "Admin", authentication: true },
|
|
1584
|
+
"GET /admin/api/forms/:id": { description: "Get form details and submissions", category: "Admin", authentication: true },
|
|
1585
|
+
"POST /admin/api/forms": { description: "Create a new form", category: "Admin", authentication: true },
|
|
1586
|
+
"PUT /admin/api/forms/:id": { description: "Update a form", category: "Admin", authentication: true },
|
|
1587
|
+
"DELETE /admin/api/forms/:id": { description: "Delete a form", category: "Admin", authentication: true },
|
|
1588
|
+
"GET /admin/api/forms/:id/submissions": { description: "Get form submissions", category: "Admin", authentication: true },
|
|
1589
|
+
"DELETE /admin/api/forms/:id/submissions/:submissionId": { description: "Delete a form submission", category: "Admin", authentication: true },
|
|
1590
|
+
// Search endpoints
|
|
1591
|
+
"GET /api/search": { description: "Search content using AI, FTS5, keyword, or hybrid mode", category: "Search", authentication: false },
|
|
1592
|
+
"POST /api/search/click": { description: "Track a search result click for analytics", category: "Search", authentication: false },
|
|
1593
|
+
"GET /admin/plugins/ai-search/api/status": { description: "Get search plugin status and configuration", category: "Search", authentication: true },
|
|
1594
|
+
"POST /admin/plugins/ai-search/api/index": { description: "Trigger content indexing for search", category: "Search", authentication: true },
|
|
1595
|
+
"POST /admin/plugins/ai-search/api/index/reset": { description: "Reset the search index", category: "Search", authentication: true },
|
|
1596
|
+
"GET /admin/plugins/ai-search/api/analytics": { description: "Get search analytics and metrics", category: "Search", authentication: true },
|
|
1597
|
+
"GET /admin/plugins/ai-search/api/analytics/queries": { description: "Get top search queries", category: "Search", authentication: true },
|
|
1598
|
+
"GET /admin/plugins/ai-search/api/analytics/clicks": { description: "Get click-through analytics", category: "Search", authentication: true },
|
|
1599
|
+
"GET /admin/plugins/ai-search/api/fts5/status": { description: "Get FTS5 full-text search status", category: "Search", authentication: true },
|
|
1600
|
+
"POST /admin/plugins/ai-search/api/fts5/rebuild": { description: "Rebuild the FTS5 search index", category: "Search", authentication: true },
|
|
1601
|
+
"GET /admin/plugins/ai-search/api/facets": { description: "Get available search facets", category: "Search", authentication: true },
|
|
1602
|
+
"GET /admin/plugins/ai-search/api/experiments": { description: "List search A/B test experiments", category: "Search", authentication: true },
|
|
1603
|
+
"POST /admin/plugins/ai-search/api/experiments": { description: "Create a search A/B test experiment", category: "Search", authentication: true },
|
|
1604
|
+
"GET /admin/plugins/ai-search/api/experiments/:id": { description: "Get experiment details", category: "Search", authentication: true },
|
|
1605
|
+
"PUT /admin/plugins/ai-search/api/experiments/:id": { description: "Update an experiment", category: "Search", authentication: true },
|
|
1606
|
+
"DELETE /admin/plugins/ai-search/api/experiments/:id": { description: "Delete an experiment", category: "Search", authentication: true },
|
|
1607
|
+
"POST /admin/plugins/ai-search/api/experiments/:id/start": { description: "Start an experiment", category: "Search", authentication: true },
|
|
1608
|
+
"POST /admin/plugins/ai-search/api/experiments/:id/stop": { description: "Stop a running experiment", category: "Search", authentication: true },
|
|
1609
|
+
"GET /admin/plugins/ai-search/api/experiments/:id/results": { description: "Get experiment results and statistics", category: "Search", authentication: true },
|
|
1610
|
+
"GET /admin/plugins/ai-search/api/quality": { description: "Get search quality agent analysis", category: "Search", authentication: true },
|
|
1611
|
+
"POST /admin/plugins/ai-search/api/quality/run": { description: "Run search quality analysis", category: "Search", authentication: true },
|
|
1612
|
+
"GET /admin/plugins/ai-search/api/quality/recommendations": { description: "Get quality improvement recommendations", category: "Search", authentication: true },
|
|
1613
|
+
"POST /admin/plugins/ai-search/api/quality/recommendations/:id/apply": { description: "Apply a quality recommendation", category: "Search", authentication: true },
|
|
1614
|
+
"POST /admin/plugins/ai-search/api/quality/recommendations/:id/dismiss": { description: "Dismiss a quality recommendation", category: "Search", authentication: true },
|
|
1615
|
+
"GET /admin/plugins/ai-search/api/synonyms": { description: "List search synonyms", category: "Search", authentication: true },
|
|
1616
|
+
"POST /admin/plugins/ai-search/api/synonyms": { description: "Add a search synonym", category: "Search", authentication: true },
|
|
1617
|
+
"DELETE /admin/plugins/ai-search/api/synonyms/:id": { description: "Delete a search synonym", category: "Search", authentication: true },
|
|
1618
|
+
"GET /admin/plugins/ai-search/api/query-rules": { description: "List search query rules", category: "Search", authentication: true },
|
|
1619
|
+
"POST /admin/plugins/ai-search/api/query-rules": { description: "Create a query rule", category: "Search", authentication: true },
|
|
1620
|
+
"PUT /admin/plugins/ai-search/api/query-rules/:id": { description: "Update a query rule", category: "Search", authentication: true },
|
|
1621
|
+
"DELETE /admin/plugins/ai-search/api/query-rules/:id": { description: "Delete a query rule", category: "Search", authentication: true },
|
|
1622
|
+
"GET /admin/plugins/ai-search/api/settings": { description: "Get search plugin settings", category: "Search", authentication: true },
|
|
1623
|
+
"PUT /admin/plugins/ai-search/api/settings": { description: "Update search plugin settings", category: "Search", authentication: true },
|
|
1624
|
+
// API Key endpoints
|
|
1625
|
+
"GET /admin/api-keys/api/keys": { description: "List all API keys", category: "API Keys", authentication: true },
|
|
1626
|
+
"POST /admin/api-keys/api/keys": { description: "Create a new API key", category: "API Keys", authentication: true },
|
|
1627
|
+
"DELETE /admin/api-keys/api/keys/:id": { description: "Revoke an API key", category: "API Keys", authentication: true },
|
|
1628
|
+
"PUT /admin/api-keys/api/keys/:id": { description: "Update an API key", category: "API Keys", authentication: true },
|
|
1629
|
+
// Cache endpoints
|
|
1630
|
+
"GET /admin/cache/api/stats": { description: "Get cache statistics", category: "Cache", authentication: true },
|
|
1631
|
+
"POST /admin/cache/api/purge": { description: "Purge cache entries", category: "Cache", authentication: true },
|
|
1632
|
+
"GET /admin/cache/api/entries": { description: "List cache entries", category: "Cache", authentication: true },
|
|
1633
|
+
"DELETE /admin/cache/api/entries/:key": { description: "Delete a specific cache entry", category: "Cache", authentication: true },
|
|
1634
|
+
// Workflow endpoints
|
|
1635
|
+
"GET /workflow/status/:id": { description: "Get workflow status for a content item", category: "Workflow", authentication: true },
|
|
1636
|
+
"POST /workflow/submit/:id": { description: "Submit content for review", category: "Workflow", authentication: true },
|
|
1637
|
+
"POST /workflow/approve/:id": { description: "Approve content in review", category: "Workflow", authentication: true },
|
|
1638
|
+
"POST /workflow/reject/:id": { description: "Reject content in review", category: "Workflow", authentication: true },
|
|
1639
|
+
"POST /workflow/publish/:id": { description: "Publish approved content", category: "Workflow", authentication: true },
|
|
1640
|
+
"POST /workflow/unpublish/:id": { description: "Unpublish content", category: "Workflow", authentication: true },
|
|
1641
|
+
"GET /workflow/history/:id": { description: "Get workflow history for a content item", category: "Workflow", authentication: true },
|
|
1642
|
+
// Form endpoints (public)
|
|
1643
|
+
"POST /forms/:formId/submit": { description: "Submit a form (public endpoint)", category: "Forms", authentication: false },
|
|
1644
|
+
"GET /forms/:formId": { description: "Get form definition for rendering", category: "Forms", authentication: false },
|
|
1645
|
+
"POST /api/forms/:formId/submit": { description: "Submit a form via API", category: "Forms", authentication: false },
|
|
1646
|
+
"GET /api/forms/:formId": { description: "Get form definition via API", category: "Forms", authentication: false },
|
|
1647
|
+
// System endpoints
|
|
1648
|
+
"GET /health": { description: "Health check endpoint for monitoring", category: "System", authentication: false },
|
|
1649
|
+
"GET /api/health": { description: "API health check with schema information", category: "System", authentication: false },
|
|
1650
|
+
"GET /api": { description: "API root - returns API information and available endpoints", category: "System", authentication: false },
|
|
1651
|
+
"GET /api/system/info": { description: "Get system information and version", category: "System", authentication: false },
|
|
1652
|
+
"GET /api/system/schema": { description: "Get database schema information", category: "System", authentication: false },
|
|
1653
|
+
// File serving
|
|
1654
|
+
"GET /files/*": { description: "Serve files from R2 storage (public access)", category: "Files", authentication: false },
|
|
1655
|
+
// Database tools
|
|
1656
|
+
"POST /admin/database-tools/api/query": { description: "Execute a database query", category: "Admin", authentication: true },
|
|
1657
|
+
"GET /admin/database-tools/api/tables": { description: "List database tables", category: "Admin", authentication: true },
|
|
1658
|
+
"GET /admin/database-tools/api/tables/:name": { description: "Get table schema and sample data", category: "Admin", authentication: true },
|
|
1659
|
+
// Seed data
|
|
1660
|
+
"POST /admin/seed-data/api/generate": { description: "Generate seed data for development", category: "Admin", authentication: true },
|
|
1661
|
+
"GET /admin/seed-data/api/status": { description: "Get seed data generation status", category: "Admin", authentication: true },
|
|
1662
|
+
// Email plugin
|
|
1663
|
+
"POST /admin/plugins/email/api/send": { description: "Send an email", category: "Admin", authentication: true },
|
|
1664
|
+
"GET /admin/plugins/email/api/templates": { description: "List email templates", category: "Admin", authentication: true },
|
|
1665
|
+
"POST /admin/plugins/email/api/test": { description: "Send a test email", category: "Admin", authentication: true }
|
|
1666
|
+
};
|
|
1667
|
+
var INCLUDED_ROUTE_PATTERNS = [
|
|
1668
|
+
/^\/api\//,
|
|
1669
|
+
// All /api/* routes
|
|
1670
|
+
/^\/api$/,
|
|
1671
|
+
// API root
|
|
1672
|
+
/^\/auth\/(?!login$|register$)/,
|
|
1673
|
+
// Auth routes except GET login/register HTML pages
|
|
1674
|
+
/^\/auth\/login$/,
|
|
1675
|
+
// POST /auth/login (method filtered later)
|
|
1676
|
+
/^\/auth\/register$/,
|
|
1677
|
+
// POST /auth/register (method filtered later)
|
|
1678
|
+
/^\/admin\/api\//,
|
|
1679
|
+
// Admin API endpoints
|
|
1680
|
+
/^\/admin\/api-keys\/api\//,
|
|
1681
|
+
// API key management
|
|
1682
|
+
/^\/admin\/cache\/api\//,
|
|
1683
|
+
// Cache management API
|
|
1684
|
+
/^\/admin\/plugins\/.*\/api\//,
|
|
1685
|
+
// Plugin API endpoints
|
|
1686
|
+
/^\/admin\/database-tools\/api\//,
|
|
1687
|
+
// Database tools API
|
|
1688
|
+
/^\/admin\/seed-data\/api\//,
|
|
1689
|
+
// Seed data API
|
|
1690
|
+
/^\/workflow\//,
|
|
1691
|
+
// Workflow endpoints
|
|
1692
|
+
/^\/health$/,
|
|
1693
|
+
// Health check
|
|
1694
|
+
/^\/files\//,
|
|
1695
|
+
// File serving
|
|
1696
|
+
/^\/forms\//
|
|
1697
|
+
// Public form endpoints
|
|
1698
|
+
];
|
|
1699
|
+
var EXCLUDED_ROUTES = /* @__PURE__ */ new Set([
|
|
1700
|
+
"GET /auth/login",
|
|
1701
|
+
"GET /auth/register",
|
|
1702
|
+
"GET /auth/login/form"
|
|
1703
|
+
]);
|
|
1704
|
+
var cachedRouteList = null;
|
|
1705
|
+
function isIncludedRoute(method, path) {
|
|
1706
|
+
const key = `${method} ${path}`;
|
|
1707
|
+
if (EXCLUDED_ROUTES.has(key)) {
|
|
1708
|
+
return false;
|
|
1709
|
+
}
|
|
1710
|
+
return INCLUDED_ROUTE_PATTERNS.some((pattern) => pattern.test(path));
|
|
1711
|
+
}
|
|
1712
|
+
function inferCategory(path) {
|
|
1713
|
+
if (path.startsWith("/auth/")) return "Auth";
|
|
1714
|
+
if (path.startsWith("/api/search")) return "Search";
|
|
1715
|
+
if (path.startsWith("/api/media")) return "Media";
|
|
1716
|
+
if (path.startsWith("/api/system")) return "System";
|
|
1717
|
+
if (path.startsWith("/api/content") || path.startsWith("/api/collections")) return "Content";
|
|
1718
|
+
if (path.startsWith("/api/forms")) return "Forms";
|
|
1719
|
+
if (path.startsWith("/admin/api-keys")) return "API Keys";
|
|
1720
|
+
if (path.startsWith("/admin/cache")) return "Cache";
|
|
1721
|
+
if (path.startsWith("/admin/plugins/ai-search")) return "Search";
|
|
1722
|
+
if (path.startsWith("/admin/api")) return "Admin";
|
|
1723
|
+
if (path.startsWith("/admin/database-tools")) return "Admin";
|
|
1724
|
+
if (path.startsWith("/admin/seed-data")) return "Admin";
|
|
1725
|
+
if (path.startsWith("/admin/plugins/email")) return "Admin";
|
|
1726
|
+
if (path.startsWith("/workflow/")) return "Workflow";
|
|
1727
|
+
if (path.startsWith("/forms/")) return "Forms";
|
|
1728
|
+
if (path.startsWith("/files/")) return "Files";
|
|
1729
|
+
if (path === "/health" || path.startsWith("/api")) return "System";
|
|
1730
|
+
return "Other";
|
|
1731
|
+
}
|
|
1732
|
+
function inferAuth(path) {
|
|
1733
|
+
if (path === "/health" || path === "/api" || path === "/api/health") return false;
|
|
1734
|
+
if (path === "/api/system/info" || path === "/api/system/schema") return false;
|
|
1735
|
+
if (path.startsWith("/files/")) return false;
|
|
1736
|
+
if (path.startsWith("/forms/") || path.startsWith("/api/forms/")) return false;
|
|
1737
|
+
if (path.startsWith("/admin/")) return true;
|
|
1738
|
+
if (path.startsWith("/workflow/")) return true;
|
|
1739
|
+
return "unknown";
|
|
1740
|
+
}
|
|
1741
|
+
function buildRouteList(app) {
|
|
1742
|
+
if (cachedRouteList) return cachedRouteList;
|
|
1743
|
+
if (!app) return [];
|
|
1744
|
+
try {
|
|
1745
|
+
const routes = dev.inspectRoutes(app);
|
|
1746
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1747
|
+
const result = [];
|
|
1748
|
+
for (const route of routes) {
|
|
1749
|
+
if (route.isMiddleware) continue;
|
|
1750
|
+
if (route.method === "ALL") continue;
|
|
1751
|
+
const key = `${route.method} ${route.path}`;
|
|
1752
|
+
if (seen.has(key)) continue;
|
|
1753
|
+
seen.add(key);
|
|
1754
|
+
if (!isIncludedRoute(route.method, route.path)) continue;
|
|
1755
|
+
const meta = ROUTE_METADATA[key];
|
|
1756
|
+
if (meta) {
|
|
1757
|
+
result.push({
|
|
1758
|
+
method: route.method,
|
|
1759
|
+
path: route.path,
|
|
1760
|
+
description: meta.description,
|
|
1761
|
+
authentication: meta.authentication,
|
|
1762
|
+
category: meta.category,
|
|
1763
|
+
documented: true
|
|
1764
|
+
});
|
|
1765
|
+
} else {
|
|
1766
|
+
result.push({
|
|
1767
|
+
method: route.method,
|
|
1768
|
+
path: route.path,
|
|
1769
|
+
description: "",
|
|
1770
|
+
authentication: inferAuth(route.path),
|
|
1771
|
+
category: inferCategory(route.path),
|
|
1772
|
+
documented: false
|
|
1773
|
+
});
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
const methodOrder = { GET: 0, POST: 1, PUT: 2, PATCH: 3, DELETE: 4 };
|
|
1777
|
+
result.sort((a, b) => {
|
|
1778
|
+
const catCmp = a.category.localeCompare(b.category);
|
|
1779
|
+
if (catCmp !== 0) return catCmp;
|
|
1780
|
+
const methCmp = (methodOrder[a.method] ?? 5) - (methodOrder[b.method] ?? 5);
|
|
1781
|
+
if (methCmp !== 0) return methCmp;
|
|
1782
|
+
return a.path.localeCompare(b.path);
|
|
1783
|
+
});
|
|
1784
|
+
cachedRouteList = result;
|
|
1785
|
+
return result;
|
|
1786
|
+
} catch (error) {
|
|
1787
|
+
console.error("Failed to inspect routes:", error);
|
|
1788
|
+
return [];
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1458
1791
|
|
|
1459
1792
|
exports.CACHE_CONFIGS = CACHE_CONFIGS;
|
|
1793
|
+
exports.CATEGORY_INFO = CATEGORY_INFO;
|
|
1460
1794
|
exports.CacheService = CacheService;
|
|
1461
1795
|
exports.Logger = Logger;
|
|
1462
1796
|
exports.SettingsService = SettingsService;
|
|
1463
1797
|
exports.TelemetryService = TelemetryService;
|
|
1464
1798
|
exports.apiTokens = apiTokens;
|
|
1799
|
+
exports.buildRouteList = buildRouteList;
|
|
1465
1800
|
exports.collections = collections;
|
|
1466
1801
|
exports.content = content;
|
|
1467
1802
|
exports.contentVersions = contentVersions;
|
|
1468
1803
|
exports.createInstallationIdentity = createInstallationIdentity;
|
|
1804
|
+
exports.getAppInstance = getAppInstance;
|
|
1469
1805
|
exports.getCacheService = getCacheService;
|
|
1470
1806
|
exports.getLogger = getLogger;
|
|
1471
1807
|
exports.getTelemetryService = getTelemetryService;
|
|
@@ -1503,8 +1839,9 @@ exports.selectPluginSchema = selectPluginSchema;
|
|
|
1503
1839
|
exports.selectSystemLogSchema = selectSystemLogSchema;
|
|
1504
1840
|
exports.selectUserSchema = selectUserSchema;
|
|
1505
1841
|
exports.selectWorkflowHistorySchema = selectWorkflowHistorySchema;
|
|
1842
|
+
exports.setAppInstance = setAppInstance;
|
|
1506
1843
|
exports.systemLogs = systemLogs;
|
|
1507
1844
|
exports.users = users;
|
|
1508
1845
|
exports.workflowHistory = workflowHistory;
|
|
1509
|
-
//# sourceMappingURL=chunk-
|
|
1510
|
-
//# sourceMappingURL=chunk-
|
|
1846
|
+
//# sourceMappingURL=chunk-64APW3DW.cjs.map
|
|
1847
|
+
//# sourceMappingURL=chunk-64APW3DW.cjs.map
|