@sonicjs-cms/core 2.8.3 → 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-Y3VMEGY2.js → chunk-25YNV4RK.js} +3 -3
- package/dist/{chunk-Y3VMEGY2.js.map → chunk-25YNV4RK.js.map} +1 -1
- package/dist/{chunk-CH5UHZVM.js → chunk-2JGQKF7B.js} +184 -298
- package/dist/chunk-2JGQKF7B.js.map +1 -0
- package/dist/{chunk-5XAI2XUF.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-K4Q4SFJJ.cjs → chunk-DQZVU3WB.cjs} +4 -4
- package/dist/{chunk-K4Q4SFJJ.cjs.map → chunk-DQZVU3WB.cjs.map} +1 -1
- package/dist/{chunk-R4WR3VTN.cjs → chunk-KSB6FXOP.cjs} +285 -399
- package/dist/chunk-KSB6FXOP.cjs.map +1 -0
- package/dist/{chunk-HXHVU5GM.cjs → chunk-LDFMYRG6.cjs} +2 -2
- package/dist/{chunk-HXHVU5GM.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-JDIM5AG7.cjs → chunk-SHU7Q66Q.cjs} +7 -5
- package/dist/chunk-SHU7Q66Q.cjs.map +1 -0
- package/dist/{chunk-GTFMI24U.js → chunk-STTZVLY2.js} +2 -2
- package/dist/{chunk-GTFMI24U.js.map → chunk-STTZVLY2.js.map} +1 -1
- package/dist/{collection-config-i8EaAF7z.d.cts → collection-config-DckWhkdL.d.cts} +2 -2
- package/dist/{collection-config-i8EaAF7z.d.ts → collection-config-DckWhkdL.d.ts} +2 -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-7X4RPH7O.cjs.map → migrations-QQWGDWGB.cjs.map} +1 -1
- package/dist/migrations-SZSR3C3G.js +4 -0
- package/dist/{migrations-KHWFJ2HN.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-CJozpgmI.d.cts → plugin-bootstrap-BAz7NY0H.d.cts} +2 -2
- package/dist/{plugin-bootstrap-DU5VmuHZ.d.ts → 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-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-R4WR3VTN.cjs.map +0 -1
- package/dist/chunk-VNLR35GO.cjs.map +0 -1
- package/dist/migrations-7X4RPH7O.cjs +0 -13
- package/dist/migrations-KHWFJ2HN.js +0 -4
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { getCacheService, CACHE_CONFIGS, getLogger, SettingsService } from './chunk-
|
|
2
|
-
import { requireAuth, isPluginActive, optionalAuth, requireRole, rateLimit, AuthManager, logActivity, generateCsrfToken } from './chunk-
|
|
1
|
+
import { getCacheService, CACHE_CONFIGS, getLogger, SettingsService, getAppInstance, buildRouteList, CATEGORY_INFO } from './chunk-7JMMLHPQ.js';
|
|
2
|
+
import { requireAuth, isPluginActive, optionalAuth, requireRole, rateLimit, AuthManager, logActivity, generateCsrfToken } from './chunk-25YNV4RK.js';
|
|
3
3
|
import { PluginService } from './chunk-YFJJU26H.js';
|
|
4
|
-
import { MigrationService } from './chunk-
|
|
4
|
+
import { MigrationService } from './chunk-STTZVLY2.js';
|
|
5
5
|
import { init_admin_layout_catalyst_template, renderDesignPage, renderCheckboxPage, renderTestimonialsList, renderCodeExamplesList, renderAlert, renderTable, renderPagination, renderConfirmationDialog, getConfirmationDialogScript, renderAdminLayoutCatalyst, renderAdminLayout, adminLayoutV2, renderForm } from './chunk-JJS7JZCH.js';
|
|
6
6
|
import { PluginBuilder, TurnstileService } from './chunk-J5WGMRSU.js';
|
|
7
|
-
import { QueryFilterBuilder, getCoreVersion, getBlocksFieldConfig, parseBlocksValue } from './chunk-
|
|
7
|
+
import { QueryFilterBuilder, getCoreVersion, getBlocksFieldConfig, parseBlocksValue } from './chunk-3FHMXGLF.js';
|
|
8
8
|
import { metricsTracker } from './chunk-FICTAGD4.js';
|
|
9
9
|
import { escapeHtml, sanitizeRichText, sanitizeInput } from './chunk-TQABQWOP.js';
|
|
10
10
|
import { Hono } from 'hono';
|
|
@@ -2281,7 +2281,7 @@ adminApiRoutes.delete("/collections/:id", async (c) => {
|
|
|
2281
2281
|
});
|
|
2282
2282
|
adminApiRoutes.get("/migrations/status", async (c) => {
|
|
2283
2283
|
try {
|
|
2284
|
-
const { MigrationService: MigrationService2 } = await import('./migrations-
|
|
2284
|
+
const { MigrationService: MigrationService2 } = await import('./migrations-SZSR3C3G.js');
|
|
2285
2285
|
const db = c.env.DB;
|
|
2286
2286
|
const migrationService = new MigrationService2(db);
|
|
2287
2287
|
const status = await migrationService.getMigrationStatus();
|
|
@@ -2306,7 +2306,7 @@ adminApiRoutes.post("/migrations/run", async (c) => {
|
|
|
2306
2306
|
error: "Unauthorized. Admin access required."
|
|
2307
2307
|
}, 403);
|
|
2308
2308
|
}
|
|
2309
|
-
const { MigrationService: MigrationService2 } = await import('./migrations-
|
|
2309
|
+
const { MigrationService: MigrationService2 } = await import('./migrations-SZSR3C3G.js');
|
|
2310
2310
|
const db = c.env.DB;
|
|
2311
2311
|
const migrationService = new MigrationService2(db);
|
|
2312
2312
|
const result = await migrationService.runPendingMigrations();
|
|
@@ -2325,7 +2325,7 @@ adminApiRoutes.post("/migrations/run", async (c) => {
|
|
|
2325
2325
|
});
|
|
2326
2326
|
adminApiRoutes.get("/migrations/validate", async (c) => {
|
|
2327
2327
|
try {
|
|
2328
|
-
const { MigrationService: MigrationService2 } = await import('./migrations-
|
|
2328
|
+
const { MigrationService: MigrationService2 } = await import('./migrations-SZSR3C3G.js');
|
|
2329
2329
|
const db = c.env.DB;
|
|
2330
2330
|
const migrationService = new MigrationService2(db);
|
|
2331
2331
|
const validation = await migrationService.validateSchema();
|
|
@@ -4284,7 +4284,7 @@ function getMDXEditorInitScript(config) {
|
|
|
4284
4284
|
const toolbar = config?.toolbar || "full";
|
|
4285
4285
|
const placeholder = config?.placeholder || "Start writing your content...";
|
|
4286
4286
|
return `
|
|
4287
|
-
// Initialize EasyMDE (Markdown Editor) for
|
|
4287
|
+
// Initialize EasyMDE (Markdown Editor) only for markdown-marked fields
|
|
4288
4288
|
function initializeMDXEditor() {
|
|
4289
4289
|
if (typeof EasyMDE === 'undefined') {
|
|
4290
4290
|
console.warn('EasyMDE not loaded yet, retrying...');
|
|
@@ -4293,7 +4293,7 @@ function getMDXEditorInitScript(config) {
|
|
|
4293
4293
|
}
|
|
4294
4294
|
|
|
4295
4295
|
// Find all textareas that need EasyMDE
|
|
4296
|
-
document.querySelectorAll('.richtext-container textarea').forEach((textarea) => {
|
|
4296
|
+
document.querySelectorAll('.richtext-container[data-editor-provider="easymde"] textarea').forEach((textarea) => {
|
|
4297
4297
|
// Skip if already initialized
|
|
4298
4298
|
if (textarea.dataset.mdxeditorInitialized === 'true') {
|
|
4299
4299
|
return;
|
|
@@ -4392,11 +4392,11 @@ function getTinyMCEInitScript(config) {
|
|
|
4392
4392
|
const contentCss = skin.includes("dark") ? "dark" : "default";
|
|
4393
4393
|
const defaultHeight = config?.defaultHeight || 300;
|
|
4394
4394
|
return `
|
|
4395
|
-
// Initialize TinyMCE for
|
|
4395
|
+
// Initialize TinyMCE only for TinyMCE-backed richtext fields
|
|
4396
4396
|
function initializeTinyMCE() {
|
|
4397
4397
|
if (typeof tinymce !== 'undefined') {
|
|
4398
4398
|
// Find all textareas that need TinyMCE
|
|
4399
|
-
document.querySelectorAll('.richtext-container textarea').forEach((textarea) => {
|
|
4399
|
+
document.querySelectorAll('.richtext-container[data-editor-provider="tinymce"] textarea').forEach((textarea) => {
|
|
4400
4400
|
// Skip if already initialized
|
|
4401
4401
|
if (tinymce.get(textarea.id)) {
|
|
4402
4402
|
return;
|
|
@@ -4833,6 +4833,24 @@ function getReadFieldValueScript() {
|
|
|
4833
4833
|
</script>
|
|
4834
4834
|
`;
|
|
4835
4835
|
}
|
|
4836
|
+
function isMarkdownEditorFieldType(fieldType) {
|
|
4837
|
+
return fieldType === "markdown" || fieldType === "mdxeditor" || fieldType === "easymde";
|
|
4838
|
+
}
|
|
4839
|
+
function getEditorMetadata(fieldType) {
|
|
4840
|
+
if (fieldType === "richtext" || fieldType === "tinymce") {
|
|
4841
|
+
return {
|
|
4842
|
+
family: "richtext",
|
|
4843
|
+
provider: "tinymce"
|
|
4844
|
+
};
|
|
4845
|
+
}
|
|
4846
|
+
if (isMarkdownEditorFieldType(fieldType)) {
|
|
4847
|
+
return {
|
|
4848
|
+
family: "markdown",
|
|
4849
|
+
provider: "easymde"
|
|
4850
|
+
};
|
|
4851
|
+
}
|
|
4852
|
+
return null;
|
|
4853
|
+
}
|
|
4836
4854
|
function renderDynamicField(field, options = {}) {
|
|
4837
4855
|
const { value = "", errors = [], disabled = false, className = "", pluginStatuses = {}, collectionId = "", contentId = "" } = options;
|
|
4838
4856
|
const opts = field.field_options || {};
|
|
@@ -4846,10 +4864,10 @@ function renderDynamicField(field, options = {}) {
|
|
|
4846
4864
|
if (field.field_type === "quill" && !pluginStatuses.quillEnabled) {
|
|
4847
4865
|
fallbackToTextarea = true;
|
|
4848
4866
|
fallbackWarning = "\u26A0\uFE0F Quill Editor plugin is inactive. Using textarea fallback.";
|
|
4849
|
-
} else if ((field.field_type
|
|
4867
|
+
} else if (isMarkdownEditorFieldType(field.field_type) && !pluginStatuses.mdxeditorEnabled) {
|
|
4850
4868
|
fallbackToTextarea = true;
|
|
4851
|
-
fallbackWarning = "\u26A0\uFE0F
|
|
4852
|
-
} else if (field.field_type === "tinymce" && !pluginStatuses.tinymceEnabled) {
|
|
4869
|
+
fallbackWarning = "\u26A0\uFE0F Markdown editor plugin is inactive. Using textarea fallback.";
|
|
4870
|
+
} else if ((field.field_type === "richtext" || field.field_type === "tinymce") && !pluginStatuses.tinymceEnabled) {
|
|
4853
4871
|
fallbackToTextarea = true;
|
|
4854
4872
|
fallbackWarning = "\u26A0\uFE0F TinyMCE plugin is inactive. Using textarea fallback.";
|
|
4855
4873
|
}
|
|
@@ -4971,8 +4989,10 @@ function renderDynamicField(field, options = {}) {
|
|
|
4971
4989
|
`;
|
|
4972
4990
|
break;
|
|
4973
4991
|
case "richtext":
|
|
4992
|
+
case "tinymce": {
|
|
4993
|
+
const editorMetadata = getEditorMetadata(field.field_type);
|
|
4974
4994
|
fieldHTML = `
|
|
4975
|
-
<div class="richtext-container" data-height="${opts.height || 300}" data-toolbar="${opts.toolbar || "full"}">
|
|
4995
|
+
<div class="richtext-container" data-height="${opts.height || 300}" data-toolbar="${opts.toolbar || "full"}" data-editor-family="${editorMetadata?.family || ""}" data-editor-provider="${editorMetadata?.provider || ""}">
|
|
4976
4996
|
<textarea
|
|
4977
4997
|
id="${fieldId}"
|
|
4978
4998
|
name="${fieldName}"
|
|
@@ -4983,6 +5003,7 @@ function renderDynamicField(field, options = {}) {
|
|
|
4983
5003
|
</div>
|
|
4984
5004
|
`;
|
|
4985
5005
|
break;
|
|
5006
|
+
}
|
|
4986
5007
|
case "quill":
|
|
4987
5008
|
fieldHTML = `
|
|
4988
5009
|
<div class="quill-editor-container" data-field-id="${fieldId}">
|
|
@@ -5006,12 +5027,12 @@ function renderDynamicField(field, options = {}) {
|
|
|
5006
5027
|
</div>
|
|
5007
5028
|
`;
|
|
5008
5029
|
break;
|
|
5009
|
-
case "mdxeditor":
|
|
5010
|
-
case "tinymce":
|
|
5011
|
-
case "easymde":
|
|
5012
5030
|
case "markdown":
|
|
5031
|
+
case "mdxeditor":
|
|
5032
|
+
case "easymde": {
|
|
5033
|
+
const editorMetadata = getEditorMetadata(field.field_type);
|
|
5013
5034
|
fieldHTML = `
|
|
5014
|
-
<div class="richtext-container" data-height="${opts.height || 300}" data-toolbar="${opts.toolbar || "full"}">
|
|
5035
|
+
<div class="richtext-container" data-height="${opts.height || 300}" data-toolbar="${opts.toolbar || "full"}" data-editor-family="${editorMetadata?.family || ""}" data-editor-provider="${editorMetadata?.provider || ""}">
|
|
5015
5036
|
<textarea
|
|
5016
5037
|
id="${fieldId}"
|
|
5017
5038
|
name="${fieldName}"
|
|
@@ -5022,6 +5043,7 @@ function renderDynamicField(field, options = {}) {
|
|
|
5022
5043
|
</div>
|
|
5023
5044
|
`;
|
|
5024
5045
|
break;
|
|
5046
|
+
}
|
|
5025
5047
|
case "number":
|
|
5026
5048
|
fieldHTML = `
|
|
5027
5049
|
<input
|
|
@@ -8240,6 +8262,40 @@ function renderContentListPage(data) {
|
|
|
8240
8262
|
return renderAdminLayoutCatalyst(layoutData);
|
|
8241
8263
|
}
|
|
8242
8264
|
|
|
8265
|
+
// src/routes/admin-content-field-types.ts
|
|
8266
|
+
function resolveSchemaFieldType(fieldConfig) {
|
|
8267
|
+
if (fieldConfig.type === "slug" || fieldConfig.format === "slug") {
|
|
8268
|
+
return "slug";
|
|
8269
|
+
}
|
|
8270
|
+
if (fieldConfig.type && fieldConfig.type !== "string") {
|
|
8271
|
+
return fieldConfig.type;
|
|
8272
|
+
}
|
|
8273
|
+
if (fieldConfig.format === "richtext") {
|
|
8274
|
+
return "richtext";
|
|
8275
|
+
}
|
|
8276
|
+
if (fieldConfig.format === "media") {
|
|
8277
|
+
return "media";
|
|
8278
|
+
}
|
|
8279
|
+
if (fieldConfig.format === "date-time") {
|
|
8280
|
+
return "date";
|
|
8281
|
+
}
|
|
8282
|
+
if (Array.isArray(fieldConfig.enum)) {
|
|
8283
|
+
return "select";
|
|
8284
|
+
}
|
|
8285
|
+
return fieldConfig.type || "string";
|
|
8286
|
+
}
|
|
8287
|
+
function buildSchemaFieldOptions(fieldConfig) {
|
|
8288
|
+
const fieldOptions = { ...fieldConfig };
|
|
8289
|
+
const resolvedFieldType = resolveSchemaFieldType(fieldConfig);
|
|
8290
|
+
if (resolvedFieldType === "select" && Array.isArray(fieldConfig.enum)) {
|
|
8291
|
+
fieldOptions.options = fieldConfig.enum.map((value, index) => ({
|
|
8292
|
+
value,
|
|
8293
|
+
label: fieldConfig.enumLabels?.[index] || value
|
|
8294
|
+
}));
|
|
8295
|
+
}
|
|
8296
|
+
return fieldOptions;
|
|
8297
|
+
}
|
|
8298
|
+
|
|
8243
8299
|
// src/routes/admin-content.ts
|
|
8244
8300
|
var adminContentRoutes = new Hono();
|
|
8245
8301
|
function parseFieldValue(field, formData, options = {}) {
|
|
@@ -8372,17 +8428,11 @@ async function getCollectionFields(db, collectionId) {
|
|
|
8372
8428
|
if (schema && schema.properties) {
|
|
8373
8429
|
let fieldOrder = 0;
|
|
8374
8430
|
return Object.entries(schema.properties).map(([fieldName, fieldConfig]) => {
|
|
8375
|
-
|
|
8376
|
-
if (fieldConfig.type === "select" && fieldConfig.enum) {
|
|
8377
|
-
fieldOptions.options = fieldConfig.enum.map((value, index) => ({
|
|
8378
|
-
value,
|
|
8379
|
-
label: fieldConfig.enumLabels?.[index] || value
|
|
8380
|
-
}));
|
|
8381
|
-
}
|
|
8431
|
+
const fieldOptions = buildSchemaFieldOptions(fieldConfig);
|
|
8382
8432
|
return {
|
|
8383
8433
|
id: `schema-${fieldName}`,
|
|
8384
8434
|
field_name: fieldName,
|
|
8385
|
-
field_type: fieldConfig
|
|
8435
|
+
field_type: resolveSchemaFieldType(fieldConfig),
|
|
8386
8436
|
field_label: fieldConfig.title || fieldName,
|
|
8387
8437
|
field_options: fieldOptions,
|
|
8388
8438
|
field_order: fieldOrder++,
|
|
@@ -20780,6 +20830,20 @@ router.get("/system-status", async (c) => {
|
|
|
20780
20830
|
}
|
|
20781
20831
|
});
|
|
20782
20832
|
|
|
20833
|
+
// src/routes/admin-collections-field-types.ts
|
|
20834
|
+
function isMarkdownEditorType(fieldType) {
|
|
20835
|
+
return fieldType === "markdown" || fieldType === "mdxeditor" || fieldType === "easymde";
|
|
20836
|
+
}
|
|
20837
|
+
function normalizeFieldType(fieldType) {
|
|
20838
|
+
if (isMarkdownEditorType(fieldType)) {
|
|
20839
|
+
return "markdown";
|
|
20840
|
+
}
|
|
20841
|
+
if (fieldType === "tinymce") {
|
|
20842
|
+
return "richtext";
|
|
20843
|
+
}
|
|
20844
|
+
return fieldType;
|
|
20845
|
+
}
|
|
20846
|
+
|
|
20783
20847
|
// src/templates/pages/admin-collections-list.template.ts
|
|
20784
20848
|
init_admin_layout_catalyst_template();
|
|
20785
20849
|
|
|
@@ -21266,7 +21330,9 @@ function getFieldTypeBadge(fieldType) {
|
|
|
21266
21330
|
"slug": "URL Slug",
|
|
21267
21331
|
"richtext": "Rich Text (TinyMCE)",
|
|
21268
21332
|
"quill": "Rich Text (Quill)",
|
|
21269
|
-
"
|
|
21333
|
+
"markdown": "Markdown",
|
|
21334
|
+
"mdxeditor": "Markdown",
|
|
21335
|
+
"easymde": "Markdown",
|
|
21270
21336
|
"number": "Number",
|
|
21271
21337
|
"boolean": "Boolean",
|
|
21272
21338
|
"date": "Date",
|
|
@@ -21279,7 +21345,9 @@ function getFieldTypeBadge(fieldType) {
|
|
|
21279
21345
|
"slug": "bg-sky-500/10 dark:bg-sky-400/10 text-sky-700 dark:text-sky-300 ring-sky-500/20 dark:ring-sky-400/20",
|
|
21280
21346
|
"richtext": "bg-purple-500/10 dark:bg-purple-400/10 text-purple-700 dark:text-purple-300 ring-purple-500/20 dark:ring-purple-400/20",
|
|
21281
21347
|
"quill": "bg-purple-500/10 dark:bg-purple-400/10 text-purple-700 dark:text-purple-300 ring-purple-500/20 dark:ring-purple-400/20",
|
|
21348
|
+
"markdown": "bg-purple-500/10 dark:bg-purple-400/10 text-purple-700 dark:text-purple-300 ring-purple-500/20 dark:ring-purple-400/20",
|
|
21282
21349
|
"mdxeditor": "bg-purple-500/10 dark:bg-purple-400/10 text-purple-700 dark:text-purple-300 ring-purple-500/20 dark:ring-purple-400/20",
|
|
21350
|
+
"easymde": "bg-purple-500/10 dark:bg-purple-400/10 text-purple-700 dark:text-purple-300 ring-purple-500/20 dark:ring-purple-400/20",
|
|
21283
21351
|
"number": "bg-green-500/10 dark:bg-green-400/10 text-green-700 dark:text-green-300 ring-green-500/20 dark:ring-green-400/20",
|
|
21284
21352
|
"boolean": "bg-amber-500/10 dark:bg-amber-400/10 text-amber-700 dark:text-amber-300 ring-amber-500/20 dark:ring-amber-400/20",
|
|
21285
21353
|
"date": "bg-cyan-500/10 dark:bg-cyan-400/10 text-cyan-700 dark:text-cyan-300 ring-cyan-500/20 dark:ring-cyan-400/20",
|
|
@@ -21760,7 +21828,7 @@ function renderCollectionFormPage(data) {
|
|
|
21760
21828
|
<option value="slug">URL Slug</option>
|
|
21761
21829
|
${data.editorPlugins?.tinymce ? '<option value="richtext">Rich Text (TinyMCE)</option>' : ""}
|
|
21762
21830
|
${data.editorPlugins?.quill ? '<option value="quill">Rich Text (Quill)</option>' : ""}
|
|
21763
|
-
${data.editorPlugins?.easyMdx ? '<option value="
|
|
21831
|
+
${data.editorPlugins?.easyMdx ? '<option value="markdown">Markdown</option>' : ""}
|
|
21764
21832
|
<option value="number">Number</option>
|
|
21765
21833
|
<option value="boolean">Boolean</option>
|
|
21766
21834
|
<option value="date">Date</option>
|
|
@@ -21985,7 +22053,7 @@ function renderCollectionFormPage(data) {
|
|
|
21985
22053
|
// Check if it's a schema field with field_options that might indicate the actual type
|
|
21986
22054
|
if (field.field_options && typeof field.field_options === 'object') {
|
|
21987
22055
|
// Only convert to richtext if type is explicitly 'string' and format is richtext
|
|
21988
|
-
// Don't convert if it's already a specific editor type like '
|
|
22056
|
+
// Don't convert if it's already a specific editor type like 'markdown', 'quill', etc.
|
|
21989
22057
|
if (field.field_options.format === 'richtext' && uiFieldType === 'string') {
|
|
21990
22058
|
uiFieldType = 'richtext';
|
|
21991
22059
|
}
|
|
@@ -22006,6 +22074,12 @@ function renderCollectionFormPage(data) {
|
|
|
22006
22074
|
uiFieldType = typeMapping[uiFieldType];
|
|
22007
22075
|
}
|
|
22008
22076
|
|
|
22077
|
+
if (uiFieldType === 'mdxeditor' || uiFieldType === 'easymde') {
|
|
22078
|
+
uiFieldType = 'markdown';
|
|
22079
|
+
} else if (uiFieldType === 'tinymce') {
|
|
22080
|
+
uiFieldType = 'richtext';
|
|
22081
|
+
}
|
|
22082
|
+
|
|
22009
22083
|
// Log all available options
|
|
22010
22084
|
const availableOptions = Array.from(fieldTypeSelect.options).map(opt => ({ value: opt.value, text: opt.text }));
|
|
22011
22085
|
console.log('Available dropdown options:', availableOptions);
|
|
@@ -22092,7 +22166,7 @@ function renderCollectionFormPage(data) {
|
|
|
22092
22166
|
|
|
22093
22167
|
console.log('[Edit Field] Showing options for field type:', fieldType, '(original:', field.field_type, ')');
|
|
22094
22168
|
|
|
22095
|
-
if (['select', 'radio', 'media', 'richtext', 'reference'].includes(fieldType)) {
|
|
22169
|
+
if (['select', 'radio', 'media', 'richtext', 'markdown', 'reference'].includes(fieldType)) {
|
|
22096
22170
|
optionsContainer.classList.remove('hidden');
|
|
22097
22171
|
|
|
22098
22172
|
// Set help text based on type
|
|
@@ -22109,6 +22183,9 @@ function renderCollectionFormPage(data) {
|
|
|
22109
22183
|
case 'richtext':
|
|
22110
22184
|
helpText.textContent = 'Full-featured WYSIWYG text editor with formatting options';
|
|
22111
22185
|
break;
|
|
22186
|
+
case 'markdown':
|
|
22187
|
+
helpText.textContent = 'Markdown editor with live preview powered by the EasyMDE plugin';
|
|
22188
|
+
break;
|
|
22112
22189
|
case 'reference':
|
|
22113
22190
|
helpText.textContent = 'Link to content from other collections';
|
|
22114
22191
|
break;
|
|
@@ -22249,7 +22326,7 @@ function renderCollectionFormPage(data) {
|
|
|
22249
22326
|
const fieldNameInput = document.getElementById('modal-field-name');
|
|
22250
22327
|
|
|
22251
22328
|
// Show/hide options based on field type
|
|
22252
|
-
if (['select', 'radio', 'media', 'richtext', 'guid', 'reference'].includes(this.value)) {
|
|
22329
|
+
if (['select', 'radio', 'media', 'richtext', 'markdown', 'guid', 'reference'].includes(this.value)) {
|
|
22253
22330
|
optionsContainer.classList.remove('hidden');
|
|
22254
22331
|
|
|
22255
22332
|
// Set default options and help text based on type
|
|
@@ -22270,6 +22347,10 @@ function renderCollectionFormPage(data) {
|
|
|
22270
22347
|
fieldOptions.value = '{"toolbar": "full", "height": 400}';
|
|
22271
22348
|
helpText.textContent = 'Full-featured WYSIWYG text editor with formatting options';
|
|
22272
22349
|
break;
|
|
22350
|
+
case 'markdown':
|
|
22351
|
+
fieldOptions.value = '{"toolbar": "full", "height": 400}';
|
|
22352
|
+
helpText.textContent = 'Markdown editor with live preview powered by the EasyMDE plugin';
|
|
22353
|
+
break;
|
|
22273
22354
|
case 'reference':
|
|
22274
22355
|
fieldOptions.value = '{"collection": ["pages", "posts"]}';
|
|
22275
22356
|
helpText.textContent = 'Link to content from other collections';
|
|
@@ -22830,11 +22911,12 @@ adminCollectionsRoutes.post("/:id/fields", async (c) => {
|
|
|
22830
22911
|
searchable: isSearchable,
|
|
22831
22912
|
...parsedOptions
|
|
22832
22913
|
};
|
|
22833
|
-
|
|
22914
|
+
const normalizedFieldType = normalizeFieldType(fieldType);
|
|
22915
|
+
if (normalizedFieldType === "richtext") {
|
|
22834
22916
|
fieldConfig.format = "richtext";
|
|
22835
|
-
} else if (
|
|
22917
|
+
} else if (normalizedFieldType === "date") {
|
|
22836
22918
|
fieldConfig.format = "date-time";
|
|
22837
|
-
} else if (
|
|
22919
|
+
} else if (normalizedFieldType === "select") {
|
|
22838
22920
|
fieldConfig.enum = parsedOptions.options || [];
|
|
22839
22921
|
} else if (fieldType === "radio") {
|
|
22840
22922
|
fieldConfig.type = "radio";
|
|
@@ -22843,20 +22925,14 @@ adminCollectionsRoutes.post("/:id/fields", async (c) => {
|
|
|
22843
22925
|
}
|
|
22844
22926
|
} else if (fieldType === "media") {
|
|
22845
22927
|
fieldConfig.format = "media";
|
|
22846
|
-
} else if (
|
|
22928
|
+
} else if (normalizedFieldType === "slug") {
|
|
22847
22929
|
fieldConfig.type = "slug";
|
|
22848
22930
|
fieldConfig.format = "slug";
|
|
22849
|
-
} else if (
|
|
22931
|
+
} else if (normalizedFieldType === "quill") {
|
|
22850
22932
|
fieldConfig.type = "quill";
|
|
22851
|
-
} else if (
|
|
22852
|
-
fieldConfig.type = "mdxeditor";
|
|
22853
|
-
} else if (fieldType === "tinymce") {
|
|
22854
|
-
fieldConfig.type = "tinymce";
|
|
22855
|
-
} else if (fieldType === "easymde") {
|
|
22856
|
-
fieldConfig.type = "easymde";
|
|
22857
|
-
} else if (fieldType === "markdown") {
|
|
22933
|
+
} else if (normalizedFieldType === "markdown") {
|
|
22858
22934
|
fieldConfig.type = "markdown";
|
|
22859
|
-
} else if (
|
|
22935
|
+
} else if (normalizedFieldType === "reference") {
|
|
22860
22936
|
fieldConfig.type = "reference";
|
|
22861
22937
|
}
|
|
22862
22938
|
schema.properties[fieldName] = fieldConfig;
|
|
@@ -27461,6 +27537,33 @@ var public_forms_default = publicFormsRoutes;
|
|
|
27461
27537
|
|
|
27462
27538
|
// src/templates/pages/admin-api-reference.template.ts
|
|
27463
27539
|
init_admin_layout_catalyst_template();
|
|
27540
|
+
function renderAuthBadge(auth) {
|
|
27541
|
+
if (auth === true) {
|
|
27542
|
+
return `
|
|
27543
|
+
<span class="shrink-0 inline-flex items-center gap-x-1 rounded-md bg-amber-50 dark:bg-amber-500/10 px-2 py-1 text-xs font-medium text-amber-700 dark:text-amber-300 ring-1 ring-inset ring-amber-700/10 dark:ring-amber-400/20">
|
|
27544
|
+
<svg class="h-3 w-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" stroke-width="2">
|
|
27545
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"/>
|
|
27546
|
+
</svg>
|
|
27547
|
+
Auth
|
|
27548
|
+
</span>`;
|
|
27549
|
+
}
|
|
27550
|
+
if (auth === false) {
|
|
27551
|
+
return `
|
|
27552
|
+
<span class="shrink-0 inline-flex items-center gap-x-1 rounded-md bg-lime-50 dark:bg-lime-500/10 px-2 py-1 text-xs font-medium text-lime-700 dark:text-lime-300 ring-1 ring-inset ring-lime-700/10 dark:ring-lime-400/20">
|
|
27553
|
+
<svg class="h-3 w-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" stroke-width="2">
|
|
27554
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
|
27555
|
+
</svg>
|
|
27556
|
+
Public
|
|
27557
|
+
</span>`;
|
|
27558
|
+
}
|
|
27559
|
+
return `
|
|
27560
|
+
<span class="shrink-0 inline-flex items-center gap-x-1 rounded-md bg-zinc-50 dark:bg-zinc-500/10 px-2 py-1 text-xs font-medium text-zinc-500 dark:text-zinc-400 ring-1 ring-inset ring-zinc-500/10 dark:ring-zinc-400/20">
|
|
27561
|
+
<svg class="h-3 w-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" stroke-width="2">
|
|
27562
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
|
27563
|
+
</svg>
|
|
27564
|
+
Unknown
|
|
27565
|
+
</span>`;
|
|
27566
|
+
}
|
|
27464
27567
|
function renderAPIReferencePage(data) {
|
|
27465
27568
|
const endpointsByCategory = data.endpoints.reduce((acc, endpoint) => {
|
|
27466
27569
|
if (!acc[endpoint.category]) {
|
|
@@ -27469,40 +27572,18 @@ function renderAPIReferencePage(data) {
|
|
|
27469
27572
|
acc[endpoint.category].push(endpoint);
|
|
27470
27573
|
return acc;
|
|
27471
27574
|
}, {});
|
|
27472
|
-
const
|
|
27473
|
-
|
|
27474
|
-
|
|
27475
|
-
|
|
27476
|
-
|
|
27477
|
-
},
|
|
27478
|
-
"Content": {
|
|
27479
|
-
title: "Content Management",
|
|
27480
|
-
description: "Content creation, retrieval, and management",
|
|
27481
|
-
icon: "\u{1F4DD}"
|
|
27482
|
-
},
|
|
27483
|
-
"Media": {
|
|
27484
|
-
title: "Media Management",
|
|
27485
|
-
description: "File upload, storage, and media operations",
|
|
27486
|
-
icon: "\u{1F5BC}\uFE0F"
|
|
27487
|
-
},
|
|
27488
|
-
"Admin": {
|
|
27489
|
-
title: "Admin Interface",
|
|
27490
|
-
description: "Administrative panel and management features",
|
|
27491
|
-
icon: "\u2699\uFE0F"
|
|
27492
|
-
},
|
|
27493
|
-
"System": {
|
|
27494
|
-
title: "System",
|
|
27495
|
-
description: "Health checks and system information",
|
|
27496
|
-
icon: "\u{1F527}"
|
|
27497
|
-
}
|
|
27498
|
-
};
|
|
27575
|
+
const categories = Object.keys(endpointsByCategory);
|
|
27576
|
+
const totalEndpoints = data.endpoints.length;
|
|
27577
|
+
const publicEndpoints = data.endpoints.filter((e) => e.authentication === false).length;
|
|
27578
|
+
const protectedEndpoints = data.endpoints.filter((e) => e.authentication === true).length;
|
|
27579
|
+
const undocumentedCount = data.endpoints.filter((e) => e.documented === false).length;
|
|
27499
27580
|
const pageContent = `
|
|
27500
27581
|
<div class="space-y-6">
|
|
27501
27582
|
<!-- Header -->
|
|
27502
27583
|
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between">
|
|
27503
27584
|
<div>
|
|
27504
27585
|
<h1 class="text-2xl/8 font-semibold text-zinc-950 dark:text-white sm:text-xl/8">API Reference</h1>
|
|
27505
|
-
<p class="mt-2 text-sm/6 text-zinc-500 dark:text-zinc-400">
|
|
27586
|
+
<p class="mt-2 text-sm/6 text-zinc-500 dark:text-zinc-400">Auto-discovered documentation of all registered API endpoints</p>
|
|
27506
27587
|
</div>
|
|
27507
27588
|
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
|
|
27508
27589
|
<a href="/api" target="_blank" class="inline-flex items-center justify-center gap-x-1.5 rounded-lg bg-zinc-950 dark:bg-white px-3.5 py-2.5 text-sm font-semibold text-white dark:text-zinc-950 hover:bg-zinc-800 dark:hover:bg-zinc-100 transition-colors shadow-sm">
|
|
@@ -27515,29 +27596,35 @@ function renderAPIReferencePage(data) {
|
|
|
27515
27596
|
</div>
|
|
27516
27597
|
|
|
27517
27598
|
<!-- Stats -->
|
|
27518
|
-
<dl class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-
|
|
27599
|
+
<dl class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-5">
|
|
27519
27600
|
<div class="rounded-lg bg-white dark:bg-zinc-900 shadow-sm ring-1 ring-zinc-950/5 dark:ring-white/10 px-6 py-5">
|
|
27520
27601
|
<dt class="text-sm/6 font-medium text-zinc-500 dark:text-zinc-400">Total Endpoints</dt>
|
|
27521
27602
|
<dd class="mt-2 flex items-baseline gap-x-2">
|
|
27522
|
-
<span class="text-4xl font-semibold tracking-tight text-zinc-950 dark:text-white">${
|
|
27603
|
+
<span class="text-4xl font-semibold tracking-tight text-zinc-950 dark:text-white">${totalEndpoints}</span>
|
|
27523
27604
|
</dd>
|
|
27524
27605
|
</div>
|
|
27525
27606
|
<div class="rounded-lg bg-white dark:bg-zinc-900 shadow-sm ring-1 ring-zinc-950/5 dark:ring-white/10 px-6 py-5">
|
|
27526
27607
|
<dt class="text-sm/6 font-medium text-zinc-500 dark:text-zinc-400">Public Endpoints</dt>
|
|
27527
27608
|
<dd class="mt-2 flex items-baseline gap-x-2">
|
|
27528
|
-
<span class="text-4xl font-semibold tracking-tight text-lime-600 dark:text-lime-400">${
|
|
27609
|
+
<span class="text-4xl font-semibold tracking-tight text-lime-600 dark:text-lime-400">${publicEndpoints}</span>
|
|
27529
27610
|
</dd>
|
|
27530
27611
|
</div>
|
|
27531
27612
|
<div class="rounded-lg bg-white dark:bg-zinc-900 shadow-sm ring-1 ring-zinc-950/5 dark:ring-white/10 px-6 py-5">
|
|
27532
27613
|
<dt class="text-sm/6 font-medium text-zinc-500 dark:text-zinc-400">Protected Endpoints</dt>
|
|
27533
27614
|
<dd class="mt-2 flex items-baseline gap-x-2">
|
|
27534
|
-
<span class="text-4xl font-semibold tracking-tight text-amber-600 dark:text-amber-400">${
|
|
27615
|
+
<span class="text-4xl font-semibold tracking-tight text-amber-600 dark:text-amber-400">${protectedEndpoints}</span>
|
|
27535
27616
|
</dd>
|
|
27536
27617
|
</div>
|
|
27537
27618
|
<div class="rounded-lg bg-white dark:bg-zinc-900 shadow-sm ring-1 ring-zinc-950/5 dark:ring-white/10 px-6 py-5">
|
|
27538
27619
|
<dt class="text-sm/6 font-medium text-zinc-500 dark:text-zinc-400">Categories</dt>
|
|
27539
27620
|
<dd class="mt-2 flex items-baseline gap-x-2">
|
|
27540
|
-
<span class="text-4xl font-semibold tracking-tight text-cyan-600 dark:text-cyan-400">${
|
|
27621
|
+
<span class="text-4xl font-semibold tracking-tight text-cyan-600 dark:text-cyan-400">${categories.length}</span>
|
|
27622
|
+
</dd>
|
|
27623
|
+
</div>
|
|
27624
|
+
<div class="rounded-lg bg-white dark:bg-zinc-900 shadow-sm ring-1 ring-zinc-950/5 dark:ring-white/10 px-6 py-5">
|
|
27625
|
+
<dt class="text-sm/6 font-medium text-zinc-500 dark:text-zinc-400">Undocumented</dt>
|
|
27626
|
+
<dd class="mt-2 flex items-baseline gap-x-2">
|
|
27627
|
+
<span class="text-4xl font-semibold tracking-tight ${undocumentedCount > 0 ? "text-zinc-400 dark:text-zinc-500" : "text-lime-600 dark:text-lime-400"}">${undocumentedCount}</span>
|
|
27541
27628
|
</dd>
|
|
27542
27629
|
</div>
|
|
27543
27630
|
</dl>
|
|
@@ -27589,9 +27676,11 @@ function renderAPIReferencePage(data) {
|
|
|
27589
27676
|
class="col-start-1 row-start-1 w-full appearance-none rounded-lg bg-white dark:bg-zinc-800 py-2 pl-3 pr-8 text-sm text-zinc-950 dark:text-white outline outline-1 -outline-offset-1 outline-zinc-950/10 dark:outline-white/10 *:bg-white dark:*:bg-zinc-800 focus:outline focus:outline-2 focus:-outline-offset-2 focus:outline-zinc-950 dark:focus:outline-white min-w-[200px]"
|
|
27590
27677
|
>
|
|
27591
27678
|
<option value="">All Categories</option>
|
|
27592
|
-
${
|
|
27593
|
-
|
|
27594
|
-
|
|
27679
|
+
${categories.map((category) => {
|
|
27680
|
+
const info = CATEGORY_INFO[category];
|
|
27681
|
+
const title = info ? info.title : category;
|
|
27682
|
+
return `<option value="${category}">${title}</option>`;
|
|
27683
|
+
}).join("\n ")}
|
|
27595
27684
|
</select>
|
|
27596
27685
|
<svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end text-zinc-500 dark:text-zinc-400 sm:size-4">
|
|
27597
27686
|
<path d="M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" fill-rule="evenodd" />
|
|
@@ -27605,7 +27694,7 @@ function renderAPIReferencePage(data) {
|
|
|
27605
27694
|
<!-- API Categories -->
|
|
27606
27695
|
<div class="space-y-6">
|
|
27607
27696
|
${Object.entries(endpointsByCategory).map(([category, endpoints]) => {
|
|
27608
|
-
const info =
|
|
27697
|
+
const info = CATEGORY_INFO[category] || { title: category, description: "", icon: "📋" };
|
|
27609
27698
|
return `
|
|
27610
27699
|
<div class="api-category" data-category="${category}">
|
|
27611
27700
|
<div class="rounded-lg bg-white dark:bg-zinc-900 shadow-sm ring-1 ring-zinc-950/5 dark:ring-white/10 overflow-hidden">
|
|
@@ -27639,23 +27728,14 @@ function renderAPIReferencePage(data) {
|
|
|
27639
27728
|
<div class="flex-1 min-w-0">
|
|
27640
27729
|
<div class="flex items-center gap-x-2 mb-2">
|
|
27641
27730
|
<code class="text-zinc-950 dark:text-white text-sm font-mono font-medium break-all">${endpoint.path}</code>
|
|
27642
|
-
${endpoint.authentication
|
|
27643
|
-
|
|
27644
|
-
|
|
27645
|
-
|
|
27646
|
-
</svg>
|
|
27647
|
-
Auth
|
|
27648
|
-
</span>
|
|
27649
|
-
` : `
|
|
27650
|
-
<span class="shrink-0 inline-flex items-center gap-x-1 rounded-md bg-lime-50 dark:bg-lime-500/10 px-2 py-1 text-xs font-medium text-lime-700 dark:text-lime-300 ring-1 ring-inset ring-lime-700/10 dark:ring-lime-400/20">
|
|
27651
|
-
<svg class="h-3 w-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" stroke-width="2">
|
|
27652
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
|
27653
|
-
</svg>
|
|
27654
|
-
Public
|
|
27731
|
+
${renderAuthBadge(endpoint.authentication)}
|
|
27732
|
+
${endpoint.documented === false ? `
|
|
27733
|
+
<span class="shrink-0 inline-flex items-center rounded-md bg-zinc-50 dark:bg-zinc-800 px-2 py-1 text-xs font-medium text-zinc-400 dark:text-zinc-500 ring-1 ring-inset ring-zinc-200 dark:ring-zinc-700">
|
|
27734
|
+
Auto-discovered
|
|
27655
27735
|
</span>
|
|
27656
|
-
`}
|
|
27736
|
+
` : ""}
|
|
27657
27737
|
</div>
|
|
27658
|
-
<p class="text-zinc-600 dark:text-zinc-400 text-sm leading-6">${endpoint.description}</p>
|
|
27738
|
+
<p class="text-zinc-600 dark:text-zinc-400 text-sm leading-6">${endpoint.description || '<em class="text-zinc-400 dark:text-zinc-500">No description available</em>'}</p>
|
|
27659
27739
|
</div>
|
|
27660
27740
|
</div>
|
|
27661
27741
|
</div>
|
|
@@ -27733,8 +27813,8 @@ function renderAPIReferencePage(data) {
|
|
|
27733
27813
|
const path = endpoint.dataset.path.toLowerCase();
|
|
27734
27814
|
const description = endpoint.dataset.description.toLowerCase();
|
|
27735
27815
|
|
|
27736
|
-
const matchesSearch = !searchTerm ||
|
|
27737
|
-
path.includes(searchTerm) ||
|
|
27816
|
+
const matchesSearch = !searchTerm ||
|
|
27817
|
+
path.includes(searchTerm) ||
|
|
27738
27818
|
description.includes(searchTerm);
|
|
27739
27819
|
const matchesMethod = !selectedMethod || method === selectedMethod;
|
|
27740
27820
|
|
|
@@ -27794,207 +27874,13 @@ function renderAPIReferencePage(data) {
|
|
|
27794
27874
|
var VERSION2 = getCoreVersion();
|
|
27795
27875
|
var router2 = new Hono();
|
|
27796
27876
|
router2.use("*", requireAuth());
|
|
27797
|
-
var apiEndpoints = [
|
|
27798
|
-
// Auth endpoints
|
|
27799
|
-
{
|
|
27800
|
-
method: "POST",
|
|
27801
|
-
path: "/auth/login",
|
|
27802
|
-
description: "Authenticate user with email and password",
|
|
27803
|
-
authentication: false,
|
|
27804
|
-
category: "Auth"
|
|
27805
|
-
},
|
|
27806
|
-
{
|
|
27807
|
-
method: "POST",
|
|
27808
|
-
path: "/auth/register",
|
|
27809
|
-
description: "Register a new user account",
|
|
27810
|
-
authentication: false,
|
|
27811
|
-
category: "Auth"
|
|
27812
|
-
},
|
|
27813
|
-
{
|
|
27814
|
-
method: "POST",
|
|
27815
|
-
path: "/auth/logout",
|
|
27816
|
-
description: "Log out the current user and invalidate session",
|
|
27817
|
-
authentication: true,
|
|
27818
|
-
category: "Auth"
|
|
27819
|
-
},
|
|
27820
|
-
{
|
|
27821
|
-
method: "GET",
|
|
27822
|
-
path: "/auth/me",
|
|
27823
|
-
description: "Get current authenticated user information",
|
|
27824
|
-
authentication: true,
|
|
27825
|
-
category: "Auth"
|
|
27826
|
-
},
|
|
27827
|
-
{
|
|
27828
|
-
method: "POST",
|
|
27829
|
-
path: "/auth/refresh",
|
|
27830
|
-
description: "Refresh authentication token",
|
|
27831
|
-
authentication: true,
|
|
27832
|
-
category: "Auth"
|
|
27833
|
-
},
|
|
27834
|
-
// Content endpoints
|
|
27835
|
-
{
|
|
27836
|
-
method: "GET",
|
|
27837
|
-
path: "/api/collections",
|
|
27838
|
-
description: "List all available collections",
|
|
27839
|
-
authentication: false,
|
|
27840
|
-
category: "Content"
|
|
27841
|
-
},
|
|
27842
|
-
{
|
|
27843
|
-
method: "GET",
|
|
27844
|
-
path: "/api/collections/:collection/content",
|
|
27845
|
-
description: "Get all content items from a specific collection",
|
|
27846
|
-
authentication: false,
|
|
27847
|
-
category: "Content"
|
|
27848
|
-
},
|
|
27849
|
-
{
|
|
27850
|
-
method: "GET",
|
|
27851
|
-
path: "/api/content/:id",
|
|
27852
|
-
description: "Get a specific content item by ID",
|
|
27853
|
-
authentication: false,
|
|
27854
|
-
category: "Content"
|
|
27855
|
-
},
|
|
27856
|
-
{
|
|
27857
|
-
method: "POST",
|
|
27858
|
-
path: "/api/content",
|
|
27859
|
-
description: "Create a new content item",
|
|
27860
|
-
authentication: true,
|
|
27861
|
-
category: "Content"
|
|
27862
|
-
},
|
|
27863
|
-
{
|
|
27864
|
-
method: "PUT",
|
|
27865
|
-
path: "/api/content/:id",
|
|
27866
|
-
description: "Update an existing content item",
|
|
27867
|
-
authentication: true,
|
|
27868
|
-
category: "Content"
|
|
27869
|
-
},
|
|
27870
|
-
{
|
|
27871
|
-
method: "DELETE",
|
|
27872
|
-
path: "/api/content/:id",
|
|
27873
|
-
description: "Delete a content item",
|
|
27874
|
-
authentication: true,
|
|
27875
|
-
category: "Content"
|
|
27876
|
-
},
|
|
27877
|
-
// Media endpoints
|
|
27878
|
-
{
|
|
27879
|
-
method: "GET",
|
|
27880
|
-
path: "/api/media",
|
|
27881
|
-
description: "List all media files with pagination",
|
|
27882
|
-
authentication: false,
|
|
27883
|
-
category: "Media"
|
|
27884
|
-
},
|
|
27885
|
-
{
|
|
27886
|
-
method: "GET",
|
|
27887
|
-
path: "/api/media/:id",
|
|
27888
|
-
description: "Get a specific media file by ID",
|
|
27889
|
-
authentication: false,
|
|
27890
|
-
category: "Media"
|
|
27891
|
-
},
|
|
27892
|
-
{
|
|
27893
|
-
method: "POST",
|
|
27894
|
-
path: "/api/media/upload",
|
|
27895
|
-
description: "Upload a new media file to R2 storage",
|
|
27896
|
-
authentication: true,
|
|
27897
|
-
category: "Media"
|
|
27898
|
-
},
|
|
27899
|
-
{
|
|
27900
|
-
method: "DELETE",
|
|
27901
|
-
path: "/api/media/:id",
|
|
27902
|
-
description: "Delete a media file from storage",
|
|
27903
|
-
authentication: true,
|
|
27904
|
-
category: "Media"
|
|
27905
|
-
},
|
|
27906
|
-
// Admin endpoints
|
|
27907
|
-
{
|
|
27908
|
-
method: "GET",
|
|
27909
|
-
path: "/admin/api/stats",
|
|
27910
|
-
description: "Get dashboard statistics (collections, content, media, users)",
|
|
27911
|
-
authentication: true,
|
|
27912
|
-
category: "Admin"
|
|
27913
|
-
},
|
|
27914
|
-
{
|
|
27915
|
-
method: "GET",
|
|
27916
|
-
path: "/admin/api/storage",
|
|
27917
|
-
description: "Get storage usage information",
|
|
27918
|
-
authentication: true,
|
|
27919
|
-
category: "Admin"
|
|
27920
|
-
},
|
|
27921
|
-
{
|
|
27922
|
-
method: "GET",
|
|
27923
|
-
path: "/admin/api/activity",
|
|
27924
|
-
description: "Get recent activity logs",
|
|
27925
|
-
authentication: true,
|
|
27926
|
-
category: "Admin"
|
|
27927
|
-
},
|
|
27928
|
-
{
|
|
27929
|
-
method: "GET",
|
|
27930
|
-
path: "/admin/api/collections",
|
|
27931
|
-
description: "List all collections with field counts",
|
|
27932
|
-
authentication: true,
|
|
27933
|
-
category: "Admin"
|
|
27934
|
-
},
|
|
27935
|
-
{
|
|
27936
|
-
method: "POST",
|
|
27937
|
-
path: "/admin/api/collections",
|
|
27938
|
-
description: "Create a new collection",
|
|
27939
|
-
authentication: true,
|
|
27940
|
-
category: "Admin"
|
|
27941
|
-
},
|
|
27942
|
-
{
|
|
27943
|
-
method: "PATCH",
|
|
27944
|
-
path: "/admin/api/collections/:id",
|
|
27945
|
-
description: "Update an existing collection",
|
|
27946
|
-
authentication: true,
|
|
27947
|
-
category: "Admin"
|
|
27948
|
-
},
|
|
27949
|
-
{
|
|
27950
|
-
method: "DELETE",
|
|
27951
|
-
path: "/admin/api/collections/:id",
|
|
27952
|
-
description: "Delete a collection (must be empty)",
|
|
27953
|
-
authentication: true,
|
|
27954
|
-
category: "Admin"
|
|
27955
|
-
},
|
|
27956
|
-
{
|
|
27957
|
-
method: "GET",
|
|
27958
|
-
path: "/admin/api/migrations/status",
|
|
27959
|
-
description: "Get database migration status",
|
|
27960
|
-
authentication: true,
|
|
27961
|
-
category: "Admin"
|
|
27962
|
-
},
|
|
27963
|
-
{
|
|
27964
|
-
method: "POST",
|
|
27965
|
-
path: "/admin/api/migrations/run",
|
|
27966
|
-
description: "Run pending database migrations",
|
|
27967
|
-
authentication: true,
|
|
27968
|
-
category: "Admin"
|
|
27969
|
-
},
|
|
27970
|
-
// System endpoints
|
|
27971
|
-
{
|
|
27972
|
-
method: "GET",
|
|
27973
|
-
path: "/health",
|
|
27974
|
-
description: "Health check endpoint for monitoring",
|
|
27975
|
-
authentication: false,
|
|
27976
|
-
category: "System"
|
|
27977
|
-
},
|
|
27978
|
-
{
|
|
27979
|
-
method: "GET",
|
|
27980
|
-
path: "/api/health",
|
|
27981
|
-
description: "API health check with schema information",
|
|
27982
|
-
authentication: false,
|
|
27983
|
-
category: "System"
|
|
27984
|
-
},
|
|
27985
|
-
{
|
|
27986
|
-
method: "GET",
|
|
27987
|
-
path: "/api",
|
|
27988
|
-
description: "API root - returns API information and OpenAPI spec",
|
|
27989
|
-
authentication: false,
|
|
27990
|
-
category: "System"
|
|
27991
|
-
}
|
|
27992
|
-
];
|
|
27993
27877
|
router2.get("/", async (c) => {
|
|
27994
27878
|
const user = c.get("user");
|
|
27995
27879
|
try {
|
|
27880
|
+
const app2 = getAppInstance();
|
|
27881
|
+
const endpoints = buildRouteList(app2);
|
|
27996
27882
|
const pageData = {
|
|
27997
|
-
endpoints
|
|
27883
|
+
endpoints,
|
|
27998
27884
|
user: user ? {
|
|
27999
27885
|
name: user.email.split("@")[0] || user.email,
|
|
28000
27886
|
email: user.email,
|
|
@@ -28050,5 +27936,5 @@ var ROUTES_INFO = {
|
|
|
28050
27936
|
};
|
|
28051
27937
|
|
|
28052
27938
|
export { ROUTES_INFO, adminCheckboxRoutes, adminCollectionsRoutes, adminDesignRoutes, adminFormsRoutes, adminLogsRoutes, adminMediaRoutes, adminPluginRoutes, adminSettingsRoutes, admin_api_default, admin_code_examples_default, admin_content_default, admin_testimonials_default, api_content_crud_default, api_default, api_media_default, api_system_default, auth_default, getConfirmationDialogScript2 as getConfirmationDialogScript, public_forms_default, renderConfirmationDialog2 as renderConfirmationDialog, router, router2, test_cleanup_default, userRoutes };
|
|
28053
|
-
//# sourceMappingURL=chunk-
|
|
28054
|
-
//# sourceMappingURL=chunk-
|
|
27939
|
+
//# sourceMappingURL=chunk-2JGQKF7B.js.map
|
|
27940
|
+
//# sourceMappingURL=chunk-2JGQKF7B.js.map
|