@sonicjs-cms/core 2.8.3 → 2.10.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-YFJJU26H.js → chunk-27AOVQTR.js} +10 -2
- package/dist/chunk-27AOVQTR.js.map +1 -0
- package/dist/{chunk-Y3VMEGY2.js → chunk-4TTMQQC7.js} +4 -4
- package/dist/{chunk-Y3VMEGY2.js.map → chunk-4TTMQQC7.js.map} +1 -1
- package/dist/{chunk-VNLR35GO.cjs → chunk-64APW3DW.cjs} +339 -2
- package/dist/chunk-64APW3DW.cjs.map +1 -0
- package/dist/{chunk-GTFMI24U.js → chunk-6O3RJV3C.js} +2 -2
- package/dist/{chunk-GTFMI24U.js.map → chunk-6O3RJV3C.js.map} +1 -1
- 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-JDIM5AG7.cjs → chunk-EKPLKUZT.cjs} +11 -5
- package/dist/chunk-EKPLKUZT.cjs.map +1 -0
- package/dist/{chunk-MPT5PA6U.cjs → chunk-IIBRG5S5.cjs} +10 -2
- package/dist/chunk-IIBRG5S5.cjs.map +1 -0
- package/dist/{chunk-K4Q4SFJJ.cjs → chunk-IT2TC4ZD.cjs} +7 -7
- package/dist/{chunk-K4Q4SFJJ.cjs.map → chunk-IT2TC4ZD.cjs.map} +1 -1
- package/dist/{chunk-5XAI2XUF.js → chunk-IZWNIUJI.js} +11 -5
- package/dist/chunk-IZWNIUJI.js.map +1 -0
- package/dist/{chunk-CH5UHZVM.js → chunk-JTNUM7JE.js} +1218 -442
- package/dist/chunk-JTNUM7JE.js.map +1 -0
- package/dist/chunk-MNFY6DWY.cjs +54 -54
- package/dist/chunk-MNFY6DWY.cjs.map +1 -1
- package/dist/{chunk-R4WR3VTN.cjs → chunk-RCA6R6VE.cjs} +1329 -553
- package/dist/chunk-RCA6R6VE.cjs.map +1 -0
- package/dist/{chunk-HXHVU5GM.cjs → chunk-ZMVWMJ3S.cjs} +2 -2
- package/dist/{chunk-HXHVU5GM.cjs.map → chunk-ZMVWMJ3S.cjs.map} +1 -1
- package/dist/{collection-config-i8EaAF7z.d.cts → collection-config-B4PG-AaF.d.cts} +4 -2
- package/dist/{collection-config-i8EaAF7z.d.ts → collection-config-B4PG-AaF.d.ts} +4 -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 +142 -141
- 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 +11 -10
- package/dist/index.js.map +1 -1
- package/dist/middleware.cjs +29 -29
- package/dist/middleware.d.cts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/middleware.js +3 -3
- package/dist/migrations-N2C2VPJU.js +4 -0
- package/dist/{migrations-KHWFJ2HN.js.map → migrations-N2C2VPJU.js.map} +1 -1
- package/dist/migrations-ONIAY6GK.cjs +13 -0
- package/dist/{migrations-7X4RPH7O.cjs.map → migrations-ONIAY6GK.cjs.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-CJozpgmI.d.cts → plugin-bootstrap-WmpvYM5w.d.ts} +2 -2
- package/dist/{plugin-bootstrap-DU5VmuHZ.d.ts → plugin-bootstrap-fpG98Otb.d.cts} +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 +29 -29
- package/dist/routes.d.cts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.js +6 -6
- package/dist/services.cjs +44 -28
- package/dist/services.d.cts +29 -4
- package/dist/services.d.ts +29 -4
- package/dist/services.js +3 -3
- 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 +9 -3
- package/dist/chunk-5XAI2XUF.js.map +0 -1
- package/dist/chunk-CH5UHZVM.js.map +0 -1
- package/dist/chunk-G44QUVNM.js.map +0 -1
- package/dist/chunk-JDIM5AG7.cjs.map +0 -1
- package/dist/chunk-MPT5PA6U.cjs.map +0 -1
- package/dist/chunk-R4WR3VTN.cjs.map +0 -1
- package/dist/chunk-VNLR35GO.cjs.map +0 -1
- package/dist/chunk-YFJJU26H.js.map +0 -1
- package/dist/migrations-7X4RPH7O.cjs +0 -13
- package/dist/migrations-KHWFJ2HN.js +0 -4
|
@@ -2,8 +2,9 @@ import { getTelemetryConfig, sanitizeErrorMessage, sanitizeRoute, generateInstal
|
|
|
2
2
|
import { __export } from './chunk-V4OQ3NZ2.js';
|
|
3
3
|
import { sqliteTable, integer, text } from 'drizzle-orm/sqlite-core';
|
|
4
4
|
import { z } from 'zod/v4';
|
|
5
|
-
import { getTableColumns, getViewSelectedFields,
|
|
5
|
+
import { isTable, getTableColumns, getViewSelectedFields, is, Column, SQL, isView, inArray, eq, like, gte, lte, and, count, asc, desc } from 'drizzle-orm';
|
|
6
6
|
import { drizzle } from 'drizzle-orm/d1';
|
|
7
|
+
import { inspectRoutes } from 'hono/dev';
|
|
7
8
|
|
|
8
9
|
// src/db/schema.ts
|
|
9
10
|
var schema_exports = {};
|
|
@@ -1453,7 +1454,339 @@ function createInstallationIdentity(projectName) {
|
|
|
1453
1454
|
}
|
|
1454
1455
|
return identity;
|
|
1455
1456
|
}
|
|
1457
|
+
var appInstance = null;
|
|
1458
|
+
function setAppInstance(app) {
|
|
1459
|
+
appInstance = app;
|
|
1460
|
+
}
|
|
1461
|
+
function getAppInstance() {
|
|
1462
|
+
return appInstance;
|
|
1463
|
+
}
|
|
1464
|
+
var CATEGORY_INFO = {
|
|
1465
|
+
"Auth": {
|
|
1466
|
+
title: "Authentication",
|
|
1467
|
+
description: "User authentication and authorization endpoints",
|
|
1468
|
+
icon: "🔐"
|
|
1469
|
+
},
|
|
1470
|
+
"Content": {
|
|
1471
|
+
title: "Content Management",
|
|
1472
|
+
description: "Content creation, retrieval, and management",
|
|
1473
|
+
icon: "📝"
|
|
1474
|
+
},
|
|
1475
|
+
"Media": {
|
|
1476
|
+
title: "Media Management",
|
|
1477
|
+
description: "File upload, storage, and media operations",
|
|
1478
|
+
icon: "🖼️"
|
|
1479
|
+
},
|
|
1480
|
+
"Admin": {
|
|
1481
|
+
title: "Admin Interface",
|
|
1482
|
+
description: "Administrative panel and management features",
|
|
1483
|
+
icon: "⚙️"
|
|
1484
|
+
},
|
|
1485
|
+
"System": {
|
|
1486
|
+
title: "System",
|
|
1487
|
+
description: "Health checks and system information",
|
|
1488
|
+
icon: "🔧"
|
|
1489
|
+
},
|
|
1490
|
+
"Search": {
|
|
1491
|
+
title: "Search",
|
|
1492
|
+
description: "AI-powered search, full-text search, and analytics",
|
|
1493
|
+
icon: "🔍"
|
|
1494
|
+
},
|
|
1495
|
+
"API Keys": {
|
|
1496
|
+
title: "API Keys",
|
|
1497
|
+
description: "API key management and authentication",
|
|
1498
|
+
icon: "🔑"
|
|
1499
|
+
},
|
|
1500
|
+
"Workflow": {
|
|
1501
|
+
title: "Workflow",
|
|
1502
|
+
description: "Content workflow and approval processes",
|
|
1503
|
+
icon: "🔄"
|
|
1504
|
+
},
|
|
1505
|
+
"Cache": {
|
|
1506
|
+
title: "Cache",
|
|
1507
|
+
description: "Cache management and invalidation",
|
|
1508
|
+
icon: "⚡"
|
|
1509
|
+
},
|
|
1510
|
+
"Forms": {
|
|
1511
|
+
title: "Forms",
|
|
1512
|
+
description: "Form submissions and management",
|
|
1513
|
+
icon: "📋"
|
|
1514
|
+
},
|
|
1515
|
+
"Files": {
|
|
1516
|
+
title: "Files",
|
|
1517
|
+
description: "File serving from R2 storage",
|
|
1518
|
+
icon: "📁"
|
|
1519
|
+
}
|
|
1520
|
+
};
|
|
1521
|
+
var ROUTE_METADATA = {
|
|
1522
|
+
// Auth endpoints
|
|
1523
|
+
"POST /auth/login": { description: "Authenticate user with email and password (returns JWT)", category: "Auth", authentication: false },
|
|
1524
|
+
"POST /auth/login/form": { description: "Form-based login (sets session cookie)", category: "Auth", authentication: false },
|
|
1525
|
+
"POST /auth/register": { description: "Register a new user account", category: "Auth", authentication: false },
|
|
1526
|
+
"POST /auth/logout": { description: "Log out the current user and invalidate session", category: "Auth", authentication: true },
|
|
1527
|
+
"GET /auth/me": { description: "Get current authenticated user information", category: "Auth", authentication: true },
|
|
1528
|
+
"POST /auth/refresh": { description: "Refresh authentication token", category: "Auth", authentication: true },
|
|
1529
|
+
"POST /auth/seed-admin": { description: "Create or reset the admin user account", category: "Auth", authentication: false },
|
|
1530
|
+
"POST /auth/magic-link/request": { description: "Request a magic link login email", category: "Auth", authentication: false },
|
|
1531
|
+
"GET /auth/magic-link/verify": { description: "Verify magic link token and authenticate", category: "Auth", authentication: false },
|
|
1532
|
+
"POST /auth/otp/request": { description: "Request a one-time password via email", category: "Auth", authentication: false },
|
|
1533
|
+
"POST /auth/otp/verify": { description: "Verify OTP code and authenticate", category: "Auth", authentication: false },
|
|
1534
|
+
// Content endpoints
|
|
1535
|
+
"GET /api/collections": { description: "List all available collections", category: "Content", authentication: false },
|
|
1536
|
+
"GET /api/collections/:collection/content": { description: "Get all content items from a specific collection", category: "Content", authentication: false },
|
|
1537
|
+
"GET /api/content/:id": { description: "Get a specific content item by ID", category: "Content", authentication: false },
|
|
1538
|
+
"POST /api/content": { description: "Create a new content item", category: "Content", authentication: true },
|
|
1539
|
+
"PUT /api/content/:id": { description: "Update an existing content item", category: "Content", authentication: true },
|
|
1540
|
+
"DELETE /api/content/:id": { description: "Delete a content item", category: "Content", authentication: true },
|
|
1541
|
+
"GET /api/content/:id/versions": { description: "Get version history for a content item", category: "Content", authentication: true },
|
|
1542
|
+
"POST /api/content/:id/restore/:versionId": { description: "Restore a content item to a previous version", category: "Content", authentication: true },
|
|
1543
|
+
// Media endpoints
|
|
1544
|
+
"GET /api/media": { description: "List all media files with pagination", category: "Media", authentication: false },
|
|
1545
|
+
"GET /api/media/:id": { description: "Get a specific media file by ID", category: "Media", authentication: false },
|
|
1546
|
+
"POST /api/media/upload": { description: "Upload a new media file to R2 storage", category: "Media", authentication: true },
|
|
1547
|
+
"DELETE /api/media/:id": { description: "Delete a media file from storage", category: "Media", authentication: true },
|
|
1548
|
+
// Admin API endpoints
|
|
1549
|
+
"GET /admin/api/stats": { description: "Get dashboard statistics (collections, content, media, users)", category: "Admin", authentication: true },
|
|
1550
|
+
"GET /admin/api/storage": { description: "Get storage usage information", category: "Admin", authentication: true },
|
|
1551
|
+
"GET /admin/api/activity": { description: "Get recent activity logs", category: "Admin", authentication: true },
|
|
1552
|
+
"GET /admin/api/collections": { description: "List all collections with field counts", category: "Admin", authentication: true },
|
|
1553
|
+
"POST /admin/api/collections": { description: "Create a new collection", category: "Admin", authentication: true },
|
|
1554
|
+
"GET /admin/api/collections/:id": { description: "Get a specific collection with its fields", category: "Admin", authentication: true },
|
|
1555
|
+
"PATCH /admin/api/collections/:id": { description: "Update an existing collection", category: "Admin", authentication: true },
|
|
1556
|
+
"DELETE /admin/api/collections/:id": { description: "Delete a collection (must be empty)", category: "Admin", authentication: true },
|
|
1557
|
+
"GET /admin/api/collections/:id/fields": { description: "Get fields for a specific collection", category: "Admin", authentication: true },
|
|
1558
|
+
"POST /admin/api/collections/:id/fields": { description: "Add a field to a collection", category: "Admin", authentication: true },
|
|
1559
|
+
"PATCH /admin/api/collections/:id/fields/:fieldId": { description: "Update a collection field", category: "Admin", authentication: true },
|
|
1560
|
+
"DELETE /admin/api/collections/:id/fields/:fieldId": { description: "Remove a field from a collection", category: "Admin", authentication: true },
|
|
1561
|
+
"POST /admin/api/collections/:id/fields/reorder": { description: "Reorder fields in a collection", category: "Admin", authentication: true },
|
|
1562
|
+
"GET /admin/api/migrations/status": { description: "Get database migration status", category: "Admin", authentication: true },
|
|
1563
|
+
"POST /admin/api/migrations/run": { description: "Run pending database migrations", category: "Admin", authentication: true },
|
|
1564
|
+
"GET /admin/api/content": { description: "List content items with filtering and pagination", category: "Admin", authentication: true },
|
|
1565
|
+
"GET /admin/api/content/:id": { description: "Get a content item for admin editing", category: "Admin", authentication: true },
|
|
1566
|
+
"POST /admin/api/content": { description: "Create content via admin API", category: "Admin", authentication: true },
|
|
1567
|
+
"PUT /admin/api/content/:id": { description: "Update content via admin API", category: "Admin", authentication: true },
|
|
1568
|
+
"DELETE /admin/api/content/:id": { description: "Delete content via admin API", category: "Admin", authentication: true },
|
|
1569
|
+
"GET /admin/api/media": { description: "List media files for admin management", category: "Admin", authentication: true },
|
|
1570
|
+
"POST /admin/api/media/upload": { description: "Upload media via admin interface", category: "Admin", authentication: true },
|
|
1571
|
+
"DELETE /admin/api/media/:id": { description: "Delete media via admin interface", category: "Admin", authentication: true },
|
|
1572
|
+
"GET /admin/api/users": { description: "List all users", category: "Admin", authentication: true },
|
|
1573
|
+
"POST /admin/api/users": { description: "Create a new user", category: "Admin", authentication: true },
|
|
1574
|
+
"PUT /admin/api/users/:id": { description: "Update a user", category: "Admin", authentication: true },
|
|
1575
|
+
"DELETE /admin/api/users/:id": { description: "Delete a user", category: "Admin", authentication: true },
|
|
1576
|
+
"GET /admin/api/logs": { description: "Get application logs with filtering", category: "Admin", authentication: true },
|
|
1577
|
+
"GET /admin/api/plugins": { description: "List all registered plugins", category: "Admin", authentication: true },
|
|
1578
|
+
"POST /admin/api/plugins/:id/toggle": { description: "Enable or disable a plugin", category: "Admin", authentication: true },
|
|
1579
|
+
"GET /admin/api/settings": { description: "Get application settings", category: "Admin", authentication: true },
|
|
1580
|
+
"PUT /admin/api/settings": { description: "Update application settings", category: "Admin", authentication: true },
|
|
1581
|
+
"GET /admin/api/forms": { description: "List all forms", category: "Admin", authentication: true },
|
|
1582
|
+
"GET /admin/api/forms/:id": { description: "Get form details and submissions", category: "Admin", authentication: true },
|
|
1583
|
+
"POST /admin/api/forms": { description: "Create a new form", category: "Admin", authentication: true },
|
|
1584
|
+
"PUT /admin/api/forms/:id": { description: "Update a form", category: "Admin", authentication: true },
|
|
1585
|
+
"DELETE /admin/api/forms/:id": { description: "Delete a form", category: "Admin", authentication: true },
|
|
1586
|
+
"GET /admin/api/forms/:id/submissions": { description: "Get form submissions", category: "Admin", authentication: true },
|
|
1587
|
+
"DELETE /admin/api/forms/:id/submissions/:submissionId": { description: "Delete a form submission", category: "Admin", authentication: true },
|
|
1588
|
+
// Search endpoints
|
|
1589
|
+
"GET /api/search": { description: "Search content using AI, FTS5, keyword, or hybrid mode", category: "Search", authentication: false },
|
|
1590
|
+
"POST /api/search/click": { description: "Track a search result click for analytics", category: "Search", authentication: false },
|
|
1591
|
+
"GET /admin/plugins/ai-search/api/status": { description: "Get search plugin status and configuration", category: "Search", authentication: true },
|
|
1592
|
+
"POST /admin/plugins/ai-search/api/index": { description: "Trigger content indexing for search", category: "Search", authentication: true },
|
|
1593
|
+
"POST /admin/plugins/ai-search/api/index/reset": { description: "Reset the search index", category: "Search", authentication: true },
|
|
1594
|
+
"GET /admin/plugins/ai-search/api/analytics": { description: "Get search analytics and metrics", category: "Search", authentication: true },
|
|
1595
|
+
"GET /admin/plugins/ai-search/api/analytics/queries": { description: "Get top search queries", category: "Search", authentication: true },
|
|
1596
|
+
"GET /admin/plugins/ai-search/api/analytics/clicks": { description: "Get click-through analytics", category: "Search", authentication: true },
|
|
1597
|
+
"GET /admin/plugins/ai-search/api/fts5/status": { description: "Get FTS5 full-text search status", category: "Search", authentication: true },
|
|
1598
|
+
"POST /admin/plugins/ai-search/api/fts5/rebuild": { description: "Rebuild the FTS5 search index", category: "Search", authentication: true },
|
|
1599
|
+
"GET /admin/plugins/ai-search/api/facets": { description: "Get available search facets", category: "Search", authentication: true },
|
|
1600
|
+
"GET /admin/plugins/ai-search/api/experiments": { description: "List search A/B test experiments", category: "Search", authentication: true },
|
|
1601
|
+
"POST /admin/plugins/ai-search/api/experiments": { description: "Create a search A/B test experiment", category: "Search", authentication: true },
|
|
1602
|
+
"GET /admin/plugins/ai-search/api/experiments/:id": { description: "Get experiment details", category: "Search", authentication: true },
|
|
1603
|
+
"PUT /admin/plugins/ai-search/api/experiments/:id": { description: "Update an experiment", category: "Search", authentication: true },
|
|
1604
|
+
"DELETE /admin/plugins/ai-search/api/experiments/:id": { description: "Delete an experiment", category: "Search", authentication: true },
|
|
1605
|
+
"POST /admin/plugins/ai-search/api/experiments/:id/start": { description: "Start an experiment", category: "Search", authentication: true },
|
|
1606
|
+
"POST /admin/plugins/ai-search/api/experiments/:id/stop": { description: "Stop a running experiment", category: "Search", authentication: true },
|
|
1607
|
+
"GET /admin/plugins/ai-search/api/experiments/:id/results": { description: "Get experiment results and statistics", category: "Search", authentication: true },
|
|
1608
|
+
"GET /admin/plugins/ai-search/api/quality": { description: "Get search quality agent analysis", category: "Search", authentication: true },
|
|
1609
|
+
"POST /admin/plugins/ai-search/api/quality/run": { description: "Run search quality analysis", category: "Search", authentication: true },
|
|
1610
|
+
"GET /admin/plugins/ai-search/api/quality/recommendations": { description: "Get quality improvement recommendations", category: "Search", authentication: true },
|
|
1611
|
+
"POST /admin/plugins/ai-search/api/quality/recommendations/:id/apply": { description: "Apply a quality recommendation", category: "Search", authentication: true },
|
|
1612
|
+
"POST /admin/plugins/ai-search/api/quality/recommendations/:id/dismiss": { description: "Dismiss a quality recommendation", category: "Search", authentication: true },
|
|
1613
|
+
"GET /admin/plugins/ai-search/api/synonyms": { description: "List search synonyms", category: "Search", authentication: true },
|
|
1614
|
+
"POST /admin/plugins/ai-search/api/synonyms": { description: "Add a search synonym", category: "Search", authentication: true },
|
|
1615
|
+
"DELETE /admin/plugins/ai-search/api/synonyms/:id": { description: "Delete a search synonym", category: "Search", authentication: true },
|
|
1616
|
+
"GET /admin/plugins/ai-search/api/query-rules": { description: "List search query rules", category: "Search", authentication: true },
|
|
1617
|
+
"POST /admin/plugins/ai-search/api/query-rules": { description: "Create a query rule", category: "Search", authentication: true },
|
|
1618
|
+
"PUT /admin/plugins/ai-search/api/query-rules/:id": { description: "Update a query rule", category: "Search", authentication: true },
|
|
1619
|
+
"DELETE /admin/plugins/ai-search/api/query-rules/:id": { description: "Delete a query rule", category: "Search", authentication: true },
|
|
1620
|
+
"GET /admin/plugins/ai-search/api/settings": { description: "Get search plugin settings", category: "Search", authentication: true },
|
|
1621
|
+
"PUT /admin/plugins/ai-search/api/settings": { description: "Update search plugin settings", category: "Search", authentication: true },
|
|
1622
|
+
// API Key endpoints
|
|
1623
|
+
"GET /admin/api-keys/api/keys": { description: "List all API keys", category: "API Keys", authentication: true },
|
|
1624
|
+
"POST /admin/api-keys/api/keys": { description: "Create a new API key", category: "API Keys", authentication: true },
|
|
1625
|
+
"DELETE /admin/api-keys/api/keys/:id": { description: "Revoke an API key", category: "API Keys", authentication: true },
|
|
1626
|
+
"PUT /admin/api-keys/api/keys/:id": { description: "Update an API key", category: "API Keys", authentication: true },
|
|
1627
|
+
// Cache endpoints
|
|
1628
|
+
"GET /admin/cache/api/stats": { description: "Get cache statistics", category: "Cache", authentication: true },
|
|
1629
|
+
"POST /admin/cache/api/purge": { description: "Purge cache entries", category: "Cache", authentication: true },
|
|
1630
|
+
"GET /admin/cache/api/entries": { description: "List cache entries", category: "Cache", authentication: true },
|
|
1631
|
+
"DELETE /admin/cache/api/entries/:key": { description: "Delete a specific cache entry", category: "Cache", authentication: true },
|
|
1632
|
+
// Workflow endpoints
|
|
1633
|
+
"GET /workflow/status/:id": { description: "Get workflow status for a content item", category: "Workflow", authentication: true },
|
|
1634
|
+
"POST /workflow/submit/:id": { description: "Submit content for review", category: "Workflow", authentication: true },
|
|
1635
|
+
"POST /workflow/approve/:id": { description: "Approve content in review", category: "Workflow", authentication: true },
|
|
1636
|
+
"POST /workflow/reject/:id": { description: "Reject content in review", category: "Workflow", authentication: true },
|
|
1637
|
+
"POST /workflow/publish/:id": { description: "Publish approved content", category: "Workflow", authentication: true },
|
|
1638
|
+
"POST /workflow/unpublish/:id": { description: "Unpublish content", category: "Workflow", authentication: true },
|
|
1639
|
+
"GET /workflow/history/:id": { description: "Get workflow history for a content item", category: "Workflow", authentication: true },
|
|
1640
|
+
// Form endpoints (public)
|
|
1641
|
+
"POST /forms/:formId/submit": { description: "Submit a form (public endpoint)", category: "Forms", authentication: false },
|
|
1642
|
+
"GET /forms/:formId": { description: "Get form definition for rendering", category: "Forms", authentication: false },
|
|
1643
|
+
"POST /api/forms/:formId/submit": { description: "Submit a form via API", category: "Forms", authentication: false },
|
|
1644
|
+
"GET /api/forms/:formId": { description: "Get form definition via API", category: "Forms", authentication: false },
|
|
1645
|
+
// System endpoints
|
|
1646
|
+
"GET /health": { description: "Health check endpoint for monitoring", category: "System", authentication: false },
|
|
1647
|
+
"GET /api/health": { description: "API health check with schema information", category: "System", authentication: false },
|
|
1648
|
+
"GET /api": { description: "API root - returns API information and available endpoints", category: "System", authentication: false },
|
|
1649
|
+
"GET /api/system/info": { description: "Get system information and version", category: "System", authentication: false },
|
|
1650
|
+
"GET /api/system/schema": { description: "Get database schema information", category: "System", authentication: false },
|
|
1651
|
+
// File serving
|
|
1652
|
+
"GET /files/*": { description: "Serve files from R2 storage (public access)", category: "Files", authentication: false },
|
|
1653
|
+
// Database tools
|
|
1654
|
+
"POST /admin/database-tools/api/query": { description: "Execute a database query", category: "Admin", authentication: true },
|
|
1655
|
+
"GET /admin/database-tools/api/tables": { description: "List database tables", category: "Admin", authentication: true },
|
|
1656
|
+
"GET /admin/database-tools/api/tables/:name": { description: "Get table schema and sample data", category: "Admin", authentication: true },
|
|
1657
|
+
// Seed data
|
|
1658
|
+
"POST /admin/seed-data/api/generate": { description: "Generate seed data for development", category: "Admin", authentication: true },
|
|
1659
|
+
"GET /admin/seed-data/api/status": { description: "Get seed data generation status", category: "Admin", authentication: true },
|
|
1660
|
+
// Email plugin
|
|
1661
|
+
"POST /admin/plugins/email/api/send": { description: "Send an email", category: "Admin", authentication: true },
|
|
1662
|
+
"GET /admin/plugins/email/api/templates": { description: "List email templates", category: "Admin", authentication: true },
|
|
1663
|
+
"POST /admin/plugins/email/api/test": { description: "Send a test email", category: "Admin", authentication: true }
|
|
1664
|
+
};
|
|
1665
|
+
var INCLUDED_ROUTE_PATTERNS = [
|
|
1666
|
+
/^\/api\//,
|
|
1667
|
+
// All /api/* routes
|
|
1668
|
+
/^\/api$/,
|
|
1669
|
+
// API root
|
|
1670
|
+
/^\/auth\/(?!login$|register$)/,
|
|
1671
|
+
// Auth routes except GET login/register HTML pages
|
|
1672
|
+
/^\/auth\/login$/,
|
|
1673
|
+
// POST /auth/login (method filtered later)
|
|
1674
|
+
/^\/auth\/register$/,
|
|
1675
|
+
// POST /auth/register (method filtered later)
|
|
1676
|
+
/^\/admin\/api\//,
|
|
1677
|
+
// Admin API endpoints
|
|
1678
|
+
/^\/admin\/api-keys\/api\//,
|
|
1679
|
+
// API key management
|
|
1680
|
+
/^\/admin\/cache\/api\//,
|
|
1681
|
+
// Cache management API
|
|
1682
|
+
/^\/admin\/plugins\/.*\/api\//,
|
|
1683
|
+
// Plugin API endpoints
|
|
1684
|
+
/^\/admin\/database-tools\/api\//,
|
|
1685
|
+
// Database tools API
|
|
1686
|
+
/^\/admin\/seed-data\/api\//,
|
|
1687
|
+
// Seed data API
|
|
1688
|
+
/^\/workflow\//,
|
|
1689
|
+
// Workflow endpoints
|
|
1690
|
+
/^\/health$/,
|
|
1691
|
+
// Health check
|
|
1692
|
+
/^\/files\//,
|
|
1693
|
+
// File serving
|
|
1694
|
+
/^\/forms\//
|
|
1695
|
+
// Public form endpoints
|
|
1696
|
+
];
|
|
1697
|
+
var EXCLUDED_ROUTES = /* @__PURE__ */ new Set([
|
|
1698
|
+
"GET /auth/login",
|
|
1699
|
+
"GET /auth/register",
|
|
1700
|
+
"GET /auth/login/form"
|
|
1701
|
+
]);
|
|
1702
|
+
var cachedRouteList = null;
|
|
1703
|
+
function isIncludedRoute(method, path) {
|
|
1704
|
+
const key = `${method} ${path}`;
|
|
1705
|
+
if (EXCLUDED_ROUTES.has(key)) {
|
|
1706
|
+
return false;
|
|
1707
|
+
}
|
|
1708
|
+
return INCLUDED_ROUTE_PATTERNS.some((pattern) => pattern.test(path));
|
|
1709
|
+
}
|
|
1710
|
+
function inferCategory(path) {
|
|
1711
|
+
if (path.startsWith("/auth/")) return "Auth";
|
|
1712
|
+
if (path.startsWith("/api/search")) return "Search";
|
|
1713
|
+
if (path.startsWith("/api/media")) return "Media";
|
|
1714
|
+
if (path.startsWith("/api/system")) return "System";
|
|
1715
|
+
if (path.startsWith("/api/content") || path.startsWith("/api/collections")) return "Content";
|
|
1716
|
+
if (path.startsWith("/api/forms")) return "Forms";
|
|
1717
|
+
if (path.startsWith("/admin/api-keys")) return "API Keys";
|
|
1718
|
+
if (path.startsWith("/admin/cache")) return "Cache";
|
|
1719
|
+
if (path.startsWith("/admin/plugins/ai-search")) return "Search";
|
|
1720
|
+
if (path.startsWith("/admin/api")) return "Admin";
|
|
1721
|
+
if (path.startsWith("/admin/database-tools")) return "Admin";
|
|
1722
|
+
if (path.startsWith("/admin/seed-data")) return "Admin";
|
|
1723
|
+
if (path.startsWith("/admin/plugins/email")) return "Admin";
|
|
1724
|
+
if (path.startsWith("/workflow/")) return "Workflow";
|
|
1725
|
+
if (path.startsWith("/forms/")) return "Forms";
|
|
1726
|
+
if (path.startsWith("/files/")) return "Files";
|
|
1727
|
+
if (path === "/health" || path.startsWith("/api")) return "System";
|
|
1728
|
+
return "Other";
|
|
1729
|
+
}
|
|
1730
|
+
function inferAuth(path) {
|
|
1731
|
+
if (path === "/health" || path === "/api" || path === "/api/health") return false;
|
|
1732
|
+
if (path === "/api/system/info" || path === "/api/system/schema") return false;
|
|
1733
|
+
if (path.startsWith("/files/")) return false;
|
|
1734
|
+
if (path.startsWith("/forms/") || path.startsWith("/api/forms/")) return false;
|
|
1735
|
+
if (path.startsWith("/admin/")) return true;
|
|
1736
|
+
if (path.startsWith("/workflow/")) return true;
|
|
1737
|
+
return "unknown";
|
|
1738
|
+
}
|
|
1739
|
+
function buildRouteList(app) {
|
|
1740
|
+
if (cachedRouteList) return cachedRouteList;
|
|
1741
|
+
if (!app) return [];
|
|
1742
|
+
try {
|
|
1743
|
+
const routes = inspectRoutes(app);
|
|
1744
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1745
|
+
const result = [];
|
|
1746
|
+
for (const route of routes) {
|
|
1747
|
+
if (route.isMiddleware) continue;
|
|
1748
|
+
if (route.method === "ALL") continue;
|
|
1749
|
+
const key = `${route.method} ${route.path}`;
|
|
1750
|
+
if (seen.has(key)) continue;
|
|
1751
|
+
seen.add(key);
|
|
1752
|
+
if (!isIncludedRoute(route.method, route.path)) continue;
|
|
1753
|
+
const meta = ROUTE_METADATA[key];
|
|
1754
|
+
if (meta) {
|
|
1755
|
+
result.push({
|
|
1756
|
+
method: route.method,
|
|
1757
|
+
path: route.path,
|
|
1758
|
+
description: meta.description,
|
|
1759
|
+
authentication: meta.authentication,
|
|
1760
|
+
category: meta.category,
|
|
1761
|
+
documented: true
|
|
1762
|
+
});
|
|
1763
|
+
} else {
|
|
1764
|
+
result.push({
|
|
1765
|
+
method: route.method,
|
|
1766
|
+
path: route.path,
|
|
1767
|
+
description: "",
|
|
1768
|
+
authentication: inferAuth(route.path),
|
|
1769
|
+
category: inferCategory(route.path),
|
|
1770
|
+
documented: false
|
|
1771
|
+
});
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
const methodOrder = { GET: 0, POST: 1, PUT: 2, PATCH: 3, DELETE: 4 };
|
|
1775
|
+
result.sort((a, b) => {
|
|
1776
|
+
const catCmp = a.category.localeCompare(b.category);
|
|
1777
|
+
if (catCmp !== 0) return catCmp;
|
|
1778
|
+
const methCmp = (methodOrder[a.method] ?? 5) - (methodOrder[b.method] ?? 5);
|
|
1779
|
+
if (methCmp !== 0) return methCmp;
|
|
1780
|
+
return a.path.localeCompare(b.path);
|
|
1781
|
+
});
|
|
1782
|
+
cachedRouteList = result;
|
|
1783
|
+
return result;
|
|
1784
|
+
} catch (error) {
|
|
1785
|
+
console.error("Failed to inspect routes:", error);
|
|
1786
|
+
return [];
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1456
1789
|
|
|
1457
|
-
export { CACHE_CONFIGS, CacheService, Logger, SettingsService, TelemetryService, apiTokens, collections, content, contentVersions, createInstallationIdentity, getCacheService, getLogger, getTelemetryService, initLogger, initTelemetry, insertCollectionSchema, insertContentSchema, insertLogConfigSchema, insertMediaSchema, insertPluginActivityLogSchema, insertPluginAssetSchema, insertPluginHookSchema, insertPluginRouteSchema, insertPluginSchema, insertSystemLogSchema, insertUserSchema, insertWorkflowHistorySchema, logConfig, media, pluginActivityLog, pluginAssets, pluginHooks, pluginRoutes, plugins, schema_exports, selectCollectionSchema, selectContentSchema, selectLogConfigSchema, selectMediaSchema, selectPluginActivityLogSchema, selectPluginAssetSchema, selectPluginHookSchema, selectPluginRouteSchema, selectPluginSchema, selectSystemLogSchema, selectUserSchema, selectWorkflowHistorySchema, systemLogs, users, workflowHistory };
|
|
1458
|
-
//# sourceMappingURL=chunk-
|
|
1459
|
-
//# sourceMappingURL=chunk-
|
|
1790
|
+
export { CACHE_CONFIGS, CATEGORY_INFO, CacheService, Logger, SettingsService, TelemetryService, apiTokens, buildRouteList, collections, content, contentVersions, createInstallationIdentity, getAppInstance, getCacheService, getLogger, getTelemetryService, initLogger, initTelemetry, insertCollectionSchema, insertContentSchema, insertLogConfigSchema, insertMediaSchema, insertPluginActivityLogSchema, insertPluginAssetSchema, insertPluginHookSchema, insertPluginRouteSchema, insertPluginSchema, insertSystemLogSchema, insertUserSchema, insertWorkflowHistorySchema, logConfig, media, pluginActivityLog, pluginAssets, pluginHooks, pluginRoutes, plugins, schema_exports, selectCollectionSchema, selectContentSchema, selectLogConfigSchema, selectMediaSchema, selectPluginActivityLogSchema, selectPluginAssetSchema, selectPluginHookSchema, selectPluginRouteSchema, selectPluginSchema, selectSystemLogSchema, selectUserSchema, selectWorkflowHistorySchema, setAppInstance, systemLogs, users, workflowHistory };
|
|
1791
|
+
//# sourceMappingURL=chunk-7JMMLHPQ.js.map
|
|
1792
|
+
//# sourceMappingURL=chunk-7JMMLHPQ.js.map
|