dineway 0.1.49 → 0.2.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/{activity-events-CwM7yxPW.mjs → activity-events-y6eT8UW6.mjs} +6 -38
- package/dist/actor-CrObAPV0.mjs +37 -0
- package/dist/after-BfniwgIf.mjs +9 -0
- package/dist/{allowed-origins-CyGnbgBd.mjs → allowed-origins-_oeyP6x-.mjs} +1 -1
- package/dist/api/route-utils.d.mts +10 -10
- package/dist/api/route-utils.mjs +16 -13
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +5 -4
- package/dist/{api-BMIxRIEN.mjs → api-ByrU2q-Z.mjs} +60 -36
- package/dist/{api-tokens-DtvdtIkm.mjs → api-tokens-CjVMQT-X.mjs} +6 -2
- package/dist/{apply-D_RlTYtC.mjs → apply-bZswmZPm.mjs} +117 -77
- package/dist/astro/image-endpoint.d.mts +7 -0
- package/dist/astro/image-endpoint.mjs +54 -0
- package/dist/astro/index.d.mts +35 -11
- package/dist/astro/index.mjs +157 -23
- package/dist/astro/integration/shims/use-sync-external-store-with-selector.js +71 -0
- package/dist/astro/integration/shims/use-sync-external-store.js +1 -0
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.mjs +42 -24
- package/dist/astro/middleware/redirect.mjs +13 -4
- package/dist/astro/middleware/request-context.mjs +8 -5
- package/dist/astro/middleware/seed.d.mts +1 -1
- package/dist/astro/middleware/seed.mjs +2 -2
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.mjs +333 -192
- package/dist/astro/routes/admin.astro +6 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -6
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -6
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
- package/dist/astro/routes/api/admin/briefing.mjs +21 -17
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +9 -8
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +9 -8
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +9 -8
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +17 -14
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +17 -14
- package/dist/astro/routes/api/admin/bylines/index.mjs +17 -14
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +14 -12
- package/dist/astro/routes/api/admin/comments/_id_.mjs +6 -5
- package/dist/astro/routes/api/admin/comments/bulk.mjs +11 -9
- package/dist/astro/routes/api/admin/comments/counts.mjs +6 -5
- package/dist/astro/routes/api/admin/comments/index.mjs +11 -9
- package/dist/astro/routes/api/admin/context/_id_/history.mjs +26 -24
- package/dist/astro/routes/api/admin/context/_id_/index.mjs +26 -24
- package/dist/astro/routes/api/admin/context/_id_/review.mjs +31 -28
- package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +31 -28
- package/dist/astro/routes/api/admin/context/diff.mjs +30 -27
- package/dist/astro/routes/api/admin/context/index.mjs +31 -28
- package/dist/astro/routes/api/admin/context/stale.mjs +30 -27
- package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +26 -24
- package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +30 -27
- package/dist/astro/routes/api/admin/hitl-requests/index.mjs +30 -27
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +27 -25
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +6 -6
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +6 -6
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +55 -51
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +55 -51
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +47 -43
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +53 -49
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +52 -48
- package/dist/astro/routes/api/admin/plugins/index.mjs +47 -43
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +46 -42
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +52 -48
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +46 -42
- package/dist/astro/routes/api/admin/plugins/updates.mjs +46 -42
- package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +5 -5
- package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +31 -27
- package/dist/astro/routes/api/admin/review-requests/index.mjs +10 -9
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +46 -42
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +46 -42
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +8 -7
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +4 -4
- package/dist/astro/routes/api/admin/users/index.mjs +7 -6
- package/dist/astro/routes/api/auth/dev-bypass.mjs +4 -4
- package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
- package/dist/astro/routes/api/auth/invite/complete.mjs +12 -11
- package/dist/astro/routes/api/auth/invite/index.mjs +9 -8
- package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -10
- package/dist/astro/routes/api/auth/logout.mjs +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +11 -10
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
- package/dist/astro/routes/api/auth/me.mjs +9 -8
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +6 -5
- package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +12 -11
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +10 -9
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +11 -10
- package/dist/astro/routes/api/auth/passkey/verify.mjs +11 -10
- package/dist/astro/routes/api/auth/setup-token/index.mjs +5 -5
- package/dist/astro/routes/api/auth/setup-token/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/signup/complete.mjs +12 -11
- package/dist/astro/routes/api/auth/signup/request.mjs +11 -10
- package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +15 -13
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts +8 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +160 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +10 -9
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +10 -9
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +16 -14
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +10 -9
- package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/index.mjs +10 -9
- package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -6
- package/dist/astro/routes/api/dashboard.mjs +9 -8
- package/dist/astro/routes/api/dev/emails.mjs +2 -2
- package/dist/astro/routes/api/health.mjs +1 -1
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +22 -10
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +9 -6
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +19 -1
- package/dist/astro/routes/api/import/wordpress/execute.mjs +84 -37
- package/dist/astro/routes/api/import/wordpress/media.d.mts +13 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +19 -13
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +35 -32
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +18 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +120 -100
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +24 -12
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +56 -2
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +283 -55
- package/dist/astro/routes/api/manifest.mjs +14 -5
- package/dist/astro/routes/api/mcp.mjs +265 -69
- package/dist/astro/routes/api/media/_id_/confirm.mjs +38 -10
- package/dist/astro/routes/api/media/_id_.mjs +11 -7
- package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
- package/dist/astro/routes/api/media/providers/index.mjs +2 -2
- package/dist/astro/routes/api/media/upload-url.mjs +11 -10
- package/dist/astro/routes/api/media.mjs +27 -34
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +31 -28
- package/dist/astro/routes/api/menus/_name_/items.mjs +31 -28
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +31 -28
- package/dist/astro/routes/api/menus/_name_/translations.mjs +31 -28
- package/dist/astro/routes/api/menus/_name_.mjs +31 -28
- package/dist/astro/routes/api/menus/index.mjs +31 -28
- package/dist/astro/routes/api/oauth/authorize.mjs +7 -7
- package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
- package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
- package/dist/astro/routes/api/oauth/register.mjs +4 -4
- package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
- package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
- package/dist/astro/routes/api/oauth/token.mjs +6 -6
- package/dist/astro/routes/api/openapi.json.mjs +4 -3
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +30 -30
- package/dist/astro/routes/api/redirects/404s/index.mjs +11 -10
- package/dist/astro/routes/api/redirects/404s/summary.mjs +11 -10
- package/dist/astro/routes/api/redirects/_id_.mjs +32 -29
- package/dist/astro/routes/api/redirects/index.mjs +32 -29
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +2 -2
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +47 -43
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +47 -43
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +47 -43
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +47 -43
- package/dist/astro/routes/api/schema/collections/index.mjs +47 -43
- package/dist/astro/routes/api/schema/index.mjs +13 -14
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +46 -42
- package/dist/astro/routes/api/schema/orphans/index.mjs +46 -42
- package/dist/astro/routes/api/search/enable.mjs +11 -10
- package/dist/astro/routes/api/search/index.mjs +10 -9
- package/dist/astro/routes/api/search/rebuild.mjs +11 -10
- package/dist/astro/routes/api/search/stats.mjs +6 -6
- package/dist/astro/routes/api/search/suggest.mjs +10 -9
- package/dist/astro/routes/api/sections/_slug_.mjs +31 -28
- package/dist/astro/routes/api/sections/index.mjs +31 -28
- package/dist/astro/routes/api/settings/email.mjs +4 -4
- package/dist/astro/routes/api/settings.mjs +31 -28
- package/dist/astro/routes/api/setup/admin-verify.mjs +14 -13
- package/dist/astro/routes/api/setup/admin.mjs +12 -11
- package/dist/astro/routes/api/setup/dev-bypass.mjs +31 -25
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
- package/dist/astro/routes/api/setup/index.mjs +29 -25
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +8 -7
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +34 -31
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +34 -31
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +34 -31
- package/dist/astro/routes/api/taxonomies/index.mjs +34 -31
- package/dist/astro/routes/api/themes/preview.mjs +5 -5
- package/dist/astro/routes/api/typegen.mjs +4 -4
- package/dist/astro/routes/api/well-known/auth.mjs +3 -3
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +3 -3
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +3 -3
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +30 -27
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +31 -28
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +31 -28
- package/dist/astro/routes/api/widget-areas/_name_.mjs +28 -26
- package/dist/astro/routes/api/widget-areas/index.mjs +31 -28
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +8 -7
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +23 -14
- package/dist/astro/routes/sitemap.xml.mjs +9 -8
- package/dist/astro/session-driver.d.mts +1 -1
- package/dist/astro/session-driver.mjs +2 -2
- package/dist/astro/types.d.mts +21 -13
- package/dist/{audit-BeNsSyfU.mjs → audit-ByVKIwWF.mjs} +1 -1
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{auth-control-guard-Dr14I98m.mjs → auth-control-guard-CqeUmQsv.mjs} +1 -1
- package/dist/{authorize-BLO0m7fW.mjs → authorize-CcBxcHtz.mjs} +1 -1
- package/dist/{briefing-DJX6irto.mjs → briefing-BJaJI8dm.mjs} +2 -1
- package/dist/{briefing-CkTee1ex.mjs → briefing-CawZ59CY.mjs} +90 -28
- package/dist/bundle-7C_DpkEq.mjs +602 -0
- package/dist/{byline-BVC1lV6G.mjs → byline-e51-fWRs.mjs} +30 -62
- package/dist/{byline-fields-uJlygdzM.d.mts → byline-fields-CUvbslGc.d.mts} +80 -37
- package/dist/{byline-fields-Cj39WhXC.mjs → byline-fields-D-N5qVIG.mjs} +1 -1
- package/dist/{byline-fields-cNrLJVRs.mjs → byline-fields-DOJO16Gm.mjs} +3 -3
- package/dist/{byline-registry-4v6tXMNX.mjs → byline-registry-87nNnYl4.mjs} +2 -2
- package/dist/{bylines-LN9XISRo.mjs → bylines-CMQNCNFh.mjs} +9 -3
- package/dist/{bylines-DwokOFj6.mjs → bylines-y4LO-dTj.mjs} +5 -5
- package/dist/{cache-Bac05gBd.mjs → cache-C-FNTFYK.mjs} +2 -2
- package/dist/{chunks-CuUt7K50.mjs → chunks-CxBt-GxR.mjs} +1 -1
- package/dist/cli/index.mjs +94 -659
- package/dist/client/external-auth-headers.d.mts +1 -1
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.mjs +2 -1
- package/dist/{comment-Beue8-15.mjs → comment-DlA4iChg.mjs} +13 -3
- package/dist/comment-reaction-DfFao1ST.mjs +58 -0
- package/dist/{comments-DcjFIfqX.mjs → comments-DApFGMsP.mjs} +1 -1
- package/dist/{content-CBxYGWfL.mjs → content-Bh4BDjv8.mjs} +51 -34
- package/dist/content-refresh-CgutSUfO.mjs +1576 -0
- package/dist/{context-CQVNZaR8.mjs → context-C5W3G18y.mjs} +111 -50
- package/dist/{context-Df1xVYyr.mjs → context-CK4ym2Sf.mjs} +2 -2
- package/dist/{context-route-helpers-B9wj8Rmh.mjs → context-route-helpers-MASyGgWf.mjs} +2 -1
- package/dist/{cron-DxCAU_Sn.mjs → cron-cKcNTix_.mjs} +7 -3
- package/dist/{dashboard-B7ZUNuyF.mjs → dashboard-DQkVT7Ei.mjs} +4 -4
- 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/{device-flow-BZVGftqi.mjs → device-flow-BnqRH-T9.mjs} +5 -5
- package/dist/{placeholder-d54Qr_7n.mjs → enrich-DIFIFA8O.mjs} +36 -9
- package/dist/{error-DCSuUAZW.mjs → error-CytFlgcd.mjs} +5 -0
- package/dist/field-defs-cache-DRNdhBJv.mjs +49 -0
- package/dist/{fts-manager-B5l_qwrA.mjs → fts-manager-Crzypjqu.mjs} +1 -1
- package/dist/hitl-Hw1RmWOq.mjs +677 -0
- package/dist/{hitl-requests-7NlzVeUA.mjs → hitl-requests-B4Vbcmaq.mjs} +2 -2
- package/dist/{hitl-route-helpers-k---_H3-.mjs → hitl-route-helpers-hEVzvP8l.mjs} +5 -4
- package/dist/import-Bh9biJfx.mjs +1354 -0
- package/dist/{index-CZiWCQDp.d.mts → index-D4y6NGiy.d.mts} +75 -3
- package/dist/index.d.mts +17 -16
- package/dist/index.mjs +80 -68
- package/dist/{jsonld-DZ67souc.d.mts → jsonld-Dq0gsnOH.d.mts} +8 -4
- package/dist/{load-D9OiGr2m.mjs → load-DmYeniXl.mjs} +1 -1
- package/dist/{loader--GOYux8M.mjs → loader-CjWqjweO.mjs} +117 -31
- package/dist/{manifest-schema-qh2P7RDX.mjs → manifest-schema-BxVPYMJR.mjs} +34 -1
- package/dist/mcp-reviewed-executor-TwVbMzG6.mjs +555 -0
- package/dist/media/image-endpoint.d.mts +32 -0
- package/dist/media/image-endpoint.mjs +111 -0
- package/dist/media/index.d.mts +27 -2
- package/dist/media/index.mjs +5 -3
- package/dist/media/local-runtime.d.mts +16 -11
- package/dist/media/local-runtime.mjs +9 -7
- package/dist/{media-CbKyYukG.mjs → media-DMj0grzC.mjs} +3 -1
- package/dist/{media-allowlist-BYxJIcTO.mjs → media-allowlist-BlVCSzHx.mjs} +1 -1
- package/dist/media-url-lEKSrpr9.mjs +20 -0
- package/dist/{menus-BZbXf-ej.mjs → menus-TaW1gKnk.mjs} +19 -5
- package/dist/{menus-C7F0sCrC.mjs → menus-xvsnVZXw.mjs} +80 -15
- package/dist/{normalize-ByemhhfW.mjs → normalize-5ek_z7de.mjs} +8 -1
- package/dist/{oauth-authorization-DF-LCsIA.mjs → oauth-authorization-DiaGvRVz.mjs} +5 -5
- package/dist/{oauth-clients-Du-V0fEm.mjs → oauth-clients-Dl9E8dEM.mjs} +2 -2
- package/dist/object-cache/memory.d.mts +14 -0
- package/dist/object-cache/memory.mjs +55 -0
- package/dist/object-cache-D51qOseS.mjs +419 -0
- package/dist/page/index.d.mts +4 -3
- package/dist/page/index.mjs +2 -2
- package/dist/{parse-CneSgl7-.mjs → parse-CbymENaR.mjs} +1 -1
- package/dist/{parser-DxfsARXL.mjs → parser-C1nYd-81.mjs} +151 -9
- package/dist/{placeholder-CXfoCtCd.d.mts → placeholder-uvNRZBX9.d.mts} +12 -4
- package/dist/plugin-utils.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.mjs +11 -2
- package/dist/{plugins-DzfqRREq.mjs → plugins-BolVa-tl.mjs} +831 -63
- package/dist/{transport-LSdZVXHF.mjs → portable-text-dA_UlJwW.mjs} +1 -134
- package/dist/{preview-C-3YTX2U.mjs → preview-vSVg6fwG.mjs} +4 -3
- package/dist/process-cache-7xgAO9JY.mjs +106 -0
- package/dist/{provider-loader-9it4vd6L.d.mts → provider-loader-MD8zAbnH.d.mts} +1 -1
- package/dist/{public-url-B4xV4rGa.d.mts → public-url-gsp3oUbu.d.mts} +1 -1
- package/dist/{query-Ds0EnMFX.mjs → query-CfRCdaL3.mjs} +281 -76
- package/dist/{query-CZ3TH_Uu.mjs → query-jaAmw8E1.mjs} +11 -6
- package/dist/{rate-limit-i0G3IAOX.mjs → rate-limit-ZLdyWoZF.mjs} +2 -2
- package/dist/{redirect-CEACczxo.mjs → redirect-BAjt4Z6b.mjs} +2 -2
- package/dist/{redirects-DYj1yPxs.mjs → redirects-BTdwpQtE.mjs} +47 -24
- package/dist/{redirects-ocRJmQHP.mjs → redirects-CA-xylPG.mjs} +19 -11
- package/dist/{registry-D7HACema.mjs → registry-CtyVedcN.mjs} +130 -77
- package/dist/request-context.d.mts +2 -0
- package/dist/{request-meta-DAb6xaP9.mjs → request-meta-CUypToDJ.mjs} +1 -1
- package/dist/{review-requests-Qum4713s.mjs → review-requests-C9Ff11Vq.mjs} +1 -1
- package/dist/{review-requests-BW2NxY-l.mjs → review-requests-DUyEmtmG.mjs} +1 -1
- package/dist/{runner-09sTqtv0.d.mts → runner-1tC2tIRV.d.mts} +1 -1
- package/dist/runner-DB7CRfOF.mjs +6740 -0
- package/dist/{runtime-C4-2lSFg.d.mts → runtime-BOeiQsCv.d.mts} +1952 -1489
- package/dist/runtime.d.mts +10 -10
- package/dist/runtime.mjs +3 -3
- package/dist/schema-DXdYj4R3.mjs +8 -0
- package/dist/{search-Gdrqj582.mjs → search-DSaLgEFI.mjs} +5 -3
- package/dist/{secrets-CeGpBFV2.mjs → secrets-CDZo2k8L.mjs} +14 -11
- package/dist/{sections-BOjU13Y-.mjs → sections-PVVXHGfp.mjs} +2 -2
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +21 -18
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.mjs +3 -12
- package/dist/{seo-CLj8lS7Q.mjs → seo-CQG3GCHQ.mjs} +5 -2
- package/dist/{seo-contributions-CqVvReEj.mjs → seo-contributions-C1EnikHB.mjs} +11 -3
- package/dist/{seo-5lJOtB5J.mjs → seo-qa7Dn0jK.mjs} +22 -4
- package/dist/{service-jGlhrICs.mjs → service-DiN4ZuPp.mjs} +2 -2
- package/dist/session-user-CAKImna3.mjs +22 -0
- package/dist/{settings-CUXOxzsT.mjs → settings-BbqgHWpU.mjs} +28 -55
- package/dist/{settings-DlBsT2VS.mjs → settings-i4VPP8bT.mjs} +2 -2
- package/dist/{setup-complete-BRrdPYjZ.mjs → setup-complete-B8fl-mjV.mjs} +1 -1
- package/dist/{site-activity-DONFrMBJ.mjs → site-activity-Dy3FROs0.mjs} +1 -1
- package/dist/{site-context-C8Az_P_I.mjs → site-context-DQiL8Fl5.mjs} +23 -652
- package/dist/{site-url-DIMD68go.mjs → site-url-BML3GQYm.mjs} +1 -1
- package/dist/status-DANd8ERo.mjs +21 -0
- 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-D9Sw4wWM.mjs → taxonomies-9s-v03H-.mjs} +36 -29
- package/dist/taxonomies-DRiixp_E.mjs +443 -0
- package/dist/{taxonomy-B169Nm6B.mjs → taxonomy-Dvsw6BOs.mjs} +44 -9
- package/dist/transport-BNmCqLu7.mjs +134 -0
- package/dist/types-4garmdWa.mjs +66 -0
- package/dist/{types-DSPGWjxO.d.mts → types-C8XW6L19.d.mts} +225 -4
- package/dist/{types-GaCtZ1k9.d.mts → types-CDpH6MA4.d.mts} +18 -0
- package/dist/{types-DRIKLmJI.d.mts → types-C_ly5eTp.d.mts} +17 -2
- package/dist/types-DF7ZuGGk.d.mts +118 -0
- package/dist/types-DU0bU2Wu.d.mts +2392 -0
- package/dist/{types-CwawBUTa.d.mts → types-DW_-sFyz.d.mts} +2 -1
- package/dist/{types-CSgR9nQB.mjs → types-Dq1qT19x.mjs} +1 -1
- package/dist/ui/server-runtime.d.mts +15 -15
- package/dist/ui/server-runtime.mjs +24 -20
- package/dist/url-Cac7a9QZ.mjs +33 -0
- package/dist/{user-DTLoZs16.mjs → user-BIZPzCb9.mjs} +2 -2
- package/dist/{utils-B8hBJ9Oz.mjs → utils-CMDhr5Xd.mjs} +129 -7
- package/dist/{validate-DzjCdy6v.d.mts → validate-CZvb-BKB.d.mts} +10 -7
- package/dist/{validate-DWmPO6oj.mjs → validate-DNs0pTSc.mjs} +11 -6
- package/dist/version-BTvfRGc6.mjs +6 -0
- package/dist/{widgets-BpJ8EpPd.mjs → widgets-f0ibZUIq.mjs} +46 -43
- package/dist/{wordpress-slugs-DHNR9LpG.mjs → wordpress-slugs-BhHJX8XE.mjs} +1 -1
- package/dist/{zod-generator-K91-g665.mjs → zod-generator-B7TMjyFJ.mjs} +41 -13
- package/package.json +30 -8
- package/src/components/Block.astro +50 -0
- package/src/components/Comments.astro +143 -1
- package/src/components/DinewayHead.astro +19 -2
- package/src/components/DinewayImage.astro +66 -33
- package/src/components/DinewayMedia.astro +1 -2
- package/src/components/Image.astro +85 -40
- package/src/components/InlinePortableTextEditor.tsx +12 -2
- package/src/components/JsonLdScript.astro +9 -0
- package/src/components/LiveSearch.astro +40 -4
- package/src/components/index.ts +4 -0
- package/src/components/live-search-routing.ts +30 -0
- package/src/components/portable-text-text-align.ts +15 -0
- package/src/ui.ts +2 -0
- package/dist/entity-aliases-4y93Yjuc.mjs +0 -51
- package/dist/import-4YBXbDkI.mjs +0 -684
- package/dist/runner-DzIpHGND.mjs +0 -2836
- package/dist/schema-Bsi-VpYv.mjs +0 -8
- package/dist/taxonomies-CZ-_DitR.mjs +0 -327
- package/dist/types-CuJOqHfM.d.mts +0 -758
- package/dist/version-C4gfn0PJ.mjs +0 -6
- /package/dist/{adapters-OQCImOL7.d.mts → adapters-NVSs4UH7.d.mts} +0 -0
- /package/dist/{api-tokens-CYUoFGo7.mjs → api-tokens-2r7OWi_I.mjs} +0 -0
- /package/dist/{challenge-store-DFxX0_15.mjs → challenge-store-Bjlepa2E.mjs} +0 -0
- /package/dist/{components--pg6zBvu.mjs → components-Bclf98Be.mjs} +0 -0
- /package/dist/{context-types-r8oFvyOq.mjs → context-types-DqTo6C79.mjs} +0 -0
- /package/dist/{default-B6iaLvP7.mjs → default--K40jqm0.mjs} +0 -0
- /package/dist/{email-console-BOVqIYpB.mjs → email-console-ChgKFO8-.mjs} +0 -0
- /package/dist/{escape-BDgouFFY.mjs → escape-Bd4P_xKg.mjs} +0 -0
- /package/dist/{experimental-workflows-CSMffP6q.mjs → experimental-workflows-BMsUnIAw.mjs} +0 -0
- /package/dist/{mime-CbKsKDCB.mjs → mime-CA7Lgovc.mjs} +0 -0
- /package/dist/{mode-CZqCF9dZ.mjs → mode-C4CIyjtR.mjs} +0 -0
- /package/dist/{oauth-state-store-qncPB_IU.mjs → oauth-state-store-CNoXafF7.mjs} +0 -0
- /package/dist/{oauth-user-lookup-BFjWF8wK.mjs → oauth-user-lookup-Ygw4bNyt.mjs} +0 -0
- /package/dist/{options-LsPjZlqD.mjs → options-DQPTH5n0.mjs} +0 -0
- /package/dist/{passkey-config-DzHQK90v.mjs → passkey-config-BUwu8BA3.mjs} +0 -0
- /package/dist/{patterns-DKAX6oqN.mjs → patterns-BhAvqO0S.mjs} +0 -0
- /package/dist/{provider-loader-DzUxejk7.mjs → provider-loader-D0w9dqjm.mjs} +0 -0
- /package/dist/{public-url-B_m9IwdV.mjs → public-url-BEz_sM9n.mjs} +0 -0
- /package/dist/{redirect-BjIBtDWY.mjs → redirect-wphRBv4y.mjs} +0 -0
- /package/dist/{request-cache-ho99schz.mjs → request-cache-D9GQBxMP.mjs} +0 -0
- /package/dist/{resolve-DTuDyYKs.mjs → resolve-Cb6Dbz-C.mjs} +0 -0
- /package/dist/{setup-nonce-pyGfc9hV.mjs → setup-nonce-CoyjILvW.mjs} +0 -0
- /package/dist/{sidecar-client-mJxwayYN.mjs → sidecar-client-C3mqXg4C.mjs} +0 -0
- /package/dist/{slugify-BqebcqBg.mjs → slugify-KSsVD_D3.mjs} +0 -0
- /package/dist/{ssrf-DiKqWd3N.mjs → ssrf-DWe8jwAp.mjs} +0 -0
- /package/dist/{tokens-SLmgowfd.mjs → tokens-1RK1n6ED.mjs} +0 -0
- /package/dist/{transaction-CFLhEOuH.mjs → transaction-C2EOMTJA.mjs} +0 -0
- /package/dist/{transport-BnsNxh2l.d.mts → transport-CcJu3Co8.d.mts} +0 -0
- /package/dist/{trusted-proxy-BgIIcbsN.mjs → trusted-proxy-DTXQ2IMv.mjs} +0 -0
- /package/dist/{types-CJ8DkL0q.mjs → types-B3t5cxhU.mjs} +0 -0
- /package/dist/{types-nP9vGUFq.d.mts → types-C46EvNdc.d.mts} +0 -0
- /package/dist/{types-Cg276-3z.mjs → types-C5CVgwsV.mjs} +0 -0
- /package/dist/{types-DZpT-PnG.d.mts → types-POH8PQZh.d.mts} +0 -0
- /package/dist/{types-Dryvv7LH.d.mts → types-Rc3gQqqw.d.mts} +0 -0
- /package/dist/{url-w7Mp5qAD.mjs → url-CpyFDFpO.mjs} +0 -0
|
@@ -1,81 +1,94 @@
|
|
|
1
|
-
import { i as runMigrations } from "../runner-
|
|
1
|
+
import { i as runMigrations } from "../runner-DB7CRfOF.mjs";
|
|
2
2
|
import "../connection-CiJWiWya.mjs";
|
|
3
3
|
import { t as validateIdentifier } from "../validate-VPnKoIzW.mjs";
|
|
4
4
|
import { s as isSqlite } from "../dialect-helpers-fk43GbDb.mjs";
|
|
5
5
|
import { i as setI18nConfig } from "../config-CVssduLe.mjs";
|
|
6
|
-
import { d as EmailPipeline, g as
|
|
6
|
+
import { _ as readBoundedPluginRouteBody, d as EmailPipeline, g as DEFAULT_PLUGIN_RAW_BODY_LIMIT_BYTES, h as definePlugin, m as resolveExclusiveHooks, p as createHookPipeline, u as PluginRouteRegistry } from "../plugins-BolVa-tl.mjs";
|
|
7
7
|
import { createRequestMetrics, getRequestContext, runWithContext } from "../request-context.mjs";
|
|
8
8
|
import { createRecorder, flushRecorder, formatServerTimingHeader, isInstrumentationEnabled, isServerTimingEnabled, kyselyLogOption } from "../database/instrumentation.mjs";
|
|
9
9
|
import "../base64-F8-DUraK.mjs";
|
|
10
|
-
import "../types-
|
|
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 "../
|
|
30
|
-
import "../
|
|
31
|
-
import
|
|
32
|
-
import "../
|
|
33
|
-
import
|
|
34
|
-
import "../
|
|
35
|
-
import {
|
|
36
|
-
import
|
|
37
|
-
import {
|
|
38
|
-
import "../
|
|
39
|
-
import "../
|
|
10
|
+
import "../types-Dq1qT19x.mjs";
|
|
11
|
+
import { o as isMissingTableError, r as getDb } from "../loader-CjWqjweO.mjs";
|
|
12
|
+
import { t as after } from "../after-BfniwgIf.mjs";
|
|
13
|
+
import "../object-cache-D51qOseS.mjs";
|
|
14
|
+
import { r as RevisionRepository, t as ContentRepository } from "../content-Bh4BDjv8.mjs";
|
|
15
|
+
import { t as MediaRepository } from "../media-DMj0grzC.mjs";
|
|
16
|
+
import "../user-BIZPzCb9.mjs";
|
|
17
|
+
import "../taxonomy-Dvsw6BOs.mjs";
|
|
18
|
+
import "../comment-DlA4iChg.mjs";
|
|
19
|
+
import { t as OptionsRepository } from "../options-DQPTH5n0.mjs";
|
|
20
|
+
import "../audit-ByVKIwWF.mjs";
|
|
21
|
+
import "../site-activity-Dy3FROs0.mjs";
|
|
22
|
+
import "../review-requests-DUyEmtmG.mjs";
|
|
23
|
+
import "../hitl-Hw1RmWOq.mjs";
|
|
24
|
+
import { t as PluginContextFactory } from "../context-C5W3G18y.mjs";
|
|
25
|
+
import "../menus-TaW1gKnk.mjs";
|
|
26
|
+
import "../redirect-BAjt4Z6b.mjs";
|
|
27
|
+
import { r as requestCached } from "../request-cache-D9GQBxMP.mjs";
|
|
28
|
+
import "../byline-registry-87nNnYl4.mjs";
|
|
29
|
+
import { a as initWithLock, i as createInitLock, r as processCachedAsync, t as createProcessCache } from "../process-cache-7xgAO9JY.mjs";
|
|
30
|
+
import "../field-defs-cache-DRNdhBJv.mjs";
|
|
31
|
+
import "../byline-e51-fWRs.mjs";
|
|
32
|
+
import { n as normalizeMediaValue } from "../normalize-5ek_z7de.mjs";
|
|
33
|
+
import "../enrich-DIFIFA8O.mjs";
|
|
34
|
+
import "../seo-CQG3GCHQ.mjs";
|
|
35
|
+
import { $ as handleContentUpdate, A as handleRevisionGet, B as handleContentDiscardDraft, D as handleMediaGet, E as handleMediaDelete, F as handleContentCompare, G as handleContentListTrashed, H as handleContentGet, I as handleContentCountScheduled, J as handleContentRestore, K as handleContentPermanentDelete, L as handleContentCountTrashed, M as handleRevisionRestore, O as handleMediaList, P as handleContentAuthors, Q as handleContentUnschedule, R as handleContentCreate, T as handleMediaCreate, U as handleContentGetIncludingTrashed, V as handleContentDuplicate, W as handleContentList, X as handleContentTranslations, Y as handleContentSchedule, Z as handleContentUnpublish, d as createPluginBundleStore, et as validateRev, j as handleRevisionList, k as handleMediaUpdate, q as handleContentPublish, z as handleContentDelete } from "../api-ByrU2q-Z.mjs";
|
|
36
|
+
import "../dashboard-DQkVT7Ei.mjs";
|
|
37
|
+
import { u as PluginStateRepository } from "../briefing-CawZ59CY.mjs";
|
|
38
|
+
import "../context-types-DqTo6C79.mjs";
|
|
39
|
+
import { i as markContentMediaUsageCollectionStale, o as refreshContentMediaUsageAfterWrite, r as findNonTranslatableSiblingContentIds, t as deleteContentMediaUsage } from "../content-refresh-CgutSUfO.mjs";
|
|
40
40
|
import { n as hashString } from "../hash-BPmX6P8I.mjs";
|
|
41
|
-
import {
|
|
42
|
-
import "../
|
|
43
|
-
import "../
|
|
44
|
-
import "../
|
|
45
|
-
import "../
|
|
46
|
-
import "../
|
|
47
|
-
import "../
|
|
48
|
-
import "../
|
|
49
|
-
import "../
|
|
50
|
-
import "../
|
|
51
|
-
import "../
|
|
52
|
-
import "../
|
|
53
|
-
import
|
|
54
|
-
import "../
|
|
55
|
-
import "../
|
|
56
|
-
import "../
|
|
57
|
-
import
|
|
58
|
-
import "../
|
|
59
|
-
import "../
|
|
60
|
-
import
|
|
61
|
-
import
|
|
62
|
-
import "../
|
|
63
|
-
import
|
|
64
|
-
import {
|
|
65
|
-
import "../
|
|
66
|
-
import "../
|
|
67
|
-
import "../
|
|
68
|
-
import "../
|
|
69
|
-
import "../
|
|
70
|
-
import "../
|
|
71
|
-
import "../
|
|
72
|
-
import "../
|
|
73
|
-
import "../
|
|
41
|
+
import { t as FTSManager } from "../fts-manager-Crzypjqu.mjs";
|
|
42
|
+
import { n as SchemaRegistry } from "../registry-CtyVedcN.mjs";
|
|
43
|
+
import { r as createPublicMediaUrlResolver } from "../url-Cac7a9QZ.mjs";
|
|
44
|
+
import "../settings-BbqgHWpU.mjs";
|
|
45
|
+
import "../briefing-BJaJI8dm.mjs";
|
|
46
|
+
import "../review-requests-C9Ff11Vq.mjs";
|
|
47
|
+
import { n as VERSION, t as COMMIT } from "../version-BTvfRGc6.mjs";
|
|
48
|
+
import "../query-jaAmw8E1.mjs";
|
|
49
|
+
import "../zod-generator-B7TMjyFJ.mjs";
|
|
50
|
+
import "../schema-DXdYj4R3.mjs";
|
|
51
|
+
import "../seo-qa7Dn0jK.mjs";
|
|
52
|
+
import "../bylines-CMQNCNFh.mjs";
|
|
53
|
+
import "../byline-fields-D-N5qVIG.mjs";
|
|
54
|
+
import "../sections-PVVXHGfp.mjs";
|
|
55
|
+
import "../settings-i4VPP8bT.mjs";
|
|
56
|
+
import "../resolve-Cb6Dbz-C.mjs";
|
|
57
|
+
import "../taxonomies-DRiixp_E.mjs";
|
|
58
|
+
import "../taxonomies-9s-v03H-.mjs";
|
|
59
|
+
import { r as normalizeManifestRoute } from "../manifest-schema-BxVPYMJR.mjs";
|
|
60
|
+
import "../parse-CbymENaR.mjs";
|
|
61
|
+
import "../redirects-CA-xylPG.mjs";
|
|
62
|
+
import "../byline-fields-DOJO16Gm.mjs";
|
|
63
|
+
import "../status-DANd8ERo.mjs";
|
|
64
|
+
import { t as getTrustedProxyHeaders } from "../trusted-proxy-DTXQ2IMv.mjs";
|
|
65
|
+
import "../rate-limit-ZLdyWoZF.mjs";
|
|
66
|
+
import { a as invalidateUrlPatternCache } from "../query-CfRCdaL3.mjs";
|
|
67
|
+
import "../preview-vSVg6fwG.mjs";
|
|
68
|
+
import "../parser-C1nYd-81.mjs";
|
|
69
|
+
import { n as sanitizeHeadersForSandbox, t as extractRequestMeta } from "../request-meta-CUypToDJ.mjs";
|
|
70
|
+
import "../ssrf-DWe8jwAp.mjs";
|
|
71
|
+
import { n as CronExecutor } from "../cron-cKcNTix_.mjs";
|
|
72
|
+
import { r as devConsoleEmailDeliver, t as DEV_CONSOLE_EMAIL_PLUGIN_ID } from "../email-console-ChgKFO8-.mjs";
|
|
73
|
+
import { o as validateEncryptionKeyAtStartup } from "../secrets-CDZo2k8L.mjs";
|
|
74
|
+
import "../api-tokens-2r7OWi_I.mjs";
|
|
75
|
+
import { n as createActivePluginMcpRegistry } from "../mcp-reviewed-executor-TwVbMzG6.mjs";
|
|
76
|
+
import "../activity-events-y6eT8UW6.mjs";
|
|
77
|
+
import "../import-Bh9biJfx.mjs";
|
|
78
|
+
import "../utils-CMDhr5Xd.mjs";
|
|
79
|
+
import "../tokens-1RK1n6ED.mjs";
|
|
80
|
+
import "../comment-reaction-DfFao1ST.mjs";
|
|
81
|
+
import "../menus-xvsnVZXw.mjs";
|
|
82
|
+
import "../bylines-y4LO-dTj.mjs";
|
|
83
|
+
import "../widgets-f0ibZUIq.mjs";
|
|
84
|
+
import "../apply-bZswmZPm.mjs";
|
|
85
|
+
import "../load-DmYeniXl.mjs";
|
|
86
|
+
import "../search-DSaLgEFI.mjs";
|
|
74
87
|
import "../index.mjs";
|
|
75
|
-
import { t as getAuthMode } from "../mode-
|
|
76
|
-
import { i as experimentalSiteContextWorkflowsEnabled } from "../experimental-workflows-
|
|
77
|
-
import { t as cleanupExpiredChallenges } from "../challenge-store-
|
|
78
|
-
import {
|
|
88
|
+
import { t as getAuthMode } from "../mode-C4CIyjtR.mjs";
|
|
89
|
+
import { i as experimentalSiteContextWorkflowsEnabled } from "../experimental-workflows-BMsUnIAw.mjs";
|
|
90
|
+
import { t as cleanupExpiredChallenges } from "../challenge-store-Bjlepa2E.mjs";
|
|
91
|
+
import { t as resolveSessionUser } from "../session-user-CAKImna3.mjs";
|
|
79
92
|
import { Kysely, sql } from "kysely";
|
|
80
93
|
import { defineMiddleware } from "astro:middleware";
|
|
81
94
|
import virtualConfig from "virtual:dineway/config";
|
|
@@ -387,47 +400,6 @@ async function publishDueContent(db, options = {}) {
|
|
|
387
400
|
return published;
|
|
388
401
|
}
|
|
389
402
|
|
|
390
|
-
//#endregion
|
|
391
|
-
//#region src/utils/init-lock.ts
|
|
392
|
-
const DEFAULT_DEADLINE_MS = 15e3;
|
|
393
|
-
const DEFAULT_POLL_MS = 50;
|
|
394
|
-
const MAX_WAIT_HEADROOM_MS = 15e3;
|
|
395
|
-
function sleep(ms) {
|
|
396
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
397
|
-
}
|
|
398
|
-
function createInitLock() {
|
|
399
|
-
return {
|
|
400
|
-
ownerStartedAt: null,
|
|
401
|
-
generation: 0
|
|
402
|
-
};
|
|
403
|
-
}
|
|
404
|
-
async function initWithLock(lock, getCached, init, options) {
|
|
405
|
-
const deadlineMs = options?.deadlineMs ?? DEFAULT_DEADLINE_MS;
|
|
406
|
-
const pollMs = options?.pollMs ?? DEFAULT_POLL_MS;
|
|
407
|
-
const maxWaitMs = options?.maxWaitMs ?? deadlineMs + MAX_WAIT_HEADROOM_MS;
|
|
408
|
-
const waitStart = Date.now();
|
|
409
|
-
for (;;) {
|
|
410
|
-
const cached = getCached();
|
|
411
|
-
if (cached !== null && cached !== void 0) return cached;
|
|
412
|
-
const ownerStartedAt = lock.ownerStartedAt;
|
|
413
|
-
if (ownerStartedAt === null || Date.now() - ownerStartedAt > deadlineMs) {
|
|
414
|
-
lock.generation += 1;
|
|
415
|
-
const claim = lock.generation;
|
|
416
|
-
lock.ownerStartedAt = Date.now();
|
|
417
|
-
try {
|
|
418
|
-
const isCurrentClaim = () => lock.generation === claim;
|
|
419
|
-
const initPromise = Promise.resolve().then(() => init(isCurrentClaim));
|
|
420
|
-
options?.anchor?.(initPromise.then(() => void 0, () => void 0));
|
|
421
|
-
return await initPromise;
|
|
422
|
-
} finally {
|
|
423
|
-
if (lock.generation === claim) lock.ownerStartedAt = null;
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
if (Date.now() - waitStart > maxWaitMs) throw new Error(`initWithLock: timed out after ${maxWaitMs}ms waiting for initialization`);
|
|
427
|
-
await sleep(pollMs);
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
|
|
431
403
|
//#endregion
|
|
432
404
|
//#region src/dineway-runtime.ts
|
|
433
405
|
const LEADING_SLASH_PATTERN = /^\//;
|
|
@@ -553,7 +525,6 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
553
525
|
configuredPlugins;
|
|
554
526
|
sandboxedPlugins;
|
|
555
527
|
sandboxedPluginEntries;
|
|
556
|
-
schemaRegistry;
|
|
557
528
|
_hooks;
|
|
558
529
|
config;
|
|
559
530
|
mediaProviders;
|
|
@@ -576,10 +547,8 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
576
547
|
runtimeDeps;
|
|
577
548
|
/** Mutable ref for the cron invokeCronHook closure to read the current pipeline */
|
|
578
549
|
pipelineRef;
|
|
579
|
-
/**
|
|
580
|
-
|
|
581
|
-
/** Shared in-flight FTS health verification promise. */
|
|
582
|
-
_searchHealthPromise = null;
|
|
550
|
+
/** Process-lifetime FTS health check cache that never stores an in-flight promise. */
|
|
551
|
+
_searchHealthCache = createProcessCache();
|
|
583
552
|
/**
|
|
584
553
|
* Get the database instance for the current request.
|
|
585
554
|
*
|
|
@@ -599,7 +568,6 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
599
568
|
this.configuredPlugins = configuredPlugins;
|
|
600
569
|
this.sandboxedPlugins = sandboxedPlugins;
|
|
601
570
|
this.sandboxedPluginEntries = sandboxedPluginEntries;
|
|
602
|
-
this.schemaRegistry = new SchemaRegistry(db);
|
|
603
571
|
this._hooks = hooks;
|
|
604
572
|
this.enabledPlugins = enabledPlugins;
|
|
605
573
|
this.pluginStates = pluginStates;
|
|
@@ -620,6 +588,32 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
620
588
|
getSandboxRunner() {
|
|
621
589
|
return sandboxRunner;
|
|
622
590
|
}
|
|
591
|
+
get schemaRegistry() {
|
|
592
|
+
return new SchemaRegistry(this.db);
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Resolve native MCP contributions from the current active plugin set.
|
|
596
|
+
* The registry is derived per request so activate/deactivate changes cannot
|
|
597
|
+
* leave a stateless MCP server with a stale contribution snapshot.
|
|
598
|
+
*/
|
|
599
|
+
getPluginMcpRegistry() {
|
|
600
|
+
return createActivePluginMcpRegistry(this.configuredPlugins, this.enabledPlugins);
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* Resolve the outbound HTTP capability for an active native plugin.
|
|
604
|
+
* MCP handlers use this instead of reaching for global fetch, so the same
|
|
605
|
+
* capability and SSRF rules apply to routes, hooks, and MCP contributions.
|
|
606
|
+
*/
|
|
607
|
+
getPluginHttpAccess(pluginId) {
|
|
608
|
+
if (!this.enabledPlugins.has(pluginId)) return void 0;
|
|
609
|
+
const plugin = this.configuredPlugins.find((candidate) => candidate.id === pluginId);
|
|
610
|
+
if (!plugin) return void 0;
|
|
611
|
+
return new PluginContextFactory({
|
|
612
|
+
...this.pipelineFactoryOptions,
|
|
613
|
+
emailPipeline: this.email ?? void 0,
|
|
614
|
+
cronReschedule: this.cronScheduler ? () => this.cronScheduler?.reschedule() : void 0
|
|
615
|
+
}).createContext(plugin).http;
|
|
616
|
+
}
|
|
623
617
|
/**
|
|
624
618
|
* Publish any content whose scheduled time has passed.
|
|
625
619
|
* Routes through the runtime wrapper so after-publish hooks still fire.
|
|
@@ -679,26 +673,29 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
679
673
|
*
|
|
680
674
|
* Search health is deferred off the runtime cold-start path so ordinary
|
|
681
675
|
* page loads do not pay the index verification cost. Concurrent callers
|
|
682
|
-
*
|
|
683
|
-
* treated as healthy for the lifetime of this runtime instance.
|
|
676
|
+
* coalesce without sharing an in-flight promise, and once it has completed
|
|
677
|
+
* the result is treated as healthy for the lifetime of this runtime instance.
|
|
684
678
|
*/
|
|
685
679
|
async ensureSearchHealthy() {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
if (!isSqlite(
|
|
689
|
-
|
|
690
|
-
return;
|
|
691
|
-
}
|
|
692
|
-
this._searchHealthPromise = (async () => {
|
|
680
|
+
const requestDb = getRequestContextDatabase();
|
|
681
|
+
const db = requestDb ?? this._db;
|
|
682
|
+
if (!isSqlite(db)) return;
|
|
683
|
+
const verify = async () => {
|
|
693
684
|
try {
|
|
694
|
-
const repaired = await new FTSManager(
|
|
685
|
+
const repaired = await new FTSManager(db).verifyAndRepairAll();
|
|
695
686
|
if (repaired > 0) console.log(`Repaired ${repaired} corrupted FTS index(es)`);
|
|
696
|
-
} catch {}
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
687
|
+
} catch {}
|
|
688
|
+
};
|
|
689
|
+
if (requestDb) {
|
|
690
|
+
await verify();
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
try {
|
|
694
|
+
await processCachedAsync(this._searchHealthCache, verify, {
|
|
695
|
+
anchor: (promise) => after(() => promise),
|
|
696
|
+
ownerTimeoutMs: 3e4
|
|
697
|
+
});
|
|
698
|
+
} catch {}
|
|
702
699
|
}
|
|
703
700
|
/**
|
|
704
701
|
* Update in-memory plugin status and rebuild the hook pipeline.
|
|
@@ -731,10 +728,7 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
731
728
|
async rebuildHookPipeline() {
|
|
732
729
|
const newPipeline = createHookPipeline(this.allPipelinePlugins.filter((p) => this.enabledPlugins.has(p.id)), this.pipelineFactoryOptions);
|
|
733
730
|
await DinewayRuntime.resolveExclusiveHooks(newPipeline, this.db, this.runtimeDeps);
|
|
734
|
-
if (this.email) newPipeline.setContextFactory({
|
|
735
|
-
db: this.db,
|
|
736
|
-
emailPipeline: this.email
|
|
737
|
-
});
|
|
731
|
+
if (this.email) newPipeline.setContextFactory({ emailPipeline: this.email });
|
|
738
732
|
if (this.cronScheduler) {
|
|
739
733
|
const scheduler = this.cronScheduler;
|
|
740
734
|
newPipeline.setContextFactory({ cronReschedule: () => scheduler.reschedule() });
|
|
@@ -816,7 +810,10 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
816
810
|
const routeMetaMap = /* @__PURE__ */ new Map();
|
|
817
811
|
for (const entry of bundle.manifest.routes) {
|
|
818
812
|
const normalized = normalizeManifestRoute(entry);
|
|
819
|
-
routeMetaMap.set(normalized.name, {
|
|
813
|
+
routeMetaMap.set(normalized.name, {
|
|
814
|
+
public: normalized.public === true,
|
|
815
|
+
body: "json"
|
|
816
|
+
});
|
|
820
817
|
}
|
|
821
818
|
sandboxedRouteMetaCache.set(pluginId, routeMetaMap);
|
|
822
819
|
} else sandboxedRouteMetaCache.delete(pluginId);
|
|
@@ -843,6 +840,7 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
843
840
|
}
|
|
844
841
|
};
|
|
845
842
|
const db = await phase("rt.db", "DB init + migrations", () => DinewayRuntime.getDatabase(deps));
|
|
843
|
+
const resolveDb = () => getRequestContextDatabase() ?? db;
|
|
846
844
|
await phase("rt.secrets", "Validate encryption key", () => validateEncryptionKeyAtStartup());
|
|
847
845
|
const storage = DinewayRuntime.getStorage(deps);
|
|
848
846
|
let pluginStates = /* @__PURE__ */ new Map();
|
|
@@ -906,6 +904,7 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
906
904
|
const trustedProxyHeaders = getTrustedProxyHeaders(deps.config);
|
|
907
905
|
const pipelineFactoryOptions = {
|
|
908
906
|
db,
|
|
907
|
+
getDb: resolveDb,
|
|
909
908
|
storage: storage ?? void 0,
|
|
910
909
|
siteInfo,
|
|
911
910
|
trustedProxyHeaders
|
|
@@ -924,6 +923,7 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
924
923
|
const mediaProviderEntries = deps.mediaProviderEntries ?? [];
|
|
925
924
|
const providerContext = {
|
|
926
925
|
db,
|
|
926
|
+
getDb: resolveDb,
|
|
927
927
|
storage
|
|
928
928
|
};
|
|
929
929
|
for (const entry of mediaProviderEntries) try {
|
|
@@ -940,15 +940,12 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
940
940
|
const result = await pipelineRef.current.invokeCronHook(pluginId, event);
|
|
941
941
|
if (!result.success && result.error) throw result.error;
|
|
942
942
|
};
|
|
943
|
-
pipeline.setContextFactory({
|
|
944
|
-
db,
|
|
945
|
-
emailPipeline
|
|
946
|
-
});
|
|
943
|
+
pipeline.setContextFactory({ emailPipeline });
|
|
947
944
|
let cronExecutor = null;
|
|
948
945
|
const runtimeRef = { current: null };
|
|
949
946
|
await phase("rt.cron", "Cron init (recovery deferred post-response)", async () => {
|
|
950
947
|
try {
|
|
951
|
-
cronExecutor = new CronExecutor(
|
|
948
|
+
cronExecutor = new CronExecutor(resolveDb, invokeCronHook);
|
|
952
949
|
const executorForRecovery = cronExecutor;
|
|
953
950
|
after(async () => {
|
|
954
951
|
try {
|
|
@@ -979,6 +976,18 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
979
976
|
console.warn("[cron] Failed to initialize cron system:", error);
|
|
980
977
|
}
|
|
981
978
|
});
|
|
979
|
+
await phase("rt.pluginLifecycle", "Configured plugin first-start lifecycle", async () => {
|
|
980
|
+
const stateRepository = new PluginStateRepository(db);
|
|
981
|
+
for (const plugin of deps.plugins) {
|
|
982
|
+
if (pluginStates.has(plugin.id)) continue;
|
|
983
|
+
const installFailure = (await pipeline.runPluginInstall(plugin.id)).find((result) => !result.success);
|
|
984
|
+
if (installFailure) throw new Error(`Plugin install failed for "${plugin.id}": ${installFailure.error?.message ?? "Unknown error"}`);
|
|
985
|
+
const activateFailure = (await pipeline.runPluginActivate(plugin.id)).find((result) => !result.success);
|
|
986
|
+
if (activateFailure) throw new Error(`Plugin activation failed for "${plugin.id}": ${activateFailure.error?.message ?? "Unknown error"}`);
|
|
987
|
+
await stateRepository.enable(plugin.id, plugin.version);
|
|
988
|
+
pluginStates.set(plugin.id, "active");
|
|
989
|
+
}
|
|
990
|
+
});
|
|
982
991
|
const runtime = new DinewayRuntime(db, storage, deps.plugins, sandboxedPlugins, deps.sandboxedPluginEntries, pipeline, enabledPlugins, pluginStates, deps.config, mediaProviders, mediaProviderEntries, cronExecutor, cronScheduler, emailPipeline, allPipelinePlugins, pipelineFactoryOptions, deps, pipelineRef);
|
|
983
992
|
runtimeRef.current = runtime;
|
|
984
993
|
return runtime;
|
|
@@ -1030,9 +1039,9 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
1030
1039
|
}
|
|
1031
1040
|
})();
|
|
1032
1041
|
if (collectionCount.count === 0 && !setupDone) {
|
|
1033
|
-
const { applySeed } = await import("../apply-
|
|
1034
|
-
const { loadSeed } = await import("../load-
|
|
1035
|
-
const { validateSeed } = await import("../validate-
|
|
1042
|
+
const { applySeed } = await import("../apply-bZswmZPm.mjs").then((n) => n.n);
|
|
1043
|
+
const { loadSeed } = await import("../load-DmYeniXl.mjs").then((n) => n.r);
|
|
1044
|
+
const { validateSeed } = await import("../validate-DNs0pTSc.mjs").then((n) => n.n);
|
|
1036
1045
|
const seed = await loadSeed();
|
|
1037
1046
|
if (validateSeed(seed).valid) {
|
|
1038
1047
|
await applySeed(db, seed, { onConflict: "skip" });
|
|
@@ -1130,7 +1139,10 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
1130
1139
|
const routeMeta = /* @__PURE__ */ new Map();
|
|
1131
1140
|
for (const entry of bundle.manifest.routes) {
|
|
1132
1141
|
const normalized = normalizeManifestRoute(entry);
|
|
1133
|
-
routeMeta.set(normalized.name, {
|
|
1142
|
+
routeMeta.set(normalized.name, {
|
|
1143
|
+
public: normalized.public === true,
|
|
1144
|
+
body: "json"
|
|
1145
|
+
});
|
|
1134
1146
|
}
|
|
1135
1147
|
sandboxedRouteMetaCache.set(plugin.pluginId, routeMeta);
|
|
1136
1148
|
}
|
|
@@ -1238,7 +1250,9 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
1238
1250
|
sandboxed: true,
|
|
1239
1251
|
adminMode: hasAdminPages || hasWidgets ? "blocks" : "none",
|
|
1240
1252
|
adminPages: entry.adminPages ?? [],
|
|
1241
|
-
dashboardWidgets: entry.adminWidgets ?? []
|
|
1253
|
+
dashboardWidgets: entry.adminWidgets ?? [],
|
|
1254
|
+
portableTextBlocks: entry.portableTextBlocks,
|
|
1255
|
+
fieldWidgets: entry.fieldWidgets
|
|
1242
1256
|
};
|
|
1243
1257
|
}
|
|
1244
1258
|
for (const [pluginId, meta] of marketplaceManifestCache) {
|
|
@@ -1318,11 +1332,13 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
1318
1332
|
authorId: body.authorId,
|
|
1319
1333
|
bylines: body.bylines
|
|
1320
1334
|
});
|
|
1321
|
-
if (result.success && result.data)
|
|
1335
|
+
if (result.success && result.data) {
|
|
1336
|
+
await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
|
|
1337
|
+
this.runAfterSaveHooks(contentItemToRecord(result.data.item), collection, true);
|
|
1338
|
+
}
|
|
1322
1339
|
return result;
|
|
1323
1340
|
}
|
|
1324
1341
|
async handleContentUpdate(collection, id, body) {
|
|
1325
|
-
const { ContentRepository } = await import("../content-CBxYGWfL.mjs").then((n) => n.n);
|
|
1326
1342
|
const repo = new ContentRepository(this.db);
|
|
1327
1343
|
const resolvedItem = await repo.findByIdOrSlug(collection, id, body.locale);
|
|
1328
1344
|
const resolvedId = resolvedItem?.id ?? id;
|
|
@@ -1393,7 +1409,21 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
1393
1409
|
authorId: bodyWithoutRev.authorId,
|
|
1394
1410
|
bylines: bodyWithoutRev.bylines
|
|
1395
1411
|
});
|
|
1396
|
-
if (result.success && result.data)
|
|
1412
|
+
if (result.success && result.data) {
|
|
1413
|
+
const contentIdsToRefresh = [resolvedId];
|
|
1414
|
+
if (!usesDraftRevisions && processedData) try {
|
|
1415
|
+
contentIdsToRefresh.push(...await findNonTranslatableSiblingContentIds(this.db, collection, resolvedId, result.data.item.translationGroup, processedData));
|
|
1416
|
+
} catch (error) {
|
|
1417
|
+
console.error(`[media-usage] Failed to discover synced i18n siblings for ${collection}/${resolvedId}:`, error);
|
|
1418
|
+
try {
|
|
1419
|
+
await markContentMediaUsageCollectionStale(this.db, collection, "CONTENT_USAGE_REFRESH_ERROR");
|
|
1420
|
+
} catch (staleError) {
|
|
1421
|
+
console.error(`[media-usage] Failed to mark ${collection} stale:`, staleError);
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
await this.refreshContentUsageAfterSuccessfulWrite(collection, contentIdsToRefresh);
|
|
1425
|
+
this.runAfterSaveHooks(contentItemToRecord(result.data.item), collection, false);
|
|
1426
|
+
}
|
|
1397
1427
|
return result;
|
|
1398
1428
|
}
|
|
1399
1429
|
async handleContentDelete(collection, id) {
|
|
@@ -1414,48 +1444,81 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
1414
1444
|
message: "Delete blocked by sandboxed plugin hook"
|
|
1415
1445
|
}
|
|
1416
1446
|
};
|
|
1447
|
+
const contentId = await this.resolveContentId(collection, id, false);
|
|
1417
1448
|
const result = await handleContentDelete(this.db, collection, id);
|
|
1418
|
-
if (result.success)
|
|
1449
|
+
if (result.success) {
|
|
1450
|
+
if (contentId) await this.refreshContentUsageAfterSuccessfulWrite(collection, [contentId]);
|
|
1451
|
+
this.runAfterDeleteHooks(id, collection, false);
|
|
1452
|
+
}
|
|
1419
1453
|
return result;
|
|
1420
1454
|
}
|
|
1421
1455
|
async handleContentListTrashed(collection, params = {}) {
|
|
1422
1456
|
return handleContentListTrashed(this.db, collection, params);
|
|
1423
1457
|
}
|
|
1424
1458
|
async handleContentRestore(collection, id) {
|
|
1425
|
-
|
|
1459
|
+
const result = await handleContentRestore(this.db, collection, id);
|
|
1460
|
+
if (result.success) {
|
|
1461
|
+
await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
|
|
1462
|
+
this.runAfterRestoreHooks(contentItemToRecord(result.data.item), collection);
|
|
1463
|
+
}
|
|
1464
|
+
return result;
|
|
1426
1465
|
}
|
|
1427
1466
|
async handleContentPermanentDelete(collection, id) {
|
|
1467
|
+
const contentId = await this.resolveContentId(collection, id, true);
|
|
1428
1468
|
const result = await handleContentPermanentDelete(this.db, collection, id);
|
|
1429
|
-
if (result.success)
|
|
1469
|
+
if (result.success) {
|
|
1470
|
+
if (contentId) await this.deleteContentUsageAfterSuccessfulPermanentDelete(collection, contentId);
|
|
1471
|
+
this.runAfterDeleteHooks(id, collection, true);
|
|
1472
|
+
}
|
|
1430
1473
|
return result;
|
|
1431
1474
|
}
|
|
1432
1475
|
async handleContentCountTrashed(collection) {
|
|
1433
1476
|
return handleContentCountTrashed(this.db, collection);
|
|
1434
1477
|
}
|
|
1435
1478
|
async handleContentDuplicate(collection, id, authorId) {
|
|
1436
|
-
|
|
1479
|
+
const result = await handleContentDuplicate(this.db, collection, id, authorId);
|
|
1480
|
+
if (result.success && result.data) await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
|
|
1481
|
+
return result;
|
|
1437
1482
|
}
|
|
1438
1483
|
async handleContentPublish(collection, id, options = {}) {
|
|
1439
1484
|
const result = await handleContentPublish(this.db, collection, id, options);
|
|
1440
|
-
if (result.success && result.data)
|
|
1485
|
+
if (result.success && result.data) {
|
|
1486
|
+
await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
|
|
1487
|
+
this.runAfterPublishHooks(contentItemToRecord(result.data.item), collection);
|
|
1488
|
+
}
|
|
1441
1489
|
return result;
|
|
1442
1490
|
}
|
|
1443
1491
|
async handleContentUnpublish(collection, id) {
|
|
1444
1492
|
const result = await handleContentUnpublish(this.db, collection, id);
|
|
1445
|
-
if (result.success && result.data)
|
|
1493
|
+
if (result.success && result.data) {
|
|
1494
|
+
await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
|
|
1495
|
+
this.runAfterUnpublishHooks(contentItemToRecord(result.data.item), collection);
|
|
1496
|
+
}
|
|
1446
1497
|
return result;
|
|
1447
1498
|
}
|
|
1448
1499
|
async handleContentSchedule(collection, id, scheduledAt) {
|
|
1449
|
-
|
|
1500
|
+
const result = await handleContentSchedule(this.db, collection, id, scheduledAt);
|
|
1501
|
+
if (result.success && result.data) {
|
|
1502
|
+
await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
|
|
1503
|
+
this.runAfterScheduleHooks(contentItemToRecord(result.data.item), collection);
|
|
1504
|
+
}
|
|
1505
|
+
return result;
|
|
1450
1506
|
}
|
|
1451
1507
|
async handleContentUnschedule(collection, id) {
|
|
1452
|
-
|
|
1508
|
+
const result = await handleContentUnschedule(this.db, collection, id);
|
|
1509
|
+
if (result.success && result.data) {
|
|
1510
|
+
await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
|
|
1511
|
+
this.runAfterUnscheduleHooks(contentItemToRecord(result.data.item), collection);
|
|
1512
|
+
}
|
|
1513
|
+
return result;
|
|
1453
1514
|
}
|
|
1454
1515
|
async handleContentCountScheduled(collection) {
|
|
1455
1516
|
return handleContentCountScheduled(this.db, collection);
|
|
1456
1517
|
}
|
|
1457
1518
|
async handleContentDiscardDraft(collection, id) {
|
|
1458
|
-
|
|
1519
|
+
const result = await handleContentDiscardDraft(this.db, collection, id);
|
|
1520
|
+
if (result.success && result.data) await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
|
|
1521
|
+
return result;
|
|
1459
1522
|
}
|
|
1460
1523
|
async handleContentCompare(collection, id) {
|
|
1461
1524
|
return handleContentCompare(this.db, collection, id);
|
|
@@ -1463,6 +1526,25 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
1463
1526
|
async handleContentTranslations(collection, id) {
|
|
1464
1527
|
return handleContentTranslations(this.db, collection, id);
|
|
1465
1528
|
}
|
|
1529
|
+
async refreshContentUsageAfterSuccessfulWrite(collection, contentIds) {
|
|
1530
|
+
for (const contentId of new Set(contentIds)) try {
|
|
1531
|
+
await refreshContentMediaUsageAfterWrite(this.db, collection, contentId);
|
|
1532
|
+
} catch (error) {
|
|
1533
|
+
console.error(`[media-usage] Failed after content write ${collection}/${contentId}:`, error);
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
async deleteContentUsageAfterSuccessfulPermanentDelete(collection, contentId) {
|
|
1537
|
+
try {
|
|
1538
|
+
const result = await deleteContentMediaUsage(this.db, collection, contentId);
|
|
1539
|
+
if (!result.success) console.error(`[media-usage] Usage delete for ${collection}/${contentId} finished with ${result.errorCode}`);
|
|
1540
|
+
} catch (error) {
|
|
1541
|
+
console.error(`[media-usage] Failed after permanent content delete ${collection}/${contentId}:`, error);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
async resolveContentId(collection, id, includeTrashed) {
|
|
1545
|
+
const repo = new ContentRepository(this.db);
|
|
1546
|
+
return (includeTrashed ? await repo.findByIdOrSlugIncludingTrashed(collection, id) : await repo.findByIdOrSlug(collection, id))?.id ?? null;
|
|
1547
|
+
}
|
|
1466
1548
|
async handleMediaList(params) {
|
|
1467
1549
|
return handleMediaList(this.db, params);
|
|
1468
1550
|
}
|
|
@@ -1526,7 +1608,12 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
1526
1608
|
if (trustedPlugin) {
|
|
1527
1609
|
const route = trustedPlugin.routes[routeKey];
|
|
1528
1610
|
if (!route) return null;
|
|
1529
|
-
return {
|
|
1611
|
+
return {
|
|
1612
|
+
public: route.public === true,
|
|
1613
|
+
body: route.body ?? "json",
|
|
1614
|
+
...route.body === "raw" ? { maxBodyBytes: route.maxBodyBytes ?? DEFAULT_PLUGIN_RAW_BODY_LIMIT_BYTES } : {},
|
|
1615
|
+
authorization: route.authorization
|
|
1616
|
+
};
|
|
1530
1617
|
}
|
|
1531
1618
|
const meta = sandboxedRouteMetaCache.get(pluginId);
|
|
1532
1619
|
if (meta) {
|
|
@@ -1535,14 +1622,23 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
1535
1622
|
}
|
|
1536
1623
|
if (routeKey === "admin") {
|
|
1537
1624
|
const manifestMeta = marketplaceManifestCache.get(pluginId);
|
|
1538
|
-
if (manifestMeta?.admin?.pages?.length || manifestMeta?.admin?.widgets?.length) return {
|
|
1625
|
+
if (manifestMeta?.admin?.pages?.length || manifestMeta?.admin?.widgets?.length) return {
|
|
1626
|
+
public: false,
|
|
1627
|
+
body: "json"
|
|
1628
|
+
};
|
|
1539
1629
|
const entry = this.sandboxedPluginEntries.find((e) => e.id === pluginId);
|
|
1540
|
-
if (entry?.adminPages?.length || entry?.adminWidgets?.length) return {
|
|
1630
|
+
if (entry?.adminPages?.length || entry?.adminWidgets?.length) return {
|
|
1631
|
+
public: false,
|
|
1632
|
+
body: "json"
|
|
1633
|
+
};
|
|
1541
1634
|
}
|
|
1542
|
-
if (this.findSandboxedPlugin(pluginId)) return {
|
|
1635
|
+
if (this.findSandboxedPlugin(pluginId)) return {
|
|
1636
|
+
public: false,
|
|
1637
|
+
body: "json"
|
|
1638
|
+
};
|
|
1543
1639
|
return null;
|
|
1544
1640
|
}
|
|
1545
|
-
async handlePluginApiRoute(pluginId, _method, path, request) {
|
|
1641
|
+
async handlePluginApiRoute(pluginId, _method, path, request, invocation) {
|
|
1546
1642
|
if (!this.isPluginEnabled(pluginId)) return {
|
|
1547
1643
|
success: false,
|
|
1548
1644
|
error: {
|
|
@@ -1555,22 +1651,41 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
1555
1651
|
const routeRegistry = new PluginRouteRegistry({
|
|
1556
1652
|
...this.pipelineFactoryOptions,
|
|
1557
1653
|
db: this.db,
|
|
1654
|
+
storage: this.storage ?? void 0,
|
|
1558
1655
|
emailPipeline: this.email ?? void 0,
|
|
1559
1656
|
trustedProxyHeaders: getTrustedProxyHeaders(this.config)
|
|
1560
1657
|
});
|
|
1561
1658
|
routeRegistry.register(trustedPlugin);
|
|
1562
1659
|
const routeKey = path.replace(LEADING_SLASH_PATTERN, "");
|
|
1660
|
+
const trustedRoute = trustedPlugin.routes[routeKey];
|
|
1661
|
+
if ((trustedRoute?.body ?? "json") === "raw") {
|
|
1662
|
+
const bodyResult = await readBoundedPluginRouteBody(request, trustedRoute?.maxBodyBytes ?? DEFAULT_PLUGIN_RAW_BODY_LIMIT_BYTES);
|
|
1663
|
+
if (!bodyResult.ok) return {
|
|
1664
|
+
success: false,
|
|
1665
|
+
error: {
|
|
1666
|
+
code: "PAYLOAD_TOO_LARGE",
|
|
1667
|
+
message: `Plugin route request body exceeds ${bodyResult.limit} bytes`
|
|
1668
|
+
},
|
|
1669
|
+
status: 413
|
|
1670
|
+
};
|
|
1671
|
+
return routeRegistry.invoke(pluginId, routeKey, {
|
|
1672
|
+
request,
|
|
1673
|
+
rawBody: bodyResult.bytes,
|
|
1674
|
+
actor: invocation?.actor
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1563
1677
|
let body = void 0;
|
|
1564
1678
|
try {
|
|
1565
1679
|
body = await request.json();
|
|
1566
1680
|
} catch {}
|
|
1567
1681
|
return routeRegistry.invoke(pluginId, routeKey, {
|
|
1568
1682
|
request,
|
|
1569
|
-
body
|
|
1683
|
+
body,
|
|
1684
|
+
actor: invocation?.actor
|
|
1570
1685
|
});
|
|
1571
1686
|
}
|
|
1572
1687
|
const sandboxedPlugin = this.findSandboxedPlugin(pluginId);
|
|
1573
|
-
if (sandboxedPlugin) return this.handleSandboxedRoute(sandboxedPlugin, path, request);
|
|
1688
|
+
if (sandboxedPlugin) return this.handleSandboxedRoute(sandboxedPlugin, path, request, invocation?.actor);
|
|
1574
1689
|
return {
|
|
1575
1690
|
success: false,
|
|
1576
1691
|
error: {
|
|
@@ -1685,11 +1800,42 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
1685
1800
|
}
|
|
1686
1801
|
}
|
|
1687
1802
|
runAfterPublishHooks(content, collection) {
|
|
1803
|
+
this.runDeferredContentHook("content:afterPublish", content, collection);
|
|
1804
|
+
}
|
|
1805
|
+
runAfterUnpublishHooks(content, collection) {
|
|
1806
|
+
this.runDeferredContentHook("content:afterUnpublish", content, collection);
|
|
1807
|
+
}
|
|
1808
|
+
runAfterRestoreHooks(content, collection) {
|
|
1809
|
+
this.runDeferredContentHook("content:afterRestore", content, collection);
|
|
1810
|
+
}
|
|
1811
|
+
runAfterScheduleHooks(content, collection) {
|
|
1812
|
+
this.runDeferredContentHook("content:afterSchedule", content, collection);
|
|
1813
|
+
}
|
|
1814
|
+
runAfterUnscheduleHooks(content, collection) {
|
|
1815
|
+
this.runDeferredContentHook("content:afterUnschedule", content, collection);
|
|
1816
|
+
}
|
|
1817
|
+
runDeferredContentHook(name, content, collection) {
|
|
1688
1818
|
after(async () => {
|
|
1689
|
-
if (this.hooks.hasHooks(
|
|
1690
|
-
|
|
1819
|
+
if (this.hooks.hasHooks(name)) try {
|
|
1820
|
+
switch (name) {
|
|
1821
|
+
case "content:afterPublish":
|
|
1822
|
+
await this.hooks.runContentAfterPublish(content, collection);
|
|
1823
|
+
break;
|
|
1824
|
+
case "content:afterUnpublish":
|
|
1825
|
+
await this.hooks.runContentAfterUnpublish(content, collection);
|
|
1826
|
+
break;
|
|
1827
|
+
case "content:afterRestore":
|
|
1828
|
+
await this.hooks.runContentAfterRestore(content, collection);
|
|
1829
|
+
break;
|
|
1830
|
+
case "content:afterSchedule":
|
|
1831
|
+
await this.hooks.runContentAfterSchedule(content, collection);
|
|
1832
|
+
break;
|
|
1833
|
+
case "content:afterUnschedule":
|
|
1834
|
+
await this.hooks.runContentAfterUnschedule(content, collection);
|
|
1835
|
+
break;
|
|
1836
|
+
}
|
|
1691
1837
|
} catch (err) {
|
|
1692
|
-
console.error(
|
|
1838
|
+
console.error(`Dineway ${name} hook error:`, err);
|
|
1693
1839
|
}
|
|
1694
1840
|
const tasks = [];
|
|
1695
1841
|
for (const [pluginKey, plugin] of this.sandboxedPlugins) {
|
|
@@ -1697,30 +1843,19 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
1697
1843
|
if (!pluginId || !this.isPluginEnabled(pluginId)) continue;
|
|
1698
1844
|
tasks.push((async () => {
|
|
1699
1845
|
try {
|
|
1700
|
-
await plugin.invokeHook(
|
|
1846
|
+
await plugin.invokeHook(name, {
|
|
1701
1847
|
content,
|
|
1702
1848
|
collection
|
|
1703
1849
|
});
|
|
1704
1850
|
} catch (err) {
|
|
1705
|
-
console.error(`Dineway: Sandboxed plugin ${pluginId}
|
|
1851
|
+
console.error(`Dineway: Sandboxed plugin ${pluginId} ${name} error:`, err);
|
|
1706
1852
|
}
|
|
1707
1853
|
})());
|
|
1708
1854
|
}
|
|
1709
1855
|
await Promise.allSettled(tasks);
|
|
1710
1856
|
});
|
|
1711
1857
|
}
|
|
1712
|
-
|
|
1713
|
-
if (this.hooks.hasHooks("content:afterUnpublish")) this.hooks.runContentAfterUnpublish(content, collection).catch((err) => console.error("Dineway afterUnpublish hook error:", err));
|
|
1714
|
-
for (const [pluginKey, plugin] of this.sandboxedPlugins) {
|
|
1715
|
-
const [pluginId] = pluginKey.split(":");
|
|
1716
|
-
if (!pluginId || !this.isPluginEnabled(pluginId)) continue;
|
|
1717
|
-
plugin.invokeHook("content:afterUnpublish", {
|
|
1718
|
-
content,
|
|
1719
|
-
collection
|
|
1720
|
-
}).catch((err) => console.error(`Dineway: Sandboxed plugin ${pluginId} afterUnpublish error:`, err));
|
|
1721
|
-
}
|
|
1722
|
-
}
|
|
1723
|
-
async handleSandboxedRoute(plugin, path, request) {
|
|
1858
|
+
async handleSandboxedRoute(plugin, path, request, actor) {
|
|
1724
1859
|
const routeName = path.replace(LEADING_SLASH_PATTERN, "");
|
|
1725
1860
|
let body = void 0;
|
|
1726
1861
|
try {
|
|
@@ -1735,7 +1870,8 @@ var DinewayRuntime = class DinewayRuntime {
|
|
|
1735
1870
|
url: request.url,
|
|
1736
1871
|
method: request.method,
|
|
1737
1872
|
headers,
|
|
1738
|
-
meta
|
|
1873
|
+
meta,
|
|
1874
|
+
actor: actor ?? null
|
|
1739
1875
|
})
|
|
1740
1876
|
};
|
|
1741
1877
|
} catch (error) {
|
|
@@ -1982,9 +2118,9 @@ function setBaselineSecurityHeaders(response, pathname, serverTimings) {
|
|
|
1982
2118
|
const res = new Response(response.body, response);
|
|
1983
2119
|
const astroCookies = Reflect.get(response, ASTRO_COOKIES_SYMBOL);
|
|
1984
2120
|
if (astroCookies !== void 0) Reflect.set(res, ASTRO_COOKIES_SYMBOL, astroCookies);
|
|
1985
|
-
res.headers.set("X-Content-Type-Options", "nosniff");
|
|
1986
|
-
res.headers.set("Referrer-Policy", "strict-origin-when-cross-origin");
|
|
1987
|
-
res.headers.set("Permissions-Policy", "camera=(), microphone=(), geolocation=(), payment=()");
|
|
2121
|
+
if (!res.headers.has("X-Content-Type-Options")) res.headers.set("X-Content-Type-Options", "nosniff");
|
|
2122
|
+
if (!res.headers.has("Referrer-Policy")) res.headers.set("Referrer-Policy", "strict-origin-when-cross-origin");
|
|
2123
|
+
if (!res.headers.has("Permissions-Policy")) res.headers.set("Permissions-Policy", "camera=(), microphone=(), geolocation=(), payment=()");
|
|
1988
2124
|
const shouldSetFrameOptions = !import.meta.env.DEV || pathname.startsWith("/_dineway");
|
|
1989
2125
|
if (!res.headers.has("Content-Security-Policy") && shouldSetFrameOptions) res.headers.set("X-Frame-Options", "SAMEORIGIN");
|
|
1990
2126
|
if (serverTimings && serverTimings.length > 0) res.headers.set("Server-Timing", formatServerTimingHeader(serverTimings));
|
|
@@ -2059,11 +2195,11 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2059
2195
|
const requestDb = locals.__dinewayRequestDb;
|
|
2060
2196
|
if (!isDinewayRoute && !isPublicRuntimeRoute && !hasEditCookie && !hasPreviewToken) {
|
|
2061
2197
|
const hasSessionCookie = cookies.get("astro-session") !== void 0;
|
|
2062
|
-
if (!(context.isPrerendered || !hasSessionCookie ? null : await context.session
|
|
2063
|
-
if (!isSetupVerified()) {
|
|
2198
|
+
if (!(context.isPrerendered || !hasSessionCookie ? null : await resolveSessionUser(context.session)) && !requestDb) {
|
|
2199
|
+
if (!isSetupVerified() && !context.isPrerendered) {
|
|
2064
2200
|
const setupStart = startServerTiming(serverTimings);
|
|
2065
2201
|
try {
|
|
2066
|
-
const { getDb } = await import("../loader
|
|
2202
|
+
const { getDb } = await import("../loader-CjWqjweO.mjs").then((n) => n.i);
|
|
2067
2203
|
await (await getDb()).selectFrom("_dineway_migrations").selectAll().limit(1).execute();
|
|
2068
2204
|
markSetupVerified();
|
|
2069
2205
|
} catch (error) {
|
|
@@ -2117,6 +2253,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2117
2253
|
locals.dineway = {
|
|
2118
2254
|
handleContentList: runtime.handleContentList.bind(runtime),
|
|
2119
2255
|
handleContentGet: runtime.handleContentGet.bind(runtime),
|
|
2256
|
+
handleContentAuthors: runtime.handleContentAuthors.bind(runtime),
|
|
2120
2257
|
handleContentCreate: runtime.handleContentCreate.bind(runtime),
|
|
2121
2258
|
handleContentUpdate: runtime.handleContentUpdate.bind(runtime),
|
|
2122
2259
|
handleContentDelete: runtime.handleContentDelete.bind(runtime),
|
|
@@ -2145,6 +2282,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2145
2282
|
handlePluginApiRoute: runtime.handlePluginApiRoute.bind(runtime),
|
|
2146
2283
|
handlePublicPluginApiRoute: createPublicPluginApiRouteHandler(runtime),
|
|
2147
2284
|
getPluginRouteMeta: runtime.getPluginRouteMeta.bind(runtime),
|
|
2285
|
+
getPluginHttpAccess: runtime.getPluginHttpAccess.bind(runtime),
|
|
2148
2286
|
getMediaProvider: runtime.getMediaProvider.bind(runtime),
|
|
2149
2287
|
getMediaProviderList: runtime.getMediaProviderList.bind(runtime),
|
|
2150
2288
|
collectPageMetadata: runtime.collectPageMetadata.bind(runtime),
|
|
@@ -2156,6 +2294,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2156
2294
|
hooks: runtime.hooks,
|
|
2157
2295
|
email: runtime.email,
|
|
2158
2296
|
configuredPlugins: runtime.configuredPlugins,
|
|
2297
|
+
sandboxedPluginEntries: runtime.sandboxedPluginEntries,
|
|
2159
2298
|
config,
|
|
2160
2299
|
getManifest: runtime.getManifest.bind(runtime),
|
|
2161
2300
|
invalidateManifest: runtime.invalidateManifest.bind(runtime),
|
|
@@ -2179,10 +2318,12 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2179
2318
|
return runWithContext(parentContext ? {
|
|
2180
2319
|
...parentContext,
|
|
2181
2320
|
editMode,
|
|
2182
|
-
db: requestDb
|
|
2321
|
+
db: requestDb,
|
|
2322
|
+
dbIsIsolated: true
|
|
2183
2323
|
} : {
|
|
2184
2324
|
editMode,
|
|
2185
|
-
db: requestDb
|
|
2325
|
+
db: requestDb,
|
|
2326
|
+
dbIsIsolated: true
|
|
2186
2327
|
}, doInit);
|
|
2187
2328
|
}
|
|
2188
2329
|
return doInit();
|