emdash 0.10.0 → 0.11.1
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/{apply-UsrFuO7l.mjs → apply-Ded_1vng.mjs} +36 -25
- package/dist/{apply-UsrFuO7l.mjs.map → apply-Ded_1vng.mjs.map} +1 -1
- package/dist/astro/index.d.mts +5 -5
- package/dist/astro/index.mjs +1 -1
- package/dist/astro/middleware/auth.d.mts +5 -5
- package/dist/astro/middleware/redirect.mjs +2 -2
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +83 -33
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/types.d.mts +10 -7
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/{byline-C3vnhIpU.mjs → byline-gFn1r0vA.mjs} +2 -2
- package/dist/{byline-C3vnhIpU.mjs.map → byline-gFn1r0vA.mjs.map} +1 -1
- package/dist/{bylines-esI7ioa9.mjs → bylines-DTFI8nDM.mjs} +4 -4
- package/dist/{bylines-esI7ioa9.mjs.map → bylines-DTFI8nDM.mjs.map} +1 -1
- package/dist/{cache-fTzxgMFJ.mjs → cache-BAJbeoZ8.mjs} +2 -2
- package/dist/{cache-fTzxgMFJ.mjs.map → cache-BAJbeoZ8.mjs.map} +1 -1
- package/dist/{chunks-Da2-b-oA.mjs → chunks-BK1oZS-l.mjs} +2 -2
- package/dist/{chunks-Da2-b-oA.mjs.map → chunks-BK1oZS-l.mjs.map} +1 -1
- package/dist/cli/index.mjs +102 -27
- package/dist/cli/index.mjs.map +1 -1
- package/dist/{content-C7G4QXkK.mjs → content-CERxPUN0.mjs} +2 -2
- package/dist/{content-C7G4QXkK.mjs.map → content-CERxPUN0.mjs.map} +1 -1
- package/dist/database/instrumentation.d.mts +6 -4
- package/dist/database/instrumentation.d.mts.map +1 -1
- package/dist/database/instrumentation.mjs +19 -7
- package/dist/database/instrumentation.mjs.map +1 -1
- package/dist/db/index.d.mts +2 -2
- package/dist/db/index.mjs +1 -1
- package/dist/{index-DjPMOfO0.d.mts → index-BogfvE-z.d.mts} +32 -24
- package/dist/index-BogfvE-z.d.mts.map +1 -0
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +19 -19
- package/dist/{load-sXRuM7Us.mjs → load-DR1VwFXR.mjs} +2 -2
- package/dist/{load-sXRuM7Us.mjs.map → load-DR1VwFXR.mjs.map} +1 -1
- package/dist/{loader-Bx2_9-5e.mjs → loader-ou_PXAjg.mjs} +2 -2
- package/dist/{loader-Bx2_9-5e.mjs.map → loader-ou_PXAjg.mjs.map} +1 -1
- package/dist/media/local-runtime.d.mts +5 -5
- package/dist/media/local-runtime.mjs +1 -1
- package/dist/{media-D8FbNsl0.mjs → media-1fFhub9c.mjs} +21 -9
- package/dist/media-1fFhub9c.mjs.map +1 -0
- package/dist/page/index.d.mts +2 -2
- package/dist/plugins/adapt-sandbox-entry.d.mts +5 -5
- package/dist/plugins/adapt-sandbox-entry.mjs +1 -1
- package/dist/{query-Bo-msrmu.mjs → query-8c_meo_K.mjs} +10 -10
- package/dist/{query-Bo-msrmu.mjs.map → query-8c_meo_K.mjs.map} +1 -1
- package/dist/{registry-Beb7wxFc.mjs → registry-Do34mz_P.mjs} +6 -5
- package/dist/registry-Do34mz_P.mjs.map +1 -0
- package/dist/{request-cache-C-tIpYIw.mjs → request-cache-D4I69LeL.mjs} +6 -2
- package/dist/request-cache-D4I69LeL.mjs.map +1 -0
- package/dist/request-context.d.mts +27 -1
- package/dist/request-context.d.mts.map +1 -1
- package/dist/request-context.mjs +16 -3
- package/dist/request-context.mjs.map +1 -1
- package/dist/{runner-DMnlIkh4.mjs → runner-DIcU2UCC.mjs} +174 -152
- package/dist/runner-DIcU2UCC.mjs.map +1 -0
- package/dist/{runner-Clwe4Mme.d.mts → runner-Iu3IZSDM.d.mts} +2 -2
- package/dist/{runner-Clwe4Mme.d.mts.map → runner-Iu3IZSDM.d.mts.map} +1 -1
- package/dist/runtime.d.mts +5 -5
- package/dist/runtime.mjs +1 -1
- package/dist/{search-DkN-BqsS.mjs → search-DuWhx4NG.mjs} +172 -30
- package/dist/search-DuWhx4NG.mjs.map +1 -0
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +10 -10
- package/dist/{taxonomies-CTtewrSQ.mjs → taxonomies-Bw76xAxo.mjs} +6 -6
- package/dist/{taxonomies-CTtewrSQ.mjs.map → taxonomies-Bw76xAxo.mjs.map} +1 -1
- package/dist/{taxonomy-DSxx2K2L.mjs → taxonomy-D6NvlKo8.mjs} +3 -3
- package/dist/{taxonomy-DSxx2K2L.mjs.map → taxonomy-D6NvlKo8.mjs.map} +1 -1
- package/dist/{types-Eg829jj9.mjs → types-56BKbld_.mjs} +1 -1
- package/dist/types-56BKbld_.mjs.map +1 -0
- package/dist/{types-Dtx1mSMX.d.mts → types-BQx6ZXpR.d.mts} +2 -1
- package/dist/types-BQx6ZXpR.d.mts.map +1 -0
- package/dist/{types-Dl1fgFjn.d.mts → types-BTe41zL6.d.mts} +4 -3
- package/dist/types-BTe41zL6.d.mts.map +1 -0
- package/dist/types-DiI8NOG_.mjs +16 -0
- package/dist/types-DiI8NOG_.mjs.map +1 -0
- package/dist/{types-D19uBYWn.d.mts → types-IjUrQMVe.d.mts} +21 -245
- package/dist/types-IjUrQMVe.d.mts.map +1 -0
- package/dist/{validate-DHGwADqO.d.mts → validate-CcVQQpmH.d.mts} +7 -3
- package/dist/validate-CcVQQpmH.d.mts.map +1 -0
- package/dist/{validate-CBIbxM3L.mjs → validate-UK4Ja1uo.mjs} +3 -3
- package/dist/{validate-CBIbxM3L.mjs.map → validate-UK4Ja1uo.mjs.map} +1 -1
- package/dist/{validation-B1NYiEos.mjs → validation-Vc5DQkJa.mjs} +4 -4
- package/dist/{validation-B1NYiEos.mjs.map → validation-Vc5DQkJa.mjs.map} +1 -1
- package/dist/version-JjSqv90m.mjs +7 -0
- package/dist/{version-CMD42IRC.mjs.map → version-JjSqv90m.mjs.map} +1 -1
- package/dist/{zod-generator-BNJDQBSZ.mjs → zod-generator-CHnJUP2l.mjs} +1 -1
- package/dist/{zod-generator-BNJDQBSZ.mjs.map → zod-generator-CHnJUP2l.mjs.map} +1 -1
- package/package.json +9 -8
- package/src/api/errors.ts +5 -0
- package/src/api/handlers/content.ts +9 -0
- package/src/api/handlers/media-allowlist.ts +40 -0
- package/src/api/handlers/media.ts +1 -1
- package/src/api/handlers/menus.ts +158 -28
- package/src/api/handlers/validate-media-fields.ts +125 -0
- package/src/api/schemas/media.ts +23 -3
- package/src/api/schemas/schema.ts +11 -2
- package/src/astro/middleware.ts +46 -11
- package/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +1 -1
- package/src/astro/routes/api/content/[collection]/[id]/duplicate.ts +1 -1
- package/src/astro/routes/api/content/[collection]/[id]/permanent.ts +1 -1
- package/src/astro/routes/api/content/[collection]/[id]/publish.ts +1 -1
- package/src/astro/routes/api/content/[collection]/[id]/restore.ts +1 -1
- package/src/astro/routes/api/content/[collection]/[id]/schedule.ts +2 -2
- package/src/astro/routes/api/content/[collection]/[id]/unpublish.ts +1 -1
- package/src/astro/routes/api/content/[collection]/[id].ts +2 -2
- package/src/astro/routes/api/content/[collection]/index.ts +1 -1
- package/src/astro/routes/api/media/upload-url.ts +10 -4
- package/src/astro/routes/api/media.ts +12 -4
- package/src/astro/types.ts +5 -1
- package/src/auth/rate-limit.ts +3 -3
- package/src/cli/commands/bundle-utils.ts +81 -6
- package/src/cli/commands/bundle.ts +18 -15
- package/src/cli/commands/export-seed.ts +57 -3
- package/src/database/instrumentation.ts +22 -8
- package/src/database/migrations/016_api_tokens.ts +18 -3
- package/src/database/migrations/037_credential_algorithm.ts +18 -0
- package/src/database/migrations/runner.ts +2 -0
- package/src/database/repositories/media.ts +40 -10
- package/src/database/types.ts +2 -1
- package/src/emdash-runtime.ts +16 -3
- package/src/fields/file.ts +7 -6
- package/src/fields/image.ts +12 -11
- package/src/fields/types.ts +3 -0
- package/src/index.ts +1 -1
- package/src/mcp/server.ts +37 -8
- package/src/media/mime.ts +75 -0
- package/src/plugins/types.ts +81 -191
- package/src/request-cache.ts +6 -2
- package/src/request-context.ts +42 -2
- package/src/schema/registry.ts +5 -5
- package/src/schema/types.ts +3 -2
- package/src/seed/apply.ts +25 -8
- package/src/seed/types.ts +4 -0
- package/dist/index-DjPMOfO0.d.mts.map +0 -1
- package/dist/media-D8FbNsl0.mjs.map +0 -1
- package/dist/registry-Beb7wxFc.mjs.map +0 -1
- package/dist/request-cache-C-tIpYIw.mjs.map +0 -1
- package/dist/runner-DMnlIkh4.mjs.map +0 -1
- package/dist/search-DkN-BqsS.mjs.map +0 -1
- package/dist/types-CoO6mpV3.mjs +0 -68
- package/dist/types-CoO6mpV3.mjs.map +0 -1
- package/dist/types-D19uBYWn.d.mts.map +0 -1
- package/dist/types-Dl1fgFjn.d.mts.map +0 -1
- package/dist/types-Dtx1mSMX.d.mts.map +0 -1
- package/dist/types-Eg829jj9.mjs.map +0 -1
- package/dist/validate-DHGwADqO.d.mts.map +0 -1
- package/dist/version-CMD42IRC.mjs +0 -7
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { i as __exportAll } from "./runner-
|
|
1
|
+
import { i as __exportAll } from "./runner-DIcU2UCC.mjs";
|
|
2
2
|
import { n as getI18nConfig } from "./config-CVssduLe.mjs";
|
|
3
|
-
import { r as RevisionRepository, t as ContentRepository } from "./content-
|
|
4
|
-
import { t as MediaRepository } from "./media-
|
|
5
|
-
import { t as TaxonomyRepository } from "./taxonomy-
|
|
3
|
+
import { r as RevisionRepository, t as ContentRepository } from "./content-CERxPUN0.mjs";
|
|
4
|
+
import { t as MediaRepository } from "./media-1fFhub9c.mjs";
|
|
5
|
+
import { t as TaxonomyRepository } from "./taxonomy-D6NvlKo8.mjs";
|
|
6
6
|
import { t as OptionsRepository } from "./options-nPxWnrya.mjs";
|
|
7
7
|
import { t as withTransaction } from "./transaction-D44LBXvU.mjs";
|
|
8
8
|
import { t as RedirectRepository } from "./redirect-C5H7VGIX.mjs";
|
|
9
|
-
import { t as BylineRepository } from "./byline-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { t as validateSeed } from "./validate-
|
|
9
|
+
import { t as BylineRepository } from "./byline-gFn1r0vA.mjs";
|
|
10
|
+
import { n as requestCached, t as peekRequestCache } from "./request-cache-D4I69LeL.mjs";
|
|
11
|
+
import { i as FTSManager, n as SchemaRegistry } from "./registry-Do34mz_P.mjs";
|
|
12
|
+
import { r as getDb } from "./loader-ou_PXAjg.mjs";
|
|
13
|
+
import { t as validateSeed } from "./validate-UK4Ja1uo.mjs";
|
|
14
14
|
import { ulid } from "ulidx";
|
|
15
15
|
import { imageSize } from "image-size";
|
|
16
16
|
import mime from "mime/lite";
|
|
@@ -908,6 +908,7 @@ async function applySeed(db, seed, options = {}) {
|
|
|
908
908
|
}
|
|
909
909
|
if (seed.menus) {
|
|
910
910
|
const menuSeedIdMap = /* @__PURE__ */ new Map();
|
|
911
|
+
const itemSeedIdMap = /* @__PURE__ */ new Map();
|
|
911
912
|
const fallbackLocale = getI18nConfig()?.defaultLocale ?? "en";
|
|
912
913
|
for (const menu of seed.menus) {
|
|
913
914
|
const locale = menu.locale ?? fallbackLocale;
|
|
@@ -941,7 +942,7 @@ async function applySeed(db, seed, options = {}) {
|
|
|
941
942
|
id: menuId,
|
|
942
943
|
translationGroup
|
|
943
944
|
});
|
|
944
|
-
const itemCount = await applyMenuItems(db, menuId, locale, menu.items, null, 0, seedIdMap);
|
|
945
|
+
const itemCount = await applyMenuItems(db, menuId, locale, menu.items, null, 0, seedIdMap, itemSeedIdMap);
|
|
945
946
|
result.menus.items += itemCount;
|
|
946
947
|
}
|
|
947
948
|
}
|
|
@@ -1042,9 +1043,9 @@ async function applySeed(db, seed, options = {}) {
|
|
|
1042
1043
|
}
|
|
1043
1044
|
}
|
|
1044
1045
|
}
|
|
1045
|
-
const { invalidateBylineCache } = await import("./bylines-
|
|
1046
|
-
const { invalidateRedirectCache } = await import("./cache-
|
|
1047
|
-
const { invalidateUrlPatternCache } = await import("./query-
|
|
1046
|
+
const { invalidateBylineCache } = await import("./bylines-DTFI8nDM.mjs").then((n) => n.t);
|
|
1047
|
+
const { invalidateRedirectCache } = await import("./cache-BAJbeoZ8.mjs").then((n) => n.t);
|
|
1048
|
+
const { invalidateUrlPatternCache } = await import("./query-8c_meo_K.mjs").then((n) => n.o);
|
|
1048
1049
|
invalidateBylineCache();
|
|
1049
1050
|
invalidateRedirectCache();
|
|
1050
1051
|
invalidateUrlPatternCache();
|
|
@@ -1128,7 +1129,7 @@ async function applyContentTaxonomies(db, collectionSlug, contentId, entry, isUp
|
|
|
1128
1129
|
if (isUpdate) await db.deleteFrom("content_taxonomies").where("collection", "=", collectionSlug).where("entry_id", "=", contentId).execute();
|
|
1129
1130
|
if (!entry.taxonomies) {
|
|
1130
1131
|
if (isUpdate) {
|
|
1131
|
-
const { invalidateTermCache } = await import("./taxonomies-
|
|
1132
|
+
const { invalidateTermCache } = await import("./taxonomies-Bw76xAxo.mjs").then((n) => n.u);
|
|
1132
1133
|
invalidateTermCache();
|
|
1133
1134
|
}
|
|
1134
1135
|
return;
|
|
@@ -1140,23 +1141,23 @@ async function applyContentTaxonomies(db, collectionSlug, contentId, entry, isUp
|
|
|
1140
1141
|
if (term) await termRepo.attachToEntry(collectionSlug, contentId, term.id);
|
|
1141
1142
|
}
|
|
1142
1143
|
}
|
|
1143
|
-
const { invalidateTermCache } = await import("./taxonomies-
|
|
1144
|
+
const { invalidateTermCache } = await import("./taxonomies-Bw76xAxo.mjs").then((n) => n.u);
|
|
1144
1145
|
invalidateTermCache();
|
|
1145
1146
|
}
|
|
1146
1147
|
/**
|
|
1147
1148
|
* Apply menu items recursively.
|
|
1148
1149
|
*
|
|
1149
|
-
*
|
|
1150
|
-
*
|
|
1151
|
-
*
|
|
1152
|
-
*
|
|
1153
|
-
* already holds the content's translation_group.
|
|
1150
|
+
* When a `SeedMenuItem` carries `id`/`translationOf`, the import resolves the
|
|
1151
|
+
* source item's `translation_group` so cross-locale "same nav entry" links
|
|
1152
|
+
* survive export → apply. Items without `translationOf` get a fresh group
|
|
1153
|
+
* (= their own id).
|
|
1154
1154
|
*/
|
|
1155
|
-
async function applyMenuItems(db, menuId, locale, items, parentId, startOrder, seedIdMap) {
|
|
1155
|
+
async function applyMenuItems(db, menuId, locale, items, parentId, startOrder, seedIdMap, itemSeedIdMap) {
|
|
1156
1156
|
let count = 0;
|
|
1157
1157
|
let order = startOrder;
|
|
1158
1158
|
for (const item of items) {
|
|
1159
1159
|
const itemId = ulid();
|
|
1160
|
+
const itemLocale = item.locale ?? locale;
|
|
1160
1161
|
let referenceId = null;
|
|
1161
1162
|
let referenceCollection = null;
|
|
1162
1163
|
if (item.type === "page" || item.type === "post") {
|
|
@@ -1165,6 +1166,12 @@ async function applyMenuItems(db, menuId, locale, items, parentId, startOrder, s
|
|
|
1165
1166
|
referenceCollection = item.collection || `${item.type}s`;
|
|
1166
1167
|
}
|
|
1167
1168
|
}
|
|
1169
|
+
let translationGroup = itemId;
|
|
1170
|
+
if (item.translationOf) {
|
|
1171
|
+
const source = itemSeedIdMap.get(item.translationOf);
|
|
1172
|
+
if (source) translationGroup = source.translationGroup;
|
|
1173
|
+
else console.warn(`menu item "${item.label ?? item.url ?? item.ref ?? "(unlabeled)"}" (${itemLocale}): translationOf "${item.translationOf}" not found yet; minting a fresh group.`);
|
|
1174
|
+
}
|
|
1168
1175
|
await db.insertInto("_emdash_menu_items").values({
|
|
1169
1176
|
id: itemId,
|
|
1170
1177
|
menu_id: menuId,
|
|
@@ -1179,13 +1186,17 @@ async function applyMenuItems(db, menuId, locale, items, parentId, startOrder, s
|
|
|
1179
1186
|
target: item.target ?? null,
|
|
1180
1187
|
css_classes: item.cssClasses ?? null,
|
|
1181
1188
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1182
|
-
locale,
|
|
1183
|
-
translation_group:
|
|
1189
|
+
locale: itemLocale,
|
|
1190
|
+
translation_group: translationGroup
|
|
1184
1191
|
}).execute();
|
|
1192
|
+
if (item.id) itemSeedIdMap.set(item.id, {
|
|
1193
|
+
id: itemId,
|
|
1194
|
+
translationGroup
|
|
1195
|
+
});
|
|
1185
1196
|
count++;
|
|
1186
1197
|
order++;
|
|
1187
1198
|
if (item.children && item.children.length > 0) {
|
|
1188
|
-
const childCount = await applyMenuItems(db, menuId,
|
|
1199
|
+
const childCount = await applyMenuItems(db, menuId, itemLocale, item.children, itemId, 0, seedIdMap, itemSeedIdMap);
|
|
1189
1200
|
count += childCount;
|
|
1190
1201
|
}
|
|
1191
1202
|
}
|
|
@@ -1377,4 +1388,4 @@ function getImageDimensions(buffer) {
|
|
|
1377
1388
|
|
|
1378
1389
|
//#endregion
|
|
1379
1390
|
export { ssrfSafeFetch as a, getPluginSetting as c, getSiteSettings as d, setSiteSettings as f, resolveAndValidateExternalUrl as i, getPluginSettings as l, apply_exports as n, stripCredentialHeaders as o, SsrfError as r, validateExternalUrl as s, applySeed as t, getSiteSetting as u };
|
|
1380
|
-
//# sourceMappingURL=apply-
|
|
1391
|
+
//# sourceMappingURL=apply-Ded_1vng.mjs.map
|