void 0.20.1 → 0.20.2
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 +5 -1
- package/dist/{auth-W9WII-mN.mjs → auth-DPl6kck4.mjs} +46 -26
- package/dist/{auth-cmd-CAH62yDU.mjs → auth-cmd-gniL2fNt.mjs} +5 -4
- package/dist/auth-link-NZdjCmSc.mjs +28 -0
- package/dist/{build-cmd-CJvZvPQO.mjs → build-cmd-sI18tX_O.mjs} +3 -3
- package/dist/{cache-BlNeQjuP.mjs → cache-IHn5MwBC.mjs} +3 -3
- package/dist/{cancel-deploy-CmlAZ9P6.mjs → cancel-deploy-C5qTOdLi.mjs} +3 -3
- package/dist/cf-access-DRsQRe6k.mjs +75 -0
- package/dist/cli/cli.mjs +308 -1958
- package/dist/cli/env-schema-probe.mjs +11 -2
- package/dist/{client-Clirrol3.mjs → client-dHfSJvAN.mjs} +300 -81
- package/dist/{cloudflare-auth-B1QtTO1b.mjs → cloudflare-auth-6M5llVPC.mjs} +2 -2
- package/dist/{cloudflare-cmd-B6_OZx2V.mjs → cloudflare-cmd-4RPGN3KB.mjs} +2 -2
- package/dist/{cloudflare-connect-j5D4hhrG.mjs → cloudflare-connect-t1UU5svD.mjs} +2 -2
- package/dist/{cloudflare-operations-CPTpRW6d.mjs → cloudflare-operations-BzWnlC1_.mjs} +1 -1
- package/dist/{config-BQFq7QvD.mjs → config-uNGuFsI2.mjs} +1 -1
- package/dist/{connect-C04Wdy_h.mjs → connect-Bfk31O_8.mjs} +6 -6
- package/dist/{create-project-ChGZ1DFd.mjs → create-project-Bk9Z0-Jg.mjs} +6 -5
- package/dist/{db-D2d_mUsB.mjs → db-BkRoptAt.mjs} +47 -30
- package/dist/{delete-D8GigDk8.mjs → delete-DouASY9P.mjs} +3 -3
- package/dist/{deploy-iXZ3F0N6.mjs → deploy-DTaWUS1S.mjs} +121 -110
- package/dist/{dev-inbox-DkgRWLkW.mjs → dev-inbox-P0u4tM8Y.mjs} +1 -1
- package/dist/{domain-B1VmoSr0.mjs → domain-1RhhOVrC.mjs} +4 -4
- package/dist/email-C-lGh51B.mjs +795 -0
- package/dist/{env-D4Emu-M_.mjs → env-DBKmK4vc.mjs} +1 -0
- package/dist/{env-BcQzYgoG.mjs → env-DJHsPE7Z.mjs} +5 -5
- package/dist/{env-validation-ENpMy6Ez.mjs → env-validation-CF6KvTRf.mjs} +3 -1
- package/dist/{gen-DI2YwdBM.mjs → gen-B_wPnVTK.mjs} +2 -2
- package/dist/{github-cmd-xItS5Zwf.mjs → github-cmd-PW7ZnWTp.mjs} +3 -3
- package/dist/{headers-D8QfRX9Y.mjs → headers-BAHwgHdW.mjs} +1 -1
- package/dist/help-CwOX-zmI.mjs +2216 -0
- package/dist/{inbound-afAcWeQ9.d.mts → inbound-CH5Mksyy.d.mts} +34 -48
- package/dist/{inbound-2d0zi2yS.mjs → inbound-aVHEUhKo.mjs} +130 -100
- package/dist/index.mjs +54 -17
- package/dist/{init-BD-9THgn.mjs → init-BWZ7q5Z4.mjs} +11 -11
- package/dist/{link-RMdgjF1v.mjs → link-Rmvu2Wl_.mjs} +4 -4
- package/dist/{list-3F52R_yO.mjs → list-DEE2S6mY.mjs} +4 -4
- package/dist/{login-pV69H-ZO.mjs → login-Uvferzmm.mjs} +28 -10
- package/dist/{logs-DFHHD6wE.mjs → logs-27FenuiC.mjs} +4 -4
- package/dist/{mime-BJD7d_qL.mjs → mime-D5Nmdzf7.mjs} +23 -9
- package/dist/{node-Dk3H2jmU.mjs → node-Ez5KW5rn.mjs} +2 -2
- package/dist/operator-auth-B3e08unv.mjs +52 -0
- package/dist/operator-client-LUZnlnYk.mjs +82 -0
- package/dist/{operator-cmd-DYWRbWUA.mjs → operator-cmd-CjOTmAYE.mjs} +35 -55
- package/dist/{output-tFQLLj26.mjs → output-B0cfNSx5.mjs} +316 -2
- package/dist/pages/index.mjs +2 -2
- package/dist/platform-auth-config-DrbQXXiW.mjs +368 -0
- package/dist/platform-auth-protection-Bhtvp0B_.mjs +219 -0
- package/dist/platform-auth-recovery-CeOKGVeJ.mjs +310 -0
- package/dist/{platform-cmd-DxJ2FRwR.mjs → platform-cmd-BFhieCdV.mjs} +16 -6
- package/dist/{platform-domain-ChvbJkdy.mjs → platform-domain-C74PULqV.mjs} +4 -4
- package/dist/{platform-lifecycle-DN4MzJF_.mjs → platform-lifecycle-BwAIgz-t.mjs} +1667 -191
- package/dist/{platform-management-Db2PXw0B.mjs → platform-management-COogu_Se.mjs} +33 -7
- package/dist/{platform-recovery-C_YO-tIs.mjs → platform-recovery-ewqLefp1.mjs} +6 -5
- package/dist/{prepare-CBetXvsN.mjs → prepare-CtDJjoOj.mjs} +2 -2
- package/dist/{prepare-BfJvFUtJ.mjs → prepare-blNRQvQl.mjs} +2 -2
- package/dist/prerender-render.d.mts +11 -0
- package/dist/prerender-render.mjs +111 -0
- package/dist/{project-cmd-Mo0V9yKS.mjs → project-cmd-DmZK9Hxf.mjs} +32 -14
- package/dist/project-team-D8jOJMUJ.mjs +130 -0
- package/dist/project-token-DA34bf-C.mjs +75 -0
- package/dist/{provision-Blnstcm2.mjs → provision-CSJOjjQk.mjs} +2 -0
- package/dist/{requests-BcKOVpRg.mjs → requests-CUExwGQQ.mjs} +3 -3
- package/dist/{rollback-Bx85-0xh.mjs → rollback-CDNGU1gr.mjs} +4 -4
- package/dist/runtime/ai.mjs +3 -2
- package/dist/runtime/email/testing.d.mts +1 -1
- package/dist/runtime/email/testing.mjs +3 -3
- package/dist/runtime/email-protocol.d.mts +15 -0
- package/dist/runtime/email-protocol.mjs +70 -0
- package/dist/runtime/email.d.mts +2 -2
- package/dist/runtime/email.mjs +189 -96
- package/dist/runtime/remote/index.mjs +5 -3
- package/dist/{secret-ByhJ9AMl.mjs → secret-Bzzi2e9E.mjs} +5 -5
- package/dist/{skills-Q46GZMO-.mjs → skills-C0RvGjeE.mjs} +1 -1
- package/dist/{subcommand-prompt-WfySCQ7S.mjs → subcommand-prompt-Bmyn5Rlc.mjs} +1 -1
- package/package.json +12 -7
- package/skills/void/SKILL.md +35 -4
- package/skills/void/docs/guide/deployment.md +2 -0
- package/skills/void/docs/guide/email.md +102 -110
- package/skills/void/docs/guide/platform-administration.md +214 -2
- package/skills/void/docs/guide/platform-development.md +64 -2
- package/skills/void/docs/guide/project-collaboration.md +94 -0
- package/skills/void/docs/guide/self-hosted-platform.md +184 -30
- package/skills/void/docs/reference/cli.md +249 -21
- package/dist/cf-access-AJ1ehiFR.mjs +0 -42
- package/dist/cf-access-DsSsZUPr.mjs +0 -67
- package/dist/email-uKyQYUVY.mjs +0 -1016
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as log } from "./output-
|
|
1
|
+
import { D as log } from "./output-B0cfNSx5.mjs";
|
|
2
2
|
import { o as resolveWranglerArgv } from "./preset-lAy0B0BQ.mjs";
|
|
3
3
|
import { execFile, spawn, spawnSync } from "node:child_process";
|
|
4
4
|
//#region src/cli/cloudflare-auth.ts
|
|
@@ -202,7 +202,7 @@ function cloudflareAuthEnvironment(source = process.env) {
|
|
|
202
202
|
"WRANGLER_OUTPUT_FILE_PATH",
|
|
203
203
|
"WRANGLER_LOG_SANITIZE"
|
|
204
204
|
]);
|
|
205
|
-
for (const key of Object.keys(env)) if (/^VOID_PLATFORM_/i.test(key) || /^(?:DATABASE_URL|CF_ACCESS_CLIENT_ID|CF_ACCESS_CLIENT_SECRET|CF_ACCESS_TOKEN)$/i.test(key) || scrubbedWranglerKeys.has(key.toUpperCase())) delete env[key];
|
|
205
|
+
for (const key of Object.keys(env)) if (/^VOID_PLATFORM_/i.test(key) || /^(?:DATABASE_URL|CF_ACCESS_CLIENT_ID|CF_ACCESS_CLIENT_SECRET|CF_ACCESS_TOKEN|VOID_ACCESS_CREDENTIALS|VOID_ACCESS_ORIGIN)$/i.test(key) || scrubbedWranglerKeys.has(key.toUpperCase())) delete env[key];
|
|
206
206
|
env.CLOUDFLARE_AUTH_USE_KEYRING = "true";
|
|
207
207
|
env.WRANGLER_LOG_SANITIZE = "true";
|
|
208
208
|
return env;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as basename } from "./dist-BrsS7cai.mjs";
|
|
2
|
-
import { D as log } from "./output-
|
|
2
|
+
import { D as log } from "./output-B0cfNSx5.mjs";
|
|
3
3
|
import { v as readRootWranglerConfig } from "./wrangler--imS8n0d.mjs";
|
|
4
|
-
import { a as createBundledCloudflareAuthRunner, c as parseCloudflareAuthSession, o as enableCloudflareKeyring, r as cloudflareCredentialOverrides, s as ensureCloudflareAuthentication } from "./cloudflare-auth-
|
|
4
|
+
import { a as createBundledCloudflareAuthRunner, c as parseCloudflareAuthSession, o as enableCloudflareKeyring, r as cloudflareCredentialOverrides, s as ensureCloudflareAuthentication } from "./cloudflare-auth-6M5llVPC.mjs";
|
|
5
5
|
//#region src/cli/cloudflare-cmd.ts
|
|
6
6
|
async function runCloudflareCommand(root, args) {
|
|
7
7
|
const runWrangler = createBundledCloudflareAuthRunner(root);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as join, t as basename } from "./dist-BrsS7cai.mjs";
|
|
2
|
-
import { D as log,
|
|
2
|
+
import { D as log, I as isCancel, M as select } from "./output-B0cfNSx5.mjs";
|
|
3
3
|
import { i as LATEST_KNOWN_COMPAT_DATE, k as writeProvisionedWranglerConfig, v as readRootWranglerConfig } from "./wrangler--imS8n0d.mjs";
|
|
4
|
-
import { a as createBundledCloudflareAuthRunner, s as ensureCloudflareAuthentication } from "./cloudflare-auth-
|
|
4
|
+
import { a as createBundledCloudflareAuthRunner, s as ensureCloudflareAuthentication } from "./cloudflare-auth-6M5llVPC.mjs";
|
|
5
5
|
import { existsSync } from "node:fs";
|
|
6
6
|
//#region src/cli/cloudflare-connect.ts
|
|
7
7
|
async function connectCloudflare(root, interactive = Boolean(process.stdin.isTTY)) {
|
|
@@ -3,7 +3,7 @@ import { o as join } from "./dist-BrsS7cai.mjs";
|
|
|
3
3
|
import { A as writeWranglerPublishedTrafficSnapshot, O as updateWranglerCustomDomain, S as readWranglerPublishedTrafficSnapshot, b as readWranglerCustomDomains } from "./wrangler--imS8n0d.mjs";
|
|
4
4
|
import { r as scanWranglerDotenvKeys } from "./dotenv-VQxupEUv.mjs";
|
|
5
5
|
import { o as resolveWranglerArgv } from "./preset-lAy0B0BQ.mjs";
|
|
6
|
-
import { i as provisionEnv, o as resolvePinnedApiBaseUrl, r as deleteEnvVarCaseAware, t as assertNoTransportRedirectInProjectDotenv } from "./provision-
|
|
6
|
+
import { i as provisionEnv, o as resolvePinnedApiBaseUrl, r as deleteEnvVarCaseAware, t as assertNoTransportRedirectInProjectDotenv } from "./provision-CSJOjjQk.mjs";
|
|
7
7
|
import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
8
8
|
import { tmpdir } from "node:os";
|
|
9
9
|
import { spawnSync } from "node:child_process";
|
|
@@ -2,7 +2,7 @@ import { n as __exportAll } from "./rolldown-runtime-rQ84J-ij.mjs";
|
|
|
2
2
|
import { o as join } from "./dist-BrsS7cai.mjs";
|
|
3
3
|
import { a as validateSourceDir } from "./project-paths-SK8nMHPp.mjs";
|
|
4
4
|
import { i as isVoidAuthProvider, t as VOID_AUTH_PROVIDERS } from "./providers-CJlNS3kT.mjs";
|
|
5
|
-
import { a as parseAddress, n as MimeError } from "./mime-
|
|
5
|
+
import { a as parseAddress, n as MimeError } from "./mime-D5Nmdzf7.mjs";
|
|
6
6
|
import { readFileSync } from "node:fs";
|
|
7
7
|
//#region src/config.ts
|
|
8
8
|
var config_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { D as log,
|
|
2
|
-
import {
|
|
3
|
-
import { a as isExpiredTokenError, n as PlatformClient } from "./client-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { D as log, I as isCancel, M as select, X as normalizePlatformApiUrl, Y as listPlatformConnections } from "./output-B0cfNSx5.mjs";
|
|
2
|
+
import { T as writePlatformSelection, p as readPlatformToken, w as writeDeploymentPlatform, x as readDeploymentPlatform } from "./auth-DPl6kck4.mjs";
|
|
3
|
+
import { a as isExpiredTokenError, n as PlatformClient } from "./client-dHfSJvAN.mjs";
|
|
4
|
+
import { n as promptForLoginToken } from "./login-Uvferzmm.mjs";
|
|
5
|
+
import { discoverPlatform, promptPlatformUrl, saveDiscoveredPlatform } from "./platform-cmd-BFhieCdV.mjs";
|
|
6
|
+
import { t as connectCloudflare } from "./cloudflare-connect-t1UU5svD.mjs";
|
|
7
7
|
//#region src/cli/connect.ts
|
|
8
8
|
async function selectVoidPlatform(interactive) {
|
|
9
9
|
if (!interactive) throw new Error("connect: Supply a Void platform URL in non-interactive mode.");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as __exportAll } from "./rolldown-runtime-rQ84J-ij.mjs";
|
|
2
|
-
import { C as cancel, D as log,
|
|
3
|
-
import {
|
|
4
|
-
import { t as PlatformApiError } from "./client-
|
|
2
|
+
import { C as cancel, D as log, I as isCancel, M as select, P as text, c as import_picocolors, w as confirm } from "./output-B0cfNSx5.mjs";
|
|
3
|
+
import { E as writeProjectConfig, c as getSiteDomain, y as attachSelectedPlatform } from "./auth-DPl6kck4.mjs";
|
|
4
|
+
import { t as PlatformApiError } from "./client-dHfSJvAN.mjs";
|
|
5
5
|
import { n as inferDefaultSlug } from "./resolve-project--Vxawf7z.mjs";
|
|
6
6
|
//#region src/cli/project-slug.ts
|
|
7
7
|
var project_slug_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -39,7 +39,8 @@ async function promptProjectSelection(projects, message = "Select a project:", r
|
|
|
39
39
|
label: "Create new project"
|
|
40
40
|
}], ...projects.map((p) => ({
|
|
41
41
|
value: p.id,
|
|
42
|
-
label: `${p.slug} (${p.url ?? `${p.slug}.${getSiteDomain(root)}`})
|
|
42
|
+
label: `${p.slug} (${p.url ?? `${p.slug}.${getSiteDomain(root)}`})`,
|
|
43
|
+
...p.role ? { hint: p.role === "reader" ? "reader (read-only)" : p.role } : {}
|
|
43
44
|
}))];
|
|
44
45
|
const result = await select({
|
|
45
46
|
message,
|
|
@@ -52,7 +53,7 @@ async function promptProjectSelection(projects, message = "Select a project:", r
|
|
|
52
53
|
if (result === "__create__") return { action: "create" };
|
|
53
54
|
const project = projects.find((p) => p.id === result);
|
|
54
55
|
if (options.confirmExisting) {
|
|
55
|
-
const confirmed = await confirm({ message: `Linking to an existing project. Running \`void deploy\` will overwrite the current deployment of ${project.url ?? `${project.slug}.${getSiteDomain(root)}`}. Continue?` });
|
|
56
|
+
const confirmed = await confirm({ message: project.role === "reader" ? `Link to ${project.slug} with read-only access? Deploying requires collaborator access or higher.` : `Linking to an existing project. Running \`void deploy\` will overwrite the current deployment of ${project.url ?? `${project.slug}.${getSiteDomain(root)}`}. Continue?` });
|
|
56
57
|
if (isCancel(confirmed) || !confirmed) {
|
|
57
58
|
cancel("Project link cancelled.");
|
|
58
59
|
process.exit(0);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { c as relative, i as extname, l as resolve, o as join, t as basename } from "./dist-BrsS7cai.mjs";
|
|
2
|
-
import { D as log, E as intro,
|
|
2
|
+
import { A as outro, D as log, E as intro, H as ensurePlatformProxyAccess, I as isCancel, U as isCloudflareAccessChallenge, V as ensurePlatformAccessToken, a as dim, c as import_picocolors, r as cliTitle, w as confirm } from "./output-B0cfNSx5.mjs";
|
|
3
3
|
import { n as readProjectPaths } from "./project-paths-SK8nMHPp.mjs";
|
|
4
|
-
import { t as cfAccessHeaders } from "./cf-access-
|
|
5
|
-
import {
|
|
6
|
-
import { c as getDatabaseDialect, f as readConfig, p as resolveBindingNames } from "./config-
|
|
4
|
+
import { t as cfAccessHeaders } from "./cf-access-DRsQRe6k.mjs";
|
|
5
|
+
import { S as readProjectConfig, l as getToken, s as getProxyUrl, x as readDeploymentPlatform } from "./auth-DPl6kck4.mjs";
|
|
6
|
+
import { c as getDatabaseDialect, f as readConfig, p as resolveBindingNames } from "./config-uNGuFsI2.mjs";
|
|
7
7
|
import { r as detectFramework } from "./plugin-inference-BDRfZngg.mjs";
|
|
8
8
|
import { c as collectMigrations, d as stripSqlExt, f as writeJournal, n as listDrizzleArtifacts, r as validateMigrations, t as assertJournalCoherence, u as readJournal } from "./validate-tBBN_dXH.mjs";
|
|
9
9
|
import { t as resolveLocalD1Target } from "./local-d1-D2I6Ox5F.mjs";
|
|
10
|
-
import { a as loadLocalEnv } from "./env-
|
|
11
|
-
import { n as PlatformClient, t as PlatformApiError } from "./client-
|
|
12
|
-
import { formatTimestamp } from "./gen-
|
|
10
|
+
import { a as loadLocalEnv } from "./env-DBKmK4vc.mjs";
|
|
11
|
+
import { n as PlatformClient, t as PlatformApiError } from "./client-dHfSJvAN.mjs";
|
|
12
|
+
import { formatTimestamp } from "./gen-B_wPnVTK.mjs";
|
|
13
13
|
import { createRequire } from "node:module";
|
|
14
14
|
import { existsSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
15
15
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -233,7 +233,7 @@ async function runConnect(root, dialect, args) {
|
|
|
233
233
|
if (result.dashboardUrl) log.info(`Dashboard: ${result.dashboardUrl}`);
|
|
234
234
|
}
|
|
235
235
|
if (!connectionString) {
|
|
236
|
-
const { text: promptText, isCancel: isCancelCheck } = await import("./output-
|
|
236
|
+
const { text: promptText, isCancel: isCancelCheck } = await import("./output-B0cfNSx5.mjs").then((n) => n.T);
|
|
237
237
|
const answer = await promptText({
|
|
238
238
|
message: `Enter your ${dialect === "mysql" ? "MySQL" : "PostgreSQL"} connection string:`,
|
|
239
239
|
placeholder: dialect === "mysql" ? "mysql://user:pass@host:3306/database" : "postgresql://user:pass@host:5432/database"
|
|
@@ -278,7 +278,7 @@ async function runPush(root, dialect) {
|
|
|
278
278
|
outro("Done.");
|
|
279
279
|
}
|
|
280
280
|
async function runGenerate(root, dialect) {
|
|
281
|
-
const { prepareProject } = await import("./prepare-
|
|
281
|
+
const { prepareProject } = await import("./prepare-CtDJjoOj.mjs");
|
|
282
282
|
const { writeDrizzleConfig } = await import("./config-NOG_U1aK.mjs").then((n) => n.t);
|
|
283
283
|
await prepareProject(root);
|
|
284
284
|
const authSchemaPath = join(root, ".void", "better-auth-schema.ts");
|
|
@@ -359,7 +359,7 @@ async function runStatus(root, dialect) {
|
|
|
359
359
|
applied_at: ""
|
|
360
360
|
}));
|
|
361
361
|
} else {
|
|
362
|
-
const { readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
362
|
+
const { readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-BzWnlC1_.mjs").then((n) => n.t);
|
|
363
363
|
remoteApplied = (await readCloudflareD1Migrations(resolveCloudflareD1Context(root, resolveBindingNames(readConfig(root).inference?.bindings)?.d1 ?? "DB"))).map((name) => ({
|
|
364
364
|
name,
|
|
365
365
|
applied_at: ""
|
|
@@ -601,7 +601,7 @@ async function runExecute(root, command, file, dialect, remote) {
|
|
|
601
601
|
process.exit(0);
|
|
602
602
|
}
|
|
603
603
|
if (dialect === "sqlite") {
|
|
604
|
-
const { executeCloudflareD1Sql, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
604
|
+
const { executeCloudflareD1Sql, resolveCloudflareD1Context } = await import("./cloudflare-operations-BzWnlC1_.mjs").then((n) => n.t);
|
|
605
605
|
const rows = await executeCloudflareD1Sql(resolveCloudflareD1Context(root, resolveBindingNames(readConfig(root).inference?.bindings)?.d1 ?? "DB"), sql);
|
|
606
606
|
if (rows.length > 0) printTable(rows);
|
|
607
607
|
else log.success("Executed successfully.");
|
|
@@ -643,21 +643,38 @@ async function runExecute(root, command, file, dialect, remote) {
|
|
|
643
643
|
if (d1Resource) binding = d1Resource.binding_name;
|
|
644
644
|
} catch {}
|
|
645
645
|
const proxyUrl = getProxyUrl(root);
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
646
|
+
ensurePlatformProxyAccess(platformClient.apiUrl, proxyUrl);
|
|
647
|
+
const capturedAccessHeaders = cfAccessHeaders(process.env, proxyUrl);
|
|
648
|
+
const requestProxy = () => {
|
|
649
|
+
const currentAccessHeaders = cfAccessHeaders(process.env, proxyUrl);
|
|
650
|
+
const accessHeaders = Object.keys(currentAccessHeaders).length > 0 ? currentAccessHeaders : capturedAccessHeaders;
|
|
651
|
+
return {
|
|
652
|
+
accessHeaders,
|
|
653
|
+
response: fetch(`${proxyUrl}/d1/query`, {
|
|
654
|
+
method: "POST",
|
|
655
|
+
headers: {
|
|
656
|
+
Authorization: `Bearer ${token}`,
|
|
657
|
+
"Content-Type": "application/json",
|
|
658
|
+
...accessHeaders
|
|
659
|
+
},
|
|
660
|
+
body: JSON.stringify({
|
|
661
|
+
projectId: projectConfig.projectId,
|
|
662
|
+
binding,
|
|
663
|
+
sql,
|
|
664
|
+
params: [],
|
|
665
|
+
method: "all"
|
|
666
|
+
}),
|
|
667
|
+
redirect: "manual"
|
|
668
|
+
})
|
|
669
|
+
};
|
|
670
|
+
};
|
|
671
|
+
const first = requestProxy();
|
|
672
|
+
let res = await first.response;
|
|
673
|
+
if (isCloudflareAccessChallenge(res) && !first.accessHeaders["CF-Access-Client-Id"]) {
|
|
674
|
+
await res.body?.cancel();
|
|
675
|
+
ensurePlatformAccessToken(proxyUrl, true, false, first.accessHeaders["cf-access-token"]);
|
|
676
|
+
res = await requestProxy().response;
|
|
677
|
+
}
|
|
661
678
|
if (!res.ok) {
|
|
662
679
|
const text = await res.text().catch(() => res.statusText);
|
|
663
680
|
log.error(`db: Proxy request failed with ${res.status}: '${text}'.`);
|
|
@@ -789,7 +806,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
789
806
|
outro("Done.");
|
|
790
807
|
return;
|
|
791
808
|
}
|
|
792
|
-
const { applyCloudflareD1Migrations, readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
809
|
+
const { applyCloudflareD1Migrations, readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-BzWnlC1_.mjs").then((n) => n.t);
|
|
793
810
|
const binding = resolveBindingNames(readConfig(root).inference?.bindings)?.d1 ?? "DB";
|
|
794
811
|
const context = resolveCloudflareD1Context(root, binding);
|
|
795
812
|
const remoteBefore = new Set(await readCloudflareD1Migrations(context));
|
|
@@ -805,7 +822,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
805
822
|
log.error(getErrorMessage(error));
|
|
806
823
|
process.exit(1);
|
|
807
824
|
}
|
|
808
|
-
const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-
|
|
825
|
+
const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-DTaWUS1S.mjs").then((n) => n.n);
|
|
809
826
|
const applySet = await checkWranglerMigrationApplySet(context.operation.configPath, parseRootWranglerConfig(context.operation.configPath), binding, context.migrationsDir, rawMigrations);
|
|
810
827
|
if (!applySet.ok) {
|
|
811
828
|
log.error(applySet.reason);
|
|
@@ -1419,7 +1436,7 @@ async function runExport(root, args, dialect) {
|
|
|
1419
1436
|
}
|
|
1420
1437
|
}
|
|
1421
1438
|
async function runSetUrl(root) {
|
|
1422
|
-
const { readConfig: readVoidConfig, getDatabaseDialect: getDialect } = await import("./config-
|
|
1439
|
+
const { readConfig: readVoidConfig, getDatabaseDialect: getDialect } = await import("./config-uNGuFsI2.mjs").then((n) => n.n);
|
|
1423
1440
|
const dialect = getDialect(readVoidConfig(root));
|
|
1424
1441
|
if (dialect === "sqlite") {
|
|
1425
1442
|
log.error("db: This command is only for PostgreSQL and MySQL projects. Set \"database\" to \"pg\" or \"mysql\" in void.json.");
|
|
@@ -1435,7 +1452,7 @@ async function runSetUrl(root) {
|
|
|
1435
1452
|
log.error("No project linked. Run `void deploy` first or link a project.");
|
|
1436
1453
|
process.exit(1);
|
|
1437
1454
|
}
|
|
1438
|
-
const { text: promptText, isCancel: isCancelCheck } = await import("./output-
|
|
1455
|
+
const { text: promptText, isCancel: isCancelCheck } = await import("./output-B0cfNSx5.mjs").then((n) => n.T);
|
|
1439
1456
|
const connectionString = await promptText({
|
|
1440
1457
|
message: `Enter your ${dialect === "mysql" ? "MySQL" : "PostgreSQL"} connection string:`,
|
|
1441
1458
|
placeholder: dialect === "mysql" ? "mysql://user:pass@host:3306/dbname" : "postgresql://user:pass@host:5432/dbname",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as cancel, D as log, E as intro,
|
|
2
|
-
import {
|
|
3
|
-
import { n as PlatformClient } from "./client-
|
|
1
|
+
import { A as outro, C as cancel, D as log, E as intro, I as isCancel, P as text, i as createSpinner, k as note, r as cliTitle } from "./output-B0cfNSx5.mjs";
|
|
2
|
+
import { C as removeProjectConfig, S as readProjectConfig, l as getToken } from "./auth-DPl6kck4.mjs";
|
|
3
|
+
import { n as PlatformClient } from "./client-dHfSJvAN.mjs";
|
|
4
4
|
import { r as resolveProjectBySlug } from "./resolve-project--Vxawf7z.mjs";
|
|
5
5
|
//#region src/cli/delete.ts
|
|
6
6
|
async function runDeleteCommand(root, slug, options) {
|