void 1.12.0 → 1.12.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.
Files changed (123) hide show
  1. package/dist/{account-cmd-D_0qJ9fx.mjs → account-cmd-CdJQba_Q.mjs} +4 -4
  2. package/dist/{application-analysis-Cx2S63z5.mjs → application-analysis-DVeN8yoi.mjs} +1 -1
  3. package/dist/{application-routing-BAXpnawu.mjs → application-routing-KKw4Y84h.mjs} +1 -1
  4. package/dist/{auth-Boz0lrb3.mjs → auth-A7cZ8aXA.mjs} +1 -1
  5. package/dist/{auth-DlLDymuc.mjs → auth-CqwJwItO.mjs} +1 -1
  6. package/dist/{auth-link-C97r9p2N.mjs → auth-link-D9MWA_dj.mjs} +4 -4
  7. package/dist/{auth-router-BmzEgzYx.mjs → auth-router-FskgTU3B.mjs} +1 -1
  8. package/dist/{build-cmd-BaFsyZrz.mjs → build-cmd-B7OJ0U5R.mjs} +2 -2
  9. package/dist/build-id-4IV4hC1-.mjs +13 -0
  10. package/dist/{cache-xO711ATQ.mjs → cache-wSpi3aeM.mjs} +2 -2
  11. package/dist/{cancel-deploy-Di11ynsr.mjs → cancel-deploy-DMWzkAlb.mjs} +2 -2
  12. package/dist/{cf-access-FaIm95jA.mjs → cf-access-DHklo7Rg.mjs} +33 -19
  13. package/dist/{cf-build-output-Ca201_n1.mjs → cf-build-output-Cso7Vh-t.mjs} +4 -2
  14. package/dist/cf-build-output-Wpk_e5CI.mjs +1 -0
  15. package/dist/cli/cli.mjs +1 -1
  16. package/dist/cli/cloudflare-operation-process.mjs +1 -1
  17. package/dist/cli/db-execute-process.d.mts +2 -0
  18. package/dist/cli/db-execute-process.mjs +57 -0
  19. package/dist/{cli-main-DlW6lB8s.mjs → cli-main-DaLrQfPS.mjs} +37 -344
  20. package/dist/{client-ImIe7Mjq.mjs → client-DE2m2ldh.mjs} +4 -4
  21. package/dist/{client-DkYzDEC0.mjs → client-eLZwqkPH.mjs} +1 -1
  22. package/dist/{cloudflare-operations-BF0PSErW.mjs → cloudflare-operations-BIRQkYwL.mjs} +14 -8
  23. package/dist/cloudflare-operations-ByjFGats.mjs +1 -0
  24. package/dist/{connect-DDRQGfFE.mjs → connect-WG4TcR_d.mjs} +4 -4
  25. package/dist/{create-project-CY7sP8sI.mjs → create-project-8FdN6D2i.mjs} +2 -2
  26. package/dist/{create-project-Dro3K-az.mjs → create-project-CbuDH5Hv.mjs} +1 -1
  27. package/dist/{db-DmlaWVBu.mjs → db-BSuWV1PI.mjs} +1348 -69
  28. package/dist/db-args-BvMwAber.mjs +1 -0
  29. package/dist/db-args-CiQVg8SJ.mjs +321 -0
  30. package/dist/{delete-Uuq9ch6o.mjs → delete-WtLEfap2.mjs} +2 -2
  31. package/dist/{deploy-B9E7_rHC.mjs → deploy-DtJeunLF.mjs} +14 -14
  32. package/dist/{deploy-BB3rsZbP.mjs → deploy-GT4CW5fs.mjs} +1 -1
  33. package/dist/{deploy-managed-static-IKZyuc1W.mjs → deploy-managed-static-BWBsxOww.mjs} +5 -5
  34. package/dist/{deploy-security-notice-C3LalelR.mjs → deploy-security-notice-IRGy6Edf.mjs} +2 -2
  35. package/dist/deploy.mjs +4 -4
  36. package/dist/{domain-B_xY1yZ5.mjs → domain-mweyYXSw.mjs} +3 -3
  37. package/dist/{email-BIC15L7a.mjs → email-DoDqRH6i.mjs} +5 -5
  38. package/dist/{email-cloudflare-C447nOqq.mjs → email-cloudflare-DeYH3Ke7.mjs} +2 -2
  39. package/dist/{env-DJPZYHT5.mjs → env-DaAoYR2-.mjs} +3 -3
  40. package/dist/{gen-DiTZlDx8.mjs → gen-aOtHhZLD.mjs} +1 -1
  41. package/dist/gen-vhBDHs3q.mjs +1 -0
  42. package/dist/{github-cmd-DPmby8x-.mjs → github-cmd-BR19Ffdz.mjs} +2 -2
  43. package/dist/{help-9wfMyXHb.mjs → help-DvClCzqL.mjs} +9 -1
  44. package/dist/help-fKPzcTJv.mjs +1 -0
  45. package/dist/index.mjs +16 -206
  46. package/dist/{info-BWEWaOBo.mjs → info-P6MBiVJi.mjs} +2 -2
  47. package/dist/{init-BuTPVLPO.mjs → init-B2VZ2Hut.mjs} +63 -18
  48. package/dist/installed-packages-tfmYd-cC.mjs +198 -0
  49. package/dist/{link-BiesPyT4.mjs → link-Dyz9IGcM.mjs} +3 -3
  50. package/dist/{list-CkonftPQ.mjs → list-VGYBMjmx.mjs} +4 -4
  51. package/dist/login-BbSQTZ6d.mjs +1 -0
  52. package/dist/{login-BSOSah1j.mjs → login-jUBgfvzk.mjs} +3 -3
  53. package/dist/{logs-HOBUnroa.mjs → logs-kS1wuR4b.mjs} +3 -3
  54. package/dist/module-references-DWQmO6TW.mjs +27 -0
  55. package/dist/{mysql-sql-CB52k8tQ.mjs → mysql-lock-D8xtnI-D.mjs} +1 -118
  56. package/dist/mysql-sql-BIE7bc4Z.mjs +124 -0
  57. package/dist/{operator-ai-logging-ZDqqhnIq.mjs → operator-ai-logging-DD0n6zc2.mjs} +3 -3
  58. package/dist/{operator-args-DCkWbgT-.mjs → operator-args-nvetCWuz.mjs} +1 -1
  59. package/dist/{operator-auth-BjoPLgja.mjs → operator-auth-DMvn-y9X.mjs} +1 -1
  60. package/dist/{operator-client-DzebIntv.mjs → operator-client-dFNnXfyB.mjs} +4 -3
  61. package/dist/operator-cmd-jnjzuJKX.mjs +1 -0
  62. package/dist/{operator-cmd-AZoeI9Pl.mjs → operator-cmd-wML5HNfS.mjs} +13 -9
  63. package/dist/{operator-security-Bo26FP01.mjs → operator-security-D5MToU0p.mjs} +1 -1
  64. package/dist/pages/client.mjs +77 -9
  65. package/dist/pages/index.d.mts +6 -0
  66. package/dist/pages/index.mjs +276 -6
  67. package/dist/pages/protocol.mjs +1 -1
  68. package/dist/platform-args-CMwMoiLp.mjs +1 -0
  69. package/dist/{platform-args-lwCyQ6Xy.mjs → platform-args-CvZSuhYS.mjs} +1 -1
  70. package/dist/{platform-auth-config-DLRMPw1G.mjs → platform-auth-config-Bv3oQ2gE.mjs} +7 -7
  71. package/dist/{platform-auth-protection-HSmLmD3d.mjs → platform-auth-protection-OqzfhXwx.mjs} +5 -5
  72. package/dist/{platform-auth-recovery-BXPhTlKa.mjs → platform-auth-recovery-rmIYjXST.mjs} +4 -4
  73. package/dist/{platform-cmd-CqRjxFEU.mjs → platform-cmd-B3rO4RhU.mjs} +1 -1
  74. package/dist/{platform-cmd-DJ-fOYhL.mjs → platform-cmd-D_4z2Ijv.mjs} +6 -6
  75. package/dist/{platform-domain-CRsRJOws.mjs → platform-domain-CUq9odbd.mjs} +2 -2
  76. package/dist/{platform-lifecycle-bx_kpqo7.mjs → platform-lifecycle-DOSYo0UI.mjs} +1 -1
  77. package/dist/{platform-lifecycle-fau3VKv6.mjs → platform-lifecycle-DuoVruij.mjs} +138 -43
  78. package/dist/{platform-management-BRGhD-oF.mjs → platform-management-D_gt3qLb.mjs} +1 -1
  79. package/dist/{platform-management-CnKBdDx5.mjs → platform-management-MmO9IubR.mjs} +4 -4
  80. package/dist/{platform-plans-config-2C3_5EDs.mjs → platform-plans-config-DiydtNKY.mjs} +3 -3
  81. package/dist/{platform-recovery-poxgOOAY.mjs → platform-recovery-P_FVslfd.mjs} +2 -2
  82. package/dist/{platform-setup-DYylapHD.mjs → platform-setup-Lph9i-rh.mjs} +1 -1
  83. package/dist/{plugin-inference-7O11_E4H.mjs → plugin-inference-COlq96WJ.mjs} +2 -27
  84. package/dist/prepare-DcwigRUS.mjs +1 -0
  85. package/dist/{prepare-DWjn1Lzd.mjs → prepare-WvijE289.mjs} +1 -1
  86. package/dist/{prepare-BbvlKreR.mjs → prepare-co1o1FFd.mjs} +1 -1
  87. package/dist/{project-cmd-DyUEFi2b.mjs → project-cmd-BWJTplpc.mjs} +18 -18
  88. package/dist/{project-security-DZEQgnsS.mjs → project-security-BV1xfj1K.mjs} +1 -1
  89. package/dist/{project-security--tYGFPGo.mjs → project-security-CY_aahvW.mjs} +2 -2
  90. package/dist/{project-team-BszTHgzC.mjs → project-team-BlIFXlmT.mjs} +2 -2
  91. package/dist/{project-token-DBDy4NdV.mjs → project-token-CMsB7I1-.mjs} +2 -2
  92. package/dist/{project-zero-trust-D9sUouij.mjs → project-zero-trust-BI6pdpx4.mjs} +2 -2
  93. package/dist/{protocol-CE3wP-H1.mjs → protocol-4rEnumif.mjs} +10 -3
  94. package/dist/{redirect-DD825Stf.mjs → redirect-Dyvuil0Q.mjs} +5 -2
  95. package/dist/{requests-CBokjiOi.mjs → requests-CfmJxNYg.mjs} +2 -2
  96. package/dist/{rollback-CEeHNFUn.mjs → rollback-DL5HuAsM.mjs} +3 -3
  97. package/dist/{runner-mysql-3XDKrn-g.mjs → runner-mysql-D549vGGm.mjs} +2 -1
  98. package/dist/{runner-mysql-r688x6Y9.mjs → runner-mysql-DOjbj-N1.mjs} +1 -1
  99. package/dist/runtime/db/migrations/mysql-handler.mjs +2 -1
  100. package/dist/runtime/routing/index.mjs +2 -2
  101. package/dist/{secret-Deqo3n_N.mjs → secret-C-WBaUSS.mjs} +3 -3
  102. package/docs/guide/jobs.md +1 -1
  103. package/docs/guide/pages-routing/actions-and-forms.md +36 -15
  104. package/docs/guide/pages-routing/errors.md +3 -1
  105. package/docs/guide/pages-routing/overview.md +20 -0
  106. package/docs/guide/platform/administration/zero-trust.md +1 -1
  107. package/docs/guide/platform/installation/maintenance.md +5 -3
  108. package/docs/guide/queues.md +1 -1
  109. package/docs/integrations/frameworks/sveltekit.md +1 -1
  110. package/docs/reference/api/pages.md +4 -0
  111. package/docs/reference/cli/database.md +42 -6
  112. package/docs/reference/cli/platform-security.md +1 -1
  113. package/docs/reference/cli/platform-zero-trust.md +4 -3
  114. package/docs/reference/cli/setup.md +4 -0
  115. package/package.json +7 -7
  116. package/dist/cf-build-output-Dy7N0hQN.mjs +0 -1
  117. package/dist/cloudflare-operations-dpRD-2Px.mjs +0 -1
  118. package/dist/gen-CQDiPi8m.mjs +0 -1
  119. package/dist/help-Dy3w4rPq.mjs +0 -1
  120. package/dist/login-DWCZeCX9.mjs +0 -1
  121. package/dist/operator-cmd-DEnHFmJF.mjs +0 -1
  122. package/dist/platform-args-DNbNZ_RR.mjs +0 -1
  123. package/dist/prepare-BmG2E6TI.mjs +0 -1
@@ -2,12 +2,12 @@ import { L as log } from "./dist-Cr_xGE_K.mjs";
2
2
  import { t as hasOwnKey } from "./has-own-key-D9QEnAkF.mjs";
3
3
  import { n as getOwnVersion } from "./agents-64FnLwxP.mjs";
4
4
  import { t as formatCloudflareUserMessage } from "./cloudflare-user-output-CCR99eQY.mjs";
5
- import { n as isD1Bookmark } from "./cf-command-values-5BPBRc9Z.mjs";
6
- import { i as printVoidHeader, n as printGlobalHelp, r as printHelpPage, t as getHelpPath } from "./help-9wfMyXHb.mjs";
7
- import { i as parseSecurityArgs, n as operatorGroups } from "./operator-args-DCkWbgT-.mjs";
8
- import { r as OperatorClientError } from "./operator-client-DzebIntv.mjs";
5
+ import { n as parseDbArgs, t as dbSubcommands } from "./db-args-CiQVg8SJ.mjs";
6
+ import { i as printVoidHeader, n as printGlobalHelp, r as printHelpPage, t as getHelpPath } from "./help-DvClCzqL.mjs";
7
+ import { i as parseSecurityArgs, n as operatorGroups } from "./operator-args-nvetCWuz.mjs";
8
+ import { r as OperatorClientError } from "./operator-client-dFNnXfyB.mjs";
9
9
  import { f as formatUrl, h as import_picocolors } from "./output-BZLnu0z8.mjs";
10
- import { n as platformSubcommands, t as parsePlatformArgs } from "./platform-args-lwCyQ6Xy.mjs";
10
+ import { n as platformSubcommands, t as parsePlatformArgs } from "./platform-args-CvZSuhYS.mjs";
11
11
  import { parseArgs } from "node:util";
12
12
  // src/cli/account-args.ts
13
13
  const accountSubcommands = [
@@ -239,321 +239,6 @@ function parseConnectArgs(args) {
239
239
  noLogin: values["no-login"] ?? false
240
240
  };
241
241
  }
242
- // src/cli/db-args.ts
243
- const dbSubcommands = [
244
- {
245
- name: "push",
246
- description: "Push schema to the development database (no migration files)"
247
- },
248
- {
249
- name: "generate",
250
- description: "Generate SQL migrations from schema changes"
251
- },
252
- {
253
- name: "status",
254
- description: "Show migration status (local + remote)"
255
- },
256
- {
257
- name: "reset",
258
- description: "Reset local DB and re-run migrations"
259
- },
260
- {
261
- name: "seed",
262
- description: "Reset local DB, run migrations, and seed",
263
- flags: [{
264
- name: "--file",
265
- arg: "<path>",
266
- description: "Seed from a specific file"
267
- }]
268
- },
269
- {
270
- name: "execute",
271
- arg: "<sql>",
272
- description: "Run SQL against the database (use --remote for the deployed database)",
273
- flags: [{
274
- name: "--remote",
275
- description: "Run against the deployed database"
276
- }, {
277
- name: "--yes",
278
- description: "Skip the confirmation prompt"
279
- }]
280
- },
281
- {
282
- name: "migrate",
283
- description: "Apply pending migrations",
284
- flags: [{
285
- name: "--remote",
286
- description: "Apply to the remote database"
287
- }]
288
- },
289
- {
290
- name: "studio",
291
- description: "Open Drizzle Studio against the database (use --remote for the deployed PostgreSQL or MySQL database)",
292
- flags: [{
293
- name: "--remote",
294
- description: "Open Studio against the deployed database"
295
- }]
296
- },
297
- {
298
- name: "set-url",
299
- description: "Update the external database URL for deployment"
300
- },
301
- {
302
- name: "connect",
303
- arg: "[connection-string]",
304
- description: "Connect or provision an external database",
305
- flags: [
306
- {
307
- name: "--provider",
308
- arg: "<name-or-module>",
309
- description: "Provision with an adapter"
310
- },
311
- {
312
- name: "--name",
313
- arg: "<name>",
314
- description: "Provider project/database name"
315
- },
316
- {
317
- name: "--region",
318
- arg: "<region>",
319
- description: "Provider region identifier"
320
- },
321
- {
322
- name: "--local-only",
323
- description: "Do not sync a linked Void project"
324
- }
325
- ]
326
- },
327
- {
328
- name: "restore",
329
- description: "Restore the deployed D1 database to an earlier point (direct Cloudflare)",
330
- flags: [
331
- {
332
- name: "--bookmark",
333
- arg: "<bookmark>",
334
- description: "Restore point printed by deploy (or use --timestamp)"
335
- },
336
- {
337
- name: "--timestamp",
338
- arg: "<iso-time>",
339
- description: "Time to restore to, with Z or an offset (or use --bookmark)"
340
- },
341
- {
342
- name: "--platform",
343
- arg: "cloudflare",
344
- description: "Restore after a one-off deploy with --platform cloudflare"
345
- },
346
- {
347
- name: "--yes",
348
- description: "Skip the confirmation prompt"
349
- }
350
- ]
351
- },
352
- {
353
- name: "rename-migrations",
354
- description: "Rename migrations to timestamp-based format"
355
- },
356
- {
357
- name: "export",
358
- description: "Export local database as SQL",
359
- flags: [
360
- {
361
- name: "--output",
362
- arg: "<path>",
363
- description: "Export to a specific file path"
364
- },
365
- {
366
- name: "--no-data",
367
- description: "Schema only (no INSERT statements)"
368
- },
369
- {
370
- name: "--no-schema",
371
- description: "Data only (no CREATE TABLE)"
372
- },
373
- {
374
- name: "--table",
375
- arg: "<name>",
376
- description: "Export a single table"
377
- }
378
- ]
379
- }
380
- ];
381
- const MAX_POSITIONALS = {
382
- push: 0,
383
- generate: 0,
384
- status: 0,
385
- reset: 0,
386
- seed: 0,
387
- execute: 1,
388
- migrate: 0,
389
- studio: 0,
390
- "set-url": 0,
391
- connect: 1,
392
- restore: 0,
393
- "rename-migrations": 0,
394
- export: 0
395
- };
396
- const ACTION_FLAGS = {
397
- push: [],
398
- generate: [],
399
- status: [],
400
- reset: ["yes"],
401
- seed: ["file", "yes"],
402
- execute: [
403
- "file",
404
- "remote",
405
- "yes"
406
- ],
407
- migrate: ["remote"],
408
- studio: ["remote"],
409
- "set-url": [],
410
- connect: [
411
- "provider",
412
- "name",
413
- "region",
414
- "local-only"
415
- ],
416
- restore: [
417
- "bookmark",
418
- "timestamp",
419
- "platform",
420
- "yes"
421
- ],
422
- "rename-migrations": [],
423
- export: [
424
- "output",
425
- "no-data",
426
- "no-schema",
427
- "table"
428
- ]
429
- };
430
- /**
431
- * Read a restore time as a UTC ISO string. A time without a zone would depend on where the
432
- * command runs, `new Date` rolls impossible dates over (Feb 30 becomes Mar 2), and it keeps only
433
- * milliseconds, so all three are rejected instead of restoring to a moment the user did not write.
434
- */
435
- function parseRestoreTime(value) {
436
- const match = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d{1,3})?)?(?:Z|([+-])(\d{2}):(\d{2}))$/i.exec(value);
437
- const time = new Date(value);
438
- if (!match || Number.isNaN(time.getTime())) return;
439
- const offsetMinutes = match[7] ? (match[7] === "-" ? -1 : 1) * (Number(match[8]) * 60 + Number(match[9])) : 0;
440
- const written = new Date(time.getTime() + offsetMinutes * 6e4);
441
- return [
442
- written.getUTCFullYear(),
443
- written.getUTCMonth() + 1,
444
- written.getUTCDate(),
445
- written.getUTCHours(),
446
- written.getUTCMinutes(),
447
- written.getUTCSeconds()
448
- ].every((field, index) => field === Number(match[index + 1] ?? 0)) ? time.toISOString() : void 0;
449
- }
450
- function isDbAction(value) {
451
- return value !== void 0 && Object.hasOwn(MAX_POSITIONALS, value);
452
- }
453
- function parseDbArgs(args) {
454
- const { values, positionals } = parseArgs({
455
- args,
456
- options: {
457
- file: { type: "string" },
458
- output: { type: "string" },
459
- "no-data": { type: "boolean" },
460
- "no-schema": { type: "boolean" },
461
- table: { type: "string" },
462
- remote: { type: "boolean" },
463
- provider: { type: "string" },
464
- name: { type: "string" },
465
- region: { type: "string" },
466
- "local-only": { type: "boolean" },
467
- yes: { type: "boolean" },
468
- bookmark: { type: "string" },
469
- timestamp: { type: "string" },
470
- platform: { type: "string" }
471
- },
472
- allowPositionals: true,
473
- strict: true
474
- });
475
- const [action, ...rest] = positionals;
476
- if (!isDbAction(action)) throw new Error("db: Usage: void db <push|generate|status|reset|seed|execute|migrate|studio|export|connect|set-url|restore|rename-migrations>.");
477
- if (action === "export" && values.remote) throw new Error("db: `void db export` reads only the local database; --remote is not supported.");
478
- const unsupported = Object.keys(values).find((flag) => !ACTION_FLAGS[action].includes(flag));
479
- if (unsupported) throw new Error(`db: \`void db ${action}\` does not support --${unsupported}.`);
480
- const maxPositionals = MAX_POSITIONALS[action];
481
- if (rest.length > maxPositionals) throw new Error(`db: Unexpected argument '${rest[maxPositionals]}'.`);
482
- switch (action) {
483
- case "reset": return {
484
- action,
485
- yes: values.yes
486
- };
487
- case "seed": return {
488
- action,
489
- file: values.file,
490
- yes: values.yes
491
- };
492
- case "execute": {
493
- const [command] = rest;
494
- if (!command && !values.file) throw new Error("db: Usage: void db execute <sql> or void db execute --file <path>.");
495
- if (command && values.file) throw new Error("db: Provide either SQL inline or --file, not both.");
496
- return {
497
- action,
498
- command,
499
- file: values.file,
500
- remote: values.remote,
501
- yes: values.yes
502
- };
503
- }
504
- case "migrate":
505
- case "studio": return {
506
- action,
507
- remote: values.remote
508
- };
509
- case "connect": {
510
- const [url] = rest;
511
- if (url && values.provider) throw new Error("db: Provide either a connection string or --provider, not both.");
512
- return {
513
- action,
514
- url,
515
- provider: values.provider,
516
- name: values.name,
517
- region: values.region,
518
- localOnly: values["local-only"]
519
- };
520
- }
521
- case "restore": {
522
- if (values.platform !== void 0 && values.platform !== "cloudflare") throw new Error("db: `void db restore --platform` accepts only 'cloudflare'.");
523
- const platform = values.platform;
524
- const bookmark = values.bookmark?.trim();
525
- const timestamp = values.timestamp?.trim();
526
- if (bookmark && !timestamp) {
527
- if (!isD1Bookmark(bookmark)) throw new Error("db: --bookmark must be a D1 restore point printed by `void deploy`, for example 00000085-0000024c-00004ef2.");
528
- return {
529
- action,
530
- target: { bookmark },
531
- platform,
532
- yes: values.yes
533
- };
534
- }
535
- if (timestamp && !bookmark) {
536
- const time = parseRestoreTime(timestamp);
537
- if (!time) throw new Error("db: --timestamp must be a valid ISO 8601 time with Z or an offset and at most millisecond precision, for example 2026-10-16T09:30:00Z.");
538
- return {
539
- action,
540
- target: { timestamp: time },
541
- platform,
542
- yes: values.yes
543
- };
544
- }
545
- throw new Error("db: Usage: void db restore --bookmark <bookmark> or void db restore --timestamp <iso-time>.");
546
- }
547
- case "export": return {
548
- action,
549
- output: values.output,
550
- noData: values["no-data"],
551
- noSchema: values["no-schema"],
552
- table: values.table
553
- };
554
- default: return { action };
555
- }
556
- }
557
242
  // src/cli/domain-args.ts
558
243
  const domainSubcommands = [
559
244
  {
@@ -1654,7 +1339,7 @@ async function runSubcommandGroup(command, subcommands, parse, run) {
1654
1339
  const sub = args[1];
1655
1340
  const hasNamedSubcommand = args.slice(1).some((arg) => subcommands.some(({ name }) => name === arg));
1656
1341
  try {
1657
- if ((!sub || sub.startsWith("-") && !hasNamedSubcommand) && process.stdin.isTTY) {
1342
+ if ((!sub || sub.startsWith("-") && !hasNamedSubcommand) && process.stdin.isTTY && !args.includes("--json")) {
1658
1343
  const { promptSubcommand } = await import("./subcommand-prompt-B4LOLosl.mjs");
1659
1344
  if (command === "platform" && !sub) log.info(`A Void platform lets a team deploy Void apps to a shared Cloudflare account.
1660
1345
  This command sets up and manages platforms. Join with \`void connect <url>\`.
@@ -1687,7 +1372,7 @@ Docs: ${formatUrl("https://void.cloud/guide/self-hosted-platform")}`);
1687
1372
  if (command === "platform") {
1688
1373
  const platformMessage = message.replace(/^platform:/, import_picocolors.default.bold(import_picocolors.default.red("platform:")));
1689
1374
  console.error(err instanceof OperatorClientError && err.details !== void 0 ? `${platformMessage}\n${isPartialResult(err) ? "Partial result" : "Details"}:\n${JSON.stringify(err.details, null, 2)}` : platformMessage);
1690
- } else log.error(message);
1375
+ } else log.error(message, args.includes("--json") ? { output: process.stderr } : void 0);
1691
1376
  process.exit(1);
1692
1377
  }
1693
1378
  }
@@ -1698,19 +1383,27 @@ const args = process.argv.slice(2);
1698
1383
  const command = args[0];
1699
1384
  const helpPath = getHelpPath(args);
1700
1385
  const subcommandGroups = {
1701
- auth: () => runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("./auth-router-BmzEgzYx.mjs").then(({ runAuthRouter }) => runAuthRouter(root, parsed))),
1702
- account: () => runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (root, parsed) => import("./account-cmd-D_0qJ9fx.mjs").then(({ runAccountCommand }) => runAccountCommand(root, parsed))),
1703
- platform: () => runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (root, parsed) => import("./platform-cmd-CqRjxFEU.mjs").then(({ runPlatformCommand }) => runPlatformCommand(root, parsed))),
1386
+ auth: () => runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("./auth-router-FskgTU3B.mjs").then(({ runAuthRouter }) => runAuthRouter(root, parsed))),
1387
+ account: () => runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (root, parsed) => import("./account-cmd-CdJQba_Q.mjs").then(({ runAccountCommand }) => runAccountCommand(root, parsed))),
1388
+ platform: () => runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (root, parsed) => import("./platform-cmd-B3rO4RhU.mjs").then(({ runPlatformCommand }) => runPlatformCommand(root, parsed))),
1704
1389
  cloudflare: () => runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (root, parsed) => import("./cloudflare-cmd-SsFlJe2B.mjs").then(({ runCloudflareCommand }) => runCloudflareCommand(root, parsed))),
1705
- project: () => runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("./project-cmd-DyUEFi2b.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed))),
1706
- secret: () => runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("./secret-Deqo3n_N.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed))),
1707
- domain: () => runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("./domain-B_xY1yZ5.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed))),
1708
- email: () => runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (root, parsed) => import("./email-BIC15L7a.mjs").then(({ runEmailCommand }) => runEmailCommand(root, parsed))),
1709
- db: () => runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("./db-DmlaWVBu.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed))),
1710
- env: () => runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("./env-DJPZYHT5.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed))),
1711
- gen: () => runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("./gen-CQDiPi8m.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed))),
1712
- github: () => runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("./github-cmd-DPmby8x-.mjs").then(({ runGithubCommand }) => runGithubCommand(root, parsed))),
1713
- build: () => runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("./build-cmd-BaFsyZrz.mjs").then(({ runBuildCommand }) => runBuildCommand(root, parsed)))
1390
+ project: () => runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("./project-cmd-BWJTplpc.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed))),
1391
+ secret: () => runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("./secret-C-WBaUSS.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed))),
1392
+ domain: () => runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("./domain-mweyYXSw.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed))),
1393
+ email: () => runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (root, parsed) => import("./email-DoDqRH6i.mjs").then(({ runEmailCommand }) => runEmailCommand(root, parsed))),
1394
+ db: () => runSubcommandGroup("db", dbSubcommands, parseDbArgs, async (root, parsed) => {
1395
+ if (parsed.action === "execute" && parsed.json) {
1396
+ const { runDbExecuteProcess } = await import("./cli/db-execute-process.mjs");
1397
+ await runDbExecuteProcess(root, args);
1398
+ } else {
1399
+ const { runDbCommand } = await import("./db-BSuWV1PI.mjs");
1400
+ await runDbCommand(root, parsed);
1401
+ }
1402
+ }),
1403
+ env: () => runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("./env-DaAoYR2-.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed))),
1404
+ gen: () => runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("./gen-vhBDHs3q.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed))),
1405
+ github: () => runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("./github-cmd-BR19Ffdz.mjs").then(({ runGithubCommand }) => runGithubCommand(root, parsed))),
1406
+ build: () => runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("./build-cmd-B7OJ0U5R.mjs").then(({ runBuildCommand }) => runBuildCommand(root, parsed)))
1714
1407
  };
1715
1408
  if (helpPath) {
1716
1409
  if (helpPath.length === 0) printGlobalHelp();
@@ -1729,21 +1422,21 @@ if (helpPath) {
1729
1422
  log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
1730
1423
  process.exit(1);
1731
1424
  }
1732
- const { runDeploy } = await import("./deploy-BB3rsZbP.mjs");
1425
+ const { runDeploy } = await import("./deploy-GT4CW5fs.mjs");
1733
1426
  await runDeploy(root, deployArgs).catch((err) => {
1734
1427
  log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
1735
1428
  process.exit(1);
1736
1429
  });
1737
1430
  } else if (command === "connect") await (async () => {
1738
1431
  const parsed = parseConnectArgs(args.slice(1));
1739
- const { runConnectCommand } = await import("./connect-DDRQGfFE.mjs");
1432
+ const { runConnectCommand } = await import("./connect-WG4TcR_d.mjs");
1740
1433
  await runConnectCommand(process.cwd(), parsed);
1741
1434
  })().catch((err) => {
1742
1435
  log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
1743
1436
  process.exit(1);
1744
1437
  });
1745
1438
  else if (command && hasOwnKey(subcommandGroups, command)) subcommandGroups[command]();
1746
- else if (command === "info") await import("./info-BWEWaOBo.mjs").then(async ({ runInfoCommand }) => {
1439
+ else if (command === "info") await import("./info-P6MBiVJi.mjs").then(async ({ runInfoCommand }) => {
1747
1440
  try {
1748
1441
  await runInfoCommand(process.cwd(), parseInfoArgs(args.slice(1)));
1749
1442
  } catch (err) {
@@ -1764,14 +1457,14 @@ else if (command === "prepare") {
1764
1457
  log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
1765
1458
  process.exit(1);
1766
1459
  }
1767
- const { runPrepareCommand } = await import("./prepare-DWjn1Lzd.mjs");
1460
+ const { runPrepareCommand } = await import("./prepare-WvijE289.mjs");
1768
1461
  await runPrepareCommand(root).catch((err) => {
1769
1462
  log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
1770
1463
  process.exit(1);
1771
1464
  });
1772
1465
  } else if (command === "init") {
1773
1466
  const root = process.cwd();
1774
- await import("./init-BuTPVLPO.mjs").then(async ({ runInitCommand, parseInitArgs }) => {
1467
+ await import("./init-B2VZ2Hut.mjs").then(async ({ runInitCommand, parseInitArgs }) => {
1775
1468
  let initArgs;
1776
1469
  try {
1777
1470
  initArgs = parseInitArgs(args.slice(1));
@@ -1910,12 +1603,12 @@ else if (command) {
1910
1603
  if (hasOwnKey(subcommandGroups, cmd)) return subcommandGroups[cmd]();
1911
1604
  switch (cmd) {
1912
1605
  case "connect": {
1913
- const { runConnectCommand } = await import("./connect-DDRQGfFE.mjs");
1606
+ const { runConnectCommand } = await import("./connect-WG4TcR_d.mjs");
1914
1607
  await runConnectCommand(root, parseConnectArgs([]));
1915
1608
  return;
1916
1609
  }
1917
1610
  case "init": {
1918
- const { runInitCommand, parseInitArgs } = await import("./init-BuTPVLPO.mjs");
1611
+ const { runInitCommand, parseInitArgs } = await import("./init-B2VZ2Hut.mjs");
1919
1612
  await runInitCommand(root, parseInitArgs([]));
1920
1613
  return;
1921
1614
  }
@@ -1925,17 +1618,17 @@ else if (command) {
1925
1618
  return;
1926
1619
  }
1927
1620
  case "deploy": {
1928
- const { runDeploy } = await import("./deploy-BB3rsZbP.mjs");
1621
+ const { runDeploy } = await import("./deploy-GT4CW5fs.mjs");
1929
1622
  await runDeploy(root);
1930
1623
  return;
1931
1624
  }
1932
1625
  case "info": {
1933
- const { runInfoCommand } = await import("./info-BWEWaOBo.mjs");
1626
+ const { runInfoCommand } = await import("./info-P6MBiVJi.mjs");
1934
1627
  await runInfoCommand(root, parseInfoArgs([]));
1935
1628
  return;
1936
1629
  }
1937
1630
  case "prepare": {
1938
- const { runPrepareCommand } = await import("./prepare-DWjn1Lzd.mjs");
1631
+ const { runPrepareCommand } = await import("./prepare-WvijE289.mjs");
1939
1632
  await runPrepareCommand(root);
1940
1633
  return;
1941
1634
  }
@@ -1,8 +1,8 @@
1
1
  import { a as join } from "./dist-DMYe8CZJ.mjs";
2
2
  import { t as cfAccessHeaders } from "./cf-access-DmkKPcAI.mjs";
3
3
  import { r as getPackageDir } from "./agents-64FnLwxP.mjs";
4
- import { a as getApiUrl } from "./auth-DlLDymuc.mjs";
5
- import { r as isCloudflareAccessChallenge, t as ensurePlatformAccessToken } from "./cf-access-FaIm95jA.mjs";
4
+ import { a as getApiUrl } from "./auth-CqwJwItO.mjs";
5
+ import { r as isCloudflareAccessChallenge, t as ensurePlatformAccessToken } from "./cf-access-DHklo7Rg.mjs";
6
6
  import { t as Buffer } from "./node-buffer-D7kgjaDs.mjs";
7
7
  import { n as readPlatformDiscoveryResponse } from "./platform-discovery-CLxtixHJ.mjs";
8
8
  import { t as hasOwnKey } from "./has-own-key-D9QEnAkF.mjs";
@@ -96,7 +96,7 @@ function readCliVersion() {
96
96
  }
97
97
  const VOID_CLI_VERSION = readCliVersion();
98
98
  /** The oldest Void platform release this CLI supports, including queue concurrency caps. */
99
- const MIN_PLATFORM_VERSION = "1.12.0";
99
+ const MIN_PLATFORM_VERSION = "1.12.1";
100
100
  const RELEASE_VERSION = /^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$/;
101
101
  /**
102
102
  * Discovery probes keyed by platform base URL. Every outcome (pass,
@@ -128,7 +128,7 @@ function assertSupportedPlatform(apiUrl, probe) {
128
128
  if (probe.kind === "unknown") return;
129
129
  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}`);
130
130
  const { version } = probe;
131
- if (version === "hosted" || isOlderPlatformVersion(version, "1.12.0") !== true) return;
131
+ if (version === "hosted" || isOlderPlatformVersion(version, "1.12.1") !== true) return;
132
132
  throw new Error(`The Void platform at ${apiUrl} runs version ${version}, but this CLI requires ${MIN_PLATFORM_VERSION} or later. ${UPGRADE_PLATFORM_ACTION}`);
133
133
  }
134
134
  /**
@@ -1 +1 @@
1
- export { r as PlatformClient, s as isOlderPlatformVersion } from "./client-ImIe7Mjq.mjs";
1
+ export { r as PlatformClient, s as isOlderPlatformVersion } from "./client-DE2m2ldh.mjs";
@@ -105,7 +105,12 @@ async function importCloudflareD1Sql(context, sql) {
105
105
  configPath: context.operation.configPath
106
106
  }));
107
107
  }
108
+ /** Every row the SQL returned, with the rows of all its statements in one list. */
108
109
  async function executeCloudflareD1Sql(context, sql) {
110
+ return (await executeCloudflareD1Statements(context, sql)).flatMap((result) => result.results);
111
+ }
112
+ /** D1's result for each statement in the SQL, in order. */
113
+ async function executeCloudflareD1Statements(context, sql) {
109
114
  const execute = (source) => run(context.operation, {
110
115
  type: "d1.execute",
111
116
  database: context.migrateToken,
@@ -114,14 +119,15 @@ async function executeCloudflareD1Sql(context, sql) {
114
119
  });
115
120
  const parsed = requireData((Buffer.byteLength(JSON.stringify(sql)) > 16384 ? await withD1SqlFile(sql, (file) => execute({ file })) : await execute({ sql })).data, "Cloudflare D1 execute");
116
121
  if (!Array.isArray(parsed)) throw new Error("Cloudflare D1 execute returned an unexpected response.");
117
- const rows = [];
118
- for (const item of parsed) {
122
+ return parsed.map((item) => {
119
123
  if (typeof item !== "object" || item === null) throw new Error("Cloudflare D1 execute returned a malformed result.");
120
- const resultRows = item.results;
121
- if (!Array.isArray(resultRows)) continue;
122
- for (const row of resultRows) if (typeof row === "object" && row !== null && !Array.isArray(row)) rows.push(row);
123
- }
124
- return rows;
124
+ const { results, success, meta } = item;
125
+ return {
126
+ results: Array.isArray(results) ? results.filter((row) => typeof row === "object" && row !== null && !Array.isArray(row)) : [],
127
+ success: success !== false,
128
+ meta: typeof meta === "object" && meta !== null ? meta : {}
129
+ };
130
+ });
125
131
  }
126
132
  async function readCloudflareD1Migrations(context) {
127
133
  const table = context.migrationsTable.replaceAll("\"", "\"\"");
@@ -464,4 +470,4 @@ function failedOperationResult(error) {
464
470
  error: getErrorMessage(error)
465
471
  };
466
472
  }
467
- export { tailCloudflareWorker as S, readCloudflareWorkerStatus as _, createCloudflareEmptyDomainPublisher as a, restoreCloudflareD1Database as b, importCloudflareD1Sql as c, parseActiveVersionId as d, parseCloudflareDeployedVersionIds as f, readCloudflareD1Migrations as g, putCloudflareSecret as h, createCloudflareEmptyCronPublisher as i, listCloudflareDomains as l, publishEmptyCloudflareCustomDomainSet as m, applyCloudflareD1Migrations as n, deleteCloudflareSecret as o, parseCloudflareVersions as p, changeCloudflareDomain as r, executeCloudflareD1Sql as s, activateCloudflareExistingVersion as t, listCloudflareSecrets as u, resolveCloudflareD1Context as v, syncCloudflareSecrets as x, resolveCloudflareOperationContext as y };
473
+ export { tailCloudflareWorker as C, syncCloudflareSecrets as S, readCloudflareD1Migrations as _, createCloudflareEmptyDomainPublisher as a, resolveCloudflareOperationContext as b, executeCloudflareD1Statements as c, listCloudflareSecrets as d, parseActiveVersionId as f, putCloudflareSecret as g, publishEmptyCloudflareCustomDomainSet as h, createCloudflareEmptyCronPublisher as i, importCloudflareD1Sql as l, parseCloudflareVersions as m, applyCloudflareD1Migrations as n, deleteCloudflareSecret as o, parseCloudflareDeployedVersionIds as p, changeCloudflareDomain as r, executeCloudflareD1Sql as s, activateCloudflareExistingVersion as t, listCloudflareDomains as u, readCloudflareWorkerStatus as v, restoreCloudflareD1Database as x, resolveCloudflareD1Context as y };
@@ -0,0 +1 @@
1
+ export { t as activateCloudflareExistingVersion, n as applyCloudflareD1Migrations, r as changeCloudflareDomain, o as deleteCloudflareSecret, s as executeCloudflareD1Sql, c as executeCloudflareD1Statements, l as importCloudflareD1Sql, u as listCloudflareDomains, d as listCloudflareSecrets, g as putCloudflareSecret, _ as readCloudflareD1Migrations, v as readCloudflareWorkerStatus, y as resolveCloudflareD1Context, b as resolveCloudflareOperationContext, x as restoreCloudflareD1Database, S as syncCloudflareSecrets, C as tailCloudflareWorker } from "./cloudflare-operations-BIRQkYwL.mjs";
@@ -1,10 +1,10 @@
1
1
  import { K as select, L as log, tt as isCancel } from "./dist-Cr_xGE_K.mjs";
2
- import { d as readPlatformToken } from "./auth-DlLDymuc.mjs";
3
- import { a as isExpiredTokenError, r as PlatformClient } from "./client-ImIe7Mjq.mjs";
2
+ import { d as readPlatformToken } from "./auth-CqwJwItO.mjs";
3
+ import { a as isExpiredTokenError, r as PlatformClient } from "./client-DE2m2ldh.mjs";
4
4
  import { t as connectCloudflare } from "./cloudflare-connect-BgpHcSg3.mjs";
5
- import { t as promptForLoginToken } from "./login-BSOSah1j.mjs";
5
+ import { t as promptForLoginToken } from "./login-jUBgfvzk.mjs";
6
6
  import { y as printSuccess } from "./output-BZLnu0z8.mjs";
7
- import { i as saveDiscoveredPlatform, n as promptPlatformUrl, t as discoverPlatform } from "./platform-cmd-DJ-fOYhL.mjs";
7
+ import { i as saveDiscoveredPlatform, n as promptPlatformUrl, t as discoverPlatform } from "./platform-cmd-D_4z2Ijv.mjs";
8
8
  import { c as normalizePlatformApiUrl, s as listPlatformConnections } from "./platform-registry-DHH6fivm.mjs";
9
9
  import { c as writeDeploymentPlatform, l as writePlatformSelection, n as readDeploymentPlatform } from "./project-dh9431bN.mjs";
10
10
  // src/cli/connect.ts
@@ -1,8 +1,8 @@
1
1
  import { A as confirm, K as select, L as log, O as cancel, X as text, tt as isCancel } from "./dist-Cr_xGE_K.mjs";
2
- import { n as PlatformApiError } from "./client-ImIe7Mjq.mjs";
2
+ import { n as PlatformApiError } from "./client-DE2m2ldh.mjs";
3
3
  import { b as sanitizeTerminalText, h as import_picocolors } from "./output-BZLnu0z8.mjs";
4
4
  import { t as attachSelectedPlatform, u as writeProjectConfig } from "./project-dh9431bN.mjs";
5
- import { s as getSiteDomain } from "./auth-DlLDymuc.mjs";
5
+ import { s as getSiteDomain } from "./auth-CqwJwItO.mjs";
6
6
  import { t as validateProjectSlug } from "./project-slug-CO6ci9XG.mjs";
7
7
  import { n as inferDefaultSlug } from "./resolve-project-8WZ3iVmr.mjs";
8
8
  // src/cli/prompt.ts
@@ -1 +1 @@
1
- export { t as createProjectWithSlugRetry } from "./create-project-CY7sP8sI.mjs";
1
+ export { t as createProjectWithSlugRetry } from "./create-project-8FdN6D2i.mjs";