vercel 54.14.0 → 54.14.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/dist/chunks/{add-PVEKZBHH.js → add-PKT6ULVJ.js} +9 -9
- package/dist/chunks/{chunk-Y76J3TGD.js → chunk-2HN6DLIY.js} +1 -1
- package/dist/chunks/{chunk-FPRA7U2P.js → chunk-2XEEOHHH.js} +1 -1
- package/dist/chunks/{chunk-TH555JND.js → chunk-2ZSXQQXI.js} +15 -42
- package/dist/chunks/{chunk-6D6CSOSK.js → chunk-372SHB43.js} +86 -62
- package/dist/chunks/{chunk-4KAFHBYE.js → chunk-3BR246Y6.js} +1 -1
- package/dist/chunks/{chunk-V2WFM23D.js → chunk-4BFK3C7V.js} +2 -2
- package/dist/chunks/{chunk-FMN3NXRC.js → chunk-56AJHIQC.js} +1 -1
- package/dist/chunks/chunk-64IF634X.js +18 -0
- package/dist/chunks/{chunk-VNUNCNPE.js → chunk-AWD3IGXU.js} +3 -3
- package/dist/chunks/{chunk-5SYDEK2N.js → chunk-D7MGZH35.js} +1 -1
- package/dist/chunks/{chunk-IQQJHYW4.js → chunk-DPS62LHL.js} +2 -2
- package/dist/chunks/{chunk-RWJORLQP.js → chunk-FEYVO2US.js} +59 -17
- package/dist/chunks/{chunk-ABOX5TXU.js → chunk-FLW73SZ3.js} +3 -3
- package/dist/chunks/{chunk-Z7KOKD2G.js → chunk-G3NXHUFT.js} +1 -1
- package/dist/chunks/{chunk-CO5D46AG.js → chunk-GGP5R3FU.js} +18 -38
- package/dist/chunks/{chunk-J5273CSE.js → chunk-HIYWSGI7.js} +19 -10
- package/dist/chunks/{chunk-WFRHKZFI.js → chunk-IB56QKCM.js} +1 -1
- package/dist/chunks/{chunk-ZTPOJE63.js → chunk-IJJOI63T.js} +1 -1
- package/dist/chunks/{chunk-DAASB6YQ.js → chunk-ILJH44MK.js} +23 -3
- package/dist/chunks/{chunk-V4GROAUJ.js → chunk-IPWWE7PB.js} +4 -7
- package/dist/chunks/{chunk-G7QWUIGS.js → chunk-J7BMPRCU.js} +3 -3
- package/dist/chunks/{chunk-7OZWGXPA.js → chunk-JISJDGJF.js} +2 -2
- package/dist/chunks/{chunk-5UCWXYNH.js → chunk-LQR3CHMH.js} +88 -46
- package/dist/chunks/{chunk-4NDOMD3E.js → chunk-LYCSVJIX.js} +1 -1
- package/dist/chunks/{chunk-6IQZVQV6.js → chunk-MYWLF3BZ.js} +18 -0
- package/dist/chunks/{chunk-6K3WJDFA.js → chunk-O4V7CMVO.js} +10 -10
- package/dist/chunks/{chunk-KJ5O7JQQ.js → chunk-O7RJHL34.js} +81 -86
- package/dist/chunks/{chunk-C3VH3X5Y.js → chunk-OHIZ4SVU.js} +4 -4
- package/dist/chunks/{chunk-JFWE5ORG.js → chunk-P4KQ3FJ4.js} +1 -0
- package/dist/chunks/{chunk-PV533MBH.js → chunk-PMUUPCDL.js} +1 -1
- package/dist/chunks/{chunk-OEM7RB3X.js → chunk-SDZ5ICZL.js} +2 -2
- package/dist/chunks/{chunk-NGRSQRSN.js → chunk-SGPBULVT.js} +1 -1
- package/dist/chunks/{chunk-RM4XGGZO.js → chunk-TSENBD7C.js} +2 -2
- package/dist/chunks/{chunk-O4C4A7HM.js → chunk-VKRW77HH.js} +1 -1
- package/dist/chunks/chunk-VXYGCOKL.js +28 -0
- package/dist/chunks/{chunk-7CJZCFLW.js → chunk-YLGMXYFG.js} +2 -2
- package/dist/chunks/{chunk-B6C7NMT3.js → chunk-Z2MBXYZZ.js} +1 -1
- package/dist/chunks/{chunk-S4VHXL2Y.js → chunk-Z3X747P6.js} +1 -1
- package/dist/chunks/{compile-vercel-config-MD37D2F7.js → compile-vercel-config-3LV7J3IZ.js} +4 -4
- package/dist/chunks/{delete-6EMDCXSA.js → delete-GFW6Y6TZ.js} +10 -8
- package/dist/chunks/{disable-FLJ27NHG.js → disable-PGRAS2ZL.js} +10 -8
- package/dist/chunks/{discard-KEIII6RM.js → discard-S6N5Q4G5.js} +10 -8
- package/dist/chunks/{edit-DOL2ZJPG.js → edit-TICKX4ZV.js} +12 -10
- package/dist/chunks/{enable-PZWZIETT.js → enable-L3BYWN6S.js} +10 -8
- package/dist/chunks/{export-2PFHAELC.js → export-NXS33U5T.js} +6 -6
- package/dist/chunks/{inspect-WPWOZJ2K.js → inspect-OOI5JN3Y.js} +9 -9
- package/dist/chunks/{list-4R5DCLTB.js → list-6EHRL2D4.js} +7 -7
- package/dist/chunks/{list-ZT7QK2H7.js → list-77WL6463.js} +11 -11
- package/dist/chunks/{ls-4JTXQXMQ.js → ls-PBSOEXFG.js} +9 -9
- package/dist/chunks/{publish-JV4J3SOA.js → publish-CU2THVYW.js} +10 -8
- package/dist/chunks/{query-N22EYSZZ.js → query-HEATRYAK.js} +99 -43
- package/dist/chunks/{reorder-TG53BKW4.js → reorder-IQVKSM3H.js} +10 -8
- package/dist/chunks/{restore-U7O4VESA.js → restore-RDEOBGAS.js} +10 -8
- package/dist/chunks/{rm-XA4LYZXI.js → rm-MCSGTU4J.js} +9 -9
- package/dist/chunks/{routes-EAMQVFU2.js → routes-YEU33SON.js} +2 -2
- package/dist/chunks/{rule-inspect-HC745CYT.js → rule-inspect-3YK2XSL3.js} +9 -9
- package/dist/chunks/{rules-RMN72YHN.js → rules-F4MRDDHM.js} +6 -6
- package/dist/chunks/{schema-CZVKUXM6.js → schema-65C5EBJ7.js} +9 -9
- package/dist/chunks/{stamp-ENIXDCRO.js → stamp-AA7R3MZS.js} +3 -1
- package/dist/chunks/{types-P6JKZFEY.js → types-3R7HKP57.js} +3 -3
- package/dist/chunks/{update-PU3WLIA7.js → update-XB4WSRGY.js} +9 -9
- package/dist/commands/build/index.js +18 -16
- package/dist/commands/deploy/index.js +30 -171
- package/dist/commands/dev/index.js +187 -133
- package/dist/commands/dev/next-dev-websocket-shim-preload.cjs +190 -0
- package/dist/commands/env/index.js +162 -101
- package/dist/commands/link/index.js +19 -19
- package/dist/commands/list/index.js +13 -11
- package/dist/commands-bulk.js +258 -104
- package/dist/help.js +1 -1
- package/dist/index.js +27 -27
- package/dist/version.mjs +1 -1
- package/package.json +11 -11
|
@@ -13,14 +13,14 @@ import {
|
|
|
13
13
|
} from "../../chunks/chunk-WEVQWSBT.js";
|
|
14
14
|
import {
|
|
15
15
|
formatTable
|
|
16
|
-
} from "../../chunks/chunk-
|
|
16
|
+
} from "../../chunks/chunk-TSENBD7C.js";
|
|
17
17
|
import {
|
|
18
18
|
suggestNextCommands
|
|
19
19
|
} from "../../chunks/chunk-LKBI43XK.js";
|
|
20
20
|
import {
|
|
21
21
|
formatEnvironment,
|
|
22
22
|
validateLsArgs
|
|
23
|
-
} from "../../chunks/chunk-
|
|
23
|
+
} from "../../chunks/chunk-2HN6DLIY.js";
|
|
24
24
|
import {
|
|
25
25
|
validateJsonOutput
|
|
26
26
|
} from "../../chunks/chunk-XPKWKPWA.js";
|
|
@@ -29,21 +29,25 @@ import {
|
|
|
29
29
|
} from "../../chunks/chunk-YPQSDAEW.js";
|
|
30
30
|
import {
|
|
31
31
|
getCommandAliases
|
|
32
|
-
} from "../../chunks/chunk-
|
|
33
|
-
import "../../chunks/chunk-
|
|
34
|
-
import "../../chunks/chunk-
|
|
35
|
-
import "../../chunks/chunk-
|
|
36
|
-
import "../../chunks/chunk-
|
|
37
|
-
import "../../chunks/chunk-
|
|
38
|
-
import "../../chunks/chunk-
|
|
39
|
-
import "../../chunks/chunk-
|
|
32
|
+
} from "../../chunks/chunk-O7RJHL34.js";
|
|
33
|
+
import "../../chunks/chunk-ILJH44MK.js";
|
|
34
|
+
import "../../chunks/chunk-IB56QKCM.js";
|
|
35
|
+
import "../../chunks/chunk-DPS62LHL.js";
|
|
36
|
+
import "../../chunks/chunk-SGPBULVT.js";
|
|
37
|
+
import "../../chunks/chunk-VKRW77HH.js";
|
|
38
|
+
import "../../chunks/chunk-56AJHIQC.js";
|
|
39
|
+
import "../../chunks/chunk-IJJOI63T.js";
|
|
40
40
|
import {
|
|
41
41
|
require_execa
|
|
42
42
|
} from "../../chunks/chunk-YI3JV6GM.js";
|
|
43
|
-
import
|
|
43
|
+
import {
|
|
44
|
+
stamp_default
|
|
45
|
+
} from "../../chunks/chunk-64IF634X.js";
|
|
46
|
+
import "../../chunks/chunk-VXYGCOKL.js";
|
|
47
|
+
import "../../chunks/chunk-SDZ5ICZL.js";
|
|
44
48
|
import {
|
|
45
49
|
help
|
|
46
|
-
} from "../../chunks/chunk-
|
|
50
|
+
} from "../../chunks/chunk-AWD3IGXU.js";
|
|
47
51
|
import {
|
|
48
52
|
STANDARD_ENVIRONMENTS,
|
|
49
53
|
addSubcommand,
|
|
@@ -58,6 +62,7 @@ import {
|
|
|
58
62
|
listSubcommand,
|
|
59
63
|
param,
|
|
60
64
|
parseTarget,
|
|
65
|
+
printAlignedLabel,
|
|
61
66
|
pull,
|
|
62
67
|
pullEnvRecords,
|
|
63
68
|
pullSubcommand,
|
|
@@ -65,11 +70,11 @@ import {
|
|
|
65
70
|
require_frameworks,
|
|
66
71
|
runSubcommand,
|
|
67
72
|
updateSubcommand
|
|
68
|
-
} from "../../chunks/chunk-
|
|
73
|
+
} from "../../chunks/chunk-LQR3CHMH.js";
|
|
69
74
|
import {
|
|
70
75
|
TelemetryClient,
|
|
71
76
|
require_dist as require_dist2
|
|
72
|
-
} from "../../chunks/chunk-
|
|
77
|
+
} from "../../chunks/chunk-HIYWSGI7.js";
|
|
73
78
|
import {
|
|
74
79
|
buildCommandWithYes,
|
|
75
80
|
buildEnvAddCommandWithPreservedArgs,
|
|
@@ -81,17 +86,16 @@ import {
|
|
|
81
86
|
outputActionRequired,
|
|
82
87
|
outputAgentError
|
|
83
88
|
} from "../../chunks/chunk-NHGCQRK5.js";
|
|
84
|
-
import {
|
|
85
|
-
require_ms,
|
|
86
|
-
stamp_default
|
|
87
|
-
} from "../../chunks/chunk-CO5D46AG.js";
|
|
88
89
|
import "../../chunks/chunk-N2T234LO.js";
|
|
89
|
-
import
|
|
90
|
+
import {
|
|
91
|
+
require_ms
|
|
92
|
+
} from "../../chunks/chunk-GGP5R3FU.js";
|
|
93
|
+
import "../../chunks/chunk-LYCSVJIX.js";
|
|
90
94
|
import {
|
|
91
95
|
getFlagsSpecification,
|
|
92
96
|
parseArguments,
|
|
93
97
|
printError
|
|
94
|
-
} from "../../chunks/chunk-
|
|
98
|
+
} from "../../chunks/chunk-MYWLF3BZ.js";
|
|
95
99
|
import {
|
|
96
100
|
getCommandName,
|
|
97
101
|
getCommandNamePlain,
|
|
@@ -420,7 +424,21 @@ var EnvAddTelemetryClient = class extends TelemetryClient {
|
|
|
420
424
|
|
|
421
425
|
// src/commands/env/add.ts
|
|
422
426
|
import { determineAgent } from "@vercel/detect-agent";
|
|
423
|
-
var
|
|
427
|
+
var SENSITIVE_VALUE_HINT = "Sensitive values cannot be read later";
|
|
428
|
+
var SENSITIVE_SECRET_PROMPT = `Store as sensitive? ${import_chalk.default.dim(
|
|
429
|
+
SENSITIVE_VALUE_HINT
|
|
430
|
+
)}`;
|
|
431
|
+
var CHECKBOX_INSTRUCTIONS = [
|
|
432
|
+
" ",
|
|
433
|
+
import_chalk.default.cyan("<space>"),
|
|
434
|
+
import_chalk.default.dim(" select, "),
|
|
435
|
+
import_chalk.default.cyan("<enter>"),
|
|
436
|
+
import_chalk.default.dim(" confirm, "),
|
|
437
|
+
import_chalk.default.cyan("<a>"),
|
|
438
|
+
import_chalk.default.dim(" toggle all, "),
|
|
439
|
+
import_chalk.default.cyan("<i>"),
|
|
440
|
+
import_chalk.default.dim(" invert")
|
|
441
|
+
].join("");
|
|
424
442
|
function filterEnvChoicesForSensitivity(choices, opts) {
|
|
425
443
|
if (opts.isSensitive) {
|
|
426
444
|
return choices.filter((c) => c.value !== "development");
|
|
@@ -458,20 +476,66 @@ function resolveFinalType(envTargets, isSensitive, opts) {
|
|
|
458
476
|
}
|
|
459
477
|
return "encrypted";
|
|
460
478
|
}
|
|
461
|
-
function valueForNextCommand(value) {
|
|
462
|
-
if (!/[\s'"\\]/.test(value))
|
|
463
|
-
return value;
|
|
464
|
-
return `"${value.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
465
|
-
}
|
|
466
479
|
function fillEnvAddTemplate(template, opts) {
|
|
467
480
|
const targetPlaceholder = getEnvTargetPlaceholder();
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
481
|
+
const out = template.replace(/<name>/g, opts.envName ?? "<name>").split(targetPlaceholder).join(opts.envTargetArg ?? targetPlaceholder).replace(/<gitbranch>/g, opts.envGitBranch ?? "<gitbranch>");
|
|
482
|
+
return out.replace(/<value>/g, "<value>");
|
|
483
|
+
}
|
|
484
|
+
function redactEnvValueArgs(argv) {
|
|
485
|
+
const redacted = [...argv];
|
|
486
|
+
for (let i = 0; i < redacted.length; i++) {
|
|
487
|
+
if (redacted[i] === "--value" && i + 1 < redacted.length) {
|
|
488
|
+
redacted[i + 1] = '"<value>"';
|
|
489
|
+
i++;
|
|
490
|
+
} else if (redacted[i].startsWith("--value=")) {
|
|
491
|
+
redacted[i] = '--value="<value>"';
|
|
492
|
+
}
|
|
473
493
|
}
|
|
474
|
-
return
|
|
494
|
+
return redacted;
|
|
495
|
+
}
|
|
496
|
+
function projectLabel(link) {
|
|
497
|
+
return `${link.org.slug}/${link.project.name}`;
|
|
498
|
+
}
|
|
499
|
+
function formatEnvironmentTarget(target, customEnvironments) {
|
|
500
|
+
const standardTarget = envTargetChoices.find(
|
|
501
|
+
(choice) => choice.value === target
|
|
502
|
+
);
|
|
503
|
+
if (standardTarget) {
|
|
504
|
+
return standardTarget.name;
|
|
505
|
+
}
|
|
506
|
+
const customEnvironment = customEnvironments.find(
|
|
507
|
+
(env) => env.id === target || env.slug === target
|
|
508
|
+
);
|
|
509
|
+
return customEnvironment?.slug ?? target;
|
|
510
|
+
}
|
|
511
|
+
function formatEnvironmentTargets(envTargets, customEnvironments) {
|
|
512
|
+
return envTargets.map((target) => formatEnvironmentTarget(target, customEnvironments)).join(", ");
|
|
513
|
+
}
|
|
514
|
+
function typeLabel(type) {
|
|
515
|
+
return type === "sensitive" ? "Sensitive" : "Non-sensitive";
|
|
516
|
+
}
|
|
517
|
+
function printEnvAddResult(link, envName, envTargets, envGitBranch, customEnvironments, finalType, force) {
|
|
518
|
+
output_manager_default.print("\n");
|
|
519
|
+
printAlignedLabel(force ? "Overrode" : "Added", envName, { gutter: "\u2713" });
|
|
520
|
+
printAlignedLabel("Project", projectLabel(link));
|
|
521
|
+
printAlignedLabel(
|
|
522
|
+
"Environments",
|
|
523
|
+
formatEnvironmentTargets(envTargets, customEnvironments)
|
|
524
|
+
);
|
|
525
|
+
if (envGitBranch) {
|
|
526
|
+
printAlignedLabel("Branch", envGitBranch);
|
|
527
|
+
}
|
|
528
|
+
printAlignedLabel("Type", typeLabel(finalType));
|
|
529
|
+
}
|
|
530
|
+
function printEnvAddWarning(message) {
|
|
531
|
+
output_manager_default.print(`${import_chalk.default.yellow("!")} ${message}
|
|
532
|
+
`);
|
|
533
|
+
}
|
|
534
|
+
function promptEnvValue(client, opts) {
|
|
535
|
+
return client.input.text({
|
|
536
|
+
message: `Value?`,
|
|
537
|
+
...opts.isSensitive ? { transformer: (value) => "*".repeat(value.length) } : {}
|
|
538
|
+
});
|
|
475
539
|
}
|
|
476
540
|
async function add(client, argv) {
|
|
477
541
|
let parsedArgs;
|
|
@@ -505,7 +569,9 @@ async function add(client, argv) {
|
|
|
505
569
|
telemetryClient.trackCliArgumentName(envName);
|
|
506
570
|
telemetryClient.trackCliArgumentEnvironment(envTargetArg);
|
|
507
571
|
telemetryClient.trackCliArgumentGitBranch(envGitBranch);
|
|
508
|
-
telemetryClient.trackCliOptionValue(
|
|
572
|
+
telemetryClient.trackCliOptionValue(
|
|
573
|
+
valueFromFlag === void 0 ? void 0 : "<redacted>"
|
|
574
|
+
);
|
|
509
575
|
telemetryClient.trackCliFlagSensitive(opts["--sensitive"]);
|
|
510
576
|
telemetryClient.trackCliFlagNoSensitive(opts["--no-sensitive"]);
|
|
511
577
|
telemetryClient.trackCliFlagForce(opts["--force"]);
|
|
@@ -554,7 +620,7 @@ async function add(client, argv) {
|
|
|
554
620
|
"<scope>",
|
|
555
621
|
...linkPreserved
|
|
556
622
|
];
|
|
557
|
-
let envAddRetryArgv = client.argv;
|
|
623
|
+
let envAddRetryArgv = redactEnvValueArgs(client.argv);
|
|
558
624
|
if (envTargetArg === "preview" && envGitBranch === void 0) {
|
|
559
625
|
const argvArgs = client.argv.slice(2);
|
|
560
626
|
const addIdx = argvArgs.indexOf("add");
|
|
@@ -566,11 +632,11 @@ async function add(client, argv) {
|
|
|
566
632
|
pos++;
|
|
567
633
|
}
|
|
568
634
|
const insertAt = 2 + pos;
|
|
569
|
-
envAddRetryArgv = [
|
|
635
|
+
envAddRetryArgv = redactEnvValueArgs([
|
|
570
636
|
...client.argv.slice(0, insertAt),
|
|
571
637
|
"<gitbranch>",
|
|
572
638
|
...client.argv.slice(insertAt)
|
|
573
|
-
];
|
|
639
|
+
]);
|
|
574
640
|
}
|
|
575
641
|
}
|
|
576
642
|
outputAgentError(
|
|
@@ -644,11 +710,10 @@ async function add(client, argv) {
|
|
|
644
710
|
return "third argument <gitbranch> for Preview, or omit for all Preview branches";
|
|
645
711
|
return m;
|
|
646
712
|
});
|
|
647
|
-
const fullTemplate = `env add <name> ${getEnvTargetPlaceholder()} <gitbranch> --value <value> --yes`;
|
|
713
|
+
const fullTemplate = `env add <name> ${getEnvTargetPlaceholder()} <gitbranch> --value "<value>" --yes`;
|
|
648
714
|
const filledTemplate = fillEnvAddTemplate(fullTemplate, {
|
|
649
715
|
envName,
|
|
650
716
|
envTargetArg,
|
|
651
|
-
valueFromFlag,
|
|
652
717
|
envGitBranch
|
|
653
718
|
});
|
|
654
719
|
const next = [];
|
|
@@ -663,12 +728,12 @@ async function add(client, argv) {
|
|
|
663
728
|
}
|
|
664
729
|
if (missing.includes("git_branch_required") && envName && (valueFromFlag !== void 0 || stdInput)) {
|
|
665
730
|
const branchSpecific = fillEnvAddTemplate(
|
|
666
|
-
|
|
667
|
-
{ envName, envTargetArg: "preview"
|
|
731
|
+
'env add <name> preview <gitbranch> --value "<value>" --yes',
|
|
732
|
+
{ envName, envTargetArg: "preview" }
|
|
668
733
|
);
|
|
669
734
|
const branchAll = fillEnvAddTemplate(
|
|
670
|
-
|
|
671
|
-
{ envName, envTargetArg: "preview"
|
|
735
|
+
'env add <name> preview --value "<value>" --yes',
|
|
736
|
+
{ envName, envTargetArg: "preview" }
|
|
672
737
|
);
|
|
673
738
|
next.push(
|
|
674
739
|
{
|
|
@@ -702,7 +767,7 @@ async function add(client, argv) {
|
|
|
702
767
|
}
|
|
703
768
|
if (!envName) {
|
|
704
769
|
envName = await client.input.text({
|
|
705
|
-
message: `
|
|
770
|
+
message: `Name?`,
|
|
706
771
|
validate: (val) => val ? true : "Name cannot be empty"
|
|
707
772
|
});
|
|
708
773
|
}
|
|
@@ -714,7 +779,7 @@ async function add(client, argv) {
|
|
|
714
779
|
const sensitiveWarning = keyWarnings.find((w) => w.requiresConfirmation);
|
|
715
780
|
if (!sensitiveWarning) {
|
|
716
781
|
for (const w of keyWarnings) {
|
|
717
|
-
|
|
782
|
+
printEnvAddWarning(w.message);
|
|
718
783
|
}
|
|
719
784
|
keyAccepted = true;
|
|
720
785
|
break;
|
|
@@ -733,14 +798,14 @@ async function add(client, argv) {
|
|
|
733
798
|
{
|
|
734
799
|
command: buildEnvAddCommandWithPreservedArgs(
|
|
735
800
|
client.argv,
|
|
736
|
-
`env add ${envName} ${getEnvTargetPlaceholder()} --value <value> --yes`
|
|
801
|
+
`env add ${envName} ${getEnvTargetPlaceholder()} --value "<value>" --yes`
|
|
737
802
|
),
|
|
738
803
|
when: "Leave as is"
|
|
739
804
|
},
|
|
740
805
|
{
|
|
741
806
|
command: buildEnvAddCommandWithPreservedArgs(
|
|
742
807
|
client.argv,
|
|
743
|
-
`env add ${nameWithoutPrefix2} ${getEnvTargetPlaceholder()} --value <value> --yes`
|
|
808
|
+
`env add ${nameWithoutPrefix2} ${getEnvTargetPlaceholder()} --value "<value>" --yes`
|
|
744
809
|
),
|
|
745
810
|
when: "Rename"
|
|
746
811
|
}
|
|
@@ -748,16 +813,16 @@ async function add(client, argv) {
|
|
|
748
813
|
});
|
|
749
814
|
}
|
|
750
815
|
for (const w of keyWarnings) {
|
|
751
|
-
|
|
816
|
+
printEnvAddWarning(w.message);
|
|
752
817
|
}
|
|
753
818
|
const nameWithoutPrefix = removePublicPrefix(envName);
|
|
754
819
|
const choices2 = [
|
|
755
|
-
{ name:
|
|
820
|
+
{ name: `Keep ${envName}`, value: "c" },
|
|
756
821
|
{ name: `Rename to ${nameWithoutPrefix}`, value: "p" },
|
|
757
|
-
{ name: "Re-enter", value: "r" }
|
|
822
|
+
{ name: "Re-enter name", value: "r" }
|
|
758
823
|
];
|
|
759
824
|
const action = await client.input.select({
|
|
760
|
-
message: "
|
|
825
|
+
message: "Variable name?",
|
|
761
826
|
choices: choices2
|
|
762
827
|
});
|
|
763
828
|
if (action === "c") {
|
|
@@ -767,7 +832,7 @@ async function add(client, argv) {
|
|
|
767
832
|
output_manager_default.log(`Renamed to ${envName}`);
|
|
768
833
|
} else {
|
|
769
834
|
envName = await client.input.text({
|
|
770
|
-
message: `
|
|
835
|
+
message: `Name?`,
|
|
771
836
|
validate: (val) => val ? true : "Name cannot be empty"
|
|
772
837
|
});
|
|
773
838
|
}
|
|
@@ -775,7 +840,7 @@ async function add(client, argv) {
|
|
|
775
840
|
} else {
|
|
776
841
|
const keyWarnings = getEnvKeyWarnings(envName);
|
|
777
842
|
for (const w of keyWarnings) {
|
|
778
|
-
|
|
843
|
+
printEnvAddWarning(w.message);
|
|
779
844
|
}
|
|
780
845
|
}
|
|
781
846
|
const link = await getLinkedProject(client);
|
|
@@ -799,7 +864,7 @@ async function add(client, argv) {
|
|
|
799
864
|
...link.status === "not_linked" ? ["--scope", "<scope>"] : [],
|
|
800
865
|
...linkPreserved
|
|
801
866
|
];
|
|
802
|
-
let envAddRetryArgv = client.argv;
|
|
867
|
+
let envAddRetryArgv = redactEnvValueArgs(client.argv);
|
|
803
868
|
if (envTargetArg === "preview" && envGitBranch === void 0) {
|
|
804
869
|
const argvArgs = client.argv.slice(2);
|
|
805
870
|
const addIdx = argvArgs.indexOf("add");
|
|
@@ -811,11 +876,11 @@ async function add(client, argv) {
|
|
|
811
876
|
pos++;
|
|
812
877
|
}
|
|
813
878
|
const insertAt = 2 + pos;
|
|
814
|
-
envAddRetryArgv = [
|
|
879
|
+
envAddRetryArgv = redactEnvValueArgs([
|
|
815
880
|
...client.argv.slice(0, insertAt),
|
|
816
881
|
"<gitbranch>",
|
|
817
882
|
...client.argv.slice(insertAt)
|
|
818
|
-
];
|
|
883
|
+
]);
|
|
819
884
|
}
|
|
820
885
|
}
|
|
821
886
|
outputAgentError(
|
|
@@ -908,16 +973,24 @@ async function add(client, argv) {
|
|
|
908
973
|
} else if (skipSensitivePrompt) {
|
|
909
974
|
isSensitive = true;
|
|
910
975
|
} else {
|
|
911
|
-
output_manager_default.log(
|
|
912
|
-
`Sensitive values cannot be retrieved later from the dashboard or CLI.`
|
|
913
|
-
);
|
|
914
976
|
isSensitive = await client.input.confirm(SENSITIVE_SECRET_PROMPT, true);
|
|
915
977
|
if (policyOn && !isSensitive) {
|
|
916
|
-
output_manager_default.
|
|
917
|
-
`
|
|
978
|
+
output_manager_default.print(
|
|
979
|
+
` ${import_chalk.default.dim(
|
|
980
|
+
"Team policy limits non-sensitive values to Development."
|
|
981
|
+
)}
|
|
982
|
+
`
|
|
918
983
|
);
|
|
919
984
|
}
|
|
920
985
|
}
|
|
986
|
+
if (!client.nonInteractive && skipSensitivePrompt && policyOn && !isSensitive && envTargets.length === 0) {
|
|
987
|
+
output_manager_default.print(
|
|
988
|
+
` ${import_chalk.default.dim(
|
|
989
|
+
"Team policy limits non-sensitive values to Development."
|
|
990
|
+
)}
|
|
991
|
+
`
|
|
992
|
+
);
|
|
993
|
+
}
|
|
921
994
|
if (forceSensitive && envTargets.includes("development")) {
|
|
922
995
|
const msg = `--sensitive is not allowed with the Development Environment. Sensitive Environment Variables are only supported on Production and Preview.`;
|
|
923
996
|
if (client.nonInteractive) {
|
|
@@ -989,42 +1062,26 @@ async function add(client, argv) {
|
|
|
989
1062
|
outputActionRequired(client, {
|
|
990
1063
|
status: "action_required",
|
|
991
1064
|
reason: "missing_value",
|
|
992
|
-
message:
|
|
1065
|
+
message: 'In non-interactive mode provide the value via --value or stdin. Example: vercel env add <name> <environment> --value "<value>" --yes',
|
|
993
1066
|
next: [
|
|
994
1067
|
{
|
|
995
1068
|
command: buildEnvAddCommandWithPreservedArgs(
|
|
996
1069
|
client.argv,
|
|
997
|
-
`env add <name> ${getEnvTargetPlaceholder()} --value <value> --yes`
|
|
1070
|
+
`env add <name> ${getEnvTargetPlaceholder()} --value "<value>" --yes`
|
|
998
1071
|
)
|
|
999
1072
|
}
|
|
1000
1073
|
]
|
|
1001
1074
|
});
|
|
1002
1075
|
}
|
|
1003
|
-
|
|
1004
|
-
envValue = await client.input.password({
|
|
1005
|
-
message: `What's the value of ${envName}?`,
|
|
1006
|
-
mask: true
|
|
1007
|
-
});
|
|
1008
|
-
} else {
|
|
1009
|
-
envValue = await client.input.text({
|
|
1010
|
-
message: `What's the value of ${envName}?`,
|
|
1011
|
-
validate: (val) => val ? true : "Value cannot be empty"
|
|
1012
|
-
});
|
|
1013
|
-
}
|
|
1076
|
+
envValue = await promptEnvValue(client, { isSensitive });
|
|
1014
1077
|
}
|
|
1015
1078
|
const { finalValue } = await validateEnvValue({
|
|
1016
1079
|
envName,
|
|
1017
1080
|
initialValue: envValue,
|
|
1018
1081
|
skipConfirm,
|
|
1019
|
-
promptForValue: () => isSensitive
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
}) : client.input.text({
|
|
1023
|
-
message: `What's the value of ${envName}?`,
|
|
1024
|
-
validate: (val) => val ? true : "Value cannot be empty"
|
|
1025
|
-
}),
|
|
1026
|
-
selectAction: (choices2) => client.input.select({ message: "How to proceed?", choices: choices2 }),
|
|
1027
|
-
showWarning: (msg) => output_manager_default.warn(msg),
|
|
1082
|
+
promptForValue: () => promptEnvValue(client, { isSensitive }),
|
|
1083
|
+
selectAction: (choices2) => client.input.select({ message: "Value?", choices: choices2 }),
|
|
1084
|
+
showWarning: (msg) => printEnvAddWarning(msg),
|
|
1028
1085
|
showLog: (msg) => output_manager_default.log(msg)
|
|
1029
1086
|
});
|
|
1030
1087
|
while (envTargets.length === 0) {
|
|
@@ -1034,7 +1091,7 @@ async function add(client, argv) {
|
|
|
1034
1091
|
reason: "missing_environment",
|
|
1035
1092
|
message: `Specify at least one environment. Add as argument or use: ${buildEnvAddCommandWithPreservedArgs(
|
|
1036
1093
|
client.argv,
|
|
1037
|
-
`env add ${envName} <environment> --value <value> --yes`
|
|
1094
|
+
`env add ${envName} <environment> --value "<value>" --yes`
|
|
1038
1095
|
)}`,
|
|
1039
1096
|
choices: envChoices.map((c) => ({
|
|
1040
1097
|
id: c.value,
|
|
@@ -1043,13 +1100,14 @@ async function add(client, argv) {
|
|
|
1043
1100
|
next: envChoices.slice(0, 5).map((c) => ({
|
|
1044
1101
|
command: buildEnvAddCommandWithPreservedArgs(
|
|
1045
1102
|
client.argv,
|
|
1046
|
-
`env add ${envName} ${c.value} --value <value> --yes`
|
|
1103
|
+
`env add ${envName} ${c.value} --value "<value>" --yes`
|
|
1047
1104
|
)
|
|
1048
1105
|
}))
|
|
1049
1106
|
});
|
|
1050
1107
|
}
|
|
1051
1108
|
envTargets = await client.input.checkbox({
|
|
1052
|
-
message: `
|
|
1109
|
+
message: `Environments?`,
|
|
1110
|
+
instructions: CHECKBOX_INSTRUCTIONS,
|
|
1053
1111
|
choices: envChoices
|
|
1054
1112
|
});
|
|
1055
1113
|
if (envTargets.length === 0) {
|
|
@@ -1065,7 +1123,7 @@ async function add(client, argv) {
|
|
|
1065
1123
|
output_manager_default.error(postSelectionError);
|
|
1066
1124
|
return 1;
|
|
1067
1125
|
}
|
|
1068
|
-
if (envGitBranch === void 0 && envTargets.length === 1 && envTargets[0] === "preview") {
|
|
1126
|
+
if (envGitBranch === void 0 && envTargets.length === 1 && envTargets[0] === "preview" && !(client.nonInteractive && args.length === 2)) {
|
|
1069
1127
|
if (client.nonInteractive) {
|
|
1070
1128
|
outputActionRequired(
|
|
1071
1129
|
client,
|
|
@@ -1077,14 +1135,14 @@ async function add(client, argv) {
|
|
|
1077
1135
|
{
|
|
1078
1136
|
command: buildEnvAddCommandWithPreservedArgs(
|
|
1079
1137
|
client.argv,
|
|
1080
|
-
`env add ${envName} preview <gitbranch> --value <value> --yes`
|
|
1138
|
+
`env add ${envName} preview <gitbranch> --value "<value>" --yes`
|
|
1081
1139
|
),
|
|
1082
1140
|
when: "Add to a specific Git branch"
|
|
1083
1141
|
},
|
|
1084
1142
|
{
|
|
1085
1143
|
command: buildEnvAddCommandWithPreservedArgs(
|
|
1086
1144
|
client.argv,
|
|
1087
|
-
`env add ${envName} preview --value <value> --yes`
|
|
1145
|
+
`env add ${envName} preview --value "<value>" --yes`
|
|
1088
1146
|
),
|
|
1089
1147
|
when: "Add to all Preview branches"
|
|
1090
1148
|
}
|
|
@@ -1093,8 +1151,12 @@ async function add(client, argv) {
|
|
|
1093
1151
|
1
|
|
1094
1152
|
);
|
|
1095
1153
|
} else {
|
|
1154
|
+
output_manager_default.print(
|
|
1155
|
+
` ${import_chalk.default.dim("Leave empty to apply to all Preview branches.")}
|
|
1156
|
+
`
|
|
1157
|
+
);
|
|
1096
1158
|
envGitBranch = await client.input.text({
|
|
1097
|
-
message: `
|
|
1159
|
+
message: `Git branch?`
|
|
1098
1160
|
});
|
|
1099
1161
|
}
|
|
1100
1162
|
}
|
|
@@ -1106,16 +1168,15 @@ async function add(client, argv) {
|
|
|
1106
1168
|
});
|
|
1107
1169
|
if (policyOn && !hasDevelopment) {
|
|
1108
1170
|
if (forceEncrypted) {
|
|
1109
|
-
|
|
1171
|
+
printEnvAddWarning(
|
|
1110
1172
|
`--no-sensitive is ignored: your team enforces sensitive Environment Variables for Production and Preview.`
|
|
1111
1173
|
);
|
|
1112
1174
|
finalType = "sensitive";
|
|
1113
1175
|
}
|
|
1114
1176
|
}
|
|
1115
1177
|
const upsert = opts["--force"] ? "true" : "";
|
|
1116
|
-
const addStamp = stamp_default();
|
|
1117
1178
|
try {
|
|
1118
|
-
output_manager_default.spinner("Saving");
|
|
1179
|
+
output_manager_default.spinner("Saving\u2026");
|
|
1119
1180
|
await addEnvRecord(
|
|
1120
1181
|
client,
|
|
1121
1182
|
project.id,
|
|
@@ -1145,14 +1206,14 @@ async function add(client, argv) {
|
|
|
1145
1206
|
}
|
|
1146
1207
|
throw err;
|
|
1147
1208
|
}
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1209
|
+
printEnvAddResult(
|
|
1210
|
+
link,
|
|
1211
|
+
envName,
|
|
1212
|
+
envTargets,
|
|
1213
|
+
envGitBranch,
|
|
1214
|
+
customEnvironments,
|
|
1215
|
+
finalType,
|
|
1216
|
+
Boolean(opts["--force"])
|
|
1156
1217
|
);
|
|
1157
1218
|
const { isAgent } = await determineAgent();
|
|
1158
1219
|
const guidanceMode = parsedArgs.flags["--guidance"] ?? isAgent;
|
|
@@ -1675,7 +1736,7 @@ async function run(client) {
|
|
|
1675
1736
|
flags: parsedArgs.flags
|
|
1676
1737
|
}) || "development";
|
|
1677
1738
|
const gitBranch = parsedArgs.flags["--git-branch"];
|
|
1678
|
-
output_manager_default.spinner(`Downloading \`${environment}\`
|
|
1739
|
+
output_manager_default.spinner(`Downloading \`${environment}\` environment variables`);
|
|
1679
1740
|
const records = await pullEnvRecords(
|
|
1680
1741
|
client,
|
|
1681
1742
|
link.project.id,
|
|
@@ -11,45 +11,45 @@ import {
|
|
|
11
11
|
addSubcommand7 as addSubcommand,
|
|
12
12
|
getCommandAliases,
|
|
13
13
|
linkCommand
|
|
14
|
-
} from "../../chunks/chunk-
|
|
15
|
-
import "../../chunks/chunk-
|
|
16
|
-
import "../../chunks/chunk-
|
|
17
|
-
import "../../chunks/chunk-
|
|
18
|
-
import "../../chunks/chunk-
|
|
19
|
-
import "../../chunks/chunk-
|
|
20
|
-
import "../../chunks/chunk-
|
|
21
|
-
import "../../chunks/chunk-
|
|
14
|
+
} from "../../chunks/chunk-O7RJHL34.js";
|
|
15
|
+
import "../../chunks/chunk-ILJH44MK.js";
|
|
16
|
+
import "../../chunks/chunk-IB56QKCM.js";
|
|
17
|
+
import "../../chunks/chunk-DPS62LHL.js";
|
|
18
|
+
import "../../chunks/chunk-SGPBULVT.js";
|
|
19
|
+
import "../../chunks/chunk-VKRW77HH.js";
|
|
20
|
+
import "../../chunks/chunk-56AJHIQC.js";
|
|
21
|
+
import "../../chunks/chunk-IJJOI63T.js";
|
|
22
22
|
import {
|
|
23
23
|
ensureLink
|
|
24
|
-
} from "../../chunks/chunk-
|
|
25
|
-
import "../../chunks/chunk-
|
|
24
|
+
} from "../../chunks/chunk-YLGMXYFG.js";
|
|
25
|
+
import "../../chunks/chunk-372SHB43.js";
|
|
26
26
|
import "../../chunks/chunk-LJ5WXXG6.js";
|
|
27
|
-
import "../../chunks/chunk-
|
|
28
|
-
import "../../chunks/chunk-
|
|
27
|
+
import "../../chunks/chunk-4BFK3C7V.js";
|
|
28
|
+
import "../../chunks/chunk-SDZ5ICZL.js";
|
|
29
29
|
import {
|
|
30
30
|
detectExplicitScope,
|
|
31
31
|
getScope
|
|
32
|
-
} from "../../chunks/chunk-
|
|
32
|
+
} from "../../chunks/chunk-G3NXHUFT.js";
|
|
33
33
|
import {
|
|
34
34
|
help
|
|
35
|
-
} from "../../chunks/chunk-
|
|
35
|
+
} from "../../chunks/chunk-AWD3IGXU.js";
|
|
36
36
|
import {
|
|
37
37
|
addRepoLink,
|
|
38
38
|
autoInstallVercelPlugin,
|
|
39
39
|
ensureRepoLink
|
|
40
|
-
} from "../../chunks/chunk-
|
|
40
|
+
} from "../../chunks/chunk-LQR3CHMH.js";
|
|
41
41
|
import {
|
|
42
42
|
TelemetryClient
|
|
43
|
-
} from "../../chunks/chunk-
|
|
43
|
+
} from "../../chunks/chunk-HIYWSGI7.js";
|
|
44
44
|
import "../../chunks/chunk-NHGCQRK5.js";
|
|
45
|
-
import "../../chunks/chunk-CO5D46AG.js";
|
|
46
45
|
import "../../chunks/chunk-N2T234LO.js";
|
|
47
|
-
import "../../chunks/chunk-
|
|
46
|
+
import "../../chunks/chunk-GGP5R3FU.js";
|
|
47
|
+
import "../../chunks/chunk-LYCSVJIX.js";
|
|
48
48
|
import {
|
|
49
49
|
getFlagsSpecification,
|
|
50
50
|
parseArguments,
|
|
51
51
|
printError
|
|
52
|
-
} from "../../chunks/chunk-
|
|
52
|
+
} from "../../chunks/chunk-MYWLF3BZ.js";
|
|
53
53
|
import {
|
|
54
54
|
cmd
|
|
55
55
|
} from "../../chunks/chunk-LN6B7ZI3.js";
|
|
@@ -20,42 +20,44 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
formatEnvironment,
|
|
22
22
|
validateLsArgs
|
|
23
|
-
} from "../../chunks/chunk-
|
|
23
|
+
} from "../../chunks/chunk-2HN6DLIY.js";
|
|
24
24
|
import {
|
|
25
25
|
validateJsonOutput
|
|
26
26
|
} from "../../chunks/chunk-XPKWKPWA.js";
|
|
27
27
|
import {
|
|
28
28
|
listCommand
|
|
29
|
-
} from "../../chunks/chunk-
|
|
29
|
+
} from "../../chunks/chunk-IJJOI63T.js";
|
|
30
|
+
import {
|
|
31
|
+
elapsed
|
|
32
|
+
} from "../../chunks/chunk-VXYGCOKL.js";
|
|
30
33
|
import {
|
|
31
34
|
getScope
|
|
32
|
-
} from "../../chunks/chunk-
|
|
35
|
+
} from "../../chunks/chunk-G3NXHUFT.js";
|
|
33
36
|
import {
|
|
34
37
|
help
|
|
35
|
-
} from "../../chunks/chunk-
|
|
38
|
+
} from "../../chunks/chunk-AWD3IGXU.js";
|
|
36
39
|
import {
|
|
37
40
|
formatProject,
|
|
38
41
|
getLinkedProject,
|
|
39
42
|
getProjectByNameOrId,
|
|
40
43
|
parseTarget
|
|
41
|
-
} from "../../chunks/chunk-
|
|
44
|
+
} from "../../chunks/chunk-LQR3CHMH.js";
|
|
42
45
|
import {
|
|
43
46
|
TelemetryClient
|
|
44
|
-
} from "../../chunks/chunk-
|
|
47
|
+
} from "../../chunks/chunk-HIYWSGI7.js";
|
|
45
48
|
import "../../chunks/chunk-NHGCQRK5.js";
|
|
49
|
+
import "../../chunks/chunk-N2T234LO.js";
|
|
46
50
|
import {
|
|
47
|
-
elapsed,
|
|
48
51
|
require_ms
|
|
49
|
-
} from "../../chunks/chunk-
|
|
50
|
-
import "../../chunks/chunk-N2T234LO.js";
|
|
52
|
+
} from "../../chunks/chunk-GGP5R3FU.js";
|
|
51
53
|
import {
|
|
52
54
|
table
|
|
53
|
-
} from "../../chunks/chunk-
|
|
55
|
+
} from "../../chunks/chunk-LYCSVJIX.js";
|
|
54
56
|
import {
|
|
55
57
|
getFlagsSpecification,
|
|
56
58
|
parseArguments,
|
|
57
59
|
printError
|
|
58
|
-
} from "../../chunks/chunk-
|
|
60
|
+
} from "../../chunks/chunk-MYWLF3BZ.js";
|
|
59
61
|
import {
|
|
60
62
|
ProjectNotFound,
|
|
61
63
|
getCommandName,
|