dineway 0.1.49 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity-DUaz_w7p.mjs +79 -0
- package/dist/{activity-events-CwM7yxPW.mjs → activity-events-CJDvE2uc.mjs} +5 -113
- package/dist/actor-0QJ1Gbtf.mjs +37 -0
- package/dist/after-BfniwgIf.mjs +9 -0
- package/dist/{allowed-origins-CyGnbgBd.mjs → allowed-origins--OwHHiY8.mjs} +1 -1
- package/dist/api/route-utils.d.mts +9 -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-B4PHIF4V.mjs} +93 -41
- package/dist/{api-tokens-DtvdtIkm.mjs → api-tokens-tbK_sORH.mjs} +6 -2
- package/dist/{apply-D_RlTYtC.mjs → apply-DjTqq6Ae.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 +34 -11
- package/dist/astro/index.mjs +163 -24
- 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 +8 -18
- 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 +389 -206
- 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 +27 -24
- package/dist/astro/routes/api/admin/context/_id_/index.mjs +27 -24
- package/dist/astro/routes/api/admin/context/_id_/review.mjs +32 -28
- package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +32 -28
- package/dist/astro/routes/api/admin/context/diff.mjs +31 -27
- package/dist/astro/routes/api/admin/context/index.mjs +32 -28
- package/dist/astro/routes/api/admin/context/stale.mjs +31 -27
- package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +27 -24
- package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +31 -27
- package/dist/astro/routes/api/admin/hitl-requests/index.mjs +31 -27
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +28 -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 +56 -51
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +56 -51
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +47 -43
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +54 -49
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +53 -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 +53 -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 +32 -63
- package/dist/astro/routes/api/admin/review-requests/index.d.mts +2 -1
- package/dist/astro/routes/api/admin/review-requests/index.mjs +58 -10
- 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 +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +49 -20
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +67 -32
- 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 +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +11 -9
- package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/index.mjs +11 -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 +18 -1
- package/dist/astro/routes/api/import/wordpress/execute.mjs +85 -37
- package/dist/astro/routes/api/import/wordpress/media.d.mts +12 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +20 -14
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +36 -32
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +17 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +121 -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 +55 -2
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +284 -55
- package/dist/astro/routes/api/manifest.mjs +14 -5
- package/dist/astro/routes/api/mcp.mjs +753 -170
- 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 +28 -35
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +32 -28
- package/dist/astro/routes/api/menus/_name_/items.mjs +32 -28
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +32 -28
- package/dist/astro/routes/api/menus/_name_/translations.mjs +32 -28
- package/dist/astro/routes/api/menus/_name_.mjs +32 -28
- package/dist/astro/routes/api/menus/index.mjs +32 -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 +46 -31
- 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 +33 -29
- package/dist/astro/routes/api/redirects/index.mjs +33 -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 +48 -43
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +48 -43
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +48 -43
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +48 -43
- package/dist/astro/routes/api/schema/collections/index.mjs +48 -43
- package/dist/astro/routes/api/schema/index.mjs +14 -15
- 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 +32 -28
- package/dist/astro/routes/api/sections/index.mjs +32 -28
- package/dist/astro/routes/api/settings/email.mjs +4 -4
- package/dist/astro/routes/api/settings.mjs +32 -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 +35 -31
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +35 -31
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +35 -31
- package/dist/astro/routes/api/taxonomies/index.mjs +35 -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 +31 -27
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +32 -28
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +32 -28
- package/dist/astro/routes/api/widget-areas/_name_.mjs +29 -26
- package/dist/astro/routes/api/widget-areas/index.mjs +32 -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 +22 -13
- package/dist/{audit-BeNsSyfU.mjs → audit-B2pRxZ20.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-D71jourk.mjs} +1 -1
- package/dist/{authorize-BLO0m7fW.mjs → authorize-ZXPGPwKn.mjs} +1 -1
- package/dist/{briefing-CkTee1ex.mjs → briefing-0rf-su3-.mjs} +90 -28
- package/dist/{briefing-DJX6irto.mjs → briefing-kRhegBoF.mjs} +2 -1
- package/dist/bundle-CEcdUa1s.mjs +602 -0
- package/dist/{byline-BVC1lV6G.mjs → byline-7xR185Ly.mjs} +30 -62
- package/dist/{byline-fields-Cj39WhXC.mjs → byline-fields-BKzA0fJU.mjs} +1 -1
- package/dist/{byline-fields-uJlygdzM.d.mts → byline-fields-Ckeqd1OY.d.mts} +88 -35
- package/dist/{byline-fields-cNrLJVRs.mjs → byline-fields-WN7RQT4q.mjs} +10 -4
- package/dist/{byline-registry-4v6tXMNX.mjs → byline-registry-Ba54M74c.mjs} +2 -2
- package/dist/{bylines-LN9XISRo.mjs → bylines-C-EL6dh3.mjs} +9 -3
- package/dist/{bylines-DwokOFj6.mjs → bylines-CmZFCMr0.mjs} +5 -5
- package/dist/{cache-Bac05gBd.mjs → cache-DkVCKGio.mjs} +2 -2
- package/dist/{chunks-CuUt7K50.mjs → chunks-ChGNDY8r.mjs} +1 -1
- package/dist/cli/index.d.mts +29 -1
- package/dist/cli/index.mjs +1466 -1763
- package/dist/cli/plugin-kit.d.mts +75 -0
- package/dist/cli/plugin-kit.mjs +4 -0
- package/dist/client/external-auth-headers.d.mts +1 -1
- package/dist/client/index.d.mts +27 -52
- package/dist/client/index.mjs +34 -6
- package/dist/client-factory-BDD9azPJ.mjs +233 -0
- package/dist/{comment-Beue8-15.mjs → comment-DFALgsJD.mjs} +13 -3
- package/dist/comment-reaction-C37bf99u.mjs +58 -0
- package/dist/{comments-DcjFIfqX.mjs → comments-B3NwDBxl.mjs} +1 -1
- package/dist/{content-CBxYGWfL.mjs → content-DJcAYFhz.mjs} +51 -34
- package/dist/content-refresh-B4ZCmxgd.mjs +1576 -0
- package/dist/{context-Df1xVYyr.mjs → context-DnpXcp6Y.mjs} +2 -2
- package/dist/{context-CQVNZaR8.mjs → context-fSCYLL3c.mjs} +125 -53
- package/dist/{context-route-helpers-B9wj8Rmh.mjs → context-route-helpers-CI8XzcsK.mjs} +2 -1
- package/dist/{cron-DxCAU_Sn.mjs → cron-B1SL_lsb.mjs} +7 -3
- package/dist/{dashboard-B7ZUNuyF.mjs → dashboard-D0nj5oWg.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-BJe6VEhP.mjs} +5 -5
- package/dist/{placeholder-d54Qr_7n.mjs → enrich-Ck9tfMqe.mjs} +36 -9
- package/dist/{error-DCSuUAZW.mjs → error-CSVaQNZy.mjs} +5 -0
- package/dist/{experimental-workflows-CSMffP6q.mjs → experimental-workflows-GVhUgzEs.mjs} +1 -1
- package/dist/field-defs-cache-DL-T2XVS.mjs +49 -0
- package/dist/forgeway-seo-client-G5ddhVHd.mjs +456 -0
- package/dist/{fts-manager-B5l_qwrA.mjs → fts-manager-ewTGohf4.mjs} +1 -1
- package/dist/{hitl-requests-7NlzVeUA.mjs → hitl-requests-DEFj8e6u.mjs} +2 -2
- package/dist/{hitl-route-helpers-k---_H3-.mjs → hitl-route-helpers-C23JHaWz.mjs} +5 -4
- package/dist/import-CXXL5pip.mjs +1354 -0
- package/dist/index-DcnOCD1e.d.mts +375 -0
- package/dist/index.d.mts +15 -16
- package/dist/index.mjs +85 -70
- package/dist/{jsonld-DZ67souc.d.mts → jsonld-DzKbhRZ4.d.mts} +8 -4
- package/dist/{load-D9OiGr2m.mjs → load-CFtJRT3c.mjs} +1 -1
- package/dist/{loader--GOYux8M.mjs → loader-aWkkc1_o.mjs} +117 -31
- package/dist/{manifest-schema-qh2P7RDX.mjs → manifest-schema-uA6pRFXi.mjs} +38 -1
- package/dist/mcp-reviewed-executor-Dn52L_yY.mjs +558 -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 +15 -11
- package/dist/media/local-runtime.mjs +9 -7
- package/dist/{media-CbKyYukG.mjs → media-CVMOoywq.mjs} +3 -1
- package/dist/{media-allowlist-BYxJIcTO.mjs → media-allowlist-zDNJmXCo.mjs} +1 -1
- package/dist/media-url-BdoLPvg8.mjs +20 -0
- package/dist/{menus-C7F0sCrC.mjs → menus-CCG2z5um.mjs} +80 -15
- package/dist/{menus-BZbXf-ej.mjs → menus-CmyIkRG5.mjs} +19 -5
- package/dist/{normalize-ByemhhfW.mjs → normalize-Cyt7JdF7.mjs} +8 -1
- package/dist/{oauth-authorization-DF-LCsIA.mjs → oauth-authorization-B9H7X85L.mjs} +5 -5
- package/dist/{oauth-clients-Du-V0fEm.mjs → oauth-clients-Dwl32-Uj.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/output-DhBe5_Pi.mjs +68 -0
- package/dist/page/index.d.mts +10 -3
- package/dist/page/index.mjs +2 -2
- package/dist/{parse-CneSgl7-.mjs → parse-i15EFSAE.mjs} +1 -1
- package/dist/{parser-DxfsARXL.mjs → parser-06LLLL4E.mjs} +151 -9
- package/dist/{placeholder-CXfoCtCd.d.mts → placeholder-DkWkXfDI.d.mts} +12 -4
- package/dist/plugin-utils.d.mts +8 -9
- package/dist/plugins/adapt-sandbox-entry.d.mts +8 -9
- package/dist/plugins/adapt-sandbox-entry.mjs +13 -2
- package/dist/{plugins-DzfqRREq.mjs → plugins-CPA2PtfY.mjs} +919 -66
- package/dist/{transport-LSdZVXHF.mjs → portable-text-BASHceim.mjs} +1 -134
- package/dist/portable-text-E79LyjGo.d.mts +45 -0
- package/dist/{preview-C-3YTX2U.mjs → preview-BjedZm8G.mjs} +4 -3
- package/dist/process-cache-CCDgti7j.mjs +106 -0
- package/dist/project-env-DKibmuP8.mjs +95 -0
- package/dist/{provider-loader-9it4vd6L.d.mts → provider-loader-DC2JdWeO.d.mts} +1 -1
- package/dist/{public-url-B4xV4rGa.d.mts → public-url-DQJCnYi9.d.mts} +1 -1
- package/dist/publication-authorization-RKiHXKtq.mjs +985 -0
- package/dist/{query-CZ3TH_Uu.mjs → query-C2U5u5_p.mjs} +11 -6
- package/dist/{query-Ds0EnMFX.mjs → query-DEv5x6yB.mjs} +281 -76
- package/dist/{rate-limit-i0G3IAOX.mjs → rate-limit-DglsAJSw.mjs} +2 -2
- package/dist/{redirect-CEACczxo.mjs → redirect-ubhEqQCQ.mjs} +2 -2
- package/dist/{redirects-ocRJmQHP.mjs → redirects-Bhpm8bRe.mjs} +35 -19
- package/dist/{redirects-DYj1yPxs.mjs → redirects-xs2yahLq.mjs} +47 -24
- package/dist/{registry-D7HACema.mjs → registry-BYYyb2tF.mjs} +148 -81
- package/dist/request-context.d.mts +2 -0
- package/dist/{request-meta-DAb6xaP9.mjs → request-meta-CFe1tW2M.mjs} +1 -1
- package/dist/review-payload-BysRWpxS.mjs +111 -0
- package/dist/{review-requests-BW2NxY-l.mjs → review-requests-CTWGnWUt.mjs} +1 -1
- package/dist/review-requests-D42VEP1l.mjs +142 -0
- package/dist/review-route-helpers-C31vO6SI.mjs +41 -0
- package/dist/runner-BgmttQmD.mjs +7444 -0
- package/dist/{runner-09sTqtv0.d.mts → runner-D6hzs8L9.d.mts} +1 -1
- package/dist/runtime.d.mts +9 -10
- package/dist/runtime.mjs +3 -3
- package/dist/schema-DUtnZxjZ.mjs +8 -0
- package/dist/{search-Gdrqj582.mjs → search-DUKgZUlm.mjs} +5 -3
- package/dist/{secrets-CeGpBFV2.mjs → secrets-ZV5rd8yV.mjs} +14 -11
- package/dist/{sections-BOjU13Y-.mjs → sections-DvFgsnda.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-5lJOtB5J.mjs → seo-BLszyJxd.mjs} +22 -4
- package/dist/{seo-CLj8lS7Q.mjs → seo-BU8MLCS9.mjs} +5 -2
- package/dist/{seo-contributions-CqVvReEj.mjs → seo-contributions-GnCuL1ML.mjs} +11 -3
- package/dist/{service-jGlhrICs.mjs → service-FL3fB0Rx.mjs} +2 -2
- package/dist/session-user-Ct6GBLvn.mjs +22 -0
- package/dist/{settings-CUXOxzsT.mjs → settings-BECcAIRH.mjs} +28 -55
- package/dist/{settings-DlBsT2VS.mjs → settings-EzADu-dd.mjs} +2 -2
- package/dist/{setup-complete-BRrdPYjZ.mjs → setup-complete-Da0axZEE.mjs} +1 -1
- package/dist/{site-activity-DONFrMBJ.mjs → site-activity-h8smOlYI.mjs} +1 -1
- package/dist/{site-context-C8Az_P_I.mjs → site-context-B8T1kpUP.mjs} +337 -530
- package/dist/{site-url-DIMD68go.mjs → site-url-DJEid0ml.mjs} +1 -1
- package/dist/stable-hash-DshcXvRE.mjs +19 -0
- package/dist/status-NqWOSFAD.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-BiM9NtgW.mjs} +36 -29
- package/dist/taxonomies-DSnY5nOa.mjs +443 -0
- package/dist/{taxonomy-B169Nm6B.mjs → taxonomy-0k_vRVsD.mjs} +44 -9
- package/dist/transport-C46KHLMP.mjs +134 -0
- package/dist/types-A8fPOJnl.mjs +69 -0
- package/dist/types-BLQCz46p.d.mts +118 -0
- package/dist/{types-CwawBUTa.d.mts → types-B_FlxIIl.d.mts} +4 -1
- package/dist/{types-CSgR9nQB.mjs → types-ChxYDRvx.mjs} +1 -1
- package/dist/{types-GaCtZ1k9.d.mts → types-Cw0PeCT_.d.mts} +18 -0
- package/dist/types-DuQn1G7-.d.mts +2973 -0
- package/dist/{runtime-C4-2lSFg.d.mts → types-DwoUifGE.d.mts} +5668 -3000
- package/dist/{types-DRIKLmJI.d.mts → types-opjX_kz6.d.mts} +17 -2
- package/dist/ui/server-runtime.d.mts +13 -15
- package/dist/ui/server-runtime.mjs +24 -20
- package/dist/url-guoXQQcV.mjs +33 -0
- package/dist/{user-DTLoZs16.mjs → user-BH-n01y3.mjs} +2 -2
- package/dist/{utils-B8hBJ9Oz.mjs → utils-D1SrKGtP.mjs} +129 -7
- package/dist/{validate-DzjCdy6v.d.mts → validate-CbVFoJgc.d.mts} +65 -8
- package/dist/{validate-DWmPO6oj.mjs → validate-D1HL-oLR.mjs} +11 -6
- package/dist/version-C3iVRuaF.mjs +6 -0
- package/dist/{widgets-BpJ8EpPd.mjs → widgets-BZrLrNgS.mjs} +46 -43
- package/dist/{wordpress-slugs-DHNR9LpG.mjs → wordpress-slugs-C3PWcowq.mjs} +1 -1
- package/dist/{zod-generator-K91-g665.mjs → zod-generator-C7AsLpSB.mjs} +42 -14
- package/package.json +38 -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/index-CZiWCQDp.d.mts +0 -227
- package/dist/review-requests-Qum4713s.mjs +0 -79
- 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/types-DSPGWjxO.d.mts +0 -1247
- package/dist/types-nP9vGUFq.d.mts +0 -56
- package/dist/version-C4gfn0PJ.mjs +0 -6
- /package/dist/{adapters-OQCImOL7.d.mts → adapters-BiRymx02.d.mts} +0 -0
- /package/dist/{api-tokens-CYUoFGo7.mjs → api-tokens-Ypaly90d.mjs} +0 -0
- /package/dist/{challenge-store-DFxX0_15.mjs → challenge-store-D5pSY2S1.mjs} +0 -0
- /package/dist/{components--pg6zBvu.mjs → components-DImzlLhb.mjs} +0 -0
- /package/dist/{context-types-r8oFvyOq.mjs → context-types-eBuMDAg-.mjs} +0 -0
- /package/dist/{default-B6iaLvP7.mjs → default-D4Vygcy_.mjs} +0 -0
- /package/dist/{email-console-BOVqIYpB.mjs → email-console-Bp0r68iF.mjs} +0 -0
- /package/dist/{escape-BDgouFFY.mjs → escape-DN4Qmjsl.mjs} +0 -0
- /package/dist/{hash-BPmX6P8I.mjs → hash-mxxx2oPW.mjs} +0 -0
- /package/dist/{mime-CbKsKDCB.mjs → mime-C0vOHFm7.mjs} +0 -0
- /package/dist/{mode-CZqCF9dZ.mjs → mode-C8yZnIlR.mjs} +0 -0
- /package/dist/{oauth-state-store-qncPB_IU.mjs → oauth-state-store-CndT35iw.mjs} +0 -0
- /package/dist/{oauth-user-lookup-BFjWF8wK.mjs → oauth-user-lookup-CMehAaKs.mjs} +0 -0
- /package/dist/{options-LsPjZlqD.mjs → options-DQPTH5n0.mjs} +0 -0
- /package/dist/{passkey-config-DzHQK90v.mjs → passkey-config-NYukYGed.mjs} +0 -0
- /package/dist/{patterns-DKAX6oqN.mjs → patterns-CoqlXUvk.mjs} +0 -0
- /package/dist/{provider-loader-DzUxejk7.mjs → provider-loader-BtfrrzfD.mjs} +0 -0
- /package/dist/{public-url-B_m9IwdV.mjs → public-url-Cp6hyjVR.mjs} +0 -0
- /package/dist/{redirect-BjIBtDWY.mjs → redirect-DrbEmU9a.mjs} +0 -0
- /package/dist/{request-cache-ho99schz.mjs → request-cache-CBFjCwSt.mjs} +0 -0
- /package/dist/{resolve-DTuDyYKs.mjs → resolve-DE71WcL9.mjs} +0 -0
- /package/dist/{setup-nonce-pyGfc9hV.mjs → setup-nonce-BtkKnvxQ.mjs} +0 -0
- /package/dist/{sidecar-client-mJxwayYN.mjs → sidecar-client-Ctzfyyp-.mjs} +0 -0
- /package/dist/{slugify-BqebcqBg.mjs → slugify-KSsVD_D3.mjs} +0 -0
- /package/dist/{ssrf-DiKqWd3N.mjs → ssrf-FJqwQzj4.mjs} +0 -0
- /package/dist/{tokens-SLmgowfd.mjs → tokens-BDQU29Vd.mjs} +0 -0
- /package/dist/{transaction-CFLhEOuH.mjs → transaction-0LEAAy8R.mjs} +0 -0
- /package/dist/{transport-BnsNxh2l.d.mts → transport-D9pKAzFP.d.mts} +0 -0
- /package/dist/{trusted-proxy-BgIIcbsN.mjs → trusted-proxy-Dm7Mxvt6.mjs} +0 -0
- /package/dist/{types-CJ8DkL0q.mjs → types-B7TDDFMG.mjs} +0 -0
- /package/dist/{types-Dryvv7LH.d.mts → types-g0zMtraY.d.mts} +0 -0
- /package/dist/{types-Cg276-3z.mjs → types-mVVgRPaU.mjs} +0 -0
- /package/dist/{types-DZpT-PnG.d.mts → types-wFu80FrO.d.mts} +0 -0
- /package/dist/{url-w7Mp5qAD.mjs → url-EMAguGVk.mjs} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { r as getDb } from "./loader
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { r as getDb } from "./loader-aWkkc1_o.mjs";
|
|
2
|
+
import { n as cachedQuery, t as CacheNamespace } from "./object-cache-D51qOseS.mjs";
|
|
3
|
+
import { r as requestCached } from "./request-cache-CBFjCwSt.mjs";
|
|
4
|
+
import { n as SchemaRegistry } from "./registry-BYYyb2tF.mjs";
|
|
4
5
|
|
|
5
6
|
//#region src/schema/query.ts
|
|
6
7
|
/**
|
|
@@ -17,9 +18,13 @@ import { n as SchemaRegistry } from "./registry-D7HACema.mjs";
|
|
|
17
18
|
* ```
|
|
18
19
|
*/
|
|
19
20
|
async function getCollectionInfo(slug) {
|
|
20
|
-
return requestCached(`collection-info:${slug}`,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
return requestCached(`collection-info:${slug}`, () => cachedQuery({
|
|
22
|
+
namespace: CacheNamespace.SCHEMA,
|
|
23
|
+
key: `collection-info:${slug}`,
|
|
24
|
+
load: async () => {
|
|
25
|
+
return getCollectionInfoWithDb(await getDb(), slug);
|
|
26
|
+
}
|
|
27
|
+
}));
|
|
23
28
|
}
|
|
24
29
|
/**
|
|
25
30
|
* Get collection metadata with an explicit db handle.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { a as __exportAll } from "./runner-
|
|
1
|
+
import { a as __exportAll } from "./runner-BgmttQmD.mjs";
|
|
2
2
|
import { n as getI18nConfig, r as isI18nEnabled, t as getFallbackChain } from "./config-CVssduLe.mjs";
|
|
3
3
|
import { getRequestContext } from "./request-context.mjs";
|
|
4
|
-
import { i as encodeCursor } from "./types-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { i as encodeCursor } from "./types-ChxYDRvx.mjs";
|
|
5
|
+
import { o as isMissingTableError, s as takeLiveCollectionMeta, t as CURSOR_RAW_VALUES } from "./loader-aWkkc1_o.mjs";
|
|
6
|
+
import { i as contentNamespaces, n as cachedQuery, u as invalidateSchemaObjectCache } from "./object-cache-D51qOseS.mjs";
|
|
7
|
+
import { r as requestCached } from "./request-cache-CBFjCwSt.mjs";
|
|
7
8
|
|
|
8
9
|
//#region src/visual-editing/editable.ts
|
|
9
10
|
/**
|
|
@@ -84,6 +85,8 @@ var query_exports = /* @__PURE__ */ __exportAll({
|
|
|
84
85
|
resolveDinewayPath: () => resolveDinewayPath,
|
|
85
86
|
sliceCollectionResult: () => sliceCollectionResult
|
|
86
87
|
});
|
|
88
|
+
const FOLDED_TERMS = Symbol.for("dineway:foldedTerms");
|
|
89
|
+
const FOLDED_BYLINES = Symbol.for("dineway:foldedBylines");
|
|
87
90
|
const COLLECTION_NAME = "_dineway";
|
|
88
91
|
/** Symbol key for edit metadata on PT arrays — avoids collision with user data */
|
|
89
92
|
const DINEWAY_EDIT = Symbol.for("__dineway");
|
|
@@ -125,6 +128,14 @@ function dataStr(data, key, fallback = "") {
|
|
|
125
128
|
const val = data[key];
|
|
126
129
|
return typeof val === "string" ? val : fallback;
|
|
127
130
|
}
|
|
131
|
+
/** Safely read a date-like field from a Record */
|
|
132
|
+
function dataDate(data, key) {
|
|
133
|
+
const val = data[key];
|
|
134
|
+
if (val instanceof Date) return Number.isNaN(val.getTime()) ? void 0 : val;
|
|
135
|
+
if (typeof val !== "string" && typeof val !== "number") return void 0;
|
|
136
|
+
const date = new Date(val);
|
|
137
|
+
return Number.isNaN(date.getTime()) ? void 0 : date;
|
|
138
|
+
}
|
|
128
139
|
/** Type guard for Record<string, unknown> */
|
|
129
140
|
function isRecord(value) {
|
|
130
141
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -176,61 +187,105 @@ async function getDinewayCollection(type, filter) {
|
|
|
176
187
|
const i18nConfig = getI18nConfig();
|
|
177
188
|
const resolvedLocale = filter?.locale ?? ctx?.locale ?? (isI18nEnabled() ? i18nConfig.defaultLocale : void 0);
|
|
178
189
|
const bucketed = bucketFilter(filter);
|
|
179
|
-
const cached = await requestCached(collectionCacheKey(type, bucketed.fetchFilter, resolvedLocale),
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
const result = await getLiveCollection(COLLECTION_NAME, liveFilter);
|
|
195
|
-
const meta = takeLiveCollectionMeta(liveFilter);
|
|
196
|
-
const { entries, error, cacheHint } = result;
|
|
197
|
-
const rawCursor = Object.getOwnPropertyDescriptor(result, "nextCursor")?.value;
|
|
198
|
-
const nextCursor = typeof rawCursor === "string" ? rawCursor : meta?.nextCursor;
|
|
199
|
-
const rawTotal = Object.getOwnPropertyDescriptor(result, "total")?.value;
|
|
200
|
-
const total = typeof rawTotal === "number" ? rawTotal : meta?.total;
|
|
201
|
-
if (error) return {
|
|
202
|
-
entries: [],
|
|
203
|
-
error,
|
|
204
|
-
cacheHint: {},
|
|
205
|
-
total
|
|
206
|
-
};
|
|
207
|
-
const hasMore = requestedFetchLimit !== void 0 && requestedFetchLimit > 0 && entries.length > requestedFetchLimit;
|
|
208
|
-
const pageEntries = hasMore ? entries.slice(0, requestedFetchLimit) : entries;
|
|
209
|
-
const pageNextCursor = (hasMore ? encodeEntryCursor(pageEntries.at(-1), bucketed.fetchFilter?.orderBy) : void 0) ?? nextCursor;
|
|
210
|
-
const isEditMode = ctx?.editMode ?? false;
|
|
211
|
-
const entriesWithEdit = pageEntries.map((entry) => {
|
|
212
|
-
const dbId = entryDatabaseId(entry);
|
|
213
|
-
if (isEditMode) tagEditableFields(entryData(entry), type, dbId);
|
|
190
|
+
const cached = await requestCached(collectionCacheKey(type, bucketed.fetchFilter, resolvedLocale), () => loadCollectionCached(type, bucketed.fetchFilter, resolvedLocale));
|
|
191
|
+
return bucketed.requestedLimit === void 0 ? cached : sliceCollectionResult(cached, bucketed.requestedLimit, filter?.orderBy);
|
|
192
|
+
}
|
|
193
|
+
async function loadCollectionCached(type, filter, resolvedLocale) {
|
|
194
|
+
const snapshot = await cachedQuery({
|
|
195
|
+
namespace: contentNamespaces(type),
|
|
196
|
+
key: collectionCacheKey(type, filter, resolvedLocale),
|
|
197
|
+
load: async () => {
|
|
198
|
+
const result = await getDinewayCollectionUncached(type, filter, resolvedLocale);
|
|
199
|
+
if (result.error) return {
|
|
200
|
+
ok: false,
|
|
201
|
+
error: result.error,
|
|
202
|
+
cacheHint: result.cacheHint,
|
|
203
|
+
total: result.total
|
|
204
|
+
};
|
|
214
205
|
return {
|
|
215
|
-
|
|
216
|
-
|
|
206
|
+
ok: true,
|
|
207
|
+
value: {
|
|
208
|
+
entries: result.entries.map(entrySnapshot),
|
|
209
|
+
nextCursor: result.nextCursor,
|
|
210
|
+
hasMore: result.hasMore,
|
|
211
|
+
total: result.total,
|
|
212
|
+
cacheHint: result.cacheHint
|
|
213
|
+
}
|
|
217
214
|
};
|
|
218
|
-
}
|
|
219
|
-
|
|
215
|
+
},
|
|
216
|
+
cacheable: (snap) => snap.ok
|
|
217
|
+
});
|
|
218
|
+
if (!snapshot.ok) return {
|
|
219
|
+
entries: [],
|
|
220
|
+
error: snapshot.error,
|
|
221
|
+
cacheHint: snapshot.cacheHint,
|
|
222
|
+
total: snapshot.total
|
|
223
|
+
};
|
|
224
|
+
return {
|
|
225
|
+
entries: snapshot.value.entries.map((entry) => reviveEntry(entry)),
|
|
226
|
+
nextCursor: snapshot.value.nextCursor,
|
|
227
|
+
hasMore: snapshot.value.hasMore,
|
|
228
|
+
total: snapshot.value.total,
|
|
229
|
+
cacheHint: snapshot.value.cacheHint
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
async function getDinewayCollectionUncached(type, filter, resolvedLocale) {
|
|
233
|
+
const { getLiveCollection } = await import("astro:content");
|
|
234
|
+
const ctx = getRequestContext();
|
|
235
|
+
const requestedFetchLimit = filter?.limit;
|
|
236
|
+
const liveLimit = requestedFetchLimit !== void 0 && requestedFetchLimit > 0 ? requestedFetchLimit + 1 : requestedFetchLimit;
|
|
237
|
+
const pageParam = filter?.cursor !== void 0 ? { cursor: filter.cursor } : filter?.offset !== void 0 ? { offset: filter.offset } : {};
|
|
238
|
+
const liveFilter = {
|
|
239
|
+
type,
|
|
240
|
+
status: filter?.status,
|
|
241
|
+
limit: liveLimit,
|
|
242
|
+
...pageParam,
|
|
243
|
+
where: filter?.where,
|
|
244
|
+
q: filter?.q,
|
|
245
|
+
searchColumns: filter?.searchColumns,
|
|
246
|
+
orderBy: filter?.orderBy,
|
|
247
|
+
locale: resolvedLocale
|
|
248
|
+
};
|
|
249
|
+
const result = await getLiveCollection(COLLECTION_NAME, liveFilter);
|
|
250
|
+
const meta = takeLiveCollectionMeta(liveFilter);
|
|
251
|
+
const { entries, error, cacheHint } = result;
|
|
252
|
+
const rawCursor = Object.getOwnPropertyDescriptor(result, "nextCursor")?.value;
|
|
253
|
+
const nextCursor = typeof rawCursor === "string" ? rawCursor : meta?.nextCursor;
|
|
254
|
+
const rawTotal = Object.getOwnPropertyDescriptor(result, "total")?.value;
|
|
255
|
+
const total = typeof rawTotal === "number" ? rawTotal : meta?.total;
|
|
256
|
+
if (error) return {
|
|
257
|
+
entries: [],
|
|
258
|
+
error,
|
|
259
|
+
cacheHint: {},
|
|
260
|
+
total
|
|
261
|
+
};
|
|
262
|
+
const hasMore = requestedFetchLimit !== void 0 && requestedFetchLimit > 0 && entries.length > requestedFetchLimit;
|
|
263
|
+
const pageEntries = hasMore ? entries.slice(0, requestedFetchLimit) : entries;
|
|
264
|
+
const pageNextCursor = (hasMore ? encodeEntryCursor(pageEntries.at(-1), filter?.orderBy) : void 0) ?? nextCursor;
|
|
265
|
+
const hasMoreResult = requestedFetchLimit !== void 0 && requestedFetchLimit > 0 ? hasMore : meta?.hasMore;
|
|
266
|
+
const isEditMode = ctx?.editMode ?? false;
|
|
267
|
+
const entriesWithEdit = pageEntries.map((entry) => {
|
|
268
|
+
const dbId = entryDatabaseId(entry);
|
|
269
|
+
if (isEditMode) tagEditableFields(entryData(entry), type, dbId);
|
|
220
270
|
return {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
total,
|
|
224
|
-
cacheHint: cacheHint ?? {}
|
|
271
|
+
...entry,
|
|
272
|
+
edit: isEditMode ? createEditable(type, dbId, entryEditOptions(entry)) : createNoop()
|
|
225
273
|
};
|
|
226
274
|
});
|
|
227
|
-
|
|
275
|
+
await Promise.all([hydrateEntryBylines(type, entriesWithEdit), hydrateEntryTerms(type, entriesWithEdit, resolvedLocale)]);
|
|
276
|
+
return {
|
|
277
|
+
entries: entriesWithEdit,
|
|
278
|
+
nextCursor: pageNextCursor,
|
|
279
|
+
hasMore: hasMoreResult,
|
|
280
|
+
total,
|
|
281
|
+
cacheHint: cacheHint ?? {}
|
|
282
|
+
};
|
|
228
283
|
}
|
|
229
284
|
const BUCKET_LIMIT_THRESHOLD = 10;
|
|
230
285
|
/** @internal exported for unit tests; not part of the public API. */
|
|
231
286
|
function bucketFilter(filter) {
|
|
232
287
|
const limit = filter?.limit;
|
|
233
|
-
if (limit === void 0 || limit >= BUCKET_LIMIT_THRESHOLD || limit <= 0 || filter?.cursor !== void 0) return {
|
|
288
|
+
if (limit === void 0 || limit >= BUCKET_LIMIT_THRESHOLD || limit <= 0 || filter?.cursor !== void 0 || filter?.offset !== void 0) return {
|
|
234
289
|
fetchFilter: filter,
|
|
235
290
|
requestedLimit: void 0
|
|
236
291
|
};
|
|
@@ -252,7 +307,8 @@ function sliceCollectionResult(cached, limit, orderBy) {
|
|
|
252
307
|
return {
|
|
253
308
|
...cached,
|
|
254
309
|
entries,
|
|
255
|
-
nextCursor
|
|
310
|
+
nextCursor,
|
|
311
|
+
hasMore: true
|
|
256
312
|
};
|
|
257
313
|
}
|
|
258
314
|
const ENTRY_DATA_KEY_MAP = {
|
|
@@ -292,6 +348,7 @@ function collectionCacheKey(type, filter, locale) {
|
|
|
292
348
|
filter?.status ?? "",
|
|
293
349
|
filter?.limit ?? "",
|
|
294
350
|
filter?.cursor ?? "",
|
|
351
|
+
filter?.offset ?? "",
|
|
295
352
|
filter?.where ? stableStringify(filter.where) : "",
|
|
296
353
|
filter?.q ?? "",
|
|
297
354
|
filter?.searchColumns ? JSON.stringify(filter.searchColumns) : "",
|
|
@@ -310,6 +367,36 @@ function stableOrder(value) {
|
|
|
310
367
|
}
|
|
311
368
|
return ordered;
|
|
312
369
|
}
|
|
370
|
+
const CURSOR_RAW_FIELD = "__dinewayCursorRaw";
|
|
371
|
+
function entrySnapshot(entry) {
|
|
372
|
+
const data = entryData(entry);
|
|
373
|
+
const rawCursor = Reflect.get(data, CURSOR_RAW_VALUES);
|
|
374
|
+
return {
|
|
375
|
+
id: entry.id,
|
|
376
|
+
data: {
|
|
377
|
+
...data,
|
|
378
|
+
[CURSOR_RAW_FIELD]: isRecord(rawCursor) ? rawCursor : {}
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
function reviveEntry(raw) {
|
|
383
|
+
const entry = isRecord(raw) ? raw : {};
|
|
384
|
+
const data = { ...isRecord(entry.data) ? entry.data : {} };
|
|
385
|
+
const rawCursorValue = data[CURSOR_RAW_FIELD];
|
|
386
|
+
const rawCursor = isRecord(rawCursorValue) ? rawCursorValue : {};
|
|
387
|
+
delete data[CURSOR_RAW_FIELD];
|
|
388
|
+
Object.defineProperty(data, CURSOR_RAW_VALUES, {
|
|
389
|
+
value: rawCursor,
|
|
390
|
+
enumerable: false,
|
|
391
|
+
configurable: false,
|
|
392
|
+
writable: false
|
|
393
|
+
});
|
|
394
|
+
return {
|
|
395
|
+
id: typeof entry.id === "string" ? entry.id : "",
|
|
396
|
+
data,
|
|
397
|
+
edit: createNoop()
|
|
398
|
+
};
|
|
399
|
+
}
|
|
313
400
|
/**
|
|
314
401
|
* Get a single entry by type and ID/slug
|
|
315
402
|
*
|
|
@@ -351,8 +438,16 @@ async function getDinewayEntry(type, id, options) {
|
|
|
351
438
|
function isVisible(entry) {
|
|
352
439
|
const data = entryData(entry);
|
|
353
440
|
const status = dataStr(data, "status");
|
|
354
|
-
const scheduledAt =
|
|
355
|
-
|
|
441
|
+
const scheduledAt = dataDate(data, "scheduledAt");
|
|
442
|
+
const isPublished = status === "published";
|
|
443
|
+
const isScheduledAndReady = status === "scheduled" && scheduledAt !== void 0 && scheduledAt.getTime() <= Date.now();
|
|
444
|
+
return isPublished || !!isScheduledAndReady;
|
|
445
|
+
}
|
|
446
|
+
function isPendingScheduled(entry) {
|
|
447
|
+
const data = entryData(entry);
|
|
448
|
+
if (dataStr(data, "status") !== "scheduled") return false;
|
|
449
|
+
const scheduledAt = dataDate(data, "scheduledAt");
|
|
450
|
+
return scheduledAt !== void 0 && scheduledAt.getTime() > Date.now();
|
|
356
451
|
}
|
|
357
452
|
const localeChain = requestedLocale && isI18nEnabled() ? getFallbackChain(requestedLocale) : [requestedLocale];
|
|
358
453
|
/** Return a successful EntryResult with runtime data hydrated */
|
|
@@ -419,30 +514,68 @@ async function getDinewayEntry(type, id, options) {
|
|
|
419
514
|
cacheHint: {}
|
|
420
515
|
};
|
|
421
516
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
517
|
+
let timeSensitive = false;
|
|
518
|
+
const resolveNormal = async () => {
|
|
519
|
+
for (let i = 0; i < localeChain.length; i++) {
|
|
520
|
+
const locale = localeChain[i];
|
|
521
|
+
const fallbackLocale = i > 0 ? locale : void 0;
|
|
522
|
+
const { entry, error, cacheHint } = await getLiveEntry(COLLECTION_NAME, {
|
|
523
|
+
type,
|
|
524
|
+
id,
|
|
525
|
+
locale
|
|
526
|
+
});
|
|
527
|
+
if (error) return {
|
|
528
|
+
entry: null,
|
|
529
|
+
error,
|
|
530
|
+
isPreview: false,
|
|
531
|
+
cacheHint: {}
|
|
532
|
+
};
|
|
533
|
+
if (entry && isVisible(entry)) return successResult(wrapEntry(entry), {
|
|
534
|
+
isPreview: false,
|
|
535
|
+
fallbackLocale,
|
|
536
|
+
cacheHint: cacheHint ?? {}
|
|
537
|
+
});
|
|
538
|
+
if (entry && isPendingScheduled(entry)) timeSensitive = true;
|
|
539
|
+
}
|
|
540
|
+
return {
|
|
431
541
|
entry: null,
|
|
432
|
-
error,
|
|
433
542
|
isPreview: false,
|
|
434
543
|
cacheHint: {}
|
|
435
544
|
};
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
545
|
+
};
|
|
546
|
+
const snapshot = await cachedQuery({
|
|
547
|
+
namespace: contentNamespaces(type),
|
|
548
|
+
key: `entry:${id}|loc=${requestedLocale ?? ""}`,
|
|
549
|
+
load: async () => {
|
|
550
|
+
const result = await resolveNormal();
|
|
551
|
+
if (result.error) return {
|
|
552
|
+
ok: false,
|
|
553
|
+
error: result.error,
|
|
554
|
+
cacheHint: result.cacheHint
|
|
555
|
+
};
|
|
556
|
+
return {
|
|
557
|
+
ok: true,
|
|
558
|
+
value: {
|
|
559
|
+
entry: result.entry ? entrySnapshot(result.entry) : null,
|
|
560
|
+
isPreview: result.isPreview,
|
|
561
|
+
fallbackLocale: result.fallbackLocale,
|
|
562
|
+
cacheHint: result.cacheHint
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
},
|
|
566
|
+
cacheable: (snap) => snap.ok && !timeSensitive
|
|
567
|
+
});
|
|
568
|
+
if (!snapshot.ok) return {
|
|
443
569
|
entry: null,
|
|
570
|
+
error: snapshot.error,
|
|
444
571
|
isPreview: false,
|
|
445
|
-
cacheHint:
|
|
572
|
+
cacheHint: snapshot.cacheHint
|
|
573
|
+
};
|
|
574
|
+
return {
|
|
575
|
+
entry: snapshot.value.entry ? reviveEntry(snapshot.value.entry) : null,
|
|
576
|
+
isPreview: snapshot.value.isPreview,
|
|
577
|
+
fallbackLocale: snapshot.value.fallbackLocale,
|
|
578
|
+
cacheHint: snapshot.value.cacheHint
|
|
446
579
|
};
|
|
447
580
|
}
|
|
448
581
|
/**
|
|
@@ -456,8 +589,47 @@ async function getDinewayEntry(type, id, options) {
|
|
|
456
589
|
*/
|
|
457
590
|
async function hydrateEntryBylines(type, entries) {
|
|
458
591
|
if (entries.length === 0) return;
|
|
592
|
+
if (entries.every((entry) => FOLDED_BYLINES in entryData(entry))) {
|
|
593
|
+
const parsed = entries.map((entry) => {
|
|
594
|
+
const data = entryData(entry);
|
|
595
|
+
const folded = Reflect.get(data, FOLDED_BYLINES);
|
|
596
|
+
return {
|
|
597
|
+
data,
|
|
598
|
+
credits: (Array.isArray(folded) ? folded : []).map((raw) => {
|
|
599
|
+
const byline = raw?.byline ?? {};
|
|
600
|
+
return {
|
|
601
|
+
roleLabel: raw?.roleLabel ?? null,
|
|
602
|
+
sortOrder: Number(raw?.sortOrder ?? 0),
|
|
603
|
+
source: "explicit",
|
|
604
|
+
byline: {
|
|
605
|
+
...byline,
|
|
606
|
+
isGuest: Boolean(byline.isGuest),
|
|
607
|
+
customFields: {}
|
|
608
|
+
}
|
|
609
|
+
};
|
|
610
|
+
}).toSorted((a, b) => a.sortOrder - b.sortOrder)
|
|
611
|
+
};
|
|
612
|
+
});
|
|
613
|
+
let needsQueryPath = parsed.some((item) => item.credits.length === 0 && (dataStr(item.data, "authorId") !== "" || dataStr(item.data, "primaryBylineId") !== ""));
|
|
614
|
+
let hasCustomFields = false;
|
|
615
|
+
if (!needsQueryPath) try {
|
|
616
|
+
const { getDb } = await import("./loader-aWkkc1_o.mjs").then((n) => n.i);
|
|
617
|
+
const db = await getDb();
|
|
618
|
+
const { getBylineFieldDefs } = await import("./field-defs-cache-DL-T2XVS.mjs").then((n) => n.t);
|
|
619
|
+
hasCustomFields = (await getBylineFieldDefs(db)).length > 0;
|
|
620
|
+
} catch (error) {
|
|
621
|
+
if (!isMissingTableError(error)) needsQueryPath = true;
|
|
622
|
+
}
|
|
623
|
+
if (!needsQueryPath && !hasCustomFields) {
|
|
624
|
+
for (const item of parsed) {
|
|
625
|
+
item.data.bylines = item.credits;
|
|
626
|
+
item.data.byline = item.credits[0]?.byline ?? null;
|
|
627
|
+
}
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
459
631
|
try {
|
|
460
|
-
const { getBylinesForEntries } = await import("./bylines-
|
|
632
|
+
const { getBylinesForEntries } = await import("./bylines-CmZFCMr0.mjs").then((n) => n.t);
|
|
461
633
|
const refs = entries.map((entry) => {
|
|
462
634
|
const data = entryData(entry);
|
|
463
635
|
const id = dataStr(data, "id");
|
|
@@ -487,8 +659,40 @@ async function hydrateEntryBylines(type, entries) {
|
|
|
487
659
|
}
|
|
488
660
|
async function hydrateEntryTerms(type, entries, locale) {
|
|
489
661
|
if (entries.length === 0) return;
|
|
662
|
+
if (entries.every((entry) => FOLDED_TERMS in entryData(entry))) {
|
|
663
|
+
const perEntry = [];
|
|
664
|
+
for (const entry of entries) {
|
|
665
|
+
const data = entryData(entry);
|
|
666
|
+
const folded = Reflect.get(data, FOLDED_TERMS);
|
|
667
|
+
const rows = Array.isArray(folded) ? folded : [];
|
|
668
|
+
const grouped = {};
|
|
669
|
+
for (const row of rows) {
|
|
670
|
+
const name = String(row?.name);
|
|
671
|
+
(grouped[name] ??= []).push({
|
|
672
|
+
id: row?.id,
|
|
673
|
+
name,
|
|
674
|
+
slug: row?.slug,
|
|
675
|
+
label: row?.label,
|
|
676
|
+
parentId: row?.parent_id ?? void 0,
|
|
677
|
+
children: [],
|
|
678
|
+
locale: row?.locale,
|
|
679
|
+
translationGroup: row?.translation_group
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
for (const [name, terms] of Object.entries(grouped)) grouped[name] = terms.toSorted((a, b) => String(a.label).localeCompare(String(b.label)));
|
|
683
|
+
data.terms = grouped;
|
|
684
|
+
const entryId = dataStr(data, "id");
|
|
685
|
+
if (entryId) perEntry.push({
|
|
686
|
+
entryId,
|
|
687
|
+
byTaxonomy: grouped
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
const { primeFoldedEntryTerms } = await import("./taxonomies-DSnY5nOa.mjs").then((n) => n.u);
|
|
691
|
+
primeFoldedEntryTerms(type, perEntry, { locale });
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
490
694
|
try {
|
|
491
|
-
const { getAllTermsForEntries } = await import("./taxonomies-
|
|
695
|
+
const { getAllTermsForEntries } = await import("./taxonomies-DSnY5nOa.mjs").then((n) => n.u);
|
|
492
696
|
const ids = entries.map((entry) => dataStr(entryData(entry), "id")).filter(Boolean);
|
|
493
697
|
if (ids.length === 0) return;
|
|
494
698
|
const termsMap = await getAllTermsForEntries(type, ids, { locale });
|
|
@@ -522,9 +726,9 @@ async function hydrateEntryTerms(type, entries, locale) {
|
|
|
522
726
|
*/
|
|
523
727
|
async function getTranslations(type, id) {
|
|
524
728
|
try {
|
|
525
|
-
const db = (await import("./loader
|
|
729
|
+
const db = (await import("./loader-aWkkc1_o.mjs").then((n) => n.i)).getDb;
|
|
526
730
|
const dbInstance = await db();
|
|
527
|
-
const { ContentRepository } = await import("./content-
|
|
731
|
+
const { ContentRepository } = await import("./content-DJcAYFhz.mjs").then((n) => n.n);
|
|
528
732
|
const repo = new ContentRepository(dbInstance);
|
|
529
733
|
const item = await repo.findByIdOrSlug(type, id);
|
|
530
734
|
if (!item) return {
|
|
@@ -567,6 +771,7 @@ function patternToRegex(pattern) {
|
|
|
567
771
|
let cachedUrlPatterns = null;
|
|
568
772
|
function invalidateUrlPatternCache() {
|
|
569
773
|
cachedUrlPatterns = null;
|
|
774
|
+
invalidateSchemaObjectCache();
|
|
570
775
|
}
|
|
571
776
|
/**
|
|
572
777
|
* Resolve a URL path to a content entry by matching against collection URL patterns.
|
|
@@ -591,8 +796,8 @@ async function resolveDinewayPath(path) {
|
|
|
591
796
|
const hasDbOverride = !!getRequestContext()?.db;
|
|
592
797
|
let patterns = !hasDbOverride ? cachedUrlPatterns : null;
|
|
593
798
|
if (!patterns) {
|
|
594
|
-
const { getDb } = await import("./loader
|
|
595
|
-
const { SchemaRegistry } = await import("./registry-
|
|
799
|
+
const { getDb } = await import("./loader-aWkkc1_o.mjs").then((n) => n.i);
|
|
800
|
+
const { SchemaRegistry } = await import("./registry-BYYyb2tF.mjs").then((n) => n.r);
|
|
596
801
|
patterns = (await new SchemaRegistry(await getDb()).listCollections()).filter((collection) => collection.urlPattern).map((collection) => {
|
|
597
802
|
const { regex, paramNames } = patternToRegex(collection.urlPattern);
|
|
598
803
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as apiError } from "./error-
|
|
2
|
-
import { n as normalizeTrustedHeaders } from "./trusted-proxy-
|
|
1
|
+
import { t as apiError } from "./error-CSVaQNZy.mjs";
|
|
2
|
+
import { n as normalizeTrustedHeaders } from "./trusted-proxy-Dm7Mxvt6.mjs";
|
|
3
3
|
import { sql } from "kysely";
|
|
4
4
|
|
|
5
5
|
//#region src/auth/rate-limit.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as currentTimestampValue } from "./dialect-helpers-fk43GbDb.mjs";
|
|
2
|
-
import { i as encodeCursor, r as decodeCursor } from "./types-
|
|
3
|
-
import { i as matchPattern, n as interpolateDestination, r as isPattern, t as compilePattern } from "./patterns-
|
|
2
|
+
import { i as encodeCursor, r as decodeCursor } from "./types-ChxYDRvx.mjs";
|
|
3
|
+
import { i as matchPattern, n as interpolateDestination, r as isPattern, t as compilePattern } from "./patterns-CoqlXUvk.mjs";
|
|
4
4
|
import { sql } from "kysely";
|
|
5
5
|
import { ulid } from "ulidx";
|
|
6
6
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { t as isSafeHref } from "./url-
|
|
1
|
+
import { t as isSafeHref } from "./url-EMAguGVk.mjs";
|
|
2
|
+
import { n as isTerminalStatus, t as REDIRECT_RULE_STATUSES } from "./status-NqWOSFAD.mjs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
|
|
4
5
|
//#region src/api/schemas/common.ts
|
|
@@ -67,6 +68,8 @@ const bylineSummarySchema = z.object({
|
|
|
67
68
|
avatarMediaId: z.string().nullable(),
|
|
68
69
|
avatarStorageKey: z.string().nullish(),
|
|
69
70
|
avatarAlt: z.string().nullish(),
|
|
71
|
+
avatarBlurhash: z.string().nullish(),
|
|
72
|
+
avatarDominantColor: z.string().nullish(),
|
|
70
73
|
websiteUrl: z.string().nullable(),
|
|
71
74
|
userId: z.string().nullable(),
|
|
72
75
|
isGuest: z.boolean(),
|
|
@@ -174,14 +177,22 @@ const contentUpdateBody = z.object({
|
|
|
174
177
|
seo: contentSeoInput.optional(),
|
|
175
178
|
publishedAt: contentDateOverride
|
|
176
179
|
}).meta({ id: "ContentUpdateBody" });
|
|
177
|
-
const contentScheduleBody = z.object({
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}).
|
|
180
|
+
const contentScheduleBody = z.object({
|
|
181
|
+
scheduledAt: z.string().min(1, "scheduledAt is required").meta({
|
|
182
|
+
description: "ISO 8601 datetime for scheduled publishing",
|
|
183
|
+
example: "2025-06-15T09:00:00Z"
|
|
184
|
+
}),
|
|
185
|
+
reviewRequestId: z.string().min(1, "reviewRequestId is required").meta({ description: "Approved editorial Review Request bound to the exact Draft Revision" }),
|
|
186
|
+
releaseAuthorizationId: z.string().min(1).optional().meta({ description: "Approved exact release HITL Request required for token actors" })
|
|
187
|
+
}).meta({ id: "ContentScheduleBody" });
|
|
188
|
+
const contentPublishBody = z.object({
|
|
189
|
+
publishedAt: z.iso.datetime({
|
|
190
|
+
offset: true,
|
|
191
|
+
message: "must be an ISO 8601 datetime"
|
|
192
|
+
}).optional().meta({ description: "Optional ISO 8601 datetime to backdate the publish. Requires content:publish_any permission. Without this, existing published_at is preserved on re-publish." }),
|
|
193
|
+
reviewRequestId: z.string().min(1, "reviewRequestId is required").meta({ description: "Approved editorial Review Request bound to the exact Draft Revision" }),
|
|
194
|
+
releaseAuthorizationId: z.string().min(1).optional().meta({ description: "Approved exact release HITL Request required for token actors" })
|
|
195
|
+
}).meta({ id: "ContentPublishBody" });
|
|
185
196
|
const contentPreviewUrlBody = z.object({
|
|
186
197
|
expiresIn: z.union([z.string(), z.number()]).optional(),
|
|
187
198
|
pathPattern: z.string().optional()
|
|
@@ -463,10 +474,11 @@ const createFieldBody = z.object({
|
|
|
463
474
|
}).meta({ id: "CreateFieldBody" });
|
|
464
475
|
const updateFieldBody = z.object({
|
|
465
476
|
label: z.string().min(1).optional(),
|
|
477
|
+
type: fieldTypeValues.optional(),
|
|
466
478
|
required: z.boolean().optional(),
|
|
467
479
|
unique: z.boolean().optional(),
|
|
468
480
|
defaultValue: z.unknown().optional(),
|
|
469
|
-
validation: fieldValidation,
|
|
481
|
+
validation: fieldValidation.nullable(),
|
|
470
482
|
widget: z.string().optional(),
|
|
471
483
|
options: fieldWidgetOptions,
|
|
472
484
|
sortOrder: z.number().int().min(0).optional(),
|
|
@@ -534,6 +546,11 @@ const createCommentBody = z.object({
|
|
|
534
546
|
parentId: z.string().optional(),
|
|
535
547
|
website_url: z.string().optional()
|
|
536
548
|
}).meta({ id: "CreateCommentBody" });
|
|
549
|
+
const createReactionBody = z.object({
|
|
550
|
+
commentId: z.string().min(1),
|
|
551
|
+
reaction: z.string().min(1).max(20).default("like"),
|
|
552
|
+
website_url: z.string().optional()
|
|
553
|
+
}).meta({ id: "CreateReactionBody" });
|
|
537
554
|
const commentStatusBody = z.object({ status: z.enum([
|
|
538
555
|
"approved",
|
|
539
556
|
"pending",
|
|
@@ -581,6 +598,7 @@ const publicCommentSchema = z.object({
|
|
|
581
598
|
body: z.string(),
|
|
582
599
|
parentId: z.string().nullable(),
|
|
583
600
|
createdAt: z.string(),
|
|
601
|
+
reactions: z.record(z.string(), z.number().int()).optional(),
|
|
584
602
|
replies: z.array(z.any()).optional()
|
|
585
603
|
}).meta({ id: "PublicComment" });
|
|
586
604
|
/** Admin comment with full details */
|
|
@@ -1039,12 +1057,7 @@ const widgetAreaWithWidgetsAndCountSchema = widgetAreaWithWidgetsSchema.extend({
|
|
|
1039
1057
|
|
|
1040
1058
|
//#endregion
|
|
1041
1059
|
//#region src/api/schemas/redirects.ts
|
|
1042
|
-
const redirectType = z.coerce.number().int().refine((n) =>
|
|
1043
|
-
301,
|
|
1044
|
-
302,
|
|
1045
|
-
307,
|
|
1046
|
-
308
|
|
1047
|
-
].includes(n), { message: "Redirect type must be 301, 302, 307, or 308" });
|
|
1060
|
+
const redirectType = z.coerce.number().int().refine((n) => REDIRECT_RULE_STATUSES.includes(n), { message: "Redirect type must be 301, 302, 307, 308, 410, or 451" });
|
|
1048
1061
|
/** Matches CR or LF characters */
|
|
1049
1062
|
const CRLF = /[\r\n]/;
|
|
1050
1063
|
/** Path must start with / and not be protocol-relative, contain no CRLF, and no path traversal */
|
|
@@ -1057,14 +1070,17 @@ const urlPath = z.string().min(1).refine((s) => s.startsWith("/") && !s.startsWi
|
|
|
1057
1070
|
}, { message: "URL must not contain path traversal segments" });
|
|
1058
1071
|
const createRedirectBody = z.object({
|
|
1059
1072
|
source: urlPath,
|
|
1060
|
-
destination: urlPath,
|
|
1073
|
+
destination: z.union([urlPath, z.literal("")]).optional(),
|
|
1061
1074
|
type: redirectType.optional().default(301),
|
|
1062
1075
|
enabled: z.boolean().optional().default(true),
|
|
1063
1076
|
groupName: z.string().nullish()
|
|
1077
|
+
}).refine((o) => isTerminalStatus(o.type) || !!o.destination, {
|
|
1078
|
+
message: "destination is required for redirect types (301, 302, 307, 308)",
|
|
1079
|
+
path: ["destination"]
|
|
1064
1080
|
}).meta({ id: "CreateRedirectBody" });
|
|
1065
1081
|
const updateRedirectBody = z.object({
|
|
1066
1082
|
source: urlPath.optional(),
|
|
1067
|
-
destination: urlPath.optional(),
|
|
1083
|
+
destination: z.union([urlPath, z.literal("")]).optional(),
|
|
1068
1084
|
type: redirectType.optional(),
|
|
1069
1085
|
enabled: z.boolean().optional(),
|
|
1070
1086
|
groupName: z.string().nullish()
|
|
@@ -1118,4 +1134,4 @@ const notFoundSummarySchema = z.object({
|
|
|
1118
1134
|
const notFoundSummaryResponseSchema = z.object({ items: z.array(notFoundSummarySchema) }).meta({ id: "NotFoundSummaryResponse" });
|
|
1119
1135
|
|
|
1120
1136
|
//#endregion
|
|
1121
|
-
export { createMenuBody as $,
|
|
1137
|
+
export { createMenuBody as $, contentCompareResponseSchema as $t, searchRebuildBody as A, localeCode as An, fieldResponseSchema as At, updateSectionBody as B, mediaConfirmBody as Bt, userDetailSchema as C, contentBylineInputSchema as Cn, collectionResponseSchema as Ct, usersListQuery as D, cursorPaginationQuery as Dn, createFieldBody as Dt, userUpdateBody as E, countResponseSchema as En, createCollectionBody as Et, siteSettingsSchema as F, successEnvelope as Fn, schemaExportQuery as Ft, taxonomyListResponseSchema as G, mediaListResponseSchema as Gt, createTermBody as H, mediaExistingResponseSchema as Ht, createSectionBody as I, updateCollectionBody as It, termResponseSchema as J, mediaUpdateBody as Jt, termGetResponseSchema as K, mediaProviderListQuery as Kt, sectionListResponseSchema as L, updateFieldBody as Lt, searchResultSchema as M, offsetPaginationQuery as Mn, orphanRegisterBody as Mt, searchSuggestQuery as N, roleLevel as Nn, orphanedTableListResponseSchema as Nt, searchEnableBody as O, deleteResponseSchema as On, fieldListResponseSchema as Ot, settingsUpdateBody as P, slugPattern as Pn, orphanedTableSchema as Pt, updateTermBody as Q, contentAuthorsResponseSchema as Qt, sectionSchema as R, DEFAULT_MAX_UPLOAD_SIZE as Rt, allowedDomainUpdateBody as S, bylinesListQuery as Sn, collectionListResponseSchema as St, userSchema as T, apiErrorSchema as Tn, collectionWithFieldsResponseSchema as Tt, taxonomyDefSchema as U, mediaItemSchema as Ut, createTaxonomyDefBody as V, mediaConfirmResponseSchema as Vt, taxonomyDefTranslationsSchema as W, mediaListQuery as Wt, termTranslationsSchema as X, mediaUploadUrlResponseSchema as Xt, termSchema as Y, mediaUploadUrlBody as Yt, termWithCountSchema as Z, contentAuthorSchema as Zt, widgetAreaSchema as _, bylineCreateBody as _n, createCommentBody as _t, notFoundPruneBody as a, contentPublishBody as an, menuTranslationsSchema as at, widgetSchema as b, bylineSummarySchema as bn, publicCommentSchema as bt, notFoundSummarySchema as c, contentSeoInput as cn, updateMenuBody as ct, redirectsListQuery as d, contentTranslationSchema as dn, commentBulkBody as dt, contentCreateBody as en, createMenuItemBody as et, updateRedirectBody as f, contentTranslationsResponseSchema as fn, commentBulkResponseSchema as ft, updateWidgetBody as g, trashedContentListResponseSchema as gn, commentStatusBody as gt, reorderWidgetsBody as h, trashedContentItemSchema as hn, commentSchema as ht, notFoundListResponseSchema as i, contentPreviewUrlBody as in, menuSchema as it, searchResponseSchema as j, localeFilterQuery as jn, fieldSchema as jt, searchQuery as k, httpUrl as kn, fieldReorderBody as kt, redirectListResponseSchema as l, contentSeoSchema as ln, updateMenuItemBody as lt, createWidgetBody as m, contentUpdateBody as mn, commentListQuery as mt, notFoundEntrySchema as n, contentListQuery as nn, menuItemTypeEnum as nt, notFoundSummaryQuery as o, contentResponseSchema as on, menuWithItemsSchema as ot, createWidgetAreaBody as p, contentTrashQuery as pn, commentCountsResponseSchema as pt, termListResponseSchema as q, mediaResponseSchema as qt, notFoundListQuery as r, contentListResponseSchema as rn, menuListItemSchema as rt, notFoundSummaryResponseSchema as s, contentScheduleBody as sn, reorderMenuItemsBody as st, createRedirectBody as t, contentItemSchema as tn, menuItemSchema as tt, redirectSchema as u, contentTermsBody as un, adminCommentListResponseSchema as ut, widgetAreaWithWidgetsAndCountSchema as v, bylineCreditSchema as vn, createReactionBody as vt, userListResponseSchema as w, VALID_ROLE_LEVELS as wn, collectionSchema as wt, allowedDomainCreateBody as x, bylineUpdateBody as xn, collectionGetQuery as xt, widgetAreaWithWidgetsSchema as y, bylineListResponseSchema as yn, publicCommentListResponseSchema as yt, sectionsListQuery as z, formatFileSize as zt };
|