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,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import { o as
|
|
5
|
-
import { t as
|
|
6
|
-
import {
|
|
1
|
+
import { AtomicWriteConflict, atomicBatch, rowUnchanged } from "./database/batch.mjs";
|
|
2
|
+
import { r as currentIsoTimestampValue } from "./dialect-helpers-C6xtO-Ui.mjs";
|
|
3
|
+
import { a as hashApiToken, n as TOKEN_PREFIXES, r as generatePrefixedToken, t as ALL_VALID_SCOPES } from "./api-tokens-D5K_Csub.mjs";
|
|
4
|
+
import { a as filterExperimentalSiteContextWorkflowScopes, i as experimentalSiteContextWorkflowsEnabled, o as getExperimentalSiteContextWorkflowScopesDisabledMessage, r as disabledExperimentalSiteContextWorkflowScopes } from "./experimental-workflows-M5D3RTFo.mjs";
|
|
5
|
+
import { t as readTokenAuthority } from "./oauth-authority-CCqo4eBm.mjs";
|
|
6
|
+
import { sql } from "kysely";
|
|
7
|
+
import { clampScopes, toRoleLevel } from "@dineway-ai/auth";
|
|
7
8
|
import { generateCodeVerifier } from "arctic";
|
|
8
9
|
|
|
9
10
|
//#region src/api/handlers/device-flow.ts
|
|
@@ -200,57 +201,72 @@ async function handleDeviceTokenExchange(db, input) {
|
|
|
200
201
|
message: "Invalid device code state"
|
|
201
202
|
}
|
|
202
203
|
};
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}
|
|
251
|
-
};
|
|
204
|
+
const authority = await readTokenAuthority(db, row.user_id);
|
|
205
|
+
if (!authority.user || authority.user.disabled) return {
|
|
206
|
+
success: false,
|
|
207
|
+
error: {
|
|
208
|
+
code: "INVALID_GRANT",
|
|
209
|
+
message: "User account is unavailable"
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
const scopes = clampScopes(filterExperimentalSiteContextWorkflowScopes(JSON.parse(row.scopes)), authority.user.role, { includeExperimental: experimentalSiteContextWorkflowsEnabled() });
|
|
213
|
+
if (scopes.length === 0) return {
|
|
214
|
+
success: false,
|
|
215
|
+
error: {
|
|
216
|
+
code: "INVALID_GRANT",
|
|
217
|
+
message: "Device code no longer supports any permitted scopes"
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
const accessToken = generatePrefixedToken(TOKEN_PREFIXES.OAUTH_ACCESS);
|
|
221
|
+
const accessExpires = expiresAt(ACCESS_TOKEN_TTL_SECONDS);
|
|
222
|
+
const refreshToken = generatePrefixedToken(TOKEN_PREFIXES.OAUTH_REFRESH);
|
|
223
|
+
const refreshExpires = expiresAt(REFRESH_TOKEN_TTL_SECONDS);
|
|
224
|
+
await atomicBatch(db, {
|
|
225
|
+
checks: [
|
|
226
|
+
rowUnchanged("_dineway_device_codes", row),
|
|
227
|
+
...authority.checks,
|
|
228
|
+
sql`EXISTS (SELECT 1 FROM _dineway_device_codes WHERE device_code = ${input.device_code} AND expires_at > ${currentIsoTimestampValue(db)})`
|
|
229
|
+
],
|
|
230
|
+
statements: [
|
|
231
|
+
db.deleteFrom("_dineway_device_codes").where("device_code", "=", input.device_code).compile(),
|
|
232
|
+
db.insertInto("_dineway_oauth_tokens").values({
|
|
233
|
+
token_hash: accessToken.hash,
|
|
234
|
+
token_type: "access",
|
|
235
|
+
user_id: row.user_id,
|
|
236
|
+
scopes: JSON.stringify(scopes),
|
|
237
|
+
client_type: "cli",
|
|
238
|
+
expires_at: accessExpires,
|
|
239
|
+
refresh_token_hash: refreshToken.hash
|
|
240
|
+
}).compile(),
|
|
241
|
+
db.insertInto("_dineway_oauth_tokens").values({
|
|
242
|
+
token_hash: refreshToken.hash,
|
|
243
|
+
token_type: "refresh",
|
|
244
|
+
user_id: row.user_id,
|
|
245
|
+
scopes: JSON.stringify(scopes),
|
|
246
|
+
client_type: "cli",
|
|
247
|
+
expires_at: refreshExpires,
|
|
248
|
+
refresh_token_hash: null
|
|
249
|
+
}).compile()
|
|
250
|
+
]
|
|
252
251
|
});
|
|
253
|
-
|
|
252
|
+
return {
|
|
253
|
+
success: true,
|
|
254
|
+
data: {
|
|
255
|
+
access_token: accessToken.raw,
|
|
256
|
+
refresh_token: refreshToken.raw,
|
|
257
|
+
token_type: "Bearer",
|
|
258
|
+
expires_in: ACCESS_TOKEN_TTL_SECONDS,
|
|
259
|
+
scope: scopes.join(" ")
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
} catch (error) {
|
|
263
|
+
if (error instanceof AtomicWriteConflict) return {
|
|
264
|
+
success: false,
|
|
265
|
+
error: {
|
|
266
|
+
code: "INVALID_GRANT",
|
|
267
|
+
message: "Device code or account authorization changed"
|
|
268
|
+
}
|
|
269
|
+
};
|
|
254
270
|
return {
|
|
255
271
|
success: false,
|
|
256
272
|
error: {
|
|
@@ -291,8 +307,24 @@ async function handleDeviceAuthorize(db, userId, userRole, input) {
|
|
|
291
307
|
}
|
|
292
308
|
};
|
|
293
309
|
}
|
|
310
|
+
const authority = await readTokenAuthority(db, userId);
|
|
311
|
+
if (!authority.user || authority.user.disabled) return {
|
|
312
|
+
success: false,
|
|
313
|
+
error: {
|
|
314
|
+
code: "FORBIDDEN",
|
|
315
|
+
message: "User account is unavailable"
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
const checks = [
|
|
319
|
+
rowUnchanged("_dineway_device_codes", match),
|
|
320
|
+
...authority.checks,
|
|
321
|
+
sql`EXISTS (SELECT 1 FROM _dineway_device_codes WHERE device_code = ${match.device_code} AND expires_at > ${currentIsoTimestampValue(db)})`
|
|
322
|
+
];
|
|
294
323
|
if ((input.action ?? "approve") === "deny") {
|
|
295
|
-
await db
|
|
324
|
+
await atomicBatch(db, {
|
|
325
|
+
checks,
|
|
326
|
+
statements: [db.updateTable("_dineway_device_codes").set({ status: "denied" }).where("device_code", "=", match.device_code).compile()]
|
|
327
|
+
});
|
|
296
328
|
return {
|
|
297
329
|
success: true,
|
|
298
330
|
data: { authorized: false }
|
|
@@ -306,7 +338,7 @@ async function handleDeviceAuthorize(db, userId, userRole, input) {
|
|
|
306
338
|
message: getExperimentalSiteContextWorkflowScopesDisabledMessage()
|
|
307
339
|
}
|
|
308
340
|
};
|
|
309
|
-
const effectiveScopes = clampScopes(requestedScopes, userRole, { includeExperimental: experimentalSiteContextWorkflowsEnabled() });
|
|
341
|
+
const effectiveScopes = clampScopes(requestedScopes, toRoleLevel(Math.min(userRole, authority.user.role)), { includeExperimental: experimentalSiteContextWorkflowsEnabled() });
|
|
310
342
|
if (effectiveScopes.length === 0) return {
|
|
311
343
|
success: false,
|
|
312
344
|
error: {
|
|
@@ -314,16 +346,26 @@ async function handleDeviceAuthorize(db, userId, userRole, input) {
|
|
|
314
346
|
message: "Your role does not permit any of the requested scopes"
|
|
315
347
|
}
|
|
316
348
|
};
|
|
317
|
-
await db
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
349
|
+
await atomicBatch(db, {
|
|
350
|
+
checks,
|
|
351
|
+
statements: [db.updateTable("_dineway_device_codes").set({
|
|
352
|
+
status: "authorized",
|
|
353
|
+
user_id: userId,
|
|
354
|
+
scopes: JSON.stringify(effectiveScopes)
|
|
355
|
+
}).where("device_code", "=", match.device_code).compile()]
|
|
356
|
+
});
|
|
322
357
|
return {
|
|
323
358
|
success: true,
|
|
324
359
|
data: { authorized: true }
|
|
325
360
|
};
|
|
326
|
-
} catch {
|
|
361
|
+
} catch (error) {
|
|
362
|
+
if (error instanceof AtomicWriteConflict) return {
|
|
363
|
+
success: false,
|
|
364
|
+
error: {
|
|
365
|
+
code: "INVALID_CODE",
|
|
366
|
+
message: "Device code or account authorization changed"
|
|
367
|
+
}
|
|
368
|
+
};
|
|
327
369
|
return {
|
|
328
370
|
success: false,
|
|
329
371
|
error: {
|
|
@@ -365,8 +407,7 @@ async function handleTokenRefresh(db, input) {
|
|
|
365
407
|
}
|
|
366
408
|
};
|
|
367
409
|
if (new Date(row.expires_at) < /* @__PURE__ */ new Date()) {
|
|
368
|
-
await db.deleteFrom("_dineway_oauth_tokens").where("token_hash", "=", refreshHash).execute();
|
|
369
|
-
await db.deleteFrom("_dineway_oauth_tokens").where("refresh_token_hash", "=", refreshHash).execute();
|
|
410
|
+
await db.deleteFrom("_dineway_oauth_tokens").where((eb) => eb.or([eb("token_hash", "=", refreshHash), eb("refresh_token_hash", "=", refreshHash)])).execute();
|
|
370
411
|
return {
|
|
371
412
|
success: false,
|
|
372
413
|
error: {
|
|
@@ -375,7 +416,8 @@ async function handleTokenRefresh(db, input) {
|
|
|
375
416
|
}
|
|
376
417
|
};
|
|
377
418
|
}
|
|
378
|
-
const
|
|
419
|
+
const authority = await readTokenAuthority(db, row.user_id, row.client_id);
|
|
420
|
+
const userInfo = authority.user;
|
|
379
421
|
if (!userInfo) {
|
|
380
422
|
await db.deleteFrom("_dineway_oauth_tokens").where("user_id", "=", row.user_id).execute();
|
|
381
423
|
return {
|
|
@@ -398,12 +440,11 @@ async function handleTokenRefresh(db, input) {
|
|
|
398
440
|
}
|
|
399
441
|
let scopes = clampScopes(filterExperimentalSiteContextWorkflowScopes(JSON.parse(row.scopes)), userInfo.role, { includeExperimental: experimentalSiteContextWorkflowsEnabled() });
|
|
400
442
|
if (row.client_id) {
|
|
401
|
-
const client =
|
|
443
|
+
const client = authority.client;
|
|
402
444
|
if (client?.scopes?.length) scopes = scopes.filter((s) => client.scopes.includes(s));
|
|
403
445
|
}
|
|
404
|
-
if (scopes.length === 0) {
|
|
405
|
-
await db.deleteFrom("_dineway_oauth_tokens").where("token_hash", "=", refreshHash).execute();
|
|
406
|
-
await db.deleteFrom("_dineway_oauth_tokens").where("refresh_token_hash", "=", refreshHash).execute();
|
|
446
|
+
if (scopes.length === 0 || row.client_id && !authority.client) {
|
|
447
|
+
await db.deleteFrom("_dineway_oauth_tokens").where((eb) => eb.or([eb("token_hash", "=", refreshHash), eb("refresh_token_hash", "=", refreshHash)])).execute();
|
|
407
448
|
return {
|
|
408
449
|
success: false,
|
|
409
450
|
error: {
|
|
@@ -412,18 +453,25 @@ async function handleTokenRefresh(db, input) {
|
|
|
412
453
|
}
|
|
413
454
|
};
|
|
414
455
|
}
|
|
415
|
-
await db.deleteFrom("_dineway_oauth_tokens").where("refresh_token_hash", "=", refreshHash).where("token_type", "=", "access").execute();
|
|
416
456
|
const accessToken = generatePrefixedToken(TOKEN_PREFIXES.OAUTH_ACCESS);
|
|
417
457
|
const accessExpires = expiresAt(ACCESS_TOKEN_TTL_SECONDS);
|
|
418
|
-
await db
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
458
|
+
await atomicBatch(db, {
|
|
459
|
+
checks: [
|
|
460
|
+
rowUnchanged("_dineway_oauth_tokens", row),
|
|
461
|
+
...authority.checks,
|
|
462
|
+
sql`EXISTS (SELECT 1 FROM _dineway_oauth_tokens WHERE token_hash = ${refreshHash} AND expires_at > ${currentIsoTimestampValue(db)})`
|
|
463
|
+
],
|
|
464
|
+
statements: [db.deleteFrom("_dineway_oauth_tokens").where("refresh_token_hash", "=", refreshHash).where("token_type", "=", "access").compile(), db.insertInto("_dineway_oauth_tokens").values({
|
|
465
|
+
token_hash: accessToken.hash,
|
|
466
|
+
token_type: "access",
|
|
467
|
+
user_id: row.user_id,
|
|
468
|
+
scopes: JSON.stringify(scopes),
|
|
469
|
+
client_type: row.client_type,
|
|
470
|
+
expires_at: accessExpires,
|
|
471
|
+
refresh_token_hash: refreshHash,
|
|
472
|
+
client_id: row.client_id
|
|
473
|
+
}).compile()]
|
|
474
|
+
});
|
|
427
475
|
return {
|
|
428
476
|
success: true,
|
|
429
477
|
data: {
|
|
@@ -455,19 +503,7 @@ async function handleTokenRefresh(db, input) {
|
|
|
455
503
|
async function handleTokenRevoke(db, input) {
|
|
456
504
|
try {
|
|
457
505
|
const hash = hashApiToken(input.token);
|
|
458
|
-
|
|
459
|
-
"token_hash",
|
|
460
|
-
"token_type",
|
|
461
|
-
"refresh_token_hash"
|
|
462
|
-
]).where("token_hash", "=", hash).executeTakeFirst();
|
|
463
|
-
if (!row) return {
|
|
464
|
-
success: true,
|
|
465
|
-
data: { revoked: true }
|
|
466
|
-
};
|
|
467
|
-
if (row.token_type === "refresh") {
|
|
468
|
-
await db.deleteFrom("_dineway_oauth_tokens").where("refresh_token_hash", "=", hash).execute();
|
|
469
|
-
await db.deleteFrom("_dineway_oauth_tokens").where("token_hash", "=", hash).execute();
|
|
470
|
-
} else await db.deleteFrom("_dineway_oauth_tokens").where("token_hash", "=", hash).execute();
|
|
506
|
+
await db.deleteFrom("_dineway_oauth_tokens").where((eb) => eb.or([eb("token_hash", "=", hash), eb("refresh_token_hash", "=", hash)])).execute();
|
|
471
507
|
return {
|
|
472
508
|
success: true,
|
|
473
509
|
data: { revoked: true }
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as validateIdentifier } from "./validate-
|
|
2
|
-
import { i as encodeCursor, r as decodeCursor } from "./types-
|
|
3
|
-
import { n as publicDiscoveryExclusions } from "./public-discovery-
|
|
4
|
-
import { n as SchemaRegistry } from "./registry-
|
|
5
|
-
import { t as resolveContentUrl } from "./public-url-
|
|
1
|
+
import { t as validateIdentifier } from "./validate-Co3j6T_K.mjs";
|
|
2
|
+
import { i as encodeCursor, r as decodeCursor } from "./types-BqxIv8Il.mjs";
|
|
3
|
+
import { n as publicDiscoveryExclusions } from "./public-discovery-BAbOvKiR.mjs";
|
|
4
|
+
import { n as SchemaRegistry } from "./registry-RD9qTnYL.mjs";
|
|
5
|
+
import { t as resolveContentUrl } from "./public-url-C7pbmS_7.mjs";
|
|
6
6
|
import { sql } from "kysely";
|
|
7
7
|
|
|
8
8
|
//#region src/seo/canonical-url.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { i as encodeBase64url } from "./base64-
|
|
2
|
-
import { t as MediaRepository } from "./media-
|
|
3
|
-
import { t as buildStableHash } from "./stable-hash-
|
|
4
|
-
import { a as selectActiveBriefingContextEntries,
|
|
5
|
-
import { s as
|
|
6
|
-
import {
|
|
7
|
-
import { r as ssrfSafeFetch } from "./ssrf-
|
|
1
|
+
import { i as encodeBase64url } from "./base64-Cz-aU0X1.mjs";
|
|
2
|
+
import { t as MediaRepository } from "./media-3fK0u-bo.mjs";
|
|
3
|
+
import { t as buildStableHash } from "./stable-hash-DEtJgcp7.mjs";
|
|
4
|
+
import { a as selectActiveBriefingContextEntries, d as ContextRepository, i as parseSiteBriefingScope } from "./briefing-CkCi6S-W.mjs";
|
|
5
|
+
import { n as sha256, s as readBoundedBytes } from "./runs-B5BExdKO.mjs";
|
|
6
|
+
import { c as loadContentMediaUsageFields } from "./content-refresh-l4mPoGeX.mjs";
|
|
7
|
+
import { r as ssrfSafeFetch } from "./ssrf-LN16WMip.mjs";
|
|
8
8
|
import { imageSize } from "image-size";
|
|
9
9
|
|
|
10
10
|
//#region src/review-automation/evidence.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as __exportAll } from "./runner-CVeq0266.mjs";
|
|
2
2
|
import { getRequestContext } from "./request-context.mjs";
|
|
3
|
-
import { t as after } from "./after-
|
|
4
|
-
import { r as requestCached } from "./request-cache-
|
|
5
|
-
import { n as BylineSchemaRegistry } from "./byline-registry-
|
|
6
|
-
import { n as invalidateProcessCache, r as processCachedAsync, t as createProcessCache } from "./process-cache-
|
|
3
|
+
import { t as after } from "./after-BVaUn7bK.mjs";
|
|
4
|
+
import { r as requestCached } from "./request-cache-DPmV5nk4.mjs";
|
|
5
|
+
import { n as BylineSchemaRegistry } from "./byline-registry-CkuVVeJJ.mjs";
|
|
6
|
+
import { n as invalidateProcessCache, r as processCachedAsync, t as createProcessCache } from "./process-cache-MHM4Sqzs.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/bylines/field-defs-cache.ts
|
|
9
9
|
var field_defs_cache_exports = /* @__PURE__ */ __exportAll({ getBylineFieldDefs: () => getBylineFieldDefs });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
-
import { ForgewayClient } from "@forgeway/sdk";
|
|
3
2
|
import { chmod, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import { ForgewayClient } from "@forgeway/sdk";
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
5
|
|
|
6
6
|
//#region src/cli/commands/deploy/utils/forgeway-secrets.ts
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { c as __exportAll } from "./runner-CVeq0266.mjs";
|
|
2
|
+
import { atomicBatch } from "./database/batch.mjs";
|
|
3
|
+
import { t as validateIdentifier } from "./validate-Co3j6T_K.mjs";
|
|
4
|
+
import { s as isSqlite, u as tableExists } from "./dialect-helpers-C6xtO-Ui.mjs";
|
|
4
5
|
import { sql } from "kysely";
|
|
5
6
|
|
|
6
7
|
//#region src/search/fts-manager.ts
|
|
7
|
-
var fts_manager_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
var fts_manager_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
FTSManager: () => FTSManager,
|
|
10
|
+
parseSearchConfig: () => parseSearchConfig
|
|
11
|
+
});
|
|
8
12
|
/**
|
|
9
13
|
* FTS5 Manager
|
|
10
14
|
*
|
|
@@ -53,8 +57,11 @@ var FTSManager = class {
|
|
|
53
57
|
* @param searchableFields - Array of field names to index
|
|
54
58
|
* @param weights - Optional field weights for ranking
|
|
55
59
|
*/
|
|
56
|
-
async createFtsTable(collectionSlug, searchableFields,
|
|
57
|
-
|
|
60
|
+
async createFtsTable(collectionSlug, searchableFields, weights) {
|
|
61
|
+
await atomicBatch(this.db, { statements: this.createStatements(collectionSlug, searchableFields, weights) });
|
|
62
|
+
}
|
|
63
|
+
createStatements(collectionSlug, searchableFields, _weights) {
|
|
64
|
+
if (!isSqlite(this.db)) return [];
|
|
58
65
|
this.validateInputs(collectionSlug, searchableFields);
|
|
59
66
|
const ftsTable = this.getFtsTableName(collectionSlug);
|
|
60
67
|
const contentTable = this.getContentTableName(collectionSlug);
|
|
@@ -63,15 +70,14 @@ var FTSManager = class {
|
|
|
63
70
|
"locale UNINDEXED",
|
|
64
71
|
...searchableFields
|
|
65
72
|
].join(", ");
|
|
66
|
-
|
|
73
|
+
return [sql.raw(`
|
|
67
74
|
CREATE VIRTUAL TABLE IF NOT EXISTS "${ftsTable}" USING fts5(
|
|
68
75
|
${columns},
|
|
69
76
|
content='${contentTable}',
|
|
70
77
|
content_rowid='rowid',
|
|
71
78
|
tokenize='porter unicode61'
|
|
72
79
|
)
|
|
73
|
-
`).
|
|
74
|
-
await this.createTriggers(collectionSlug, searchableFields);
|
|
80
|
+
`).compile(this.db), ...this.triggerStatements(collectionSlug, searchableFields)];
|
|
75
81
|
}
|
|
76
82
|
/**
|
|
77
83
|
* Create triggers to keep FTS table in sync with content table.
|
|
@@ -80,14 +86,15 @@ var FTSManager = class {
|
|
|
80
86
|
* `deleted_at IS NULL`. This keeps soft-deleted content out of the
|
|
81
87
|
* index and keeps repair counts aligned with searchable content.
|
|
82
88
|
*/
|
|
83
|
-
|
|
89
|
+
triggerStatements(collectionSlug, searchableFields) {
|
|
90
|
+
const statements = [];
|
|
84
91
|
this.validateInputs(collectionSlug, searchableFields);
|
|
85
92
|
const ftsTable = this.getFtsTableName(collectionSlug);
|
|
86
93
|
const contentTable = this.getContentTableName(collectionSlug);
|
|
87
94
|
const fieldList = searchableFields.join(", ");
|
|
88
95
|
const newFieldList = searchableFields.map((f) => `NEW.${f}`).join(", ");
|
|
89
96
|
const oldFieldList = searchableFields.map((f) => `OLD.${f}`).join(", ");
|
|
90
|
-
|
|
97
|
+
statements.push(sql.raw(`
|
|
91
98
|
CREATE TRIGGER IF NOT EXISTS "${ftsTable}_insert"
|
|
92
99
|
AFTER INSERT ON "${contentTable}"
|
|
93
100
|
WHEN NEW.deleted_at IS NULL
|
|
@@ -95,8 +102,8 @@ var FTSManager = class {
|
|
|
95
102
|
INSERT INTO "${ftsTable}"(rowid, id, locale, ${fieldList})
|
|
96
103
|
VALUES (NEW.rowid, NEW.id, NEW.locale, ${newFieldList});
|
|
97
104
|
END
|
|
98
|
-
`).
|
|
99
|
-
|
|
105
|
+
`).compile(this.db));
|
|
106
|
+
statements.push(sql.raw(`
|
|
100
107
|
CREATE TRIGGER IF NOT EXISTS "${ftsTable}_update"
|
|
101
108
|
AFTER UPDATE ON "${contentTable}"
|
|
102
109
|
BEGIN
|
|
@@ -107,8 +114,8 @@ var FTSManager = class {
|
|
|
107
114
|
SELECT NEW.rowid, NEW.id, NEW.locale, ${newFieldList}
|
|
108
115
|
WHERE NEW.deleted_at IS NULL;
|
|
109
116
|
END
|
|
110
|
-
`).
|
|
111
|
-
|
|
117
|
+
`).compile(this.db));
|
|
118
|
+
statements.push(sql.raw(`
|
|
112
119
|
CREATE TRIGGER IF NOT EXISTS "${ftsTable}_delete"
|
|
113
120
|
AFTER DELETE ON "${contentTable}"
|
|
114
121
|
WHEN OLD.deleted_at IS NULL
|
|
@@ -116,79 +123,73 @@ var FTSManager = class {
|
|
|
116
123
|
INSERT INTO "${ftsTable}"("${ftsTable}", rowid, id, locale, ${fieldList})
|
|
117
124
|
VALUES ('delete', OLD.rowid, OLD.id, OLD.locale, ${oldFieldList});
|
|
118
125
|
END
|
|
119
|
-
`).
|
|
126
|
+
`).compile(this.db));
|
|
127
|
+
return statements;
|
|
120
128
|
}
|
|
121
129
|
/**
|
|
122
130
|
* Drop triggers for a collection
|
|
123
131
|
*/
|
|
124
|
-
|
|
132
|
+
dropStatements(collectionSlug) {
|
|
133
|
+
if (!isSqlite(this.db)) return [];
|
|
125
134
|
this.validateInputs(collectionSlug);
|
|
126
135
|
const ftsTable = this.getFtsTableName(collectionSlug);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
136
|
+
return [...[
|
|
137
|
+
"insert",
|
|
138
|
+
"update",
|
|
139
|
+
"delete"
|
|
140
|
+
].map((suffix) => sql`DROP TRIGGER IF EXISTS ${sql.ref(`${ftsTable}_${suffix}`)}`.compile(this.db)), sql`DROP TABLE IF EXISTS ${sql.ref(ftsTable)}`.compile(this.db)];
|
|
130
141
|
}
|
|
131
|
-
/**
|
|
132
|
-
* Drop the FTS table and triggers for a collection
|
|
133
|
-
*/
|
|
134
142
|
async dropFtsTable(collectionSlug) {
|
|
135
|
-
|
|
136
|
-
this.validateInputs(collectionSlug);
|
|
137
|
-
const ftsTable = this.getFtsTableName(collectionSlug);
|
|
138
|
-
await this.dropTriggers(collectionSlug);
|
|
139
|
-
await sql.raw(`DROP TABLE IF EXISTS "${ftsTable}"`).execute(this.db);
|
|
143
|
+
await atomicBatch(this.db, { statements: this.dropStatements(collectionSlug) });
|
|
140
144
|
}
|
|
141
145
|
/**
|
|
142
146
|
* Rebuild the FTS index for a collection
|
|
143
147
|
*
|
|
144
148
|
* This is useful after bulk imports or if the index gets out of sync.
|
|
145
149
|
*/
|
|
150
|
+
rebuildStatements(collectionSlug, searchableFields, weights) {
|
|
151
|
+
if (!isSqlite(this.db)) return [];
|
|
152
|
+
return [
|
|
153
|
+
...this.dropStatements(collectionSlug),
|
|
154
|
+
...this.createStatements(collectionSlug, searchableFields, weights),
|
|
155
|
+
this.populateStatement(collectionSlug, searchableFields)
|
|
156
|
+
];
|
|
157
|
+
}
|
|
146
158
|
async rebuildIndex(collectionSlug, searchableFields, weights) {
|
|
147
|
-
|
|
148
|
-
await this.dropFtsTable(collectionSlug);
|
|
149
|
-
await this.createFtsTable(collectionSlug, searchableFields, weights);
|
|
150
|
-
await this.populateFromContent(collectionSlug, searchableFields);
|
|
159
|
+
await atomicBatch(this.db, { statements: this.rebuildStatements(collectionSlug, searchableFields, weights) });
|
|
151
160
|
}
|
|
152
161
|
/**
|
|
153
162
|
* Populate the FTS table from existing content
|
|
154
163
|
*/
|
|
155
164
|
async populateFromContent(collectionSlug, searchableFields) {
|
|
156
165
|
if (!isSqlite(this.db)) return;
|
|
166
|
+
await this.db.executeQuery(this.populateStatement(collectionSlug, searchableFields));
|
|
167
|
+
}
|
|
168
|
+
populateStatement(collectionSlug, searchableFields) {
|
|
157
169
|
this.validateInputs(collectionSlug, searchableFields);
|
|
158
170
|
const ftsTable = this.getFtsTableName(collectionSlug);
|
|
159
171
|
const contentTable = this.getContentTableName(collectionSlug);
|
|
160
172
|
const fieldList = searchableFields.join(", ");
|
|
161
|
-
|
|
173
|
+
return sql.raw(`
|
|
162
174
|
INSERT INTO "${ftsTable}"(rowid, id, locale, ${fieldList})
|
|
163
175
|
SELECT rowid, id, locale, ${fieldList} FROM "${contentTable}"
|
|
164
176
|
WHERE deleted_at IS NULL
|
|
165
|
-
`).
|
|
177
|
+
`).compile(this.db);
|
|
166
178
|
}
|
|
167
179
|
/**
|
|
168
180
|
* Get the search configuration for a collection
|
|
169
181
|
*/
|
|
170
182
|
async getSearchConfig(collectionSlug) {
|
|
171
|
-
|
|
172
|
-
if (!result?.search_config) return null;
|
|
173
|
-
try {
|
|
174
|
-
const parsed = JSON.parse(result.search_config);
|
|
175
|
-
if (typeof parsed !== "object" || parsed === null || !("enabled" in parsed) || typeof parsed.enabled !== "boolean") return null;
|
|
176
|
-
const config = { enabled: parsed.enabled };
|
|
177
|
-
if ("weights" in parsed && typeof parsed.weights === "object" && parsed.weights !== null) {
|
|
178
|
-
const weights = {};
|
|
179
|
-
for (const [k, v] of Object.entries(parsed.weights)) if (typeof v === "number") weights[k] = v;
|
|
180
|
-
config.weights = weights;
|
|
181
|
-
}
|
|
182
|
-
return config;
|
|
183
|
-
} catch {
|
|
184
|
-
return null;
|
|
185
|
-
}
|
|
183
|
+
return parseSearchConfig((await this.db.selectFrom("_dineway_collections").select("search_config").where("slug", "=", collectionSlug).executeTakeFirst())?.search_config ?? null);
|
|
186
184
|
}
|
|
187
185
|
/**
|
|
188
186
|
* Update the search configuration for a collection
|
|
189
187
|
*/
|
|
188
|
+
configStatement(collectionSlug, config) {
|
|
189
|
+
return this.db.updateTable("_dineway_collections").set({ search_config: JSON.stringify(config) }).where("slug", "=", collectionSlug).compile();
|
|
190
|
+
}
|
|
190
191
|
async setSearchConfig(collectionSlug, config) {
|
|
191
|
-
await this.db.
|
|
192
|
+
await this.db.executeQuery(this.configStatement(collectionSlug, config));
|
|
192
193
|
}
|
|
193
194
|
/**
|
|
194
195
|
* Get searchable fields for a collection
|
|
@@ -208,11 +209,10 @@ var FTSManager = class {
|
|
|
208
209
|
if (!isSqlite(this.db)) throw new Error("Full-text search is only available with SQLite databases");
|
|
209
210
|
const searchableFields = await this.getSearchableFields(collectionSlug);
|
|
210
211
|
if (searchableFields.length === 0) throw new Error(`No searchable fields defined for collection "${collectionSlug}". Mark at least one field as searchable before enabling search.`);
|
|
211
|
-
await this.
|
|
212
|
-
await this.setSearchConfig(collectionSlug, {
|
|
212
|
+
await atomicBatch(this.db, { statements: [...this.rebuildStatements(collectionSlug, searchableFields, options?.weights), this.configStatement(collectionSlug, {
|
|
213
213
|
enabled: true,
|
|
214
214
|
weights: options?.weights
|
|
215
|
-
});
|
|
215
|
+
})] });
|
|
216
216
|
}
|
|
217
217
|
/**
|
|
218
218
|
* Disable search for a collection
|
|
@@ -222,11 +222,10 @@ var FTSManager = class {
|
|
|
222
222
|
async disableSearch(collectionSlug) {
|
|
223
223
|
if (!isSqlite(this.db)) return;
|
|
224
224
|
const existing = await this.getSearchConfig(collectionSlug);
|
|
225
|
-
await this.
|
|
226
|
-
await this.setSearchConfig(collectionSlug, {
|
|
225
|
+
await atomicBatch(this.db, { statements: [...this.dropStatements(collectionSlug), this.configStatement(collectionSlug, {
|
|
227
226
|
enabled: false,
|
|
228
227
|
weights: existing?.weights
|
|
229
|
-
});
|
|
228
|
+
})] });
|
|
230
229
|
}
|
|
231
230
|
/**
|
|
232
231
|
* Get index statistics for a collection
|
|
@@ -297,6 +296,22 @@ var FTSManager = class {
|
|
|
297
296
|
return repaired;
|
|
298
297
|
}
|
|
299
298
|
};
|
|
299
|
+
function parseSearchConfig(value) {
|
|
300
|
+
if (!value) return null;
|
|
301
|
+
try {
|
|
302
|
+
const parsed = JSON.parse(value);
|
|
303
|
+
if (typeof parsed !== "object" || parsed === null || !("enabled" in parsed) || typeof parsed.enabled !== "boolean") return null;
|
|
304
|
+
const config = { enabled: parsed.enabled };
|
|
305
|
+
if ("weights" in parsed && typeof parsed.weights === "object" && parsed.weights !== null) {
|
|
306
|
+
const weights = {};
|
|
307
|
+
for (const [k, v] of Object.entries(parsed.weights)) if (typeof v === "number") weights[k] = v;
|
|
308
|
+
config.weights = weights;
|
|
309
|
+
}
|
|
310
|
+
return config;
|
|
311
|
+
} catch {
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
300
315
|
|
|
301
316
|
//#endregion
|
|
302
|
-
export { fts_manager_exports as n, FTSManager as t };
|
|
317
|
+
export { fts_manager_exports as n, parseSearchConfig as r, FTSManager as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as HitlRequestService } from "./site-context-
|
|
2
|
-
import { t as ExperimentalSiteContextWorkflowDisabledError } from "./experimental-workflows-
|
|
1
|
+
import { b as HitlRequestService } from "./site-context-vCiDRr4H.mjs";
|
|
2
|
+
import { t as ExperimentalSiteContextWorkflowDisabledError } from "./experimental-workflows-M5D3RTFo.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/api/handlers/hitl-requests.ts
|
|
5
5
|
const HITL_NOT_FOUND_RE = /not found/i;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import { p as logSiteActivitySafely } from "./activity-events-
|
|
5
|
-
import { t as ExperimentalSiteContextWorkflowDisabledError } from "./experimental-workflows-
|
|
1
|
+
import { i as resolveActorIdentity } from "./actor-DxUAJgQX.mjs";
|
|
2
|
+
import { t as WorkflowHitlCoordinator } from "./site-context-vCiDRr4H.mjs";
|
|
3
|
+
import { t as apiError } from "./error-Dd8LtpG5.mjs";
|
|
4
|
+
import { p as logSiteActivitySafely } from "./activity-events-D-yGV7cW.mjs";
|
|
5
|
+
import { t as ExperimentalSiteContextWorkflowDisabledError } from "./experimental-workflows-M5D3RTFo.mjs";
|
|
6
6
|
import { Role } from "@dineway-ai/auth";
|
|
7
7
|
|
|
8
8
|
//#region src/api/hitl-route-helpers.ts
|