dineway 0.1.49 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity-DUaz_w7p.mjs +79 -0
- package/dist/{activity-events-CwM7yxPW.mjs → activity-events-CJDvE2uc.mjs} +5 -113
- package/dist/actor-0QJ1Gbtf.mjs +37 -0
- package/dist/after-BfniwgIf.mjs +9 -0
- package/dist/{allowed-origins-CyGnbgBd.mjs → allowed-origins--OwHHiY8.mjs} +1 -1
- package/dist/api/route-utils.d.mts +9 -10
- package/dist/api/route-utils.mjs +16 -13
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +5 -4
- package/dist/{api-BMIxRIEN.mjs → api-B4PHIF4V.mjs} +93 -41
- package/dist/{api-tokens-DtvdtIkm.mjs → api-tokens-tbK_sORH.mjs} +6 -2
- package/dist/{apply-D_RlTYtC.mjs → apply-DjTqq6Ae.mjs} +117 -77
- package/dist/astro/image-endpoint.d.mts +7 -0
- package/dist/astro/image-endpoint.mjs +54 -0
- package/dist/astro/index.d.mts +34 -11
- package/dist/astro/index.mjs +163 -24
- package/dist/astro/integration/shims/use-sync-external-store-with-selector.js +71 -0
- package/dist/astro/integration/shims/use-sync-external-store.js +1 -0
- package/dist/astro/middleware/auth.d.mts +8 -18
- package/dist/astro/middleware/auth.mjs +42 -24
- package/dist/astro/middleware/redirect.mjs +13 -4
- package/dist/astro/middleware/request-context.mjs +8 -5
- package/dist/astro/middleware/seed.d.mts +1 -1
- package/dist/astro/middleware/seed.mjs +2 -2
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.mjs +389 -206
- package/dist/astro/routes/admin.astro +6 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -6
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -6
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
- package/dist/astro/routes/api/admin/briefing.mjs +21 -17
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +9 -8
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +9 -8
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +9 -8
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +17 -14
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +17 -14
- package/dist/astro/routes/api/admin/bylines/index.mjs +17 -14
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +14 -12
- package/dist/astro/routes/api/admin/comments/_id_.mjs +6 -5
- package/dist/astro/routes/api/admin/comments/bulk.mjs +11 -9
- package/dist/astro/routes/api/admin/comments/counts.mjs +6 -5
- package/dist/astro/routes/api/admin/comments/index.mjs +11 -9
- package/dist/astro/routes/api/admin/context/_id_/history.mjs +27 -24
- package/dist/astro/routes/api/admin/context/_id_/index.mjs +27 -24
- package/dist/astro/routes/api/admin/context/_id_/review.mjs +32 -28
- package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +32 -28
- package/dist/astro/routes/api/admin/context/diff.mjs +31 -27
- package/dist/astro/routes/api/admin/context/index.mjs +32 -28
- package/dist/astro/routes/api/admin/context/stale.mjs +31 -27
- package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +27 -24
- package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +31 -27
- package/dist/astro/routes/api/admin/hitl-requests/index.mjs +31 -27
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +28 -25
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +6 -6
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +6 -6
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +56 -51
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +56 -51
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +47 -43
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +54 -49
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +53 -48
- package/dist/astro/routes/api/admin/plugins/index.mjs +47 -43
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +46 -42
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +53 -48
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +46 -42
- package/dist/astro/routes/api/admin/plugins/updates.mjs +46 -42
- package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +5 -5
- package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +32 -63
- package/dist/astro/routes/api/admin/review-requests/index.d.mts +2 -1
- package/dist/astro/routes/api/admin/review-requests/index.mjs +58 -10
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +46 -42
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +46 -42
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +8 -7
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +4 -4
- package/dist/astro/routes/api/admin/users/index.mjs +7 -6
- package/dist/astro/routes/api/auth/dev-bypass.mjs +4 -4
- package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
- package/dist/astro/routes/api/auth/invite/complete.mjs +12 -11
- package/dist/astro/routes/api/auth/invite/index.mjs +9 -8
- package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -10
- package/dist/astro/routes/api/auth/logout.mjs +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +11 -10
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
- package/dist/astro/routes/api/auth/me.mjs +9 -8
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +6 -5
- package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +12 -11
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +10 -9
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +11 -10
- package/dist/astro/routes/api/auth/passkey/verify.mjs +11 -10
- package/dist/astro/routes/api/auth/setup-token/index.mjs +5 -5
- package/dist/astro/routes/api/auth/setup-token/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/signup/complete.mjs +12 -11
- package/dist/astro/routes/api/auth/signup/request.mjs +11 -10
- package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +15 -13
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts +8 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +160 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +49 -20
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +67 -32
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +16 -14
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +11 -9
- package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/index.mjs +11 -9
- package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -6
- package/dist/astro/routes/api/dashboard.mjs +9 -8
- package/dist/astro/routes/api/dev/emails.mjs +2 -2
- package/dist/astro/routes/api/health.mjs +1 -1
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +22 -10
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +9 -6
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +18 -1
- package/dist/astro/routes/api/import/wordpress/execute.mjs +85 -37
- package/dist/astro/routes/api/import/wordpress/media.d.mts +12 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +20 -14
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +36 -32
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +17 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +121 -100
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +24 -12
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +55 -2
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +284 -55
- package/dist/astro/routes/api/manifest.mjs +14 -5
- package/dist/astro/routes/api/mcp.mjs +753 -170
- package/dist/astro/routes/api/media/_id_/confirm.mjs +38 -10
- package/dist/astro/routes/api/media/_id_.mjs +11 -7
- package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
- package/dist/astro/routes/api/media/providers/index.mjs +2 -2
- package/dist/astro/routes/api/media/upload-url.mjs +11 -10
- package/dist/astro/routes/api/media.mjs +28 -35
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +32 -28
- package/dist/astro/routes/api/menus/_name_/items.mjs +32 -28
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +32 -28
- package/dist/astro/routes/api/menus/_name_/translations.mjs +32 -28
- package/dist/astro/routes/api/menus/_name_.mjs +32 -28
- package/dist/astro/routes/api/menus/index.mjs +32 -28
- package/dist/astro/routes/api/oauth/authorize.mjs +7 -7
- package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
- package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
- package/dist/astro/routes/api/oauth/register.mjs +4 -4
- package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
- package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
- package/dist/astro/routes/api/oauth/token.mjs +6 -6
- package/dist/astro/routes/api/openapi.json.mjs +4 -3
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +46 -31
- package/dist/astro/routes/api/redirects/404s/index.mjs +11 -10
- package/dist/astro/routes/api/redirects/404s/summary.mjs +11 -10
- package/dist/astro/routes/api/redirects/_id_.mjs +33 -29
- package/dist/astro/routes/api/redirects/index.mjs +33 -29
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +2 -2
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +48 -43
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +48 -43
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +48 -43
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +48 -43
- package/dist/astro/routes/api/schema/collections/index.mjs +48 -43
- package/dist/astro/routes/api/schema/index.mjs +14 -15
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +46 -42
- package/dist/astro/routes/api/schema/orphans/index.mjs +46 -42
- package/dist/astro/routes/api/search/enable.mjs +11 -10
- package/dist/astro/routes/api/search/index.mjs +10 -9
- package/dist/astro/routes/api/search/rebuild.mjs +11 -10
- package/dist/astro/routes/api/search/stats.mjs +6 -6
- package/dist/astro/routes/api/search/suggest.mjs +10 -9
- package/dist/astro/routes/api/sections/_slug_.mjs +32 -28
- package/dist/astro/routes/api/sections/index.mjs +32 -28
- package/dist/astro/routes/api/settings/email.mjs +4 -4
- package/dist/astro/routes/api/settings.mjs +32 -28
- package/dist/astro/routes/api/setup/admin-verify.mjs +14 -13
- package/dist/astro/routes/api/setup/admin.mjs +12 -11
- package/dist/astro/routes/api/setup/dev-bypass.mjs +31 -25
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
- package/dist/astro/routes/api/setup/index.mjs +29 -25
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +8 -7
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +35 -31
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +35 -31
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +35 -31
- package/dist/astro/routes/api/taxonomies/index.mjs +35 -31
- package/dist/astro/routes/api/themes/preview.mjs +5 -5
- package/dist/astro/routes/api/typegen.mjs +4 -4
- package/dist/astro/routes/api/well-known/auth.mjs +3 -3
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +3 -3
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +3 -3
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +31 -27
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +32 -28
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +32 -28
- package/dist/astro/routes/api/widget-areas/_name_.mjs +29 -26
- package/dist/astro/routes/api/widget-areas/index.mjs +32 -28
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +8 -7
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +23 -14
- package/dist/astro/routes/sitemap.xml.mjs +9 -8
- package/dist/astro/session-driver.d.mts +1 -1
- package/dist/astro/session-driver.mjs +2 -2
- package/dist/astro/types.d.mts +22 -13
- package/dist/{audit-BeNsSyfU.mjs → audit-B2pRxZ20.mjs} +1 -1
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{auth-control-guard-Dr14I98m.mjs → auth-control-guard-D71jourk.mjs} +1 -1
- package/dist/{authorize-BLO0m7fW.mjs → authorize-ZXPGPwKn.mjs} +1 -1
- package/dist/{briefing-CkTee1ex.mjs → briefing-0rf-su3-.mjs} +90 -28
- package/dist/{briefing-DJX6irto.mjs → briefing-kRhegBoF.mjs} +2 -1
- package/dist/bundle-CEcdUa1s.mjs +602 -0
- package/dist/{byline-BVC1lV6G.mjs → byline-7xR185Ly.mjs} +30 -62
- package/dist/{byline-fields-Cj39WhXC.mjs → byline-fields-BKzA0fJU.mjs} +1 -1
- package/dist/{byline-fields-uJlygdzM.d.mts → byline-fields-Ckeqd1OY.d.mts} +88 -35
- package/dist/{byline-fields-cNrLJVRs.mjs → byline-fields-WN7RQT4q.mjs} +10 -4
- package/dist/{byline-registry-4v6tXMNX.mjs → byline-registry-Ba54M74c.mjs} +2 -2
- package/dist/{bylines-LN9XISRo.mjs → bylines-C-EL6dh3.mjs} +9 -3
- package/dist/{bylines-DwokOFj6.mjs → bylines-CmZFCMr0.mjs} +5 -5
- package/dist/{cache-Bac05gBd.mjs → cache-DkVCKGio.mjs} +2 -2
- package/dist/{chunks-CuUt7K50.mjs → chunks-ChGNDY8r.mjs} +1 -1
- package/dist/cli/index.d.mts +29 -1
- package/dist/cli/index.mjs +1466 -1763
- package/dist/cli/plugin-kit.d.mts +75 -0
- package/dist/cli/plugin-kit.mjs +4 -0
- package/dist/client/external-auth-headers.d.mts +1 -1
- package/dist/client/index.d.mts +27 -52
- package/dist/client/index.mjs +34 -6
- package/dist/client-factory-BDD9azPJ.mjs +233 -0
- package/dist/{comment-Beue8-15.mjs → comment-DFALgsJD.mjs} +13 -3
- package/dist/comment-reaction-C37bf99u.mjs +58 -0
- package/dist/{comments-DcjFIfqX.mjs → comments-B3NwDBxl.mjs} +1 -1
- package/dist/{content-CBxYGWfL.mjs → content-DJcAYFhz.mjs} +51 -34
- package/dist/content-refresh-B4ZCmxgd.mjs +1576 -0
- package/dist/{context-Df1xVYyr.mjs → context-DnpXcp6Y.mjs} +2 -2
- package/dist/{context-CQVNZaR8.mjs → context-fSCYLL3c.mjs} +125 -53
- package/dist/{context-route-helpers-B9wj8Rmh.mjs → context-route-helpers-CI8XzcsK.mjs} +2 -1
- package/dist/{cron-DxCAU_Sn.mjs → cron-B1SL_lsb.mjs} +7 -3
- package/dist/{dashboard-B7ZUNuyF.mjs → dashboard-D0nj5oWg.mjs} +4 -4
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/{device-flow-BZVGftqi.mjs → device-flow-BJe6VEhP.mjs} +5 -5
- package/dist/{placeholder-d54Qr_7n.mjs → enrich-Ck9tfMqe.mjs} +36 -9
- package/dist/{error-DCSuUAZW.mjs → error-CSVaQNZy.mjs} +5 -0
- package/dist/{experimental-workflows-CSMffP6q.mjs → experimental-workflows-GVhUgzEs.mjs} +1 -1
- package/dist/field-defs-cache-DL-T2XVS.mjs +49 -0
- package/dist/forgeway-seo-client-G5ddhVHd.mjs +456 -0
- package/dist/{fts-manager-B5l_qwrA.mjs → fts-manager-ewTGohf4.mjs} +1 -1
- package/dist/{hitl-requests-7NlzVeUA.mjs → hitl-requests-DEFj8e6u.mjs} +2 -2
- package/dist/{hitl-route-helpers-k---_H3-.mjs → hitl-route-helpers-C23JHaWz.mjs} +5 -4
- package/dist/import-CXXL5pip.mjs +1354 -0
- package/dist/index-DcnOCD1e.d.mts +375 -0
- package/dist/index.d.mts +15 -16
- package/dist/index.mjs +85 -70
- package/dist/{jsonld-DZ67souc.d.mts → jsonld-DzKbhRZ4.d.mts} +8 -4
- package/dist/{load-D9OiGr2m.mjs → load-CFtJRT3c.mjs} +1 -1
- package/dist/{loader--GOYux8M.mjs → loader-aWkkc1_o.mjs} +117 -31
- package/dist/{manifest-schema-qh2P7RDX.mjs → manifest-schema-uA6pRFXi.mjs} +38 -1
- package/dist/mcp-reviewed-executor-Dn52L_yY.mjs +558 -0
- package/dist/media/image-endpoint.d.mts +32 -0
- package/dist/media/image-endpoint.mjs +111 -0
- package/dist/media/index.d.mts +27 -2
- package/dist/media/index.mjs +5 -3
- package/dist/media/local-runtime.d.mts +15 -11
- package/dist/media/local-runtime.mjs +9 -7
- package/dist/{media-CbKyYukG.mjs → media-CVMOoywq.mjs} +3 -1
- package/dist/{media-allowlist-BYxJIcTO.mjs → media-allowlist-zDNJmXCo.mjs} +1 -1
- package/dist/media-url-BdoLPvg8.mjs +20 -0
- package/dist/{menus-C7F0sCrC.mjs → menus-CCG2z5um.mjs} +80 -15
- package/dist/{menus-BZbXf-ej.mjs → menus-CmyIkRG5.mjs} +19 -5
- package/dist/{normalize-ByemhhfW.mjs → normalize-Cyt7JdF7.mjs} +8 -1
- package/dist/{oauth-authorization-DF-LCsIA.mjs → oauth-authorization-B9H7X85L.mjs} +5 -5
- package/dist/{oauth-clients-Du-V0fEm.mjs → oauth-clients-Dwl32-Uj.mjs} +2 -2
- package/dist/object-cache/memory.d.mts +14 -0
- package/dist/object-cache/memory.mjs +55 -0
- package/dist/object-cache-D51qOseS.mjs +419 -0
- package/dist/output-DhBe5_Pi.mjs +68 -0
- package/dist/page/index.d.mts +10 -3
- package/dist/page/index.mjs +2 -2
- package/dist/{parse-CneSgl7-.mjs → parse-i15EFSAE.mjs} +1 -1
- package/dist/{parser-DxfsARXL.mjs → parser-06LLLL4E.mjs} +151 -9
- package/dist/{placeholder-CXfoCtCd.d.mts → placeholder-DkWkXfDI.d.mts} +12 -4
- package/dist/plugin-utils.d.mts +8 -9
- package/dist/plugins/adapt-sandbox-entry.d.mts +8 -9
- package/dist/plugins/adapt-sandbox-entry.mjs +13 -2
- package/dist/{plugins-DzfqRREq.mjs → plugins-CPA2PtfY.mjs} +919 -66
- package/dist/{transport-LSdZVXHF.mjs → portable-text-BASHceim.mjs} +1 -134
- package/dist/portable-text-E79LyjGo.d.mts +45 -0
- package/dist/{preview-C-3YTX2U.mjs → preview-BjedZm8G.mjs} +4 -3
- package/dist/process-cache-CCDgti7j.mjs +106 -0
- package/dist/project-env-DKibmuP8.mjs +95 -0
- package/dist/{provider-loader-9it4vd6L.d.mts → provider-loader-DC2JdWeO.d.mts} +1 -1
- package/dist/{public-url-B4xV4rGa.d.mts → public-url-DQJCnYi9.d.mts} +1 -1
- package/dist/publication-authorization-RKiHXKtq.mjs +985 -0
- package/dist/{query-CZ3TH_Uu.mjs → query-C2U5u5_p.mjs} +11 -6
- package/dist/{query-Ds0EnMFX.mjs → query-DEv5x6yB.mjs} +281 -76
- package/dist/{rate-limit-i0G3IAOX.mjs → rate-limit-DglsAJSw.mjs} +2 -2
- package/dist/{redirect-CEACczxo.mjs → redirect-ubhEqQCQ.mjs} +2 -2
- package/dist/{redirects-ocRJmQHP.mjs → redirects-Bhpm8bRe.mjs} +35 -19
- package/dist/{redirects-DYj1yPxs.mjs → redirects-xs2yahLq.mjs} +47 -24
- package/dist/{registry-D7HACema.mjs → registry-BYYyb2tF.mjs} +148 -81
- package/dist/request-context.d.mts +2 -0
- package/dist/{request-meta-DAb6xaP9.mjs → request-meta-CFe1tW2M.mjs} +1 -1
- package/dist/review-payload-BysRWpxS.mjs +111 -0
- package/dist/{review-requests-BW2NxY-l.mjs → review-requests-CTWGnWUt.mjs} +1 -1
- package/dist/review-requests-D42VEP1l.mjs +142 -0
- package/dist/review-route-helpers-C31vO6SI.mjs +41 -0
- package/dist/runner-BgmttQmD.mjs +7444 -0
- package/dist/{runner-09sTqtv0.d.mts → runner-D6hzs8L9.d.mts} +1 -1
- package/dist/runtime.d.mts +9 -10
- package/dist/runtime.mjs +3 -3
- package/dist/schema-DUtnZxjZ.mjs +8 -0
- package/dist/{search-Gdrqj582.mjs → search-DUKgZUlm.mjs} +5 -3
- package/dist/{secrets-CeGpBFV2.mjs → secrets-ZV5rd8yV.mjs} +14 -11
- package/dist/{sections-BOjU13Y-.mjs → sections-DvFgsnda.mjs} +2 -2
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +21 -18
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.mjs +3 -12
- package/dist/{seo-5lJOtB5J.mjs → seo-BLszyJxd.mjs} +22 -4
- package/dist/{seo-CLj8lS7Q.mjs → seo-BU8MLCS9.mjs} +5 -2
- package/dist/{seo-contributions-CqVvReEj.mjs → seo-contributions-GnCuL1ML.mjs} +11 -3
- package/dist/{service-jGlhrICs.mjs → service-FL3fB0Rx.mjs} +2 -2
- package/dist/session-user-Ct6GBLvn.mjs +22 -0
- package/dist/{settings-CUXOxzsT.mjs → settings-BECcAIRH.mjs} +28 -55
- package/dist/{settings-DlBsT2VS.mjs → settings-EzADu-dd.mjs} +2 -2
- package/dist/{setup-complete-BRrdPYjZ.mjs → setup-complete-Da0axZEE.mjs} +1 -1
- package/dist/{site-activity-DONFrMBJ.mjs → site-activity-h8smOlYI.mjs} +1 -1
- package/dist/{site-context-C8Az_P_I.mjs → site-context-B8T1kpUP.mjs} +337 -530
- package/dist/{site-url-DIMD68go.mjs → site-url-DJEid0ml.mjs} +1 -1
- package/dist/stable-hash-DshcXvRE.mjs +19 -0
- package/dist/status-NqWOSFAD.mjs +21 -0
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/{taxonomies-D9Sw4wWM.mjs → taxonomies-BiM9NtgW.mjs} +36 -29
- package/dist/taxonomies-DSnY5nOa.mjs +443 -0
- package/dist/{taxonomy-B169Nm6B.mjs → taxonomy-0k_vRVsD.mjs} +44 -9
- package/dist/transport-C46KHLMP.mjs +134 -0
- package/dist/types-A8fPOJnl.mjs +69 -0
- package/dist/types-BLQCz46p.d.mts +118 -0
- package/dist/{types-CwawBUTa.d.mts → types-B_FlxIIl.d.mts} +4 -1
- package/dist/{types-CSgR9nQB.mjs → types-ChxYDRvx.mjs} +1 -1
- package/dist/{types-GaCtZ1k9.d.mts → types-Cw0PeCT_.d.mts} +18 -0
- package/dist/types-DuQn1G7-.d.mts +2973 -0
- package/dist/{runtime-C4-2lSFg.d.mts → types-DwoUifGE.d.mts} +5668 -3000
- package/dist/{types-DRIKLmJI.d.mts → types-opjX_kz6.d.mts} +17 -2
- package/dist/ui/server-runtime.d.mts +13 -15
- package/dist/ui/server-runtime.mjs +24 -20
- package/dist/url-guoXQQcV.mjs +33 -0
- package/dist/{user-DTLoZs16.mjs → user-BH-n01y3.mjs} +2 -2
- package/dist/{utils-B8hBJ9Oz.mjs → utils-D1SrKGtP.mjs} +129 -7
- package/dist/{validate-DzjCdy6v.d.mts → validate-CbVFoJgc.d.mts} +65 -8
- package/dist/{validate-DWmPO6oj.mjs → validate-D1HL-oLR.mjs} +11 -6
- package/dist/version-C3iVRuaF.mjs +6 -0
- package/dist/{widgets-BpJ8EpPd.mjs → widgets-BZrLrNgS.mjs} +46 -43
- package/dist/{wordpress-slugs-DHNR9LpG.mjs → wordpress-slugs-C3PWcowq.mjs} +1 -1
- package/dist/{zod-generator-K91-g665.mjs → zod-generator-C7AsLpSB.mjs} +42 -14
- package/package.json +38 -8
- package/src/components/Block.astro +50 -0
- package/src/components/Comments.astro +143 -1
- package/src/components/DinewayHead.astro +19 -2
- package/src/components/DinewayImage.astro +66 -33
- package/src/components/DinewayMedia.astro +1 -2
- package/src/components/Image.astro +85 -40
- package/src/components/InlinePortableTextEditor.tsx +12 -2
- package/src/components/JsonLdScript.astro +9 -0
- package/src/components/LiveSearch.astro +40 -4
- package/src/components/index.ts +4 -0
- package/src/components/live-search-routing.ts +30 -0
- package/src/components/portable-text-text-align.ts +15 -0
- package/src/ui.ts +2 -0
- package/dist/entity-aliases-4y93Yjuc.mjs +0 -51
- package/dist/import-4YBXbDkI.mjs +0 -684
- package/dist/index-CZiWCQDp.d.mts +0 -227
- package/dist/review-requests-Qum4713s.mjs +0 -79
- package/dist/runner-DzIpHGND.mjs +0 -2836
- package/dist/schema-Bsi-VpYv.mjs +0 -8
- package/dist/taxonomies-CZ-_DitR.mjs +0 -327
- package/dist/types-CuJOqHfM.d.mts +0 -758
- package/dist/types-DSPGWjxO.d.mts +0 -1247
- package/dist/types-nP9vGUFq.d.mts +0 -56
- package/dist/version-C4gfn0PJ.mjs +0 -6
- /package/dist/{adapters-OQCImOL7.d.mts → adapters-BiRymx02.d.mts} +0 -0
- /package/dist/{api-tokens-CYUoFGo7.mjs → api-tokens-Ypaly90d.mjs} +0 -0
- /package/dist/{challenge-store-DFxX0_15.mjs → challenge-store-D5pSY2S1.mjs} +0 -0
- /package/dist/{components--pg6zBvu.mjs → components-DImzlLhb.mjs} +0 -0
- /package/dist/{context-types-r8oFvyOq.mjs → context-types-eBuMDAg-.mjs} +0 -0
- /package/dist/{default-B6iaLvP7.mjs → default-D4Vygcy_.mjs} +0 -0
- /package/dist/{email-console-BOVqIYpB.mjs → email-console-Bp0r68iF.mjs} +0 -0
- /package/dist/{escape-BDgouFFY.mjs → escape-DN4Qmjsl.mjs} +0 -0
- /package/dist/{hash-BPmX6P8I.mjs → hash-mxxx2oPW.mjs} +0 -0
- /package/dist/{mime-CbKsKDCB.mjs → mime-C0vOHFm7.mjs} +0 -0
- /package/dist/{mode-CZqCF9dZ.mjs → mode-C8yZnIlR.mjs} +0 -0
- /package/dist/{oauth-state-store-qncPB_IU.mjs → oauth-state-store-CndT35iw.mjs} +0 -0
- /package/dist/{oauth-user-lookup-BFjWF8wK.mjs → oauth-user-lookup-CMehAaKs.mjs} +0 -0
- /package/dist/{options-LsPjZlqD.mjs → options-DQPTH5n0.mjs} +0 -0
- /package/dist/{passkey-config-DzHQK90v.mjs → passkey-config-NYukYGed.mjs} +0 -0
- /package/dist/{patterns-DKAX6oqN.mjs → patterns-CoqlXUvk.mjs} +0 -0
- /package/dist/{provider-loader-DzUxejk7.mjs → provider-loader-BtfrrzfD.mjs} +0 -0
- /package/dist/{public-url-B_m9IwdV.mjs → public-url-Cp6hyjVR.mjs} +0 -0
- /package/dist/{redirect-BjIBtDWY.mjs → redirect-DrbEmU9a.mjs} +0 -0
- /package/dist/{request-cache-ho99schz.mjs → request-cache-CBFjCwSt.mjs} +0 -0
- /package/dist/{resolve-DTuDyYKs.mjs → resolve-DE71WcL9.mjs} +0 -0
- /package/dist/{setup-nonce-pyGfc9hV.mjs → setup-nonce-BtkKnvxQ.mjs} +0 -0
- /package/dist/{sidecar-client-mJxwayYN.mjs → sidecar-client-Ctzfyyp-.mjs} +0 -0
- /package/dist/{slugify-BqebcqBg.mjs → slugify-KSsVD_D3.mjs} +0 -0
- /package/dist/{ssrf-DiKqWd3N.mjs → ssrf-FJqwQzj4.mjs} +0 -0
- /package/dist/{tokens-SLmgowfd.mjs → tokens-BDQU29Vd.mjs} +0 -0
- /package/dist/{transaction-CFLhEOuH.mjs → transaction-0LEAAy8R.mjs} +0 -0
- /package/dist/{transport-BnsNxh2l.d.mts → transport-D9pKAzFP.d.mts} +0 -0
- /package/dist/{trusted-proxy-BgIIcbsN.mjs → trusted-proxy-Dm7Mxvt6.mjs} +0 -0
- /package/dist/{types-CJ8DkL0q.mjs → types-B7TDDFMG.mjs} +0 -0
- /package/dist/{types-Dryvv7LH.d.mts → types-g0zMtraY.d.mts} +0 -0
- /package/dist/{types-Cg276-3z.mjs → types-mVVgRPaU.mjs} +0 -0
- /package/dist/{types-DZpT-PnG.d.mts → types-wFu80FrO.d.mts} +0 -0
- /package/dist/{url-w7Mp5qAD.mjs → url-EMAguGVk.mjs} +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { DinewayClient, PluginRequestOptions } from "../client/index.mjs";
|
|
2
|
+
import { SubCommandsDef } from "citty";
|
|
3
|
+
|
|
4
|
+
//#region src/cli/contributions.d.ts
|
|
5
|
+
interface DinewayCliContribution {
|
|
6
|
+
commands: SubCommandsDef;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/cli/client-factory.d.ts
|
|
10
|
+
interface ClientArgs {
|
|
11
|
+
url?: string;
|
|
12
|
+
token?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Shared connection args for all CLI commands that talk to a Dineway instance.
|
|
16
|
+
* Spread into each command's `args` definition.
|
|
17
|
+
*/
|
|
18
|
+
declare const connectionArgs: {
|
|
19
|
+
url: {
|
|
20
|
+
type: "string";
|
|
21
|
+
alias: string;
|
|
22
|
+
description: string;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
token: {
|
|
26
|
+
type: "string";
|
|
27
|
+
alias: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
header: {
|
|
31
|
+
type: "string";
|
|
32
|
+
alias: string;
|
|
33
|
+
description: string;
|
|
34
|
+
};
|
|
35
|
+
json: {
|
|
36
|
+
type: "boolean";
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Create a DinewayClient from CLI args, env vars, and stored credentials.
|
|
42
|
+
*
|
|
43
|
+
* Auth resolution order:
|
|
44
|
+
* 1. --token flag
|
|
45
|
+
* 2. DINEWAY_TOKEN env var
|
|
46
|
+
* 3. Stored credentials (~/.config/dineway/auth.json)
|
|
47
|
+
* 4. Dev bypass (if URL is localhost)
|
|
48
|
+
*
|
|
49
|
+
* Custom headers are merged from (in priority order):
|
|
50
|
+
* 1. Stored credentials (persisted during `dineway login --header`)
|
|
51
|
+
* 2. DINEWAY_HEADERS env var
|
|
52
|
+
* 3. --header CLI flags
|
|
53
|
+
*/
|
|
54
|
+
declare function createClientFromArgs(args: ClientArgs): DinewayClient;
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/cli/output.d.ts
|
|
57
|
+
interface OutputArgs {
|
|
58
|
+
json?: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Redirect consola output to stderr so it doesn't pollute JSON on stdout.
|
|
62
|
+
*
|
|
63
|
+
* Call this early in any command that uses `output()` with `--json`.
|
|
64
|
+
* Safe to call multiple times — only applies the redirect once.
|
|
65
|
+
*/
|
|
66
|
+
declare function configureOutputMode(args: OutputArgs): void;
|
|
67
|
+
/**
|
|
68
|
+
* Output data as JSON or pretty-printed.
|
|
69
|
+
*
|
|
70
|
+
* If stdout is not a TTY or --json is set, outputs JSON.
|
|
71
|
+
* Otherwise, outputs a formatted representation.
|
|
72
|
+
*/
|
|
73
|
+
declare function output(data: unknown, args: OutputArgs): void;
|
|
74
|
+
//#endregion
|
|
75
|
+
export { type DinewayCliContribution, type PluginRequestOptions, configureOutputMode, connectionArgs, createClientFromArgs, output };
|
package/dist/client/index.d.mts
CHANGED
|
@@ -1,49 +1,6 @@
|
|
|
1
|
-
import { a as tokenInterceptor, i as devBypassInterceptor, n as createTransport, r as csrfInterceptor, t as Interceptor } from "../transport-
|
|
1
|
+
import { a as tokenInterceptor, i as devBypassInterceptor, n as createTransport, r as csrfInterceptor, t as Interceptor } from "../transport-D9pKAzFP.mjs";
|
|
2
|
+
import { n as markdownToPortableText, r as portableTextToMarkdown, t as PortableTextBlock } from "../portable-text-E79LyjGo.mjs";
|
|
2
3
|
|
|
3
|
-
//#region src/client/portable-text.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Portable Text <-> Markdown conversion layer.
|
|
6
|
-
*
|
|
7
|
-
* Three tiers of block handling:
|
|
8
|
-
* Tier 1: Standard PT blocks <-> standard Markdown (headings, paragraphs, lists, etc.)
|
|
9
|
-
* Tier 2: Dineway custom blocks <-> Markdown directives (future)
|
|
10
|
-
* Tier 3: Unknown blocks <-> opaque HTML comment fences (preserved, not editable)
|
|
11
|
-
*/
|
|
12
|
-
/** Minimal Portable Text block shape */
|
|
13
|
-
interface PortableTextBlock {
|
|
14
|
-
_type: string;
|
|
15
|
-
_key?: string;
|
|
16
|
-
style?: string;
|
|
17
|
-
level?: number;
|
|
18
|
-
listItem?: string;
|
|
19
|
-
markDefs?: MarkDef[];
|
|
20
|
-
children?: PortableTextSpan[];
|
|
21
|
-
[key: string]: unknown;
|
|
22
|
-
}
|
|
23
|
-
interface PortableTextSpan {
|
|
24
|
-
_type: string;
|
|
25
|
-
_key?: string;
|
|
26
|
-
text?: string;
|
|
27
|
-
marks?: string[];
|
|
28
|
-
[key: string]: unknown;
|
|
29
|
-
}
|
|
30
|
-
interface MarkDef {
|
|
31
|
-
_key: string;
|
|
32
|
-
_type: string;
|
|
33
|
-
href?: string;
|
|
34
|
-
[key: string]: unknown;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Convert Portable Text blocks to Markdown.
|
|
38
|
-
* Unknown block types are serialized as opaque fences.
|
|
39
|
-
*/
|
|
40
|
-
declare function portableTextToMarkdown(blocks: PortableTextBlock[]): string;
|
|
41
|
-
/**
|
|
42
|
-
* Convert Markdown to Portable Text blocks.
|
|
43
|
-
* Opaque fences (<!--ec:block ... -->) are deserialized and spliced back in.
|
|
44
|
-
*/
|
|
45
|
-
declare function markdownToPortableText(markdown: string): PortableTextBlock[];
|
|
46
|
-
//#endregion
|
|
47
4
|
//#region src/client/index.d.ts
|
|
48
5
|
interface DinewayClientOptions {
|
|
49
6
|
/** Base URL of the Dineway instance */
|
|
@@ -59,6 +16,11 @@ interface DinewayClientOptions {
|
|
|
59
16
|
/** Additional request interceptors */
|
|
60
17
|
interceptors?: Interceptor[];
|
|
61
18
|
}
|
|
19
|
+
interface PluginRequestOptions {
|
|
20
|
+
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
21
|
+
query?: Record<string, string | number | boolean | null | undefined>;
|
|
22
|
+
body?: unknown;
|
|
23
|
+
}
|
|
62
24
|
/** Standard API error shape */
|
|
63
25
|
interface ApiError {
|
|
64
26
|
code: string;
|
|
@@ -93,6 +55,18 @@ interface ContentItem {
|
|
|
93
55
|
translationGroup: string | null;
|
|
94
56
|
_rev?: string;
|
|
95
57
|
}
|
|
58
|
+
interface ContentPublishOptions {
|
|
59
|
+
reviewRequestId: string;
|
|
60
|
+
releaseAuthorizationId?: string;
|
|
61
|
+
publishedAt?: string;
|
|
62
|
+
locale?: string;
|
|
63
|
+
}
|
|
64
|
+
interface ContentScheduleOptions {
|
|
65
|
+
at: string;
|
|
66
|
+
reviewRequestId: string;
|
|
67
|
+
releaseAuthorizationId?: string;
|
|
68
|
+
locale?: string;
|
|
69
|
+
}
|
|
96
70
|
/** Collection metadata */
|
|
97
71
|
interface Collection {
|
|
98
72
|
slug: string;
|
|
@@ -105,6 +79,7 @@ interface Collection {
|
|
|
105
79
|
/** Collection with fields */
|
|
106
80
|
interface CollectionWithFields extends Collection {
|
|
107
81
|
fields: Field[];
|
|
82
|
+
schemaFingerprint: string;
|
|
108
83
|
}
|
|
109
84
|
/** Field metadata */
|
|
110
85
|
interface Field {
|
|
@@ -320,14 +295,12 @@ declare class DinewayClient {
|
|
|
320
295
|
}): Promise<ContentItem>;
|
|
321
296
|
/** Delete (soft) a content item */
|
|
322
297
|
delete(collection: string, id: string): Promise<void>;
|
|
323
|
-
/** Publish
|
|
324
|
-
publish(collection: string, id: string): Promise<void>;
|
|
298
|
+
/** Publish an exact, editorially approved Draft Revision */
|
|
299
|
+
publish(collection: string, id: string, options: ContentPublishOptions): Promise<void>;
|
|
325
300
|
/** Unpublish a content item */
|
|
326
301
|
unpublish(collection: string, id: string): Promise<void>;
|
|
327
|
-
/** Schedule
|
|
328
|
-
schedule(collection: string, id: string, options:
|
|
329
|
-
at: string;
|
|
330
|
-
}): Promise<void>;
|
|
302
|
+
/** Schedule an exact, editorially approved Draft Revision */
|
|
303
|
+
schedule(collection: string, id: string, options: ContentScheduleOptions): Promise<void>;
|
|
331
304
|
/** Restore a trashed content item */
|
|
332
305
|
restore(collection: string, id: string): Promise<void>;
|
|
333
306
|
/** Compare live and draft revisions */
|
|
@@ -394,6 +367,8 @@ declare class DinewayClient {
|
|
|
394
367
|
menu(name: string): Promise<MenuWithItems>;
|
|
395
368
|
/** Create a one-time browser setup link for the current admin user. */
|
|
396
369
|
createSetupLink(): Promise<SetupLinkResult>;
|
|
370
|
+
/** Invoke a deterministic application-service route contributed by an active plugin. */
|
|
371
|
+
pluginRequest<T>(pluginId: string, routePath: string, options?: PluginRequestOptions): Promise<T>;
|
|
397
372
|
/** Make a typed JSON request to the API */
|
|
398
373
|
private request;
|
|
399
374
|
/** Make a raw request — caller handles response */
|
|
@@ -404,4 +379,4 @@ declare class DinewayClient {
|
|
|
404
379
|
private getFieldSchemas;
|
|
405
380
|
}
|
|
406
381
|
//#endregion
|
|
407
|
-
export { ApiError, ClientResponse, Collection, CollectionWithFields, ContentItem, DinewayApiError, DinewayClient, DinewayClientError, DinewayClientOptions, Field, type Interceptor, ListResult, Manifest, MediaItem, Menu, MenuItem, MenuWithItems, type PortableTextBlock, SchemaExport, SearchResult, SetupLinkResult, Taxonomy, Term, createTransport, csrfInterceptor, devBypassInterceptor, markdownToPortableText, portableTextToMarkdown, tokenInterceptor };
|
|
382
|
+
export { ApiError, ClientResponse, Collection, CollectionWithFields, ContentItem, ContentPublishOptions, ContentScheduleOptions, DinewayApiError, DinewayClient, DinewayClientError, DinewayClientOptions, Field, type Interceptor, ListResult, Manifest, MediaItem, Menu, MenuItem, MenuWithItems, PluginRequestOptions, type PortableTextBlock, SchemaExport, SearchResult, SetupLinkResult, Taxonomy, Term, createTransport, csrfInterceptor, devBypassInterceptor, markdownToPortableText, portableTextToMarkdown, tokenInterceptor };
|
package/dist/client/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as portableTextToMarkdown, n as convertDataForWrite, r as markdownToPortableText, t as convertDataForRead } from "../portable-text-BASHceim.mjs";
|
|
2
|
+
import { a as tokenInterceptor, i as refreshInterceptor, n as csrfInterceptor, r as devBypassInterceptor, t as createTransport } from "../transport-C46KHLMP.mjs";
|
|
2
3
|
import mime from "mime/lite";
|
|
3
4
|
|
|
4
5
|
//#region src/client/index.ts
|
|
@@ -21,6 +22,8 @@ import mime from "mime/lite";
|
|
|
21
22
|
* ```
|
|
22
23
|
*/
|
|
23
24
|
const TRAILING_SLASH_PATTERN = /\/$/;
|
|
25
|
+
const LEADING_TRAILING_SLASH_PATTERN = /^\/+|\/+$/g;
|
|
26
|
+
const PLUGIN_ID_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
24
27
|
function mimeFromFilename(filename) {
|
|
25
28
|
return mime.getType(filename) ?? "application/octet-stream";
|
|
26
29
|
}
|
|
@@ -188,17 +191,31 @@ var DinewayClient = class {
|
|
|
188
191
|
async delete(collection, id) {
|
|
189
192
|
await this.request("DELETE", `/content/${encodeURIComponent(collection)}/${encodeURIComponent(id)}`);
|
|
190
193
|
}
|
|
191
|
-
/** Publish
|
|
192
|
-
async publish(collection, id) {
|
|
193
|
-
|
|
194
|
+
/** Publish an exact, editorially approved Draft Revision */
|
|
195
|
+
async publish(collection, id, options) {
|
|
196
|
+
const params = new URLSearchParams();
|
|
197
|
+
if (options.locale) params.set("locale", options.locale);
|
|
198
|
+
const qs = params.toString();
|
|
199
|
+
await this.request("POST", `/content/${encodeURIComponent(collection)}/${encodeURIComponent(id)}/publish${qs ? `?${qs}` : ""}`, {
|
|
200
|
+
reviewRequestId: options.reviewRequestId,
|
|
201
|
+
releaseAuthorizationId: options.releaseAuthorizationId,
|
|
202
|
+
publishedAt: options.publishedAt
|
|
203
|
+
});
|
|
194
204
|
}
|
|
195
205
|
/** Unpublish a content item */
|
|
196
206
|
async unpublish(collection, id) {
|
|
197
207
|
await this.request("POST", `/content/${encodeURIComponent(collection)}/${encodeURIComponent(id)}/unpublish`);
|
|
198
208
|
}
|
|
199
|
-
/** Schedule
|
|
209
|
+
/** Schedule an exact, editorially approved Draft Revision */
|
|
200
210
|
async schedule(collection, id, options) {
|
|
201
|
-
|
|
211
|
+
const params = new URLSearchParams();
|
|
212
|
+
if (options.locale) params.set("locale", options.locale);
|
|
213
|
+
const qs = params.toString();
|
|
214
|
+
await this.request("POST", `/content/${encodeURIComponent(collection)}/${encodeURIComponent(id)}/schedule${qs ? `?${qs}` : ""}`, {
|
|
215
|
+
scheduledAt: options.at,
|
|
216
|
+
reviewRequestId: options.reviewRequestId,
|
|
217
|
+
releaseAuthorizationId: options.releaseAuthorizationId
|
|
218
|
+
});
|
|
202
219
|
}
|
|
203
220
|
/** Restore a trashed content item */
|
|
204
221
|
async restore(collection, id) {
|
|
@@ -291,6 +308,17 @@ var DinewayClient = class {
|
|
|
291
308
|
async createSetupLink() {
|
|
292
309
|
return this.request("POST", "/auth/setup-token");
|
|
293
310
|
}
|
|
311
|
+
/** Invoke a deterministic application-service route contributed by an active plugin. */
|
|
312
|
+
async pluginRequest(pluginId, routePath, options = {}) {
|
|
313
|
+
if (!PLUGIN_ID_PATTERN.test(pluginId)) throw new Error("Invalid plugin ID");
|
|
314
|
+
const segments = routePath.replace(LEADING_TRAILING_SLASH_PATTERN, "").split("/");
|
|
315
|
+
if (segments.length === 0 || segments.some((segment) => !segment || segment === "." || segment === "..")) throw new Error("Invalid plugin route path");
|
|
316
|
+
const encodedPath = segments.map((segment) => encodeURIComponent(segment)).join("/");
|
|
317
|
+
const query = new URLSearchParams();
|
|
318
|
+
for (const [key, value] of Object.entries(options.query ?? {})) if (value !== void 0 && value !== null) query.set(key, String(value));
|
|
319
|
+
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
320
|
+
return this.request(options.method ?? "GET", `/plugins/${encodeURIComponent(pluginId)}/${encodedPath}${suffix}`, options.body);
|
|
321
|
+
}
|
|
294
322
|
/** Make a typed JSON request to the API */
|
|
295
323
|
async request(method, path, body) {
|
|
296
324
|
const response = await this.requestRaw(method, path, body);
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { a as __exportAll } from "./runner-BgmttQmD.mjs";
|
|
2
|
+
import { customHeadersInterceptor, resolveCustomHeaders } from "./client/external-auth-headers.mjs";
|
|
3
|
+
import { DinewayClient } from "./client/index.mjs";
|
|
4
|
+
import { a as resolveDinewayBaseUrl, o as resolveDinewayToken, t as DEFAULT_DINEWAY_URL } from "./project-env-DKibmuP8.mjs";
|
|
5
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
6
|
+
import { join, resolve } from "node:path";
|
|
7
|
+
import { homedir } from "node:os";
|
|
8
|
+
|
|
9
|
+
//#region src/cli/credentials.ts
|
|
10
|
+
/**
|
|
11
|
+
* Credential storage for CLI auth tokens.
|
|
12
|
+
*
|
|
13
|
+
* Stores OAuth tokens in ~/.config/dineway/auth.json.
|
|
14
|
+
* Remote URLs are keyed by origin, local dev by project path.
|
|
15
|
+
*/
|
|
16
|
+
function getConfigDir() {
|
|
17
|
+
const xdg = process.env["XDG_CONFIG_HOME"];
|
|
18
|
+
if (xdg) return join(xdg, "dineway");
|
|
19
|
+
return join(homedir(), ".config", "dineway");
|
|
20
|
+
}
|
|
21
|
+
function getCredentialPath() {
|
|
22
|
+
return join(getConfigDir(), "auth.json");
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Resolve the credential key for a given URL.
|
|
26
|
+
*
|
|
27
|
+
* Remote URLs are keyed by origin (e.g. "https://my-site.pages.dev").
|
|
28
|
+
* Local dev instances are keyed by project path (e.g. "path:/Users/matt/sites/blog").
|
|
29
|
+
*/
|
|
30
|
+
function resolveCredentialKey(baseUrl) {
|
|
31
|
+
try {
|
|
32
|
+
const url = new URL(baseUrl);
|
|
33
|
+
if (url.hostname === "localhost" || url.hostname === "127.0.0.1" || url.hostname === "[::1]") {
|
|
34
|
+
const projectPath = findProjectRoot(process.cwd());
|
|
35
|
+
if (projectPath) return `path:${projectPath}`;
|
|
36
|
+
return url.origin;
|
|
37
|
+
}
|
|
38
|
+
return url.origin;
|
|
39
|
+
} catch {
|
|
40
|
+
return baseUrl;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Walk up from cwd to find the project root (directory containing astro.config.*).
|
|
45
|
+
*/
|
|
46
|
+
function findProjectRoot(from) {
|
|
47
|
+
let dir = resolve(from);
|
|
48
|
+
const root = resolve("/");
|
|
49
|
+
while (dir !== root) {
|
|
50
|
+
for (const name of [
|
|
51
|
+
"astro.config.ts",
|
|
52
|
+
"astro.config.mts",
|
|
53
|
+
"astro.config.js",
|
|
54
|
+
"astro.config.mjs"
|
|
55
|
+
]) if (existsSync(join(dir, name))) return dir;
|
|
56
|
+
const parent = resolve(dir, "..");
|
|
57
|
+
if (parent === dir) break;
|
|
58
|
+
dir = parent;
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
function readStore() {
|
|
63
|
+
const path = getCredentialPath();
|
|
64
|
+
try {
|
|
65
|
+
if (existsSync(path)) {
|
|
66
|
+
const content = readFileSync(path, "utf-8");
|
|
67
|
+
return JSON.parse(content);
|
|
68
|
+
}
|
|
69
|
+
} catch {}
|
|
70
|
+
return {};
|
|
71
|
+
}
|
|
72
|
+
function writeStore(store) {
|
|
73
|
+
mkdirSync(getConfigDir(), {
|
|
74
|
+
recursive: true,
|
|
75
|
+
mode: 448
|
|
76
|
+
});
|
|
77
|
+
writeFileSync(getCredentialPath(), JSON.stringify(store, null, " "), {
|
|
78
|
+
encoding: "utf-8",
|
|
79
|
+
mode: 384
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Get stored credentials for a URL.
|
|
84
|
+
*/
|
|
85
|
+
function getCredentials(baseUrl) {
|
|
86
|
+
const key = resolveCredentialKey(baseUrl);
|
|
87
|
+
const cred = readStore()[key];
|
|
88
|
+
if (!cred || !("accessToken" in cred)) return null;
|
|
89
|
+
return cred;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Save credentials for a URL.
|
|
93
|
+
*/
|
|
94
|
+
function saveCredentials(baseUrl, cred) {
|
|
95
|
+
const key = resolveCredentialKey(baseUrl);
|
|
96
|
+
const store = readStore();
|
|
97
|
+
store[key] = cred;
|
|
98
|
+
writeStore(store);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Remove credentials for a URL.
|
|
102
|
+
*/
|
|
103
|
+
function removeCredentials(baseUrl) {
|
|
104
|
+
const key = resolveCredentialKey(baseUrl);
|
|
105
|
+
const store = readStore();
|
|
106
|
+
if (key in store) {
|
|
107
|
+
delete store[key];
|
|
108
|
+
writeStore(store);
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
function marketplaceKey(registryUrl) {
|
|
114
|
+
try {
|
|
115
|
+
return `marketplace:${new URL(registryUrl).origin}`;
|
|
116
|
+
} catch {
|
|
117
|
+
return `marketplace:${registryUrl}`;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Get stored marketplace credential for a registry URL.
|
|
122
|
+
*/
|
|
123
|
+
function getMarketplaceCredential(registryUrl) {
|
|
124
|
+
const key = marketplaceKey(registryUrl);
|
|
125
|
+
const cred = readStore()[key];
|
|
126
|
+
if (!cred || !("token" in cred)) return null;
|
|
127
|
+
if (new Date(cred.expiresAt) < /* @__PURE__ */ new Date()) return null;
|
|
128
|
+
return cred;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Save marketplace credential for a registry URL.
|
|
132
|
+
*/
|
|
133
|
+
function saveMarketplaceCredential(registryUrl, cred) {
|
|
134
|
+
const key = marketplaceKey(registryUrl);
|
|
135
|
+
const store = readStore();
|
|
136
|
+
store[key] = cred;
|
|
137
|
+
writeStore(store);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Remove marketplace credential for a registry URL.
|
|
141
|
+
*/
|
|
142
|
+
function removeMarketplaceCredential(registryUrl) {
|
|
143
|
+
const key = marketplaceKey(registryUrl);
|
|
144
|
+
const store = readStore();
|
|
145
|
+
if (key in store) {
|
|
146
|
+
delete store[key];
|
|
147
|
+
writeStore(store);
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region src/cli/client-factory.ts
|
|
155
|
+
var client_factory_exports = /* @__PURE__ */ __exportAll({
|
|
156
|
+
connectionArgs: () => connectionArgs,
|
|
157
|
+
createClientFromArgs: () => createClientFromArgs
|
|
158
|
+
});
|
|
159
|
+
/**
|
|
160
|
+
* Shared connection args for all CLI commands that talk to a Dineway instance.
|
|
161
|
+
* Spread into each command's `args` definition.
|
|
162
|
+
*/
|
|
163
|
+
const connectionArgs = {
|
|
164
|
+
url: {
|
|
165
|
+
type: "string",
|
|
166
|
+
alias: "u",
|
|
167
|
+
description: "Dineway instance URL",
|
|
168
|
+
default: DEFAULT_DINEWAY_URL
|
|
169
|
+
},
|
|
170
|
+
token: {
|
|
171
|
+
type: "string",
|
|
172
|
+
alias: "t",
|
|
173
|
+
description: "Auth token"
|
|
174
|
+
},
|
|
175
|
+
header: {
|
|
176
|
+
type: "string",
|
|
177
|
+
alias: "H",
|
|
178
|
+
description: "Custom header \"Name: Value\" (repeatable, or use DINEWAY_HEADERS env)"
|
|
179
|
+
},
|
|
180
|
+
json: {
|
|
181
|
+
type: "boolean",
|
|
182
|
+
description: "Output as JSON"
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Create a DinewayClient from CLI args, env vars, and stored credentials.
|
|
187
|
+
*
|
|
188
|
+
* Auth resolution order:
|
|
189
|
+
* 1. --token flag
|
|
190
|
+
* 2. DINEWAY_TOKEN env var
|
|
191
|
+
* 3. Stored credentials (~/.config/dineway/auth.json)
|
|
192
|
+
* 4. Dev bypass (if URL is localhost)
|
|
193
|
+
*
|
|
194
|
+
* Custom headers are merged from (in priority order):
|
|
195
|
+
* 1. Stored credentials (persisted during `dineway login --header`)
|
|
196
|
+
* 2. DINEWAY_HEADERS env var
|
|
197
|
+
* 3. --header CLI flags
|
|
198
|
+
*/
|
|
199
|
+
function createClientFromArgs(args) {
|
|
200
|
+
const baseUrl = resolveDinewayBaseUrl(args.url);
|
|
201
|
+
let token = resolveDinewayToken(args.token);
|
|
202
|
+
const isLocal = baseUrl.includes("localhost") || baseUrl.includes("127.0.0.1");
|
|
203
|
+
const cred = !token ? getCredentials(baseUrl) : null;
|
|
204
|
+
const customHeaders = {
|
|
205
|
+
...cred?.customHeaders,
|
|
206
|
+
...resolveCustomHeaders()
|
|
207
|
+
};
|
|
208
|
+
const extraInterceptors = [];
|
|
209
|
+
if (Object.keys(customHeaders).length > 0) extraInterceptors.push(customHeadersInterceptor(customHeaders));
|
|
210
|
+
if (!token && cred) if (new Date(cred.expiresAt) > /* @__PURE__ */ new Date()) token = cred.accessToken;
|
|
211
|
+
else return new DinewayClient({
|
|
212
|
+
baseUrl,
|
|
213
|
+
token: cred.accessToken,
|
|
214
|
+
refreshToken: cred.refreshToken,
|
|
215
|
+
onTokenRefresh: (newAccessToken, expiresIn) => {
|
|
216
|
+
saveCredentials(baseUrl, {
|
|
217
|
+
...cred,
|
|
218
|
+
accessToken: newAccessToken,
|
|
219
|
+
expiresAt: new Date(Date.now() + expiresIn * 1e3).toISOString()
|
|
220
|
+
});
|
|
221
|
+
},
|
|
222
|
+
interceptors: extraInterceptors
|
|
223
|
+
});
|
|
224
|
+
return new DinewayClient({
|
|
225
|
+
baseUrl,
|
|
226
|
+
token,
|
|
227
|
+
devBypass: !token && isLocal,
|
|
228
|
+
interceptors: extraInterceptors
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
//#endregion
|
|
233
|
+
export { getMarketplaceCredential as a, resolveCredentialKey as c, getCredentials as i, saveCredentials as l, connectionArgs as n, removeCredentials as o, createClientFromArgs as r, removeMarketplaceCredential as s, client_factory_exports as t, saveMarketplaceCredential as u };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { i as encodeCursor, r as decodeCursor } from "./types-
|
|
1
|
+
import { i as encodeCursor, r as decodeCursor } from "./types-ChxYDRvx.mjs";
|
|
2
|
+
import { s as invalidateCommentObjectCache } from "./object-cache-D51qOseS.mjs";
|
|
2
3
|
import { sql } from "kysely";
|
|
3
4
|
import { ulid } from "ulidx";
|
|
4
5
|
|
|
@@ -31,6 +32,7 @@ var CommentRepository = class CommentRepository {
|
|
|
31
32
|
created_at: now,
|
|
32
33
|
updated_at: now
|
|
33
34
|
}).execute();
|
|
35
|
+
invalidateCommentObjectCache();
|
|
34
36
|
const comment = await this.findById(id);
|
|
35
37
|
if (!comment) throw new Error("Failed to create comment");
|
|
36
38
|
return comment;
|
|
@@ -105,6 +107,7 @@ var CommentRepository = class CommentRepository {
|
|
|
105
107
|
status,
|
|
106
108
|
updated_at: now
|
|
107
109
|
}).where("id", "=", id).execute();
|
|
110
|
+
invalidateCommentObjectCache();
|
|
108
111
|
return this.findById(id);
|
|
109
112
|
}
|
|
110
113
|
/**
|
|
@@ -117,13 +120,16 @@ var CommentRepository = class CommentRepository {
|
|
|
117
120
|
status,
|
|
118
121
|
updated_at: now
|
|
119
122
|
}).where("id", "in", ids).executeTakeFirst();
|
|
123
|
+
invalidateCommentObjectCache();
|
|
120
124
|
return Number(result.numUpdatedRows ?? 0);
|
|
121
125
|
}
|
|
122
126
|
/**
|
|
123
127
|
* Hard-delete a single comment. Replies cascade via FK.
|
|
124
128
|
*/
|
|
125
129
|
async delete(id) {
|
|
126
|
-
|
|
130
|
+
const deleted = ((await this.db.deleteFrom("_dineway_comments").where("id", "=", id).executeTakeFirst()).numDeletedRows ?? 0) > 0;
|
|
131
|
+
if (deleted) invalidateCommentObjectCache();
|
|
132
|
+
return deleted;
|
|
127
133
|
}
|
|
128
134
|
/**
|
|
129
135
|
* Bulk hard-delete comments
|
|
@@ -131,6 +137,7 @@ var CommentRepository = class CommentRepository {
|
|
|
131
137
|
async bulkDelete(ids) {
|
|
132
138
|
if (ids.length === 0) return 0;
|
|
133
139
|
const result = await this.db.deleteFrom("_dineway_comments").where("id", "in", ids).executeTakeFirst();
|
|
140
|
+
invalidateCommentObjectCache();
|
|
134
141
|
return Number(result.numDeletedRows ?? 0);
|
|
135
142
|
}
|
|
136
143
|
/**
|
|
@@ -138,7 +145,9 @@ var CommentRepository = class CommentRepository {
|
|
|
138
145
|
*/
|
|
139
146
|
async deleteByContent(collection, contentId) {
|
|
140
147
|
const result = await this.db.deleteFrom("_dineway_comments").where("collection", "=", collection).where("content_id", "=", contentId).executeTakeFirst();
|
|
141
|
-
|
|
148
|
+
const deleted = Number(result.numDeletedRows ?? 0);
|
|
149
|
+
if (deleted > 0) invalidateCommentObjectCache();
|
|
150
|
+
return deleted;
|
|
142
151
|
}
|
|
143
152
|
/**
|
|
144
153
|
* Count comments for a content item, optionally filtered by status
|
|
@@ -183,6 +192,7 @@ var CommentRepository = class CommentRepository {
|
|
|
183
192
|
*/
|
|
184
193
|
async updateModerationMetadata(id, metadata) {
|
|
185
194
|
await this.db.updateTable("_dineway_comments").set({ moderation_metadata: JSON.stringify(metadata) }).where("id", "=", id).execute();
|
|
195
|
+
invalidateCommentObjectCache();
|
|
186
196
|
}
|
|
187
197
|
/**
|
|
188
198
|
* Assemble a flat list of comments into a threaded structure (1-level nesting)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-ChGNDY8r.mjs";
|
|
2
|
+
import { ulid } from "ulidx";
|
|
3
|
+
|
|
4
|
+
//#region src/database/repositories/comment-reaction.ts
|
|
5
|
+
var CommentReactionRepository = class {
|
|
6
|
+
constructor(db) {
|
|
7
|
+
this.db = db;
|
|
8
|
+
}
|
|
9
|
+
async toggle(input) {
|
|
10
|
+
if (((await this.db.insertInto("_dineway_comment_reactions").values({
|
|
11
|
+
id: ulid(),
|
|
12
|
+
comment_id: input.commentId,
|
|
13
|
+
reaction: input.reaction,
|
|
14
|
+
voter_hash: input.voterHash,
|
|
15
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
16
|
+
}).onConflict((oc) => oc.columns([
|
|
17
|
+
"comment_id",
|
|
18
|
+
"voter_hash",
|
|
19
|
+
"reaction"
|
|
20
|
+
]).doNothing()).executeTakeFirst()).numInsertedOrUpdatedRows ?? 0n) > 0n) return { reacted: true };
|
|
21
|
+
await this.db.deleteFrom("_dineway_comment_reactions").where("comment_id", "=", input.commentId).where("voter_hash", "=", input.voterHash).where("reaction", "=", input.reaction).execute();
|
|
22
|
+
return { reacted: false };
|
|
23
|
+
}
|
|
24
|
+
async countsForComments(commentIds) {
|
|
25
|
+
const result = /* @__PURE__ */ new Map();
|
|
26
|
+
if (commentIds.length === 0) return result;
|
|
27
|
+
for (const batch of chunks(commentIds, SQL_BATCH_SIZE)) {
|
|
28
|
+
const rows = await this.db.selectFrom("_dineway_comment_reactions").select(["comment_id", "reaction"]).select((eb) => eb.fn.count("id").as("count")).where("comment_id", "in", batch).groupBy(["comment_id", "reaction"]).execute();
|
|
29
|
+
for (const row of rows) {
|
|
30
|
+
const counts = result.get(row.comment_id) ?? {};
|
|
31
|
+
counts[row.reaction] = Number(row.count);
|
|
32
|
+
result.set(row.comment_id, counts);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
async viewerReactions(commentIds, voterHash) {
|
|
38
|
+
const result = /* @__PURE__ */ new Map();
|
|
39
|
+
if (commentIds.length === 0) return result;
|
|
40
|
+
for (const batch of chunks(commentIds, SQL_BATCH_SIZE)) {
|
|
41
|
+
const rows = await this.db.selectFrom("_dineway_comment_reactions").select(["comment_id", "reaction"]).where("comment_id", "in", batch).where("voter_hash", "=", voterHash).execute();
|
|
42
|
+
for (const row of rows) {
|
|
43
|
+
const reactions = result.get(row.comment_id) ?? [];
|
|
44
|
+
reactions.push(row.reaction);
|
|
45
|
+
result.set(row.comment_id, reactions);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
async countRecentByVoter(voterHash, windowMinutes = 10) {
|
|
51
|
+
const cutoff = (/* @__PURE__ */ new Date(Date.now() - windowMinutes * 60 * 1e3)).toISOString();
|
|
52
|
+
const result = await this.db.selectFrom("_dineway_comment_reactions").select((eb) => eb.fn.count("id").as("count")).where("voter_hash", "=", voterHash).where("created_at", ">", cutoff).executeTakeFirst();
|
|
53
|
+
return Number(result?.count ?? 0);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
export { CommentReactionRepository as t };
|