void 0.20.1 → 0.20.3

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.
Files changed (109) hide show
  1. package/README.md +5 -1
  2. package/dist/{auth-W9WII-mN.mjs → auth-DPl6kck4.mjs} +46 -26
  3. package/dist/{auth-cmd-CAH62yDU.mjs → auth-cmd-CzwquNiP.mjs} +5 -4
  4. package/dist/auth-link-ElDTgF7j.mjs +28 -0
  5. package/dist/{build-cmd-CJvZvPQO.mjs → build-cmd-BpJe6boP.mjs} +3 -3
  6. package/dist/{cache-BlNeQjuP.mjs → cache-D98YTqeE.mjs} +3 -3
  7. package/dist/{cancel-deploy-CmlAZ9P6.mjs → cancel-deploy-CPbEQLMG.mjs} +3 -3
  8. package/dist/cf-access-DRsQRe6k.mjs +75 -0
  9. package/dist/cli/cli.mjs +309 -1958
  10. package/dist/cli/env-schema-probe.mjs +11 -2
  11. package/dist/client-BQBrZoCX.mjs +989 -0
  12. package/dist/{cloudflare-auth-B1QtTO1b.mjs → cloudflare-auth-6M5llVPC.mjs} +2 -2
  13. package/dist/{cloudflare-cmd-B6_OZx2V.mjs → cloudflare-cmd-4RPGN3KB.mjs} +2 -2
  14. package/dist/{cloudflare-connect-j5D4hhrG.mjs → cloudflare-connect-t1UU5svD.mjs} +2 -2
  15. package/dist/{cloudflare-operations-CPTpRW6d.mjs → cloudflare-operations-BzWnlC1_.mjs} +1 -1
  16. package/dist/{config-BQFq7QvD.mjs → config-uNGuFsI2.mjs} +1 -1
  17. package/dist/{connect-C04Wdy_h.mjs → connect-WCQZ_u3m.mjs} +6 -6
  18. package/dist/{create-project-ChGZ1DFd.mjs → create-project-D0oXA090.mjs} +7 -7
  19. package/dist/{db-D2d_mUsB.mjs → db-DJ-9qs3S.mjs} +47 -30
  20. package/dist/{delete-D8GigDk8.mjs → delete-BZ4-WaGm.mjs} +3 -3
  21. package/dist/{deploy-iXZ3F0N6.mjs → deploy-BAhhcg5q.mjs} +135 -117
  22. package/dist/{dev-inbox-DkgRWLkW.mjs → dev-inbox-P0u4tM8Y.mjs} +1 -1
  23. package/dist/{domain-B1VmoSr0.mjs → domain-BxAyhxXN.mjs} +4 -4
  24. package/dist/email-Bj7Cvdwp.mjs +795 -0
  25. package/dist/{env-D4Emu-M_.mjs → env-DBKmK4vc.mjs} +1 -0
  26. package/dist/{env-BcQzYgoG.mjs → env-DP_EErve.mjs} +5 -5
  27. package/dist/{env-validation-ENpMy6Ez.mjs → env-validation-CF6KvTRf.mjs} +3 -1
  28. package/dist/{gen-DI2YwdBM.mjs → gen-B_wPnVTK.mjs} +2 -2
  29. package/dist/{github-cmd-xItS5Zwf.mjs → github-cmd-C-z_xRrQ.mjs} +15 -21
  30. package/dist/{headers-D8QfRX9Y.mjs → headers-BAHwgHdW.mjs} +1 -1
  31. package/dist/help-CwOX-zmI.mjs +2216 -0
  32. package/dist/{inbound-afAcWeQ9.d.mts → inbound-CH5Mksyy.d.mts} +34 -48
  33. package/dist/{inbound-2d0zi2yS.mjs → inbound-aVHEUhKo.mjs} +130 -100
  34. package/dist/index.mjs +54 -17
  35. package/dist/{init-BD-9THgn.mjs → init-BGktCXgA.mjs} +11 -11
  36. package/dist/{link-RMdgjF1v.mjs → link-D2kbqhWb.mjs} +4 -4
  37. package/dist/{list-3F52R_yO.mjs → list-CvkK_G7k.mjs} +4 -4
  38. package/dist/{login-pV69H-ZO.mjs → login-WIjNc77c.mjs} +28 -10
  39. package/dist/{logs-DFHHD6wE.mjs → logs-dLUFCapG.mjs} +4 -4
  40. package/dist/{mime-BJD7d_qL.mjs → mime-D5Nmdzf7.mjs} +23 -9
  41. package/dist/{node-Dk3H2jmU.mjs → node-Ez5KW5rn.mjs} +2 -2
  42. package/dist/operator-auth-B3e08unv.mjs +52 -0
  43. package/dist/operator-client-LUZnlnYk.mjs +82 -0
  44. package/dist/{operator-cmd-DYWRbWUA.mjs → operator-cmd-CKJ7xIRs.mjs} +35 -55
  45. package/dist/{output-tFQLLj26.mjs → output-B0cfNSx5.mjs} +316 -2
  46. package/dist/pages/index.mjs +2 -2
  47. package/dist/platform-auth-config-CdVWRRJr.mjs +368 -0
  48. package/dist/platform-auth-protection-Drl0qhrn.mjs +219 -0
  49. package/dist/platform-auth-recovery-CmKEWpDo.mjs +310 -0
  50. package/dist/{platform-cmd-DxJ2FRwR.mjs → platform-cmd-5q_k56xS.mjs} +16 -6
  51. package/dist/{platform-domain-ChvbJkdy.mjs → platform-domain-4GiDlcqx.mjs} +4 -4
  52. package/dist/{platform-lifecycle-DN4MzJF_.mjs → platform-lifecycle-R9xAxvtG.mjs} +1716 -204
  53. package/dist/{platform-management-Db2PXw0B.mjs → platform-management-BfWsXHEW.mjs} +35 -7
  54. package/dist/{platform-recovery-C_YO-tIs.mjs → platform-recovery-CbK-I1FB.mjs} +6 -5
  55. package/dist/{prepare-CBetXvsN.mjs → prepare-CtDJjoOj.mjs} +2 -2
  56. package/dist/{prepare-BfJvFUtJ.mjs → prepare-blNRQvQl.mjs} +2 -2
  57. package/dist/prerender-render.d.mts +11 -0
  58. package/dist/prerender-render.mjs +111 -0
  59. package/dist/{project-cmd-Mo0V9yKS.mjs → project-cmd-CTdmnzvc.mjs} +32 -14
  60. package/dist/project-team-CGxsQe3_.mjs +132 -0
  61. package/dist/project-token-Cirx7uwZ.mjs +75 -0
  62. package/dist/{provision-Blnstcm2.mjs → provision-CSJOjjQk.mjs} +2 -0
  63. package/dist/{requests-BcKOVpRg.mjs → requests-4Nq59hOr.mjs} +3 -3
  64. package/dist/{rollback-Bx85-0xh.mjs → rollback-Dr7u0Ljx.mjs} +4 -4
  65. package/dist/runtime/ai.mjs +3 -2
  66. package/dist/runtime/email/testing.d.mts +1 -1
  67. package/dist/runtime/email/testing.mjs +3 -3
  68. package/dist/runtime/email-protocol.d.mts +15 -0
  69. package/dist/runtime/email-protocol.mjs +70 -0
  70. package/dist/runtime/email.d.mts +2 -2
  71. package/dist/runtime/email.mjs +189 -96
  72. package/dist/runtime/remote/index.mjs +54 -11
  73. package/dist/runtime/sandbox.d.mts +4 -56
  74. package/dist/runtime/sandbox.mjs +81 -220
  75. package/dist/{secret-ByhJ9AMl.mjs → secret-AcPi-FoA.mjs} +5 -5
  76. package/dist/{skills-Q46GZMO-.mjs → skills-C0RvGjeE.mjs} +1 -1
  77. package/dist/{subcommand-prompt-WfySCQ7S.mjs → subcommand-prompt-Bmyn5Rlc.mjs} +1 -1
  78. package/package.json +12 -7
  79. package/skills/void/SKILL.md +35 -4
  80. package/skills/void/docs/guide/deployment.md +16 -14
  81. package/skills/void/docs/guide/email.md +114 -120
  82. package/skills/void/docs/guide/platform/administration/access.md +163 -0
  83. package/skills/void/docs/guide/platform/administration/email.md +121 -0
  84. package/skills/void/docs/guide/platform/administration/operations.md +97 -0
  85. package/skills/void/docs/guide/platform/administration/projects.md +54 -0
  86. package/skills/void/docs/guide/platform/development/local.md +119 -0
  87. package/skills/void/docs/guide/platform/development/runtime.md +124 -0
  88. package/skills/void/docs/guide/platform/development/schema-ci.md +95 -0
  89. package/skills/void/docs/guide/platform/installation/ci.md +55 -0
  90. package/skills/void/docs/guide/platform/installation/credentials.md +80 -0
  91. package/skills/void/docs/guide/platform/installation/domains.md +68 -0
  92. package/skills/void/docs/guide/platform/installation/first-deployment.md +82 -0
  93. package/skills/void/docs/guide/platform/installation/maintenance.md +137 -0
  94. package/skills/void/docs/guide/platform/installation/prerequisites.md +86 -0
  95. package/skills/void/docs/guide/platform/installation/setup.md +169 -0
  96. package/skills/void/docs/guide/platform/installation/uninstall.md +54 -0
  97. package/skills/void/docs/guide/platform-administration.md +6 -202
  98. package/skills/void/docs/guide/platform-development.md +5 -254
  99. package/skills/void/docs/guide/project-collaboration.md +94 -0
  100. package/skills/void/docs/guide/sandboxes.md +9 -24
  101. package/skills/void/docs/guide/self-hosted-platform.md +13 -542
  102. package/skills/void/docs/reference/api.md +34 -34
  103. package/skills/void/docs/reference/cli.md +276 -31
  104. package/skills/void/docs/reference/config.md +1 -1
  105. package/skills/void/docs/reference/resource-inference.md +10 -10
  106. package/dist/cf-access-AJ1ehiFR.mjs +0 -42
  107. package/dist/cf-access-DsSsZUPr.mjs +0 -67
  108. package/dist/client-Clirrol3.mjs +0 -705
  109. package/dist/email-uKyQYUVY.mjs +0 -1016
@@ -1,4 +1,4 @@
1
- import { D as log } from "./output-tFQLLj26.mjs";
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-tFQLLj26.mjs";
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-B1QtTO1b.mjs";
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, F as isCancel, j as select } from "./output-tFQLLj26.mjs";
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-B1QtTO1b.mjs";
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-Blnstcm2.mjs";
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-BJD7d_qL.mjs";
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, F as isCancel, G as normalizePlatformApiUrl, W as listPlatformConnections, j as select } from "./output-tFQLLj26.mjs";
2
- import { C as writeDeploymentPlatform, b as readDeploymentPlatform, f as readPlatformToken, w as writePlatformSelection } from "./auth-W9WII-mN.mjs";
3
- import { a as isExpiredTokenError, n as PlatformClient } from "./client-Clirrol3.mjs";
4
- import { t as promptForLoginToken } from "./login-pV69H-ZO.mjs";
5
- import { t as connectCloudflare } from "./cloudflare-connect-j5D4hhrG.mjs";
6
- import { discoverPlatform, promptPlatformUrl, saveDiscoveredPlatform } from "./platform-cmd-DxJ2FRwR.mjs";
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-BQBrZoCX.mjs";
4
+ import { n as promptForLoginToken } from "./login-WIjNc77c.mjs";
5
+ import { discoverPlatform, promptPlatformUrl, saveDiscoveredPlatform } from "./platform-cmd-5q_k56xS.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, F as isCancel, N as text, c as import_picocolors, j as select, w as confirm } from "./output-tFQLLj26.mjs";
3
- import { T as writeProjectConfig, s as getSiteDomain, v as attachSelectedPlatform } from "./auth-W9WII-mN.mjs";
4
- import { t as PlatformApiError } from "./client-Clirrol3.mjs";
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-BQBrZoCX.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);
@@ -104,8 +105,7 @@ async function createProjectWithSlugRetry(client, initialDefaultSlug, promptSlug
104
105
  return project;
105
106
  } catch (error) {
106
107
  if (error instanceof PlatformApiError && isRetryableCreateError(error)) {
107
- const reason = error.code || error.body || `HTTP ${error.status}`;
108
- log.error(`project: Could not create project '${slug}': ${reason}.`);
108
+ log.error(`project: ${error.message}`);
109
109
  defaultSlug = slug;
110
110
  continue;
111
111
  }
@@ -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, F as isCancel, a as dim, c as import_picocolors, k as outro, r as cliTitle, w as confirm } from "./output-tFQLLj26.mjs";
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-AJ1ehiFR.mjs";
5
- import { b as readDeploymentPlatform, c as getToken, o as getProxyUrl, x as readProjectConfig } from "./auth-W9WII-mN.mjs";
6
- import { c as getDatabaseDialect, f as readConfig, p as resolveBindingNames } from "./config-BQFq7QvD.mjs";
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-D4Emu-M_.mjs";
11
- import { n as PlatformClient, t as PlatformApiError } from "./client-Clirrol3.mjs";
12
- import { formatTimestamp } from "./gen-DI2YwdBM.mjs";
10
+ import { a as loadLocalEnv } from "./env-DBKmK4vc.mjs";
11
+ import { n as PlatformClient, t as PlatformApiError } from "./client-BQBrZoCX.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-tFQLLj26.mjs").then((n) => n.T);
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-CBetXvsN.mjs");
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-CPTpRW6d.mjs").then((n) => n.t);
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-CPTpRW6d.mjs").then((n) => n.t);
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
- const res = await fetch(`${proxyUrl}/d1/query`, {
647
- method: "POST",
648
- headers: {
649
- Authorization: `Bearer ${token}`,
650
- "Content-Type": "application/json",
651
- ...cfAccessHeaders(process.env, proxyUrl)
652
- },
653
- body: JSON.stringify({
654
- projectId: projectConfig.projectId,
655
- binding,
656
- sql,
657
- params: [],
658
- method: "all"
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-CPTpRW6d.mjs").then((n) => n.t);
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-iXZ3F0N6.mjs").then((n) => n.n);
825
+ const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-BAhhcg5q.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-BQFq7QvD.mjs").then((n) => n.n);
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-tFQLLj26.mjs").then((n) => n.T);
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, F as isCancel, N as text, O as note, i as createSpinner, k as outro, r as cliTitle } from "./output-tFQLLj26.mjs";
2
- import { S as removeProjectConfig, c as getToken, x as readProjectConfig } from "./auth-W9WII-mN.mjs";
3
- import { n as PlatformClient } from "./client-Clirrol3.mjs";
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-BQBrZoCX.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) {