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
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import { getRequestContext } from "./request-context.mjs";
|
|
2
|
+
import { t as after } from "./after-BfniwgIf.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/object-cache/codec.ts
|
|
5
|
+
/**
|
|
6
|
+
* Object-cache serialization codec.
|
|
7
|
+
*
|
|
8
|
+
* Cached values are JSON, with one extension: `Date` instances are preserved
|
|
9
|
+
* across the round-trip. Dineway content entries carry `Date` objects for the
|
|
10
|
+
* system timestamp columns (`createdAt`, `updatedAt`, `publishedAt`,
|
|
11
|
+
* `scheduledAt`) and on `cacheHint.lastModified`; plain `JSON.stringify` would
|
|
12
|
+
* silently flatten those to ISO strings, so a value read from cache would no
|
|
13
|
+
* longer be `=== instanceof Date` and downstream `value instanceof Date`
|
|
14
|
+
* branches (cursor encoding, scheduled-visibility checks) would diverge from a
|
|
15
|
+
* fresh database read.
|
|
16
|
+
*
|
|
17
|
+
* Functions and symbol-keyed properties are NOT preserved — callers that cache
|
|
18
|
+
* values carrying either (e.g. content entries with their `.edit` proxy and
|
|
19
|
+
* the non-enumerable `CURSOR_RAW_VALUES` symbol) must reduce to a serializable
|
|
20
|
+
* snapshot before caching and rebuild the non-serializable parts on read. See
|
|
21
|
+
* `query.ts` content snapshot helpers.
|
|
22
|
+
*/
|
|
23
|
+
/** Tag used to mark a serialized `Date`. Deliberately unlikely to collide. */
|
|
24
|
+
const DATE_TAG = "$$dinewayDate";
|
|
25
|
+
function isTaggedDate(value) {
|
|
26
|
+
if (typeof value !== "object" || value === null) return false;
|
|
27
|
+
return Object.keys(value).length === 1 && typeof value[DATE_TAG] === "string";
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Serialize a value to a cache string, preserving `Date` instances.
|
|
31
|
+
*
|
|
32
|
+
* Uses the JSON replacer's `this` binding to inspect the *original* property
|
|
33
|
+
* value: `JSON.stringify` invokes `Date.prototype.toJSON` before the replacer
|
|
34
|
+
* sees it, so by the time `value` arrives it is already an ISO string. Reading
|
|
35
|
+
* `this[key]` recovers the live `Date` so we can tag it.
|
|
36
|
+
*/
|
|
37
|
+
function encode(value) {
|
|
38
|
+
return JSON.stringify(value, function(key, val) {
|
|
39
|
+
const original = this[key];
|
|
40
|
+
if (original instanceof Date) return { [DATE_TAG]: original.toISOString() };
|
|
41
|
+
return val;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Parse a cache string produced by {@link encode}, rehydrating tagged `Date`s.
|
|
46
|
+
*
|
|
47
|
+
* Returns `undefined` if the input is not valid JSON (treated as a cache miss
|
|
48
|
+
* by the read-through layer rather than throwing).
|
|
49
|
+
*/
|
|
50
|
+
function decode(raw) {
|
|
51
|
+
try {
|
|
52
|
+
return JSON.parse(raw, (_key, value) => {
|
|
53
|
+
if (isTaggedDate(value)) return new Date(value[DATE_TAG]);
|
|
54
|
+
return value;
|
|
55
|
+
});
|
|
56
|
+
} catch {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/object-cache/index.ts
|
|
63
|
+
/**
|
|
64
|
+
* Object cache — distributed read-through query cache.
|
|
65
|
+
*
|
|
66
|
+
* Layering (per query):
|
|
67
|
+
*
|
|
68
|
+
* requestCached → in-request dedupe (per render, WeakMap on ALS context)
|
|
69
|
+
* cachedQuery → THIS layer: object-cache L2, epoch-keyed
|
|
70
|
+
* database → source of truth
|
|
71
|
+
*
|
|
72
|
+
* Optional and off by default: when no `objectCache` descriptor is configured,
|
|
73
|
+
* `virtual:dineway/object-cache` exports `createObjectCache = undefined`,
|
|
74
|
+
* {@link getBackend} resolves to `null`, and {@link cachedQuery} is a
|
|
75
|
+
* transparent passthrough to its `load` function. Configure with
|
|
76
|
+
* `memoryCache()` (Node/local) or another compatible backend descriptor from an
|
|
77
|
+
* extension package.
|
|
78
|
+
*
|
|
79
|
+
* Invalidation is epoch-based: each cache key embeds a per-namespace epoch
|
|
80
|
+
* ("last changed" marker) read from the backend. A write calls
|
|
81
|
+
* {@link invalidateObjectCache}, which stamps the namespace epoch to
|
|
82
|
+
* `Date.now()`; every previously-stored key for that namespace is instantly
|
|
83
|
+
* orphaned and reclaimed by its TTL. This is O(1) and needs no key
|
|
84
|
+
* enumeration.
|
|
85
|
+
*
|
|
86
|
+
* The singleton backend/config and the per-isolate epoch cache live on
|
|
87
|
+
* `globalThis` behind `Symbol.for` keys so Vite SSR chunk duplication can't
|
|
88
|
+
* fork them (same pattern as `request-context.ts`).
|
|
89
|
+
*/
|
|
90
|
+
const DEFAULT_KEY_PREFIX = "dineway";
|
|
91
|
+
const DEFAULT_TTL_SECONDS = 3600;
|
|
92
|
+
const DEFAULT_REVALIDATE_MS = 1e3;
|
|
93
|
+
const DEFAULT_TIMEOUT_MS = 2e3;
|
|
94
|
+
/**
|
|
95
|
+
* Race a backend operation against a timeout so a stalled call that never
|
|
96
|
+
* resolves *and* never rejects degrades to a rejection instead of hanging the
|
|
97
|
+
* isolate. A rejection is benign: callers already treat a failed read as a
|
|
98
|
+
* cache miss / last-known epoch.
|
|
99
|
+
*/
|
|
100
|
+
function withTimeout(promise, ms, label) {
|
|
101
|
+
if (!(ms > 0)) return promise;
|
|
102
|
+
let timer;
|
|
103
|
+
const timeout = new Promise((_resolve, reject) => {
|
|
104
|
+
timer = setTimeout(() => {
|
|
105
|
+
reject(/* @__PURE__ */ new Error(`object-cache ${label} timed out after ${ms}ms`));
|
|
106
|
+
}, ms);
|
|
107
|
+
});
|
|
108
|
+
return Promise.race([promise, timeout]).finally(() => clearTimeout(timer));
|
|
109
|
+
}
|
|
110
|
+
function isMissingVirtualObjectCache(error) {
|
|
111
|
+
return error instanceof Error && error.message.includes("virtual:dineway/object-cache");
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Extra time past the configured read timeout before an in-flight epoch read
|
|
115
|
+
* is presumed dead. A live owner's read settles within `timeout` (enforced by
|
|
116
|
+
* {@link withTimeout}), so the grace only needs to absorb scheduling jitter.
|
|
117
|
+
*/
|
|
118
|
+
const EPOCH_READ_GRACE_MS = 1e3;
|
|
119
|
+
/**
|
|
120
|
+
* How long an in-flight epoch read may be trusted. A read older than this can
|
|
121
|
+
* only exist because its owning request was cancelled mid-await — on workerd
|
|
122
|
+
* a cancelled request's continuations never run, *including the timeout's own
|
|
123
|
+
* `setTimeout` callback*, so the shared promise never settles and is never
|
|
124
|
+
* replaced. With the timeout disabled (`timeout: 0`) the default is used as
|
|
125
|
+
* the deadline; the worst case of guessing too short is one duplicate
|
|
126
|
+
* backend read.
|
|
127
|
+
*/
|
|
128
|
+
function epochReadDeadline() {
|
|
129
|
+
return (holder.config.timeout > 0 ? holder.config.timeout : DEFAULT_TIMEOUT_MS) + EPOCH_READ_GRACE_MS;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Await another request's in-flight epoch read, bounded by the waiter's own
|
|
133
|
+
* timer. The bare promise must never be awaited across requests: if the
|
|
134
|
+
* owning request is cancelled, the promise never settles (see
|
|
135
|
+
* {@link epochReadDeadline}) and an unguarded waiter hangs until the isolate
|
|
136
|
+
* is evicted. The race timer below belongs to the *waiter's* request context
|
|
137
|
+
* and therefore always fires; on timeout the waiter degrades to `fallback`
|
|
138
|
+
* (the last known epoch), the same contract as a failed backend read.
|
|
139
|
+
*/
|
|
140
|
+
function raceInFlightEpochRead(promise, ms, fallback) {
|
|
141
|
+
let timer;
|
|
142
|
+
const timeout = new Promise((resolve) => {
|
|
143
|
+
timer = setTimeout(resolve, Math.max(ms, 1), fallback);
|
|
144
|
+
});
|
|
145
|
+
return Promise.race([promise, timeout]).finally(() => clearTimeout(timer));
|
|
146
|
+
}
|
|
147
|
+
const BACKEND_KEY = Symbol.for("dineway:object-cache:backend");
|
|
148
|
+
const EPOCH_KEY = Symbol.for("dineway:object-cache:epochs");
|
|
149
|
+
const PENDING_KEY = Symbol.for("dineway:object-cache:pending-bumps");
|
|
150
|
+
const g = globalThis;
|
|
151
|
+
const holder = g[BACKEND_KEY] ?? (() => {
|
|
152
|
+
const h = {
|
|
153
|
+
initialized: false,
|
|
154
|
+
backend: null,
|
|
155
|
+
initPromise: null,
|
|
156
|
+
config: {
|
|
157
|
+
keyPrefix: DEFAULT_KEY_PREFIX,
|
|
158
|
+
defaultTtl: DEFAULT_TTL_SECONDS,
|
|
159
|
+
revalidate: DEFAULT_REVALIDATE_MS,
|
|
160
|
+
timeout: DEFAULT_TIMEOUT_MS
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
g[BACKEND_KEY] = h;
|
|
164
|
+
return h;
|
|
165
|
+
})();
|
|
166
|
+
const epochCache = g[EPOCH_KEY] ?? (() => {
|
|
167
|
+
const m = /* @__PURE__ */ new Map();
|
|
168
|
+
g[EPOCH_KEY] = m;
|
|
169
|
+
return m;
|
|
170
|
+
})();
|
|
171
|
+
/** Namespaces with a backend epoch write already scheduled this tick. */
|
|
172
|
+
const pendingBumps = g[PENDING_KEY] ?? (() => {
|
|
173
|
+
const s = /* @__PURE__ */ new Set();
|
|
174
|
+
g[PENDING_KEY] = s;
|
|
175
|
+
return s;
|
|
176
|
+
})();
|
|
177
|
+
/**
|
|
178
|
+
* Resolve (once per isolate) the configured object-cache backend.
|
|
179
|
+
*
|
|
180
|
+
* Loads `virtual:dineway/object-cache`, which exports `createObjectCache`
|
|
181
|
+
* (`undefined` when no cache is configured) and the serialized
|
|
182
|
+
* `objectCacheConfig`. Returns `null` when the cache is disabled.
|
|
183
|
+
*/
|
|
184
|
+
async function getBackend() {
|
|
185
|
+
if (holder.initialized) return holder.backend;
|
|
186
|
+
if (holder.initPromise) return holder.initPromise;
|
|
187
|
+
holder.initPromise = (async () => {
|
|
188
|
+
try {
|
|
189
|
+
const mod = await import("virtual:dineway/object-cache");
|
|
190
|
+
const config = mod.objectCacheConfig ?? {};
|
|
191
|
+
holder.config = {
|
|
192
|
+
keyPrefix: typeof config.keyPrefix === "string" && config.keyPrefix.length > 0 ? config.keyPrefix : DEFAULT_KEY_PREFIX,
|
|
193
|
+
defaultTtl: typeof config.defaultTtl === "number" && config.defaultTtl > 0 ? config.defaultTtl : DEFAULT_TTL_SECONDS,
|
|
194
|
+
revalidate: typeof config.revalidate === "number" && config.revalidate >= 0 ? config.revalidate : DEFAULT_REVALIDATE_MS,
|
|
195
|
+
timeout: typeof config.timeout === "number" && config.timeout >= 0 ? config.timeout : DEFAULT_TIMEOUT_MS
|
|
196
|
+
};
|
|
197
|
+
holder.backend = typeof mod.createObjectCache === "function" ? mod.createObjectCache(config) : null;
|
|
198
|
+
} catch (error) {
|
|
199
|
+
if (import.meta.env?.DEV && !isMissingVirtualObjectCache(error)) console.warn("[object-cache] backend unavailable:", error);
|
|
200
|
+
holder.backend = null;
|
|
201
|
+
}
|
|
202
|
+
holder.initialized = true;
|
|
203
|
+
holder.initPromise = null;
|
|
204
|
+
return holder.backend;
|
|
205
|
+
})();
|
|
206
|
+
return holder.initPromise;
|
|
207
|
+
}
|
|
208
|
+
/** Build the backend key for a namespace's epoch anchor. */
|
|
209
|
+
function epochKey(namespace) {
|
|
210
|
+
return `${holder.config.keyPrefix}:epoch:${namespace}`;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Build the (epoch-independent) backend key for a cached value.
|
|
214
|
+
*
|
|
215
|
+
* The key is stable across invalidations — the namespace epochs are stored
|
|
216
|
+
* *inside* the value envelope and validated on read, not baked into the key.
|
|
217
|
+
* This lets the value and the epochs be fetched in one parallel round-trip
|
|
218
|
+
* (instead of "read epoch, then read value"), and means an invalidated value
|
|
219
|
+
* is overwritten in place rather than orphaned under a dead epoch-keyed name.
|
|
220
|
+
*/
|
|
221
|
+
function valueKey(namespaces, key) {
|
|
222
|
+
return `${holder.config.keyPrefix}:${namespaces.join(",")}:${key}`;
|
|
223
|
+
}
|
|
224
|
+
function epochsMatch(stored, current) {
|
|
225
|
+
if (stored.length !== current.length) return false;
|
|
226
|
+
for (let i = 0; i < stored.length; i++) if (stored[i] !== current[i]) return false;
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Requests that must always read live data and never populate the cache:
|
|
231
|
+
* visual edit mode, preview tokens, and isolated databases (playground / DO
|
|
232
|
+
* preview, whose schema and content diverge from the configured site).
|
|
233
|
+
*/
|
|
234
|
+
function shouldBypass() {
|
|
235
|
+
const ctx = getRequestContext();
|
|
236
|
+
if (!ctx) return false;
|
|
237
|
+
return ctx.editMode === true || ctx.preview !== void 0 || ctx.dbIsIsolated === true;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Read the current epoch for `namespace`, reusing an isolate-cached value for
|
|
241
|
+
* up to `revalidate` ms. A missing epoch (never bumped) is treated as `0`.
|
|
242
|
+
*
|
|
243
|
+
* Backend errors and stalls are non-fatal: the read is bounded by a timeout,
|
|
244
|
+
* and on failure we fall back to the last known epoch (or `0`), so a flaky or
|
|
245
|
+
* hung cache degrades to "serve whatever's keyed" rather than throwing or
|
|
246
|
+
* hanging.
|
|
247
|
+
*/
|
|
248
|
+
async function getEpoch(namespace, backend) {
|
|
249
|
+
const now = Date.now();
|
|
250
|
+
const cached = epochCache.get(namespace);
|
|
251
|
+
if (cached && now - cached.at < holder.config.revalidate) return cached.value;
|
|
252
|
+
if (cached?.promise) {
|
|
253
|
+
const age = now - (cached.promiseAt ?? 0);
|
|
254
|
+
const deadline = epochReadDeadline();
|
|
255
|
+
if (age < deadline) return raceInFlightEpochRead(cached.promise, deadline - age, cached.value);
|
|
256
|
+
}
|
|
257
|
+
const promise = (async () => {
|
|
258
|
+
let value;
|
|
259
|
+
try {
|
|
260
|
+
const raw = await withTimeout(backend.get(epochKey(namespace)), holder.config.timeout, "epoch read");
|
|
261
|
+
const parsed = raw === null ? 0 : Number(raw);
|
|
262
|
+
value = Number.isFinite(parsed) ? parsed : 0;
|
|
263
|
+
} catch {
|
|
264
|
+
value = cached?.value ?? 0;
|
|
265
|
+
}
|
|
266
|
+
const merged = Math.max(value, epochCache.get(namespace)?.value ?? 0);
|
|
267
|
+
epochCache.set(namespace, {
|
|
268
|
+
value: merged,
|
|
269
|
+
at: Date.now()
|
|
270
|
+
});
|
|
271
|
+
return merged;
|
|
272
|
+
})();
|
|
273
|
+
after(() => promise.then(() => void 0, () => void 0));
|
|
274
|
+
epochCache.set(namespace, {
|
|
275
|
+
value: cached?.value ?? 0,
|
|
276
|
+
at: cached?.at ?? 0,
|
|
277
|
+
promise,
|
|
278
|
+
promiseAt: now
|
|
279
|
+
});
|
|
280
|
+
return promise;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Distributed read-through cache around `load`.
|
|
284
|
+
*
|
|
285
|
+
* `T` must be the value as it should be *stored* — i.e. JSON-serializable with
|
|
286
|
+
* the codec's `Date` support, carrying no functions or symbol-keyed props.
|
|
287
|
+
* Callers caching richer objects (content entries) reduce to a serializable
|
|
288
|
+
* snapshot here and rebuild on the way out; see `query.ts`.
|
|
289
|
+
*
|
|
290
|
+
* On a miss or when the cache is disabled/bypassed, this is equivalent to
|
|
291
|
+
* `await load()`. Backend errors never propagate: a failing `get` is a miss, a
|
|
292
|
+
* failing `set` is dropped.
|
|
293
|
+
*/
|
|
294
|
+
async function cachedQuery(options) {
|
|
295
|
+
const backend = await getBackend();
|
|
296
|
+
if (!backend || shouldBypass()) return options.load();
|
|
297
|
+
const namespaces = typeof options.namespace === "string" ? [options.namespace] : options.namespace;
|
|
298
|
+
const fullKey = valueKey(namespaces, options.key);
|
|
299
|
+
const epochsPromise = Promise.all(namespaces.map((ns) => getEpoch(ns, backend)));
|
|
300
|
+
const rawPromise = withTimeout(backend.get(fullKey), holder.config.timeout, "read").catch(() => null);
|
|
301
|
+
const currentEpochs = await epochsPromise;
|
|
302
|
+
const raw = await rawPromise;
|
|
303
|
+
if (raw !== null) {
|
|
304
|
+
const decoded = decode(raw);
|
|
305
|
+
if (decoded !== void 0) {
|
|
306
|
+
const envelope = decoded;
|
|
307
|
+
if (epochsMatch(envelope.e, currentEpochs)) return envelope.v;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
const value = await options.load();
|
|
311
|
+
if (options.cacheable ? options.cacheable(value) : true) {
|
|
312
|
+
const ttl = options.ttl ?? holder.config.defaultTtl;
|
|
313
|
+
after(async () => {
|
|
314
|
+
try {
|
|
315
|
+
const encoded = encode({
|
|
316
|
+
e: currentEpochs,
|
|
317
|
+
v: value
|
|
318
|
+
});
|
|
319
|
+
await backend.set(fullKey, encoded, ttl);
|
|
320
|
+
} catch (error) {
|
|
321
|
+
if (import.meta.env?.DEV) console.warn("[object-cache] set failed:", error);
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
return value;
|
|
326
|
+
}
|
|
327
|
+
/** Whether object-cache reads are active for the current request. */
|
|
328
|
+
async function isObjectCacheActive() {
|
|
329
|
+
return await getBackend() !== null && !shouldBypass();
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Invalidate every cached value in `namespace` by bumping its epoch.
|
|
333
|
+
*
|
|
334
|
+
* Sync and non-blocking: the local epoch is stamped immediately (so the
|
|
335
|
+
* writing isolate is instantly consistent) and the backend write is deferred
|
|
336
|
+
* via `after`. Other isolates pick up the new epoch within their `revalidate`
|
|
337
|
+
* window. No-ops when the cache is disabled.
|
|
338
|
+
*/
|
|
339
|
+
function invalidateObjectCache(namespace) {
|
|
340
|
+
const prev = epochCache.get(namespace)?.value ?? 0;
|
|
341
|
+
const stamp = Math.max(prev + 1, Date.now());
|
|
342
|
+
epochCache.set(namespace, {
|
|
343
|
+
value: stamp,
|
|
344
|
+
at: stamp
|
|
345
|
+
});
|
|
346
|
+
if (pendingBumps.has(namespace)) return;
|
|
347
|
+
pendingBumps.add(namespace);
|
|
348
|
+
after(async () => {
|
|
349
|
+
pendingBumps.delete(namespace);
|
|
350
|
+
try {
|
|
351
|
+
const backend = await getBackend();
|
|
352
|
+
if (!backend) return;
|
|
353
|
+
const latest = epochCache.get(namespace)?.value ?? stamp;
|
|
354
|
+
await backend.set(epochKey(namespace), String(latest));
|
|
355
|
+
} catch (error) {
|
|
356
|
+
console.error("[object-cache] epoch bump failed for", namespace, error);
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Fixed namespaces for data shared across collections. Content reads fold the
|
|
362
|
+
* `BYLINES` and `TAXONOMIES` epochs into their keys (via {@link cachedQuery})
|
|
363
|
+
* because entries hydrate byline and taxonomy-term data — so renaming an
|
|
364
|
+
* author or a category correctly invalidates every cached entry that displays
|
|
365
|
+
* it, without tracking which collections reference it.
|
|
366
|
+
*/
|
|
367
|
+
const CacheNamespace = {
|
|
368
|
+
SETTINGS: "settings",
|
|
369
|
+
MENUS: "menus",
|
|
370
|
+
TAXONOMIES: "taxonomies",
|
|
371
|
+
BYLINES: "bylines",
|
|
372
|
+
SCHEMA: "schema",
|
|
373
|
+
COMMENTS: "comments"
|
|
374
|
+
};
|
|
375
|
+
/** Namespace for a content collection's cached queries. */
|
|
376
|
+
function contentNamespace(collection) {
|
|
377
|
+
return `content:${collection}`;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Namespaces a content read depends on: the collection itself plus the shared
|
|
381
|
+
* byline/taxonomy data folded into each entry.
|
|
382
|
+
*/
|
|
383
|
+
function contentNamespaces(collection) {
|
|
384
|
+
return [
|
|
385
|
+
contentNamespace(collection),
|
|
386
|
+
CacheNamespace.BYLINES,
|
|
387
|
+
CacheNamespace.TAXONOMIES
|
|
388
|
+
];
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Invalidate all cached reads (list + entry) for a content collection.
|
|
392
|
+
* Call from every write path that mutates rows in `ec_<collection>`.
|
|
393
|
+
*/
|
|
394
|
+
function invalidateCollectionCache(collection) {
|
|
395
|
+
invalidateObjectCache(contentNamespace(collection));
|
|
396
|
+
}
|
|
397
|
+
/** Invalidate cached taxonomy definitions/terms and all content that hydrates them. */
|
|
398
|
+
function invalidateTaxonomyObjectCache() {
|
|
399
|
+
invalidateObjectCache(CacheNamespace.TAXONOMIES);
|
|
400
|
+
}
|
|
401
|
+
/** Invalidate cached bylines and all content that hydrates them. */
|
|
402
|
+
function invalidateBylineObjectCache() {
|
|
403
|
+
invalidateObjectCache(CacheNamespace.BYLINES);
|
|
404
|
+
}
|
|
405
|
+
/** Invalidate cached navigation menus. */
|
|
406
|
+
function invalidateMenuObjectCache() {
|
|
407
|
+
invalidateObjectCache(CacheNamespace.MENUS);
|
|
408
|
+
}
|
|
409
|
+
/** Invalidate cached collection schema/metadata reads (e.g. getCollectionInfo). */
|
|
410
|
+
function invalidateSchemaObjectCache() {
|
|
411
|
+
invalidateObjectCache(CacheNamespace.SCHEMA);
|
|
412
|
+
}
|
|
413
|
+
/** Invalidate cached public comment reads. */
|
|
414
|
+
function invalidateCommentObjectCache() {
|
|
415
|
+
invalidateObjectCache(CacheNamespace.COMMENTS);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
//#endregion
|
|
419
|
+
export { invalidateBylineObjectCache as a, invalidateMenuObjectCache as c, invalidateTaxonomyObjectCache as d, isObjectCacheActive as f, contentNamespaces as i, invalidateObjectCache as l, cachedQuery as n, invalidateCollectionCache as o, contentNamespace as r, invalidateCommentObjectCache as s, CacheNamespace as t, invalidateSchemaObjectCache as u };
|
package/dist/page/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import "../types-DU0bU2Wu.mjs";
|
|
2
|
+
import { A as PageMetadataContribution, D as PageFragmentContribution, vt as PublicPageContext } from "../types-C8XW6L19.mjs";
|
|
3
|
+
import { a as generateSiteSeoContributions, c as ResolvedPageMetadata, d as renderPageMetadata, f as resolvePageMetadata, h as createPublicPageContext, i as generateBaseSeoContributions, l as createSha256CspHash, m as CreatePublicPageContextInput, n as buildWebSiteJsonLd, o as renderFragments, p as safeJsonLdSerialize, r as cleanJsonLd, s as resolveFragments, t as buildBlogPostingJsonLd, u as escapeHtmlAttr } from "../jsonld-Dq0gsnOH.mjs";
|
|
3
4
|
|
|
4
5
|
//#region src/page/index.d.ts
|
|
5
6
|
/**
|
|
@@ -16,4 +17,4 @@ interface DinewayPageRuntime {
|
|
|
16
17
|
*/
|
|
17
18
|
declare function getPageRuntime(locals: Record<string, unknown>): DinewayPageRuntime | undefined;
|
|
18
19
|
//#endregion
|
|
19
|
-
export { type CreatePublicPageContextInput, DinewayPageRuntime, type ResolvedPageMetadata, buildBlogPostingJsonLd, buildWebSiteJsonLd, cleanJsonLd, createPublicPageContext, escapeHtmlAttr, generateBaseSeoContributions, generateSiteSeoContributions, getPageRuntime, renderFragments, renderPageMetadata, resolveFragments, resolvePageMetadata, safeJsonLdSerialize };
|
|
20
|
+
export { type CreatePublicPageContextInput, DinewayPageRuntime, type ResolvedPageMetadata, buildBlogPostingJsonLd, buildWebSiteJsonLd, cleanJsonLd, createPublicPageContext, createSha256CspHash, escapeHtmlAttr, generateBaseSeoContributions, generateSiteSeoContributions, getPageRuntime, renderFragments, renderPageMetadata, resolveFragments, resolvePageMetadata, safeJsonLdSerialize };
|
package/dist/page/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as cleanJsonLd, c as
|
|
1
|
+
import { a as cleanJsonLd, c as createSha256CspHash, d as resolvePageMetadata, f as safeJsonLdSerialize, i as buildWebSiteJsonLd, l as escapeHtmlAttr, n as generateSiteSeoContributions, o as renderFragments, p as createPublicPageContext, r as buildBlogPostingJsonLd, s as resolveFragments, t as generateBaseSeoContributions, u as renderPageMetadata } from "../seo-contributions-C1EnikHB.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/page/index.ts
|
|
4
4
|
/**
|
|
@@ -11,4 +11,4 @@ function getPageRuntime(locals) {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
|
-
export { buildBlogPostingJsonLd, buildWebSiteJsonLd, cleanJsonLd, createPublicPageContext, escapeHtmlAttr, generateBaseSeoContributions, generateSiteSeoContributions, getPageRuntime, renderFragments, renderPageMetadata, resolveFragments, resolvePageMetadata, safeJsonLdSerialize };
|
|
14
|
+
export { buildBlogPostingJsonLd, buildWebSiteJsonLd, cleanJsonLd, createPublicPageContext, createSha256CspHash, escapeHtmlAttr, generateBaseSeoContributions, generateSiteSeoContributions, getPageRuntime, renderFragments, renderPageMetadata, resolveFragments, resolvePageMetadata, safeJsonLdSerialize };
|
|
@@ -3,12 +3,107 @@ import sax from "sax";
|
|
|
3
3
|
//#region src/cli/wxr/parser.ts
|
|
4
4
|
const PHP_SERIALIZED_STRING_PATTERN = /s:\d+:"([^"]+)"/g;
|
|
5
5
|
const PHP_SERIALIZED_STRING_MATCH_PATTERN = /s:\d+:"([^"]+)"/;
|
|
6
|
+
const WPML_LOCALE_META_KEYS = ["_icl_lang_code"];
|
|
7
|
+
const WPML_TRID_META_KEYS = ["trid", "_icl_translation_id"];
|
|
8
|
+
const POLYLANG_LOCALE_META_KEY = "_locale";
|
|
9
|
+
const POLYLANG_TRANSLATIONS_META_KEY = "_translations";
|
|
10
|
+
const POLYLANG_LANG_TAXONOMY = "language";
|
|
11
|
+
function polylangTranslationGroupFromMeta(serialized) {
|
|
12
|
+
const bytes = new TextEncoder().encode(serialized);
|
|
13
|
+
const decoder = new TextDecoder("utf-8");
|
|
14
|
+
const ids = [];
|
|
15
|
+
let i = 0;
|
|
16
|
+
const n = bytes.length;
|
|
17
|
+
const CHAR_S = 115;
|
|
18
|
+
const CHAR_I = 105;
|
|
19
|
+
const CHAR_COLON = 58;
|
|
20
|
+
const CHAR_SEMI = 59;
|
|
21
|
+
const CHAR_QUOTE = 34;
|
|
22
|
+
const indexOf = (byte, from) => {
|
|
23
|
+
for (let k = from; k < n; k++) if (bytes[k] === byte) return k;
|
|
24
|
+
return -1;
|
|
25
|
+
};
|
|
26
|
+
while (i < n) {
|
|
27
|
+
const ch = bytes[i];
|
|
28
|
+
if (ch === CHAR_S && bytes[i + 1] === CHAR_COLON) {
|
|
29
|
+
const lenStart = i + 2;
|
|
30
|
+
const lenEnd = indexOf(CHAR_COLON, lenStart);
|
|
31
|
+
if (lenEnd === -1) break;
|
|
32
|
+
const lenText = decoder.decode(bytes.slice(lenStart, lenEnd));
|
|
33
|
+
const len = Number.parseInt(lenText, 10);
|
|
34
|
+
if (!Number.isFinite(len) || len < 0) {
|
|
35
|
+
i = lenEnd + 1;
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (bytes[lenEnd + 1] !== CHAR_QUOTE) {
|
|
39
|
+
i = lenEnd + 1;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
i = lenEnd + 2 + len + 2;
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (ch === CHAR_I && bytes[i + 1] === CHAR_COLON) {
|
|
46
|
+
const valStart = i + 2;
|
|
47
|
+
const valEnd = indexOf(CHAR_SEMI, valStart);
|
|
48
|
+
if (valEnd === -1) break;
|
|
49
|
+
const idText = decoder.decode(bytes.slice(valStart, valEnd));
|
|
50
|
+
const id = Number.parseInt(idText, 10);
|
|
51
|
+
if (Number.isFinite(id)) ids.push(id);
|
|
52
|
+
i = valEnd + 1;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
i++;
|
|
56
|
+
}
|
|
57
|
+
if (ids.length === 0) return void 0;
|
|
58
|
+
return `pll:${[...new Set(ids)].toSorted((a, b) => a - b).join(",")}`;
|
|
59
|
+
}
|
|
60
|
+
function promoteI18nMetadata(post) {
|
|
61
|
+
for (const key of WPML_LOCALE_META_KEYS) {
|
|
62
|
+
const value = post.meta.get(key);
|
|
63
|
+
if (value) {
|
|
64
|
+
post.locale = value;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
for (const key of WPML_TRID_META_KEYS) {
|
|
69
|
+
const value = post.meta.get(key);
|
|
70
|
+
if (value) {
|
|
71
|
+
post.translationGroup = `wpml:${value}`;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (!post.locale) {
|
|
76
|
+
const pllLocale = post.meta.get(POLYLANG_LOCALE_META_KEY);
|
|
77
|
+
if (pllLocale) post.locale = pllLocale;
|
|
78
|
+
else {
|
|
79
|
+
const firstLang = (post.customTaxonomies?.get(POLYLANG_LANG_TAXONOMY))?.[0];
|
|
80
|
+
if (firstLang) post.locale = firstLang;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (!post.translationGroup) {
|
|
84
|
+
const pllTranslations = post.meta.get(POLYLANG_TRANSLATIONS_META_KEY);
|
|
85
|
+
if (pllTranslations) {
|
|
86
|
+
const group = polylangTranslationGroupFromMeta(pllTranslations);
|
|
87
|
+
if (group) post.translationGroup = group;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
6
91
|
/** Extract string value from a SAX attribute (handles both Tag and QualifiedTag) */
|
|
7
92
|
function attrStr(attr) {
|
|
8
93
|
if (typeof attr === "string") return attr;
|
|
9
94
|
if (attr && typeof attr === "object" && "value" in attr) return attr.value;
|
|
10
95
|
return "";
|
|
11
96
|
}
|
|
97
|
+
function normalizeDomain(domain) {
|
|
98
|
+
if (domain === "post_tag") return "tag";
|
|
99
|
+
return domain;
|
|
100
|
+
}
|
|
101
|
+
function captureItemCategoryLabel(item, pair, label) {
|
|
102
|
+
if (!label || label === pair.nicename) return;
|
|
103
|
+
if (!item.taxonomyLabels) item.taxonomyLabels = /* @__PURE__ */ new Map();
|
|
104
|
+
const key = `${normalizeDomain(pair.domain)}\u0000${pair.nicename}`;
|
|
105
|
+
if (!item.taxonomyLabels.has(key)) item.taxonomyLabels.set(key, label);
|
|
106
|
+
}
|
|
12
107
|
/** Type guard for complete WxrTerm (all required fields present) */
|
|
13
108
|
function isCompleteWxrTerm(term) {
|
|
14
109
|
return term.id !== void 0 && term.taxonomy !== void 0 && term.slug !== void 0 && term.name !== void 0;
|
|
@@ -38,6 +133,7 @@ function parseWxr(stream) {
|
|
|
38
133
|
let currentAuthor = null;
|
|
39
134
|
let currentTerm = null;
|
|
40
135
|
let currentMetaKey = "";
|
|
136
|
+
let pendingItemCategory = null;
|
|
41
137
|
const navMenuItemPosts = [];
|
|
42
138
|
const menuTermsBySlug = /* @__PURE__ */ new Map();
|
|
43
139
|
parser.on("opentag", (node) => {
|
|
@@ -57,13 +153,27 @@ function parseWxr(stream) {
|
|
|
57
153
|
if (tagName === "category" && currentItem && node.attributes) {
|
|
58
154
|
const domain = attrStr(node.attributes.domain);
|
|
59
155
|
const nicename = attrStr(node.attributes.nicename);
|
|
60
|
-
if (domain === "category" && nicename)
|
|
61
|
-
|
|
62
|
-
|
|
156
|
+
if (domain === "category" && nicename) {
|
|
157
|
+
currentItem.categories.push(nicename);
|
|
158
|
+
pendingItemCategory = {
|
|
159
|
+
domain,
|
|
160
|
+
nicename
|
|
161
|
+
};
|
|
162
|
+
} else if (domain === "post_tag" && nicename) {
|
|
163
|
+
currentItem.tags.push(nicename);
|
|
164
|
+
pendingItemCategory = {
|
|
165
|
+
domain,
|
|
166
|
+
nicename
|
|
167
|
+
};
|
|
168
|
+
} else if (domain && nicename && domain !== "category" && domain !== "post_tag") {
|
|
63
169
|
if (!currentItem.customTaxonomies) currentItem.customTaxonomies = /* @__PURE__ */ new Map();
|
|
64
170
|
const existing = currentItem.customTaxonomies.get(domain) || [];
|
|
65
171
|
existing.push(nicename);
|
|
66
172
|
currentItem.customTaxonomies.set(domain, existing);
|
|
173
|
+
pendingItemCategory = {
|
|
174
|
+
domain,
|
|
175
|
+
nicename
|
|
176
|
+
};
|
|
67
177
|
}
|
|
68
178
|
}
|
|
69
179
|
});
|
|
@@ -181,6 +291,10 @@ function parseWxr(stream) {
|
|
|
181
291
|
meta: currentItem.meta
|
|
182
292
|
};
|
|
183
293
|
break;
|
|
294
|
+
case "category":
|
|
295
|
+
if (pendingItemCategory && text) captureItemCategoryLabel(currentItem, pendingItemCategory, text);
|
|
296
|
+
pendingItemCategory = null;
|
|
297
|
+
break;
|
|
184
298
|
case "item":
|
|
185
299
|
if (currentAttachment) {
|
|
186
300
|
data.attachments.push(currentAttachment);
|
|
@@ -188,7 +302,10 @@ function parseWxr(stream) {
|
|
|
188
302
|
} else if (currentItem.postType === "nav_menu_item") {
|
|
189
303
|
navMenuItemPosts.push(currentItem);
|
|
190
304
|
data.posts.push(currentItem);
|
|
191
|
-
} else if (currentItem.postType !== "attachment")
|
|
305
|
+
} else if (currentItem.postType !== "attachment") {
|
|
306
|
+
promoteI18nMetadata(currentItem);
|
|
307
|
+
data.posts.push(currentItem);
|
|
308
|
+
}
|
|
192
309
|
currentItem = null;
|
|
193
310
|
break;
|
|
194
311
|
}
|
|
@@ -326,6 +443,7 @@ function parseWxrString(xml) {
|
|
|
326
443
|
let currentAuthor = null;
|
|
327
444
|
let currentTerm = null;
|
|
328
445
|
let currentMetaKey = "";
|
|
446
|
+
let pendingItemCategory = null;
|
|
329
447
|
const navMenuItemPosts = [];
|
|
330
448
|
const menuTermsBySlug = /* @__PURE__ */ new Map();
|
|
331
449
|
parser.onopentag = (node) => {
|
|
@@ -345,13 +463,27 @@ function parseWxrString(xml) {
|
|
|
345
463
|
if (tag === "category" && currentItem && node.attributes) {
|
|
346
464
|
const domain = attrStr(node.attributes.domain);
|
|
347
465
|
const nicename = attrStr(node.attributes.nicename);
|
|
348
|
-
if (domain === "category" && nicename)
|
|
349
|
-
|
|
350
|
-
|
|
466
|
+
if (domain === "category" && nicename) {
|
|
467
|
+
currentItem.categories.push(nicename);
|
|
468
|
+
pendingItemCategory = {
|
|
469
|
+
domain,
|
|
470
|
+
nicename
|
|
471
|
+
};
|
|
472
|
+
} else if (domain === "post_tag" && nicename) {
|
|
473
|
+
currentItem.tags.push(nicename);
|
|
474
|
+
pendingItemCategory = {
|
|
475
|
+
domain,
|
|
476
|
+
nicename
|
|
477
|
+
};
|
|
478
|
+
} else if (domain && nicename && domain !== "category" && domain !== "post_tag") {
|
|
351
479
|
if (!currentItem.customTaxonomies) currentItem.customTaxonomies = /* @__PURE__ */ new Map();
|
|
352
480
|
const existing = currentItem.customTaxonomies.get(domain) || [];
|
|
353
481
|
existing.push(nicename);
|
|
354
482
|
currentItem.customTaxonomies.set(domain, existing);
|
|
483
|
+
pendingItemCategory = {
|
|
484
|
+
domain,
|
|
485
|
+
nicename
|
|
486
|
+
};
|
|
355
487
|
}
|
|
356
488
|
}
|
|
357
489
|
};
|
|
@@ -465,7 +597,14 @@ function parseWxrString(xml) {
|
|
|
465
597
|
currentMetaKey = text;
|
|
466
598
|
break;
|
|
467
599
|
case "wp:meta_value":
|
|
468
|
-
if (currentMetaKey && currentItem.meta)
|
|
600
|
+
if (currentMetaKey && currentItem.meta) {
|
|
601
|
+
currentItem.meta.set(currentMetaKey, text);
|
|
602
|
+
currentMetaKey = "";
|
|
603
|
+
}
|
|
604
|
+
break;
|
|
605
|
+
case "category":
|
|
606
|
+
if (pendingItemCategory && text) captureItemCategoryLabel(currentItem, pendingItemCategory, text);
|
|
607
|
+
pendingItemCategory = null;
|
|
469
608
|
break;
|
|
470
609
|
case "item":
|
|
471
610
|
if (currentAttachment) {
|
|
@@ -474,7 +613,10 @@ function parseWxrString(xml) {
|
|
|
474
613
|
} else if (currentItem.postType === "nav_menu_item") {
|
|
475
614
|
navMenuItemPosts.push(currentItem);
|
|
476
615
|
data.posts.push(currentItem);
|
|
477
|
-
} else if (currentItem.postType !== "attachment")
|
|
616
|
+
} else if (currentItem.postType !== "attachment") {
|
|
617
|
+
promoteI18nMetadata(currentItem);
|
|
618
|
+
data.posts.push(currentItem);
|
|
619
|
+
}
|
|
478
620
|
currentItem = null;
|
|
479
621
|
break;
|
|
480
622
|
}
|