@goldskycom/cli 0.1.1 → 0.2.1
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 +656 -260
- package/package.json +6 -2
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
8
|
var __commonJS = (cb, mod) => function __require() {
|
|
9
9
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
10
|
};
|
|
@@ -12,22 +12,19 @@ var __export = (target, all) => {
|
|
|
12
12
|
for (var name in all)
|
|
13
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
14
|
};
|
|
15
|
-
var
|
|
16
|
-
if (
|
|
17
|
-
for (let key of __getOwnPropNames(
|
|
18
|
-
if (!__hasOwnProp.call(
|
|
19
|
-
__defProp(
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from))
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
20
|
}
|
|
21
|
-
return
|
|
22
|
-
};
|
|
23
|
-
var __toESM = (module2, isNodeMode) => {
|
|
24
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
21
|
+
return to;
|
|
25
22
|
};
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
28
|
|
|
32
29
|
// ../../node_modules/@sinclair/typebox/typebox.js
|
|
33
30
|
var require_typebox = __commonJS({
|
|
@@ -333,6 +330,22 @@ var require_subgraph = __commonJS({
|
|
|
333
330
|
exports.RemoveMessageSchema = {
|
|
334
331
|
params: DeployParams
|
|
335
332
|
};
|
|
333
|
+
var SubgraphDeployment = typebox_1.Type.Object({
|
|
334
|
+
created_at: typebox_1.Type.Number(),
|
|
335
|
+
deployment_id: typebox_1.Type.String(),
|
|
336
|
+
health: typebox_1.Type.String(),
|
|
337
|
+
synced: typebox_1.Type.Boolean(),
|
|
338
|
+
fatal_error: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
339
|
+
non_fatal_errors: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())),
|
|
340
|
+
indexing_progress: typebox_1.Type.Optional(typebox_1.Type.Object({
|
|
341
|
+
network: typebox_1.Type.String(),
|
|
342
|
+
progress_percent: typebox_1.Type.Number(),
|
|
343
|
+
chain_head_block: typebox_1.Type.Number(),
|
|
344
|
+
deployment_head_block: typebox_1.Type.Number(),
|
|
345
|
+
deployment_start_block: typebox_1.Type.Number(),
|
|
346
|
+
synced: typebox_1.Type.Boolean()
|
|
347
|
+
}))
|
|
348
|
+
});
|
|
336
349
|
var SubgraphStatus = typebox_1.Type.Object({
|
|
337
350
|
name: typebox_1.Type.String(),
|
|
338
351
|
version: typebox_1.Type.String(),
|
|
@@ -340,22 +353,7 @@ var require_subgraph = __commonJS({
|
|
|
340
353
|
health: typebox_1.Type.String(),
|
|
341
354
|
synced: typebox_1.Type.Boolean(),
|
|
342
355
|
graphql_endpoint: typebox_1.Type.String(),
|
|
343
|
-
deployments: typebox_1.Type.Array(
|
|
344
|
-
created_at: typebox_1.Type.Number(),
|
|
345
|
-
deployment_id: typebox_1.Type.String(),
|
|
346
|
-
health: typebox_1.Type.String(),
|
|
347
|
-
synced: typebox_1.Type.Boolean(),
|
|
348
|
-
fatal_error: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
349
|
-
non_fatal_errors: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())),
|
|
350
|
-
indexing_progress: typebox_1.Type.Optional(typebox_1.Type.Object({
|
|
351
|
-
network: typebox_1.Type.String(),
|
|
352
|
-
progress_percent: typebox_1.Type.Number(),
|
|
353
|
-
chain_head_block: typebox_1.Type.Number(),
|
|
354
|
-
deployment_head_block: typebox_1.Type.Number(),
|
|
355
|
-
deployment_start_block: typebox_1.Type.Number(),
|
|
356
|
-
synced: typebox_1.Type.Boolean()
|
|
357
|
-
}))
|
|
358
|
-
}))
|
|
356
|
+
deployments: typebox_1.Type.Array(SubgraphDeployment)
|
|
359
357
|
});
|
|
360
358
|
var SubgraphVersionsParams = typebox_1.Type.Object({
|
|
361
359
|
name: typebox_1.Type.String()
|
|
@@ -774,7 +772,13 @@ var require_settle = __commonJS({
|
|
|
774
772
|
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
775
773
|
resolve5(response);
|
|
776
774
|
} else {
|
|
777
|
-
reject(createError(
|
|
775
|
+
reject(createError(
|
|
776
|
+
"Request failed with status code " + response.status,
|
|
777
|
+
response.config,
|
|
778
|
+
null,
|
|
779
|
+
response.request,
|
|
780
|
+
response
|
|
781
|
+
));
|
|
778
782
|
}
|
|
779
783
|
};
|
|
780
784
|
}
|
|
@@ -1061,7 +1065,12 @@ var require_xhr = __commonJS({
|
|
|
1061
1065
|
if (config.timeoutErrorMessage) {
|
|
1062
1066
|
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
1063
1067
|
}
|
|
1064
|
-
reject(createError(
|
|
1068
|
+
reject(createError(
|
|
1069
|
+
timeoutErrorMessage,
|
|
1070
|
+
config,
|
|
1071
|
+
transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED",
|
|
1072
|
+
request
|
|
1073
|
+
));
|
|
1065
1074
|
request = null;
|
|
1066
1075
|
};
|
|
1067
1076
|
if (utils.isStandardBrowserEnv()) {
|
|
@@ -1131,14 +1140,18 @@ var require_ms = __commonJS({
|
|
|
1131
1140
|
} else if (type === "number" && isFinite(val)) {
|
|
1132
1141
|
return options.long ? fmtLong(val) : fmtShort(val);
|
|
1133
1142
|
}
|
|
1134
|
-
throw new Error(
|
|
1143
|
+
throw new Error(
|
|
1144
|
+
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
1145
|
+
);
|
|
1135
1146
|
};
|
|
1136
1147
|
function parse(str) {
|
|
1137
1148
|
str = String(str);
|
|
1138
1149
|
if (str.length > 100) {
|
|
1139
1150
|
return;
|
|
1140
1151
|
}
|
|
1141
|
-
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
1152
|
+
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
1153
|
+
str
|
|
1154
|
+
);
|
|
1142
1155
|
if (!match) {
|
|
1143
1156
|
return;
|
|
1144
1157
|
}
|
|
@@ -1338,7 +1351,7 @@ var require_common = __commonJS({
|
|
|
1338
1351
|
}
|
|
1339
1352
|
namespaces = split[i].replace(/\*/g, ".*?");
|
|
1340
1353
|
if (namespaces[0] === "-") {
|
|
1341
|
-
createDebug.skips.push(new RegExp("^" + namespaces.
|
|
1354
|
+
createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
|
|
1342
1355
|
} else {
|
|
1343
1356
|
createDebug.names.push(new RegExp("^" + namespaces + "$"));
|
|
1344
1357
|
}
|
|
@@ -1680,8 +1693,11 @@ var require_node = __commonJS({
|
|
|
1680
1693
|
exports.save = save;
|
|
1681
1694
|
exports.load = load;
|
|
1682
1695
|
exports.useColors = useColors;
|
|
1683
|
-
exports.destroy = util.deprecate(
|
|
1684
|
-
|
|
1696
|
+
exports.destroy = util.deprecate(
|
|
1697
|
+
() => {
|
|
1698
|
+
},
|
|
1699
|
+
"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
|
|
1700
|
+
);
|
|
1685
1701
|
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
1686
1702
|
try {
|
|
1687
1703
|
const supportsColor = require_supports_color();
|
|
@@ -1888,10 +1904,22 @@ var require_follow_redirects = __commonJS({
|
|
|
1888
1904
|
this._redirectable.emit(event, arg1, arg2, arg3);
|
|
1889
1905
|
};
|
|
1890
1906
|
});
|
|
1891
|
-
var RedirectionError = createErrorType(
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1907
|
+
var RedirectionError = createErrorType(
|
|
1908
|
+
"ERR_FR_REDIRECTION_FAILURE",
|
|
1909
|
+
"Redirected request failed"
|
|
1910
|
+
);
|
|
1911
|
+
var TooManyRedirectsError = createErrorType(
|
|
1912
|
+
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
1913
|
+
"Maximum number of redirects exceeded"
|
|
1914
|
+
);
|
|
1915
|
+
var MaxBodyLengthExceededError = createErrorType(
|
|
1916
|
+
"ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
|
|
1917
|
+
"Request body larger than maxBodyLength limit"
|
|
1918
|
+
);
|
|
1919
|
+
var WriteAfterEndError = createErrorType(
|
|
1920
|
+
"ERR_STREAM_WRITE_AFTER_END",
|
|
1921
|
+
"write after end"
|
|
1922
|
+
);
|
|
1895
1923
|
function RedirectableRequest(options, responseCallback) {
|
|
1896
1924
|
Writable.call(this);
|
|
1897
1925
|
this._sanitizeOptions(options);
|
|
@@ -2349,7 +2377,10 @@ var require_http = __commonJS({
|
|
|
2349
2377
|
} else if (utils.isString(data)) {
|
|
2350
2378
|
data = Buffer.from(data, "utf-8");
|
|
2351
2379
|
} else {
|
|
2352
|
-
return reject(createError(
|
|
2380
|
+
return reject(createError(
|
|
2381
|
+
"Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",
|
|
2382
|
+
config
|
|
2383
|
+
));
|
|
2353
2384
|
}
|
|
2354
2385
|
if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
|
|
2355
2386
|
return reject(createError("Request body larger than maxBodyLength limit", config));
|
|
@@ -2498,7 +2529,12 @@ var require_http = __commonJS({
|
|
|
2498
2529
|
if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
|
|
2499
2530
|
rejected = true;
|
|
2500
2531
|
stream.destroy();
|
|
2501
|
-
reject(createError(
|
|
2532
|
+
reject(createError(
|
|
2533
|
+
"maxContentLength size of " + config.maxContentLength + " exceeded",
|
|
2534
|
+
config,
|
|
2535
|
+
null,
|
|
2536
|
+
lastRequest
|
|
2537
|
+
));
|
|
2502
2538
|
}
|
|
2503
2539
|
});
|
|
2504
2540
|
stream.on("aborted", function handlerStreamAborted() {
|
|
@@ -2541,7 +2577,12 @@ var require_http = __commonJS({
|
|
|
2541
2577
|
if (config.timeout) {
|
|
2542
2578
|
var timeout = parseInt(config.timeout, 10);
|
|
2543
2579
|
if (isNaN(timeout)) {
|
|
2544
|
-
reject(createError(
|
|
2580
|
+
reject(createError(
|
|
2581
|
+
"error trying to parse `config.timeout` to int",
|
|
2582
|
+
config,
|
|
2583
|
+
"ERR_PARSE_TIMEOUT",
|
|
2584
|
+
req
|
|
2585
|
+
));
|
|
2545
2586
|
return;
|
|
2546
2587
|
}
|
|
2547
2588
|
req.setTimeout(timeout, function handleRequestTimeout() {
|
|
@@ -2553,7 +2594,12 @@ var require_http = __commonJS({
|
|
|
2553
2594
|
timeoutErrorMessage = "timeout of " + config.timeout + "ms exceeded";
|
|
2554
2595
|
}
|
|
2555
2596
|
var transitional = config.transitional || defaults.transitional;
|
|
2556
|
-
reject(createError(
|
|
2597
|
+
reject(createError(
|
|
2598
|
+
timeoutErrorMessage,
|
|
2599
|
+
config,
|
|
2600
|
+
transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED",
|
|
2601
|
+
req
|
|
2602
|
+
));
|
|
2557
2603
|
});
|
|
2558
2604
|
}
|
|
2559
2605
|
if (config.cancelToken || config.signal) {
|
|
@@ -2732,21 +2778,43 @@ var require_dispatchRequest = __commonJS({
|
|
|
2732
2778
|
module2.exports = function dispatchRequest(config) {
|
|
2733
2779
|
throwIfCancellationRequested(config);
|
|
2734
2780
|
config.headers = config.headers || {};
|
|
2735
|
-
config.data = transformData.call(
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2781
|
+
config.data = transformData.call(
|
|
2782
|
+
config,
|
|
2783
|
+
config.data,
|
|
2784
|
+
config.headers,
|
|
2785
|
+
config.transformRequest
|
|
2786
|
+
);
|
|
2787
|
+
config.headers = utils.merge(
|
|
2788
|
+
config.headers.common || {},
|
|
2789
|
+
config.headers[config.method] || {},
|
|
2790
|
+
config.headers
|
|
2791
|
+
);
|
|
2792
|
+
utils.forEach(
|
|
2793
|
+
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
2794
|
+
function cleanHeaderConfig(method) {
|
|
2795
|
+
delete config.headers[method];
|
|
2796
|
+
}
|
|
2797
|
+
);
|
|
2740
2798
|
var adapter = config.adapter || defaults.adapter;
|
|
2741
2799
|
return adapter(config).then(function onAdapterResolution(response) {
|
|
2742
2800
|
throwIfCancellationRequested(config);
|
|
2743
|
-
response.data = transformData.call(
|
|
2801
|
+
response.data = transformData.call(
|
|
2802
|
+
config,
|
|
2803
|
+
response.data,
|
|
2804
|
+
response.headers,
|
|
2805
|
+
config.transformResponse
|
|
2806
|
+
);
|
|
2744
2807
|
return response;
|
|
2745
2808
|
}, function onAdapterRejection(reason) {
|
|
2746
2809
|
if (!isCancel(reason)) {
|
|
2747
2810
|
throwIfCancellationRequested(config);
|
|
2748
2811
|
if (reason && reason.response) {
|
|
2749
|
-
reason.response.data = transformData.call(
|
|
2812
|
+
reason.response.data = transformData.call(
|
|
2813
|
+
config,
|
|
2814
|
+
reason.response.data,
|
|
2815
|
+
reason.response.headers,
|
|
2816
|
+
config.transformResponse
|
|
2817
|
+
);
|
|
2750
2818
|
}
|
|
2751
2819
|
}
|
|
2752
2820
|
return Promise.reject(reason);
|
|
@@ -2859,7 +2927,12 @@ var require_validator = __commonJS({
|
|
|
2859
2927
|
}
|
|
2860
2928
|
if (version && !deprecatedWarnings[opt]) {
|
|
2861
2929
|
deprecatedWarnings[opt] = true;
|
|
2862
|
-
console.warn(
|
|
2930
|
+
console.warn(
|
|
2931
|
+
formatMessage(
|
|
2932
|
+
opt,
|
|
2933
|
+
" has been deprecated since v" + version + " and will be removed in the near future"
|
|
2934
|
+
)
|
|
2935
|
+
);
|
|
2863
2936
|
}
|
|
2864
2937
|
return validator ? validator(value, opt, opts) : true;
|
|
2865
2938
|
};
|
|
@@ -12665,9 +12738,13 @@ var require_src2 = __commonJS({
|
|
|
12665
12738
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
12666
12739
|
if (k2 === void 0)
|
|
12667
12740
|
k2 = k;
|
|
12668
|
-
Object.
|
|
12669
|
-
|
|
12670
|
-
|
|
12741
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12742
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12743
|
+
desc = { enumerable: true, get: function() {
|
|
12744
|
+
return m[k];
|
|
12745
|
+
} };
|
|
12746
|
+
}
|
|
12747
|
+
Object.defineProperty(o, k2, desc);
|
|
12671
12748
|
} : function(o, m, k, k2) {
|
|
12672
12749
|
if (k2 === void 0)
|
|
12673
12750
|
k2 = k;
|
|
@@ -13902,14 +13979,14 @@ var require_templates = __commonJS({
|
|
|
13902
13979
|
}
|
|
13903
13980
|
return results;
|
|
13904
13981
|
}
|
|
13905
|
-
function buildStyle(
|
|
13982
|
+
function buildStyle(chalk12, styles) {
|
|
13906
13983
|
const enabled = {};
|
|
13907
13984
|
for (const layer of styles) {
|
|
13908
13985
|
for (const style of layer.styles) {
|
|
13909
13986
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
13910
13987
|
}
|
|
13911
13988
|
}
|
|
13912
|
-
let current =
|
|
13989
|
+
let current = chalk12;
|
|
13913
13990
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
13914
13991
|
if (!Array.isArray(styles2)) {
|
|
13915
13992
|
continue;
|
|
@@ -13921,7 +13998,7 @@ var require_templates = __commonJS({
|
|
|
13921
13998
|
}
|
|
13922
13999
|
return current;
|
|
13923
14000
|
}
|
|
13924
|
-
module2.exports = (
|
|
14001
|
+
module2.exports = (chalk12, temporary) => {
|
|
13925
14002
|
const styles = [];
|
|
13926
14003
|
const chunks = [];
|
|
13927
14004
|
let chunk = [];
|
|
@@ -13931,13 +14008,13 @@ var require_templates = __commonJS({
|
|
|
13931
14008
|
} else if (style) {
|
|
13932
14009
|
const string = chunk.join("");
|
|
13933
14010
|
chunk = [];
|
|
13934
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
|
14011
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk12, styles)(string));
|
|
13935
14012
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
13936
14013
|
} else if (close) {
|
|
13937
14014
|
if (styles.length === 0) {
|
|
13938
14015
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
13939
14016
|
}
|
|
13940
|
-
chunks.push(buildStyle(
|
|
14017
|
+
chunks.push(buildStyle(chalk12, styles)(chunk.join("")));
|
|
13941
14018
|
chunk = [];
|
|
13942
14019
|
styles.pop();
|
|
13943
14020
|
} else {
|
|
@@ -13985,16 +14062,16 @@ var require_source = __commonJS({
|
|
|
13985
14062
|
}
|
|
13986
14063
|
};
|
|
13987
14064
|
var chalkFactory = (options) => {
|
|
13988
|
-
const
|
|
13989
|
-
applyOptions(
|
|
13990
|
-
|
|
13991
|
-
Object.setPrototypeOf(
|
|
13992
|
-
Object.setPrototypeOf(
|
|
13993
|
-
|
|
14065
|
+
const chalk13 = {};
|
|
14066
|
+
applyOptions(chalk13, options);
|
|
14067
|
+
chalk13.template = (...arguments_) => chalkTag(chalk13.template, ...arguments_);
|
|
14068
|
+
Object.setPrototypeOf(chalk13, Chalk.prototype);
|
|
14069
|
+
Object.setPrototypeOf(chalk13.template, chalk13);
|
|
14070
|
+
chalk13.template.constructor = () => {
|
|
13994
14071
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
13995
14072
|
};
|
|
13996
|
-
|
|
13997
|
-
return
|
|
14073
|
+
chalk13.template.Instance = ChalkClass;
|
|
14074
|
+
return chalk13.template;
|
|
13998
14075
|
};
|
|
13999
14076
|
function Chalk(options) {
|
|
14000
14077
|
return chalkFactory(options);
|
|
@@ -14105,7 +14182,7 @@ var require_source = __commonJS({
|
|
|
14105
14182
|
return openAll + string + closeAll;
|
|
14106
14183
|
};
|
|
14107
14184
|
var template;
|
|
14108
|
-
var chalkTag = (
|
|
14185
|
+
var chalkTag = (chalk13, ...strings) => {
|
|
14109
14186
|
const [firstString] = strings;
|
|
14110
14187
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
14111
14188
|
return strings.join(" ");
|
|
@@ -14113,19 +14190,22 @@ var require_source = __commonJS({
|
|
|
14113
14190
|
const arguments_ = strings.slice(1);
|
|
14114
14191
|
const parts = [firstString.raw[0]];
|
|
14115
14192
|
for (let i = 1; i < firstString.length; i++) {
|
|
14116
|
-
parts.push(
|
|
14193
|
+
parts.push(
|
|
14194
|
+
String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
14195
|
+
String(firstString.raw[i])
|
|
14196
|
+
);
|
|
14117
14197
|
}
|
|
14118
14198
|
if (template === void 0) {
|
|
14119
14199
|
template = require_templates();
|
|
14120
14200
|
}
|
|
14121
|
-
return template(
|
|
14201
|
+
return template(chalk13, parts.join(""));
|
|
14122
14202
|
};
|
|
14123
14203
|
Object.defineProperties(Chalk.prototype, styles);
|
|
14124
|
-
var
|
|
14125
|
-
|
|
14126
|
-
|
|
14127
|
-
|
|
14128
|
-
module2.exports =
|
|
14204
|
+
var chalk12 = Chalk();
|
|
14205
|
+
chalk12.supportsColor = stdoutColor;
|
|
14206
|
+
chalk12.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
14207
|
+
chalk12.stderr.supportsColor = stderrColor;
|
|
14208
|
+
module2.exports = chalk12;
|
|
14129
14209
|
}
|
|
14130
14210
|
});
|
|
14131
14211
|
|
|
@@ -14452,7 +14532,13 @@ var require_settle2 = __commonJS({
|
|
|
14452
14532
|
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
14453
14533
|
resolve5(response);
|
|
14454
14534
|
} else {
|
|
14455
|
-
reject(createError(
|
|
14535
|
+
reject(createError(
|
|
14536
|
+
"Request failed with status code " + response.status,
|
|
14537
|
+
response.config,
|
|
14538
|
+
null,
|
|
14539
|
+
response.request,
|
|
14540
|
+
response
|
|
14541
|
+
));
|
|
14456
14542
|
}
|
|
14457
14543
|
};
|
|
14458
14544
|
}
|
|
@@ -14739,7 +14825,12 @@ var require_xhr2 = __commonJS({
|
|
|
14739
14825
|
if (config.timeoutErrorMessage) {
|
|
14740
14826
|
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
14741
14827
|
}
|
|
14742
|
-
reject(createError(
|
|
14828
|
+
reject(createError(
|
|
14829
|
+
timeoutErrorMessage,
|
|
14830
|
+
config,
|
|
14831
|
+
transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED",
|
|
14832
|
+
request
|
|
14833
|
+
));
|
|
14743
14834
|
request = null;
|
|
14744
14835
|
};
|
|
14745
14836
|
if (utils.isStandardBrowserEnv()) {
|
|
@@ -14874,7 +14965,10 @@ var require_http2 = __commonJS({
|
|
|
14874
14965
|
} else if (utils.isString(data)) {
|
|
14875
14966
|
data = Buffer.from(data, "utf-8");
|
|
14876
14967
|
} else {
|
|
14877
|
-
return reject(createError(
|
|
14968
|
+
return reject(createError(
|
|
14969
|
+
"Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",
|
|
14970
|
+
config
|
|
14971
|
+
));
|
|
14878
14972
|
}
|
|
14879
14973
|
if (!headerNames["content-length"]) {
|
|
14880
14974
|
headers["Content-Length"] = data.length;
|
|
@@ -15010,7 +15104,12 @@ var require_http2 = __commonJS({
|
|
|
15010
15104
|
totalResponseBytes += chunk.length;
|
|
15011
15105
|
if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
|
|
15012
15106
|
stream.destroy();
|
|
15013
|
-
reject(createError(
|
|
15107
|
+
reject(createError(
|
|
15108
|
+
"maxContentLength size of " + config.maxContentLength + " exceeded",
|
|
15109
|
+
config,
|
|
15110
|
+
null,
|
|
15111
|
+
lastRequest
|
|
15112
|
+
));
|
|
15014
15113
|
}
|
|
15015
15114
|
});
|
|
15016
15115
|
stream.on("error", function handleStreamError(err) {
|
|
@@ -15039,13 +15138,23 @@ var require_http2 = __commonJS({
|
|
|
15039
15138
|
if (config.timeout) {
|
|
15040
15139
|
var timeout = parseInt(config.timeout, 10);
|
|
15041
15140
|
if (isNaN(timeout)) {
|
|
15042
|
-
reject(createError(
|
|
15141
|
+
reject(createError(
|
|
15142
|
+
"error trying to parse `config.timeout` to int",
|
|
15143
|
+
config,
|
|
15144
|
+
"ERR_PARSE_TIMEOUT",
|
|
15145
|
+
req
|
|
15146
|
+
));
|
|
15043
15147
|
return;
|
|
15044
15148
|
}
|
|
15045
15149
|
req.setTimeout(timeout, function handleRequestTimeout() {
|
|
15046
15150
|
req.abort();
|
|
15047
15151
|
var transitional = config.transitional || defaults.transitional;
|
|
15048
|
-
reject(createError(
|
|
15152
|
+
reject(createError(
|
|
15153
|
+
"timeout of " + timeout + "ms exceeded",
|
|
15154
|
+
config,
|
|
15155
|
+
transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED",
|
|
15156
|
+
req
|
|
15157
|
+
));
|
|
15049
15158
|
});
|
|
15050
15159
|
}
|
|
15051
15160
|
if (config.cancelToken || config.signal) {
|
|
@@ -15224,21 +15333,43 @@ var require_dispatchRequest2 = __commonJS({
|
|
|
15224
15333
|
module2.exports = function dispatchRequest(config) {
|
|
15225
15334
|
throwIfCancellationRequested(config);
|
|
15226
15335
|
config.headers = config.headers || {};
|
|
15227
|
-
config.data = transformData.call(
|
|
15228
|
-
|
|
15229
|
-
|
|
15230
|
-
|
|
15231
|
-
|
|
15336
|
+
config.data = transformData.call(
|
|
15337
|
+
config,
|
|
15338
|
+
config.data,
|
|
15339
|
+
config.headers,
|
|
15340
|
+
config.transformRequest
|
|
15341
|
+
);
|
|
15342
|
+
config.headers = utils.merge(
|
|
15343
|
+
config.headers.common || {},
|
|
15344
|
+
config.headers[config.method] || {},
|
|
15345
|
+
config.headers
|
|
15346
|
+
);
|
|
15347
|
+
utils.forEach(
|
|
15348
|
+
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
15349
|
+
function cleanHeaderConfig(method) {
|
|
15350
|
+
delete config.headers[method];
|
|
15351
|
+
}
|
|
15352
|
+
);
|
|
15232
15353
|
var adapter = config.adapter || defaults.adapter;
|
|
15233
15354
|
return adapter(config).then(function onAdapterResolution(response) {
|
|
15234
15355
|
throwIfCancellationRequested(config);
|
|
15235
|
-
response.data = transformData.call(
|
|
15356
|
+
response.data = transformData.call(
|
|
15357
|
+
config,
|
|
15358
|
+
response.data,
|
|
15359
|
+
response.headers,
|
|
15360
|
+
config.transformResponse
|
|
15361
|
+
);
|
|
15236
15362
|
return response;
|
|
15237
15363
|
}, function onAdapterRejection(reason) {
|
|
15238
15364
|
if (!isCancel(reason)) {
|
|
15239
15365
|
throwIfCancellationRequested(config);
|
|
15240
15366
|
if (reason && reason.response) {
|
|
15241
|
-
reason.response.data = transformData.call(
|
|
15367
|
+
reason.response.data = transformData.call(
|
|
15368
|
+
config,
|
|
15369
|
+
reason.response.data,
|
|
15370
|
+
reason.response.headers,
|
|
15371
|
+
config.transformResponse
|
|
15372
|
+
);
|
|
15242
15373
|
}
|
|
15243
15374
|
}
|
|
15244
15375
|
return Promise.reject(reason);
|
|
@@ -15351,7 +15482,12 @@ var require_validator2 = __commonJS({
|
|
|
15351
15482
|
}
|
|
15352
15483
|
if (version && !deprecatedWarnings[opt]) {
|
|
15353
15484
|
deprecatedWarnings[opt] = true;
|
|
15354
|
-
console.warn(
|
|
15485
|
+
console.warn(
|
|
15486
|
+
formatMessage(
|
|
15487
|
+
opt,
|
|
15488
|
+
" has been deprecated since v" + version + " and will be removed in the near future"
|
|
15489
|
+
)
|
|
15490
|
+
);
|
|
15355
15491
|
}
|
|
15356
15492
|
return validator ? validator(value, opt, opts) : true;
|
|
15357
15493
|
};
|
|
@@ -15744,14 +15880,14 @@ var require_templates2 = __commonJS({
|
|
|
15744
15880
|
}
|
|
15745
15881
|
return results;
|
|
15746
15882
|
}
|
|
15747
|
-
function buildStyle(
|
|
15883
|
+
function buildStyle(chalk12, styles) {
|
|
15748
15884
|
const enabled = {};
|
|
15749
15885
|
for (const layer of styles) {
|
|
15750
15886
|
for (const style of layer.styles) {
|
|
15751
15887
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
15752
15888
|
}
|
|
15753
15889
|
}
|
|
15754
|
-
let current =
|
|
15890
|
+
let current = chalk12;
|
|
15755
15891
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
15756
15892
|
if (!Array.isArray(styles2)) {
|
|
15757
15893
|
continue;
|
|
@@ -15763,7 +15899,7 @@ var require_templates2 = __commonJS({
|
|
|
15763
15899
|
}
|
|
15764
15900
|
return current;
|
|
15765
15901
|
}
|
|
15766
|
-
module2.exports = (
|
|
15902
|
+
module2.exports = (chalk12, temporary) => {
|
|
15767
15903
|
const styles = [];
|
|
15768
15904
|
const chunks = [];
|
|
15769
15905
|
let chunk = [];
|
|
@@ -15773,13 +15909,13 @@ var require_templates2 = __commonJS({
|
|
|
15773
15909
|
} else if (style) {
|
|
15774
15910
|
const string = chunk.join("");
|
|
15775
15911
|
chunk = [];
|
|
15776
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
|
15912
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk12, styles)(string));
|
|
15777
15913
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
15778
15914
|
} else if (close) {
|
|
15779
15915
|
if (styles.length === 0) {
|
|
15780
15916
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
15781
15917
|
}
|
|
15782
|
-
chunks.push(buildStyle(
|
|
15918
|
+
chunks.push(buildStyle(chalk12, styles)(chunk.join("")));
|
|
15783
15919
|
chunk = [];
|
|
15784
15920
|
styles.pop();
|
|
15785
15921
|
} else {
|
|
@@ -15826,16 +15962,16 @@ var require_source2 = __commonJS({
|
|
|
15826
15962
|
}
|
|
15827
15963
|
};
|
|
15828
15964
|
var chalkFactory = (options) => {
|
|
15829
|
-
const
|
|
15830
|
-
applyOptions(
|
|
15831
|
-
|
|
15832
|
-
Object.setPrototypeOf(
|
|
15833
|
-
Object.setPrototypeOf(
|
|
15834
|
-
|
|
15965
|
+
const chalk13 = {};
|
|
15966
|
+
applyOptions(chalk13, options);
|
|
15967
|
+
chalk13.template = (...arguments_) => chalkTag(chalk13.template, ...arguments_);
|
|
15968
|
+
Object.setPrototypeOf(chalk13, Chalk.prototype);
|
|
15969
|
+
Object.setPrototypeOf(chalk13.template, chalk13);
|
|
15970
|
+
chalk13.template.constructor = () => {
|
|
15835
15971
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
15836
15972
|
};
|
|
15837
|
-
|
|
15838
|
-
return
|
|
15973
|
+
chalk13.template.Instance = ChalkClass;
|
|
15974
|
+
return chalk13.template;
|
|
15839
15975
|
};
|
|
15840
15976
|
function Chalk(options) {
|
|
15841
15977
|
return chalkFactory(options);
|
|
@@ -15943,7 +16079,7 @@ var require_source2 = __commonJS({
|
|
|
15943
16079
|
return openAll + string + closeAll;
|
|
15944
16080
|
};
|
|
15945
16081
|
var template;
|
|
15946
|
-
var chalkTag = (
|
|
16082
|
+
var chalkTag = (chalk13, ...strings) => {
|
|
15947
16083
|
const [firstString] = strings;
|
|
15948
16084
|
if (!Array.isArray(firstString)) {
|
|
15949
16085
|
return strings.join(" ");
|
|
@@ -15951,19 +16087,22 @@ var require_source2 = __commonJS({
|
|
|
15951
16087
|
const arguments_ = strings.slice(1);
|
|
15952
16088
|
const parts = [firstString.raw[0]];
|
|
15953
16089
|
for (let i = 1; i < firstString.length; i++) {
|
|
15954
|
-
parts.push(
|
|
16090
|
+
parts.push(
|
|
16091
|
+
String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
16092
|
+
String(firstString.raw[i])
|
|
16093
|
+
);
|
|
15955
16094
|
}
|
|
15956
16095
|
if (template === void 0) {
|
|
15957
16096
|
template = require_templates2();
|
|
15958
16097
|
}
|
|
15959
|
-
return template(
|
|
16098
|
+
return template(chalk13, parts.join(""));
|
|
15960
16099
|
};
|
|
15961
16100
|
Object.defineProperties(Chalk.prototype, styles);
|
|
15962
|
-
var
|
|
15963
|
-
|
|
15964
|
-
|
|
15965
|
-
|
|
15966
|
-
|
|
16101
|
+
var chalk12 = Chalk();
|
|
16102
|
+
chalk12.supportsColor = stdoutColor;
|
|
16103
|
+
chalk12.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
16104
|
+
chalk12.stderr.supportsColor = stderrColor;
|
|
16105
|
+
chalk12.Level = {
|
|
15967
16106
|
None: 0,
|
|
15968
16107
|
Basic: 1,
|
|
15969
16108
|
Ansi256: 2,
|
|
@@ -15973,7 +16112,7 @@ var require_source2 = __commonJS({
|
|
|
15973
16112
|
2: "Ansi256",
|
|
15974
16113
|
3: "TrueColor"
|
|
15975
16114
|
};
|
|
15976
|
-
module2.exports =
|
|
16115
|
+
module2.exports = chalk12;
|
|
15977
16116
|
}
|
|
15978
16117
|
});
|
|
15979
16118
|
|
|
@@ -16041,10 +16180,25 @@ var require_signals = __commonJS({
|
|
|
16041
16180
|
"SIGTERM"
|
|
16042
16181
|
];
|
|
16043
16182
|
if (process.platform !== "win32") {
|
|
16044
|
-
module2.exports.push(
|
|
16183
|
+
module2.exports.push(
|
|
16184
|
+
"SIGVTALRM",
|
|
16185
|
+
"SIGXCPU",
|
|
16186
|
+
"SIGXFSZ",
|
|
16187
|
+
"SIGUSR2",
|
|
16188
|
+
"SIGTRAP",
|
|
16189
|
+
"SIGSYS",
|
|
16190
|
+
"SIGQUIT",
|
|
16191
|
+
"SIGIOT"
|
|
16192
|
+
);
|
|
16045
16193
|
}
|
|
16046
16194
|
if (process.platform === "linux") {
|
|
16047
|
-
module2.exports.push(
|
|
16195
|
+
module2.exports.push(
|
|
16196
|
+
"SIGIO",
|
|
16197
|
+
"SIGPOLL",
|
|
16198
|
+
"SIGPWR",
|
|
16199
|
+
"SIGSTKFLT",
|
|
16200
|
+
"SIGUNUSED"
|
|
16201
|
+
);
|
|
16048
16202
|
}
|
|
16049
16203
|
}
|
|
16050
16204
|
});
|
|
@@ -19009,14 +19163,14 @@ var require_templates3 = __commonJS({
|
|
|
19009
19163
|
}
|
|
19010
19164
|
return results;
|
|
19011
19165
|
}
|
|
19012
|
-
function buildStyle(
|
|
19166
|
+
function buildStyle(chalk12, styles) {
|
|
19013
19167
|
const enabled = {};
|
|
19014
19168
|
for (const layer of styles) {
|
|
19015
19169
|
for (const style of layer.styles) {
|
|
19016
19170
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
19017
19171
|
}
|
|
19018
19172
|
}
|
|
19019
|
-
let current =
|
|
19173
|
+
let current = chalk12;
|
|
19020
19174
|
for (const styleName of Object.keys(enabled)) {
|
|
19021
19175
|
if (Array.isArray(enabled[styleName])) {
|
|
19022
19176
|
if (!(styleName in current)) {
|
|
@@ -19031,7 +19185,7 @@ var require_templates3 = __commonJS({
|
|
|
19031
19185
|
}
|
|
19032
19186
|
return current;
|
|
19033
19187
|
}
|
|
19034
|
-
module2.exports = (
|
|
19188
|
+
module2.exports = (chalk12, tmp) => {
|
|
19035
19189
|
const styles = [];
|
|
19036
19190
|
const chunks = [];
|
|
19037
19191
|
let chunk = [];
|
|
@@ -19041,13 +19195,13 @@ var require_templates3 = __commonJS({
|
|
|
19041
19195
|
} else if (style) {
|
|
19042
19196
|
const str = chunk.join("");
|
|
19043
19197
|
chunk = [];
|
|
19044
|
-
chunks.push(styles.length === 0 ? str : buildStyle(
|
|
19198
|
+
chunks.push(styles.length === 0 ? str : buildStyle(chalk12, styles)(str));
|
|
19045
19199
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
19046
19200
|
} else if (close) {
|
|
19047
19201
|
if (styles.length === 0) {
|
|
19048
19202
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
19049
19203
|
}
|
|
19050
|
-
chunks.push(buildStyle(
|
|
19204
|
+
chunks.push(buildStyle(chalk12, styles)(chunk.join("")));
|
|
19051
19205
|
chunk = [];
|
|
19052
19206
|
styles.pop();
|
|
19053
19207
|
} else {
|
|
@@ -19084,16 +19238,16 @@ var require_chalk = __commonJS({
|
|
|
19084
19238
|
}
|
|
19085
19239
|
function Chalk(options) {
|
|
19086
19240
|
if (!this || !(this instanceof Chalk) || this.template) {
|
|
19087
|
-
const
|
|
19088
|
-
applyOptions(
|
|
19089
|
-
|
|
19241
|
+
const chalk12 = {};
|
|
19242
|
+
applyOptions(chalk12, options);
|
|
19243
|
+
chalk12.template = function() {
|
|
19090
19244
|
const args = [].slice.call(arguments);
|
|
19091
|
-
return chalkTag.apply(null, [
|
|
19245
|
+
return chalkTag.apply(null, [chalk12.template].concat(args));
|
|
19092
19246
|
};
|
|
19093
|
-
Object.setPrototypeOf(
|
|
19094
|
-
Object.setPrototypeOf(
|
|
19095
|
-
|
|
19096
|
-
return
|
|
19247
|
+
Object.setPrototypeOf(chalk12, Chalk.prototype);
|
|
19248
|
+
Object.setPrototypeOf(chalk12.template, chalk12);
|
|
19249
|
+
chalk12.template.constructor = Chalk;
|
|
19250
|
+
return chalk12.template;
|
|
19097
19251
|
}
|
|
19098
19252
|
applyOptions(this, options);
|
|
19099
19253
|
}
|
|
@@ -19212,7 +19366,7 @@ var require_chalk = __commonJS({
|
|
|
19212
19366
|
ansiStyles.dim.open = originalDim;
|
|
19213
19367
|
return str;
|
|
19214
19368
|
}
|
|
19215
|
-
function chalkTag(
|
|
19369
|
+
function chalkTag(chalk12, strings) {
|
|
19216
19370
|
if (!Array.isArray(strings)) {
|
|
19217
19371
|
return [].slice.call(arguments, 1).join(" ");
|
|
19218
19372
|
}
|
|
@@ -19222,7 +19376,7 @@ var require_chalk = __commonJS({
|
|
|
19222
19376
|
parts.push(String(args[i - 1]).replace(/[{}\\]/g, "\\$&"));
|
|
19223
19377
|
parts.push(String(strings.raw[i]));
|
|
19224
19378
|
}
|
|
19225
|
-
return template(
|
|
19379
|
+
return template(chalk12, parts.join(""));
|
|
19226
19380
|
}
|
|
19227
19381
|
Object.defineProperties(Chalk.prototype, styles);
|
|
19228
19382
|
module2.exports = Chalk();
|
|
@@ -19235,19 +19389,19 @@ var require_chalk = __commonJS({
|
|
|
19235
19389
|
var require_log_symbols = __commonJS({
|
|
19236
19390
|
"../../node_modules/log-symbols/index.js"(exports, module2) {
|
|
19237
19391
|
"use strict";
|
|
19238
|
-
var
|
|
19392
|
+
var chalk12 = require_chalk();
|
|
19239
19393
|
var isSupported = process.platform !== "win32" || process.env.CI || process.env.TERM === "xterm-256color";
|
|
19240
19394
|
var main = {
|
|
19241
|
-
info:
|
|
19242
|
-
success:
|
|
19243
|
-
warning:
|
|
19244
|
-
error:
|
|
19395
|
+
info: chalk12.blue("\u2139"),
|
|
19396
|
+
success: chalk12.green("\u2714"),
|
|
19397
|
+
warning: chalk12.yellow("\u26A0"),
|
|
19398
|
+
error: chalk12.red("\u2716")
|
|
19245
19399
|
};
|
|
19246
19400
|
var fallbacks = {
|
|
19247
|
-
info:
|
|
19248
|
-
success:
|
|
19249
|
-
warning:
|
|
19250
|
-
error:
|
|
19401
|
+
info: chalk12.blue("i"),
|
|
19402
|
+
success: chalk12.green("\u221A"),
|
|
19403
|
+
warning: chalk12.yellow("\u203C"),
|
|
19404
|
+
error: chalk12.red("\xD7")
|
|
19251
19405
|
};
|
|
19252
19406
|
module2.exports = isSupported ? main : fallbacks;
|
|
19253
19407
|
}
|
|
@@ -19632,7 +19786,9 @@ var require_is_interactive = __commonJS({
|
|
|
19632
19786
|
"../../node_modules/is-interactive/index.js"(exports, module2) {
|
|
19633
19787
|
"use strict";
|
|
19634
19788
|
module2.exports = ({ stream = process.stdout } = {}) => {
|
|
19635
|
-
return Boolean(
|
|
19789
|
+
return Boolean(
|
|
19790
|
+
stream && stream.isTTY && process.env.TERM !== "dumb" && !("CI" in process.env)
|
|
19791
|
+
);
|
|
19636
19792
|
};
|
|
19637
19793
|
}
|
|
19638
19794
|
});
|
|
@@ -19771,7 +19927,7 @@ var require_ora = __commonJS({
|
|
|
19771
19927
|
"../../node_modules/ora/index.js"(exports, module2) {
|
|
19772
19928
|
"use strict";
|
|
19773
19929
|
var readline2 = require("readline");
|
|
19774
|
-
var
|
|
19930
|
+
var chalk12 = require_source2();
|
|
19775
19931
|
var cliCursor = require_cli_cursor();
|
|
19776
19932
|
var cliSpinners = require_cli_spinners();
|
|
19777
19933
|
var logSymbols = require_log_symbols();
|
|
@@ -19939,7 +20095,7 @@ var require_ora = __commonJS({
|
|
|
19939
20095
|
const { frames } = this.spinner;
|
|
19940
20096
|
let frame = frames[this.frameIndex];
|
|
19941
20097
|
if (this.color) {
|
|
19942
|
-
frame =
|
|
20098
|
+
frame = chalk12[this.color](frame);
|
|
19943
20099
|
}
|
|
19944
20100
|
this.frameIndex = ++this.frameIndex % frames.length;
|
|
19945
20101
|
const fullPrefixText = typeof this.prefixText === "string" && this.prefixText !== "" ? this.prefixText + " " : "";
|
|
@@ -21681,7 +21837,7 @@ var require_stream_readable = __commonJS({
|
|
|
21681
21837
|
debug("ondata");
|
|
21682
21838
|
increasedAwaitDrain = false;
|
|
21683
21839
|
var ret = dest.write(chunk);
|
|
21684
|
-
if (
|
|
21840
|
+
if (false === ret && !increasedAwaitDrain) {
|
|
21685
21841
|
if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
|
|
21686
21842
|
debug("false write response, pause", src._readableState.awaitDrain);
|
|
21687
21843
|
src._readableState.awaitDrain++;
|
|
@@ -21823,7 +21979,7 @@ var require_stream_readable = __commonJS({
|
|
|
21823
21979
|
}
|
|
21824
21980
|
Readable.prototype.pause = function() {
|
|
21825
21981
|
debug("call pause flowing=%j", this._readableState.flowing);
|
|
21826
|
-
if (this._readableState.flowing
|
|
21982
|
+
if (false !== this._readableState.flowing) {
|
|
21827
21983
|
debug("pause");
|
|
21828
21984
|
this._readableState.flowing = false;
|
|
21829
21985
|
this.emit("pause");
|
|
@@ -22951,7 +23107,9 @@ var require_utils3 = __commonJS({
|
|
|
22951
23107
|
return promise.then(function(data) {
|
|
22952
23108
|
var dataType = exports.getTypeOf(data);
|
|
22953
23109
|
if (!dataType) {
|
|
22954
|
-
return external.Promise.reject(
|
|
23110
|
+
return external.Promise.reject(
|
|
23111
|
+
new Error("Can't read the data of '" + name + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?")
|
|
23112
|
+
);
|
|
22955
23113
|
}
|
|
22956
23114
|
if (dataType === "arraybuffer") {
|
|
22957
23115
|
data = exports.transformTo("uint8array", data);
|
|
@@ -25308,7 +25466,10 @@ var require_deflate = __commonJS({
|
|
|
25308
25466
|
put_byte(s, OS_CODE);
|
|
25309
25467
|
s.status = BUSY_STATE;
|
|
25310
25468
|
} else {
|
|
25311
|
-
put_byte(
|
|
25469
|
+
put_byte(
|
|
25470
|
+
s,
|
|
25471
|
+
(s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (!s.gzhead.extra ? 0 : 4) + (!s.gzhead.name ? 0 : 8) + (!s.gzhead.comment ? 0 : 16)
|
|
25472
|
+
);
|
|
25312
25473
|
put_byte(s, s.gzhead.time & 255);
|
|
25313
25474
|
put_byte(s, s.gzhead.time >> 8 & 255);
|
|
25314
25475
|
put_byte(s, s.gzhead.time >> 16 & 255);
|
|
@@ -25823,7 +25984,14 @@ var require_deflate2 = __commonJS({
|
|
|
25823
25984
|
this.chunks = [];
|
|
25824
25985
|
this.strm = new ZStream();
|
|
25825
25986
|
this.strm.avail_out = 0;
|
|
25826
|
-
var status = zlib_deflate.deflateInit2(
|
|
25987
|
+
var status = zlib_deflate.deflateInit2(
|
|
25988
|
+
this.strm,
|
|
25989
|
+
opt.level,
|
|
25990
|
+
opt.method,
|
|
25991
|
+
opt.windowBits,
|
|
25992
|
+
opt.memLevel,
|
|
25993
|
+
opt.strategy
|
|
25994
|
+
);
|
|
25827
25995
|
if (status !== Z_OK) {
|
|
25828
25996
|
throw new Error(msg[status]);
|
|
25829
25997
|
}
|
|
@@ -26931,7 +27099,13 @@ var require_inflate = __commonJS({
|
|
|
26931
27099
|
if (!state.head.extra) {
|
|
26932
27100
|
state.head.extra = new Array(state.head.extra_len);
|
|
26933
27101
|
}
|
|
26934
|
-
utils.arraySet(
|
|
27102
|
+
utils.arraySet(
|
|
27103
|
+
state.head.extra,
|
|
27104
|
+
input,
|
|
27105
|
+
next,
|
|
27106
|
+
copy,
|
|
27107
|
+
len
|
|
27108
|
+
);
|
|
26935
27109
|
}
|
|
26936
27110
|
if (state.flags & 512) {
|
|
26937
27111
|
state.check = crc32(state.check, input, copy, next);
|
|
@@ -27775,7 +27949,10 @@ var require_inflate2 = __commonJS({
|
|
|
27775
27949
|
this.chunks = [];
|
|
27776
27950
|
this.strm = new ZStream();
|
|
27777
27951
|
this.strm.avail_out = 0;
|
|
27778
|
-
var status = zlib_inflate.inflateInit2(
|
|
27952
|
+
var status = zlib_inflate.inflateInit2(
|
|
27953
|
+
this.strm,
|
|
27954
|
+
opt.windowBits
|
|
27955
|
+
);
|
|
27779
27956
|
if (status !== c.Z_OK) {
|
|
27780
27957
|
throw new Error(msg[status]);
|
|
27781
27958
|
}
|
|
@@ -28631,7 +28808,14 @@ var require_DataReader = __commonJS({
|
|
|
28631
28808
|
},
|
|
28632
28809
|
readDate: function() {
|
|
28633
28810
|
var dostime = this.readInt(4);
|
|
28634
|
-
return new Date(Date.UTC(
|
|
28811
|
+
return new Date(Date.UTC(
|
|
28812
|
+
(dostime >> 25 & 127) + 1980,
|
|
28813
|
+
(dostime >> 21 & 15) - 1,
|
|
28814
|
+
dostime >> 16 & 31,
|
|
28815
|
+
dostime >> 11 & 31,
|
|
28816
|
+
dostime >> 5 & 63,
|
|
28817
|
+
(dostime & 31) << 1
|
|
28818
|
+
));
|
|
28635
28819
|
}
|
|
28636
28820
|
};
|
|
28637
28821
|
module2.exports = DataReader;
|
|
@@ -34521,7 +34705,7 @@ ${cbNode.commentBefore}` : cb;
|
|
|
34521
34705
|
if (comment)
|
|
34522
34706
|
directiveComments.push(comment);
|
|
34523
34707
|
}
|
|
34524
|
-
if (prevDoc && !hasDirectives && (doc.version || prevDoc.version || doc.options.version)
|
|
34708
|
+
if (prevDoc && !hasDirectives && "1.1" === (doc.version || prevDoc.version || doc.options.version)) {
|
|
34525
34709
|
const copyTagPrefix = ({
|
|
34526
34710
|
handle,
|
|
34527
34711
|
prefix
|
|
@@ -35507,9 +35691,11 @@ var require_lib4 = __commonJS({
|
|
|
35507
35691
|
});
|
|
35508
35692
|
}
|
|
35509
35693
|
;
|
|
35510
|
-
totalWidth = (colWidths.length == 1 ? colWidths[0] : colWidths.reduce(
|
|
35511
|
-
|
|
35512
|
-
|
|
35694
|
+
totalWidth = (colWidths.length == 1 ? colWidths[0] : colWidths.reduce(
|
|
35695
|
+
function(a, b) {
|
|
35696
|
+
return a + b;
|
|
35697
|
+
}
|
|
35698
|
+
)) + colWidths.length + 1;
|
|
35513
35699
|
function extractColumnWidths(arr, offset) {
|
|
35514
35700
|
var offset = offset || 0;
|
|
35515
35701
|
arr.forEach(function(cell, i) {
|
|
@@ -35532,7 +35718,12 @@ var require_lib4 = __commonJS({
|
|
|
35532
35718
|
}
|
|
35533
35719
|
;
|
|
35534
35720
|
function lineTop() {
|
|
35535
|
-
var l2 = line(
|
|
35721
|
+
var l2 = line(
|
|
35722
|
+
chars.top,
|
|
35723
|
+
chars["top-left"] || chars.top,
|
|
35724
|
+
chars["top-right"] || chars.top,
|
|
35725
|
+
chars["top-mid"]
|
|
35726
|
+
);
|
|
35536
35727
|
if (l2)
|
|
35537
35728
|
ret += l2 + "\n";
|
|
35538
35729
|
}
|
|
@@ -35614,7 +35805,12 @@ var require_lib4 = __commonJS({
|
|
|
35614
35805
|
lineTop();
|
|
35615
35806
|
else {
|
|
35616
35807
|
if (!style.compact || i < !!head.length ? 1 : cells.length == 0) {
|
|
35617
|
-
var l2 = line(
|
|
35808
|
+
var l2 = line(
|
|
35809
|
+
chars.mid,
|
|
35810
|
+
chars["left-mid"],
|
|
35811
|
+
chars["right-mid"],
|
|
35812
|
+
chars["mid-mid"]
|
|
35813
|
+
);
|
|
35618
35814
|
if (l2)
|
|
35619
35815
|
ret += l2 + "\n";
|
|
35620
35816
|
}
|
|
@@ -35626,7 +35822,12 @@ var require_lib4 = __commonJS({
|
|
|
35626
35822
|
}
|
|
35627
35823
|
;
|
|
35628
35824
|
});
|
|
35629
|
-
var l = line(
|
|
35825
|
+
var l = line(
|
|
35826
|
+
chars.bottom,
|
|
35827
|
+
chars["bottom-left"] || chars.bottom,
|
|
35828
|
+
chars["bottom-right"] || chars.bottom,
|
|
35829
|
+
chars["bottom-mid"]
|
|
35830
|
+
);
|
|
35630
35831
|
if (l)
|
|
35631
35832
|
ret += l;
|
|
35632
35833
|
else
|
|
@@ -35640,6 +35841,7 @@ var require_lib4 = __commonJS({
|
|
|
35640
35841
|
|
|
35641
35842
|
// src/index.ts
|
|
35642
35843
|
var src_exports = {};
|
|
35844
|
+
module.exports = __toCommonJS(src_exports);
|
|
35643
35845
|
|
|
35644
35846
|
// ../../node_modules/yargs/lib/platform-shims/esm.mjs
|
|
35645
35847
|
var import_assert = require("assert");
|
|
@@ -40462,6 +40664,9 @@ function isYargsInstance(y) {
|
|
|
40462
40664
|
var Yargs = YargsFactory(esm_default);
|
|
40463
40665
|
var yargs_default = Yargs;
|
|
40464
40666
|
|
|
40667
|
+
// src/index.ts
|
|
40668
|
+
var import_api_schemas7 = __toESM(require_src2());
|
|
40669
|
+
|
|
40465
40670
|
// src/commands/login.ts
|
|
40466
40671
|
var login_exports = {};
|
|
40467
40672
|
__export(login_exports, {
|
|
@@ -40502,7 +40707,11 @@ async function saveAuthToken(token) {
|
|
|
40502
40707
|
} catch (ex) {
|
|
40503
40708
|
await import_fs5.default.promises.mkdir(goldSkyDir);
|
|
40504
40709
|
}
|
|
40505
|
-
await import_fs5.default.promises.writeFile(
|
|
40710
|
+
await import_fs5.default.promises.writeFile(
|
|
40711
|
+
import_path5.default.join(goldSkyDir, "auth_token"),
|
|
40712
|
+
token,
|
|
40713
|
+
"utf8"
|
|
40714
|
+
);
|
|
40506
40715
|
}
|
|
40507
40716
|
async function clearAuthToken() {
|
|
40508
40717
|
const homeDir = import_os.default.homedir();
|
|
@@ -40518,7 +40727,38 @@ var import_chalk = __toESM(require_source());
|
|
|
40518
40727
|
var import_readline = __toESM(require("readline"));
|
|
40519
40728
|
var import_axios = __toESM(require_axios4());
|
|
40520
40729
|
var import_ora = __toESM(require_ora());
|
|
40730
|
+
async function checkToken(token, opts) {
|
|
40731
|
+
applyAuthToken(token);
|
|
40732
|
+
console.log();
|
|
40733
|
+
const spinner = (0, import_ora.default)("Validating API Token").start();
|
|
40734
|
+
try {
|
|
40735
|
+
const response = await import_axios.default.get(`${opts.apiHost}/auth/check_token`, {
|
|
40736
|
+
headers: {
|
|
40737
|
+
Authorization: `Bearer ${token}`
|
|
40738
|
+
},
|
|
40739
|
+
validateStatus: (_) => true
|
|
40740
|
+
});
|
|
40741
|
+
if (response.status === 200 && response.data.success) {
|
|
40742
|
+
await saveAuthToken(token);
|
|
40743
|
+
spinner.succeed(
|
|
40744
|
+
`${import_chalk.default.bold(
|
|
40745
|
+
`Logged in to project '${response.data.project.name}'`
|
|
40746
|
+
)} You can now run any authenticated commands on Goldsky from this computer`
|
|
40747
|
+
);
|
|
40748
|
+
return;
|
|
40749
|
+
}
|
|
40750
|
+
} catch (ex) {
|
|
40751
|
+
}
|
|
40752
|
+
spinner.fail(
|
|
40753
|
+
`${import_chalk.default.bold(
|
|
40754
|
+
"Login failed"
|
|
40755
|
+
)}. Make sure you entered your API token correctly - or contact Goldsky for more assistance`
|
|
40756
|
+
);
|
|
40757
|
+
}
|
|
40521
40758
|
async function login(opts) {
|
|
40759
|
+
if (opts.token) {
|
|
40760
|
+
return checkToken(opts.token, opts);
|
|
40761
|
+
}
|
|
40522
40762
|
const rl = import_readline.default.createInterface({
|
|
40523
40763
|
input: process.stdin,
|
|
40524
40764
|
output: process.stdout
|
|
@@ -40526,24 +40766,7 @@ async function login(opts) {
|
|
|
40526
40766
|
rl.stdoutMuted = true;
|
|
40527
40767
|
rl.question("Enter or paste in your Goldsky API token: ", async (token) => {
|
|
40528
40768
|
rl.close();
|
|
40529
|
-
|
|
40530
|
-
console.log();
|
|
40531
|
-
const spinner = (0, import_ora.default)("Validating API Token").start();
|
|
40532
|
-
try {
|
|
40533
|
-
const response = await import_axios.default.get(`${opts.apiHost}/auth/check_token`, {
|
|
40534
|
-
headers: {
|
|
40535
|
-
Authorization: `Bearer ${token}`
|
|
40536
|
-
},
|
|
40537
|
-
validateStatus: (_) => true
|
|
40538
|
-
});
|
|
40539
|
-
if (response.status === 200 && response.data.success) {
|
|
40540
|
-
await saveAuthToken(token);
|
|
40541
|
-
spinner.succeed(`${import_chalk.default.bold(`Logged in to project '${response.data.project.name}'`)} You can now run any authenticated commands on Goldsky from this computer`);
|
|
40542
|
-
return;
|
|
40543
|
-
}
|
|
40544
|
-
} catch (ex) {
|
|
40545
|
-
}
|
|
40546
|
-
spinner.fail(`${import_chalk.default.bold("Login failed")}. Make sure you entered your API token correctly - or contact Goldsky for more assistance`);
|
|
40769
|
+
await checkToken(token, opts);
|
|
40547
40770
|
});
|
|
40548
40771
|
rl._writeToOutput = () => {
|
|
40549
40772
|
if (process.stdout.isTTY) {
|
|
@@ -40553,17 +40776,22 @@ async function login(opts) {
|
|
|
40553
40776
|
}
|
|
40554
40777
|
async function logout(_opts) {
|
|
40555
40778
|
clearAuthToken();
|
|
40556
|
-
console.log(
|
|
40779
|
+
console.log(
|
|
40780
|
+
`${import_chalk.default.bold(
|
|
40781
|
+
"Logged out"
|
|
40782
|
+
)}. You will need to log in again if you want to run authenticated commands on this computer in future`
|
|
40783
|
+
);
|
|
40557
40784
|
}
|
|
40558
40785
|
|
|
40559
40786
|
// src/commands/login.ts
|
|
40560
40787
|
var command2 = "login";
|
|
40561
40788
|
var describe = "Log in to Goldsky to enable running authenticated CLI commands";
|
|
40562
|
-
var builder = (yargs) => yargs.
|
|
40563
|
-
|
|
40564
|
-
|
|
40565
|
-
|
|
40566
|
-
|
|
40789
|
+
var builder = (yargs) => yargs.option("token", {
|
|
40790
|
+
describe: "CLI Auth Token",
|
|
40791
|
+
type: "string"
|
|
40792
|
+
});
|
|
40793
|
+
var handler = async ({ apiHost, token }) => {
|
|
40794
|
+
await login({ apiHost, token });
|
|
40567
40795
|
};
|
|
40568
40796
|
|
|
40569
40797
|
// src/commands/logout.ts
|
|
@@ -40607,16 +40835,21 @@ var import_api_schemas2 = __toESM(require_src2());
|
|
|
40607
40835
|
var import_ora2 = __toESM(require_ora());
|
|
40608
40836
|
async function remove(opts) {
|
|
40609
40837
|
const spinner = (0, import_ora2.default)("Removing subgraph").start();
|
|
40610
|
-
const [err, _data] = await import_api_schemas2.ApiFetch.delete_(
|
|
40611
|
-
params
|
|
40612
|
-
|
|
40613
|
-
|
|
40838
|
+
const [err, _data] = await import_api_schemas2.ApiFetch.delete_(
|
|
40839
|
+
(params) => `/api/admin/subgraph/v1/subgraphs/${params.name}/deployments/${params.version_label}`,
|
|
40840
|
+
{
|
|
40841
|
+
params: {
|
|
40842
|
+
name: opts.name,
|
|
40843
|
+
version_label: opts.v
|
|
40844
|
+
}
|
|
40614
40845
|
}
|
|
40615
|
-
|
|
40846
|
+
);
|
|
40616
40847
|
if (!err) {
|
|
40617
40848
|
spinner.succeed(import_chalk2.default.bold("Removed subgraph"));
|
|
40618
40849
|
} else {
|
|
40619
|
-
spinner.fail(
|
|
40850
|
+
spinner.fail(
|
|
40851
|
+
`${import_chalk2.default.bold("Subgraph removal failed:")} ${import_chalk2.default.red(err.message)}`
|
|
40852
|
+
);
|
|
40620
40853
|
}
|
|
40621
40854
|
}
|
|
40622
40855
|
|
|
@@ -40691,29 +40924,42 @@ async function deploy_default(opts) {
|
|
|
40691
40924
|
console.log(import_chalk3.default.bold(`Deploying Subgraph:`));
|
|
40692
40925
|
const buildValidation = await validateBuild(opts.path);
|
|
40693
40926
|
if (!buildValidation.isValid) {
|
|
40694
|
-
console.log(
|
|
40927
|
+
console.log(
|
|
40928
|
+
`Deployment failed: This path doesn't point to a subgraph build path`
|
|
40929
|
+
);
|
|
40695
40930
|
return;
|
|
40696
40931
|
}
|
|
40697
40932
|
const bundle = await packageBuild(buildValidation.buildPath);
|
|
40698
40933
|
const spinner = (0, import_ora4.default)("Deploying to Goldsky").start();
|
|
40699
40934
|
const form = import_api_schemas3.ApiFetch.FormData();
|
|
40700
|
-
form.append(
|
|
40935
|
+
form.append(
|
|
40936
|
+
"bundle",
|
|
40937
|
+
bundle.generateNodeStream({ streamFiles: true }),
|
|
40938
|
+
"bundle.zip"
|
|
40939
|
+
);
|
|
40701
40940
|
form.append("overwrite", opts.overwrite ? "1" : "0");
|
|
40702
|
-
const [err, data] = await import_api_schemas3.ApiFetch.put(
|
|
40703
|
-
params
|
|
40704
|
-
|
|
40705
|
-
|
|
40706
|
-
|
|
40707
|
-
|
|
40708
|
-
|
|
40941
|
+
const [err, data] = await import_api_schemas3.ApiFetch.put(
|
|
40942
|
+
(params) => `/api/admin/subgraph/v1/subgraphs/${params.name}/deployments/${params.version_label}`,
|
|
40943
|
+
{
|
|
40944
|
+
params: {
|
|
40945
|
+
name: opts.name,
|
|
40946
|
+
version_label: opts.v
|
|
40947
|
+
},
|
|
40948
|
+
body: form
|
|
40949
|
+
}
|
|
40950
|
+
);
|
|
40709
40951
|
if (!err) {
|
|
40710
40952
|
spinner.succeed();
|
|
40711
40953
|
console.log();
|
|
40712
|
-
console.log(
|
|
40954
|
+
console.log(
|
|
40955
|
+
`${import_chalk3.default.bold("Deployed subgraph API:")} ${opts.apiHost}${data.data.subgraph.graphql_endpoint}`
|
|
40956
|
+
);
|
|
40713
40957
|
} else {
|
|
40714
40958
|
spinner.fail();
|
|
40715
40959
|
console.log();
|
|
40716
|
-
console.log(
|
|
40960
|
+
console.log(
|
|
40961
|
+
`${import_chalk3.default.bold("Deployment failed:")} ${import_chalk3.default.red(err.message)}`
|
|
40962
|
+
);
|
|
40717
40963
|
}
|
|
40718
40964
|
}
|
|
40719
40965
|
async function packageBuild(buildPath) {
|
|
@@ -40724,13 +40970,18 @@ async function packageBuild(buildPath) {
|
|
|
40724
40970
|
type: "nodebuffer",
|
|
40725
40971
|
streamFiles: true
|
|
40726
40972
|
});
|
|
40727
|
-
const subgraphContent = await import_fs7.default.promises.readFile(
|
|
40728
|
-
|
|
40729
|
-
|
|
40973
|
+
const subgraphContent = await import_fs7.default.promises.readFile(
|
|
40974
|
+
import_path7.default.join(buildPath, "subgraph.yaml"),
|
|
40975
|
+
{
|
|
40976
|
+
encoding: "utf8"
|
|
40977
|
+
}
|
|
40978
|
+
);
|
|
40730
40979
|
const subgraph = import_yaml.default.parse(subgraphContent);
|
|
40731
40980
|
bundle.file("subgraph.yaml", subgraphContent);
|
|
40732
40981
|
const schemaFile = subgraph.schema.file;
|
|
40733
|
-
const schemaContent = await import_fs7.default.promises.readFile(
|
|
40982
|
+
const schemaContent = await import_fs7.default.promises.readFile(
|
|
40983
|
+
import_path7.default.join(buildPath, schemaFile)
|
|
40984
|
+
);
|
|
40734
40985
|
bundle.file(schemaFile, schemaContent);
|
|
40735
40986
|
for (let dataSource of subgraph.dataSources) {
|
|
40736
40987
|
const mapping = dataSource.mapping;
|
|
@@ -40739,7 +40990,9 @@ async function packageBuild(buildPath) {
|
|
|
40739
40990
|
...mapping.abis.map((a) => a.file)
|
|
40740
40991
|
];
|
|
40741
40992
|
for (let abiFile of abiFiles) {
|
|
40742
|
-
const abiContent = await import_fs7.default.promises.readFile(
|
|
40993
|
+
const abiContent = await import_fs7.default.promises.readFile(
|
|
40994
|
+
import_path7.default.join(buildPath, abiFile)
|
|
40995
|
+
);
|
|
40743
40996
|
bundle.file(abiFile, abiContent);
|
|
40744
40997
|
}
|
|
40745
40998
|
}
|
|
@@ -40810,37 +41063,74 @@ async function list_default(opts) {
|
|
|
40810
41063
|
if (!err) {
|
|
40811
41064
|
spinner.stop();
|
|
40812
41065
|
if (data.data.length === 0) {
|
|
40813
|
-
console.log(
|
|
41066
|
+
console.log(
|
|
41067
|
+
import_chalk4.default.bold("No subgraphs found."),
|
|
41068
|
+
"Run 'goldsky subgraph deploy --help' for information on deploying a subgraph"
|
|
41069
|
+
);
|
|
40814
41070
|
} else {
|
|
40815
41071
|
console.log(import_chalk4.default.bold("Subgraphs"));
|
|
40816
41072
|
for (const sg of data.data) {
|
|
40817
41073
|
if (sg.tag) {
|
|
40818
41074
|
if (sg.tag.target_version) {
|
|
40819
|
-
console.log(
|
|
41075
|
+
console.log(
|
|
41076
|
+
import_chalk4.default.bold(
|
|
41077
|
+
`* ${sg.name}/${sg.version} -> ${sg.name}/${sg.tag.target_version}`
|
|
41078
|
+
)
|
|
41079
|
+
);
|
|
40820
41080
|
} else {
|
|
40821
|
-
console.log(
|
|
41081
|
+
console.log(
|
|
41082
|
+
import_chalk4.default.bold(`* ${sg.name}/${sg.version} -> [no target]`)
|
|
41083
|
+
);
|
|
40822
41084
|
}
|
|
40823
41085
|
} else {
|
|
40824
41086
|
console.log(import_chalk4.default.bold(`* ${sg.name}/${sg.version}`));
|
|
40825
41087
|
}
|
|
40826
41088
|
if (opts.details && sg.deployments.length) {
|
|
40827
41089
|
const detail = sg.deployments[0];
|
|
40828
|
-
console.log(
|
|
40829
|
-
|
|
40830
|
-
|
|
41090
|
+
console.log(
|
|
41091
|
+
" ",
|
|
41092
|
+
"GraphQL API:",
|
|
41093
|
+
import_api_schemas4.ApiFetch.getPath(sg.graphql_endpoint, {})
|
|
41094
|
+
);
|
|
41095
|
+
console.log(
|
|
41096
|
+
" ",
|
|
41097
|
+
"Created:",
|
|
41098
|
+
new Date(detail.created_at * 1e3).toLocaleString()
|
|
41099
|
+
);
|
|
41100
|
+
console.log(
|
|
41101
|
+
" ",
|
|
41102
|
+
"Status:",
|
|
41103
|
+
`${import_chalk4.default[detail.health === "healthy" ? "green" : "red"](
|
|
41104
|
+
detail.health
|
|
41105
|
+
)}`
|
|
41106
|
+
);
|
|
40831
41107
|
if (detail.fatal_error) {
|
|
40832
|
-
console.log(
|
|
40833
|
-
|
|
40834
|
-
|
|
41108
|
+
console.log(
|
|
41109
|
+
" ",
|
|
41110
|
+
"Fatal error:",
|
|
41111
|
+
import_chalk4.default.red(detail.fatal_error.replace(/\t/g, "\r\n "))
|
|
41112
|
+
);
|
|
41113
|
+
}
|
|
41114
|
+
console.log(
|
|
41115
|
+
" ",
|
|
41116
|
+
"Synced:",
|
|
41117
|
+
`${detail.synced ? import_chalk4.default.green("\u2714") : `${((_a = detail.indexing_progress) == null ? void 0 : _a.progress_percent.toPrecision(3)) || 0}%`}`
|
|
41118
|
+
);
|
|
40835
41119
|
if (detail.indexing_progress) {
|
|
40836
|
-
console.log(
|
|
41120
|
+
console.log(
|
|
41121
|
+
" ",
|
|
41122
|
+
"Blocks indexed:",
|
|
41123
|
+
`${detail.indexing_progress.deployment_start_block} -> ${detail.indexing_progress.deployment_head_block}`
|
|
41124
|
+
);
|
|
40837
41125
|
console.log(" ", "Chain:", (_b = detail.indexing_progress) == null ? void 0 : _b.network);
|
|
40838
41126
|
}
|
|
40839
41127
|
}
|
|
40840
41128
|
}
|
|
40841
41129
|
}
|
|
40842
41130
|
} else {
|
|
40843
|
-
spinner.fail(
|
|
41131
|
+
spinner.fail(
|
|
41132
|
+
`${import_chalk4.default.bold("Subgraph listing failed:")} ${import_chalk4.default.red(err.message)}`
|
|
41133
|
+
);
|
|
40844
41134
|
}
|
|
40845
41135
|
}
|
|
40846
41136
|
|
|
@@ -40897,40 +41187,54 @@ async function tag_default(opts) {
|
|
|
40897
41187
|
const apiPath = (params) => `/api/admin/subgraph/v1/subgraphs/${params.name}/tags/${params.version_label}`;
|
|
40898
41188
|
if (opts.remove) {
|
|
40899
41189
|
const spinner = (0, import_ora6.default)("Removing tag").start();
|
|
40900
|
-
const [err, _data] = await import_api_schemas5.ApiFetch.delete_(
|
|
40901
|
-
|
|
40902
|
-
|
|
40903
|
-
|
|
41190
|
+
const [err, _data] = await import_api_schemas5.ApiFetch.delete_(
|
|
41191
|
+
apiPath,
|
|
41192
|
+
{
|
|
41193
|
+
params: {
|
|
41194
|
+
name: opts.name,
|
|
41195
|
+
version_label: opts.v
|
|
41196
|
+
}
|
|
40904
41197
|
}
|
|
40905
|
-
|
|
41198
|
+
);
|
|
40906
41199
|
if (!err) {
|
|
40907
|
-
spinner.succeed(
|
|
40908
|
-
|
|
40909
|
-
|
|
40910
|
-
|
|
41200
|
+
spinner.succeed(
|
|
41201
|
+
`${import_chalk5.default.bold("Removed tag:")} ${apiPath({
|
|
41202
|
+
name: opts.name,
|
|
41203
|
+
version_label: opts.v
|
|
41204
|
+
})}`
|
|
41205
|
+
);
|
|
40911
41206
|
} else {
|
|
40912
|
-
spinner.fail(
|
|
41207
|
+
spinner.fail(
|
|
41208
|
+
`${import_chalk5.default.bold("Tag removal failed:")} ${import_chalk5.default.red(err.message)}`
|
|
41209
|
+
);
|
|
40913
41210
|
}
|
|
40914
41211
|
} else {
|
|
40915
41212
|
const spinner = (0, import_ora6.default)("Tagging subgraph").start();
|
|
40916
|
-
const [err, data] = await import_api_schemas5.ApiFetch.put(
|
|
40917
|
-
|
|
40918
|
-
|
|
40919
|
-
|
|
40920
|
-
|
|
40921
|
-
|
|
40922
|
-
|
|
41213
|
+
const [err, data] = await import_api_schemas5.ApiFetch.put(
|
|
41214
|
+
apiPath,
|
|
41215
|
+
{
|
|
41216
|
+
params: {
|
|
41217
|
+
name: opts.name,
|
|
41218
|
+
version_label: opts.v
|
|
41219
|
+
},
|
|
41220
|
+
body: {
|
|
41221
|
+
target_version: opts.t
|
|
41222
|
+
}
|
|
40923
41223
|
}
|
|
40924
|
-
|
|
41224
|
+
);
|
|
40925
41225
|
if (!err) {
|
|
40926
41226
|
spinner.succeed(`${import_chalk5.default.bold("Tagged subgraph:")}
|
|
40927
41227
|
${apiPath({ name: opts.name, version_label: opts.v })} ->
|
|
40928
41228
|
${opts.t ? apiPath({ name: opts.name, version_label: opts.t }) : "null"}`);
|
|
40929
41229
|
if (data.data.subgraph.deployments.length) {
|
|
40930
|
-
console.log(
|
|
41230
|
+
console.log(
|
|
41231
|
+
`${import_chalk5.default.bold("GraphQL API:")} ${opts.apiHost}${data.data.subgraph.graphql_endpoint}`
|
|
41232
|
+
);
|
|
40931
41233
|
}
|
|
40932
41234
|
} else {
|
|
40933
|
-
spinner.fail(
|
|
41235
|
+
spinner.fail(
|
|
41236
|
+
`${import_chalk5.default.bold("Tagging failed:")} ${import_chalk5.default.red(err.message)}`
|
|
41237
|
+
);
|
|
40934
41238
|
}
|
|
40935
41239
|
}
|
|
40936
41240
|
}
|
|
@@ -41029,35 +41333,47 @@ var import_chalk6 = __toESM(require_source());
|
|
|
41029
41333
|
var import_cli_table = __toESM(require_lib4());
|
|
41030
41334
|
async function createWebhook(opts) {
|
|
41031
41335
|
const spinner = (0, import_ora7.default)("Creating webhook").start();
|
|
41032
|
-
const [err, data] = await import_api_schemas6.ApiFetch.post(
|
|
41033
|
-
params
|
|
41034
|
-
|
|
41035
|
-
|
|
41036
|
-
|
|
41037
|
-
|
|
41038
|
-
|
|
41039
|
-
|
|
41040
|
-
|
|
41336
|
+
const [err, data] = await import_api_schemas6.ApiFetch.post(
|
|
41337
|
+
(params) => `/api/admin/subgraph/v1/webhooks/${params.subgraphName}/${params.subgraphVersion}`,
|
|
41338
|
+
{
|
|
41339
|
+
params: {
|
|
41340
|
+
subgraphName: opts.subgraphName,
|
|
41341
|
+
subgraphVersion: opts.subgraphVersion
|
|
41342
|
+
},
|
|
41343
|
+
body: {
|
|
41344
|
+
name: opts.name,
|
|
41345
|
+
webhookUrl: opts.webhookUrl,
|
|
41346
|
+
entity: opts.entity
|
|
41347
|
+
}
|
|
41041
41348
|
}
|
|
41042
|
-
|
|
41349
|
+
);
|
|
41043
41350
|
if (!err) {
|
|
41044
41351
|
spinner.succeed();
|
|
41045
41352
|
console.log();
|
|
41046
41353
|
console.log(`Webhook '${import_chalk6.default.bold(data.data.name)}' created.`);
|
|
41047
|
-
console.log(
|
|
41354
|
+
console.log(
|
|
41355
|
+
`Make sure calls to your endpoint have the following value for the 'goldsky-webhook-secret' header: ${import_chalk6.default.bold(
|
|
41356
|
+
`${data.data.webhookSecret}`
|
|
41357
|
+
)}`
|
|
41358
|
+
);
|
|
41048
41359
|
} else {
|
|
41049
41360
|
spinner.fail();
|
|
41050
41361
|
console.log();
|
|
41051
|
-
console.log(
|
|
41362
|
+
console.log(
|
|
41363
|
+
`${import_chalk6.default.bold("Webhook creation failed:")} ${import_chalk6.default.red(err.message)}`
|
|
41364
|
+
);
|
|
41052
41365
|
}
|
|
41053
41366
|
}
|
|
41054
41367
|
async function deleteWebhook(opts) {
|
|
41055
41368
|
const spinner = (0, import_ora7.default)("Deleting webhook").start();
|
|
41056
|
-
const [err] = await import_api_schemas6.ApiFetch.delete_(
|
|
41057
|
-
params
|
|
41058
|
-
|
|
41369
|
+
const [err] = await import_api_schemas6.ApiFetch.delete_(
|
|
41370
|
+
(params) => `/api/admin/subgraph/v1/webhooks/${params.name}`,
|
|
41371
|
+
{
|
|
41372
|
+
params: {
|
|
41373
|
+
name: opts.name
|
|
41374
|
+
}
|
|
41059
41375
|
}
|
|
41060
|
-
|
|
41376
|
+
);
|
|
41061
41377
|
if (!err) {
|
|
41062
41378
|
spinner.succeed();
|
|
41063
41379
|
console.log();
|
|
@@ -41065,7 +41381,9 @@ async function deleteWebhook(opts) {
|
|
|
41065
41381
|
} else {
|
|
41066
41382
|
spinner.fail();
|
|
41067
41383
|
console.log();
|
|
41068
|
-
console.log(
|
|
41384
|
+
console.log(
|
|
41385
|
+
`${import_chalk6.default.bold("Webhook deletion failed:")} ${import_chalk6.default.red(err.message)}`
|
|
41386
|
+
);
|
|
41069
41387
|
}
|
|
41070
41388
|
}
|
|
41071
41389
|
async function listWebhooks() {
|
|
@@ -41097,12 +41415,18 @@ async function listWebhooks() {
|
|
|
41097
41415
|
});
|
|
41098
41416
|
console.log(table.toString());
|
|
41099
41417
|
} else {
|
|
41100
|
-
console.log(
|
|
41418
|
+
console.log(
|
|
41419
|
+
`No webhooks found. Create one with ${import_chalk6.default.bold(
|
|
41420
|
+
"goldsky subgraph webhook create"
|
|
41421
|
+
)}.`
|
|
41422
|
+
);
|
|
41101
41423
|
}
|
|
41102
41424
|
} else {
|
|
41103
41425
|
spinner.fail();
|
|
41104
41426
|
console.log();
|
|
41105
|
-
console.log(
|
|
41427
|
+
console.log(
|
|
41428
|
+
`${import_chalk6.default.bold("Could not list webhooks:")} ${import_chalk6.default.red(err.message)}`
|
|
41429
|
+
);
|
|
41106
41430
|
}
|
|
41107
41431
|
}
|
|
41108
41432
|
|
|
@@ -41193,14 +41517,87 @@ var builder13 = (yargs) => yargs.command(deploy_exports).command(list_exports).c
|
|
|
41193
41517
|
var handler13 = async () => {
|
|
41194
41518
|
};
|
|
41195
41519
|
|
|
41520
|
+
// src/lib/update-notifier.ts
|
|
41521
|
+
var import_chalk11 = __toESM(require_source());
|
|
41522
|
+
|
|
41523
|
+
// package.json
|
|
41524
|
+
var package_default = {
|
|
41525
|
+
name: "@goldskycom/cli",
|
|
41526
|
+
version: "0.2.1",
|
|
41527
|
+
description: "The Goldsky CLI to deploy subgraphs, index & transform blockchain data, configure webhooks, and access your data in real-time.",
|
|
41528
|
+
main: "dist/index.js",
|
|
41529
|
+
keywords: [
|
|
41530
|
+
"goldsky",
|
|
41531
|
+
"web3",
|
|
41532
|
+
"blockchain",
|
|
41533
|
+
"real-time",
|
|
41534
|
+
"data pipelines",
|
|
41535
|
+
"streams",
|
|
41536
|
+
"webhooks"
|
|
41537
|
+
],
|
|
41538
|
+
author: "Goldsky",
|
|
41539
|
+
scripts: {
|
|
41540
|
+
test: 'echo "Error: no test specified" && exit 1',
|
|
41541
|
+
clean: "rimraf ./dist && rimraf tsconfig.tsbuildinfo",
|
|
41542
|
+
build: "npm run clean && tsc --noEmit --skipLibCheck && node ./scripts/build.js && chmod a+x bin/goldsky",
|
|
41543
|
+
"build:sdk": "npx pkg -t linux,macos,win . -o sdk/goldsky",
|
|
41544
|
+
"dev:debug": "ts-node src/index.ts",
|
|
41545
|
+
prepublishOnly: "npm run build"
|
|
41546
|
+
},
|
|
41547
|
+
bin: {
|
|
41548
|
+
goldsky: "bin/goldsky"
|
|
41549
|
+
},
|
|
41550
|
+
files: [
|
|
41551
|
+
"bin/goldsky",
|
|
41552
|
+
"dist"
|
|
41553
|
+
],
|
|
41554
|
+
devDependencies: {
|
|
41555
|
+
"@types/axios": "^0.14.0",
|
|
41556
|
+
"@types/cli-table": "^0.3.0",
|
|
41557
|
+
"@types/form-data": "^2.5.0",
|
|
41558
|
+
"@types/jszip": "^3.4.1",
|
|
41559
|
+
"@types/node": "^16.11.11",
|
|
41560
|
+
"@types/update-notifier": "^6.0.1",
|
|
41561
|
+
"@types/yaml": "^1.9.7",
|
|
41562
|
+
"@types/yargs": "^17.0.7",
|
|
41563
|
+
axios: "^0.24.0",
|
|
41564
|
+
chalk: "^4.1.2",
|
|
41565
|
+
"cli-table": "^0.3.11",
|
|
41566
|
+
"form-data": "^4.0.0",
|
|
41567
|
+
jszip: "^3.7.1",
|
|
41568
|
+
ora: "^4.1.1",
|
|
41569
|
+
yaml: "^1.10.2",
|
|
41570
|
+
yargs: "^17.5.1"
|
|
41571
|
+
},
|
|
41572
|
+
license: "",
|
|
41573
|
+
dependencies: {
|
|
41574
|
+
"update-notifier": "^6.0.2"
|
|
41575
|
+
}
|
|
41576
|
+
};
|
|
41577
|
+
|
|
41578
|
+
// src/lib/update-notifier.ts
|
|
41579
|
+
var runUpdateNotifier = async () => {
|
|
41580
|
+
const updateNotifier = Function(
|
|
41581
|
+
'return import("update-notifier")'
|
|
41582
|
+
)();
|
|
41583
|
+
(await updateNotifier).default({ pkg: package_default }).notify({
|
|
41584
|
+
message: `\u{1F389} A new version of the Goldsky CLI is available \u{1F389}
|
|
41585
|
+
|
|
41586
|
+
Run {updateCommand} to update (${import_chalk11.default.dim("{currentVersion}")}${import_chalk11.default.reset(
|
|
41587
|
+
" \u2192 "
|
|
41588
|
+
)}${import_chalk11.default.green("{latestVersion}")})`
|
|
41589
|
+
});
|
|
41590
|
+
};
|
|
41591
|
+
|
|
41196
41592
|
// src/index.ts
|
|
41197
|
-
var import_api_schemas7 = __toESM(require_src2());
|
|
41198
41593
|
var doesCommandAcceptSubgraphNameWithoutVersion = (command15) => ["subgraph list", "subgraph tag delete"].includes(command15);
|
|
41199
41594
|
var argv = hideBin(process.argv);
|
|
41200
|
-
|
|
41595
|
+
runUpdateNotifier().then(loadAndApplyAuthToken).then(() => {
|
|
41201
41596
|
yargs_default(argv).scriptName("goldsky").usage("$0 <cmd> args").check((argv2) => {
|
|
41202
41597
|
if (argv2.nameAndVersion && !doesCommandAcceptSubgraphNameWithoutVersion(argv2._.join(" ")) && !argv2.nameAndVersion.match(/^.*\/.*$/)) {
|
|
41203
|
-
throw new Error(
|
|
41598
|
+
throw new Error(
|
|
41599
|
+
`The provided <nameAndValue> "${argv2.nameAndVersion}" does not match the "name/version" pattern, such as "my-subgraph/1.0.0".`
|
|
41600
|
+
);
|
|
41204
41601
|
}
|
|
41205
41602
|
return true;
|
|
41206
41603
|
}).option("apiHost", {
|
|
@@ -41209,13 +41606,12 @@ loadAndApplyAuthToken().then(() => {
|
|
|
41209
41606
|
type: "string",
|
|
41210
41607
|
default: import_api_schemas7.API_URL,
|
|
41211
41608
|
hidden: true
|
|
41212
|
-
}).command(login_exports).command(logout_exports).command(subgraph_exports).version().alias("v", "version").alias("h", "help").strict().demandCommand(1).middleware([
|
|
41609
|
+
}).command(login_exports).command(logout_exports).command(subgraph_exports).version(package_default.version).alias("v", "version").alias("h", "help").strict().demandCommand(1).middleware([
|
|
41213
41610
|
(argv2) => {
|
|
41214
41611
|
import_api_schemas7.ApiFetch.setApiHost(argv2.apiHost);
|
|
41215
41612
|
}
|
|
41216
41613
|
]).showHelpOnFail(true).argv;
|
|
41217
41614
|
});
|
|
41218
|
-
module.exports = __toCommonJS(src_exports);
|
|
41219
41615
|
/*!
|
|
41220
41616
|
* mime-db
|
|
41221
41617
|
* Copyright(c) 2014 Jonathan Ong
|