dineway 0.2.32 → 0.2.34
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-CfryM8jO.mjs → activity-CZnq5YlZ.mjs} +2 -2
- package/dist/{activity-events-BVo9rMUz.mjs → activity-events-D-yGV7cW.mjs} +1 -1
- package/dist/{actor-DrJJsvy6.mjs → actor-DxUAJgQX.mjs} +20 -6
- package/dist/{adapters-DHt3f2lu.d.mts → adapters-BQ8CQbBm.d.mts} +5 -7
- package/dist/after-BVaUn7bK.mjs +24 -0
- package/dist/{allowed-origins-DtBQa4JR.mjs → allowed-origins-DV3LWuWW.mjs} +1 -1
- package/dist/api/route-utils.d.mts +10 -10
- package/dist/api/route-utils.mjs +23 -19
- package/dist/api/schemas/index.d.mts +1 -1
- package/dist/api/schemas/index.mjs +5 -5
- package/dist/{api-DF92r_un.mjs → api-CL4pG2zf.mjs} +55 -1215
- package/dist/api-tokens-D5K_Csub.mjs +3 -0
- package/dist/{api-tokens-CSomx-l3.mjs → api-tokens-_6tMD1W4.mjs} +1 -1
- package/dist/{apply-Bs2jXsms.mjs → apply-CYLUMiZg.mjs} +109 -93
- package/dist/astro/index.d.mts +16 -12
- package/dist/astro/index.mjs +50 -9
- package/dist/astro/middleware/auth.d.mts +9 -9
- package/dist/astro/middleware/auth.mjs +29 -8
- package/dist/astro/middleware/redirect.mjs +8 -7
- package/dist/astro/middleware/request-context.mjs +17 -10
- package/dist/astro/middleware/seed.d.mts +1 -1
- package/dist/astro/middleware/seed.mjs +93 -71
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware/workers.d.mts +6 -0
- package/dist/astro/middleware/workers.mjs +8 -0
- package/dist/astro/middleware.mjs +288 -159
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -7
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -7
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +7 -7
- package/dist/astro/routes/api/admin/briefing.mjs +25 -23
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +5 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +11 -10
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +11 -10
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +11 -10
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +22 -20
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +22 -20
- package/dist/astro/routes/api/admin/bylines/index.mjs +22 -20
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +17 -16
- package/dist/astro/routes/api/admin/comments/_id_.mjs +8 -7
- package/dist/astro/routes/api/admin/comments/bulk.mjs +14 -13
- package/dist/astro/routes/api/admin/comments/counts.mjs +8 -7
- package/dist/astro/routes/api/admin/comments/index.mjs +14 -13
- package/dist/astro/routes/api/admin/context/_id_/history.mjs +43 -31
- package/dist/astro/routes/api/admin/context/_id_/index.mjs +43 -31
- package/dist/astro/routes/api/admin/context/_id_/review.mjs +48 -36
- package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +48 -36
- package/dist/astro/routes/api/admin/context/diff.mjs +47 -35
- package/dist/astro/routes/api/admin/context/index.mjs +48 -36
- package/dist/astro/routes/api/admin/context/stale.mjs +47 -35
- package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +43 -31
- package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +47 -35
- package/dist/astro/routes/api/admin/hitl-requests/index.mjs +47 -35
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +44 -32
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +7 -7
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +7 -7
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +72 -66
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +72 -66
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +64 -58
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +71 -65
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +71 -65
- package/dist/astro/routes/api/admin/plugins/index.mjs +64 -58
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +64 -58
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +71 -65
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +64 -58
- package/dist/astro/routes/api/admin/plugins/updates.mjs +64 -58
- package/dist/astro/routes/api/admin/review-requests/_id_/image.mjs +26 -23
- package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +33 -25
- package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +56 -43
- package/dist/astro/routes/api/admin/review-requests/_id_/revoke.mjs +10 -9
- package/dist/astro/routes/api/admin/review-requests/index.mjs +54 -41
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +64 -58
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +64 -58
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +20 -12
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +40 -32
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +3 -3
- package/dist/astro/routes/api/admin/users/index.mjs +7 -7
- package/dist/astro/routes/api/auth/dev-bypass.mjs +6 -5
- package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
- package/dist/astro/routes/api/auth/invite/complete.mjs +12 -12
- package/dist/astro/routes/api/auth/invite/index.mjs +9 -9
- package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -11
- package/dist/astro/routes/api/auth/logout.mjs +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +12 -11
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/me.mjs +11 -11
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +5 -4
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +5 -4
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +7 -7
- package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +14 -13
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +11 -11
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +12 -12
- package/dist/astro/routes/api/auth/passkey/verify.mjs +12 -12
- package/dist/astro/routes/api/auth/setup-token/index.mjs +32 -23
- package/dist/astro/routes/api/auth/setup-token/verify.mjs +32 -26
- package/dist/astro/routes/api/auth/signup/complete.mjs +12 -12
- package/dist/astro/routes/api/auth/signup/request.mjs +12 -11
- package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +21 -18
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +19 -16
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +8 -7
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +8 -7
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +8 -7
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +24 -21
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +35 -22
- package/dist/astro/routes/api/content/_collection_/_id_/release-readiness.mjs +9 -9
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +8 -7
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +35 -22
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +23 -19
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +8 -7
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +14 -13
- package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/index.mjs +14 -13
- package/dist/astro/routes/api/content/_collection_/trash.mjs +8 -8
- package/dist/astro/routes/api/dashboard.mjs +16 -11
- 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 +25 -24
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +12 -11
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +9 -9
- package/dist/astro/routes/api/import/wordpress/execute.mjs +51 -42
- package/dist/astro/routes/api/import/wordpress/media.d.mts +9 -9
- package/dist/astro/routes/api/import/wordpress/media.mjs +14 -14
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +52 -40
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +10 -10
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +50 -38
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +29 -27
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +9 -9
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +56 -47
- package/dist/astro/routes/api/integration/artifact.mjs +11 -8
- package/dist/astro/routes/api/integration/dispatch.mjs +17 -14
- package/dist/astro/routes/api/integrations/_provider_.mjs +11 -8
- package/dist/astro/routes/api/integrations/index.mjs +10 -7
- package/dist/astro/routes/api/manifest.mjs +5 -5
- package/dist/astro/routes/api/mcp.mjs +98 -88
- package/dist/astro/routes/api/media/_id_/confirm.mjs +12 -12
- package/dist/astro/routes/api/media/_id_.mjs +9 -9
- 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 +13 -13
- package/dist/astro/routes/api/media.mjs +16 -16
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +48 -36
- package/dist/astro/routes/api/menus/_name_/items.mjs +48 -36
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +48 -36
- package/dist/astro/routes/api/menus/_name_/translations.mjs +48 -36
- package/dist/astro/routes/api/menus/_name_.mjs +48 -36
- package/dist/astro/routes/api/menus/index.mjs +48 -36
- package/dist/astro/routes/api/oauth/authorize.mjs +9 -7
- package/dist/astro/routes/api/oauth/device/authorize.mjs +7 -6
- package/dist/astro/routes/api/oauth/device/code.mjs +11 -9
- package/dist/astro/routes/api/oauth/device/token.mjs +10 -8
- package/dist/astro/routes/api/oauth/register.mjs +4 -4
- package/dist/astro/routes/api/oauth/token/refresh.mjs +7 -6
- package/dist/astro/routes/api/oauth/token/revoke.mjs +7 -6
- package/dist/astro/routes/api/oauth/token.mjs +8 -6
- package/dist/astro/routes/api/openapi.json.mjs +5 -5
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +4 -4
- package/dist/astro/routes/api/redirects/404s/index.mjs +15 -14
- package/dist/astro/routes/api/redirects/404s/summary.mjs +15 -14
- package/dist/astro/routes/api/redirects/_id_.mjs +48 -37
- package/dist/astro/routes/api/redirects/index.mjs +48 -37
- 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 +66 -60
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +66 -60
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +66 -60
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +66 -60
- package/dist/astro/routes/api/schema/collections/index.mjs +66 -60
- package/dist/astro/routes/api/schema/index.mjs +12 -11
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +64 -58
- package/dist/astro/routes/api/schema/orphans/index.mjs +64 -58
- package/dist/astro/routes/api/search/enable.mjs +15 -14
- package/dist/astro/routes/api/search/index.mjs +14 -13
- package/dist/astro/routes/api/search/rebuild.mjs +15 -14
- package/dist/astro/routes/api/search/stats.mjs +9 -8
- package/dist/astro/routes/api/search/suggest.mjs +14 -13
- package/dist/astro/routes/api/sections/_slug_.mjs +48 -36
- package/dist/astro/routes/api/sections/index.mjs +48 -36
- package/dist/astro/routes/api/settings/email.mjs +5 -5
- package/dist/astro/routes/api/settings/reviews.mjs +11 -10
- package/dist/astro/routes/api/settings.mjs +48 -36
- package/dist/astro/routes/api/setup/admin-verify.mjs +14 -14
- package/dist/astro/routes/api/setup/admin.mjs +12 -12
- package/dist/astro/routes/api/setup/dev-bypass.mjs +35 -31
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
- package/dist/astro/routes/api/setup/index.mjs +37 -33
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +11 -9
- package/dist/astro/routes/api/system/heartbeat.mjs +2 -2
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +51 -39
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +51 -39
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +51 -39
- package/dist/astro/routes/api/taxonomies/index.mjs +51 -39
- package/dist/astro/routes/api/themes/preview.mjs +8 -6
- 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 +47 -35
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +48 -36
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +48 -36
- package/dist/astro/routes/api/widget-areas/_name_.mjs +45 -33
- package/dist/astro/routes/api/widget-areas/index.mjs +48 -36
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +11 -10
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +20 -18
- package/dist/astro/routes/sitemap.xml.mjs +19 -17
- package/dist/astro/session-driver.d.mts +1 -1
- package/dist/astro/session-driver.mjs +4 -4
- package/dist/astro/types.d.mts +13 -13
- package/dist/atomic-authority-CnBQJ14T.mjs +33 -0
- package/dist/{audit-CYjfxG9i.mjs → audit-F5iWkbcJ.mjs} +11 -4
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{auth-control-guard-CITT8ZA_.mjs → auth-control-guard-D4WW-wFF.mjs} +1 -1
- package/dist/{authorize-KcI0pAfN.mjs → authorize-EnP57AQl.mjs} +1 -1
- package/dist/{briefing-r3hXCDQC.mjs → briefing-BXsVwd4P.mjs} +1 -1
- package/dist/{briefing-BgQTljQt.mjs → briefing-CkCi6S-W.mjs} +445 -447
- package/dist/{bundle-S6zx-V4D.mjs → bundle-Cgak1zGE.mjs} +3 -3
- package/dist/{byline-Ctil4rij.mjs → byline-DEZKlzD9.mjs} +107 -113
- package/dist/{byline-fields-QpmruT5r.mjs → byline-fields-BGEIA9dZ.mjs} +3 -3
- package/dist/{byline-fields-DNXKWUW9.d.mts → byline-fields-BmkhEDFF.d.mts} +2 -2
- package/dist/{byline-fields-DiCyW6eQ.mjs → byline-fields-Qg8TesxL.mjs} +1 -1
- package/dist/{byline-registry-rkr73qSE.mjs → byline-registry-CkuVVeJJ.mjs} +46 -76
- package/dist/{bylines-BcuBpzVi.mjs → bylines-7BQxRGyG.mjs} +4 -4
- package/dist/{bylines-v_ZUQnR-.mjs → bylines-LqNRjma2.mjs} +6 -6
- package/dist/{cache-V2BCplaY.mjs → cache-CSTy-R-K.mjs} +2 -2
- package/dist/{chunks-CnuL55JE.mjs → chunks-BnG3LPMN.mjs} +1 -1
- package/dist/cli/index.mjs +452 -263
- package/dist/cli/plugin-kit.d.mts +9 -9
- package/dist/cli/plugin-kit.mjs +2 -2
- package/dist/client/external-auth-headers.d.mts +1 -1
- package/dist/client/index.d.mts +11 -11
- package/dist/client/index.mjs +2 -2
- package/dist/{client-factory-C-y9VZDX.mjs → client-factory-BLSkgsTg.mjs} +1 -1
- package/dist/{comment-_nvJSS-A.mjs → comment-Bi7cJ9SS.mjs} +2 -2
- package/dist/{comment-reaction-DhVgJ17S.mjs → comment-reaction-BLqIj5mx.mjs} +1 -1
- package/dist/{comments-D4mIDjvA.mjs → comments-Dg_gWBEB.mjs} +1 -1
- package/dist/content-De_XeXy_.mjs +1230 -0
- package/dist/{content-CVCrcuvD.mjs → content-NobcQti0.mjs} +240 -161
- package/dist/{content-refresh-QvBIyb_g.mjs → content-refresh-l4mPoGeX.mjs} +170 -193
- package/dist/{context-MftkHbWx.mjs → context-6uqzU-M9.mjs} +95 -77
- package/dist/{context-JjKucxBm.mjs → context-B0SG9Xkc.mjs} +2 -2
- package/dist/{context-route-helpers-e1APrqSm.mjs → context-route-helpers-C8s26uDT.mjs} +2 -2
- package/dist/{cron-mGVPQ5e6.mjs → cron-D7zB6m8i.mjs} +36 -32
- package/dist/d1-binding-D6HZa3ks.mjs +8 -0
- package/dist/d1-dialect-B1b8cmxX.mjs +48 -0
- package/dist/{dashboard-ZJ7sMcBI.mjs → dashboard-B-OybCMw.mjs} +5 -5
- package/dist/database/batch.d.mts +20 -0
- package/dist/database/batch.mjs +69 -0
- package/dist/database/d1/index.d.mts +18 -0
- package/dist/database/d1/index.mjs +8 -0
- package/dist/db/d1.d.mts +7 -0
- package/dist/db/d1.mjs +13 -0
- package/dist/db/index.d.mts +4 -4
- package/dist/db/index.mjs +10 -7
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/libsql.mjs +46 -3
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/{device-flow-eOcL5m0Q.mjs → device-flow-DhpCzMo0.mjs} +130 -94
- package/dist/{dialect-helpers-fk43GbDb.mjs → dialect-helpers-C6xtO-Ui.mjs} +1 -1
- package/dist/{discovery-CJkuHGhZ.mjs → discovery-CqXbN0WZ.mjs} +5 -5
- package/dist/{enrich-KErvJOuI.mjs → enrich-BjF-J4sF.mjs} +1 -1
- package/dist/{evidence-6IUv9ML3.mjs → evidence-xJf8hQgH.mjs} +7 -7
- package/dist/{field-defs-cache-CwrIyZFT.mjs → field-defs-cache-BKKFFf_V.mjs} +5 -5
- package/dist/{forgeway-account-lYJ8iX3G.mjs → forgeway-account-BeKJlKh1.mjs} +1 -1
- package/dist/{fts-manager-DX7ZkrCa.mjs → fts-manager-BeWtB7ZD.mjs} +72 -57
- package/dist/{hitl-requests-CmYVunm-.mjs → hitl-requests-evSsel48.mjs} +2 -2
- package/dist/{hitl-route-helpers-CRm537zS.mjs → hitl-route-helpers-D2kJSOFX.mjs} +5 -5
- package/dist/{import-DqRAgsKr.mjs → import-Jpta-CYE.mjs} +9 -9
- package/dist/{index-Co7xtjkd.d.mts → index-CSUSBfdD.d.mts} +7 -4
- package/dist/index.d.mts +16 -16
- package/dist/index.mjs +104 -96
- package/dist/{integration-credentials-qudN6yRr.mjs → integration-credentials-BrQr0fb_.mjs} +2 -2
- package/dist/{jsonld-DTd-AVWg.d.mts → jsonld-CqIVIeZK.d.mts} +2 -2
- package/dist/{load-fCOciq0Q.mjs → load-Dc5ttyg4.mjs} +1 -1
- package/dist/{loader-BDje8ME2.mjs → loader-Cgsx23wU.mjs} +4 -4
- package/dist/{manifest-schema-CfKD0thC.mjs → manifest-schema-DG29meRy.mjs} +1 -1
- package/dist/{mcp-reviewed-executor-DmhM3Cy6.mjs → mcp-reviewed-executor-DAZL3Ckt.mjs} +7 -7
- package/dist/media/image-endpoint.mjs +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +2 -2
- package/dist/media/local-runtime.d.mts +11 -11
- package/dist/media/local-runtime.mjs +3 -3
- package/dist/{media-dvRjj4po.mjs → media-3fK0u-bo.mjs} +1 -1
- package/dist/{media-allowlist-DaG6lNoy.mjs → media-allowlist-rN4qIF6W.mjs} +1 -1
- package/dist/{menus-CpuR4Qkm.mjs → menus-5liJusbp.mjs} +138 -90
- package/dist/{menus-CZbz5L_V.mjs → menus-CbR_J8cJ.mjs} +8 -8
- package/dist/migrations-CMdxWKx-.mjs +76 -0
- package/dist/oauth-authority-CCqo4eBm.mjs +43 -0
- package/dist/{oauth-authorization-Jf5e3azH.mjs → oauth-authorization--0UtTZpv.mjs} +89 -98
- package/dist/{oauth-clients-tovQ4D4h.mjs → oauth-clients-D4WBYaYW.mjs} +2 -2
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{object-cache-D51qOseS.mjs → object-cache-BGjIlY9s.mjs} +1 -1
- package/dist/page/index.d.mts +10 -10
- package/dist/page/index.mjs +1 -1
- package/dist/{parse-IsGn-5lt.mjs → parse--7nG62_h.mjs} +1 -1
- package/dist/plugin-utils.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.mjs +1 -1
- package/dist/{plugins-DXyLI3Hb.mjs → plugins-DK1wLuao.mjs} +35 -84
- package/dist/{policy-950odoX_.mjs → policy-Dej7NJFD.mjs} +2 -2
- package/dist/{preview-BXmS1SXL.mjs → preview-q0pkibNO.mjs} +2 -2
- package/dist/{provider-loader-DDq7R_RN.d.mts → provider-loader-C0GaLwKB.d.mts} +1 -1
- package/dist/{public-url-CT-T1D_w.d.mts → public-url-B9zEdO8p.d.mts} +1 -1
- package/dist/{public-url-BQ9vf0AS.d.mts → public-url-BV-YQ_LF.d.mts} +2 -2
- package/dist/{publication-authorization-C-vYPGD8.mjs → publication-authorization-BrEZ2TsE.mjs} +459 -33
- package/dist/{query-CrW2yI6G.mjs → query-CEn9HXnf.mjs} +15 -15
- package/dist/{query-DcB9uGTW.mjs → query-DAS6VbMS.mjs} +4 -4
- package/dist/{rate-limit-DEkoxTsP.mjs → rate-limit-Dd1TnzZP.mjs} +2 -2
- package/dist/{redirect-DG-o0CKV.mjs → redirect-HLI3wT5Y.mjs} +26 -14
- package/dist/{redirects-Bjp4iKJU.mjs → redirects-DmOdfRjI.mjs} +5 -5
- package/dist/{redirects-N8gmWhVM.mjs → redirects-UCXyL0lP.mjs} +3 -3
- package/dist/{registry-D-IV_h50.mjs → registry-RD9qTnYL.mjs} +183 -186
- package/dist/release-BR08Slqf.mjs +5148 -0
- package/dist/request-context.d.mts +8 -0
- package/dist/{request-meta-BW0the1R.mjs → request-meta-BOcuHAXD.mjs} +1 -1
- package/dist/{resolve-pZ4NQM-X.mjs → resolve-C80Pm2DW.mjs} +1 -1
- package/dist/{review-payload-f1L4lzQg.mjs → review-payload-DEylbssM.mjs} +52 -4
- package/dist/{review-requests-DICrYH2-.mjs → review-requests-BF2eEKr8.mjs} +93 -37
- package/dist/{review-requests-BTKfeWlS.mjs → review-requests-CyfWbJ6W.mjs} +2 -2
- package/dist/{review-route-helpers-DaZBBps8.mjs → review-route-helpers-lKA-CXms.mjs} +2 -2
- package/dist/{revision-De7OmYVD.mjs → revision-090sZyGc.mjs} +28 -22
- package/dist/revocation-B7GL5fMl.mjs +53 -0
- package/dist/{runner-DJiRFyLI.mjs → runner-CVeq0266.mjs} +594 -491
- package/dist/{runner-Dye73myO.d.mts → runner-JnJSGXEB.d.mts} +1 -1
- package/dist/{runs-DEujUDOj.mjs → runs-B5BExdKO.mjs} +5 -5
- package/dist/runtime-env-CQVAWHzH.mjs +19 -0
- package/dist/runtime.d.mts +10 -10
- package/dist/runtime.mjs +5 -5
- package/dist/schema-DLMkODQc.mjs +8 -0
- package/dist/{search-DxUKN9Zz.mjs → search-CRzWNfxX.mjs} +4 -4
- package/dist/{secrets-AdCrGg1c.mjs → secrets-Cg0D2gQW.mjs} +10 -11
- package/dist/{sections-BPFOEMK6.mjs → sections-BwUjOGqn.mjs} +2 -2
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +29 -25
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +11 -10
- package/dist/{seo-DWHdo5aW.mjs → seo-BOTuCeh-.mjs} +25 -15
- package/dist/{seo-GfovzqpU.mjs → seo-B_tBFyud.mjs} +1 -1
- package/dist/{service-DbgjHWyW.mjs → service--bQht6oN.mjs} +2 -2
- package/dist/{service-BrNKVCjC.mjs → service-DilVsWGD.mjs} +3 -3
- package/dist/{session-user-DyqWGIh4.mjs → session-user-DeqTcAmR.mjs} +1 -1
- package/dist/{settings-CAsQLi0N.mjs → settings-DFzevIrU.mjs} +8 -8
- package/dist/{settings-BKEHw6Bu.mjs → settings-Deqx3Upy.mjs} +2 -2
- package/dist/{setup-complete-C8LTo8cO.mjs → setup-complete-BFqudwbW.mjs} +1 -1
- package/dist/{site-activity-7oezuHXK.mjs → site-activity-BrN2NviL.mjs} +11 -4
- package/dist/{site-context-CA7rbxux.mjs → site-context-vCiDRr4H.mjs} +50 -37
- package/dist/{site-url-DoZf_jVj.mjs → site-url-wXFqbm9c.mjs} +1 -1
- package/dist/state-jyNZ6-7L.mjs +30 -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 +3 -3
- package/dist/{store-c4qx3gVh.mjs → store-C1yDxxfv.mjs} +37 -12
- package/dist/submission-BsHNfHc7.mjs +155 -0
- package/dist/{taxonomies-ALDiRQ84.mjs → taxonomies-4cnTcbD6.mjs} +3 -3
- package/dist/{taxonomies-93DV-1QT.mjs → taxonomies-CllxqaH0.mjs} +7 -7
- package/dist/{taxonomy-BOBTJ_aE.mjs → taxonomy-DWxxLpp5.mjs} +3 -3
- package/dist/{tokens-c-qxNqzC.mjs → tokens-Bjuf1HID.mjs} +1 -1
- package/dist/{trusted-proxy-CdEl6g6B.mjs → trusted-proxy-CAW9o4Dw.mjs} +4 -12
- package/dist/{types-BRCUO8NR.d.mts → types-7Th6Mwz3.d.mts} +1 -0
- package/dist/{types-BpSTdH1H.mjs → types-BqxIv8Il.mjs} +2 -2
- package/dist/{types-6KmeXInJ.d.mts → types-CFgTpfPk.d.mts} +1 -1
- package/dist/{types-TpXK8km5.d.mts → types-QjOcidFc.d.mts} +300 -172
- package/dist/ui/server-runtime.d.mts +13 -13
- package/dist/ui/server-runtime.mjs +28 -26
- package/dist/{user-D0NJ7gYf.mjs → user-1-YV30lf.mjs} +2 -2
- package/dist/{utils-BK2efsHv.mjs → utils-Cglcqpm2.mjs} +2 -2
- package/dist/{validate-CDWVODvc.d.mts → validate-A27peRc4.d.mts} +3 -3
- package/dist/{validate-C9g9iX3q.mjs → validate-Wl4MSf3V.mjs} +3 -3
- package/dist/version-BWxyC5s4.mjs +6 -0
- package/dist/{widgets-Cm5Qx2Np.mjs → widgets-Di-6yDH7.mjs} +3 -3
- package/dist/{wordpress-slugs-WdPZaVXf.mjs → wordpress-slugs-vOx7R1dM.mjs} +1 -1
- package/dist/{worker-D7OccgB8.mjs → worker-RpaMP71d.mjs} +76 -47
- package/dist/workers-build-BaQCrSmf.mjs +36 -0
- package/dist/{zod-generator-DS5oZNaL.mjs → zod-generator-Cylvl_SM.mjs} +2 -2
- package/package.json +35 -9
- package/dist/after-BfniwgIf.mjs +0 -9
- package/dist/api-tokens-CmT83Bgj.mjs +0 -3
- package/dist/db/libsql-http.d.mts +0 -27
- package/dist/db/libsql-http.mjs +0 -29
- package/dist/libsql-dialect-CANq6UNI.mjs +0 -47
- package/dist/oauth-user-lookup-B451pZmd.mjs +0 -25
- package/dist/revocation-CkTOhdlw.mjs +0 -42
- package/dist/schema-IjuRxkqq.mjs +0 -8
- package/dist/submission-C47cHBIg.mjs +0 -67
- package/dist/transaction-BGQgnwUi.mjs +0 -28
- package/dist/version-9orir5LL.mjs +0 -6
- /package/dist/{base64-F8-DUraK.mjs → base64-Cz-aU0X1.mjs} +0 -0
- /package/dist/{challenge-store-CYrg4F4t.mjs → challenge-store-D-_-VavY.mjs} +0 -0
- /package/dist/{components-DAq_4iPX.mjs → components-BWQUCJEr.mjs} +0 -0
- /package/dist/{config-CVssduLe.mjs → config-XW5tMrH8.mjs} +0 -0
- /package/dist/{content-index-names-Bbu1FY1r.mjs → content-index-names-CDc2IQIx.mjs} +0 -0
- /package/dist/{context-types-CPWAJRs5.mjs → context-types-DqTo6C79.mjs} +0 -0
- /package/dist/{default-BeIzUa1e.mjs → default-D9zxuUU7.mjs} +0 -0
- /package/dist/{email-console-Bfi_exVg.mjs → email-console-BONByQiC.mjs} +0 -0
- /package/dist/{error-DLg1H2LT.mjs → error-Dd8LtpG5.mjs} +0 -0
- /package/dist/{escape-C6lkys0j.mjs → escape-BWC4s5bV.mjs} +0 -0
- /package/dist/{experimental-workflows-B9x8delL.mjs → experimental-workflows-M5D3RTFo.mjs} +0 -0
- /package/dist/{hash-jhbF98tT.mjs → hash-lNx3KJis.mjs} +0 -0
- /package/dist/{media-url-CL3NzgLh.mjs → media-url-B4YtTY6c.mjs} +0 -0
- /package/dist/{mime-CDTtL7jE.mjs → mime-D_ae-u_U.mjs} +0 -0
- /package/dist/{mode-D554vAgH.mjs → mode-CPf_KZ37.mjs} +0 -0
- /package/dist/{normalize-Ev3FiBMx.mjs → normalize-5rct_U0I.mjs} +0 -0
- /package/dist/{oauth-state-store-Do1a_o3H.mjs → oauth-state-store-CMgcimzA.mjs} +0 -0
- /package/dist/{options-1dBRkoCl.mjs → options-BcqHWpc-.mjs} +0 -0
- /package/dist/{output-8j9oltTf.mjs → output-BYpiVUBf.mjs} +0 -0
- /package/dist/{parser-C9rzPuSZ.mjs → parser-BV0wzQHo.mjs} +0 -0
- /package/dist/{passkey-config-CRN44T04.mjs → passkey-config-BG4GO4OO.mjs} +0 -0
- /package/dist/{patterns-3XE9bU4r.mjs → patterns-CZ7D4y_R.mjs} +0 -0
- /package/dist/{placeholder-D03pGvqM.d.mts → placeholder-BHTaoCYx.d.mts} +0 -0
- /package/dist/{portable-text-tIk9_uz_.mjs → portable-text-B9YuySom.mjs} +0 -0
- /package/dist/{portable-text-BdRm4uZq.d.mts → portable-text-FKf3IrPz.d.mts} +0 -0
- /package/dist/{process-cache-B-L-A9zg.mjs → process-cache-MHM4Sqzs.mjs} +0 -0
- /package/dist/{provider-loader-C4i82ll1.mjs → provider-loader-3MY1SjzA.mjs} +0 -0
- /package/dist/{public-discovery-CyDzK1-S.mjs → public-discovery-BAbOvKiR.mjs} +0 -0
- /package/dist/{public-url-oudwI7K0.mjs → public-url-C7pbmS_7.mjs} +0 -0
- /package/dist/{public-url-BVIjzMo3.mjs → public-url-D5Wjq0sy.mjs} +0 -0
- /package/dist/{redirect-Dp5u-8dH.mjs → redirect-Bx96u2nS.mjs} +0 -0
- /package/dist/{request-cache-BruBnFAR.mjs → request-cache-DPmV5nk4.mjs} +0 -0
- /package/dist/{seo-contributions-BAtRDXEQ.mjs → seo-contributions-Dt57p6Sq.mjs} +0 -0
- /package/dist/{service-DeX1PRNt.mjs → service-wYQ_ePZ4.mjs} +0 -0
- /package/dist/{setup-nonce-D-CEYlw7.mjs → setup-nonce-CAqDUxxU.mjs} +0 -0
- /package/dist/{sidecar-client-Bw2C0XTf.mjs → sidecar-client-CnpGTvYq.mjs} +0 -0
- /package/dist/{slugify-KSsVD_D3.mjs → slugify-Di8Q_MFq.mjs} +0 -0
- /package/dist/{ssrf-C7tTSD1r.mjs → ssrf-LN16WMip.mjs} +0 -0
- /package/dist/{stable-hash-DF7R5eN8.mjs → stable-hash-DEtJgcp7.mjs} +0 -0
- /package/dist/{status-Bba6RbkS.mjs → status-Bwkeuz8g.mjs} +0 -0
- /package/dist/{transport-BddGhTAI.mjs → transport-472KVGBe.mjs} +0 -0
- /package/dist/{transport-ktLL9r2O.d.mts → transport-C0jj-Nc8.d.mts} +0 -0
- /package/dist/{types-BQZFeZjd.mjs → types-BDq9t5lG.mjs} +0 -0
- /package/dist/{types-CKIt_jmM.d.mts → types-Bs-7Geuh.d.mts} +0 -0
- /package/dist/{types-CLMOusxP.d.mts → types-CwkJp6zr.d.mts} +0 -0
- /package/dist/{types-C0DPvhR5.mjs → types-CyBH89BS.mjs} +0 -0
- /package/dist/{types-BbkkkAb6.mjs → types-D17dJRht.mjs} +0 -0
- /package/dist/{types--3oJQ0hs.d.mts → types-DTjrkhKU.d.mts} +0 -0
- /package/dist/{types-CPaVj_GC.d.mts → types-DkXuBo8k.d.mts} +0 -0
- /package/dist/{types-CU3Wn2HC.d.mts → types-b2sq7ZDk.d.mts} +0 -0
- /package/dist/{url-C_pLSrGZ.mjs → url-D375-6LM.mjs} +0 -0
- /package/dist/{url-Dumsft7G.mjs → url-bv5i4JN0.mjs} +0 -0
- /package/dist/{validate-VPnKoIzW.mjs → validate-Co3j6T_K.mjs} +0 -0
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
1
|
+
import { atomicBatch, rowUnchanged } from "./database/batch.mjs";
|
|
2
|
+
import { i as encodeBase64url, n as decodeBase64url } from "./base64-Cz-aU0X1.mjs";
|
|
3
|
+
import { t as readRuntimeEnv } from "./runtime-env-CQVAWHzH.mjs";
|
|
4
|
+
import { i as parseEncryptionKeys, t as DinewaySecretsError } from "./secrets-Cg0D2gQW.mjs";
|
|
3
5
|
|
|
4
6
|
//#region src/database/repositories/integration-credentials.ts
|
|
5
7
|
var IntegrationCredentialRepository = class {
|
|
6
8
|
constructor(db) {
|
|
7
9
|
this.db = db;
|
|
8
10
|
}
|
|
9
|
-
|
|
11
|
+
preparePut(input) {
|
|
10
12
|
const now = input.updatedAt ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
11
13
|
const row = {
|
|
12
14
|
provider: input.provider,
|
|
@@ -20,7 +22,7 @@ var IntegrationCredentialRepository = class {
|
|
|
20
22
|
created_at: now,
|
|
21
23
|
updated_at: now
|
|
22
24
|
};
|
|
23
|
-
|
|
25
|
+
return this.db.insertInto("_dineway_integration_credentials").values(row).onConflict((conflict) => conflict.column("provider").doUpdateSet({
|
|
24
26
|
credential_type: row.credential_type,
|
|
25
27
|
encryption_version: row.encryption_version,
|
|
26
28
|
key_id: row.key_id,
|
|
@@ -29,7 +31,25 @@ var IntegrationCredentialRepository = class {
|
|
|
29
31
|
fingerprint: row.fingerprint,
|
|
30
32
|
source: row.source,
|
|
31
33
|
updated_at: now
|
|
32
|
-
})).
|
|
34
|
+
})).compile();
|
|
35
|
+
}
|
|
36
|
+
async put(input, expected) {
|
|
37
|
+
const checks = expected ? [rowUnchanged("_dineway_integration_credentials", {
|
|
38
|
+
provider: expected.provider,
|
|
39
|
+
credential_type: expected.credentialType,
|
|
40
|
+
encryption_version: expected.encryptionVersion,
|
|
41
|
+
key_id: expected.keyId,
|
|
42
|
+
nonce: expected.nonce,
|
|
43
|
+
ciphertext: expected.ciphertext,
|
|
44
|
+
fingerprint: expected.fingerprint,
|
|
45
|
+
source: expected.source,
|
|
46
|
+
created_at: expected.createdAt,
|
|
47
|
+
updated_at: expected.updatedAt
|
|
48
|
+
})] : [];
|
|
49
|
+
await atomicBatch(this.db, {
|
|
50
|
+
checks,
|
|
51
|
+
statements: [this.preparePut(input)]
|
|
52
|
+
});
|
|
33
53
|
const stored = await this.find(input.provider);
|
|
34
54
|
if (!stored) throw new Error("Integration credential write did not persist.");
|
|
35
55
|
return stored;
|
|
@@ -71,17 +91,18 @@ var IntegrationCredentialStore = class {
|
|
|
71
91
|
repository;
|
|
72
92
|
keysPromise;
|
|
73
93
|
constructor(db, options = {}) {
|
|
94
|
+
this.db = db;
|
|
74
95
|
this.repository = new IntegrationCredentialRepository(db);
|
|
75
96
|
this.keysPromise = options.keys ? Promise.resolve(options.keys) : parseEncryptionKeys(readEncryptionKey(options.env));
|
|
76
97
|
}
|
|
77
|
-
async
|
|
98
|
+
async prepareSet(provider, credential, source = "admin") {
|
|
78
99
|
validateProvider(provider);
|
|
79
100
|
validateCredential(credential);
|
|
80
101
|
const primaryKey = (await this.requireKeys())[0];
|
|
81
102
|
if (!primaryKey) throw encryptionKeyRequired();
|
|
82
103
|
const serialized = serializeCredential(credential);
|
|
83
104
|
const encrypted = await encryptCredential(primaryKey, provider, credential.type, serialized);
|
|
84
|
-
return
|
|
105
|
+
return this.repository.preparePut({
|
|
85
106
|
provider,
|
|
86
107
|
credentialType: credential.type,
|
|
87
108
|
encryptionVersion: ENCRYPTION_VERSION,
|
|
@@ -90,7 +111,13 @@ var IntegrationCredentialStore = class {
|
|
|
90
111
|
ciphertext: encrypted.ciphertext,
|
|
91
112
|
fingerprint: await fingerprintCredential(primaryKey, provider, serialized),
|
|
92
113
|
source
|
|
93
|
-
})
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
async set(provider, credential, source = "admin") {
|
|
117
|
+
await atomicBatch(this.db, { statements: [await this.prepareSet(provider, credential, source)] });
|
|
118
|
+
const status = await this.status(provider);
|
|
119
|
+
if (!status) throw new Error("Integration credential write did not persist.");
|
|
120
|
+
return status;
|
|
94
121
|
}
|
|
95
122
|
async status(provider) {
|
|
96
123
|
validateProvider(provider);
|
|
@@ -131,7 +158,7 @@ var IntegrationCredentialStore = class {
|
|
|
131
158
|
ciphertext: encrypted.ciphertext,
|
|
132
159
|
fingerprint: await fingerprintCredential(primaryKey, provider, serialized),
|
|
133
160
|
source: stored.source
|
|
134
|
-
});
|
|
161
|
+
}, stored);
|
|
135
162
|
}
|
|
136
163
|
return credential;
|
|
137
164
|
}
|
|
@@ -234,9 +261,7 @@ function encryptionKeyRequired() {
|
|
|
234
261
|
}
|
|
235
262
|
function readEncryptionKey(env) {
|
|
236
263
|
if (env) return env.DINEWAY_ENCRYPTION_KEY;
|
|
237
|
-
|
|
238
|
-
const proc = typeof process !== "undefined" && process.env ? process.env : {};
|
|
239
|
-
return meta.DINEWAY_ENCRYPTION_KEY ?? proc.DINEWAY_ENCRYPTION_KEY;
|
|
264
|
+
return readRuntimeEnv("DINEWAY_ENCRYPTION_KEY");
|
|
240
265
|
}
|
|
241
266
|
function toStatus(stored) {
|
|
242
267
|
return {
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { AtomicWriteConflict, atomicBatch, rowUnchanged } from "./database/batch.mjs";
|
|
2
|
+
import { t as ContentRepository } from "./content-NobcQti0.mjs";
|
|
3
|
+
import { t as buildStableHash } from "./stable-hash-DEtJgcp7.mjs";
|
|
4
|
+
import { i as isSupersededReview, r as ReviewRequestRepository, t as REVIEW_SUPERSESSION_ACTOR } from "./review-requests-BF2eEKr8.mjs";
|
|
5
|
+
import { i as encodeRev, t as ReviewPayloadBuilder } from "./review-payload-DEylbssM.mjs";
|
|
6
|
+
import { i as reviewDraft } from "./evidence-xJf8hQgH.mjs";
|
|
7
|
+
import { sql } from "kysely";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
|
|
10
|
+
//#region src/review-automation/submission.ts
|
|
11
|
+
var ReviewSubmissionError = class extends Error {
|
|
12
|
+
constructor(message, code = "REVIEW_SUBMISSION_INVALID") {
|
|
13
|
+
super(message);
|
|
14
|
+
this.code = code;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
async function submitAutomatedReview(db, handlers, input) {
|
|
18
|
+
const contentRepo = new ContentRepository(db);
|
|
19
|
+
const entry = await contentRepo.findByIdOrSlug(input.collection, input.id);
|
|
20
|
+
const snapshot = entry ? await contentRepo.snapshot(input.collection, entry.id) : null;
|
|
21
|
+
if (!snapshot) throw new ReviewSubmissionError("The submitted content could not be read.");
|
|
22
|
+
const revisionIds = [snapshot.item.liveRevisionId, snapshot.item.draftRevisionId].filter((id) => id !== null);
|
|
23
|
+
const revisions = revisionIds.length ? await db.selectFrom("revisions").selectAll().where("id", "in", revisionIds).execute() : [];
|
|
24
|
+
const built = await new ReviewPayloadBuilder(handlers).buildContentReviewPayload(input);
|
|
25
|
+
if (input.expectedRev !== void 0 && input.expectedRev !== built.reviewedRev) throw new ReviewSubmissionError("Reload the latest draft before submitting it.", "REVIEW_REVISION_CHANGED");
|
|
26
|
+
const contentHash = await buildStableHash(reviewDraft(built));
|
|
27
|
+
const targetKey = await buildStableHash({
|
|
28
|
+
collection: built.collection,
|
|
29
|
+
id: built.entryId,
|
|
30
|
+
actionHash: built.actionHash
|
|
31
|
+
});
|
|
32
|
+
if (built.reviewedRev !== encodeRev(snapshot.item) || built.draftRevisionId !== snapshot.item.draftRevisionId || built.liveRevisionId !== snapshot.item.liveRevisionId) throw new ReviewSubmissionError("The submitted content changed. Review the latest draft.");
|
|
33
|
+
const scheduledAt = snapshot.item.scheduledAt;
|
|
34
|
+
const checks = [snapshot.check, ...revisions.map((revision) => rowUnchanged("revisions", revision))];
|
|
35
|
+
const reviews = new ReviewRequestRepository(db);
|
|
36
|
+
const prepareSupersession = async () => {
|
|
37
|
+
const statements = [];
|
|
38
|
+
if (!input.supersedePending) return {
|
|
39
|
+
checks: [],
|
|
40
|
+
statements
|
|
41
|
+
};
|
|
42
|
+
const query = db.selectFrom("_dineway_review_requests").where("collection", "=", built.collection).where("entry_id", "=", built.entryId).where("action_type", "=", built.actionType).where("requested_by_actor_type", "=", input.actor.actorType).where("requested_by_actor_id", "=", input.actor.actorId).where("status", "=", "pending").where("revoked_at", "is", null).where((eb) => eb.or([eb("reviewed_rev", "!=", built.reviewedRev), eb("action_hash", "!=", built.actionHash)]));
|
|
43
|
+
const previous = await query.select("id").execute();
|
|
44
|
+
const supersessionChecks = [sql`${query.select((eb) => eb.fn.countAll().as("count"))} = ${previous.length}`];
|
|
45
|
+
for (const prior of previous) {
|
|
46
|
+
const batch = await reviews.prepareResolve(prior.id, {
|
|
47
|
+
decision: "rejected",
|
|
48
|
+
resolvedByActorType: "system",
|
|
49
|
+
resolvedByActorId: REVIEW_SUPERSESSION_ACTOR,
|
|
50
|
+
reviewNote: "Superseded by a newer submission. This is not an editorial rejection."
|
|
51
|
+
});
|
|
52
|
+
if (!batch) throw new AtomicWriteConflict();
|
|
53
|
+
supersessionChecks.push(...batch.checks ?? []);
|
|
54
|
+
statements.push(...batch.statements);
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
checks: supersessionChecks,
|
|
58
|
+
statements
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
const reuseReview = async (item) => {
|
|
62
|
+
const batch = await prepareSupersession();
|
|
63
|
+
if (batch.statements.length) await atomicBatch(db, {
|
|
64
|
+
checks: [
|
|
65
|
+
...checks,
|
|
66
|
+
rowUnchanged("_dineway_review_requests", {
|
|
67
|
+
id: item.id,
|
|
68
|
+
status: item.status,
|
|
69
|
+
revoked_at: item.revokedAt ?? null
|
|
70
|
+
}),
|
|
71
|
+
...batch.checks
|
|
72
|
+
],
|
|
73
|
+
statements: batch.statements
|
|
74
|
+
});
|
|
75
|
+
return {
|
|
76
|
+
item,
|
|
77
|
+
created: false
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
const findExisting = async () => {
|
|
81
|
+
const existing = await db.selectFrom("_dineway_review_jobs").select("review_id").where("target_key", "=", targetKey).executeTakeFirst();
|
|
82
|
+
if (existing) {
|
|
83
|
+
const item = await reviews.findById(existing.review_id);
|
|
84
|
+
if (!item || item.status === "rejected" || item.revokedAt) throw new ReviewSubmissionError("Edit the content before submitting a rejected or revoked target again.");
|
|
85
|
+
return item;
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
};
|
|
89
|
+
const existingReview = await findExisting();
|
|
90
|
+
if (existingReview) return reuseReview(existingReview);
|
|
91
|
+
const rejected = await db.selectFrom("_dineway_review_requests").select([
|
|
92
|
+
"id",
|
|
93
|
+
"status",
|
|
94
|
+
"review_payload",
|
|
95
|
+
"resolved_by_actor_type",
|
|
96
|
+
"resolved_by_actor_id"
|
|
97
|
+
]).where("collection", "=", built.collection).where("entry_id", "=", built.entryId).where("status", "=", "rejected").execute();
|
|
98
|
+
checks.push(sql`NOT EXISTS (SELECT 1 FROM _dineway_review_jobs WHERE target_key = ${targetKey})`, sql`(SELECT COUNT(*) FROM _dineway_review_requests WHERE collection = ${built.collection} AND entry_id = ${built.entryId} AND status = 'rejected') = ${rejected.length}`, ...rejected.map((row) => rowUnchanged("_dineway_review_requests", row)));
|
|
99
|
+
for (const row of rejected) {
|
|
100
|
+
if (isSupersededReview(row)) continue;
|
|
101
|
+
if (await buildStableHash(z.object({ diff: z.object({ draft: z.unknown().optional() }).optional() }).parse(JSON.parse(row.review_payload)).diff?.draft) === contentHash) throw new ReviewSubmissionError("This content was rejected. Change it before submitting a new review.");
|
|
102
|
+
}
|
|
103
|
+
const approved = await reviews.findApprovedForTarget(built);
|
|
104
|
+
if (approved) return reuseReview(approved);
|
|
105
|
+
const pendingQuery = db.selectFrom("_dineway_review_requests").where("collection", "=", built.collection).where("entry_id", "=", built.entryId).where("action_type", "=", built.actionType).where("reviewed_rev", "=", built.reviewedRev).where("action_hash", "=", built.actionHash).where("status", "=", "pending").where("revoked_at", "is", null);
|
|
106
|
+
const pending = await pendingQuery.selectAll().orderBy("created_at").orderBy("id").executeTakeFirst();
|
|
107
|
+
checks.push(pending ? rowUnchanged("_dineway_review_requests", pending) : sql`NOT EXISTS ${pendingQuery.select("id")}`);
|
|
108
|
+
const prepared = pending ? null : reviews.prepareCreate({
|
|
109
|
+
...built,
|
|
110
|
+
riskReason: input.riskReason,
|
|
111
|
+
requestedByActorType: input.actor.actorType,
|
|
112
|
+
requestedByActorId: input.actor.actorId,
|
|
113
|
+
requestedAuthMetadata: input.actor.authMetadata
|
|
114
|
+
});
|
|
115
|
+
const reviewId = pending?.id ?? prepared.id;
|
|
116
|
+
const supersession = await prepareSupersession();
|
|
117
|
+
checks.push(...supersession.checks);
|
|
118
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
119
|
+
const job = db.insertInto("_dineway_review_jobs").values({
|
|
120
|
+
review_id: reviewId,
|
|
121
|
+
target_key: targetKey,
|
|
122
|
+
content_hash: contentHash,
|
|
123
|
+
state: "queued",
|
|
124
|
+
release_state: "none",
|
|
125
|
+
evidence_json: null,
|
|
126
|
+
reason: "Automated review in progress",
|
|
127
|
+
release_reason: null,
|
|
128
|
+
scheduled_at: scheduledAt,
|
|
129
|
+
created_at: now,
|
|
130
|
+
updated_at: now
|
|
131
|
+
}).compile();
|
|
132
|
+
try {
|
|
133
|
+
await atomicBatch(db, {
|
|
134
|
+
checks,
|
|
135
|
+
statements: [
|
|
136
|
+
...supersession.statements,
|
|
137
|
+
...prepared ? [prepared.statement] : [],
|
|
138
|
+
job
|
|
139
|
+
]
|
|
140
|
+
});
|
|
141
|
+
} catch (error) {
|
|
142
|
+
if (error instanceof AtomicWriteConflict) {
|
|
143
|
+
const existing = await findExisting();
|
|
144
|
+
if (existing) return reuseReview(existing);
|
|
145
|
+
}
|
|
146
|
+
throw error;
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
item: await reviews.findById(reviewId),
|
|
150
|
+
created: !pending
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
//#endregion
|
|
155
|
+
export { submitAutomatedReview as n, ReviewSubmissionError as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as TaxonomyRepository } from "./taxonomy-
|
|
3
|
-
import { c as invalidateTaxonomyDefsCache, l as invalidateTermCache } from "./taxonomies-
|
|
1
|
+
import { c as __exportAll } from "./runner-CVeq0266.mjs";
|
|
2
|
+
import { t as TaxonomyRepository } from "./taxonomy-DWxxLpp5.mjs";
|
|
3
|
+
import { c as invalidateTaxonomyDefsCache, l as invalidateTermCache } from "./taxonomies-CllxqaH0.mjs";
|
|
4
4
|
import { ulid } from "ulidx";
|
|
5
5
|
|
|
6
6
|
//#region src/api/handlers/taxonomies.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as __exportAll } from "./runner-CVeq0266.mjs";
|
|
2
2
|
import { getRequestContext } from "./request-context.mjs";
|
|
3
|
-
import { a as resetTaxonomyNamesCache, o as isMissingTableError, r as getDb } from "./loader-
|
|
4
|
-
import { d as invalidateTaxonomyObjectCache, f as isObjectCacheActive, n as cachedQuery, t as CacheNamespace } from "./object-cache-
|
|
5
|
-
import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-
|
|
6
|
-
import { i as setRequestCacheEntry, n as peekRequestCache, r as requestCached } from "./request-cache-
|
|
7
|
-
import { n as resolveLocaleChain, t as resolveLocale } from "./resolve-
|
|
3
|
+
import { a as resetTaxonomyNamesCache, o as isMissingTableError, r as getDb } from "./loader-Cgsx23wU.mjs";
|
|
4
|
+
import { d as invalidateTaxonomyObjectCache, f as isObjectCacheActive, n as cachedQuery, t as CacheNamespace } from "./object-cache-BGjIlY9s.mjs";
|
|
5
|
+
import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-BnG3LPMN.mjs";
|
|
6
|
+
import { i as setRequestCacheEntry, n as peekRequestCache, r as requestCached } from "./request-cache-DPmV5nk4.mjs";
|
|
7
|
+
import { n as resolveLocaleChain, t as resolveLocale } from "./resolve-C80Pm2DW.mjs";
|
|
8
8
|
|
|
9
9
|
//#region src/taxonomies/index.ts
|
|
10
10
|
/**
|
|
@@ -393,7 +393,7 @@ function primeFoldedEntryTerms(collection, perEntry, options = {}) {
|
|
|
393
393
|
* Get entries by term.
|
|
394
394
|
*/
|
|
395
395
|
async function getEntriesByTerm(collection, taxonomyName, termSlug, options = {}) {
|
|
396
|
-
const { getDinewayCollection } = await import("./query-
|
|
396
|
+
const { getDinewayCollection } = await import("./query-CEn9HXnf.mjs").then((n) => n.o);
|
|
397
397
|
const queryOptions = { where: { [taxonomyName]: termSlug } };
|
|
398
398
|
if (options.locale !== void 0) queryOptions.locale = options.locale;
|
|
399
399
|
const { entries } = await getDinewayCollection(collection, queryOptions);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as invalidateTaxonomyObjectCache } from "./object-cache-
|
|
1
|
+
import { c as __exportAll } from "./runner-CVeq0266.mjs";
|
|
2
|
+
import { d as invalidateTaxonomyObjectCache } from "./object-cache-BGjIlY9s.mjs";
|
|
3
3
|
import { ulid } from "ulidx";
|
|
4
4
|
|
|
5
5
|
//#region src/database/repositories/taxonomy.ts
|
|
@@ -226,7 +226,7 @@ var TaxonomyRepository = class {
|
|
|
226
226
|
*/
|
|
227
227
|
async countEntriesForTerms(translationGroups) {
|
|
228
228
|
if (translationGroups.length === 0) return /* @__PURE__ */ new Map();
|
|
229
|
-
const { chunks, SQL_BATCH_SIZE } = await import("./chunks-
|
|
229
|
+
const { chunks, SQL_BATCH_SIZE } = await import("./chunks-BnG3LPMN.mjs").then((n) => n.r);
|
|
230
230
|
const counts = /* @__PURE__ */ new Map();
|
|
231
231
|
for (const chunk of chunks(translationGroups, SQL_BATCH_SIZE)) {
|
|
232
232
|
const rows = await this.db.selectFrom("content_taxonomies").select(["taxonomy_id", (eb) => eb.fn.count("entry_id").as("count")]).where("taxonomy_id", "in", chunk).groupBy("taxonomy_id").execute();
|
|
@@ -1,25 +1,17 @@
|
|
|
1
|
+
import { t as readRuntimeEnv } from "./runtime-env-CQVAWHzH.mjs";
|
|
2
|
+
|
|
1
3
|
//#region src/auth/trusted-proxy.ts
|
|
2
4
|
/**
|
|
3
5
|
* RFC 7230 token characters for HTTP header names.
|
|
4
6
|
* Invalid names throw when passed to `Headers.get()`.
|
|
5
7
|
*/
|
|
6
8
|
const HEADER_NAME_PATTERN = /^[!#$%&'*+\-.^_`|~0-9a-z]+$/;
|
|
7
|
-
/** Cache for the env-derived value. `null` means "not yet parsed". */
|
|
8
|
-
let envCache = null;
|
|
9
9
|
function normalizeTrustedHeaders(names) {
|
|
10
10
|
return names.map((name) => name.trim().toLowerCase()).filter((name) => name.length > 0 && HEADER_NAME_PATTERN.test(name));
|
|
11
11
|
}
|
|
12
12
|
function getEnvTrustedHeaders() {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
const importMetaEnv = import.meta.env;
|
|
17
|
-
raw = (typeof process !== "undefined" ? process.env?.DINEWAY_TRUSTED_PROXY_HEADERS : void 0) || importMetaEnv?.DINEWAY_TRUSTED_PROXY_HEADERS;
|
|
18
|
-
} catch {
|
|
19
|
-
raw = void 0;
|
|
20
|
-
}
|
|
21
|
-
envCache = raw ? normalizeTrustedHeaders(raw.split(",")) : [];
|
|
22
|
-
return envCache;
|
|
13
|
+
const raw = readRuntimeEnv("DINEWAY_TRUSTED_PROXY_HEADERS");
|
|
14
|
+
return raw ? normalizeTrustedHeaders(raw.split(",")) : [];
|
|
23
15
|
}
|
|
24
16
|
function getTrustedProxyHeaders(config) {
|
|
25
17
|
if (config?.trustedProxyHeaders !== void 0) return normalizeTrustedHeaders(config.trustedProxyHeaders);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as encodeBase64, t as decodeBase64 } from "./base64-
|
|
1
|
+
import { c as __exportAll } from "./runner-CVeq0266.mjs";
|
|
2
|
+
import { r as encodeBase64, t as decodeBase64 } from "./base64-Cz-aU0X1.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/database/repositories/types.ts
|
|
5
5
|
var types_exports = /* @__PURE__ */ __exportAll({
|