@sonicjs-cms/core 2.0.4 → 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-CQ2VMJQO.js → chunk-LGC3TNCY.js} +252 -84
- package/dist/chunk-LGC3TNCY.js.map +1 -0
- package/dist/{chunk-RZW752PE.cjs → chunk-NPWWR6RI.cjs} +359 -191
- package/dist/chunk-NPWWR6RI.cjs.map +1 -0
- package/dist/{chunk-BRPONFW6.cjs → chunk-TRSHFTF6.cjs} +3 -3
- package/dist/{chunk-BRPONFW6.cjs.map → chunk-TRSHFTF6.cjs.map} +1 -1
- package/dist/{chunk-WKGONLHK.js → chunk-VSLEA22M.js} +3 -3
- package/dist/{chunk-WKGONLHK.js.map → chunk-VSLEA22M.js.map} +1 -1
- package/dist/index.cjs +876 -127
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +759 -9
- 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-CDBVZEWR.js.map +0 -1
- package/dist/chunk-CQ2VMJQO.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-RZW752PE.cjs.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,387 +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
840
|
// src/index.ts
|
|
92
|
-
var VERSION =
|
|
841
|
+
var VERSION = chunkTRSHFTF6_cjs.package_default.version;
|
|
93
842
|
|
|
94
843
|
Object.defineProperty(exports, "ROUTES_INFO", {
|
|
95
844
|
enumerable: true,
|
|
96
|
-
get: function () { return
|
|
845
|
+
get: function () { return chunkNPWWR6RI_cjs.ROUTES_INFO; }
|
|
97
846
|
});
|
|
98
847
|
Object.defineProperty(exports, "adminApiRoutes", {
|
|
99
848
|
enumerable: true,
|
|
100
|
-
get: function () { return
|
|
849
|
+
get: function () { return chunkNPWWR6RI_cjs.admin_api_default; }
|
|
101
850
|
});
|
|
102
851
|
Object.defineProperty(exports, "adminCheckboxRoutes", {
|
|
103
852
|
enumerable: true,
|
|
104
|
-
get: function () { return
|
|
853
|
+
get: function () { return chunkNPWWR6RI_cjs.adminCheckboxRoutes; }
|
|
105
854
|
});
|
|
106
855
|
Object.defineProperty(exports, "adminCodeExamplesRoutes", {
|
|
107
856
|
enumerable: true,
|
|
108
|
-
get: function () { return
|
|
857
|
+
get: function () { return chunkNPWWR6RI_cjs.admin_code_examples_default; }
|
|
109
858
|
});
|
|
110
859
|
Object.defineProperty(exports, "adminCollectionsRoutes", {
|
|
111
860
|
enumerable: true,
|
|
112
|
-
get: function () { return
|
|
861
|
+
get: function () { return chunkNPWWR6RI_cjs.adminCollectionsRoutes; }
|
|
113
862
|
});
|
|
114
863
|
Object.defineProperty(exports, "adminContentRoutes", {
|
|
115
864
|
enumerable: true,
|
|
116
|
-
get: function () { return
|
|
865
|
+
get: function () { return chunkNPWWR6RI_cjs.admin_content_default; }
|
|
117
866
|
});
|
|
118
867
|
Object.defineProperty(exports, "adminDashboardRoutes", {
|
|
119
868
|
enumerable: true,
|
|
120
|
-
get: function () { return
|
|
869
|
+
get: function () { return chunkNPWWR6RI_cjs.router; }
|
|
121
870
|
});
|
|
122
871
|
Object.defineProperty(exports, "adminDesignRoutes", {
|
|
123
872
|
enumerable: true,
|
|
124
|
-
get: function () { return
|
|
873
|
+
get: function () { return chunkNPWWR6RI_cjs.adminDesignRoutes; }
|
|
125
874
|
});
|
|
126
875
|
Object.defineProperty(exports, "adminFAQRoutes", {
|
|
127
876
|
enumerable: true,
|
|
128
|
-
get: function () { return
|
|
877
|
+
get: function () { return chunkNPWWR6RI_cjs.admin_faq_default; }
|
|
129
878
|
});
|
|
130
879
|
Object.defineProperty(exports, "adminLogsRoutes", {
|
|
131
880
|
enumerable: true,
|
|
132
|
-
get: function () { return
|
|
881
|
+
get: function () { return chunkNPWWR6RI_cjs.adminLogsRoutes; }
|
|
133
882
|
});
|
|
134
883
|
Object.defineProperty(exports, "adminMediaRoutes", {
|
|
135
884
|
enumerable: true,
|
|
136
|
-
get: function () { return
|
|
885
|
+
get: function () { return chunkNPWWR6RI_cjs.adminMediaRoutes; }
|
|
137
886
|
});
|
|
138
887
|
Object.defineProperty(exports, "adminPluginRoutes", {
|
|
139
888
|
enumerable: true,
|
|
140
|
-
get: function () { return
|
|
889
|
+
get: function () { return chunkNPWWR6RI_cjs.adminPluginRoutes; }
|
|
141
890
|
});
|
|
142
891
|
Object.defineProperty(exports, "adminSettingsRoutes", {
|
|
143
892
|
enumerable: true,
|
|
144
|
-
get: function () { return
|
|
893
|
+
get: function () { return chunkNPWWR6RI_cjs.adminSettingsRoutes; }
|
|
145
894
|
});
|
|
146
895
|
Object.defineProperty(exports, "adminTestimonialsRoutes", {
|
|
147
896
|
enumerable: true,
|
|
148
|
-
get: function () { return
|
|
897
|
+
get: function () { return chunkNPWWR6RI_cjs.admin_testimonials_default; }
|
|
149
898
|
});
|
|
150
899
|
Object.defineProperty(exports, "adminUsersRoutes", {
|
|
151
900
|
enumerable: true,
|
|
152
|
-
get: function () { return
|
|
901
|
+
get: function () { return chunkNPWWR6RI_cjs.userRoutes; }
|
|
153
902
|
});
|
|
154
903
|
Object.defineProperty(exports, "apiContentCrudRoutes", {
|
|
155
904
|
enumerable: true,
|
|
156
|
-
get: function () { return
|
|
905
|
+
get: function () { return chunkNPWWR6RI_cjs.api_content_crud_default; }
|
|
157
906
|
});
|
|
158
907
|
Object.defineProperty(exports, "apiMediaRoutes", {
|
|
159
908
|
enumerable: true,
|
|
160
|
-
get: function () { return
|
|
909
|
+
get: function () { return chunkNPWWR6RI_cjs.api_media_default; }
|
|
161
910
|
});
|
|
162
911
|
Object.defineProperty(exports, "apiRoutes", {
|
|
163
912
|
enumerable: true,
|
|
164
|
-
get: function () { return
|
|
913
|
+
get: function () { return chunkNPWWR6RI_cjs.api_default; }
|
|
165
914
|
});
|
|
166
915
|
Object.defineProperty(exports, "apiSystemRoutes", {
|
|
167
916
|
enumerable: true,
|
|
168
|
-
get: function () { return
|
|
917
|
+
get: function () { return chunkNPWWR6RI_cjs.api_system_default; }
|
|
169
918
|
});
|
|
170
919
|
Object.defineProperty(exports, "authRoutes", {
|
|
171
920
|
enumerable: true,
|
|
172
|
-
get: function () { return
|
|
921
|
+
get: function () { return chunkNPWWR6RI_cjs.auth_default; }
|
|
173
922
|
});
|
|
174
923
|
Object.defineProperty(exports, "Logger", {
|
|
175
924
|
enumerable: true,
|
|
176
|
-
get: function () { return
|
|
925
|
+
get: function () { return chunkDOR2IU73_cjs.Logger; }
|
|
177
926
|
});
|
|
178
927
|
Object.defineProperty(exports, "apiTokens", {
|
|
179
928
|
enumerable: true,
|
|
180
|
-
get: function () { return
|
|
929
|
+
get: function () { return chunkDOR2IU73_cjs.apiTokens; }
|
|
181
930
|
});
|
|
182
931
|
Object.defineProperty(exports, "collections", {
|
|
183
932
|
enumerable: true,
|
|
184
|
-
get: function () { return
|
|
933
|
+
get: function () { return chunkDOR2IU73_cjs.collections; }
|
|
185
934
|
});
|
|
186
935
|
Object.defineProperty(exports, "content", {
|
|
187
936
|
enumerable: true,
|
|
188
|
-
get: function () { return
|
|
937
|
+
get: function () { return chunkDOR2IU73_cjs.content; }
|
|
189
938
|
});
|
|
190
939
|
Object.defineProperty(exports, "contentVersions", {
|
|
191
940
|
enumerable: true,
|
|
192
|
-
get: function () { return
|
|
941
|
+
get: function () { return chunkDOR2IU73_cjs.contentVersions; }
|
|
193
942
|
});
|
|
194
943
|
Object.defineProperty(exports, "getLogger", {
|
|
195
944
|
enumerable: true,
|
|
196
|
-
get: function () { return
|
|
945
|
+
get: function () { return chunkDOR2IU73_cjs.getLogger; }
|
|
197
946
|
});
|
|
198
947
|
Object.defineProperty(exports, "initLogger", {
|
|
199
948
|
enumerable: true,
|
|
200
|
-
get: function () { return
|
|
949
|
+
get: function () { return chunkDOR2IU73_cjs.initLogger; }
|
|
201
950
|
});
|
|
202
951
|
Object.defineProperty(exports, "insertCollectionSchema", {
|
|
203
952
|
enumerable: true,
|
|
204
|
-
get: function () { return
|
|
953
|
+
get: function () { return chunkDOR2IU73_cjs.insertCollectionSchema; }
|
|
205
954
|
});
|
|
206
955
|
Object.defineProperty(exports, "insertContentSchema", {
|
|
207
956
|
enumerable: true,
|
|
208
|
-
get: function () { return
|
|
957
|
+
get: function () { return chunkDOR2IU73_cjs.insertContentSchema; }
|
|
209
958
|
});
|
|
210
959
|
Object.defineProperty(exports, "insertLogConfigSchema", {
|
|
211
960
|
enumerable: true,
|
|
212
|
-
get: function () { return
|
|
961
|
+
get: function () { return chunkDOR2IU73_cjs.insertLogConfigSchema; }
|
|
213
962
|
});
|
|
214
963
|
Object.defineProperty(exports, "insertMediaSchema", {
|
|
215
964
|
enumerable: true,
|
|
216
|
-
get: function () { return
|
|
965
|
+
get: function () { return chunkDOR2IU73_cjs.insertMediaSchema; }
|
|
217
966
|
});
|
|
218
967
|
Object.defineProperty(exports, "insertPluginActivityLogSchema", {
|
|
219
968
|
enumerable: true,
|
|
220
|
-
get: function () { return
|
|
969
|
+
get: function () { return chunkDOR2IU73_cjs.insertPluginActivityLogSchema; }
|
|
221
970
|
});
|
|
222
971
|
Object.defineProperty(exports, "insertPluginAssetSchema", {
|
|
223
972
|
enumerable: true,
|
|
224
|
-
get: function () { return
|
|
973
|
+
get: function () { return chunkDOR2IU73_cjs.insertPluginAssetSchema; }
|
|
225
974
|
});
|
|
226
975
|
Object.defineProperty(exports, "insertPluginHookSchema", {
|
|
227
976
|
enumerable: true,
|
|
228
|
-
get: function () { return
|
|
977
|
+
get: function () { return chunkDOR2IU73_cjs.insertPluginHookSchema; }
|
|
229
978
|
});
|
|
230
979
|
Object.defineProperty(exports, "insertPluginRouteSchema", {
|
|
231
980
|
enumerable: true,
|
|
232
|
-
get: function () { return
|
|
981
|
+
get: function () { return chunkDOR2IU73_cjs.insertPluginRouteSchema; }
|
|
233
982
|
});
|
|
234
983
|
Object.defineProperty(exports, "insertPluginSchema", {
|
|
235
984
|
enumerable: true,
|
|
236
|
-
get: function () { return
|
|
985
|
+
get: function () { return chunkDOR2IU73_cjs.insertPluginSchema; }
|
|
237
986
|
});
|
|
238
987
|
Object.defineProperty(exports, "insertSystemLogSchema", {
|
|
239
988
|
enumerable: true,
|
|
240
|
-
get: function () { return
|
|
989
|
+
get: function () { return chunkDOR2IU73_cjs.insertSystemLogSchema; }
|
|
241
990
|
});
|
|
242
991
|
Object.defineProperty(exports, "insertUserSchema", {
|
|
243
992
|
enumerable: true,
|
|
244
|
-
get: function () { return
|
|
993
|
+
get: function () { return chunkDOR2IU73_cjs.insertUserSchema; }
|
|
245
994
|
});
|
|
246
995
|
Object.defineProperty(exports, "insertWorkflowHistorySchema", {
|
|
247
996
|
enumerable: true,
|
|
248
|
-
get: function () { return
|
|
997
|
+
get: function () { return chunkDOR2IU73_cjs.insertWorkflowHistorySchema; }
|
|
249
998
|
});
|
|
250
999
|
Object.defineProperty(exports, "logConfig", {
|
|
251
1000
|
enumerable: true,
|
|
252
|
-
get: function () { return
|
|
1001
|
+
get: function () { return chunkDOR2IU73_cjs.logConfig; }
|
|
253
1002
|
});
|
|
254
1003
|
Object.defineProperty(exports, "media", {
|
|
255
1004
|
enumerable: true,
|
|
256
|
-
get: function () { return
|
|
1005
|
+
get: function () { return chunkDOR2IU73_cjs.media; }
|
|
257
1006
|
});
|
|
258
1007
|
Object.defineProperty(exports, "pluginActivityLog", {
|
|
259
1008
|
enumerable: true,
|
|
260
|
-
get: function () { return
|
|
1009
|
+
get: function () { return chunkDOR2IU73_cjs.pluginActivityLog; }
|
|
261
1010
|
});
|
|
262
1011
|
Object.defineProperty(exports, "pluginAssets", {
|
|
263
1012
|
enumerable: true,
|
|
264
|
-
get: function () { return
|
|
1013
|
+
get: function () { return chunkDOR2IU73_cjs.pluginAssets; }
|
|
265
1014
|
});
|
|
266
1015
|
Object.defineProperty(exports, "pluginHooks", {
|
|
267
1016
|
enumerable: true,
|
|
268
|
-
get: function () { return
|
|
1017
|
+
get: function () { return chunkDOR2IU73_cjs.pluginHooks; }
|
|
269
1018
|
});
|
|
270
1019
|
Object.defineProperty(exports, "pluginRoutes", {
|
|
271
1020
|
enumerable: true,
|
|
272
|
-
get: function () { return
|
|
1021
|
+
get: function () { return chunkDOR2IU73_cjs.pluginRoutes; }
|
|
273
1022
|
});
|
|
274
1023
|
Object.defineProperty(exports, "plugins", {
|
|
275
1024
|
enumerable: true,
|
|
276
|
-
get: function () { return
|
|
1025
|
+
get: function () { return chunkDOR2IU73_cjs.plugins; }
|
|
277
1026
|
});
|
|
278
1027
|
Object.defineProperty(exports, "selectCollectionSchema", {
|
|
279
1028
|
enumerable: true,
|
|
280
|
-
get: function () { return
|
|
1029
|
+
get: function () { return chunkDOR2IU73_cjs.selectCollectionSchema; }
|
|
281
1030
|
});
|
|
282
1031
|
Object.defineProperty(exports, "selectContentSchema", {
|
|
283
1032
|
enumerable: true,
|
|
284
|
-
get: function () { return
|
|
1033
|
+
get: function () { return chunkDOR2IU73_cjs.selectContentSchema; }
|
|
285
1034
|
});
|
|
286
1035
|
Object.defineProperty(exports, "selectLogConfigSchema", {
|
|
287
1036
|
enumerable: true,
|
|
288
|
-
get: function () { return
|
|
1037
|
+
get: function () { return chunkDOR2IU73_cjs.selectLogConfigSchema; }
|
|
289
1038
|
});
|
|
290
1039
|
Object.defineProperty(exports, "selectMediaSchema", {
|
|
291
1040
|
enumerable: true,
|
|
292
|
-
get: function () { return
|
|
1041
|
+
get: function () { return chunkDOR2IU73_cjs.selectMediaSchema; }
|
|
293
1042
|
});
|
|
294
1043
|
Object.defineProperty(exports, "selectPluginActivityLogSchema", {
|
|
295
1044
|
enumerable: true,
|
|
296
|
-
get: function () { return
|
|
1045
|
+
get: function () { return chunkDOR2IU73_cjs.selectPluginActivityLogSchema; }
|
|
297
1046
|
});
|
|
298
1047
|
Object.defineProperty(exports, "selectPluginAssetSchema", {
|
|
299
1048
|
enumerable: true,
|
|
300
|
-
get: function () { return
|
|
1049
|
+
get: function () { return chunkDOR2IU73_cjs.selectPluginAssetSchema; }
|
|
301
1050
|
});
|
|
302
1051
|
Object.defineProperty(exports, "selectPluginHookSchema", {
|
|
303
1052
|
enumerable: true,
|
|
304
|
-
get: function () { return
|
|
1053
|
+
get: function () { return chunkDOR2IU73_cjs.selectPluginHookSchema; }
|
|
305
1054
|
});
|
|
306
1055
|
Object.defineProperty(exports, "selectPluginRouteSchema", {
|
|
307
1056
|
enumerable: true,
|
|
308
|
-
get: function () { return
|
|
1057
|
+
get: function () { return chunkDOR2IU73_cjs.selectPluginRouteSchema; }
|
|
309
1058
|
});
|
|
310
1059
|
Object.defineProperty(exports, "selectPluginSchema", {
|
|
311
1060
|
enumerable: true,
|
|
312
|
-
get: function () { return
|
|
1061
|
+
get: function () { return chunkDOR2IU73_cjs.selectPluginSchema; }
|
|
313
1062
|
});
|
|
314
1063
|
Object.defineProperty(exports, "selectSystemLogSchema", {
|
|
315
1064
|
enumerable: true,
|
|
316
|
-
get: function () { return
|
|
1065
|
+
get: function () { return chunkDOR2IU73_cjs.selectSystemLogSchema; }
|
|
317
1066
|
});
|
|
318
1067
|
Object.defineProperty(exports, "selectUserSchema", {
|
|
319
1068
|
enumerable: true,
|
|
320
|
-
get: function () { return
|
|
1069
|
+
get: function () { return chunkDOR2IU73_cjs.selectUserSchema; }
|
|
321
1070
|
});
|
|
322
1071
|
Object.defineProperty(exports, "selectWorkflowHistorySchema", {
|
|
323
1072
|
enumerable: true,
|
|
324
|
-
get: function () { return
|
|
1073
|
+
get: function () { return chunkDOR2IU73_cjs.selectWorkflowHistorySchema; }
|
|
325
1074
|
});
|
|
326
1075
|
Object.defineProperty(exports, "systemLogs", {
|
|
327
1076
|
enumerable: true,
|
|
328
|
-
get: function () { return
|
|
1077
|
+
get: function () { return chunkDOR2IU73_cjs.systemLogs; }
|
|
329
1078
|
});
|
|
330
1079
|
Object.defineProperty(exports, "users", {
|
|
331
1080
|
enumerable: true,
|
|
332
|
-
get: function () { return
|
|
1081
|
+
get: function () { return chunkDOR2IU73_cjs.users; }
|
|
333
1082
|
});
|
|
334
1083
|
Object.defineProperty(exports, "workflowHistory", {
|
|
335
1084
|
enumerable: true,
|
|
336
|
-
get: function () { return
|
|
1085
|
+
get: function () { return chunkDOR2IU73_cjs.workflowHistory; }
|
|
337
1086
|
});
|
|
338
1087
|
Object.defineProperty(exports, "AuthManager", {
|
|
339
1088
|
enumerable: true,
|
|
340
|
-
get: function () { return
|
|
1089
|
+
get: function () { return chunkIM5SDXOE_cjs.AuthManager; }
|
|
341
1090
|
});
|
|
342
1091
|
Object.defineProperty(exports, "PermissionManager", {
|
|
343
1092
|
enumerable: true,
|
|
344
|
-
get: function () { return
|
|
1093
|
+
get: function () { return chunkIM5SDXOE_cjs.PermissionManager; }
|
|
345
1094
|
});
|
|
346
1095
|
Object.defineProperty(exports, "bootstrapMiddleware", {
|
|
347
1096
|
enumerable: true,
|
|
348
|
-
get: function () { return
|
|
1097
|
+
get: function () { return chunkIM5SDXOE_cjs.bootstrapMiddleware; }
|
|
349
1098
|
});
|
|
350
1099
|
Object.defineProperty(exports, "cacheHeaders", {
|
|
351
1100
|
enumerable: true,
|
|
352
|
-
get: function () { return
|
|
1101
|
+
get: function () { return chunkIM5SDXOE_cjs.cacheHeaders; }
|
|
353
1102
|
});
|
|
354
1103
|
Object.defineProperty(exports, "compressionMiddleware", {
|
|
355
1104
|
enumerable: true,
|
|
356
|
-
get: function () { return
|
|
1105
|
+
get: function () { return chunkIM5SDXOE_cjs.compressionMiddleware; }
|
|
357
1106
|
});
|
|
358
1107
|
Object.defineProperty(exports, "detailedLoggingMiddleware", {
|
|
359
1108
|
enumerable: true,
|
|
360
|
-
get: function () { return
|
|
1109
|
+
get: function () { return chunkIM5SDXOE_cjs.detailedLoggingMiddleware; }
|
|
361
1110
|
});
|
|
362
1111
|
Object.defineProperty(exports, "getActivePlugins", {
|
|
363
1112
|
enumerable: true,
|
|
364
|
-
get: function () { return
|
|
1113
|
+
get: function () { return chunkIM5SDXOE_cjs.getActivePlugins; }
|
|
365
1114
|
});
|
|
366
1115
|
Object.defineProperty(exports, "isPluginActive", {
|
|
367
1116
|
enumerable: true,
|
|
368
|
-
get: function () { return
|
|
1117
|
+
get: function () { return chunkIM5SDXOE_cjs.isPluginActive; }
|
|
369
1118
|
});
|
|
370
1119
|
Object.defineProperty(exports, "logActivity", {
|
|
371
1120
|
enumerable: true,
|
|
372
|
-
get: function () { return
|
|
1121
|
+
get: function () { return chunkIM5SDXOE_cjs.logActivity; }
|
|
373
1122
|
});
|
|
374
1123
|
Object.defineProperty(exports, "loggingMiddleware", {
|
|
375
1124
|
enumerable: true,
|
|
376
|
-
get: function () { return
|
|
1125
|
+
get: function () { return chunkIM5SDXOE_cjs.loggingMiddleware; }
|
|
377
1126
|
});
|
|
378
1127
|
Object.defineProperty(exports, "optionalAuth", {
|
|
379
1128
|
enumerable: true,
|
|
380
|
-
get: function () { return
|
|
1129
|
+
get: function () { return chunkIM5SDXOE_cjs.optionalAuth; }
|
|
381
1130
|
});
|
|
382
1131
|
Object.defineProperty(exports, "performanceLoggingMiddleware", {
|
|
383
1132
|
enumerable: true,
|
|
384
|
-
get: function () { return
|
|
1133
|
+
get: function () { return chunkIM5SDXOE_cjs.performanceLoggingMiddleware; }
|
|
385
1134
|
});
|
|
386
1135
|
Object.defineProperty(exports, "requireActivePlugin", {
|
|
387
1136
|
enumerable: true,
|
|
388
|
-
get: function () { return
|
|
1137
|
+
get: function () { return chunkIM5SDXOE_cjs.requireActivePlugin; }
|
|
389
1138
|
});
|
|
390
1139
|
Object.defineProperty(exports, "requireActivePlugins", {
|
|
391
1140
|
enumerable: true,
|
|
392
|
-
get: function () { return
|
|
1141
|
+
get: function () { return chunkIM5SDXOE_cjs.requireActivePlugins; }
|
|
393
1142
|
});
|
|
394
1143
|
Object.defineProperty(exports, "requireAnyPermission", {
|
|
395
1144
|
enumerable: true,
|
|
396
|
-
get: function () { return
|
|
1145
|
+
get: function () { return chunkIM5SDXOE_cjs.requireAnyPermission; }
|
|
397
1146
|
});
|
|
398
1147
|
Object.defineProperty(exports, "requireAuth", {
|
|
399
1148
|
enumerable: true,
|
|
400
|
-
get: function () { return
|
|
1149
|
+
get: function () { return chunkIM5SDXOE_cjs.requireAuth; }
|
|
401
1150
|
});
|
|
402
1151
|
Object.defineProperty(exports, "requirePermission", {
|
|
403
1152
|
enumerable: true,
|
|
404
|
-
get: function () { return
|
|
1153
|
+
get: function () { return chunkIM5SDXOE_cjs.requirePermission; }
|
|
405
1154
|
});
|
|
406
1155
|
Object.defineProperty(exports, "requireRole", {
|
|
407
1156
|
enumerable: true,
|
|
408
|
-
get: function () { return
|
|
1157
|
+
get: function () { return chunkIM5SDXOE_cjs.requireRole; }
|
|
409
1158
|
});
|
|
410
1159
|
Object.defineProperty(exports, "securityHeaders", {
|
|
411
1160
|
enumerable: true,
|
|
412
|
-
get: function () { return
|
|
1161
|
+
get: function () { return chunkIM5SDXOE_cjs.securityHeaders; }
|
|
413
1162
|
});
|
|
414
1163
|
Object.defineProperty(exports, "securityLoggingMiddleware", {
|
|
415
1164
|
enumerable: true,
|
|
416
|
-
get: function () { return
|
|
1165
|
+
get: function () { return chunkIM5SDXOE_cjs.securityLoggingMiddleware; }
|
|
417
1166
|
});
|
|
418
1167
|
Object.defineProperty(exports, "MigrationService", {
|
|
419
1168
|
enumerable: true,
|
|
420
|
-
get: function () { return
|
|
1169
|
+
get: function () { return chunk3JMOWGUU_cjs.MigrationService; }
|
|
421
1170
|
});
|
|
422
1171
|
Object.defineProperty(exports, "PluginBootstrapService", {
|
|
423
1172
|
enumerable: true,
|
|
424
|
-
get: function () { return
|
|
1173
|
+
get: function () { return chunk3JMOWGUU_cjs.PluginBootstrapService; }
|
|
425
1174
|
});
|
|
426
1175
|
Object.defineProperty(exports, "PluginServiceClass", {
|
|
427
1176
|
enumerable: true,
|
|
428
|
-
get: function () { return
|
|
1177
|
+
get: function () { return chunk3JMOWGUU_cjs.PluginService; }
|
|
429
1178
|
});
|
|
430
1179
|
Object.defineProperty(exports, "cleanupRemovedCollections", {
|
|
431
1180
|
enumerable: true,
|
|
432
|
-
get: function () { return
|
|
1181
|
+
get: function () { return chunk3JMOWGUU_cjs.cleanupRemovedCollections; }
|
|
433
1182
|
});
|
|
434
1183
|
Object.defineProperty(exports, "fullCollectionSync", {
|
|
435
1184
|
enumerable: true,
|
|
436
|
-
get: function () { return
|
|
1185
|
+
get: function () { return chunk3JMOWGUU_cjs.fullCollectionSync; }
|
|
437
1186
|
});
|
|
438
1187
|
Object.defineProperty(exports, "getAvailableCollectionNames", {
|
|
439
1188
|
enumerable: true,
|
|
440
|
-
get: function () { return
|
|
1189
|
+
get: function () { return chunk3JMOWGUU_cjs.getAvailableCollectionNames; }
|
|
441
1190
|
});
|
|
442
1191
|
Object.defineProperty(exports, "getManagedCollections", {
|
|
443
1192
|
enumerable: true,
|
|
444
|
-
get: function () { return
|
|
1193
|
+
get: function () { return chunk3JMOWGUU_cjs.getManagedCollections; }
|
|
445
1194
|
});
|
|
446
1195
|
Object.defineProperty(exports, "isCollectionManaged", {
|
|
447
1196
|
enumerable: true,
|
|
448
|
-
get: function () { return
|
|
1197
|
+
get: function () { return chunk3JMOWGUU_cjs.isCollectionManaged; }
|
|
449
1198
|
});
|
|
450
1199
|
Object.defineProperty(exports, "loadCollectionConfig", {
|
|
451
1200
|
enumerable: true,
|
|
452
|
-
get: function () { return
|
|
1201
|
+
get: function () { return chunk3JMOWGUU_cjs.loadCollectionConfig; }
|
|
453
1202
|
});
|
|
454
1203
|
Object.defineProperty(exports, "loadCollectionConfigs", {
|
|
455
1204
|
enumerable: true,
|
|
456
|
-
get: function () { return
|
|
1205
|
+
get: function () { return chunk3JMOWGUU_cjs.loadCollectionConfigs; }
|
|
457
1206
|
});
|
|
458
1207
|
Object.defineProperty(exports, "syncCollection", {
|
|
459
1208
|
enumerable: true,
|
|
460
|
-
get: function () { return
|
|
1209
|
+
get: function () { return chunk3JMOWGUU_cjs.syncCollection; }
|
|
461
1210
|
});
|
|
462
1211
|
Object.defineProperty(exports, "syncCollections", {
|
|
463
1212
|
enumerable: true,
|
|
464
|
-
get: function () { return
|
|
1213
|
+
get: function () { return chunk3JMOWGUU_cjs.syncCollections; }
|
|
465
1214
|
});
|
|
466
1215
|
Object.defineProperty(exports, "validateCollectionConfig", {
|
|
467
1216
|
enumerable: true,
|
|
468
|
-
get: function () { return
|
|
1217
|
+
get: function () { return chunk3JMOWGUU_cjs.validateCollectionConfig; }
|
|
469
1218
|
});
|
|
470
1219
|
Object.defineProperty(exports, "renderFilterBar", {
|
|
471
1220
|
enumerable: true,
|
|
@@ -525,43 +1274,43 @@ Object.defineProperty(exports, "ScopedHookSystemClass", {
|
|
|
525
1274
|
});
|
|
526
1275
|
Object.defineProperty(exports, "QueryFilterBuilder", {
|
|
527
1276
|
enumerable: true,
|
|
528
|
-
get: function () { return
|
|
1277
|
+
get: function () { return chunkTRSHFTF6_cjs.QueryFilterBuilder; }
|
|
529
1278
|
});
|
|
530
1279
|
Object.defineProperty(exports, "SONICJS_VERSION", {
|
|
531
1280
|
enumerable: true,
|
|
532
|
-
get: function () { return
|
|
1281
|
+
get: function () { return chunkTRSHFTF6_cjs.SONICJS_VERSION; }
|
|
533
1282
|
});
|
|
534
1283
|
Object.defineProperty(exports, "TemplateRenderer", {
|
|
535
1284
|
enumerable: true,
|
|
536
|
-
get: function () { return
|
|
1285
|
+
get: function () { return chunkTRSHFTF6_cjs.TemplateRenderer; }
|
|
537
1286
|
});
|
|
538
1287
|
Object.defineProperty(exports, "buildQuery", {
|
|
539
1288
|
enumerable: true,
|
|
540
|
-
get: function () { return
|
|
1289
|
+
get: function () { return chunkTRSHFTF6_cjs.buildQuery; }
|
|
541
1290
|
});
|
|
542
1291
|
Object.defineProperty(exports, "escapeHtml", {
|
|
543
1292
|
enumerable: true,
|
|
544
|
-
get: function () { return
|
|
1293
|
+
get: function () { return chunkTRSHFTF6_cjs.escapeHtml; }
|
|
545
1294
|
});
|
|
546
1295
|
Object.defineProperty(exports, "getCoreVersion", {
|
|
547
1296
|
enumerable: true,
|
|
548
|
-
get: function () { return
|
|
1297
|
+
get: function () { return chunkTRSHFTF6_cjs.getCoreVersion; }
|
|
549
1298
|
});
|
|
550
1299
|
Object.defineProperty(exports, "renderTemplate", {
|
|
551
1300
|
enumerable: true,
|
|
552
|
-
get: function () { return
|
|
1301
|
+
get: function () { return chunkTRSHFTF6_cjs.renderTemplate; }
|
|
553
1302
|
});
|
|
554
1303
|
Object.defineProperty(exports, "sanitizeInput", {
|
|
555
1304
|
enumerable: true,
|
|
556
|
-
get: function () { return
|
|
1305
|
+
get: function () { return chunkTRSHFTF6_cjs.sanitizeInput; }
|
|
557
1306
|
});
|
|
558
1307
|
Object.defineProperty(exports, "sanitizeObject", {
|
|
559
1308
|
enumerable: true,
|
|
560
|
-
get: function () { return
|
|
1309
|
+
get: function () { return chunkTRSHFTF6_cjs.sanitizeObject; }
|
|
561
1310
|
});
|
|
562
1311
|
Object.defineProperty(exports, "templateRenderer", {
|
|
563
1312
|
enumerable: true,
|
|
564
|
-
get: function () { return
|
|
1313
|
+
get: function () { return chunkTRSHFTF6_cjs.templateRenderer; }
|
|
565
1314
|
});
|
|
566
1315
|
Object.defineProperty(exports, "metricsTracker", {
|
|
567
1316
|
enumerable: true,
|