void 0.24.0 → 0.26.0
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/README.md +19 -106
- package/dist/{account-cmd-vJhh5lrb.mjs → account-cmd-CDry3B5V.mjs} +5 -5
- package/dist/{application-analysis-BVsVqc11.mjs → application-analysis-DC2yPvzY.mjs} +1 -1
- package/dist/{application-routing-B7QEjqSR.mjs → application-routing-C9khgLiS.mjs} +1 -1
- package/dist/{auth-DX3JURcX.mjs → auth-B60QDbjg.mjs} +1 -1
- package/dist/{auth-CQkSDS50.mjs → auth-D52yG7hl.mjs} +3 -3
- package/dist/{auth-link-D75t9wO2.mjs → auth-link-DjeOptYi.mjs} +5 -6
- package/dist/{auth-router-ClfhL1J7.mjs → auth-router-BRxIuqDi.mjs} +7 -7
- package/dist/{build-cmd-zMi1iFnS.mjs → build-cmd-Ce3C8huo.mjs} +6 -7
- package/dist/{cache-ZtQmyxVV.mjs → cache-CS8Yxr5a.mjs} +6 -7
- package/dist/{cancel-deploy-Box0kkEV.mjs → cancel-deploy-mZsD88Xa.mjs} +4 -6
- package/dist/{cf-access-BGe5sWXF.mjs → cf-access-YTlqvAsk.mjs} +1 -1
- package/dist/cf-build-output-ChY6-XWP.mjs +2 -0
- package/dist/cli/cli.mjs +45 -45
- package/dist/cli/cloudflare-operation-process.mjs +3 -3
- package/dist/cli/env-schema-probe.d.mts +1 -1
- package/dist/cli/env-schema-probe.mjs +2 -2
- package/dist/client-BxVixJBI.mjs +2 -0
- package/dist/{client-DKAsFA4X.mjs → client-mC-dFGDD.mjs} +103 -25
- package/dist/{cloudflare-cmd-CmY8dGkd.mjs → cloudflare-cmd-bhwCxAN6.mjs} +2 -2
- package/dist/{cloudflare-connect-IiR3ZieC.mjs → cloudflare-connect-CuhRgk3k.mjs} +2 -2
- package/dist/{cloudflare-operations-DzH-A966.mjs → cloudflare-operations-DYa3coIk.mjs} +2 -2
- package/dist/{cloudflare-operations-BCdXSsmo.mjs → cloudflare-operations-DoQrVHAt.mjs} +1 -1
- package/dist/{connect-B-usTnlF.mjs → connect-H6EvP62X.mjs} +12 -9
- package/dist/{create-project-CYOOAYcn.mjs → create-project-B2kk9Q0o.mjs} +6 -6
- package/dist/{create-project-FWbf5Olo.mjs → create-project-Dbb4uiN-.mjs} +1 -1
- package/dist/{db-Ck2eZ2iB.mjs → db-DpCKZto0.mjs} +35 -38
- package/dist/{delete-sK56qtzZ.mjs → delete-CxlSvsvW.mjs} +6 -7
- package/dist/{deploy-gCVaiJbS.mjs → deploy-CeEbnv4b.mjs} +9249 -8925
- package/dist/deploy-qmiLE1G1.mjs +2 -0
- package/dist/{dev-inbox-P0u4tM8Y.mjs → dev-inbox-D64ZKUod.mjs} +5 -6
- package/dist/{domain-DFfQE8jg.mjs → domain-B_9VgOm6.mjs} +8 -8
- package/dist/{email-CdnhUHvJ.mjs → email-BokHgjKj.mjs} +7 -7
- package/dist/{env-DmGdHi5i.mjs → env-BdTc-K2L.mjs} +7 -8
- package/dist/{env-public-BX_r8HR6.d.mts → env-public-DR7ZM6d-.d.mts} +1 -1
- package/dist/{env-validation-zZOCcQVZ.mjs → env-validation-cZBvGWaP.mjs} +1 -1
- package/dist/{fetch-stream-IvCYKyQL.mjs → fetch-stream-Nm3hkZbT.mjs} +8 -1
- package/dist/{gen-CshAkukR.mjs → gen-BhDlTpwW.mjs} +2 -4
- package/dist/gen-qCBwH3fZ.mjs +2 -0
- package/dist/{github-cmd-DftuEvIt.mjs → github-cmd-hhkTzlGS.mjs} +7 -16
- package/dist/{handler-CZ4nAylQ.d.mts → handler-BeK3weD4.d.mts} +1 -1
- package/dist/{help-Dotbf6iz.mjs → help-Bv44e2tm.mjs} +13 -9
- package/dist/help-Dw5f9Xrg.mjs +2 -0
- package/dist/index.d.mts +19 -15
- package/dist/index.mjs +2225 -2142
- package/dist/{info-B97bTX9N.mjs → info-DhtTKh65.mjs} +2 -4
- package/dist/{init-BTQEZZGJ.mjs → init-BMf4T03q.mjs} +17 -18
- package/dist/{limits-Bq5LG8Id.d.mts → limits-CFsDKQvU.d.mts} +1 -10
- package/dist/{limits-Cjuk2VPm.mjs → limits-D0vD1M9A.mjs} +1 -22
- package/dist/{link-B46sYH0K.mjs → link-BqYsSS_I.mjs} +6 -7
- package/dist/{list-BnPrIsU_.mjs → list-_kBToO-l.mjs} +10 -10
- package/dist/{live-Chw1eIMv.d.mts → live-iAuEH1hd.d.mts} +1 -1
- package/dist/{local-d1-2CMnpuW_.mjs → local-d1-fGxYrVD6.mjs} +2 -2
- package/dist/login-D7meQg_3.mjs +2 -0
- package/dist/{login-BuiMyUrx.mjs → login-DFuo-RWO.mjs} +9 -7
- package/dist/{logs-CZG9d-ic.mjs → logs-DYgnh6dH.mjs} +7 -8
- package/dist/migrate-CEu2X5DB.mjs +2 -0
- package/dist/{migrate-q4_njtaW.mjs → migrate-CV1on-yJ.mjs} +2 -4
- package/dist/{node-BkyRWRx8.mjs → node-C6Q6e1Es.mjs} +1 -1
- package/dist/{operator-args-B3BTmSoi.mjs → operator-args-DdY54Bgb.mjs} +1 -1
- package/dist/{operator-auth-7erYc6Lt.mjs → operator-auth-2dsGlTT5.mjs} +4 -8
- package/dist/{operator-client-CpHjTd0t.mjs → operator-client-BFqpp6z0.mjs} +3 -3
- package/dist/{operator-cmd-DGqPJUD3.mjs → operator-cmd-CUGHXrQf.mjs} +27 -9
- package/dist/operator-cmd-DRPvhpjM.mjs +2 -0
- package/dist/{output-CbM85T4k.mjs → output-BvdaehtE.mjs} +28 -4
- package/dist/pages/client.d.mts +4 -1
- package/dist/pages/client.mjs +120 -29
- package/dist/pages/index.mjs +1 -1
- package/dist/pages/islands-plugin.mjs +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/{plan-NPpwZ_kc.mjs → plan-CJGEeTEI.mjs} +2 -2
- package/dist/plan-COtUvdMA.mjs +2 -0
- package/dist/{platform-args-3k8X9-H_.mjs → platform-args-DSV2p4nY.mjs} +4 -2
- package/dist/platform-args-Dcy_5b_Y.mjs +2 -0
- package/dist/{platform-auth-config-DDrxUy4m.mjs → platform-auth-config-Bosx7U1h.mjs} +20 -19
- package/dist/{platform-auth-protection-BLadnnct.mjs → platform-auth-protection-DcbL_LW_.mjs} +8 -8
- package/dist/{platform-auth-recovery-CmCzX2Fl.mjs → platform-auth-recovery-WfTZ8K6o.mjs} +7 -7
- package/dist/{platform-cmd-DMDEc9uS.mjs → platform-cmd-DbKtQb_4.mjs} +73 -38
- package/dist/{platform-cmd-pMTRhvYs.mjs → platform-cmd-dyFUof0t.mjs} +1 -1
- package/dist/platform-discovery-BC0HCKYt.mjs +41 -0
- package/dist/{platform-domain-Di6EYrQl.mjs → platform-domain-Bsq43AJp.mjs} +5 -4
- package/dist/{platform-lifecycle-BFdSi9Qt.mjs → platform-lifecycle--5gWmDoI.mjs} +1 -1
- package/dist/{platform-lifecycle-BBoNzojY.mjs → platform-lifecycle-Cfi0o6xM.mjs} +4605 -3527
- package/dist/platform-management-Bbwf6-Dq.mjs +2 -0
- package/dist/{platform-management-CWOQOWXm.mjs → platform-management-BrF9STZp.mjs} +211 -31
- package/dist/{platform-plans-config-Vl9BP3H4.mjs → platform-plans-config-DU-8nC2Y.mjs} +3 -3
- package/dist/{platform-recovery-BJnQJEtQ.mjs → platform-recovery-DQAqAQYu.mjs} +3 -3
- package/dist/{platform-registry-DkPPXfp_.mjs → platform-registry-P387v42A.mjs} +18 -11
- package/dist/prepare-BBknoZI1.mjs +2 -0
- package/dist/{prepare-CBLT3CHH.mjs → prepare-BMrRWLwP.mjs} +3 -4
- package/dist/{prepare-DnaKBi--.mjs → prepare-WoUubFKL.mjs} +1 -1
- package/dist/{project-DsblYifa.mjs → project-BiaPQ7ur.mjs} +1 -1
- package/dist/{project-DKG5Ra8p.mjs → project-DQstYTxO.mjs} +1 -1
- package/dist/{project-cmd-DxnXstAq.mjs → project-cmd-BbH2LptN.mjs} +21 -22
- package/dist/{project-team-BmHcaALJ.mjs → project-team-Yiww3-go.mjs} +8 -9
- package/dist/{project-token-GionZlBI.mjs → project-token-BrtT2NkY.mjs} +6 -9
- package/dist/{project-zero-trust-JLCjVQA7.mjs → project-zero-trust-nYJ2V2nc.mjs} +5 -6
- package/dist/{prompts-BNUoTiaf.mjs → prompts-6OSVA7DJ.mjs} +58 -15
- package/dist/{prompts-2TGE6oXx.mjs → prompts-ZAuJlyCj.mjs} +1 -1
- package/dist/{protocol-CjF_iI9X.d.mts → protocol-BX8t2jiw.d.mts} +1 -1
- package/dist/{provision-CVku1JFU.mjs → provision-DMTPG8Rh.mjs} +1 -1
- package/dist/{provision-CaoxO_U7.mjs → provision-VeqAC77A.mjs} +18 -8
- package/dist/{requests-BOjIVAeF.mjs → requests-TIz_jtSu.mjs} +5 -6
- package/dist/{rollback-CwR3pLj3.mjs → rollback-dBqICPzj.mjs} +9 -10
- package/dist/{runner-Ol0TNjk6.mjs → runner--2KF6Kua.mjs} +1 -1
- package/dist/{runner-CXA9Fh8h.mjs → runner-voIltZrY.mjs} +1 -1
- package/dist/runtime/ai.d.mts +10 -11
- package/dist/runtime/ai.mjs +13 -18
- package/dist/runtime/client-react.mjs +1 -1
- package/dist/runtime/client-solid.mjs +1 -1
- package/dist/runtime/client-svelte.mjs +1 -1
- package/dist/runtime/client-vue.mjs +1 -1
- package/dist/runtime/client.mjs +1 -1
- package/dist/runtime/email/testing.mjs +1 -1
- package/dist/runtime/email.mjs +35 -17
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/limits.d.mts +2 -2
- package/dist/runtime/limits.mjs +2 -2
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/migration-handler.mjs +33 -7
- package/dist/runtime/routing.d.mts +1 -1
- package/dist/runtime/routing.mjs +1 -1
- package/dist/runtime/sandbox.d.mts +1 -1
- package/dist/runtime/sandbox.mjs +12 -22
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +1 -1
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/{sandbox-XZAqzFlG.d.mts → sandbox-C5LFoJMf.d.mts} +7 -7
- package/dist/{scan-C7okrLyM.mjs → scan-C8dA7iM4.mjs} +10 -6
- package/dist/{secret-ByWJWBUG.mjs → secret-AKnNXNP5.mjs} +15 -16
- package/dist/{skills-C1PlclPt.mjs → skills-BPQUGClu.mjs} +1 -1
- package/dist/{subcommand-prompt-klFCfcor.mjs → subcommand-prompt-B6WS9Aoz.mjs} +2 -2
- package/dist/sveltekit.d.mts +1 -1
- package/dist/sveltekit.mjs +4 -9
- package/dist/validate-pna7R3Pv.mjs +2 -0
- package/dist/{validate-ctOrgiS3.mjs → validate-ymhap6M_.mjs} +1 -1
- package/dist/{wrangler-7K-bW_DL.mjs → wrangler-DhUerFkW.mjs} +10 -15
- package/dist/{ws-CL1w7GXU.d.mts → ws-C79j4aED.d.mts} +1 -1
- package/package.json +21 -21
- package/sandbox.Dockerfile +1 -1
- package/skills/void/SKILL.md +5 -2
- package/skills/void/docs/guide/ai.md +78 -137
- package/skills/void/docs/guide/app-types.md +1 -1
- package/skills/void/docs/guide/auth.md +0 -2
- package/skills/void/docs/guide/database/d1.md +7 -7
- package/skills/void/docs/guide/database.md +15 -0
- package/skills/void/docs/guide/deployment.md +58 -124
- package/skills/void/docs/guide/env-vars.md +1 -5
- package/skills/void/docs/guide/index.md +19 -18
- package/skills/void/docs/guide/kv.md +0 -2
- package/skills/void/docs/guide/live.md +2 -0
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +49 -47
- package/skills/void/docs/guide/pages-routing/overview.md +2 -2
- package/skills/void/docs/guide/platform/administration/email.md +0 -2
- package/skills/void/docs/guide/platform/administration/operations.md +11 -22
- package/skills/void/docs/guide/platform/administration/plans.md +1 -5
- package/skills/void/docs/guide/platform/administration/zero-trust.md +1 -4
- package/skills/void/docs/guide/platform/development/schema-ci.md +7 -1
- package/skills/void/docs/guide/platform/installation/credentials.md +2 -2
- package/skills/void/docs/guide/platform/installation/first-deployment.md +5 -1
- package/skills/void/docs/guide/platform/installation/maintenance.md +33 -11
- package/skills/void/docs/guide/platform/installation/prerequisites.md +79 -7
- package/skills/void/docs/guide/platform/installation/setup.md +1 -1
- package/skills/void/docs/guide/platform/installation/uninstall.md +44 -11
- package/skills/void/docs/guide/quickstart.md +37 -80
- package/skills/void/docs/guide/sandboxes.md +75 -66
- package/skills/void/docs/guide/self-hosted-platform.md +20 -0
- package/skills/void/docs/guide/websockets.md +0 -2
- package/skills/void/docs/integrations/frameworks/overview.md +2 -2
- package/skills/void/docs/integrations/frameworks/sveltekit.md +40 -25
- package/skills/void/docs/integrations/nodejs-bun-deno.md +7 -2
- package/skills/void/docs/reference/api/resources.md +38 -14
- package/skills/void/docs/reference/api.md +35 -34
- package/skills/void/docs/reference/cli/auth.md +3 -1
- package/skills/void/docs/reference/cli/deploy.md +1 -1
- package/skills/void/docs/reference/cli/platform-config.md +2 -2
- package/skills/void/docs/reference/cli/platform-installation.md +14 -12
- package/skills/void/docs/reference/cli/platform-operations.md +4 -8
- package/skills/void/docs/reference/cli/platform.md +9 -2
- package/skills/void/docs/reference/cli.md +1 -1
- package/skills/void/docs/reference/resource-inference.md +12 -8
- package/dist/cf-build-output-_0HNWysu.mjs +0 -2
- package/dist/client-B9UBI03V.mjs +0 -2
- package/dist/deploy-irP5q0-x.mjs +0 -2
- package/dist/gen-DvQTWzDU.mjs +0 -2
- package/dist/help-mabuIV98.mjs +0 -2
- package/dist/login-DIy9Sb-U.mjs +0 -2
- package/dist/migrate-BCiJ8w0f.mjs +0 -2
- package/dist/plan-D1Q5rf-r.mjs +0 -2
- package/dist/platform-args-DdnM6WIf.mjs +0 -2
- package/dist/platform-management-DG47jys8.mjs +0 -2
- package/dist/prepare-CnjcTV2s.mjs +0 -2
- package/dist/validate-Dq_L3s0S.mjs +0 -2
- package/skills/void/docs/guide/env-migration.md +0 -109
- package/dist/{cf-build-output-BPqOT964.mjs → cf-build-output-U8o1Gl6X.mjs} +1 -1
- package/dist/{env-validation-C_8tPdhs.mjs → env-validation-vBSQ8gw5.mjs} +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { a as join } from "./dist-BVqXeR_h.mjs";
|
|
2
|
+
import { c as normalizePlatformApiUrl } from "./platform-registry-P387v42A.mjs";
|
|
2
3
|
import { t as cfAccessHeaders } from "./cf-access-TWNzXltp.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { a as getApiUrl } from "./auth-CQkSDS50.mjs";
|
|
4
|
+
import { i as isCloudflareAccessChallenge, n as ensurePlatformAccessToken, t as ensureCloudflaredToken } from "./cf-access-YTlqvAsk.mjs";
|
|
5
|
+
import { a as getApiUrl } from "./auth-D52yG7hl.mjs";
|
|
6
6
|
import { n as getPackageDir } from "./agents-B_pX_HmQ.mjs";
|
|
7
|
+
import { n as readPlatformDiscoveryResponse } from "./platform-discovery-BC0HCKYt.mjs";
|
|
7
8
|
import { readFileSync } from "node:fs";
|
|
8
9
|
import { stripVTControlCharacters } from "node:util";
|
|
9
10
|
//#region src/cli/platform-errors.ts
|
|
@@ -106,6 +107,41 @@ function readCliVersion() {
|
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
const VOID_CLI_VERSION = readCliVersion();
|
|
110
|
+
/** The oldest Void platform release this CLI supports. */
|
|
111
|
+
const MIN_PLATFORM_VERSION = "0.26.0";
|
|
112
|
+
const RELEASE_VERSION = /^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$/;
|
|
113
|
+
/**
|
|
114
|
+
* Version checks keyed by platform base URL. Every outcome (pass, inconclusive,
|
|
115
|
+
* or too old) is kept for the rest of the process, so polling commands probe
|
|
116
|
+
* discovery once.
|
|
117
|
+
*/
|
|
118
|
+
const platformVersionChecks = /* @__PURE__ */ new Map();
|
|
119
|
+
/**
|
|
120
|
+
* Returns whether `version` is older than MIN_PLATFORM_VERSION, or null when
|
|
121
|
+
* it is not a release version. A prerelease sorts before its release.
|
|
122
|
+
*/
|
|
123
|
+
function isOlderThanMinimumPlatform(version) {
|
|
124
|
+
const actual = RELEASE_VERSION.exec(version);
|
|
125
|
+
const minimum = RELEASE_VERSION.exec(MIN_PLATFORM_VERSION);
|
|
126
|
+
if (!actual) return null;
|
|
127
|
+
for (const part of [
|
|
128
|
+
1,
|
|
129
|
+
2,
|
|
130
|
+
3
|
|
131
|
+
]) {
|
|
132
|
+
const difference = Number(actual[part]) - Number(minimum[part]);
|
|
133
|
+
if (difference !== 0) return difference < 0;
|
|
134
|
+
}
|
|
135
|
+
return actual[4] !== void 0 && minimum[4] === void 0;
|
|
136
|
+
}
|
|
137
|
+
const UPGRADE_PLATFORM_ACTION = "Ask its administrator to upgrade the platform runtime with `void platform upgrade`.";
|
|
138
|
+
function assertSupportedPlatform(apiUrl, probe) {
|
|
139
|
+
if (probe.kind === "unknown") return;
|
|
140
|
+
if (probe.kind === "missing") throw new Error(`The Void platform at ${apiUrl} does not report its version, but this CLI requires ${MIN_PLATFORM_VERSION} or later. ${UPGRADE_PLATFORM_ACTION}`);
|
|
141
|
+
const { version } = probe;
|
|
142
|
+
if (version === "hosted" || isOlderThanMinimumPlatform(version) !== true) return;
|
|
143
|
+
throw new Error(`The Void platform at ${apiUrl} runs version ${version}, but this CLI requires ${MIN_PLATFORM_VERSION} or later. ${UPGRADE_PLATFORM_ACTION}`);
|
|
144
|
+
}
|
|
109
145
|
/**
|
|
110
146
|
* Detects the `cli_outdated` 426 response shape emitted by the platform's
|
|
111
147
|
* `cliVersionGate` middleware. When present, callers should surface the
|
|
@@ -199,12 +235,20 @@ var PlatformClient = class {
|
|
|
199
235
|
authHeaders;
|
|
200
236
|
accessHeaders;
|
|
201
237
|
cliLog;
|
|
238
|
+
checkPlatformVersion;
|
|
202
239
|
apiUrl;
|
|
240
|
+
/**
|
|
241
|
+
* `checkPlatformVersion: false` skips the minimum platform version check.
|
|
242
|
+
* Only login uses it, so users can still sign in to an older platform.
|
|
243
|
+
*/
|
|
203
244
|
constructor(token, options) {
|
|
204
|
-
if (typeof options === "string")
|
|
205
|
-
|
|
245
|
+
if (typeof options === "string") {
|
|
246
|
+
this.baseUrl = normalizePlatformApiUrl(options);
|
|
247
|
+
this.checkPlatformVersion = true;
|
|
248
|
+
} else {
|
|
206
249
|
this.baseUrl = normalizePlatformApiUrl(options?.apiUrl ?? getApiUrl(options?.root));
|
|
207
250
|
this.cliLog = options?.cliLog;
|
|
251
|
+
this.checkPlatformVersion = options?.checkPlatformVersion !== false;
|
|
208
252
|
}
|
|
209
253
|
this.apiUrl = this.baseUrl;
|
|
210
254
|
ensureCloudflaredToken(this.baseUrl);
|
|
@@ -216,6 +260,46 @@ var PlatformClient = class {
|
|
|
216
260
|
}
|
|
217
261
|
async request(url, options = {}) {
|
|
218
262
|
if (new URL(url).origin !== this.baseUrl) throw new Error("Platform credentials cannot be sent to another origin.");
|
|
263
|
+
if (this.checkPlatformVersion) await this.ensureSupportedPlatform();
|
|
264
|
+
return this.send(url, options);
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Checks the platform version once per process and base URL. Concurrent
|
|
268
|
+
* first requests share one check, and its outcome is kept for later requests.
|
|
269
|
+
*/
|
|
270
|
+
ensureSupportedPlatform() {
|
|
271
|
+
const apiUrl = this.baseUrl;
|
|
272
|
+
const cached = platformVersionChecks.get(apiUrl);
|
|
273
|
+
if (cached) return cached;
|
|
274
|
+
const check = this.probePlatformVersion().then((probe) => assertSupportedPlatform(apiUrl, probe));
|
|
275
|
+
platformVersionChecks.set(apiUrl, check);
|
|
276
|
+
return check;
|
|
277
|
+
}
|
|
278
|
+
/** Reads the platform version from public discovery, without credentials. */
|
|
279
|
+
async probePlatformVersion() {
|
|
280
|
+
let response;
|
|
281
|
+
try {
|
|
282
|
+
response = await this.send(`${this.baseUrl}/.well-known/void-platform`, {
|
|
283
|
+
headers: { Accept: "application/json" },
|
|
284
|
+
signal: AbortSignal.timeout(15e3)
|
|
285
|
+
});
|
|
286
|
+
} catch {
|
|
287
|
+
return { kind: "unknown" };
|
|
288
|
+
}
|
|
289
|
+
if (response.status === 404) {
|
|
290
|
+
await response.body?.cancel();
|
|
291
|
+
return { kind: "missing" };
|
|
292
|
+
}
|
|
293
|
+
try {
|
|
294
|
+
return {
|
|
295
|
+
kind: "version",
|
|
296
|
+
version: (await readPlatformDiscoveryResponse(this.baseUrl, response)).platformVersion
|
|
297
|
+
};
|
|
298
|
+
} catch {
|
|
299
|
+
return { kind: "unknown" };
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
async send(url, options) {
|
|
219
303
|
if (!this.accessHeaders["CF-Access-Client-Id"]) ensureCloudflaredToken(this.baseUrl);
|
|
220
304
|
const send = () => {
|
|
221
305
|
const currentAccessHeaders = cfAccessHeaders(process.env, this.baseUrl);
|
|
@@ -268,7 +352,6 @@ var PlatformClient = class {
|
|
|
268
352
|
/** A lightweight project list for interactive linking. */
|
|
269
353
|
async listProjectChoices() {
|
|
270
354
|
const res = await this.request(`${this.baseUrl}/projects/choices`, { headers: { ...this.authHeaders } });
|
|
271
|
-
if (res.status === 404) throw new Error("This platform does not support project lookup. Ask its administrator to upgrade the platform runtime.");
|
|
272
355
|
if (!res.ok) await throwPlatformApiError("Failed to list project choices", res);
|
|
273
356
|
return res.json();
|
|
274
357
|
}
|
|
@@ -284,7 +367,6 @@ var PlatformClient = class {
|
|
|
284
367
|
const url = new URL(`${this.baseUrl}/projects/resolve`);
|
|
285
368
|
url.searchParams.set("slug", slug);
|
|
286
369
|
const res = await this.request(url.toString(), { headers: { ...this.authHeaders } });
|
|
287
|
-
if (res.status === 404) throw new Error("This platform does not support project lookup. Ask its administrator to upgrade the platform runtime.");
|
|
288
370
|
if (!res.ok) await throwPlatformApiError("Failed to resolve project", res);
|
|
289
371
|
return (await res.json()).project;
|
|
290
372
|
}
|
|
@@ -599,22 +681,19 @@ var PlatformClient = class {
|
|
|
599
681
|
}
|
|
600
682
|
const receipt = res.headers.get("x-void-deployment-id");
|
|
601
683
|
const observationDeadline = Date.now() + DEPLOY_OBSERVATION_DEADLINE_MS;
|
|
602
|
-
if (receipt
|
|
684
|
+
if (receipt === null || !/^[A-Za-z0-9_-]{1,128}$/.test(receipt)) {
|
|
603
685
|
res.body?.cancel().catch(() => {});
|
|
604
|
-
throw new Error("Invalid deployment receipt from platform.");
|
|
686
|
+
throw new Error(receipt === null ? "Platform returned no deployment receipt." : "Invalid deployment receipt from platform.");
|
|
605
687
|
}
|
|
606
688
|
let cursor = 0;
|
|
607
689
|
let terminal = false;
|
|
608
690
|
if (!res.body) {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
return;
|
|
616
|
-
}
|
|
617
|
-
throw new Error("Platform returned no deployment event stream.");
|
|
691
|
+
yield {
|
|
692
|
+
event: "start",
|
|
693
|
+
deploymentId: receipt
|
|
694
|
+
};
|
|
695
|
+
yield* this.followDeploymentEvents(projectId, receipt, cursor, observationDeadline);
|
|
696
|
+
return;
|
|
618
697
|
}
|
|
619
698
|
const reader = res.body.getReader();
|
|
620
699
|
const decoder = new TextDecoder();
|
|
@@ -627,7 +706,6 @@ var PlatformClient = class {
|
|
|
627
706
|
let streamFinished = false;
|
|
628
707
|
let readTimer;
|
|
629
708
|
const read = async () => {
|
|
630
|
-
if (!receipt) return reader.read();
|
|
631
709
|
const remaining = observationDeadline - Date.now();
|
|
632
710
|
if (remaining <= 0) throw new DeploymentObservationTimeoutError(receipt);
|
|
633
711
|
try {
|
|
@@ -653,18 +731,18 @@ var PlatformClient = class {
|
|
|
653
731
|
event: lastEventName,
|
|
654
732
|
raw: line.slice(0, 200)
|
|
655
733
|
});
|
|
656
|
-
if (
|
|
734
|
+
if (event.event === "start") return null;
|
|
657
735
|
terminal = event.event === "done" || event.event === "error";
|
|
658
736
|
return event;
|
|
659
737
|
};
|
|
660
738
|
try {
|
|
661
|
-
|
|
739
|
+
yield {
|
|
662
740
|
event: "start",
|
|
663
741
|
deploymentId: receipt
|
|
664
742
|
};
|
|
665
743
|
while (true) {
|
|
666
744
|
const { done, value } = await read();
|
|
667
|
-
if (
|
|
745
|
+
if (Date.now() >= observationDeadline) throw new DeploymentObservationTimeoutError(receipt);
|
|
668
746
|
if (done) {
|
|
669
747
|
streamFinished = true;
|
|
670
748
|
buffer += decoder.decode();
|
|
@@ -701,13 +779,13 @@ var PlatformClient = class {
|
|
|
701
779
|
eventCount,
|
|
702
780
|
lastEvent: lastEventName
|
|
703
781
|
});
|
|
704
|
-
if (
|
|
782
|
+
if (err instanceof DeploymentObservationTimeoutError || err instanceof DeploymentProtocolError || err instanceof SyntaxError || err instanceof DOMException && err.name === "AbortError") throw err;
|
|
705
783
|
} finally {
|
|
706
784
|
clearTimeout(readTimer);
|
|
707
785
|
if (!streamFinished) reader.cancel().catch(() => {});
|
|
708
786
|
reader.releaseLock();
|
|
709
787
|
}
|
|
710
|
-
if (
|
|
788
|
+
if (!terminal) yield* this.followDeploymentEvents(projectId, receipt, cursor, observationDeadline);
|
|
711
789
|
}
|
|
712
790
|
async *followDeploymentEvents(projectId, deploymentId, since, deadline) {
|
|
713
791
|
let cursor = since;
|
|
@@ -1165,4 +1243,4 @@ function sleep(ms) {
|
|
|
1165
1243
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1166
1244
|
}
|
|
1167
1245
|
//#endregion
|
|
1168
|
-
export {
|
|
1246
|
+
export { isExpiredTokenError as a, platformErrorMessage as c, isCliOutdatedError as i, PlatformApiError as n, readCliVersion as o, PlatformClient as r, parsePlatformErrorBody as s, MIN_PLATFORM_VERSION as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as basename } from "./dist-BVqXeR_h.mjs";
|
|
2
|
-
import { y as readRootWranglerConfig } from "./wrangler-
|
|
3
|
-
import { L as log } from "./prompts-
|
|
2
|
+
import { y as readRootWranglerConfig } from "./wrangler-DhUerFkW.mjs";
|
|
3
|
+
import { L as log } from "./prompts-6OSVA7DJ.mjs";
|
|
4
4
|
import { a as parseCloudflareAuthSession, i as ensureCloudflareAuthentication, n as cloudflareCredentialOverrides, r as createBundledCloudflareAuthRunner } from "./cloudflare-auth-Qdc7tw8F.mjs";
|
|
5
5
|
//#region src/cli/cloudflare-cmd.ts
|
|
6
6
|
async function runCloudflareCommand(root, args) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as join, t as basename } from "./dist-BVqXeR_h.mjs";
|
|
2
|
-
import { A as writeProvisionedWranglerConfig, i as LATEST_KNOWN_COMPAT_DATE, y as readRootWranglerConfig } from "./wrangler-
|
|
3
|
-
import { K as select, L as log, tt as isCancel } from "./prompts-
|
|
2
|
+
import { A as writeProvisionedWranglerConfig, i as LATEST_KNOWN_COMPAT_DATE, y as readRootWranglerConfig } from "./wrangler-DhUerFkW.mjs";
|
|
3
|
+
import { K as select, L as log, tt as isCancel } from "./prompts-6OSVA7DJ.mjs";
|
|
4
4
|
import { i as ensureCloudflareAuthentication, r as createBundledCloudflareAuthRunner } from "./cloudflare-auth-Qdc7tw8F.mjs";
|
|
5
5
|
import { existsSync } from "node:fs";
|
|
6
6
|
//#region src/cli/cloudflare-connect.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as join } from "./dist-BVqXeR_h.mjs";
|
|
2
2
|
import { i as persistCloudflareConfig, r as materializeCloudflareConfig } from "./cloudflare-config-Bktvwtpf.mjs";
|
|
3
|
-
import { C as readWranglerPublishedTrafficSnapshot, j as writeWranglerPublishedTrafficSnapshot, k as updateWranglerCustomDomain, x as readWranglerCustomDomains } from "./wrangler-
|
|
3
|
+
import { C as readWranglerPublishedTrafficSnapshot, j as writeWranglerPublishedTrafficSnapshot, k as updateWranglerCustomDomain, x as readWranglerCustomDomains } from "./wrangler-DhUerFkW.mjs";
|
|
4
4
|
import { r as scanWranglerDotenvKeys } from "./dotenv-VQxupEUv.mjs";
|
|
5
5
|
import { t as createCloudflareProcessRunner } from "./cloudflare-process-B-wekeR6.mjs";
|
|
6
|
-
import { _ as resolvePinnedApiBaseUrl, g as provisionEnv, r as assertNoTransportRedirectInProjectDotenv, s as deleteEnvVarCaseAware } from "./provision-
|
|
6
|
+
import { _ as resolvePinnedApiBaseUrl, g as provisionEnv, r as assertNoTransportRedirectInProjectDotenv, s as deleteEnvVarCaseAware } from "./provision-VeqAC77A.mjs";
|
|
7
7
|
import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
8
8
|
import { tmpdir } from "node:os";
|
|
9
9
|
import { deployCloudflareVersionTraffic, encodeCloudflareVersionMessage, parseCloudflareVersionMessage, parseRootWranglerConfig, readBindingFieldPresence, readCloudflareTriggerConfig, readWranglerTopLevelString, resolveD1MigrateTarget, stabilizeCloudflareVersionTriggers } from "@void/deploy-cloudflare";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as resolveCloudflareD1Context, b as tailCloudflareWorker, c as listCloudflareDomains, g as readCloudflareWorkerStatus, h as readCloudflareD1Migrations, l as listCloudflareSecrets, m as putCloudflareSecret, n as applyCloudflareD1Migrations, o as deleteCloudflareSecret, r as changeCloudflareDomain, s as executeCloudflareD1Sql, t as activateCloudflareExistingVersion, v as resolveCloudflareOperationContext, y as syncCloudflareSecrets } from "./cloudflare-operations-
|
|
1
|
+
import { _ as resolveCloudflareD1Context, b as tailCloudflareWorker, c as listCloudflareDomains, g as readCloudflareWorkerStatus, h as readCloudflareD1Migrations, l as listCloudflareSecrets, m as putCloudflareSecret, n as applyCloudflareD1Migrations, o as deleteCloudflareSecret, r as changeCloudflareDomain, s as executeCloudflareD1Sql, t as activateCloudflareExistingVersion, v as resolveCloudflareOperationContext, y as syncCloudflareSecrets } from "./cloudflare-operations-DYa3coIk.mjs";
|
|
2
2
|
export { activateCloudflareExistingVersion, applyCloudflareD1Migrations, changeCloudflareDomain, deleteCloudflareSecret, executeCloudflareD1Sql, listCloudflareDomains, listCloudflareSecrets, putCloudflareSecret, readCloudflareD1Migrations, readCloudflareWorkerStatus, resolveCloudflareD1Context, resolveCloudflareOperationContext, syncCloudflareSecrets, tailCloudflareWorker };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as writePlatformSelection, n as readDeploymentPlatform, s as writeDeploymentPlatform } from "./project-
|
|
3
|
-
import { d as readPlatformToken } from "./auth-
|
|
4
|
-
import { K as select, L as log, tt as isCancel } from "./prompts-
|
|
5
|
-
import {
|
|
6
|
-
import { t as promptForLoginToken } from "./login-
|
|
7
|
-
import { i as saveDiscoveredPlatform, n as promptPlatformUrl, t as discoverPlatform } from "./platform-cmd-
|
|
8
|
-
import { t as connectCloudflare } from "./cloudflare-connect-
|
|
1
|
+
import { c as normalizePlatformApiUrl, s as listPlatformConnections } from "./platform-registry-P387v42A.mjs";
|
|
2
|
+
import { c as writePlatformSelection, n as readDeploymentPlatform, s as writeDeploymentPlatform } from "./project-DQstYTxO.mjs";
|
|
3
|
+
import { d as readPlatformToken } from "./auth-D52yG7hl.mjs";
|
|
4
|
+
import { K as select, L as log, tt as isCancel } from "./prompts-6OSVA7DJ.mjs";
|
|
5
|
+
import { a as isExpiredTokenError, r as PlatformClient } from "./client-mC-dFGDD.mjs";
|
|
6
|
+
import { t as promptForLoginToken } from "./login-DFuo-RWO.mjs";
|
|
7
|
+
import { i as saveDiscoveredPlatform, n as promptPlatformUrl, t as discoverPlatform } from "./platform-cmd-DbKtQb_4.mjs";
|
|
8
|
+
import { t as connectCloudflare } from "./cloudflare-connect-CuhRgk3k.mjs";
|
|
9
9
|
//#region src/cli/connect.ts
|
|
10
10
|
async function selectVoidPlatform(interactive) {
|
|
11
11
|
if (!interactive) throw new Error("connect: Supply a Void platform URL in non-interactive mode.");
|
|
@@ -31,7 +31,10 @@ async function authenticateConnection(root, discovery, interactive) {
|
|
|
31
31
|
const matchingEnv = Boolean(envToken && envUrl && normalizePlatformApiUrl(envUrl) === discovery.apiUrl);
|
|
32
32
|
const token = matchingEnv ? envToken : readPlatformToken(discovery.apiUrl);
|
|
33
33
|
if (token) try {
|
|
34
|
-
await new PlatformClient(token, {
|
|
34
|
+
await new PlatformClient(token, {
|
|
35
|
+
apiUrl: discovery.apiUrl,
|
|
36
|
+
checkPlatformVersion: false
|
|
37
|
+
}).whoami();
|
|
35
38
|
log.success(`Authenticated with ${discovery.displayName}.`);
|
|
36
39
|
return;
|
|
37
40
|
} catch (error) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { l as writeProjectConfig, t as attachSelectedPlatform } from "./project-
|
|
2
|
-
import { s as getSiteDomain } from "./auth-
|
|
3
|
-
import { A as confirm, K as select, L as log, O as cancel, X as text, tt as isCancel } from "./prompts-
|
|
4
|
-
import {
|
|
5
|
-
import { c as import_picocolors,
|
|
1
|
+
import { l as writeProjectConfig, t as attachSelectedPlatform } from "./project-DQstYTxO.mjs";
|
|
2
|
+
import { s as getSiteDomain } from "./auth-D52yG7hl.mjs";
|
|
3
|
+
import { A as confirm, K as select, L as log, O as cancel, X as text, tt as isCancel } from "./prompts-6OSVA7DJ.mjs";
|
|
4
|
+
import { n as PlatformApiError } from "./client-mC-dFGDD.mjs";
|
|
5
|
+
import { c as import_picocolors, u as sanitizeTerminalText } from "./output-BvdaehtE.mjs";
|
|
6
6
|
import { t as validateProjectSlug } from "./project-slug-23TpquG4.mjs";
|
|
7
7
|
import { n as inferDefaultSlug } from "./resolve-project-BG5ORGID.mjs";
|
|
8
8
|
//#region src/cli/prompt.ts
|
|
@@ -30,7 +30,7 @@ async function promptProjectSelection(projects, message = "Select a project:", r
|
|
|
30
30
|
}], ...projects.map((p) => ({
|
|
31
31
|
value: p.id,
|
|
32
32
|
label: `${p.slug} (${p.url ?? `${p.slug}.${getSiteDomain(root)}`})`,
|
|
33
|
-
|
|
33
|
+
hint: p.role === "reader" ? "reader (read-only)" : p.role
|
|
34
34
|
}))];
|
|
35
35
|
const result = await select({
|
|
36
36
|
message,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createProjectWithSlugRetry } from "./create-project-
|
|
1
|
+
import { t as createProjectWithSlugRetry } from "./create-project-B2kk9Q0o.mjs";
|
|
2
2
|
export { createProjectWithSlugRetry };
|
|
@@ -3,17 +3,17 @@ import { r as detectFramework } from "./plugin-inference-CXWnn79A.mjs";
|
|
|
3
3
|
import { n as readProjectPaths } from "./project-paths-GgcMozYz.mjs";
|
|
4
4
|
import { h as resolveBindingNames, m as readConfig, u as getDatabaseDialect } from "./config-Br_JZD6u.mjs";
|
|
5
5
|
import { i as writeJournal, n as readJournal, r as stripSqlExt, t as collectMigrations } from "./collect-DiTn9yr6.mjs";
|
|
6
|
+
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-DQstYTxO.mjs";
|
|
7
|
+
import { t as resolveLocalD1Target } from "./local-d1-fGxYrVD6.mjs";
|
|
6
8
|
import { t as cfAccessHeaders } from "./cf-access-TWNzXltp.mjs";
|
|
7
|
-
import { i as isCloudflareAccessChallenge, n as ensurePlatformAccessToken, r as ensurePlatformProxyAccess } from "./cf-access-
|
|
8
|
-
import {
|
|
9
|
-
import { c as getToken, o as getProxyUrl } from "./auth-CQkSDS50.mjs";
|
|
10
|
-
import { t as resolveLocalD1Target } from "./local-d1-2CMnpuW_.mjs";
|
|
9
|
+
import { i as isCloudflareAccessChallenge, n as ensurePlatformAccessToken, r as ensurePlatformProxyAccess } from "./cf-access-YTlqvAsk.mjs";
|
|
10
|
+
import { c as getToken, o as getProxyUrl } from "./auth-D52yG7hl.mjs";
|
|
11
11
|
import { a as loadLocalEnv } from "./env-_v349JBd.mjs";
|
|
12
|
-
import { A as confirm, H as outro, L as log,
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { n as formatTimestamp } from "./gen-
|
|
12
|
+
import { A as confirm, H as outro, L as log, tt as isCancel } from "./prompts-6OSVA7DJ.mjs";
|
|
13
|
+
import { n as PlatformApiError, r as PlatformClient } from "./client-mC-dFGDD.mjs";
|
|
14
|
+
import { c as import_picocolors, i as dim, o as formatCount } from "./output-BvdaehtE.mjs";
|
|
15
|
+
import { i as validateMigrations, r as listDrizzleArtifacts, t as assertJournalCoherence } from "./validate-ymhap6M_.mjs";
|
|
16
|
+
import { n as formatTimestamp } from "./gen-BhDlTpwW.mjs";
|
|
17
17
|
import { createRequire } from "node:module";
|
|
18
18
|
import { existsSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
19
19
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -197,10 +197,7 @@ function validatePendingMigrations(migrations, appliedNames) {
|
|
|
197
197
|
validateMigrations(pending);
|
|
198
198
|
}
|
|
199
199
|
async function runDbCommand(root, args) {
|
|
200
|
-
|
|
201
|
-
if (exportToStdout) process.stderr.write("\n");
|
|
202
|
-
else console.log();
|
|
203
|
-
intro(cliTitle("db"), exportToStdout ? { output: process.stderr } : void 0);
|
|
200
|
+
if (!(args.action === "export" && !args.output)) console.log();
|
|
204
201
|
const dialect = getDatabaseDialect(readConfig(root));
|
|
205
202
|
if (args.action === "push") await runPush(root, dialect);
|
|
206
203
|
else if (args.action === "generate") await runGenerate(root, dialect);
|
|
@@ -273,7 +270,7 @@ async function runConnect(root, dialect, args) {
|
|
|
273
270
|
if (result.dashboardUrl) log.info(`Dashboard: ${result.dashboardUrl}`);
|
|
274
271
|
}
|
|
275
272
|
if (!connectionString) {
|
|
276
|
-
const { text: promptText, isCancel: isCancelCheck } = await import("./prompts-
|
|
273
|
+
const { text: promptText, isCancel: isCancelCheck } = await import("./prompts-ZAuJlyCj.mjs");
|
|
277
274
|
const answer = await promptText({
|
|
278
275
|
message: `Enter your ${dialect === "mysql" ? "MySQL" : "PostgreSQL"} connection string:`,
|
|
279
276
|
placeholder: dialect === "mysql" ? "mysql://user:pass@host:3306/database" : "postgresql://user:pass@host:5432/database"
|
|
@@ -318,7 +315,7 @@ async function runPush(root, dialect) {
|
|
|
318
315
|
outro("Done.");
|
|
319
316
|
}
|
|
320
317
|
async function runGenerate(root, dialect) {
|
|
321
|
-
const { prepareProject } = await import("./prepare-
|
|
318
|
+
const { prepareProject } = await import("./prepare-BBknoZI1.mjs");
|
|
322
319
|
const { writeDrizzleConfig } = await import("./config-0acf1oys.mjs");
|
|
323
320
|
await prepareProject(root);
|
|
324
321
|
const authSchemaPath = join(root, ".void", "better-auth-schema.ts");
|
|
@@ -384,7 +381,7 @@ async function runStatus(root, dialect) {
|
|
|
384
381
|
localApplied = [];
|
|
385
382
|
}
|
|
386
383
|
else {
|
|
387
|
-
const { getAppliedMigrations } = await import("./runner-
|
|
384
|
+
const { getAppliedMigrations } = await import("./runner-voIltZrY.mjs");
|
|
388
385
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
389
386
|
localApplied = await getAppliedMigrations(dbPath);
|
|
390
387
|
}
|
|
@@ -399,7 +396,7 @@ async function runStatus(root, dialect) {
|
|
|
399
396
|
applied_at: ""
|
|
400
397
|
}));
|
|
401
398
|
} else {
|
|
402
|
-
const { readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
399
|
+
const { readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-DoQrVHAt.mjs");
|
|
403
400
|
remoteApplied = (await readCloudflareD1Migrations(resolveCloudflareD1Context(root, resolveBindingNames(readConfig(root).inference?.bindings)?.d1 ?? "DB"))).map((name) => ({
|
|
404
401
|
name,
|
|
405
402
|
applied_at: ""
|
|
@@ -423,7 +420,7 @@ async function runStatus(root, dialect) {
|
|
|
423
420
|
}
|
|
424
421
|
log.info(lines.join("\n"));
|
|
425
422
|
const localPending = allMigrations.length - localSet.size;
|
|
426
|
-
const parts = [
|
|
423
|
+
const parts = [formatCount(allMigrations.length, "migration")];
|
|
427
424
|
if (localPending > 0) parts.push(`${localPending} pending locally`);
|
|
428
425
|
if (remoteSet !== null) {
|
|
429
426
|
const remotePending = allMigrations.length - remoteSet.size;
|
|
@@ -480,7 +477,7 @@ async function resetDatabase(root, dialect) {
|
|
|
480
477
|
}
|
|
481
478
|
return migrations.length;
|
|
482
479
|
}
|
|
483
|
-
const { runMigrations } = await import("./runner-
|
|
480
|
+
const { runMigrations } = await import("./runner-voIltZrY.mjs");
|
|
484
481
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
485
482
|
rmSync(dbPath, { force: true });
|
|
486
483
|
rmSync(dbPath + "-wal", { force: true });
|
|
@@ -489,13 +486,13 @@ async function resetDatabase(root, dialect) {
|
|
|
489
486
|
}
|
|
490
487
|
async function runReset(root, dialect) {
|
|
491
488
|
const count = await resetDatabase(root, dialect);
|
|
492
|
-
log.success(`Database reset. Applied ${count
|
|
489
|
+
log.success(`Database reset. Applied ${formatCount(count, "migration")}.`);
|
|
493
490
|
if (dialect === "sqlite") log.info(dim("Restart your dev server if it's running."));
|
|
494
491
|
outro("Done.");
|
|
495
492
|
}
|
|
496
493
|
async function runSeed(root, file, dialect) {
|
|
497
494
|
const migrationCount = await resetDatabase(root, dialect);
|
|
498
|
-
log.step(`Reset database. Applied ${migrationCount
|
|
495
|
+
log.step(`Reset database. Applied ${formatCount(migrationCount, "migration")}.`);
|
|
499
496
|
const seed = resolveSeedTarget(root, file);
|
|
500
497
|
if (seed.kind === "sql") {
|
|
501
498
|
const sql = readFileSync(seed.path, "utf-8");
|
|
@@ -515,7 +512,7 @@ async function runSeed(root, file, dialect) {
|
|
|
515
512
|
outro("Done.");
|
|
516
513
|
return;
|
|
517
514
|
}
|
|
518
|
-
const { openSqliteDatabase } = await import("./runner-
|
|
515
|
+
const { openSqliteDatabase } = await import("./runner-voIltZrY.mjs");
|
|
519
516
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
520
517
|
const db = await openSqliteDatabase(dbPath);
|
|
521
518
|
try {
|
|
@@ -641,7 +638,7 @@ async function runExecute(root, command, file, dialect, remote) {
|
|
|
641
638
|
process.exit(0);
|
|
642
639
|
}
|
|
643
640
|
if (dialect === "sqlite") {
|
|
644
|
-
const { executeCloudflareD1Sql, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
641
|
+
const { executeCloudflareD1Sql, resolveCloudflareD1Context } = await import("./cloudflare-operations-DoQrVHAt.mjs");
|
|
645
642
|
const rows = await executeCloudflareD1Sql(resolveCloudflareD1Context(root, resolveBindingNames(readConfig(root).inference?.bindings)?.d1 ?? "DB"), sql);
|
|
646
643
|
if (rows.length > 0) printTable(rows);
|
|
647
644
|
else log.success("Executed successfully.");
|
|
@@ -746,7 +743,7 @@ async function runExecute(root, command, file, dialect, remote) {
|
|
|
746
743
|
outro("Done.");
|
|
747
744
|
return;
|
|
748
745
|
}
|
|
749
|
-
const { openSqliteDatabase } = await import("./runner-
|
|
746
|
+
const { openSqliteDatabase } = await import("./runner-voIltZrY.mjs");
|
|
750
747
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
751
748
|
if (!existsSync(dbPath)) {
|
|
752
749
|
log.error("No local database found. Run `void dev` first.");
|
|
@@ -832,7 +829,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
832
829
|
validateMigrations(pending);
|
|
833
830
|
const applied = await applyMigrations();
|
|
834
831
|
for (const migration of applied) log.step(migration);
|
|
835
|
-
log.success(`Applied ${applied.length
|
|
832
|
+
log.success(`Applied ${formatCount(applied.length, "migration")} to remote database.`);
|
|
836
833
|
outro("Done.");
|
|
837
834
|
return;
|
|
838
835
|
} catch (error) {
|
|
@@ -846,7 +843,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
846
843
|
outro("Done.");
|
|
847
844
|
return;
|
|
848
845
|
}
|
|
849
|
-
const { applyCloudflareD1Migrations, readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
846
|
+
const { applyCloudflareD1Migrations, readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-DoQrVHAt.mjs");
|
|
850
847
|
const binding = resolveBindingNames(readConfig(root).inference?.bindings)?.d1 ?? "DB";
|
|
851
848
|
const context = resolveCloudflareD1Context(root, binding);
|
|
852
849
|
const remoteBefore = new Set(await readCloudflareD1Migrations(context));
|
|
@@ -862,7 +859,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
862
859
|
log.error(getErrorMessage(error));
|
|
863
860
|
process.exit(1);
|
|
864
861
|
}
|
|
865
|
-
const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-
|
|
862
|
+
const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-qmiLE1G1.mjs");
|
|
866
863
|
const applySet = await checkWranglerMigrationApplySet(context.operation.configPath, parseRootWranglerConfig(context.operation.configPath), binding, context.migrationsDir, rawMigrations);
|
|
867
864
|
if (!applySet.ok) {
|
|
868
865
|
log.error(applySet.reason);
|
|
@@ -876,7 +873,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
876
873
|
process.exit(1);
|
|
877
874
|
}
|
|
878
875
|
for (const migration of pending) log.step(migration.name);
|
|
879
|
-
log.success(`Applied ${pending.length
|
|
876
|
+
log.success(`Applied ${formatCount(pending.length, "migration")} to remote database.`);
|
|
880
877
|
outro("Done.");
|
|
881
878
|
return;
|
|
882
879
|
}
|
|
@@ -924,7 +921,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
924
921
|
if (result.applied.length === 0) log.info("Remote database is up to date.");
|
|
925
922
|
else {
|
|
926
923
|
for (const name of result.applied) log.step(name);
|
|
927
|
-
log.success(`Applied ${result.applied.length
|
|
924
|
+
log.success(`Applied ${formatCount(result.applied.length, "migration")} to remote database.`);
|
|
928
925
|
}
|
|
929
926
|
for (const warning of result.warnings ?? []) log.warn(warning);
|
|
930
927
|
outro("Done.");
|
|
@@ -950,7 +947,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
950
947
|
if (applied.length === 0) log.info("All migrations are up to date.");
|
|
951
948
|
else {
|
|
952
949
|
for (const name of applied) log.step(name);
|
|
953
|
-
log.success(`Applied ${applied.length
|
|
950
|
+
log.success(`Applied ${formatCount(applied.length, "migration")}.`);
|
|
954
951
|
}
|
|
955
952
|
outro("Done.");
|
|
956
953
|
return;
|
|
@@ -975,12 +972,12 @@ async function runMigrate(root, dialect, remote) {
|
|
|
975
972
|
if (applied.length === 0) log.info("All migrations are up to date.");
|
|
976
973
|
else {
|
|
977
974
|
for (const name of applied) log.step(name);
|
|
978
|
-
log.success(`Applied ${applied.length
|
|
975
|
+
log.success(`Applied ${formatCount(applied.length, "migration")}.`);
|
|
979
976
|
}
|
|
980
977
|
outro("Done.");
|
|
981
978
|
return;
|
|
982
979
|
}
|
|
983
|
-
const { getAppliedMigrations, runMigrations } = await import("./runner-
|
|
980
|
+
const { getAppliedMigrations, runMigrations } = await import("./runner-voIltZrY.mjs");
|
|
984
981
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
985
982
|
try {
|
|
986
983
|
const existingRows = await getAppliedMigrations(dbPath);
|
|
@@ -993,7 +990,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
993
990
|
if (applied.length === 0) log.info("All migrations are up to date.");
|
|
994
991
|
else {
|
|
995
992
|
for (const name of applied) log.step(name);
|
|
996
|
-
log.success(`Applied ${applied.length
|
|
993
|
+
log.success(`Applied ${formatCount(applied.length, "migration")}.`);
|
|
997
994
|
log.info(dim("Restart your dev server if it's running."));
|
|
998
995
|
}
|
|
999
996
|
outro("Done.");
|
|
@@ -1290,7 +1287,7 @@ async function runRenameMigrations(root, dialect) {
|
|
|
1290
1287
|
process.exit(1);
|
|
1291
1288
|
}
|
|
1292
1289
|
else {
|
|
1293
|
-
const { openSqliteDatabase } = await import("./runner-
|
|
1290
|
+
const { openSqliteDatabase } = await import("./runner-voIltZrY.mjs");
|
|
1294
1291
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
1295
1292
|
if (existsSync(dbPath)) try {
|
|
1296
1293
|
const db = await openSqliteDatabase(dbPath);
|
|
@@ -1319,7 +1316,7 @@ async function runRenameMigrations(root, dialect) {
|
|
|
1319
1316
|
process.exit(1);
|
|
1320
1317
|
}
|
|
1321
1318
|
}
|
|
1322
|
-
log.success(`Renamed ${renames.length
|
|
1319
|
+
log.success(`Renamed ${formatCount(renames.length, "migration")} to timestamp format.`);
|
|
1323
1320
|
outro("Done.");
|
|
1324
1321
|
}
|
|
1325
1322
|
function formatMySqlExportValue(value) {
|
|
@@ -1442,7 +1439,7 @@ async function runExport(root, args, dialect) {
|
|
|
1442
1439
|
} else process.stdout.write(output);
|
|
1443
1440
|
return;
|
|
1444
1441
|
}
|
|
1445
|
-
const { openSqliteDatabase } = await import("./runner-
|
|
1442
|
+
const { openSqliteDatabase } = await import("./runner-voIltZrY.mjs");
|
|
1446
1443
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
1447
1444
|
if (!existsSync(dbPath)) {
|
|
1448
1445
|
log.error("No local database found. Run `void dev` first.", errOut);
|
|
@@ -1524,7 +1521,7 @@ async function runSetUrl(root) {
|
|
|
1524
1521
|
log.error("No project linked. Run `void deploy` first or link a project.");
|
|
1525
1522
|
process.exit(1);
|
|
1526
1523
|
}
|
|
1527
|
-
const { text: promptText, isCancel: isCancelCheck } = await import("./prompts-
|
|
1524
|
+
const { text: promptText, isCancel: isCancelCheck } = await import("./prompts-ZAuJlyCj.mjs");
|
|
1528
1525
|
const connectionString = await promptText({
|
|
1529
1526
|
message: `Enter your ${dialect === "mysql" ? "MySQL" : "PostgreSQL"} connection string:`,
|
|
1530
1527
|
placeholder: dialect === "mysql" ? "mysql://user:pass@host:3306/dbname" : "postgresql://user:pass@host:5432/dbname",
|
|
@@ -1611,7 +1608,7 @@ async function runSeedModule(root, seedPath, dialect) {
|
|
|
1611
1608
|
return;
|
|
1612
1609
|
}
|
|
1613
1610
|
const { drizzle } = await import("drizzle-orm/better-sqlite3");
|
|
1614
|
-
const { openSqliteDatabase } = await import("./runner-
|
|
1611
|
+
const { openSqliteDatabase } = await import("./runner-voIltZrY.mjs");
|
|
1615
1612
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
1616
1613
|
const sqlite = await openSqliteDatabase(dbPath);
|
|
1617
1614
|
try {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { a as removeProjectConfig, r as readProjectConfig } from "./project-
|
|
2
|
-
import { c as getToken } from "./auth-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { a as removeProjectConfig, r as readProjectConfig } from "./project-DQstYTxO.mjs";
|
|
2
|
+
import { c as getToken } from "./auth-D52yG7hl.mjs";
|
|
3
|
+
import { H as outro, L as log, O as cancel, X as text, tt as isCancel } from "./prompts-6OSVA7DJ.mjs";
|
|
4
|
+
import { r as PlatformClient } from "./client-mC-dFGDD.mjs";
|
|
5
|
+
import { l as note, r as createSpinner } from "./output-BvdaehtE.mjs";
|
|
6
6
|
import { r as resolveProjectBySlug } from "./resolve-project-BG5ORGID.mjs";
|
|
7
7
|
//#region src/cli/delete.ts
|
|
8
8
|
async function runDeleteCommand(root, slug, options) {
|
|
9
9
|
console.log();
|
|
10
|
-
intro(cliTitle("delete"));
|
|
11
10
|
const token = getToken(root);
|
|
12
11
|
if (!token) {
|
|
13
12
|
log.error("Not logged in. Run `void account login` first.");
|
|
@@ -55,7 +54,7 @@ async function runDeleteCommand(root, slug, options) {
|
|
|
55
54
|
const s = createSpinner();
|
|
56
55
|
s.start("Deleting project...");
|
|
57
56
|
const result = await client.deleteProject(projectId);
|
|
58
|
-
s.
|
|
57
|
+
s.clear();
|
|
59
58
|
if (result.warnings && result.warnings.length > 0) for (const warning of result.warnings) log.warn(warning);
|
|
60
59
|
if (readProjectConfig(root)?.projectId === projectId) {
|
|
61
60
|
removeProjectConfig(root);
|