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