dineway 0.2.33 → 0.2.35
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-BbtYp_4V.mjs} +2 -2
- package/dist/{activity-events-BVo9rMUz.mjs → activity-events-CiFN61xq.mjs} +1 -1
- package/dist/{actor-DrJJsvy6.mjs → actor-DxUAJgQX.mjs} +20 -6
- package/dist/{adapters-DHt3f2lu.d.mts → adapters-Rol-inz6.d.mts} +5 -7
- package/dist/after-BVaUn7bK.mjs +24 -0
- package/dist/{allowed-origins-DGSyhRCz.mjs → allowed-origins-Cp7BI3L9.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-CTf1SLmg.mjs → api-CwhrR7H5.mjs} +55 -1215
- package/dist/api-tokens-DA18zxza.mjs +3 -0
- package/dist/{api-tokens-CSomx-l3.mjs → api-tokens-OAgvq4xg.mjs} +1 -1
- package/dist/{apply-Bs2jXsms.mjs → apply-BTfAReIv.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 +287 -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 +18 -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 +42 -31
- package/dist/astro/routes/api/admin/context/_id_/index.mjs +42 -31
- package/dist/astro/routes/api/admin/context/_id_/review.mjs +47 -36
- package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +47 -36
- package/dist/astro/routes/api/admin/context/diff.mjs +46 -35
- package/dist/astro/routes/api/admin/context/index.mjs +47 -36
- package/dist/astro/routes/api/admin/context/stale.mjs +46 -35
- package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +42 -31
- package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +46 -35
- package/dist/astro/routes/api/admin/hitl-requests/index.mjs +46 -35
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +43 -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 +71 -66
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +71 -66
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +63 -58
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +70 -65
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +70 -65
- package/dist/astro/routes/api/admin/plugins/index.mjs +63 -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 +63 -58
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +70 -65
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +63 -58
- package/dist/astro/routes/api/admin/plugins/updates.mjs +63 -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 +39 -25
- package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +55 -43
- package/dist/astro/routes/api/admin/review-requests/_id_/revoke.mjs +10 -9
- package/dist/astro/routes/api/admin/review-requests/index.mjs +53 -41
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +63 -58
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +63 -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.d.mts +73 -2
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +91 -49
- 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 +34 -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 +34 -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 +50 -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 +51 -40
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +10 -10
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +49 -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 +55 -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 +97 -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 +47 -36
- package/dist/astro/routes/api/menus/_name_/items.mjs +47 -36
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +47 -36
- package/dist/astro/routes/api/menus/_name_/translations.mjs +47 -36
- package/dist/astro/routes/api/menus/_name_.mjs +47 -36
- package/dist/astro/routes/api/menus/index.mjs +47 -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 +47 -37
- package/dist/astro/routes/api/redirects/index.mjs +47 -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 +65 -60
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +65 -60
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +65 -60
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +65 -60
- package/dist/astro/routes/api/schema/collections/index.mjs +65 -60
- package/dist/astro/routes/api/schema/index.mjs +12 -11
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +63 -58
- package/dist/astro/routes/api/schema/orphans/index.mjs +63 -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 +47 -36
- package/dist/astro/routes/api/sections/index.mjs +47 -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 +47 -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 +50 -39
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +50 -39
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +50 -39
- package/dist/astro/routes/api/taxonomies/index.mjs +50 -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 +46 -35
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +47 -36
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +47 -36
- package/dist/astro/routes/api/widget-areas/_name_.mjs +44 -33
- package/dist/astro/routes/api/widget-areas/index.mjs +47 -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-DPOSBNFI.mjs} +1 -1
- package/dist/{authorize-KcI0pAfN.mjs → authorize-CXIjxIfC.mjs} +1 -1
- package/dist/{briefing-BgQTljQt.mjs → briefing-5zf0YZbR.mjs} +445 -447
- package/dist/{briefing-r3hXCDQC.mjs → briefing-DiupPvyN.mjs} +1 -1
- package/dist/{bundle-S6zx-V4D.mjs → bundle-DImnxo71.mjs} +3 -3
- package/dist/{byline-Ctil4rij.mjs → byline-DEZKlzD9.mjs} +107 -113
- package/dist/{byline-fields-51ja6JDa.d.mts → byline-fields-BO96fXLv.d.mts} +8 -8
- package/dist/{byline-fields-DiCyW6eQ.mjs → byline-fields-CY6V0ew1.mjs} +1 -1
- package/dist/{byline-fields-QpmruT5r.mjs → byline-fields-DGNKitg3.mjs} +3 -3
- package/dist/{byline-registry-rkr73qSE.mjs → byline-registry-CkuVVeJJ.mjs} +46 -76
- package/dist/{bylines-v_ZUQnR-.mjs → bylines-CXyKpVLQ.mjs} +6 -6
- package/dist/{bylines-BcuBpzVi.mjs → bylines-gSAfpHl4.mjs} +4 -4
- package/dist/{cache-V2BCplaY.mjs → cache-DZDOBJv3.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-6vLLT06O.mjs} +1 -1
- package/dist/{comment-_nvJSS-A.mjs → comment-kgLTdtQD.mjs} +15 -8
- package/dist/{comment-reaction-DhVgJ17S.mjs → comment-reaction-Cun5eIXL.mjs} +1 -1
- package/dist/{comments-D4mIDjvA.mjs → comments-ZYK_cZvx.mjs} +1 -1
- package/dist/{content-CVCrcuvD.mjs → content-D9xKUSno.mjs} +287 -165
- package/dist/{content-refresh-QvBIyb_g.mjs → content-refresh-9M9cc55-.mjs} +170 -193
- package/dist/{context-JjKucxBm.mjs → context-BU8AbLmY.mjs} +2 -2
- package/dist/{context-MftkHbWx.mjs → context-C5lPtfeh.mjs} +95 -77
- package/dist/{context-route-helpers-e1APrqSm.mjs → context-route-helpers-CWAHJFl3.mjs} +2 -2
- package/dist/{cron-mGVPQ5e6.mjs → cron-BVYo08mi.mjs} +36 -32
- package/dist/d1-binding-D6HZa3ks.mjs +8 -0
- package/dist/d1-dialect-BBxPg6Om.mjs +48 -0
- package/dist/{dashboard-ZJ7sMcBI.mjs → dashboard-BnD5krLg.mjs} +5 -5
- package/dist/database/batch.d.mts +22 -0
- package/dist/database/batch.mjs +92 -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-Prqg6ycD.mjs} +130 -94
- package/dist/{dialect-helpers-fk43GbDb.mjs → dialect-helpers-C6xtO-Ui.mjs} +1 -1
- package/dist/{discovery-CJkuHGhZ.mjs → discovery-CYcZJ1o3.mjs} +5 -5
- package/dist/{enrich-KErvJOuI.mjs → enrich-BjF-J4sF.mjs} +1 -1
- package/dist/{evidence-6IUv9ML3.mjs → evidence-krrA3uiG.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-CnWOIusE.mjs} +1 -1
- package/dist/{fts-manager-DX7ZkrCa.mjs → fts-manager-DA74x_uP.mjs} +72 -57
- package/dist/{hitl-requests-CmYVunm-.mjs → hitl-requests-CGjA1jND.mjs} +2 -2
- package/dist/{hitl-route-helpers-CRm537zS.mjs → hitl-route-helpers-BxSL0iZB.mjs} +5 -5
- package/dist/{import-DqRAgsKr.mjs → import-CayDCPaH.mjs} +9 -9
- package/dist/{index-Co7xtjkd.d.mts → index-mlJSqFkG.d.mts} +7 -4
- package/dist/index.d.mts +16 -16
- package/dist/index.mjs +103 -96
- package/dist/{integration-credentials-qudN6yRr.mjs → integration-credentials-Br16M1VE.mjs} +2 -2
- package/dist/{jsonld-BpvnSp2m.d.mts → jsonld-BUiFEiCZ.d.mts} +2 -2
- package/dist/{load-fCOciq0Q.mjs → load-B2oitobd.mjs} +1 -1
- package/dist/{loader-BDje8ME2.mjs → loader-Cgsx23wU.mjs} +4 -4
- package/dist/{manifest-schema-CfKD0thC.mjs → manifest-schema-DBXM_g8l.mjs} +1 -1
- package/dist/{mcp-reviewed-executor-DmhM3Cy6.mjs → mcp-reviewed-executor-RJ71uyQb.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-BZqwtRTZ.mjs} +12 -4
- package/dist/{media-allowlist-DaG6lNoy.mjs → media-allowlist-CyByjUXh.mjs} +1 -1
- package/dist/{menus-CZbz5L_V.mjs → menus-2o-DVcwA.mjs} +8 -8
- package/dist/{menus-CpuR4Qkm.mjs → menus-5liJusbp.mjs} +138 -90
- package/dist/migrations-C7YXse7V.mjs +76 -0
- package/dist/oauth-authority-DOjME4Hh.mjs +43 -0
- package/dist/{oauth-authorization-Jf5e3azH.mjs → oauth-authorization-B_mmz7O2.mjs} +89 -98
- package/dist/{oauth-clients-tovQ4D4h.mjs → oauth-clients-Cr4pdIAE.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-BscLr3p2.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-f48yrwfI.mjs} +35 -84
- package/dist/{policy-DKdNMv8y.mjs → policy-CrK1vl8l.mjs} +2 -2
- package/dist/{preview-BXmS1SXL.mjs → preview-E1xKZGsX.mjs} +2 -2
- package/dist/{provider-loader-DDq7R_RN.d.mts → provider-loader-H2wdGD0o.d.mts} +1 -1
- package/dist/{public-url-Ci7UbC0W.d.mts → public-url-CI700CW4.d.mts} +1 -1
- package/dist/{public-url-BQ9vf0AS.d.mts → public-url-zoO-QbN6.d.mts} +2 -2
- package/dist/{publication-authorization-C-vYPGD8.mjs → publication-authorization-Dq_20SZR.mjs} +458 -33
- package/dist/{query-DcB9uGTW.mjs → query-BkWWdxyb.mjs} +4 -4
- package/dist/{query-CrW2yI6G.mjs → query-D6oNo9iz.mjs} +15 -15
- package/dist/{rate-limit-DEkoxTsP.mjs → rate-limit-RaBJEgyt.mjs} +2 -2
- package/dist/{redirect-DG-o0CKV.mjs → redirect-HLI3wT5Y.mjs} +26 -14
- package/dist/{redirects-Bjp4iKJU.mjs → redirects-D16GFaOa.mjs} +5 -5
- package/dist/{redirects-N8gmWhVM.mjs → redirects-DpRiuRWn.mjs} +3 -3
- package/dist/{registry-D-IV_h50.mjs → registry-DcV93OL_.mjs} +183 -186
- package/dist/release-CZfAeyXm.mjs +5148 -0
- package/dist/request-context.d.mts +8 -0
- package/dist/{request-meta-BW0the1R.mjs → request-meta-C6yGqnGD.mjs} +1 -1
- package/dist/{resolve-pZ4NQM-X.mjs → resolve-CpOV2jt_.mjs} +1 -1
- package/dist/review-payload-LLIi1sxO.mjs +1386 -0
- package/dist/{review-requests-DICrYH2-.mjs → review-requests-BF2eEKr8.mjs} +93 -37
- package/dist/{review-requests-BTKfeWlS.mjs → review-requests-C7prIbCo.mjs} +2 -2
- package/dist/{review-route-helpers-DaZBBps8.mjs → review-route-helpers-BYx3Px90.mjs} +2 -2
- package/dist/{revision-De7OmYVD.mjs → revision-090sZyGc.mjs} +28 -22
- package/dist/revocation-DZ8e4JCS.mjs +53 -0
- package/dist/{runner-DJiRFyLI.mjs → runner-CVeq0266.mjs} +594 -491
- package/dist/{runner-Dye73myO.d.mts → runner-Cxl-vyk2.d.mts} +1 -1
- package/dist/{runs-DEujUDOj.mjs → runs-B8kCirJ6.mjs} +5 -5
- package/dist/runtime-env-v-1UXPAH.mjs +19 -0
- package/dist/runtime.d.mts +10 -10
- package/dist/runtime.mjs +5 -5
- package/dist/schema-DFeC5axi.mjs +8 -0
- package/dist/{search-DxUKN9Zz.mjs → search-C9qOBgvo.mjs} +4 -4
- package/dist/{secrets-AdCrGg1c.mjs → secrets-BP2YTPWn.mjs} +10 -11
- package/dist/{sections-BPFOEMK6.mjs → sections-CkoQY7Z9.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-GfovzqpU.mjs → seo-Bypxm1iD.mjs} +1 -1
- package/dist/{seo-DWHdo5aW.mjs → seo-DYpc_rQ1.mjs} +25 -15
- package/dist/{service-BrNKVCjC.mjs → service-DOFqfUVv.mjs} +46 -21
- package/dist/{service-DbgjHWyW.mjs → service-mJBl4ZP4.mjs} +2 -2
- package/dist/{session-user-D8WwGEPH.mjs → session-user-DacoiKrJ.mjs} +1 -1
- package/dist/{settings-BKEHw6Bu.mjs → settings-2p7TuNWG.mjs} +2 -2
- package/dist/{settings-CAsQLi0N.mjs → settings-DRFy8JQx.mjs} +8 -8
- package/dist/{setup-complete-CHCYS5KV.mjs → setup-complete-CWMnrNFN.mjs} +1 -1
- package/dist/{site-activity-7oezuHXK.mjs → site-activity-BrN2NviL.mjs} +11 -4
- package/dist/{site-context-CA7rbxux.mjs → site-context-D9oETfxF.mjs} +50 -37
- package/dist/{site-url-DoZf_jVj.mjs → site-url-DoTPKRND.mjs} +1 -1
- package/dist/state-D8AogXCV.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-CjmmGlVw.mjs} +37 -12
- package/dist/submission-BLvkvewK.mjs +411 -0
- package/dist/{taxonomies-ALDiRQ84.mjs → taxonomies-C5ayPp3T.mjs} +3 -3
- package/dist/{taxonomies-93DV-1QT.mjs → taxonomies-DW6Fps-w.mjs} +7 -7
- package/dist/{taxonomy-BOBTJ_aE.mjs → taxonomy-DWxxLpp5.mjs} +3 -3
- package/dist/{tokens-c-qxNqzC.mjs → tokens-I3tSjoFI.mjs} +1 -1
- package/dist/{trusted-proxy-CdEl6g6B.mjs → trusted-proxy-CvDP0g0F.mjs} +4 -12
- package/dist/{types-6KmeXInJ.d.mts → types-BFoQ5a1v.d.mts} +1 -1
- package/dist/{types-BpSTdH1H.mjs → types-BqxIv8Il.mjs} +2 -2
- package/dist/{types-BRCUO8NR.d.mts → types-CVRNRAA5.d.mts} +1 -0
- package/dist/{types-CfpX1og5.d.mts → types-Tt_IGMno.d.mts} +360 -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-BoWkoty8.mjs} +2 -2
- package/dist/{validate-CDWVODvc.d.mts → validate-CCOsvPg2.d.mts} +3 -3
- package/dist/{validate-C9g9iX3q.mjs → validate-CupwWNWL.mjs} +3 -3
- package/dist/version-DpT-k_Ny.mjs +6 -0
- package/dist/{widgets-Cm5Qx2Np.mjs → widgets-DbOctkXv.mjs} +3 -3
- package/dist/{wordpress-slugs-WdPZaVXf.mjs → wordpress-slugs-pQlLXbKn.mjs} +1 -1
- package/dist/{worker-Bhuu7eqS.mjs → worker-wjRq4FI9.mjs} +76 -47
- package/dist/workers-build-QVrquLLe.mjs +36 -0
- package/dist/{zod-generator-DS5oZNaL.mjs → zod-generator-BzACAoR5.mjs} +2 -2
- package/package.json +34 -8
- 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/review-payload-f1L4lzQg.mjs +0 -111
- 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-CJqc1mwj.mjs +0 -6
- /package/dist/{base64-F8-DUraK.mjs → base64-Cz-aU0X1.mjs} +0 -0
- /package/dist/{challenge-store-CDKfye2r.mjs → challenge-store-DFGsDtCj.mjs} +0 -0
- /package/dist/{components-DAq_4iPX.mjs → components-gMTtJqHg.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-DLD_HnKT.mjs} +0 -0
- /package/dist/{default-BeIzUa1e.mjs → default-w3MwLng7.mjs} +0 -0
- /package/dist/{email-console-Bfi_exVg.mjs → email-console-CpvgEN1w.mjs} +0 -0
- /package/dist/{error-DLg1H2LT.mjs → error-B-44r5TD.mjs} +0 -0
- /package/dist/{escape-C6lkys0j.mjs → escape-B1GM0yJU.mjs} +0 -0
- /package/dist/{experimental-workflows-B9x8delL.mjs → experimental-workflows-fzJHB3ZI.mjs} +0 -0
- /package/dist/{hash-jhbF98tT.mjs → hash-DvMZXj2L.mjs} +0 -0
- /package/dist/{media-url-CL3NzgLh.mjs → media-url-D-elxQjL.mjs} +0 -0
- /package/dist/{mime-CDTtL7jE.mjs → mime-D_ae-u_U.mjs} +0 -0
- /package/dist/{mode-DJeacFCZ.mjs → mode-BJwb_MgK.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-D2H9hKcN.mjs} +0 -0
- /package/dist/{options-1dBRkoCl.mjs → options-BcqHWpc-.mjs} +0 -0
- /package/dist/{output-8j9oltTf.mjs → output-CdmbQioY.mjs} +0 -0
- /package/dist/{parser-C9rzPuSZ.mjs → parser-ehIlj32k.mjs} +0 -0
- /package/dist/{passkey-config-CRN44T04.mjs → passkey-config-sUQoLEj_.mjs} +0 -0
- /package/dist/{patterns-3XE9bU4r.mjs → patterns-CZ7D4y_R.mjs} +0 -0
- /package/dist/{placeholder-D03pGvqM.d.mts → placeholder-CQKI6vLd.d.mts} +0 -0
- /package/dist/{portable-text-BdRm4uZq.d.mts → portable-text-BE7nszX6.d.mts} +0 -0
- /package/dist/{portable-text-tIk9_uz_.mjs → portable-text-DH3Om_2D.mjs} +0 -0
- /package/dist/{process-cache-B-L-A9zg.mjs → process-cache-MHM4Sqzs.mjs} +0 -0
- /package/dist/{provider-loader-C4i82ll1.mjs → provider-loader-Dnv2neOu.mjs} +0 -0
- /package/dist/{public-discovery-CyDzK1-S.mjs → public-discovery-CTql6jdZ.mjs} +0 -0
- /package/dist/{public-url-BVIjzMo3.mjs → public-url-4sMO36Gw.mjs} +0 -0
- /package/dist/{public-url-oudwI7K0.mjs → public-url-DNt9A1yS.mjs} +0 -0
- /package/dist/{redirect-Dp5u-8dH.mjs → redirect-Cjjb5VYr.mjs} +0 -0
- /package/dist/{request-cache-BruBnFAR.mjs → request-cache-DPmV5nk4.mjs} +0 -0
- /package/dist/{seo-contributions-BAtRDXEQ.mjs → seo-contributions-atY3jZEV.mjs} +0 -0
- /package/dist/{service-DeX1PRNt.mjs → service-CeEi6nax.mjs} +0 -0
- /package/dist/{setup-nonce-D-CEYlw7.mjs → setup-nonce-BUmfCiY1.mjs} +0 -0
- /package/dist/{sidecar-client-Bw2C0XTf.mjs → sidecar-client-CbrX8nuw.mjs} +0 -0
- /package/dist/{slugify-KSsVD_D3.mjs → slugify-Di8Q_MFq.mjs} +0 -0
- /package/dist/{ssrf-C7tTSD1r.mjs → ssrf-COxLChKv.mjs} +0 -0
- /package/dist/{stable-hash-DF7R5eN8.mjs → stable-hash-DEtJgcp7.mjs} +0 -0
- /package/dist/{status-Bba6RbkS.mjs → status-DBSB6tdS.mjs} +0 -0
- /package/dist/{transport-ktLL9r2O.d.mts → transport-CZbtxgKZ.d.mts} +0 -0
- /package/dist/{transport-BddGhTAI.mjs → transport-aPKvM53n.mjs} +0 -0
- /package/dist/{types-CKIt_jmM.d.mts → types-1qU0-N1P.d.mts} +0 -0
- /package/dist/{types-BQZFeZjd.mjs → types-BKsk4nnM.mjs} +0 -0
- /package/dist/{types-CLMOusxP.d.mts → types-BWsEjujW.d.mts} +0 -0
- /package/dist/{types--3oJQ0hs.d.mts → types-CAD4OvmF.d.mts} +0 -0
- /package/dist/{types-BbkkkAb6.mjs → types-ChSk0dmw.mjs} +0 -0
- /package/dist/{types-C0DPvhR5.mjs → types-CyBH89BS.mjs} +0 -0
- /package/dist/{types-CU3Wn2HC.d.mts → types-DNPP-eu4.d.mts} +0 -0
- /package/dist/{types-CPaVj_GC.d.mts → types-SddyDti7.d.mts} +0 -0
- /package/dist/{url-C_pLSrGZ.mjs → url-Ce0qtSdB.mjs} +0 -0
- /package/dist/{url-Dumsft7G.mjs → url-DfqolpO2.mjs} +0 -0
- /package/dist/{validate-VPnKoIzW.mjs → validate-Co3j6T_K.mjs} +0 -0
package/dist/cli/index.mjs
CHANGED
|
@@ -1,61 +1,71 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { a as runMigrations, n as getMigrationFingerprint, r as getMigrationStatus } from "../runner-CVeq0266.mjs";
|
|
3
3
|
import { t as createDatabase } from "../connection-DJ3GzHVH.mjs";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import "../
|
|
9
|
-
import {
|
|
10
|
-
import "../
|
|
11
|
-
import {
|
|
12
|
-
import "../
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import "../
|
|
18
|
-
import "../
|
|
19
|
-
import "../
|
|
20
|
-
import "../
|
|
21
|
-
import { t as
|
|
22
|
-
import "../
|
|
23
|
-
import "../
|
|
24
|
-
import "../
|
|
25
|
-
import
|
|
26
|
-
import "../
|
|
27
|
-
import { n as DinewayToolsService, r as integrationResponse, t as DinewayToolsError } from "../service-
|
|
28
|
-
import
|
|
29
|
-
import { n as
|
|
30
|
-
import
|
|
31
|
-
import { t as
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import {
|
|
35
|
-
import
|
|
36
|
-
import { n as
|
|
4
|
+
import "../d1-binding-D6HZa3ks.mjs";
|
|
5
|
+
import { AtomicWriteConflict, atomicBatch, rowUnchanged } from "../database/batch.mjs";
|
|
6
|
+
import { t as validateIdentifier } from "../validate-Co3j6T_K.mjs";
|
|
7
|
+
import { l as listTablesLike } from "../dialect-helpers-C6xtO-Ui.mjs";
|
|
8
|
+
import { n as getI18nConfig, r as isI18nEnabled } from "../config-XW5tMrH8.mjs";
|
|
9
|
+
import { i as encodeBase64url } from "../base64-Cz-aU0X1.mjs";
|
|
10
|
+
import "../types-BqxIv8Il.mjs";
|
|
11
|
+
import { o as isMissingTableError } from "../loader-Cgsx23wU.mjs";
|
|
12
|
+
import "../actor-DxUAJgQX.mjs";
|
|
13
|
+
import "../atomic-authority-CnBQJ14T.mjs";
|
|
14
|
+
import "../after-BVaUn7bK.mjs";
|
|
15
|
+
import "../object-cache-BGjIlY9s.mjs";
|
|
16
|
+
import { n as slugify } from "../slugify-Di8Q_MFq.mjs";
|
|
17
|
+
import "../revision-090sZyGc.mjs";
|
|
18
|
+
import { t as ContentRepository } from "../content-D9xKUSno.mjs";
|
|
19
|
+
import { t as MediaRepository } from "../media-BZqwtRTZ.mjs";
|
|
20
|
+
import { t as TaxonomyRepository } from "../taxonomy-DWxxLpp5.mjs";
|
|
21
|
+
import { t as OptionsRepository } from "../options-BcqHWpc-.mjs";
|
|
22
|
+
import "../redirect-HLI3wT5Y.mjs";
|
|
23
|
+
import "../request-cache-DPmV5nk4.mjs";
|
|
24
|
+
import "../byline-registry-CkuVVeJJ.mjs";
|
|
25
|
+
import "../field-defs-cache-BKKFFf_V.mjs";
|
|
26
|
+
import { t as BylineRepository } from "../byline-DEZKlzD9.mjs";
|
|
27
|
+
import { n as DinewayToolsService, r as integrationResponse, t as DinewayToolsError } from "../service-CeEi6nax.mjs";
|
|
28
|
+
import "../runtime-env-v-1UXPAH.mjs";
|
|
29
|
+
import { i as parseEncryptionKeys, n as fingerprintKey, r as generateEncryptionKey, t as DinewaySecretsError } from "../secrets-BP2YTPWn.mjs";
|
|
30
|
+
import "../content-refresh-9M9cc55-.mjs";
|
|
31
|
+
import { n as resolveAndValidateExternalUrl, t as SsrfError } from "../ssrf-COxLChKv.mjs";
|
|
32
|
+
import "../fts-manager-DA74x_uP.mjs";
|
|
33
|
+
import "../public-discovery-CTql6jdZ.mjs";
|
|
34
|
+
import { n as SchemaRegistry } from "../registry-DcV93OL_.mjs";
|
|
35
|
+
import "../settings-DRFy8JQx.mjs";
|
|
36
|
+
import { n as VERSION } from "../version-DpT-k_Ny.mjs";
|
|
37
|
+
import { t as IntegrationCredentialStore } from "../store-CjmmGlVw.mjs";
|
|
38
|
+
import { a as reconcileManifestAccess, i as pluginManifestSchema } from "../manifest-schema-DBXM_g8l.mjs";
|
|
39
|
+
import "../migrations-C7YXse7V.mjs";
|
|
40
|
+
import { t as validateSeed } from "../validate-CupwWNWL.mjs";
|
|
41
|
+
import { t as applySeed } from "../apply-BTfAReIv.mjs";
|
|
42
|
+
import { n as validateWorkersBindings, t as WORKERS_BUILD_METADATA } from "../workers-build-QVrquLLe.mjs";
|
|
43
|
+
import { n as d1ReleaseRevision } from "../state-D8AogXCV.mjs";
|
|
44
|
+
import { a as createForgewayAccountClient, c as normalizeForgewayApiUrl, d as refreshForgewayAccountCredentials, f as removeStoredForgewayAccount, g as writeForgewayCredentials, h as readForgewayCredentials, i as completeForgewayAccountLogin, l as normalizeForgewayEmail, m as listForgewayCredentials, n as DEFAULT_FORGEWAY_API_BASE_URL, o as getForgewayDinewayAccount, p as sendForgewayAccountLoginLink, r as InvalidForgewayAccountCredentialsError, s as normalizeDinewayWebUrl, t as DEFAULT_DINEWAY_WEB_URL, u as readStoredForgewayAccount } from "../forgeway-account-CnWOIusE.mjs";
|
|
45
|
+
import { n as output, t as configureOutputMode } from "../output-CdmbQioY.mjs";
|
|
37
46
|
import { createHeaderAwareFetch, isRedirectResponse, resolveCustomHeaders } from "../client/external-auth-headers.mjs";
|
|
38
|
-
import { t as convertDataForRead } from "../portable-text-
|
|
39
|
-
import { _ as saveMarketplaceCredential, a as ensureProjectGitignoreDinewayLocalState, c as resolveDinewayBaseUrl, d as getCredentials, f as getMarketplaceCredential, g as saveCredentials, h as resolveCredentialKey, i as DEFAULT_DINEWAY_URL, l as resolveDinewayToken, m as removeMarketplaceCredential, n as connectionArgs, o as ensureProjectGitignoreEntry, p as removeCredentials, r as createClientFromArgs, s as readProjectEnv, u as upsertProjectEnv } from "../client-factory-
|
|
47
|
+
import { t as convertDataForRead } from "../portable-text-DH3Om_2D.mjs";
|
|
48
|
+
import { _ as saveMarketplaceCredential, a as ensureProjectGitignoreDinewayLocalState, c as resolveDinewayBaseUrl, d as getCredentials, f as getMarketplaceCredential, g as saveCredentials, h as resolveCredentialKey, i as DEFAULT_DINEWAY_URL, l as resolveDinewayToken, m as removeMarketplaceCredential, n as connectionArgs, o as ensureProjectGitignoreEntry, p as removeCredentials, r as createClientFromArgs, s as readProjectEnv, u as upsertProjectEnv } from "../client-factory-6vLLT06O.mjs";
|
|
49
|
+
import { t as migrateD1Release } from "../release-CZfAeyXm.mjs";
|
|
50
|
+
import { t as createD1Dialect } from "../d1-dialect-BBxPg6Om.mjs";
|
|
40
51
|
import { LocalStorage } from "../storage/local.mjs";
|
|
41
|
-
import { r as fileExists$11, t as bundleCommand } from "../bundle-
|
|
52
|
+
import { r as fileExists$11, t as bundleCommand } from "../bundle-DImnxo71.mjs";
|
|
42
53
|
import { createRequire } from "node:module";
|
|
43
54
|
import { createHash } from "node:crypto";
|
|
44
|
-
import { sql } from "kysely";
|
|
55
|
+
import { Kysely, sql } from "kysely";
|
|
45
56
|
import { z } from "zod";
|
|
46
57
|
import { createGzipDecoder, unpackTar } from "modern-tar";
|
|
47
|
-
import { createReadStream,
|
|
58
|
+
import { createReadStream, existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
48
59
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
49
60
|
import sax from "sax";
|
|
50
61
|
import { pathToFileURL } from "node:url";
|
|
62
|
+
import { access, mkdir, mkdtemp, readFile, readdir, realpath, rm, stat, writeFile } from "node:fs/promises";
|
|
51
63
|
import { defineCommand, runCommand, runMain } from "citty";
|
|
52
64
|
import { createInterface } from "node:readline/promises";
|
|
53
65
|
import consola, { consola as consola$1 } from "consola";
|
|
54
66
|
import pc from "picocolors";
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import { createGzip } from "node:zlib";
|
|
58
|
-
import { packTar } from "modern-tar/fs";
|
|
67
|
+
import { tmpdir } from "node:os";
|
|
68
|
+
import { createJiti } from "jiti";
|
|
59
69
|
import { spawn } from "node:child_process";
|
|
60
70
|
import { parse } from "parse5";
|
|
61
71
|
|
|
@@ -858,6 +868,257 @@ const contentCommand = defineCommand({
|
|
|
858
868
|
}
|
|
859
869
|
});
|
|
860
870
|
|
|
871
|
+
//#endregion
|
|
872
|
+
//#region src/cli/d1-project.ts
|
|
873
|
+
const BINDING_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
874
|
+
const pluginDescriptor = z.object({
|
|
875
|
+
id: z.string(),
|
|
876
|
+
version: z.string(),
|
|
877
|
+
entrypoint: z.string(),
|
|
878
|
+
format: z.enum(["native", "standard"]).optional(),
|
|
879
|
+
options: z.unknown().optional()
|
|
880
|
+
});
|
|
881
|
+
const integrationSchema = z.object({
|
|
882
|
+
name: z.literal("dineway"),
|
|
883
|
+
api: z.object({ dinewayConfig: z.object({
|
|
884
|
+
database: z.object({
|
|
885
|
+
entrypoint: z.string(),
|
|
886
|
+
config: z.unknown()
|
|
887
|
+
}).optional(),
|
|
888
|
+
plugins: z.array(pluginDescriptor).default([])
|
|
889
|
+
}) })
|
|
890
|
+
});
|
|
891
|
+
async function firstExisting(cwd, files) {
|
|
892
|
+
for (const file of files) {
|
|
893
|
+
const path = resolve(cwd, file);
|
|
894
|
+
try {
|
|
895
|
+
await access(path);
|
|
896
|
+
return path;
|
|
897
|
+
} catch (error) {
|
|
898
|
+
if (!(error instanceof Error && "code" in error && error.code === "ENOENT")) throw error;
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
/** Read the public integration API without running Astro hooks or writing a bundled config. */
|
|
903
|
+
async function readProjectDinewayConfig(cwd) {
|
|
904
|
+
const path = await firstExisting(cwd, [
|
|
905
|
+
"astro.config.mjs",
|
|
906
|
+
"astro.config.ts",
|
|
907
|
+
"astro.config.js",
|
|
908
|
+
"astro.config.mts",
|
|
909
|
+
"astro.config.cjs"
|
|
910
|
+
]);
|
|
911
|
+
if (!path) return void 0;
|
|
912
|
+
const jiti = createJiti(join(cwd, "package.json"), {
|
|
913
|
+
fsCache: false,
|
|
914
|
+
moduleCache: false,
|
|
915
|
+
nativeModules: [
|
|
916
|
+
"@astrojs/cloudflare",
|
|
917
|
+
"wrangler",
|
|
918
|
+
"miniflare"
|
|
919
|
+
]
|
|
920
|
+
});
|
|
921
|
+
const config = z.object({ integrations: z.array(z.unknown()).default([]) }).parse(await jiti.import(path, { default: true }));
|
|
922
|
+
const found = (await Promise.all(config.integrations.flat(Infinity))).flatMap((integration) => {
|
|
923
|
+
const parsed = integrationSchema.safeParse(integration);
|
|
924
|
+
return parsed.success ? [parsed.data.api.dinewayConfig] : [];
|
|
925
|
+
});
|
|
926
|
+
if (found.length > 1) throw new Error("Configure exactly one Dineway integration.");
|
|
927
|
+
return found[0];
|
|
928
|
+
}
|
|
929
|
+
async function readD1Project(cwd) {
|
|
930
|
+
const config = await readProjectDinewayConfig(cwd);
|
|
931
|
+
if (config?.database?.entrypoint !== "dineway/db/d1") throw new Error("Configure database: d1({ binding: 'DB' }) in this project's Dineway integration.");
|
|
932
|
+
const { binding } = z.object({ binding: z.string().regex(BINDING_NAME) }).parse(config.database.config);
|
|
933
|
+
const jiti = createJiti(join(cwd, "package.json"), {
|
|
934
|
+
fsCache: false,
|
|
935
|
+
moduleCache: false,
|
|
936
|
+
nativeModules: [
|
|
937
|
+
"@astrojs/cloudflare",
|
|
938
|
+
"wrangler",
|
|
939
|
+
"miniflare"
|
|
940
|
+
]
|
|
941
|
+
});
|
|
942
|
+
const plugins = [];
|
|
943
|
+
for (const descriptor of config.plugins) {
|
|
944
|
+
if (descriptor.format === "standard") throw new Error(`Plugin ${descriptor.id} must provide a verified native D1 migration plan.`);
|
|
945
|
+
const module = await jiti.import(descriptor.entrypoint);
|
|
946
|
+
if (typeof module.createPlugin !== "function") throw new Error(`Plugin ${descriptor.id} does not export createPlugin.`);
|
|
947
|
+
const createPlugin = module.createPlugin;
|
|
948
|
+
const plugin = createPlugin(descriptor.options ?? {});
|
|
949
|
+
if (plugin.id !== descriptor.id || plugin.version !== descriptor.version) throw new Error(`Plugin ${descriptor.id} descriptor and runtime versions differ. Rebuild the plugin before migrating.`);
|
|
950
|
+
plugins.push(plugin);
|
|
951
|
+
}
|
|
952
|
+
return {
|
|
953
|
+
binding,
|
|
954
|
+
plugins
|
|
955
|
+
};
|
|
956
|
+
}
|
|
957
|
+
const wranglerDatabaseSchema = z.object({
|
|
958
|
+
account_id: z.string().optional(),
|
|
959
|
+
compatibility_date: z.string().optional(),
|
|
960
|
+
d1_databases: z.array(z.object({
|
|
961
|
+
binding: z.string(),
|
|
962
|
+
database_name: z.string().optional(),
|
|
963
|
+
database_id: z.string().min(1)
|
|
964
|
+
}))
|
|
965
|
+
});
|
|
966
|
+
async function loadProjectWrangler(cwd, config, environment) {
|
|
967
|
+
const configPath = config ? resolve(cwd, config) : await firstExisting(cwd, [
|
|
968
|
+
"wrangler.jsonc",
|
|
969
|
+
"wrangler.json",
|
|
970
|
+
"wrangler.toml"
|
|
971
|
+
]);
|
|
972
|
+
if (!configPath) throw new Error("Add a Wrangler configuration with the site's D1 binding before migrating.");
|
|
973
|
+
const require = createRequire(join(cwd, "package.json"));
|
|
974
|
+
let entry;
|
|
975
|
+
try {
|
|
976
|
+
entry = require.resolve("wrangler");
|
|
977
|
+
} catch (cause) {
|
|
978
|
+
throw new Error("Install Wrangler in this project before migrating D1.", { cause });
|
|
979
|
+
}
|
|
980
|
+
const module = await import(pathToFileURL(entry).href);
|
|
981
|
+
if (!module || typeof module !== "object" || !("getPlatformProxy" in module) || !("unstable_readConfig" in module)) throw new Error("This Wrangler version does not expose the required configuration and D1 proxy APIs.");
|
|
982
|
+
const api = module;
|
|
983
|
+
return {
|
|
984
|
+
api,
|
|
985
|
+
configPath,
|
|
986
|
+
config: wranglerDatabaseSchema.parse(api.unstable_readConfig({
|
|
987
|
+
config: configPath,
|
|
988
|
+
env: environment
|
|
989
|
+
}, { hideWarnings: true }))
|
|
990
|
+
};
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
//#endregion
|
|
994
|
+
//#region src/cli/commands/database.ts
|
|
995
|
+
async function migrateProjectD1(options) {
|
|
996
|
+
if (options.local === options.remote) throw new Error("Choose exactly one target: --local or --remote.");
|
|
997
|
+
const cwd = resolve(options.cwd);
|
|
998
|
+
const project = await readD1Project(cwd);
|
|
999
|
+
const wrangler = await loadProjectWrangler(cwd, options.config, options.environment);
|
|
1000
|
+
const bindings = wrangler.config.d1_databases.filter((item) => item.binding === project.binding);
|
|
1001
|
+
if (bindings.length !== 1) throw new Error(`Wrangler must define exactly one D1 binding named ${project.binding}.`);
|
|
1002
|
+
const selected = bindings[0];
|
|
1003
|
+
const accountId = wrangler.config.account_id ?? process.env.CLOUDFLARE_ACCOUNT_ID;
|
|
1004
|
+
if (options.remote && !accountId) throw new Error("Set account_id in Wrangler or CLOUDFLARE_ACCOUNT_ID to select the remote account explicitly.");
|
|
1005
|
+
const revision = d1ReleaseRevision(project.plugins);
|
|
1006
|
+
const target = {
|
|
1007
|
+
binding: project.binding,
|
|
1008
|
+
databaseId: selected.database_id,
|
|
1009
|
+
accountId: options.remote ? accountId : void 0,
|
|
1010
|
+
location: options.remote ? "remote" : "local",
|
|
1011
|
+
revision
|
|
1012
|
+
};
|
|
1013
|
+
if (options.dryRun) return {
|
|
1014
|
+
...target,
|
|
1015
|
+
dryRun: true,
|
|
1016
|
+
message: "Would verify and apply core and configured plugin migrations. No database connection was opened."
|
|
1017
|
+
};
|
|
1018
|
+
const directory = await mkdtemp(join(tmpdir(), "dineway-d1-"));
|
|
1019
|
+
let proxy;
|
|
1020
|
+
let db;
|
|
1021
|
+
try {
|
|
1022
|
+
const configPath = join(directory, "wrangler.json");
|
|
1023
|
+
await writeFile(configPath, JSON.stringify({
|
|
1024
|
+
name: "dineway-migration",
|
|
1025
|
+
account_id: accountId,
|
|
1026
|
+
compatibility_date: wrangler.config.compatibility_date ?? "2026-09-01",
|
|
1027
|
+
d1_databases: [{
|
|
1028
|
+
...selected,
|
|
1029
|
+
remote: options.remote
|
|
1030
|
+
}]
|
|
1031
|
+
}));
|
|
1032
|
+
proxy = await wrangler.api.getPlatformProxy({
|
|
1033
|
+
configPath,
|
|
1034
|
+
remoteBindings: options.remote,
|
|
1035
|
+
persist: options.remote ? false : { path: join(cwd, ".wrangler/state/v3") }
|
|
1036
|
+
});
|
|
1037
|
+
const binding = proxy.env[project.binding];
|
|
1038
|
+
if (!binding || typeof binding.batch !== "function" || typeof binding.prepare !== "function") throw new Error(`Wrangler did not provide D1 binding ${project.binding}.`);
|
|
1039
|
+
db = new Kysely({ dialect: createD1Dialect(binding) });
|
|
1040
|
+
const applied = await migrateD1Release(db, project.plugins, { adopt: options.adopt });
|
|
1041
|
+
return {
|
|
1042
|
+
...target,
|
|
1043
|
+
dryRun: false,
|
|
1044
|
+
applied
|
|
1045
|
+
};
|
|
1046
|
+
} finally {
|
|
1047
|
+
try {
|
|
1048
|
+
await db?.destroy();
|
|
1049
|
+
} finally {
|
|
1050
|
+
try {
|
|
1051
|
+
await proxy?.dispose();
|
|
1052
|
+
} finally {
|
|
1053
|
+
await rm(directory, {
|
|
1054
|
+
recursive: true,
|
|
1055
|
+
force: true
|
|
1056
|
+
});
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
const migrateCommand = defineCommand({
|
|
1062
|
+
meta: {
|
|
1063
|
+
name: "migrate",
|
|
1064
|
+
description: "Install or upgrade D1 before starting or deploying the site"
|
|
1065
|
+
},
|
|
1066
|
+
args: {
|
|
1067
|
+
cwd: {
|
|
1068
|
+
type: "string",
|
|
1069
|
+
default: process.cwd(),
|
|
1070
|
+
description: "Project directory"
|
|
1071
|
+
},
|
|
1072
|
+
local: {
|
|
1073
|
+
type: "boolean",
|
|
1074
|
+
default: false,
|
|
1075
|
+
description: "Migrate local Wrangler D1 state"
|
|
1076
|
+
},
|
|
1077
|
+
remote: {
|
|
1078
|
+
type: "boolean",
|
|
1079
|
+
default: false,
|
|
1080
|
+
description: "Migrate the explicitly configured Cloudflare account and D1 database"
|
|
1081
|
+
},
|
|
1082
|
+
"dry-run": {
|
|
1083
|
+
type: "boolean",
|
|
1084
|
+
default: false,
|
|
1085
|
+
description: "Validate configuration without connecting to D1 or writing files"
|
|
1086
|
+
},
|
|
1087
|
+
adopt: {
|
|
1088
|
+
type: "boolean",
|
|
1089
|
+
default: false,
|
|
1090
|
+
description: "Verify and adopt an imported, upgraded Node database"
|
|
1091
|
+
},
|
|
1092
|
+
config: {
|
|
1093
|
+
type: "string",
|
|
1094
|
+
description: "Wrangler configuration path"
|
|
1095
|
+
},
|
|
1096
|
+
env: {
|
|
1097
|
+
type: "string",
|
|
1098
|
+
description: "Wrangler environment"
|
|
1099
|
+
}
|
|
1100
|
+
},
|
|
1101
|
+
async run({ args }) {
|
|
1102
|
+
const result = await migrateProjectD1({
|
|
1103
|
+
cwd: args.cwd,
|
|
1104
|
+
local: args.local,
|
|
1105
|
+
remote: args.remote,
|
|
1106
|
+
dryRun: args["dry-run"],
|
|
1107
|
+
adopt: args.adopt,
|
|
1108
|
+
config: args.config,
|
|
1109
|
+
environment: args.env
|
|
1110
|
+
});
|
|
1111
|
+
consola.log(JSON.stringify(result, null, 2));
|
|
1112
|
+
}
|
|
1113
|
+
});
|
|
1114
|
+
const databaseCommand = defineCommand({
|
|
1115
|
+
meta: {
|
|
1116
|
+
name: "database",
|
|
1117
|
+
description: "Explicit database maintenance"
|
|
1118
|
+
},
|
|
1119
|
+
subCommands: { migrate: migrateCommand }
|
|
1120
|
+
});
|
|
1121
|
+
|
|
861
1122
|
//#endregion
|
|
862
1123
|
//#region src/cli/paywall.ts
|
|
863
1124
|
const PAYWALL_MESSAGE_PATTERN = /\b(quota|credit|credits|upgrade|plan|billing|subscription|slot)\b/i;
|
|
@@ -1016,6 +1277,97 @@ async function handleCliPaywall(input) {
|
|
|
1016
1277
|
return true;
|
|
1017
1278
|
}
|
|
1018
1279
|
|
|
1280
|
+
//#endregion
|
|
1281
|
+
//#region src/cli/commands/deploy/utils/spawn.ts
|
|
1282
|
+
async function runCommand$1(command, args, options) {
|
|
1283
|
+
return new Promise((resolve, reject) => {
|
|
1284
|
+
const child = spawn(command, args, {
|
|
1285
|
+
cwd: options.cwd,
|
|
1286
|
+
env: {
|
|
1287
|
+
...process.env,
|
|
1288
|
+
...options.env
|
|
1289
|
+
},
|
|
1290
|
+
stdio: options.stdio === "inherit" ? "inherit" : [
|
|
1291
|
+
"ignore",
|
|
1292
|
+
"pipe",
|
|
1293
|
+
"pipe"
|
|
1294
|
+
],
|
|
1295
|
+
shell: false
|
|
1296
|
+
});
|
|
1297
|
+
let stdout = "";
|
|
1298
|
+
let stderr = "";
|
|
1299
|
+
if (options.stdio !== "inherit") {
|
|
1300
|
+
child.stdout?.on("data", (chunk) => {
|
|
1301
|
+
stdout += chunk.toString();
|
|
1302
|
+
});
|
|
1303
|
+
child.stderr?.on("data", (chunk) => {
|
|
1304
|
+
stderr += chunk.toString();
|
|
1305
|
+
});
|
|
1306
|
+
}
|
|
1307
|
+
child.on("error", reject);
|
|
1308
|
+
child.on("close", (code) => {
|
|
1309
|
+
resolve({
|
|
1310
|
+
code: code ?? 0,
|
|
1311
|
+
stdout,
|
|
1312
|
+
stderr
|
|
1313
|
+
});
|
|
1314
|
+
});
|
|
1315
|
+
});
|
|
1316
|
+
}
|
|
1317
|
+
async function runCommandOrThrow(command, args, options) {
|
|
1318
|
+
const result = await runCommand$1(command, args, options);
|
|
1319
|
+
if (result.code !== 0) {
|
|
1320
|
+
const detail = result.stderr.trim() || result.stdout.trim() || `exit code ${result.code}`;
|
|
1321
|
+
throw new Error(`${command} ${args.join(" ")} failed: ${detail}`);
|
|
1322
|
+
}
|
|
1323
|
+
return result;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
//#endregion
|
|
1327
|
+
//#region src/cli/commands/deploy/utils/cli-resolver.ts
|
|
1328
|
+
async function confirm(message) {
|
|
1329
|
+
if (!process.stdin.isTTY) return false;
|
|
1330
|
+
const rl = createInterface({
|
|
1331
|
+
input: process.stdin,
|
|
1332
|
+
output: process.stdout
|
|
1333
|
+
});
|
|
1334
|
+
try {
|
|
1335
|
+
const answer = await rl.question(`${message} [y/N] `);
|
|
1336
|
+
return answer.trim().toLowerCase() === "y" || answer.trim().toLowerCase() === "yes";
|
|
1337
|
+
} finally {
|
|
1338
|
+
rl.close();
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
function resolveProviderCli(cwd, binary) {
|
|
1342
|
+
const local = join(cwd, "node_modules", ".bin", process.platform === "win32" ? `${binary}.cmd` : binary);
|
|
1343
|
+
return existsSync(local) ? local : binary;
|
|
1344
|
+
}
|
|
1345
|
+
async function ensureTargetCli(target, cwd, options = {}) {
|
|
1346
|
+
if (!target.cli) return;
|
|
1347
|
+
if ((await runCommand$1(resolveProviderCli(cwd, target.cli.versionCommand.command), target.cli.versionCommand.args, { cwd }).catch(() => ({
|
|
1348
|
+
code: 1,
|
|
1349
|
+
stdout: "",
|
|
1350
|
+
stderr: ""
|
|
1351
|
+
}))).code === 0) return;
|
|
1352
|
+
if (options.dryRun) {
|
|
1353
|
+
consola.info(`[dry-run] Would verify ${target.cli.binary} CLI with ${target.cli.versionCommand.command} ${target.cli.versionCommand.args.join(" ")}`);
|
|
1354
|
+
if (target.cli.npmPackage) consola.info(`[dry-run] Would offer to install ${target.cli.npmPackage}`);
|
|
1355
|
+
else consola.info(`[dry-run] ${target.cli.installHint ?? `Install ${target.cli.binary} before deploying.`}`);
|
|
1356
|
+
return;
|
|
1357
|
+
}
|
|
1358
|
+
if (!target.cli.npmPackage) throw new Error(`${target.label} CLI is required. ${target.cli.installHint ?? `Install ${target.cli.binary} and try again.`}`);
|
|
1359
|
+
if (options.yes) throw new Error(`Install ${target.cli.npmPackage} and run this command again. The --yes flag does not approve global CLI installation.`);
|
|
1360
|
+
if (!await confirm(`${target.label} CLI is not installed. Install ${target.cli.npmPackage} globally now?`)) throw new Error(`Install ${target.cli.npmPackage} and run this command again.`);
|
|
1361
|
+
await runCommandOrThrow("npm", [
|
|
1362
|
+
"install",
|
|
1363
|
+
"--global",
|
|
1364
|
+
target.cli.npmPackage
|
|
1365
|
+
], {
|
|
1366
|
+
cwd,
|
|
1367
|
+
stdio: "inherit"
|
|
1368
|
+
});
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1019
1371
|
//#endregion
|
|
1020
1372
|
//#region src/cli/commands/deploy/utils/astro-adapter.ts
|
|
1021
1373
|
const CLOUDFLARE_ADAPTER_PACKAGE = "@astrojs/cloudflare";
|
|
@@ -1348,6 +1700,9 @@ async function readWorkersBuild(cwd) {
|
|
|
1348
1700
|
const config = workerBuildSchema.parse(JSON.parse(await readFile(configPath, "utf-8")));
|
|
1349
1701
|
if (!config.compatibility_flags.includes("nodejs_compat")) throw new Error("Dineway Workers require compatibility_flags: [\"nodejs_compat\"].");
|
|
1350
1702
|
const serverDir = dirname(configPath);
|
|
1703
|
+
if (!await exists(join(serverDir, WORKERS_BUILD_METADATA))) throw new Error("Missing Dineway build metadata. Rebuild the Cloudflare application before deploying.");
|
|
1704
|
+
await assertInsideDirectory(serverDir, join(serverDir, WORKERS_BUILD_METADATA));
|
|
1705
|
+
await validateWorkersBindings(serverDir, config);
|
|
1351
1706
|
const entrypoint = resolve(serverDir, config.main);
|
|
1352
1707
|
const assetsDir = resolve(serverDir, config.assets.directory);
|
|
1353
1708
|
await assertInsideDirectory(serverDir, entrypoint);
|
|
@@ -1363,203 +1718,12 @@ async function readWorkersBuild(cwd) {
|
|
|
1363
1718
|
};
|
|
1364
1719
|
}
|
|
1365
1720
|
|
|
1366
|
-
//#endregion
|
|
1367
|
-
//#region src/cli/commands/deploy/targets/chatgpt-sites.ts
|
|
1368
|
-
const HOSTING_PATH = ".openai/hosting.json";
|
|
1369
|
-
const externalPersistence = z.unknown().refine((value) => value == null, "This Dineway Sites target uses external HTTP libSQL and S3; native D1/R2 bindings are not supported.");
|
|
1370
|
-
const hostingSchema = z.object({
|
|
1371
|
-
project_id: z.string().min(1),
|
|
1372
|
-
static: z.null().optional(),
|
|
1373
|
-
d1: externalPersistence.optional(),
|
|
1374
|
-
r2: externalPersistence.optional(),
|
|
1375
|
-
capabilities: z.array(z.string()).optional()
|
|
1376
|
-
}).strict();
|
|
1377
|
-
const NON_RUNTIME_ENTRIES = new Set([
|
|
1378
|
-
".prerender",
|
|
1379
|
-
".vite",
|
|
1380
|
-
"wrangler.json",
|
|
1381
|
-
".dev.vars",
|
|
1382
|
-
".env"
|
|
1383
|
-
]);
|
|
1384
|
-
const BINDING_KEYS = [
|
|
1385
|
-
"kv_namespaces",
|
|
1386
|
-
"d1_databases",
|
|
1387
|
-
"r2_buckets",
|
|
1388
|
-
"services",
|
|
1389
|
-
"hyperdrive",
|
|
1390
|
-
"vectorize",
|
|
1391
|
-
"workflows",
|
|
1392
|
-
"worker_loaders",
|
|
1393
|
-
"queues",
|
|
1394
|
-
"durable_objects",
|
|
1395
|
-
"images",
|
|
1396
|
-
"ai"
|
|
1397
|
-
];
|
|
1398
|
-
async function readHosting(cwd, projectId) {
|
|
1399
|
-
await assertInsideDirectory(cwd, join(cwd, HOSTING_PATH));
|
|
1400
|
-
if (!(await lstat(join(cwd, HOSTING_PATH))).isFile()) throw new Error("Sites hosting.json must be a regular file.");
|
|
1401
|
-
const config = hostingSchema.parse(JSON.parse(await readFile(join(cwd, HOSTING_PATH), "utf-8")));
|
|
1402
|
-
if (projectId && projectId !== config.project_id) throw new Error("--site does not match .openai/hosting.json. Reuse the existing Sites project ID.");
|
|
1403
|
-
return config;
|
|
1404
|
-
}
|
|
1405
|
-
async function assertRegularTree(path) {
|
|
1406
|
-
const stat = await lstat(path);
|
|
1407
|
-
if (stat.isDirectory()) for (const entry of await readdir(path)) await assertRegularTree(join(path, entry));
|
|
1408
|
-
else if (!stat.isFile()) throw new Error("Sites build output must not contain symlinks or special files.");
|
|
1409
|
-
}
|
|
1410
|
-
function hasBinding(value) {
|
|
1411
|
-
if (Array.isArray(value)) return value.length > 0;
|
|
1412
|
-
if (value && typeof value === "object") return Object.values(value).some(hasBinding);
|
|
1413
|
-
return value !== void 0 && value !== null && value !== false && value !== "";
|
|
1414
|
-
}
|
|
1415
|
-
const chatgptSitesTarget = {
|
|
1416
|
-
name: "chatgpt-sites",
|
|
1417
|
-
label: "ChatGPT Sites",
|
|
1418
|
-
description: "Prepare an Astro Worker archive for publishing through the Sites connector.",
|
|
1419
|
-
supportLevel: "experimental",
|
|
1420
|
-
async generateConfig(cwd, options) {
|
|
1421
|
-
if (await exists(join(cwd, HOSTING_PATH))) await readHosting(cwd, options.site);
|
|
1422
|
-
else if (!options.site && !options.dryRun) throw new Error("Register or select a Site with the Sites connector first, then pass its exact project ID with --site or save it in .openai/hosting.json.");
|
|
1423
|
-
const files = await generateWorkersConfig(cwd, options.dryRun);
|
|
1424
|
-
files.push(await writeNewFile(cwd, HOSTING_PATH, JSON.stringify({ project_id: options.site }, null, " ") + "\n", options.dryRun));
|
|
1425
|
-
return files;
|
|
1426
|
-
},
|
|
1427
|
-
async deploy(cwd, options) {
|
|
1428
|
-
if (options.dryRun) return { message: "[dry-run] Would prepare dist/server/index.js and dist/.openai/hosting.json for the Sites hosting skill. Publishing uses the Sites connector." };
|
|
1429
|
-
const hosting = await readHosting(cwd, options.site);
|
|
1430
|
-
if (await exists(join(cwd, "drizzle")) || await exists(join(cwd, "dist/.openai/drizzle"))) throw new Error("This Dineway Sites target does not support Drizzle/D1 migrations. Use external HTTP libSQL with Dineway's runtime migrations.");
|
|
1431
|
-
const build = await readWorkersBuild(cwd);
|
|
1432
|
-
const unsupported = BINDING_KEYS.filter((key) => hasBinding(build.config[key]));
|
|
1433
|
-
if (unsupported.length) throw new Error(`Sites cannot provision this Worker's Wrangler bindings: ${unsupported.join(", ")}. Use Dineway database sessions, libsqlHttp(), and S3 storage. Manage Sites bindings with the Sites connector.`);
|
|
1434
|
-
await assertRegularTree(build.serverDir);
|
|
1435
|
-
await assertRegularTree(build.assetsDir);
|
|
1436
|
-
await mkdir(join(cwd, ".dineway"), { recursive: true });
|
|
1437
|
-
await assertInsideDirectory(cwd, join(cwd, ".dineway"));
|
|
1438
|
-
const stage = await mkdtemp(join(cwd, ".dineway/sites-"));
|
|
1439
|
-
try {
|
|
1440
|
-
const dist = join(stage, "upload/dist");
|
|
1441
|
-
await mkdir(join(dist, ".openai"), { recursive: true });
|
|
1442
|
-
await cp(build.serverDir, join(dist, "server"), {
|
|
1443
|
-
recursive: true,
|
|
1444
|
-
filter: (path) => !NON_RUNTIME_ENTRIES.has(basename(path))
|
|
1445
|
-
});
|
|
1446
|
-
await cp(build.assetsDir, join(dist, "client"), { recursive: true });
|
|
1447
|
-
if (build.entrypoint !== join(build.serverDir, "index.js")) {
|
|
1448
|
-
const entry = "./" + relative(build.serverDir, build.entrypoint).split(sep).join("/");
|
|
1449
|
-
await writeFile(join(dist, "server/index.js"), `export { default } from ${JSON.stringify(entry)};\n`);
|
|
1450
|
-
}
|
|
1451
|
-
await writeFile(join(dist, ".openai/hosting.json"), JSON.stringify(hosting, null, " ") + "\n");
|
|
1452
|
-
const archivePath = join(cwd, ".dineway/sites-deploy.tar.gz");
|
|
1453
|
-
const preparedArchive = join(stage, "site.tar.gz");
|
|
1454
|
-
await pipeline(packTar(join(stage, "upload")), createGzip(), createWriteStream(preparedArchive, { mode: 384 }));
|
|
1455
|
-
await rename(preparedArchive, archivePath);
|
|
1456
|
-
return { message: `Sites archive prepared: ${archivePath}. Not published yet. Use the sites-hosting skill to push the matching source, save this version, and deploy through the Sites connector.` };
|
|
1457
|
-
} finally {
|
|
1458
|
-
await rm(stage, {
|
|
1459
|
-
recursive: true,
|
|
1460
|
-
force: true
|
|
1461
|
-
});
|
|
1462
|
-
}
|
|
1463
|
-
}
|
|
1464
|
-
};
|
|
1465
|
-
|
|
1466
|
-
//#endregion
|
|
1467
|
-
//#region src/cli/commands/deploy/utils/spawn.ts
|
|
1468
|
-
async function runCommand$1(command, args, options) {
|
|
1469
|
-
return new Promise((resolve, reject) => {
|
|
1470
|
-
const child = spawn(command, args, {
|
|
1471
|
-
cwd: options.cwd,
|
|
1472
|
-
env: {
|
|
1473
|
-
...process.env,
|
|
1474
|
-
...options.env
|
|
1475
|
-
},
|
|
1476
|
-
stdio: options.stdio === "inherit" ? "inherit" : [
|
|
1477
|
-
"ignore",
|
|
1478
|
-
"pipe",
|
|
1479
|
-
"pipe"
|
|
1480
|
-
],
|
|
1481
|
-
shell: false
|
|
1482
|
-
});
|
|
1483
|
-
let stdout = "";
|
|
1484
|
-
let stderr = "";
|
|
1485
|
-
if (options.stdio !== "inherit") {
|
|
1486
|
-
child.stdout?.on("data", (chunk) => {
|
|
1487
|
-
stdout += chunk.toString();
|
|
1488
|
-
});
|
|
1489
|
-
child.stderr?.on("data", (chunk) => {
|
|
1490
|
-
stderr += chunk.toString();
|
|
1491
|
-
});
|
|
1492
|
-
}
|
|
1493
|
-
child.on("error", reject);
|
|
1494
|
-
child.on("close", (code) => {
|
|
1495
|
-
resolve({
|
|
1496
|
-
code: code ?? 0,
|
|
1497
|
-
stdout,
|
|
1498
|
-
stderr
|
|
1499
|
-
});
|
|
1500
|
-
});
|
|
1501
|
-
});
|
|
1502
|
-
}
|
|
1503
|
-
async function runCommandOrThrow(command, args, options) {
|
|
1504
|
-
const result = await runCommand$1(command, args, options);
|
|
1505
|
-
if (result.code !== 0) {
|
|
1506
|
-
const detail = result.stderr.trim() || result.stdout.trim() || `exit code ${result.code}`;
|
|
1507
|
-
throw new Error(`${command} ${args.join(" ")} failed: ${detail}`);
|
|
1508
|
-
}
|
|
1509
|
-
return result;
|
|
1510
|
-
}
|
|
1511
|
-
|
|
1512
|
-
//#endregion
|
|
1513
|
-
//#region src/cli/commands/deploy/utils/cli-resolver.ts
|
|
1514
|
-
async function confirm(message) {
|
|
1515
|
-
if (!process.stdin.isTTY) return false;
|
|
1516
|
-
const rl = createInterface({
|
|
1517
|
-
input: process.stdin,
|
|
1518
|
-
output: process.stdout
|
|
1519
|
-
});
|
|
1520
|
-
try {
|
|
1521
|
-
const answer = await rl.question(`${message} [y/N] `);
|
|
1522
|
-
return answer.trim().toLowerCase() === "y" || answer.trim().toLowerCase() === "yes";
|
|
1523
|
-
} finally {
|
|
1524
|
-
rl.close();
|
|
1525
|
-
}
|
|
1526
|
-
}
|
|
1527
|
-
function resolveProviderCli(cwd, binary) {
|
|
1528
|
-
const local = join(cwd, "node_modules", ".bin", process.platform === "win32" ? `${binary}.cmd` : binary);
|
|
1529
|
-
return existsSync(local) ? local : binary;
|
|
1530
|
-
}
|
|
1531
|
-
async function ensureTargetCli(target, cwd, options = {}) {
|
|
1532
|
-
if (!target.cli) return;
|
|
1533
|
-
if ((await runCommand$1(resolveProviderCli(cwd, target.cli.versionCommand.command), target.cli.versionCommand.args, { cwd }).catch(() => ({
|
|
1534
|
-
code: 1,
|
|
1535
|
-
stdout: "",
|
|
1536
|
-
stderr: ""
|
|
1537
|
-
}))).code === 0) return;
|
|
1538
|
-
if (options.dryRun) {
|
|
1539
|
-
consola.info(`[dry-run] Would verify ${target.cli.binary} CLI with ${target.cli.versionCommand.command} ${target.cli.versionCommand.args.join(" ")}`);
|
|
1540
|
-
if (target.cli.npmPackage) consola.info(`[dry-run] Would offer to install ${target.cli.npmPackage}`);
|
|
1541
|
-
else consola.info(`[dry-run] ${target.cli.installHint ?? `Install ${target.cli.binary} before deploying.`}`);
|
|
1542
|
-
return;
|
|
1543
|
-
}
|
|
1544
|
-
if (!target.cli.npmPackage) throw new Error(`${target.label} CLI is required. ${target.cli.installHint ?? `Install ${target.cli.binary} and try again.`}`);
|
|
1545
|
-
if (options.yes) throw new Error(`Install ${target.cli.npmPackage} and run this command again. The --yes flag does not approve global CLI installation.`);
|
|
1546
|
-
if (!await confirm(`${target.label} CLI is not installed. Install ${target.cli.npmPackage} globally now?`)) throw new Error(`Install ${target.cli.npmPackage} and run this command again.`);
|
|
1547
|
-
await runCommandOrThrow("npm", [
|
|
1548
|
-
"install",
|
|
1549
|
-
"--global",
|
|
1550
|
-
target.cli.npmPackage
|
|
1551
|
-
], {
|
|
1552
|
-
cwd,
|
|
1553
|
-
stdio: "inherit"
|
|
1554
|
-
});
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1557
1721
|
//#endregion
|
|
1558
1722
|
//#region src/cli/commands/deploy/targets/cloudflare.ts
|
|
1559
1723
|
const cloudflareTarget = {
|
|
1560
1724
|
name: "cloudflare",
|
|
1561
1725
|
label: "Cloudflare Workers",
|
|
1562
|
-
description: "Deploy an Astro Worker with Wrangler and
|
|
1726
|
+
description: "Deploy an Astro Worker with Wrangler, D1, and object storage.",
|
|
1563
1727
|
supportLevel: "experimental",
|
|
1564
1728
|
cli: {
|
|
1565
1729
|
npmPackage: null,
|
|
@@ -1568,7 +1732,7 @@ const cloudflareTarget = {
|
|
|
1568
1732
|
command: "wrangler",
|
|
1569
1733
|
args: ["--version"]
|
|
1570
1734
|
},
|
|
1571
|
-
installHint: "Install wrangler in this project (for example: pnpm add -D wrangler@^4.
|
|
1735
|
+
installHint: "Install wrangler in this project (for example: pnpm add -D wrangler@^4.156.1)."
|
|
1572
1736
|
},
|
|
1573
1737
|
async checkAuth(cwd) {
|
|
1574
1738
|
return (await runCommand$1(resolveProviderCli(cwd, "wrangler"), ["whoami", "--json"], { cwd })).code === 0;
|
|
@@ -3480,8 +3644,7 @@ const targets = [
|
|
|
3480
3644
|
dockerTarget,
|
|
3481
3645
|
flyTarget,
|
|
3482
3646
|
gcpTarget,
|
|
3483
|
-
cloudflareTarget
|
|
3484
|
-
chatgptSitesTarget
|
|
3647
|
+
cloudflareTarget
|
|
3485
3648
|
];
|
|
3486
3649
|
const DEFAULT_TARGET = "forgeway";
|
|
3487
3650
|
function getTarget(name) {
|
|
@@ -3567,7 +3730,7 @@ const deployCommand = defineCommand({
|
|
|
3567
3730
|
},
|
|
3568
3731
|
site: {
|
|
3569
3732
|
type: "string",
|
|
3570
|
-
description: "Forgeway site ID/slug
|
|
3733
|
+
description: "Forgeway site ID/slug",
|
|
3571
3734
|
required: false
|
|
3572
3735
|
},
|
|
3573
3736
|
"place-id": {
|
|
@@ -3756,7 +3919,7 @@ async function fileExists$3(path) {
|
|
|
3756
3919
|
const devCommand = defineCommand({
|
|
3757
3920
|
meta: {
|
|
3758
3921
|
name: "dev",
|
|
3759
|
-
description: "Start
|
|
3922
|
+
description: "Start the development server"
|
|
3760
3923
|
},
|
|
3761
3924
|
args: {
|
|
3762
3925
|
database: {
|
|
@@ -3790,26 +3953,28 @@ const devCommand = defineCommand({
|
|
|
3790
3953
|
consola.error("No package.json found");
|
|
3791
3954
|
process.exit(1);
|
|
3792
3955
|
}
|
|
3793
|
-
const database = resolveCliDatabaseTarget(cwd, args.database);
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3956
|
+
const database = (await readProjectDinewayConfig(cwd))?.database?.entrypoint === "dineway/db/d1" ? void 0 : resolveCliDatabaseTarget(cwd, args.database);
|
|
3957
|
+
if (database) {
|
|
3958
|
+
consola.info(`Database: ${database.display}`);
|
|
3959
|
+
if (database.localPath && !await fileExists$3(database.localPath)) consola.start("Database not found, initializing...");
|
|
3960
|
+
const db = createDatabase({ url: database.url });
|
|
3961
|
+
try {
|
|
3962
|
+
consola.start("Checking database migrations...");
|
|
3963
|
+
const { applied } = await runMigrations(db);
|
|
3964
|
+
if (applied.length > 0) consola.success(`Applied ${applied.length} migrations`);
|
|
3965
|
+
else consola.info("Database up to date");
|
|
3966
|
+
} catch (error) {
|
|
3967
|
+
consola.error("Migration failed:", error);
|
|
3968
|
+
await db.destroy();
|
|
3969
|
+
process.exit(1);
|
|
3970
|
+
}
|
|
3804
3971
|
await db.destroy();
|
|
3805
|
-
|
|
3806
|
-
}
|
|
3807
|
-
await db.destroy();
|
|
3972
|
+
} else consola.info("Using the configured D1 binding. Run dineway database migrate --local before starting a fresh database.");
|
|
3808
3973
|
if (args.types) {
|
|
3809
3974
|
const remoteUrl = pkg.dineway?.url || process.env.DINEWAY_URL;
|
|
3810
3975
|
if (!remoteUrl) consola.warn("No remote URL configured. Set DINEWAY_URL or dineway.url in package.json");
|
|
3811
3976
|
else try {
|
|
3812
|
-
const { createClientFromArgs } = await import("../client-factory-
|
|
3977
|
+
const { createClientFromArgs } = await import("../client-factory-6vLLT06O.mjs").then((n) => n.t);
|
|
3813
3978
|
const client = createClientFromArgs({ url: remoteUrl });
|
|
3814
3979
|
const schema = await client.schemaExport();
|
|
3815
3980
|
const types = await client.schemaTypes();
|
|
@@ -3851,7 +4016,7 @@ const devCommand = defineCommand({
|
|
|
3851
4016
|
stdio: "inherit",
|
|
3852
4017
|
env: {
|
|
3853
4018
|
...process.env,
|
|
3854
|
-
DINEWAY_DATABASE_URL: database.url
|
|
4019
|
+
...database ? { DINEWAY_DATABASE_URL: database.url } : {}
|
|
3855
4020
|
}
|
|
3856
4021
|
});
|
|
3857
4022
|
child.on("error", (error) => {
|
|
@@ -4539,21 +4704,44 @@ const INTEGRATION_TOKEN_ENV_SOURCES = [
|
|
|
4539
4704
|
["tikhub", "TIKHUB_API_KEY"]
|
|
4540
4705
|
];
|
|
4541
4706
|
async function importIntegrationCredentialsFromEnvironment(db, env) {
|
|
4542
|
-
|
|
4707
|
+
const options = new OptionsRepository(db);
|
|
4708
|
+
if (await options.exists(INTEGRATION_CREDENTIAL_IMPORT_MARKER)) return {
|
|
4543
4709
|
status: "already_completed",
|
|
4544
4710
|
providers: []
|
|
4545
4711
|
};
|
|
4546
4712
|
const credentials = collectEnvironmentCredentials(env);
|
|
4547
4713
|
const keys = await parseEncryptionKeys(env.DINEWAY_ENCRYPTION_KEY);
|
|
4548
4714
|
if (credentials.length > 0 && (!keys || keys.length === 0)) throw new DinewaySecretsError("DINEWAY_ENCRYPTION_KEY is required to import Integration credentials.", "ENCRYPTION_KEY_REQUIRED");
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4715
|
+
const store = new IntegrationCredentialStore(db, { keys: keys ?? [] });
|
|
4716
|
+
const checks = [sql`NOT EXISTS (SELECT 1 FROM options WHERE name = ${INTEGRATION_CREDENTIAL_IMPORT_MARKER})`];
|
|
4717
|
+
const statements = [];
|
|
4718
|
+
for (const entry of credentials) {
|
|
4719
|
+
const existing = await db.selectFrom("_dineway_integration_credentials").selectAll().where("provider", "=", entry.provider).executeTakeFirst();
|
|
4720
|
+
if (existing) checks.push(rowUnchanged("_dineway_integration_credentials", existing));
|
|
4721
|
+
else {
|
|
4722
|
+
checks.push(sql`NOT EXISTS (SELECT 1 FROM _dineway_integration_credentials WHERE provider = ${entry.provider})`);
|
|
4723
|
+
statements.push(await store.prepareSet(entry.provider, entry.credential, "environment"));
|
|
4724
|
+
}
|
|
4725
|
+
}
|
|
4726
|
+
statements.push(db.insertInto("options").values({
|
|
4727
|
+
name: INTEGRATION_CREDENTIAL_IMPORT_MARKER,
|
|
4728
|
+
value: JSON.stringify({
|
|
4553
4729
|
completedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4554
4730
|
providerCount: credentials.length
|
|
4731
|
+
})
|
|
4732
|
+
}).compile());
|
|
4733
|
+
try {
|
|
4734
|
+
await atomicBatch(db, {
|
|
4735
|
+
checks,
|
|
4736
|
+
statements
|
|
4555
4737
|
});
|
|
4556
|
-
})
|
|
4738
|
+
} catch (error) {
|
|
4739
|
+
if (error instanceof AtomicWriteConflict && await options.exists(INTEGRATION_CREDENTIAL_IMPORT_MARKER)) return {
|
|
4740
|
+
status: "already_completed",
|
|
4741
|
+
providers: []
|
|
4742
|
+
};
|
|
4743
|
+
throw error;
|
|
4744
|
+
}
|
|
4557
4745
|
return {
|
|
4558
4746
|
status: credentials.length > 0 ? "imported" : "completed_empty",
|
|
4559
4747
|
providers: credentials.map((entry) => entry.provider)
|
|
@@ -5807,7 +5995,7 @@ const publishCommand = defineCommand({
|
|
|
5807
5995
|
const pluginDir = resolve(args.dir);
|
|
5808
5996
|
try {
|
|
5809
5997
|
const { runCommand } = await import("citty");
|
|
5810
|
-
const { bundleCommand } = await import("../bundle-
|
|
5998
|
+
const { bundleCommand } = await import("../bundle-DImnxo71.mjs").then((n) => n.n);
|
|
5811
5999
|
await runCommand(bundleCommand, { rawArgs: ["--dir", pluginDir] });
|
|
5812
6000
|
} catch {
|
|
5813
6001
|
consola.error("Build failed");
|
|
@@ -8291,6 +8479,7 @@ function isFileNotFound(error) {
|
|
|
8291
8479
|
*/
|
|
8292
8480
|
const builtInCommands = {
|
|
8293
8481
|
init: initCommand,
|
|
8482
|
+
database: databaseCommand,
|
|
8294
8483
|
account: accountCommand,
|
|
8295
8484
|
types: typesCommand,
|
|
8296
8485
|
dev: devCommand,
|