@sonicjs-cms/core 2.0.3 → 2.0.5
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/{chunk-LEG4KNFP.cjs → chunk-3JMOWGUU.cjs} +20 -2
- package/dist/chunk-3JMOWGUU.cjs.map +1 -0
- package/dist/{chunk-LH4Z7QID.js → chunk-6FR25MPC.js} +111 -3
- package/dist/chunk-6FR25MPC.js.map +1 -0
- package/dist/{chunk-3NVJ6W27.cjs → chunk-DOR2IU73.cjs} +111 -2
- package/dist/chunk-DOR2IU73.cjs.map +1 -0
- package/dist/{chunk-M6FPVS7E.js → chunk-G5KY3WJV.js} +16 -29
- package/dist/chunk-G5KY3WJV.js.map +1 -0
- package/dist/{chunk-CDBVZEWR.js → chunk-HSRPDEQQ.js} +20 -2
- package/dist/chunk-HSRPDEQQ.js.map +1 -0
- package/dist/{chunk-4BJGEGX5.cjs → chunk-IM5SDXOE.cjs} +19 -32
- package/dist/chunk-IM5SDXOE.cjs.map +1 -0
- package/dist/{chunk-PPUKPNTP.js → chunk-LGC3TNCY.js} +293 -101
- package/dist/chunk-LGC3TNCY.js.map +1 -0
- package/dist/{chunk-5B3VMVEX.cjs → chunk-NPWWR6RI.cjs} +400 -208
- package/dist/chunk-NPWWR6RI.cjs.map +1 -0
- package/dist/{chunk-UL32L2KV.cjs → chunk-TRSHFTF6.cjs} +123 -3
- package/dist/chunk-TRSHFTF6.cjs.map +1 -0
- package/dist/{chunk-XJETEIRU.js → chunk-VSLEA22M.js} +123 -4
- package/dist/chunk-VSLEA22M.js.map +1 -0
- package/dist/index.cjs +876 -131
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +759 -13
- package/dist/index.js.map +1 -1
- package/dist/middleware.cjs +23 -23
- package/dist/middleware.js +2 -2
- package/dist/routes.cjs +25 -25
- package/dist/routes.js +5 -5
- package/dist/services.cjs +25 -21
- package/dist/services.js +2 -2
- package/dist/utils.cjs +11 -11
- package/dist/utils.js +1 -1
- package/migrations/006_plugin_system.sql +2 -2
- package/migrations/011_config_managed_collections.sql +1 -0
- package/migrations/018_settings_table.sql +23 -0
- package/package.json +1 -1
- package/dist/chunk-3NVJ6W27.cjs.map +0 -1
- package/dist/chunk-4BJGEGX5.cjs.map +0 -1
- package/dist/chunk-5B3VMVEX.cjs.map +0 -1
- package/dist/chunk-CDBVZEWR.js.map +0 -1
- package/dist/chunk-LEG4KNFP.cjs.map +0 -1
- package/dist/chunk-LH4Z7QID.js.map +0 -1
- package/dist/chunk-M6FPVS7E.js.map +0 -1
- package/dist/chunk-PPUKPNTP.js.map +0 -1
- package/dist/chunk-UL32L2KV.cjs.map +0 -1
- package/dist/chunk-XJETEIRU.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,29 +1,750 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunkNPWWR6RI_cjs = require('./chunk-NPWWR6RI.cjs');
|
|
4
|
+
var chunkDOR2IU73_cjs = require('./chunk-DOR2IU73.cjs');
|
|
5
|
+
var chunkIM5SDXOE_cjs = require('./chunk-IM5SDXOE.cjs');
|
|
6
|
+
var chunk3JMOWGUU_cjs = require('./chunk-3JMOWGUU.cjs');
|
|
7
7
|
var chunk5APKEYFK_cjs = require('./chunk-5APKEYFK.cjs');
|
|
8
8
|
var chunk3SPQ3J4N_cjs = require('./chunk-3SPQ3J4N.cjs');
|
|
9
9
|
var chunkHJZOA2O5_cjs = require('./chunk-HJZOA2O5.cjs');
|
|
10
|
-
var
|
|
10
|
+
var chunkTRSHFTF6_cjs = require('./chunk-TRSHFTF6.cjs');
|
|
11
11
|
var chunkRCQ2HIQD_cjs = require('./chunk-RCQ2HIQD.cjs');
|
|
12
12
|
var chunkKYGRJCZM_cjs = require('./chunk-KYGRJCZM.cjs');
|
|
13
13
|
require('./chunk-IGJUBJBW.cjs');
|
|
14
14
|
var hono = require('hono');
|
|
15
15
|
var d1 = require('drizzle-orm/d1');
|
|
16
16
|
|
|
17
|
+
// src/plugins/core-plugins/database-tools-plugin/services/database-service.ts
|
|
18
|
+
var DatabaseToolsService = class {
|
|
19
|
+
constructor(db) {
|
|
20
|
+
this.db = db;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get database statistics
|
|
24
|
+
*/
|
|
25
|
+
async getDatabaseStats() {
|
|
26
|
+
const tables = await this.getTables();
|
|
27
|
+
const stats = {
|
|
28
|
+
tables: [],
|
|
29
|
+
totalRows: 0
|
|
30
|
+
};
|
|
31
|
+
for (const tableName of tables) {
|
|
32
|
+
try {
|
|
33
|
+
const result = await this.db.prepare(`SELECT COUNT(*) as count FROM ${tableName}`).first();
|
|
34
|
+
const rowCount = result?.count || 0;
|
|
35
|
+
stats.tables.push({
|
|
36
|
+
name: tableName,
|
|
37
|
+
rowCount
|
|
38
|
+
});
|
|
39
|
+
stats.totalRows += rowCount;
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.warn(`Could not count rows in table ${tableName}:`, error);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return stats;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get all tables in the database
|
|
48
|
+
*/
|
|
49
|
+
async getTables() {
|
|
50
|
+
const result = await this.db.prepare(`
|
|
51
|
+
SELECT name FROM sqlite_master
|
|
52
|
+
WHERE type='table'
|
|
53
|
+
AND name NOT LIKE 'sqlite_%'
|
|
54
|
+
ORDER BY name
|
|
55
|
+
`).all();
|
|
56
|
+
return result.results?.map((row) => row.name) || [];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Truncate all data except admin user
|
|
60
|
+
*/
|
|
61
|
+
async truncateAllData(adminEmail) {
|
|
62
|
+
const errors = [];
|
|
63
|
+
const tablesCleared = [];
|
|
64
|
+
let adminUserPreserved = false;
|
|
65
|
+
try {
|
|
66
|
+
const adminUser = await this.db.prepare(
|
|
67
|
+
"SELECT * FROM users WHERE email = ? AND role = ?"
|
|
68
|
+
).bind(adminEmail, "admin").first();
|
|
69
|
+
if (!adminUser) {
|
|
70
|
+
return {
|
|
71
|
+
success: false,
|
|
72
|
+
message: "Admin user not found. Operation cancelled for safety.",
|
|
73
|
+
tablesCleared: [],
|
|
74
|
+
adminUserPreserved: false,
|
|
75
|
+
errors: ["Admin user not found"]
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const tablesToTruncate = [
|
|
79
|
+
"content",
|
|
80
|
+
"content_versions",
|
|
81
|
+
"content_workflow_status",
|
|
82
|
+
"collections",
|
|
83
|
+
"media",
|
|
84
|
+
"sessions",
|
|
85
|
+
"notifications",
|
|
86
|
+
"api_tokens",
|
|
87
|
+
"workflow_history",
|
|
88
|
+
"scheduled_content",
|
|
89
|
+
"faqs",
|
|
90
|
+
"faq_categories",
|
|
91
|
+
"plugins",
|
|
92
|
+
"plugin_settings",
|
|
93
|
+
"email_templates",
|
|
94
|
+
"email_themes"
|
|
95
|
+
];
|
|
96
|
+
const existingTables = await this.getTables();
|
|
97
|
+
const tablesToClear = tablesToTruncate.filter(
|
|
98
|
+
(table) => existingTables.includes(table)
|
|
99
|
+
);
|
|
100
|
+
for (const tableName of tablesToClear) {
|
|
101
|
+
try {
|
|
102
|
+
await this.db.prepare(`DELETE FROM ${tableName}`).run();
|
|
103
|
+
tablesCleared.push(tableName);
|
|
104
|
+
} catch (error) {
|
|
105
|
+
errors.push(`Failed to clear table ${tableName}: ${error}`);
|
|
106
|
+
console.error(`Error clearing table ${tableName}:`, error);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
try {
|
|
110
|
+
await this.db.prepare("DELETE FROM users WHERE email != ? OR role != ?").bind(adminEmail, "admin").run();
|
|
111
|
+
const verifyAdmin = await this.db.prepare(
|
|
112
|
+
"SELECT id FROM users WHERE email = ? AND role = ?"
|
|
113
|
+
).bind(adminEmail, "admin").first();
|
|
114
|
+
adminUserPreserved = !!verifyAdmin;
|
|
115
|
+
tablesCleared.push("users (non-admin)");
|
|
116
|
+
} catch (error) {
|
|
117
|
+
errors.push(`Failed to clear non-admin users: ${error}`);
|
|
118
|
+
console.error("Error clearing non-admin users:", error);
|
|
119
|
+
}
|
|
120
|
+
try {
|
|
121
|
+
await this.db.prepare("DELETE FROM sqlite_sequence").run();
|
|
122
|
+
} catch (error) {
|
|
123
|
+
}
|
|
124
|
+
const message = errors.length > 0 ? `Truncation completed with ${errors.length} errors. ${tablesCleared.length} tables cleared.` : `Successfully truncated database. ${tablesCleared.length} tables cleared.`;
|
|
125
|
+
return {
|
|
126
|
+
success: errors.length === 0,
|
|
127
|
+
message,
|
|
128
|
+
tablesCleared,
|
|
129
|
+
adminUserPreserved,
|
|
130
|
+
errors: errors.length > 0 ? errors : void 0
|
|
131
|
+
};
|
|
132
|
+
} catch (error) {
|
|
133
|
+
return {
|
|
134
|
+
success: false,
|
|
135
|
+
message: `Database truncation failed: ${error}`,
|
|
136
|
+
tablesCleared,
|
|
137
|
+
adminUserPreserved,
|
|
138
|
+
errors: [String(error)]
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Create a backup of current data (simplified version)
|
|
144
|
+
*/
|
|
145
|
+
async createBackup() {
|
|
146
|
+
try {
|
|
147
|
+
const backupId = `backup_${Date.now()}`;
|
|
148
|
+
const stats = await this.getDatabaseStats();
|
|
149
|
+
console.log(`Backup ${backupId} created with ${stats.totalRows} total rows`);
|
|
150
|
+
return {
|
|
151
|
+
success: true,
|
|
152
|
+
message: `Backup created successfully (${stats.totalRows} rows)`,
|
|
153
|
+
backupId
|
|
154
|
+
};
|
|
155
|
+
} catch (error) {
|
|
156
|
+
return {
|
|
157
|
+
success: false,
|
|
158
|
+
message: `Backup failed: ${error}`
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Get table data with optional pagination and sorting
|
|
164
|
+
*/
|
|
165
|
+
async getTableData(tableName, limit = 100, offset = 0, sortColumn, sortDirection = "asc") {
|
|
166
|
+
try {
|
|
167
|
+
const tables = await this.getTables();
|
|
168
|
+
if (!tables.includes(tableName)) {
|
|
169
|
+
throw new Error(`Table ${tableName} not found`);
|
|
170
|
+
}
|
|
171
|
+
const pragmaResult = await this.db.prepare(`PRAGMA table_info(${tableName})`).all();
|
|
172
|
+
const columns = pragmaResult.results?.map((col) => col.name) || [];
|
|
173
|
+
if (sortColumn && !columns.includes(sortColumn)) {
|
|
174
|
+
sortColumn = void 0;
|
|
175
|
+
}
|
|
176
|
+
const countResult = await this.db.prepare(`SELECT COUNT(*) as count FROM ${tableName}`).first();
|
|
177
|
+
const totalRows = countResult?.count || 0;
|
|
178
|
+
let query = `SELECT * FROM ${tableName}`;
|
|
179
|
+
if (sortColumn) {
|
|
180
|
+
query += ` ORDER BY ${sortColumn} ${sortDirection.toUpperCase()}`;
|
|
181
|
+
}
|
|
182
|
+
query += ` LIMIT ${limit} OFFSET ${offset}`;
|
|
183
|
+
const dataResult = await this.db.prepare(query).all();
|
|
184
|
+
return {
|
|
185
|
+
tableName,
|
|
186
|
+
columns,
|
|
187
|
+
rows: dataResult.results || [],
|
|
188
|
+
totalRows
|
|
189
|
+
};
|
|
190
|
+
} catch (error) {
|
|
191
|
+
throw new Error(`Failed to fetch table data: ${error}`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Validate database integrity
|
|
196
|
+
*/
|
|
197
|
+
async validateDatabase() {
|
|
198
|
+
const issues = [];
|
|
199
|
+
try {
|
|
200
|
+
const requiredTables = ["users", "content", "collections"];
|
|
201
|
+
const existingTables = await this.getTables();
|
|
202
|
+
for (const table of requiredTables) {
|
|
203
|
+
if (!existingTables.includes(table)) {
|
|
204
|
+
issues.push(`Critical table missing: ${table}`);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
const adminCount = await this.db.prepare(
|
|
208
|
+
"SELECT COUNT(*) as count FROM users WHERE role = ?"
|
|
209
|
+
).bind("admin").first();
|
|
210
|
+
if (adminCount?.count === 0) {
|
|
211
|
+
issues.push("No admin users found");
|
|
212
|
+
}
|
|
213
|
+
try {
|
|
214
|
+
const integrityResult = await this.db.prepare("PRAGMA integrity_check").first();
|
|
215
|
+
if (integrityResult && integrityResult.integrity_check !== "ok") {
|
|
216
|
+
issues.push(`Database integrity check failed: ${integrityResult.integrity_check}`);
|
|
217
|
+
}
|
|
218
|
+
} catch (error) {
|
|
219
|
+
issues.push(`Could not run integrity check: ${error}`);
|
|
220
|
+
}
|
|
221
|
+
} catch (error) {
|
|
222
|
+
issues.push(`Validation error: ${error}`);
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
valid: issues.length === 0,
|
|
226
|
+
issues
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
// src/templates/pages/admin-database-table.template.ts
|
|
232
|
+
chunk3SPQ3J4N_cjs.init_admin_layout_catalyst_template();
|
|
233
|
+
function renderDatabaseTablePage(data) {
|
|
234
|
+
const totalPages = Math.ceil(data.totalRows / data.pageSize);
|
|
235
|
+
const startRow = (data.currentPage - 1) * data.pageSize + 1;
|
|
236
|
+
const endRow = Math.min(data.currentPage * data.pageSize, data.totalRows);
|
|
237
|
+
const pageContent = `
|
|
238
|
+
<div class="space-y-6">
|
|
239
|
+
<!-- Header -->
|
|
240
|
+
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between">
|
|
241
|
+
<div>
|
|
242
|
+
<div class="flex items-center space-x-3">
|
|
243
|
+
<a
|
|
244
|
+
href="/admin/settings/database-tools"
|
|
245
|
+
class="inline-flex items-center text-sm/6 text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-300"
|
|
246
|
+
>
|
|
247
|
+
<svg class="w-5 h-5 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
248
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"/>
|
|
249
|
+
</svg>
|
|
250
|
+
Back to Database Tools
|
|
251
|
+
</a>
|
|
252
|
+
</div>
|
|
253
|
+
<h1 class="mt-2 text-2xl/8 font-semibold text-zinc-950 dark:text-white sm:text-xl/8">Table: ${data.tableName}</h1>
|
|
254
|
+
<p class="mt-2 text-sm/6 text-zinc-500 dark:text-zinc-400">
|
|
255
|
+
Showing ${startRow.toLocaleString()} - ${endRow.toLocaleString()} of ${data.totalRows.toLocaleString()} rows
|
|
256
|
+
</p>
|
|
257
|
+
</div>
|
|
258
|
+
<div class="mt-4 sm:mt-0 flex items-center space-x-3">
|
|
259
|
+
<div class="flex items-center space-x-2">
|
|
260
|
+
<label for="pageSize" class="text-sm font-medium text-zinc-700 dark:text-zinc-300">
|
|
261
|
+
Rows per page:
|
|
262
|
+
</label>
|
|
263
|
+
<select
|
|
264
|
+
id="pageSize"
|
|
265
|
+
onchange="changePageSize(this.value)"
|
|
266
|
+
class="rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm font-semibold text-zinc-950 dark:text-white ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 hover:bg-zinc-50 dark:hover:bg-zinc-700 transition-colors shadow-sm cursor-pointer"
|
|
267
|
+
>
|
|
268
|
+
<option value="10" ${data.pageSize === 10 ? "selected" : ""}>10</option>
|
|
269
|
+
<option value="20" ${data.pageSize === 20 ? "selected" : ""}>20</option>
|
|
270
|
+
<option value="50" ${data.pageSize === 50 ? "selected" : ""}>50</option>
|
|
271
|
+
<option value="100" ${data.pageSize === 100 ? "selected" : ""}>100</option>
|
|
272
|
+
<option value="200" ${data.pageSize === 200 ? "selected" : ""}>200</option>
|
|
273
|
+
</select>
|
|
274
|
+
</div>
|
|
275
|
+
<button
|
|
276
|
+
onclick="refreshTableData()"
|
|
277
|
+
class="inline-flex items-center justify-center rounded-lg bg-white dark:bg-zinc-800 px-3.5 py-2.5 text-sm font-semibold text-zinc-950 dark:text-white ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 hover:bg-zinc-50 dark:hover:bg-zinc-700 transition-colors shadow-sm"
|
|
278
|
+
>
|
|
279
|
+
<svg class="-ml-0.5 mr-1.5 h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
280
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"/>
|
|
281
|
+
</svg>
|
|
282
|
+
Refresh
|
|
283
|
+
</button>
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
286
|
+
|
|
287
|
+
<!-- Table Card -->
|
|
288
|
+
<div class="rounded-xl bg-white dark:bg-zinc-900 shadow-sm ring-1 ring-zinc-950/5 dark:ring-white/10 overflow-hidden">
|
|
289
|
+
<!-- Table -->
|
|
290
|
+
<div class="overflow-x-auto">
|
|
291
|
+
<table class="min-w-full divide-y divide-zinc-950/10 dark:divide-white/10">
|
|
292
|
+
<thead class="bg-zinc-50 dark:bg-white/5">
|
|
293
|
+
<tr>
|
|
294
|
+
${data.columns.map((col) => `
|
|
295
|
+
<th
|
|
296
|
+
scope="col"
|
|
297
|
+
class="px-4 py-3.5 text-left text-xs font-semibold text-zinc-950 dark:text-white uppercase tracking-wider cursor-pointer hover:bg-zinc-100 dark:hover:bg-white/10 transition-colors"
|
|
298
|
+
onclick="sortTable('${col}')"
|
|
299
|
+
>
|
|
300
|
+
<div class="flex items-center space-x-1">
|
|
301
|
+
<span>${col}</span>
|
|
302
|
+
${data.sortColumn === col ? `
|
|
303
|
+
<svg class="w-4 h-4 ${data.sortDirection === "asc" ? "" : "rotate-180"}" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
304
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7"/>
|
|
305
|
+
</svg>
|
|
306
|
+
` : `
|
|
307
|
+
<svg class="w-4 h-4 text-zinc-400 dark:text-zinc-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
308
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"/>
|
|
309
|
+
</svg>
|
|
310
|
+
`}
|
|
311
|
+
</div>
|
|
312
|
+
</th>
|
|
313
|
+
`).join("")}
|
|
314
|
+
</tr>
|
|
315
|
+
</thead>
|
|
316
|
+
<tbody class="divide-y divide-zinc-950/5 dark:divide-white/5">
|
|
317
|
+
${data.rows.length > 0 ? data.rows.map((row, idx) => `
|
|
318
|
+
<tr class="${idx % 2 === 0 ? "bg-white dark:bg-zinc-900" : "bg-zinc-50 dark:bg-zinc-900/50"}">
|
|
319
|
+
${data.columns.map((col) => `
|
|
320
|
+
<td class="px-4 py-3 text-sm text-zinc-700 dark:text-zinc-300 whitespace-nowrap max-w-xs overflow-hidden text-ellipsis" title="${escapeHtml2(String(row[col] ?? ""))}">
|
|
321
|
+
${formatCellValue(row[col])}
|
|
322
|
+
</td>
|
|
323
|
+
`).join("")}
|
|
324
|
+
</tr>
|
|
325
|
+
`).join("") : `
|
|
326
|
+
<tr>
|
|
327
|
+
<td colspan="${data.columns.length}" class="px-4 py-12 text-center text-sm text-zinc-500 dark:text-zinc-400">
|
|
328
|
+
<svg class="w-12 h-12 mx-auto mb-4 text-zinc-400 dark:text-zinc-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
329
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"/>
|
|
330
|
+
</svg>
|
|
331
|
+
<p>No data in this table</p>
|
|
332
|
+
</td>
|
|
333
|
+
</tr>
|
|
334
|
+
`}
|
|
335
|
+
</tbody>
|
|
336
|
+
</table>
|
|
337
|
+
</div>
|
|
338
|
+
|
|
339
|
+
<!-- Pagination -->
|
|
340
|
+
${totalPages > 1 ? `
|
|
341
|
+
<div class="flex items-center justify-between border-t border-zinc-950/10 dark:border-white/10 bg-zinc-50 dark:bg-zinc-900/50 px-4 py-3 sm:px-6">
|
|
342
|
+
<div class="flex flex-1 justify-between sm:hidden">
|
|
343
|
+
<button
|
|
344
|
+
onclick="goToPage(${data.currentPage - 1})"
|
|
345
|
+
${data.currentPage === 1 ? "disabled" : ""}
|
|
346
|
+
class="relative inline-flex items-center rounded-lg px-4 py-2 text-sm font-semibold text-zinc-950 dark:text-white ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 hover:bg-zinc-100 dark:hover:bg-zinc-800 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
347
|
+
>
|
|
348
|
+
Previous
|
|
349
|
+
</button>
|
|
350
|
+
<button
|
|
351
|
+
onclick="goToPage(${data.currentPage + 1})"
|
|
352
|
+
${data.currentPage === totalPages ? "disabled" : ""}
|
|
353
|
+
class="relative ml-3 inline-flex items-center rounded-lg px-4 py-2 text-sm font-semibold text-zinc-950 dark:text-white ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 hover:bg-zinc-100 dark:hover:bg-zinc-800 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
354
|
+
>
|
|
355
|
+
Next
|
|
356
|
+
</button>
|
|
357
|
+
</div>
|
|
358
|
+
<div class="hidden sm:flex sm:flex-1 sm:items-center sm:justify-between">
|
|
359
|
+
<div>
|
|
360
|
+
<p class="text-sm text-zinc-700 dark:text-zinc-300">
|
|
361
|
+
Page <span class="font-medium">${data.currentPage}</span> of <span class="font-medium">${totalPages}</span>
|
|
362
|
+
</p>
|
|
363
|
+
</div>
|
|
364
|
+
<div>
|
|
365
|
+
<nav class="isolate inline-flex -space-x-px rounded-lg shadow-sm" aria-label="Pagination">
|
|
366
|
+
<button
|
|
367
|
+
onclick="goToPage(${data.currentPage - 1})"
|
|
368
|
+
${data.currentPage === 1 ? "disabled" : ""}
|
|
369
|
+
class="relative inline-flex items-center rounded-l-lg px-2 py-2 text-zinc-400 ring-1 ring-inset ring-zinc-300 dark:ring-zinc-700 hover:bg-zinc-50 dark:hover:bg-zinc-800 focus:z-20 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
370
|
+
>
|
|
371
|
+
<span class="sr-only">Previous</span>
|
|
372
|
+
<svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
|
|
373
|
+
<path fill-rule="evenodd" d="M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z" clip-rule="evenodd" />
|
|
374
|
+
</svg>
|
|
375
|
+
</button>
|
|
376
|
+
|
|
377
|
+
${generatePageNumbers(data.currentPage, totalPages)}
|
|
378
|
+
|
|
379
|
+
<button
|
|
380
|
+
onclick="goToPage(${data.currentPage + 1})"
|
|
381
|
+
${data.currentPage === totalPages ? "disabled" : ""}
|
|
382
|
+
class="relative inline-flex items-center rounded-r-lg px-2 py-2 text-zinc-400 ring-1 ring-inset ring-zinc-300 dark:ring-zinc-700 hover:bg-zinc-50 dark:hover:bg-zinc-800 focus:z-20 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
383
|
+
>
|
|
384
|
+
<span class="sr-only">Next</span>
|
|
385
|
+
<svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
|
|
386
|
+
<path fill-rule="evenodd" d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd" />
|
|
387
|
+
</svg>
|
|
388
|
+
</button>
|
|
389
|
+
</nav>
|
|
390
|
+
</div>
|
|
391
|
+
</div>
|
|
392
|
+
</div>
|
|
393
|
+
` : ""}
|
|
394
|
+
</div>
|
|
395
|
+
</div>
|
|
396
|
+
|
|
397
|
+
<script>
|
|
398
|
+
const currentTableName = '${data.tableName}';
|
|
399
|
+
let currentPage = ${data.currentPage};
|
|
400
|
+
let currentPageSize = ${data.pageSize};
|
|
401
|
+
let currentSort = '${data.sortColumn || ""}';
|
|
402
|
+
let currentSortDir = '${data.sortDirection || "asc"}';
|
|
403
|
+
|
|
404
|
+
function goToPage(page) {
|
|
405
|
+
if (page < 1 || page > ${totalPages}) return;
|
|
406
|
+
const params = new URLSearchParams();
|
|
407
|
+
params.set('page', page);
|
|
408
|
+
params.set('pageSize', currentPageSize);
|
|
409
|
+
if (currentSort) {
|
|
410
|
+
params.set('sort', currentSort);
|
|
411
|
+
params.set('dir', currentSortDir);
|
|
412
|
+
}
|
|
413
|
+
window.location.href = \`/admin/database-tools/tables/\${currentTableName}?\${params}\`;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
function sortTable(column) {
|
|
417
|
+
let newDir = 'asc';
|
|
418
|
+
if (currentSort === column && currentSortDir === 'asc') {
|
|
419
|
+
newDir = 'desc';
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
const params = new URLSearchParams();
|
|
423
|
+
params.set('page', '1');
|
|
424
|
+
params.set('pageSize', currentPageSize);
|
|
425
|
+
params.set('sort', column);
|
|
426
|
+
params.set('dir', newDir);
|
|
427
|
+
window.location.href = \`/admin/database-tools/tables/\${currentTableName}?\${params}\`;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
function changePageSize(newSize) {
|
|
431
|
+
const params = new URLSearchParams();
|
|
432
|
+
params.set('page', '1');
|
|
433
|
+
params.set('pageSize', newSize);
|
|
434
|
+
if (currentSort) {
|
|
435
|
+
params.set('sort', currentSort);
|
|
436
|
+
params.set('dir', currentSortDir);
|
|
437
|
+
}
|
|
438
|
+
window.location.href = \`/admin/database-tools/tables/\${currentTableName}?\${params}\`;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
function refreshTableData() {
|
|
442
|
+
window.location.reload();
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
function formatCellValue(value) {
|
|
446
|
+
if (value === null || value === undefined) {
|
|
447
|
+
return '<span class="text-zinc-400 dark:text-zinc-500 italic">null</span>';
|
|
448
|
+
}
|
|
449
|
+
if (typeof value === 'boolean') {
|
|
450
|
+
return \`<span class="px-2 py-0.5 rounded text-xs font-medium \${value ? 'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400' : 'bg-zinc-100 text-zinc-800 dark:bg-zinc-800 dark:text-zinc-400'}">\${value}</span>\`;
|
|
451
|
+
}
|
|
452
|
+
if (typeof value === 'object') {
|
|
453
|
+
return '<span class="text-xs font-mono text-zinc-600 dark:text-zinc-400">' + JSON.stringify(value).substring(0, 50) + (JSON.stringify(value).length > 50 ? '...' : '') + '</span>';
|
|
454
|
+
}
|
|
455
|
+
const str = String(value);
|
|
456
|
+
if (str.length > 100) {
|
|
457
|
+
return escapeHtml(str.substring(0, 100)) + '...';
|
|
458
|
+
}
|
|
459
|
+
return escapeHtml(str);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
function escapeHtml(text) {
|
|
463
|
+
const map = {
|
|
464
|
+
'&': '&',
|
|
465
|
+
'<': '<',
|
|
466
|
+
'>': '>',
|
|
467
|
+
'"': '"',
|
|
468
|
+
"'": '''
|
|
469
|
+
};
|
|
470
|
+
return String(text).replace(/[&<>"']/g, m => map[m]);
|
|
471
|
+
}
|
|
472
|
+
</script>
|
|
473
|
+
`;
|
|
474
|
+
const layoutData = {
|
|
475
|
+
title: `Table: ${data.tableName}`,
|
|
476
|
+
pageTitle: `Database: ${data.tableName}`,
|
|
477
|
+
currentPath: `/admin/database-tools/tables/${data.tableName}`,
|
|
478
|
+
user: data.user,
|
|
479
|
+
content: pageContent
|
|
480
|
+
};
|
|
481
|
+
return chunk3SPQ3J4N_cjs.renderAdminLayoutCatalyst(layoutData);
|
|
482
|
+
}
|
|
483
|
+
function generatePageNumbers(currentPage, totalPages) {
|
|
484
|
+
const pages = [];
|
|
485
|
+
const maxVisible = 7;
|
|
486
|
+
if (totalPages <= maxVisible) {
|
|
487
|
+
for (let i = 1; i <= totalPages; i++) {
|
|
488
|
+
pages.push(i);
|
|
489
|
+
}
|
|
490
|
+
} else {
|
|
491
|
+
if (currentPage <= 4) {
|
|
492
|
+
for (let i = 1; i <= 5; i++) pages.push(i);
|
|
493
|
+
pages.push(-1);
|
|
494
|
+
pages.push(totalPages);
|
|
495
|
+
} else if (currentPage >= totalPages - 3) {
|
|
496
|
+
pages.push(1);
|
|
497
|
+
pages.push(-1);
|
|
498
|
+
for (let i = totalPages - 4; i <= totalPages; i++) pages.push(i);
|
|
499
|
+
} else {
|
|
500
|
+
pages.push(1);
|
|
501
|
+
pages.push(-1);
|
|
502
|
+
for (let i = currentPage - 1; i <= currentPage + 1; i++) pages.push(i);
|
|
503
|
+
pages.push(-1);
|
|
504
|
+
pages.push(totalPages);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
return pages.map((page) => {
|
|
508
|
+
if (page === -1) {
|
|
509
|
+
return `
|
|
510
|
+
<span class="relative inline-flex items-center px-4 py-2 text-sm font-semibold text-zinc-700 dark:text-zinc-300 ring-1 ring-inset ring-zinc-300 dark:ring-zinc-700">
|
|
511
|
+
...
|
|
512
|
+
</span>
|
|
513
|
+
`;
|
|
514
|
+
}
|
|
515
|
+
const isActive = page === currentPage;
|
|
516
|
+
return `
|
|
517
|
+
<button
|
|
518
|
+
onclick="goToPage(${page})"
|
|
519
|
+
class="relative inline-flex items-center px-4 py-2 text-sm font-semibold ${isActive ? "z-10 bg-indigo-600 text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600" : "text-zinc-900 dark:text-zinc-100 ring-1 ring-inset ring-zinc-300 dark:ring-zinc-700 hover:bg-zinc-50 dark:hover:bg-zinc-800"}"
|
|
520
|
+
>
|
|
521
|
+
${page}
|
|
522
|
+
</button>
|
|
523
|
+
`;
|
|
524
|
+
}).join("");
|
|
525
|
+
}
|
|
526
|
+
function escapeHtml2(text) {
|
|
527
|
+
const map = {
|
|
528
|
+
"&": "&",
|
|
529
|
+
"<": "<",
|
|
530
|
+
">": ">",
|
|
531
|
+
'"': """,
|
|
532
|
+
"'": "'"
|
|
533
|
+
};
|
|
534
|
+
return String(text).replace(/[&<>"']/g, (m) => map[m] || m);
|
|
535
|
+
}
|
|
536
|
+
function formatCellValue(value) {
|
|
537
|
+
if (value === null || value === void 0) {
|
|
538
|
+
return '<span class="text-zinc-400 dark:text-zinc-500 italic">null</span>';
|
|
539
|
+
}
|
|
540
|
+
if (typeof value === "boolean") {
|
|
541
|
+
return `<span class="px-2 py-0.5 rounded text-xs font-medium ${value ? "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400" : "bg-zinc-100 text-zinc-800 dark:bg-zinc-800 dark:text-zinc-400"}">${value}</span>`;
|
|
542
|
+
}
|
|
543
|
+
if (typeof value === "object") {
|
|
544
|
+
return '<span class="text-xs font-mono text-zinc-600 dark:text-zinc-400">' + JSON.stringify(value).substring(0, 50) + (JSON.stringify(value).length > 50 ? "..." : "") + "</span>";
|
|
545
|
+
}
|
|
546
|
+
const str = String(value);
|
|
547
|
+
if (str.length > 100) {
|
|
548
|
+
return escapeHtml2(str.substring(0, 100)) + "...";
|
|
549
|
+
}
|
|
550
|
+
return escapeHtml2(str);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
// src/plugins/core-plugins/database-tools-plugin/admin-routes.ts
|
|
554
|
+
function createDatabaseToolsAdminRoutes() {
|
|
555
|
+
const router2 = new hono.Hono();
|
|
556
|
+
router2.use("*", chunkIM5SDXOE_cjs.requireAuth());
|
|
557
|
+
router2.get("/api/stats", async (c) => {
|
|
558
|
+
try {
|
|
559
|
+
const user = c.get("user");
|
|
560
|
+
if (!user || user.role !== "admin") {
|
|
561
|
+
return c.json({
|
|
562
|
+
success: false,
|
|
563
|
+
error: "Unauthorized. Admin access required."
|
|
564
|
+
}, 403);
|
|
565
|
+
}
|
|
566
|
+
const db = c.env.DB;
|
|
567
|
+
const service = new DatabaseToolsService(db);
|
|
568
|
+
const stats = await service.getDatabaseStats();
|
|
569
|
+
return c.json({
|
|
570
|
+
success: true,
|
|
571
|
+
data: stats
|
|
572
|
+
});
|
|
573
|
+
} catch (error) {
|
|
574
|
+
console.error("Error fetching database stats:", error);
|
|
575
|
+
return c.json({
|
|
576
|
+
success: false,
|
|
577
|
+
error: "Failed to fetch database statistics"
|
|
578
|
+
}, 500);
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
router2.post("/api/truncate", async (c) => {
|
|
582
|
+
try {
|
|
583
|
+
const user = c.get("user");
|
|
584
|
+
if (!user || user.role !== "admin") {
|
|
585
|
+
return c.json({
|
|
586
|
+
success: false,
|
|
587
|
+
error: "Unauthorized. Admin access required."
|
|
588
|
+
}, 403);
|
|
589
|
+
}
|
|
590
|
+
const body = await c.req.json();
|
|
591
|
+
const { confirmText } = body;
|
|
592
|
+
if (confirmText !== "TRUNCATE ALL DATA") {
|
|
593
|
+
return c.json({
|
|
594
|
+
success: false,
|
|
595
|
+
error: "Invalid confirmation text. Operation cancelled."
|
|
596
|
+
}, 400);
|
|
597
|
+
}
|
|
598
|
+
const db = c.env.DB;
|
|
599
|
+
const service = new DatabaseToolsService(db);
|
|
600
|
+
const result = await service.truncateAllData(user.email);
|
|
601
|
+
return c.json({
|
|
602
|
+
success: result.success,
|
|
603
|
+
message: result.message,
|
|
604
|
+
data: {
|
|
605
|
+
tablesCleared: result.tablesCleared,
|
|
606
|
+
adminUserPreserved: result.adminUserPreserved,
|
|
607
|
+
errors: result.errors
|
|
608
|
+
}
|
|
609
|
+
});
|
|
610
|
+
} catch (error) {
|
|
611
|
+
console.error("Error truncating database:", error);
|
|
612
|
+
return c.json({
|
|
613
|
+
success: false,
|
|
614
|
+
error: "Failed to truncate database"
|
|
615
|
+
}, 500);
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
router2.post("/api/backup", async (c) => {
|
|
619
|
+
try {
|
|
620
|
+
const user = c.get("user");
|
|
621
|
+
if (!user || user.role !== "admin") {
|
|
622
|
+
return c.json({
|
|
623
|
+
success: false,
|
|
624
|
+
error: "Unauthorized. Admin access required."
|
|
625
|
+
}, 403);
|
|
626
|
+
}
|
|
627
|
+
const db = c.env.DB;
|
|
628
|
+
const service = new DatabaseToolsService(db);
|
|
629
|
+
const result = await service.createBackup();
|
|
630
|
+
return c.json({
|
|
631
|
+
success: result.success,
|
|
632
|
+
message: result.message,
|
|
633
|
+
data: {
|
|
634
|
+
backupId: result.backupId
|
|
635
|
+
}
|
|
636
|
+
});
|
|
637
|
+
} catch (error) {
|
|
638
|
+
console.error("Error creating backup:", error);
|
|
639
|
+
return c.json({
|
|
640
|
+
success: false,
|
|
641
|
+
error: "Failed to create backup"
|
|
642
|
+
}, 500);
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
router2.get("/api/validate", async (c) => {
|
|
646
|
+
try {
|
|
647
|
+
const user = c.get("user");
|
|
648
|
+
if (!user || user.role !== "admin") {
|
|
649
|
+
return c.json({
|
|
650
|
+
success: false,
|
|
651
|
+
error: "Unauthorized. Admin access required."
|
|
652
|
+
}, 403);
|
|
653
|
+
}
|
|
654
|
+
const db = c.env.DB;
|
|
655
|
+
const service = new DatabaseToolsService(db);
|
|
656
|
+
const validation = await service.validateDatabase();
|
|
657
|
+
return c.json({
|
|
658
|
+
success: true,
|
|
659
|
+
data: validation
|
|
660
|
+
});
|
|
661
|
+
} catch (error) {
|
|
662
|
+
console.error("Error validating database:", error);
|
|
663
|
+
return c.json({
|
|
664
|
+
success: false,
|
|
665
|
+
error: "Failed to validate database"
|
|
666
|
+
}, 500);
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
router2.get("/api/tables/:tableName", async (c) => {
|
|
670
|
+
try {
|
|
671
|
+
const user = c.get("user");
|
|
672
|
+
if (!user || user.role !== "admin") {
|
|
673
|
+
return c.json({
|
|
674
|
+
success: false,
|
|
675
|
+
error: "Unauthorized. Admin access required."
|
|
676
|
+
}, 403);
|
|
677
|
+
}
|
|
678
|
+
const tableName = c.req.param("tableName");
|
|
679
|
+
const limit = parseInt(c.req.query("limit") || "100");
|
|
680
|
+
const offset = parseInt(c.req.query("offset") || "0");
|
|
681
|
+
const sortColumn = c.req.query("sort");
|
|
682
|
+
const sortDirection = c.req.query("dir") || "asc";
|
|
683
|
+
const db = c.env.DB;
|
|
684
|
+
const service = new DatabaseToolsService(db);
|
|
685
|
+
const tableData = await service.getTableData(tableName, limit, offset, sortColumn, sortDirection);
|
|
686
|
+
return c.json({
|
|
687
|
+
success: true,
|
|
688
|
+
data: tableData
|
|
689
|
+
});
|
|
690
|
+
} catch (error) {
|
|
691
|
+
console.error("Error fetching table data:", error);
|
|
692
|
+
return c.json({
|
|
693
|
+
success: false,
|
|
694
|
+
error: `Failed to fetch table data: ${error}`
|
|
695
|
+
}, 500);
|
|
696
|
+
}
|
|
697
|
+
});
|
|
698
|
+
router2.get("/tables/:tableName", async (c) => {
|
|
699
|
+
try {
|
|
700
|
+
const user = c.get("user");
|
|
701
|
+
if (!user || user.role !== "admin") {
|
|
702
|
+
return c.redirect("/admin/login");
|
|
703
|
+
}
|
|
704
|
+
const tableName = c.req.param("tableName");
|
|
705
|
+
const page = parseInt(c.req.query("page") || "1");
|
|
706
|
+
const pageSize = parseInt(c.req.query("pageSize") || "20");
|
|
707
|
+
const sortColumn = c.req.query("sort");
|
|
708
|
+
const sortDirection = c.req.query("dir") || "asc";
|
|
709
|
+
const offset = (page - 1) * pageSize;
|
|
710
|
+
const db = c.env.DB;
|
|
711
|
+
const service = new DatabaseToolsService(db);
|
|
712
|
+
const tableData = await service.getTableData(tableName, pageSize, offset, sortColumn, sortDirection);
|
|
713
|
+
const pageData = {
|
|
714
|
+
user: {
|
|
715
|
+
name: user.email.split("@")[0] || "Unknown",
|
|
716
|
+
email: user.email,
|
|
717
|
+
role: user.role
|
|
718
|
+
},
|
|
719
|
+
tableName: tableData.tableName,
|
|
720
|
+
columns: tableData.columns,
|
|
721
|
+
rows: tableData.rows,
|
|
722
|
+
totalRows: tableData.totalRows,
|
|
723
|
+
currentPage: page,
|
|
724
|
+
pageSize,
|
|
725
|
+
sortColumn,
|
|
726
|
+
sortDirection
|
|
727
|
+
};
|
|
728
|
+
return c.html(renderDatabaseTablePage(pageData));
|
|
729
|
+
} catch (error) {
|
|
730
|
+
console.error("Error rendering table page:", error);
|
|
731
|
+
return c.text(`Error: ${error}`, 500);
|
|
732
|
+
}
|
|
733
|
+
});
|
|
734
|
+
return router2;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
// src/app.ts
|
|
17
738
|
function createSonicJSApp(config = {}) {
|
|
18
739
|
const app = new hono.Hono();
|
|
19
|
-
const appVersion = config.version ||
|
|
740
|
+
const appVersion = config.version || chunkTRSHFTF6_cjs.getCoreVersion();
|
|
20
741
|
const appName = config.name || "SonicJS AI";
|
|
21
742
|
app.use("*", async (c, next) => {
|
|
22
743
|
c.set("appVersion", appVersion);
|
|
23
744
|
await next();
|
|
24
745
|
});
|
|
25
|
-
app.use("*",
|
|
26
|
-
app.use("*",
|
|
746
|
+
app.use("*", chunkIM5SDXOE_cjs.metricsMiddleware());
|
|
747
|
+
app.use("*", chunkIM5SDXOE_cjs.bootstrapMiddleware());
|
|
27
748
|
if (config.middleware?.beforeAuth) {
|
|
28
749
|
for (const middleware of config.middleware.beforeAuth) {
|
|
29
750
|
app.use("*", middleware);
|
|
@@ -40,19 +761,47 @@ function createSonicJSApp(config = {}) {
|
|
|
40
761
|
app.use("*", middleware);
|
|
41
762
|
}
|
|
42
763
|
}
|
|
43
|
-
app.route("/api",
|
|
44
|
-
app.route("/api/media",
|
|
45
|
-
app.route("/api/system",
|
|
46
|
-
app.route("/admin/api",
|
|
47
|
-
app.route("/admin/dashboard",
|
|
48
|
-
app.route("/admin/collections",
|
|
49
|
-
app.route("/admin/settings",
|
|
50
|
-
app.route("/admin/
|
|
51
|
-
app.route("/admin/
|
|
52
|
-
app.route("/admin/
|
|
53
|
-
app.route("/admin/
|
|
54
|
-
app.route("/admin",
|
|
55
|
-
app.route("/
|
|
764
|
+
app.route("/api", chunkNPWWR6RI_cjs.api_default);
|
|
765
|
+
app.route("/api/media", chunkNPWWR6RI_cjs.api_media_default);
|
|
766
|
+
app.route("/api/system", chunkNPWWR6RI_cjs.api_system_default);
|
|
767
|
+
app.route("/admin/api", chunkNPWWR6RI_cjs.admin_api_default);
|
|
768
|
+
app.route("/admin/dashboard", chunkNPWWR6RI_cjs.router);
|
|
769
|
+
app.route("/admin/collections", chunkNPWWR6RI_cjs.adminCollectionsRoutes);
|
|
770
|
+
app.route("/admin/settings", chunkNPWWR6RI_cjs.adminSettingsRoutes);
|
|
771
|
+
app.route("/admin/database-tools", createDatabaseToolsAdminRoutes());
|
|
772
|
+
app.route("/admin/content", chunkNPWWR6RI_cjs.admin_content_default);
|
|
773
|
+
app.route("/admin/media", chunkNPWWR6RI_cjs.adminMediaRoutes);
|
|
774
|
+
app.route("/admin/plugins", chunkNPWWR6RI_cjs.adminPluginRoutes);
|
|
775
|
+
app.route("/admin/logs", chunkNPWWR6RI_cjs.adminLogsRoutes);
|
|
776
|
+
app.route("/admin", chunkNPWWR6RI_cjs.userRoutes);
|
|
777
|
+
app.route("/auth", chunkNPWWR6RI_cjs.auth_default);
|
|
778
|
+
app.get("/files/*", async (c) => {
|
|
779
|
+
try {
|
|
780
|
+
const url = new URL(c.req.url);
|
|
781
|
+
const pathname = url.pathname;
|
|
782
|
+
const objectKey = pathname.replace(/^\/files\//, "");
|
|
783
|
+
if (!objectKey) {
|
|
784
|
+
return c.notFound();
|
|
785
|
+
}
|
|
786
|
+
const object = await c.env.MEDIA_BUCKET.get(objectKey);
|
|
787
|
+
if (!object) {
|
|
788
|
+
return c.notFound();
|
|
789
|
+
}
|
|
790
|
+
const headers = new Headers();
|
|
791
|
+
object.httpMetadata?.contentType && headers.set("Content-Type", object.httpMetadata.contentType);
|
|
792
|
+
object.httpMetadata?.contentDisposition && headers.set("Content-Disposition", object.httpMetadata.contentDisposition);
|
|
793
|
+
headers.set("Cache-Control", "public, max-age=31536000");
|
|
794
|
+
headers.set("Access-Control-Allow-Origin", "*");
|
|
795
|
+
headers.set("Access-Control-Allow-Methods", "GET, HEAD, OPTIONS");
|
|
796
|
+
headers.set("Access-Control-Allow-Headers", "Content-Type");
|
|
797
|
+
return new Response(object.body, {
|
|
798
|
+
headers
|
|
799
|
+
});
|
|
800
|
+
} catch (error) {
|
|
801
|
+
console.error("Error serving file:", error);
|
|
802
|
+
return c.notFound();
|
|
803
|
+
}
|
|
804
|
+
});
|
|
56
805
|
if (config.routes) {
|
|
57
806
|
for (const route of config.routes) {
|
|
58
807
|
app.route(route.path, route.handler);
|
|
@@ -85,391 +834,387 @@ function setupCoreRoutes(_app) {
|
|
|
85
834
|
console.warn("setupCoreRoutes is deprecated. Use createSonicJSApp() instead.");
|
|
86
835
|
}
|
|
87
836
|
function createDb(d1$1) {
|
|
88
|
-
return d1.drizzle(d1$1, { schema:
|
|
837
|
+
return d1.drizzle(d1$1, { schema: chunkDOR2IU73_cjs.schema_exports });
|
|
89
838
|
}
|
|
90
839
|
|
|
91
|
-
// package.json
|
|
92
|
-
var package_default = {
|
|
93
|
-
version: "2.0.3"};
|
|
94
|
-
|
|
95
840
|
// src/index.ts
|
|
96
|
-
var VERSION = package_default.version;
|
|
841
|
+
var VERSION = chunkTRSHFTF6_cjs.package_default.version;
|
|
97
842
|
|
|
98
843
|
Object.defineProperty(exports, "ROUTES_INFO", {
|
|
99
844
|
enumerable: true,
|
|
100
|
-
get: function () { return
|
|
845
|
+
get: function () { return chunkNPWWR6RI_cjs.ROUTES_INFO; }
|
|
101
846
|
});
|
|
102
847
|
Object.defineProperty(exports, "adminApiRoutes", {
|
|
103
848
|
enumerable: true,
|
|
104
|
-
get: function () { return
|
|
849
|
+
get: function () { return chunkNPWWR6RI_cjs.admin_api_default; }
|
|
105
850
|
});
|
|
106
851
|
Object.defineProperty(exports, "adminCheckboxRoutes", {
|
|
107
852
|
enumerable: true,
|
|
108
|
-
get: function () { return
|
|
853
|
+
get: function () { return chunkNPWWR6RI_cjs.adminCheckboxRoutes; }
|
|
109
854
|
});
|
|
110
855
|
Object.defineProperty(exports, "adminCodeExamplesRoutes", {
|
|
111
856
|
enumerable: true,
|
|
112
|
-
get: function () { return
|
|
857
|
+
get: function () { return chunkNPWWR6RI_cjs.admin_code_examples_default; }
|
|
113
858
|
});
|
|
114
859
|
Object.defineProperty(exports, "adminCollectionsRoutes", {
|
|
115
860
|
enumerable: true,
|
|
116
|
-
get: function () { return
|
|
861
|
+
get: function () { return chunkNPWWR6RI_cjs.adminCollectionsRoutes; }
|
|
117
862
|
});
|
|
118
863
|
Object.defineProperty(exports, "adminContentRoutes", {
|
|
119
864
|
enumerable: true,
|
|
120
|
-
get: function () { return
|
|
865
|
+
get: function () { return chunkNPWWR6RI_cjs.admin_content_default; }
|
|
121
866
|
});
|
|
122
867
|
Object.defineProperty(exports, "adminDashboardRoutes", {
|
|
123
868
|
enumerable: true,
|
|
124
|
-
get: function () { return
|
|
869
|
+
get: function () { return chunkNPWWR6RI_cjs.router; }
|
|
125
870
|
});
|
|
126
871
|
Object.defineProperty(exports, "adminDesignRoutes", {
|
|
127
872
|
enumerable: true,
|
|
128
|
-
get: function () { return
|
|
873
|
+
get: function () { return chunkNPWWR6RI_cjs.adminDesignRoutes; }
|
|
129
874
|
});
|
|
130
875
|
Object.defineProperty(exports, "adminFAQRoutes", {
|
|
131
876
|
enumerable: true,
|
|
132
|
-
get: function () { return
|
|
877
|
+
get: function () { return chunkNPWWR6RI_cjs.admin_faq_default; }
|
|
133
878
|
});
|
|
134
879
|
Object.defineProperty(exports, "adminLogsRoutes", {
|
|
135
880
|
enumerable: true,
|
|
136
|
-
get: function () { return
|
|
881
|
+
get: function () { return chunkNPWWR6RI_cjs.adminLogsRoutes; }
|
|
137
882
|
});
|
|
138
883
|
Object.defineProperty(exports, "adminMediaRoutes", {
|
|
139
884
|
enumerable: true,
|
|
140
|
-
get: function () { return
|
|
885
|
+
get: function () { return chunkNPWWR6RI_cjs.adminMediaRoutes; }
|
|
141
886
|
});
|
|
142
887
|
Object.defineProperty(exports, "adminPluginRoutes", {
|
|
143
888
|
enumerable: true,
|
|
144
|
-
get: function () { return
|
|
889
|
+
get: function () { return chunkNPWWR6RI_cjs.adminPluginRoutes; }
|
|
145
890
|
});
|
|
146
891
|
Object.defineProperty(exports, "adminSettingsRoutes", {
|
|
147
892
|
enumerable: true,
|
|
148
|
-
get: function () { return
|
|
893
|
+
get: function () { return chunkNPWWR6RI_cjs.adminSettingsRoutes; }
|
|
149
894
|
});
|
|
150
895
|
Object.defineProperty(exports, "adminTestimonialsRoutes", {
|
|
151
896
|
enumerable: true,
|
|
152
|
-
get: function () { return
|
|
897
|
+
get: function () { return chunkNPWWR6RI_cjs.admin_testimonials_default; }
|
|
153
898
|
});
|
|
154
899
|
Object.defineProperty(exports, "adminUsersRoutes", {
|
|
155
900
|
enumerable: true,
|
|
156
|
-
get: function () { return
|
|
901
|
+
get: function () { return chunkNPWWR6RI_cjs.userRoutes; }
|
|
157
902
|
});
|
|
158
903
|
Object.defineProperty(exports, "apiContentCrudRoutes", {
|
|
159
904
|
enumerable: true,
|
|
160
|
-
get: function () { return
|
|
905
|
+
get: function () { return chunkNPWWR6RI_cjs.api_content_crud_default; }
|
|
161
906
|
});
|
|
162
907
|
Object.defineProperty(exports, "apiMediaRoutes", {
|
|
163
908
|
enumerable: true,
|
|
164
|
-
get: function () { return
|
|
909
|
+
get: function () { return chunkNPWWR6RI_cjs.api_media_default; }
|
|
165
910
|
});
|
|
166
911
|
Object.defineProperty(exports, "apiRoutes", {
|
|
167
912
|
enumerable: true,
|
|
168
|
-
get: function () { return
|
|
913
|
+
get: function () { return chunkNPWWR6RI_cjs.api_default; }
|
|
169
914
|
});
|
|
170
915
|
Object.defineProperty(exports, "apiSystemRoutes", {
|
|
171
916
|
enumerable: true,
|
|
172
|
-
get: function () { return
|
|
917
|
+
get: function () { return chunkNPWWR6RI_cjs.api_system_default; }
|
|
173
918
|
});
|
|
174
919
|
Object.defineProperty(exports, "authRoutes", {
|
|
175
920
|
enumerable: true,
|
|
176
|
-
get: function () { return
|
|
921
|
+
get: function () { return chunkNPWWR6RI_cjs.auth_default; }
|
|
177
922
|
});
|
|
178
923
|
Object.defineProperty(exports, "Logger", {
|
|
179
924
|
enumerable: true,
|
|
180
|
-
get: function () { return
|
|
925
|
+
get: function () { return chunkDOR2IU73_cjs.Logger; }
|
|
181
926
|
});
|
|
182
927
|
Object.defineProperty(exports, "apiTokens", {
|
|
183
928
|
enumerable: true,
|
|
184
|
-
get: function () { return
|
|
929
|
+
get: function () { return chunkDOR2IU73_cjs.apiTokens; }
|
|
185
930
|
});
|
|
186
931
|
Object.defineProperty(exports, "collections", {
|
|
187
932
|
enumerable: true,
|
|
188
|
-
get: function () { return
|
|
933
|
+
get: function () { return chunkDOR2IU73_cjs.collections; }
|
|
189
934
|
});
|
|
190
935
|
Object.defineProperty(exports, "content", {
|
|
191
936
|
enumerable: true,
|
|
192
|
-
get: function () { return
|
|
937
|
+
get: function () { return chunkDOR2IU73_cjs.content; }
|
|
193
938
|
});
|
|
194
939
|
Object.defineProperty(exports, "contentVersions", {
|
|
195
940
|
enumerable: true,
|
|
196
|
-
get: function () { return
|
|
941
|
+
get: function () { return chunkDOR2IU73_cjs.contentVersions; }
|
|
197
942
|
});
|
|
198
943
|
Object.defineProperty(exports, "getLogger", {
|
|
199
944
|
enumerable: true,
|
|
200
|
-
get: function () { return
|
|
945
|
+
get: function () { return chunkDOR2IU73_cjs.getLogger; }
|
|
201
946
|
});
|
|
202
947
|
Object.defineProperty(exports, "initLogger", {
|
|
203
948
|
enumerable: true,
|
|
204
|
-
get: function () { return
|
|
949
|
+
get: function () { return chunkDOR2IU73_cjs.initLogger; }
|
|
205
950
|
});
|
|
206
951
|
Object.defineProperty(exports, "insertCollectionSchema", {
|
|
207
952
|
enumerable: true,
|
|
208
|
-
get: function () { return
|
|
953
|
+
get: function () { return chunkDOR2IU73_cjs.insertCollectionSchema; }
|
|
209
954
|
});
|
|
210
955
|
Object.defineProperty(exports, "insertContentSchema", {
|
|
211
956
|
enumerable: true,
|
|
212
|
-
get: function () { return
|
|
957
|
+
get: function () { return chunkDOR2IU73_cjs.insertContentSchema; }
|
|
213
958
|
});
|
|
214
959
|
Object.defineProperty(exports, "insertLogConfigSchema", {
|
|
215
960
|
enumerable: true,
|
|
216
|
-
get: function () { return
|
|
961
|
+
get: function () { return chunkDOR2IU73_cjs.insertLogConfigSchema; }
|
|
217
962
|
});
|
|
218
963
|
Object.defineProperty(exports, "insertMediaSchema", {
|
|
219
964
|
enumerable: true,
|
|
220
|
-
get: function () { return
|
|
965
|
+
get: function () { return chunkDOR2IU73_cjs.insertMediaSchema; }
|
|
221
966
|
});
|
|
222
967
|
Object.defineProperty(exports, "insertPluginActivityLogSchema", {
|
|
223
968
|
enumerable: true,
|
|
224
|
-
get: function () { return
|
|
969
|
+
get: function () { return chunkDOR2IU73_cjs.insertPluginActivityLogSchema; }
|
|
225
970
|
});
|
|
226
971
|
Object.defineProperty(exports, "insertPluginAssetSchema", {
|
|
227
972
|
enumerable: true,
|
|
228
|
-
get: function () { return
|
|
973
|
+
get: function () { return chunkDOR2IU73_cjs.insertPluginAssetSchema; }
|
|
229
974
|
});
|
|
230
975
|
Object.defineProperty(exports, "insertPluginHookSchema", {
|
|
231
976
|
enumerable: true,
|
|
232
|
-
get: function () { return
|
|
977
|
+
get: function () { return chunkDOR2IU73_cjs.insertPluginHookSchema; }
|
|
233
978
|
});
|
|
234
979
|
Object.defineProperty(exports, "insertPluginRouteSchema", {
|
|
235
980
|
enumerable: true,
|
|
236
|
-
get: function () { return
|
|
981
|
+
get: function () { return chunkDOR2IU73_cjs.insertPluginRouteSchema; }
|
|
237
982
|
});
|
|
238
983
|
Object.defineProperty(exports, "insertPluginSchema", {
|
|
239
984
|
enumerable: true,
|
|
240
|
-
get: function () { return
|
|
985
|
+
get: function () { return chunkDOR2IU73_cjs.insertPluginSchema; }
|
|
241
986
|
});
|
|
242
987
|
Object.defineProperty(exports, "insertSystemLogSchema", {
|
|
243
988
|
enumerable: true,
|
|
244
|
-
get: function () { return
|
|
989
|
+
get: function () { return chunkDOR2IU73_cjs.insertSystemLogSchema; }
|
|
245
990
|
});
|
|
246
991
|
Object.defineProperty(exports, "insertUserSchema", {
|
|
247
992
|
enumerable: true,
|
|
248
|
-
get: function () { return
|
|
993
|
+
get: function () { return chunkDOR2IU73_cjs.insertUserSchema; }
|
|
249
994
|
});
|
|
250
995
|
Object.defineProperty(exports, "insertWorkflowHistorySchema", {
|
|
251
996
|
enumerable: true,
|
|
252
|
-
get: function () { return
|
|
997
|
+
get: function () { return chunkDOR2IU73_cjs.insertWorkflowHistorySchema; }
|
|
253
998
|
});
|
|
254
999
|
Object.defineProperty(exports, "logConfig", {
|
|
255
1000
|
enumerable: true,
|
|
256
|
-
get: function () { return
|
|
1001
|
+
get: function () { return chunkDOR2IU73_cjs.logConfig; }
|
|
257
1002
|
});
|
|
258
1003
|
Object.defineProperty(exports, "media", {
|
|
259
1004
|
enumerable: true,
|
|
260
|
-
get: function () { return
|
|
1005
|
+
get: function () { return chunkDOR2IU73_cjs.media; }
|
|
261
1006
|
});
|
|
262
1007
|
Object.defineProperty(exports, "pluginActivityLog", {
|
|
263
1008
|
enumerable: true,
|
|
264
|
-
get: function () { return
|
|
1009
|
+
get: function () { return chunkDOR2IU73_cjs.pluginActivityLog; }
|
|
265
1010
|
});
|
|
266
1011
|
Object.defineProperty(exports, "pluginAssets", {
|
|
267
1012
|
enumerable: true,
|
|
268
|
-
get: function () { return
|
|
1013
|
+
get: function () { return chunkDOR2IU73_cjs.pluginAssets; }
|
|
269
1014
|
});
|
|
270
1015
|
Object.defineProperty(exports, "pluginHooks", {
|
|
271
1016
|
enumerable: true,
|
|
272
|
-
get: function () { return
|
|
1017
|
+
get: function () { return chunkDOR2IU73_cjs.pluginHooks; }
|
|
273
1018
|
});
|
|
274
1019
|
Object.defineProperty(exports, "pluginRoutes", {
|
|
275
1020
|
enumerable: true,
|
|
276
|
-
get: function () { return
|
|
1021
|
+
get: function () { return chunkDOR2IU73_cjs.pluginRoutes; }
|
|
277
1022
|
});
|
|
278
1023
|
Object.defineProperty(exports, "plugins", {
|
|
279
1024
|
enumerable: true,
|
|
280
|
-
get: function () { return
|
|
1025
|
+
get: function () { return chunkDOR2IU73_cjs.plugins; }
|
|
281
1026
|
});
|
|
282
1027
|
Object.defineProperty(exports, "selectCollectionSchema", {
|
|
283
1028
|
enumerable: true,
|
|
284
|
-
get: function () { return
|
|
1029
|
+
get: function () { return chunkDOR2IU73_cjs.selectCollectionSchema; }
|
|
285
1030
|
});
|
|
286
1031
|
Object.defineProperty(exports, "selectContentSchema", {
|
|
287
1032
|
enumerable: true,
|
|
288
|
-
get: function () { return
|
|
1033
|
+
get: function () { return chunkDOR2IU73_cjs.selectContentSchema; }
|
|
289
1034
|
});
|
|
290
1035
|
Object.defineProperty(exports, "selectLogConfigSchema", {
|
|
291
1036
|
enumerable: true,
|
|
292
|
-
get: function () { return
|
|
1037
|
+
get: function () { return chunkDOR2IU73_cjs.selectLogConfigSchema; }
|
|
293
1038
|
});
|
|
294
1039
|
Object.defineProperty(exports, "selectMediaSchema", {
|
|
295
1040
|
enumerable: true,
|
|
296
|
-
get: function () { return
|
|
1041
|
+
get: function () { return chunkDOR2IU73_cjs.selectMediaSchema; }
|
|
297
1042
|
});
|
|
298
1043
|
Object.defineProperty(exports, "selectPluginActivityLogSchema", {
|
|
299
1044
|
enumerable: true,
|
|
300
|
-
get: function () { return
|
|
1045
|
+
get: function () { return chunkDOR2IU73_cjs.selectPluginActivityLogSchema; }
|
|
301
1046
|
});
|
|
302
1047
|
Object.defineProperty(exports, "selectPluginAssetSchema", {
|
|
303
1048
|
enumerable: true,
|
|
304
|
-
get: function () { return
|
|
1049
|
+
get: function () { return chunkDOR2IU73_cjs.selectPluginAssetSchema; }
|
|
305
1050
|
});
|
|
306
1051
|
Object.defineProperty(exports, "selectPluginHookSchema", {
|
|
307
1052
|
enumerable: true,
|
|
308
|
-
get: function () { return
|
|
1053
|
+
get: function () { return chunkDOR2IU73_cjs.selectPluginHookSchema; }
|
|
309
1054
|
});
|
|
310
1055
|
Object.defineProperty(exports, "selectPluginRouteSchema", {
|
|
311
1056
|
enumerable: true,
|
|
312
|
-
get: function () { return
|
|
1057
|
+
get: function () { return chunkDOR2IU73_cjs.selectPluginRouteSchema; }
|
|
313
1058
|
});
|
|
314
1059
|
Object.defineProperty(exports, "selectPluginSchema", {
|
|
315
1060
|
enumerable: true,
|
|
316
|
-
get: function () { return
|
|
1061
|
+
get: function () { return chunkDOR2IU73_cjs.selectPluginSchema; }
|
|
317
1062
|
});
|
|
318
1063
|
Object.defineProperty(exports, "selectSystemLogSchema", {
|
|
319
1064
|
enumerable: true,
|
|
320
|
-
get: function () { return
|
|
1065
|
+
get: function () { return chunkDOR2IU73_cjs.selectSystemLogSchema; }
|
|
321
1066
|
});
|
|
322
1067
|
Object.defineProperty(exports, "selectUserSchema", {
|
|
323
1068
|
enumerable: true,
|
|
324
|
-
get: function () { return
|
|
1069
|
+
get: function () { return chunkDOR2IU73_cjs.selectUserSchema; }
|
|
325
1070
|
});
|
|
326
1071
|
Object.defineProperty(exports, "selectWorkflowHistorySchema", {
|
|
327
1072
|
enumerable: true,
|
|
328
|
-
get: function () { return
|
|
1073
|
+
get: function () { return chunkDOR2IU73_cjs.selectWorkflowHistorySchema; }
|
|
329
1074
|
});
|
|
330
1075
|
Object.defineProperty(exports, "systemLogs", {
|
|
331
1076
|
enumerable: true,
|
|
332
|
-
get: function () { return
|
|
1077
|
+
get: function () { return chunkDOR2IU73_cjs.systemLogs; }
|
|
333
1078
|
});
|
|
334
1079
|
Object.defineProperty(exports, "users", {
|
|
335
1080
|
enumerable: true,
|
|
336
|
-
get: function () { return
|
|
1081
|
+
get: function () { return chunkDOR2IU73_cjs.users; }
|
|
337
1082
|
});
|
|
338
1083
|
Object.defineProperty(exports, "workflowHistory", {
|
|
339
1084
|
enumerable: true,
|
|
340
|
-
get: function () { return
|
|
1085
|
+
get: function () { return chunkDOR2IU73_cjs.workflowHistory; }
|
|
341
1086
|
});
|
|
342
1087
|
Object.defineProperty(exports, "AuthManager", {
|
|
343
1088
|
enumerable: true,
|
|
344
|
-
get: function () { return
|
|
1089
|
+
get: function () { return chunkIM5SDXOE_cjs.AuthManager; }
|
|
345
1090
|
});
|
|
346
1091
|
Object.defineProperty(exports, "PermissionManager", {
|
|
347
1092
|
enumerable: true,
|
|
348
|
-
get: function () { return
|
|
1093
|
+
get: function () { return chunkIM5SDXOE_cjs.PermissionManager; }
|
|
349
1094
|
});
|
|
350
1095
|
Object.defineProperty(exports, "bootstrapMiddleware", {
|
|
351
1096
|
enumerable: true,
|
|
352
|
-
get: function () { return
|
|
1097
|
+
get: function () { return chunkIM5SDXOE_cjs.bootstrapMiddleware; }
|
|
353
1098
|
});
|
|
354
1099
|
Object.defineProperty(exports, "cacheHeaders", {
|
|
355
1100
|
enumerable: true,
|
|
356
|
-
get: function () { return
|
|
1101
|
+
get: function () { return chunkIM5SDXOE_cjs.cacheHeaders; }
|
|
357
1102
|
});
|
|
358
1103
|
Object.defineProperty(exports, "compressionMiddleware", {
|
|
359
1104
|
enumerable: true,
|
|
360
|
-
get: function () { return
|
|
1105
|
+
get: function () { return chunkIM5SDXOE_cjs.compressionMiddleware; }
|
|
361
1106
|
});
|
|
362
1107
|
Object.defineProperty(exports, "detailedLoggingMiddleware", {
|
|
363
1108
|
enumerable: true,
|
|
364
|
-
get: function () { return
|
|
1109
|
+
get: function () { return chunkIM5SDXOE_cjs.detailedLoggingMiddleware; }
|
|
365
1110
|
});
|
|
366
1111
|
Object.defineProperty(exports, "getActivePlugins", {
|
|
367
1112
|
enumerable: true,
|
|
368
|
-
get: function () { return
|
|
1113
|
+
get: function () { return chunkIM5SDXOE_cjs.getActivePlugins; }
|
|
369
1114
|
});
|
|
370
1115
|
Object.defineProperty(exports, "isPluginActive", {
|
|
371
1116
|
enumerable: true,
|
|
372
|
-
get: function () { return
|
|
1117
|
+
get: function () { return chunkIM5SDXOE_cjs.isPluginActive; }
|
|
373
1118
|
});
|
|
374
1119
|
Object.defineProperty(exports, "logActivity", {
|
|
375
1120
|
enumerable: true,
|
|
376
|
-
get: function () { return
|
|
1121
|
+
get: function () { return chunkIM5SDXOE_cjs.logActivity; }
|
|
377
1122
|
});
|
|
378
1123
|
Object.defineProperty(exports, "loggingMiddleware", {
|
|
379
1124
|
enumerable: true,
|
|
380
|
-
get: function () { return
|
|
1125
|
+
get: function () { return chunkIM5SDXOE_cjs.loggingMiddleware; }
|
|
381
1126
|
});
|
|
382
1127
|
Object.defineProperty(exports, "optionalAuth", {
|
|
383
1128
|
enumerable: true,
|
|
384
|
-
get: function () { return
|
|
1129
|
+
get: function () { return chunkIM5SDXOE_cjs.optionalAuth; }
|
|
385
1130
|
});
|
|
386
1131
|
Object.defineProperty(exports, "performanceLoggingMiddleware", {
|
|
387
1132
|
enumerable: true,
|
|
388
|
-
get: function () { return
|
|
1133
|
+
get: function () { return chunkIM5SDXOE_cjs.performanceLoggingMiddleware; }
|
|
389
1134
|
});
|
|
390
1135
|
Object.defineProperty(exports, "requireActivePlugin", {
|
|
391
1136
|
enumerable: true,
|
|
392
|
-
get: function () { return
|
|
1137
|
+
get: function () { return chunkIM5SDXOE_cjs.requireActivePlugin; }
|
|
393
1138
|
});
|
|
394
1139
|
Object.defineProperty(exports, "requireActivePlugins", {
|
|
395
1140
|
enumerable: true,
|
|
396
|
-
get: function () { return
|
|
1141
|
+
get: function () { return chunkIM5SDXOE_cjs.requireActivePlugins; }
|
|
397
1142
|
});
|
|
398
1143
|
Object.defineProperty(exports, "requireAnyPermission", {
|
|
399
1144
|
enumerable: true,
|
|
400
|
-
get: function () { return
|
|
1145
|
+
get: function () { return chunkIM5SDXOE_cjs.requireAnyPermission; }
|
|
401
1146
|
});
|
|
402
1147
|
Object.defineProperty(exports, "requireAuth", {
|
|
403
1148
|
enumerable: true,
|
|
404
|
-
get: function () { return
|
|
1149
|
+
get: function () { return chunkIM5SDXOE_cjs.requireAuth; }
|
|
405
1150
|
});
|
|
406
1151
|
Object.defineProperty(exports, "requirePermission", {
|
|
407
1152
|
enumerable: true,
|
|
408
|
-
get: function () { return
|
|
1153
|
+
get: function () { return chunkIM5SDXOE_cjs.requirePermission; }
|
|
409
1154
|
});
|
|
410
1155
|
Object.defineProperty(exports, "requireRole", {
|
|
411
1156
|
enumerable: true,
|
|
412
|
-
get: function () { return
|
|
1157
|
+
get: function () { return chunkIM5SDXOE_cjs.requireRole; }
|
|
413
1158
|
});
|
|
414
1159
|
Object.defineProperty(exports, "securityHeaders", {
|
|
415
1160
|
enumerable: true,
|
|
416
|
-
get: function () { return
|
|
1161
|
+
get: function () { return chunkIM5SDXOE_cjs.securityHeaders; }
|
|
417
1162
|
});
|
|
418
1163
|
Object.defineProperty(exports, "securityLoggingMiddleware", {
|
|
419
1164
|
enumerable: true,
|
|
420
|
-
get: function () { return
|
|
1165
|
+
get: function () { return chunkIM5SDXOE_cjs.securityLoggingMiddleware; }
|
|
421
1166
|
});
|
|
422
1167
|
Object.defineProperty(exports, "MigrationService", {
|
|
423
1168
|
enumerable: true,
|
|
424
|
-
get: function () { return
|
|
1169
|
+
get: function () { return chunk3JMOWGUU_cjs.MigrationService; }
|
|
425
1170
|
});
|
|
426
1171
|
Object.defineProperty(exports, "PluginBootstrapService", {
|
|
427
1172
|
enumerable: true,
|
|
428
|
-
get: function () { return
|
|
1173
|
+
get: function () { return chunk3JMOWGUU_cjs.PluginBootstrapService; }
|
|
429
1174
|
});
|
|
430
1175
|
Object.defineProperty(exports, "PluginServiceClass", {
|
|
431
1176
|
enumerable: true,
|
|
432
|
-
get: function () { return
|
|
1177
|
+
get: function () { return chunk3JMOWGUU_cjs.PluginService; }
|
|
433
1178
|
});
|
|
434
1179
|
Object.defineProperty(exports, "cleanupRemovedCollections", {
|
|
435
1180
|
enumerable: true,
|
|
436
|
-
get: function () { return
|
|
1181
|
+
get: function () { return chunk3JMOWGUU_cjs.cleanupRemovedCollections; }
|
|
437
1182
|
});
|
|
438
1183
|
Object.defineProperty(exports, "fullCollectionSync", {
|
|
439
1184
|
enumerable: true,
|
|
440
|
-
get: function () { return
|
|
1185
|
+
get: function () { return chunk3JMOWGUU_cjs.fullCollectionSync; }
|
|
441
1186
|
});
|
|
442
1187
|
Object.defineProperty(exports, "getAvailableCollectionNames", {
|
|
443
1188
|
enumerable: true,
|
|
444
|
-
get: function () { return
|
|
1189
|
+
get: function () { return chunk3JMOWGUU_cjs.getAvailableCollectionNames; }
|
|
445
1190
|
});
|
|
446
1191
|
Object.defineProperty(exports, "getManagedCollections", {
|
|
447
1192
|
enumerable: true,
|
|
448
|
-
get: function () { return
|
|
1193
|
+
get: function () { return chunk3JMOWGUU_cjs.getManagedCollections; }
|
|
449
1194
|
});
|
|
450
1195
|
Object.defineProperty(exports, "isCollectionManaged", {
|
|
451
1196
|
enumerable: true,
|
|
452
|
-
get: function () { return
|
|
1197
|
+
get: function () { return chunk3JMOWGUU_cjs.isCollectionManaged; }
|
|
453
1198
|
});
|
|
454
1199
|
Object.defineProperty(exports, "loadCollectionConfig", {
|
|
455
1200
|
enumerable: true,
|
|
456
|
-
get: function () { return
|
|
1201
|
+
get: function () { return chunk3JMOWGUU_cjs.loadCollectionConfig; }
|
|
457
1202
|
});
|
|
458
1203
|
Object.defineProperty(exports, "loadCollectionConfigs", {
|
|
459
1204
|
enumerable: true,
|
|
460
|
-
get: function () { return
|
|
1205
|
+
get: function () { return chunk3JMOWGUU_cjs.loadCollectionConfigs; }
|
|
461
1206
|
});
|
|
462
1207
|
Object.defineProperty(exports, "syncCollection", {
|
|
463
1208
|
enumerable: true,
|
|
464
|
-
get: function () { return
|
|
1209
|
+
get: function () { return chunk3JMOWGUU_cjs.syncCollection; }
|
|
465
1210
|
});
|
|
466
1211
|
Object.defineProperty(exports, "syncCollections", {
|
|
467
1212
|
enumerable: true,
|
|
468
|
-
get: function () { return
|
|
1213
|
+
get: function () { return chunk3JMOWGUU_cjs.syncCollections; }
|
|
469
1214
|
});
|
|
470
1215
|
Object.defineProperty(exports, "validateCollectionConfig", {
|
|
471
1216
|
enumerable: true,
|
|
472
|
-
get: function () { return
|
|
1217
|
+
get: function () { return chunk3JMOWGUU_cjs.validateCollectionConfig; }
|
|
473
1218
|
});
|
|
474
1219
|
Object.defineProperty(exports, "renderFilterBar", {
|
|
475
1220
|
enumerable: true,
|
|
@@ -529,43 +1274,43 @@ Object.defineProperty(exports, "ScopedHookSystemClass", {
|
|
|
529
1274
|
});
|
|
530
1275
|
Object.defineProperty(exports, "QueryFilterBuilder", {
|
|
531
1276
|
enumerable: true,
|
|
532
|
-
get: function () { return
|
|
1277
|
+
get: function () { return chunkTRSHFTF6_cjs.QueryFilterBuilder; }
|
|
533
1278
|
});
|
|
534
1279
|
Object.defineProperty(exports, "SONICJS_VERSION", {
|
|
535
1280
|
enumerable: true,
|
|
536
|
-
get: function () { return
|
|
1281
|
+
get: function () { return chunkTRSHFTF6_cjs.SONICJS_VERSION; }
|
|
537
1282
|
});
|
|
538
1283
|
Object.defineProperty(exports, "TemplateRenderer", {
|
|
539
1284
|
enumerable: true,
|
|
540
|
-
get: function () { return
|
|
1285
|
+
get: function () { return chunkTRSHFTF6_cjs.TemplateRenderer; }
|
|
541
1286
|
});
|
|
542
1287
|
Object.defineProperty(exports, "buildQuery", {
|
|
543
1288
|
enumerable: true,
|
|
544
|
-
get: function () { return
|
|
1289
|
+
get: function () { return chunkTRSHFTF6_cjs.buildQuery; }
|
|
545
1290
|
});
|
|
546
1291
|
Object.defineProperty(exports, "escapeHtml", {
|
|
547
1292
|
enumerable: true,
|
|
548
|
-
get: function () { return
|
|
1293
|
+
get: function () { return chunkTRSHFTF6_cjs.escapeHtml; }
|
|
549
1294
|
});
|
|
550
1295
|
Object.defineProperty(exports, "getCoreVersion", {
|
|
551
1296
|
enumerable: true,
|
|
552
|
-
get: function () { return
|
|
1297
|
+
get: function () { return chunkTRSHFTF6_cjs.getCoreVersion; }
|
|
553
1298
|
});
|
|
554
1299
|
Object.defineProperty(exports, "renderTemplate", {
|
|
555
1300
|
enumerable: true,
|
|
556
|
-
get: function () { return
|
|
1301
|
+
get: function () { return chunkTRSHFTF6_cjs.renderTemplate; }
|
|
557
1302
|
});
|
|
558
1303
|
Object.defineProperty(exports, "sanitizeInput", {
|
|
559
1304
|
enumerable: true,
|
|
560
|
-
get: function () { return
|
|
1305
|
+
get: function () { return chunkTRSHFTF6_cjs.sanitizeInput; }
|
|
561
1306
|
});
|
|
562
1307
|
Object.defineProperty(exports, "sanitizeObject", {
|
|
563
1308
|
enumerable: true,
|
|
564
|
-
get: function () { return
|
|
1309
|
+
get: function () { return chunkTRSHFTF6_cjs.sanitizeObject; }
|
|
565
1310
|
});
|
|
566
1311
|
Object.defineProperty(exports, "templateRenderer", {
|
|
567
1312
|
enumerable: true,
|
|
568
|
-
get: function () { return
|
|
1313
|
+
get: function () { return chunkTRSHFTF6_cjs.templateRenderer; }
|
|
569
1314
|
});
|
|
570
1315
|
Object.defineProperty(exports, "metricsTracker", {
|
|
571
1316
|
enumerable: true,
|