dineway 0.1.45 → 0.1.46
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-CpcTzKpF.mjs → activity-events-CNk3clTT.mjs} +1 -1
- package/dist/{allowed-origins-3RuuoFjC.mjs → allowed-origins-DhipQNLb.mjs} +1 -1
- package/dist/api/route-utils.d.mts +9 -10
- package/dist/api/route-utils.mjs +13 -13
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +4 -4
- package/dist/{api-DkFSCD74.mjs → api-Bmfii2mH.mjs} +101 -56
- package/dist/{api-tokens-BFg7tiOQ.mjs → api-tokens-DtvdtIkm.mjs} +1 -1
- package/dist/{apply-TIoQ00aH.mjs → apply-BpRBCqUt.mjs} +76 -31
- package/dist/astro/index.d.mts +10 -11
- package/dist/astro/index.mjs +23 -3
- package/dist/astro/middleware/auth.d.mts +9 -10
- package/dist/astro/middleware/auth.mjs +5 -5
- package/dist/astro/middleware/redirect.mjs +13 -7
- package/dist/astro/middleware/request-context.mjs +3 -3
- 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 +120 -82
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +5 -5
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +5 -5
- 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 +17 -17
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.d.mts +7 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +17 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_.d.mts +9 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +38 -0
- package/dist/astro/routes/api/admin/byline-fields/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +31 -0
- package/dist/astro/routes/api/admin/byline-fields/reorder.d.mts +7 -0
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +24 -0
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +27 -27
- package/dist/astro/routes/api/admin/bylines/_id_/translations.d.mts +8 -0
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +57 -0
- package/dist/astro/routes/api/admin/bylines/index.mjs +30 -26
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +11 -11
- package/dist/astro/routes/api/admin/comments/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/bulk.mjs +9 -9
- package/dist/astro/routes/api/admin/comments/counts.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/index.mjs +9 -9
- package/dist/astro/routes/api/admin/context/_id_/history.mjs +23 -23
- package/dist/astro/routes/api/admin/context/_id_/index.mjs +23 -23
- package/dist/astro/routes/api/admin/context/_id_/review.mjs +27 -27
- package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +27 -27
- package/dist/astro/routes/api/admin/context/diff.mjs +26 -26
- package/dist/astro/routes/api/admin/context/index.mjs +27 -27
- package/dist/astro/routes/api/admin/context/stale.mjs +26 -26
- package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +23 -23
- package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +26 -26
- package/dist/astro/routes/api/admin/hitl-requests/index.mjs +26 -26
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +24 -24
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +2 -2
- 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 +48 -44
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +48 -44
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +42 -38
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +47 -43
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +47 -43
- package/dist/astro/routes/api/admin/plugins/index.mjs +42 -38
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +42 -38
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +47 -43
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +42 -38
- package/dist/astro/routes/api/admin/plugins/updates.mjs +42 -38
- package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +5 -5
- package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +26 -26
- package/dist/astro/routes/api/admin/review-requests/index.mjs +9 -9
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +42 -38
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +42 -38
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +5 -5
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +2 -2
- package/dist/astro/routes/api/admin/users/index.mjs +5 -5
- package/dist/astro/routes/api/auth/dev-bypass.mjs +5 -5
- package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
- package/dist/astro/routes/api/auth/invite/complete.mjs +9 -9
- package/dist/astro/routes/api/auth/invite/index.mjs +6 -6
- package/dist/astro/routes/api/auth/invite/register-options.mjs +8 -8
- package/dist/astro/routes/api/auth/logout.mjs +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +8 -8
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/me.mjs +20 -11
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +2 -2
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +5 -5
- package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +10 -10
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +8 -8
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +9 -9
- package/dist/astro/routes/api/auth/passkey/verify.mjs +9 -9
- 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 +9 -9
- package/dist/astro/routes/api/auth/signup/request.mjs +8 -8
- package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +12 -12
- 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 -11
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +9 -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 +9 -9
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +20 -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 +12 -10
- package/dist/astro/routes/api/content/_collection_/index.mjs +9 -9
- package/dist/astro/routes/api/content/_collection_/trash.mjs +6 -6
- package/dist/astro/routes/api/dashboard.mjs +8 -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 +10 -10
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +7 -7
- package/dist/astro/routes/api/import/wordpress/execute.mjs +29 -28
- package/dist/astro/routes/api/import/wordpress/media.mjs +10 -10
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +31 -31
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts +5 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs +16 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +30 -30
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +13 -13
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +31 -30
- package/dist/astro/routes/api/manifest.mjs +4 -4
- package/dist/astro/routes/api/mcp.mjs +75 -50
- package/dist/astro/routes/api/media/_id_/confirm.mjs +8 -8
- package/dist/astro/routes/api/media/_id_.mjs +6 -6
- 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 +10 -10
- package/dist/astro/routes/api/media.mjs +14 -13
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +27 -27
- package/dist/astro/routes/api/menus/_name_/items.mjs +27 -27
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +27 -27
- package/dist/astro/routes/api/menus/_name_/translations.mjs +27 -27
- package/dist/astro/routes/api/menus/_name_.mjs +27 -27
- package/dist/astro/routes/api/menus/index.mjs +27 -27
- 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 +10 -7
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +3 -3
- package/dist/astro/routes/api/redirects/404s/index.mjs +10 -10
- package/dist/astro/routes/api/redirects/404s/summary.mjs +10 -10
- package/dist/astro/routes/api/redirects/_id_.mjs +28 -28
- package/dist/astro/routes/api/redirects/index.mjs +28 -28
- 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 +43 -39
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +43 -39
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +43 -39
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +43 -39
- package/dist/astro/routes/api/schema/collections/index.mjs +43 -39
- package/dist/astro/routes/api/schema/index.mjs +7 -7
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +42 -38
- package/dist/astro/routes/api/schema/orphans/index.mjs +42 -38
- package/dist/astro/routes/api/search/enable.mjs +11 -11
- package/dist/astro/routes/api/search/index.mjs +10 -10
- package/dist/astro/routes/api/search/rebuild.mjs +11 -11
- package/dist/astro/routes/api/search/stats.mjs +7 -7
- package/dist/astro/routes/api/search/suggest.mjs +10 -10
- package/dist/astro/routes/api/sections/_slug_.mjs +27 -27
- package/dist/astro/routes/api/sections/index.mjs +27 -27
- package/dist/astro/routes/api/settings/email.mjs +3 -3
- package/dist/astro/routes/api/settings.mjs +27 -27
- package/dist/astro/routes/api/setup/admin-verify.mjs +11 -11
- package/dist/astro/routes/api/setup/admin.mjs +9 -9
- package/dist/astro/routes/api/setup/dev-bypass.mjs +24 -23
- package/dist/astro/routes/api/setup/dev-reset.mjs +1 -1
- package/dist/astro/routes/api/setup/index.mjs +25 -24
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +7 -6
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +30 -29
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +30 -29
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +30 -29
- package/dist/astro/routes/api/taxonomies/index.mjs +30 -29
- package/dist/astro/routes/api/themes/preview.mjs +4 -4
- package/dist/astro/routes/api/typegen.mjs +4 -4
- package/dist/astro/routes/api/well-known/auth.mjs +2 -2
- 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 +26 -26
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +27 -27
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +27 -27
- package/dist/astro/routes/api/widget-areas/_name_.mjs +25 -25
- package/dist/astro/routes/api/widget-areas/index.mjs +27 -27
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +7 -7
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +59 -15
- package/dist/astro/routes/sitemap.xml.mjs +8 -8
- package/dist/astro/session-driver.d.mts +1 -1
- package/dist/astro/session-driver.mjs +3 -3
- package/dist/astro/types.d.mts +16 -14
- package/dist/{audit-NgiRzqP9.mjs → audit-DuRbTm8L.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-1FHtkDP6.mjs → auth-control-guard-Dr14I98m.mjs} +1 -1
- package/dist/{authorize-BbIhZi3a.mjs → authorize-BLO0m7fW.mjs} +1 -1
- package/dist/{briefing-Jsxs587i.mjs → briefing-BFEWeJtR.mjs} +6 -6
- package/dist/{briefing-DD82WaEy.mjs → briefing-C4fJSVYW.mjs} +1 -1
- package/dist/byline-CXQcMsBu.mjs +628 -0
- package/dist/{bylines-BU6b8jSi.d.mts → byline-fields-CaF_xfpj.d.mts} +146 -15
- package/dist/{import-Br7aP9yh.mjs → byline-fields-D7TJ_oHF.mjs} +57 -3
- package/dist/byline-fields-Dc7L6Yry.mjs +113 -0
- package/dist/byline-registry-CL8BxPPp.mjs +287 -0
- package/dist/bylines-BgriNlW7.mjs +165 -0
- package/dist/bylines-D2vqm1aZ.mjs +163 -0
- package/dist/{cache-DQyZ-QaB.mjs → cache-GRK71jOU.mjs} +2 -2
- package/dist/{chunks-D8KL0nCY.mjs → chunks-DgEw12Bc.mjs} +1 -1
- package/dist/cli/index.mjs +958 -89
- package/dist/client/external-auth-headers.d.mts +1 -1
- package/dist/client/index.d.mts +2 -1
- package/dist/client/index.mjs +5 -2
- package/dist/{comment-BmJXz3lc.mjs → comment-ogMaF1gk.mjs} +1 -1
- package/dist/{comments-yTbeIYc2.mjs → comments-CTSOKrZq.mjs} +1 -1
- package/dist/{connection-BCNICDWN.mjs → connection-CiJWiWya.mjs} +44 -13
- package/dist/{content-DvpMad_N.mjs → content-BfyjOiMi.mjs} +24 -4
- package/dist/content-index-names-Bbu1FY1r.mjs +26 -0
- package/dist/{context-DgqEfcWz.mjs → context-DRhmPCiE.mjs} +2 -2
- package/dist/{context-Ufrm1lOv.mjs → context-ZMHhwzkG.mjs} +8 -8
- package/dist/{context-route-helpers-Dq5U_AXp.mjs → context-route-helpers-YLWx2N1j.mjs} +1 -1
- package/dist/{dashboard-BC9bgPOH.mjs → dashboard-D0gWuzNp.mjs} +4 -4
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +2 -2
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/libsql.mjs +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/db/sqlite.mjs +1 -1
- package/dist/{device-flow-CTS91g4A.mjs → device-flow-BL5ZRlc1.mjs} +4 -4
- package/dist/{dialect-helpers-TkdbkFad.mjs → dialect-helpers-fk43GbDb.mjs} +13 -3
- package/dist/{fts-manager-DnfOsF4s.mjs → fts-manager-EHY2Kes9.mjs} +2 -2
- package/dist/{hitl-requests-DaRuZ7tb.mjs → hitl-requests-B4Hkt0TO.mjs} +2 -2
- package/dist/{hitl-route-helpers-DcPySbZ3.mjs → hitl-route-helpers-CHjdfQ0s.mjs} +4 -4
- package/dist/{import-DSXK3aQF.mjs → import-CvHY6sf5.mjs} +3 -3
- package/dist/{index-BwOO3vu2.d.mts → index-DJVaYiUV.d.mts} +2 -2
- package/dist/index.d.mts +16 -17
- package/dist/index.mjs +69 -65
- package/dist/{jsonld-CLbYsYYH.d.mts → jsonld-AcPnCEGD.d.mts} +2 -2
- package/dist/{load-BCCcmoW9.mjs → load-BdbvtoDb.mjs} +1 -1
- package/dist/{loader-p2imNN98.mjs → loader-Y0QvC_QO.mjs} +167 -61
- package/dist/media/index.d.mts +1 -2
- package/dist/media/index.mjs +2 -2
- package/dist/media/local-runtime.d.mts +11 -12
- package/dist/media/local-runtime.mjs +2 -2
- package/dist/{media-Cg4zc9fq.mjs → media-DhBwiCYR.mjs} +6 -1
- package/dist/{media-allowlist-D8gsm8_t.mjs → media-allowlist-BsXkT9RK.mjs} +1 -1
- package/dist/{menus-DOaL6NaF.mjs → menus-BzGQpw9d.mjs} +2 -2
- package/dist/{menus-DzG3-9tQ.mjs → menus-fqqzXyHd.mjs} +5 -5
- package/dist/{oauth-authorization-DyOFXQWq.mjs → oauth-authorization-Dk3_LOfj.mjs} +4 -4
- package/dist/{oauth-clients-BMs_bmoz.mjs → oauth-clients-CzeMGyUU.mjs} +2 -2
- package/dist/page/index.d.mts +2 -2
- package/dist/page/index.mjs +1 -1
- package/dist/{parse-D7Tu6ku4.mjs → parse-CneSgl7-.mjs} +1 -1
- package/dist/{types-cn-fvYQ1.d.mts → placeholder-CXfoCtCd.d.mts} +38 -1
- package/dist/plugin-utils.d.mts +22 -10
- package/dist/plugin-utils.mjs +8 -10
- package/dist/plugins/adapt-sandbox-entry.d.mts +9 -10
- package/dist/plugins/adapt-sandbox-entry.mjs +1 -1
- package/dist/{plugins-DCDVDF4B.mjs → plugins-BQ5Joz6v.mjs} +36 -6
- package/dist/{preview-BhgxNRWI.mjs → preview-D5rvDhRt.mjs} +7 -7
- package/dist/{provider-loader-B19YyyBp.d.mts → provider-loader-B5PMjpN7.d.mts} +1 -1
- package/dist/{query-BnRpB09I.mjs → query-BJuUydtD.mjs} +3 -3
- package/dist/{query-DHvNhBhi.mjs → query-CSx0EdSW.mjs} +30 -18
- package/dist/{rate-limit-BWP_kKiZ.mjs → rate-limit-i0G3IAOX.mjs} +2 -2
- package/dist/{redirect-BaVvo2te.mjs → redirect-BqFMj67n.mjs} +20 -6
- package/dist/{redirects-Ba-lJA5j.mjs → redirects-CJwHl_YG.mjs} +3 -3
- package/dist/{redirects-x5ol_Qj9.mjs → redirects-q_cToaHv.mjs} +29 -8
- package/dist/{registry-i__XP2WV.mjs → registry-Cq3QRBW2.mjs} +14 -5
- package/dist/{request-cache-BpwuE2ix.mjs → request-cache-w5cj5itT.mjs} +9 -1
- package/dist/{request-meta-DUGfAeXy.mjs → request-meta-DAb6xaP9.mjs} +1 -1
- package/dist/resolve-DTuDyYKs.mjs +100 -0
- package/dist/{review-requests-DuIxM4YM.mjs → review-requests-GYqjl2jO.mjs} +1 -1
- package/dist/{review-requests-CTUU_RJm.mjs → review-requests-tPw8_pAO.mjs} +1 -1
- package/dist/{runner-FhUNNaqA.d.mts → runner-Cnz4dl0f.d.mts} +1 -1
- package/dist/{runner-DF2DgD_B.mjs → runner-DTfG5v0G.mjs} +574 -196
- package/dist/{runtime-1bE80cmL.d.mts → runtime-Cd-kjPfN.d.mts} +1155 -273
- package/dist/runtime.d.mts +10 -11
- package/dist/runtime.mjs +4 -4
- package/dist/schema-DmHMWnSA.mjs +8 -0
- package/dist/{search-Cl9preJT.mjs → search-BAiFLz81.mjs} +3 -3
- package/dist/{sections-Zx-2q9IH.mjs → sections-DsuIrFDC.mjs} +2 -2
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +18 -17
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.mjs +1 -0
- package/dist/{seo-CJBiMDkj.mjs → seo-5lJOtB5J.mjs} +4 -2
- package/dist/{seo-BPb_reaG.mjs → seo-uMFBaR8G.mjs} +1 -1
- package/dist/{service-wPGgmbUa.mjs → service-CifrxCru.mjs} +2 -2
- package/dist/{settings-nr15a8uv.mjs → settings-BYGdocdj.mjs} +2 -2
- package/dist/{settings-DORe02PC.mjs → settings-DNRQuX3d.mjs} +3 -3
- package/dist/{site-activity-KFZprBZM.mjs → site-activity-6x1JccoR.mjs} +1 -1
- package/dist/{site-context-DuBQk6Mp.mjs → site-context-sN12ehZF.mjs} +13 -13
- 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-DGaw_-aU.mjs → taxonomies-CQFmkP5u.mjs} +3 -3
- package/dist/{taxonomies-BVBKoXRf.mjs → taxonomies-faQVeMgj.mjs} +7 -32
- package/dist/{taxonomy-BvXRL85P.mjs → taxonomy-BnH-6VsX.mjs} +2 -2
- package/dist/{types-DvwHUku7.d.mts → types-B7_vSiPD.d.mts} +16 -0
- package/dist/{types-D1DjBFA9.mjs → types-Ck7-WoUD.mjs} +1 -1
- package/dist/{types-t7_nCCA9.d.mts → types-DEAQG87T.d.mts} +2 -56
- package/dist/{types-C-CMfzSl.d.mts → types-DYKtk8f1.d.mts} +31 -0
- package/dist/{types-C3Em8xpG.mjs → types-DbZhHtqS.mjs} +23 -1
- package/dist/{types-BIM7jwxr.d.mts → types-UGmU5sWx.d.mts} +1 -1
- package/dist/types-nP9vGUFq.d.mts +56 -0
- package/dist/ui/server-runtime.d.mts +13 -7
- package/dist/ui/server-runtime.mjs +18 -17
- package/dist/{user-2aI21yV1.mjs → user-CqZwN21P.mjs} +1 -1
- package/dist/{validate-CvQ6cvHH.d.mts → validate-BJuG-ISL.d.mts} +21 -3
- package/dist/{validate-JE-WfUQ5.mjs → validate-CK4a1sIF.mjs} +22 -2
- package/dist/version-Cg6ur4zS.mjs +6 -0
- package/dist/{widgets-Cj6ULpED.mjs → widgets-CdDvF4fV.mjs} +2 -2
- package/dist/{wordpress-slugs-hqItqJrQ.mjs → wordpress-slugs-B6Gw9q3Q.mjs} +1 -1
- package/dist/{zod-generator-C4BgFBZV.mjs → zod-generator-D1ROBNuC.mjs} +2 -2
- package/package.json +7 -8
- package/src/components/InlinePortableTextEditor.tsx +66 -0
- package/src/components/code-block-languages.ts +76 -0
- package/src/components/inline-code-block.tsx +241 -0
- package/dist/byline-DpNNSjET.mjs +0 -219
- package/dist/bylines-75_STR73.mjs +0 -114
- package/dist/chunk-ClPoSABd.mjs +0 -21
- package/dist/db-errors-DHJCB_gY.mjs +0 -23
- package/dist/index-Ct0pjZwW.d.mts +0 -835
- package/dist/placeholder-BZpCpid_.d.mts +0 -40
- package/dist/schema-U-SeFWwn.mjs +0 -8
- package/dist/version-DTpFm69w.mjs +0 -6
- /package/dist/{adapters-kZjS7plb.d.mts → adapters-OQCImOL7.d.mts} +0 -0
- /package/dist/{api-tokens-L0o9Bd7v.mjs → api-tokens-CYUoFGo7.mjs} +0 -0
- /package/dist/{challenge-store-cJam-E5R.mjs → challenge-store-CRSz-Xim.mjs} +0 -0
- /package/dist/{components-BJfa-F6n.mjs → components--pg6zBvu.mjs} +0 -0
- /package/dist/{config-XW5tMrH8.mjs → config-CVssduLe.mjs} +0 -0
- /package/dist/{context-types-BrSQNye5.mjs → context-types-DQh_XKkn.mjs} +0 -0
- /package/dist/{cron-D7FDsRu-.mjs → cron-DxCAU_Sn.mjs} +0 -0
- /package/dist/{default-5A3XVR7L.mjs → default-BHauvIdG.mjs} +0 -0
- /package/dist/{email-console-Bs1qKx59.mjs → email-console-BOVqIYpB.mjs} +0 -0
- /package/dist/{error-DLkgOP5m.mjs → error-DCSuUAZW.mjs} +0 -0
- /package/dist/{escape-r8_GbEU2.mjs → escape-BDgouFFY.mjs} +0 -0
- /package/dist/{experimental-workflows-BbZbIEZp.mjs → experimental-workflows-Dh4DUoD_.mjs} +0 -0
- /package/dist/{hash-DFFrkivP.mjs → hash-BPmX6P8I.mjs} +0 -0
- /package/dist/{manifest-schema-C6fzQoWn.mjs → manifest-schema-qh2P7RDX.mjs} +0 -0
- /package/dist/{mime-DYP4V5Ks.mjs → mime-8pAB8-77.mjs} +0 -0
- /package/dist/{mode-Bd55iLcP.mjs → mode-CpyEz8pe.mjs} +0 -0
- /package/dist/{normalize-BY_EJnd9.mjs → normalize-O-hi3a27.mjs} +0 -0
- /package/dist/{oauth-state-store-BRSUEkmx.mjs → oauth-state-store-qncPB_IU.mjs} +0 -0
- /package/dist/{oauth-user-lookup-DdcI8ZVL.mjs → oauth-user-lookup-BFjWF8wK.mjs} +0 -0
- /package/dist/{parser-egIGEco-.mjs → parser-DxfsARXL.mjs} +0 -0
- /package/dist/{passkey-config-AX4sjpQ4.mjs → passkey-config-DzHQK90v.mjs} +0 -0
- /package/dist/{patterns-CiyXeDgr.mjs → patterns-D9iDO3j8.mjs} +0 -0
- /package/dist/{placeholder-b0Ufu0La.mjs → placeholder-BDo81Is5.mjs} +0 -0
- /package/dist/{provider-loader-BdRV01gr.mjs → provider-loader-DzUxejk7.mjs} +0 -0
- /package/dist/{public-url-BL2r8dmQ.mjs → public-url-DLUM5OOv.mjs} +0 -0
- /package/dist/{redirect-Ce_6Yb6z.mjs → redirect-BjIBtDWY.mjs} +0 -0
- /package/dist/{secrets-DfeNNoLa.mjs → secrets-CN6FCpcB.mjs} +0 -0
- /package/dist/{seo-contributions-C0LXoWw3.mjs → seo-contributions-CqVvReEj.mjs} +0 -0
- /package/dist/{setup-complete-C2ztsNhJ.mjs → setup-complete-BytMc6HO.mjs} +0 -0
- /package/dist/{setup-nonce-BTKq7uBi.mjs → setup-nonce-pyGfc9hV.mjs} +0 -0
- /package/dist/{sidecar-client-lrf7ErYJ.mjs → sidecar-client-mJxwayYN.mjs} +0 -0
- /package/dist/{site-url-C18yBhtv.mjs → site-url-C-cu8Ff2.mjs} +0 -0
- /package/dist/{ssrf-KAIQS48_.mjs → ssrf-DiKqWd3N.mjs} +0 -0
- /package/dist/{tokens-CsP8Se8S.mjs → tokens-CjSgb0AC.mjs} +0 -0
- /package/dist/{transport-nNEGdHkI.d.mts → transport-DidKKxvW.d.mts} +0 -0
- /package/dist/{transport-B7kO-4ee.mjs → transport-LSdZVXHF.mjs} +0 -0
- /package/dist/{trusted-proxy-Bbm6PLR6.mjs → trusted-proxy-BgIIcbsN.mjs} +0 -0
- /package/dist/{types-CNNQ8l0v.mjs → types-Cg276-3z.mjs} +0 -0
- /package/dist/{types-BYjPylrZ.d.mts → types-DZpT-PnG.d.mts} +0 -0
- /package/dist/{types-BgE6gMFI.d.mts → types-Dryvv7LH.d.mts} +0 -0
- /package/dist/{types-BBETcziA.d.mts → types-GaCtZ1k9.d.mts} +0 -0
- /package/dist/{url-BzhfYtRn.mjs → url-w7Mp5qAD.mjs} +0 -0
- /package/dist/{utils-FEbQMgB5.mjs → utils-wv-zvC-Y.mjs} +0 -0
package/dist/byline-DpNNSjET.mjs
DELETED
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import { t as validateIdentifier } from "./validate-VPnKoIzW.mjs";
|
|
2
|
-
import { c as listTablesLike } from "./dialect-helpers-TkdbkFad.mjs";
|
|
3
|
-
import { n as decodeCursor, r as encodeCursor } from "./types-D1DjBFA9.mjs";
|
|
4
|
-
import { t as withTransaction } from "./transaction-D0FOsb3X.mjs";
|
|
5
|
-
import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-D8KL0nCY.mjs";
|
|
6
|
-
import { sql } from "kysely";
|
|
7
|
-
import { ulid } from "ulidx";
|
|
8
|
-
|
|
9
|
-
//#region src/database/repositories/byline.ts
|
|
10
|
-
function rowToByline(row) {
|
|
11
|
-
return {
|
|
12
|
-
id: row.id,
|
|
13
|
-
slug: row.slug,
|
|
14
|
-
displayName: row.display_name,
|
|
15
|
-
bio: row.bio,
|
|
16
|
-
avatarMediaId: row.avatar_media_id,
|
|
17
|
-
websiteUrl: row.website_url,
|
|
18
|
-
userId: row.user_id,
|
|
19
|
-
isGuest: row.is_guest === 1,
|
|
20
|
-
createdAt: row.created_at,
|
|
21
|
-
updatedAt: row.updated_at
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
var BylineRepository = class {
|
|
25
|
-
constructor(db) {
|
|
26
|
-
this.db = db;
|
|
27
|
-
}
|
|
28
|
-
async findById(id) {
|
|
29
|
-
const row = await this.db.selectFrom("_dineway_bylines").selectAll().where("id", "=", id).executeTakeFirst();
|
|
30
|
-
return row ? rowToByline(row) : null;
|
|
31
|
-
}
|
|
32
|
-
async findBySlug(slug) {
|
|
33
|
-
const row = await this.db.selectFrom("_dineway_bylines").selectAll().where("slug", "=", slug).executeTakeFirst();
|
|
34
|
-
return row ? rowToByline(row) : null;
|
|
35
|
-
}
|
|
36
|
-
async findByUserId(userId) {
|
|
37
|
-
const row = await this.db.selectFrom("_dineway_bylines").selectAll().where("user_id", "=", userId).executeTakeFirst();
|
|
38
|
-
return row ? rowToByline(row) : null;
|
|
39
|
-
}
|
|
40
|
-
async findMany(options) {
|
|
41
|
-
const limit = Math.min(Math.max(options?.limit ?? 50, 1), 100);
|
|
42
|
-
let query = this.db.selectFrom("_dineway_bylines").selectAll().orderBy("created_at", "desc").orderBy("id", "desc").limit(limit + 1);
|
|
43
|
-
if (options?.search) {
|
|
44
|
-
const term = `%${options.search.replaceAll("\\", "\\\\").replaceAll("%", "\\%").replaceAll("_", "\\_")}%`;
|
|
45
|
-
query = query.where((eb) => eb.or([eb("display_name", "like", term), eb("slug", "like", term)]));
|
|
46
|
-
}
|
|
47
|
-
if (options?.isGuest !== void 0) query = query.where("is_guest", "=", options.isGuest ? 1 : 0);
|
|
48
|
-
if (options?.userId !== void 0) query = query.where("user_id", "=", options.userId);
|
|
49
|
-
if (options?.cursor) {
|
|
50
|
-
const decoded = decodeCursor(options.cursor);
|
|
51
|
-
if (decoded) query = query.where((eb) => eb.or([eb("created_at", "<", decoded.orderValue), eb.and([eb("created_at", "=", decoded.orderValue), eb("id", "<", decoded.id)])]));
|
|
52
|
-
}
|
|
53
|
-
const rows = await query.execute();
|
|
54
|
-
const items = rows.slice(0, limit).map(rowToByline);
|
|
55
|
-
const result = { items };
|
|
56
|
-
if (rows.length > limit) {
|
|
57
|
-
const last = items.at(-1);
|
|
58
|
-
if (last) result.nextCursor = encodeCursor(last.createdAt, last.id);
|
|
59
|
-
}
|
|
60
|
-
return result;
|
|
61
|
-
}
|
|
62
|
-
async create(input) {
|
|
63
|
-
const id = ulid();
|
|
64
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
65
|
-
await this.db.insertInto("_dineway_bylines").values({
|
|
66
|
-
id,
|
|
67
|
-
slug: input.slug,
|
|
68
|
-
display_name: input.displayName,
|
|
69
|
-
bio: input.bio ?? null,
|
|
70
|
-
avatar_media_id: input.avatarMediaId ?? null,
|
|
71
|
-
website_url: input.websiteUrl ?? null,
|
|
72
|
-
user_id: input.userId ?? null,
|
|
73
|
-
is_guest: input.isGuest ? 1 : 0,
|
|
74
|
-
created_at: now,
|
|
75
|
-
updated_at: now
|
|
76
|
-
}).execute();
|
|
77
|
-
const byline = await this.findById(id);
|
|
78
|
-
if (!byline) throw new Error("Failed to create byline");
|
|
79
|
-
return byline;
|
|
80
|
-
}
|
|
81
|
-
async update(id, input) {
|
|
82
|
-
if (!await this.findById(id)) return null;
|
|
83
|
-
const updates = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
84
|
-
if (input.slug !== void 0) updates.slug = input.slug;
|
|
85
|
-
if (input.displayName !== void 0) updates.display_name = input.displayName;
|
|
86
|
-
if (input.bio !== void 0) updates.bio = input.bio;
|
|
87
|
-
if (input.avatarMediaId !== void 0) updates.avatar_media_id = input.avatarMediaId;
|
|
88
|
-
if (input.websiteUrl !== void 0) updates.website_url = input.websiteUrl;
|
|
89
|
-
if (input.userId !== void 0) updates.user_id = input.userId;
|
|
90
|
-
if (input.isGuest !== void 0) updates.is_guest = input.isGuest ? 1 : 0;
|
|
91
|
-
await this.db.updateTable("_dineway_bylines").set(updates).where("id", "=", id).execute();
|
|
92
|
-
return await this.findById(id);
|
|
93
|
-
}
|
|
94
|
-
async delete(id) {
|
|
95
|
-
if (!await this.findById(id)) return false;
|
|
96
|
-
await withTransaction(this.db, async (trx) => {
|
|
97
|
-
await trx.deleteFrom("_dineway_content_bylines").where("byline_id", "=", id).execute();
|
|
98
|
-
await trx.deleteFrom("_dineway_bylines").where("id", "=", id).execute();
|
|
99
|
-
const tableNames = await listTablesLike(trx, "ec_%");
|
|
100
|
-
for (const tableName of tableNames) {
|
|
101
|
-
validateIdentifier(tableName, "content table");
|
|
102
|
-
await sql`
|
|
103
|
-
UPDATE ${sql.ref(tableName)}
|
|
104
|
-
SET primary_byline_id = NULL
|
|
105
|
-
WHERE primary_byline_id = ${id}
|
|
106
|
-
`.execute(trx);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
return true;
|
|
110
|
-
}
|
|
111
|
-
async getContentBylines(collectionSlug, contentId) {
|
|
112
|
-
return (await this.db.selectFrom("_dineway_content_bylines as cb").innerJoin("_dineway_bylines as b", "b.id", "cb.byline_id").select([
|
|
113
|
-
"cb.sort_order as sort_order",
|
|
114
|
-
"cb.role_label as role_label",
|
|
115
|
-
"b.id as id",
|
|
116
|
-
"b.slug as slug",
|
|
117
|
-
"b.display_name as display_name",
|
|
118
|
-
"b.bio as bio",
|
|
119
|
-
"b.avatar_media_id as avatar_media_id",
|
|
120
|
-
"b.website_url as website_url",
|
|
121
|
-
"b.user_id as user_id",
|
|
122
|
-
"b.is_guest as is_guest",
|
|
123
|
-
"b.created_at as created_at",
|
|
124
|
-
"b.updated_at as updated_at"
|
|
125
|
-
]).where("cb.collection_slug", "=", collectionSlug).where("cb.content_id", "=", contentId).orderBy("cb.sort_order", "asc").execute()).map((row) => ({
|
|
126
|
-
byline: rowToByline(row),
|
|
127
|
-
sortOrder: row.sort_order,
|
|
128
|
-
roleLabel: row.role_label
|
|
129
|
-
}));
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Batch-fetch byline credits for multiple content items in a single query.
|
|
133
|
-
* Returns a Map keyed by contentId.
|
|
134
|
-
*/
|
|
135
|
-
async getContentBylinesMany(collectionSlug, contentIds) {
|
|
136
|
-
const result = /* @__PURE__ */ new Map();
|
|
137
|
-
if (contentIds.length === 0) return result;
|
|
138
|
-
const uniqueContentIds = [...new Set(contentIds)];
|
|
139
|
-
for (const chunk of chunks(uniqueContentIds, SQL_BATCH_SIZE)) {
|
|
140
|
-
const rows = await this.db.selectFrom("_dineway_content_bylines as cb").innerJoin("_dineway_bylines as b", "b.id", "cb.byline_id").select([
|
|
141
|
-
"cb.content_id as content_id",
|
|
142
|
-
"cb.sort_order as sort_order",
|
|
143
|
-
"cb.role_label as role_label",
|
|
144
|
-
"b.id as id",
|
|
145
|
-
"b.slug as slug",
|
|
146
|
-
"b.display_name as display_name",
|
|
147
|
-
"b.bio as bio",
|
|
148
|
-
"b.avatar_media_id as avatar_media_id",
|
|
149
|
-
"b.website_url as website_url",
|
|
150
|
-
"b.user_id as user_id",
|
|
151
|
-
"b.is_guest as is_guest",
|
|
152
|
-
"b.created_at as created_at",
|
|
153
|
-
"b.updated_at as updated_at"
|
|
154
|
-
]).where("cb.collection_slug", "=", collectionSlug).where("cb.content_id", "in", chunk).orderBy("cb.sort_order", "asc").execute();
|
|
155
|
-
for (const row of rows) {
|
|
156
|
-
const contentId = row.content_id;
|
|
157
|
-
const credit = {
|
|
158
|
-
byline: rowToByline(row),
|
|
159
|
-
sortOrder: row.sort_order,
|
|
160
|
-
roleLabel: row.role_label
|
|
161
|
-
};
|
|
162
|
-
const existing = result.get(contentId);
|
|
163
|
-
if (existing) existing.push(credit);
|
|
164
|
-
else result.set(contentId, [credit]);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
return result;
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Batch-fetch byline profiles linked to user IDs in a single query.
|
|
171
|
-
* Returns a Map keyed by userId.
|
|
172
|
-
*/
|
|
173
|
-
async findByUserIds(userIds) {
|
|
174
|
-
const result = /* @__PURE__ */ new Map();
|
|
175
|
-
if (userIds.length === 0) return result;
|
|
176
|
-
for (const chunk of chunks(userIds, SQL_BATCH_SIZE)) {
|
|
177
|
-
const rows = await this.db.selectFrom("_dineway_bylines").selectAll().where("user_id", "in", chunk).execute();
|
|
178
|
-
for (const row of rows) if (row.user_id) result.set(row.user_id, rowToByline(row));
|
|
179
|
-
}
|
|
180
|
-
return result;
|
|
181
|
-
}
|
|
182
|
-
async setContentBylines(collectionSlug, contentId, inputBylines) {
|
|
183
|
-
validateIdentifier(collectionSlug, "collection slug");
|
|
184
|
-
const tableName = `ec_${collectionSlug}`;
|
|
185
|
-
validateIdentifier(tableName, "content table");
|
|
186
|
-
const seen = /* @__PURE__ */ new Set();
|
|
187
|
-
const bylines = inputBylines.filter((item) => {
|
|
188
|
-
if (seen.has(item.bylineId)) return false;
|
|
189
|
-
seen.add(item.bylineId);
|
|
190
|
-
return true;
|
|
191
|
-
});
|
|
192
|
-
if (bylines.length > 0) {
|
|
193
|
-
const ids = bylines.map((item) => item.bylineId);
|
|
194
|
-
if ((await this.db.selectFrom("_dineway_bylines").select("id").where("id", "in", ids).execute()).length !== ids.length) throw new Error("One or more byline IDs do not exist");
|
|
195
|
-
}
|
|
196
|
-
await this.db.deleteFrom("_dineway_content_bylines").where("collection_slug", "=", collectionSlug).where("content_id", "=", contentId).execute();
|
|
197
|
-
for (let i = 0; i < bylines.length; i++) {
|
|
198
|
-
const item = bylines[i];
|
|
199
|
-
await this.db.insertInto("_dineway_content_bylines").values({
|
|
200
|
-
id: ulid(),
|
|
201
|
-
collection_slug: collectionSlug,
|
|
202
|
-
content_id: contentId,
|
|
203
|
-
byline_id: item.bylineId,
|
|
204
|
-
sort_order: i,
|
|
205
|
-
role_label: item.roleLabel ?? null,
|
|
206
|
-
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
207
|
-
}).execute();
|
|
208
|
-
}
|
|
209
|
-
await sql`
|
|
210
|
-
UPDATE ${sql.ref(tableName)}
|
|
211
|
-
SET primary_byline_id = ${bylines[0]?.bylineId ?? null}
|
|
212
|
-
WHERE id = ${contentId}
|
|
213
|
-
`.execute(this.db);
|
|
214
|
-
return await this.getContentBylines(collectionSlug, contentId);
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
//#endregion
|
|
219
|
-
export { BylineRepository as t };
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./chunk-ClPoSABd.mjs";
|
|
2
|
-
import { t as validateIdentifier } from "./validate-VPnKoIzW.mjs";
|
|
3
|
-
import { t as BylineRepository } from "./byline-DpNNSjET.mjs";
|
|
4
|
-
import { r as getDb } from "./loader-p2imNN98.mjs";
|
|
5
|
-
import { t as isMissingTableError } from "./db-errors-DHJCB_gY.mjs";
|
|
6
|
-
import { sql } from "kysely";
|
|
7
|
-
|
|
8
|
-
//#region src/bylines/index.ts
|
|
9
|
-
var bylines_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
-
getByline: () => getByline,
|
|
11
|
-
getBylineBySlug: () => getBylineBySlug,
|
|
12
|
-
getBylinesForEntries: () => getBylinesForEntries,
|
|
13
|
-
invalidateBylineCache: () => invalidateBylineCache
|
|
14
|
-
});
|
|
15
|
-
function invalidateBylineCache() {}
|
|
16
|
-
/**
|
|
17
|
-
* Get a byline by ID.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```ts
|
|
21
|
-
* import { getByline } from "dineway";
|
|
22
|
-
*
|
|
23
|
-
* const byline = await getByline("01HXYZ...");
|
|
24
|
-
* if (byline) {
|
|
25
|
-
* console.log(byline.displayName);
|
|
26
|
-
* }
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
async function getByline(id) {
|
|
30
|
-
return new BylineRepository(await getDb()).findById(id);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Get a byline by slug.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```ts
|
|
37
|
-
* import { getBylineBySlug } from "dineway";
|
|
38
|
-
*
|
|
39
|
-
* const byline = await getBylineBySlug("jane-doe");
|
|
40
|
-
* if (byline) {
|
|
41
|
-
* console.log(byline.displayName); // "Jane Doe"
|
|
42
|
-
* }
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
async function getBylineBySlug(slug) {
|
|
46
|
-
return new BylineRepository(await getDb()).findBySlug(slug);
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Batch-fetch byline credits for multiple content entries in a single query.
|
|
50
|
-
*
|
|
51
|
-
* This is more efficient than calling getEntryBylines for each entry
|
|
52
|
-
* when you need bylines for a list of entries (e.g., a blog index page).
|
|
53
|
-
*
|
|
54
|
-
* @param collection - The collection slug (e.g., "posts")
|
|
55
|
-
* @param entries - Entry id + authorId pairs; authorId is already on the row
|
|
56
|
-
* @returns Map from entry ID to array of byline credits
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```ts
|
|
60
|
-
* import { getBylinesForEntries, getDinewayCollection } from "dineway";
|
|
61
|
-
*
|
|
62
|
-
* const { entries } = await getDinewayCollection("posts");
|
|
63
|
-
* const refs = entries.map((e) => ({ id: e.data.id, authorId: e.data.authorId ?? null }));
|
|
64
|
-
* const bylinesMap = await getBylinesForEntries("posts", refs);
|
|
65
|
-
*
|
|
66
|
-
* for (const entry of entries) {
|
|
67
|
-
* const bylines = bylinesMap.get(entry.data.id) ?? [];
|
|
68
|
-
* // render bylines
|
|
69
|
-
* }
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
|
-
async function getBylinesForEntries(collection, entries) {
|
|
73
|
-
validateIdentifier(collection, "collection");
|
|
74
|
-
const result = /* @__PURE__ */ new Map();
|
|
75
|
-
for (const { id } of entries) result.set(id, []);
|
|
76
|
-
if (entries.length === 0) return result;
|
|
77
|
-
const repo = new BylineRepository(await getDb());
|
|
78
|
-
const entryIds = entries.map((entry) => entry.id);
|
|
79
|
-
let bylinesMap;
|
|
80
|
-
try {
|
|
81
|
-
bylinesMap = await repo.getContentBylinesMany(collection, entryIds);
|
|
82
|
-
} catch (error) {
|
|
83
|
-
if (isMissingTableError(error)) return result;
|
|
84
|
-
throw error;
|
|
85
|
-
}
|
|
86
|
-
const needsFallback = /* @__PURE__ */ new Map();
|
|
87
|
-
for (const { id, authorId } of entries) if (!bylinesMap.has(id) && authorId) needsFallback.set(id, authorId);
|
|
88
|
-
const uniqueAuthorIds = [...new Set(needsFallback.values())];
|
|
89
|
-
const authorBylineMap = await repo.findByUserIds(uniqueAuthorIds);
|
|
90
|
-
for (const { id } of entries) {
|
|
91
|
-
const explicit = bylinesMap.get(id);
|
|
92
|
-
if (explicit && explicit.length > 0) {
|
|
93
|
-
result.set(id, explicit.map((c) => ({
|
|
94
|
-
...c,
|
|
95
|
-
source: "explicit"
|
|
96
|
-
})));
|
|
97
|
-
continue;
|
|
98
|
-
}
|
|
99
|
-
const authorId = needsFallback.get(id);
|
|
100
|
-
if (authorId) {
|
|
101
|
-
const fallback = authorBylineMap.get(authorId);
|
|
102
|
-
if (fallback) result.set(id, [{
|
|
103
|
-
byline: fallback,
|
|
104
|
-
sortOrder: 0,
|
|
105
|
-
roleLabel: null,
|
|
106
|
-
source: "inferred"
|
|
107
|
-
}]);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return result;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
//#endregion
|
|
114
|
-
export { invalidateBylineCache as i, getByline as n, getBylineBySlug as r, bylines_exports as t };
|
package/dist/chunk-ClPoSABd.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
|
|
3
|
-
//#region \0rolldown/runtime.js
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __exportAll = (all, no_symbols) => {
|
|
6
|
-
let target = {};
|
|
7
|
-
for (var name in all) {
|
|
8
|
-
__defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: true
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
if (!no_symbols) {
|
|
14
|
-
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
15
|
-
}
|
|
16
|
-
return target;
|
|
17
|
-
};
|
|
18
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
|
-
export { __require as n, __exportAll as t };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//#region src/utils/db-errors.ts
|
|
2
|
-
/**
|
|
3
|
-
* Shared detection helpers for database-layer error messages.
|
|
4
|
-
*
|
|
5
|
-
* Different SQL dialects phrase "table or relation does not exist" differently.
|
|
6
|
-
* Runtime code that treats pre-migration databases as empty should use this
|
|
7
|
-
* helper rather than duplicating string checks per call-site.
|
|
8
|
-
*/
|
|
9
|
-
function messageOf(error) {
|
|
10
|
-
if (error instanceof Error) return error.message.toLowerCase();
|
|
11
|
-
if (typeof error === "string") return error.toLowerCase();
|
|
12
|
-
return "";
|
|
13
|
-
}
|
|
14
|
-
function isMissingTableError(error) {
|
|
15
|
-
const message = messageOf(error);
|
|
16
|
-
if (!message) return false;
|
|
17
|
-
if (message.includes("no such table")) return true;
|
|
18
|
-
if (message.includes("does not exist") || message.includes("doesn't exist")) return message.includes("relation") || message.includes("table");
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
export { isMissingTableError as t };
|