vercel 54.2.0 → 54.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{add-FAIIANHS.js → add-6BI52GC7.js} +8 -8
- package/dist/chunks/{chunk-2OASKDFC.js → chunk-3NTROBCB.js} +7 -4
- package/dist/chunks/{chunk-XVAEOG4L.js → chunk-3TDGMELF.js} +3 -5
- package/dist/chunks/{chunk-KSMF2UFR.js → chunk-4CIXZOP4.js} +15 -0
- package/dist/chunks/{chunk-O2NXGZCW.js → chunk-4KGRBMBC.js} +8 -8
- package/dist/chunks/{chunk-JFVGRFME.js → chunk-5EKBCYHA.js} +1 -1
- package/dist/chunks/{chunk-ISJJTUJZ.js → chunk-5TTQBT67.js} +1 -1
- package/dist/chunks/{chunk-IYP3534A.js → chunk-63MSANDD.js} +14 -10
- package/dist/chunks/{chunk-JQ7RG6JF.js → chunk-7UDM3VHD.js} +1 -1
- package/dist/chunks/{chunk-QH5Q2B4F.js → chunk-AKWLMA5B.js} +1 -1
- package/dist/chunks/{chunk-C5YP6KFI.js → chunk-AOJHEPS4.js} +6 -0
- package/dist/chunks/{chunk-QAA3JVFJ.js → chunk-B3RJGSB2.js} +2 -2
- package/dist/chunks/{chunk-ZAAKSLHC.js → chunk-C2V6DCWN.js} +4 -2
- package/dist/chunks/{chunk-4PSOOFYO.js → chunk-DJA3IN2X.js} +1 -1
- package/dist/chunks/{chunk-YNHUUJTK.js → chunk-EU5K7JFJ.js} +5 -5
- package/dist/chunks/{chunk-ZA4ZUW7G.js → chunk-GJI2IQHA.js} +2 -2
- package/dist/chunks/{chunk-4GQQJY5Y.js → chunk-H33IJ7OP.js} +9 -0
- package/dist/chunks/{chunk-23UWSHRQ.js → chunk-HFVP2JUO.js} +133 -63
- package/dist/chunks/{chunk-E3NE4SKN.js → chunk-L6Q2EQPI.js} +1 -0
- package/dist/chunks/{chunk-DKD6GTQT.js → chunk-OM5Z2KO5.js} +1 -1
- package/dist/chunks/{chunk-TWVG3QHM.js → chunk-PU4PEBGY.js} +1 -1
- package/dist/chunks/{chunk-VKQT3HCH.js → chunk-PXR6WCEU.js} +5 -5
- package/dist/chunks/{chunk-QEYYWOB4.js → chunk-R6QYB2GK.js} +13 -3
- package/dist/chunks/{chunk-FKUVFVT2.js → chunk-RNIZUKES.js} +120 -59
- package/dist/chunks/{chunk-E32QX22S.js → chunk-SJAFZ3UZ.js} +65 -5
- package/dist/chunks/{chunk-YE6OHHJA.js → chunk-SRLTKHXQ.js} +6 -6
- package/dist/chunks/{chunk-2DFWEDF7.js → chunk-SRVNEJVN.js} +2 -2
- package/dist/chunks/{chunk-DP5346AR.js → chunk-SXYVZF6H.js} +3 -3
- package/dist/chunks/{chunk-TZMIHH5D.js → chunk-TM2USC5N.js} +6 -11
- package/dist/chunks/{chunk-H7ZZXKJ2.js → chunk-TTOZFGDX.js} +3 -3
- package/dist/chunks/{chunk-J7RPHYNB.js → chunk-W64ECC2K.js} +1 -1
- package/dist/chunks/{chunk-IFATV36R.js → chunk-YAOSNCGO.js} +5 -8
- package/dist/chunks/{chunk-CQANJIEC.js → chunk-YP423QYK.js} +4 -6
- package/dist/chunks/{chunk-DIWRR5Y4.js → chunk-ZCMQ43RC.js} +1 -1
- package/dist/chunks/{chunk-ZFEECTPC.js → chunk-ZUK6C2UA.js} +1 -1
- package/dist/chunks/{compile-vercel-config-7TPMRTKM.js → compile-vercel-config-UTUECEB5.js} +3 -3
- package/dist/chunks/{delete-MVQKJDRS.js → delete-FML7PGMQ.js} +6 -6
- package/dist/chunks/{disable-YRONTYDS.js → disable-LJFGBJQD.js} +6 -6
- package/dist/chunks/{discard-UM7Y2PMF.js → discard-JKLUB56V.js} +6 -6
- package/dist/chunks/{edit-PHXJMLL2.js → edit-24LNAGLI.js} +8 -8
- package/dist/chunks/{enable-D26FR2VL.js → enable-XV6WCSRR.js} +6 -6
- package/dist/chunks/{export-YLMQTP7Y.js → export-IZAJQNHO.js} +6 -6
- package/dist/chunks/{inspect-SJTJNJVL.js → inspect-4OYBTMEZ.js} +10 -10
- package/dist/chunks/{list-XGSNQW5B.js → list-FOLL3X7L.js} +9 -9
- package/dist/chunks/{list-6OV7HAO4.js → list-PEXOOVJA.js} +5 -5
- package/dist/chunks/{ls-THDT5E4M.js → ls-3D5FA5CD.js} +8 -8
- package/dist/chunks/{publish-NPM5RPLV.js → publish-FV5R2JPI.js} +6 -6
- package/dist/chunks/{query-QP5JLBXI.js → query-JM422UQL.js} +6 -6
- package/dist/chunks/{reorder-573FHW5Z.js → reorder-H5VPRRYP.js} +6 -6
- package/dist/chunks/{restore-H65BVJFL.js → restore-JPFHV2E2.js} +6 -6
- package/dist/chunks/{rm-MOVL4G2Y.js → rm-AQFIGZB7.js} +8 -8
- package/dist/chunks/{routes-I74KWX7Q.js → routes-IBID4NSZ.js} +2 -2
- package/dist/chunks/{rule-inspect-33M2FHDU.js → rule-inspect-XV56NBAE.js} +8 -8
- package/dist/chunks/{rules-KVSJYT5T.js → rules-SUXFDKPS.js} +7 -7
- package/dist/chunks/{schema-MXM7Z52O.js → schema-3I4KYWU3.js} +7 -7
- package/dist/chunks/{types-QAT6PCGL.js → types-V6KTYGWP.js} +3 -3
- package/dist/chunks/{update-CSKHHR3E.js → update-3W7ETGXO.js} +8 -8
- package/dist/commands/build/index.js +80 -22
- package/dist/commands/deploy/index.js +32 -26
- package/dist/commands/dev/index.js +26 -13
- package/dist/commands/env/index.js +18 -22
- package/dist/commands/link/index.js +22 -29
- package/dist/commands/list/index.js +10 -10
- package/dist/commands-bulk.js +1356 -429
- package/dist/index.js +31 -21
- package/dist/version.mjs +1 -1
- package/package.json +16 -16
package/dist/commands-bulk.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
RoutesAddTelemetryClient,
|
|
12
12
|
RoutesTelemetryClient
|
|
13
|
-
} from "./chunks/chunk-
|
|
13
|
+
} from "./chunks/chunk-ZCMQ43RC.js";
|
|
14
14
|
import {
|
|
15
15
|
ALL_ACTION_CHOICES,
|
|
16
16
|
MAX_CONDITIONS,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
runInteractiveEditLoop,
|
|
32
32
|
stripQuotes,
|
|
33
33
|
validateActionFlags
|
|
34
|
-
} from "./chunks/chunk-
|
|
34
|
+
} from "./chunks/chunk-ZUK6C2UA.js";
|
|
35
35
|
import {
|
|
36
36
|
getRouteVersions
|
|
37
37
|
} from "./chunks/chunk-AHU7WNL2.js";
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
parsePosition,
|
|
49
49
|
parseSubcommandArgs,
|
|
50
50
|
withGlobalFlags
|
|
51
|
-
} from "./chunks/chunk-
|
|
51
|
+
} from "./chunks/chunk-SXYVZF6H.js";
|
|
52
52
|
import {
|
|
53
53
|
normalizeRepeatableStringFilters
|
|
54
54
|
} from "./chunks/chunk-HTOH3MSD.js";
|
|
@@ -64,11 +64,11 @@ import {
|
|
|
64
64
|
resolveOpenApiTagForTeamsCli,
|
|
65
65
|
setAutoUpdate,
|
|
66
66
|
tryOpenApiFallback
|
|
67
|
-
} from "./chunks/chunk-
|
|
67
|
+
} from "./chunks/chunk-SRLTKHXQ.js";
|
|
68
68
|
import {
|
|
69
69
|
getUpdateCommand,
|
|
70
70
|
isGlobal
|
|
71
|
-
} from "./chunks/chunk-
|
|
71
|
+
} from "./chunks/chunk-5TTQBT67.js";
|
|
72
72
|
import {
|
|
73
73
|
Now,
|
|
74
74
|
collectContactInformation,
|
|
@@ -89,8 +89,9 @@ import {
|
|
|
89
89
|
require_format,
|
|
90
90
|
require_jsonlines,
|
|
91
91
|
setupDomain
|
|
92
|
-
} from "./chunks/chunk-
|
|
92
|
+
} from "./chunks/chunk-4KGRBMBC.js";
|
|
93
93
|
import {
|
|
94
|
+
getGlobalPathConfig,
|
|
94
95
|
processRevocationResponse,
|
|
95
96
|
readLocalConfig,
|
|
96
97
|
require_open,
|
|
@@ -98,18 +99,19 @@ import {
|
|
|
98
99
|
sleep,
|
|
99
100
|
writeToAuthConfigFile,
|
|
100
101
|
writeToConfigFile
|
|
101
|
-
} from "./chunks/chunk-
|
|
102
|
+
} from "./chunks/chunk-PXR6WCEU.js";
|
|
102
103
|
import "./chunks/chunk-V5P25P7F.js";
|
|
103
104
|
import {
|
|
105
|
+
ellipsis,
|
|
104
106
|
getCustomEnvironments,
|
|
105
107
|
getInvalidSubcommand,
|
|
106
108
|
pickCustomEnvironment,
|
|
107
109
|
readStandardInput,
|
|
108
110
|
require_dist as require_dist4
|
|
109
|
-
} from "./chunks/chunk-
|
|
111
|
+
} from "./chunks/chunk-AOJHEPS4.js";
|
|
110
112
|
import {
|
|
111
113
|
formatTable
|
|
112
|
-
} from "./chunks/chunk-
|
|
114
|
+
} from "./chunks/chunk-SRVNEJVN.js";
|
|
113
115
|
import "./chunks/chunk-LOS7HHU3.js";
|
|
114
116
|
import {
|
|
115
117
|
isValidName
|
|
@@ -125,12 +127,12 @@ import {
|
|
|
125
127
|
import {
|
|
126
128
|
formatEnvironment,
|
|
127
129
|
validateLsArgs
|
|
128
|
-
} from "./chunks/chunk-
|
|
130
|
+
} from "./chunks/chunk-7UDM3VHD.js";
|
|
129
131
|
import {
|
|
130
132
|
validateJsonOutput
|
|
131
133
|
} from "./chunks/chunk-XPKWKPWA.js";
|
|
132
134
|
import {
|
|
133
|
-
getSubcommand as
|
|
135
|
+
getSubcommand as getSubcommand5
|
|
134
136
|
} from "./chunks/chunk-YPQSDAEW.js";
|
|
135
137
|
import {
|
|
136
138
|
ADDON_LABELS,
|
|
@@ -224,6 +226,7 @@ import {
|
|
|
224
226
|
getSubcommand,
|
|
225
227
|
getSubcommand2,
|
|
226
228
|
getSubcommand3,
|
|
229
|
+
getSubcommand4,
|
|
227
230
|
gitCommand,
|
|
228
231
|
guidanceCommand,
|
|
229
232
|
guideSubcommand,
|
|
@@ -360,6 +363,7 @@ import {
|
|
|
360
363
|
tokenSubcommand2,
|
|
361
364
|
tokensCommand,
|
|
362
365
|
tokensSubcommand,
|
|
366
|
+
tracesCommand,
|
|
363
367
|
transferInSubcommand,
|
|
364
368
|
updateSubcommand,
|
|
365
369
|
updateSubcommand2,
|
|
@@ -372,11 +376,11 @@ import {
|
|
|
372
376
|
webAnalyticsSubcommand,
|
|
373
377
|
webhooksCommand,
|
|
374
378
|
whoamiCommand
|
|
375
|
-
} from "./chunks/chunk-
|
|
379
|
+
} from "./chunks/chunk-HFVP2JUO.js";
|
|
376
380
|
import {
|
|
377
381
|
metricsCommand,
|
|
378
382
|
schemaSubcommand
|
|
379
|
-
} from "./chunks/chunk-
|
|
383
|
+
} from "./chunks/chunk-YAOSNCGO.js";
|
|
380
384
|
import {
|
|
381
385
|
addSubcommand as addSubcommand9,
|
|
382
386
|
deleteSubcommand,
|
|
@@ -392,12 +396,12 @@ import {
|
|
|
392
396
|
reorderSubcommand,
|
|
393
397
|
restoreSubcommand as restoreSubcommand2,
|
|
394
398
|
routesCommand
|
|
395
|
-
} from "./chunks/chunk-
|
|
399
|
+
} from "./chunks/chunk-5EKBCYHA.js";
|
|
396
400
|
import {
|
|
397
401
|
alertsCommand,
|
|
398
402
|
inspectSubcommand,
|
|
399
403
|
listSubcommand
|
|
400
|
-
} from "./chunks/chunk-
|
|
404
|
+
} from "./chunks/chunk-TM2USC5N.js";
|
|
401
405
|
import {
|
|
402
406
|
rulesAddSubcommand,
|
|
403
407
|
rulesAggregateCommand,
|
|
@@ -405,26 +409,17 @@ import {
|
|
|
405
409
|
rulesLsSubcommand,
|
|
406
410
|
rulesRmSubcommand,
|
|
407
411
|
rulesUpdateSubcommand
|
|
408
|
-
} from "./chunks/chunk-
|
|
409
|
-
import "./chunks/chunk-
|
|
412
|
+
} from "./chunks/chunk-3TDGMELF.js";
|
|
413
|
+
import "./chunks/chunk-C2V6DCWN.js";
|
|
410
414
|
import {
|
|
411
415
|
activityCommand,
|
|
412
416
|
typesSubcommand
|
|
413
|
-
} from "./chunks/chunk-
|
|
414
|
-
import
|
|
415
|
-
detectExplicitScope,
|
|
416
|
-
getScope
|
|
417
|
-
} from "./chunks/chunk-J7RPHYNB.js";
|
|
418
|
-
import "./chunks/chunk-4PSOOFYO.js";
|
|
417
|
+
} from "./chunks/chunk-YP423QYK.js";
|
|
418
|
+
import "./chunks/chunk-DJA3IN2X.js";
|
|
419
419
|
import {
|
|
420
420
|
main
|
|
421
|
-
} from "./chunks/chunk-
|
|
422
|
-
import
|
|
423
|
-
AGENT_ACTION,
|
|
424
|
-
AGENT_REASON,
|
|
425
|
-
AGENT_STATUS
|
|
426
|
-
} from "./chunks/chunk-E3NE4SKN.js";
|
|
427
|
-
import "./chunks/chunk-QH5Q2B4F.js";
|
|
421
|
+
} from "./chunks/chunk-63MSANDD.js";
|
|
422
|
+
import "./chunks/chunk-AKWLMA5B.js";
|
|
428
423
|
import {
|
|
429
424
|
ua_default
|
|
430
425
|
} from "./chunks/chunk-76ZNZKIN.js";
|
|
@@ -433,15 +428,24 @@ import {
|
|
|
433
428
|
} from "./chunks/chunk-N733ZD4W.js";
|
|
434
429
|
import {
|
|
435
430
|
ensureLink
|
|
436
|
-
} from "./chunks/chunk-
|
|
437
|
-
import "./chunks/chunk-
|
|
438
|
-
import
|
|
431
|
+
} from "./chunks/chunk-R6QYB2GK.js";
|
|
432
|
+
import "./chunks/chunk-SJAFZ3UZ.js";
|
|
433
|
+
import {
|
|
434
|
+
AGENT_ACTION,
|
|
435
|
+
AGENT_REASON,
|
|
436
|
+
AGENT_STATUS
|
|
437
|
+
} from "./chunks/chunk-L6Q2EQPI.js";
|
|
438
|
+
import "./chunks/chunk-B3RJGSB2.js";
|
|
439
439
|
import {
|
|
440
440
|
autoInstallVercelPlugin
|
|
441
|
-
} from "./chunks/chunk-
|
|
441
|
+
} from "./chunks/chunk-3NTROBCB.js";
|
|
442
|
+
import {
|
|
443
|
+
detectExplicitScope,
|
|
444
|
+
getScope
|
|
445
|
+
} from "./chunks/chunk-W64ECC2K.js";
|
|
442
446
|
import {
|
|
443
447
|
help
|
|
444
|
-
} from "./chunks/chunk-
|
|
448
|
+
} from "./chunks/chunk-TTOZFGDX.js";
|
|
445
449
|
import {
|
|
446
450
|
STANDARD_ENVIRONMENTS,
|
|
447
451
|
VERCEL_CONFIG_EXTENSIONS,
|
|
@@ -483,10 +487,10 @@ import {
|
|
|
483
487
|
resolveProjectCwd,
|
|
484
488
|
selectAndParseRemoteUrl,
|
|
485
489
|
selectOrg
|
|
486
|
-
} from "./chunks/chunk-
|
|
490
|
+
} from "./chunks/chunk-RNIZUKES.js";
|
|
487
491
|
import {
|
|
488
492
|
TelemetryClient
|
|
489
|
-
} from "./chunks/chunk-
|
|
493
|
+
} from "./chunks/chunk-4CIXZOP4.js";
|
|
490
494
|
import {
|
|
491
495
|
argvHasNonInteractive,
|
|
492
496
|
buildCommandWithGlobalFlags,
|
|
@@ -509,7 +513,7 @@ import {
|
|
|
509
513
|
} from "./chunks/chunk-N2T234LO.js";
|
|
510
514
|
import {
|
|
511
515
|
table
|
|
512
|
-
} from "./chunks/chunk-
|
|
516
|
+
} from "./chunks/chunk-OM5Z2KO5.js";
|
|
513
517
|
import {
|
|
514
518
|
GLOBAL_CLI_FLAG_NAMES,
|
|
515
519
|
getCommandNameWithGlobalFlags,
|
|
@@ -519,7 +523,7 @@ import {
|
|
|
519
523
|
globalCliFlagTakesValue,
|
|
520
524
|
parseArguments,
|
|
521
525
|
printError
|
|
522
|
-
} from "./chunks/chunk-
|
|
526
|
+
} from "./chunks/chunk-H33IJ7OP.js";
|
|
523
527
|
import {
|
|
524
528
|
APIError,
|
|
525
529
|
AliasInUse,
|
|
@@ -789,14 +793,6 @@ var ActivityTelemetryClient = class extends TelemetryClient {
|
|
|
789
793
|
});
|
|
790
794
|
}
|
|
791
795
|
}
|
|
792
|
-
trackCliOptionProject(v) {
|
|
793
|
-
if (v) {
|
|
794
|
-
this.trackCliOption({
|
|
795
|
-
option: "project",
|
|
796
|
-
value: this.redactedValue
|
|
797
|
-
});
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
796
|
trackCliFlagAll(v) {
|
|
801
797
|
if (v) {
|
|
802
798
|
this.trackCliFlag("all");
|
|
@@ -840,7 +836,7 @@ async function activity(client) {
|
|
|
840
836
|
printError(err);
|
|
841
837
|
return 1;
|
|
842
838
|
}
|
|
843
|
-
const { subcommand, subcommandOriginal } =
|
|
839
|
+
const { subcommand, subcommandOriginal } = getSubcommand5(
|
|
844
840
|
parsedArgs.args.slice(1),
|
|
845
841
|
COMMAND_CONFIG
|
|
846
842
|
);
|
|
@@ -863,7 +859,7 @@ async function activity(client) {
|
|
|
863
859
|
return 0;
|
|
864
860
|
}
|
|
865
861
|
telemetry2.trackCliSubcommandTypes(subcommandOriginal);
|
|
866
|
-
const typesFn = (await import("./chunks/types-
|
|
862
|
+
const typesFn = (await import("./chunks/types-V6KTYGWP.js")).default;
|
|
867
863
|
return typesFn(client, telemetry2);
|
|
868
864
|
}
|
|
869
865
|
default: {
|
|
@@ -873,7 +869,7 @@ async function activity(client) {
|
|
|
873
869
|
return 0;
|
|
874
870
|
}
|
|
875
871
|
telemetry2.trackCliSubcommandLs(subcommandOriginal);
|
|
876
|
-
const listFn = (await import("./chunks/list-
|
|
872
|
+
const listFn = (await import("./chunks/list-PEXOOVJA.js")).default;
|
|
877
873
|
return listFn(client, telemetry2);
|
|
878
874
|
}
|
|
879
875
|
}
|
|
@@ -1070,7 +1066,7 @@ async function apiKeys(client) {
|
|
|
1070
1066
|
return 1;
|
|
1071
1067
|
}
|
|
1072
1068
|
const subArgs = parsedArgs.args.slice(2);
|
|
1073
|
-
const { subcommand, args, subcommandOriginal } =
|
|
1069
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
1074
1070
|
subArgs,
|
|
1075
1071
|
COMMAND_CONFIG2
|
|
1076
1072
|
);
|
|
@@ -1134,7 +1130,7 @@ async function main2(client) {
|
|
|
1134
1130
|
store: client.telemetryEventStore
|
|
1135
1131
|
}
|
|
1136
1132
|
});
|
|
1137
|
-
const { subcommand, subcommandOriginal } =
|
|
1133
|
+
const { subcommand, subcommandOriginal } = getSubcommand5(
|
|
1138
1134
|
parsedArgs.args.slice(1),
|
|
1139
1135
|
COMMAND_CONFIG3
|
|
1140
1136
|
);
|
|
@@ -1209,14 +1205,6 @@ var AlertsTelemetryClient = class extends TelemetryClient {
|
|
|
1209
1205
|
});
|
|
1210
1206
|
}
|
|
1211
1207
|
}
|
|
1212
|
-
trackCliOptionProject(v) {
|
|
1213
|
-
if (v) {
|
|
1214
|
-
this.trackCliOption({
|
|
1215
|
-
option: "project",
|
|
1216
|
-
value: this.redactedValue
|
|
1217
|
-
});
|
|
1218
|
-
}
|
|
1219
|
-
}
|
|
1220
1208
|
trackCliFlagAll(v) {
|
|
1221
1209
|
if (v) {
|
|
1222
1210
|
this.trackCliFlag("all");
|
|
@@ -1296,7 +1284,7 @@ async function alerts(client) {
|
|
|
1296
1284
|
printError(err);
|
|
1297
1285
|
return 1;
|
|
1298
1286
|
}
|
|
1299
|
-
const { subcommand, args, subcommandOriginal } =
|
|
1287
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
1300
1288
|
parsedArgs.args.slice(1),
|
|
1301
1289
|
COMMAND_CONFIG4
|
|
1302
1290
|
);
|
|
@@ -1350,17 +1338,17 @@ async function alerts(client) {
|
|
|
1350
1338
|
switch (subcommand) {
|
|
1351
1339
|
case "inspect": {
|
|
1352
1340
|
telemetry2.trackCliSubcommandInspect(subcommandOriginal);
|
|
1353
|
-
const inspectFn = (await import("./chunks/inspect-
|
|
1341
|
+
const inspectFn = (await import("./chunks/inspect-4OYBTMEZ.js")).default;
|
|
1354
1342
|
return inspectFn(client, args);
|
|
1355
1343
|
}
|
|
1356
1344
|
case "rules": {
|
|
1357
1345
|
telemetry2.trackCliSubcommandRules(args[0] ?? "ls");
|
|
1358
|
-
const rulesFn = (await import("./chunks/rules-
|
|
1346
|
+
const rulesFn = (await import("./chunks/rules-SUXFDKPS.js")).default;
|
|
1359
1347
|
return rulesFn(client, args);
|
|
1360
1348
|
}
|
|
1361
1349
|
default: {
|
|
1362
1350
|
telemetry2.trackCliSubcommandLs(subcommandOriginal);
|
|
1363
|
-
const listFn = (await import("./chunks/list-
|
|
1351
|
+
const listFn = (await import("./chunks/list-FOLL3X7L.js")).default;
|
|
1364
1352
|
return listFn(client, telemetry2);
|
|
1365
1353
|
}
|
|
1366
1354
|
}
|
|
@@ -2250,7 +2238,7 @@ async function alias(client) {
|
|
|
2250
2238
|
printError(err);
|
|
2251
2239
|
return 1;
|
|
2252
2240
|
}
|
|
2253
|
-
const { subcommand, args, subcommandOriginal } =
|
|
2241
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
2254
2242
|
parsedArguments.args.slice(1),
|
|
2255
2243
|
COMMAND_CONFIG5
|
|
2256
2244
|
);
|
|
@@ -2657,7 +2645,7 @@ function getCommit(deployment) {
|
|
|
2657
2645
|
|
|
2658
2646
|
// src/commands/blob/list.ts
|
|
2659
2647
|
import * as blob from "@vercel/blob";
|
|
2660
|
-
var
|
|
2648
|
+
var import_chalk12 = __toESM(require_source(), 1);
|
|
2661
2649
|
var import_ms5 = __toESM(require_ms(), 1);
|
|
2662
2650
|
|
|
2663
2651
|
// src/util/telemetry/commands/blob/list.ts
|
|
@@ -2696,11 +2684,124 @@ var BlobListTelemetryClient = class extends TelemetryClient {
|
|
|
2696
2684
|
}
|
|
2697
2685
|
};
|
|
2698
2686
|
|
|
2687
|
+
// src/util/blob/token.ts
|
|
2688
|
+
import { resolve as resolve2 } from "path";
|
|
2689
|
+
|
|
2690
|
+
// src/util/output/list-item.ts
|
|
2691
|
+
var import_chalk11 = __toESM(require_source(), 1);
|
|
2692
|
+
var listItem = (msg, n) => {
|
|
2693
|
+
if (!n) {
|
|
2694
|
+
n = "-";
|
|
2695
|
+
}
|
|
2696
|
+
if (Number(n)) {
|
|
2697
|
+
n += ".";
|
|
2698
|
+
}
|
|
2699
|
+
return `${(0, import_chalk11.default)(n.toString())} ${msg}`;
|
|
2700
|
+
};
|
|
2701
|
+
var list_item_default = listItem;
|
|
2702
|
+
|
|
2703
|
+
// src/util/blob/token.ts
|
|
2704
|
+
function findFlagValue(argv, flag) {
|
|
2705
|
+
const eqPrefix = `${flag}=`;
|
|
2706
|
+
let result;
|
|
2707
|
+
for (let i = 0; i < argv.length; i++) {
|
|
2708
|
+
const arg = argv[i];
|
|
2709
|
+
if (arg === flag)
|
|
2710
|
+
result = argv[i + 1];
|
|
2711
|
+
else if (arg.startsWith(eqPrefix))
|
|
2712
|
+
result = arg.slice(eqPrefix.length);
|
|
2713
|
+
}
|
|
2714
|
+
return result;
|
|
2715
|
+
}
|
|
2716
|
+
var ErrorMessage = `No Vercel Blob credentials found. To fix this issue, choose one of the following options:
|
|
2717
|
+
${list_item_default(`Pass the read-write token as an option: ${getCommandName("blob list --rw-token BLOB_READ_WRITE_TOKEN")}`, 1)}
|
|
2718
|
+
${list_item_default(`Pass OIDC credentials as options: ${getCommandName("blob list --oidc-token VERCEL_OIDC_TOKEN --store-id BLOB_STORE_ID")}`, 2)}
|
|
2719
|
+
${list_item_default(`Set OIDC credentials as environment variables: ${cmd(`VERCEL_OIDC_TOKEN=... BLOB_STORE_ID=... ${packageName} blob list`)}`, 3)}
|
|
2720
|
+
${list_item_default(`Set the read-write token as an environment variable: ${cmd(`BLOB_READ_WRITE_TOKEN=BLOB_READ_WRITE_TOKEN ${packageName} blob list`)}`, 4)}
|
|
2721
|
+
${list_item_default("Link your current folder to a Vercel Project that has a Vercel Blob store connected", 5)}`;
|
|
2722
|
+
var PartialOidcFlagsErrorMessage = `--oidc-token and --store-id must be passed together. Pass both flags, or omit them and rely on environment variables / linked project credentials.`;
|
|
2723
|
+
var PartialOidcEnvErrorMessage = `VERCEL_OIDC_TOKEN and BLOB_STORE_ID must both be set, or both be unset. Set both to use OIDC, unset both to use the read-write token, or pass --rw-token / --oidc-token + --store-id explicitly.`;
|
|
2724
|
+
async function getBlobRWToken(client, argv) {
|
|
2725
|
+
const rwToken = findFlagValue(argv, "--rw-token");
|
|
2726
|
+
if (rwToken) {
|
|
2727
|
+
return { success: true, kind: "rw", token: rwToken };
|
|
2728
|
+
}
|
|
2729
|
+
const oidcTokenFlag = findFlagValue(argv, "--oidc-token");
|
|
2730
|
+
const storeIdFlag = findFlagValue(argv, "--store-id");
|
|
2731
|
+
if (oidcTokenFlag || storeIdFlag) {
|
|
2732
|
+
if (!oidcTokenFlag || !storeIdFlag) {
|
|
2733
|
+
return { success: false, error: PartialOidcFlagsErrorMessage };
|
|
2734
|
+
}
|
|
2735
|
+
return {
|
|
2736
|
+
success: true,
|
|
2737
|
+
kind: "oidc",
|
|
2738
|
+
oidcToken: oidcTokenFlag,
|
|
2739
|
+
storeId: storeIdFlag
|
|
2740
|
+
};
|
|
2741
|
+
}
|
|
2742
|
+
const fromProcess = resolveFromEnv({
|
|
2743
|
+
VERCEL_OIDC_TOKEN: process.env.VERCEL_OIDC_TOKEN,
|
|
2744
|
+
BLOB_STORE_ID: process.env.BLOB_STORE_ID,
|
|
2745
|
+
BLOB_READ_WRITE_TOKEN: process.env.BLOB_READ_WRITE_TOKEN
|
|
2746
|
+
});
|
|
2747
|
+
if (fromProcess)
|
|
2748
|
+
return fromProcess;
|
|
2749
|
+
let envFile = {};
|
|
2750
|
+
try {
|
|
2751
|
+
envFile = await createEnvObject(resolve2(client.cwd, ".env.local")) ?? {};
|
|
2752
|
+
} catch (_error) {
|
|
2753
|
+
}
|
|
2754
|
+
const fromFile = resolveFromEnv({
|
|
2755
|
+
VERCEL_OIDC_TOKEN: envFile.VERCEL_OIDC_TOKEN,
|
|
2756
|
+
BLOB_STORE_ID: envFile.BLOB_STORE_ID,
|
|
2757
|
+
BLOB_READ_WRITE_TOKEN: envFile.BLOB_READ_WRITE_TOKEN
|
|
2758
|
+
});
|
|
2759
|
+
if (fromFile)
|
|
2760
|
+
return fromFile;
|
|
2761
|
+
return { success: false, error: ErrorMessage };
|
|
2762
|
+
}
|
|
2763
|
+
function resolveFromEnv(env) {
|
|
2764
|
+
const { VERCEL_OIDC_TOKEN, BLOB_STORE_ID, BLOB_READ_WRITE_TOKEN } = env;
|
|
2765
|
+
if (Boolean(VERCEL_OIDC_TOKEN) !== Boolean(BLOB_STORE_ID)) {
|
|
2766
|
+
return { success: false, error: PartialOidcEnvErrorMessage };
|
|
2767
|
+
}
|
|
2768
|
+
if (VERCEL_OIDC_TOKEN && BLOB_STORE_ID) {
|
|
2769
|
+
return {
|
|
2770
|
+
success: true,
|
|
2771
|
+
kind: "oidc",
|
|
2772
|
+
oidcToken: VERCEL_OIDC_TOKEN,
|
|
2773
|
+
storeId: BLOB_STORE_ID
|
|
2774
|
+
};
|
|
2775
|
+
}
|
|
2776
|
+
if (BLOB_READ_WRITE_TOKEN) {
|
|
2777
|
+
return { success: true, kind: "rw", token: BLOB_READ_WRITE_TOKEN };
|
|
2778
|
+
}
|
|
2779
|
+
return null;
|
|
2780
|
+
}
|
|
2781
|
+
function blobOpts(auth) {
|
|
2782
|
+
if (auth.success && auth.kind === "rw") {
|
|
2783
|
+
return { token: auth.token };
|
|
2784
|
+
}
|
|
2785
|
+
if (auth.success && auth.kind === "oidc") {
|
|
2786
|
+
return { oidcToken: auth.oidcToken, storeId: auth.storeId };
|
|
2787
|
+
}
|
|
2788
|
+
return {};
|
|
2789
|
+
}
|
|
2790
|
+
function getStoreIdFromAuth(auth) {
|
|
2791
|
+
if (!auth.success)
|
|
2792
|
+
return null;
|
|
2793
|
+
if (auth.kind === "oidc") {
|
|
2794
|
+
return auth.storeId.startsWith("store_") ? auth.storeId : `store_${auth.storeId}`;
|
|
2795
|
+
}
|
|
2796
|
+
const [, , , id] = auth.token.split("_");
|
|
2797
|
+
return id ? `store_${id}` : null;
|
|
2798
|
+
}
|
|
2799
|
+
|
|
2699
2800
|
// src/commands/blob/list.ts
|
|
2700
2801
|
function isMode(mode) {
|
|
2701
2802
|
return mode === "folded" || mode === "expanded";
|
|
2702
2803
|
}
|
|
2703
|
-
async function list3(client, argv,
|
|
2804
|
+
async function list3(client, argv, auth) {
|
|
2704
2805
|
const telemetryClient = new BlobListTelemetryClient({
|
|
2705
2806
|
opts: {
|
|
2706
2807
|
store: client.telemetryEventStore
|
|
@@ -2744,7 +2845,7 @@ async function list3(client, argv, rwToken) {
|
|
|
2744
2845
|
output_manager_default.debug("Fetching blobs");
|
|
2745
2846
|
output_manager_default.spinner("Fetching blobs");
|
|
2746
2847
|
list15 = await blob.list({
|
|
2747
|
-
|
|
2848
|
+
...blobOpts(auth),
|
|
2748
2849
|
limit: limit ?? 10,
|
|
2749
2850
|
cursor,
|
|
2750
2851
|
mode,
|
|
@@ -2759,7 +2860,7 @@ async function list3(client, argv, rwToken) {
|
|
|
2759
2860
|
const urls = [];
|
|
2760
2861
|
const tablePrint = table(
|
|
2761
2862
|
[
|
|
2762
|
-
headers.map((header) =>
|
|
2863
|
+
headers.map((header) => import_chalk12.default.dim(header)),
|
|
2763
2864
|
...list15.blobs.map((blob7) => {
|
|
2764
2865
|
urls.push(blob7.url);
|
|
2765
2866
|
const uploadedAt = (0, import_ms5.default)(Date.now() - new Date(blob7.uploadedAt).getTime());
|
|
@@ -2849,11 +2950,29 @@ var BlobTelemetryClient = class extends TelemetryClient {
|
|
|
2849
2950
|
value: actual
|
|
2850
2951
|
});
|
|
2851
2952
|
}
|
|
2852
|
-
trackCliOptionRwToken() {
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2953
|
+
trackCliOptionRwToken(value) {
|
|
2954
|
+
if (value) {
|
|
2955
|
+
this.trackCliOption({
|
|
2956
|
+
option: "--rw-token",
|
|
2957
|
+
value: this.redactedValue
|
|
2958
|
+
});
|
|
2959
|
+
}
|
|
2960
|
+
}
|
|
2961
|
+
trackCliOptionOidcToken(value) {
|
|
2962
|
+
if (value) {
|
|
2963
|
+
this.trackCliOption({
|
|
2964
|
+
option: "--oidc-token",
|
|
2965
|
+
value: this.redactedValue
|
|
2966
|
+
});
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2969
|
+
trackCliOptionStoreId(value) {
|
|
2970
|
+
if (value) {
|
|
2971
|
+
this.trackCliOption({
|
|
2972
|
+
option: "--store-id",
|
|
2973
|
+
value: this.redactedValue
|
|
2974
|
+
});
|
|
2975
|
+
}
|
|
2857
2976
|
}
|
|
2858
2977
|
};
|
|
2859
2978
|
|
|
@@ -2863,7 +2982,7 @@ var import_error_utils = __toESM(require_dist(), 1);
|
|
|
2863
2982
|
import { statSync } from "fs";
|
|
2864
2983
|
import { open as open2 } from "fs/promises";
|
|
2865
2984
|
import { basename } from "path";
|
|
2866
|
-
var
|
|
2985
|
+
var import_chalk13 = __toESM(require_source(), 1);
|
|
2867
2986
|
|
|
2868
2987
|
// src/util/telemetry/commands/blob/put.ts
|
|
2869
2988
|
var BlobPutTelemetryClient = class extends TelemetryClient {
|
|
@@ -2960,7 +3079,7 @@ function parseAccessFlag(accessFlag) {
|
|
|
2960
3079
|
}
|
|
2961
3080
|
|
|
2962
3081
|
// src/commands/blob/put.ts
|
|
2963
|
-
async function put2(client, argv,
|
|
3082
|
+
async function put2(client, argv, auth) {
|
|
2964
3083
|
const telemetryClient = new BlobPutTelemetryClient({
|
|
2965
3084
|
opts: {
|
|
2966
3085
|
store: client.telemetryEventStore
|
|
@@ -3007,15 +3126,15 @@ async function put2(client, argv, rwToken) {
|
|
|
3007
3126
|
if (!filePath) {
|
|
3008
3127
|
if (client.stdin.isTTY) {
|
|
3009
3128
|
output_manager_default.error(
|
|
3010
|
-
`Missing input. Usage: ${
|
|
3129
|
+
`Missing input. Usage: ${import_chalk13.default.cyan(
|
|
3011
3130
|
`${getCommandName("blob put <file>")}`
|
|
3012
|
-
)} or pipe data: ${
|
|
3131
|
+
)} or pipe data: ${import_chalk13.default.cyan("cat file.txt | vercel blob put --pathname <pathname>")}`
|
|
3013
3132
|
);
|
|
3014
3133
|
return 1;
|
|
3015
3134
|
}
|
|
3016
3135
|
if (!pathnameFlag) {
|
|
3017
3136
|
output_manager_default.error(
|
|
3018
|
-
`Missing pathname. When reading from stdin, you must specify --pathname. Usage: ${
|
|
3137
|
+
`Missing pathname. When reading from stdin, you must specify --pathname. Usage: ${import_chalk13.default.cyan(
|
|
3019
3138
|
"cat file.txt | vercel blob put --pathname <pathname>"
|
|
3020
3139
|
)}`
|
|
3021
3140
|
);
|
|
@@ -3048,9 +3167,9 @@ async function put2(client, argv, rwToken) {
|
|
|
3048
3167
|
}
|
|
3049
3168
|
if (!pathname || !putBody) {
|
|
3050
3169
|
output_manager_default.error(
|
|
3051
|
-
`Missing pathname or input. Usage: ${
|
|
3170
|
+
`Missing pathname or input. Usage: ${import_chalk13.default.cyan(
|
|
3052
3171
|
`${getCommandName("blob put <file>")}`
|
|
3053
|
-
)} or ${
|
|
3172
|
+
)} or ${import_chalk13.default.cyan(
|
|
3054
3173
|
`cat file.txt | ${getCommandName("blob put --pathname <pathname>")}`
|
|
3055
3174
|
)}`
|
|
3056
3175
|
);
|
|
@@ -3061,7 +3180,7 @@ async function put2(client, argv, rwToken) {
|
|
|
3061
3180
|
output_manager_default.debug("Uploading blob");
|
|
3062
3181
|
output_manager_default.spinner("Uploading blob");
|
|
3063
3182
|
result = await blob2.put(pathname, putBody, {
|
|
3064
|
-
|
|
3183
|
+
...blobOpts(auth),
|
|
3065
3184
|
access: access3,
|
|
3066
3185
|
addRandomSuffix: addRandomSuffix ?? false,
|
|
3067
3186
|
multipart: multipart ?? true,
|
|
@@ -3123,13 +3242,13 @@ var import_bytes = __toESM(require_bytes(), 1);
|
|
|
3123
3242
|
import { createWriteStream } from "fs";
|
|
3124
3243
|
import { Readable } from "stream";
|
|
3125
3244
|
import { pipeline } from "stream/promises";
|
|
3126
|
-
async function get2(client, argv,
|
|
3245
|
+
async function get2(client, argv, auth) {
|
|
3127
3246
|
const telemetryClient = new BlobGetTelemetryClient({
|
|
3128
3247
|
opts: {
|
|
3129
3248
|
store: client.telemetryEventStore
|
|
3130
3249
|
}
|
|
3131
3250
|
});
|
|
3132
|
-
const flagsSpecification = getFlagsSpecification(
|
|
3251
|
+
const flagsSpecification = getFlagsSpecification(getSubcommand3.options);
|
|
3133
3252
|
let parsedArgs;
|
|
3134
3253
|
try {
|
|
3135
3254
|
parsedArgs = parseArguments(argv, flagsSpecification);
|
|
@@ -3165,7 +3284,7 @@ async function get2(client, argv, rwToken) {
|
|
|
3165
3284
|
output_manager_default.spinner("Downloading blob");
|
|
3166
3285
|
}
|
|
3167
3286
|
const result = await blob3.get(urlOrPathname, {
|
|
3168
|
-
|
|
3287
|
+
...blobOpts(auth),
|
|
3169
3288
|
access: access3,
|
|
3170
3289
|
ifNoneMatch
|
|
3171
3290
|
});
|
|
@@ -3220,7 +3339,7 @@ var BlobDelTelemetryClient = class extends TelemetryClient {
|
|
|
3220
3339
|
};
|
|
3221
3340
|
|
|
3222
3341
|
// src/commands/blob/del.ts
|
|
3223
|
-
async function del2(client, argv,
|
|
3342
|
+
async function del2(client, argv, auth) {
|
|
3224
3343
|
const telemetryClient = new BlobDelTelemetryClient({
|
|
3225
3344
|
opts: {
|
|
3226
3345
|
store: client.telemetryEventStore
|
|
@@ -3247,7 +3366,7 @@ async function del2(client, argv, rwToken) {
|
|
|
3247
3366
|
try {
|
|
3248
3367
|
output_manager_default.debug("Deleting blob");
|
|
3249
3368
|
output_manager_default.spinner("Deleting blob");
|
|
3250
|
-
await blob4.del(args, {
|
|
3369
|
+
await blob4.del(args, { ...blobOpts(auth), ifMatch });
|
|
3251
3370
|
} catch (err) {
|
|
3252
3371
|
output_manager_default.error(`Error deleting blob: ${err}`);
|
|
3253
3372
|
return 1;
|
|
@@ -3318,7 +3437,7 @@ var BlobCopyTelemetryClient = class extends TelemetryClient {
|
|
|
3318
3437
|
};
|
|
3319
3438
|
|
|
3320
3439
|
// src/commands/blob/copy.ts
|
|
3321
|
-
async function copy2(client, argv,
|
|
3440
|
+
async function copy2(client, argv, auth) {
|
|
3322
3441
|
const telemetryClient = new BlobCopyTelemetryClient({
|
|
3323
3442
|
opts: {
|
|
3324
3443
|
store: client.telemetryEventStore
|
|
@@ -3365,7 +3484,7 @@ async function copy2(client, argv, rwToken) {
|
|
|
3365
3484
|
output_manager_default.debug("Copying blob");
|
|
3366
3485
|
output_manager_default.spinner("Copying blob");
|
|
3367
3486
|
result = await blob5.copy(fromUrl, toPathname, {
|
|
3368
|
-
|
|
3487
|
+
...blobOpts(auth),
|
|
3369
3488
|
access: access3,
|
|
3370
3489
|
addRandomSuffix: addRandomSuffix ?? false,
|
|
3371
3490
|
contentType,
|
|
@@ -3397,7 +3516,7 @@ async function connectResourceToProject(client, projectId, storeId, environments
|
|
|
3397
3516
|
}
|
|
3398
3517
|
|
|
3399
3518
|
// src/commands/blob/store-add.ts
|
|
3400
|
-
var
|
|
3519
|
+
var import_chalk15 = __toESM(require_source(), 1);
|
|
3401
3520
|
|
|
3402
3521
|
// src/util/telemetry/commands/blob/store-add.ts
|
|
3403
3522
|
var BlobAddStoreTelemetryClient = class extends TelemetryClient {
|
|
@@ -3441,7 +3560,7 @@ var BlobAddStoreTelemetryClient = class extends TelemetryClient {
|
|
|
3441
3560
|
};
|
|
3442
3561
|
|
|
3443
3562
|
// src/util/integration/post-provision-setup.ts
|
|
3444
|
-
var
|
|
3563
|
+
var import_chalk14 = __toESM(require_source(), 1);
|
|
3445
3564
|
var VALID_ENVIRONMENTS = [
|
|
3446
3565
|
"production",
|
|
3447
3566
|
"preview",
|
|
@@ -3490,7 +3609,7 @@ async function postProvisionSetup(client, resourceName, resourceId, contextName,
|
|
|
3490
3609
|
];
|
|
3491
3610
|
output_manager_default.debug(`Selected environments: ${JSON.stringify(environments)}`);
|
|
3492
3611
|
output_manager_default.spinner(
|
|
3493
|
-
`Connecting ${
|
|
3612
|
+
`Connecting ${import_chalk14.default.bold(resourceName)} to ${import_chalk14.default.bold(project.name)}...`
|
|
3494
3613
|
);
|
|
3495
3614
|
output_manager_default.debug(`Connecting resource ${resourceId} to project ${project.id}`);
|
|
3496
3615
|
try {
|
|
@@ -3515,7 +3634,7 @@ async function postProvisionSetup(client, resourceName, resourceId, contextName,
|
|
|
3515
3634
|
}
|
|
3516
3635
|
output_manager_default.stopSpinner();
|
|
3517
3636
|
output_manager_default.log(
|
|
3518
|
-
`${
|
|
3637
|
+
`${import_chalk14.default.bold(resourceName)} successfully connected to ${import_chalk14.default.bold(project.name)}`
|
|
3519
3638
|
);
|
|
3520
3639
|
options.onProjectConnected?.(project.id);
|
|
3521
3640
|
let envPulled = false;
|
|
@@ -3675,7 +3794,7 @@ async function addStore(client, argv) {
|
|
|
3675
3794
|
});
|
|
3676
3795
|
}
|
|
3677
3796
|
output_manager_default.spinner(
|
|
3678
|
-
`Connecting ${
|
|
3797
|
+
`Connecting ${import_chalk15.default.bold(name)} to ${import_chalk15.default.bold(link.project.name)}...`
|
|
3679
3798
|
);
|
|
3680
3799
|
await connectResourceToProject(
|
|
3681
3800
|
client,
|
|
@@ -3685,7 +3804,7 @@ async function addStore(client, argv) {
|
|
|
3685
3804
|
{ accountId: link.org.id }
|
|
3686
3805
|
);
|
|
3687
3806
|
output_manager_default.success(
|
|
3688
|
-
`Blob store ${
|
|
3807
|
+
`Blob store ${import_chalk15.default.bold(name)} linked to ${import_chalk15.default.bold(
|
|
3689
3808
|
link.project.name
|
|
3690
3809
|
)}`
|
|
3691
3810
|
);
|
|
@@ -3739,9 +3858,8 @@ async function removeStore(client, argv, rwToken) {
|
|
|
3739
3858
|
flags: { "--yes": yes }
|
|
3740
3859
|
} = parsedArgs;
|
|
3741
3860
|
let storeId = storeIdArg;
|
|
3742
|
-
if (!storeId
|
|
3743
|
-
|
|
3744
|
-
storeId = `store_${id}`;
|
|
3861
|
+
if (!storeId) {
|
|
3862
|
+
storeId = getStoreIdFromAuth(rwToken) ?? void 0;
|
|
3745
3863
|
}
|
|
3746
3864
|
if (!storeId) {
|
|
3747
3865
|
if (!client.stdin.isTTY) {
|
|
@@ -3843,16 +3961,16 @@ var BlobGetStoreTelemetryClient = class extends TelemetryClient {
|
|
|
3843
3961
|
|
|
3844
3962
|
// src/util/blob/format-store.ts
|
|
3845
3963
|
var import_bytes2 = __toESM(require_bytes(), 1);
|
|
3846
|
-
var
|
|
3964
|
+
var import_chalk16 = __toESM(require_source(), 1);
|
|
3847
3965
|
var import_format2 = __toESM(require_format(), 1);
|
|
3848
3966
|
function formatStoreDetails(store, teamSlug) {
|
|
3849
3967
|
const dateTimeFormat = "MM/DD/YYYY HH:mm:ss.SS";
|
|
3850
3968
|
const isPublic = store.access !== "private";
|
|
3851
3969
|
const storeIdSuffix = store.id.replace("store_", "").toLowerCase();
|
|
3852
3970
|
const accessDomain = isPublic ? "public" : "private";
|
|
3853
|
-
const billingState = store.billingState === "active" ?
|
|
3971
|
+
const billingState = store.billingState === "active" ? import_chalk16.default.green("Active") : import_chalk16.default.red("Inactive");
|
|
3854
3972
|
const lines = [
|
|
3855
|
-
`Blob Store: ${
|
|
3973
|
+
`Blob Store: ${import_chalk16.default.bold(store.name)} (${import_chalk16.default.dim(store.id)})`,
|
|
3856
3974
|
`Billing State: ${billingState}`
|
|
3857
3975
|
];
|
|
3858
3976
|
if (store.count !== void 0) {
|
|
@@ -3899,9 +4017,8 @@ async function getStore(client, argv, rwToken) {
|
|
|
3899
4017
|
args: [storeIdArg]
|
|
3900
4018
|
} = parsedArgs;
|
|
3901
4019
|
let storeId = storeIdArg;
|
|
3902
|
-
if (!storeId
|
|
3903
|
-
|
|
3904
|
-
storeId = `store_${id}`;
|
|
4020
|
+
if (!storeId) {
|
|
4021
|
+
storeId = getStoreIdFromAuth(rwToken) ?? void 0;
|
|
3905
4022
|
}
|
|
3906
4023
|
if (!storeId) {
|
|
3907
4024
|
if (!client.stdin.isTTY) {
|
|
@@ -3947,7 +4064,7 @@ async function getStore(client, argv, rwToken) {
|
|
|
3947
4064
|
|
|
3948
4065
|
// src/commands/blob/store-list.ts
|
|
3949
4066
|
var import_bytes3 = __toESM(require_bytes(), 1);
|
|
3950
|
-
var
|
|
4067
|
+
var import_chalk17 = __toESM(require_source(), 1);
|
|
3951
4068
|
var import_ms6 = __toESM(require_ms(), 1);
|
|
3952
4069
|
var import_title = __toESM(require_lib2(), 1);
|
|
3953
4070
|
|
|
@@ -4044,7 +4161,7 @@ async function listStores(client, argv) {
|
|
|
4044
4161
|
}
|
|
4045
4162
|
if (linkedProject) {
|
|
4046
4163
|
output_manager_default.log(
|
|
4047
|
-
`No blob stores connected to ${
|
|
4164
|
+
`No blob stores connected to ${import_chalk17.default.bold(linkedProject.name)}. Use ${import_chalk17.default.cyan("--all")} to list all team stores.`
|
|
4048
4165
|
);
|
|
4049
4166
|
} else {
|
|
4050
4167
|
output_manager_default.log("No blob stores found");
|
|
@@ -4055,7 +4172,7 @@ async function listStores(client, argv) {
|
|
|
4055
4172
|
outputJson(client, stores);
|
|
4056
4173
|
return 0;
|
|
4057
4174
|
}
|
|
4058
|
-
const header = linkedProject ? `Blob stores for project ${
|
|
4175
|
+
const header = linkedProject ? `Blob stores for project ${import_chalk17.default.bold(linkedProject.name)}:` : `Blob stores:`;
|
|
4059
4176
|
output_manager_default.log(header);
|
|
4060
4177
|
if (!client.stdin.isTTY || !client.stdout.isTTY) {
|
|
4061
4178
|
output_manager_default.print(
|
|
@@ -4068,7 +4185,7 @@ async function listStores(client, argv) {
|
|
|
4068
4185
|
}
|
|
4069
4186
|
const choices = [
|
|
4070
4187
|
...stores.map((store) => ({
|
|
4071
|
-
name: `${store.name} (${
|
|
4188
|
+
name: `${store.name} (${import_chalk17.default.dim(store.id)})`,
|
|
4072
4189
|
value: store.id
|
|
4073
4190
|
})),
|
|
4074
4191
|
{ name: "Cancel", value: "" }
|
|
@@ -4124,7 +4241,7 @@ function buildTableRows(stores, noProjects) {
|
|
|
4124
4241
|
const age = store.createdAt !== void 0 ? (0, import_ms6.default)(Date.now() - store.createdAt) : "-";
|
|
4125
4242
|
const baseRow = [
|
|
4126
4243
|
store.name,
|
|
4127
|
-
|
|
4244
|
+
import_chalk17.default.dim(store.id),
|
|
4128
4245
|
formatStatus(store.billingState),
|
|
4129
4246
|
store.region || "-",
|
|
4130
4247
|
store.size !== void 0 ? (0, import_bytes3.default)(store.size) || "0B" : "-",
|
|
@@ -4136,22 +4253,22 @@ function buildTableRows(stores, noProjects) {
|
|
|
4136
4253
|
baseRow.push(age);
|
|
4137
4254
|
return baseRow;
|
|
4138
4255
|
});
|
|
4139
|
-
return [headers.map((h) =>
|
|
4256
|
+
return [headers.map((h) => import_chalk17.default.bold(import_chalk17.default.cyan(h))), ...rows];
|
|
4140
4257
|
}
|
|
4141
4258
|
function formatStatus(billingState) {
|
|
4142
4259
|
if (!billingState) {
|
|
4143
|
-
return
|
|
4260
|
+
return import_chalk17.default.gray("\u2013");
|
|
4144
4261
|
}
|
|
4145
4262
|
const CIRCLE = "\u25CF ";
|
|
4146
4263
|
const statusText = (0, import_title.default)(billingState);
|
|
4147
4264
|
if (billingState === "active") {
|
|
4148
|
-
return
|
|
4265
|
+
return import_chalk17.default.green(CIRCLE) + statusText;
|
|
4149
4266
|
}
|
|
4150
|
-
return
|
|
4267
|
+
return import_chalk17.default.yellow(CIRCLE) + statusText;
|
|
4151
4268
|
}
|
|
4152
4269
|
function formatProjects(projects) {
|
|
4153
4270
|
if (projects.length === 0) {
|
|
4154
|
-
return
|
|
4271
|
+
return import_chalk17.default.gray("\u2013");
|
|
4155
4272
|
}
|
|
4156
4273
|
if (projects.length === 1) {
|
|
4157
4274
|
return projects[0].name;
|
|
@@ -4184,7 +4301,7 @@ var BlobEmptyStoreTelemetryClient = class extends TelemetryClient {
|
|
|
4184
4301
|
};
|
|
4185
4302
|
|
|
4186
4303
|
// src/commands/blob/store-empty.ts
|
|
4187
|
-
async function emptyStore(client, argv,
|
|
4304
|
+
async function emptyStore(client, argv, auth) {
|
|
4188
4305
|
const telemetryClient = new BlobEmptyStoreTelemetryClient({
|
|
4189
4306
|
opts: {
|
|
4190
4307
|
store: client.telemetryEventStore
|
|
@@ -4204,12 +4321,13 @@ async function emptyStore(client, argv, rwToken, fullToken) {
|
|
|
4204
4321
|
flags: { "--yes": yes }
|
|
4205
4322
|
} = parsedArgs;
|
|
4206
4323
|
telemetryClient.trackCliFlagYes(yes);
|
|
4207
|
-
|
|
4208
|
-
|
|
4324
|
+
const storeId = getStoreIdFromAuth(auth);
|
|
4325
|
+
if (!storeId) {
|
|
4326
|
+
printError(
|
|
4327
|
+
"Could not resolve a Blob store ID from the provided credentials."
|
|
4328
|
+
);
|
|
4209
4329
|
return 1;
|
|
4210
4330
|
}
|
|
4211
|
-
const [, , , id] = fullToken.token.split("_");
|
|
4212
|
-
const storeId = `store_${id}`;
|
|
4213
4331
|
try {
|
|
4214
4332
|
const link = await getLinkedProject(client);
|
|
4215
4333
|
const accountId = link.status === "linked" ? link.org.id : void 0;
|
|
@@ -4223,7 +4341,7 @@ async function emptyStore(client, argv, rwToken, fullToken) {
|
|
|
4223
4341
|
method: "GET",
|
|
4224
4342
|
accountId
|
|
4225
4343
|
}),
|
|
4226
|
-
blob6.list({
|
|
4344
|
+
blob6.list({ ...blobOpts(auth), limit: 1 })
|
|
4227
4345
|
]
|
|
4228
4346
|
);
|
|
4229
4347
|
const { name } = storeResponse.store;
|
|
@@ -4253,7 +4371,7 @@ async function emptyStore(client, argv, rwToken, fullToken) {
|
|
|
4253
4371
|
while (hasMore) {
|
|
4254
4372
|
output_manager_default.spinner(`Deleting blobs... (${totalDeleted} deleted)`);
|
|
4255
4373
|
const listResult = await blob6.list({
|
|
4256
|
-
|
|
4374
|
+
...blobOpts(auth),
|
|
4257
4375
|
limit: 1e3
|
|
4258
4376
|
});
|
|
4259
4377
|
if (listResult.blobs.length === 0) {
|
|
@@ -4261,7 +4379,7 @@ async function emptyStore(client, argv, rwToken, fullToken) {
|
|
|
4261
4379
|
break;
|
|
4262
4380
|
}
|
|
4263
4381
|
const urls = listResult.blobs.map((b) => b.url);
|
|
4264
|
-
await blob6.del(urls, {
|
|
4382
|
+
await blob6.del(urls, { ...blobOpts(auth) });
|
|
4265
4383
|
totalDeleted += urls.length;
|
|
4266
4384
|
}
|
|
4267
4385
|
output_manager_default.stopSpinner();
|
|
@@ -4273,62 +4391,11 @@ async function emptyStore(client, argv, rwToken, fullToken) {
|
|
|
4273
4391
|
}
|
|
4274
4392
|
}
|
|
4275
4393
|
|
|
4276
|
-
// src/util/blob/token.ts
|
|
4277
|
-
import { resolve as resolve2 } from "path";
|
|
4278
|
-
|
|
4279
|
-
// src/util/output/list-item.ts
|
|
4280
|
-
var import_chalk17 = __toESM(require_source(), 1);
|
|
4281
|
-
var listItem = (msg, n) => {
|
|
4282
|
-
if (!n) {
|
|
4283
|
-
n = "-";
|
|
4284
|
-
}
|
|
4285
|
-
if (Number(n)) {
|
|
4286
|
-
n += ".";
|
|
4287
|
-
}
|
|
4288
|
-
return `${(0, import_chalk17.default)(n.toString())} ${msg}`;
|
|
4289
|
-
};
|
|
4290
|
-
var list_item_default = listItem;
|
|
4291
|
-
|
|
4292
|
-
// src/util/blob/token.ts
|
|
4293
|
-
var ErrorMessage = `No Vercel Blob token found. To fix this issue, choose one of the following options:
|
|
4294
|
-
${list_item_default(`Pass the token directly as an option: ${getCommandName("blob list --rw-token BLOB_READ_WRITE_TOKEN")}`, 1)}
|
|
4295
|
-
${list_item_default(`Set the Token as an environment variable: ${cmd(`BLOB_READ_WRITE_TOKEN=BLOB_READ_WRITE_TOKEN ${packageName} blob list`)}`, 2)}
|
|
4296
|
-
${list_item_default("Link your current folder to a Vercel Project that has a Vercel Blob store connected", 3)}`;
|
|
4297
|
-
async function getBlobRWToken(client, argv) {
|
|
4298
|
-
const flagsSpecification = getFlagsSpecification(blobCommand.options);
|
|
4299
|
-
try {
|
|
4300
|
-
const parsedArgs = parseArguments(argv, flagsSpecification);
|
|
4301
|
-
const {
|
|
4302
|
-
flags: { "--rw-token": rwToken }
|
|
4303
|
-
} = parsedArgs;
|
|
4304
|
-
if (rwToken) {
|
|
4305
|
-
return { token: rwToken, success: true };
|
|
4306
|
-
}
|
|
4307
|
-
} catch (_err) {
|
|
4308
|
-
}
|
|
4309
|
-
if (process.env.BLOB_READ_WRITE_TOKEN) {
|
|
4310
|
-
return { token: process.env.BLOB_READ_WRITE_TOKEN, success: true };
|
|
4311
|
-
}
|
|
4312
|
-
const filename = ".env.local";
|
|
4313
|
-
const fullPath = resolve2(client.cwd, filename);
|
|
4314
|
-
try {
|
|
4315
|
-
const env = await createEnvObject(fullPath);
|
|
4316
|
-
if (env?.BLOB_READ_WRITE_TOKEN) {
|
|
4317
|
-
return { token: env.BLOB_READ_WRITE_TOKEN, success: true };
|
|
4318
|
-
}
|
|
4319
|
-
} catch (_error) {
|
|
4320
|
-
}
|
|
4321
|
-
return {
|
|
4322
|
-
error: ErrorMessage,
|
|
4323
|
-
success: false
|
|
4324
|
-
};
|
|
4325
|
-
}
|
|
4326
|
-
|
|
4327
4394
|
// src/commands/blob/index.ts
|
|
4328
4395
|
var COMMAND_CONFIG6 = {
|
|
4329
4396
|
list: getCommandAliases(listSubcommand18),
|
|
4330
4397
|
put: getCommandAliases(putSubcommand),
|
|
4331
|
-
get: getCommandAliases(
|
|
4398
|
+
get: getCommandAliases(getSubcommand3),
|
|
4332
4399
|
del: getCommandAliases(delSubcommand),
|
|
4333
4400
|
copy: getCommandAliases(copySubcommand),
|
|
4334
4401
|
"create-store": getCommandAliases(createStoreSubcommand),
|
|
@@ -4354,7 +4421,7 @@ async function main3(client) {
|
|
|
4354
4421
|
return 1;
|
|
4355
4422
|
}
|
|
4356
4423
|
const subArgs = parsedArgs.args.slice(1);
|
|
4357
|
-
const { subcommand, args, subcommandOriginal } =
|
|
4424
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
4358
4425
|
subArgs,
|
|
4359
4426
|
COMMAND_CONFIG6
|
|
4360
4427
|
);
|
|
@@ -4370,7 +4437,9 @@ async function main3(client) {
|
|
|
4370
4437
|
);
|
|
4371
4438
|
}
|
|
4372
4439
|
const token2 = await getBlobRWToken(client, client.argv);
|
|
4373
|
-
telemetry2.trackCliOptionRwToken();
|
|
4440
|
+
telemetry2.trackCliOptionRwToken(findFlagValue(client.argv, "--rw-token"));
|
|
4441
|
+
telemetry2.trackCliOptionOidcToken(findFlagValue(client.argv, "--oidc-token"));
|
|
4442
|
+
telemetry2.trackCliOptionStoreId(findFlagValue(client.argv, "--store-id"));
|
|
4374
4443
|
switch (subcommand) {
|
|
4375
4444
|
case "list":
|
|
4376
4445
|
if (needHelp) {
|
|
@@ -4383,7 +4452,7 @@ async function main3(client) {
|
|
|
4383
4452
|
printError(token2.error);
|
|
4384
4453
|
return 1;
|
|
4385
4454
|
}
|
|
4386
|
-
return list3(client, args, token2
|
|
4455
|
+
return list3(client, args, token2);
|
|
4387
4456
|
case "put":
|
|
4388
4457
|
if (needHelp) {
|
|
4389
4458
|
telemetry2.trackCliFlagHelp("blob", subcommandOriginal);
|
|
@@ -4395,11 +4464,11 @@ async function main3(client) {
|
|
|
4395
4464
|
printError(token2.error);
|
|
4396
4465
|
return 1;
|
|
4397
4466
|
}
|
|
4398
|
-
return put2(client, args, token2
|
|
4467
|
+
return put2(client, args, token2);
|
|
4399
4468
|
case "get":
|
|
4400
4469
|
if (needHelp) {
|
|
4401
4470
|
telemetry2.trackCliFlagHelp("blob", subcommandOriginal);
|
|
4402
|
-
printHelp(
|
|
4471
|
+
printHelp(getSubcommand3);
|
|
4403
4472
|
return 2;
|
|
4404
4473
|
}
|
|
4405
4474
|
telemetry2.trackCliSubcommandGet(subcommandOriginal);
|
|
@@ -4407,7 +4476,7 @@ async function main3(client) {
|
|
|
4407
4476
|
printError(token2.error);
|
|
4408
4477
|
return 1;
|
|
4409
4478
|
}
|
|
4410
|
-
return get2(client, args, token2
|
|
4479
|
+
return get2(client, args, token2);
|
|
4411
4480
|
case "del":
|
|
4412
4481
|
if (needHelp) {
|
|
4413
4482
|
telemetry2.trackCliFlagHelp("blob", subcommandOriginal);
|
|
@@ -4419,7 +4488,7 @@ async function main3(client) {
|
|
|
4419
4488
|
printError(token2.error);
|
|
4420
4489
|
return 1;
|
|
4421
4490
|
}
|
|
4422
|
-
return del2(client, args, token2
|
|
4491
|
+
return del2(client, args, token2);
|
|
4423
4492
|
case "copy":
|
|
4424
4493
|
if (needHelp) {
|
|
4425
4494
|
telemetry2.trackCliFlagHelp("blob", subcommandOriginal);
|
|
@@ -4431,7 +4500,7 @@ async function main3(client) {
|
|
|
4431
4500
|
printError(token2.error);
|
|
4432
4501
|
return 1;
|
|
4433
4502
|
}
|
|
4434
|
-
return copy2(client, args, token2
|
|
4503
|
+
return copy2(client, args, token2);
|
|
4435
4504
|
case "create-store":
|
|
4436
4505
|
if (needHelp) {
|
|
4437
4506
|
telemetry2.trackCliFlagHelp("blob", subcommandOriginal);
|
|
@@ -4475,7 +4544,7 @@ async function main3(client) {
|
|
|
4475
4544
|
printError(token2.error);
|
|
4476
4545
|
return 1;
|
|
4477
4546
|
}
|
|
4478
|
-
return emptyStore(client, args, token2
|
|
4547
|
+
return emptyStore(client, args, token2);
|
|
4479
4548
|
default:
|
|
4480
4549
|
output_manager_default.error(getInvalidSubcommand(COMMAND_CONFIG6));
|
|
4481
4550
|
output_manager_default.print(help(blobCommand, { columns: client.stderr.columns }));
|
|
@@ -5199,7 +5268,7 @@ async function main4(client) {
|
|
|
5199
5268
|
store: client.telemetryEventStore
|
|
5200
5269
|
}
|
|
5201
5270
|
});
|
|
5202
|
-
const { subcommand, args, subcommandOriginal } =
|
|
5271
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
5203
5272
|
parsedArgs.args.slice(1),
|
|
5204
5273
|
COMMAND_CONFIG7
|
|
5205
5274
|
);
|
|
@@ -5656,7 +5725,7 @@ async function main5(client) {
|
|
|
5656
5725
|
return 1;
|
|
5657
5726
|
}
|
|
5658
5727
|
const subArgs = parsedArgs.args.slice(1);
|
|
5659
|
-
const { subcommand, args, subcommandOriginal } =
|
|
5728
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
5660
5729
|
subArgs,
|
|
5661
5730
|
COMMAND_CONFIG8
|
|
5662
5731
|
);
|
|
@@ -5888,14 +5957,6 @@ var ConnexTelemetryClient = class extends TelemetryClient {
|
|
|
5888
5957
|
}
|
|
5889
5958
|
}
|
|
5890
5959
|
}
|
|
5891
|
-
trackCliOptionProject(v) {
|
|
5892
|
-
if (v) {
|
|
5893
|
-
this.trackCliOption({
|
|
5894
|
-
option: "project",
|
|
5895
|
-
value: this.redactedValue
|
|
5896
|
-
});
|
|
5897
|
-
}
|
|
5898
|
-
}
|
|
5899
5960
|
};
|
|
5900
5961
|
|
|
5901
5962
|
// src/commands/connex/create.ts
|
|
@@ -7470,7 +7531,7 @@ async function connex(client) {
|
|
|
7470
7531
|
subcommand,
|
|
7471
7532
|
subcommandOriginal,
|
|
7472
7533
|
args: subArgs
|
|
7473
|
-
} =
|
|
7534
|
+
} = getSubcommand5(args.slice(1), COMMAND_CONFIG9);
|
|
7474
7535
|
const needHelp = flags["--help"];
|
|
7475
7536
|
function printHelp(command) {
|
|
7476
7537
|
output_manager_default.print(
|
|
@@ -8618,7 +8679,7 @@ async function main6(client) {
|
|
|
8618
8679
|
printError(err);
|
|
8619
8680
|
return 1;
|
|
8620
8681
|
}
|
|
8621
|
-
const { subcommand, subcommandOriginal, args } =
|
|
8682
|
+
const { subcommand, subcommandOriginal, args } = getSubcommand5(
|
|
8622
8683
|
parsedArgs.args.slice(1),
|
|
8623
8684
|
COMMAND_CONFIG10
|
|
8624
8685
|
);
|
|
@@ -9219,7 +9280,7 @@ async function main7(client) {
|
|
|
9219
9280
|
store: client.telemetryEventStore
|
|
9220
9281
|
}
|
|
9221
9282
|
});
|
|
9222
|
-
const { subcommand, args, subcommandOriginal } =
|
|
9283
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
9223
9284
|
parsedArgs.args.slice(1),
|
|
9224
9285
|
COMMAND_CONFIG11
|
|
9225
9286
|
);
|
|
@@ -9261,7 +9322,7 @@ async function main7(client) {
|
|
|
9261
9322
|
}
|
|
9262
9323
|
|
|
9263
9324
|
// src/commands/curl/index.ts
|
|
9264
|
-
import { spawn } from "child_process";
|
|
9325
|
+
import { spawn as spawn2 } from "child_process";
|
|
9265
9326
|
|
|
9266
9327
|
// src/commands/curl/utils.ts
|
|
9267
9328
|
var requoteArgs = (arg) => {
|
|
@@ -9308,6 +9369,26 @@ var CurlTelemetryClient = class extends TelemetryClient {
|
|
|
9308
9369
|
this.trackCliFlag("yes");
|
|
9309
9370
|
}
|
|
9310
9371
|
}
|
|
9372
|
+
trackCliFlagTrace(trace2) {
|
|
9373
|
+
if (trace2) {
|
|
9374
|
+
this.trackCliFlag("trace");
|
|
9375
|
+
}
|
|
9376
|
+
}
|
|
9377
|
+
trackCliFlagJson(json) {
|
|
9378
|
+
if (json) {
|
|
9379
|
+
this.trackCliFlag("json");
|
|
9380
|
+
}
|
|
9381
|
+
}
|
|
9382
|
+
/**
|
|
9383
|
+
* Fired only when --yes is supplied AND the target is a production
|
|
9384
|
+
* deployment. Lets us distinguish "user explicitly confirmed prod via
|
|
9385
|
+
* --yes" from generic --yes usage on previews.
|
|
9386
|
+
*/
|
|
9387
|
+
trackCliFlagYesOnProduction(value) {
|
|
9388
|
+
if (value) {
|
|
9389
|
+
this.trackCliFlag("yes-on-production");
|
|
9390
|
+
}
|
|
9391
|
+
}
|
|
9311
9392
|
};
|
|
9312
9393
|
|
|
9313
9394
|
// src/commands/curl/shared.ts
|
|
@@ -9442,7 +9523,7 @@ function orgFromOwner(id, slug = id) {
|
|
|
9442
9523
|
return { type: id.startsWith("team_") ? "team" : "user", id, slug };
|
|
9443
9524
|
}
|
|
9444
9525
|
var VC_STRING_FLAGS = /* @__PURE__ */ new Set(["--deployment", "--protection-bypass"]);
|
|
9445
|
-
var VC_BOOLEAN_FLAGS = /* @__PURE__ */ new Set(["--yes", "--help"]);
|
|
9526
|
+
var VC_BOOLEAN_FLAGS = /* @__PURE__ */ new Set(["--yes", "--help", "--trace", "--json"]);
|
|
9446
9527
|
function flagName(arg) {
|
|
9447
9528
|
const eqIdx = arg.indexOf("=");
|
|
9448
9529
|
return eqIdx === -1 ? arg : arg.slice(0, eqIdx);
|
|
@@ -9463,6 +9544,8 @@ function parseCurlLikeArgs(rawArgs, commandName) {
|
|
|
9463
9544
|
protectionBypass: void 0,
|
|
9464
9545
|
yes: false,
|
|
9465
9546
|
help: false,
|
|
9547
|
+
trace: false,
|
|
9548
|
+
json: false,
|
|
9466
9549
|
toolFlags: []
|
|
9467
9550
|
};
|
|
9468
9551
|
const args = rawArgs[0] === commandName ? rawArgs.slice(1) : [...rawArgs];
|
|
@@ -9487,6 +9570,10 @@ function parseCurlLikeArgs(rawArgs, commandName) {
|
|
|
9487
9570
|
if (VC_BOOLEAN_FLAGS.has(name)) {
|
|
9488
9571
|
if (name === "--yes") {
|
|
9489
9572
|
result.yes = true;
|
|
9573
|
+
} else if (name === "--trace") {
|
|
9574
|
+
result.trace = true;
|
|
9575
|
+
} else if (name === "--json") {
|
|
9576
|
+
result.json = true;
|
|
9490
9577
|
} else {
|
|
9491
9578
|
result.help = true;
|
|
9492
9579
|
}
|
|
@@ -9545,7 +9632,9 @@ function setupCurlLikeCommand(client, command, telemetryClient, options = {}) {
|
|
|
9545
9632
|
deploymentFlag: parsed.deployment,
|
|
9546
9633
|
protectionBypassFlag: parsed.protectionBypass,
|
|
9547
9634
|
toolFlags: parsed.toolFlags,
|
|
9548
|
-
yes: parsed.yes
|
|
9635
|
+
yes: parsed.yes,
|
|
9636
|
+
trace: parsed.trace,
|
|
9637
|
+
json: parsed.json
|
|
9549
9638
|
};
|
|
9550
9639
|
}
|
|
9551
9640
|
let parsedArgs = null;
|
|
@@ -9612,7 +9701,9 @@ function setupCurlLikeCommand(client, command, telemetryClient, options = {}) {
|
|
|
9612
9701
|
deploymentFlag,
|
|
9613
9702
|
protectionBypassFlag,
|
|
9614
9703
|
toolFlags,
|
|
9615
|
-
yes: !!flags["--yes"]
|
|
9704
|
+
yes: !!flags["--yes"],
|
|
9705
|
+
trace: !!flags["--trace"],
|
|
9706
|
+
json: !!flags["--json"]
|
|
9616
9707
|
};
|
|
9617
9708
|
}
|
|
9618
9709
|
async function resolveProjectFromUrl(client, url) {
|
|
@@ -9684,13 +9775,18 @@ async function resolveProjectFromUrl(client, url) {
|
|
|
9684
9775
|
}
|
|
9685
9776
|
async function getFullUrlAndToken(client, fullUrl, protectionBypassFlag) {
|
|
9686
9777
|
if (protectionBypassFlag) {
|
|
9687
|
-
return {
|
|
9778
|
+
return {
|
|
9779
|
+
fullUrl,
|
|
9780
|
+
deploymentProtectionToken: protectionBypassFlag,
|
|
9781
|
+
link: null
|
|
9782
|
+
};
|
|
9688
9783
|
}
|
|
9689
9784
|
if (process.env.VERCEL_AUTOMATION_BYPASS_SECRET) {
|
|
9690
9785
|
output_manager_default.debug("Using protection bypass secret from environment variable");
|
|
9691
9786
|
return {
|
|
9692
9787
|
fullUrl,
|
|
9693
|
-
deploymentProtectionToken: process.env.VERCEL_AUTOMATION_BYPASS_SECRET
|
|
9788
|
+
deploymentProtectionToken: process.env.VERCEL_AUTOMATION_BYPASS_SECRET,
|
|
9789
|
+
link: null
|
|
9694
9790
|
};
|
|
9695
9791
|
}
|
|
9696
9792
|
const link = await resolveProjectFromUrl(client, fullUrl);
|
|
@@ -9707,7 +9803,8 @@ async function getFullUrlAndToken(client, fullUrl, protectionBypassFlag) {
|
|
|
9707
9803
|
}
|
|
9708
9804
|
return {
|
|
9709
9805
|
fullUrl,
|
|
9710
|
-
deploymentProtectionToken
|
|
9806
|
+
deploymentProtectionToken,
|
|
9807
|
+
link
|
|
9711
9808
|
};
|
|
9712
9809
|
}
|
|
9713
9810
|
async function getDeploymentUrlAndToken(client, commandName, path3, options) {
|
|
@@ -9789,6 +9886,347 @@ async function getDeploymentUrlAndToken(client, commandName, path3, options) {
|
|
|
9789
9886
|
};
|
|
9790
9887
|
}
|
|
9791
9888
|
|
|
9889
|
+
// src/commands/curl/trace.ts
|
|
9890
|
+
var import_error_utils7 = __toESM(require_dist(), 1);
|
|
9891
|
+
import { spawn } from "child_process";
|
|
9892
|
+
import { tmpdir } from "os";
|
|
9893
|
+
import { join as join3 } from "path";
|
|
9894
|
+
import { mkdtemp, readFile as readFile5, rm as rm3 } from "fs/promises";
|
|
9895
|
+
|
|
9896
|
+
// src/commands/curl/confirm-production.ts
|
|
9897
|
+
async function confirmProduction(client, { deploymentTarget, yes, isTTY }) {
|
|
9898
|
+
if (deploymentTarget !== "production") {
|
|
9899
|
+
return "proceed";
|
|
9900
|
+
}
|
|
9901
|
+
if (yes) {
|
|
9902
|
+
return "proceed";
|
|
9903
|
+
}
|
|
9904
|
+
if (!isTTY) {
|
|
9905
|
+
output_manager_default.error(
|
|
9906
|
+
"Use --yes to capture traces on production from non-interactive contexts."
|
|
9907
|
+
);
|
|
9908
|
+
return "non-tty-no-yes";
|
|
9909
|
+
}
|
|
9910
|
+
const confirmed = await client.input.confirm(
|
|
9911
|
+
"You are about to capture a trace against a production deployment. Continue?",
|
|
9912
|
+
false
|
|
9913
|
+
);
|
|
9914
|
+
return confirmed ? "proceed" : "declined";
|
|
9915
|
+
}
|
|
9916
|
+
|
|
9917
|
+
// src/commands/curl/trace-session-token-provider.ts
|
|
9918
|
+
import { createHash as createHash3 } from "crypto";
|
|
9919
|
+
import { chmod, mkdir, readFile as readFile4, unlink, writeFile as writeFile3 } from "fs/promises";
|
|
9920
|
+
import { dirname, join as join2 } from "path";
|
|
9921
|
+
var FALLBACK_TTL_MS = 5 * 60 * 1e3;
|
|
9922
|
+
var EXPIRY_BUFFER_MS = 30 * 1e3;
|
|
9923
|
+
var CACHE_SCHEMA_VERSION = 1;
|
|
9924
|
+
function resolveCacheDir(override2) {
|
|
9925
|
+
if (override2)
|
|
9926
|
+
return override2;
|
|
9927
|
+
return join2(getGlobalPathConfig(), "cache", "traces");
|
|
9928
|
+
}
|
|
9929
|
+
function cacheFilename(teamId, host) {
|
|
9930
|
+
const key = `${teamId ?? ""}:${host}`;
|
|
9931
|
+
return `${createHash3("sha256").update(key).digest("hex")}.json`;
|
|
9932
|
+
}
|
|
9933
|
+
function cachePath(cacheDir, teamId, host) {
|
|
9934
|
+
return join2(cacheDir, cacheFilename(teamId, host));
|
|
9935
|
+
}
|
|
9936
|
+
async function readCache(path3) {
|
|
9937
|
+
let raw;
|
|
9938
|
+
try {
|
|
9939
|
+
raw = await readFile4(path3, "utf8");
|
|
9940
|
+
} catch {
|
|
9941
|
+
return null;
|
|
9942
|
+
}
|
|
9943
|
+
try {
|
|
9944
|
+
const parsed = JSON.parse(raw);
|
|
9945
|
+
if (!parsed || typeof parsed.token !== "string" || typeof parsed.expiresAt !== "number" || parsed.schemaVersion !== CACHE_SCHEMA_VERSION) {
|
|
9946
|
+
return null;
|
|
9947
|
+
}
|
|
9948
|
+
return parsed;
|
|
9949
|
+
} catch {
|
|
9950
|
+
output_manager_default.debug(`Trace cookie cache file is corrupt at ${path3}; re-issuing.`);
|
|
9951
|
+
return null;
|
|
9952
|
+
}
|
|
9953
|
+
}
|
|
9954
|
+
async function writeCache(path3, entry) {
|
|
9955
|
+
await mkdir(dirname(path3), { recursive: true });
|
|
9956
|
+
await writeFile3(path3, JSON.stringify(entry), { mode: 384 });
|
|
9957
|
+
await chmod(path3, 384);
|
|
9958
|
+
}
|
|
9959
|
+
async function issueToken(client, {
|
|
9960
|
+
teamId,
|
|
9961
|
+
projectId,
|
|
9962
|
+
hostname
|
|
9963
|
+
}) {
|
|
9964
|
+
const body = JSON.stringify({ projectId, hostname });
|
|
9965
|
+
const response = await client.fetch(
|
|
9966
|
+
"/v1/projects/traces/session",
|
|
9967
|
+
{
|
|
9968
|
+
method: "POST",
|
|
9969
|
+
body,
|
|
9970
|
+
headers: { "Content-Type": "application/json" },
|
|
9971
|
+
accountId: teamId
|
|
9972
|
+
}
|
|
9973
|
+
);
|
|
9974
|
+
if (!response?.token) {
|
|
9975
|
+
throw new Error("Trace session response is missing a token");
|
|
9976
|
+
}
|
|
9977
|
+
const expiresAt = typeof response.expiresAt === "number" ? response.expiresAt : Date.now() + FALLBACK_TTL_MS;
|
|
9978
|
+
return { token: response.token, expiresAt };
|
|
9979
|
+
}
|
|
9980
|
+
async function getTraceSessionToken({
|
|
9981
|
+
client,
|
|
9982
|
+
teamId,
|
|
9983
|
+
projectId,
|
|
9984
|
+
host,
|
|
9985
|
+
evictedToken,
|
|
9986
|
+
cacheDir
|
|
9987
|
+
}) {
|
|
9988
|
+
const dir = resolveCacheDir(cacheDir);
|
|
9989
|
+
const hostname = toHost(host);
|
|
9990
|
+
const path3 = cachePath(dir, teamId, hostname);
|
|
9991
|
+
const cached = await readCache(path3);
|
|
9992
|
+
if (cached && evictedToken && cached.token === evictedToken) {
|
|
9993
|
+
await unlink(path3).catch(() => {
|
|
9994
|
+
});
|
|
9995
|
+
} else if (cached && Date.now() < cached.expiresAt - EXPIRY_BUFFER_MS) {
|
|
9996
|
+
return {
|
|
9997
|
+
token: cached.token,
|
|
9998
|
+
expiresAt: cached.expiresAt,
|
|
9999
|
+
fromCache: true
|
|
10000
|
+
};
|
|
10001
|
+
}
|
|
10002
|
+
const issued = await issueToken(client, { teamId, projectId, hostname });
|
|
10003
|
+
try {
|
|
10004
|
+
await writeCache(path3, {
|
|
10005
|
+
token: issued.token,
|
|
10006
|
+
expiresAt: issued.expiresAt,
|
|
10007
|
+
schemaVersion: CACHE_SCHEMA_VERSION
|
|
10008
|
+
});
|
|
10009
|
+
} catch (err) {
|
|
10010
|
+
output_manager_default.debug(`Failed to write trace cookie cache: ${err}`);
|
|
10011
|
+
}
|
|
10012
|
+
return {
|
|
10013
|
+
token: issued.token,
|
|
10014
|
+
expiresAt: issued.expiresAt,
|
|
10015
|
+
fromCache: false
|
|
10016
|
+
};
|
|
10017
|
+
}
|
|
10018
|
+
|
|
10019
|
+
// src/commands/curl/trace.ts
|
|
10020
|
+
var TRACE_COOKIE_NAME = "_vercel_tracing";
|
|
10021
|
+
var SESSION_COOKIE_NAME = "_vercel_session";
|
|
10022
|
+
async function lookupDeployment(client, fullUrl, accountId) {
|
|
10023
|
+
const host = toHost(fullUrl);
|
|
10024
|
+
return client.fetch(
|
|
10025
|
+
`/v13/deployments/${encodeURIComponent(host)}`,
|
|
10026
|
+
accountId ? { accountId } : {}
|
|
10027
|
+
);
|
|
10028
|
+
}
|
|
10029
|
+
function resolveTeamId(link, deployment) {
|
|
10030
|
+
if (link?.org.type === "team") {
|
|
10031
|
+
return link.org.id;
|
|
10032
|
+
}
|
|
10033
|
+
if (deployment.ownerId?.startsWith("team_")) {
|
|
10034
|
+
return deployment.ownerId;
|
|
10035
|
+
}
|
|
10036
|
+
return void 0;
|
|
10037
|
+
}
|
|
10038
|
+
function extractVercelId(headerDump) {
|
|
10039
|
+
const lines = headerDump.split(/\r?\n/);
|
|
10040
|
+
let lastValue;
|
|
10041
|
+
for (const line of lines) {
|
|
10042
|
+
const idx = line.indexOf(":");
|
|
10043
|
+
if (idx === -1)
|
|
10044
|
+
continue;
|
|
10045
|
+
const name = line.slice(0, idx).trim().toLowerCase();
|
|
10046
|
+
if (name === "x-vercel-id") {
|
|
10047
|
+
lastValue = line.slice(idx + 1).trim();
|
|
10048
|
+
}
|
|
10049
|
+
}
|
|
10050
|
+
if (!lastValue)
|
|
10051
|
+
return void 0;
|
|
10052
|
+
const sepIdx = lastValue.lastIndexOf("::");
|
|
10053
|
+
return sepIdx === -1 ? lastValue : lastValue.slice(sepIdx + 2);
|
|
10054
|
+
}
|
|
10055
|
+
function extractFinalStatus(headerDump) {
|
|
10056
|
+
const lines = headerDump.split(/\r?\n/);
|
|
10057
|
+
let lastStatus;
|
|
10058
|
+
for (const line of lines) {
|
|
10059
|
+
const match = line.match(/^HTTP\/[\d.]+\s+(\d{3})/);
|
|
10060
|
+
if (match) {
|
|
10061
|
+
lastStatus = Number(match[1]);
|
|
10062
|
+
}
|
|
10063
|
+
}
|
|
10064
|
+
return lastStatus;
|
|
10065
|
+
}
|
|
10066
|
+
async function runCurlAndCaptureHeaders(curlFlags, json) {
|
|
10067
|
+
const tmpDir = await mkdtemp(join3(tmpdir(), "vc-curl-trace-"));
|
|
10068
|
+
const headerFile = join3(tmpDir, "headers");
|
|
10069
|
+
const flags = ["--dump-header", headerFile, ...curlFlags];
|
|
10070
|
+
try {
|
|
10071
|
+
const { exitCode: exitCode2, capturedBody } = await new Promise((resolve8) => {
|
|
10072
|
+
const child = spawn("curl", flags, {
|
|
10073
|
+
stdio: json ? ["inherit", "pipe", "inherit"] : "inherit",
|
|
10074
|
+
shell: false
|
|
10075
|
+
});
|
|
10076
|
+
let buf = "";
|
|
10077
|
+
if (json && child.stdout) {
|
|
10078
|
+
child.stdout.setEncoding("utf8");
|
|
10079
|
+
child.stdout.on("data", (chunk) => {
|
|
10080
|
+
buf += chunk;
|
|
10081
|
+
});
|
|
10082
|
+
}
|
|
10083
|
+
child.on("error", (err) => {
|
|
10084
|
+
if (err.code === "ENOENT") {
|
|
10085
|
+
output_manager_default.error("curl command not found. Please install curl.");
|
|
10086
|
+
} else {
|
|
10087
|
+
output_manager_default.error(`Failed to execute curl: ${err.message}`);
|
|
10088
|
+
}
|
|
10089
|
+
resolve8({ exitCode: 1, capturedBody: buf });
|
|
10090
|
+
});
|
|
10091
|
+
child.on("close", (code2) => {
|
|
10092
|
+
resolve8({ exitCode: code2 ?? 1, capturedBody: buf });
|
|
10093
|
+
});
|
|
10094
|
+
});
|
|
10095
|
+
let headerDump = "";
|
|
10096
|
+
try {
|
|
10097
|
+
headerDump = await readFile5(headerFile, "utf8");
|
|
10098
|
+
} catch (err) {
|
|
10099
|
+
output_manager_default.debug(`Failed to read curl header dump: ${err}`);
|
|
10100
|
+
}
|
|
10101
|
+
return { exitCode: exitCode2, headerDump, capturedBody };
|
|
10102
|
+
} finally {
|
|
10103
|
+
await rm3(tmpDir, { recursive: true, force: true }).catch(() => {
|
|
10104
|
+
});
|
|
10105
|
+
}
|
|
10106
|
+
}
|
|
10107
|
+
async function trace(client, { fullUrl, link, curlFlags, json, yes, telemetry: telemetry2 }) {
|
|
10108
|
+
telemetry2.trackCliFlagTrace(true);
|
|
10109
|
+
if (json) {
|
|
10110
|
+
telemetry2.trackCliFlagJson(true);
|
|
10111
|
+
}
|
|
10112
|
+
const accountId = link?.org.id;
|
|
10113
|
+
let deployment;
|
|
10114
|
+
try {
|
|
10115
|
+
deployment = await lookupDeployment(client, fullUrl, accountId);
|
|
10116
|
+
} catch (err) {
|
|
10117
|
+
output_manager_default.error(
|
|
10118
|
+
`Failed to look up deployment for tracing: ${err instanceof Error ? err.message : String(err)}`
|
|
10119
|
+
);
|
|
10120
|
+
return 1;
|
|
10121
|
+
}
|
|
10122
|
+
const projectId = link?.project.id ?? deployment.projectId;
|
|
10123
|
+
if (!projectId) {
|
|
10124
|
+
output_manager_default.error(
|
|
10125
|
+
"Could not resolve project for trace session. Run `vercel link` and retry."
|
|
10126
|
+
);
|
|
10127
|
+
return 1;
|
|
10128
|
+
}
|
|
10129
|
+
const teamId = resolveTeamId(link, deployment);
|
|
10130
|
+
let userId;
|
|
10131
|
+
try {
|
|
10132
|
+
userId = client.authConfig.userId ?? (await getUser(client)).id;
|
|
10133
|
+
} catch (err) {
|
|
10134
|
+
output_manager_default.error(
|
|
10135
|
+
`Failed to resolve user for trace session: ${(0, import_error_utils7.errorToString)(err)}`
|
|
10136
|
+
);
|
|
10137
|
+
return 1;
|
|
10138
|
+
}
|
|
10139
|
+
const deploymentTarget = deployment.target === "production" ? "production" : "preview";
|
|
10140
|
+
const confirmation = await confirmProduction(client, {
|
|
10141
|
+
deploymentTarget,
|
|
10142
|
+
yes,
|
|
10143
|
+
isTTY: !!client.stdin.isTTY
|
|
10144
|
+
});
|
|
10145
|
+
if (confirmation === "non-tty-no-yes") {
|
|
10146
|
+
return 1;
|
|
10147
|
+
}
|
|
10148
|
+
if (confirmation === "declined") {
|
|
10149
|
+
output_manager_default.log("Trace cancelled.");
|
|
10150
|
+
return 0;
|
|
10151
|
+
}
|
|
10152
|
+
if (deploymentTarget === "production" && yes) {
|
|
10153
|
+
telemetry2.trackCliFlagYesOnProduction(true);
|
|
10154
|
+
}
|
|
10155
|
+
let session;
|
|
10156
|
+
try {
|
|
10157
|
+
session = await getTraceSessionToken({
|
|
10158
|
+
client,
|
|
10159
|
+
teamId,
|
|
10160
|
+
projectId,
|
|
10161
|
+
host: fullUrl
|
|
10162
|
+
});
|
|
10163
|
+
} catch (err) {
|
|
10164
|
+
output_manager_default.error(
|
|
10165
|
+
`Failed to acquire trace session: ${err instanceof Error ? err.message : String(err)}`
|
|
10166
|
+
);
|
|
10167
|
+
return 1;
|
|
10168
|
+
}
|
|
10169
|
+
let { exitCode: exitCode2, headerDump, capturedBody } = await runCurlWithCookie(
|
|
10170
|
+
session.token,
|
|
10171
|
+
userId,
|
|
10172
|
+
curlFlags,
|
|
10173
|
+
json
|
|
10174
|
+
);
|
|
10175
|
+
if (session.fromCache && extractFinalStatus(headerDump) === 401 && exitCode2 === 0) {
|
|
10176
|
+
output_manager_default.debug("Trace cookie returned 401; evicting cache and retrying.");
|
|
10177
|
+
let refreshed;
|
|
10178
|
+
try {
|
|
10179
|
+
refreshed = await getTraceSessionToken({
|
|
10180
|
+
client,
|
|
10181
|
+
teamId,
|
|
10182
|
+
projectId,
|
|
10183
|
+
host: fullUrl,
|
|
10184
|
+
evictedToken: session.token
|
|
10185
|
+
});
|
|
10186
|
+
} catch (err) {
|
|
10187
|
+
output_manager_default.error(
|
|
10188
|
+
`Failed to refresh trace session after 401: ${err instanceof Error ? err.message : String(err)}`
|
|
10189
|
+
);
|
|
10190
|
+
return 1;
|
|
10191
|
+
}
|
|
10192
|
+
({ exitCode: exitCode2, headerDump, capturedBody } = await runCurlWithCookie(
|
|
10193
|
+
refreshed.token,
|
|
10194
|
+
userId,
|
|
10195
|
+
curlFlags,
|
|
10196
|
+
json
|
|
10197
|
+
));
|
|
10198
|
+
}
|
|
10199
|
+
const requestId = extractVercelId(headerDump);
|
|
10200
|
+
if (json) {
|
|
10201
|
+
client.stdout.write(
|
|
10202
|
+
`${JSON.stringify({ response: capturedBody, requestId: requestId ?? null }, null, 2)}
|
|
10203
|
+
`
|
|
10204
|
+
);
|
|
10205
|
+
return requestId ? exitCode2 : exitCode2 === 0 ? 1 : exitCode2;
|
|
10206
|
+
}
|
|
10207
|
+
if (!requestId) {
|
|
10208
|
+
output_manager_default.error(
|
|
10209
|
+
"Trace cookie was set but the response did not include an x-vercel-id header."
|
|
10210
|
+
);
|
|
10211
|
+
return exitCode2 === 0 ? 1 : exitCode2;
|
|
10212
|
+
}
|
|
10213
|
+
client.stderr.write(
|
|
10214
|
+
`
|
|
10215
|
+
Run \`vercel traces get ${requestId}\` to fetch the trace.
|
|
10216
|
+
`
|
|
10217
|
+
);
|
|
10218
|
+
return exitCode2;
|
|
10219
|
+
}
|
|
10220
|
+
async function runCurlWithCookie(token2, userId, curlFlags, json) {
|
|
10221
|
+
const flagsWithCookie = [
|
|
10222
|
+
"--header",
|
|
10223
|
+
`Cookie: ${TRACE_COOKIE_NAME}=${token2}; ${SESSION_COOKIE_NAME}=${userId}`,
|
|
10224
|
+
...curlFlags
|
|
10225
|
+
];
|
|
10226
|
+
output_manager_default.debug(`Executing: curl ${flagsWithCookie.map(requoteArgs).join(" ")}`);
|
|
10227
|
+
return runCurlAndCaptureHeaders(flagsWithCookie, json);
|
|
10228
|
+
}
|
|
10229
|
+
|
|
9792
10230
|
// src/commands/curl/index.ts
|
|
9793
10231
|
async function curl(client) {
|
|
9794
10232
|
const telemetryClient = new CurlTelemetryClient({
|
|
@@ -9802,7 +10240,15 @@ async function curl(client) {
|
|
|
9802
10240
|
if (typeof setup === "number") {
|
|
9803
10241
|
return setup;
|
|
9804
10242
|
}
|
|
9805
|
-
const {
|
|
10243
|
+
const {
|
|
10244
|
+
path: path3,
|
|
10245
|
+
isFullUrl,
|
|
10246
|
+
deploymentFlag,
|
|
10247
|
+
protectionBypassFlag,
|
|
10248
|
+
toolFlags,
|
|
10249
|
+
trace: traceFlag,
|
|
10250
|
+
json: jsonFlag
|
|
10251
|
+
} = setup;
|
|
9806
10252
|
const result = isFullUrl ? await getFullUrlAndToken(client, path3, protectionBypassFlag) : await getDeploymentUrlAndToken(client, "curl", path3, {
|
|
9807
10253
|
deploymentFlag,
|
|
9808
10254
|
protectionBypassFlag,
|
|
@@ -9820,9 +10266,19 @@ async function curl(client) {
|
|
|
9820
10266
|
);
|
|
9821
10267
|
}
|
|
9822
10268
|
curlFlags.unshift("--url", fullUrl);
|
|
10269
|
+
if (traceFlag) {
|
|
10270
|
+
return trace(client, {
|
|
10271
|
+
fullUrl,
|
|
10272
|
+
link: result.link ?? null,
|
|
10273
|
+
curlFlags,
|
|
10274
|
+
json: jsonFlag,
|
|
10275
|
+
yes: setup.yes,
|
|
10276
|
+
telemetry: telemetryClient
|
|
10277
|
+
});
|
|
10278
|
+
}
|
|
9823
10279
|
output_manager_default.debug(`Executing: curl ${curlFlags.map(requoteArgs).join(" ")}`);
|
|
9824
10280
|
return new Promise((resolve8) => {
|
|
9825
|
-
const curlProcess =
|
|
10281
|
+
const curlProcess = spawn2("curl", curlFlags, {
|
|
9826
10282
|
stdio: "inherit",
|
|
9827
10283
|
shell: false
|
|
9828
10284
|
});
|
|
@@ -9902,14 +10358,6 @@ var DeployHooksLsTelemetryClient = class extends TelemetryClient {
|
|
|
9902
10358
|
});
|
|
9903
10359
|
}
|
|
9904
10360
|
}
|
|
9905
|
-
trackCliOptionProject(project) {
|
|
9906
|
-
if (project) {
|
|
9907
|
-
this.trackCliOption({
|
|
9908
|
-
option: "project",
|
|
9909
|
-
value: project
|
|
9910
|
-
});
|
|
9911
|
-
}
|
|
9912
|
-
}
|
|
9913
10361
|
};
|
|
9914
10362
|
|
|
9915
10363
|
// src/commands/deploy-hooks/ls.ts
|
|
@@ -10041,14 +10489,6 @@ var DeployHooksCreateTelemetryClient = class extends TelemetryClient {
|
|
|
10041
10489
|
});
|
|
10042
10490
|
}
|
|
10043
10491
|
}
|
|
10044
|
-
trackCliOptionProject(project) {
|
|
10045
|
-
if (project) {
|
|
10046
|
-
this.trackCliOption({
|
|
10047
|
-
option: "project",
|
|
10048
|
-
value: project
|
|
10049
|
-
});
|
|
10050
|
-
}
|
|
10051
|
-
}
|
|
10052
10492
|
};
|
|
10053
10493
|
|
|
10054
10494
|
// src/commands/deploy-hooks/create.ts
|
|
@@ -10283,14 +10723,6 @@ var DeployHooksRmTelemetryClient = class extends TelemetryClient {
|
|
|
10283
10723
|
});
|
|
10284
10724
|
}
|
|
10285
10725
|
}
|
|
10286
|
-
trackCliOptionProject(project) {
|
|
10287
|
-
if (project) {
|
|
10288
|
-
this.trackCliOption({
|
|
10289
|
-
option: "project",
|
|
10290
|
-
value: project
|
|
10291
|
-
});
|
|
10292
|
-
}
|
|
10293
|
-
}
|
|
10294
10726
|
trackCliFlagYes(yes) {
|
|
10295
10727
|
if (yes) {
|
|
10296
10728
|
this.trackCliFlag("yes");
|
|
@@ -10304,7 +10736,7 @@ function deployHooksCommandWithGlobalFlags(baseSubcommand, argv) {
|
|
|
10304
10736
|
const full = globalFlags.length ? `${baseSubcommand} ${globalFlags.join(" ")}` : baseSubcommand;
|
|
10305
10737
|
return getCommandNamePlain(full);
|
|
10306
10738
|
}
|
|
10307
|
-
async function
|
|
10739
|
+
async function rm4(client, argv) {
|
|
10308
10740
|
const telemetry2 = new DeployHooksRmTelemetryClient({
|
|
10309
10741
|
opts: {
|
|
10310
10742
|
store: client.telemetryEventStore
|
|
@@ -10501,7 +10933,7 @@ async function main8(client) {
|
|
|
10501
10933
|
store: client.telemetryEventStore
|
|
10502
10934
|
}
|
|
10503
10935
|
});
|
|
10504
|
-
const { subcommand, args, subcommandOriginal } =
|
|
10936
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
10505
10937
|
parsedArgs.args.slice(1),
|
|
10506
10938
|
COMMAND_CONFIG12
|
|
10507
10939
|
);
|
|
@@ -10534,7 +10966,7 @@ async function main8(client) {
|
|
|
10534
10966
|
return printHelp(removeSubcommand4);
|
|
10535
10967
|
}
|
|
10536
10968
|
telemetry2.trackCliSubcommandRemove(subcommandOriginal);
|
|
10537
|
-
return
|
|
10969
|
+
return rm4(client, args);
|
|
10538
10970
|
default:
|
|
10539
10971
|
if (needHelp) {
|
|
10540
10972
|
telemetry2.trackCliFlagHelp("deploy-hooks", subcommandOriginal);
|
|
@@ -11484,7 +11916,7 @@ function withGlobalFlags4(client, commandTemplate) {
|
|
|
11484
11916
|
const flags = getGlobalFlagsOnlyFromArgs(client.argv.slice(2));
|
|
11485
11917
|
return getCommandNamePlain(`${commandTemplate} ${flags.join(" ")}`.trim());
|
|
11486
11918
|
}
|
|
11487
|
-
async function
|
|
11919
|
+
async function rm5(client, argv) {
|
|
11488
11920
|
let parsedArgs;
|
|
11489
11921
|
const flagsSpecification = getFlagsSpecification(removeSubcommand5.options);
|
|
11490
11922
|
try {
|
|
@@ -11686,7 +12118,7 @@ async function dns(client) {
|
|
|
11686
12118
|
store: telemetryEventStore
|
|
11687
12119
|
}
|
|
11688
12120
|
});
|
|
11689
|
-
const { subcommand, subcommandOriginal, args } =
|
|
12121
|
+
const { subcommand, subcommandOriginal, args } = getSubcommand5(
|
|
11690
12122
|
parsedArgs.args.slice(1),
|
|
11691
12123
|
COMMAND_CONFIG13
|
|
11692
12124
|
);
|
|
@@ -11725,7 +12157,7 @@ async function dns(client) {
|
|
|
11725
12157
|
return 2;
|
|
11726
12158
|
}
|
|
11727
12159
|
telemetry2.trackCliSubcommandRemove(subcommandOriginal);
|
|
11728
|
-
return
|
|
12160
|
+
return rm5(client, args);
|
|
11729
12161
|
default:
|
|
11730
12162
|
if (needHelp) {
|
|
11731
12163
|
telemetry2.trackCliFlagHelp("dns", subcommandOriginal);
|
|
@@ -11883,7 +12315,7 @@ var DomainsAddTelemetryClient = class extends TelemetryClient {
|
|
|
11883
12315
|
};
|
|
11884
12316
|
|
|
11885
12317
|
// src/commands/domains/add.ts
|
|
11886
|
-
var
|
|
12318
|
+
var import_error_utils8 = __toESM(require_dist(), 1);
|
|
11887
12319
|
function withGlobalFlags5(client, commandTemplate) {
|
|
11888
12320
|
const flags = getGlobalFlagsOnlyFromArgs(client.argv.slice(2));
|
|
11889
12321
|
return getCommandNamePlain(`${commandTemplate} ${flags.join(" ")}`.trim());
|
|
@@ -12032,7 +12464,7 @@ async function add4(client, argv) {
|
|
|
12032
12464
|
{
|
|
12033
12465
|
status: "error",
|
|
12034
12466
|
reason: "domain_remove_failed",
|
|
12035
|
-
message: (0,
|
|
12467
|
+
message: (0, import_error_utils8.errorToString)(removeResponse)
|
|
12036
12468
|
},
|
|
12037
12469
|
1
|
|
12038
12470
|
);
|
|
@@ -12053,7 +12485,7 @@ async function add4(client, argv) {
|
|
|
12053
12485
|
if (code2 === "not_domain_owner" || status3 === 403 && msg.includes("not authorized")) {
|
|
12054
12486
|
reason = "domain_not_owned";
|
|
12055
12487
|
}
|
|
12056
|
-
let message = (0,
|
|
12488
|
+
let message = (0, import_error_utils8.errorToString)(aliasTarget);
|
|
12057
12489
|
if (reason === "domain_not_owned" || code2 === "invalid_domain" || msg.includes("not authorized to use")) {
|
|
12058
12490
|
message += " domains add is for domains you already own or control via DNS. If you have not purchased the domain yet, the user must run 'domains buy' interactively (agents must not purchase) or buy in the dashboard; use 'domains transfer-in' to move an existing registration to Vercel.";
|
|
12059
12491
|
}
|
|
@@ -12097,7 +12529,7 @@ async function add4(client, argv) {
|
|
|
12097
12529
|
{
|
|
12098
12530
|
status: "error",
|
|
12099
12531
|
reason: "domain_fetch_failed",
|
|
12100
|
-
message: (0,
|
|
12532
|
+
message: (0, import_error_utils8.errorToString)(domainResponse)
|
|
12101
12533
|
},
|
|
12102
12534
|
1
|
|
12103
12535
|
);
|
|
@@ -12817,7 +13249,7 @@ var DomainsRmTelemetryClient = class extends TelemetryClient {
|
|
|
12817
13249
|
};
|
|
12818
13250
|
|
|
12819
13251
|
// src/commands/domains/rm.ts
|
|
12820
|
-
async function
|
|
13252
|
+
async function rm6(client, argv) {
|
|
12821
13253
|
const telemetry2 = new DomainsRmTelemetryClient({
|
|
12822
13254
|
opts: {
|
|
12823
13255
|
store: client.telemetryEventStore
|
|
@@ -13412,7 +13844,7 @@ async function main9(client) {
|
|
|
13412
13844
|
store: client.telemetryEventStore
|
|
13413
13845
|
}
|
|
13414
13846
|
});
|
|
13415
|
-
const { subcommand, args, subcommandOriginal } =
|
|
13847
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
13416
13848
|
parsedArgs.args.slice(1),
|
|
13417
13849
|
COMMAND_CONFIG14
|
|
13418
13850
|
);
|
|
@@ -13470,7 +13902,7 @@ async function main9(client) {
|
|
|
13470
13902
|
return printHelp(removeSubcommand6);
|
|
13471
13903
|
}
|
|
13472
13904
|
telemetry2.trackCliSubcommandRemove(subcommandOriginal);
|
|
13473
|
-
return
|
|
13905
|
+
return rm6(client, args);
|
|
13474
13906
|
case "transferIn":
|
|
13475
13907
|
if (needHelp) {
|
|
13476
13908
|
telemetry2.trackCliFlagHelp("domains", subcommandOriginal);
|
|
@@ -15195,7 +15627,7 @@ async function main10(client, args) {
|
|
|
15195
15627
|
subcommand,
|
|
15196
15628
|
args: subArgs,
|
|
15197
15629
|
subcommandOriginal
|
|
15198
|
-
} =
|
|
15630
|
+
} = getSubcommand5(parsedArgs.args, COMMAND_CONFIG15);
|
|
15199
15631
|
const needHelp = parsedArgs.flags["--help"];
|
|
15200
15632
|
if (!subcommand && needHelp) {
|
|
15201
15633
|
telemetry2.trackCliFlagHelp("firewall", "system-bypass");
|
|
@@ -15449,7 +15881,7 @@ async function main11(client, args) {
|
|
|
15449
15881
|
subcommand,
|
|
15450
15882
|
args: subArgs,
|
|
15451
15883
|
subcommandOriginal
|
|
15452
|
-
} =
|
|
15884
|
+
} = getSubcommand5(parsedArgs.args, COMMAND_CONFIG16);
|
|
15453
15885
|
const needHelp = parsedArgs.flags["--help"];
|
|
15454
15886
|
if (!subcommand && needHelp) {
|
|
15455
15887
|
telemetry2.trackCliFlagHelp("firewall", "attack-mode");
|
|
@@ -15685,7 +16117,7 @@ async function main12(client, args) {
|
|
|
15685
16117
|
subcommand,
|
|
15686
16118
|
args: subArgs,
|
|
15687
16119
|
subcommandOriginal
|
|
15688
|
-
} =
|
|
16120
|
+
} = getSubcommand5(parsedArgs.args, COMMAND_CONFIG17);
|
|
15689
16121
|
const needHelp = parsedArgs.flags["--help"];
|
|
15690
16122
|
if (!subcommand && needHelp) {
|
|
15691
16123
|
telemetry2.trackCliFlagHelp("firewall", "system-mitigations");
|
|
@@ -16113,7 +16545,7 @@ async function main13(client, args) {
|
|
|
16113
16545
|
subcommand,
|
|
16114
16546
|
args: subArgs,
|
|
16115
16547
|
subcommandOriginal
|
|
16116
|
-
} =
|
|
16548
|
+
} = getSubcommand5(parsedArgs.args, COMMAND_CONFIG18);
|
|
16117
16549
|
const needHelp = parsedArgs.flags["--help"];
|
|
16118
16550
|
if (!subcommand && needHelp) {
|
|
16119
16551
|
telemetry2.trackCliFlagHelp("firewall", "ip-blocks");
|
|
@@ -19997,7 +20429,7 @@ async function main14(client, args) {
|
|
|
19997
20429
|
subcommand,
|
|
19998
20430
|
args: subArgs,
|
|
19999
20431
|
subcommandOriginal
|
|
20000
|
-
} =
|
|
20432
|
+
} = getSubcommand5(parsedArgs.args, COMMAND_CONFIG19);
|
|
20001
20433
|
const needHelp = parsedArgs.flags["--help"];
|
|
20002
20434
|
if (!subcommand && needHelp) {
|
|
20003
20435
|
telemetry2.trackCliFlagHelp("firewall", "rules");
|
|
@@ -20123,7 +20555,7 @@ async function main15(client) {
|
|
|
20123
20555
|
return 1;
|
|
20124
20556
|
}
|
|
20125
20557
|
const subArgs = parsedArgs.args.slice(1);
|
|
20126
|
-
const { subcommand, args, subcommandOriginal } =
|
|
20558
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
20127
20559
|
subArgs,
|
|
20128
20560
|
COMMAND_CONFIG20
|
|
20129
20561
|
);
|
|
@@ -21347,7 +21779,7 @@ async function main16(client) {
|
|
|
21347
21779
|
store: client.telemetryEventStore
|
|
21348
21780
|
}
|
|
21349
21781
|
});
|
|
21350
|
-
const { subcommand, args, subcommandOriginal } =
|
|
21782
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
21351
21783
|
parsedArgs.args.slice(1),
|
|
21352
21784
|
COMMAND_CONFIG21
|
|
21353
21785
|
);
|
|
@@ -24198,7 +24630,7 @@ var FlagsRmTelemetryClient = class extends TelemetryClient {
|
|
|
24198
24630
|
};
|
|
24199
24631
|
|
|
24200
24632
|
// src/commands/flags/rm.ts
|
|
24201
|
-
async function
|
|
24633
|
+
async function rm7(client, argv) {
|
|
24202
24634
|
const telemetryClient = new FlagsRmTelemetryClient({
|
|
24203
24635
|
opts: {
|
|
24204
24636
|
store: client.telemetryEventStore
|
|
@@ -25448,7 +25880,7 @@ async function sdkKeys(client) {
|
|
|
25448
25880
|
return 1;
|
|
25449
25881
|
}
|
|
25450
25882
|
const subArgs = parsedArgs.args.slice(0);
|
|
25451
|
-
const { subcommand, args, subcommandOriginal } =
|
|
25883
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
25452
25884
|
subArgs,
|
|
25453
25885
|
COMMAND_CONFIG22
|
|
25454
25886
|
);
|
|
@@ -25679,7 +26111,7 @@ async function main17(client) {
|
|
|
25679
26111
|
return 1;
|
|
25680
26112
|
}
|
|
25681
26113
|
const subArgs = parsedArgs.args.slice(1);
|
|
25682
|
-
const { subcommand, args, subcommandOriginal } =
|
|
26114
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
25683
26115
|
subArgs,
|
|
25684
26116
|
COMMAND_CONFIG23
|
|
25685
26117
|
);
|
|
@@ -25766,7 +26198,7 @@ async function main17(client) {
|
|
|
25766
26198
|
return 2;
|
|
25767
26199
|
}
|
|
25768
26200
|
telemetry2.trackCliSubcommandRemove(subcommandOriginal);
|
|
25769
|
-
return
|
|
26201
|
+
return rm7(client, args);
|
|
25770
26202
|
case "archive":
|
|
25771
26203
|
if (needHelp) {
|
|
25772
26204
|
telemetry2.trackCliFlagHelp("flags", subcommandOriginal);
|
|
@@ -25823,7 +26255,7 @@ async function main17(client) {
|
|
|
25823
26255
|
|
|
25824
26256
|
// src/commands/git/connect.ts
|
|
25825
26257
|
var import_chalk115 = __toESM(require_source(), 1);
|
|
25826
|
-
import { join as
|
|
26258
|
+
import { join as join4 } from "path";
|
|
25827
26259
|
|
|
25828
26260
|
// src/util/telemetry/commands/git/connect.ts
|
|
25829
26261
|
var GitConnectTelemetryClient = class extends TelemetryClient {
|
|
@@ -25890,7 +26322,7 @@ async function connect(client, argv) {
|
|
|
25890
26322
|
const { project, org } = linkedProject;
|
|
25891
26323
|
const gitProviderLink = project.link;
|
|
25892
26324
|
client.config.currentTeam = org.type === "team" ? org.id : void 0;
|
|
25893
|
-
const gitConfigPath =
|
|
26325
|
+
const gitConfigPath = join4(cwd, ".git/config");
|
|
25894
26326
|
const gitConfig = await parseGitConfig(gitConfigPath);
|
|
25895
26327
|
if (repoArg) {
|
|
25896
26328
|
const parsedUrlArg = parseRepoUrl(repoArg);
|
|
@@ -26190,7 +26622,7 @@ async function main18(client) {
|
|
|
26190
26622
|
store: client.telemetryEventStore
|
|
26191
26623
|
}
|
|
26192
26624
|
});
|
|
26193
|
-
const { subcommand, args, subcommandOriginal } =
|
|
26625
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
26194
26626
|
parsedArgs.args.slice(1),
|
|
26195
26627
|
COMMAND_CONFIG24
|
|
26196
26628
|
);
|
|
@@ -26298,7 +26730,7 @@ async function guidance(client) {
|
|
|
26298
26730
|
printError(err);
|
|
26299
26731
|
return 1;
|
|
26300
26732
|
}
|
|
26301
|
-
const { subcommand, subcommandOriginal } =
|
|
26733
|
+
const { subcommand, subcommandOriginal } = getSubcommand5(
|
|
26302
26734
|
parsedArguments.args.slice(1),
|
|
26303
26735
|
COMMAND_CONFIG25
|
|
26304
26736
|
);
|
|
@@ -26348,7 +26780,7 @@ async function guidance(client) {
|
|
|
26348
26780
|
}
|
|
26349
26781
|
|
|
26350
26782
|
// src/commands/httpstat/index.ts
|
|
26351
|
-
import { spawn as
|
|
26783
|
+
import { spawn as spawn3 } from "child_process";
|
|
26352
26784
|
|
|
26353
26785
|
// src/util/telemetry/commands/httpstat/index.ts
|
|
26354
26786
|
var HttpstatTelemetryClient = class extends TelemetryClient {
|
|
@@ -26418,7 +26850,7 @@ async function httpstat(client) {
|
|
|
26418
26850
|
`Executing: httpstat ${httpstatFlags.map(requoteArgs).join(" ")}`
|
|
26419
26851
|
);
|
|
26420
26852
|
return new Promise((resolve8) => {
|
|
26421
|
-
const httpstatProcess =
|
|
26853
|
+
const httpstatProcess = spawn3("httpstat", httpstatFlags, {
|
|
26422
26854
|
stdio: "inherit",
|
|
26423
26855
|
shell: false
|
|
26424
26856
|
});
|
|
@@ -26592,7 +27024,7 @@ async function guess(client, exampleList, name) {
|
|
|
26592
27024
|
}
|
|
26593
27025
|
|
|
26594
27026
|
// src/commands/init/index.ts
|
|
26595
|
-
var
|
|
27027
|
+
var import_error_utils9 = __toESM(require_dist(), 1);
|
|
26596
27028
|
|
|
26597
27029
|
// src/util/telemetry/commands/init/index.ts
|
|
26598
27030
|
var InitTelemetryClient = class extends TelemetryClient {
|
|
@@ -26642,7 +27074,7 @@ async function main19(client) {
|
|
|
26642
27074
|
output_manager_default.print(help(initCommand, { columns: client.stderr.columns }));
|
|
26643
27075
|
return 2;
|
|
26644
27076
|
}
|
|
26645
|
-
const args =
|
|
27077
|
+
const args = getSubcommand5(parsedArgs.args.slice(1), COMMAND_CONFIG26).args;
|
|
26646
27078
|
if (parsedArgs.args.length > 3) {
|
|
26647
27079
|
output_manager_default.error("Too many arguments.");
|
|
26648
27080
|
return 1;
|
|
@@ -26653,7 +27085,7 @@ async function main19(client) {
|
|
|
26653
27085
|
return await init(client, parsedArgs.flags, args, telemetry2);
|
|
26654
27086
|
} catch (err) {
|
|
26655
27087
|
output_manager_default.prettyError(err);
|
|
26656
|
-
if ((0,
|
|
27088
|
+
if ((0, import_error_utils9.isError)(err) && typeof err.stack === "string") {
|
|
26657
27089
|
output_manager_default.debug(err.stack);
|
|
26658
27090
|
}
|
|
26659
27091
|
return 1;
|
|
@@ -26661,7 +27093,7 @@ async function main19(client) {
|
|
|
26661
27093
|
}
|
|
26662
27094
|
|
|
26663
27095
|
// src/commands/inspect/index.ts
|
|
26664
|
-
var
|
|
27096
|
+
var import_error_utils10 = __toESM(require_dist(), 1);
|
|
26665
27097
|
var import_chalk121 = __toESM(require_source(), 1);
|
|
26666
27098
|
var import_ms16 = __toESM(require_ms(), 1);
|
|
26667
27099
|
var import_title2 = __toESM(require_lib2(), 1);
|
|
@@ -27040,7 +27472,7 @@ async function inspect4(client) {
|
|
|
27040
27472
|
try {
|
|
27041
27473
|
({ contextName } = await getScope(client));
|
|
27042
27474
|
} catch (err) {
|
|
27043
|
-
if ((0,
|
|
27475
|
+
if ((0, import_error_utils10.isErrnoException)(err) && (err.code === "NOT_AUTHORIZED" || err.code === "TEAM_DELETED")) {
|
|
27044
27476
|
error(err.message);
|
|
27045
27477
|
return 1;
|
|
27046
27478
|
}
|
|
@@ -27240,7 +27672,7 @@ function exitCode(state) {
|
|
|
27240
27672
|
|
|
27241
27673
|
// src/commands/integration/add-auto-provision.ts
|
|
27242
27674
|
var import_chalk124 = __toESM(require_source(), 1);
|
|
27243
|
-
var
|
|
27675
|
+
var import_error_utils11 = __toESM(require_dist(), 1);
|
|
27244
27676
|
var import_open11 = __toESM(require_open(), 1);
|
|
27245
27677
|
|
|
27246
27678
|
// src/util/integration/auto-provision-resource.ts
|
|
@@ -27516,13 +27948,6 @@ async function acceptTermsViaBrowser(client, integration, teamId, teamSlug, time
|
|
|
27516
27948
|
if (shouldEmitNonInteractiveCommandError(client)) {
|
|
27517
27949
|
const tail = buildIntegrationCommandTailFromArgv(client.argv);
|
|
27518
27950
|
const policyLinks = getMarketplacePolicyLinks(integration);
|
|
27519
|
-
const acceptTermsCmd = buildCommandWithGlobalFlags(
|
|
27520
|
-
client.argv,
|
|
27521
|
-
`integration accept-terms ${integration.slug} --yes`,
|
|
27522
|
-
packageName,
|
|
27523
|
-
{ prependGlobalFlags: true }
|
|
27524
|
-
);
|
|
27525
|
-
const apiAcceptSupported = !integration.capabilities?.requiresBrowserInstall;
|
|
27526
27951
|
outputActionRequired(
|
|
27527
27952
|
client,
|
|
27528
27953
|
{
|
|
@@ -27532,7 +27957,7 @@ async function acceptTermsViaBrowser(client, integration, teamId, teamSlug, time
|
|
|
27532
27957
|
verification_uri: url.href,
|
|
27533
27958
|
policy_links: policyLinks,
|
|
27534
27959
|
userActionRequired: true,
|
|
27535
|
-
hint:
|
|
27960
|
+
hint: `Read policy_links, complete verification_uri in the browser, then retry install from next[]. Confirm with ${packageName} integration installations.`,
|
|
27536
27961
|
next: [
|
|
27537
27962
|
{
|
|
27538
27963
|
command: buildCommandWithGlobalFlags(
|
|
@@ -27542,10 +27967,6 @@ async function acceptTermsViaBrowser(client, integration, teamId, teamSlug, time
|
|
|
27542
27967
|
{ prependGlobalFlags: true }
|
|
27543
27968
|
),
|
|
27544
27969
|
when: "Retry install after terms are accepted (browser or dashboard)"
|
|
27545
|
-
},
|
|
27546
|
-
{
|
|
27547
|
-
command: acceptTermsCmd,
|
|
27548
|
-
when: apiAcceptSupported ? "Accept terms via API instead of the browser (after reading policy_links)" : "Optional: only if this integration later supports API acceptance; browser-gated integrations will error \u2014 prefer verification_uri first"
|
|
27549
27970
|
}
|
|
27550
27971
|
]
|
|
27551
27972
|
},
|
|
@@ -28444,10 +28865,10 @@ Example: vercel ${commandName} ${integration.slug}/${integration.products[0].slu
|
|
|
28444
28865
|
"marketplace_checkout_provisioning_failed",
|
|
28445
28866
|
{
|
|
28446
28867
|
...baseProps,
|
|
28447
|
-
error_message: (0,
|
|
28868
|
+
error_message: (0, import_error_utils11.errorToString)(error)
|
|
28448
28869
|
}
|
|
28449
28870
|
);
|
|
28450
|
-
output_manager_default.error((0,
|
|
28871
|
+
output_manager_default.error((0, import_error_utils11.errorToString)(error));
|
|
28451
28872
|
return 1;
|
|
28452
28873
|
}
|
|
28453
28874
|
output_manager_default.stopSpinner();
|
|
@@ -30822,18 +31243,6 @@ function logPolicyLinksSummary(links) {
|
|
|
30822
31243
|
output_manager_default.log(`Terms of service: ${links.integration_eula}`);
|
|
30823
31244
|
}
|
|
30824
31245
|
}
|
|
30825
|
-
function policiesFromConfirmYes(integration) {
|
|
30826
|
-
const policies = {
|
|
30827
|
-
toc: (/* @__PURE__ */ new Date()).toISOString()
|
|
30828
|
-
};
|
|
30829
|
-
if (integration.privacyDocUri) {
|
|
30830
|
-
policies.privacy = (/* @__PURE__ */ new Date()).toISOString();
|
|
30831
|
-
}
|
|
30832
|
-
if (integration.eulaDocUri) {
|
|
30833
|
-
policies.eula = (/* @__PURE__ */ new Date()).toISOString();
|
|
30834
|
-
}
|
|
30835
|
-
return policies;
|
|
30836
|
-
}
|
|
30837
31246
|
async function acceptTerms(client, argv) {
|
|
30838
31247
|
const spec = getFlagsSpecification(acceptTermsSubcommand.options);
|
|
30839
31248
|
let parsed;
|
|
@@ -30889,7 +31298,6 @@ async function acceptTerms(client, argv) {
|
|
|
30889
31298
|
return 1;
|
|
30890
31299
|
}
|
|
30891
31300
|
const integrationSlug = parsed.args[0];
|
|
30892
|
-
const yes = Boolean(parsed.flags["--yes"]);
|
|
30893
31301
|
const { team } = await getScope(client);
|
|
30894
31302
|
if (!team) {
|
|
30895
31303
|
output_manager_default.error("Team not found. Run `vercel switch` or use --scope.");
|
|
@@ -30960,39 +31368,24 @@ async function acceptTerms(client, argv) {
|
|
|
30960
31368
|
}
|
|
30961
31369
|
let acceptedPolicies;
|
|
30962
31370
|
if (shouldEmitNonInteractiveCommandError(client)) {
|
|
30963
|
-
|
|
30964
|
-
|
|
30965
|
-
|
|
30966
|
-
|
|
30967
|
-
|
|
30968
|
-
|
|
30969
|
-
|
|
30970
|
-
|
|
30971
|
-
|
|
30972
|
-
|
|
30973
|
-
|
|
30974
|
-
|
|
30975
|
-
|
|
30976
|
-
|
|
30977
|
-
|
|
30978
|
-
|
|
30979
|
-
|
|
30980
|
-
|
|
30981
|
-
when: "After confirming policy text out of band"
|
|
30982
|
-
}
|
|
30983
|
-
]
|
|
30984
|
-
},
|
|
30985
|
-
1
|
|
30986
|
-
);
|
|
30987
|
-
output_manager_default.error(msg);
|
|
30988
|
-
return 1;
|
|
30989
|
-
}
|
|
30990
|
-
acceptedPolicies = policiesFromConfirmYes(integration);
|
|
30991
|
-
} else {
|
|
30992
|
-
acceptedPolicies = await promptForTermAcceptance(client, integration);
|
|
30993
|
-
if (!acceptedPolicies) {
|
|
30994
|
-
return 1;
|
|
30995
|
-
}
|
|
31371
|
+
const msg = "Marketplace terms cannot be accepted in non-interactive mode. Run this command in an interactive terminal as a human.";
|
|
31372
|
+
outputAgentError(
|
|
31373
|
+
client,
|
|
31374
|
+
{
|
|
31375
|
+
status: "error",
|
|
31376
|
+
reason: AGENT_REASON.INTEGRATION_TERMS_ACCEPTANCE_REQUIRED,
|
|
31377
|
+
message: msg,
|
|
31378
|
+
policy_links: getMarketplacePolicyLinks(integration),
|
|
31379
|
+
hint: `Open the policy links, then run \`${packageName} integration accept-terms ${integration.slug}\` interactively.`
|
|
31380
|
+
},
|
|
31381
|
+
1
|
|
31382
|
+
);
|
|
31383
|
+
output_manager_default.error(msg);
|
|
31384
|
+
return 1;
|
|
31385
|
+
}
|
|
31386
|
+
acceptedPolicies = await promptForTermAcceptance(client, integration);
|
|
31387
|
+
if (!acceptedPolicies) {
|
|
31388
|
+
return 1;
|
|
30996
31389
|
}
|
|
30997
31390
|
try {
|
|
30998
31391
|
const result = await installMarketplaceIntegration(
|
|
@@ -31077,7 +31470,7 @@ async function main20(client) {
|
|
|
31077
31470
|
subcommand,
|
|
31078
31471
|
subcommandOriginal,
|
|
31079
31472
|
args: subArgs
|
|
31080
|
-
} =
|
|
31473
|
+
} = getSubcommand5(args.slice(1), COMMAND_CONFIG27);
|
|
31081
31474
|
const needHelp = flags["--help"];
|
|
31082
31475
|
function printHelp(command) {
|
|
31083
31476
|
output_manager_default.print(
|
|
@@ -32119,7 +32512,7 @@ async function main21(client) {
|
|
|
32119
32512
|
subcommand,
|
|
32120
32513
|
subcommandOriginal,
|
|
32121
32514
|
args: subArgs
|
|
32122
|
-
} =
|
|
32515
|
+
} = getSubcommand5(args.slice(1), COMMAND_CONFIG28);
|
|
32123
32516
|
const needHelp = flags["--help"];
|
|
32124
32517
|
if (!subcommand && needHelp) {
|
|
32125
32518
|
telemetry2.trackCliFlagHelp("integration-resource");
|
|
@@ -32172,14 +32565,14 @@ async function main21(client) {
|
|
|
32172
32565
|
}
|
|
32173
32566
|
|
|
32174
32567
|
// src/commands/logout/index.ts
|
|
32175
|
-
var
|
|
32568
|
+
var import_error_utils13 = __toESM(require_dist(), 1);
|
|
32176
32569
|
|
|
32177
32570
|
// src/util/telemetry/commands/logout/index.ts
|
|
32178
32571
|
var LogoutTelemetryClient = class extends TelemetryClient {
|
|
32179
32572
|
};
|
|
32180
32573
|
|
|
32181
32574
|
// src/commands/logout/future.ts
|
|
32182
|
-
var
|
|
32575
|
+
var import_error_utils12 = __toESM(require_dist(), 1);
|
|
32183
32576
|
async function logout(client) {
|
|
32184
32577
|
const { authConfig } = client;
|
|
32185
32578
|
if (!authConfig.token) {
|
|
@@ -32212,7 +32605,7 @@ async function logout(client) {
|
|
|
32212
32605
|
return 0;
|
|
32213
32606
|
}
|
|
32214
32607
|
} catch (err) {
|
|
32215
|
-
output_manager_default.debug((0,
|
|
32608
|
+
output_manager_default.debug((0, import_error_utils12.errorToString)(err));
|
|
32216
32609
|
output_manager_default.error("Failed during logout");
|
|
32217
32610
|
}
|
|
32218
32611
|
return 1;
|
|
@@ -32274,7 +32667,7 @@ async function logout2(client) {
|
|
|
32274
32667
|
writeToAuthConfigFile(authConfig);
|
|
32275
32668
|
output_manager_default.debug("Configuration has been deleted");
|
|
32276
32669
|
} catch (err) {
|
|
32277
|
-
output_manager_default.debug((0,
|
|
32670
|
+
output_manager_default.debug((0, import_error_utils13.errorToString)(err));
|
|
32278
32671
|
exitCode2 = 1;
|
|
32279
32672
|
}
|
|
32280
32673
|
if (exitCode2 === 0) {
|
|
@@ -32286,7 +32679,7 @@ async function logout2(client) {
|
|
|
32286
32679
|
}
|
|
32287
32680
|
|
|
32288
32681
|
// src/commands/logs/index.ts
|
|
32289
|
-
var
|
|
32682
|
+
var import_error_utils14 = __toESM(require_dist(), 1);
|
|
32290
32683
|
var import_chalk140 = __toESM(require_source(), 1);
|
|
32291
32684
|
var import_format21 = __toESM(require_format(), 1);
|
|
32292
32685
|
|
|
@@ -32446,14 +32839,6 @@ var LogsTelemetryClient = class extends TelemetryClient {
|
|
|
32446
32839
|
});
|
|
32447
32840
|
}
|
|
32448
32841
|
}
|
|
32449
|
-
trackCliOptionProject(v) {
|
|
32450
|
-
if (v) {
|
|
32451
|
-
this.trackCliOption({
|
|
32452
|
-
option: "project",
|
|
32453
|
-
value: this.redactedValue
|
|
32454
|
-
});
|
|
32455
|
-
}
|
|
32456
|
-
}
|
|
32457
32842
|
trackCliOptionDeployment(v) {
|
|
32458
32843
|
if (v) {
|
|
32459
32844
|
this.trackCliOption({
|
|
@@ -32910,7 +33295,7 @@ async function logs(client) {
|
|
|
32910
33295
|
try {
|
|
32911
33296
|
({ contextName } = await getScope(client));
|
|
32912
33297
|
} catch (err) {
|
|
32913
|
-
if ((0,
|
|
33298
|
+
if ((0, import_error_utils14.isErrnoException)(err) && (err.code === "NOT_AUTHORIZED" || err.code === "TEAM_DELETED")) {
|
|
32914
33299
|
output_manager_default.error(err.message);
|
|
32915
33300
|
return 1;
|
|
32916
33301
|
}
|
|
@@ -33853,14 +34238,6 @@ var MetricsTelemetryClient = class extends TelemetryClient {
|
|
|
33853
34238
|
});
|
|
33854
34239
|
}
|
|
33855
34240
|
}
|
|
33856
|
-
trackCliOptionProject(v) {
|
|
33857
|
-
if (v) {
|
|
33858
|
-
this.trackCliOption({
|
|
33859
|
-
option: "project",
|
|
33860
|
-
value: this.redactedValue
|
|
33861
|
-
});
|
|
33862
|
-
}
|
|
33863
|
-
}
|
|
33864
34241
|
trackCliFlagAll(v) {
|
|
33865
34242
|
if (v) {
|
|
33866
34243
|
this.trackCliFlag("all");
|
|
@@ -33889,7 +34266,7 @@ async function metrics(client) {
|
|
|
33889
34266
|
return 1;
|
|
33890
34267
|
}
|
|
33891
34268
|
const subArgs = parsedArgs.args.slice(1);
|
|
33892
|
-
const { subcommand, subcommandOriginal } =
|
|
34269
|
+
const { subcommand, subcommandOriginal } = getSubcommand5(
|
|
33893
34270
|
subArgs,
|
|
33894
34271
|
COMMAND_CONFIG29
|
|
33895
34272
|
);
|
|
@@ -33916,7 +34293,7 @@ async function metrics(client) {
|
|
|
33916
34293
|
return 0;
|
|
33917
34294
|
}
|
|
33918
34295
|
telemetry2.trackCliSubcommandSchema(subcommandOriginal);
|
|
33919
|
-
const schemaFn = (await import("./chunks/schema-
|
|
34296
|
+
const schemaFn = (await import("./chunks/schema-3I4KYWU3.js")).default;
|
|
33920
34297
|
return schemaFn(client, telemetry2);
|
|
33921
34298
|
}
|
|
33922
34299
|
default: {
|
|
@@ -33929,7 +34306,7 @@ async function metrics(client) {
|
|
|
33929
34306
|
output_manager_default.print(help(metricsCommand, { columns: client.stderr.columns }));
|
|
33930
34307
|
return 2;
|
|
33931
34308
|
}
|
|
33932
|
-
const queryFn = (await import("./chunks/query-
|
|
34309
|
+
const queryFn = (await import("./chunks/query-JM422UQL.js")).default;
|
|
33933
34310
|
return queryFn(client, telemetry2);
|
|
33934
34311
|
}
|
|
33935
34312
|
}
|
|
@@ -33937,7 +34314,7 @@ async function metrics(client) {
|
|
|
33937
34314
|
|
|
33938
34315
|
// src/commands/microfrontends/pull.ts
|
|
33939
34316
|
var import_chalk141 = __toESM(require_source(), 1);
|
|
33940
|
-
import { join as
|
|
34317
|
+
import { join as join5 } from "path";
|
|
33941
34318
|
var import_fs_extra = __toESM(require_lib(), 1);
|
|
33942
34319
|
var VERCEL_DIR = ".vercel";
|
|
33943
34320
|
var VERCEL_DIR_MICROFRONTENDS = "microfrontends.json";
|
|
@@ -33960,7 +34337,7 @@ async function pull2(client) {
|
|
|
33960
34337
|
const { project, org, repoRoot } = link;
|
|
33961
34338
|
let currentDirectory;
|
|
33962
34339
|
if (repoRoot) {
|
|
33963
|
-
currentDirectory =
|
|
34340
|
+
currentDirectory = join5(repoRoot, project.rootDirectory || "");
|
|
33964
34341
|
} else {
|
|
33965
34342
|
currentDirectory = client.cwd;
|
|
33966
34343
|
}
|
|
@@ -33998,7 +34375,7 @@ async function pull2(client) {
|
|
|
33998
34375
|
)
|
|
33999
34376
|
};
|
|
34000
34377
|
output_manager_default.stopSpinner();
|
|
34001
|
-
const path3 =
|
|
34378
|
+
const path3 = join5(currentDirectory, VERCEL_DIR, VERCEL_DIR_MICROFRONTENDS);
|
|
34002
34379
|
await (0, import_fs_extra.outputJSON)(path3, sanitizedConfig, {
|
|
34003
34380
|
spaces: 2
|
|
34004
34381
|
});
|
|
@@ -34007,7 +34384,7 @@ async function pull2(client) {
|
|
|
34007
34384
|
`${prependEmoji(
|
|
34008
34385
|
`Downloaded microfrontends configuration to ${import_chalk141.default.bold(
|
|
34009
34386
|
humanizePath(
|
|
34010
|
-
|
|
34387
|
+
join5(currentDirectory, VERCEL_DIR, VERCEL_DIR_MICROFRONTENDS)
|
|
34011
34388
|
)
|
|
34012
34389
|
)} ${import_chalk141.default.gray(microfrontendsStamp())}`,
|
|
34013
34390
|
emoji("success")
|
|
@@ -34024,9 +34401,9 @@ async function pull2(client) {
|
|
|
34024
34401
|
|
|
34025
34402
|
// src/commands/microfrontends/create-group.ts
|
|
34026
34403
|
var import_chalk142 = __toESM(require_source(), 1);
|
|
34027
|
-
import { writeFile as
|
|
34404
|
+
import { writeFile as writeFile4 } from "fs/promises";
|
|
34028
34405
|
import { existsSync } from "fs";
|
|
34029
|
-
import { join as
|
|
34406
|
+
import { join as join6 } from "path";
|
|
34030
34407
|
|
|
34031
34408
|
// src/commands/microfrontends/utils.ts
|
|
34032
34409
|
async function ensureMicrofrontendsContext(client, options) {
|
|
@@ -34450,8 +34827,8 @@ async function createGroup(client) {
|
|
|
34450
34827
|
const linkedProject = link.status === "linked" ? link.project : void 0;
|
|
34451
34828
|
if (linkedProject && linkedProject.id === defaultApp.id) {
|
|
34452
34829
|
const repoRoot = link.status === "linked" ? link.repoRoot : void 0;
|
|
34453
|
-
const projectDir = repoRoot ?
|
|
34454
|
-
const configPath =
|
|
34830
|
+
const projectDir = repoRoot ? join6(repoRoot, linkedProject.rootDirectory || "") : client.cwd;
|
|
34831
|
+
const configPath = join6(projectDir, "microfrontends.json");
|
|
34455
34832
|
if (!existsSync(configPath)) {
|
|
34456
34833
|
output_manager_default.log("");
|
|
34457
34834
|
output_manager_default.log(
|
|
@@ -34488,7 +34865,7 @@ async function createGroup(client) {
|
|
|
34488
34865
|
routingPaths,
|
|
34489
34866
|
productionAlias
|
|
34490
34867
|
);
|
|
34491
|
-
await
|
|
34868
|
+
await writeFile4(configPath, config + "\n", "utf-8");
|
|
34492
34869
|
output_manager_default.success(`Created ${import_chalk142.default.bold("microfrontends.json")}`);
|
|
34493
34870
|
output_manager_default.log(
|
|
34494
34871
|
"Create a preview deployment to test microfrontends before deploying to production."
|
|
@@ -35100,7 +35477,7 @@ async function deleteGroup(client) {
|
|
|
35100
35477
|
|
|
35101
35478
|
// src/commands/microfrontends/inspect-group.ts
|
|
35102
35479
|
import { existsSync as existsSync2 } from "fs";
|
|
35103
|
-
import { join as
|
|
35480
|
+
import { join as join7 } from "path";
|
|
35104
35481
|
var import_chalk146 = __toESM(require_source(), 1);
|
|
35105
35482
|
async function inspectGroup(client) {
|
|
35106
35483
|
let parsedArgs;
|
|
@@ -35366,8 +35743,8 @@ async function resolvePackageNameFromLocalRepo(localRepoContext, gitOrg, gitRepo
|
|
|
35366
35743
|
if (!isProjectInLocalRepo(localRepoContext, gitOrg, gitRepo)) {
|
|
35367
35744
|
return null;
|
|
35368
35745
|
}
|
|
35369
|
-
const projectDir =
|
|
35370
|
-
const packageJsonPath =
|
|
35746
|
+
const projectDir = join7(localRepoContext.repoRoot, rootDirectory || "");
|
|
35747
|
+
const packageJsonPath = join7(projectDir, "package.json");
|
|
35371
35748
|
const pkg = await readJSONFile(packageJsonPath);
|
|
35372
35749
|
if (!pkg || pkg instanceof Error) {
|
|
35373
35750
|
return null;
|
|
@@ -35386,19 +35763,19 @@ function resolveLocalConfigFilePath(projects, localRepoContext, configuredConfig
|
|
|
35386
35763
|
)) {
|
|
35387
35764
|
return null;
|
|
35388
35765
|
}
|
|
35389
|
-
const projectDir =
|
|
35766
|
+
const projectDir = join7(
|
|
35390
35767
|
localRepoContext.repoRoot,
|
|
35391
35768
|
defaultProject.git.rootDirectory || ""
|
|
35392
35769
|
);
|
|
35393
35770
|
const configuredName = configuredConfigFileName ?? null;
|
|
35394
35771
|
if (configuredName) {
|
|
35395
|
-
const configuredPath =
|
|
35772
|
+
const configuredPath = join7(projectDir, configuredName);
|
|
35396
35773
|
if (existsSync2(configuredPath)) {
|
|
35397
35774
|
return configuredPath;
|
|
35398
35775
|
}
|
|
35399
35776
|
}
|
|
35400
|
-
const jsonPath =
|
|
35401
|
-
const jsoncPath =
|
|
35777
|
+
const jsonPath = join7(projectDir, "microfrontends.json");
|
|
35778
|
+
const jsoncPath = join7(projectDir, "microfrontends.jsonc");
|
|
35402
35779
|
if (existsSync2(jsonPath)) {
|
|
35403
35780
|
return jsonPath;
|
|
35404
35781
|
}
|
|
@@ -35485,7 +35862,7 @@ async function main23(client) {
|
|
|
35485
35862
|
printError(error);
|
|
35486
35863
|
return 1;
|
|
35487
35864
|
}
|
|
35488
|
-
const { subcommand, subcommandOriginal } =
|
|
35865
|
+
const { subcommand, subcommandOriginal } = getSubcommand5(
|
|
35489
35866
|
parsedArgs.args.slice(1),
|
|
35490
35867
|
COMMAND_CONFIG30
|
|
35491
35868
|
);
|
|
@@ -35808,7 +36185,7 @@ async function main24(client) {
|
|
|
35808
36185
|
printError(error);
|
|
35809
36186
|
return 1;
|
|
35810
36187
|
}
|
|
35811
|
-
const { subcommand, args } =
|
|
36188
|
+
const { subcommand, args } = getSubcommand5(
|
|
35812
36189
|
parsedArgs.args.slice(1),
|
|
35813
36190
|
COMMAND_CONFIG31
|
|
35814
36191
|
);
|
|
@@ -37634,7 +38011,7 @@ var ProjectRmTelemetryClient = class extends TelemetryClient {
|
|
|
37634
38011
|
|
|
37635
38012
|
// src/commands/project/rm.ts
|
|
37636
38013
|
var e = encodeURIComponent;
|
|
37637
|
-
async function
|
|
38014
|
+
async function rm8(client, argv) {
|
|
37638
38015
|
const telemetryClient = new ProjectRmTelemetryClient({
|
|
37639
38016
|
opts: {
|
|
37640
38017
|
store: client.telemetryEventStore
|
|
@@ -38420,7 +38797,7 @@ async function main25(client) {
|
|
|
38420
38797
|
printError(error);
|
|
38421
38798
|
return 1;
|
|
38422
38799
|
}
|
|
38423
|
-
let { subcommand, args, subcommandOriginal } =
|
|
38800
|
+
let { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
38424
38801
|
parsedArgs.args.slice(1),
|
|
38425
38802
|
COMMAND_CONFIG32
|
|
38426
38803
|
);
|
|
@@ -38547,7 +38924,7 @@ async function main25(client) {
|
|
|
38547
38924
|
return printHelp(removeSubcommand12);
|
|
38548
38925
|
}
|
|
38549
38926
|
telemetry2.trackCliSubcommandRemove(subcommandOriginal);
|
|
38550
|
-
exitCode2 = await
|
|
38927
|
+
exitCode2 = await rm8(client, args);
|
|
38551
38928
|
break;
|
|
38552
38929
|
default: {
|
|
38553
38930
|
const fallback = await tryOpenApiFallback(
|
|
@@ -38572,7 +38949,7 @@ async function main25(client) {
|
|
|
38572
38949
|
|
|
38573
38950
|
// src/commands/promote/index.ts
|
|
38574
38951
|
var import_ms24 = __toESM(require_ms(), 1);
|
|
38575
|
-
var
|
|
38952
|
+
var import_error_utils15 = __toESM(require_dist(), 1);
|
|
38576
38953
|
|
|
38577
38954
|
// src/commands/promote/request-promote.ts
|
|
38578
38955
|
var import_chalk161 = __toESM(require_source(), 1);
|
|
@@ -39017,7 +39394,7 @@ var promote_default = async (client) => {
|
|
|
39017
39394
|
yes
|
|
39018
39395
|
});
|
|
39019
39396
|
} catch (err) {
|
|
39020
|
-
if ((0,
|
|
39397
|
+
if ((0, import_error_utils15.isErrnoException)(err)) {
|
|
39021
39398
|
if (err.code === "ERR_CANCELED") {
|
|
39022
39399
|
return 0;
|
|
39023
39400
|
}
|
|
@@ -39094,7 +39471,7 @@ async function getDeploymentByIdOrURL({
|
|
|
39094
39471
|
}
|
|
39095
39472
|
|
|
39096
39473
|
// src/commands/redeploy/index.ts
|
|
39097
|
-
var
|
|
39474
|
+
var import_error_utils16 = __toESM(require_dist(), 1);
|
|
39098
39475
|
|
|
39099
39476
|
// src/util/telemetry/commands/redeploy/index.ts
|
|
39100
39477
|
var RedeployTelemetryClient = class extends TelemetryClient {
|
|
@@ -39305,7 +39682,7 @@ async function redeploy(client) {
|
|
|
39305
39682
|
);
|
|
39306
39683
|
} catch (err) {
|
|
39307
39684
|
output_manager_default.prettyError(err);
|
|
39308
|
-
if ((0,
|
|
39685
|
+
if ((0, import_error_utils16.isErrnoException)(err) && err.code === "ERR_INVALID_TEAM") {
|
|
39309
39686
|
output_manager_default.error(
|
|
39310
39687
|
`Use ${import_chalk163.default.bold("vc switch")} to change your current team`
|
|
39311
39688
|
);
|
|
@@ -41237,7 +41614,7 @@ async function main26(client) {
|
|
|
41237
41614
|
return 1;
|
|
41238
41615
|
}
|
|
41239
41616
|
const subArgs = parsedArgs.args.slice(1);
|
|
41240
|
-
const { subcommand, args, subcommandOriginal } =
|
|
41617
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
41241
41618
|
subArgs,
|
|
41242
41619
|
COMMAND_CONFIG33
|
|
41243
41620
|
);
|
|
@@ -41652,7 +42029,7 @@ function deploymentsAndProjects(deployments, projects, conjunction = "and") {
|
|
|
41652
42029
|
}
|
|
41653
42030
|
|
|
41654
42031
|
// src/commands/rollback/index.ts
|
|
41655
|
-
var
|
|
42032
|
+
var import_error_utils17 = __toESM(require_dist(), 1);
|
|
41656
42033
|
var import_ms29 = __toESM(require_ms(), 1);
|
|
41657
42034
|
|
|
41658
42035
|
// src/commands/rollback/request-rollback.ts
|
|
@@ -41933,7 +42310,7 @@ var rollback_default = async (client) => {
|
|
|
41933
42310
|
timeout
|
|
41934
42311
|
});
|
|
41935
42312
|
} catch (err) {
|
|
41936
|
-
if ((0,
|
|
42313
|
+
if ((0, import_error_utils17.isErrnoException)(err)) {
|
|
41937
42314
|
if (err.code === "ERR_CANCELED") {
|
|
41938
42315
|
return 0;
|
|
41939
42316
|
}
|
|
@@ -42503,7 +42880,7 @@ async function rollingRelease(client) {
|
|
|
42503
42880
|
subcommand,
|
|
42504
42881
|
args: subcommandArgs,
|
|
42505
42882
|
subcommandOriginal
|
|
42506
|
-
} =
|
|
42883
|
+
} = getSubcommand5(client.argv.slice(3), COMMAND_CONFIG34);
|
|
42507
42884
|
const needHelp = client.argv.includes("--help") || client.argv.includes("-h");
|
|
42508
42885
|
if (!subcommand && needHelp) {
|
|
42509
42886
|
telemetry2.trackCliFlagHelp("rolling-release");
|
|
@@ -44766,7 +45143,7 @@ async function main27(client) {
|
|
|
44766
45143
|
return 1;
|
|
44767
45144
|
}
|
|
44768
45145
|
const subArgs = parsedArgs.args.slice(1);
|
|
44769
|
-
const { subcommand, args, subcommandOriginal } =
|
|
45146
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
44770
45147
|
subArgs,
|
|
44771
45148
|
COMMAND_CONFIG35
|
|
44772
45149
|
);
|
|
@@ -44824,7 +45201,7 @@ async function main27(client) {
|
|
|
44824
45201
|
return 2;
|
|
44825
45202
|
}
|
|
44826
45203
|
telemetry2.trackCliSubcommandEdit(subcommandOriginal);
|
|
44827
|
-
return (await import("./chunks/edit-
|
|
45204
|
+
return (await import("./chunks/edit-24LNAGLI.js")).default(client, args);
|
|
44828
45205
|
case "delete":
|
|
44829
45206
|
if (needHelp) {
|
|
44830
45207
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -44832,7 +45209,7 @@ async function main27(client) {
|
|
|
44832
45209
|
return 2;
|
|
44833
45210
|
}
|
|
44834
45211
|
telemetry2.trackCliSubcommandDelete(subcommandOriginal);
|
|
44835
|
-
return (await import("./chunks/delete-
|
|
45212
|
+
return (await import("./chunks/delete-FML7PGMQ.js")).default(client, args);
|
|
44836
45213
|
case "enable":
|
|
44837
45214
|
if (needHelp) {
|
|
44838
45215
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -44840,7 +45217,7 @@ async function main27(client) {
|
|
|
44840
45217
|
return 2;
|
|
44841
45218
|
}
|
|
44842
45219
|
telemetry2.trackCliSubcommandEnable(subcommandOriginal);
|
|
44843
|
-
return (await import("./chunks/enable-
|
|
45220
|
+
return (await import("./chunks/enable-XV6WCSRR.js")).default(client, args);
|
|
44844
45221
|
case "disable":
|
|
44845
45222
|
if (needHelp) {
|
|
44846
45223
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -44848,7 +45225,7 @@ async function main27(client) {
|
|
|
44848
45225
|
return 2;
|
|
44849
45226
|
}
|
|
44850
45227
|
telemetry2.trackCliSubcommandDisable(subcommandOriginal);
|
|
44851
|
-
return (await import("./chunks/disable-
|
|
45228
|
+
return (await import("./chunks/disable-LJFGBJQD.js")).default(client, args);
|
|
44852
45229
|
case "reorder":
|
|
44853
45230
|
if (needHelp) {
|
|
44854
45231
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -44856,7 +45233,7 @@ async function main27(client) {
|
|
|
44856
45233
|
return 2;
|
|
44857
45234
|
}
|
|
44858
45235
|
telemetry2.trackCliSubcommandReorder(subcommandOriginal);
|
|
44859
|
-
return (await import("./chunks/reorder-
|
|
45236
|
+
return (await import("./chunks/reorder-H5VPRRYP.js")).default(client, args);
|
|
44860
45237
|
case "export":
|
|
44861
45238
|
if (needHelp) {
|
|
44862
45239
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -44864,7 +45241,7 @@ async function main27(client) {
|
|
|
44864
45241
|
return 2;
|
|
44865
45242
|
}
|
|
44866
45243
|
telemetry2.trackCliSubcommandExport(subcommandOriginal);
|
|
44867
|
-
return (await import("./chunks/export-
|
|
45244
|
+
return (await import("./chunks/export-IZAJQNHO.js")).default(client, args);
|
|
44868
45245
|
case "publish":
|
|
44869
45246
|
if (needHelp) {
|
|
44870
45247
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -44872,7 +45249,7 @@ async function main27(client) {
|
|
|
44872
45249
|
return 2;
|
|
44873
45250
|
}
|
|
44874
45251
|
telemetry2.trackCliSubcommandPublish(subcommandOriginal);
|
|
44875
|
-
return (await import("./chunks/publish-
|
|
45252
|
+
return (await import("./chunks/publish-FV5R2JPI.js")).default(client, args);
|
|
44876
45253
|
case "restore":
|
|
44877
45254
|
if (needHelp) {
|
|
44878
45255
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -44880,7 +45257,7 @@ async function main27(client) {
|
|
|
44880
45257
|
return 2;
|
|
44881
45258
|
}
|
|
44882
45259
|
telemetry2.trackCliSubcommandRestore(subcommandOriginal);
|
|
44883
|
-
return (await import("./chunks/restore-
|
|
45260
|
+
return (await import("./chunks/restore-JPFHV2E2.js")).default(client, args);
|
|
44884
45261
|
case "discard-staging":
|
|
44885
45262
|
if (needHelp) {
|
|
44886
45263
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -44888,7 +45265,7 @@ async function main27(client) {
|
|
|
44888
45265
|
return 2;
|
|
44889
45266
|
}
|
|
44890
45267
|
telemetry2.trackCliSubcommandDiscardStaging(subcommandOriginal);
|
|
44891
|
-
return (await import("./chunks/discard-
|
|
45268
|
+
return (await import("./chunks/discard-JKLUB56V.js")).default(client, args);
|
|
44892
45269
|
default:
|
|
44893
45270
|
output_manager_default.error(getInvalidSubcommand(COMMAND_CONFIG35));
|
|
44894
45271
|
output_manager_default.print(help(routesCommand, { columns: client.stderr.columns }));
|
|
@@ -44962,10 +45339,10 @@ async function sandbox(client) {
|
|
|
44962
45339
|
var import_chalk178 = __toESM(require_source(), 1);
|
|
44963
45340
|
var import_frameworks2 = __toESM(require_frameworks(), 1);
|
|
44964
45341
|
var import_fs_detectors = __toESM(require_dist3(), 1);
|
|
44965
|
-
import { access as access2, readFile as
|
|
44966
|
-
import { join as
|
|
45342
|
+
import { access as access2, readFile as readFile6 } from "fs/promises";
|
|
45343
|
+
import { join as join8 } from "path";
|
|
44967
45344
|
import { homedir } from "os";
|
|
44968
|
-
import { spawn as
|
|
45345
|
+
import { spawn as spawn4 } from "child_process";
|
|
44969
45346
|
|
|
44970
45347
|
// src/util/telemetry/commands/skills/index.ts
|
|
44971
45348
|
var SkillsTelemetryClient = class extends TelemetryClient {
|
|
@@ -45066,7 +45443,7 @@ async function detectProjectFramework(cwd) {
|
|
|
45066
45443
|
}
|
|
45067
45444
|
async function readPackageDeps(cwd) {
|
|
45068
45445
|
try {
|
|
45069
|
-
const raw = await
|
|
45446
|
+
const raw = await readFile6(join8(cwd, "package.json"), "utf8");
|
|
45070
45447
|
const pkg = JSON.parse(raw);
|
|
45071
45448
|
const allDeps = {
|
|
45072
45449
|
...pkg.dependencies,
|
|
@@ -45086,8 +45463,8 @@ function cleanDepName(dep) {
|
|
|
45086
45463
|
async function isSkillInstalled(name, cwd) {
|
|
45087
45464
|
const sanitized = name.toLowerCase().replace(/\s+/g, "-");
|
|
45088
45465
|
const dirs = [
|
|
45089
|
-
|
|
45090
|
-
|
|
45466
|
+
join8(cwd, ".agents", "skills", sanitized),
|
|
45467
|
+
join8(homedir(), ".agents", "skills", sanitized)
|
|
45091
45468
|
];
|
|
45092
45469
|
for (const dir of dirs) {
|
|
45093
45470
|
try {
|
|
@@ -45355,7 +45732,7 @@ ${table(tableData, { hsep: 4 })}`);
|
|
|
45355
45732
|
}
|
|
45356
45733
|
function runCommand(cmd2, args) {
|
|
45357
45734
|
return new Promise((resolve8) => {
|
|
45358
|
-
const child =
|
|
45735
|
+
const child = spawn4(cmd2, args, {
|
|
45359
45736
|
stdio: "pipe"
|
|
45360
45737
|
});
|
|
45361
45738
|
child.on("close", (code2) => resolve8(code2 ?? 1));
|
|
@@ -45765,7 +46142,7 @@ async function inviteUserToTeam(client, teamId, email2) {
|
|
|
45765
46142
|
}
|
|
45766
46143
|
|
|
45767
46144
|
// src/commands/teams/invite.ts
|
|
45768
|
-
var
|
|
46145
|
+
var import_error_utils18 = __toESM(require_dist(), 1);
|
|
45769
46146
|
|
|
45770
46147
|
// src/util/telemetry/commands/teams/invite.ts
|
|
45771
46148
|
var TeamsInviteTelemetryClient = class extends TelemetryClient {
|
|
@@ -45953,7 +46330,7 @@ Please select a team scope using ${getCommandName(
|
|
|
45953
46330
|
validate: validateEmail
|
|
45954
46331
|
});
|
|
45955
46332
|
} catch (err) {
|
|
45956
|
-
if (!(0,
|
|
46333
|
+
if (!(0, import_error_utils18.isError)(err) || err.message !== "USER_ABORT") {
|
|
45957
46334
|
throw err;
|
|
45958
46335
|
}
|
|
45959
46336
|
}
|
|
@@ -45983,7 +46360,7 @@ Please select a team scope using ${getCommandName(
|
|
|
45983
46360
|
} catch (err) {
|
|
45984
46361
|
output_manager_default.stopSpinner();
|
|
45985
46362
|
process.stderr.write(eraseLines(emails.length + 2));
|
|
45986
|
-
output_manager_default.error((0,
|
|
46363
|
+
output_manager_default.error((0, import_error_utils18.errorToString)(err));
|
|
45987
46364
|
hasError = true;
|
|
45988
46365
|
for (const email3 of emails) {
|
|
45989
46366
|
output_manager_default.log(`${import_chalk181.default.cyan(chars_default.tick)} ${sentEmailPrefix}${email3}`);
|
|
@@ -46036,7 +46413,7 @@ async function patchTeam(client, teamId, payload) {
|
|
|
46036
46413
|
}
|
|
46037
46414
|
|
|
46038
46415
|
// src/commands/teams/add.ts
|
|
46039
|
-
var
|
|
46416
|
+
var import_error_utils19 = __toESM(require_dist(), 1);
|
|
46040
46417
|
var validateSlug = (value) => /^[a-z]+[a-z0-9_-]*$/.test(value);
|
|
46041
46418
|
var validateName = (value) => /^[ a-zA-Z0-9_-]+$/.test(value);
|
|
46042
46419
|
var teamUrlPrefix = "Team URL".padEnd(14) + import_chalk182.default.gray("vercel.com/");
|
|
@@ -46070,8 +46447,8 @@ function createTeamWithTimeout(client, slug) {
|
|
|
46070
46447
|
]);
|
|
46071
46448
|
}
|
|
46072
46449
|
function formatCreateTeamError(err, slug) {
|
|
46073
|
-
const isAbort = (0,
|
|
46074
|
-
const isTimeoutMsg = (0,
|
|
46450
|
+
const isAbort = (0, import_error_utils19.isError)(err) && err.name === "AbortError";
|
|
46451
|
+
const isTimeoutMsg = (0, import_error_utils19.isError)(err) && err.message === "Request timed out.";
|
|
46075
46452
|
if (isAbort || isTimeoutMsg) {
|
|
46076
46453
|
return TIMEOUT_HINT;
|
|
46077
46454
|
}
|
|
@@ -46095,11 +46472,11 @@ function formatCreateTeamError(err, slug) {
|
|
|
46095
46472
|
const prefix = slugHint || paymentHint;
|
|
46096
46473
|
return prefix ? `${prefix}${prefix.trim() ? "\n" : ""}${err.serverMessage || err.message}` : err.serverMessage || err.message;
|
|
46097
46474
|
}
|
|
46098
|
-
return (0,
|
|
46475
|
+
return (0, import_error_utils19.errorToString)(err);
|
|
46099
46476
|
}
|
|
46100
46477
|
function formatCreateTeamErrorPlain(err, slug) {
|
|
46101
|
-
const isAbort = (0,
|
|
46102
|
-
const isTimeoutMsg = (0,
|
|
46478
|
+
const isAbort = (0, import_error_utils19.isError)(err) && err.name === "AbortError";
|
|
46479
|
+
const isTimeoutMsg = (0, import_error_utils19.isError)(err) && err.message === "Request timed out.";
|
|
46103
46480
|
if (isAbort || isTimeoutMsg) {
|
|
46104
46481
|
return TIMEOUT_HINT;
|
|
46105
46482
|
}
|
|
@@ -46113,7 +46490,7 @@ function formatCreateTeamErrorPlain(err, slug) {
|
|
|
46113
46490
|
const prefix = slugHint || paymentHint;
|
|
46114
46491
|
return prefix ? `${prefix}${prefix.trim() ? "\n" : ""}${err.serverMessage || err.message}` : err.serverMessage || err.message;
|
|
46115
46492
|
}
|
|
46116
|
-
return (0,
|
|
46493
|
+
return (0, import_error_utils19.errorToString)(err);
|
|
46117
46494
|
}
|
|
46118
46495
|
var VERCEL_ACCOUNT_BILLING_URL = "https://vercel.com/account/billing";
|
|
46119
46496
|
function createTeamErrorReason(err) {
|
|
@@ -46126,7 +46503,7 @@ function createTeamErrorReason(err) {
|
|
|
46126
46503
|
}
|
|
46127
46504
|
if (isAPIError(err) && err.status === 429)
|
|
46128
46505
|
return "rate_limited";
|
|
46129
|
-
if ((0,
|
|
46506
|
+
if ((0, import_error_utils19.isError)(err) && (err.name === "AbortError" || err.message === "Request timed out.")) {
|
|
46130
46507
|
return "timeout";
|
|
46131
46508
|
}
|
|
46132
46509
|
return "team_creation_failed";
|
|
@@ -46273,12 +46650,12 @@ async function add11(client, argv = []) {
|
|
|
46273
46650
|
{
|
|
46274
46651
|
status: "error",
|
|
46275
46652
|
reason: "team_update_failed",
|
|
46276
|
-
message: (0,
|
|
46653
|
+
message: (0, import_error_utils19.errorToString)(err)
|
|
46277
46654
|
},
|
|
46278
46655
|
1
|
|
46279
46656
|
);
|
|
46280
46657
|
}
|
|
46281
|
-
output_manager_default.error((0,
|
|
46658
|
+
output_manager_default.error((0, import_error_utils19.errorToString)(err));
|
|
46282
46659
|
return 1;
|
|
46283
46660
|
}
|
|
46284
46661
|
output_manager_default.stopSpinner();
|
|
@@ -46305,7 +46682,7 @@ async function add11(client, argv = []) {
|
|
|
46305
46682
|
default: slug
|
|
46306
46683
|
});
|
|
46307
46684
|
} catch (err) {
|
|
46308
|
-
if ((0,
|
|
46685
|
+
if ((0, import_error_utils19.isError)(err) && err.message === "USER_ABORT") {
|
|
46309
46686
|
output_manager_default.log("Canceled");
|
|
46310
46687
|
return 0;
|
|
46311
46688
|
}
|
|
@@ -46336,7 +46713,7 @@ async function add11(client, argv = []) {
|
|
|
46336
46713
|
default: name
|
|
46337
46714
|
});
|
|
46338
46715
|
} catch (err) {
|
|
46339
|
-
if ((0,
|
|
46716
|
+
if ((0, import_error_utils19.isError)(err) && err.message === "USER_ABORT") {
|
|
46340
46717
|
output_manager_default.log("No name specified");
|
|
46341
46718
|
return 2;
|
|
46342
46719
|
}
|
|
@@ -47082,7 +47459,7 @@ async function teams(client) {
|
|
|
47082
47459
|
if (parsedArgs.args[0] === "switch") {
|
|
47083
47460
|
parsedArgs.args.unshift("teams");
|
|
47084
47461
|
}
|
|
47085
|
-
const { subcommand, args, subcommandOriginal } =
|
|
47462
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
47086
47463
|
parsedArgs.args.slice(1),
|
|
47087
47464
|
COMMAND_CONFIG37
|
|
47088
47465
|
);
|
|
@@ -47431,7 +47808,7 @@ async function add12(client, argv) {
|
|
|
47431
47808
|
}
|
|
47432
47809
|
|
|
47433
47810
|
// src/commands/tokens/rm.ts
|
|
47434
|
-
async function
|
|
47811
|
+
async function rm9(client, argv) {
|
|
47435
47812
|
let parsedArgs;
|
|
47436
47813
|
const flagsSpecification = getFlagsSpecification(removeSubcommand14.options);
|
|
47437
47814
|
try {
|
|
@@ -47537,7 +47914,7 @@ async function main29(client) {
|
|
|
47537
47914
|
store: client.telemetryEventStore
|
|
47538
47915
|
}
|
|
47539
47916
|
});
|
|
47540
|
-
const { subcommand, args, subcommandOriginal } =
|
|
47917
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
47541
47918
|
parsedArgs.args.slice(1),
|
|
47542
47919
|
COMMAND_CONFIG38
|
|
47543
47920
|
);
|
|
@@ -47567,7 +47944,7 @@ async function main29(client) {
|
|
|
47567
47944
|
return printHelp(removeSubcommand14);
|
|
47568
47945
|
}
|
|
47569
47946
|
telemetry2.trackCliSubcommandRemove(subcommandOriginal);
|
|
47570
|
-
return
|
|
47947
|
+
return rm9(client, args);
|
|
47571
47948
|
default:
|
|
47572
47949
|
if (needHelp) {
|
|
47573
47950
|
telemetry2.trackCliFlagHelp("tokens", subcommandOriginal);
|
|
@@ -47704,7 +48081,7 @@ async function telemetry(client) {
|
|
|
47704
48081
|
printError(err);
|
|
47705
48082
|
return 1;
|
|
47706
48083
|
}
|
|
47707
|
-
const { subcommand, args, subcommandOriginal } =
|
|
48084
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
47708
48085
|
parsedArguments.args.slice(1),
|
|
47709
48086
|
COMMAND_CONFIG39
|
|
47710
48087
|
);
|
|
@@ -47760,6 +48137,555 @@ async function telemetry(client) {
|
|
|
47760
48137
|
}
|
|
47761
48138
|
}
|
|
47762
48139
|
|
|
48140
|
+
// src/util/telemetry/commands/traces/index.ts
|
|
48141
|
+
var TracesTelemetryClient = class extends TelemetryClient {
|
|
48142
|
+
trackCliArgumentRequestId(requestId) {
|
|
48143
|
+
if (requestId) {
|
|
48144
|
+
this.trackCliArgument({
|
|
48145
|
+
arg: "requestId",
|
|
48146
|
+
value: this.redactedValue
|
|
48147
|
+
});
|
|
48148
|
+
}
|
|
48149
|
+
}
|
|
48150
|
+
trackCliFlagJson(json) {
|
|
48151
|
+
if (json) {
|
|
48152
|
+
this.trackCliFlag("json");
|
|
48153
|
+
}
|
|
48154
|
+
}
|
|
48155
|
+
trackCliOptionProject(project) {
|
|
48156
|
+
if (project) {
|
|
48157
|
+
this.trackCliOption({
|
|
48158
|
+
option: "project",
|
|
48159
|
+
value: this.redactedValue
|
|
48160
|
+
});
|
|
48161
|
+
}
|
|
48162
|
+
}
|
|
48163
|
+
};
|
|
48164
|
+
|
|
48165
|
+
// src/commands/traces/fetch-trace.ts
|
|
48166
|
+
async function fetchTrace({
|
|
48167
|
+
client,
|
|
48168
|
+
teamId,
|
|
48169
|
+
projectId,
|
|
48170
|
+
requestId
|
|
48171
|
+
}) {
|
|
48172
|
+
const search = new URLSearchParams({ teamId, projectId, requestId });
|
|
48173
|
+
const url = `/v1/projects/traces?${search.toString()}`;
|
|
48174
|
+
const response = await client.fetch(url);
|
|
48175
|
+
return { trace: response.trace };
|
|
48176
|
+
}
|
|
48177
|
+
|
|
48178
|
+
// src/commands/traces/analyze.ts
|
|
48179
|
+
var MAX_TREE_DEPTH = 256;
|
|
48180
|
+
var SPAN_STATUS_ERROR = 1;
|
|
48181
|
+
var ATTR_HINT_KEYS = [
|
|
48182
|
+
"http.url",
|
|
48183
|
+
"http.target",
|
|
48184
|
+
"db.statement",
|
|
48185
|
+
"http.status_code"
|
|
48186
|
+
];
|
|
48187
|
+
function tupleToUs(tuple) {
|
|
48188
|
+
if (!tuple || tuple.length !== 2) {
|
|
48189
|
+
return null;
|
|
48190
|
+
}
|
|
48191
|
+
const [seconds, nanoseconds] = tuple;
|
|
48192
|
+
if (typeof seconds !== "number" || typeof nanoseconds !== "number") {
|
|
48193
|
+
return null;
|
|
48194
|
+
}
|
|
48195
|
+
return seconds * 1e6 + nanoseconds / 1e3;
|
|
48196
|
+
}
|
|
48197
|
+
function getDurationUs(span) {
|
|
48198
|
+
const us = tupleToUs(span.duration);
|
|
48199
|
+
if (us === null) {
|
|
48200
|
+
return null;
|
|
48201
|
+
}
|
|
48202
|
+
return us < 0 ? 0 : us;
|
|
48203
|
+
}
|
|
48204
|
+
function getStartTimeUs(span) {
|
|
48205
|
+
return tupleToUs(span.startTime);
|
|
48206
|
+
}
|
|
48207
|
+
function readAttrString(attributes, key) {
|
|
48208
|
+
const value = attributes?.[key];
|
|
48209
|
+
if (typeof value === "string") {
|
|
48210
|
+
return value;
|
|
48211
|
+
}
|
|
48212
|
+
if (typeof value === "number") {
|
|
48213
|
+
return String(value);
|
|
48214
|
+
}
|
|
48215
|
+
return void 0;
|
|
48216
|
+
}
|
|
48217
|
+
function resolveRootSpan(trace2) {
|
|
48218
|
+
if (trace2.spans.length === 0) {
|
|
48219
|
+
return void 0;
|
|
48220
|
+
}
|
|
48221
|
+
if (trace2.rootSpanId) {
|
|
48222
|
+
const match = trace2.spans.find((span) => span.spanId === trace2.rootSpanId);
|
|
48223
|
+
if (match) {
|
|
48224
|
+
return match;
|
|
48225
|
+
}
|
|
48226
|
+
}
|
|
48227
|
+
return trace2.spans[0];
|
|
48228
|
+
}
|
|
48229
|
+
function compareByStart(a, b) {
|
|
48230
|
+
const startA = getStartTimeUs(a);
|
|
48231
|
+
const startB = getStartTimeUs(b);
|
|
48232
|
+
if (startA === null && startB === null) {
|
|
48233
|
+
return 0;
|
|
48234
|
+
}
|
|
48235
|
+
if (startA === null) {
|
|
48236
|
+
return 1;
|
|
48237
|
+
}
|
|
48238
|
+
if (startB === null) {
|
|
48239
|
+
return -1;
|
|
48240
|
+
}
|
|
48241
|
+
return startA - startB;
|
|
48242
|
+
}
|
|
48243
|
+
function analyze(trace2) {
|
|
48244
|
+
const root = resolveRootSpan(trace2);
|
|
48245
|
+
const rootDurationUs = root ? getDurationUs(root) : null;
|
|
48246
|
+
const rootStartUs = root ? getStartTimeUs(root) : null;
|
|
48247
|
+
const spansById = /* @__PURE__ */ new Map();
|
|
48248
|
+
for (const span of trace2.spans) {
|
|
48249
|
+
spansById.set(span.spanId, span);
|
|
48250
|
+
}
|
|
48251
|
+
const childrenByParent = /* @__PURE__ */ new Map();
|
|
48252
|
+
for (const span of trace2.spans) {
|
|
48253
|
+
if (!span.parentSpanId) {
|
|
48254
|
+
continue;
|
|
48255
|
+
}
|
|
48256
|
+
if (!spansById.has(span.parentSpanId)) {
|
|
48257
|
+
continue;
|
|
48258
|
+
}
|
|
48259
|
+
const list15 = childrenByParent.get(span.parentSpanId);
|
|
48260
|
+
if (list15) {
|
|
48261
|
+
list15.push(span);
|
|
48262
|
+
} else {
|
|
48263
|
+
childrenByParent.set(span.parentSpanId, [span]);
|
|
48264
|
+
}
|
|
48265
|
+
}
|
|
48266
|
+
for (const list15 of childrenByParent.values()) {
|
|
48267
|
+
list15.sort(compareByStart);
|
|
48268
|
+
}
|
|
48269
|
+
const spanInfo = /* @__PURE__ */ new Map();
|
|
48270
|
+
for (const span of trace2.spans) {
|
|
48271
|
+
const durationUs = getDurationUs(span);
|
|
48272
|
+
const children = childrenByParent.get(span.spanId) ?? [];
|
|
48273
|
+
let childTotalUs = 0;
|
|
48274
|
+
for (const child of children) {
|
|
48275
|
+
const cd = getDurationUs(child);
|
|
48276
|
+
if (cd !== null) {
|
|
48277
|
+
childTotalUs += cd;
|
|
48278
|
+
}
|
|
48279
|
+
}
|
|
48280
|
+
const selfTimeUs = durationUs === null ? null : Math.max(0, durationUs - childTotalUs);
|
|
48281
|
+
let startOffsetUs = null;
|
|
48282
|
+
if (rootStartUs !== null) {
|
|
48283
|
+
const startUs = getStartTimeUs(span);
|
|
48284
|
+
if (startUs !== null) {
|
|
48285
|
+
startOffsetUs = Math.max(0, startUs - rootStartUs);
|
|
48286
|
+
}
|
|
48287
|
+
}
|
|
48288
|
+
spanInfo.set(span.spanId, {
|
|
48289
|
+
span,
|
|
48290
|
+
durationUs,
|
|
48291
|
+
selfTimeUs,
|
|
48292
|
+
startOffsetUs
|
|
48293
|
+
});
|
|
48294
|
+
}
|
|
48295
|
+
const visited = /* @__PURE__ */ new Set();
|
|
48296
|
+
const treeOrder = [];
|
|
48297
|
+
let truncatedAtDepth = false;
|
|
48298
|
+
if (root) {
|
|
48299
|
+
truncatedAtDepth = walkTree(root, 0, childrenByParent, visited, treeOrder) || truncatedAtDepth;
|
|
48300
|
+
}
|
|
48301
|
+
const orphanOrder = [];
|
|
48302
|
+
const orphanRoots = trace2.spans.filter(
|
|
48303
|
+
(span) => !visited.has(span.spanId) && (!span.parentSpanId || !spansById.has(span.parentSpanId))
|
|
48304
|
+
).sort(compareByStart);
|
|
48305
|
+
for (const orphan of orphanRoots) {
|
|
48306
|
+
truncatedAtDepth = walkTree(orphan, 0, childrenByParent, visited, orphanOrder) || truncatedAtDepth;
|
|
48307
|
+
}
|
|
48308
|
+
for (const span of trace2.spans) {
|
|
48309
|
+
if (!visited.has(span.spanId)) {
|
|
48310
|
+
orphanOrder.push({ span, depth: 0 });
|
|
48311
|
+
visited.add(span.spanId);
|
|
48312
|
+
}
|
|
48313
|
+
}
|
|
48314
|
+
const errorSpans = trace2.spans.filter(
|
|
48315
|
+
(span) => span.status?.code === SPAN_STATUS_ERROR
|
|
48316
|
+
);
|
|
48317
|
+
const byName = /* @__PURE__ */ new Map();
|
|
48318
|
+
for (const span of trace2.spans) {
|
|
48319
|
+
const name = span.name || "<unnamed>";
|
|
48320
|
+
const durationUs = getDurationUs(span) ?? 0;
|
|
48321
|
+
const entry = byName.get(name);
|
|
48322
|
+
if (entry) {
|
|
48323
|
+
entry.count += 1;
|
|
48324
|
+
entry.totalUs += durationUs;
|
|
48325
|
+
} else {
|
|
48326
|
+
byName.set(name, { count: 1, totalUs: durationUs });
|
|
48327
|
+
}
|
|
48328
|
+
}
|
|
48329
|
+
const repeatedOps = [];
|
|
48330
|
+
for (const [name, { count, totalUs }] of byName) {
|
|
48331
|
+
if (count >= 2) {
|
|
48332
|
+
repeatedOps.push({
|
|
48333
|
+
name,
|
|
48334
|
+
count,
|
|
48335
|
+
totalUs,
|
|
48336
|
+
perCallUs: totalUs / count
|
|
48337
|
+
});
|
|
48338
|
+
}
|
|
48339
|
+
}
|
|
48340
|
+
repeatedOps.sort((a, b) => b.totalUs - a.totalUs);
|
|
48341
|
+
return {
|
|
48342
|
+
trace: trace2,
|
|
48343
|
+
root,
|
|
48344
|
+
rootDurationUs,
|
|
48345
|
+
rootStartUs,
|
|
48346
|
+
spanInfo,
|
|
48347
|
+
treeOrder,
|
|
48348
|
+
orphanOrder,
|
|
48349
|
+
errorSpans,
|
|
48350
|
+
repeatedOps,
|
|
48351
|
+
truncatedAtDepth
|
|
48352
|
+
};
|
|
48353
|
+
}
|
|
48354
|
+
function walkTree(span, depth, childrenByParent, visited, out) {
|
|
48355
|
+
if (visited.has(span.spanId)) {
|
|
48356
|
+
return false;
|
|
48357
|
+
}
|
|
48358
|
+
visited.add(span.spanId);
|
|
48359
|
+
if (depth >= MAX_TREE_DEPTH) {
|
|
48360
|
+
out.push({ span, depth });
|
|
48361
|
+
return true;
|
|
48362
|
+
}
|
|
48363
|
+
out.push({ span, depth });
|
|
48364
|
+
let truncated = false;
|
|
48365
|
+
const children = childrenByParent.get(span.spanId) ?? [];
|
|
48366
|
+
for (const child of children) {
|
|
48367
|
+
truncated = walkTree(child, depth + 1, childrenByParent, visited, out) || truncated;
|
|
48368
|
+
}
|
|
48369
|
+
return truncated;
|
|
48370
|
+
}
|
|
48371
|
+
|
|
48372
|
+
// src/commands/traces/render-markdown.ts
|
|
48373
|
+
var UNKNOWN = "<unknown>";
|
|
48374
|
+
var UNNAMED = "<unnamed>";
|
|
48375
|
+
var ATTR_VALUE_MAX_LEN = 80;
|
|
48376
|
+
var TRACE_ID_MAX_LEN = 13;
|
|
48377
|
+
function renderMarkdown(trace2, options) {
|
|
48378
|
+
const analysis = analyze(trace2);
|
|
48379
|
+
const sections = [];
|
|
48380
|
+
sections.push(renderHeader(analysis, options));
|
|
48381
|
+
if (analysis.errorSpans.length > 0) {
|
|
48382
|
+
sections.push(renderErrors(analysis));
|
|
48383
|
+
}
|
|
48384
|
+
if (analysis.repeatedOps.length > 0) {
|
|
48385
|
+
sections.push(renderRepeatedOps(analysis));
|
|
48386
|
+
}
|
|
48387
|
+
sections.push(renderTree(analysis));
|
|
48388
|
+
return `${sections.join("\n\n")}
|
|
48389
|
+
`;
|
|
48390
|
+
}
|
|
48391
|
+
function renderHeader(analysis, options) {
|
|
48392
|
+
const { trace: trace2, root, rootDurationUs, errorSpans } = analysis;
|
|
48393
|
+
const attributes = root?.attributes;
|
|
48394
|
+
const method = readAttrString(attributes, "http.method");
|
|
48395
|
+
const target = readAttrString(attributes, "http.target");
|
|
48396
|
+
const status3 = readAttrString(attributes, "http.status_code");
|
|
48397
|
+
const endpoint = formatEndpoint(method, target, status3);
|
|
48398
|
+
const duration = formatDurationUs(rootDurationUs);
|
|
48399
|
+
const spans = formatSpansLine(trace2.spans.length, errorSpans.length);
|
|
48400
|
+
const lines = [
|
|
48401
|
+
`# Trace ${ellipsis(trace2.traceId, TRACE_ID_MAX_LEN)}`,
|
|
48402
|
+
"",
|
|
48403
|
+
`- **Trace id:** ${trace2.traceId}`,
|
|
48404
|
+
`- **Request id:** ${options.requestId}`,
|
|
48405
|
+
`- **Endpoint:** ${endpoint}`,
|
|
48406
|
+
`- **Duration:** ${duration}`,
|
|
48407
|
+
`- **Spans:** ${spans}`
|
|
48408
|
+
];
|
|
48409
|
+
return lines.join("\n");
|
|
48410
|
+
}
|
|
48411
|
+
function renderErrors(analysis) {
|
|
48412
|
+
const lines = [`## Errors (${analysis.errorSpans.length})`, ""];
|
|
48413
|
+
for (const span of analysis.errorSpans) {
|
|
48414
|
+
const name = `\`${span.name || UNNAMED}\``;
|
|
48415
|
+
const message = span.status?.message;
|
|
48416
|
+
const header = message ? `${name} \u2014 \`${message}\`` : name;
|
|
48417
|
+
lines.push(`- ${header}`);
|
|
48418
|
+
for (const hint of collectAttrHints(span.attributes)) {
|
|
48419
|
+
lines.push(` - \`${hint.key}\`: ${hint.value}`);
|
|
48420
|
+
}
|
|
48421
|
+
}
|
|
48422
|
+
return lines.join("\n");
|
|
48423
|
+
}
|
|
48424
|
+
function renderRepeatedOps(analysis) {
|
|
48425
|
+
const { repeatedOps, rootDurationUs } = analysis;
|
|
48426
|
+
const showPctColumn = rootDurationUs !== null && rootDurationUs > 0;
|
|
48427
|
+
const header = ["Operation", "Count", "Total", "Per call"];
|
|
48428
|
+
const align = ["---", "---:", "---:", "---:"];
|
|
48429
|
+
if (showPctColumn) {
|
|
48430
|
+
header.push("% of root");
|
|
48431
|
+
align.push("---:");
|
|
48432
|
+
}
|
|
48433
|
+
const lines = [
|
|
48434
|
+
"## Repeated operations",
|
|
48435
|
+
"",
|
|
48436
|
+
`| ${header.join(" | ")} |`,
|
|
48437
|
+
`| ${align.join(" | ")} |`
|
|
48438
|
+
];
|
|
48439
|
+
for (const op of repeatedOps) {
|
|
48440
|
+
const cells = [
|
|
48441
|
+
`\`${op.name}\``,
|
|
48442
|
+
String(op.count),
|
|
48443
|
+
formatDurationUs(op.totalUs),
|
|
48444
|
+
formatDurationUs(op.perCallUs)
|
|
48445
|
+
];
|
|
48446
|
+
if (showPctColumn && rootDurationUs !== null) {
|
|
48447
|
+
cells.push(formatPct(op.totalUs, rootDurationUs));
|
|
48448
|
+
}
|
|
48449
|
+
lines.push(`| ${cells.join(" | ")} |`);
|
|
48450
|
+
}
|
|
48451
|
+
return lines.join("\n");
|
|
48452
|
+
}
|
|
48453
|
+
function renderTree(analysis) {
|
|
48454
|
+
const lines = ["## Span tree", ""];
|
|
48455
|
+
if (analysis.treeOrder.length === 0 && analysis.orphanOrder.length === 0) {
|
|
48456
|
+
lines.push("_No spans._");
|
|
48457
|
+
return lines.join("\n");
|
|
48458
|
+
}
|
|
48459
|
+
for (const node of analysis.treeOrder) {
|
|
48460
|
+
lines.push(formatTreeRow(node, analysis));
|
|
48461
|
+
}
|
|
48462
|
+
if (analysis.orphanOrder.length > 0) {
|
|
48463
|
+
lines.push("", "### Orphan spans", "");
|
|
48464
|
+
for (const node of analysis.orphanOrder) {
|
|
48465
|
+
lines.push(formatTreeRow(node, analysis));
|
|
48466
|
+
}
|
|
48467
|
+
}
|
|
48468
|
+
if (analysis.truncatedAtDepth) {
|
|
48469
|
+
lines.push("", `_Tree truncated at depth ${MAX_TREE_DEPTH}._`);
|
|
48470
|
+
}
|
|
48471
|
+
return lines.join("\n");
|
|
48472
|
+
}
|
|
48473
|
+
function formatTreeRow(node, analysis) {
|
|
48474
|
+
const { span, depth } = node;
|
|
48475
|
+
const info = analysis.spanInfo.get(span.spanId);
|
|
48476
|
+
const indent = " ".repeat(depth);
|
|
48477
|
+
const parts = [];
|
|
48478
|
+
const durationUs = info?.durationUs ?? null;
|
|
48479
|
+
parts.push(`\`${formatDurationUs(durationUs)}\``);
|
|
48480
|
+
if (analysis.rootDurationUs !== null && analysis.rootDurationUs > 0) {
|
|
48481
|
+
parts.push(formatPct(durationUs, analysis.rootDurationUs));
|
|
48482
|
+
}
|
|
48483
|
+
if (analysis.rootStartUs !== null) {
|
|
48484
|
+
const offset = info?.startOffsetUs ?? null;
|
|
48485
|
+
parts.push(formatOffset(offset));
|
|
48486
|
+
}
|
|
48487
|
+
parts.push(`\`${span.name || UNNAMED}\``);
|
|
48488
|
+
if (span.status?.code === SPAN_STATUS_ERROR) {
|
|
48489
|
+
const message = span.status.message;
|
|
48490
|
+
parts.push(message ? `[error: ${message}]` : "[error]");
|
|
48491
|
+
}
|
|
48492
|
+
const [hint] = collectAttrHints(span.attributes);
|
|
48493
|
+
if (hint) {
|
|
48494
|
+
parts.push(`\u2014 \`${hint.key}\`: ${hint.value}`);
|
|
48495
|
+
}
|
|
48496
|
+
return `${indent}- ${parts.join(" ")}`;
|
|
48497
|
+
}
|
|
48498
|
+
function formatEndpoint(method, target, status3) {
|
|
48499
|
+
const left = method && target ? `${method} ${target}` : method ?? target;
|
|
48500
|
+
const path3 = left ? `\`${left}\`` : UNKNOWN;
|
|
48501
|
+
if (status3) {
|
|
48502
|
+
return `${path3} \u2192 ${status3}`;
|
|
48503
|
+
}
|
|
48504
|
+
return path3;
|
|
48505
|
+
}
|
|
48506
|
+
function formatSpansLine(count, errors) {
|
|
48507
|
+
if (errors === 0) {
|
|
48508
|
+
return String(count);
|
|
48509
|
+
}
|
|
48510
|
+
const label = errors === 1 ? "error" : "errors";
|
|
48511
|
+
return `${count} (${errors} ${label})`;
|
|
48512
|
+
}
|
|
48513
|
+
function formatDurationUs(us) {
|
|
48514
|
+
if (us === null) {
|
|
48515
|
+
return UNKNOWN;
|
|
48516
|
+
}
|
|
48517
|
+
if (us < 1e3) {
|
|
48518
|
+
return `${Math.round(us)}\u03BCs`;
|
|
48519
|
+
}
|
|
48520
|
+
if (us < 1e6) {
|
|
48521
|
+
return `${(us / 1e3).toFixed(1)}ms`;
|
|
48522
|
+
}
|
|
48523
|
+
return `${(us / 1e6).toFixed(1)}s`;
|
|
48524
|
+
}
|
|
48525
|
+
function formatOffset(us) {
|
|
48526
|
+
if (us === null) {
|
|
48527
|
+
return `+${UNKNOWN}`;
|
|
48528
|
+
}
|
|
48529
|
+
return `+${formatDurationUs(us)}`;
|
|
48530
|
+
}
|
|
48531
|
+
function formatPct(us, rootUs) {
|
|
48532
|
+
if (us === null) {
|
|
48533
|
+
return UNKNOWN;
|
|
48534
|
+
}
|
|
48535
|
+
if (rootUs <= 0) {
|
|
48536
|
+
return UNKNOWN;
|
|
48537
|
+
}
|
|
48538
|
+
const pct = us / rootUs * 100;
|
|
48539
|
+
if (pct > 0 && pct < 1) {
|
|
48540
|
+
return "<1%";
|
|
48541
|
+
}
|
|
48542
|
+
return `${Math.round(pct)}%`;
|
|
48543
|
+
}
|
|
48544
|
+
function collectAttrHints(attributes) {
|
|
48545
|
+
if (!attributes) {
|
|
48546
|
+
return [];
|
|
48547
|
+
}
|
|
48548
|
+
const out = [];
|
|
48549
|
+
for (const key of ATTR_HINT_KEYS) {
|
|
48550
|
+
const value = readAttrString(attributes, key);
|
|
48551
|
+
if (value !== void 0) {
|
|
48552
|
+
out.push({ key, value: ellipsis(value, ATTR_VALUE_MAX_LEN) });
|
|
48553
|
+
}
|
|
48554
|
+
}
|
|
48555
|
+
return out;
|
|
48556
|
+
}
|
|
48557
|
+
|
|
48558
|
+
// src/commands/traces/scope-resolver.ts
|
|
48559
|
+
var MISSING_BOTH_MESSAGE = "No linked project found. Run `vercel link`, pass --cwd to a linked dir, or use --scope <team> and --project <name>.";
|
|
48560
|
+
function resolveScope({
|
|
48561
|
+
flags = {},
|
|
48562
|
+
linkedProject
|
|
48563
|
+
}) {
|
|
48564
|
+
const flagScope = flags.scope?.trim() || void 0;
|
|
48565
|
+
const flagProject = flags.project?.trim() || void 0;
|
|
48566
|
+
if (linkedProject.status === "linked") {
|
|
48567
|
+
return {
|
|
48568
|
+
teamId: flagScope ?? linkedProject.org.id,
|
|
48569
|
+
projectId: flagProject ?? linkedProject.project.id
|
|
48570
|
+
};
|
|
48571
|
+
}
|
|
48572
|
+
if (flagScope && flagProject) {
|
|
48573
|
+
return { teamId: flagScope, projectId: flagProject };
|
|
48574
|
+
}
|
|
48575
|
+
return { message: MISSING_BOTH_MESSAGE };
|
|
48576
|
+
}
|
|
48577
|
+
|
|
48578
|
+
// src/commands/traces/get.ts
|
|
48579
|
+
async function get3(client, telemetry2) {
|
|
48580
|
+
let parsedArgs;
|
|
48581
|
+
const flagsSpecification = getFlagsSpecification(getSubcommand2.options);
|
|
48582
|
+
try {
|
|
48583
|
+
parsedArgs = parseArguments(client.argv.slice(2), flagsSpecification);
|
|
48584
|
+
} catch (err) {
|
|
48585
|
+
printError(err);
|
|
48586
|
+
return 1;
|
|
48587
|
+
}
|
|
48588
|
+
const positional = parsedArgs.args.slice(1);
|
|
48589
|
+
const requestId = positional[0] === getSubcommand2.name ? positional[1] : positional[0];
|
|
48590
|
+
const json = parsedArgs.flags["--json"];
|
|
48591
|
+
const scopeFlag = parsedArgs.flags["--scope"];
|
|
48592
|
+
const projectFlag = parsedArgs.flags["--project"];
|
|
48593
|
+
telemetry2.trackCliArgumentRequestId(requestId);
|
|
48594
|
+
telemetry2.trackCliFlagJson(json);
|
|
48595
|
+
telemetry2.trackCliOptionProject(projectFlag);
|
|
48596
|
+
if (!requestId) {
|
|
48597
|
+
output_manager_default.print(
|
|
48598
|
+
help(getSubcommand2, {
|
|
48599
|
+
parent: tracesCommand,
|
|
48600
|
+
columns: client.stderr.columns
|
|
48601
|
+
})
|
|
48602
|
+
);
|
|
48603
|
+
return 2;
|
|
48604
|
+
}
|
|
48605
|
+
let teamId;
|
|
48606
|
+
let projectId;
|
|
48607
|
+
if (scopeFlag && projectFlag) {
|
|
48608
|
+
teamId = scopeFlag;
|
|
48609
|
+
projectId = projectFlag;
|
|
48610
|
+
} else {
|
|
48611
|
+
const linkedProject = await getLinkedProject(client);
|
|
48612
|
+
if (linkedProject.status === "error") {
|
|
48613
|
+
return linkedProject.exitCode;
|
|
48614
|
+
}
|
|
48615
|
+
const scope = resolveScope({
|
|
48616
|
+
flags: { scope: scopeFlag, project: projectFlag },
|
|
48617
|
+
linkedProject
|
|
48618
|
+
});
|
|
48619
|
+
if ("message" in scope) {
|
|
48620
|
+
output_manager_default.error(scope.message);
|
|
48621
|
+
return 1;
|
|
48622
|
+
}
|
|
48623
|
+
teamId = scope.teamId;
|
|
48624
|
+
projectId = scope.projectId;
|
|
48625
|
+
}
|
|
48626
|
+
output_manager_default.spinner("Fetching trace\u2026");
|
|
48627
|
+
let trace2;
|
|
48628
|
+
try {
|
|
48629
|
+
({ trace: trace2 } = await fetchTrace({
|
|
48630
|
+
client,
|
|
48631
|
+
teamId,
|
|
48632
|
+
projectId,
|
|
48633
|
+
requestId
|
|
48634
|
+
}));
|
|
48635
|
+
} catch (err) {
|
|
48636
|
+
output_manager_default.stopSpinner();
|
|
48637
|
+
printError(err);
|
|
48638
|
+
return 1;
|
|
48639
|
+
}
|
|
48640
|
+
output_manager_default.stopSpinner();
|
|
48641
|
+
if (json) {
|
|
48642
|
+
client.stdout.write(`${JSON.stringify(trace2, null, 2)}
|
|
48643
|
+
`);
|
|
48644
|
+
return 0;
|
|
48645
|
+
}
|
|
48646
|
+
client.stdout.write(renderMarkdown(trace2, { requestId }));
|
|
48647
|
+
output_manager_default.log("Run with --json for full trace data.");
|
|
48648
|
+
return 0;
|
|
48649
|
+
}
|
|
48650
|
+
|
|
48651
|
+
// src/commands/traces/index.ts
|
|
48652
|
+
var COMMAND_CONFIG40 = {
|
|
48653
|
+
get: getCommandAliases(getSubcommand2)
|
|
48654
|
+
};
|
|
48655
|
+
async function traces(client) {
|
|
48656
|
+
const telemetry2 = new TracesTelemetryClient({
|
|
48657
|
+
opts: {
|
|
48658
|
+
store: client.telemetryEventStore
|
|
48659
|
+
}
|
|
48660
|
+
});
|
|
48661
|
+
let parsedArgs;
|
|
48662
|
+
const flagsSpecification = getFlagsSpecification(tracesCommand.options);
|
|
48663
|
+
try {
|
|
48664
|
+
parsedArgs = parseArguments(client.argv.slice(2), flagsSpecification, {
|
|
48665
|
+
permissive: true
|
|
48666
|
+
});
|
|
48667
|
+
} catch (err) {
|
|
48668
|
+
printError(err);
|
|
48669
|
+
return 1;
|
|
48670
|
+
}
|
|
48671
|
+
const { subcommand, subcommandOriginal } = getSubcommand5(
|
|
48672
|
+
parsedArgs.args.slice(1),
|
|
48673
|
+
COMMAND_CONFIG40
|
|
48674
|
+
);
|
|
48675
|
+
if (parsedArgs.flags["--help"]) {
|
|
48676
|
+
telemetry2.trackCliFlagHelp("traces", subcommandOriginal);
|
|
48677
|
+
const isGet = subcommand === getSubcommand2.name;
|
|
48678
|
+
output_manager_default.print(
|
|
48679
|
+
help(isGet ? getSubcommand2 : tracesCommand, {
|
|
48680
|
+
parent: isGet ? tracesCommand : void 0,
|
|
48681
|
+
columns: client.stderr.columns
|
|
48682
|
+
})
|
|
48683
|
+
);
|
|
48684
|
+
return 2;
|
|
48685
|
+
}
|
|
48686
|
+
return get3(client, telemetry2);
|
|
48687
|
+
}
|
|
48688
|
+
|
|
47763
48689
|
// src/util/telemetry/commands/upgrade/index.ts
|
|
47764
48690
|
var UpgradeTelemetryClient = class extends TelemetryClient {
|
|
47765
48691
|
trackCliFlagDryRun(dryRun) {
|
|
@@ -47905,7 +48831,7 @@ var UsageTelemetryClient = class extends TelemetryClient {
|
|
|
47905
48831
|
};
|
|
47906
48832
|
|
|
47907
48833
|
// src/commands/usage/index.ts
|
|
47908
|
-
var
|
|
48834
|
+
var import_error_utils20 = __toESM(require_dist(), 1);
|
|
47909
48835
|
|
|
47910
48836
|
// src/util/billing/period-utils.ts
|
|
47911
48837
|
import { DateTime } from "luxon";
|
|
@@ -48376,7 +49302,7 @@ async function usage(client) {
|
|
|
48376
49302
|
contextName = scope.contextName;
|
|
48377
49303
|
teamId = scope.team?.id;
|
|
48378
49304
|
} catch (err) {
|
|
48379
|
-
if ((0,
|
|
49305
|
+
if ((0, import_error_utils20.isErrnoException)(err) && (err.code === "NOT_AUTHORIZED" || err.code === "TEAM_DELETED")) {
|
|
48380
49306
|
error(err.message);
|
|
48381
49307
|
return 1;
|
|
48382
49308
|
}
|
|
@@ -48715,14 +49641,14 @@ var WebhooksGetTelemetryClient = class extends TelemetryClient {
|
|
|
48715
49641
|
};
|
|
48716
49642
|
|
|
48717
49643
|
// src/commands/webhooks/get.ts
|
|
48718
|
-
async function
|
|
49644
|
+
async function get4(client, argv) {
|
|
48719
49645
|
const telemetry2 = new WebhooksGetTelemetryClient({
|
|
48720
49646
|
opts: {
|
|
48721
49647
|
store: client.telemetryEventStore
|
|
48722
49648
|
}
|
|
48723
49649
|
});
|
|
48724
49650
|
let parsedArgs;
|
|
48725
|
-
const flagsSpecification = getFlagsSpecification(
|
|
49651
|
+
const flagsSpecification = getFlagsSpecification(getSubcommand4.options);
|
|
48726
49652
|
try {
|
|
48727
49653
|
parsedArgs = parseArguments(argv, flagsSpecification);
|
|
48728
49654
|
} catch (error) {
|
|
@@ -49223,7 +50149,7 @@ function webhookCommandWithGlobalFlags(baseSubcommand, argv) {
|
|
|
49223
50149
|
const full = globalFlags.length ? `${baseSubcommand} ${globalFlags.join(" ")}` : baseSubcommand;
|
|
49224
50150
|
return getCommandNamePlain(full);
|
|
49225
50151
|
}
|
|
49226
|
-
async function
|
|
50152
|
+
async function rm10(client, argv) {
|
|
49227
50153
|
const telemetry2 = new WebhooksRmTelemetryClient({
|
|
49228
50154
|
opts: {
|
|
49229
50155
|
store: client.telemetryEventStore
|
|
@@ -49417,7 +50343,7 @@ var WebhooksTelemetryClient = class extends TelemetryClient {
|
|
|
49417
50343
|
};
|
|
49418
50344
|
|
|
49419
50345
|
// src/commands/webhooks/index.ts
|
|
49420
|
-
var
|
|
50346
|
+
var COMMAND_CONFIG41 = {
|
|
49421
50347
|
create: ["create", "add"],
|
|
49422
50348
|
get: ["get", "inspect"],
|
|
49423
50349
|
ls: ["ls", "list"],
|
|
@@ -49439,9 +50365,9 @@ async function main30(client) {
|
|
|
49439
50365
|
store: client.telemetryEventStore
|
|
49440
50366
|
}
|
|
49441
50367
|
});
|
|
49442
|
-
const { subcommand, args, subcommandOriginal } =
|
|
50368
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
49443
50369
|
parsedArgs.args.slice(1),
|
|
49444
|
-
|
|
50370
|
+
COMMAND_CONFIG41
|
|
49445
50371
|
);
|
|
49446
50372
|
const needHelp = parsedArgs.flags["--help"];
|
|
49447
50373
|
if (!subcommand && needHelp) {
|
|
@@ -49466,17 +50392,17 @@ async function main30(client) {
|
|
|
49466
50392
|
case "get":
|
|
49467
50393
|
if (needHelp) {
|
|
49468
50394
|
telemetry2.trackCliFlagHelp("webhooks", subcommandOriginal);
|
|
49469
|
-
return printHelp(
|
|
50395
|
+
return printHelp(getSubcommand4);
|
|
49470
50396
|
}
|
|
49471
50397
|
telemetry2.trackCliSubcommandGet(subcommandOriginal);
|
|
49472
|
-
return
|
|
50398
|
+
return get4(client, args);
|
|
49473
50399
|
case "rm":
|
|
49474
50400
|
if (needHelp) {
|
|
49475
50401
|
telemetry2.trackCliFlagHelp("webhooks", subcommandOriginal);
|
|
49476
50402
|
return printHelp(removeSubcommand15);
|
|
49477
50403
|
}
|
|
49478
50404
|
telemetry2.trackCliSubcommandRemove(subcommandOriginal);
|
|
49479
|
-
return
|
|
50405
|
+
return rm10(client, args);
|
|
49480
50406
|
default:
|
|
49481
50407
|
if (needHelp) {
|
|
49482
50408
|
telemetry2.trackCliFlagHelp("webhooks", subcommandOriginal);
|
|
@@ -49618,6 +50544,7 @@ export {
|
|
|
49618
50544
|
teams,
|
|
49619
50545
|
telemetry,
|
|
49620
50546
|
main29 as tokens,
|
|
50547
|
+
traces,
|
|
49621
50548
|
upgrade,
|
|
49622
50549
|
usage,
|
|
49623
50550
|
main30 as webhooks,
|