vercel 58.9.2 → 58.9.4
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-LVQP3SR2.js → add-GCIDCWH7.js} +2 -2
- package/dist/chunks/{add-DDUZR2RD.js → add-XFGCONHF.js} +6 -6
- package/dist/chunks/{add-XZ2HRB22.js → add-ZZTRLRJT.js} +2 -2
- package/dist/chunks/{build-L3WNBFT6.js → build-VVNU4BLE.js} +2 -2
- package/dist/chunks/{chunk-J23MTK5H.js → chunk-3GTCSDQR.js} +7 -11
- package/dist/chunks/{chunk-DBMBKXZO.js → chunk-3RVAJBTW.js} +1 -1
- package/dist/chunks/{chunk-CMS7PTFB.js → chunk-473IQJL4.js} +1 -1
- package/dist/chunks/{chunk-5LPWBMQG.js → chunk-4EN73Q5Q.js} +1 -1
- package/dist/chunks/{chunk-R7FRJJSO.js → chunk-4ZDDOMUT.js} +109 -31
- package/dist/chunks/{chunk-DSJHGENE.js → chunk-5KY7ORFF.js} +1 -1
- package/dist/chunks/{chunk-QCDSQERI.js → chunk-5OWYFCOQ.js} +3 -3
- package/dist/chunks/{chunk-S6CMPUF4.js → chunk-6RVEMCWL.js} +1 -1
- package/dist/chunks/{chunk-Z7LH63PK.js → chunk-6WHBYHIB.js} +1 -1
- package/dist/chunks/{chunk-YXFLKPDC.js → chunk-F2PRLQ37.js} +772 -12
- package/dist/chunks/{chunk-QXXH6L46.js → chunk-HDKQ66NL.js} +113 -8
- package/dist/chunks/{chunk-77FZZ73F.js → chunk-HXZFIIDG.js} +4 -4
- package/dist/chunks/{chunk-74ZES62J.js → chunk-IV3BQDT2.js} +1 -1
- package/dist/chunks/{chunk-Z7RSIWNT.js → chunk-K43NT7QG.js} +1 -1
- package/dist/chunks/{chunk-EPAVMBXG.js → chunk-NCPOQOZ2.js} +2 -2
- package/dist/chunks/{constants-T6BULVX6.js → chunk-O26N2UPI.js} +4 -2
- package/dist/chunks/{chunk-KIGRD7TV.js → chunk-PSYZGH6M.js} +1 -1
- package/dist/chunks/{chunk-DZAP2FIC.js → chunk-QLZKPGI4.js} +1 -1
- package/dist/chunks/{chunk-DGVJNQI3.js → chunk-R67YCGGV.js} +2 -2
- package/dist/chunks/{chunk-6YFPNNA5.js → chunk-TPNM2IBA.js} +1 -1
- package/dist/chunks/{chunk-3T3AIIEO.js → chunk-U2HFLQVO.js} +2 -2
- package/dist/chunks/{chunk-2Z66EK7E.js → chunk-UA6KSQA7.js} +1 -1
- package/dist/chunks/{chunk-BW7BH66H.js → chunk-VJCN2M7S.js} +1 -1
- package/dist/chunks/{chunk-446IAD7O.js → chunk-ZI4J4CQ4.js} +1 -1
- package/dist/chunks/{clear-QD7QNE2X.js → clear-FEV6EGAS.js} +2 -2
- package/dist/chunks/{compile-vercel-config-G46NO752.js → compile-vercel-config-QSZ7JDCG.js} +1 -1
- package/dist/chunks/{config-MRWCWMFM.js → config-3BEFAQQU.js} +2 -2
- package/dist/chunks/constants-WEQVJSYS.js +15 -0
- package/dist/chunks/{delete-THAK6PDA.js → delete-IYAGVXU6.js} +2 -2
- package/dist/chunks/{delete-IJDA6IJT.js → delete-QYUDDZD2.js} +2 -2
- package/dist/chunks/{disable-XJLSQWDP.js → disable-D4WNCZ4Z.js} +2 -2
- package/dist/chunks/{discard-MDTDXLPM.js → discard-YFBRDG2N.js} +2 -2
- package/dist/chunks/{edit-TBUQIBCG.js → edit-3IUCXLNZ.js} +2 -2
- package/dist/chunks/{edit-XWMGSV5O.js → edit-TWPSJUE4.js} +3 -3
- package/dist/chunks/{enable-D4ZEFA7B.js → enable-XJ7JMETR.js} +2 -2
- package/dist/chunks/{export-35THNYMQ.js → export-GJ6XQQFA.js} +2 -2
- package/dist/chunks/{image-ONVF2WQF.js → image-SXRSCUP3.js} +3 -3
- package/dist/chunks/{import-builders-4PL2UTKQ.js → import-builders-QITJL2IG.js} +2 -2
- package/dist/chunks/{inspect-P2MVWGGX.js → inspect-DXYEEYSF.js} +2 -2
- package/dist/chunks/{inspect-UKWD7EKB.js → inspect-FAJ7BQOB.js} +3 -3
- package/dist/chunks/{inspect-22HFUKUL.js → inspect-H2HA6RZQ.js} +2 -2
- package/dist/chunks/{inspect-K5URFDTI.js → inspect-SMDJWUBZ.js} +2 -2
- package/dist/chunks/{inspect-JPKI7TUF.js → inspect-U5SNE5AC.js} +2 -2
- package/dist/chunks/{list-QOKS7OXY.js → list-FONLZ3YO.js} +3 -3
- package/dist/chunks/{list-RTALDLVZ.js → list-MTOKP2AP.js} +1 -1
- package/dist/chunks/{list-2GKTKNSP.js → list-YR65RN5B.js} +2 -2
- package/dist/chunks/{login-VTT2OSLJ.js → login-DKKJWEM5.js} +2 -2
- package/dist/chunks/{ls-4VTPS4H3.js → ls-4CRKYKH7.js} +2 -2
- package/dist/chunks/{ls-DPQN66HC.js → ls-DI6AQCB4.js} +2 -2
- package/dist/chunks/{ls-6M25LDJ3.js → ls-LS475P45.js} +2 -2
- package/dist/chunks/{ls-5FYZ5VEP.js → ls-ORTO6EFA.js} +2 -2
- package/dist/chunks/{ls-3XZ54CAA.js → ls-XO2VXFTI.js} +3 -3
- package/dist/chunks/{open-LSQVBKRQ.js → open-2P4ZZTJD.js} +2 -2
- package/dist/chunks/{permissions-KHCRKKCJ.js → permissions-PTW7BRVE.js} +4 -4
- package/dist/chunks/{publish-OQZQOC3A.js → publish-IRGV2FST.js} +2 -2
- package/dist/chunks/{push-O22DZTSK.js → push-3OY5CP5F.js} +2 -2
- package/dist/chunks/{query-X2SX26DL.js → query-DLYCIOU6.js} +1 -1
- package/dist/chunks/{reorder-E53PSWXQ.js → reorder-J2TPPT62.js} +2 -2
- package/dist/chunks/{reply-NQD2F6SH.js → reply-QZWESDIB.js} +2 -2
- package/dist/chunks/{resolve-6ZPARPEF.js → resolve-HSW2EFLZ.js} +2 -2
- package/dist/chunks/{restore-UJYDYOZO.js → restore-DFLBJZFM.js} +2 -2
- package/dist/chunks/{rm-TCPTNK5O.js → rm-FAPEWTLO.js} +2 -2
- package/dist/chunks/{rm-A6S57TZX.js → rm-G5JC3V3B.js} +2 -2
- package/dist/chunks/{rm-BYF6J53M.js → rm-NIRLLUDU.js} +2 -2
- package/dist/chunks/{rm-5T3LQY2T.js → rm-QKGA6HFJ.js} +3 -3
- package/dist/chunks/{rule-inspect-Q7G2H534.js → rule-inspect-LKKYOQN7.js} +3 -3
- package/dist/chunks/{rules-5EI4AZ2N.js → rules-DNPBXPCT.js} +6 -6
- package/dist/chunks/{schema-CFEL4DGE.js → schema-E4EWRSGN.js} +1 -1
- package/dist/chunks/{tags-GWQZQY3Q.js → tags-IO73I6MR.js} +2 -2
- package/dist/chunks/{update-SHTZVWMD.js → update-CFCAOSLN.js} +6 -6
- package/dist/commands/build/index.js +13 -10
- package/dist/commands/deploy/index.js +9 -9
- package/dist/commands/dev/index.js +8 -8
- package/dist/commands/env/index.js +4 -4
- package/dist/commands/link/index.js +6 -6
- package/dist/commands/list/index.js +2 -2
- package/dist/commands-bulk.js +839 -773
- package/dist/index.js +26 -10
- package/dist/vc.js +7 -3
- package/dist/version.mjs +2 -1
- package/package.json +18 -18
package/dist/commands-bulk.js
CHANGED
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
runInteractiveEditLoop,
|
|
38
38
|
stripQuotes,
|
|
39
39
|
validateActionFlags
|
|
40
|
-
} from "./chunks/chunk-
|
|
40
|
+
} from "./chunks/chunk-5KY7ORFF.js";
|
|
41
41
|
import {
|
|
42
42
|
getRouteVersions
|
|
43
43
|
} from "./chunks/chunk-AHU7WNL2.js";
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
requireProjectContext,
|
|
58
58
|
validateRequiredArguments,
|
|
59
59
|
withGlobalFlags as withGlobalFlags2
|
|
60
|
-
} from "./chunks/chunk-
|
|
60
|
+
} from "./chunks/chunk-IV3BQDT2.js";
|
|
61
61
|
import {
|
|
62
62
|
canPrompt
|
|
63
63
|
} from "./chunks/chunk-2473DUBR.js";
|
|
@@ -79,23 +79,37 @@ import {
|
|
|
79
79
|
resolveTimeRange
|
|
80
80
|
} from "./chunks/chunk-P65EEFTR.js";
|
|
81
81
|
import {
|
|
82
|
+
CURL_INSTALL_COMMAND,
|
|
82
83
|
OpenApiCache,
|
|
83
84
|
api,
|
|
84
85
|
box,
|
|
85
86
|
did_you_mean_default,
|
|
87
|
+
executeNativeSelfUpdate,
|
|
86
88
|
executeUpgrade,
|
|
89
|
+
getLinkedVersion,
|
|
90
|
+
getPinnedVersion,
|
|
91
|
+
getPrBuildSha,
|
|
92
|
+
installAndLinkPrBinary,
|
|
93
|
+
installAndLinkVersion,
|
|
87
94
|
isAutoUpdateEnabled,
|
|
95
|
+
isCurlInstall,
|
|
96
|
+
isLinkedToPrBuild,
|
|
97
|
+
listAvailableVersions,
|
|
98
|
+
listInstalledVersions,
|
|
88
99
|
login,
|
|
100
|
+
parsePrTarget,
|
|
101
|
+
require_tar_fs,
|
|
89
102
|
resolveOpenApiTagForProjectsCli,
|
|
90
103
|
resolveOpenApiTagForTeamsCli,
|
|
91
104
|
setAutoUpdate,
|
|
105
|
+
setPinnedVersion,
|
|
92
106
|
tryOpenApiFallback
|
|
93
|
-
} from "./chunks/chunk-
|
|
107
|
+
} from "./chunks/chunk-F2PRLQ37.js";
|
|
94
108
|
import "./chunks/chunk-FGDKMNEN.js";
|
|
95
109
|
import {
|
|
96
110
|
getUpdateCommand,
|
|
97
111
|
isGlobal
|
|
98
|
-
} from "./chunks/chunk-
|
|
112
|
+
} from "./chunks/chunk-QLZKPGI4.js";
|
|
99
113
|
import {
|
|
100
114
|
Now,
|
|
101
115
|
addDomain,
|
|
@@ -116,7 +130,7 @@ import {
|
|
|
116
130
|
require_cjs,
|
|
117
131
|
require_jsonlines,
|
|
118
132
|
setupDomain
|
|
119
|
-
} from "./chunks/chunk-
|
|
133
|
+
} from "./chunks/chunk-5OWYFCOQ.js";
|
|
120
134
|
import {
|
|
121
135
|
require_format
|
|
122
136
|
} from "./chunks/chunk-PRWJUY5U.js";
|
|
@@ -126,7 +140,7 @@ import {
|
|
|
126
140
|
readLocalConfig,
|
|
127
141
|
sleep,
|
|
128
142
|
writeToConfigFile
|
|
129
|
-
} from "./chunks/chunk-
|
|
143
|
+
} from "./chunks/chunk-R67YCGGV.js";
|
|
130
144
|
import {
|
|
131
145
|
getGlobalPathConfig
|
|
132
146
|
} from "./chunks/chunk-JKQWQA2T.js";
|
|
@@ -156,7 +170,7 @@ import {
|
|
|
156
170
|
import {
|
|
157
171
|
formatEnvironment,
|
|
158
172
|
validateLsArgs
|
|
159
|
-
} from "./chunks/chunk-
|
|
173
|
+
} from "./chunks/chunk-4EN73Q5Q.js";
|
|
160
174
|
import {
|
|
161
175
|
validateJsonOutput
|
|
162
176
|
} from "./chunks/chunk-KXDWXXJH.js";
|
|
@@ -200,6 +214,7 @@ import {
|
|
|
200
214
|
attackModeDisableSubcommand,
|
|
201
215
|
attackModeEnableSubcommand,
|
|
202
216
|
attackModeSubcommand,
|
|
217
|
+
autoupdateSubcommand,
|
|
203
218
|
backupsSubcommand,
|
|
204
219
|
balanceSubcommand,
|
|
205
220
|
bisectCommand,
|
|
@@ -293,6 +308,7 @@ import {
|
|
|
293
308
|
inspectSubcommand6 as inspectSubcommand8,
|
|
294
309
|
installCommand,
|
|
295
310
|
installationsSubcommand,
|
|
311
|
+
installedSubcommand,
|
|
296
312
|
integrationCommand,
|
|
297
313
|
integrationResourceCommand,
|
|
298
314
|
invalidateSubcommand,
|
|
@@ -324,6 +340,7 @@ import {
|
|
|
324
340
|
listSubcommand19 as listSubcommand22,
|
|
325
341
|
listSubcommand2,
|
|
326
342
|
listSubcommand20 as listSubcommand23,
|
|
343
|
+
listSubcommand21 as listSubcommand24,
|
|
327
344
|
listSubcommand3 as listSubcommand4,
|
|
328
345
|
listSubcommand5,
|
|
329
346
|
listSubcommand6 as listSubcommand7,
|
|
@@ -456,17 +473,20 @@ import {
|
|
|
456
473
|
updateSubcommand3,
|
|
457
474
|
updateSubcommand4,
|
|
458
475
|
updateSubcommand5,
|
|
476
|
+
updateSubcommand6,
|
|
459
477
|
upgradeCommand,
|
|
460
478
|
uploadSubcommand,
|
|
461
479
|
usageCommand,
|
|
480
|
+
useSubcommand,
|
|
462
481
|
verifySubcommand,
|
|
482
|
+
versionCommand,
|
|
463
483
|
versionsDiffSubcommand,
|
|
464
484
|
versionsListSubcommand,
|
|
465
485
|
versionsSubcommand,
|
|
466
486
|
webAnalyticsSubcommand,
|
|
467
487
|
webhooksCommand,
|
|
468
488
|
whoamiCommand
|
|
469
|
-
} from "./chunks/chunk-
|
|
489
|
+
} from "./chunks/chunk-HDKQ66NL.js";
|
|
470
490
|
import {
|
|
471
491
|
addSubcommand as addSubcommand12,
|
|
472
492
|
buildSubcommand,
|
|
@@ -552,9 +572,11 @@ import {
|
|
|
552
572
|
dump,
|
|
553
573
|
load,
|
|
554
574
|
main
|
|
555
|
-
} from "./chunks/chunk-
|
|
556
|
-
import
|
|
557
|
-
|
|
575
|
+
} from "./chunks/chunk-HXZFIIDG.js";
|
|
576
|
+
import {
|
|
577
|
+
require_semver
|
|
578
|
+
} from "./chunks/chunk-IB5L4LKZ.js";
|
|
579
|
+
import "./chunks/chunk-6RVEMCWL.js";
|
|
558
580
|
import {
|
|
559
581
|
require_execa
|
|
560
582
|
} from "./chunks/chunk-R6IGDGX3.js";
|
|
@@ -569,10 +591,10 @@ import {
|
|
|
569
591
|
} from "./chunks/chunk-VXYGCOKL.js";
|
|
570
592
|
import {
|
|
571
593
|
ensureLink
|
|
572
|
-
} from "./chunks/chunk-
|
|
573
|
-
import "./chunks/chunk-
|
|
574
|
-
import "./chunks/chunk-
|
|
575
|
-
import "./chunks/chunk-
|
|
594
|
+
} from "./chunks/chunk-U2HFLQVO.js";
|
|
595
|
+
import "./chunks/chunk-4ZDDOMUT.js";
|
|
596
|
+
import "./chunks/chunk-K43NT7QG.js";
|
|
597
|
+
import "./chunks/chunk-UA6KSQA7.js";
|
|
576
598
|
import {
|
|
577
599
|
help
|
|
578
600
|
} from "./chunks/chunk-ZX2FSPWV.js";
|
|
@@ -617,17 +639,13 @@ import {
|
|
|
617
639
|
processRevocationResponse,
|
|
618
640
|
pull,
|
|
619
641
|
readJSONFile,
|
|
620
|
-
require_chownr,
|
|
621
642
|
require_dist as require_dist2,
|
|
622
643
|
require_dist3,
|
|
623
644
|
require_fast_deep_equal,
|
|
624
645
|
require_frameworks,
|
|
625
646
|
require_lib,
|
|
626
|
-
require_mkdirp,
|
|
627
647
|
require_open,
|
|
628
648
|
require_pluralize,
|
|
629
|
-
require_pump,
|
|
630
|
-
require_tar_stream,
|
|
631
649
|
resolveProjectContext,
|
|
632
650
|
resolveProjectCwd,
|
|
633
651
|
revocationRequest,
|
|
@@ -635,7 +653,7 @@ import {
|
|
|
635
653
|
selectOrg,
|
|
636
654
|
toHost,
|
|
637
655
|
ua_default
|
|
638
|
-
} from "./chunks/chunk-
|
|
656
|
+
} from "./chunks/chunk-3GTCSDQR.js";
|
|
639
657
|
import {
|
|
640
658
|
TelemetryClient
|
|
641
659
|
} from "./chunks/chunk-ECCWJHC6.js";
|
|
@@ -744,352 +762,10 @@ import {
|
|
|
744
762
|
require_source
|
|
745
763
|
} from "./chunks/chunk-S7KYDPEM.js";
|
|
746
764
|
import {
|
|
747
|
-
__commonJS,
|
|
748
765
|
__require,
|
|
749
766
|
__toESM
|
|
750
767
|
} from "./chunks/chunk-TZ2YI2VH.js";
|
|
751
768
|
|
|
752
|
-
// ../../node_modules/.pnpm/tar-fs@1.16.5/node_modules/tar-fs/index.js
|
|
753
|
-
var require_tar_fs = __commonJS({
|
|
754
|
-
"../../node_modules/.pnpm/tar-fs@1.16.5/node_modules/tar-fs/index.js"(exports) {
|
|
755
|
-
var chownr = require_chownr();
|
|
756
|
-
var tar2 = require_tar_stream();
|
|
757
|
-
var pump = require_pump();
|
|
758
|
-
var mkdirp = require_mkdirp();
|
|
759
|
-
var fs4 = __require("fs");
|
|
760
|
-
var path3 = __require("path");
|
|
761
|
-
var os = __require("os");
|
|
762
|
-
var win32 = os.platform() === "win32";
|
|
763
|
-
var noop = function() {
|
|
764
|
-
};
|
|
765
|
-
var echo = function(name) {
|
|
766
|
-
return name;
|
|
767
|
-
};
|
|
768
|
-
var normalize = !win32 ? echo : function(name) {
|
|
769
|
-
return name.replace(/\\/g, "/").replace(/[:?<>|]/g, "_");
|
|
770
|
-
};
|
|
771
|
-
var statAll = function(fs5, stat4, cwd, ignore, entries, sort) {
|
|
772
|
-
var queue = entries || ["."];
|
|
773
|
-
return function loop(callback) {
|
|
774
|
-
if (!queue.length)
|
|
775
|
-
return callback();
|
|
776
|
-
var next = queue.shift();
|
|
777
|
-
var nextAbs = path3.join(cwd, next);
|
|
778
|
-
stat4(nextAbs, function(err, stat5) {
|
|
779
|
-
if (err)
|
|
780
|
-
return callback(err);
|
|
781
|
-
if (!stat5.isDirectory())
|
|
782
|
-
return callback(null, next, stat5);
|
|
783
|
-
fs5.readdir(nextAbs, function(err2, files) {
|
|
784
|
-
if (err2)
|
|
785
|
-
return callback(err2);
|
|
786
|
-
if (sort)
|
|
787
|
-
files.sort();
|
|
788
|
-
for (var i = 0; i < files.length; i++) {
|
|
789
|
-
if (!ignore(path3.join(cwd, next, files[i])))
|
|
790
|
-
queue.push(path3.join(next, files[i]));
|
|
791
|
-
}
|
|
792
|
-
callback(null, next, stat5);
|
|
793
|
-
});
|
|
794
|
-
});
|
|
795
|
-
};
|
|
796
|
-
};
|
|
797
|
-
var strip = function(map, level) {
|
|
798
|
-
return function(header) {
|
|
799
|
-
header.name = header.name.split("/").slice(level).join("/");
|
|
800
|
-
var linkname = header.linkname;
|
|
801
|
-
if (linkname && (header.type === "link" || path3.isAbsolute(linkname))) {
|
|
802
|
-
header.linkname = linkname.split("/").slice(level).join("/");
|
|
803
|
-
}
|
|
804
|
-
return map(header);
|
|
805
|
-
};
|
|
806
|
-
};
|
|
807
|
-
exports.pack = function(cwd, opts) {
|
|
808
|
-
if (!cwd)
|
|
809
|
-
cwd = ".";
|
|
810
|
-
if (!opts)
|
|
811
|
-
opts = {};
|
|
812
|
-
var xfs = opts.fs || fs4;
|
|
813
|
-
var ignore = opts.ignore || opts.filter || noop;
|
|
814
|
-
var map = opts.map || noop;
|
|
815
|
-
var mapStream = opts.mapStream || echo;
|
|
816
|
-
var statNext = statAll(xfs, opts.dereference ? xfs.stat : xfs.lstat, cwd, ignore, opts.entries, opts.sort);
|
|
817
|
-
var strict = opts.strict !== false;
|
|
818
|
-
var umask = typeof opts.umask === "number" ? ~opts.umask : ~processUmask();
|
|
819
|
-
var dmode = typeof opts.dmode === "number" ? opts.dmode : 0;
|
|
820
|
-
var fmode = typeof opts.fmode === "number" ? opts.fmode : 0;
|
|
821
|
-
var pack = opts.pack || tar2.pack();
|
|
822
|
-
var finish = opts.finish || noop;
|
|
823
|
-
if (opts.strip)
|
|
824
|
-
map = strip(map, opts.strip);
|
|
825
|
-
if (opts.readable) {
|
|
826
|
-
dmode |= parseInt(555, 8);
|
|
827
|
-
fmode |= parseInt(444, 8);
|
|
828
|
-
}
|
|
829
|
-
if (opts.writable) {
|
|
830
|
-
dmode |= parseInt(333, 8);
|
|
831
|
-
fmode |= parseInt(222, 8);
|
|
832
|
-
}
|
|
833
|
-
var onsymlink = function(filename, header) {
|
|
834
|
-
xfs.readlink(path3.join(cwd, filename), function(err, linkname) {
|
|
835
|
-
if (err)
|
|
836
|
-
return pack.destroy(err);
|
|
837
|
-
header.linkname = normalize(linkname);
|
|
838
|
-
pack.entry(header, onnextentry);
|
|
839
|
-
});
|
|
840
|
-
};
|
|
841
|
-
var onstat = function(err, filename, stat4) {
|
|
842
|
-
if (err)
|
|
843
|
-
return pack.destroy(err);
|
|
844
|
-
if (!filename) {
|
|
845
|
-
if (opts.finalize !== false)
|
|
846
|
-
pack.finalize();
|
|
847
|
-
return finish(pack);
|
|
848
|
-
}
|
|
849
|
-
if (stat4.isSocket())
|
|
850
|
-
return onnextentry();
|
|
851
|
-
var header = {
|
|
852
|
-
name: normalize(filename),
|
|
853
|
-
mode: (stat4.mode | (stat4.isDirectory() ? dmode : fmode)) & umask,
|
|
854
|
-
mtime: stat4.mtime,
|
|
855
|
-
size: stat4.size,
|
|
856
|
-
type: "file",
|
|
857
|
-
uid: stat4.uid,
|
|
858
|
-
gid: stat4.gid
|
|
859
|
-
};
|
|
860
|
-
if (stat4.isDirectory()) {
|
|
861
|
-
header.size = 0;
|
|
862
|
-
header.type = "directory";
|
|
863
|
-
header = map(header) || header;
|
|
864
|
-
return pack.entry(header, onnextentry);
|
|
865
|
-
}
|
|
866
|
-
if (stat4.isSymbolicLink()) {
|
|
867
|
-
header.size = 0;
|
|
868
|
-
header.type = "symlink";
|
|
869
|
-
header = map(header) || header;
|
|
870
|
-
return onsymlink(filename, header);
|
|
871
|
-
}
|
|
872
|
-
header = map(header) || header;
|
|
873
|
-
if (!stat4.isFile()) {
|
|
874
|
-
if (strict)
|
|
875
|
-
return pack.destroy(new Error("unsupported type for " + filename));
|
|
876
|
-
return onnextentry();
|
|
877
|
-
}
|
|
878
|
-
var entry = pack.entry(header, onnextentry);
|
|
879
|
-
if (!entry)
|
|
880
|
-
return;
|
|
881
|
-
var rs = mapStream(xfs.createReadStream(path3.join(cwd, filename)), header);
|
|
882
|
-
rs.on("error", function(err2) {
|
|
883
|
-
entry.destroy(err2);
|
|
884
|
-
});
|
|
885
|
-
pump(rs, entry);
|
|
886
|
-
};
|
|
887
|
-
var onnextentry = function(err) {
|
|
888
|
-
if (err)
|
|
889
|
-
return pack.destroy(err);
|
|
890
|
-
statNext(onstat);
|
|
891
|
-
};
|
|
892
|
-
onnextentry();
|
|
893
|
-
return pack;
|
|
894
|
-
};
|
|
895
|
-
var head = function(list21) {
|
|
896
|
-
return list21.length ? list21[list21.length - 1] : null;
|
|
897
|
-
};
|
|
898
|
-
var processGetuid = function() {
|
|
899
|
-
return process.getuid ? process.getuid() : -1;
|
|
900
|
-
};
|
|
901
|
-
var processUmask = function() {
|
|
902
|
-
return process.umask ? process.umask() : 0;
|
|
903
|
-
};
|
|
904
|
-
exports.extract = function(cwd, opts) {
|
|
905
|
-
if (!cwd)
|
|
906
|
-
cwd = ".";
|
|
907
|
-
if (!opts)
|
|
908
|
-
opts = {};
|
|
909
|
-
var xfs = opts.fs || fs4;
|
|
910
|
-
var ignore = opts.ignore || opts.filter || noop;
|
|
911
|
-
var map = opts.map || noop;
|
|
912
|
-
var mapStream = opts.mapStream || echo;
|
|
913
|
-
var own = opts.chown !== false && !win32 && processGetuid() === 0;
|
|
914
|
-
var extract = opts.extract || tar2.extract();
|
|
915
|
-
var stack = [];
|
|
916
|
-
var now = /* @__PURE__ */ new Date();
|
|
917
|
-
var umask = typeof opts.umask === "number" ? ~opts.umask : ~processUmask();
|
|
918
|
-
var dmode = typeof opts.dmode === "number" ? opts.dmode : 0;
|
|
919
|
-
var fmode = typeof opts.fmode === "number" ? opts.fmode : 0;
|
|
920
|
-
var strict = opts.strict !== false;
|
|
921
|
-
if (opts.strip)
|
|
922
|
-
map = strip(map, opts.strip);
|
|
923
|
-
if (opts.readable) {
|
|
924
|
-
dmode |= parseInt(555, 8);
|
|
925
|
-
fmode |= parseInt(444, 8);
|
|
926
|
-
}
|
|
927
|
-
if (opts.writable) {
|
|
928
|
-
dmode |= parseInt(333, 8);
|
|
929
|
-
fmode |= parseInt(222, 8);
|
|
930
|
-
}
|
|
931
|
-
var utimesParent = function(name, cb) {
|
|
932
|
-
var top;
|
|
933
|
-
while ((top = head(stack)) && name.slice(0, top[0].length) !== top[0])
|
|
934
|
-
stack.pop();
|
|
935
|
-
if (!top)
|
|
936
|
-
return cb();
|
|
937
|
-
xfs.utimes(top[0], now, top[1], cb);
|
|
938
|
-
};
|
|
939
|
-
var utimes = function(name, header, cb) {
|
|
940
|
-
if (opts.utimes === false)
|
|
941
|
-
return cb();
|
|
942
|
-
if (header.type === "directory")
|
|
943
|
-
return xfs.utimes(name, now, header.mtime, cb);
|
|
944
|
-
if (header.type === "symlink")
|
|
945
|
-
return utimesParent(name, cb);
|
|
946
|
-
xfs.utimes(name, now, header.mtime, function(err) {
|
|
947
|
-
if (err)
|
|
948
|
-
return cb(err);
|
|
949
|
-
utimesParent(name, cb);
|
|
950
|
-
});
|
|
951
|
-
};
|
|
952
|
-
var chperm = function(name, header, cb) {
|
|
953
|
-
var link2 = header.type === "symlink";
|
|
954
|
-
var chmod3 = link2 ? xfs.lchmod : xfs.chmod;
|
|
955
|
-
var chown = link2 ? xfs.lchown : xfs.chown;
|
|
956
|
-
if (!chmod3)
|
|
957
|
-
return cb();
|
|
958
|
-
var mode = (header.mode | (header.type === "directory" ? dmode : fmode)) & umask;
|
|
959
|
-
chmod3(name, mode, function(err) {
|
|
960
|
-
if (err)
|
|
961
|
-
return cb(err);
|
|
962
|
-
if (!own)
|
|
963
|
-
return cb();
|
|
964
|
-
if (!chown)
|
|
965
|
-
return cb();
|
|
966
|
-
chown(name, header.uid, header.gid, cb);
|
|
967
|
-
});
|
|
968
|
-
};
|
|
969
|
-
extract.on("entry", function(header, stream, next) {
|
|
970
|
-
header = map(header) || header;
|
|
971
|
-
header.name = normalize(header.name);
|
|
972
|
-
var name = path3.join(cwd, path3.join("/", header.name));
|
|
973
|
-
if (ignore(name, header)) {
|
|
974
|
-
stream.resume();
|
|
975
|
-
return next();
|
|
976
|
-
}
|
|
977
|
-
var stat4 = function(err) {
|
|
978
|
-
if (err)
|
|
979
|
-
return next(err);
|
|
980
|
-
utimes(name, header, function(err2) {
|
|
981
|
-
if (err2)
|
|
982
|
-
return next(err2);
|
|
983
|
-
if (win32)
|
|
984
|
-
return next();
|
|
985
|
-
chperm(name, header, next);
|
|
986
|
-
});
|
|
987
|
-
};
|
|
988
|
-
var onsymlink = function() {
|
|
989
|
-
if (win32)
|
|
990
|
-
return next();
|
|
991
|
-
xfs.unlink(name, function() {
|
|
992
|
-
var dst = path3.resolve(path3.dirname(name), header.linkname);
|
|
993
|
-
if (!dst.startsWith(path3.resolve(cwd)))
|
|
994
|
-
return next(new Error(name + " is not a valid symlink"));
|
|
995
|
-
xfs.symlink(header.linkname, name, stat4);
|
|
996
|
-
});
|
|
997
|
-
};
|
|
998
|
-
var onlink = function() {
|
|
999
|
-
if (win32)
|
|
1000
|
-
return next();
|
|
1001
|
-
xfs.unlink(name, function() {
|
|
1002
|
-
var srcpath = path3.join(cwd, path3.join("/", header.linkname));
|
|
1003
|
-
xfs.realpath(srcpath, function(err, dst) {
|
|
1004
|
-
if (err || !dst.startsWith(path3.resolve(cwd)))
|
|
1005
|
-
return next(new Error(name + " is not a valid hardlink"));
|
|
1006
|
-
xfs.link(dst, name, function(err2) {
|
|
1007
|
-
if (err2 && err2.code === "EPERM" && opts.hardlinkAsFilesFallback) {
|
|
1008
|
-
stream = xfs.createReadStream(srcpath);
|
|
1009
|
-
return onfile();
|
|
1010
|
-
}
|
|
1011
|
-
stat4(err2);
|
|
1012
|
-
});
|
|
1013
|
-
});
|
|
1014
|
-
});
|
|
1015
|
-
};
|
|
1016
|
-
var onfile = function() {
|
|
1017
|
-
var ws = xfs.createWriteStream(name);
|
|
1018
|
-
var rs = mapStream(stream, header);
|
|
1019
|
-
ws.on("error", function(err) {
|
|
1020
|
-
rs.destroy(err);
|
|
1021
|
-
});
|
|
1022
|
-
pump(rs, ws, function(err) {
|
|
1023
|
-
if (err)
|
|
1024
|
-
return next(err);
|
|
1025
|
-
ws.on("close", stat4);
|
|
1026
|
-
});
|
|
1027
|
-
};
|
|
1028
|
-
if (header.type === "directory") {
|
|
1029
|
-
stack.push([name, header.mtime]);
|
|
1030
|
-
return mkdirfix(name, {
|
|
1031
|
-
fs: xfs,
|
|
1032
|
-
own,
|
|
1033
|
-
uid: header.uid,
|
|
1034
|
-
gid: header.gid
|
|
1035
|
-
}, stat4);
|
|
1036
|
-
}
|
|
1037
|
-
var dir = path3.dirname(name);
|
|
1038
|
-
validate(xfs, dir, path3.join(cwd, "."), function(err, valid) {
|
|
1039
|
-
if (err)
|
|
1040
|
-
return next(err);
|
|
1041
|
-
if (!valid)
|
|
1042
|
-
return next(new Error(dir + " is not a valid path"));
|
|
1043
|
-
mkdirfix(dir, {
|
|
1044
|
-
fs: xfs,
|
|
1045
|
-
own,
|
|
1046
|
-
uid: header.uid,
|
|
1047
|
-
gid: header.gid
|
|
1048
|
-
}, function(err2) {
|
|
1049
|
-
if (err2)
|
|
1050
|
-
return next(err2);
|
|
1051
|
-
switch (header.type) {
|
|
1052
|
-
case "file":
|
|
1053
|
-
return onfile();
|
|
1054
|
-
case "link":
|
|
1055
|
-
return onlink();
|
|
1056
|
-
case "symlink":
|
|
1057
|
-
return onsymlink();
|
|
1058
|
-
}
|
|
1059
|
-
if (strict)
|
|
1060
|
-
return next(new Error("unsupported type for " + name + " (" + header.type + ")"));
|
|
1061
|
-
stream.resume();
|
|
1062
|
-
next();
|
|
1063
|
-
});
|
|
1064
|
-
});
|
|
1065
|
-
});
|
|
1066
|
-
if (opts.finish)
|
|
1067
|
-
extract.on("finish", opts.finish);
|
|
1068
|
-
return extract;
|
|
1069
|
-
};
|
|
1070
|
-
function validate(fs5, name, root, cb) {
|
|
1071
|
-
if (name === root)
|
|
1072
|
-
return cb(null, true);
|
|
1073
|
-
fs5.lstat(name, function(err, st) {
|
|
1074
|
-
if (err && err.code !== "ENOENT")
|
|
1075
|
-
return cb(err);
|
|
1076
|
-
if (err || st.isDirectory())
|
|
1077
|
-
return validate(fs5, path3.join(name, ".."), root, cb);
|
|
1078
|
-
cb(null, false);
|
|
1079
|
-
});
|
|
1080
|
-
}
|
|
1081
|
-
function mkdirfix(name, opts, cb) {
|
|
1082
|
-
mkdirp(name, { fs: opts.fs }, function(err, made) {
|
|
1083
|
-
if (!err && made && opts.own) {
|
|
1084
|
-
chownr(made, opts.uid, opts.gid, cb);
|
|
1085
|
-
} else {
|
|
1086
|
-
cb(err);
|
|
1087
|
-
}
|
|
1088
|
-
});
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
});
|
|
1092
|
-
|
|
1093
769
|
// src/util/telemetry/commands/agent/index.ts
|
|
1094
770
|
var AgentTelemetryClient = class extends TelemetryClient {
|
|
1095
771
|
trackCliArgumentInit(value) {
|
|
@@ -1495,12 +1171,12 @@ function runId(run3) {
|
|
|
1495
1171
|
return readString(run3, "id", "runId") ?? PLACEHOLDER;
|
|
1496
1172
|
}
|
|
1497
1173
|
function formatRunStatus(run3) {
|
|
1498
|
-
const
|
|
1499
|
-
if (!
|
|
1174
|
+
const status4 = readString(run3, "status", "state");
|
|
1175
|
+
if (!status4)
|
|
1500
1176
|
return PLACEHOLDER;
|
|
1501
|
-
const label = (0, import_title.default)(
|
|
1177
|
+
const label = (0, import_title.default)(status4.replace(/[_-]+/g, " "));
|
|
1502
1178
|
const CIRCLE = "\u25CF ";
|
|
1503
|
-
switch (
|
|
1179
|
+
switch (status4.toLowerCase()) {
|
|
1504
1180
|
case "completed":
|
|
1505
1181
|
case "succeeded":
|
|
1506
1182
|
case "success":
|
|
@@ -2479,7 +2155,7 @@ async function activity(client) {
|
|
|
2479
2155
|
return 0;
|
|
2480
2156
|
}
|
|
2481
2157
|
telemetry2.trackCliSubcommandLs(subcommandOriginal);
|
|
2482
|
-
const listFn = (await import("./chunks/list-
|
|
2158
|
+
const listFn = (await import("./chunks/list-MTOKP2AP.js")).default;
|
|
2483
2159
|
return listFn(client, telemetry2);
|
|
2484
2160
|
}
|
|
2485
2161
|
}
|
|
@@ -6442,7 +6118,7 @@ ${preserved.join("\n")}` : body
|
|
|
6442
6118
|
const current = await readFileOrNull(path3);
|
|
6443
6119
|
const symlink = await isSymlink(path3);
|
|
6444
6120
|
let next = null;
|
|
6445
|
-
let
|
|
6121
|
+
let status4;
|
|
6446
6122
|
let error;
|
|
6447
6123
|
try {
|
|
6448
6124
|
let acc = current;
|
|
@@ -6451,14 +6127,14 @@ ${preserved.join("\n")}` : body
|
|
|
6451
6127
|
}
|
|
6452
6128
|
next = acc;
|
|
6453
6129
|
if (current === null) {
|
|
6454
|
-
|
|
6130
|
+
status4 = "create";
|
|
6455
6131
|
} else if (acc === current || ctx.apiKey === KEY_PLACEHOLDER && acc !== null && matchesWithStoredKey(current, acc)) {
|
|
6456
|
-
|
|
6132
|
+
status4 = "unchanged";
|
|
6457
6133
|
} else {
|
|
6458
|
-
|
|
6134
|
+
status4 = "update";
|
|
6459
6135
|
}
|
|
6460
6136
|
} catch (err) {
|
|
6461
|
-
|
|
6137
|
+
status4 = "error";
|
|
6462
6138
|
error = err instanceof Error ? err.message : String(err);
|
|
6463
6139
|
}
|
|
6464
6140
|
changes.push({
|
|
@@ -6469,7 +6145,7 @@ ${preserved.join("\n")}` : body
|
|
|
6469
6145
|
owners: entry.owners,
|
|
6470
6146
|
current,
|
|
6471
6147
|
next,
|
|
6472
|
-
status:
|
|
6148
|
+
status: status4,
|
|
6473
6149
|
error,
|
|
6474
6150
|
symlink
|
|
6475
6151
|
});
|
|
@@ -6854,9 +6530,9 @@ function printAgentWarning(warning2) {
|
|
|
6854
6530
|
function groupWarningsByAgent(entries) {
|
|
6855
6531
|
const grouped = /* @__PURE__ */ new Map();
|
|
6856
6532
|
for (const { agent: agent2, warning: warning2 } of entries) {
|
|
6857
|
-
const
|
|
6858
|
-
|
|
6859
|
-
grouped.set(agent2,
|
|
6533
|
+
const list22 = grouped.get(agent2) ?? [];
|
|
6534
|
+
list22.push(warning2);
|
|
6535
|
+
grouped.set(agent2, list22);
|
|
6860
6536
|
}
|
|
6861
6537
|
return grouped;
|
|
6862
6538
|
}
|
|
@@ -8185,13 +7861,13 @@ function outputPrice(p) {
|
|
|
8185
7861
|
return `${p?.image_output}/img`;
|
|
8186
7862
|
return dash();
|
|
8187
7863
|
}
|
|
8188
|
-
function printEndpointsTable(
|
|
7864
|
+
function printEndpointsTable(list22) {
|
|
8189
7865
|
return `${table(
|
|
8190
7866
|
[
|
|
8191
7867
|
["provider", "context", "input", "output", "p50 ttft", "uptime"].map(
|
|
8192
7868
|
(header) => import_chalk24.default.gray(header)
|
|
8193
7869
|
),
|
|
8194
|
-
...
|
|
7870
|
+
...list22.map((e2) => [
|
|
8195
7871
|
e2.provider_name,
|
|
8196
7872
|
count(e2.context_length),
|
|
8197
7873
|
inputPrice(e2.pricing),
|
|
@@ -9325,17 +9001,17 @@ ${extra}` : helpOutput);
|
|
|
9325
9001
|
switch (subcommand) {
|
|
9326
9002
|
case "inspect": {
|
|
9327
9003
|
telemetry2.trackCliSubcommandInspect(subcommandOriginal);
|
|
9328
|
-
const inspectFn = (await import("./chunks/inspect-
|
|
9004
|
+
const inspectFn = (await import("./chunks/inspect-H2HA6RZQ.js")).default;
|
|
9329
9005
|
return inspectFn(client, rawSubcommandArgs);
|
|
9330
9006
|
}
|
|
9331
9007
|
case "rules": {
|
|
9332
9008
|
telemetry2.trackCliSubcommandRules(args[0] ?? "ls");
|
|
9333
|
-
const rulesFn = (await import("./chunks/rules-
|
|
9009
|
+
const rulesFn = (await import("./chunks/rules-DNPBXPCT.js")).default;
|
|
9334
9010
|
return rulesFn(client, rawSubcommandArgs);
|
|
9335
9011
|
}
|
|
9336
9012
|
default: {
|
|
9337
9013
|
telemetry2.trackCliSubcommandLs(subcommandOriginal);
|
|
9338
|
-
const listFn = (await import("./chunks/list-
|
|
9014
|
+
const listFn = (await import("./chunks/list-YR65RN5B.js")).default;
|
|
9339
9015
|
return listFn(client, telemetry2);
|
|
9340
9016
|
}
|
|
9341
9017
|
}
|
|
@@ -10762,7 +10438,7 @@ async function list9(client, argv, auth) {
|
|
|
10762
10438
|
store: client.telemetryEventStore
|
|
10763
10439
|
}
|
|
10764
10440
|
});
|
|
10765
|
-
const flagsSpecification = getFlagsSpecification(
|
|
10441
|
+
const flagsSpecification = getFlagsSpecification(listSubcommand23.options);
|
|
10766
10442
|
let parsedArgs;
|
|
10767
10443
|
try {
|
|
10768
10444
|
parsedArgs = parseArguments(argv, flagsSpecification);
|
|
@@ -10795,11 +10471,11 @@ async function list9(client, argv, auth) {
|
|
|
10795
10471
|
);
|
|
10796
10472
|
return 1;
|
|
10797
10473
|
}
|
|
10798
|
-
let
|
|
10474
|
+
let list22;
|
|
10799
10475
|
try {
|
|
10800
10476
|
output_manager_default.debug("Fetching blobs");
|
|
10801
10477
|
output_manager_default.spinner("Fetching blobs");
|
|
10802
|
-
|
|
10478
|
+
list22 = await blob.list({
|
|
10803
10479
|
...blobOpts(auth),
|
|
10804
10480
|
limit: limit ?? 10,
|
|
10805
10481
|
cursor: cursor2,
|
|
@@ -10816,7 +10492,7 @@ async function list9(client, argv, auth) {
|
|
|
10816
10492
|
const tablePrint = table(
|
|
10817
10493
|
[
|
|
10818
10494
|
headers.map((header) => import_chalk34.default.dim(header)),
|
|
10819
|
-
...
|
|
10495
|
+
...list22.blobs.map((blob9) => {
|
|
10820
10496
|
urls.push(blob9.url);
|
|
10821
10497
|
const uploadedAt = (0, import_ms5.default)(Date.now() - new Date(blob9.uploadedAt).getTime());
|
|
10822
10498
|
return [uploadedAt, String(blob9.size), blob9.pathname, blob9.url];
|
|
@@ -10824,7 +10500,7 @@ async function list9(client, argv, auth) {
|
|
|
10824
10500
|
],
|
|
10825
10501
|
{ hsep: 5 }
|
|
10826
10502
|
).replace(/^/gm, " ");
|
|
10827
|
-
if (
|
|
10503
|
+
if (list22.blobs.length > 0) {
|
|
10828
10504
|
output_manager_default.print(`
|
|
10829
10505
|
${tablePrint}
|
|
10830
10506
|
|
|
@@ -10832,11 +10508,11 @@ ${tablePrint}
|
|
|
10832
10508
|
} else {
|
|
10833
10509
|
output_manager_default.log("No blobs in this store");
|
|
10834
10510
|
}
|
|
10835
|
-
if (
|
|
10511
|
+
if (list22.cursor) {
|
|
10836
10512
|
const nextFlags = getCommandFlags(flags, ["_", "--cursor"]);
|
|
10837
10513
|
output_manager_default.log(
|
|
10838
10514
|
`To display the next page run ${getCommandName(
|
|
10839
|
-
`blob list${nextFlags} --cursor ${
|
|
10515
|
+
`blob list${nextFlags} --cursor ${list22.cursor}`
|
|
10840
10516
|
)}`
|
|
10841
10517
|
);
|
|
10842
10518
|
}
|
|
@@ -12952,7 +12628,7 @@ async function signedToken(client, argv, auth) {
|
|
|
12952
12628
|
|
|
12953
12629
|
// src/commands/blob/index.ts
|
|
12954
12630
|
var COMMAND_CONFIG13 = {
|
|
12955
|
-
list: getCommandAliases(
|
|
12631
|
+
list: getCommandAliases(listSubcommand23),
|
|
12956
12632
|
put: getCommandAliases(putSubcommand),
|
|
12957
12633
|
get: getCommandAliases(getSubcommand3),
|
|
12958
12634
|
del: getCommandAliases(delSubcommand),
|
|
@@ -13005,7 +12681,7 @@ async function main3(client) {
|
|
|
13005
12681
|
case "list":
|
|
13006
12682
|
if (needHelp) {
|
|
13007
12683
|
telemetry2.trackCliFlagHelp("blob", subcommandOriginal);
|
|
13008
|
-
printHelp(
|
|
12684
|
+
printHelp(listSubcommand23);
|
|
13009
12685
|
return 2;
|
|
13010
12686
|
}
|
|
13011
12687
|
telemetry2.trackCliSubcommandList(subcommandOriginal);
|
|
@@ -14701,43 +14377,43 @@ async function comments(client) {
|
|
|
14701
14377
|
if (handleHelp(inspectSubcommand4))
|
|
14702
14378
|
return 0;
|
|
14703
14379
|
telemetry2.trackCliSubcommandInspect(subcommandOriginal);
|
|
14704
|
-
return (await import("./chunks/inspect-
|
|
14380
|
+
return (await import("./chunks/inspect-FAJ7BQOB.js")).default(client, telemetry2);
|
|
14705
14381
|
}
|
|
14706
14382
|
case "open": {
|
|
14707
14383
|
if (handleHelp(openSubcommand))
|
|
14708
14384
|
return 0;
|
|
14709
14385
|
telemetry2.trackCliSubcommandOpen(subcommandOriginal);
|
|
14710
|
-
return (await import("./chunks/open-
|
|
14386
|
+
return (await import("./chunks/open-2P4ZZTJD.js")).default(client, telemetry2);
|
|
14711
14387
|
}
|
|
14712
14388
|
case "reply": {
|
|
14713
14389
|
if (handleHelp(replySubcommand))
|
|
14714
14390
|
return 0;
|
|
14715
14391
|
telemetry2.trackCliSubcommandReply(subcommandOriginal);
|
|
14716
|
-
return (await import("./chunks/reply-
|
|
14392
|
+
return (await import("./chunks/reply-QZWESDIB.js")).default(client, telemetry2);
|
|
14717
14393
|
}
|
|
14718
14394
|
case "resolve": {
|
|
14719
14395
|
if (handleHelp(resolveSubcommand))
|
|
14720
14396
|
return 0;
|
|
14721
14397
|
telemetry2.trackCliSubcommandResolve(subcommandOriginal);
|
|
14722
|
-
return (await import("./chunks/resolve-
|
|
14398
|
+
return (await import("./chunks/resolve-HSW2EFLZ.js")).default(client, telemetry2, true);
|
|
14723
14399
|
}
|
|
14724
14400
|
case "reopen": {
|
|
14725
14401
|
if (handleHelp(reopenSubcommand))
|
|
14726
14402
|
return 0;
|
|
14727
14403
|
telemetry2.trackCliSubcommandReopen(subcommandOriginal);
|
|
14728
|
-
return (await import("./chunks/resolve-
|
|
14404
|
+
return (await import("./chunks/resolve-HSW2EFLZ.js")).default(client, telemetry2, false);
|
|
14729
14405
|
}
|
|
14730
14406
|
case "edit": {
|
|
14731
14407
|
if (handleHelp(editSubcommand))
|
|
14732
14408
|
return 0;
|
|
14733
14409
|
telemetry2.trackCliSubcommandEdit(subcommandOriginal);
|
|
14734
|
-
return (await import("./chunks/edit-
|
|
14410
|
+
return (await import("./chunks/edit-3IUCXLNZ.js")).default(client, telemetry2);
|
|
14735
14411
|
}
|
|
14736
14412
|
case "delete": {
|
|
14737
14413
|
if (handleHelp(deleteSubcommand))
|
|
14738
14414
|
return 0;
|
|
14739
14415
|
telemetry2.trackCliSubcommandDelete(subcommandOriginal);
|
|
14740
|
-
return (await import("./chunks/delete-
|
|
14416
|
+
return (await import("./chunks/delete-QYUDDZD2.js")).default(client, telemetry2);
|
|
14741
14417
|
}
|
|
14742
14418
|
default: {
|
|
14743
14419
|
if (needHelp) {
|
|
@@ -14753,7 +14429,7 @@ async function comments(client) {
|
|
|
14753
14429
|
}
|
|
14754
14430
|
telemetry2.trackCliSubcommandList(subcommandOriginal);
|
|
14755
14431
|
const defaultInvocation = subcommandOriginal === "default";
|
|
14756
|
-
return (await import("./chunks/list-
|
|
14432
|
+
return (await import("./chunks/list-FONLZ3YO.js")).default(
|
|
14757
14433
|
client,
|
|
14758
14434
|
telemetry2,
|
|
14759
14435
|
defaultInvocation
|
|
@@ -15141,8 +14817,8 @@ async function awaitConnexResult(client, verifier) {
|
|
|
15141
14817
|
return null;
|
|
15142
14818
|
}
|
|
15143
14819
|
} catch (err) {
|
|
15144
|
-
const
|
|
15145
|
-
if (
|
|
14820
|
+
const status4 = err.status;
|
|
14821
|
+
if (status4 === 404) {
|
|
15146
14822
|
early404Count++;
|
|
15147
14823
|
if (early404Count > MAX_EARLY_404_COUNT) {
|
|
15148
14824
|
output_manager_default.error("Setup request expired. Please try again.");
|
|
@@ -16508,8 +16184,8 @@ async function update(client, args, flags) {
|
|
|
16508
16184
|
);
|
|
16509
16185
|
} catch (err) {
|
|
16510
16186
|
output_manager_default.stopSpinner();
|
|
16511
|
-
const
|
|
16512
|
-
if (
|
|
16187
|
+
const status4 = err.status;
|
|
16188
|
+
if (status4 === 404) {
|
|
16513
16189
|
output_manager_default.error(`Connector not found: ${import_chalk47.default.bold(clientIdOrUid)}`);
|
|
16514
16190
|
} else {
|
|
16515
16191
|
output_manager_default.error(
|
|
@@ -16551,8 +16227,8 @@ async function update(client, args, flags) {
|
|
|
16551
16227
|
);
|
|
16552
16228
|
} catch (err) {
|
|
16553
16229
|
output_manager_default.stopSpinner();
|
|
16554
|
-
const
|
|
16555
|
-
if (
|
|
16230
|
+
const status4 = err.status;
|
|
16231
|
+
if (status4 === 404) {
|
|
16556
16232
|
output_manager_default.error(`Connector not found: ${import_chalk47.default.bold(clientIdOrUid)}`);
|
|
16557
16233
|
return 1;
|
|
16558
16234
|
}
|
|
@@ -16660,8 +16336,8 @@ async function list11(client, flags) {
|
|
|
16660
16336
|
response = await client.fetch(url);
|
|
16661
16337
|
} catch (err) {
|
|
16662
16338
|
output_manager_default.stopSpinner();
|
|
16663
|
-
const
|
|
16664
|
-
if (
|
|
16339
|
+
const status4 = err.status;
|
|
16340
|
+
if (status4 === 404) {
|
|
16665
16341
|
output_manager_default.error(
|
|
16666
16342
|
"Connect is not enabled for this team. Contact support to enable it."
|
|
16667
16343
|
);
|
|
@@ -17171,8 +16847,8 @@ async function attach(client, args, flags) {
|
|
|
17171
16847
|
);
|
|
17172
16848
|
} catch (err) {
|
|
17173
16849
|
output_manager_default.stopSpinner();
|
|
17174
|
-
const
|
|
17175
|
-
if (
|
|
16850
|
+
const status4 = err.status;
|
|
16851
|
+
if (status4 === 404) {
|
|
17176
16852
|
output_manager_default.error(`No connector found for ${import_chalk50.default.bold(clientIdOrUid)}.`);
|
|
17177
16853
|
return 1;
|
|
17178
16854
|
}
|
|
@@ -17236,8 +16912,8 @@ async function attach(client, args, flags) {
|
|
|
17236
16912
|
`/v1/connect/connectors/${encodeURIComponent(target.id)}/projects/${encodeURIComponent(projectId)}`
|
|
17237
16913
|
);
|
|
17238
16914
|
} catch (err) {
|
|
17239
|
-
const
|
|
17240
|
-
if (
|
|
16915
|
+
const status4 = err.status;
|
|
16916
|
+
if (status4 !== 404) {
|
|
17241
16917
|
printError(err);
|
|
17242
16918
|
return 1;
|
|
17243
16919
|
}
|
|
@@ -17331,14 +17007,14 @@ async function attach(client, args, flags) {
|
|
|
17331
17007
|
);
|
|
17332
17008
|
} catch (err) {
|
|
17333
17009
|
output_manager_default.stopSpinner();
|
|
17334
|
-
const
|
|
17335
|
-
if (
|
|
17010
|
+
const status4 = err.status;
|
|
17011
|
+
if (status4 === 403) {
|
|
17336
17012
|
output_manager_default.error(
|
|
17337
17013
|
`You don't have permission to attach projects on this team. Owner or Member role required.`
|
|
17338
17014
|
);
|
|
17339
17015
|
return 1;
|
|
17340
17016
|
}
|
|
17341
|
-
if (
|
|
17017
|
+
if (status4 === 404) {
|
|
17342
17018
|
output_manager_default.error(
|
|
17343
17019
|
`No connector found for ${import_chalk50.default.bold(displayName)}, or project ${import_chalk50.default.bold(projectName)} is no longer accessible.`
|
|
17344
17020
|
);
|
|
@@ -17359,14 +17035,14 @@ async function attach(client, args, flags) {
|
|
|
17359
17035
|
await patchTriggerDestinations(client, target.id, merged);
|
|
17360
17036
|
} catch (err) {
|
|
17361
17037
|
output_manager_default.stopSpinner();
|
|
17362
|
-
const
|
|
17363
|
-
if (
|
|
17038
|
+
const status4 = err.status;
|
|
17039
|
+
if (status4 === 403) {
|
|
17364
17040
|
output_manager_default.error(
|
|
17365
17041
|
`You don't have permission to update trigger destinations on this team. Owner or Member role required.`
|
|
17366
17042
|
);
|
|
17367
17043
|
return 1;
|
|
17368
17044
|
}
|
|
17369
|
-
if (
|
|
17045
|
+
if (status4 === 404) {
|
|
17370
17046
|
output_manager_default.error(
|
|
17371
17047
|
`Trigger destinations are not available for this team (the connex-triggers feature is not enabled).`
|
|
17372
17048
|
);
|
|
@@ -17479,8 +17155,8 @@ async function detach(client, args, flags) {
|
|
|
17479
17155
|
);
|
|
17480
17156
|
} catch (err) {
|
|
17481
17157
|
output_manager_default.stopSpinner();
|
|
17482
|
-
const
|
|
17483
|
-
if (
|
|
17158
|
+
const status4 = err.status;
|
|
17159
|
+
if (status4 === 404) {
|
|
17484
17160
|
output_manager_default.error(`No connector found for ${import_chalk51.default.bold(clientIdOrUid)}.`);
|
|
17485
17161
|
return 1;
|
|
17486
17162
|
}
|
|
@@ -17497,8 +17173,8 @@ async function detach(client, args, flags) {
|
|
|
17497
17173
|
`/v1/connect/connectors/${encodeURIComponent(target.id)}/projects/${encodeURIComponent(projectId)}`
|
|
17498
17174
|
);
|
|
17499
17175
|
} catch (err) {
|
|
17500
|
-
const
|
|
17501
|
-
if (
|
|
17176
|
+
const status4 = err.status;
|
|
17177
|
+
if (status4 !== 404) {
|
|
17502
17178
|
printError(err);
|
|
17503
17179
|
return 1;
|
|
17504
17180
|
}
|
|
@@ -17555,14 +17231,14 @@ async function detach(client, args, flags) {
|
|
|
17555
17231
|
);
|
|
17556
17232
|
} catch (err) {
|
|
17557
17233
|
output_manager_default.stopSpinner();
|
|
17558
|
-
const
|
|
17559
|
-
if (
|
|
17234
|
+
const status4 = err.status;
|
|
17235
|
+
if (status4 === 403) {
|
|
17560
17236
|
output_manager_default.error(
|
|
17561
17237
|
`You don't have permission to detach projects on this team. Owner or Member role required.`
|
|
17562
17238
|
);
|
|
17563
17239
|
return 1;
|
|
17564
17240
|
}
|
|
17565
|
-
if (
|
|
17241
|
+
if (status4 === 404) {
|
|
17566
17242
|
if (asJson) {
|
|
17567
17243
|
client.stdout.write(
|
|
17568
17244
|
`${JSON.stringify(
|
|
@@ -17643,8 +17319,8 @@ async function remove5(client, args, flags) {
|
|
|
17643
17319
|
);
|
|
17644
17320
|
} catch (err) {
|
|
17645
17321
|
output_manager_default.stopSpinner();
|
|
17646
|
-
const
|
|
17647
|
-
if (
|
|
17322
|
+
const status4 = err.status;
|
|
17323
|
+
if (status4 === 404) {
|
|
17648
17324
|
output_manager_default.error(`No connector found for ${import_chalk52.default.bold(clientIdOrUid)}.`);
|
|
17649
17325
|
return 1;
|
|
17650
17326
|
}
|
|
@@ -17764,8 +17440,8 @@ async function revokeTokens(client, args, flags) {
|
|
|
17764
17440
|
);
|
|
17765
17441
|
} catch (err) {
|
|
17766
17442
|
output_manager_default.stopSpinner();
|
|
17767
|
-
const
|
|
17768
|
-
if (
|
|
17443
|
+
const status4 = err.status;
|
|
17444
|
+
if (status4 === 404) {
|
|
17769
17445
|
output_manager_default.error(`No connector found for ${import_chalk53.default.bold(clientIdOrUid)}.`);
|
|
17770
17446
|
return 1;
|
|
17771
17447
|
}
|
|
@@ -17849,8 +17525,8 @@ async function revokeTokens(client, args, flags) {
|
|
|
17849
17525
|
);
|
|
17850
17526
|
} catch (err) {
|
|
17851
17527
|
output_manager_default.stopSpinner();
|
|
17852
|
-
const
|
|
17853
|
-
if (
|
|
17528
|
+
const status4 = err.status;
|
|
17529
|
+
if (status4 === 403) {
|
|
17854
17530
|
output_manager_default.error(
|
|
17855
17531
|
`You don't have permission to revoke tokens for ${import_chalk53.default.bold(displayName)}.`
|
|
17856
17532
|
);
|
|
@@ -17937,8 +17613,8 @@ async function openClient(client, args, flags) {
|
|
|
17937
17613
|
resolvedId = resolved.id;
|
|
17938
17614
|
} catch (err) {
|
|
17939
17615
|
output_manager_default.stopSpinner();
|
|
17940
|
-
const
|
|
17941
|
-
if (
|
|
17616
|
+
const status4 = err.status;
|
|
17617
|
+
if (status4 === 404) {
|
|
17942
17618
|
output_manager_default.error(
|
|
17943
17619
|
`Connector ${import_chalk54.default.bold(`"${clientIdOrUid}"`)} not found on team ${import_chalk54.default.bold(team.slug)}, or Connect is not enabled for this team.`
|
|
17944
17620
|
);
|
|
@@ -23050,9 +22726,9 @@ function nextCommandsForDomainsAddFailure(client, domainName, projectName, err)
|
|
|
23050
22726
|
const apiErr = err;
|
|
23051
22727
|
const code2 = typeof apiErr.code === "string" ? apiErr.code : "";
|
|
23052
22728
|
const msg = err.message.toLowerCase();
|
|
23053
|
-
const
|
|
23054
|
-
const looksLikeOwnershipOrPurchaseIssue = code2 === "not_domain_owner" || code2 === "invalid_domain" || code2 === "domain_not_found" ||
|
|
23055
|
-
const aliasConflict = code2 === "ALIAS_DOMAIN_EXIST" ||
|
|
22729
|
+
const status4 = isAPIError(err) ? err.status : void 0;
|
|
22730
|
+
const looksLikeOwnershipOrPurchaseIssue = code2 === "not_domain_owner" || code2 === "invalid_domain" || code2 === "domain_not_found" || status4 === 403 && (msg.includes("not authorized") || msg.includes("forbidden")) || msg.includes("not verified") || msg.includes("do not own") || msg.includes("not the owner");
|
|
22731
|
+
const aliasConflict = code2 === "ALIAS_DOMAIN_EXIST" || status4 === 409 || msg.includes("already assigned") || msg.includes("already in use");
|
|
23056
22732
|
if (looksLikeOwnershipOrPurchaseIssue || aliasConflict) {
|
|
23057
22733
|
next.push({
|
|
23058
22734
|
command: withGlobalFlags(client, `domains buy ${domainName}`),
|
|
@@ -23218,12 +22894,12 @@ async function add5(client, argv) {
|
|
|
23218
22894
|
} catch (err) {
|
|
23219
22895
|
const error = err instanceof Error ? err : new Error(String(err));
|
|
23220
22896
|
if (client.nonInteractive) {
|
|
23221
|
-
const
|
|
22897
|
+
const status4 = isAPIError(error) ? error.status : void 0;
|
|
23222
22898
|
const apiErr = error;
|
|
23223
22899
|
const code2 = typeof apiErr.code === "string" ? apiErr.code : "";
|
|
23224
22900
|
const msg = error.message.toLowerCase();
|
|
23225
|
-
let reason =
|
|
23226
|
-
if (code2 === "not_domain_owner" ||
|
|
22901
|
+
let reason = status4 === 403 ? "forbidden" : status4 === 404 ? "not_found" : status4 === 409 || msg.includes("already") ? "alias_conflict" : "domain_add_failed";
|
|
22902
|
+
if (code2 === "not_domain_owner" || status4 === 403 && msg.includes("not authorized")) {
|
|
23227
22903
|
reason = "domain_not_owned";
|
|
23228
22904
|
}
|
|
23229
22905
|
let message = (0, import_error_utils9.errorToString)(error);
|
|
@@ -23380,12 +23056,12 @@ async function add5(client, argv) {
|
|
|
23380
23056
|
}
|
|
23381
23057
|
if (aliasTarget instanceof Error) {
|
|
23382
23058
|
if (client.nonInteractive) {
|
|
23383
|
-
const
|
|
23059
|
+
const status4 = isAPIError(aliasTarget) ? aliasTarget.status : void 0;
|
|
23384
23060
|
const apiErr = aliasTarget;
|
|
23385
23061
|
const code2 = typeof apiErr.code === "string" ? apiErr.code : "";
|
|
23386
23062
|
const msg = aliasTarget.message.toLowerCase();
|
|
23387
|
-
let reason =
|
|
23388
|
-
if (code2 === "not_domain_owner" ||
|
|
23063
|
+
let reason = status4 === 403 ? "forbidden" : status4 === 404 ? "not_found" : status4 === 409 || msg.includes("already") ? "alias_conflict" : "domain_add_failed";
|
|
23064
|
+
if (code2 === "not_domain_owner" || status4 === 403 && msg.includes("not authorized")) {
|
|
23389
23065
|
reason = "domain_not_owned";
|
|
23390
23066
|
}
|
|
23391
23067
|
let message = (0, import_error_utils9.errorToString)(aliasTarget);
|
|
@@ -25520,7 +25196,7 @@ function projectErrorMessage(err, projectIdOrName) {
|
|
|
25520
25196
|
var import_tldts6 = __toESM(require_cjs(), 1);
|
|
25521
25197
|
function diagnoseDomain(facts, commands) {
|
|
25522
25198
|
const configurationStatus = getConfigurationStatus(facts);
|
|
25523
|
-
const
|
|
25199
|
+
const status4 = getDomainStatus2(configurationStatus, facts.project);
|
|
25524
25200
|
const recommendedDnsRecords = configurationStatus === "scope-resolution-required" || isPlatformManagedDomain(facts) || shouldRecommendProjectAttachment(facts) ? [] : getRecommendedDnsRecords(facts);
|
|
25525
25201
|
const domainConnect = configurationStatus === "scope-resolution-required" || isPlatformManagedDomain(facts) || shouldRecommendProjectAttachment(facts) ? null : getDomainConnectConfiguration(facts);
|
|
25526
25202
|
const steps = buildSteps(
|
|
@@ -25529,13 +25205,13 @@ function diagnoseDomain(facts, commands) {
|
|
|
25529
25205
|
recommendedDnsRecords,
|
|
25530
25206
|
domainConnect
|
|
25531
25207
|
);
|
|
25532
|
-
const details = statusDetails(facts,
|
|
25533
|
-
const issues = getDomainIssues(facts,
|
|
25534
|
-
const next = buildNextSteps(steps, commands,
|
|
25535
|
-
const ok = isOkStatus(
|
|
25208
|
+
const details = statusDetails(facts, status4, steps);
|
|
25209
|
+
const issues = getDomainIssues(facts, status4, configurationStatus, steps);
|
|
25210
|
+
const next = buildNextSteps(steps, commands, status4);
|
|
25211
|
+
const ok = isOkStatus(status4);
|
|
25536
25212
|
return {
|
|
25537
25213
|
facts,
|
|
25538
|
-
status:
|
|
25214
|
+
status: status4,
|
|
25539
25215
|
configurationStatus,
|
|
25540
25216
|
ok,
|
|
25541
25217
|
exitCode: ok ? 0 : 1,
|
|
@@ -25586,15 +25262,15 @@ function getDomainStatus2(configurationStatus, project) {
|
|
|
25586
25262
|
}
|
|
25587
25263
|
return configurationStatus;
|
|
25588
25264
|
}
|
|
25589
|
-
function getDomainIssues(facts,
|
|
25265
|
+
function getDomainIssues(facts, status4, configurationStatus, steps) {
|
|
25590
25266
|
const statuses = [];
|
|
25591
25267
|
const addStatus = (candidate) => {
|
|
25592
25268
|
if (candidate !== "configured-correctly" && !statuses.includes(candidate)) {
|
|
25593
25269
|
statuses.push(candidate);
|
|
25594
25270
|
}
|
|
25595
25271
|
};
|
|
25596
|
-
addStatus(
|
|
25597
|
-
if (
|
|
25272
|
+
addStatus(status4);
|
|
25273
|
+
if (status4 !== "scope-resolution-required") {
|
|
25598
25274
|
addStatus(configurationStatus);
|
|
25599
25275
|
if (facts.project.kind === "missing") {
|
|
25600
25276
|
addStatus("project-domain-missing");
|
|
@@ -25607,16 +25283,16 @@ function getDomainIssues(facts, status3, configurationStatus, steps) {
|
|
|
25607
25283
|
...statusDetails(facts, domainStatus, steps)
|
|
25608
25284
|
}));
|
|
25609
25285
|
}
|
|
25610
|
-
function statusDetails(facts,
|
|
25286
|
+
function statusDetails(facts, status4, steps) {
|
|
25611
25287
|
const { domainName, project } = facts;
|
|
25612
25288
|
const domainConnect = getDomainConnect(steps);
|
|
25613
25289
|
const attachProject = steps.find((step) => step.kind === "attach-project");
|
|
25614
|
-
if (
|
|
25290
|
+
if (status4 === "configured-correctly") {
|
|
25615
25291
|
return {
|
|
25616
25292
|
reason: AGENT_REASON.CONFIGURED_CORRECTLY,
|
|
25617
25293
|
message: project.kind === "attached" ? `${domainName} has a valid configuration and is verified for project ${project.label}.` : `${domainName} has a valid configuration.`
|
|
25618
25294
|
};
|
|
25619
|
-
} else if (
|
|
25295
|
+
} else if (status4 === "verification-needed") {
|
|
25620
25296
|
return {
|
|
25621
25297
|
reason: AGENT_REASON.VERIFICATION_NEEDED,
|
|
25622
25298
|
message: project.kind === "attached" ? `${domainName} needs ownership verification for project ${project.label}.` : `${domainName} needs ownership verification.`,
|
|
@@ -25627,7 +25303,7 @@ function statusDetails(facts, status3, steps) {
|
|
|
25627
25303
|
"Add one of the project verification records at the DNS provider, then run the suggested verify command."
|
|
25628
25304
|
)
|
|
25629
25305
|
};
|
|
25630
|
-
} else if (
|
|
25306
|
+
} else if (status4 === "invalid-configuration") {
|
|
25631
25307
|
if (isPlatformManagedDomain(facts)) {
|
|
25632
25308
|
return {
|
|
25633
25309
|
reason: AGENT_REASON.INVALID_CONFIGURATION,
|
|
@@ -25656,14 +25332,14 @@ function statusDetails(facts, status3, steps) {
|
|
|
25656
25332
|
)
|
|
25657
25333
|
};
|
|
25658
25334
|
}
|
|
25659
|
-
} else if (
|
|
25335
|
+
} else if (status4 === "dnssec-needs-to-be-disabled") {
|
|
25660
25336
|
return {
|
|
25661
25337
|
reason: AGENT_REASON.DNSSEC_NEEDS_TO_BE_DISABLED,
|
|
25662
25338
|
message: `${domainName} uses Vercel nameservers, but DNSSEC must be disabled with the domain registrar so the nameservers can resolve globally.`,
|
|
25663
25339
|
userActionRequired: true,
|
|
25664
25340
|
hint: "Disable DNSSEC with the domain registrar, then run the suggested verify command."
|
|
25665
25341
|
};
|
|
25666
|
-
} else if (
|
|
25342
|
+
} else if (status4 === "dns-change-required") {
|
|
25667
25343
|
return {
|
|
25668
25344
|
reason: AGENT_REASON.DNS_CHANGE_REQUIRED,
|
|
25669
25345
|
message: `${domainName} requires a DNS change to avoid downtime.`,
|
|
@@ -25674,7 +25350,7 @@ function statusDetails(facts, status3, steps) {
|
|
|
25674
25350
|
"Apply the recommended records or nameservers at the DNS provider, then run the suggested verify command."
|
|
25675
25351
|
)
|
|
25676
25352
|
};
|
|
25677
|
-
} else if (
|
|
25353
|
+
} else if (status4 === "dns-change-recommended") {
|
|
25678
25354
|
return {
|
|
25679
25355
|
reason: AGENT_REASON.DNS_CHANGE_RECOMMENDED,
|
|
25680
25356
|
message: `${domainName} has a valid configuration, but Vercel recommends updating its DNS records.`,
|
|
@@ -25684,13 +25360,13 @@ function statusDetails(facts, status3, steps) {
|
|
|
25684
25360
|
"The domain is working. Apply the recommended DNS update when convenient, then re-check."
|
|
25685
25361
|
)
|
|
25686
25362
|
};
|
|
25687
|
-
} else if (
|
|
25363
|
+
} else if (status4 === "project-attachment-recommended") {
|
|
25688
25364
|
return {
|
|
25689
25365
|
reason: AGENT_REASON.PROJECT_ATTACHMENT_RECOMMENDED,
|
|
25690
25366
|
message: `${domainName} is owned by ${facts.contextName} but is not attached to a project.`,
|
|
25691
25367
|
hint: "To use the domain, replace <project> in next[] with the project that should serve it."
|
|
25692
25368
|
};
|
|
25693
|
-
} else if (
|
|
25369
|
+
} else if (status4 === "scope-resolution-required") {
|
|
25694
25370
|
return {
|
|
25695
25371
|
reason: AGENT_REASON.SCOPE_NOT_ACCESSIBLE,
|
|
25696
25372
|
message: `${domainName} exists on Vercel but is not accessible under ${facts.contextName}. Retry under the owning team before evaluating its DNS or project status.`,
|
|
@@ -25798,7 +25474,7 @@ function buildConfigureDnsStep(facts, recommendedDnsRecords, domainConnect) {
|
|
|
25798
25474
|
methods
|
|
25799
25475
|
};
|
|
25800
25476
|
}
|
|
25801
|
-
function buildNextSteps(steps, commands,
|
|
25477
|
+
function buildNextSteps(steps, commands, status4) {
|
|
25802
25478
|
const next = [];
|
|
25803
25479
|
for (const step of steps) {
|
|
25804
25480
|
if (step.kind === "resolve-scope") {
|
|
@@ -25829,10 +25505,10 @@ function buildNextSteps(steps, commands, status3) {
|
|
|
25829
25505
|
}
|
|
25830
25506
|
}
|
|
25831
25507
|
}
|
|
25832
|
-
if (!steps.some((step) => step.kind === "resolve-scope") &&
|
|
25508
|
+
if (!steps.some((step) => step.kind === "resolve-scope") && status4 !== "configured-correctly" && status4 !== "project-attachment-recommended") {
|
|
25833
25509
|
next.push({
|
|
25834
25510
|
command: commands.verify(),
|
|
25835
|
-
when:
|
|
25511
|
+
when: status4 === "dns-change-recommended" ? "Re-check after applying the recommended DNS change" : "Re-check after completing the required changes"
|
|
25836
25512
|
});
|
|
25837
25513
|
}
|
|
25838
25514
|
return next;
|
|
@@ -25908,8 +25584,8 @@ function hasRecommendedDnsUpdate(config) {
|
|
|
25908
25584
|
function needsDnsRecordChange(config) {
|
|
25909
25585
|
return hasRecommendedDnsUpdate(config) && (config.ipStatus === "required-change" || config.ipStatus === "optional-change" || config.misconfigured && config.configuredBy === null);
|
|
25910
25586
|
}
|
|
25911
|
-
function isOkStatus(
|
|
25912
|
-
return
|
|
25587
|
+
function isOkStatus(status4) {
|
|
25588
|
+
return status4 === "configured-correctly" || status4 === "dns-change-recommended" || status4 === "project-attachment-recommended";
|
|
25913
25589
|
}
|
|
25914
25590
|
function isCloudflareDns(config) {
|
|
25915
25591
|
return config.nameservers.length > 0 && config.nameservers.every(
|
|
@@ -27056,12 +26732,12 @@ function isMitigationsPaused(bypass) {
|
|
|
27056
26732
|
(b) => isAllSourcesBypass(b.Ip) && b.Domain === "*" && (b.ExpiresAt === null || b.ExpiresAt === void 0 || b.ExpiresAt > now)
|
|
27057
26733
|
);
|
|
27058
26734
|
}
|
|
27059
|
-
function formatAttackModeStatus(
|
|
27060
|
-
if (!
|
|
26735
|
+
function formatAttackModeStatus(status4) {
|
|
26736
|
+
if (!status4.enabled) {
|
|
27061
26737
|
return import_chalk90.default.dim("Off");
|
|
27062
26738
|
}
|
|
27063
|
-
if (
|
|
27064
|
-
const remainingMs =
|
|
26739
|
+
if (status4.activeUntil) {
|
|
26740
|
+
const remainingMs = status4.activeUntil - Date.now();
|
|
27065
26741
|
if (remainingMs <= 0) {
|
|
27066
26742
|
return import_chalk90.default.dim("Off (expired)");
|
|
27067
26743
|
}
|
|
@@ -27201,19 +26877,19 @@ function formatIpBlocksTable(annotated) {
|
|
|
27201
26877
|
` ${" ".repeat(prefixWidth)}${import_chalk90.default.dim("IP/CIDR".padEnd(ipWidth + gap))}${import_chalk90.default.dim("Hostname".padEnd(hostnameWidth + gap))}${import_chalk90.default.dim("Notes")}`
|
|
27202
26878
|
);
|
|
27203
26879
|
for (let i = 0; i < annotated.length; i++) {
|
|
27204
|
-
const { rule, status:
|
|
26880
|
+
const { rule, status: status4 } = annotated[i];
|
|
27205
26881
|
const ip = rule.ip.padEnd(ipWidth + gap);
|
|
27206
26882
|
const hostname2 = hostnames[i].padEnd(hostnameWidth + gap);
|
|
27207
26883
|
const notes = rule.notes || "";
|
|
27208
26884
|
let prefix = " ";
|
|
27209
26885
|
let colorFn = (s) => s;
|
|
27210
|
-
if (
|
|
26886
|
+
if (status4 === "added") {
|
|
27211
26887
|
prefix = "+ ";
|
|
27212
26888
|
colorFn = import_chalk90.default.green;
|
|
27213
|
-
} else if (
|
|
26889
|
+
} else if (status4 === "removed") {
|
|
27214
26890
|
prefix = "- ";
|
|
27215
26891
|
colorFn = import_chalk90.default.red;
|
|
27216
|
-
} else if (
|
|
26892
|
+
} else if (status4 === "modified") {
|
|
27217
26893
|
prefix = "~ ";
|
|
27218
26894
|
colorFn = import_chalk90.default.yellow;
|
|
27219
26895
|
}
|
|
@@ -27541,24 +27217,24 @@ function formatRulesTable(annotated) {
|
|
|
27541
27217
|
` ${" ".repeat(prefixWidth)}${import_chalk90.default.dim("#".padEnd(numWidth + gap))}${import_chalk90.default.dim("Name".padEnd(nameWidth + gap))}${import_chalk90.default.dim("Action".padEnd(actionWidth + gap))}${import_chalk90.default.dim("Status")}`
|
|
27542
27218
|
);
|
|
27543
27219
|
for (let i = 0; i < annotated.length; i++) {
|
|
27544
|
-
const { rule, status:
|
|
27220
|
+
const { rule, status: status4 } = annotated[i];
|
|
27545
27221
|
const num = String(i + 1).padEnd(numWidth + gap);
|
|
27546
27222
|
const name = rule.name.padEnd(nameWidth + gap);
|
|
27547
27223
|
const actionText = actionTexts[i].padEnd(actionWidth + gap);
|
|
27548
27224
|
let prefix = " ";
|
|
27549
27225
|
let colorFn = (s) => s;
|
|
27550
|
-
if (
|
|
27226
|
+
if (status4 === "added") {
|
|
27551
27227
|
prefix = "+ ";
|
|
27552
27228
|
colorFn = import_chalk90.default.green;
|
|
27553
|
-
} else if (
|
|
27229
|
+
} else if (status4 === "removed") {
|
|
27554
27230
|
prefix = "- ";
|
|
27555
27231
|
colorFn = import_chalk90.default.red;
|
|
27556
|
-
} else if (
|
|
27232
|
+
} else if (status4 === "modified") {
|
|
27557
27233
|
prefix = "~ ";
|
|
27558
27234
|
colorFn = import_chalk90.default.yellow;
|
|
27559
27235
|
}
|
|
27560
27236
|
const activeStatusText = rule.active ? "Enabled" : "Disabled";
|
|
27561
|
-
const activeStatus =
|
|
27237
|
+
const activeStatus = status4 === "removed" ? import_chalk90.default.dim(activeStatusText) : rule.active ? import_chalk90.default.green(activeStatusText) : import_chalk90.default.red(activeStatusText);
|
|
27562
27238
|
lines.push(colorFn(` ${prefix}${num}${name}${actionText}${activeStatus}`));
|
|
27563
27239
|
const idIndent = " ".repeat(prefixWidth + numWidth + gap);
|
|
27564
27240
|
lines.push(colorFn(` ${idIndent}${import_chalk90.default.dim(rule.id)}`));
|
|
@@ -27577,9 +27253,9 @@ function formatConditionGroup(group, groupIndex, totalGroups) {
|
|
|
27577
27253
|
function formatRuleExpanded(rule, index) {
|
|
27578
27254
|
const lines = [];
|
|
27579
27255
|
const prefix = index !== void 0 ? `${index + 1}. ` : "";
|
|
27580
|
-
const
|
|
27256
|
+
const status4 = rule.active ? import_chalk90.default.green("Enabled") : import_chalk90.default.red("Disabled");
|
|
27581
27257
|
const action = formatActionDisplay(rule.action);
|
|
27582
|
-
lines.push(` ${prefix}${import_chalk90.default.bold(rule.name)} [${
|
|
27258
|
+
lines.push(` ${prefix}${import_chalk90.default.bold(rule.name)} [${status4}]`);
|
|
27583
27259
|
if (rule.description) {
|
|
27584
27260
|
lines.push(` ${import_chalk90.default.dim(rule.description)}`);
|
|
27585
27261
|
}
|
|
@@ -28040,8 +27716,8 @@ function ipVersion(ip) {
|
|
|
28040
27716
|
return isIP(ip);
|
|
28041
27717
|
}
|
|
28042
27718
|
function validateBypassIp(input) {
|
|
28043
|
-
const
|
|
28044
|
-
if (
|
|
27719
|
+
const version2 = ipVersion(input);
|
|
27720
|
+
if (version2 === 4 || version2 === 6) {
|
|
28045
27721
|
return null;
|
|
28046
27722
|
}
|
|
28047
27723
|
const cidr = parseCidr(input);
|
|
@@ -28075,8 +27751,8 @@ function validateBypassIp(input) {
|
|
|
28075
27751
|
return null;
|
|
28076
27752
|
}
|
|
28077
27753
|
function validateBlockingIp(input) {
|
|
28078
|
-
const
|
|
28079
|
-
if (
|
|
27754
|
+
const version2 = ipVersion(input);
|
|
27755
|
+
if (version2 === 4 || version2 === 6) {
|
|
28080
27756
|
return null;
|
|
28081
27757
|
}
|
|
28082
27758
|
const cidr = parseCidr(input);
|
|
@@ -29358,16 +29034,16 @@ async function list14(client, argv) {
|
|
|
29358
29034
|
if (parsed.flags["--expand"]) {
|
|
29359
29035
|
output_manager_default.print("\n");
|
|
29360
29036
|
for (let i = 0; i < annotated.length; i++) {
|
|
29361
|
-
const { rule, status:
|
|
29037
|
+
const { rule, status: status4 } = annotated[i];
|
|
29362
29038
|
let colorFn = (s) => s;
|
|
29363
29039
|
let prefix = "";
|
|
29364
|
-
if (
|
|
29040
|
+
if (status4 === "added") {
|
|
29365
29041
|
colorFn = import_chalk105.default.green;
|
|
29366
29042
|
prefix = "+ ";
|
|
29367
|
-
} else if (
|
|
29043
|
+
} else if (status4 === "removed") {
|
|
29368
29044
|
colorFn = import_chalk105.default.red;
|
|
29369
29045
|
prefix = "- ";
|
|
29370
|
-
} else if (
|
|
29046
|
+
} else if (status4 === "modified") {
|
|
29371
29047
|
colorFn = import_chalk105.default.yellow;
|
|
29372
29048
|
prefix = "~ ";
|
|
29373
29049
|
}
|
|
@@ -33691,8 +33367,8 @@ async function resolveGlobalConfigId(client, idOrSlug) {
|
|
|
33691
33367
|
if (idOrSlug.startsWith("ecfg_")) {
|
|
33692
33368
|
return idOrSlug;
|
|
33693
33369
|
}
|
|
33694
|
-
const
|
|
33695
|
-
const match =
|
|
33370
|
+
const list22 = await client.fetch("/v1/global-config");
|
|
33371
|
+
const match = list22.find((c) => c.slug === idOrSlug);
|
|
33696
33372
|
return match?.id ?? null;
|
|
33697
33373
|
}
|
|
33698
33374
|
|
|
@@ -36912,9 +36588,9 @@ async function diffVersions(client, argv, telemetryClient) {
|
|
|
36912
36588
|
`Fetching version diff for ${import_chalk130.default.bold(flagArg)} revision ${revision} in ${projectSlugLink}`
|
|
36913
36589
|
);
|
|
36914
36590
|
try {
|
|
36915
|
-
const { version, previousVersion, availableRevisionCount } = await getVersionPair(client, project.id, flagArg, revision);
|
|
36591
|
+
const { version: version2, previousVersion, availableRevisionCount } = await getVersionPair(client, project.id, flagArg, revision);
|
|
36916
36592
|
output_manager_default.stopSpinner();
|
|
36917
|
-
if (!
|
|
36593
|
+
if (!version2) {
|
|
36918
36594
|
output_manager_default.error(
|
|
36919
36595
|
`${formatAvailableRevisionCount(availableRevisionCount)} Revision ${revision} was not found for ${import_chalk130.default.bold(flagArg)} in ${projectSlugLink}.`
|
|
36920
36596
|
);
|
|
@@ -36930,15 +36606,15 @@ async function diffVersions(client, argv, telemetryClient) {
|
|
|
36930
36606
|
outputDiffJson(
|
|
36931
36607
|
client,
|
|
36932
36608
|
flagArg,
|
|
36933
|
-
|
|
36609
|
+
version2,
|
|
36934
36610
|
previousVersion,
|
|
36935
|
-
diffVersionData(previousVersion.data,
|
|
36611
|
+
diffVersionData(previousVersion.data, version2.data)
|
|
36936
36612
|
);
|
|
36937
36613
|
} else {
|
|
36938
36614
|
printVersionDiff({
|
|
36939
36615
|
flagArg,
|
|
36940
36616
|
projectSlugLink,
|
|
36941
|
-
version,
|
|
36617
|
+
version: version2,
|
|
36942
36618
|
previousVersion,
|
|
36943
36619
|
diffStamp
|
|
36944
36620
|
});
|
|
@@ -36965,7 +36641,7 @@ async function resolveLinkedProject(client, projectName) {
|
|
|
36965
36641
|
}
|
|
36966
36642
|
async function getVersionPair(client, projectId, flagArg, revision) {
|
|
36967
36643
|
let cursor2;
|
|
36968
|
-
let
|
|
36644
|
+
let version2;
|
|
36969
36645
|
let previousVersion;
|
|
36970
36646
|
const availableRevisions = /* @__PURE__ */ new Set();
|
|
36971
36647
|
do {
|
|
@@ -36976,19 +36652,19 @@ async function getVersionPair(client, projectId, flagArg, revision) {
|
|
|
36976
36652
|
for (const candidate of result.versions) {
|
|
36977
36653
|
availableRevisions.add(candidate.revision);
|
|
36978
36654
|
}
|
|
36979
|
-
|
|
36655
|
+
version2 ??= result.versions.find(
|
|
36980
36656
|
(candidate) => candidate.revision === revision
|
|
36981
36657
|
);
|
|
36982
36658
|
previousVersion ??= result.versions.find(
|
|
36983
36659
|
(candidate) => candidate.revision === revision - 1
|
|
36984
36660
|
);
|
|
36985
|
-
if (
|
|
36661
|
+
if (version2 && previousVersion) {
|
|
36986
36662
|
break;
|
|
36987
36663
|
}
|
|
36988
36664
|
cursor2 = result.next ?? void 0;
|
|
36989
36665
|
} while (cursor2);
|
|
36990
36666
|
return {
|
|
36991
|
-
version,
|
|
36667
|
+
version: version2,
|
|
36992
36668
|
previousVersion,
|
|
36993
36669
|
availableRevisionCount: availableRevisions.size
|
|
36994
36670
|
};
|
|
@@ -36998,37 +36674,37 @@ function formatAvailableRevisionCount(count2) {
|
|
|
36998
36674
|
}
|
|
36999
36675
|
function outputJson4(client, versions2, next) {
|
|
37000
36676
|
const jsonOutput = {
|
|
37001
|
-
versions: versions2.map((
|
|
37002
|
-
...formatVersionSummary(
|
|
37003
|
-
data:
|
|
36677
|
+
versions: versions2.map((version2) => ({
|
|
36678
|
+
...formatVersionSummary(version2),
|
|
36679
|
+
data: version2.data
|
|
37004
36680
|
})),
|
|
37005
36681
|
pagination: { next }
|
|
37006
36682
|
};
|
|
37007
36683
|
client.stdout.write(`${JSON.stringify(jsonOutput, null, 2)}
|
|
37008
36684
|
`);
|
|
37009
36685
|
}
|
|
37010
|
-
function outputDiffJson(client, flagArg,
|
|
36686
|
+
function outputDiffJson(client, flagArg, version2, previousVersion, changes) {
|
|
37011
36687
|
const jsonOutput = {
|
|
37012
36688
|
flag: flagArg,
|
|
37013
|
-
revision:
|
|
36689
|
+
revision: version2.revision,
|
|
37014
36690
|
previousRevision: previousVersion.revision,
|
|
37015
|
-
version: formatVersionSummary(
|
|
36691
|
+
version: formatVersionSummary(version2),
|
|
37016
36692
|
previousVersion: formatVersionSummary(previousVersion),
|
|
37017
36693
|
changes
|
|
37018
36694
|
};
|
|
37019
36695
|
client.stdout.write(`${JSON.stringify(jsonOutput, null, 2)}
|
|
37020
36696
|
`);
|
|
37021
36697
|
}
|
|
37022
|
-
function formatVersionSummary(
|
|
36698
|
+
function formatVersionSummary(version2) {
|
|
37023
36699
|
return {
|
|
37024
|
-
id:
|
|
37025
|
-
flagId:
|
|
37026
|
-
revision:
|
|
37027
|
-
author: getVersionAuthor(
|
|
37028
|
-
createdBy:
|
|
37029
|
-
message: getVersionMessage(
|
|
37030
|
-
createdAt:
|
|
37031
|
-
changedEnvironments:
|
|
36700
|
+
id: version2.id,
|
|
36701
|
+
flagId: version2.flagId,
|
|
36702
|
+
revision: version2.revision,
|
|
36703
|
+
author: getVersionAuthor(version2),
|
|
36704
|
+
createdBy: version2.createdBy ?? null,
|
|
36705
|
+
message: getVersionMessage(version2),
|
|
36706
|
+
createdAt: version2.createdAt,
|
|
36707
|
+
changedEnvironments: version2.changedEnvironments
|
|
37032
36708
|
};
|
|
37033
36709
|
}
|
|
37034
36710
|
function printVersionsTable(versions2) {
|
|
@@ -37039,12 +36715,12 @@ function printVersionsTable(versions2) {
|
|
|
37039
36715
|
"Timestamp",
|
|
37040
36716
|
"Changed Environments"
|
|
37041
36717
|
];
|
|
37042
|
-
const rows = versions2.map((
|
|
37043
|
-
String(
|
|
37044
|
-
getVersionAuthor(
|
|
37045
|
-
getVersionMessage(
|
|
37046
|
-
formatDate(
|
|
37047
|
-
formatChangedEnvironments(
|
|
36718
|
+
const rows = versions2.map((version2) => [
|
|
36719
|
+
String(version2.revision),
|
|
36720
|
+
getVersionAuthor(version2) ?? import_chalk130.default.gray("-"),
|
|
36721
|
+
getVersionMessage(version2) ?? import_chalk130.default.gray("-"),
|
|
36722
|
+
formatDate(version2.createdAt),
|
|
36723
|
+
formatChangedEnvironments(version2.changedEnvironments)
|
|
37048
36724
|
]);
|
|
37049
36725
|
const table3 = formatTable(
|
|
37050
36726
|
headers,
|
|
@@ -37058,29 +36734,29 @@ ${table3}
|
|
|
37058
36734
|
function printVersionDiff({
|
|
37059
36735
|
flagArg,
|
|
37060
36736
|
projectSlugLink,
|
|
37061
|
-
version,
|
|
36737
|
+
version: version2,
|
|
37062
36738
|
previousVersion,
|
|
37063
36739
|
diffStamp
|
|
37064
36740
|
}) {
|
|
37065
36741
|
output_manager_default.log(
|
|
37066
|
-
`Changes in revision ${import_chalk130.default.bold(String(
|
|
36742
|
+
`Changes in revision ${import_chalk130.default.bold(String(version2.revision))} for ${import_chalk130.default.bold(flagArg)} compared with revision ${import_chalk130.default.bold(String(previousVersion.revision))} in ${projectSlugLink} ${import_chalk130.default.gray(diffStamp())}`
|
|
37067
36743
|
);
|
|
37068
36744
|
output_manager_default.print(
|
|
37069
36745
|
`
|
|
37070
|
-
${import_chalk130.default.dim("Author:")} ${getVersionAuthor(
|
|
36746
|
+
${import_chalk130.default.dim("Author:")} ${getVersionAuthor(version2) ?? import_chalk130.default.gray("-")}
|
|
37071
36747
|
`
|
|
37072
36748
|
);
|
|
37073
36749
|
output_manager_default.print(
|
|
37074
|
-
` ${import_chalk130.default.dim("Message:")} ${getVersionMessage(
|
|
36750
|
+
` ${import_chalk130.default.dim("Message:")} ${getVersionMessage(version2) ?? import_chalk130.default.gray("-")}
|
|
37075
36751
|
`
|
|
37076
36752
|
);
|
|
37077
36753
|
output_manager_default.print(
|
|
37078
|
-
` ${import_chalk130.default.dim("Changed environments:")} ${formatChangedEnvironments(
|
|
36754
|
+
` ${import_chalk130.default.dim("Changed environments:")} ${formatChangedEnvironments(version2.changedEnvironments)}
|
|
37079
36755
|
`
|
|
37080
36756
|
);
|
|
37081
36757
|
const formattedDiff = formatVersionDataDiff(
|
|
37082
36758
|
previousVersion.data,
|
|
37083
|
-
|
|
36759
|
+
version2.data
|
|
37084
36760
|
);
|
|
37085
36761
|
if (formattedDiff.length === 0) {
|
|
37086
36762
|
output_manager_default.print(`
|
|
@@ -37100,14 +36776,14 @@ function formatChangedEnvironments(environments) {
|
|
|
37100
36776
|
}
|
|
37101
36777
|
return environments.join(", ");
|
|
37102
36778
|
}
|
|
37103
|
-
function getVersionAuthor(
|
|
37104
|
-
return
|
|
36779
|
+
function getVersionAuthor(version2) {
|
|
36780
|
+
return version2.metadata?.creator?.name ?? version2.createdBy ?? null;
|
|
37105
36781
|
}
|
|
37106
|
-
function getVersionMessage(
|
|
37107
|
-
if (
|
|
37108
|
-
return
|
|
36782
|
+
function getVersionMessage(version2) {
|
|
36783
|
+
if (version2.message) {
|
|
36784
|
+
return version2.message;
|
|
37109
36785
|
}
|
|
37110
|
-
if (
|
|
36786
|
+
if (version2.revision === 0) {
|
|
37111
36787
|
return "Flag created";
|
|
37112
36788
|
}
|
|
37113
36789
|
return null;
|
|
@@ -38589,8 +38265,8 @@ async function resolveFlagEnvironment(client, flag, environment, promptMessage2,
|
|
|
38589
38265
|
return nextEnvironment;
|
|
38590
38266
|
}
|
|
38591
38267
|
function formatEnvironmentChoiceLabel(envName, envConfig) {
|
|
38592
|
-
const
|
|
38593
|
-
return `${envName} (${
|
|
38268
|
+
const status4 = envConfig?.active ? import_chalk133.default.green("active") : import_chalk133.default.yellow("paused");
|
|
38269
|
+
return `${envName} (${status4})`;
|
|
38594
38270
|
}
|
|
38595
38271
|
function isOverridingEnvironmentToVariant(envConfig, variantId) {
|
|
38596
38272
|
return !envConfig.active && envConfig.pausedOutcome?.variantId === variantId && envConfig.fallthrough.type === "variant" && envConfig.fallthrough.variantId === variantId;
|
|
@@ -44977,9 +44653,9 @@ async function main18(client) {
|
|
|
44977
44653
|
var import_chalk162 = __toESM(require_source(), 1);
|
|
44978
44654
|
async function status(client) {
|
|
44979
44655
|
const enabled = client.config.guidance?.enabled !== false;
|
|
44980
|
-
const
|
|
44656
|
+
const status4 = enabled ? import_chalk162.default.green("Enabled") : import_chalk162.default.red("Disabled");
|
|
44981
44657
|
output_manager_default.print("\n");
|
|
44982
|
-
output_manager_default.log(`${import_chalk162.default.bold("Guidance status")}: ${
|
|
44658
|
+
output_manager_default.log(`${import_chalk162.default.bold("Guidance status")}: ${status4}`);
|
|
44983
44659
|
output_manager_default.print("\n");
|
|
44984
44660
|
return 0;
|
|
44985
44661
|
}
|
|
@@ -45690,13 +45366,13 @@ function routes(routes2) {
|
|
|
45690
45366
|
toPrint += `${import_chalk165.default.grey("\u2576")} ${import_chalk165.default.cyan(item.handle)}`;
|
|
45691
45367
|
continue;
|
|
45692
45368
|
}
|
|
45693
|
-
const { src, dest, status:
|
|
45369
|
+
const { src, dest, status: status4, headers } = item;
|
|
45694
45370
|
const last = routes2.indexOf(item) === routes2.length - 1;
|
|
45695
45371
|
const suffix = last ? "" : `
|
|
45696
45372
|
`;
|
|
45697
45373
|
const finalSrc = import_chalk165.default.cyan(src.padEnd(longestSrc + padding2));
|
|
45698
45374
|
const finalDest = dest ? `${arrow}${space}${dest}` : ` ${space}${destSpace}`;
|
|
45699
|
-
const finalStatus =
|
|
45375
|
+
const finalStatus = status4 ? import_chalk165.default.grey(`[${status4}]`) : "";
|
|
45700
45376
|
let finalHeaders = null;
|
|
45701
45377
|
if (headers) {
|
|
45702
45378
|
finalHeaders = `
|
|
@@ -46501,10 +46177,10 @@ async function getResources(client) {
|
|
|
46501
46177
|
|
|
46502
46178
|
// src/util/integration-resource/create-claim-url.ts
|
|
46503
46179
|
var ClaimUrlError = class extends Error {
|
|
46504
|
-
constructor(message, code2,
|
|
46180
|
+
constructor(message, code2, status4) {
|
|
46505
46181
|
super(message);
|
|
46506
46182
|
this.code = code2;
|
|
46507
|
-
this.status =
|
|
46183
|
+
this.status = status4;
|
|
46508
46184
|
}
|
|
46509
46185
|
};
|
|
46510
46186
|
async function createClaimUrl(client, resource) {
|
|
@@ -46541,50 +46217,50 @@ function mapClaimUrlError(error, resource) {
|
|
|
46541
46217
|
"unknown"
|
|
46542
46218
|
);
|
|
46543
46219
|
}
|
|
46544
|
-
const
|
|
46220
|
+
const status4 = error.status;
|
|
46545
46221
|
const serverMessage = (error.serverMessage || error.message || "").toString();
|
|
46546
46222
|
const messageLower = serverMessage.toLowerCase();
|
|
46547
|
-
if (
|
|
46223
|
+
if (status4 === 403) {
|
|
46548
46224
|
return new ClaimUrlError(
|
|
46549
46225
|
"You don't have permission to claim resources in this team.",
|
|
46550
46226
|
"forbidden",
|
|
46551
|
-
|
|
46227
|
+
status4
|
|
46552
46228
|
);
|
|
46553
46229
|
}
|
|
46554
|
-
if (
|
|
46230
|
+
if (status4 === 404) {
|
|
46555
46231
|
if (messageLower.includes("installation")) {
|
|
46556
46232
|
return new ClaimUrlError(
|
|
46557
46233
|
"Integration installation not found. Run `vercel integration list`.",
|
|
46558
46234
|
"installation_not_found",
|
|
46559
|
-
|
|
46235
|
+
status4
|
|
46560
46236
|
);
|
|
46561
46237
|
}
|
|
46562
46238
|
return new ClaimUrlError(
|
|
46563
46239
|
`No resource named '${resource.name}' found.`,
|
|
46564
46240
|
"resource_not_found",
|
|
46565
|
-
|
|
46241
|
+
status4
|
|
46566
46242
|
);
|
|
46567
46243
|
}
|
|
46568
|
-
if (
|
|
46244
|
+
if (status4 === 400) {
|
|
46569
46245
|
if (messageLower.includes("sandbox") || messageLower.includes("ownership")) {
|
|
46570
46246
|
return new ClaimUrlError(
|
|
46571
46247
|
`'${resource.name}' can no longer be claimed (likely already claimed). Run \`${packageName} integration list\` to refresh.`,
|
|
46572
46248
|
"not_sandbox",
|
|
46573
|
-
|
|
46249
|
+
status4
|
|
46574
46250
|
);
|
|
46575
46251
|
}
|
|
46576
46252
|
if (messageLower.includes("marketplace") || messageLower.includes("integration")) {
|
|
46577
46253
|
return new ClaimUrlError(
|
|
46578
46254
|
"This integration doesn't support claiming.",
|
|
46579
46255
|
"not_marketplace",
|
|
46580
|
-
|
|
46256
|
+
status4
|
|
46581
46257
|
);
|
|
46582
46258
|
}
|
|
46583
46259
|
}
|
|
46584
46260
|
return new ClaimUrlError(
|
|
46585
46261
|
`Provider could not generate a claim URL: ${serverMessage || "unknown error"}`,
|
|
46586
46262
|
"partner_error",
|
|
46587
|
-
|
|
46263
|
+
status4
|
|
46588
46264
|
);
|
|
46589
46265
|
}
|
|
46590
46266
|
|
|
@@ -48011,11 +47687,11 @@ Re-run with --installation-id to select one, e.g.:
|
|
|
48011
47687
|
}
|
|
48012
47688
|
}
|
|
48013
47689
|
}
|
|
48014
|
-
const
|
|
48015
|
-
if (
|
|
47690
|
+
const installed2 = skills2.length - failedSkills.length;
|
|
47691
|
+
if (installed2 > 0 && !options.asJson) {
|
|
48016
47692
|
const marketplaceUrl = integration.products.length > 1 ? `https://vercel.com/marketplace/${integration.slug}/${product.slug}` : `https://vercel.com/marketplace/${integration.slug}`;
|
|
48017
47693
|
output_manager_default.log(
|
|
48018
|
-
`Installed ${
|
|
47694
|
+
`Installed ${installed2} agent skill${installed2 === 1 ? "" : "s"} for ${import_chalk171.default.bold(product.name)}`
|
|
48019
47695
|
);
|
|
48020
47696
|
output_manager_default.log(
|
|
48021
47697
|
indent_default(
|
|
@@ -49793,11 +49469,11 @@ var import_title5 = __toESM(require_lib2(), 1);
|
|
|
49793
49469
|
// src/util/integration-resource/format.ts
|
|
49794
49470
|
var import_chalk179 = __toESM(require_source(), 1);
|
|
49795
49471
|
var import_title4 = __toESM(require_lib2(), 1);
|
|
49796
|
-
function resourceStatus(
|
|
49472
|
+
function resourceStatus(status4, isSandbox = false) {
|
|
49797
49473
|
const CIRCLE = "\u25CF ";
|
|
49798
|
-
const statusTitleCase = (0, import_title4.default)(
|
|
49474
|
+
const statusTitleCase = (0, import_title4.default)(status4);
|
|
49799
49475
|
const sandboxTag = isSandbox ? ` ${import_chalk179.default.yellow("[SANDBOX]")}` : "";
|
|
49800
|
-
switch (
|
|
49476
|
+
switch (status4) {
|
|
49801
49477
|
case "initializing":
|
|
49802
49478
|
return import_chalk179.default.yellow(CIRCLE) + statusTitleCase + sandboxTag;
|
|
49803
49479
|
case "error":
|
|
@@ -51044,11 +50720,11 @@ function selectConfiguration(configurations, integrationSlug, installationId) {
|
|
|
51044
50720
|
return { ok: true, configuration: found };
|
|
51045
50721
|
}
|
|
51046
50722
|
if (configurations.length > 1) {
|
|
51047
|
-
const
|
|
50723
|
+
const list22 = configurations.map((c) => c.id).join(", ");
|
|
51048
50724
|
return {
|
|
51049
50725
|
ok: false,
|
|
51050
50726
|
reason: AGENT_REASON.INVALID_ARGUMENTS,
|
|
51051
|
-
message: `Multiple installations found for "${integrationSlug}": ${
|
|
50727
|
+
message: `Multiple installations found for "${integrationSlug}": ${list22}. Re-run with --installation-id <id> to select one. Run \`${packageName} integration installations\` to list installation IDs for this team.`
|
|
51052
50728
|
};
|
|
51053
50729
|
}
|
|
51054
50730
|
return { ok: true, configuration: configurations[0] };
|
|
@@ -54165,7 +53841,7 @@ async function metrics(client) {
|
|
|
54165
53841
|
return 0;
|
|
54166
53842
|
}
|
|
54167
53843
|
telemetry2.trackCliSubcommandSchema(subcommandOriginal);
|
|
54168
|
-
const schemaFn = (await import("./chunks/schema-
|
|
53844
|
+
const schemaFn = (await import("./chunks/schema-E4EWRSGN.js")).default;
|
|
54169
53845
|
return schemaFn(client, telemetry2);
|
|
54170
53846
|
}
|
|
54171
53847
|
default: {
|
|
@@ -54178,7 +53854,7 @@ async function metrics(client) {
|
|
|
54178
53854
|
output_manager_default.print(help(metricsCommand, { columns: client.stderr.columns }));
|
|
54179
53855
|
return 2;
|
|
54180
53856
|
}
|
|
54181
|
-
const queryFn = (await import("./chunks/query-
|
|
53857
|
+
const queryFn = (await import("./chunks/query-DLYCIOU6.js")).default;
|
|
54182
53858
|
return queryFn(client, telemetry2);
|
|
54183
53859
|
}
|
|
54184
53860
|
}
|
|
@@ -56527,14 +56203,14 @@ async function checks(client, argv) {
|
|
|
56527
56203
|
printError(err);
|
|
56528
56204
|
return 1;
|
|
56529
56205
|
}
|
|
56530
|
-
const
|
|
56206
|
+
const list22 = result.checks ?? [];
|
|
56531
56207
|
if (asJson) {
|
|
56532
56208
|
if (client.nonInteractive) {
|
|
56533
56209
|
const payload = {
|
|
56534
56210
|
status: AGENT_STATUS.OK,
|
|
56535
|
-
checks:
|
|
56211
|
+
checks: list22,
|
|
56536
56212
|
pagination: result.pagination,
|
|
56537
|
-
message:
|
|
56213
|
+
message: list22.length === 0 ? "No checks configured for this project." : `${list22.length} deployment check(s) configured.`,
|
|
56538
56214
|
next: [
|
|
56539
56215
|
{
|
|
56540
56216
|
command: buildCommandWithGlobalFlags(
|
|
@@ -56560,13 +56236,13 @@ async function checks(client, argv) {
|
|
|
56560
56236
|
}
|
|
56561
56237
|
return 0;
|
|
56562
56238
|
}
|
|
56563
|
-
if (
|
|
56239
|
+
if (list22.length === 0) {
|
|
56564
56240
|
output_manager_default.log("No checks configured for this project.");
|
|
56565
56241
|
return 0;
|
|
56566
56242
|
}
|
|
56567
56243
|
const rows = [
|
|
56568
56244
|
["ID", "Name", "Blocking", "Target"].map((h) => (0, import_chalk200.gray)(h)),
|
|
56569
|
-
...
|
|
56245
|
+
...list22.map((c) => [
|
|
56570
56246
|
String(c.id ?? c.checkId ?? ""),
|
|
56571
56247
|
String(c.name ?? ""),
|
|
56572
56248
|
String(c.blocks ?? ""),
|
|
@@ -58711,17 +58387,17 @@ var import_ms25 = __toESM(require_ms(), 1);
|
|
|
58711
58387
|
|
|
58712
58388
|
// src/util/alias/render-alias-status.ts
|
|
58713
58389
|
var import_chalk210 = __toESM(require_source(), 1);
|
|
58714
|
-
function renderAliasStatus(
|
|
58715
|
-
if (
|
|
58716
|
-
return import_chalk210.default.green(
|
|
58390
|
+
function renderAliasStatus(status4) {
|
|
58391
|
+
if (status4 === "completed") {
|
|
58392
|
+
return import_chalk210.default.green(status4);
|
|
58717
58393
|
}
|
|
58718
|
-
if (
|
|
58719
|
-
return import_chalk210.default.red(
|
|
58394
|
+
if (status4 === "failed") {
|
|
58395
|
+
return import_chalk210.default.red(status4);
|
|
58720
58396
|
}
|
|
58721
|
-
if (
|
|
58722
|
-
return import_chalk210.default.gray(
|
|
58397
|
+
if (status4 === "skipped") {
|
|
58398
|
+
return import_chalk210.default.gray(status4);
|
|
58723
58399
|
}
|
|
58724
|
-
return import_chalk210.default.yellow(
|
|
58400
|
+
return import_chalk210.default.yellow(status4);
|
|
58725
58401
|
}
|
|
58726
58402
|
|
|
58727
58403
|
// src/commands/rolling-release/request-rolling-release.ts
|
|
@@ -58862,9 +58538,9 @@ async function renderJobFailed({
|
|
|
58862
58538
|
url += `&until=${nextTimestamp}`;
|
|
58863
58539
|
}
|
|
58864
58540
|
const { aliases, pagination } = await client.fetch(url);
|
|
58865
|
-
for (const { alias: alias2, status:
|
|
58541
|
+
for (const { alias: alias2, status: status4 } of aliases) {
|
|
58866
58542
|
output_manager_default.log(
|
|
58867
|
-
` ${renderAliasStatus(
|
|
58543
|
+
` ${renderAliasStatus(status4).padEnd(11)} ${alias2.alias} (${alias2.deploymentId})`
|
|
58868
58544
|
);
|
|
58869
58545
|
}
|
|
58870
58546
|
if (pagination?.next) {
|
|
@@ -59525,10 +59201,10 @@ async function list17(client, argv) {
|
|
|
59525
59201
|
}
|
|
59526
59202
|
output_manager_default.spinner("Fetching version");
|
|
59527
59203
|
const { versions: versions2 } = await getRedirectVersions(client, project.id, teamId);
|
|
59528
|
-
const
|
|
59204
|
+
const version2 = versions2.find(
|
|
59529
59205
|
(v) => v.id === versionIdFlag || v.name === versionIdFlag
|
|
59530
59206
|
);
|
|
59531
|
-
if (!
|
|
59207
|
+
if (!version2) {
|
|
59532
59208
|
output_manager_default.error(
|
|
59533
59209
|
`Version "${versionIdFlag}" not found. Run ${import_chalk215.default.cyan(
|
|
59534
59210
|
withGlobalFlags4(client, "redirects list-versions")
|
|
@@ -59536,8 +59212,8 @@ async function list17(client, argv) {
|
|
|
59536
59212
|
);
|
|
59537
59213
|
return 1;
|
|
59538
59214
|
}
|
|
59539
|
-
versionId =
|
|
59540
|
-
versionName =
|
|
59215
|
+
versionId = version2.id;
|
|
59216
|
+
versionName = version2.name || version2.id;
|
|
59541
59217
|
}
|
|
59542
59218
|
const lsStamp = stamp_default();
|
|
59543
59219
|
let spinnerMessage = `Fetching redirects for ${import_chalk215.default.bold(project.name)}`;
|
|
@@ -59629,13 +59305,13 @@ async function list17(client, argv) {
|
|
|
59629
59305
|
}
|
|
59630
59306
|
function formatRedirectsTable(redirects, actionSymbol) {
|
|
59631
59307
|
const rows = redirects.map((redirect) => {
|
|
59632
|
-
const
|
|
59308
|
+
const status4 = redirect.statusCode || (redirect.permanent ? 308 : 307);
|
|
59633
59309
|
const prefix = actionSymbol || "";
|
|
59634
59310
|
const colorFn = actionSymbol === "+" ? import_chalk215.default.green : actionSymbol === "-" ? import_chalk215.default.red : (s) => s;
|
|
59635
59311
|
return [
|
|
59636
59312
|
colorFn(`${prefix} ${redirect.source}`),
|
|
59637
59313
|
colorFn(`${redirect.destination}`),
|
|
59638
|
-
colorFn(
|
|
59314
|
+
colorFn(status4.toString())
|
|
59639
59315
|
];
|
|
59640
59316
|
});
|
|
59641
59317
|
return formatTable(
|
|
@@ -59692,24 +59368,24 @@ function sortVersions(versions2) {
|
|
|
59692
59368
|
}
|
|
59693
59369
|
function formatVersionsTable(versions2) {
|
|
59694
59370
|
const now = Date.now();
|
|
59695
|
-
const rows = versions2.map((
|
|
59696
|
-
const age = (0, import_ms28.default)(now -
|
|
59697
|
-
let
|
|
59698
|
-
if (
|
|
59699
|
-
|
|
59700
|
-
} else if (
|
|
59701
|
-
|
|
59371
|
+
const rows = versions2.map((version2) => {
|
|
59372
|
+
const age = (0, import_ms28.default)(now - version2.lastModified);
|
|
59373
|
+
let status4 = "";
|
|
59374
|
+
if (version2.isStaging) {
|
|
59375
|
+
status4 = import_chalk216.default.yellow("Staging");
|
|
59376
|
+
} else if (version2.isLive) {
|
|
59377
|
+
status4 = import_chalk216.default.green("Live");
|
|
59702
59378
|
} else {
|
|
59703
|
-
|
|
59379
|
+
status4 = import_chalk216.default.gray("Previous");
|
|
59704
59380
|
}
|
|
59705
|
-
const name =
|
|
59706
|
-
const redirectCountStr =
|
|
59381
|
+
const name = version2.name || import_chalk216.default.gray("(unnamed)");
|
|
59382
|
+
const redirectCountStr = version2.redirectCount !== void 0 && version2.redirectCount !== null ? version2.redirectCount.toString() : import_chalk216.default.gray("-");
|
|
59707
59383
|
return [
|
|
59708
|
-
|
|
59384
|
+
status4,
|
|
59709
59385
|
name,
|
|
59710
|
-
|
|
59386
|
+
version2.id,
|
|
59711
59387
|
redirectCountStr,
|
|
59712
|
-
|
|
59388
|
+
version2.createdBy || import_chalk216.default.gray("(unknown)"),
|
|
59713
59389
|
import_chalk216.default.gray(age + " ago")
|
|
59714
59390
|
];
|
|
59715
59391
|
});
|
|
@@ -59953,7 +59629,7 @@ async function add10(client, argv) {
|
|
|
59953
59629
|
}
|
|
59954
59630
|
const addStamp = stamp_default();
|
|
59955
59631
|
output_manager_default.spinner("Adding redirect");
|
|
59956
|
-
const { alias: alias2, version } = await putRedirects(
|
|
59632
|
+
const { alias: alias2, version: version2 } = await putRedirects(
|
|
59957
59633
|
client,
|
|
59958
59634
|
project.id,
|
|
59959
59635
|
[
|
|
@@ -59980,7 +59656,7 @@ async function add10(client, argv) {
|
|
|
59980
59656
|
);
|
|
59981
59657
|
const promoteFlagParts = getRedirectPromoteSuggestionFlags(afterAdd);
|
|
59982
59658
|
const promoteCmd = getCommandNamePlain(
|
|
59983
|
-
`redirects promote ${
|
|
59659
|
+
`redirects promote ${version2.id} ${promoteFlagParts.join(" ")}`.trim()
|
|
59984
59660
|
);
|
|
59985
59661
|
const jsonOutput = {
|
|
59986
59662
|
status: AGENT_STATUS.OK,
|
|
@@ -59991,7 +59667,7 @@ async function add10(client, argv) {
|
|
|
59991
59667
|
caseSensitive,
|
|
59992
59668
|
preserveQueryParams
|
|
59993
59669
|
},
|
|
59994
|
-
version: { id:
|
|
59670
|
+
version: { id: version2.id, name: version2.name || version2.id },
|
|
59995
59671
|
...alias2 && { alias: alias2, testUrl },
|
|
59996
59672
|
/** Redirect exists only in staging until promote; production list stays unchanged. */
|
|
59997
59673
|
stagingOnly: true,
|
|
@@ -60034,7 +59710,7 @@ async function add10(client, argv) {
|
|
|
60034
59710
|
`
|
|
60035
59711
|
);
|
|
60036
59712
|
}
|
|
60037
|
-
const newVersionName =
|
|
59713
|
+
const newVersionName = version2.name || version2.id;
|
|
60038
59714
|
output_manager_default.print(` ${import_chalk217.default.bold("New staging version:")} ${newVersionName}
|
|
60039
59715
|
|
|
60040
59716
|
`);
|
|
@@ -60049,7 +59725,7 @@ async function add10(client, argv) {
|
|
|
60049
59725
|
await updateRedirectVersion(
|
|
60050
59726
|
client,
|
|
60051
59727
|
project.id,
|
|
60052
|
-
|
|
59728
|
+
version2.id,
|
|
60053
59729
|
"promote",
|
|
60054
59730
|
teamId
|
|
60055
59731
|
);
|
|
@@ -60437,7 +60113,7 @@ async function upload(client, argv) {
|
|
|
60437
60113
|
`);
|
|
60438
60114
|
const displayRedirects = redirects.slice(0, 100);
|
|
60439
60115
|
const rows = displayRedirects.map((redirect) => {
|
|
60440
|
-
const
|
|
60116
|
+
const status4 = redirect.statusCode || (redirect.permanent ? 308 : 307);
|
|
60441
60117
|
const action = redirect.action || "+";
|
|
60442
60118
|
let colorFn;
|
|
60443
60119
|
let actionSymbol;
|
|
@@ -60461,7 +60137,7 @@ async function upload(client, argv) {
|
|
|
60461
60137
|
return [
|
|
60462
60138
|
colorFn(`${actionSymbol} ${redirect.source}`),
|
|
60463
60139
|
colorFn(redirect.destination),
|
|
60464
|
-
colorFn(
|
|
60140
|
+
colorFn(status4.toString())
|
|
60465
60141
|
];
|
|
60466
60142
|
});
|
|
60467
60143
|
output_manager_default.print(
|
|
@@ -60647,8 +60323,8 @@ async function remove10(client, argv) {
|
|
|
60647
60323
|
` ${import_chalk219.default.cyan(redirectToRemove.source)} \u2192 ${import_chalk219.default.cyan(redirectToRemove.destination)}
|
|
60648
60324
|
`
|
|
60649
60325
|
);
|
|
60650
|
-
const
|
|
60651
|
-
output_manager_default.print(` Status: ${
|
|
60326
|
+
const status4 = redirectToRemove.statusCode || (redirectToRemove.permanent ? 308 : 307);
|
|
60327
|
+
output_manager_default.print(` Status: ${status4}
|
|
60652
60328
|
|
|
60653
60329
|
`);
|
|
60654
60330
|
const confirmed = await confirmAction2(
|
|
@@ -60663,7 +60339,7 @@ async function remove10(client, argv) {
|
|
|
60663
60339
|
}
|
|
60664
60340
|
const removeStamp = stamp_default();
|
|
60665
60341
|
output_manager_default.spinner(`Removing redirect for ${import_chalk219.default.bold(source)}`);
|
|
60666
|
-
const { alias: alias2, version } = await deleteRedirects(
|
|
60342
|
+
const { alias: alias2, version: version2 } = await deleteRedirects(
|
|
60667
60343
|
client,
|
|
60668
60344
|
project.id,
|
|
60669
60345
|
[source],
|
|
@@ -60678,12 +60354,12 @@ async function remove10(client, argv) {
|
|
|
60678
60354
|
);
|
|
60679
60355
|
const promoteFlagParts = getRedirectPromoteSuggestionFlags(afterRemove);
|
|
60680
60356
|
const promoteCmd = getCommandNamePlain(
|
|
60681
|
-
`redirects promote ${
|
|
60357
|
+
`redirects promote ${version2.id} ${promoteFlagParts.join(" ")}`.trim()
|
|
60682
60358
|
);
|
|
60683
60359
|
const jsonOutput = {
|
|
60684
60360
|
status: AGENT_STATUS.OK,
|
|
60685
60361
|
removed: { source },
|
|
60686
|
-
version: { id:
|
|
60362
|
+
version: { id: version2.id, name: version2.name || version2.id },
|
|
60687
60363
|
...alias2 && { alias: alias2, testUrl },
|
|
60688
60364
|
...!existingStagingVersion && {
|
|
60689
60365
|
next: [
|
|
@@ -60716,7 +60392,7 @@ async function remove10(client, argv) {
|
|
|
60716
60392
|
`
|
|
60717
60393
|
);
|
|
60718
60394
|
}
|
|
60719
|
-
const versionName =
|
|
60395
|
+
const versionName = version2.name || version2.id;
|
|
60720
60396
|
output_manager_default.print(` ${import_chalk219.default.bold("New staging version:")} ${versionName}
|
|
60721
60397
|
|
|
60722
60398
|
`);
|
|
@@ -60731,7 +60407,7 @@ async function remove10(client, argv) {
|
|
|
60731
60407
|
await updateRedirectVersion(
|
|
60732
60408
|
client,
|
|
60733
60409
|
project.id,
|
|
60734
|
-
|
|
60410
|
+
version2.id,
|
|
60735
60411
|
"promote",
|
|
60736
60412
|
teamId
|
|
60737
60413
|
);
|
|
@@ -60801,10 +60477,10 @@ async function promote(client, argv) {
|
|
|
60801
60477
|
const [versionIdentifier] = parsed.args;
|
|
60802
60478
|
output_manager_default.spinner(`Fetching redirect versions for ${import_chalk220.default.bold(project.name)}`);
|
|
60803
60479
|
const { versions: versions2 } = await getRedirectVersions(client, project.id, teamId);
|
|
60804
|
-
const
|
|
60480
|
+
const version2 = versions2.find(
|
|
60805
60481
|
(v) => v.id === versionIdentifier || v.name === versionIdentifier
|
|
60806
60482
|
);
|
|
60807
|
-
if (!
|
|
60483
|
+
if (!version2) {
|
|
60808
60484
|
if (client.nonInteractive) {
|
|
60809
60485
|
const afterPromote = getArgsAfterRedirectsSubcommand(
|
|
60810
60486
|
client.argv.slice(2),
|
|
@@ -60837,25 +60513,25 @@ async function promote(client, argv) {
|
|
|
60837
60513
|
);
|
|
60838
60514
|
return 1;
|
|
60839
60515
|
}
|
|
60840
|
-
if (
|
|
60516
|
+
if (version2.isLive) {
|
|
60841
60517
|
if (client.nonInteractive) {
|
|
60842
60518
|
outputAgentError(
|
|
60843
60519
|
client,
|
|
60844
60520
|
{
|
|
60845
60521
|
status: AGENT_STATUS.ERROR,
|
|
60846
60522
|
reason: AGENT_REASON.INVALID_ARGUMENTS,
|
|
60847
|
-
message: `Version ${
|
|
60523
|
+
message: `Version ${version2.name || version2.id} is already live. Nothing to promote.`
|
|
60848
60524
|
},
|
|
60849
60525
|
1
|
|
60850
60526
|
);
|
|
60851
60527
|
return 1;
|
|
60852
60528
|
}
|
|
60853
60529
|
output_manager_default.error(
|
|
60854
|
-
`Version ${import_chalk220.default.bold(
|
|
60530
|
+
`Version ${import_chalk220.default.bold(version2.name || version2.id)} is already live.`
|
|
60855
60531
|
);
|
|
60856
60532
|
return 1;
|
|
60857
60533
|
}
|
|
60858
|
-
if (!
|
|
60534
|
+
if (!version2.isStaging) {
|
|
60859
60535
|
if (client.nonInteractive) {
|
|
60860
60536
|
const afterPromote = getArgsAfterRedirectsSubcommand(
|
|
60861
60537
|
client.argv.slice(2),
|
|
@@ -60869,7 +60545,7 @@ async function promote(client, argv) {
|
|
|
60869
60545
|
{
|
|
60870
60546
|
status: AGENT_STATUS.ERROR,
|
|
60871
60547
|
reason: AGENT_REASON.INVALID_ARGUMENTS,
|
|
60872
|
-
message: `Version ${
|
|
60548
|
+
message: `Version ${version2.name || version2.id} is not staged. Only staging versions can be promoted to production.`,
|
|
60873
60549
|
next: [
|
|
60874
60550
|
{
|
|
60875
60551
|
command: listVersionsCmd,
|
|
@@ -60883,7 +60559,7 @@ async function promote(client, argv) {
|
|
|
60883
60559
|
}
|
|
60884
60560
|
output_manager_default.error(
|
|
60885
60561
|
`Version ${import_chalk220.default.bold(
|
|
60886
|
-
|
|
60562
|
+
version2.name || version2.id
|
|
60887
60563
|
)} is not staged. Only staging versions can be promoted to production.
|
|
60888
60564
|
Run ${import_chalk220.default.cyan(
|
|
60889
60565
|
"vercel redirects list-versions"
|
|
@@ -60891,11 +60567,11 @@ Run ${import_chalk220.default.cyan(
|
|
|
60891
60567
|
);
|
|
60892
60568
|
return 1;
|
|
60893
60569
|
}
|
|
60894
|
-
const versionName =
|
|
60570
|
+
const versionName = version2.name || version2.id;
|
|
60895
60571
|
output_manager_default.spinner("Fetching changes");
|
|
60896
60572
|
const { redirects: diffRedirects } = await getRedirects(client, project.id, {
|
|
60897
60573
|
teamId,
|
|
60898
|
-
versionId:
|
|
60574
|
+
versionId: version2.id,
|
|
60899
60575
|
diff: true
|
|
60900
60576
|
});
|
|
60901
60577
|
const changedRedirects = diffRedirects.filter(
|
|
@@ -60908,10 +60584,10 @@ ${import_chalk220.default.bold("Changes to be promoted:")}
|
|
|
60908
60584
|
`);
|
|
60909
60585
|
const displayRedirects = changedRedirects.slice(0, 20);
|
|
60910
60586
|
for (const redirect of displayRedirects) {
|
|
60911
|
-
const
|
|
60587
|
+
const status4 = redirect.statusCode || (redirect.permanent ? 308 : 307);
|
|
60912
60588
|
const symbol = redirect.action === "+" ? import_chalk220.default.green("+") : import_chalk220.default.red("-");
|
|
60913
60589
|
output_manager_default.print(
|
|
60914
|
-
` ${symbol} ${redirect.source} \u2192 ${redirect.destination} (${
|
|
60590
|
+
` ${symbol} ${redirect.source} \u2192 ${redirect.destination} (${status4})
|
|
60915
60591
|
`
|
|
60916
60592
|
);
|
|
60917
60593
|
}
|
|
@@ -60961,7 +60637,7 @@ ${import_chalk220.default.gray("No changes detected from current production vers
|
|
|
60961
60637
|
const { version: newVersion } = await updateRedirectVersion(
|
|
60962
60638
|
client,
|
|
60963
60639
|
project.id,
|
|
60964
|
-
|
|
60640
|
+
version2.id,
|
|
60965
60641
|
"promote",
|
|
60966
60642
|
teamId
|
|
60967
60643
|
);
|
|
@@ -61030,10 +60706,10 @@ async function restore(client, argv) {
|
|
|
61030
60706
|
const [versionIdentifier] = parsed.args;
|
|
61031
60707
|
output_manager_default.spinner(`Fetching redirect versions for ${import_chalk221.default.bold(project.name)}`);
|
|
61032
60708
|
const { versions: versions2 } = await getRedirectVersions(client, project.id, teamId);
|
|
61033
|
-
const
|
|
60709
|
+
const version2 = versions2.find(
|
|
61034
60710
|
(v) => v.id === versionIdentifier || v.name === versionIdentifier
|
|
61035
60711
|
);
|
|
61036
|
-
if (!
|
|
60712
|
+
if (!version2) {
|
|
61037
60713
|
if (client.nonInteractive) {
|
|
61038
60714
|
const afterRestore = getArgsAfterRedirectsSubcommand(
|
|
61039
60715
|
client.argv.slice(2),
|
|
@@ -61061,7 +60737,7 @@ async function restore(client, argv) {
|
|
|
61061
60737
|
);
|
|
61062
60738
|
return 1;
|
|
61063
60739
|
}
|
|
61064
|
-
if (
|
|
60740
|
+
if (version2.isLive) {
|
|
61065
60741
|
if (client.nonInteractive) {
|
|
61066
60742
|
const afterRestore = getArgsAfterRedirectsSubcommand(
|
|
61067
60743
|
client.argv.slice(2),
|
|
@@ -61076,7 +60752,7 @@ async function restore(client, argv) {
|
|
|
61076
60752
|
{
|
|
61077
60753
|
status: AGENT_STATUS.ERROR,
|
|
61078
60754
|
reason: AGENT_REASON.VERSION_ALREADY_LIVE,
|
|
61079
|
-
message: `Version ${
|
|
60755
|
+
message: `Version ${version2.name || version2.id} is currently live. You cannot restore the live version. Run ${listCmd2} to see previous versions you can restore.`,
|
|
61080
60756
|
next: [{ command: listCmd2 }]
|
|
61081
60757
|
},
|
|
61082
60758
|
1
|
|
@@ -61084,7 +60760,7 @@ async function restore(client, argv) {
|
|
|
61084
60760
|
}
|
|
61085
60761
|
output_manager_default.error(
|
|
61086
60762
|
`Version ${import_chalk221.default.bold(
|
|
61087
|
-
|
|
60763
|
+
version2.name || version2.id
|
|
61088
60764
|
)} is currently live. You cannot restore the live version.
|
|
61089
60765
|
Run ${import_chalk221.default.cyan(
|
|
61090
60766
|
"vercel redirects list-versions"
|
|
@@ -61092,30 +60768,30 @@ Run ${import_chalk221.default.cyan(
|
|
|
61092
60768
|
);
|
|
61093
60769
|
return 1;
|
|
61094
60770
|
}
|
|
61095
|
-
if (
|
|
60771
|
+
if (version2.isStaging) {
|
|
61096
60772
|
if (client.nonInteractive) {
|
|
61097
60773
|
outputAgentError(
|
|
61098
60774
|
client,
|
|
61099
60775
|
{
|
|
61100
60776
|
status: AGENT_STATUS.ERROR,
|
|
61101
60777
|
reason: AGENT_REASON.VERSION_IS_STAGING,
|
|
61102
|
-
message: `Version ${
|
|
60778
|
+
message: `Version ${version2.name || version2.id} is staged. You can only restore previous (non-staging, non-live) versions.`
|
|
61103
60779
|
},
|
|
61104
60780
|
1
|
|
61105
60781
|
);
|
|
61106
60782
|
}
|
|
61107
60783
|
output_manager_default.error(
|
|
61108
60784
|
`Version ${import_chalk221.default.bold(
|
|
61109
|
-
|
|
60785
|
+
version2.name || version2.id
|
|
61110
60786
|
)} is staged. You can only restore previous versions.`
|
|
61111
60787
|
);
|
|
61112
60788
|
return 1;
|
|
61113
60789
|
}
|
|
61114
|
-
const versionName =
|
|
60790
|
+
const versionName = version2.name || version2.id;
|
|
61115
60791
|
output_manager_default.spinner("Fetching changes");
|
|
61116
60792
|
const { redirects: diffRedirects } = await getRedirects(client, project.id, {
|
|
61117
60793
|
teamId,
|
|
61118
|
-
versionId:
|
|
60794
|
+
versionId: version2.id,
|
|
61119
60795
|
diff: true
|
|
61120
60796
|
});
|
|
61121
60797
|
const changedRedirects = diffRedirects.filter(
|
|
@@ -61128,10 +60804,10 @@ ${import_chalk221.default.bold("Changes to be restored:")}
|
|
|
61128
60804
|
`);
|
|
61129
60805
|
const displayRedirects = changedRedirects.slice(0, 20);
|
|
61130
60806
|
for (const redirect of displayRedirects) {
|
|
61131
|
-
const
|
|
60807
|
+
const status4 = redirect.statusCode || (redirect.permanent ? 308 : 307);
|
|
61132
60808
|
const symbol = redirect.action === "+" ? import_chalk221.default.green("+") : import_chalk221.default.red("-");
|
|
61133
60809
|
output_manager_default.print(
|
|
61134
|
-
` ${symbol} ${redirect.source} \u2192 ${redirect.destination} (${
|
|
60810
|
+
` ${symbol} ${redirect.source} \u2192 ${redirect.destination} (${status4})
|
|
61135
60811
|
`
|
|
61136
60812
|
);
|
|
61137
60813
|
}
|
|
@@ -61181,7 +60857,7 @@ ${import_chalk221.default.gray("No changes detected from current production vers
|
|
|
61181
60857
|
const { version: newVersion } = await updateRedirectVersion(
|
|
61182
60858
|
client,
|
|
61183
60859
|
project.id,
|
|
61184
|
-
|
|
60860
|
+
version2.id,
|
|
61185
60861
|
"restore",
|
|
61186
60862
|
teamId
|
|
61187
60863
|
);
|
|
@@ -61803,9 +61479,9 @@ async function renderJobFailed2({
|
|
|
61803
61479
|
url += `&until=${nextTimestamp}`;
|
|
61804
61480
|
}
|
|
61805
61481
|
const { aliases, pagination } = await client.fetch(url);
|
|
61806
|
-
for (const { alias: alias2, status:
|
|
61482
|
+
for (const { alias: alias2, status: status4 } of aliases) {
|
|
61807
61483
|
output_manager_default.log(
|
|
61808
|
-
` ${renderAliasStatus(
|
|
61484
|
+
` ${renderAliasStatus(status4).padEnd(11)} ${alias2.alias} (${alias2.deploymentId})`
|
|
61809
61485
|
);
|
|
61810
61486
|
}
|
|
61811
61487
|
if (pagination?.next) {
|
|
@@ -63009,7 +62685,7 @@ async function list18(client, argv) {
|
|
|
63009
62685
|
spinnerMessage += ` filtered by ${filter}`;
|
|
63010
62686
|
}
|
|
63011
62687
|
output_manager_default.spinner(spinnerMessage);
|
|
63012
|
-
const { routes: routes2, version, limit } = await getRoutes(client, project.id, {
|
|
62688
|
+
const { routes: routes2, version: version2, limit } = await getRoutes(client, project.id, {
|
|
63013
62689
|
teamId,
|
|
63014
62690
|
search: search2,
|
|
63015
62691
|
filter,
|
|
@@ -63060,9 +62736,9 @@ async function list18(client, argv) {
|
|
|
63060
62736
|
}
|
|
63061
62737
|
output_manager_default.print("\n");
|
|
63062
62738
|
}
|
|
63063
|
-
if (
|
|
62739
|
+
if (version2?.alias) {
|
|
63064
62740
|
output_manager_default.log(
|
|
63065
|
-
`Test your changes: ${import_chalk225.default.cyan(`https://${
|
|
62741
|
+
`Test your changes: ${import_chalk225.default.cyan(`https://${version2.alias}`)}`
|
|
63066
62742
|
);
|
|
63067
62743
|
}
|
|
63068
62744
|
} else {
|
|
@@ -63105,7 +62781,7 @@ async function list18(client, argv) {
|
|
|
63105
62781
|
function formatRoutesTable(routes2, actionSymbol) {
|
|
63106
62782
|
const rows = routes2.map((rule, index) => {
|
|
63107
62783
|
const typeLabels = getRouteTypeLabel(rule);
|
|
63108
|
-
const
|
|
62784
|
+
const status4 = rule.enabled === false ? import_chalk225.default.red("Disabled") : import_chalk225.default.green("Enabled");
|
|
63109
62785
|
const prefix = actionSymbol || "";
|
|
63110
62786
|
const colorFn = actionSymbol === "+" ? import_chalk225.default.green : actionSymbol === "-" ? import_chalk225.default.red : actionSymbol === "~" ? import_chalk225.default.yellow : (s) => s;
|
|
63111
62787
|
const position = actionSymbol ? "" : `${index + 1}`;
|
|
@@ -63116,7 +62792,7 @@ function formatRoutesTable(routes2, actionSymbol) {
|
|
|
63116
62792
|
),
|
|
63117
62793
|
colorFn(truncate(rule.route.src, 40)),
|
|
63118
62794
|
colorFn(typeLabels),
|
|
63119
|
-
|
|
62795
|
+
status4
|
|
63120
62796
|
];
|
|
63121
62797
|
});
|
|
63122
62798
|
return formatTable(
|
|
@@ -63244,19 +62920,19 @@ async function listVersions3(client, argv) {
|
|
|
63244
62920
|
return 0;
|
|
63245
62921
|
}
|
|
63246
62922
|
function formatVersionsTable2(versions2) {
|
|
63247
|
-
const rows = versions2.map((
|
|
63248
|
-
let
|
|
63249
|
-
if (
|
|
63250
|
-
|
|
63251
|
-
} else if (
|
|
63252
|
-
|
|
62923
|
+
const rows = versions2.map((version2) => {
|
|
62924
|
+
let status4 = "";
|
|
62925
|
+
if (version2.isStaging) {
|
|
62926
|
+
status4 = import_chalk226.default.yellow("Staging");
|
|
62927
|
+
} else if (version2.isLive) {
|
|
62928
|
+
status4 = import_chalk226.default.green("Live");
|
|
63253
62929
|
} else {
|
|
63254
|
-
|
|
62930
|
+
status4 = import_chalk226.default.gray("Previous");
|
|
63255
62931
|
}
|
|
63256
|
-
const id =
|
|
63257
|
-
const routeCount =
|
|
63258
|
-
const age = getRelativeTime(
|
|
63259
|
-
return [
|
|
62932
|
+
const id = version2.id.slice(0, 12);
|
|
62933
|
+
const routeCount = version2.ruleCount !== void 0 ? version2.ruleCount.toString() : "-";
|
|
62934
|
+
const age = getRelativeTime(version2.lastModified);
|
|
62935
|
+
return [status4, id, routeCount, age];
|
|
63260
62936
|
});
|
|
63261
62937
|
return formatTable(
|
|
63262
62938
|
["Status", "ID", "Routes", "Age"],
|
|
@@ -64105,8 +63781,8 @@ async function add11(client, argv) {
|
|
|
64105
63781
|
}
|
|
64106
63782
|
const actionFlag = flags["--action"];
|
|
64107
63783
|
const dest = flags["--dest"] ? stripQuotes(flags["--dest"]) : void 0;
|
|
64108
|
-
const
|
|
64109
|
-
const actionError = validateActionFlags(actionFlag, dest,
|
|
63784
|
+
const status4 = flags["--status"];
|
|
63785
|
+
const actionError = validateActionFlags(actionFlag, dest, status4);
|
|
64110
63786
|
if (actionError) {
|
|
64111
63787
|
if (isAgentMode) {
|
|
64112
63788
|
outputAgentError(
|
|
@@ -64141,7 +63817,7 @@ async function add11(client, argv) {
|
|
|
64141
63817
|
);
|
|
64142
63818
|
return 1;
|
|
64143
63819
|
}
|
|
64144
|
-
const hasAnyAction = dest ||
|
|
63820
|
+
const hasAnyAction = dest || status4 || Object.keys(headers).length > 0 || transforms.length > 0;
|
|
64145
63821
|
if (!hasAnyAction && skipPrompts) {
|
|
64146
63822
|
if (isAgentMode) {
|
|
64147
63823
|
outputAgentError(
|
|
@@ -64327,7 +64003,7 @@ async function add11(client, argv) {
|
|
|
64327
64003
|
const addStamp = stamp_default();
|
|
64328
64004
|
output_manager_default.spinner(`Adding route "${name}"`);
|
|
64329
64005
|
try {
|
|
64330
|
-
const { route, version } = await addRoute(client, project.id, routeInput, {
|
|
64006
|
+
const { route, version: version2 } = await addRoute(client, project.id, routeInput, {
|
|
64331
64007
|
teamId,
|
|
64332
64008
|
position
|
|
64333
64009
|
});
|
|
@@ -64343,8 +64019,8 @@ async function add11(client, argv) {
|
|
|
64343
64019
|
...finalStatus && { status: finalStatus }
|
|
64344
64020
|
},
|
|
64345
64021
|
version: {
|
|
64346
|
-
id:
|
|
64347
|
-
...
|
|
64022
|
+
id: version2.id,
|
|
64023
|
+
...version2.alias && { alias: version2.alias }
|
|
64348
64024
|
},
|
|
64349
64025
|
...!existingStagingVersion && {
|
|
64350
64026
|
next: [
|
|
@@ -64404,7 +64080,7 @@ async function add11(client, argv) {
|
|
|
64404
64080
|
`
|
|
64405
64081
|
);
|
|
64406
64082
|
}
|
|
64407
|
-
if (
|
|
64083
|
+
if (version2.alias) {
|
|
64408
64084
|
let testPath = "/";
|
|
64409
64085
|
if (syntax === "equals") {
|
|
64410
64086
|
testPath = src;
|
|
@@ -64415,17 +64091,17 @@ async function add11(client, argv) {
|
|
|
64415
64091
|
}
|
|
64416
64092
|
output_manager_default.print(
|
|
64417
64093
|
`
|
|
64418
|
-
${import_chalk228.default.bold("Test your changes:")} ${import_chalk228.default.cyan(`https://${
|
|
64094
|
+
${import_chalk228.default.bold("Test your changes:")} ${import_chalk228.default.cyan(`https://${version2.alias}${testPath}`)}
|
|
64419
64095
|
`
|
|
64420
64096
|
);
|
|
64421
64097
|
}
|
|
64422
64098
|
output_manager_default.print(`
|
|
64423
|
-
${import_chalk228.default.bold("Staging version:")} ${
|
|
64099
|
+
${import_chalk228.default.bold("Staging version:")} ${version2.id}
|
|
64424
64100
|
`);
|
|
64425
64101
|
await offerAutoPromote(
|
|
64426
64102
|
client,
|
|
64427
64103
|
project.id,
|
|
64428
|
-
|
|
64104
|
+
version2,
|
|
64429
64105
|
!!existingStagingVersion,
|
|
64430
64106
|
{ teamId, skipPrompts }
|
|
64431
64107
|
);
|
|
@@ -64664,7 +64340,7 @@ async function handleAIAdd2(client, projectId, teamId, aiPrompt, skipPrompts, pa
|
|
|
64664
64340
|
const addStamp = stamp_default();
|
|
64665
64341
|
output_manager_default.spinner(`Adding route "${tempRule.name}"`);
|
|
64666
64342
|
try {
|
|
64667
|
-
const { route, version } = await addRoute(
|
|
64343
|
+
const { route, version: version2 } = await addRoute(
|
|
64668
64344
|
client,
|
|
64669
64345
|
projectId,
|
|
64670
64346
|
{
|
|
@@ -64684,12 +64360,12 @@ async function handleAIAdd2(client, projectId, teamId, aiPrompt, skipPrompts, pa
|
|
|
64684
64360
|
output_manager_default.print(` ${import_chalk228.default.gray("ID:")} ${route.id}
|
|
64685
64361
|
`);
|
|
64686
64362
|
output_manager_default.print(`
|
|
64687
|
-
${import_chalk228.default.bold("Staging version:")} ${
|
|
64363
|
+
${import_chalk228.default.bold("Staging version:")} ${version2.id}
|
|
64688
64364
|
`);
|
|
64689
64365
|
await offerAutoPromote(
|
|
64690
64366
|
client,
|
|
64691
64367
|
projectId,
|
|
64692
|
-
|
|
64368
|
+
version2,
|
|
64693
64369
|
!!existingStagingVersion,
|
|
64694
64370
|
{ teamId, skipPrompts }
|
|
64695
64371
|
);
|
|
@@ -64710,7 +64386,7 @@ async function createFromGenerated2(client, projectId, teamId, generated, existi
|
|
|
64710
64386
|
const addStamp = stamp_default();
|
|
64711
64387
|
output_manager_default.spinner(`Adding route "${routeInput.name}"`);
|
|
64712
64388
|
try {
|
|
64713
|
-
const { route, version } = await addRoute(client, projectId, routeInput, {
|
|
64389
|
+
const { route, version: version2 } = await addRoute(client, projectId, routeInput, {
|
|
64714
64390
|
teamId
|
|
64715
64391
|
});
|
|
64716
64392
|
if (client.nonInteractive) {
|
|
@@ -64723,8 +64399,8 @@ async function createFromGenerated2(client, projectId, teamId, generated, existi
|
|
|
64723
64399
|
src: routeInput.route.src
|
|
64724
64400
|
},
|
|
64725
64401
|
version: {
|
|
64726
|
-
id:
|
|
64727
|
-
...
|
|
64402
|
+
id: version2.id,
|
|
64403
|
+
...version2.alias && { alias: version2.alias }
|
|
64728
64404
|
},
|
|
64729
64405
|
...!existingStagingVersion && {
|
|
64730
64406
|
next: [
|
|
@@ -64751,12 +64427,12 @@ async function createFromGenerated2(client, projectId, teamId, generated, existi
|
|
|
64751
64427
|
output_manager_default.print(` ${import_chalk228.default.gray("ID:")} ${route.id}
|
|
64752
64428
|
`);
|
|
64753
64429
|
output_manager_default.print(`
|
|
64754
|
-
${import_chalk228.default.bold("Staging version:")} ${
|
|
64430
|
+
${import_chalk228.default.bold("Staging version:")} ${version2.id}
|
|
64755
64431
|
`);
|
|
64756
64432
|
await offerAutoPromote(
|
|
64757
64433
|
client,
|
|
64758
64434
|
projectId,
|
|
64759
|
-
|
|
64435
|
+
version2,
|
|
64760
64436
|
!!existingStagingVersion,
|
|
64761
64437
|
{ teamId, skipPrompts }
|
|
64762
64438
|
);
|
|
@@ -64880,7 +64556,7 @@ async function main26(client) {
|
|
|
64880
64556
|
return 2;
|
|
64881
64557
|
}
|
|
64882
64558
|
telemetry2.trackCliSubcommandEdit(subcommandOriginal);
|
|
64883
|
-
return (await import("./chunks/edit-
|
|
64559
|
+
return (await import("./chunks/edit-TWPSJUE4.js")).default(client, args);
|
|
64884
64560
|
case "delete":
|
|
64885
64561
|
if (needHelp) {
|
|
64886
64562
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -64888,7 +64564,7 @@ async function main26(client) {
|
|
|
64888
64564
|
return 2;
|
|
64889
64565
|
}
|
|
64890
64566
|
telemetry2.trackCliSubcommandDelete(subcommandOriginal);
|
|
64891
|
-
return (await import("./chunks/delete-
|
|
64567
|
+
return (await import("./chunks/delete-IYAGVXU6.js")).default(client, args);
|
|
64892
64568
|
case "enable":
|
|
64893
64569
|
if (needHelp) {
|
|
64894
64570
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -64896,7 +64572,7 @@ async function main26(client) {
|
|
|
64896
64572
|
return 2;
|
|
64897
64573
|
}
|
|
64898
64574
|
telemetry2.trackCliSubcommandEnable(subcommandOriginal);
|
|
64899
|
-
return (await import("./chunks/enable-
|
|
64575
|
+
return (await import("./chunks/enable-XJ7JMETR.js")).default(client, args);
|
|
64900
64576
|
case "disable":
|
|
64901
64577
|
if (needHelp) {
|
|
64902
64578
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -64904,7 +64580,7 @@ async function main26(client) {
|
|
|
64904
64580
|
return 2;
|
|
64905
64581
|
}
|
|
64906
64582
|
telemetry2.trackCliSubcommandDisable(subcommandOriginal);
|
|
64907
|
-
return (await import("./chunks/disable-
|
|
64583
|
+
return (await import("./chunks/disable-D4WNCZ4Z.js")).default(client, args);
|
|
64908
64584
|
case "reorder":
|
|
64909
64585
|
if (needHelp) {
|
|
64910
64586
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -64912,7 +64588,7 @@ async function main26(client) {
|
|
|
64912
64588
|
return 2;
|
|
64913
64589
|
}
|
|
64914
64590
|
telemetry2.trackCliSubcommandReorder(subcommandOriginal);
|
|
64915
|
-
return (await import("./chunks/reorder-
|
|
64591
|
+
return (await import("./chunks/reorder-J2TPPT62.js")).default(client, args);
|
|
64916
64592
|
case "export":
|
|
64917
64593
|
if (needHelp) {
|
|
64918
64594
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -64920,7 +64596,7 @@ async function main26(client) {
|
|
|
64920
64596
|
return 2;
|
|
64921
64597
|
}
|
|
64922
64598
|
telemetry2.trackCliSubcommandExport(subcommandOriginal);
|
|
64923
|
-
return (await import("./chunks/export-
|
|
64599
|
+
return (await import("./chunks/export-GJ6XQQFA.js")).default(client, args);
|
|
64924
64600
|
case "publish":
|
|
64925
64601
|
if (needHelp) {
|
|
64926
64602
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -64928,7 +64604,7 @@ async function main26(client) {
|
|
|
64928
64604
|
return 2;
|
|
64929
64605
|
}
|
|
64930
64606
|
telemetry2.trackCliSubcommandPublish(subcommandOriginal);
|
|
64931
|
-
return (await import("./chunks/publish-
|
|
64607
|
+
return (await import("./chunks/publish-IRGV2FST.js")).default(client, args);
|
|
64932
64608
|
case "restore":
|
|
64933
64609
|
if (needHelp) {
|
|
64934
64610
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -64936,7 +64612,7 @@ async function main26(client) {
|
|
|
64936
64612
|
return 2;
|
|
64937
64613
|
}
|
|
64938
64614
|
telemetry2.trackCliSubcommandRestore(subcommandOriginal);
|
|
64939
|
-
return (await import("./chunks/restore-
|
|
64615
|
+
return (await import("./chunks/restore-DFLBJZFM.js")).default(client, args);
|
|
64940
64616
|
case "discard-staging":
|
|
64941
64617
|
if (needHelp) {
|
|
64942
64618
|
telemetry2.trackCliFlagHelp("routes", subcommandOriginal);
|
|
@@ -64944,7 +64620,7 @@ async function main26(client) {
|
|
|
64944
64620
|
return 2;
|
|
64945
64621
|
}
|
|
64946
64622
|
telemetry2.trackCliSubcommandDiscardStaging(subcommandOriginal);
|
|
64947
|
-
return (await import("./chunks/discard-
|
|
64623
|
+
return (await import("./chunks/discard-YFBRDG2N.js")).default(client, args);
|
|
64948
64624
|
default:
|
|
64949
64625
|
output_manager_default.error(getInvalidSubcommand(COMMAND_CONFIG45));
|
|
64950
64626
|
output_manager_default.print(help(routesCommand, { columns: client.stderr.columns }));
|
|
@@ -67636,9 +67312,9 @@ async function main28(client) {
|
|
|
67636
67312
|
var import_chalk238 = __toESM(require_source(), 1);
|
|
67637
67313
|
async function status2(client) {
|
|
67638
67314
|
const enabled = client.config.telemetry?.enabled !== false;
|
|
67639
|
-
const
|
|
67315
|
+
const status4 = enabled ? import_chalk238.default.green("Enabled") : import_chalk238.default.red("Disabled");
|
|
67640
67316
|
output_manager_default.print("\n");
|
|
67641
|
-
output_manager_default.log(`${import_chalk238.default.bold("Telemetry status")}: ${
|
|
67317
|
+
output_manager_default.log(`${import_chalk238.default.bold("Telemetry status")}: ${status4}
|
|
67642
67318
|
`);
|
|
67643
67319
|
const learnMoreMessage = `
|
|
67644
67320
|
|
|
@@ -67692,10 +67368,10 @@ async function flush(_client, args) {
|
|
|
67692
67368
|
headers,
|
|
67693
67369
|
body: JSON.stringify(body)
|
|
67694
67370
|
});
|
|
67695
|
-
const
|
|
67371
|
+
const status4 = res.status;
|
|
67696
67372
|
const cliTracked = res.headers.get("x-vercel-cli-tracked") || "";
|
|
67697
67373
|
const wasRecorded = cliTracked === "1";
|
|
67698
|
-
if (
|
|
67374
|
+
if (status4 === 204) {
|
|
67699
67375
|
if (wasRecorded) {
|
|
67700
67376
|
process.stderr.write("Telemetry event tracked");
|
|
67701
67377
|
} else {
|
|
@@ -67703,7 +67379,7 @@ async function flush(_client, args) {
|
|
|
67703
67379
|
}
|
|
67704
67380
|
} else {
|
|
67705
67381
|
process.stderr.write(
|
|
67706
|
-
`Failed to send telemetry events. Unexpected response from telemetry server: ${
|
|
67382
|
+
`Failed to send telemetry events. Unexpected response from telemetry server: ${status4}`
|
|
67707
67383
|
);
|
|
67708
67384
|
}
|
|
67709
67385
|
return 0;
|
|
@@ -67948,15 +67624,15 @@ function analyze(trace3) {
|
|
|
67948
67624
|
if (!spansById.has(span.parentSpanId)) {
|
|
67949
67625
|
continue;
|
|
67950
67626
|
}
|
|
67951
|
-
const
|
|
67952
|
-
if (
|
|
67953
|
-
|
|
67627
|
+
const list22 = childrenByParent.get(span.parentSpanId);
|
|
67628
|
+
if (list22) {
|
|
67629
|
+
list22.push(span);
|
|
67954
67630
|
} else {
|
|
67955
67631
|
childrenByParent.set(span.parentSpanId, [span]);
|
|
67956
67632
|
}
|
|
67957
67633
|
}
|
|
67958
|
-
for (const
|
|
67959
|
-
|
|
67634
|
+
for (const list22 of childrenByParent.values()) {
|
|
67635
|
+
list22.sort(compareByStart);
|
|
67960
67636
|
}
|
|
67961
67637
|
const spanInfo = /* @__PURE__ */ new Map();
|
|
67962
67638
|
for (const span of trace3.spans) {
|
|
@@ -68085,8 +67761,8 @@ function renderHeader(analysis, options) {
|
|
|
68085
67761
|
const attributes = root?.attributes;
|
|
68086
67762
|
const method = readAttrString(attributes, "http.method");
|
|
68087
67763
|
const target = readAttrString(attributes, "http.target");
|
|
68088
|
-
const
|
|
68089
|
-
const endpoint = formatEndpoint(method, target,
|
|
67764
|
+
const status4 = readAttrString(attributes, "http.status_code");
|
|
67765
|
+
const endpoint = formatEndpoint(method, target, status4);
|
|
68090
67766
|
const duration = formatDurationUs(rootDurationUs);
|
|
68091
67767
|
const spans = formatSpansLine(trace3.spans.length, errorSpans.length);
|
|
68092
67768
|
const lines = [
|
|
@@ -68187,11 +67863,11 @@ function formatTreeRow(node, analysis) {
|
|
|
68187
67863
|
}
|
|
68188
67864
|
return `${indent2}- ${parts.join(" ")}`;
|
|
68189
67865
|
}
|
|
68190
|
-
function formatEndpoint(method, target,
|
|
67866
|
+
function formatEndpoint(method, target, status4) {
|
|
68191
67867
|
const left = method && target ? `${method} ${target}` : method ?? target;
|
|
68192
67868
|
const path3 = left ? `\`${left}\`` : UNKNOWN;
|
|
68193
|
-
if (
|
|
68194
|
-
return `${path3} \u2192 ${
|
|
67869
|
+
if (status4) {
|
|
67870
|
+
return `${path3} \u2192 ${status4}`;
|
|
68195
67871
|
}
|
|
68196
67872
|
return path3;
|
|
68197
67873
|
}
|
|
@@ -68670,8 +68346,397 @@ async function upgrade(client) {
|
|
|
68670
68346
|
return executeUpgrade();
|
|
68671
68347
|
}
|
|
68672
68348
|
|
|
68349
|
+
// src/commands/version/index.ts
|
|
68350
|
+
var import_chalk242 = __toESM(require_source(), 1);
|
|
68351
|
+
|
|
68352
|
+
// src/commands/version/status.ts
|
|
68353
|
+
async function status3(client) {
|
|
68354
|
+
const curl2 = await isCurlInstall();
|
|
68355
|
+
output_manager_default.print(`Version: ${pkg_default.version}
|
|
68356
|
+
`);
|
|
68357
|
+
if (curl2) {
|
|
68358
|
+
const [linked, pinned] = await Promise.all([
|
|
68359
|
+
getLinkedVersion(),
|
|
68360
|
+
getPinnedVersion()
|
|
68361
|
+
]);
|
|
68362
|
+
output_manager_default.print(`Managed by: Vercel installer (~/.vercel)
|
|
68363
|
+
`);
|
|
68364
|
+
if (linked?.startsWith("pr-")) {
|
|
68365
|
+
const sha = await getPrBuildSha(linked);
|
|
68366
|
+
output_manager_default.print(
|
|
68367
|
+
`Build: PR #${linked.slice(3)}${sha ? ` (${sha.slice(0, 12)})` : ""} \u2014 a mutable pre-release build, not the v${pkg_default.version} release
|
|
68368
|
+
`
|
|
68369
|
+
);
|
|
68370
|
+
} else if (linked && linked !== pkg_default.version) {
|
|
68371
|
+
output_manager_default.print(`Linked version: ${linked}
|
|
68372
|
+
`);
|
|
68373
|
+
}
|
|
68374
|
+
if (pinned) {
|
|
68375
|
+
output_manager_default.print(
|
|
68376
|
+
`Pinned: yes (${pinned}) \u2014 automatic updates and update notices are paused until you run ${getCommandName("version use latest")}
|
|
68377
|
+
`
|
|
68378
|
+
);
|
|
68379
|
+
}
|
|
68380
|
+
} else {
|
|
68381
|
+
const updateCommand = await getUpdateCommand().catch(() => void 0);
|
|
68382
|
+
output_manager_default.print(`Managed by: package manager
|
|
68383
|
+
`);
|
|
68384
|
+
if (updateCommand) {
|
|
68385
|
+
output_manager_default.print(`Upgrade command: ${updateCommand}
|
|
68386
|
+
`);
|
|
68387
|
+
}
|
|
68388
|
+
output_manager_default.print(
|
|
68389
|
+
`Tip: the recommended way to manage the Vercel CLI is the installer: ${CURL_INSTALL_COMMAND}
|
|
68390
|
+
`
|
|
68391
|
+
);
|
|
68392
|
+
}
|
|
68393
|
+
const autoUpdates = isAutoUpdateEnabled(client.config);
|
|
68394
|
+
const pinnedNote = autoUpdates && await getPinnedVersion();
|
|
68395
|
+
output_manager_default.print(
|
|
68396
|
+
`Automatic updates: ${autoUpdates ? "Enabled" : "Disabled"}${pinnedNote ? " (paused while pinned)" : ""}
|
|
68397
|
+
`
|
|
68398
|
+
);
|
|
68399
|
+
return 0;
|
|
68400
|
+
}
|
|
68401
|
+
|
|
68402
|
+
// src/commands/version/list.ts
|
|
68403
|
+
var import_chalk240 = __toESM(require_source(), 1);
|
|
68404
|
+
var DEFAULT_COUNT = 20;
|
|
68405
|
+
async function list21() {
|
|
68406
|
+
output_manager_default.spinner("Fetching available versions\u2026", 0);
|
|
68407
|
+
let versions2;
|
|
68408
|
+
try {
|
|
68409
|
+
versions2 = await listAvailableVersions(packageName);
|
|
68410
|
+
} catch (error) {
|
|
68411
|
+
output_manager_default.stopSpinner();
|
|
68412
|
+
output_manager_default.error(
|
|
68413
|
+
`Failed to list versions: ${error instanceof Error ? error.message : String(error)}`
|
|
68414
|
+
);
|
|
68415
|
+
return 1;
|
|
68416
|
+
}
|
|
68417
|
+
output_manager_default.stopSpinner();
|
|
68418
|
+
if (versions2.length === 0) {
|
|
68419
|
+
output_manager_default.log("No versions found");
|
|
68420
|
+
return 0;
|
|
68421
|
+
}
|
|
68422
|
+
const shown = versions2.slice(0, DEFAULT_COUNT);
|
|
68423
|
+
for (const version2 of shown) {
|
|
68424
|
+
const current = version2 === pkg_default.version;
|
|
68425
|
+
output_manager_default.print(
|
|
68426
|
+
current ? `${import_chalk240.default.cyan(version2)} ${import_chalk240.default.dim("(current)")}
|
|
68427
|
+
` : `${version2}
|
|
68428
|
+
`
|
|
68429
|
+
);
|
|
68430
|
+
}
|
|
68431
|
+
if (versions2.length > shown.length) {
|
|
68432
|
+
output_manager_default.print(import_chalk240.default.dim(`\u2026 and ${versions2.length - shown.length} more
|
|
68433
|
+
`));
|
|
68434
|
+
}
|
|
68435
|
+
return 0;
|
|
68436
|
+
}
|
|
68437
|
+
|
|
68438
|
+
// src/commands/version/installed.ts
|
|
68439
|
+
var import_chalk241 = __toESM(require_source(), 1);
|
|
68440
|
+
async function installed() {
|
|
68441
|
+
if (!await isCurlInstall()) {
|
|
68442
|
+
output_manager_default.print(`${pkg_default.version} ${import_chalk241.default.dim("(current)")}
|
|
68443
|
+
`);
|
|
68444
|
+
output_manager_default.log(
|
|
68445
|
+
`This CLI is managed by a package manager, so only the current version is available. The recommended way to manage CLI versions is the installer: ${CURL_INSTALL_COMMAND}`
|
|
68446
|
+
);
|
|
68447
|
+
return 0;
|
|
68448
|
+
}
|
|
68449
|
+
const [versions2, linked, pinned] = await Promise.all([
|
|
68450
|
+
listInstalledVersions(),
|
|
68451
|
+
getLinkedVersion(),
|
|
68452
|
+
getPinnedVersion()
|
|
68453
|
+
]);
|
|
68454
|
+
if (versions2.length === 0) {
|
|
68455
|
+
output_manager_default.log("No installed versions found");
|
|
68456
|
+
return 0;
|
|
68457
|
+
}
|
|
68458
|
+
for (const version2 of versions2) {
|
|
68459
|
+
const active = version2 === (linked ?? pkg_default.version);
|
|
68460
|
+
const labels = [];
|
|
68461
|
+
if (active)
|
|
68462
|
+
labels.push("active");
|
|
68463
|
+
if (version2 === pinned)
|
|
68464
|
+
labels.push("pinned");
|
|
68465
|
+
output_manager_default.print(
|
|
68466
|
+
active ? `${import_chalk241.default.cyan(version2)} ${import_chalk241.default.dim(`(${labels.join(", ")})`)}
|
|
68467
|
+
` : `${version2}
|
|
68468
|
+
`
|
|
68469
|
+
);
|
|
68470
|
+
}
|
|
68471
|
+
return 0;
|
|
68472
|
+
}
|
|
68473
|
+
|
|
68474
|
+
// src/commands/version/use.ts
|
|
68475
|
+
var import_semver = __toESM(require_semver(), 1);
|
|
68476
|
+
async function use(args) {
|
|
68477
|
+
const target = args[0];
|
|
68478
|
+
if (!target) {
|
|
68479
|
+
output_manager_default.error(
|
|
68480
|
+
`Missing version. Usage: ${getCommandName("version use <version>")}`
|
|
68481
|
+
);
|
|
68482
|
+
return 1;
|
|
68483
|
+
}
|
|
68484
|
+
if (target === "latest") {
|
|
68485
|
+
if (!await isCurlInstall()) {
|
|
68486
|
+
output_manager_default.error(
|
|
68487
|
+
`Switching versions is only supported for installer-managed CLIs.`
|
|
68488
|
+
);
|
|
68489
|
+
output_manager_default.log(
|
|
68490
|
+
`Install the CLI with the installer first: ${CURL_INSTALL_COMMAND}`
|
|
68491
|
+
);
|
|
68492
|
+
return 1;
|
|
68493
|
+
}
|
|
68494
|
+
return executeNativeSelfUpdate();
|
|
68495
|
+
}
|
|
68496
|
+
const pr = parsePrTarget(target);
|
|
68497
|
+
if (pr !== void 0) {
|
|
68498
|
+
if (!await isCurlInstall()) {
|
|
68499
|
+
output_manager_default.error(
|
|
68500
|
+
`Switching versions is only supported for installer-managed CLIs.`
|
|
68501
|
+
);
|
|
68502
|
+
output_manager_default.log(
|
|
68503
|
+
`Install the CLI with the installer first: ${CURL_INSTALL_COMMAND}`
|
|
68504
|
+
);
|
|
68505
|
+
return 1;
|
|
68506
|
+
}
|
|
68507
|
+
try {
|
|
68508
|
+
const { updated, sha } = await installAndLinkPrBinary(pr);
|
|
68509
|
+
await setPinnedVersion(`pr-${pr}`);
|
|
68510
|
+
output_manager_default.stopSpinner();
|
|
68511
|
+
if (updated) {
|
|
68512
|
+
output_manager_default.success(
|
|
68513
|
+
`Switched to the Vercel CLI build for PR #${pr} (${sha.slice(0, 12)}).`
|
|
68514
|
+
);
|
|
68515
|
+
} else {
|
|
68516
|
+
output_manager_default.log(
|
|
68517
|
+
`Already on the latest build for PR #${pr} (${sha.slice(0, 12)}).`
|
|
68518
|
+
);
|
|
68519
|
+
}
|
|
68520
|
+
output_manager_default.log(
|
|
68521
|
+
`PR builds change on every push \u2014 re-run this command to pick up new builds.`
|
|
68522
|
+
);
|
|
68523
|
+
output_manager_default.log(
|
|
68524
|
+
`Return to a release build with ${getCommandName("version use latest")}.`
|
|
68525
|
+
);
|
|
68526
|
+
return 0;
|
|
68527
|
+
} catch (error) {
|
|
68528
|
+
output_manager_default.stopSpinner();
|
|
68529
|
+
output_manager_default.error(
|
|
68530
|
+
`Failed to switch to the PR #${pr} build: ${error instanceof Error ? error.message : String(error)}`
|
|
68531
|
+
);
|
|
68532
|
+
return 1;
|
|
68533
|
+
}
|
|
68534
|
+
}
|
|
68535
|
+
const version2 = import_semver.default.valid(import_semver.default.coerce(target)?.version ?? target) ? import_semver.default.coerce(target)?.version ?? target : void 0;
|
|
68536
|
+
if (!version2 || !import_semver.default.valid(version2)) {
|
|
68537
|
+
output_manager_default.error(`Invalid version: "${target}"`);
|
|
68538
|
+
return 1;
|
|
68539
|
+
}
|
|
68540
|
+
if (!await isCurlInstall()) {
|
|
68541
|
+
output_manager_default.error(
|
|
68542
|
+
`Switching versions is only supported for installer-managed CLIs.`
|
|
68543
|
+
);
|
|
68544
|
+
output_manager_default.log(
|
|
68545
|
+
`Install the CLI with the installer first: ${CURL_INSTALL_COMMAND}`
|
|
68546
|
+
);
|
|
68547
|
+
output_manager_default.log(
|
|
68548
|
+
`Or install this version with your package manager: npm i -g ${packageName}@${version2}`
|
|
68549
|
+
);
|
|
68550
|
+
return 1;
|
|
68551
|
+
}
|
|
68552
|
+
if (version2 === pkg_default.version && !await isLinkedToPrBuild()) {
|
|
68553
|
+
output_manager_default.log(`Already on v${version2}.`);
|
|
68554
|
+
return 0;
|
|
68555
|
+
}
|
|
68556
|
+
try {
|
|
68557
|
+
const available = await listAvailableVersions(packageName);
|
|
68558
|
+
if (!available.includes(version2)) {
|
|
68559
|
+
output_manager_default.error(`Version ${version2} does not exist.`);
|
|
68560
|
+
output_manager_default.log(
|
|
68561
|
+
`Run ${getCommandName("version list")} to see available versions.`
|
|
68562
|
+
);
|
|
68563
|
+
return 1;
|
|
68564
|
+
}
|
|
68565
|
+
} catch {
|
|
68566
|
+
}
|
|
68567
|
+
try {
|
|
68568
|
+
await installAndLinkVersion(version2);
|
|
68569
|
+
await setPinnedVersion(version2);
|
|
68570
|
+
output_manager_default.stopSpinner();
|
|
68571
|
+
output_manager_default.success(`Switched to Vercel CLI v${version2}.`);
|
|
68572
|
+
output_manager_default.log(
|
|
68573
|
+
`This version is now pinned \u2014 automatic updates are paused until you run ${getCommandName("version use latest")}.`
|
|
68574
|
+
);
|
|
68575
|
+
return 0;
|
|
68576
|
+
} catch (error) {
|
|
68577
|
+
output_manager_default.stopSpinner();
|
|
68578
|
+
output_manager_default.error(
|
|
68579
|
+
`Failed to switch to v${version2}: ${error instanceof Error ? error.message : String(error)}`
|
|
68580
|
+
);
|
|
68581
|
+
return 1;
|
|
68582
|
+
}
|
|
68583
|
+
}
|
|
68584
|
+
|
|
68585
|
+
// src/commands/version/autoupdate.ts
|
|
68586
|
+
async function autoupdate(client, args) {
|
|
68587
|
+
const action = args[0];
|
|
68588
|
+
if (!action || action === "status") {
|
|
68589
|
+
output_manager_default.print(
|
|
68590
|
+
`Automatic updates are ${isAutoUpdateEnabled(client.config) ? "enabled" : "disabled"}
|
|
68591
|
+
`
|
|
68592
|
+
);
|
|
68593
|
+
return 0;
|
|
68594
|
+
}
|
|
68595
|
+
if (action === "enable" || action === "disable") {
|
|
68596
|
+
const enabled = action === "enable";
|
|
68597
|
+
setAutoUpdate(client, enabled);
|
|
68598
|
+
output_manager_default.success(
|
|
68599
|
+
`Automatic CLI updates ${enabled ? "enabled" : "disabled"}.`
|
|
68600
|
+
);
|
|
68601
|
+
return 0;
|
|
68602
|
+
}
|
|
68603
|
+
output_manager_default.error(
|
|
68604
|
+
`Invalid argument "${action}". Usage: ${getCommandName("version autoupdate [enable|disable|status]")}`
|
|
68605
|
+
);
|
|
68606
|
+
return 1;
|
|
68607
|
+
}
|
|
68608
|
+
|
|
68609
|
+
// src/util/telemetry/commands/version/index.ts
|
|
68610
|
+
var VersionTelemetryClient = class extends TelemetryClient {
|
|
68611
|
+
trackCliSubcommandList(actual) {
|
|
68612
|
+
this.trackCliSubcommand({
|
|
68613
|
+
subcommand: "list",
|
|
68614
|
+
value: actual
|
|
68615
|
+
});
|
|
68616
|
+
}
|
|
68617
|
+
trackCliSubcommandInstalled(actual) {
|
|
68618
|
+
this.trackCliSubcommand({
|
|
68619
|
+
subcommand: "installed",
|
|
68620
|
+
value: actual
|
|
68621
|
+
});
|
|
68622
|
+
}
|
|
68623
|
+
trackCliSubcommandUse(actual) {
|
|
68624
|
+
this.trackCliSubcommand({
|
|
68625
|
+
subcommand: "use",
|
|
68626
|
+
value: actual
|
|
68627
|
+
});
|
|
68628
|
+
}
|
|
68629
|
+
trackCliSubcommandUpdate(actual) {
|
|
68630
|
+
this.trackCliSubcommand({
|
|
68631
|
+
subcommand: "update",
|
|
68632
|
+
value: actual
|
|
68633
|
+
});
|
|
68634
|
+
}
|
|
68635
|
+
trackCliSubcommandAutoupdate(actual) {
|
|
68636
|
+
this.trackCliSubcommand({
|
|
68637
|
+
subcommand: "autoupdate",
|
|
68638
|
+
value: actual
|
|
68639
|
+
});
|
|
68640
|
+
}
|
|
68641
|
+
};
|
|
68642
|
+
|
|
68643
|
+
// src/commands/version/index.ts
|
|
68644
|
+
var COMMAND_CONFIG51 = {
|
|
68645
|
+
list: getCommandAliases(listSubcommand22),
|
|
68646
|
+
installed: getCommandAliases(installedSubcommand),
|
|
68647
|
+
use: getCommandAliases(useSubcommand),
|
|
68648
|
+
update: getCommandAliases(updateSubcommand6),
|
|
68649
|
+
autoupdate: getCommandAliases(autoupdateSubcommand)
|
|
68650
|
+
};
|
|
68651
|
+
async function version(client) {
|
|
68652
|
+
const telemetry2 = new VersionTelemetryClient({
|
|
68653
|
+
opts: {
|
|
68654
|
+
store: client.telemetryEventStore
|
|
68655
|
+
}
|
|
68656
|
+
});
|
|
68657
|
+
let parsedArguments;
|
|
68658
|
+
const flagsSpecification = getFlagsSpecification(versionCommand.options);
|
|
68659
|
+
try {
|
|
68660
|
+
parsedArguments = parseArguments(client.argv.slice(2), flagsSpecification);
|
|
68661
|
+
} catch (err) {
|
|
68662
|
+
printError(err);
|
|
68663
|
+
return 1;
|
|
68664
|
+
}
|
|
68665
|
+
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
68666
|
+
parsedArguments.args.slice(1),
|
|
68667
|
+
COMMAND_CONFIG51
|
|
68668
|
+
);
|
|
68669
|
+
const needHelp = parsedArguments.flags["--help"];
|
|
68670
|
+
function printHelp(command) {
|
|
68671
|
+
output_manager_default.print(
|
|
68672
|
+
help(command, {
|
|
68673
|
+
columns: client.stderr.columns,
|
|
68674
|
+
parent: versionCommand
|
|
68675
|
+
})
|
|
68676
|
+
);
|
|
68677
|
+
}
|
|
68678
|
+
if (!subcommand && needHelp) {
|
|
68679
|
+
telemetry2.trackCliFlagHelp("version", subcommand);
|
|
68680
|
+
output_manager_default.print(help(versionCommand, { columns: client.stderr.columns }));
|
|
68681
|
+
return 2;
|
|
68682
|
+
}
|
|
68683
|
+
switch (subcommand) {
|
|
68684
|
+
case "list":
|
|
68685
|
+
if (needHelp) {
|
|
68686
|
+
telemetry2.trackCliFlagHelp("version", subcommandOriginal);
|
|
68687
|
+
printHelp(listSubcommand22);
|
|
68688
|
+
return 2;
|
|
68689
|
+
}
|
|
68690
|
+
telemetry2.trackCliSubcommandList(subcommandOriginal);
|
|
68691
|
+
return list21();
|
|
68692
|
+
case "installed":
|
|
68693
|
+
if (needHelp) {
|
|
68694
|
+
telemetry2.trackCliFlagHelp("version", subcommandOriginal);
|
|
68695
|
+
printHelp(installedSubcommand);
|
|
68696
|
+
return 2;
|
|
68697
|
+
}
|
|
68698
|
+
telemetry2.trackCliSubcommandInstalled(subcommandOriginal);
|
|
68699
|
+
return installed();
|
|
68700
|
+
case "use":
|
|
68701
|
+
if (needHelp) {
|
|
68702
|
+
telemetry2.trackCliFlagHelp("version", subcommandOriginal);
|
|
68703
|
+
printHelp(useSubcommand);
|
|
68704
|
+
return 2;
|
|
68705
|
+
}
|
|
68706
|
+
telemetry2.trackCliSubcommandUse(subcommandOriginal);
|
|
68707
|
+
return use(args);
|
|
68708
|
+
case "update":
|
|
68709
|
+
if (needHelp) {
|
|
68710
|
+
telemetry2.trackCliFlagHelp("version", subcommandOriginal);
|
|
68711
|
+
printHelp(updateSubcommand6);
|
|
68712
|
+
return 2;
|
|
68713
|
+
}
|
|
68714
|
+
telemetry2.trackCliSubcommandUpdate(subcommandOriginal);
|
|
68715
|
+
return use(["latest"]);
|
|
68716
|
+
case "autoupdate":
|
|
68717
|
+
if (needHelp) {
|
|
68718
|
+
telemetry2.trackCliFlagHelp("version", subcommandOriginal);
|
|
68719
|
+
printHelp(autoupdateSubcommand);
|
|
68720
|
+
return 2;
|
|
68721
|
+
}
|
|
68722
|
+
telemetry2.trackCliSubcommandAutoupdate(subcommandOriginal);
|
|
68723
|
+
return autoupdate(client, args);
|
|
68724
|
+
default: {
|
|
68725
|
+
if (parsedArguments.args.length > 1) {
|
|
68726
|
+
output_manager_default.print(
|
|
68727
|
+
`${import_chalk242.default.red("Error")}: Invalid subcommand. See help instructions for usage:
|
|
68728
|
+
`
|
|
68729
|
+
);
|
|
68730
|
+
output_manager_default.print(help(versionCommand, { columns: client.stderr.columns }));
|
|
68731
|
+
return 2;
|
|
68732
|
+
}
|
|
68733
|
+
return status3(client);
|
|
68734
|
+
}
|
|
68735
|
+
}
|
|
68736
|
+
}
|
|
68737
|
+
|
|
68673
68738
|
// src/commands/usage/index.ts
|
|
68674
|
-
var
|
|
68739
|
+
var import_chalk246 = __toESM(require_source(), 1);
|
|
68675
68740
|
var import_jsonlines = __toESM(require_jsonlines(), 1);
|
|
68676
68741
|
|
|
68677
68742
|
// src/util/telemetry/commands/usage/index.ts
|
|
@@ -68825,19 +68890,19 @@ function isValidGroupByDimension(value) {
|
|
|
68825
68890
|
}
|
|
68826
68891
|
|
|
68827
68892
|
// src/commands/usage/output-aggregated.ts
|
|
68828
|
-
var
|
|
68893
|
+
var import_chalk243 = __toESM(require_source(), 1);
|
|
68829
68894
|
function outputAggregated({ data, startTime }) {
|
|
68830
68895
|
const { print, log } = output_manager_default;
|
|
68831
68896
|
log(
|
|
68832
|
-
`Usage for ${
|
|
68897
|
+
`Usage for ${import_chalk243.default.bold(data.contextName)} ${elapsed(Date.now() - startTime)}`
|
|
68833
68898
|
);
|
|
68834
68899
|
log("");
|
|
68835
68900
|
const periodSuffix = data.usingDefaults ? " (current month)" : "";
|
|
68836
68901
|
log(
|
|
68837
|
-
`${
|
|
68902
|
+
`${import_chalk243.default.gray("Period:")} ${data.fromDisplay} to ${data.toDisplay}${periodSuffix}`
|
|
68838
68903
|
);
|
|
68839
|
-
log(`${
|
|
68840
|
-
log(`${
|
|
68904
|
+
log(`${import_chalk243.default.gray("Charges processed:")} ${data.chargeCount}`);
|
|
68905
|
+
log(`${import_chalk243.default.gray("Pricing unit:")} ${data.pricingUnit}`);
|
|
68841
68906
|
log("");
|
|
68842
68907
|
const sortedServices = [...data.services.entries()].sort(
|
|
68843
68908
|
(a, b) => b[1].billedCost - a[1].billedCost
|
|
@@ -68855,15 +68920,15 @@ function outputAggregated({ data, startTime }) {
|
|
|
68855
68920
|
formatCurrency(svc.billedCost)
|
|
68856
68921
|
]);
|
|
68857
68922
|
rows.push([
|
|
68858
|
-
|
|
68859
|
-
|
|
68923
|
+
import_chalk243.default.bold("Total"),
|
|
68924
|
+
import_chalk243.default.bold(
|
|
68860
68925
|
formatQuantity(data.grandTotals.pricingQuantity, data.pricingUnit)
|
|
68861
68926
|
),
|
|
68862
|
-
|
|
68863
|
-
|
|
68927
|
+
import_chalk243.default.bold(formatCurrency(data.grandTotals.effectiveCost)),
|
|
68928
|
+
import_chalk243.default.bold(formatCurrency(data.grandTotals.billedCost))
|
|
68864
68929
|
]);
|
|
68865
68930
|
const tablePrint = table(
|
|
68866
|
-
[headers.map((h) =>
|
|
68931
|
+
[headers.map((h) => import_chalk243.default.bold(import_chalk243.default.cyan(h))), ...rows],
|
|
68867
68932
|
{ hsep: 4, align: ["l", "r", "r", "r"] }
|
|
68868
68933
|
).replace(/^/gm, " ");
|
|
68869
68934
|
print(`
|
|
@@ -68871,12 +68936,12 @@ ${tablePrint}
|
|
|
68871
68936
|
|
|
68872
68937
|
`);
|
|
68873
68938
|
log(
|
|
68874
|
-
`${
|
|
68939
|
+
`${import_chalk243.default.gray("Amount due:")} ${import_chalk243.default.bold(formatCurrency(data.grandTotals.billedCost))}`
|
|
68875
68940
|
);
|
|
68876
68941
|
}
|
|
68877
68942
|
|
|
68878
68943
|
// src/commands/usage/output-breakdown.ts
|
|
68879
|
-
var
|
|
68944
|
+
var import_chalk244 = __toESM(require_source(), 1);
|
|
68880
68945
|
function getPeriodLabel(period) {
|
|
68881
68946
|
switch (period) {
|
|
68882
68947
|
case "daily":
|
|
@@ -68897,15 +68962,15 @@ function outputBreakdown({
|
|
|
68897
68962
|
const { print, log } = output_manager_default;
|
|
68898
68963
|
const periodLabel = getPeriodLabel(breakdownPeriod);
|
|
68899
68964
|
log(
|
|
68900
|
-
`${periodLabel} Usage for ${
|
|
68965
|
+
`${periodLabel} Usage for ${import_chalk244.default.bold(data.contextName)} ${elapsed(Date.now() - startTime)}`
|
|
68901
68966
|
);
|
|
68902
68967
|
log("");
|
|
68903
68968
|
const periodSuffix = data.usingDefaults ? " (current month)" : "";
|
|
68904
68969
|
log(
|
|
68905
|
-
`${
|
|
68970
|
+
`${import_chalk244.default.gray("Period:")} ${data.fromDisplay} to ${data.toDisplay}${periodSuffix}`
|
|
68906
68971
|
);
|
|
68907
|
-
log(`${
|
|
68908
|
-
log(`${
|
|
68972
|
+
log(`${import_chalk244.default.gray("Charges processed:")} ${data.chargeCount}`);
|
|
68973
|
+
log(`${import_chalk244.default.gray("Pricing unit:")} ${data.pricingUnit}`);
|
|
68909
68974
|
log("");
|
|
68910
68975
|
const sortedServices = [...data.services.entries()].sort(
|
|
68911
68976
|
(a, b) => b[1].billedCost - a[1].billedCost
|
|
@@ -68922,7 +68987,7 @@ function outputBreakdown({
|
|
|
68922
68987
|
(a, b) => b[1].billedCost - a[1].billedCost
|
|
68923
68988
|
);
|
|
68924
68989
|
log(
|
|
68925
|
-
`${
|
|
68990
|
+
`${import_chalk244.default.bold(import_chalk244.default.cyan(periodKey))} (Total: ${formatQuantity(periodData.totalPricingQuantity, data.pricingUnit)}, ${formatCurrency(periodData.totalBilledCost)})`
|
|
68926
68991
|
);
|
|
68927
68992
|
const headers = ["Service", quantityHeader, "Billed Cost"];
|
|
68928
68993
|
const rows = sortedPeriodServices.map(([name, svc]) => [
|
|
@@ -68931,7 +68996,7 @@ function outputBreakdown({
|
|
|
68931
68996
|
formatCurrency(svc.billedCost)
|
|
68932
68997
|
]);
|
|
68933
68998
|
const tablePrint = table(
|
|
68934
|
-
[headers.map((h) =>
|
|
68999
|
+
[headers.map((h) => import_chalk244.default.bold(import_chalk244.default.gray(h))), ...rows],
|
|
68935
69000
|
{ hsep: 4, align: ["l", "r", "r"] }
|
|
68936
69001
|
).replace(/^/gm, " ");
|
|
68937
69002
|
print(`${tablePrint}
|
|
@@ -68940,7 +69005,7 @@ function outputBreakdown({
|
|
|
68940
69005
|
}
|
|
68941
69006
|
|
|
68942
69007
|
// src/commands/usage/output-group-by.ts
|
|
68943
|
-
var
|
|
69008
|
+
var import_chalk245 = __toESM(require_source(), 1);
|
|
68944
69009
|
function getDimensionLabel(dimension) {
|
|
68945
69010
|
switch (dimension) {
|
|
68946
69011
|
case "project":
|
|
@@ -68959,15 +69024,15 @@ function outputGroupBy({
|
|
|
68959
69024
|
const { print, log } = output_manager_default;
|
|
68960
69025
|
const dimensionLabel = getDimensionLabel(groupByDimension);
|
|
68961
69026
|
log(
|
|
68962
|
-
`Usage by ${dimensionLabel} for ${
|
|
69027
|
+
`Usage by ${dimensionLabel} for ${import_chalk245.default.bold(data.contextName)} ${elapsed(Date.now() - startTime)}`
|
|
68963
69028
|
);
|
|
68964
69029
|
log("");
|
|
68965
69030
|
const periodSuffix = data.usingDefaults ? " (current month)" : "";
|
|
68966
69031
|
log(
|
|
68967
|
-
`${
|
|
69032
|
+
`${import_chalk245.default.gray("Period:")} ${data.fromDisplay} to ${data.toDisplay}${periodSuffix}`
|
|
68968
69033
|
);
|
|
68969
|
-
log(`${
|
|
68970
|
-
log(`${
|
|
69034
|
+
log(`${import_chalk245.default.gray("Charges processed:")} ${data.chargeCount}`);
|
|
69035
|
+
log(`${import_chalk245.default.gray("Pricing unit:")} ${data.pricingUnit}`);
|
|
68971
69036
|
log("");
|
|
68972
69037
|
const sortedGroups = [...data.groupByUsage.entries()].sort(
|
|
68973
69038
|
(a, b) => b[1].totalBilledCost - a[1].totalBilledCost
|
|
@@ -68979,7 +69044,7 @@ function outputGroupBy({
|
|
|
68979
69044
|
const quantityHeader = data.pricingUnit === "USD" ? "Usage (USD)" : data.pricingUnit;
|
|
68980
69045
|
for (const [groupName, groupData] of sortedGroups) {
|
|
68981
69046
|
log(
|
|
68982
|
-
`${
|
|
69047
|
+
`${import_chalk245.default.bold(import_chalk245.default.cyan(groupName))} (Total: ${formatQuantity(groupData.totalPricingQuantity, data.pricingUnit)}, ${formatCurrency(groupData.totalBilledCost)})`
|
|
68983
69048
|
);
|
|
68984
69049
|
const sortedServices = [...groupData.services.entries()].sort(
|
|
68985
69050
|
(a, b) => b[1].billedCost - a[1].billedCost
|
|
@@ -68991,7 +69056,7 @@ function outputGroupBy({
|
|
|
68991
69056
|
formatCurrency(svc.billedCost)
|
|
68992
69057
|
]);
|
|
68993
69058
|
const tablePrint = table(
|
|
68994
|
-
[headers.map((h) =>
|
|
69059
|
+
[headers.map((h) => import_chalk245.default.bold(import_chalk245.default.gray(h))), ...rows],
|
|
68995
69060
|
{ hsep: 4, align: ["l", "r", "r"] }
|
|
68996
69061
|
).replace(/^/gm, " ");
|
|
68997
69062
|
print(`${tablePrint}
|
|
@@ -68999,7 +69064,7 @@ function outputGroupBy({
|
|
|
68999
69064
|
}
|
|
69000
69065
|
log("");
|
|
69001
69066
|
log(
|
|
69002
|
-
`${
|
|
69067
|
+
`${import_chalk245.default.gray("Amount due:")} ${import_chalk245.default.bold(formatCurrency(data.grandTotals.billedCost))}`
|
|
69003
69068
|
);
|
|
69004
69069
|
}
|
|
69005
69070
|
|
|
@@ -69196,7 +69261,7 @@ async function usage(client) {
|
|
|
69196
69261
|
}
|
|
69197
69262
|
const start = Date.now();
|
|
69198
69263
|
if (!asJson) {
|
|
69199
|
-
spinner(`Fetching usage data for ${
|
|
69264
|
+
spinner(`Fetching usage data for ${import_chalk246.default.bold(contextName)}`);
|
|
69200
69265
|
}
|
|
69201
69266
|
debug(`Fetching charges from ${fromDate} to ${toDate}`);
|
|
69202
69267
|
const query = new URLSearchParams({
|
|
@@ -69540,7 +69605,7 @@ var VcrTelemetryClient = class extends TelemetryClient {
|
|
|
69540
69605
|
};
|
|
69541
69606
|
|
|
69542
69607
|
// src/commands/vcr/index.ts
|
|
69543
|
-
var
|
|
69608
|
+
var COMMAND_CONFIG52 = {
|
|
69544
69609
|
ls: getCommandAliases(listSubcommand21),
|
|
69545
69610
|
inspect: getCommandAliases(inspectSubcommand10),
|
|
69546
69611
|
add: getCommandAliases(addSubcommand12),
|
|
@@ -69571,7 +69636,7 @@ async function vcr(client) {
|
|
|
69571
69636
|
}
|
|
69572
69637
|
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
69573
69638
|
parsedArgs.args.slice(1),
|
|
69574
|
-
|
|
69639
|
+
COMMAND_CONFIG52
|
|
69575
69640
|
);
|
|
69576
69641
|
const needHelp = parsedArgs.flags["--help"];
|
|
69577
69642
|
function printHelp(command) {
|
|
@@ -69686,39 +69751,39 @@ async function vcr(client) {
|
|
|
69686
69751
|
switch (subcommand) {
|
|
69687
69752
|
case "ls":
|
|
69688
69753
|
telemetry2.trackCliSubcommandLs(subcommandOriginal);
|
|
69689
|
-
return (await import("./chunks/ls-
|
|
69754
|
+
return (await import("./chunks/ls-LS475P45.js")).default(client, args, telemetry2);
|
|
69690
69755
|
case "inspect":
|
|
69691
69756
|
telemetry2.trackCliSubcommandInspect(subcommandOriginal);
|
|
69692
|
-
return (await import("./chunks/inspect-
|
|
69757
|
+
return (await import("./chunks/inspect-SMDJWUBZ.js")).default(client, args, telemetry2);
|
|
69693
69758
|
case "add":
|
|
69694
69759
|
telemetry2.trackCliSubcommandAdd(subcommandOriginal);
|
|
69695
|
-
return (await import("./chunks/add-
|
|
69760
|
+
return (await import("./chunks/add-ZZTRLRJT.js")).default(client, args, telemetry2);
|
|
69696
69761
|
case "config":
|
|
69697
69762
|
telemetry2.trackCliSubcommandConfig(subcommandOriginal);
|
|
69698
|
-
return (await import("./chunks/config-
|
|
69763
|
+
return (await import("./chunks/config-3BEFAQQU.js")).default(client, args, telemetry2);
|
|
69699
69764
|
case "rm":
|
|
69700
69765
|
telemetry2.trackCliSubcommandRm(subcommandOriginal);
|
|
69701
|
-
return (await import("./chunks/rm-
|
|
69766
|
+
return (await import("./chunks/rm-G5JC3V3B.js")).default(client, args, telemetry2);
|
|
69702
69767
|
case "login":
|
|
69703
69768
|
telemetry2.trackCliSubcommandLogin(subcommandOriginal);
|
|
69704
|
-
return (await import("./chunks/login-
|
|
69769
|
+
return (await import("./chunks/login-DKKJWEM5.js")).default(client, args, telemetry2);
|
|
69705
69770
|
case "build":
|
|
69706
69771
|
telemetry2.trackCliSubcommandBuild(subcommandOriginal);
|
|
69707
|
-
return (await import("./chunks/build-
|
|
69772
|
+
return (await import("./chunks/build-VVNU4BLE.js")).default(client, telemetry2);
|
|
69708
69773
|
case "push":
|
|
69709
69774
|
telemetry2.trackCliSubcommandPush(subcommandOriginal);
|
|
69710
|
-
return (await import("./chunks/push-
|
|
69775
|
+
return (await import("./chunks/push-3OY5CP5F.js")).default(client, telemetry2);
|
|
69711
69776
|
case "tag":
|
|
69712
69777
|
telemetry2.trackCliSubcommandTag(subcommandOriginal);
|
|
69713
|
-
return (await import("./chunks/tags-
|
|
69778
|
+
return (await import("./chunks/tags-IO73I6MR.js")).default(client, args, telemetry2);
|
|
69714
69779
|
case "image":
|
|
69715
69780
|
telemetry2.trackCliSubcommandImage(subcommandOriginal);
|
|
69716
|
-
return (await import("./chunks/image-
|
|
69781
|
+
return (await import("./chunks/image-SXRSCUP3.js")).default(client, args, telemetry2);
|
|
69717
69782
|
case "permissions":
|
|
69718
69783
|
telemetry2.trackCliSubcommandPermissions(subcommandOriginal);
|
|
69719
|
-
return (await import("./chunks/permissions-
|
|
69784
|
+
return (await import("./chunks/permissions-PTW7BRVE.js")).default(client, args, telemetry2);
|
|
69720
69785
|
default:
|
|
69721
|
-
output_manager_default.error(getInvalidSubcommand(
|
|
69786
|
+
output_manager_default.error(getInvalidSubcommand(COMMAND_CONFIG52));
|
|
69722
69787
|
output_manager_default.print(help(vcrCommand, { columns: client.stderr.columns }));
|
|
69723
69788
|
return 2;
|
|
69724
69789
|
}
|
|
@@ -69726,7 +69791,7 @@ async function vcr(client) {
|
|
|
69726
69791
|
|
|
69727
69792
|
// src/commands/webhooks/ls.ts
|
|
69728
69793
|
var import_ms36 = __toESM(require_ms(), 1);
|
|
69729
|
-
var
|
|
69794
|
+
var import_chalk247 = __toESM(require_source(), 1);
|
|
69730
69795
|
var import_pluralize16 = __toESM(require_pluralize(), 1);
|
|
69731
69796
|
|
|
69732
69797
|
// src/util/webhooks/get-webhooks.ts
|
|
@@ -69763,7 +69828,7 @@ async function ls9(client, argv) {
|
|
|
69763
69828
|
}
|
|
69764
69829
|
});
|
|
69765
69830
|
let parsedArgs;
|
|
69766
|
-
const flagsSpecification = getFlagsSpecification(
|
|
69831
|
+
const flagsSpecification = getFlagsSpecification(listSubcommand24.options);
|
|
69767
69832
|
try {
|
|
69768
69833
|
parsedArgs = parseArguments(argv, flagsSpecification);
|
|
69769
69834
|
} catch (error) {
|
|
@@ -69790,7 +69855,7 @@ async function ls9(client, argv) {
|
|
|
69790
69855
|
const { contextName } = await getScope(client);
|
|
69791
69856
|
const lsStamp = stamp_default();
|
|
69792
69857
|
if (!client.nonInteractive) {
|
|
69793
|
-
output_manager_default.spinner(`Fetching Webhooks under ${
|
|
69858
|
+
output_manager_default.spinner(`Fetching Webhooks under ${import_chalk247.default.bold(contextName)}`);
|
|
69794
69859
|
}
|
|
69795
69860
|
const { webhooks } = await getWebhooks(client);
|
|
69796
69861
|
if (asJson) {
|
|
@@ -69818,9 +69883,9 @@ async function ls9(client, argv) {
|
|
|
69818
69883
|
`);
|
|
69819
69884
|
} else {
|
|
69820
69885
|
output_manager_default.log(
|
|
69821
|
-
`${(0, import_pluralize16.default)("Webhook", webhooks.length, true)} found under ${
|
|
69886
|
+
`${(0, import_pluralize16.default)("Webhook", webhooks.length, true)} found under ${import_chalk247.default.bold(
|
|
69822
69887
|
contextName
|
|
69823
|
-
)} ${
|
|
69888
|
+
)} ${import_chalk247.default.gray(lsStamp())}`
|
|
69824
69889
|
);
|
|
69825
69890
|
if (webhooks.length > 0) {
|
|
69826
69891
|
output_manager_default.print(
|
|
@@ -69836,7 +69901,7 @@ function formatWebhooksTable(webhooks) {
|
|
|
69836
69901
|
const rows = webhooks.map((webhook) => {
|
|
69837
69902
|
const age = webhook.createdAt ? (0, import_ms36.default)(current - webhook.createdAt) : "-";
|
|
69838
69903
|
const eventsDisplay = webhook.events.length > 2 ? `${webhook.events.slice(0, 2).join(", ")} +${webhook.events.length - 2}` : webhook.events.join(", ");
|
|
69839
|
-
return [webhook.id, webhook.url, eventsDisplay,
|
|
69904
|
+
return [webhook.id, webhook.url, eventsDisplay, import_chalk247.default.gray(age)];
|
|
69840
69905
|
});
|
|
69841
69906
|
return formatTable(
|
|
69842
69907
|
["ID", "URL", "Events", "Age"],
|
|
@@ -69846,7 +69911,7 @@ function formatWebhooksTable(webhooks) {
|
|
|
69846
69911
|
}
|
|
69847
69912
|
|
|
69848
69913
|
// src/commands/webhooks/get.ts
|
|
69849
|
-
var
|
|
69914
|
+
var import_chalk248 = __toESM(require_source(), 1);
|
|
69850
69915
|
|
|
69851
69916
|
// src/util/webhooks/get-webhook.ts
|
|
69852
69917
|
async function getWebhook(client, webhookId) {
|
|
@@ -69927,7 +69992,7 @@ async function get4(client, argv) {
|
|
|
69927
69992
|
const asJson = formatResult.jsonOutput || client.nonInteractive;
|
|
69928
69993
|
if (args.length !== 1) {
|
|
69929
69994
|
output_manager_default.error(
|
|
69930
|
-
`Invalid number of arguments. Usage: ${
|
|
69995
|
+
`Invalid number of arguments. Usage: ${import_chalk248.default.cyan(
|
|
69931
69996
|
`${getCommandName("webhooks get <id>")}`
|
|
69932
69997
|
)}`
|
|
69933
69998
|
);
|
|
@@ -69937,7 +70002,7 @@ async function get4(client, argv) {
|
|
|
69937
70002
|
const { contextName } = await getScope(client);
|
|
69938
70003
|
if (!client.nonInteractive) {
|
|
69939
70004
|
output_manager_default.spinner(
|
|
69940
|
-
`Fetching Webhook ${webhookId} under ${
|
|
70005
|
+
`Fetching Webhook ${webhookId} under ${import_chalk248.default.bold(contextName)}`
|
|
69941
70006
|
);
|
|
69942
70007
|
}
|
|
69943
70008
|
let webhook;
|
|
@@ -69981,33 +70046,33 @@ async function get4(client, argv) {
|
|
|
69981
70046
|
`);
|
|
69982
70047
|
} else {
|
|
69983
70048
|
output_manager_default.log(
|
|
69984
|
-
`Webhook ${webhookId} found under ${
|
|
70049
|
+
`Webhook ${webhookId} found under ${import_chalk248.default.bold(contextName)} ${import_chalk248.default.gray(
|
|
69985
70050
|
getStamp()
|
|
69986
70051
|
)}`
|
|
69987
70052
|
);
|
|
69988
70053
|
output_manager_default.print("\n");
|
|
69989
|
-
output_manager_default.print(
|
|
69990
|
-
output_manager_default.print(` ${
|
|
70054
|
+
output_manager_default.print(import_chalk248.default.bold(" General\n\n"));
|
|
70055
|
+
output_manager_default.print(` ${import_chalk248.default.cyan("ID")} ${webhook.id}
|
|
69991
70056
|
`);
|
|
69992
|
-
output_manager_default.print(` ${
|
|
70057
|
+
output_manager_default.print(` ${import_chalk248.default.cyan("URL")} ${webhook.url}
|
|
69993
70058
|
`);
|
|
69994
70059
|
output_manager_default.print(
|
|
69995
|
-
` ${
|
|
70060
|
+
` ${import_chalk248.default.cyan("Created At")} ${formatDate(webhook.createdAt)}
|
|
69996
70061
|
`
|
|
69997
70062
|
);
|
|
69998
70063
|
output_manager_default.print(
|
|
69999
|
-
` ${
|
|
70064
|
+
` ${import_chalk248.default.cyan("Updated At")} ${formatDate(webhook.updatedAt)}
|
|
70000
70065
|
`
|
|
70001
70066
|
);
|
|
70002
70067
|
output_manager_default.print("\n");
|
|
70003
|
-
output_manager_default.print(
|
|
70068
|
+
output_manager_default.print(import_chalk248.default.bold(" Events\n\n"));
|
|
70004
70069
|
for (const event of webhook.events) {
|
|
70005
70070
|
output_manager_default.print(` - ${event}
|
|
70006
70071
|
`);
|
|
70007
70072
|
}
|
|
70008
70073
|
if (webhook.projectIds && webhook.projectIds.length > 0) {
|
|
70009
70074
|
output_manager_default.print("\n");
|
|
70010
|
-
output_manager_default.print(
|
|
70075
|
+
output_manager_default.print(import_chalk248.default.bold(" Projects\n\n"));
|
|
70011
70076
|
if (webhook.projectsMetadata && webhook.projectsMetadata.length > 0) {
|
|
70012
70077
|
for (const project of webhook.projectsMetadata) {
|
|
70013
70078
|
output_manager_default.print(` - ${project.name} (${project.id})
|
|
@@ -70026,7 +70091,7 @@ async function get4(client, argv) {
|
|
|
70026
70091
|
}
|
|
70027
70092
|
|
|
70028
70093
|
// src/commands/webhooks/create.ts
|
|
70029
|
-
var
|
|
70094
|
+
var import_chalk249 = __toESM(require_source(), 1);
|
|
70030
70095
|
|
|
70031
70096
|
// src/util/webhooks/create-webhook.ts
|
|
70032
70097
|
async function createWebhook(client, payload) {
|
|
@@ -70246,7 +70311,7 @@ async function create5(client, argv) {
|
|
|
70246
70311
|
const { contextName } = await getScope(client);
|
|
70247
70312
|
const createStamp = stamp_default();
|
|
70248
70313
|
if (!client.nonInteractive) {
|
|
70249
|
-
output_manager_default.spinner(`Creating webhook under ${
|
|
70314
|
+
output_manager_default.spinner(`Creating webhook under ${import_chalk249.default.bold(contextName)}`);
|
|
70250
70315
|
}
|
|
70251
70316
|
try {
|
|
70252
70317
|
const webhook = await createWebhook(client, {
|
|
@@ -70279,27 +70344,27 @@ async function create5(client, argv) {
|
|
|
70279
70344
|
}
|
|
70280
70345
|
output_manager_default.stopSpinner();
|
|
70281
70346
|
output_manager_default.success(
|
|
70282
|
-
`Webhook created: ${
|
|
70347
|
+
`Webhook created: ${import_chalk249.default.bold(webhook.id)} ${createStamp()}`
|
|
70283
70348
|
);
|
|
70284
70349
|
output_manager_default.print("\n");
|
|
70285
|
-
output_manager_default.print(
|
|
70286
|
-
output_manager_default.print(` ${
|
|
70350
|
+
output_manager_default.print(import_chalk249.default.bold(" Webhook Details\n\n"));
|
|
70351
|
+
output_manager_default.print(` ${import_chalk249.default.cyan("ID".padEnd(10))}${webhook.id}
|
|
70287
70352
|
`);
|
|
70288
|
-
output_manager_default.print(` ${
|
|
70353
|
+
output_manager_default.print(` ${import_chalk249.default.cyan("URL".padEnd(10))}${webhook.url}
|
|
70289
70354
|
`);
|
|
70290
70355
|
output_manager_default.print(
|
|
70291
|
-
` ${
|
|
70356
|
+
` ${import_chalk249.default.cyan("Events".padEnd(10))}${webhook.events.join(", ")}
|
|
70292
70357
|
`
|
|
70293
70358
|
);
|
|
70294
70359
|
if (webhook.projectIds && webhook.projectIds.length > 0) {
|
|
70295
70360
|
output_manager_default.print(
|
|
70296
|
-
` ${
|
|
70361
|
+
` ${import_chalk249.default.cyan("Projects".padEnd(10))}${webhook.projectIds.join(", ")}
|
|
70297
70362
|
`
|
|
70298
70363
|
);
|
|
70299
70364
|
}
|
|
70300
70365
|
output_manager_default.print("\n");
|
|
70301
70366
|
output_manager_default.warn(
|
|
70302
|
-
`Save this secret - it will not be shown again: ${
|
|
70367
|
+
`Save this secret - it will not be shown again: ${import_chalk249.default.bold(webhook.secret)}`
|
|
70303
70368
|
);
|
|
70304
70369
|
output_manager_default.print("\n");
|
|
70305
70370
|
return 0;
|
|
@@ -70357,7 +70422,7 @@ function buildCreateCommandWithEventPlaceholder(fullArgv, url) {
|
|
|
70357
70422
|
}
|
|
70358
70423
|
|
|
70359
70424
|
// src/commands/webhooks/rm.ts
|
|
70360
|
-
var
|
|
70425
|
+
var import_chalk250 = __toESM(require_source(), 1);
|
|
70361
70426
|
|
|
70362
70427
|
// src/util/webhooks/delete-webhook.ts
|
|
70363
70428
|
async function deleteWebhook(client, webhookId) {
|
|
@@ -70452,7 +70517,7 @@ async function rm10(client, argv) {
|
|
|
70452
70517
|
const { contextName } = await getScope(client);
|
|
70453
70518
|
if (args.length !== 1) {
|
|
70454
70519
|
output_manager_default.error(
|
|
70455
|
-
`Invalid number of arguments. Usage: ${
|
|
70520
|
+
`Invalid number of arguments. Usage: ${import_chalk250.default.cyan(
|
|
70456
70521
|
`${getCommandName("webhooks rm <id>")}`
|
|
70457
70522
|
)}`
|
|
70458
70523
|
);
|
|
@@ -70503,7 +70568,7 @@ async function rm10(client, argv) {
|
|
|
70503
70568
|
}
|
|
70504
70569
|
const removeStamp = stamp_default();
|
|
70505
70570
|
if (!client.nonInteractive) {
|
|
70506
|
-
output_manager_default.spinner(`Removing webhook under ${
|
|
70571
|
+
output_manager_default.spinner(`Removing webhook under ${import_chalk250.default.bold(contextName)}`);
|
|
70507
70572
|
}
|
|
70508
70573
|
try {
|
|
70509
70574
|
await deleteWebhook(client, webhookId);
|
|
@@ -70523,7 +70588,7 @@ async function rm10(client, argv) {
|
|
|
70523
70588
|
);
|
|
70524
70589
|
return 0;
|
|
70525
70590
|
}
|
|
70526
|
-
output_manager_default.success(`Webhook ${
|
|
70591
|
+
output_manager_default.success(`Webhook ${import_chalk250.default.bold(webhookId)} removed ${removeStamp()}`);
|
|
70527
70592
|
return 0;
|
|
70528
70593
|
} catch (err) {
|
|
70529
70594
|
output_manager_default.stopSpinner();
|
|
@@ -70583,7 +70648,7 @@ var WebhooksTelemetryClient = class extends TelemetryClient {
|
|
|
70583
70648
|
};
|
|
70584
70649
|
|
|
70585
70650
|
// src/commands/webhooks/index.ts
|
|
70586
|
-
var
|
|
70651
|
+
var COMMAND_CONFIG53 = {
|
|
70587
70652
|
create: ["create", "add"],
|
|
70588
70653
|
get: ["get", "inspect"],
|
|
70589
70654
|
ls: ["ls", "list"],
|
|
@@ -70607,7 +70672,7 @@ async function main29(client) {
|
|
|
70607
70672
|
});
|
|
70608
70673
|
const { subcommand, args, subcommandOriginal } = getSubcommand5(
|
|
70609
70674
|
parsedArgs.args.slice(1),
|
|
70610
|
-
|
|
70675
|
+
COMMAND_CONFIG53
|
|
70611
70676
|
);
|
|
70612
70677
|
const needHelp = parsedArgs.flags["--help"];
|
|
70613
70678
|
if (!subcommand && needHelp) {
|
|
@@ -70646,7 +70711,7 @@ async function main29(client) {
|
|
|
70646
70711
|
default:
|
|
70647
70712
|
if (needHelp) {
|
|
70648
70713
|
telemetry2.trackCliFlagHelp("webhooks", subcommandOriginal);
|
|
70649
|
-
return printHelp(
|
|
70714
|
+
return printHelp(listSubcommand24);
|
|
70650
70715
|
}
|
|
70651
70716
|
telemetry2.trackCliSubcommandList(subcommandOriginal);
|
|
70652
70717
|
return ls9(client, args);
|
|
@@ -70654,7 +70719,7 @@ async function main29(client) {
|
|
|
70654
70719
|
}
|
|
70655
70720
|
|
|
70656
70721
|
// src/commands/whoami/index.ts
|
|
70657
|
-
var
|
|
70722
|
+
var import_chalk251 = __toESM(require_source(), 1);
|
|
70658
70723
|
|
|
70659
70724
|
// src/util/telemetry/commands/whoami/index.ts
|
|
70660
70725
|
var WhoamiTelemetryClient = class extends TelemetryClient {
|
|
@@ -70711,21 +70776,21 @@ async function whoami(client) {
|
|
|
70711
70776
|
client.stdout.write(`${JSON.stringify(jsonOutput, null, 2)}
|
|
70712
70777
|
`);
|
|
70713
70778
|
} else if (client.stdout.isTTY) {
|
|
70714
|
-
output_manager_default.log(`Logged in as ${
|
|
70779
|
+
output_manager_default.log(`Logged in as ${import_chalk251.default.bold(formatUsername(scope))}`);
|
|
70715
70780
|
if (team) {
|
|
70716
70781
|
output_manager_default.log(
|
|
70717
|
-
`Active team: ${
|
|
70782
|
+
`Active team: ${import_chalk251.default.bold(team.slug)}${team.name && team.name !== team.slug ? ` (${team.name})` : ""}`
|
|
70718
70783
|
);
|
|
70719
70784
|
} else {
|
|
70720
|
-
output_manager_default.log(`Active team: ${
|
|
70785
|
+
output_manager_default.log(`Active team: ${import_chalk251.default.bold("Personal Account")}`);
|
|
70721
70786
|
}
|
|
70722
70787
|
if (hasLocalOverride) {
|
|
70723
70788
|
const globalLabel = globalTeam ? globalTeam.slug : "Personal Account";
|
|
70724
70789
|
const localLabel = team ? team.slug : "Personal Account";
|
|
70725
70790
|
output_manager_default.log(
|
|
70726
|
-
`${
|
|
70791
|
+
`${import_chalk251.default.yellow("Local override:")} scope is set to ${import_chalk251.default.bold(
|
|
70727
70792
|
localLabel
|
|
70728
|
-
)} by the linked project in this directory (globally selected: ${
|
|
70793
|
+
)} by the linked project in this directory (globally selected: ${import_chalk251.default.bold(
|
|
70729
70794
|
globalLabel
|
|
70730
70795
|
)}).`
|
|
70731
70796
|
);
|
|
@@ -70803,6 +70868,7 @@ export {
|
|
|
70803
70868
|
upgrade,
|
|
70804
70869
|
usage,
|
|
70805
70870
|
vcr,
|
|
70871
|
+
version,
|
|
70806
70872
|
main29 as webhooks,
|
|
70807
70873
|
whoami
|
|
70808
70874
|
};
|