@sonicjs-cms/core 2.0.7 → 2.0.8
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-RSFXIU6A.cjs → chunk-CHMO2DOC.cjs} +4 -4
- package/dist/{chunk-RSFXIU6A.cjs.map → chunk-CHMO2DOC.cjs.map} +1 -1
- package/dist/{chunk-JB2NUJJ5.js → chunk-CUEIM4FE.js} +3 -3
- package/dist/{chunk-JB2NUJJ5.js.map → chunk-CUEIM4FE.js.map} +1 -1
- package/dist/{chunk-OOV64BK4.cjs → chunk-GN7Q6V5C.cjs} +32 -32
- package/dist/{chunk-OOV64BK4.cjs.map → chunk-GN7Q6V5C.cjs.map} +1 -1
- package/dist/{chunk-YURRY22X.js → chunk-Z2CZC6TC.js} +4 -4
- package/dist/{chunk-YURRY22X.js.map → chunk-Z2CZC6TC.js.map} +1 -1
- package/dist/index.cjs +47 -47
- package/dist/index.js +4 -4
- package/dist/routes.cjs +22 -22
- package/dist/routes.js +2 -2
- package/dist/utils.cjs +11 -11
- package/dist/utils.js +1 -1
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@ var chunkDOR2IU73_cjs = require('./chunk-DOR2IU73.cjs');
|
|
|
4
4
|
var chunk3R7EQNGO_cjs = require('./chunk-3R7EQNGO.cjs');
|
|
5
5
|
var chunkYGVWY6KO_cjs = require('./chunk-YGVWY6KO.cjs');
|
|
6
6
|
var chunk7XEESVSX_cjs = require('./chunk-7XEESVSX.cjs');
|
|
7
|
-
var
|
|
7
|
+
var chunkCHMO2DOC_cjs = require('./chunk-CHMO2DOC.cjs');
|
|
8
8
|
var chunkRCQ2HIQD_cjs = require('./chunk-RCQ2HIQD.cjs');
|
|
9
9
|
var hono = require('hono');
|
|
10
10
|
var cors = require('hono/cors');
|
|
@@ -334,12 +334,12 @@ apiRoutes.get("/content", async (c) => {
|
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
const filter =
|
|
337
|
+
const filter = chunkCHMO2DOC_cjs.QueryFilterBuilder.parseFromQuery(queryParams);
|
|
338
338
|
if (!filter.limit) {
|
|
339
339
|
filter.limit = 50;
|
|
340
340
|
}
|
|
341
341
|
filter.limit = Math.min(filter.limit, 1e3);
|
|
342
|
-
const builder = new
|
|
342
|
+
const builder = new chunkCHMO2DOC_cjs.QueryFilterBuilder();
|
|
343
343
|
const queryResult = builder.build("content", filter);
|
|
344
344
|
if (queryResult.errors.length > 0) {
|
|
345
345
|
return c.json({
|
|
@@ -426,7 +426,7 @@ apiRoutes.get("/collections/:collection/content", async (c) => {
|
|
|
426
426
|
if (!collectionResult) {
|
|
427
427
|
return c.json({ error: "Collection not found" }, 404);
|
|
428
428
|
}
|
|
429
|
-
const filter =
|
|
429
|
+
const filter = chunkCHMO2DOC_cjs.QueryFilterBuilder.parseFromQuery(queryParams);
|
|
430
430
|
if (!filter.where) {
|
|
431
431
|
filter.where = { and: [] };
|
|
432
432
|
}
|
|
@@ -442,7 +442,7 @@ apiRoutes.get("/collections/:collection/content", async (c) => {
|
|
|
442
442
|
filter.limit = 50;
|
|
443
443
|
}
|
|
444
444
|
filter.limit = Math.min(filter.limit, 1e3);
|
|
445
|
-
const builder = new
|
|
445
|
+
const builder = new chunkCHMO2DOC_cjs.QueryFilterBuilder();
|
|
446
446
|
const queryResult = builder.build("content", filter);
|
|
447
447
|
if (queryResult.errors.length > 0) {
|
|
448
448
|
return c.json({
|
|
@@ -6744,7 +6744,7 @@ function renderUserEditPage(data) {
|
|
|
6744
6744
|
<input
|
|
6745
6745
|
type="text"
|
|
6746
6746
|
name="first_name"
|
|
6747
|
-
value="${
|
|
6747
|
+
value="${chunkCHMO2DOC_cjs.escapeHtml(data.userToEdit.firstName || "")}"
|
|
6748
6748
|
required
|
|
6749
6749
|
class="w-full rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 placeholder:text-zinc-400 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-zinc-950 dark:focus:ring-white transition-shadow"
|
|
6750
6750
|
/>
|
|
@@ -6755,7 +6755,7 @@ function renderUserEditPage(data) {
|
|
|
6755
6755
|
<input
|
|
6756
6756
|
type="text"
|
|
6757
6757
|
name="last_name"
|
|
6758
|
-
value="${
|
|
6758
|
+
value="${chunkCHMO2DOC_cjs.escapeHtml(data.userToEdit.lastName || "")}"
|
|
6759
6759
|
required
|
|
6760
6760
|
class="w-full rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 placeholder:text-zinc-400 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-zinc-950 dark:focus:ring-white transition-shadow"
|
|
6761
6761
|
/>
|
|
@@ -6766,7 +6766,7 @@ function renderUserEditPage(data) {
|
|
|
6766
6766
|
<input
|
|
6767
6767
|
type="text"
|
|
6768
6768
|
name="username"
|
|
6769
|
-
value="${
|
|
6769
|
+
value="${chunkCHMO2DOC_cjs.escapeHtml(data.userToEdit.username || "")}"
|
|
6770
6770
|
required
|
|
6771
6771
|
class="w-full rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 placeholder:text-zinc-400 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-zinc-950 dark:focus:ring-white transition-shadow"
|
|
6772
6772
|
/>
|
|
@@ -6777,7 +6777,7 @@ function renderUserEditPage(data) {
|
|
|
6777
6777
|
<input
|
|
6778
6778
|
type="email"
|
|
6779
6779
|
name="email"
|
|
6780
|
-
value="${
|
|
6780
|
+
value="${chunkCHMO2DOC_cjs.escapeHtml(data.userToEdit.email || "")}"
|
|
6781
6781
|
required
|
|
6782
6782
|
class="w-full rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 placeholder:text-zinc-400 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-zinc-950 dark:focus:ring-white transition-shadow"
|
|
6783
6783
|
/>
|
|
@@ -6788,7 +6788,7 @@ function renderUserEditPage(data) {
|
|
|
6788
6788
|
<input
|
|
6789
6789
|
type="tel"
|
|
6790
6790
|
name="phone"
|
|
6791
|
-
value="${
|
|
6791
|
+
value="${chunkCHMO2DOC_cjs.escapeHtml(data.userToEdit.phone || "")}"
|
|
6792
6792
|
class="w-full rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 placeholder:text-zinc-400 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-zinc-950 dark:focus:ring-white transition-shadow"
|
|
6793
6793
|
/>
|
|
6794
6794
|
</div>
|
|
@@ -6802,7 +6802,7 @@ function renderUserEditPage(data) {
|
|
|
6802
6802
|
class="col-start-1 row-start-1 w-full appearance-none rounded-md bg-white/5 dark:bg-white/5 py-1.5 pl-3 pr-8 text-base text-zinc-950 dark:text-white outline outline-1 -outline-offset-1 outline-zinc-500/30 dark:outline-zinc-400/30 *:bg-white dark:*:bg-zinc-800 focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-zinc-500 dark:focus-visible:outline-zinc-400 sm:text-sm/6"
|
|
6803
6803
|
>
|
|
6804
6804
|
${data.roles.map((role) => `
|
|
6805
|
-
<option value="${
|
|
6805
|
+
<option value="${chunkCHMO2DOC_cjs.escapeHtml(role.value)}" ${data.userToEdit.role === role.value ? "selected" : ""}>${chunkCHMO2DOC_cjs.escapeHtml(role.label)}</option>
|
|
6806
6806
|
`).join("")}
|
|
6807
6807
|
</select>
|
|
6808
6808
|
<svg viewBox="0 0 16 16" fill="currentColor" data-slot="icon" aria-hidden="true" class="pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end text-zinc-600 dark:text-zinc-400 sm:size-4">
|
|
@@ -6818,7 +6818,7 @@ function renderUserEditPage(data) {
|
|
|
6818
6818
|
name="bio"
|
|
6819
6819
|
rows="3"
|
|
6820
6820
|
class="w-full rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 placeholder:text-zinc-400 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-zinc-950 dark:focus:ring-white transition-shadow"
|
|
6821
|
-
>${
|
|
6821
|
+
>${chunkCHMO2DOC_cjs.escapeHtml(data.userToEdit.bio || "")}</textarea>
|
|
6822
6822
|
</div>
|
|
6823
6823
|
</div>
|
|
6824
6824
|
|
|
@@ -7817,12 +7817,12 @@ userRoutes.put("/profile", async (c) => {
|
|
|
7817
7817
|
const db = c.env.DB;
|
|
7818
7818
|
try {
|
|
7819
7819
|
const formData = await c.req.formData();
|
|
7820
|
-
const firstName =
|
|
7821
|
-
const lastName =
|
|
7822
|
-
const username =
|
|
7820
|
+
const firstName = chunkCHMO2DOC_cjs.sanitizeInput(formData.get("first_name")?.toString());
|
|
7821
|
+
const lastName = chunkCHMO2DOC_cjs.sanitizeInput(formData.get("last_name")?.toString());
|
|
7822
|
+
const username = chunkCHMO2DOC_cjs.sanitizeInput(formData.get("username")?.toString());
|
|
7823
7823
|
const email = formData.get("email")?.toString()?.trim().toLowerCase() || "";
|
|
7824
|
-
const phone =
|
|
7825
|
-
const bio =
|
|
7824
|
+
const phone = chunkCHMO2DOC_cjs.sanitizeInput(formData.get("phone")?.toString()) || null;
|
|
7825
|
+
const bio = chunkCHMO2DOC_cjs.sanitizeInput(formData.get("bio")?.toString()) || null;
|
|
7826
7826
|
const timezone = formData.get("timezone")?.toString() || "UTC";
|
|
7827
7827
|
const language = formData.get("language")?.toString() || "en";
|
|
7828
7828
|
const emailNotifications = formData.get("email_notifications") === "1";
|
|
@@ -8200,12 +8200,12 @@ userRoutes.post("/users/new", async (c) => {
|
|
|
8200
8200
|
const user = c.get("user");
|
|
8201
8201
|
try {
|
|
8202
8202
|
const formData = await c.req.formData();
|
|
8203
|
-
const firstName =
|
|
8204
|
-
const lastName =
|
|
8205
|
-
const username =
|
|
8203
|
+
const firstName = chunkCHMO2DOC_cjs.sanitizeInput(formData.get("first_name")?.toString());
|
|
8204
|
+
const lastName = chunkCHMO2DOC_cjs.sanitizeInput(formData.get("last_name")?.toString());
|
|
8205
|
+
const username = chunkCHMO2DOC_cjs.sanitizeInput(formData.get("username")?.toString());
|
|
8206
8206
|
const email = formData.get("email")?.toString()?.trim().toLowerCase() || "";
|
|
8207
|
-
const phone =
|
|
8208
|
-
const bio =
|
|
8207
|
+
const phone = chunkCHMO2DOC_cjs.sanitizeInput(formData.get("phone")?.toString()) || null;
|
|
8208
|
+
const bio = chunkCHMO2DOC_cjs.sanitizeInput(formData.get("bio")?.toString()) || null;
|
|
8209
8209
|
const role = formData.get("role")?.toString() || "viewer";
|
|
8210
8210
|
const password = formData.get("password")?.toString() || "";
|
|
8211
8211
|
const confirmPassword = formData.get("confirm_password")?.toString() || "";
|
|
@@ -8406,12 +8406,12 @@ userRoutes.put("/users/:id", async (c) => {
|
|
|
8406
8406
|
const userId = c.req.param("id");
|
|
8407
8407
|
try {
|
|
8408
8408
|
const formData = await c.req.formData();
|
|
8409
|
-
const firstName =
|
|
8410
|
-
const lastName =
|
|
8411
|
-
const username =
|
|
8409
|
+
const firstName = chunkCHMO2DOC_cjs.sanitizeInput(formData.get("first_name")?.toString());
|
|
8410
|
+
const lastName = chunkCHMO2DOC_cjs.sanitizeInput(formData.get("last_name")?.toString());
|
|
8411
|
+
const username = chunkCHMO2DOC_cjs.sanitizeInput(formData.get("username")?.toString());
|
|
8412
8412
|
const email = formData.get("email")?.toString()?.trim().toLowerCase() || "";
|
|
8413
|
-
const phone =
|
|
8414
|
-
const bio =
|
|
8413
|
+
const phone = chunkCHMO2DOC_cjs.sanitizeInput(formData.get("phone")?.toString()) || null;
|
|
8414
|
+
const bio = chunkCHMO2DOC_cjs.sanitizeInput(formData.get("bio")?.toString()) || null;
|
|
8415
8415
|
const role = formData.get("role")?.toString() || "viewer";
|
|
8416
8416
|
const isActive = formData.get("is_active") === "1";
|
|
8417
8417
|
const emailVerified = formData.get("email_verified") === "1";
|
|
@@ -8554,8 +8554,8 @@ userRoutes.post("/invite-user", async (c) => {
|
|
|
8554
8554
|
const formData = await c.req.formData();
|
|
8555
8555
|
const email = formData.get("email")?.toString()?.trim().toLowerCase() || "";
|
|
8556
8556
|
const role = formData.get("role")?.toString()?.trim() || "viewer";
|
|
8557
|
-
const firstName =
|
|
8558
|
-
const lastName =
|
|
8557
|
+
const firstName = chunkCHMO2DOC_cjs.sanitizeInput(formData.get("first_name")?.toString());
|
|
8558
|
+
const lastName = chunkCHMO2DOC_cjs.sanitizeInput(formData.get("last_name")?.toString());
|
|
8559
8559
|
if (!email || !firstName || !lastName) {
|
|
8560
8560
|
return c.json({ error: "Email, first name, and last name are required" }, 400);
|
|
8561
8561
|
}
|
|
@@ -16374,7 +16374,7 @@ function renderStorageUsage(databaseSizeBytes, mediaSizeBytes) {
|
|
|
16374
16374
|
}
|
|
16375
16375
|
|
|
16376
16376
|
// src/routes/admin-dashboard.ts
|
|
16377
|
-
var VERSION =
|
|
16377
|
+
var VERSION = chunkCHMO2DOC_cjs.getCoreVersion();
|
|
16378
16378
|
var router = new hono.Hono();
|
|
16379
16379
|
router.use("*", chunk3R7EQNGO_cjs.requireAuth());
|
|
16380
16380
|
router.get("/", async (c) => {
|
|
@@ -20191,5 +20191,5 @@ exports.api_system_default = api_system_default;
|
|
|
20191
20191
|
exports.auth_default = auth_default;
|
|
20192
20192
|
exports.router = router;
|
|
20193
20193
|
exports.userRoutes = userRoutes;
|
|
20194
|
-
//# sourceMappingURL=chunk-
|
|
20195
|
-
//# sourceMappingURL=chunk-
|
|
20194
|
+
//# sourceMappingURL=chunk-GN7Q6V5C.cjs.map
|
|
20195
|
+
//# sourceMappingURL=chunk-GN7Q6V5C.cjs.map
|