vercel 32.0.1 → 32.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +551 -312
- package/package.json +11 -11
package/dist/index.js
CHANGED
@@ -858,7 +858,329 @@ module['exports'] = colors;
|
|
858
858
|
|
859
859
|
/***/ }),
|
860
860
|
|
861
|
-
/***/
|
861
|
+
/***/ 37768:
|
862
|
+
/***/ ((module) => {
|
863
|
+
|
864
|
+
"use strict";
|
865
|
+
|
866
|
+
var __defProp = Object.defineProperty;
|
867
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
868
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
869
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
870
|
+
var __export = (target, all) => {
|
871
|
+
for (var name in all)
|
872
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
873
|
+
};
|
874
|
+
var __copyProps = (to, from, except, desc) => {
|
875
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
876
|
+
for (let key of __getOwnPropNames(from))
|
877
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
878
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
879
|
+
}
|
880
|
+
return to;
|
881
|
+
};
|
882
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
883
|
+
|
884
|
+
// src/index.ts
|
885
|
+
var src_exports = {};
|
886
|
+
__export(src_exports, {
|
887
|
+
RequestCookies: () => RequestCookies,
|
888
|
+
ResponseCookies: () => ResponseCookies,
|
889
|
+
parseCookie: () => parseCookie,
|
890
|
+
parseSetCookie: () => parseSetCookie,
|
891
|
+
splitCookiesString: () => splitCookiesString,
|
892
|
+
stringifyCookie: () => stringifyCookie
|
893
|
+
});
|
894
|
+
module.exports = __toCommonJS(src_exports);
|
895
|
+
|
896
|
+
// src/serialize.ts
|
897
|
+
function stringifyCookie(c) {
|
898
|
+
var _a;
|
899
|
+
const attrs = [
|
900
|
+
"path" in c && c.path && `Path=${c.path}`,
|
901
|
+
"expires" in c && (c.expires || c.expires === 0) && `Expires=${(typeof c.expires === "number" ? new Date(c.expires) : c.expires).toUTCString()}`,
|
902
|
+
"maxAge" in c && typeof c.maxAge === "number" && `Max-Age=${c.maxAge}`,
|
903
|
+
"domain" in c && c.domain && `Domain=${c.domain}`,
|
904
|
+
"secure" in c && c.secure && "Secure",
|
905
|
+
"httpOnly" in c && c.httpOnly && "HttpOnly",
|
906
|
+
"sameSite" in c && c.sameSite && `SameSite=${c.sameSite}`
|
907
|
+
].filter(Boolean);
|
908
|
+
return `${c.name}=${encodeURIComponent((_a = c.value) != null ? _a : "")}; ${attrs.join("; ")}`;
|
909
|
+
}
|
910
|
+
function parseCookie(cookie) {
|
911
|
+
const map = /* @__PURE__ */ new Map();
|
912
|
+
for (const pair of cookie.split(/; */)) {
|
913
|
+
if (!pair)
|
914
|
+
continue;
|
915
|
+
const splitAt = pair.indexOf("=");
|
916
|
+
if (splitAt === -1) {
|
917
|
+
map.set(pair, "true");
|
918
|
+
continue;
|
919
|
+
}
|
920
|
+
const [key, value] = [pair.slice(0, splitAt), pair.slice(splitAt + 1)];
|
921
|
+
try {
|
922
|
+
map.set(key, decodeURIComponent(value != null ? value : "true"));
|
923
|
+
} catch {
|
924
|
+
}
|
925
|
+
}
|
926
|
+
return map;
|
927
|
+
}
|
928
|
+
function parseSetCookie(setCookie) {
|
929
|
+
if (!setCookie) {
|
930
|
+
return void 0;
|
931
|
+
}
|
932
|
+
const [[name, value], ...attributes] = parseCookie(setCookie);
|
933
|
+
const { domain, expires, httponly, maxage, path, samesite, secure } = Object.fromEntries(
|
934
|
+
attributes.map(([key, value2]) => [key.toLowerCase(), value2])
|
935
|
+
);
|
936
|
+
const cookie = {
|
937
|
+
name,
|
938
|
+
value: decodeURIComponent(value),
|
939
|
+
domain,
|
940
|
+
...expires && { expires: new Date(expires) },
|
941
|
+
...httponly && { httpOnly: true },
|
942
|
+
...typeof maxage === "string" && { maxAge: Number(maxage) },
|
943
|
+
path,
|
944
|
+
...samesite && { sameSite: parseSameSite(samesite) },
|
945
|
+
...secure && { secure: true }
|
946
|
+
};
|
947
|
+
return compact(cookie);
|
948
|
+
}
|
949
|
+
function compact(t) {
|
950
|
+
const newT = {};
|
951
|
+
for (const key in t) {
|
952
|
+
if (t[key]) {
|
953
|
+
newT[key] = t[key];
|
954
|
+
}
|
955
|
+
}
|
956
|
+
return newT;
|
957
|
+
}
|
958
|
+
var SAME_SITE = ["strict", "lax", "none"];
|
959
|
+
function parseSameSite(string) {
|
960
|
+
string = string.toLowerCase();
|
961
|
+
return SAME_SITE.includes(string) ? string : void 0;
|
962
|
+
}
|
963
|
+
function splitCookiesString(cookiesString) {
|
964
|
+
if (!cookiesString)
|
965
|
+
return [];
|
966
|
+
var cookiesStrings = [];
|
967
|
+
var pos = 0;
|
968
|
+
var start;
|
969
|
+
var ch;
|
970
|
+
var lastComma;
|
971
|
+
var nextStart;
|
972
|
+
var cookiesSeparatorFound;
|
973
|
+
function skipWhitespace() {
|
974
|
+
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
|
975
|
+
pos += 1;
|
976
|
+
}
|
977
|
+
return pos < cookiesString.length;
|
978
|
+
}
|
979
|
+
function notSpecialChar() {
|
980
|
+
ch = cookiesString.charAt(pos);
|
981
|
+
return ch !== "=" && ch !== ";" && ch !== ",";
|
982
|
+
}
|
983
|
+
while (pos < cookiesString.length) {
|
984
|
+
start = pos;
|
985
|
+
cookiesSeparatorFound = false;
|
986
|
+
while (skipWhitespace()) {
|
987
|
+
ch = cookiesString.charAt(pos);
|
988
|
+
if (ch === ",") {
|
989
|
+
lastComma = pos;
|
990
|
+
pos += 1;
|
991
|
+
skipWhitespace();
|
992
|
+
nextStart = pos;
|
993
|
+
while (pos < cookiesString.length && notSpecialChar()) {
|
994
|
+
pos += 1;
|
995
|
+
}
|
996
|
+
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
|
997
|
+
cookiesSeparatorFound = true;
|
998
|
+
pos = nextStart;
|
999
|
+
cookiesStrings.push(cookiesString.substring(start, lastComma));
|
1000
|
+
start = pos;
|
1001
|
+
} else {
|
1002
|
+
pos = lastComma + 1;
|
1003
|
+
}
|
1004
|
+
} else {
|
1005
|
+
pos += 1;
|
1006
|
+
}
|
1007
|
+
}
|
1008
|
+
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
|
1009
|
+
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
|
1010
|
+
}
|
1011
|
+
}
|
1012
|
+
return cookiesStrings;
|
1013
|
+
}
|
1014
|
+
|
1015
|
+
// src/request-cookies.ts
|
1016
|
+
var RequestCookies = class {
|
1017
|
+
constructor(requestHeaders) {
|
1018
|
+
/** @internal */
|
1019
|
+
this._parsed = /* @__PURE__ */ new Map();
|
1020
|
+
this._headers = requestHeaders;
|
1021
|
+
const header = requestHeaders.get("cookie");
|
1022
|
+
if (header) {
|
1023
|
+
const parsed = parseCookie(header);
|
1024
|
+
for (const [name, value] of parsed) {
|
1025
|
+
this._parsed.set(name, { name, value });
|
1026
|
+
}
|
1027
|
+
}
|
1028
|
+
}
|
1029
|
+
[Symbol.iterator]() {
|
1030
|
+
return this._parsed[Symbol.iterator]();
|
1031
|
+
}
|
1032
|
+
/**
|
1033
|
+
* The amount of cookies received from the client
|
1034
|
+
*/
|
1035
|
+
get size() {
|
1036
|
+
return this._parsed.size;
|
1037
|
+
}
|
1038
|
+
get(...args) {
|
1039
|
+
const name = typeof args[0] === "string" ? args[0] : args[0].name;
|
1040
|
+
return this._parsed.get(name);
|
1041
|
+
}
|
1042
|
+
getAll(...args) {
|
1043
|
+
var _a;
|
1044
|
+
const all = Array.from(this._parsed);
|
1045
|
+
if (!args.length) {
|
1046
|
+
return all.map(([_, value]) => value);
|
1047
|
+
}
|
1048
|
+
const name = typeof args[0] === "string" ? args[0] : (_a = args[0]) == null ? void 0 : _a.name;
|
1049
|
+
return all.filter(([n]) => n === name).map(([_, value]) => value);
|
1050
|
+
}
|
1051
|
+
has(name) {
|
1052
|
+
return this._parsed.has(name);
|
1053
|
+
}
|
1054
|
+
set(...args) {
|
1055
|
+
const [name, value] = args.length === 1 ? [args[0].name, args[0].value] : args;
|
1056
|
+
const map = this._parsed;
|
1057
|
+
map.set(name, { name, value });
|
1058
|
+
this._headers.set(
|
1059
|
+
"cookie",
|
1060
|
+
Array.from(map).map(([_, value2]) => stringifyCookie(value2)).join("; ")
|
1061
|
+
);
|
1062
|
+
return this;
|
1063
|
+
}
|
1064
|
+
/**
|
1065
|
+
* Delete the cookies matching the passed name or names in the request.
|
1066
|
+
*/
|
1067
|
+
delete(names) {
|
1068
|
+
const map = this._parsed;
|
1069
|
+
const result = !Array.isArray(names) ? map.delete(names) : names.map((name) => map.delete(name));
|
1070
|
+
this._headers.set(
|
1071
|
+
"cookie",
|
1072
|
+
Array.from(map).map(([_, value]) => stringifyCookie(value)).join("; ")
|
1073
|
+
);
|
1074
|
+
return result;
|
1075
|
+
}
|
1076
|
+
/**
|
1077
|
+
* Delete all the cookies in the cookies in the request.
|
1078
|
+
*/
|
1079
|
+
clear() {
|
1080
|
+
this.delete(Array.from(this._parsed.keys()));
|
1081
|
+
return this;
|
1082
|
+
}
|
1083
|
+
/**
|
1084
|
+
* Format the cookies in the request as a string for logging
|
1085
|
+
*/
|
1086
|
+
[Symbol.for("edge-runtime.inspect.custom")]() {
|
1087
|
+
return `RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;
|
1088
|
+
}
|
1089
|
+
toString() {
|
1090
|
+
return [...this._parsed.values()].map((v) => `${v.name}=${encodeURIComponent(v.value)}`).join("; ");
|
1091
|
+
}
|
1092
|
+
};
|
1093
|
+
|
1094
|
+
// src/response-cookies.ts
|
1095
|
+
var ResponseCookies = class {
|
1096
|
+
constructor(responseHeaders) {
|
1097
|
+
/** @internal */
|
1098
|
+
this._parsed = /* @__PURE__ */ new Map();
|
1099
|
+
var _a, _b, _c;
|
1100
|
+
this._headers = responseHeaders;
|
1101
|
+
const setCookie = (
|
1102
|
+
// @ts-expect-error See https://github.com/whatwg/fetch/issues/973
|
1103
|
+
(_c = (_b = (_a = responseHeaders.getAll) == null ? void 0 : _a.call(responseHeaders, "set-cookie")) != null ? _b : responseHeaders.get("set-cookie")) != null ? _c : []
|
1104
|
+
);
|
1105
|
+
const cookieStrings = Array.isArray(setCookie) ? setCookie : splitCookiesString(setCookie);
|
1106
|
+
for (const cookieString of cookieStrings) {
|
1107
|
+
const parsed = parseSetCookie(cookieString);
|
1108
|
+
if (parsed)
|
1109
|
+
this._parsed.set(parsed.name, parsed);
|
1110
|
+
}
|
1111
|
+
}
|
1112
|
+
/**
|
1113
|
+
* {@link https://wicg.github.io/cookie-store/#CookieStore-get CookieStore#get} without the Promise.
|
1114
|
+
*/
|
1115
|
+
get(...args) {
|
1116
|
+
const key = typeof args[0] === "string" ? args[0] : args[0].name;
|
1117
|
+
return this._parsed.get(key);
|
1118
|
+
}
|
1119
|
+
/**
|
1120
|
+
* {@link https://wicg.github.io/cookie-store/#CookieStore-getAll CookieStore#getAll} without the Promise.
|
1121
|
+
*/
|
1122
|
+
getAll(...args) {
|
1123
|
+
var _a;
|
1124
|
+
const all = Array.from(this._parsed.values());
|
1125
|
+
if (!args.length) {
|
1126
|
+
return all;
|
1127
|
+
}
|
1128
|
+
const key = typeof args[0] === "string" ? args[0] : (_a = args[0]) == null ? void 0 : _a.name;
|
1129
|
+
return all.filter((c) => c.name === key);
|
1130
|
+
}
|
1131
|
+
has(name) {
|
1132
|
+
return this._parsed.has(name);
|
1133
|
+
}
|
1134
|
+
/**
|
1135
|
+
* {@link https://wicg.github.io/cookie-store/#CookieStore-set CookieStore#set} without the Promise.
|
1136
|
+
*/
|
1137
|
+
set(...args) {
|
1138
|
+
const [name, value, cookie] = args.length === 1 ? [args[0].name, args[0].value, args[0]] : args;
|
1139
|
+
const map = this._parsed;
|
1140
|
+
map.set(name, normalizeCookie({ name, value, ...cookie }));
|
1141
|
+
replace(map, this._headers);
|
1142
|
+
return this;
|
1143
|
+
}
|
1144
|
+
/**
|
1145
|
+
* {@link https://wicg.github.io/cookie-store/#CookieStore-delete CookieStore#delete} without the Promise.
|
1146
|
+
*/
|
1147
|
+
delete(...args) {
|
1148
|
+
const [name, path, domain] = typeof args[0] === "string" ? [args[0]] : [args[0].name, args[0].path, args[0].domain];
|
1149
|
+
return this.set({ name, path, domain, value: "", expires: /* @__PURE__ */ new Date(0) });
|
1150
|
+
}
|
1151
|
+
[Symbol.for("edge-runtime.inspect.custom")]() {
|
1152
|
+
return `ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;
|
1153
|
+
}
|
1154
|
+
toString() {
|
1155
|
+
return [...this._parsed.values()].map(stringifyCookie).join("; ");
|
1156
|
+
}
|
1157
|
+
};
|
1158
|
+
function replace(bag, headers) {
|
1159
|
+
headers.delete("set-cookie");
|
1160
|
+
for (const [, value] of bag) {
|
1161
|
+
const serialized = stringifyCookie(value);
|
1162
|
+
headers.append("set-cookie", serialized);
|
1163
|
+
}
|
1164
|
+
}
|
1165
|
+
function normalizeCookie(cookie = { name: "", value: "" }) {
|
1166
|
+
if (typeof cookie.expires === "number") {
|
1167
|
+
cookie.expires = new Date(cookie.expires);
|
1168
|
+
}
|
1169
|
+
if (cookie.maxAge) {
|
1170
|
+
cookie.expires = new Date(Date.now() + cookie.maxAge * 1e3);
|
1171
|
+
}
|
1172
|
+
if (cookie.path === null || cookie.path === void 0) {
|
1173
|
+
cookie.path = "/";
|
1174
|
+
}
|
1175
|
+
return cookie;
|
1176
|
+
}
|
1177
|
+
// Annotate the CommonJS export names for ESM import in node:
|
1178
|
+
0 && (0);
|
1179
|
+
|
1180
|
+
|
1181
|
+
/***/ }),
|
1182
|
+
|
1183
|
+
/***/ 95549:
|
862
1184
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
863
1185
|
|
864
1186
|
"use strict";
|
@@ -978,6 +1300,7 @@ function computeOrigin({ headers }, defaultOrigin) {
|
|
978
1300
|
}
|
979
1301
|
|
980
1302
|
// src/edge-to-node/headers.ts
|
1303
|
+
var import_cookies = __webpack_require__(37768);
|
981
1304
|
function toOutgoingHeaders(headers) {
|
982
1305
|
var _a, _b;
|
983
1306
|
const outputHeaders = {};
|
@@ -985,7 +1308,7 @@ function toOutgoingHeaders(headers) {
|
|
985
1308
|
for (const [name, value] of typeof headers.raw !== "undefined" ? Object.entries(headers.raw()) : headers.entries()) {
|
986
1309
|
outputHeaders[name] = value;
|
987
1310
|
if (name.toLowerCase() === "set-cookie") {
|
988
|
-
outputHeaders[name] = (_b = (_a = headers.getAll) == null ? void 0 : _a.call(headers, "set-cookie")) != null ? _b : splitCookiesString(value);
|
1311
|
+
outputHeaders[name] = (_b = (_a = headers.getAll) == null ? void 0 : _a.call(headers, "set-cookie")) != null ? _b : (0, import_cookies.splitCookiesString)(value);
|
989
1312
|
}
|
990
1313
|
}
|
991
1314
|
}
|
@@ -998,55 +1321,6 @@ function mergeIntoServerResponse(headers, serverResponse) {
|
|
998
1321
|
}
|
999
1322
|
}
|
1000
1323
|
}
|
1001
|
-
function splitCookiesString(cookiesString) {
|
1002
|
-
var cookiesStrings = [];
|
1003
|
-
var pos = 0;
|
1004
|
-
var start;
|
1005
|
-
var ch;
|
1006
|
-
var lastComma;
|
1007
|
-
var nextStart;
|
1008
|
-
var cookiesSeparatorFound;
|
1009
|
-
function skipWhitespace() {
|
1010
|
-
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
|
1011
|
-
pos += 1;
|
1012
|
-
}
|
1013
|
-
return pos < cookiesString.length;
|
1014
|
-
}
|
1015
|
-
function notSpecialChar() {
|
1016
|
-
ch = cookiesString.charAt(pos);
|
1017
|
-
return ch !== "=" && ch !== ";" && ch !== ",";
|
1018
|
-
}
|
1019
|
-
while (pos < cookiesString.length) {
|
1020
|
-
start = pos;
|
1021
|
-
cookiesSeparatorFound = false;
|
1022
|
-
while (skipWhitespace()) {
|
1023
|
-
ch = cookiesString.charAt(pos);
|
1024
|
-
if (ch === ",") {
|
1025
|
-
lastComma = pos;
|
1026
|
-
pos += 1;
|
1027
|
-
skipWhitespace();
|
1028
|
-
nextStart = pos;
|
1029
|
-
while (pos < cookiesString.length && notSpecialChar()) {
|
1030
|
-
pos += 1;
|
1031
|
-
}
|
1032
|
-
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
|
1033
|
-
cookiesSeparatorFound = true;
|
1034
|
-
pos = nextStart;
|
1035
|
-
cookiesStrings.push(cookiesString.substring(start, lastComma));
|
1036
|
-
start = pos;
|
1037
|
-
} else {
|
1038
|
-
pos = lastComma + 1;
|
1039
|
-
}
|
1040
|
-
} else {
|
1041
|
-
pos += 1;
|
1042
|
-
}
|
1043
|
-
}
|
1044
|
-
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
|
1045
|
-
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
|
1046
|
-
}
|
1047
|
-
}
|
1048
|
-
return cookiesStrings;
|
1049
|
-
}
|
1050
1324
|
|
1051
1325
|
// src/edge-to-node/stream.ts
|
1052
1326
|
var import_node_stream = __webpack_require__(92413);
|
@@ -110227,6 +110501,52 @@ module.exports = new Type('tag:yaml.org,2002:timestamp', {
|
|
110227
110501
|
}).call(this);
|
110228
110502
|
|
110229
110503
|
|
110504
|
+
/***/ }),
|
110505
|
+
|
110506
|
+
/***/ 43144:
|
110507
|
+
/***/ ((module) => {
|
110508
|
+
|
110509
|
+
"use strict";
|
110510
|
+
|
110511
|
+
|
110512
|
+
module.exports = parseJson
|
110513
|
+
function parseJson (txt, reviver, context) {
|
110514
|
+
context = context || 20
|
110515
|
+
try {
|
110516
|
+
return JSON.parse(txt, reviver)
|
110517
|
+
} catch (e) {
|
110518
|
+
if (typeof txt !== 'string') {
|
110519
|
+
const isEmptyArray = Array.isArray(txt) && txt.length === 0
|
110520
|
+
const errorMessage = 'Cannot parse ' +
|
110521
|
+
(isEmptyArray ? 'an empty array' : String(txt))
|
110522
|
+
throw new TypeError(errorMessage)
|
110523
|
+
}
|
110524
|
+
const syntaxErr = e.message.match(/^Unexpected token.*position\s+(\d+)/i)
|
110525
|
+
const errIdx = syntaxErr
|
110526
|
+
? +syntaxErr[1]
|
110527
|
+
: e.message.match(/^Unexpected end of JSON.*/i)
|
110528
|
+
? txt.length - 1
|
110529
|
+
: null
|
110530
|
+
if (errIdx != null) {
|
110531
|
+
const start = errIdx <= context
|
110532
|
+
? 0
|
110533
|
+
: errIdx - context
|
110534
|
+
const end = errIdx + context >= txt.length
|
110535
|
+
? txt.length
|
110536
|
+
: errIdx + context
|
110537
|
+
e.message += ` while parsing near '${
|
110538
|
+
start === 0 ? '' : '...'
|
110539
|
+
}${txt.slice(start, end)}${
|
110540
|
+
end === txt.length ? '' : '...'
|
110541
|
+
}'`
|
110542
|
+
} else {
|
110543
|
+
e.message += ` while parsing '${txt.slice(0, context * 2)}'`
|
110544
|
+
}
|
110545
|
+
throw e
|
110546
|
+
}
|
110547
|
+
}
|
110548
|
+
|
110549
|
+
|
110230
110550
|
/***/ }),
|
110231
110551
|
|
110232
110552
|
/***/ 8933:
|
@@ -138376,132 +138696,6 @@ mkdirP.sync = function sync (p, opts, made) {
|
|
138376
138696
|
};
|
138377
138697
|
|
138378
138698
|
|
138379
|
-
/***/ }),
|
138380
|
-
|
138381
|
-
/***/ 14362:
|
138382
|
-
/***/ ((module) => {
|
138383
|
-
|
138384
|
-
function toArr(any) {
|
138385
|
-
return any == null ? [] : Array.isArray(any) ? any : [any];
|
138386
|
-
}
|
138387
|
-
|
138388
|
-
function toVal(out, key, val, opts) {
|
138389
|
-
var x, old=out[key], nxt=(
|
138390
|
-
!!~opts.string.indexOf(key) ? (val == null || val === true ? '' : String(val))
|
138391
|
-
: typeof val === 'boolean' ? val
|
138392
|
-
: !!~opts.boolean.indexOf(key) ? (val === 'false' ? false : val === 'true' || (out._.push((x = +val,x * 0 === 0) ? x : val),!!val))
|
138393
|
-
: (x = +val,x * 0 === 0) ? x : val
|
138394
|
-
);
|
138395
|
-
out[key] = old == null ? nxt : (Array.isArray(old) ? old.concat(nxt) : [old, nxt]);
|
138396
|
-
}
|
138397
|
-
|
138398
|
-
module.exports = function (args, opts) {
|
138399
|
-
args = args || [];
|
138400
|
-
opts = opts || {};
|
138401
|
-
|
138402
|
-
var k, arr, arg, name, val, out={ _:[] };
|
138403
|
-
var i=0, j=0, idx=0, len=args.length;
|
138404
|
-
|
138405
|
-
const alibi = opts.alias !== void 0;
|
138406
|
-
const strict = opts.unknown !== void 0;
|
138407
|
-
const defaults = opts.default !== void 0;
|
138408
|
-
|
138409
|
-
opts.alias = opts.alias || {};
|
138410
|
-
opts.string = toArr(opts.string);
|
138411
|
-
opts.boolean = toArr(opts.boolean);
|
138412
|
-
|
138413
|
-
if (alibi) {
|
138414
|
-
for (k in opts.alias) {
|
138415
|
-
arr = opts.alias[k] = toArr(opts.alias[k]);
|
138416
|
-
for (i=0; i < arr.length; i++) {
|
138417
|
-
(opts.alias[arr[i]] = arr.concat(k)).splice(i, 1);
|
138418
|
-
}
|
138419
|
-
}
|
138420
|
-
}
|
138421
|
-
|
138422
|
-
for (i=opts.boolean.length; i-- > 0;) {
|
138423
|
-
arr = opts.alias[opts.boolean[i]] || [];
|
138424
|
-
for (j=arr.length; j-- > 0;) opts.boolean.push(arr[j]);
|
138425
|
-
}
|
138426
|
-
|
138427
|
-
for (i=opts.string.length; i-- > 0;) {
|
138428
|
-
arr = opts.alias[opts.string[i]] || [];
|
138429
|
-
for (j=arr.length; j-- > 0;) opts.string.push(arr[j]);
|
138430
|
-
}
|
138431
|
-
|
138432
|
-
if (defaults) {
|
138433
|
-
for (k in opts.default) {
|
138434
|
-
name = typeof opts.default[k];
|
138435
|
-
arr = opts.alias[k] = opts.alias[k] || [];
|
138436
|
-
if (opts[name] !== void 0) {
|
138437
|
-
opts[name].push(k);
|
138438
|
-
for (i=0; i < arr.length; i++) {
|
138439
|
-
opts[name].push(arr[i]);
|
138440
|
-
}
|
138441
|
-
}
|
138442
|
-
}
|
138443
|
-
}
|
138444
|
-
|
138445
|
-
const keys = strict ? Object.keys(opts.alias) : [];
|
138446
|
-
|
138447
|
-
for (i=0; i < len; i++) {
|
138448
|
-
arg = args[i];
|
138449
|
-
|
138450
|
-
if (arg === '--') {
|
138451
|
-
out._ = out._.concat(args.slice(++i));
|
138452
|
-
break;
|
138453
|
-
}
|
138454
|
-
|
138455
|
-
for (j=0; j < arg.length; j++) {
|
138456
|
-
if (arg.charCodeAt(j) !== 45) break; // "-"
|
138457
|
-
}
|
138458
|
-
|
138459
|
-
if (j === 0) {
|
138460
|
-
out._.push(arg);
|
138461
|
-
} else if (arg.substring(j, j + 3) === 'no-') {
|
138462
|
-
name = arg.substring(j + 3);
|
138463
|
-
if (strict && !~keys.indexOf(name)) {
|
138464
|
-
return opts.unknown(arg);
|
138465
|
-
}
|
138466
|
-
out[name] = false;
|
138467
|
-
} else {
|
138468
|
-
for (idx=j+1; idx < arg.length; idx++) {
|
138469
|
-
if (arg.charCodeAt(idx) === 61) break; // "="
|
138470
|
-
}
|
138471
|
-
|
138472
|
-
name = arg.substring(j, idx);
|
138473
|
-
val = arg.substring(++idx) || (i+1 === len || (''+args[i+1]).charCodeAt(0) === 45 || args[++i]);
|
138474
|
-
arr = (j === 2 ? [name] : name);
|
138475
|
-
|
138476
|
-
for (idx=0; idx < arr.length; idx++) {
|
138477
|
-
name = arr[idx];
|
138478
|
-
if (strict && !~keys.indexOf(name)) return opts.unknown('-'.repeat(j) + name);
|
138479
|
-
toVal(out, name, (idx + 1 < arr.length) || val, opts);
|
138480
|
-
}
|
138481
|
-
}
|
138482
|
-
}
|
138483
|
-
|
138484
|
-
if (defaults) {
|
138485
|
-
for (k in opts.default) {
|
138486
|
-
if (out[k] === void 0) {
|
138487
|
-
out[k] = opts.default[k];
|
138488
|
-
}
|
138489
|
-
}
|
138490
|
-
}
|
138491
|
-
|
138492
|
-
if (alibi) {
|
138493
|
-
for (k in out) {
|
138494
|
-
arr = opts.alias[k] || [];
|
138495
|
-
while (arr.length > 0) {
|
138496
|
-
out[arr.shift()] = out[k];
|
138497
|
-
}
|
138498
|
-
}
|
138499
|
-
}
|
138500
|
-
|
138501
|
-
return out;
|
138502
|
-
}
|
138503
|
-
|
138504
|
-
|
138505
138699
|
/***/ }),
|
138506
138700
|
|
138507
138701
|
/***/ 88150:
|
@@ -212408,10 +212602,6 @@ var source_default = /*#__PURE__*/__webpack_require__.n(source);
|
|
212408
212602
|
var text_table = __webpack_require__(43362);
|
212409
212603
|
var text_table_default = /*#__PURE__*/__webpack_require__.n(text_table);
|
212410
212604
|
|
212411
|
-
// EXTERNAL MODULE: ../../node_modules/.pnpm/mri@1.1.5/node_modules/mri/lib/index.js
|
212412
|
-
var lib = __webpack_require__(14362);
|
212413
|
-
var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
|
212414
|
-
|
212415
212605
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js
|
212416
212606
|
var ms = __webpack_require__(21378);
|
212417
212607
|
var ms_default = /*#__PURE__*/__webpack_require__.n(ms);
|
@@ -212571,14 +212761,14 @@ var input_confirm = __webpack_require__(59320);
|
|
212571
212761
|
// EXTERNAL MODULE: ./src/util/get-command-flags.ts
|
212572
212762
|
var get_command_flags = __webpack_require__(98395);
|
212573
212763
|
|
212574
|
-
// EXTERNAL MODULE: ./src/util/get-prefixed-flags.ts
|
212575
|
-
var get_prefixed_flags = __webpack_require__(31354);
|
212576
|
-
|
212577
212764
|
// EXTERNAL MODULE: ./src/util/pkg-name.ts
|
212578
212765
|
var pkg_name = __webpack_require__(79000);
|
212579
212766
|
|
212580
|
-
//
|
212767
|
+
// EXTERNAL MODULE: ./src/util/get-args.ts
|
212768
|
+
var get_args = __webpack_require__(2505);
|
212769
|
+
var get_args_default = /*#__PURE__*/__webpack_require__.n(get_args);
|
212581
212770
|
|
212771
|
+
// CONCATENATED MODULE: ./src/commands/secrets.js
|
212582
212772
|
|
212583
212773
|
|
212584
212774
|
|
@@ -212661,14 +212851,12 @@ let subcommand;
|
|
212661
212851
|
let nextTimestamp;
|
212662
212852
|
|
212663
212853
|
const main = async client => {
|
212664
|
-
argv = (0,
|
212665
|
-
|
212666
|
-
|
212667
|
-
|
212668
|
-
|
212669
|
-
|
212670
|
-
next: 'N',
|
212671
|
-
},
|
212854
|
+
argv = (0,get_args_default())(client.argv.slice(2), {
|
212855
|
+
'--yes': Boolean,
|
212856
|
+
'--next': Number,
|
212857
|
+
'--test-warning': Boolean,
|
212858
|
+
'-y': '--yes',
|
212859
|
+
'-N': '--next',
|
212672
212860
|
});
|
212673
212861
|
|
212674
212862
|
argv._ = argv._.slice(1);
|
@@ -212714,7 +212902,8 @@ async function run({ output, contextName, currentTeam, client }) {
|
|
212714
212902
|
const secrets = new Secrets({ client, currentTeam });
|
212715
212903
|
const args = argv._.slice(1);
|
212716
212904
|
const start = Date.now();
|
212717
|
-
const { 'test-warning': testWarningFlag } = argv;
|
212905
|
+
const { '--test-warning': testWarningFlag } = argv;
|
212906
|
+
|
212718
212907
|
const commandName = (0,pkg_name.getCommandName)('secret ' + subcommand);
|
212719
212908
|
|
212720
212909
|
if (subcommand === 'ls' || subcommand === 'list') {
|
@@ -212770,14 +212959,7 @@ async function run({ output, contextName, currentTeam, client }) {
|
|
212770
212959
|
}
|
212771
212960
|
|
212772
212961
|
if (pagination && pagination.count === 20) {
|
212773
|
-
const
|
212774
|
-
const flags = (0,get_command_flags.default)(prefixedArgs, [
|
212775
|
-
'_',
|
212776
|
-
'--next',
|
212777
|
-
'-N',
|
212778
|
-
'-d',
|
212779
|
-
'-y',
|
212780
|
-
]);
|
212962
|
+
const flags = (0,get_command_flags.default)(argv, ['_', '--next', '-N', '-d', '-y']);
|
212781
212963
|
const nextCmd = `secrets ${subcommand}${flags} --next ${pagination.next}`;
|
212782
212964
|
output.log(`To display the next page run ${(0,pkg_name.getCommandName)(nextCmd)}`);
|
212783
212965
|
}
|
@@ -212805,7 +212987,7 @@ async function run({ output, contextName, currentTeam, client }) {
|
|
212805
212987
|
|
212806
212988
|
if (theSecret) {
|
212807
212989
|
const yes =
|
212808
|
-
argv
|
212990
|
+
argv['--yes'] ||
|
212809
212991
|
(await readConfirmation(client, output, theSecret, contextName));
|
212810
212992
|
if (!yes) {
|
212811
212993
|
output.print(`Canceled. Secret not deleted.\n`);
|
@@ -222782,7 +222964,7 @@ async function main(client) {
|
|
222782
222964
|
if (!vercelConfig || !hasBuilds) {
|
222783
222965
|
const pkg = await (0, read_json_file_1.default)(path_1.default.join(dir, 'package.json'));
|
222784
222966
|
if (pkg instanceof errors_ts_1.CantParseJSONFile) {
|
222785
|
-
client.output.error(
|
222967
|
+
client.output.error(pkg.message);
|
222786
222968
|
return 1;
|
222787
222969
|
}
|
222788
222970
|
if (/\b(now|vercel)\b\W+\bdev\b/.test(pkg?.scripts?.dev || '')) {
|
@@ -222889,6 +223071,150 @@ async function add(client, opts, args) {
|
|
222889
223071
|
exports.default = add;
|
222890
223072
|
|
222891
223073
|
|
223074
|
+
/***/ }),
|
223075
|
+
|
223076
|
+
/***/ 5155:
|
223077
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
223078
|
+
|
223079
|
+
"use strict";
|
223080
|
+
|
223081
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
223082
|
+
exports.dnsCommand = void 0;
|
223083
|
+
const pkg_name_1 = __webpack_require__(79000);
|
223084
|
+
exports.dnsCommand = {
|
223085
|
+
name: 'dns',
|
223086
|
+
description: 'Interact with DNS entries for a project.',
|
223087
|
+
arguments: [
|
223088
|
+
{
|
223089
|
+
name: 'command',
|
223090
|
+
required: true,
|
223091
|
+
},
|
223092
|
+
],
|
223093
|
+
subcommands: [
|
223094
|
+
{
|
223095
|
+
name: 'import',
|
223096
|
+
description: 'Import a DNS zone file (see below for examples)',
|
223097
|
+
arguments: [
|
223098
|
+
{
|
223099
|
+
name: 'domain',
|
223100
|
+
required: true,
|
223101
|
+
},
|
223102
|
+
{
|
223103
|
+
name: 'zonefile',
|
223104
|
+
required: true,
|
223105
|
+
},
|
223106
|
+
],
|
223107
|
+
options: [],
|
223108
|
+
examples: [],
|
223109
|
+
},
|
223110
|
+
{
|
223111
|
+
name: 'ls',
|
223112
|
+
description: 'List all DNS entries for a domain',
|
223113
|
+
arguments: [
|
223114
|
+
{
|
223115
|
+
name: 'domain',
|
223116
|
+
required: true,
|
223117
|
+
},
|
223118
|
+
],
|
223119
|
+
options: [],
|
223120
|
+
examples: [],
|
223121
|
+
},
|
223122
|
+
{
|
223123
|
+
name: 'add',
|
223124
|
+
description: 'Add a new DNS entry (see below for examples)',
|
223125
|
+
arguments: [
|
223126
|
+
{
|
223127
|
+
name: 'details',
|
223128
|
+
required: true,
|
223129
|
+
},
|
223130
|
+
{
|
223131
|
+
name: 'alias',
|
223132
|
+
required: true,
|
223133
|
+
},
|
223134
|
+
],
|
223135
|
+
options: [],
|
223136
|
+
examples: [],
|
223137
|
+
},
|
223138
|
+
{
|
223139
|
+
name: 'rm',
|
223140
|
+
description: 'Remove a DNS entry using its ID',
|
223141
|
+
arguments: [
|
223142
|
+
{
|
223143
|
+
name: 'id',
|
223144
|
+
required: true,
|
223145
|
+
},
|
223146
|
+
],
|
223147
|
+
options: [],
|
223148
|
+
examples: [],
|
223149
|
+
},
|
223150
|
+
],
|
223151
|
+
options: [
|
223152
|
+
{
|
223153
|
+
name: 'next',
|
223154
|
+
description: 'Show next page of results',
|
223155
|
+
argument: 'MS',
|
223156
|
+
shorthand: 'n',
|
223157
|
+
type: 'string',
|
223158
|
+
deprecated: false,
|
223159
|
+
multi: false,
|
223160
|
+
},
|
223161
|
+
{
|
223162
|
+
name: 'limit',
|
223163
|
+
shorthand: 'n',
|
223164
|
+
description: 'Number of results to return per page (default: 20, max: 100)',
|
223165
|
+
argument: 'NUMBER',
|
223166
|
+
type: 'string',
|
223167
|
+
deprecated: false,
|
223168
|
+
multi: false,
|
223169
|
+
},
|
223170
|
+
],
|
223171
|
+
examples: [
|
223172
|
+
{
|
223173
|
+
name: 'Add an A record for a subdomain',
|
223174
|
+
value: [
|
223175
|
+
`${pkg_name_1.packageName} dns add <DOMAIN> <SUBDOMAIN> <A | AAAA | ALIAS | CNAME | TXT> <VALUE>`,
|
223176
|
+
`${pkg_name_1.packageName} dns add zeit.rocks api A 198.51.100.100`,
|
223177
|
+
],
|
223178
|
+
},
|
223179
|
+
{
|
223180
|
+
name: 'Add an MX record (@ as a name refers to the domain)',
|
223181
|
+
value: [
|
223182
|
+
`${pkg_name_1.packageName} dns add <DOMAIN> '@' MX <RECORD VALUE> <PRIORITY>`,
|
223183
|
+
`${pkg_name_1.packageName} dns add zeit.rocks '@' MX mail.zeit.rocks 10`,
|
223184
|
+
],
|
223185
|
+
},
|
223186
|
+
{
|
223187
|
+
name: 'Add an SRV record',
|
223188
|
+
value: [
|
223189
|
+
`${pkg_name_1.packageName} dns add <DOMAIN> <NAME> SRV <PRIORITY> <WEIGHT> <PORT> <TARGET>`,
|
223190
|
+
`${pkg_name_1.packageName} dns add zeit.rocks '@' SRV 10 0 389 zeit.party`,
|
223191
|
+
],
|
223192
|
+
},
|
223193
|
+
{
|
223194
|
+
name: 'Add a CAA record',
|
223195
|
+
value: [
|
223196
|
+
`${pkg_name_1.packageName} dns add <DOMAIN> <NAME> CAA '<FLAGS> <TAG> "<VALUE>"'`,
|
223197
|
+
`${pkg_name_1.packageName} dns add zeit.rocks '@' CAA '0 issue "example.com"'`,
|
223198
|
+
],
|
223199
|
+
},
|
223200
|
+
{
|
223201
|
+
name: 'Import a Zone file',
|
223202
|
+
value: [
|
223203
|
+
`${pkg_name_1.packageName} dns import <DOMAIN> <FILE>`,
|
223204
|
+
`${pkg_name_1.packageName} dns import zeit.rocks ./zonefile.txt`,
|
223205
|
+
],
|
223206
|
+
},
|
223207
|
+
{
|
223208
|
+
name: 'Paginate results, where `1584722256178` is the time in milliseconds since the UNIX epoch.',
|
223209
|
+
value: [
|
223210
|
+
`${pkg_name_1.packageName} dns ls --next 1584722256178`,
|
223211
|
+
`${pkg_name_1.packageName} dns ls zeit.rocks --next 1584722256178`,
|
223212
|
+
],
|
223213
|
+
},
|
223214
|
+
],
|
223215
|
+
};
|
223216
|
+
|
223217
|
+
|
222892
223218
|
/***/ }),
|
222893
223219
|
|
222894
223220
|
/***/ 47626:
|
@@ -222941,78 +223267,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
222941
223267
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
222942
223268
|
};
|
222943
223269
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
222944
|
-
const chalk_1 = __importDefault(__webpack_require__(90877));
|
222945
223270
|
const get_args_1 = __importDefault(__webpack_require__(2505));
|
222946
223271
|
const get_subcommand_1 = __importDefault(__webpack_require__(66167));
|
222947
223272
|
const handle_error_1 = __importDefault(__webpack_require__(64377));
|
222948
|
-
const pkg_name_1 = __webpack_require__(79000);
|
222949
223273
|
const add_1 = __importDefault(__webpack_require__(25169));
|
222950
223274
|
const import_1 = __importDefault(__webpack_require__(47626));
|
222951
223275
|
const ls_1 = __importDefault(__webpack_require__(35789));
|
222952
223276
|
const rm_1 = __importDefault(__webpack_require__(42206));
|
222953
|
-
const
|
222954
|
-
|
222955
|
-
${chalk_1.default.bold(`${pkg_name_1.logo} ${pkg_name_1.packageName} dns`)} [options] <command>
|
222956
|
-
|
222957
|
-
${chalk_1.default.dim('Commands:')}
|
222958
|
-
|
222959
|
-
add [details] Add a new DNS entry (see below for examples)
|
222960
|
-
import [domain] [zonefile] Import a DNS zone file (see below for examples)
|
222961
|
-
rm [id] Remove a DNS entry using its ID
|
222962
|
-
ls [domain] List all DNS entries for a domain
|
222963
|
-
|
222964
|
-
${chalk_1.default.dim('Options:')}
|
222965
|
-
|
222966
|
-
-h, --help Output usage information
|
222967
|
-
-A ${chalk_1.default.bold.underline('FILE')}, --local-config=${chalk_1.default.bold.underline('FILE')} Path to the local ${'`vercel.json`'} file
|
222968
|
-
-Q ${chalk_1.default.bold.underline('DIR')}, --global-config=${chalk_1.default.bold.underline('DIR')} Path to the global ${'`.vercel`'} directory
|
222969
|
-
-d, --debug Debug mode [off]
|
222970
|
-
--no-color No color mode [off]
|
222971
|
-
-t ${chalk_1.default.bold.underline('TOKEN')}, --token=${chalk_1.default.bold.underline('TOKEN')} Login token
|
222972
|
-
-S, --scope Set a custom scope
|
222973
|
-
-N, --next Show next page of results
|
222974
|
-
--limit=${chalk_1.default.bold.underline('VALUE')} Number of results to return per page (default: 20, max: 100)
|
222975
|
-
|
222976
|
-
${chalk_1.default.dim('Examples:')}
|
222977
|
-
|
222978
|
-
${chalk_1.default.gray('–')} Add an A record for a subdomain
|
222979
|
-
|
222980
|
-
${chalk_1.default.cyan(`$ ${pkg_name_1.packageName} dns add <DOMAIN> <SUBDOMAIN> <A | AAAA | ALIAS | CNAME | TXT> <VALUE>`)}
|
222981
|
-
${chalk_1.default.cyan(`$ ${pkg_name_1.packageName} dns add zeit.rocks api A 198.51.100.100`)}
|
222982
|
-
|
222983
|
-
${chalk_1.default.gray('–')} Add an MX record (@ as a name refers to the domain)
|
222984
|
-
|
222985
|
-
${chalk_1.default.cyan(`$ ${pkg_name_1.packageName} dns add <DOMAIN> '@' MX <RECORD VALUE> <PRIORITY>`)}
|
222986
|
-
${chalk_1.default.cyan(`$ ${pkg_name_1.packageName} dns add zeit.rocks '@' MX mail.zeit.rocks 10`)}
|
222987
|
-
|
222988
|
-
${chalk_1.default.gray('–')} Add an SRV record
|
222989
|
-
|
222990
|
-
${chalk_1.default.cyan(`$ ${pkg_name_1.packageName} dns add <DOMAIN> <NAME> SRV <PRIORITY> <WEIGHT> <PORT> <TARGET>`)}
|
222991
|
-
${chalk_1.default.cyan(`$ ${pkg_name_1.packageName} dns add zeit.rocks '@' SRV 10 0 389 zeit.party`)}
|
222992
|
-
|
222993
|
-
${chalk_1.default.gray('–')} Add a CAA record
|
222994
|
-
|
222995
|
-
${chalk_1.default.cyan(`$ ${pkg_name_1.packageName} dns add <DOMAIN> <NAME> CAA '<FLAGS> <TAG> "<VALUE>"'`)}
|
222996
|
-
${chalk_1.default.cyan(`$ ${pkg_name_1.packageName} dns add zeit.rocks '@' CAA '0 issue "example.com"'`)}
|
222997
|
-
|
222998
|
-
${chalk_1.default.gray('–')} Import a Zone file
|
222999
|
-
|
223000
|
-
${chalk_1.default.cyan(`$ ${pkg_name_1.packageName} dns import <DOMAIN> <FILE>`)}
|
223001
|
-
${chalk_1.default.cyan(`$ ${pkg_name_1.packageName} dns import zeit.rocks ./zonefile.txt`)}
|
223002
|
-
|
223003
|
-
${chalk_1.default.gray('–')} Paginate results, where ${chalk_1.default.dim('`1584722256178`')} is the time in milliseconds since the UNIX epoch.
|
223004
|
-
|
223005
|
-
${chalk_1.default.cyan(`$ ${pkg_name_1.packageName} dns ls --next 1584722256178`)}
|
223006
|
-
${chalk_1.default.cyan(`$ ${pkg_name_1.packageName} dns ls zeit.rocks --next 1584722256178`)}
|
223007
|
-
`);
|
223008
|
-
};
|
223277
|
+
const command_1 = __webpack_require__(5155);
|
223278
|
+
const help_1 = __webpack_require__(58219);
|
223009
223279
|
const COMMAND_CONFIG = {
|
223010
223280
|
add: ['add'],
|
223011
223281
|
import: ['import'],
|
223012
223282
|
ls: ['ls', 'list'],
|
223013
223283
|
rm: ['rm', 'remove'],
|
223014
223284
|
};
|
223015
|
-
async function
|
223285
|
+
async function dns(client) {
|
223016
223286
|
let argv;
|
223017
223287
|
try {
|
223018
223288
|
argv = (0, get_args_1.default)(client.argv.slice(2), {
|
@@ -223026,7 +223296,7 @@ async function main(client) {
|
|
223026
223296
|
return 1;
|
223027
223297
|
}
|
223028
223298
|
if (argv['--help']) {
|
223029
|
-
help();
|
223299
|
+
client.output.print((0, help_1.help)(command_1.dnsCommand, { columns: client.stderr.columns }));
|
223030
223300
|
return 2;
|
223031
223301
|
}
|
223032
223302
|
const { subcommand, args } = (0, get_subcommand_1.default)(argv._.slice(1), COMMAND_CONFIG);
|
@@ -223041,7 +223311,7 @@ async function main(client) {
|
|
223041
223311
|
return (0, ls_1.default)(client, argv, args);
|
223042
223312
|
}
|
223043
223313
|
}
|
223044
|
-
exports.default =
|
223314
|
+
exports.default = dns;
|
223045
223315
|
|
223046
223316
|
|
223047
223317
|
/***/ }),
|
@@ -224609,6 +224879,7 @@ const get_env_records_1 = __webpack_require__(72913);
|
|
224609
224879
|
const diff_env_files_1 = __webpack_require__(65117);
|
224610
224880
|
const error_utils_1 = __webpack_require__(39799);
|
224611
224881
|
const add_to_gitignore_1 = __webpack_require__(19159);
|
224882
|
+
const json_parse_better_errors_1 = __importDefault(__webpack_require__(43144));
|
224612
224883
|
const CONTENTS_PREFIX = '# Created by Vercel CLI\n';
|
224613
224884
|
function readHeadSync(path, length) {
|
224614
224885
|
const buffer = Buffer.alloc(length);
|
@@ -224668,7 +224939,7 @@ async function pull(client, link, project, environment, opts, args, output, cwd,
|
|
224668
224939
|
// We need this because double quotes are stripped from the local .env file,
|
224669
224940
|
// but `records` is already in the form of a JSON object that doesn't filter
|
224670
224941
|
// double quotes.
|
224671
|
-
const newEnv =
|
224942
|
+
const newEnv = (0, json_parse_better_errors_1.default)(JSON.stringify(records).replace(/\\"/g, ''));
|
224672
224943
|
deltaString = (0, diff_env_files_1.buildDeltaString)(oldEnv, newEnv);
|
224673
224944
|
}
|
224674
224945
|
}
|
@@ -229095,7 +229366,6 @@ const chars_1 = __importDefault(__webpack_require__(87280));
|
|
229095
229366
|
const table_1 = __importDefault(__webpack_require__(27474));
|
229096
229367
|
const get_user_1 = __importDefault(__webpack_require__(78871));
|
229097
229368
|
const get_teams_1 = __importDefault(__webpack_require__(15854));
|
229098
|
-
const get_prefixed_flags_1 = __importDefault(__webpack_require__(31354));
|
229099
229369
|
const pkg_name_1 = __webpack_require__(79000);
|
229100
229370
|
const get_command_flags_1 = __importDefault(__webpack_require__(98395));
|
229101
229371
|
const cmd_1 = __importDefault(__webpack_require__(62422));
|
@@ -229155,8 +229425,7 @@ async function list(client) {
|
|
229155
229425
|
console.log(); // empty line
|
229156
229426
|
(0, table_1.default)(['', 'id', 'email / name'], teamList.map(team => [team.current, team.value, team.name]), [1, 5]);
|
229157
229427
|
if (pagination?.count === 20) {
|
229158
|
-
const
|
229159
|
-
const flags = (0, get_command_flags_1.default)(prefixedArgs, ['_', '--next', '-N', '-d']);
|
229428
|
+
const flags = (0, get_command_flags_1.default)(argv, ['_', '--next', '-N', '-d']);
|
229160
229429
|
const nextCmd = `${pkg_name_1.packageName} teams ls${flags} --next ${pagination.next}`;
|
229161
229430
|
console.log(); // empty line
|
229162
229431
|
output.log(`To display the next page run ${(0, cmd_1.default)(nextCmd)}`);
|
@@ -230440,7 +230709,7 @@ async function initCorepack({ repoRootPath, }) {
|
|
230440
230709
|
}
|
230441
230710
|
const pkg = await (0, read_json_file_1.default)((0, path_1.join)(repoRootPath, 'package.json'));
|
230442
230711
|
if (pkg instanceof errors_ts_1.CantParseJSONFile) {
|
230443
|
-
console.warn('Warning: Could not enable corepack because package.json is invalid JSON');
|
230712
|
+
console.warn('Warning: Could not enable corepack because package.json is invalid JSON', pkg.meta.parseErrorLocation);
|
230444
230713
|
}
|
230445
230714
|
else if (!pkg?.packageManager) {
|
230446
230715
|
console.warn('Warning: Could not enable corepack because package.json is missing "packageManager" property');
|
@@ -234428,6 +234697,7 @@ const get_port_1 = __importDefault(__webpack_require__(10360));
|
|
234428
234697
|
const is_port_reachable_1 = __importDefault(__webpack_require__(27225));
|
234429
234698
|
const fast_deep_equal_1 = __importDefault(__webpack_require__(45088));
|
234430
234699
|
const npm_package_arg_1 = __importDefault(__webpack_require__(74599));
|
234700
|
+
const json_parse_better_errors_1 = __importDefault(__webpack_require__(43144));
|
234431
234701
|
const client_1 = __webpack_require__(40521);
|
234432
234702
|
const routing_utils_1 = __webpack_require__(679);
|
234433
234703
|
const build_utils_1 = __webpack_require__(63445);
|
@@ -235473,7 +235743,7 @@ class DevServer {
|
|
235473
235743
|
this.output.debug(`Reading \`${rel}\` file`);
|
235474
235744
|
try {
|
235475
235745
|
const raw = await fs_extra_1.default.readFile(abs, 'utf8');
|
235476
|
-
const parsed =
|
235746
|
+
const parsed = (0, json_parse_better_errors_1.default)(raw);
|
235477
235747
|
parsed[client_1.fileNameSymbol] = rel;
|
235478
235748
|
return parsed;
|
235479
235749
|
}
|
@@ -238501,11 +238771,12 @@ class CertMissing extends now_error_1.NowError {
|
|
238501
238771
|
}
|
238502
238772
|
exports.CertMissing = CertMissing;
|
238503
238773
|
class CantParseJSONFile extends now_error_1.NowError {
|
238504
|
-
constructor(file) {
|
238774
|
+
constructor(file, parseErrorLocation) {
|
238775
|
+
const message = `Can't parse json file ${file}: ${parseErrorLocation}`;
|
238505
238776
|
super({
|
238506
238777
|
code: 'CANT_PARSE_JSON_FILE',
|
238507
|
-
meta: { file },
|
238508
|
-
message
|
238778
|
+
meta: { file, parseErrorLocation },
|
238779
|
+
message,
|
238509
238780
|
});
|
238510
238781
|
}
|
238511
238782
|
}
|
@@ -239116,7 +239387,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
239116
239387
|
exports.createProxy = void 0;
|
239117
239388
|
const http_1 = __webpack_require__(98605);
|
239118
239389
|
const node_fetch_1 = __webpack_require__(91596);
|
239119
|
-
const node_utils_1 = __webpack_require__(
|
239390
|
+
const node_utils_1 = __webpack_require__(95549);
|
239120
239391
|
const toHeaders = (0, node_utils_1.buildToHeaders)({ Headers: node_fetch_1.Headers });
|
239121
239392
|
function createProxy(client) {
|
239122
239393
|
return (0, http_1.createServer)(async (req, res) => {
|
@@ -239803,40 +240074,6 @@ function getPaginationOpts(opts) {
|
|
239803
240074
|
exports.getPaginationOpts = getPaginationOpts;
|
239804
240075
|
|
239805
240076
|
|
239806
|
-
/***/ }),
|
239807
|
-
|
239808
|
-
/***/ 31354:
|
239809
|
-
/***/ ((__unused_webpack_module, exports) => {
|
239810
|
-
|
239811
|
-
"use strict";
|
239812
|
-
|
239813
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
239814
|
-
/**
|
239815
|
-
* This function adds a prefix `-` or `--` to the flags
|
239816
|
-
* passed from the command line, because the package `mri`
|
239817
|
-
* used to extract the args removes them for some reason.
|
239818
|
-
*/
|
239819
|
-
function getPrefixedFlags(args) {
|
239820
|
-
const prefixedArgs = {};
|
239821
|
-
for (const arg in args) {
|
239822
|
-
if (arg === '_') {
|
239823
|
-
prefixedArgs[arg] = args[arg];
|
239824
|
-
}
|
239825
|
-
else {
|
239826
|
-
let prefix = '-';
|
239827
|
-
// Full form flags need two dashes, whereas one letter
|
239828
|
-
// flags need only one.
|
239829
|
-
if (arg.length > 1) {
|
239830
|
-
prefix = '--';
|
239831
|
-
}
|
239832
|
-
prefixedArgs[`${prefix}${arg}`] = args[arg];
|
239833
|
-
}
|
239834
|
-
}
|
239835
|
-
return prefixedArgs;
|
239836
|
-
}
|
239837
|
-
exports.default = getPrefixedFlags;
|
239838
|
-
|
239839
|
-
|
239840
240077
|
/***/ }),
|
239841
240078
|
|
239842
240079
|
/***/ 960:
|
@@ -244863,17 +245100,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
244863
245100
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
244864
245101
|
const fs_extra_1 = __importDefault(__webpack_require__(36365));
|
244865
245102
|
const errors_ts_1 = __webpack_require__(39240);
|
245103
|
+
const json_parse_better_errors_1 = __importDefault(__webpack_require__(43144));
|
245104
|
+
const error_utils_1 = __webpack_require__(39799);
|
244866
245105
|
async function readJSONFile(file) {
|
244867
245106
|
const content = await readFileSafe(file);
|
244868
245107
|
if (content === null) {
|
244869
245108
|
return content;
|
244870
245109
|
}
|
244871
245110
|
try {
|
244872
|
-
const json =
|
245111
|
+
const json = (0, json_parse_better_errors_1.default)(content);
|
244873
245112
|
return json;
|
244874
245113
|
}
|
244875
245114
|
catch (error) {
|
244876
|
-
return new errors_ts_1.CantParseJSONFile(file);
|
245115
|
+
return new errors_ts_1.CantParseJSONFile(file, (0, error_utils_1.errorToString)(error));
|
244877
245116
|
}
|
244878
245117
|
}
|
244879
245118
|
exports.default = readJSONFile;
|
@@ -245875,7 +246114,7 @@ module.exports = JSON.parse("[[[0,44],\"disallowed_STD3_valid\"],[[45,46],\"vali
|
|
245875
246114
|
/***/ ((module) => {
|
245876
246115
|
|
245877
246116
|
"use strict";
|
245878
|
-
module.exports = JSON.parse("{\"name\":\"@vercel/client\",\"version\":\"13.0.
|
246117
|
+
module.exports = JSON.parse("{\"name\":\"@vercel/client\",\"version\":\"13.0.1\",\"main\":\"dist/index.js\",\"typings\":\"dist/index.d.ts\",\"homepage\":\"https://vercel.com\",\"license\":\"Apache-2.0\",\"files\":[\"dist\"],\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/vercel/vercel.git\",\"directory\":\"packages/client\"},\"scripts\":{\"build\":\"tsc\",\"test-e2e\":\"pnpm test tests/create-deployment.test.ts tests/create-legacy-deployment.test.ts tests/paths.test.ts\",\"test\":\"jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail\",\"test-unit\":\"pnpm test tests/unit.*test.*\"},\"engines\":{\"node\":\">= 16\"},\"devDependencies\":{\"@types/async-retry\":\"1.4.5\",\"@types/fs-extra\":\"7.0.0\",\"@types/jest\":\"27.4.1\",\"@types/minimatch\":\"3.0.5\",\"@types/ms\":\"0.7.30\",\"@types/node\":\"14.18.33\",\"@types/node-fetch\":\"2.5.4\",\"@types/recursive-readdir\":\"2.2.0\",\"@types/tar-fs\":\"1.16.1\",\"jest-junit\":\"16.0.0\",\"typescript\":\"4.9.5\"},\"dependencies\":{\"@vercel/build-utils\":\"7.1.0\",\"@vercel/routing-utils\":\"3.0.0\",\"@zeit/fetch\":\"5.2.0\",\"async-retry\":\"1.2.3\",\"async-sema\":\"3.0.0\",\"fs-extra\":\"8.0.1\",\"ignore\":\"4.0.6\",\"minimatch\":\"5.0.1\",\"ms\":\"2.1.2\",\"node-fetch\":\"2.6.7\",\"querystring\":\"^0.2.0\",\"sleep-promise\":\"8.0.1\",\"tar-fs\":\"1.16.3\"}}");
|
245879
246118
|
|
245880
246119
|
/***/ }),
|
245881
246120
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vercel",
|
3
|
-
"version": "32.0
|
3
|
+
"version": "32.1.0",
|
4
4
|
"preferGlobal": true,
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"description": "The command-line interface for Vercel",
|
@@ -22,20 +22,20 @@
|
|
22
22
|
"node": ">= 16"
|
23
23
|
},
|
24
24
|
"dependencies": {
|
25
|
-
"@vercel/build-utils": "7.
|
25
|
+
"@vercel/build-utils": "7.1.0",
|
26
26
|
"@vercel/go": "3.0.0",
|
27
27
|
"@vercel/hydrogen": "1.0.0",
|
28
|
-
"@vercel/next": "4.0.
|
29
|
-
"@vercel/node": "3.0.
|
28
|
+
"@vercel/next": "4.0.1",
|
29
|
+
"@vercel/node": "3.0.3",
|
30
30
|
"@vercel/python": "4.0.0",
|
31
31
|
"@vercel/redwood": "2.0.0",
|
32
|
-
"@vercel/remix-builder": "2.0.
|
32
|
+
"@vercel/remix-builder": "2.0.2",
|
33
33
|
"@vercel/ruby": "2.0.0",
|
34
|
-
"@vercel/static-build": "2.0.
|
34
|
+
"@vercel/static-build": "2.0.3"
|
35
35
|
},
|
36
36
|
"devDependencies": {
|
37
37
|
"@alex_neo/jest-expect-message": "1.0.5",
|
38
|
-
"@edge-runtime/node-utils": "2.
|
38
|
+
"@edge-runtime/node-utils": "2.2.0",
|
39
39
|
"@next/env": "11.1.2",
|
40
40
|
"@sentry/node": "5.5.0",
|
41
41
|
"@sindresorhus/slugify": "0.11.0",
|
@@ -55,10 +55,10 @@
|
|
55
55
|
"@types/inquirer": "7.3.1",
|
56
56
|
"@types/jest": "27.4.1",
|
57
57
|
"@types/jest-expect-message": "1.0.3",
|
58
|
+
"@types/json-parse-better-errors": "1.0.0",
|
58
59
|
"@types/load-json-file": "2.0.7",
|
59
60
|
"@types/mime-types": "2.1.0",
|
60
61
|
"@types/minimatch": "3.0.3",
|
61
|
-
"@types/mri": "1.1.0",
|
62
62
|
"@types/ms": "0.7.30",
|
63
63
|
"@types/node": "14.18.33",
|
64
64
|
"@types/node-fetch": "2.5.10",
|
@@ -77,8 +77,8 @@
|
|
77
77
|
"@types/yauzl-promise": "2.1.0",
|
78
78
|
"@vercel-internals/constants": "1.0.4",
|
79
79
|
"@vercel-internals/get-package-json": "1.0.0",
|
80
|
-
"@vercel-internals/types": "1.0.
|
81
|
-
"@vercel/client": "13.0.
|
80
|
+
"@vercel-internals/types": "1.0.8",
|
81
|
+
"@vercel/client": "13.0.1",
|
82
82
|
"@vercel/error-utils": "2.0.1",
|
83
83
|
"@vercel/frameworks": "2.0.1",
|
84
84
|
"@vercel/fs-detectors": "5.0.1",
|
@@ -127,12 +127,12 @@
|
|
127
127
|
"jaro-winkler": "0.2.8",
|
128
128
|
"jest-junit": "16.0.0",
|
129
129
|
"jest-matcher-utils": "29.3.1",
|
130
|
+
"json-parse-better-errors": "1.0.2",
|
130
131
|
"jsonlines": "0.1.1",
|
131
132
|
"line-async-iterator": "3.0.0",
|
132
133
|
"load-json-file": "3.0.0",
|
133
134
|
"mime-types": "2.1.24",
|
134
135
|
"minimatch": "3.1.2",
|
135
|
-
"mri": "1.1.5",
|
136
136
|
"ms": "2.1.2",
|
137
137
|
"node-fetch": "2.6.7",
|
138
138
|
"npm-package-arg": "6.1.0",
|