emdash 0.9.0 → 0.11.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-DoNJiveC.d.mts → adapters-BktHA7EO.d.mts} +1 -1
- package/dist/{adapters-DoNJiveC.d.mts.map → adapters-BktHA7EO.d.mts.map} +1 -1
- package/dist/{apply-BzltprvY.mjs → apply-Ded_1vng.mjs} +167 -254
- package/dist/apply-Ded_1vng.mjs.map +1 -0
- package/dist/astro/index.d.mts +6 -6
- package/dist/astro/index.mjs +10 -2
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +5 -5
- package/dist/astro/middleware/auth.mjs +5 -5
- package/dist/astro/middleware/redirect.mjs +5 -5
- package/dist/astro/middleware/request-context.mjs +4 -4
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +94 -43
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/types.d.mts +12 -11
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/{base64-BRICGH2l.mjs → base64-MBPo9ozB.mjs} +1 -1
- package/dist/{base64-BRICGH2l.mjs.map → base64-MBPo9ozB.mjs.map} +1 -1
- package/dist/{byline-BSaNL1w7.mjs → byline-gFn1r0vA.mjs} +4 -4
- package/dist/{byline-BSaNL1w7.mjs.map → byline-gFn1r0vA.mjs.map} +1 -1
- package/dist/{bylines-CvJ3PYz2.mjs → bylines-DTFI8nDM.mjs} +5 -5
- package/dist/{bylines-CvJ3PYz2.mjs.map → bylines-DTFI8nDM.mjs.map} +1 -1
- package/dist/{cache-C6N_hhN7.mjs → cache-BAJbeoZ8.mjs} +3 -3
- package/dist/{cache-C6N_hhN7.mjs.map → cache-BAJbeoZ8.mjs.map} +1 -1
- package/dist/{chunks-NBQVDOci.mjs → chunks-BK1oZS-l.mjs} +2 -2
- package/dist/{chunks-NBQVDOci.mjs.map → chunks-BK1oZS-l.mjs.map} +1 -1
- package/dist/cli/index.mjs +342 -95
- package/dist/cli/index.mjs.map +1 -1
- 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/{config-BI0V3ICQ.mjs → config-CVssduLe.mjs} +1 -1
- package/dist/{config-BI0V3ICQ.mjs.map → config-CVssduLe.mjs.map} +1 -1
- package/dist/{content-8lOYF0pr.mjs → content-CERxPUN0.mjs} +14 -3
- package/dist/content-CERxPUN0.mjs.map +1 -0
- 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 +3 -3
- package/dist/db/index.mjs +1 -1
- 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/{db-errors-WRezodiz.mjs → db-errors-B7P2pSCn.mjs} +1 -1
- package/dist/{db-errors-WRezodiz.mjs.map → db-errors-B7P2pSCn.mjs.map} +1 -1
- package/dist/{default-D8ksjWhO.mjs → default-pHuz9WF6.mjs} +1 -1
- package/dist/{default-D8ksjWhO.mjs.map → default-pHuz9WF6.mjs.map} +1 -1
- package/dist/{error-D_-tqP-I.mjs → error-DqnRMM5z.mjs} +1 -1
- package/dist/{error-D_-tqP-I.mjs.map → error-DqnRMM5z.mjs.map} +1 -1
- package/dist/{index-BFRaVcD6.d.mts → index-Cg-rC4Gj.d.mts} +110 -87
- package/dist/index-Cg-rC4Gj.d.mts.map +1 -0
- package/dist/index.d.mts +11 -11
- package/dist/index.mjs +29 -28
- package/dist/{load-DDqMMvZL.mjs → load-DR1VwFXR.mjs} +2 -2
- package/dist/{load-DDqMMvZL.mjs.map → load-DR1VwFXR.mjs.map} +1 -1
- package/dist/{loader-CKLbBnhK.mjs → loader-ou_PXAjg.mjs} +31 -6
- package/dist/loader-ou_PXAjg.mjs.map +1 -0
- package/dist/{manifest-schema-DqWNC3lM.mjs → manifest-schema-CXAbd1vH.mjs} +1 -1
- package/dist/{manifest-schema-DqWNC3lM.mjs.map → manifest-schema-CXAbd1vH.mjs.map} +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +1 -1
- package/dist/media/local-runtime.d.mts +7 -7
- package/dist/media/local-runtime.mjs +3 -3
- package/dist/{media-BW32b4gi.mjs → media-1fFhub9c.mjs} +22 -10
- package/dist/media-1fFhub9c.mjs.map +1 -0
- package/dist/{mode-ier8jbBk.mjs → mode-YhqNVef_.mjs} +1 -1
- package/dist/{mode-ier8jbBk.mjs.map → mode-YhqNVef_.mjs.map} +1 -1
- package/dist/{options-BVp3UsTS.mjs → options-nPxWnrya.mjs} +1 -1
- package/dist/{options-BVp3UsTS.mjs.map → options-nPxWnrya.mjs.map} +1 -1
- package/dist/page/index.d.mts +2 -2
- package/dist/{patterns-CrCYkMBb.mjs → patterns-DsUZ4uxI.mjs} +1 -1
- package/dist/{patterns-CrCYkMBb.mjs.map → patterns-DsUZ4uxI.mjs.map} +1 -1
- package/dist/{placeholder-BE4o_2dc.d.mts → placeholder-CDPtkelt.d.mts} +1 -1
- package/dist/{placeholder-BE4o_2dc.d.mts.map → placeholder-CDPtkelt.d.mts.map} +1 -1
- package/dist/{placeholder-CIJejMlK.mjs → placeholder-Ci0RLeCk.mjs} +1 -1
- package/dist/{placeholder-CIJejMlK.mjs.map → placeholder-Ci0RLeCk.mjs.map} +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +5 -5
- package/dist/plugins/adapt-sandbox-entry.mjs +2 -2
- package/dist/{public-url-DByxYjUw.mjs → public-url-B1AxbbbQ.mjs} +1 -1
- package/dist/{public-url-DByxYjUw.mjs.map → public-url-B1AxbbbQ.mjs.map} +1 -1
- package/dist/{query-Cg9ZKRQ0.mjs → query-8c_meo_K.mjs} +13 -13
- package/dist/{query-Cg9ZKRQ0.mjs.map → query-8c_meo_K.mjs.map} +1 -1
- package/dist/{redirect-BhUBKRc1.mjs → redirect-C5H7VGIX.mjs} +3 -3
- package/dist/{redirect-BhUBKRc1.mjs.map → redirect-C5H7VGIX.mjs.map} +1 -1
- package/dist/{registry-Dw70ChxB.mjs → registry-Do34mz_P.mjs} +7 -6
- package/dist/registry-Do34mz_P.mjs.map +1 -0
- package/dist/{request-cache-B-bmkipQ.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-C7ADox5q.mjs → runner-DIcU2UCC.mjs} +465 -148
- package/dist/runner-DIcU2UCC.mjs.map +1 -0
- package/dist/{runner-Bnoj7vjK.d.mts → runner-Iu3IZSDM.d.mts} +2 -2
- package/dist/{runner-Bnoj7vjK.d.mts.map → runner-Iu3IZSDM.d.mts.map} +1 -1
- package/dist/runtime.d.mts +6 -6
- package/dist/runtime.mjs +3 -3
- package/dist/{search-dOGEccMa.mjs → search-DuWhx4NG.mjs} +322 -108
- package/dist/search-DuWhx4NG.mjs.map +1 -0
- package/dist/{secrets-CW3reAnU.mjs → secrets-CZ8rxLX3.mjs} +3 -3
- package/dist/{secrets-CW3reAnU.mjs.map → secrets-CZ8rxLX3.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +15 -14
- package/dist/seo/index.d.mts +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/taxonomies-Bw76xAxo.mjs +407 -0
- package/dist/taxonomies-Bw76xAxo.mjs.map +1 -0
- package/dist/taxonomy-D6NvlKo8.mjs +218 -0
- package/dist/taxonomy-D6NvlKo8.mjs.map +1 -0
- package/dist/{tokens-D7zMmWi2.mjs → tokens-CyRDPVW2.mjs} +2 -2
- package/dist/{tokens-D7zMmWi2.mjs.map → tokens-CyRDPVW2.mjs.map} +1 -1
- package/dist/{transaction-Cn2rjY78.mjs → transaction-D44LBXvU.mjs} +1 -1
- package/dist/{transaction-Cn2rjY78.mjs.map → transaction-D44LBXvU.mjs.map} +1 -1
- package/dist/{transport-DNEfeMaU.d.mts → transport-DX_5rpsq.d.mts} +1 -1
- package/dist/{transport-DNEfeMaU.d.mts.map → transport-DX_5rpsq.d.mts.map} +1 -1
- package/dist/{transport-BeMCmin1.mjs → transport-xpzIjCIB.mjs} +1 -1
- package/dist/{transport-BeMCmin1.mjs.map → transport-xpzIjCIB.mjs.map} +1 -1
- package/dist/{types-CIOg5AR8.mjs → types-56BKbld_.mjs} +1 -1
- package/dist/types-56BKbld_.mjs.map +1 -0
- package/dist/{types-CRxNbK-Z.mjs → types-BIgulNsW.mjs} +2 -2
- package/dist/{types-CRxNbK-Z.mjs.map → types-BIgulNsW.mjs.map} +1 -1
- package/dist/{types-CrtWgIvl.d.mts → types-BQx6ZXpR.d.mts} +10 -1
- package/dist/types-BQx6ZXpR.d.mts.map +1 -0
- package/dist/{types-CJsYGpco.d.mts → types-B_CXXnzh.d.mts} +1 -1
- package/dist/{types-CJsYGpco.d.mts.map → types-B_CXXnzh.d.mts.map} +1 -1
- package/dist/{types-M78DQ1lx.d.mts → types-C-aFbqmA.d.mts} +1 -1
- package/dist/{types-M78DQ1lx.d.mts.map → types-C-aFbqmA.d.mts.map} +1 -1
- package/dist/types-DiI8NOG_.mjs +16 -0
- package/dist/types-DiI8NOG_.mjs.map +1 -0
- package/dist/{types-BuBIptGk.d.mts → types-IN5z_S3P.d.mts} +158 -92
- package/dist/types-IN5z_S3P.d.mts.map +1 -0
- package/dist/{types-BSyXeCFW.d.mts → types-IZSZfEwv.d.mts} +4 -3
- package/dist/types-IZSZfEwv.d.mts.map +1 -0
- package/dist/{types-CDbKp7ND.mjs → types-K-EkEQCI.mjs} +1 -1
- package/dist/{types-CDbKp7ND.mjs.map → types-K-EkEQCI.mjs.map} +1 -1
- package/dist/{validate-BfQh_C_y.d.mts → validate-CO3JjFV5.d.mts} +22 -5
- package/dist/validate-CO3JjFV5.d.mts.map +1 -0
- package/dist/{validate-Baqf0slj.mjs → validate-UK4Ja1uo.mjs} +14 -10
- package/dist/validate-UK4Ja1uo.mjs.map +1 -0
- package/dist/{validation-BfEI7tNe.mjs → validation-Vc5DQkJa.mjs} +5 -5
- package/dist/{validation-BfEI7tNe.mjs.map → validation-Vc5DQkJa.mjs.map} +1 -1
- package/dist/version-Bg31I_Ff.mjs +7 -0
- package/dist/{version-DoxrVdYf.mjs.map → version-Bg31I_Ff.mjs.map} +1 -1
- package/dist/{zod-generator-CC0xNe_K.mjs → zod-generator-CHnJUP2l.mjs} +8 -3
- package/dist/zod-generator-CHnJUP2l.mjs.map +1 -0
- package/package.json +9 -8
- package/src/api/errors.ts +5 -0
- package/src/api/handlers/content.ts +20 -0
- package/src/api/handlers/dashboard.ts +29 -36
- package/src/api/handlers/media-allowlist.ts +40 -0
- package/src/api/handlers/media.ts +1 -1
- package/src/api/handlers/menus.ts +400 -89
- package/src/api/handlers/taxonomies.ts +273 -97
- package/src/api/handlers/validate-media-fields.ts +125 -0
- package/src/api/schemas/common.ts +7 -0
- package/src/api/schemas/media.ts +23 -3
- package/src/api/schemas/menus.ts +23 -0
- package/src/api/schemas/schema.ts +11 -2
- package/src/api/schemas/taxonomies.ts +39 -0
- package/src/astro/integration/routes.ts +10 -0
- package/src/astro/middleware.ts +46 -11
- package/src/astro/routes/api/content/[collection]/[id]/permanent.ts +1 -1
- package/src/astro/routes/api/import/wordpress/rewrite-url-helpers.ts +196 -0
- package/src/astro/routes/api/import/wordpress/rewrite-urls.ts +9 -177
- package/src/astro/routes/api/media/upload-url.ts +10 -4
- package/src/astro/routes/api/media.ts +12 -4
- package/src/astro/routes/api/menus/[name]/items.ts +16 -6
- package/src/astro/routes/api/menus/[name]/reorder.ts +8 -3
- package/src/astro/routes/api/menus/[name]/translations.ts +82 -0
- package/src/astro/routes/api/menus/[name].ts +19 -10
- package/src/astro/routes/api/menus/index.ts +9 -6
- package/src/astro/routes/api/taxonomies/[name]/terms/[slug]/translations.ts +89 -0
- package/src/astro/routes/api/taxonomies/[name]/terms/[slug].ts +22 -22
- package/src/astro/routes/api/taxonomies/[name]/terms/index.ts +11 -14
- package/src/astro/routes/api/taxonomies/index.ts +9 -6
- 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 +139 -24
- package/src/cli/commands/plugin-init.ts +216 -90
- package/src/database/instrumentation.ts +22 -8
- package/src/database/migrations/016_api_tokens.ts +18 -3
- package/src/database/migrations/036_i18n_menus_and_taxonomies.ts +477 -0
- package/src/database/migrations/037_credential_algorithm.ts +18 -0
- package/src/database/migrations/runner.ts +4 -0
- package/src/database/repositories/content.ts +11 -0
- package/src/database/repositories/media.ts +40 -10
- package/src/database/repositories/taxonomy.ts +193 -89
- package/src/database/types.ts +12 -3
- 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/i18n/resolve.ts +37 -0
- package/src/index.ts +1 -1
- package/src/loader.ts +49 -2
- package/src/mcp/server.ts +114 -26
- package/src/media/mime.ts +75 -0
- package/src/menus/index.ts +143 -124
- package/src/menus/types.ts +15 -1
- 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/schema/zod-generator.ts +12 -2
- package/src/seed/apply.ts +157 -54
- package/src/seed/types.ts +18 -1
- package/src/seed/validate.ts +27 -13
- package/src/taxonomies/index.ts +230 -213
- package/src/taxonomies/types.ts +10 -0
- package/dist/apply-BzltprvY.mjs.map +0 -1
- package/dist/content-8lOYF0pr.mjs.map +0 -1
- package/dist/index-BFRaVcD6.d.mts.map +0 -1
- package/dist/loader-CKLbBnhK.mjs.map +0 -1
- package/dist/media-BW32b4gi.mjs.map +0 -1
- package/dist/registry-Dw70ChxB.mjs.map +0 -1
- package/dist/request-cache-B-bmkipQ.mjs.map +0 -1
- package/dist/runner-C7ADox5q.mjs.map +0 -1
- package/dist/search-dOGEccMa.mjs.map +0 -1
- package/dist/taxonomies-ZlRtD6AG.mjs +0 -315
- package/dist/taxonomies-ZlRtD6AG.mjs.map +0 -1
- package/dist/types-4fVtCIm0.mjs +0 -68
- package/dist/types-4fVtCIm0.mjs.map +0 -1
- package/dist/types-BSyXeCFW.d.mts.map +0 -1
- package/dist/types-BuBIptGk.d.mts.map +0 -1
- package/dist/types-CIOg5AR8.mjs.map +0 -1
- package/dist/types-CrtWgIvl.d.mts.map +0 -1
- package/dist/validate-Baqf0slj.mjs.map +0 -1
- package/dist/validate-BfQh_C_y.d.mts.map +0 -1
- package/dist/version-DoxrVdYf.mjs +0 -7
- package/dist/zod-generator-CC0xNe_K.mjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../../types-
|
|
2
|
-
import "../../index-
|
|
3
|
-
import "../../runner-
|
|
4
|
-
import "../../types-
|
|
5
|
-
import "../../validate-
|
|
1
|
+
import "../../types-BQx6ZXpR.mjs";
|
|
2
|
+
import "../../index-Cg-rC4Gj.mjs";
|
|
3
|
+
import "../../runner-Iu3IZSDM.mjs";
|
|
4
|
+
import "../../types-IN5z_S3P.mjs";
|
|
5
|
+
import "../../validate-CO3JjFV5.mjs";
|
|
6
6
|
import { EmDashHandlers } from "../types.mjs";
|
|
7
7
|
import { User } from "@emdash-cms/auth";
|
|
8
8
|
import * as astro from "astro";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../../base64-
|
|
2
|
-
import "../../types-
|
|
3
|
-
import { t as apiError } from "../../error-
|
|
4
|
-
import { t as getPublicOrigin } from "../../public-url-
|
|
5
|
-
import { t as getAuthMode } from "../../mode-
|
|
1
|
+
import "../../base64-MBPo9ozB.mjs";
|
|
2
|
+
import "../../types-BIgulNsW.mjs";
|
|
3
|
+
import { t as apiError } from "../../error-DqnRMM5z.mjs";
|
|
4
|
+
import { t as getPublicOrigin } from "../../public-url-B1AxbbbQ.mjs";
|
|
5
|
+
import { t as getAuthMode } from "../../mode-YhqNVef_.mjs";
|
|
6
6
|
import { ulid } from "ulidx";
|
|
7
7
|
import { defineMiddleware } from "astro:middleware";
|
|
8
8
|
import virtualConfig from "virtual:emdash/config";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../../dialect-helpers-BKCvISIQ.mjs";
|
|
2
|
-
import "../../base64-
|
|
3
|
-
import "../../types-
|
|
4
|
-
import { t as RedirectRepository } from "../../redirect-
|
|
5
|
-
import { a as setCachedRedirects, i as matchCachedPatterns, n as getCachedRedirects } from "../../cache-
|
|
6
|
-
import { r as getDb } from "../../loader-
|
|
2
|
+
import "../../base64-MBPo9ozB.mjs";
|
|
3
|
+
import "../../types-BIgulNsW.mjs";
|
|
4
|
+
import { t as RedirectRepository } from "../../redirect-C5H7VGIX.mjs";
|
|
5
|
+
import { a as setCachedRedirects, i as matchCachedPatterns, n as getCachedRedirects } from "../../cache-BAJbeoZ8.mjs";
|
|
6
|
+
import { r as getDb } from "../../loader-ou_PXAjg.mjs";
|
|
7
7
|
import { defineMiddleware } from "astro:middleware";
|
|
8
8
|
|
|
9
9
|
//#region src/astro/middleware/redirect.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getRequestContext, runWithContext } from "../../request-context.mjs";
|
|
2
|
-
import "../../base64-
|
|
3
|
-
import "../../options-
|
|
4
|
-
import { n as parseContentId, r as verifyPreviewToken } from "../../tokens-
|
|
5
|
-
import { i as resolveSecretsCached } from "../../secrets-
|
|
2
|
+
import "../../base64-MBPo9ozB.mjs";
|
|
3
|
+
import "../../options-nPxWnrya.mjs";
|
|
4
|
+
import { n as parseContentId, r as verifyPreviewToken } from "../../tokens-CyRDPVW2.mjs";
|
|
5
|
+
import { i as resolveSecretsCached } from "../../secrets-CZ8rxLX3.mjs";
|
|
6
6
|
import { defineMiddleware } from "astro:middleware";
|
|
7
7
|
|
|
8
8
|
//#region src/visual-editing/toolbar.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.mts","names":[],"sources":["../../src/astro/middleware.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"middleware.d.mts","names":[],"sources":["../../src/astro/middleware.ts"],"mappings":";;;;;;AAwQA;;;cAAa,SAAA,EAyUX,KAAA,CAzUoB,iBAAA"}
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { r as runMigrations } from "../runner-
|
|
2
|
-
import { getRequestContext, runWithContext } from "../request-context.mjs";
|
|
1
|
+
import { r as runMigrations } from "../runner-DIcU2UCC.mjs";
|
|
2
|
+
import { createRequestMetrics, getRequestContext, runWithContext } from "../request-context.mjs";
|
|
3
3
|
import { createRecorder, flushRecorder, isInstrumentationEnabled, kyselyLogOption } from "../database/instrumentation.mjs";
|
|
4
4
|
import "../connection-2igzM-AT.mjs";
|
|
5
5
|
import { t as validateIdentifier } from "../validate-VPnKoIzW.mjs";
|
|
6
6
|
import { o as isSqlite } from "../dialect-helpers-BKCvISIQ.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import "../
|
|
10
|
-
import "../
|
|
11
|
-
import
|
|
12
|
-
import "../
|
|
13
|
-
import
|
|
14
|
-
import "../
|
|
15
|
-
import "../
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import "../
|
|
23
|
-
import
|
|
24
|
-
import "../
|
|
25
|
-
import "../
|
|
26
|
-
import
|
|
27
|
-
import "../
|
|
28
|
-
import "../
|
|
29
|
-
import "../
|
|
7
|
+
import { i as setI18nConfig } from "../config-CVssduLe.mjs";
|
|
8
|
+
import { At as handleContentTranslations, Ct as handleContentGetIncludingTrashed, Dt as handleContentPublish, Et as handleContentPermanentDelete, G as sanitizeHeadersForSandbox, H as resolveExclusiveHooks, I as PluginRouteRegistry, K as getTrustedProxyHeaders, L as DEV_CONSOLE_EMAIL_PLUGIN_ID, Mt as handleContentUnschedule, Nt as handleContentUpdate, Ot as handleContentRestore, Pt as validateRev, R as devConsoleEmailDeliver, St as handleContentGet, Tt as handleContentListTrashed, U as CronExecutor, V as createHookPipeline, W as extractRequestMeta, X as after, _t as handleContentCountTrashed, bt as handleContentDiscardDraft, ct as handleMediaGet, dt as handleRevisionGet, ft as handleRevisionList, gt as handleContentCountScheduled, ht as handleContentCompare, it as PluginStateRepository, jt as handleContentUnpublish, kt as handleContentSchedule, lt as handleMediaList, ot as handleMediaCreate, pt as handleRevisionRestore, q as definePlugin, st as handleMediaDelete, tt as loadBundleFromR2, ut as handleMediaUpdate, vt as handleContentCreate, wt as handleContentList, xt as handleContentDuplicate, yt as handleContentDelete, z as EmailPipeline } from "../search-DuWhx4NG.mjs";
|
|
9
|
+
import { r as RevisionRepository } from "../content-CERxPUN0.mjs";
|
|
10
|
+
import "../base64-MBPo9ozB.mjs";
|
|
11
|
+
import "../types-BIgulNsW.mjs";
|
|
12
|
+
import { t as MediaRepository } from "../media-1fFhub9c.mjs";
|
|
13
|
+
import "../taxonomy-D6NvlKo8.mjs";
|
|
14
|
+
import { t as OptionsRepository } from "../options-nPxWnrya.mjs";
|
|
15
|
+
import "../redirect-C5H7VGIX.mjs";
|
|
16
|
+
import "../byline-gFn1r0vA.mjs";
|
|
17
|
+
import { n as normalizeMediaValue } from "../placeholder-Ci0RLeCk.mjs";
|
|
18
|
+
import { n as requestCached } from "../request-cache-D4I69LeL.mjs";
|
|
19
|
+
import { r as hashString } from "../zod-generator-CHnJUP2l.mjs";
|
|
20
|
+
import { i as FTSManager, n as SchemaRegistry } from "../registry-Do34mz_P.mjs";
|
|
21
|
+
import { r as getDb } from "../loader-ou_PXAjg.mjs";
|
|
22
|
+
import "../apply-Ded_1vng.mjs";
|
|
23
|
+
import "../taxonomies-Bw76xAxo.mjs";
|
|
24
|
+
import { r as normalizeManifestRoute } from "../manifest-schema-CXAbd1vH.mjs";
|
|
25
|
+
import "../types-DiI8NOG_.mjs";
|
|
26
|
+
import "../error-DqnRMM5z.mjs";
|
|
27
|
+
import { a as invalidateUrlPatternCache } from "../query-8c_meo_K.mjs";
|
|
28
|
+
import "../tokens-CyRDPVW2.mjs";
|
|
29
|
+
import "../bylines-DTFI8nDM.mjs";
|
|
30
|
+
import "../load-DR1VwFXR.mjs";
|
|
30
31
|
import "../index.mjs";
|
|
31
|
-
import { n as VERSION, t as COMMIT } from "../version-
|
|
32
|
-
import { t as getAuthMode } from "../mode-
|
|
33
|
-
import { a as validateEncryptionKeyAtStartup } from "../secrets-
|
|
32
|
+
import { n as VERSION, t as COMMIT } from "../version-Bg31I_Ff.mjs";
|
|
33
|
+
import { t as getAuthMode } from "../mode-YhqNVef_.mjs";
|
|
34
|
+
import { a as validateEncryptionKeyAtStartup } from "../secrets-CZ8rxLX3.mjs";
|
|
34
35
|
import { Kysely, sql } from "kysely";
|
|
35
36
|
import { defineMiddleware } from "astro:middleware";
|
|
36
37
|
import virtualConfig from "virtual:emdash/config";
|
|
@@ -800,9 +801,9 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
800
801
|
}
|
|
801
802
|
})();
|
|
802
803
|
if (collectionCount.count === 0 && !setupDone) {
|
|
803
|
-
const { applySeed } = await import("../apply-
|
|
804
|
-
const { loadSeed } = await import("../load-
|
|
805
|
-
const { validateSeed } = await import("../validate-
|
|
804
|
+
const { applySeed } = await import("../apply-Ded_1vng.mjs").then((n) => n.n);
|
|
805
|
+
const { loadSeed } = await import("../load-DR1VwFXR.mjs").then((n) => n.r);
|
|
806
|
+
const { validateSeed } = await import("../validate-UK4Ja1uo.mjs").then((n) => n.n);
|
|
806
807
|
const seed = await loadSeed();
|
|
807
808
|
if (validateSeed(seed).valid) {
|
|
808
809
|
await applySeed(db, seed, { onConflict: "skip" });
|
|
@@ -982,13 +983,14 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
982
983
|
label: field.label,
|
|
983
984
|
required: field.required
|
|
984
985
|
};
|
|
986
|
+
entry.id = field.id;
|
|
985
987
|
if (field.widget) entry.widget = field.widget;
|
|
986
988
|
if (field.options) entry.options = field.options;
|
|
987
989
|
if (field.validation?.options) entry.options = field.validation.options.map((v) => ({
|
|
988
990
|
value: v,
|
|
989
991
|
label: v.charAt(0).toUpperCase() + v.slice(1)
|
|
990
992
|
}));
|
|
991
|
-
if (field.type === "repeater" && field.validation) entry.validation = field.validation;
|
|
993
|
+
if ((field.type === "repeater" || field.type === "file" || field.type === "image") && field.validation) entry.validation = { ...field.validation };
|
|
992
994
|
fields[field.slug] = entry;
|
|
993
995
|
}
|
|
994
996
|
manifestCollections[collection.slug] = {
|
|
@@ -1187,7 +1189,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1187
1189
|
if (this.hooks.hasHooks("content:beforeSave")) processedData = (await this.hooks.runContentBeforeSave(body.data, collection, true)).content;
|
|
1188
1190
|
processedData = await this.runSandboxedBeforeSave(processedData, collection, true);
|
|
1189
1191
|
processedData = await this.normalizeMediaFields(collection, processedData);
|
|
1190
|
-
const { validateContentData } = await import("../validation-
|
|
1192
|
+
const { validateContentData } = await import("../validation-Vc5DQkJa.mjs");
|
|
1191
1193
|
const validation = await validateContentData(this.db, collection, processedData, { partial: false });
|
|
1192
1194
|
if (!validation.ok) return {
|
|
1193
1195
|
success: false,
|
|
@@ -1203,7 +1205,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1203
1205
|
return result;
|
|
1204
1206
|
}
|
|
1205
1207
|
async handleContentUpdate(collection, id, body) {
|
|
1206
|
-
const { ContentRepository } = await import("../content-
|
|
1208
|
+
const { ContentRepository } = await import("../content-CERxPUN0.mjs").then((n) => n.n);
|
|
1207
1209
|
const repo = new ContentRepository(this.db);
|
|
1208
1210
|
const resolvedItem = await repo.findByIdOrSlug(collection, id);
|
|
1209
1211
|
const resolvedId = resolvedItem?.id ?? id;
|
|
@@ -1230,7 +1232,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1230
1232
|
if (this.hooks.hasHooks("content:beforeSave")) processedData = (await this.hooks.runContentBeforeSave(bodyWithoutRev.data, collection, false)).content;
|
|
1231
1233
|
processedData = await this.runSandboxedBeforeSave(processedData, collection, false);
|
|
1232
1234
|
processedData = await this.normalizeMediaFields(collection, processedData);
|
|
1233
|
-
const { validateContentData } = await import("../validation-
|
|
1235
|
+
const { validateContentData } = await import("../validation-Vc5DQkJa.mjs");
|
|
1234
1236
|
const validation = await validateContentData(this.db, collection, processedData, { partial: true });
|
|
1235
1237
|
if (!validation.ok) return {
|
|
1236
1238
|
success: false,
|
|
@@ -1872,6 +1874,49 @@ function finalizeResponse(response, serverTimings) {
|
|
|
1872
1874
|
}).join(", "));
|
|
1873
1875
|
return res;
|
|
1874
1876
|
}
|
|
1877
|
+
/**
|
|
1878
|
+
* Append always-on counters (db.*, cache.*) to the Server-Timing list.
|
|
1879
|
+
*
|
|
1880
|
+
* dur values for `count`, `hit`, `miss` are integer counts — Server-Timing
|
|
1881
|
+
* spec only models milliseconds, but browsers show whatever number is given,
|
|
1882
|
+
* which is the convention most projects use for non-time samples.
|
|
1883
|
+
*/
|
|
1884
|
+
function pushMetricsTimings(timings, metrics) {
|
|
1885
|
+
if (metrics.dbCount > 0) {
|
|
1886
|
+
timings.push({
|
|
1887
|
+
name: "db.total",
|
|
1888
|
+
dur: metrics.dbTotalMs,
|
|
1889
|
+
desc: "DB total"
|
|
1890
|
+
});
|
|
1891
|
+
timings.push({
|
|
1892
|
+
name: "db.count",
|
|
1893
|
+
dur: metrics.dbCount,
|
|
1894
|
+
desc: "Query count"
|
|
1895
|
+
});
|
|
1896
|
+
if (metrics.dbFirstOffset !== null) timings.push({
|
|
1897
|
+
name: "db.first",
|
|
1898
|
+
dur: metrics.dbFirstOffset,
|
|
1899
|
+
desc: "First query at"
|
|
1900
|
+
});
|
|
1901
|
+
if (metrics.dbLastOffset !== null) timings.push({
|
|
1902
|
+
name: "db.last",
|
|
1903
|
+
dur: metrics.dbLastOffset,
|
|
1904
|
+
desc: "Last query at"
|
|
1905
|
+
});
|
|
1906
|
+
}
|
|
1907
|
+
if (metrics.cacheHits + metrics.cacheMisses > 0) {
|
|
1908
|
+
timings.push({
|
|
1909
|
+
name: "cache.hit",
|
|
1910
|
+
dur: metrics.cacheHits,
|
|
1911
|
+
desc: "Cache hits"
|
|
1912
|
+
});
|
|
1913
|
+
timings.push({
|
|
1914
|
+
name: "cache.miss",
|
|
1915
|
+
dur: metrics.cacheMisses,
|
|
1916
|
+
desc: "Cache misses"
|
|
1917
|
+
});
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1875
1920
|
/** Public routes that require the runtime (sitemap, robots.txt, etc.) */
|
|
1876
1921
|
const PUBLIC_RUNTIME_ROUTES = new Set(["/sitemap.xml", "/robots.txt"]);
|
|
1877
1922
|
const SITEMAP_COLLECTION_RE = /^\/sitemap-[a-z][a-z0-9_]*\.xml$/;
|
|
@@ -1892,6 +1937,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
1892
1937
|
if (virtualConfig.authProviders.some((p) => p.routes?.some((r) => r.pattern && url.pathname === r.pattern))) return finalizeResponse(await next());
|
|
1893
1938
|
}
|
|
1894
1939
|
const queryRecorder = isInstrumentationEnabled() ? createRecorder(url.pathname, request.method, request.headers.get("x-perf-phase") ?? "default") : void 0;
|
|
1940
|
+
const metrics = createRequestMetrics(performance.now());
|
|
1895
1941
|
const run = async () => {
|
|
1896
1942
|
const isEmDashRoute = url.pathname.startsWith("/_emdash");
|
|
1897
1943
|
const isPublicRuntimeRoute = PUBLIC_RUNTIME_ROUTES.has(url.pathname) || SITEMAP_COLLECTION_RE.test(url.pathname);
|
|
@@ -1907,7 +1953,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
1907
1953
|
if (!setupVerified) {
|
|
1908
1954
|
const t0 = performance.now();
|
|
1909
1955
|
try {
|
|
1910
|
-
const { getDb } = await import("../loader-
|
|
1956
|
+
const { getDb } = await import("../loader-ou_PXAjg.mjs").then((n) => n.i);
|
|
1911
1957
|
await (await getDb()).selectFrom("_emdash_migrations").selectAll().limit(1).execute();
|
|
1912
1958
|
setupVerified = true;
|
|
1913
1959
|
} catch {
|
|
@@ -1959,6 +2005,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
1959
2005
|
dur: performance.now() - mwStart,
|
|
1960
2006
|
desc: "Total middleware"
|
|
1961
2007
|
});
|
|
2008
|
+
pushMetricsTimings(timings, metrics);
|
|
1962
2009
|
return finalizeResponse(response, timings);
|
|
1963
2010
|
};
|
|
1964
2011
|
if (anonScoped) {
|
|
@@ -1968,7 +2015,8 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
1968
2015
|
db: anonScoped.db
|
|
1969
2016
|
} : {
|
|
1970
2017
|
editMode: false,
|
|
1971
|
-
db: anonScoped.db
|
|
2018
|
+
db: anonScoped.db,
|
|
2019
|
+
metrics
|
|
1972
2020
|
}, async () => {
|
|
1973
2021
|
const response = await runAnon();
|
|
1974
2022
|
anonScoped.commit();
|
|
@@ -2068,6 +2116,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2068
2116
|
dur: performance.now() - mwStart,
|
|
2069
2117
|
desc: "Total middleware"
|
|
2070
2118
|
});
|
|
2119
|
+
pushMetricsTimings(timings, metrics);
|
|
2071
2120
|
return finalizeResponse(response, timings);
|
|
2072
2121
|
};
|
|
2073
2122
|
if (scoped) {
|
|
@@ -2077,7 +2126,8 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2077
2126
|
db: scoped.db
|
|
2078
2127
|
} : {
|
|
2079
2128
|
editMode: false,
|
|
2080
|
-
db: scoped.db
|
|
2129
|
+
db: scoped.db,
|
|
2130
|
+
metrics
|
|
2081
2131
|
}, async () => {
|
|
2082
2132
|
const response = await renderAndFinalize();
|
|
2083
2133
|
scoped.commit();
|
|
@@ -2097,20 +2147,21 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2097
2147
|
} : {
|
|
2098
2148
|
editMode,
|
|
2099
2149
|
db: playgroundDb,
|
|
2100
|
-
dbIsIsolated: true
|
|
2150
|
+
dbIsIsolated: true,
|
|
2151
|
+
metrics
|
|
2101
2152
|
}, doInit);
|
|
2102
2153
|
}
|
|
2103
2154
|
return doInit();
|
|
2104
2155
|
};
|
|
2105
|
-
|
|
2156
|
+
try {
|
|
2106
2157
|
return await runWithContext({
|
|
2107
2158
|
editMode: false,
|
|
2108
|
-
queryRecorder
|
|
2159
|
+
queryRecorder,
|
|
2160
|
+
metrics
|
|
2109
2161
|
}, run);
|
|
2110
2162
|
} finally {
|
|
2111
|
-
flushRecorder(queryRecorder);
|
|
2163
|
+
if (queryRecorder) flushRecorder(queryRecorder);
|
|
2112
2164
|
}
|
|
2113
|
-
return run();
|
|
2114
2165
|
});
|
|
2115
2166
|
|
|
2116
2167
|
//#endregion
|