emdash 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapters-N6BF7RCD.d.mts → adapters-BLMa4JGD.d.mts} +1 -1
- package/dist/{adapters-N6BF7RCD.d.mts.map → adapters-BLMa4JGD.d.mts.map} +1 -1
- package/dist/{apply-wmVEOSbR.mjs → apply-Bqoekfbe.mjs} +6 -6
- package/dist/{apply-wmVEOSbR.mjs.map → apply-Bqoekfbe.mjs.map} +1 -1
- package/dist/astro/index.d.mts +25 -11
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +31 -19
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +5 -5
- package/dist/astro/middleware/auth.mjs +1 -1
- package/dist/astro/middleware/redirect.mjs +2 -2
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.mjs +20 -16
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/types.d.mts +9 -9
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/{byline-1WQPlISL.mjs → byline-BGj9p9Ht.mjs} +3 -3
- package/dist/{byline-1WQPlISL.mjs.map → byline-BGj9p9Ht.mjs.map} +1 -1
- package/dist/{bylines-BYdTYmia.mjs → bylines-BihaoIDY.mjs} +5 -5
- package/dist/{bylines-BYdTYmia.mjs.map → bylines-BihaoIDY.mjs.map} +1 -1
- package/dist/cli/index.mjs +8 -8
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.mjs +1 -1
- package/dist/{content-BmXndhdi.mjs → content-BsBoyj8G.mjs} +20 -3
- package/dist/content-BsBoyj8G.mjs.map +1 -0
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +2 -2
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/{dialect-helpers-B9uSp2GJ.mjs → dialect-helpers-DhTzaUxP.mjs} +4 -1
- package/dist/dialect-helpers-DhTzaUxP.mjs.map +1 -0
- package/dist/{index-UHEVQMus.d.mts → index-Cff7AimE.d.mts} +40 -16
- package/dist/index-Cff7AimE.d.mts.map +1 -0
- package/dist/index.d.mts +11 -11
- package/dist/index.mjs +12 -12
- package/dist/{loader-CHb2v0jm.mjs → loader-BmYdf3Dr.mjs} +4 -2
- package/dist/loader-BmYdf3Dr.mjs.map +1 -0
- package/dist/media/index.d.mts +1 -1
- package/dist/media/local-runtime.d.mts +7 -7
- package/dist/{mode-CYeM2rPt.mjs → mode-C2EzN1uE.mjs} +1 -1
- package/dist/{mode-CYeM2rPt.mjs.map → mode-C2EzN1uE.mjs.map} +1 -1
- package/dist/page/index.d.mts +1 -1
- package/dist/{placeholder-bOx1xCTY.d.mts → placeholder-SvFCKbz_.d.mts} +1 -1
- package/dist/{placeholder-bOx1xCTY.d.mts.map → placeholder-SvFCKbz_.d.mts.map} +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +5 -5
- package/dist/{query-5Hcv_5ER.mjs → query-sesiOndV.mjs} +6 -6
- package/dist/{query-5Hcv_5ER.mjs.map → query-sesiOndV.mjs.map} +1 -1
- package/dist/{redirect-DIfIni3r.mjs → redirect-DUAk-Yl_.mjs} +9 -2
- package/dist/redirect-DUAk-Yl_.mjs.map +1 -0
- package/dist/{registry-1EvbAfsC.mjs → registry-DU18yVo0.mjs} +9 -3
- package/dist/registry-DU18yVo0.mjs.map +1 -0
- package/dist/{runner-BoN0-FPi.mjs → runner-Biufrii2.mjs} +3 -3
- package/dist/{runner-BoN0-FPi.mjs.map → runner-Biufrii2.mjs.map} +1 -1
- package/dist/{runner-DTqkzOzc.d.mts → runner-EAtf0ZIe.d.mts} +2 -2
- package/dist/{runner-DTqkzOzc.d.mts.map → runner-EAtf0ZIe.d.mts.map} +1 -1
- package/dist/runtime.d.mts +6 -6
- package/dist/runtime.mjs +2 -2
- package/dist/{search-BsYMed12.mjs → search-BXB-jfu2.mjs} +13 -11
- package/dist/search-BXB-jfu2.mjs.map +1 -0
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +7 -7
- package/dist/seo/index.d.mts +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/s3.d.mts +11 -3
- package/dist/storage/s3.d.mts.map +1 -1
- package/dist/storage/s3.mjs +75 -14
- package/dist/storage/s3.mjs.map +1 -1
- package/dist/{transport-COOs9GSE.d.mts → transport-BFGblqwG.d.mts} +1 -1
- package/dist/{transport-COOs9GSE.d.mts.map → transport-BFGblqwG.d.mts.map} +1 -1
- package/dist/{transport-Bl8cTdYt.mjs → transport-yxiQsi8I.mjs} +1 -1
- package/dist/{transport-Bl8cTdYt.mjs.map → transport-yxiQsi8I.mjs.map} +1 -1
- package/dist/{types-CIsTnQvJ.d.mts → types-BbsYgi_R.d.mts} +1 -1
- package/dist/{types-CIsTnQvJ.d.mts.map → types-BbsYgi_R.d.mts.map} +1 -1
- package/dist/types-Bec-r_3_.mjs.map +1 -1
- package/dist/{types-BljtYPSd.d.mts → types-C1-PVaS_.d.mts} +14 -6
- package/dist/types-C1-PVaS_.d.mts.map +1 -0
- package/dist/{types-6dqxBqsH.d.mts → types-CaKte3hR.d.mts} +102 -4
- package/dist/types-CaKte3hR.d.mts.map +1 -0
- package/dist/{types-CcreFIIH.d.mts → types-DPfzHnjW.d.mts} +1 -1
- package/dist/{types-CcreFIIH.d.mts.map → types-DPfzHnjW.d.mts.map} +1 -1
- package/dist/{types-7-UjSEyB.d.mts → types-DRjfYOEv.d.mts} +1 -1
- package/dist/{types-7-UjSEyB.d.mts.map → types-DRjfYOEv.d.mts.map} +1 -1
- package/dist/{validate-CqRJb_xU.mjs → validate-VPnKoIzW.mjs} +11 -11
- package/dist/{validate-CqRJb_xU.mjs.map → validate-VPnKoIzW.mjs.map} +1 -1
- package/dist/{validate-B7KP7VLM.d.mts → validate-bfg9OR6N.d.mts} +4 -4
- package/dist/{validate-B7KP7VLM.d.mts.map → validate-bfg9OR6N.d.mts.map} +1 -1
- package/dist/version-REAapfsU.mjs +7 -0
- package/dist/version-REAapfsU.mjs.map +1 -0
- package/package.json +5 -5
- package/src/api/handlers/redirects.ts +95 -3
- package/src/api/schemas/redirects.ts +1 -0
- package/src/astro/integration/vite-config.ts +7 -4
- package/src/astro/routes/admin.astro +2 -2
- package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +2 -0
- package/src/astro/routes/api/import/wordpress/rewrite-urls.ts +2 -0
- package/src/astro/routes/api/manifest.ts +3 -1
- package/src/astro/storage/adapters.ts +19 -5
- package/src/astro/storage/types.ts +12 -4
- package/src/astro/types.ts +1 -0
- package/src/bylines/index.ts +2 -2
- package/src/database/dialect-helpers.ts +3 -0
- package/src/database/repositories/content.ts +5 -0
- package/src/database/repositories/redirect.ts +13 -0
- package/src/database/validate.ts +10 -10
- package/src/emdash-runtime.ts +5 -1
- package/src/index.ts +1 -0
- package/src/loader.ts +2 -0
- package/src/menus/index.ts +4 -0
- package/src/redirects/loops.ts +318 -0
- package/src/schema/registry.ts +3 -0
- package/src/search/fts-manager.ts +4 -0
- package/src/storage/s3.ts +94 -25
- package/src/storage/types.ts +13 -5
- package/src/utils/slugify.ts +11 -0
- package/src/version.ts +12 -0
- package/dist/content-BmXndhdi.mjs.map +0 -1
- package/dist/dialect-helpers-B9uSp2GJ.mjs.map +0 -1
- package/dist/index-UHEVQMus.d.mts.map +0 -1
- package/dist/loader-CHb2v0jm.mjs.map +0 -1
- package/dist/redirect-DIfIni3r.mjs.map +0 -1
- package/dist/registry-1EvbAfsC.mjs.map +0 -1
- package/dist/search-BsYMed12.mjs.map +0 -1
- package/dist/types-6dqxBqsH.d.mts.map +0 -1
- package/dist/types-BljtYPSd.d.mts.map +0 -1
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import "../connection-B4zVnQIa.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { t as validateIdentifier } from "../validate-VPnKoIzW.mjs";
|
|
3
|
+
import { a as isSqlite } from "../dialect-helpers-DhTzaUxP.mjs";
|
|
4
|
+
import { r as runMigrations } from "../runner-Biufrii2.mjs";
|
|
5
|
+
import { $ as sanitizeHeadersForSandbox, At as handleContentGet, Bt as handleContentUnschedule, Ct as handleContentCompare, Dt as handleContentDelete, Et as handleContentCreate, Ft as handleContentPublish, G as DEV_CONSOLE_EMAIL_PLUGIN_ID, Ht as validateRev, It as handleContentRestore, K as devConsoleEmailDeliver, Lt as handleContentSchedule, Mt as handleContentList, Nt as handleContentListTrashed, Ot as handleContentDiscardDraft, Pt as handleContentPermanentDelete, Q as extractRequestMeta, Rt as handleContentTranslations, St as hashString, Tt as handleContentCountTrashed, Vt as handleContentUpdate, W as PluginRouteRegistry, X as resolveExclusiveHooks, Y as createHookPipeline, Z as CronExecutor, _t as handleRevisionGet, et as definePlugin, ft as handleMediaCreate, gt as handleMediaUpdate, ht as handleMediaList, jt as handleContentGetIncludingTrashed, kt as handleContentDuplicate, mt as handleMediaGet, pt as handleMediaDelete, q as EmailPipeline, st as loadBundleFromR2, ut as PluginStateRepository, vt as handleRevisionList, wt as handleContentCountScheduled, yt as handleRevisionRestore, zt as handleContentUnpublish } from "../search-BXB-jfu2.mjs";
|
|
6
|
+
import { r as RevisionRepository } from "../content-BsBoyj8G.mjs";
|
|
6
7
|
import "../base64-MBPo9ozB.mjs";
|
|
7
8
|
import "../types-CMMN0pNg.mjs";
|
|
8
9
|
import { t as MediaRepository } from "../media-DqHVh136.mjs";
|
|
9
|
-
import { f as OptionsRepository } from "../apply-
|
|
10
|
-
import { i as FTSManager, n as SchemaRegistry } from "../registry-
|
|
11
|
-
import "../redirect-
|
|
12
|
-
import "../byline-
|
|
10
|
+
import { f as OptionsRepository } from "../apply-Bqoekfbe.mjs";
|
|
11
|
+
import { i as FTSManager, n as SchemaRegistry } from "../registry-DU18yVo0.mjs";
|
|
12
|
+
import "../redirect-DUAk-Yl_.mjs";
|
|
13
|
+
import "../byline-BGj9p9Ht.mjs";
|
|
13
14
|
import { n as normalizeMediaValue } from "../placeholder-aiCD8aSZ.mjs";
|
|
14
15
|
import { i as setI18nConfig } from "../config-Cq8H0SfX.mjs";
|
|
15
16
|
import { getRequestContext, runWithContext } from "../request-context.mjs";
|
|
16
|
-
import { n as getDb } from "../loader-
|
|
17
|
+
import { n as getDb } from "../loader-BmYdf3Dr.mjs";
|
|
17
18
|
import { r as normalizeManifestRoute } from "../manifest-schema-CuMio1A9.mjs";
|
|
18
|
-
import "../query-
|
|
19
|
+
import "../query-sesiOndV.mjs";
|
|
19
20
|
import "../tokens-DrB-W6Q-.mjs";
|
|
20
|
-
import "../bylines-
|
|
21
|
+
import "../bylines-BihaoIDY.mjs";
|
|
21
22
|
import "../load-Veizk2cT.mjs";
|
|
22
23
|
import "../index.mjs";
|
|
23
|
-
import { t as
|
|
24
|
+
import { n as VERSION, t as COMMIT } from "../version-REAapfsU.mjs";
|
|
25
|
+
import { t as getAuthMode } from "../mode-C2EzN1uE.mjs";
|
|
24
26
|
import { Kysely, sql } from "kysely";
|
|
25
27
|
import { defineMiddleware } from "astro:middleware";
|
|
26
28
|
import virtualConfig from "virtual:emdash/config";
|
|
@@ -722,7 +724,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
722
724
|
}
|
|
723
725
|
})();
|
|
724
726
|
if (collectionCount.count === 0 && !setupDone) {
|
|
725
|
-
const { applySeed } = await import("../apply-
|
|
727
|
+
const { applySeed } = await import("../apply-Bqoekfbe.mjs").then((n) => n.n);
|
|
726
728
|
const { loadSeed } = await import("../load-Veizk2cT.mjs").then((n) => n.r);
|
|
727
729
|
const { validateSeed } = await import("../validate-CXnRKfJK.mjs").then((n) => n.n);
|
|
728
730
|
const seed = await loadSeed();
|
|
@@ -971,7 +973,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
971
973
|
locales: i18nConfig.locales
|
|
972
974
|
} : void 0;
|
|
973
975
|
return {
|
|
974
|
-
version:
|
|
976
|
+
version: VERSION,
|
|
977
|
+
commit: COMMIT,
|
|
975
978
|
hash: manifestHash,
|
|
976
979
|
collections: manifestCollections,
|
|
977
980
|
plugins: manifestPlugins,
|
|
@@ -1010,7 +1013,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1010
1013
|
return result;
|
|
1011
1014
|
}
|
|
1012
1015
|
async handleContentUpdate(collection, id, body) {
|
|
1013
|
-
const { ContentRepository } = await import("../content-
|
|
1016
|
+
const { ContentRepository } = await import("../content-BsBoyj8G.mjs").then((n) => n.n);
|
|
1014
1017
|
const repo = new ContentRepository(this.db);
|
|
1015
1018
|
const resolvedItem = await repo.findByIdOrSlug(collection, id);
|
|
1016
1019
|
const resolvedId = resolvedItem?.id ?? id;
|
|
@@ -1061,6 +1064,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1061
1064
|
data: mergedData,
|
|
1062
1065
|
authorId: bodyWithoutRev.authorId ?? void 0
|
|
1063
1066
|
});
|
|
1067
|
+
validateIdentifier(collection, "collection");
|
|
1064
1068
|
const tableName = `ec_${collection}`;
|
|
1065
1069
|
await sql`
|
|
1066
1070
|
UPDATE ${sql.ref(tableName)}
|
|
@@ -1571,7 +1575,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
1571
1575
|
if (!isEmDashRoute && !isPublicRuntimeRoute && !hasEditCookie && !hasPreviewToken) {
|
|
1572
1576
|
if (!(context.isPrerendered ? null : await context.session?.get("user")) && !playgroundDb) {
|
|
1573
1577
|
if (!setupVerified) try {
|
|
1574
|
-
const { getDb } = await import("../loader-
|
|
1578
|
+
const { getDb } = await import("../loader-BmYdf3Dr.mjs").then((n) => n.r);
|
|
1575
1579
|
await (await getDb()).selectFrom("_emdash_migrations").selectAll().limit(1).execute();
|
|
1576
1580
|
setupVerified = true;
|
|
1577
1581
|
} catch {
|