@settlemint/sdk-cli 2.3.2-pr2274a4c0 → 2.3.2-pr2ffa9747
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/cli.js +683 -647
- package/dist/cli.js.map +42 -42
- package/package.json +4 -3
package/dist/cli.js
CHANGED
@@ -232319,7 +232319,7 @@ var init_toBytes = __esm(() => {
|
|
232319
232319
|
};
|
232320
232320
|
});
|
232321
232321
|
|
232322
|
-
// ../../node_modules
|
232322
|
+
// ../../node_modules/@noble/hashes/esm/_assert.js
|
232323
232323
|
function anumber(n6) {
|
232324
232324
|
if (!Number.isSafeInteger(n6) || n6 < 0)
|
232325
232325
|
throw new Error("positive integer expected, got " + n6);
|
@@ -232354,7 +232354,7 @@ function aoutput(out, instance) {
|
|
232354
232354
|
}
|
232355
232355
|
var init__assert = () => {};
|
232356
232356
|
|
232357
|
-
// ../../node_modules
|
232357
|
+
// ../../node_modules/@noble/hashes/esm/_u64.js
|
232358
232358
|
function fromBig(n6, le4 = false) {
|
232359
232359
|
if (le4)
|
232360
232360
|
return { h: Number(n6 & U32_MASK64), l: Number(n6 >> _32n & U32_MASK64) };
|
@@ -232375,14 +232375,14 @@ var init__u64 = __esm(() => {
|
|
232375
232375
|
_32n = /* @__PURE__ */ BigInt(32);
|
232376
232376
|
});
|
232377
232377
|
|
232378
|
-
// ../../node_modules
|
232378
|
+
// ../../node_modules/@noble/hashes/esm/cryptoNode.js
|
232379
232379
|
import * as nc from "node:crypto";
|
232380
232380
|
var crypto2;
|
232381
232381
|
var init_cryptoNode = __esm(() => {
|
232382
232382
|
crypto2 = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && ("randomBytes" in nc) ? nc : undefined;
|
232383
232383
|
});
|
232384
232384
|
|
232385
|
-
// ../../node_modules
|
232385
|
+
// ../../node_modules/@noble/hashes/esm/utils.js
|
232386
232386
|
function u32(arr) {
|
232387
232387
|
return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
232388
232388
|
}
|
@@ -232466,7 +232466,7 @@ var init_utils2 = __esm(() => {
|
|
232466
232466
|
hasHexBuiltin = typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function";
|
232467
232467
|
});
|
232468
232468
|
|
232469
|
-
// ../../node_modules
|
232469
|
+
// ../../node_modules/@noble/hashes/esm/sha3.js
|
232470
232470
|
function keccakP(s7, rounds = 24) {
|
232471
232471
|
const B4 = new Uint32Array(5 * 2);
|
232472
232472
|
for (let round = 24 - rounds;round < 24; round++) {
|
@@ -234796,7 +234796,7 @@ var init_rpc = __esm(() => {
|
|
234796
234796
|
};
|
234797
234797
|
});
|
234798
234798
|
|
234799
|
-
// ../../node_modules
|
234799
|
+
// ../../node_modules/@noble/hashes/esm/_md.js
|
234800
234800
|
function setBigUint64(view, byteOffset, value4, isLE2) {
|
234801
234801
|
if (typeof view.setBigUint64 === "function")
|
234802
234802
|
return view.setBigUint64(byteOffset, value4, isLE2);
|
@@ -234907,7 +234907,7 @@ var init__md = __esm(() => {
|
|
234907
234907
|
};
|
234908
234908
|
});
|
234909
234909
|
|
234910
|
-
// ../../node_modules
|
234910
|
+
// ../../node_modules/@noble/hashes/esm/sha256.js
|
234911
234911
|
var SHA256_K, SHA256_IV, SHA256_W, SHA256, sha256;
|
234912
234912
|
var init_sha256 = __esm(() => {
|
234913
234913
|
init__md();
|
@@ -235061,12 +235061,12 @@ var init_sha256 = __esm(() => {
|
|
235061
235061
|
sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256);
|
235062
235062
|
});
|
235063
235063
|
|
235064
|
-
// ../../node_modules
|
235064
|
+
// ../../node_modules/@noble/hashes/esm/sha2.js
|
235065
235065
|
var init_sha2 = __esm(() => {
|
235066
235066
|
init_sha256();
|
235067
235067
|
});
|
235068
235068
|
|
235069
|
-
// ../../node_modules
|
235069
|
+
// ../../node_modules/@noble/hashes/esm/hmac.js
|
235070
235070
|
var HMAC, hmac = (hash2, key2, message) => new HMAC(hash2, key2).update(message).digest();
|
235071
235071
|
var init_hmac = __esm(() => {
|
235072
235072
|
init__assert();
|
@@ -235135,7 +235135,7 @@ var init_hmac = __esm(() => {
|
|
235135
235135
|
hmac.create = (hash2, key2) => new HMAC(hash2, key2);
|
235136
235136
|
});
|
235137
235137
|
|
235138
|
-
// ../../node_modules
|
235138
|
+
// ../../node_modules/@noble/curves/esm/abstract/utils.js
|
235139
235139
|
function isBytes2(a7) {
|
235140
235140
|
return a7 instanceof Uint8Array || ArrayBuffer.isView(a7) && a7.constructor.name === "Uint8Array";
|
235141
235141
|
}
|
@@ -235358,7 +235358,7 @@ var init_utils3 = __esm(() => {
|
|
235358
235358
|
};
|
235359
235359
|
});
|
235360
235360
|
|
235361
|
-
// ../../node_modules
|
235361
|
+
// ../../node_modules/@noble/curves/esm/abstract/modular.js
|
235362
235362
|
function mod(a7, b4) {
|
235363
235363
|
const result = a7 % b4;
|
235364
235364
|
return result >= _0n3 ? result : b4 + result;
|
@@ -235635,7 +235635,7 @@ var init_modular = __esm(() => {
|
|
235635
235635
|
];
|
235636
235636
|
});
|
235637
235637
|
|
235638
|
-
// ../../node_modules
|
235638
|
+
// ../../node_modules/@noble/curves/esm/abstract/curve.js
|
235639
235639
|
function constTimeNegate(condition, item) {
|
235640
235640
|
const neg = item.negate();
|
235641
235641
|
return condition ? neg : item;
|
@@ -235836,7 +235836,7 @@ var init_curve = __esm(() => {
|
|
235836
235836
|
pointWindowSizes = new WeakMap;
|
235837
235837
|
});
|
235838
235838
|
|
235839
|
-
// ../../node_modules
|
235839
|
+
// ../../node_modules/@noble/curves/esm/abstract/weierstrass.js
|
235840
235840
|
function validateSigVerOpts(opts) {
|
235841
235841
|
if (opts.lowS !== undefined)
|
235842
235842
|
abool("lowS", opts.lowS);
|
@@ -236733,7 +236733,7 @@ var init_weierstrass = __esm(() => {
|
|
236733
236733
|
_4n2 = BigInt(4);
|
236734
236734
|
});
|
236735
236735
|
|
236736
|
-
// ../../node_modules
|
236736
|
+
// ../../node_modules/@noble/curves/esm/_shortw_utils.js
|
236737
236737
|
function getHash(hash2) {
|
236738
236738
|
return {
|
236739
236739
|
hash: hash2,
|
@@ -236752,7 +236752,7 @@ var init__shortw_utils = __esm(() => {
|
|
236752
236752
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
236753
236753
|
});
|
236754
236754
|
|
236755
|
-
// ../../node_modules
|
236755
|
+
// ../../node_modules/@noble/curves/esm/abstract/hash-to-curve.js
|
236756
236756
|
function i2osp(value4, length) {
|
236757
236757
|
anum(value4);
|
236758
236758
|
anum(length);
|
@@ -236896,7 +236896,7 @@ var init_hash_to_curve = __esm(() => {
|
|
236896
236896
|
os2ip = bytesToNumberBE;
|
236897
236897
|
});
|
236898
236898
|
|
236899
|
-
// ../../node_modules
|
236899
|
+
// ../../node_modules/@noble/curves/esm/secp256k1.js
|
236900
236900
|
var exports_secp256k1 = {};
|
236901
236901
|
__export(exports_secp256k1, {
|
236902
236902
|
secp256k1: () => secp256k1,
|
@@ -240012,7 +240012,7 @@ var require_foldFlowLines = __commonJS((exports) => {
|
|
240012
240012
|
else
|
240013
240013
|
end = lineWidth - indentAtStart;
|
240014
240014
|
}
|
240015
|
-
let
|
240015
|
+
let split4 = undefined;
|
240016
240016
|
let prev = undefined;
|
240017
240017
|
let overflow = false;
|
240018
240018
|
let i7 = -1;
|
@@ -240046,20 +240046,20 @@ var require_foldFlowLines = __commonJS((exports) => {
|
|
240046
240046
|
if (mode === FOLD_BLOCK)
|
240047
240047
|
i7 = consumeMoreIndentedLines(text2, i7, indent2.length);
|
240048
240048
|
end = i7 + indent2.length + endStep;
|
240049
|
-
|
240049
|
+
split4 = undefined;
|
240050
240050
|
} else {
|
240051
240051
|
if (ch === " " && prev && prev !== " " && prev !== `
|
240052
240052
|
` && prev !== "\t") {
|
240053
240053
|
const next = text2[i7 + 1];
|
240054
240054
|
if (next && next !== " " && next !== `
|
240055
240055
|
` && next !== "\t")
|
240056
|
-
|
240056
|
+
split4 = i7;
|
240057
240057
|
}
|
240058
240058
|
if (i7 >= end) {
|
240059
|
-
if (
|
240060
|
-
folds.push(
|
240061
|
-
end =
|
240062
|
-
|
240059
|
+
if (split4) {
|
240060
|
+
folds.push(split4);
|
240061
|
+
end = split4 + endStep;
|
240062
|
+
split4 = undefined;
|
240063
240063
|
} else if (mode === FOLD_QUOTED) {
|
240064
240064
|
while (prev === " " || prev === "\t") {
|
240065
240065
|
prev = ch;
|
@@ -240072,7 +240072,7 @@ var require_foldFlowLines = __commonJS((exports) => {
|
|
240072
240072
|
folds.push(j4);
|
240073
240073
|
escapedFolds[j4] = true;
|
240074
240074
|
end = j4 + endStep;
|
240075
|
-
|
240075
|
+
split4 = undefined;
|
240076
240076
|
} else {
|
240077
240077
|
overflow = true;
|
240078
240078
|
}
|
@@ -243393,13 +243393,13 @@ var require_resolve_block_scalar = __commonJS((exports) => {
|
|
243393
243393
|
return { mode, indent: indent2, chomp, comment, length };
|
243394
243394
|
}
|
243395
243395
|
function splitLines(source) {
|
243396
|
-
const
|
243397
|
-
const first =
|
243396
|
+
const split4 = source.split(/\n( *)/);
|
243397
|
+
const first = split4[0];
|
243398
243398
|
const m8 = first.match(/^( *)/);
|
243399
243399
|
const line0 = m8?.[1] ? [m8[1], first.slice(m8[1].length)] : ["", first];
|
243400
243400
|
const lines2 = [line0];
|
243401
|
-
for (let i7 = 1;i7 <
|
243402
|
-
lines2.push([
|
243401
|
+
for (let i7 = 1;i7 < split4.length; i7 += 2)
|
243402
|
+
lines2.push([split4[i7], split4[i7 + 1]]);
|
243403
243403
|
return lines2;
|
243404
243404
|
}
|
243405
243405
|
exports.resolveBlockScalar = resolveBlockScalar;
|
@@ -243437,12 +243437,12 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
243437
243437
|
};
|
243438
243438
|
}
|
243439
243439
|
const valueEnd = offset + source.length;
|
243440
|
-
const
|
243440
|
+
const re4 = resolveEnd.resolveEnd(end, valueEnd, strict, onError);
|
243441
243441
|
return {
|
243442
243442
|
value: value4,
|
243443
243443
|
type: _type,
|
243444
|
-
comment:
|
243445
|
-
range: [offset, valueEnd,
|
243444
|
+
comment: re4.comment,
|
243445
|
+
range: [offset, valueEnd, re4.offset]
|
243446
243446
|
};
|
243447
243447
|
}
|
243448
243448
|
function plainValue(source, onError) {
|
@@ -243814,10 +243814,10 @@ var require_compose_node = __commonJS((exports) => {
|
|
243814
243814
|
if (alias.source.endsWith(":"))
|
243815
243815
|
onError(offset + source.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", true);
|
243816
243816
|
const valueEnd = offset + source.length;
|
243817
|
-
const
|
243818
|
-
alias.range = [offset, valueEnd,
|
243819
|
-
if (
|
243820
|
-
alias.comment =
|
243817
|
+
const re4 = resolveEnd.resolveEnd(end, valueEnd, options.strict, onError);
|
243818
|
+
alias.range = [offset, valueEnd, re4.offset];
|
243819
|
+
if (re4.comment)
|
243820
|
+
alias.comment = re4.comment;
|
243821
243821
|
return alias;
|
243822
243822
|
}
|
243823
243823
|
exports.composeEmptyNode = composeEmptyNode;
|
@@ -243855,10 +243855,10 @@ var require_compose_doc = __commonJS((exports) => {
|
|
243855
243855
|
}
|
243856
243856
|
doc2.contents = value4 ? composeNode.composeNode(ctx, value4, props, onError) : composeNode.composeEmptyNode(ctx, props.end, start3, null, props, onError);
|
243857
243857
|
const contentEnd = doc2.contents.range[2];
|
243858
|
-
const
|
243859
|
-
if (
|
243860
|
-
doc2.comment =
|
243861
|
-
doc2.range = [offset, contentEnd,
|
243858
|
+
const re4 = resolveEnd.resolveEnd(end, contentEnd, false, onError);
|
243859
|
+
if (re4.comment)
|
243860
|
+
doc2.comment = re4.comment;
|
243861
|
+
doc2.range = [offset, contentEnd, re4.offset];
|
243862
243862
|
return doc2;
|
243863
243863
|
}
|
243864
243864
|
exports.composeDoc = composeDoc;
|
@@ -262458,7 +262458,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
262458
262458
|
var package_default = {
|
262459
262459
|
name: "@settlemint/sdk-cli",
|
262460
262460
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
262461
|
-
version: "2.3.2-
|
262461
|
+
version: "2.3.2-pr2ffa9747",
|
262462
262462
|
type: "module",
|
262463
262463
|
private: false,
|
262464
262464
|
license: "FSL-1.1-MIT",
|
@@ -262507,8 +262507,8 @@ var package_default = {
|
|
262507
262507
|
"@inquirer/input": "4.1.10",
|
262508
262508
|
"@inquirer/password": "4.0.13",
|
262509
262509
|
"@inquirer/select": "4.2.1",
|
262510
|
-
"@settlemint/sdk-js": "2.3.2-
|
262511
|
-
"@settlemint/sdk-utils": "2.3.2-
|
262510
|
+
"@settlemint/sdk-js": "2.3.2-pr2ffa9747",
|
262511
|
+
"@settlemint/sdk-utils": "2.3.2-pr2ffa9747",
|
262512
262512
|
"@types/node": "22.15.21",
|
262513
262513
|
"@types/semver": "7.7.0",
|
262514
262514
|
"@types/which": "3.0.4",
|
@@ -262517,6 +262517,7 @@ var package_default = {
|
|
262517
262517
|
"is-in-ci": "1.0.0",
|
262518
262518
|
semver: "7.7.2",
|
262519
262519
|
slugify: "1.6.6",
|
262520
|
+
viem: "2.30.0",
|
262520
262521
|
which: "5.0.0",
|
262521
262522
|
yaml: "2.8.0",
|
262522
262523
|
yoctocolors: "2.1.1"
|
@@ -263885,6 +263886,20 @@ async function graphqlFetchWithRetry(input, init, maxRetries = 5, initialSleepTi
|
|
263885
263886
|
return json2.data;
|
263886
263887
|
}, maxRetries, initialSleepTime);
|
263887
263888
|
}
|
263889
|
+
function appendHeaders(headers, additionalHeaders) {
|
263890
|
+
const defaultHeaders = typeof headers === "function" ? headers() : headers;
|
263891
|
+
const filteredAdditionalHeaders = Object.entries(additionalHeaders).filter(([_, value]) => value !== undefined);
|
263892
|
+
if (Array.isArray(defaultHeaders)) {
|
263893
|
+
return [...defaultHeaders, ...filteredAdditionalHeaders];
|
263894
|
+
}
|
263895
|
+
if (defaultHeaders instanceof Headers) {
|
263896
|
+
return new Headers([...defaultHeaders, ...filteredAdditionalHeaders]);
|
263897
|
+
}
|
263898
|
+
return {
|
263899
|
+
...defaultHeaders,
|
263900
|
+
...Object.fromEntries(filteredAdditionalHeaders)
|
263901
|
+
};
|
263902
|
+
}
|
263888
263903
|
|
263889
263904
|
// ../../node_modules/environment/index.js
|
263890
263905
|
var isBrowser = globalThis.window?.document !== undefined;
|
@@ -266138,6 +266153,13 @@ function getPincodeVerificationChallengeResponse({
|
|
266138
266153
|
}
|
266139
266154
|
function createSettleMintClient(options) {
|
266140
266155
|
ensureServer();
|
266156
|
+
if (options.instance === STANDALONE_INSTANCE2) {
|
266157
|
+
if (options.anonymous) {
|
266158
|
+
options.instance = "https://console.settlemint.com";
|
266159
|
+
} else {
|
266160
|
+
throw new Error("Standalone instances cannot connect to the SettleMint platform");
|
266161
|
+
}
|
266162
|
+
}
|
266141
266163
|
const validatedOptions = options.anonymous ? validate2(exports_external.object({
|
266142
266164
|
...ClientOptionsSchema.shape,
|
266143
266165
|
accessToken: exports_external.literal("")
|
@@ -267134,6 +267156,11 @@ function camelCaseToWords2(s) {
|
|
267134
267156
|
function replaceUnderscoresAndHyphensWithSpaces(s) {
|
267135
267157
|
return s.replace(/[-_]/g, " ");
|
267136
267158
|
}
|
267159
|
+
function extractBaseUrlBeforeSegment(baseUrl, pathSegment) {
|
267160
|
+
const url2 = new URL(baseUrl);
|
267161
|
+
const segmentIndex = url2.pathname.indexOf(pathSegment);
|
267162
|
+
return url2.origin + (segmentIndex >= 0 ? url2.pathname.substring(0, segmentIndex) : url2.pathname);
|
267163
|
+
}
|
267137
267164
|
|
267138
267165
|
// ../utils/dist/filesystem.mjs
|
267139
267166
|
import { dirname as dirname5 } from "path";
|
@@ -267229,7 +267256,9 @@ async function validateSdkVersionFromCommand(command, interval = 5 * 60 * 1000)
|
|
267229
267256
|
}
|
267230
267257
|
await setLastSdkVersionCheck(new Date(now).toJSON());
|
267231
267258
|
const instance = await getInstanceFromCommand(command);
|
267232
|
-
|
267259
|
+
if (instance !== STANDALONE_INSTANCE2) {
|
267260
|
+
await validateSdkVersion(instance);
|
267261
|
+
}
|
267233
267262
|
}
|
267234
267263
|
async function validateSdkVersion(instance) {
|
267235
267264
|
const settlemint = createSettleMintClient({
|
@@ -267358,29 +267387,24 @@ init_index_chunk();
|
|
267358
267387
|
var PACKAGE_NAME = "@settlemint/sdk-hasura";
|
267359
267388
|
async function codegenHasura(env2) {
|
267360
267389
|
const gqlEndpoint = env2.SETTLEMINT_HASURA_ENDPOINT;
|
267361
|
-
const
|
267390
|
+
const instance = env2.SETTLEMINT_INSTANCE;
|
267391
|
+
const accessToken = instance === STANDALONE_INSTANCE2 ? undefined : await getApplicationOrPersonalAccessToken({
|
267362
267392
|
env: env2,
|
267363
267393
|
instance: env2.SETTLEMINT_INSTANCE,
|
267364
267394
|
prefer: "application"
|
267365
267395
|
});
|
267366
267396
|
const adminSecret = env2.SETTLEMINT_HASURA_ADMIN_SECRET;
|
267367
|
-
|
267368
|
-
if (!gqlEndpoint || !accessToken || !adminSecret) {
|
267369
|
-
note("[Codegen] Missing required Hasura environment variables", "warn");
|
267370
|
-
return;
|
267371
|
-
}
|
267372
|
-
if (gqlEndpoint && accessToken && adminSecret) {
|
267397
|
+
if (gqlEndpoint && adminSecret) {
|
267373
267398
|
await generateSchema({
|
267374
267399
|
input: gqlEndpoint,
|
267375
267400
|
output: "hasura-schema.graphql",
|
267376
267401
|
tsconfig: undefined,
|
267377
267402
|
headers: {
|
267378
267403
|
"x-hasura-admin-secret": adminSecret,
|
267379
|
-
"x-auth-token": accessToken
|
267404
|
+
...accessToken ? { "x-auth-token": accessToken } : {}
|
267380
267405
|
}
|
267381
267406
|
});
|
267382
|
-
|
267383
|
-
const hasuraTemplate = `import { createHasuraClient } from "${PACKAGE_NAME}";
|
267407
|
+
const hasuraTemplate = `import { createHasuraClient } from "${PACKAGE_NAME}";
|
267384
267408
|
import type { introspection } from "@schemas/hasura-env";
|
267385
267409
|
import { createLogger, requestLogger, type LogLevel } from '@settlemint/sdk-utils/logging';
|
267386
267410
|
|
@@ -267403,22 +267427,27 @@ export const { client: hasuraClient, graphql: hasuraGraphql } = createHasuraClie
|
|
267403
267427
|
};
|
267404
267428
|
}>({
|
267405
267429
|
instance: process.env.SETTLEMINT_HASURA_ENDPOINT!,
|
267406
|
-
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,
|
267430
|
+
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN ?? "",
|
267407
267431
|
adminSecret: process.env.SETTLEMINT_HASURA_ADMIN_SECRET!,
|
267408
267432
|
}, {
|
267409
267433
|
fetch: requestLogger(logger, "hasura", fetch) as typeof fetch,
|
267410
267434
|
});`;
|
267411
|
-
|
267412
|
-
|
267435
|
+
await writeTemplate(hasuraTemplate, "/lib/settlemint", "hasura.ts");
|
267436
|
+
} else {
|
267437
|
+
note("[Codegen] Missing required Hasura environment variables", "warn");
|
267438
|
+
}
|
267439
|
+
const databaseUrl = env2.SETTLEMINT_HASURA_DATABASE_URL;
|
267440
|
+
if (databaseUrl) {
|
267441
|
+
const drizzleTemplate = `import { createPostgresPool } from "${PACKAGE_NAME}/postgres";
|
267413
267442
|
|
267414
|
-
export const postgresPool = createPostgresPool(process.env.SETTLEMINT_HASURA_DATABASE_URL ??
|
267443
|
+
export const postgresPool = createPostgresPool(process.env.SETTLEMINT_HASURA_DATABASE_URL ?? "");
|
267415
267444
|
`;
|
267416
|
-
|
267417
|
-
|
267418
|
-
|
267419
|
-
|
267420
|
-
|
267421
|
-
|
267445
|
+
await writeTemplate(drizzleTemplate, "/lib/settlemint", "postgres.ts");
|
267446
|
+
const projectDir = await projectRoot3();
|
267447
|
+
if (!await isPackageInstalled(PACKAGE_NAME, projectDir)) {
|
267448
|
+
await installDependencies(PACKAGE_NAME, projectDir);
|
267449
|
+
}
|
267450
|
+
} else {
|
267422
267451
|
note("[Codegen] Missing database environment variables", "warn");
|
267423
267452
|
}
|
267424
267453
|
}
|
@@ -267430,21 +267459,19 @@ async function codegenPortal(env2) {
|
|
267430
267459
|
if (!gqlEndpoint) {
|
267431
267460
|
return;
|
267432
267461
|
}
|
267433
|
-
const
|
267462
|
+
const instance = env2.SETTLEMINT_INSTANCE;
|
267463
|
+
const accessToken = instance === STANDALONE_INSTANCE2 ? undefined : await getApplicationOrPersonalAccessToken({
|
267434
267464
|
env: env2,
|
267435
267465
|
instance: env2.SETTLEMINT_INSTANCE,
|
267436
267466
|
prefer: "application"
|
267437
267467
|
});
|
267438
|
-
if (!accessToken) {
|
267439
|
-
return;
|
267440
|
-
}
|
267441
267468
|
await generateSchema({
|
267442
267469
|
input: gqlEndpoint,
|
267443
267470
|
output: "portal-schema.graphql",
|
267444
267471
|
tsconfig: undefined,
|
267445
|
-
headers: {
|
267446
|
-
"x-auth-token": accessToken
|
267447
|
-
}
|
267472
|
+
headers: accessToken ? {
|
267473
|
+
"x-auth-token": accessToken
|
267474
|
+
} : {}
|
267448
267475
|
});
|
267449
267476
|
const template = `import { createPortalClient, getWebsocketClient } from "${PACKAGE_NAME2}";
|
267450
267477
|
import type { introspection } from "@schemas/portal-env";
|
@@ -267461,14 +267488,14 @@ export const { client: portalClient, graphql: portalGraphql } = createPortalClie
|
|
267461
267488
|
};
|
267462
267489
|
}>({
|
267463
267490
|
instance: process.env.SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT!,
|
267464
|
-
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,
|
267491
|
+
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN ?? "",
|
267465
267492
|
}, {
|
267466
267493
|
fetch: requestLogger(logger, "portal", fetch) as typeof fetch,
|
267467
267494
|
});
|
267468
267495
|
|
267469
267496
|
export const getPortalWebsocketClient = getWebsocketClient({
|
267470
267497
|
portalGraphqlEndpoint: process.env.SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT!,
|
267471
|
-
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,
|
267498
|
+
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN ?? "",
|
267472
267499
|
});
|
267473
267500
|
`;
|
267474
267501
|
await writeTemplate(template, "/lib/settlemint", "portal.ts");
|
@@ -267495,14 +267522,12 @@ async function codegenTheGraph(env2, subgraphNames) {
|
|
267495
267522
|
if (!Array.isArray(gqlEndpoints) || gqlEndpoints.length === 0) {
|
267496
267523
|
return;
|
267497
267524
|
}
|
267498
|
-
const
|
267525
|
+
const instance = env2.SETTLEMINT_INSTANCE;
|
267526
|
+
const accessToken = instance === STANDALONE_INSTANCE2 ? undefined : await getApplicationOrPersonalAccessToken({
|
267499
267527
|
env: env2,
|
267500
267528
|
instance: env2.SETTLEMINT_INSTANCE,
|
267501
267529
|
prefer: "application"
|
267502
267530
|
});
|
267503
|
-
if (!accessToken) {
|
267504
|
-
return;
|
267505
|
-
}
|
267506
267531
|
const template = [
|
267507
267532
|
`import { createTheGraphClient } from "${PACKAGE_NAME3}";`,
|
267508
267533
|
"import { createLogger, requestLogger, type LogLevel } from '@settlemint/sdk-utils/logging';"
|
@@ -267529,9 +267554,9 @@ async function codegenTheGraph(env2, subgraphNames) {
|
|
267529
267554
|
input: gqlEndpoint,
|
267530
267555
|
output: `the-graph-schema-${name3}.graphql`,
|
267531
267556
|
tsconfig: undefined,
|
267532
|
-
headers: {
|
267557
|
+
headers: accessToken ? {
|
267533
267558
|
"x-auth-token": accessToken
|
267534
|
-
}
|
267559
|
+
} : {}
|
267535
267560
|
});
|
267536
267561
|
const nameSuffix = capitalizeFirstLetter2(name3);
|
267537
267562
|
const graphqlClientVariable = getVariableName(`theGraphClient${nameSuffix}`);
|
@@ -267551,7 +267576,7 @@ export const { client: ${graphqlClientVariable}, graphql: ${graphqlVariable} } =
|
|
267551
267576
|
};
|
267552
267577
|
}>({
|
267553
267578
|
instances: JSON.parse(process.env.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS || '[]'),
|
267554
|
-
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,
|
267579
|
+
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN ?? "",
|
267555
267580
|
subgraphName: "${name3}",
|
267556
267581
|
cache: "force-cache",
|
267557
267582
|
}, {
|
@@ -267598,11 +267623,12 @@ async function testGqlEndpoint({
|
|
267598
267623
|
try {
|
267599
267624
|
await graphqlFetchWithRetry(gqlEndpoint, {
|
267600
267625
|
method: "POST",
|
267601
|
-
headers: {
|
267602
|
-
"
|
267603
|
-
...isHasura ? { "x-hasura-admin-secret": hasuraAdminSecret ?? "" } : {}
|
267604
|
-
|
267605
|
-
|
267626
|
+
headers: appendHeaders({
|
267627
|
+
"Content-Type": "application/json",
|
267628
|
+
...isHasura ? { "x-hasura-admin-secret": hasuraAdminSecret ?? "" } : {}
|
267629
|
+
}, {
|
267630
|
+
"x-auth-token": accessToken
|
267631
|
+
}),
|
267606
267632
|
body: JSON.stringify({
|
267607
267633
|
query: `
|
267608
267634
|
query {
|
@@ -268526,19 +268552,22 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
268526
268552
|
blockscout: false
|
268527
268553
|
};
|
268528
268554
|
}
|
268529
|
-
|
268530
|
-
|
268531
|
-
|
268532
|
-
|
268533
|
-
|
268534
|
-
|
268535
|
-
|
268536
|
-
|
268537
|
-
hasura
|
268538
|
-
|
268539
|
-
|
268540
|
-
|
268541
|
-
|
268555
|
+
let accessToken;
|
268556
|
+
if (env2.SETTLEMINT_INSTANCE !== STANDALONE_INSTANCE2) {
|
268557
|
+
accessToken = await getApplicationOrPersonalAccessToken({
|
268558
|
+
env: env2,
|
268559
|
+
instance: env2.SETTLEMINT_INSTANCE,
|
268560
|
+
prefer: "application"
|
268561
|
+
});
|
268562
|
+
if (!accessToken) {
|
268563
|
+
note("No access token found, skipping codegen for hasura, portal, thegraph and blockscout", "warn");
|
268564
|
+
return {
|
268565
|
+
hasura: false,
|
268566
|
+
portal: false,
|
268567
|
+
thegraph: false,
|
268568
|
+
blockscout: false
|
268569
|
+
};
|
268570
|
+
}
|
268542
268571
|
}
|
268543
268572
|
const theGraphEndpoints = (env2.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS ?? []).filter((gqlEndpoint) => {
|
268544
268573
|
const name3 = getSubgraphName(gqlEndpoint);
|
@@ -268975,22 +269004,21 @@ async function codegenBlockscout(env2) {
|
|
268975
269004
|
if (!endpoint) {
|
268976
269005
|
return;
|
268977
269006
|
}
|
268978
|
-
const
|
269007
|
+
const instance = env2.SETTLEMINT_INSTANCE;
|
269008
|
+
const accessToken = instance === STANDALONE_INSTANCE2 ? undefined : await getApplicationOrPersonalAccessToken({
|
268979
269009
|
env: env2,
|
268980
269010
|
instance: env2.SETTLEMINT_INSTANCE,
|
268981
269011
|
prefer: "application"
|
268982
269012
|
});
|
268983
|
-
if (!accessToken) {
|
268984
|
-
return;
|
268985
|
-
}
|
268986
269013
|
const introspectionJsonPath = resolve5(process.cwd(), "__blockscout-introspection__.json");
|
268987
269014
|
try {
|
268988
269015
|
const data = await graphqlFetchWithRetry(endpoint, {
|
268989
269016
|
method: "POST",
|
268990
|
-
headers: {
|
268991
|
-
"x-auth-token": accessToken,
|
269017
|
+
headers: appendHeaders({
|
268992
269018
|
"Content-Type": "application/json"
|
268993
|
-
},
|
269019
|
+
}, {
|
269020
|
+
"x-auth-token": accessToken
|
269021
|
+
}),
|
268994
269022
|
body: JSON.stringify({
|
268995
269023
|
query: `
|
268996
269024
|
query IntrospectionQuery {
|
@@ -269137,7 +269165,7 @@ export const { client: blockscoutClient, graphql: blockscoutGraphql } = createBl
|
|
269137
269165
|
};
|
269138
269166
|
}>({
|
269139
269167
|
instance: process.env.SETTLEMINT_BLOCKSCOUT_ENDPOINT!,
|
269140
|
-
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,
|
269168
|
+
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN ?? "",
|
269141
269169
|
}, {
|
269142
269170
|
fetch: requestLogger(logger, "blockscout", fetch) as typeof fetch,
|
269143
269171
|
});
|
@@ -269164,7 +269192,7 @@ async function codegenIpfs(env2) {
|
|
269164
269192
|
|
269165
269193
|
export const { client } = createServerIpfsClient({
|
269166
269194
|
instance: process.env.SETTLEMINT_IPFS_API_ENDPOINT!,
|
269167
|
-
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,
|
269195
|
+
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN ?? "",
|
269168
269196
|
});`;
|
269169
269197
|
await writeTemplate(clientTemplate, "/lib/settlemint", "ipfs.ts");
|
269170
269198
|
const projectDir = await projectRoot3();
|
@@ -272854,297 +272882,13 @@ async function simulateBlocks(client, parameters) {
|
|
272854
272882
|
init_exports();
|
272855
272883
|
init_Errors();
|
272856
272884
|
|
272857
|
-
// ../../node_modules/ox/node_modules/@noble/hashes/esm/_assert.js
|
272858
|
-
function anumber2(n6) {
|
272859
|
-
if (!Number.isSafeInteger(n6) || n6 < 0)
|
272860
|
-
throw new Error("positive integer expected, got " + n6);
|
272861
|
-
}
|
272862
|
-
function isBytes3(a7) {
|
272863
|
-
return a7 instanceof Uint8Array || ArrayBuffer.isView(a7) && a7.constructor.name === "Uint8Array";
|
272864
|
-
}
|
272865
|
-
function abytes3(b4, ...lengths) {
|
272866
|
-
if (!isBytes3(b4))
|
272867
|
-
throw new Error("Uint8Array expected");
|
272868
|
-
if (lengths.length > 0 && !lengths.includes(b4.length))
|
272869
|
-
throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b4.length);
|
272870
|
-
}
|
272871
|
-
function aexists2(instance, checkFinished = true) {
|
272872
|
-
if (instance.destroyed)
|
272873
|
-
throw new Error("Hash instance has been destroyed");
|
272874
|
-
if (checkFinished && instance.finished)
|
272875
|
-
throw new Error("Hash#digest() has already been called");
|
272876
|
-
}
|
272877
|
-
function aoutput2(out, instance) {
|
272878
|
-
abytes3(out);
|
272879
|
-
const min = instance.outputLen;
|
272880
|
-
if (out.length < min) {
|
272881
|
-
throw new Error("digestInto() expects output buffer of length at least " + min);
|
272882
|
-
}
|
272883
|
-
}
|
272884
|
-
|
272885
|
-
// ../../node_modules/ox/node_modules/@noble/hashes/esm/utils.js
|
272886
|
-
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
272887
|
-
function u322(arr) {
|
272888
|
-
return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
272889
|
-
}
|
272890
|
-
var isLE2 = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
|
272891
|
-
function byteSwap2(word2) {
|
272892
|
-
return word2 << 24 & 4278190080 | word2 << 8 & 16711680 | word2 >>> 8 & 65280 | word2 >>> 24 & 255;
|
272893
|
-
}
|
272894
|
-
function byteSwap322(arr) {
|
272895
|
-
for (let i6 = 0;i6 < arr.length; i6++) {
|
272896
|
-
arr[i6] = byteSwap2(arr[i6]);
|
272897
|
-
}
|
272898
|
-
}
|
272899
|
-
var hasHexBuiltin3 = typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function";
|
272900
|
-
function utf8ToBytes3(str) {
|
272901
|
-
if (typeof str !== "string")
|
272902
|
-
throw new Error("utf8ToBytes expected string, got " + typeof str);
|
272903
|
-
return new Uint8Array(new TextEncoder().encode(str));
|
272904
|
-
}
|
272905
|
-
function toBytes3(data) {
|
272906
|
-
if (typeof data === "string")
|
272907
|
-
data = utf8ToBytes3(data);
|
272908
|
-
abytes3(data);
|
272909
|
-
return data;
|
272910
|
-
}
|
272911
|
-
class Hash2 {
|
272912
|
-
clone() {
|
272913
|
-
return this._cloneInto();
|
272914
|
-
}
|
272915
|
-
}
|
272916
|
-
function wrapConstructor2(hashCons) {
|
272917
|
-
const hashC = (msg) => hashCons().update(toBytes3(msg)).digest();
|
272918
|
-
const tmp = hashCons();
|
272919
|
-
hashC.outputLen = tmp.outputLen;
|
272920
|
-
hashC.blockLen = tmp.blockLen;
|
272921
|
-
hashC.create = () => hashCons();
|
272922
|
-
return hashC;
|
272923
|
-
}
|
272924
|
-
function wrapXOFConstructorWithOpts2(hashCons) {
|
272925
|
-
const hashC = (msg, opts) => hashCons(opts).update(toBytes3(msg)).digest();
|
272926
|
-
const tmp = hashCons({});
|
272927
|
-
hashC.outputLen = tmp.outputLen;
|
272928
|
-
hashC.blockLen = tmp.blockLen;
|
272929
|
-
hashC.create = (opts) => hashCons(opts);
|
272930
|
-
return hashC;
|
272931
|
-
}
|
272932
|
-
|
272933
|
-
// ../../node_modules/ox/node_modules/@noble/hashes/esm/_u64.js
|
272934
|
-
var U32_MASK642 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
|
272935
|
-
var _32n2 = /* @__PURE__ */ BigInt(32);
|
272936
|
-
function fromBig2(n6, le4 = false) {
|
272937
|
-
if (le4)
|
272938
|
-
return { h: Number(n6 & U32_MASK642), l: Number(n6 >> _32n2 & U32_MASK642) };
|
272939
|
-
return { h: Number(n6 >> _32n2 & U32_MASK642) | 0, l: Number(n6 & U32_MASK642) | 0 };
|
272940
|
-
}
|
272941
|
-
function split4(lst, le4 = false) {
|
272942
|
-
let Ah = new Uint32Array(lst.length);
|
272943
|
-
let Al = new Uint32Array(lst.length);
|
272944
|
-
for (let i6 = 0;i6 < lst.length; i6++) {
|
272945
|
-
const { h: h8, l: l3 } = fromBig2(lst[i6], le4);
|
272946
|
-
[Ah[i6], Al[i6]] = [h8, l3];
|
272947
|
-
}
|
272948
|
-
return [Ah, Al];
|
272949
|
-
}
|
272950
|
-
var rotlSH2 = (h8, l3, s7) => h8 << s7 | l3 >>> 32 - s7;
|
272951
|
-
var rotlSL2 = (h8, l3, s7) => l3 << s7 | h8 >>> 32 - s7;
|
272952
|
-
var rotlBH2 = (h8, l3, s7) => l3 << s7 - 32 | h8 >>> 64 - s7;
|
272953
|
-
var rotlBL2 = (h8, l3, s7) => h8 << s7 - 32 | l3 >>> 64 - s7;
|
272954
|
-
|
272955
|
-
// ../../node_modules/ox/node_modules/@noble/hashes/esm/sha3.js
|
272956
|
-
var SHA3_PI2 = [];
|
272957
|
-
var SHA3_ROTL2 = [];
|
272958
|
-
var _SHA3_IOTA2 = [];
|
272959
|
-
var _0n7 = /* @__PURE__ */ BigInt(0);
|
272960
|
-
var _1n7 = /* @__PURE__ */ BigInt(1);
|
272961
|
-
var _2n5 = /* @__PURE__ */ BigInt(2);
|
272962
|
-
var _7n2 = /* @__PURE__ */ BigInt(7);
|
272963
|
-
var _256n2 = /* @__PURE__ */ BigInt(256);
|
272964
|
-
var _0x71n2 = /* @__PURE__ */ BigInt(113);
|
272965
|
-
for (let round = 0, R7 = _1n7, x6 = 1, y4 = 0;round < 24; round++) {
|
272966
|
-
[x6, y4] = [y4, (2 * x6 + 3 * y4) % 5];
|
272967
|
-
SHA3_PI2.push(2 * (5 * y4 + x6));
|
272968
|
-
SHA3_ROTL2.push((round + 1) * (round + 2) / 2 % 64);
|
272969
|
-
let t8 = _0n7;
|
272970
|
-
for (let j3 = 0;j3 < 7; j3++) {
|
272971
|
-
R7 = (R7 << _1n7 ^ (R7 >> _7n2) * _0x71n2) % _256n2;
|
272972
|
-
if (R7 & _2n5)
|
272973
|
-
t8 ^= _1n7 << (_1n7 << /* @__PURE__ */ BigInt(j3)) - _1n7;
|
272974
|
-
}
|
272975
|
-
_SHA3_IOTA2.push(t8);
|
272976
|
-
}
|
272977
|
-
var [SHA3_IOTA_H2, SHA3_IOTA_L2] = /* @__PURE__ */ split4(_SHA3_IOTA2, true);
|
272978
|
-
var rotlH2 = (h8, l3, s7) => s7 > 32 ? rotlBH2(h8, l3, s7) : rotlSH2(h8, l3, s7);
|
272979
|
-
var rotlL2 = (h8, l3, s7) => s7 > 32 ? rotlBL2(h8, l3, s7) : rotlSL2(h8, l3, s7);
|
272980
|
-
function keccakP2(s7, rounds = 24) {
|
272981
|
-
const B4 = new Uint32Array(5 * 2);
|
272982
|
-
for (let round = 24 - rounds;round < 24; round++) {
|
272983
|
-
for (let x6 = 0;x6 < 10; x6++)
|
272984
|
-
B4[x6] = s7[x6] ^ s7[x6 + 10] ^ s7[x6 + 20] ^ s7[x6 + 30] ^ s7[x6 + 40];
|
272985
|
-
for (let x6 = 0;x6 < 10; x6 += 2) {
|
272986
|
-
const idx1 = (x6 + 8) % 10;
|
272987
|
-
const idx0 = (x6 + 2) % 10;
|
272988
|
-
const B0 = B4[idx0];
|
272989
|
-
const B1 = B4[idx0 + 1];
|
272990
|
-
const Th = rotlH2(B0, B1, 1) ^ B4[idx1];
|
272991
|
-
const Tl = rotlL2(B0, B1, 1) ^ B4[idx1 + 1];
|
272992
|
-
for (let y4 = 0;y4 < 50; y4 += 10) {
|
272993
|
-
s7[x6 + y4] ^= Th;
|
272994
|
-
s7[x6 + y4 + 1] ^= Tl;
|
272995
|
-
}
|
272996
|
-
}
|
272997
|
-
let curH = s7[2];
|
272998
|
-
let curL = s7[3];
|
272999
|
-
for (let t8 = 0;t8 < 24; t8++) {
|
273000
|
-
const shift = SHA3_ROTL2[t8];
|
273001
|
-
const Th = rotlH2(curH, curL, shift);
|
273002
|
-
const Tl = rotlL2(curH, curL, shift);
|
273003
|
-
const PI = SHA3_PI2[t8];
|
273004
|
-
curH = s7[PI];
|
273005
|
-
curL = s7[PI + 1];
|
273006
|
-
s7[PI] = Th;
|
273007
|
-
s7[PI + 1] = Tl;
|
273008
|
-
}
|
273009
|
-
for (let y4 = 0;y4 < 50; y4 += 10) {
|
273010
|
-
for (let x6 = 0;x6 < 10; x6++)
|
273011
|
-
B4[x6] = s7[y4 + x6];
|
273012
|
-
for (let x6 = 0;x6 < 10; x6++)
|
273013
|
-
s7[y4 + x6] ^= ~B4[(x6 + 2) % 10] & B4[(x6 + 4) % 10];
|
273014
|
-
}
|
273015
|
-
s7[0] ^= SHA3_IOTA_H2[round];
|
273016
|
-
s7[1] ^= SHA3_IOTA_L2[round];
|
273017
|
-
}
|
273018
|
-
B4.fill(0);
|
273019
|
-
}
|
273020
|
-
|
273021
|
-
class Keccak2 extends Hash2 {
|
273022
|
-
constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
|
273023
|
-
super();
|
273024
|
-
this.pos = 0;
|
273025
|
-
this.posOut = 0;
|
273026
|
-
this.finished = false;
|
273027
|
-
this.destroyed = false;
|
273028
|
-
this.enableXOF = false;
|
273029
|
-
this.blockLen = blockLen;
|
273030
|
-
this.suffix = suffix;
|
273031
|
-
this.outputLen = outputLen;
|
273032
|
-
this.enableXOF = enableXOF;
|
273033
|
-
this.rounds = rounds;
|
273034
|
-
anumber2(outputLen);
|
273035
|
-
if (0 >= this.blockLen || this.blockLen >= 200)
|
273036
|
-
throw new Error("Sha3 supports only keccak-f1600 function");
|
273037
|
-
this.state = new Uint8Array(200);
|
273038
|
-
this.state32 = u322(this.state);
|
273039
|
-
}
|
273040
|
-
keccak() {
|
273041
|
-
if (!isLE2)
|
273042
|
-
byteSwap322(this.state32);
|
273043
|
-
keccakP2(this.state32, this.rounds);
|
273044
|
-
if (!isLE2)
|
273045
|
-
byteSwap322(this.state32);
|
273046
|
-
this.posOut = 0;
|
273047
|
-
this.pos = 0;
|
273048
|
-
}
|
273049
|
-
update(data) {
|
273050
|
-
aexists2(this);
|
273051
|
-
const { blockLen, state } = this;
|
273052
|
-
data = toBytes3(data);
|
273053
|
-
const len = data.length;
|
273054
|
-
for (let pos = 0;pos < len; ) {
|
273055
|
-
const take2 = Math.min(blockLen - this.pos, len - pos);
|
273056
|
-
for (let i6 = 0;i6 < take2; i6++)
|
273057
|
-
state[this.pos++] ^= data[pos++];
|
273058
|
-
if (this.pos === blockLen)
|
273059
|
-
this.keccak();
|
273060
|
-
}
|
273061
|
-
return this;
|
273062
|
-
}
|
273063
|
-
finish() {
|
273064
|
-
if (this.finished)
|
273065
|
-
return;
|
273066
|
-
this.finished = true;
|
273067
|
-
const { state, suffix, pos, blockLen } = this;
|
273068
|
-
state[pos] ^= suffix;
|
273069
|
-
if ((suffix & 128) !== 0 && pos === blockLen - 1)
|
273070
|
-
this.keccak();
|
273071
|
-
state[blockLen - 1] ^= 128;
|
273072
|
-
this.keccak();
|
273073
|
-
}
|
273074
|
-
writeInto(out) {
|
273075
|
-
aexists2(this, false);
|
273076
|
-
abytes3(out);
|
273077
|
-
this.finish();
|
273078
|
-
const bufferOut = this.state;
|
273079
|
-
const { blockLen } = this;
|
273080
|
-
for (let pos = 0, len = out.length;pos < len; ) {
|
273081
|
-
if (this.posOut >= blockLen)
|
273082
|
-
this.keccak();
|
273083
|
-
const take2 = Math.min(blockLen - this.posOut, len - pos);
|
273084
|
-
out.set(bufferOut.subarray(this.posOut, this.posOut + take2), pos);
|
273085
|
-
this.posOut += take2;
|
273086
|
-
pos += take2;
|
273087
|
-
}
|
273088
|
-
return out;
|
273089
|
-
}
|
273090
|
-
xofInto(out) {
|
273091
|
-
if (!this.enableXOF)
|
273092
|
-
throw new Error("XOF is not possible for this instance");
|
273093
|
-
return this.writeInto(out);
|
273094
|
-
}
|
273095
|
-
xof(bytes) {
|
273096
|
-
anumber2(bytes);
|
273097
|
-
return this.xofInto(new Uint8Array(bytes));
|
273098
|
-
}
|
273099
|
-
digestInto(out) {
|
273100
|
-
aoutput2(out, this);
|
273101
|
-
if (this.finished)
|
273102
|
-
throw new Error("digest() was already called");
|
273103
|
-
this.writeInto(out);
|
273104
|
-
this.destroy();
|
273105
|
-
return out;
|
273106
|
-
}
|
273107
|
-
digest() {
|
273108
|
-
return this.digestInto(new Uint8Array(this.outputLen));
|
273109
|
-
}
|
273110
|
-
destroy() {
|
273111
|
-
this.destroyed = true;
|
273112
|
-
this.state.fill(0);
|
273113
|
-
}
|
273114
|
-
_cloneInto(to) {
|
273115
|
-
const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
|
273116
|
-
to || (to = new Keccak2(blockLen, suffix, outputLen, enableXOF, rounds));
|
273117
|
-
to.state32.set(this.state32);
|
273118
|
-
to.pos = this.pos;
|
273119
|
-
to.posOut = this.posOut;
|
273120
|
-
to.finished = this.finished;
|
273121
|
-
to.rounds = rounds;
|
273122
|
-
to.suffix = suffix;
|
273123
|
-
to.outputLen = outputLen;
|
273124
|
-
to.enableXOF = enableXOF;
|
273125
|
-
to.destroyed = this.destroyed;
|
273126
|
-
return to;
|
273127
|
-
}
|
273128
|
-
}
|
273129
|
-
var gen2 = (suffix, blockLen, outputLen) => wrapConstructor2(() => new Keccak2(blockLen, suffix, outputLen));
|
273130
|
-
var sha3_2242 = /* @__PURE__ */ gen2(6, 144, 224 / 8);
|
273131
|
-
var sha3_2562 = /* @__PURE__ */ gen2(6, 136, 256 / 8);
|
273132
|
-
var sha3_3842 = /* @__PURE__ */ gen2(6, 104, 384 / 8);
|
273133
|
-
var sha3_5122 = /* @__PURE__ */ gen2(6, 72, 512 / 8);
|
273134
|
-
var keccak_2242 = /* @__PURE__ */ gen2(1, 144, 224 / 8);
|
273135
|
-
var keccak_2562 = /* @__PURE__ */ gen2(1, 136, 256 / 8);
|
273136
|
-
var keccak_3842 = /* @__PURE__ */ gen2(1, 104, 384 / 8);
|
273137
|
-
var keccak_5122 = /* @__PURE__ */ gen2(1, 72, 512 / 8);
|
273138
|
-
var genShake2 = (suffix, blockLen, outputLen) => wrapXOFConstructorWithOpts2((opts = {}) => new Keccak2(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true));
|
273139
|
-
var shake1282 = /* @__PURE__ */ genShake2(31, 168, 128 / 8);
|
273140
|
-
var shake2562 = /* @__PURE__ */ genShake2(31, 136, 256 / 8);
|
273141
|
-
|
273142
272885
|
// ../../node_modules/ox/_esm/core/Hash.js
|
272886
|
+
init_sha3();
|
273143
272887
|
init_Bytes();
|
273144
272888
|
init_Hex();
|
273145
272889
|
function keccak2562(value4, options = {}) {
|
273146
272890
|
const { as = typeof value4 === "string" ? "Hex" : "Bytes" } = options;
|
273147
|
-
const bytes =
|
272891
|
+
const bytes = keccak_256(from(value4));
|
273148
272892
|
if (as === "Bytes")
|
273149
272893
|
return bytes;
|
273150
272894
|
return fromBytes(bytes);
|
@@ -275032,15 +274776,18 @@ function createPublicClient(parameters) {
|
|
275032
274776
|
});
|
275033
274777
|
return client.extend(publicActions);
|
275034
274778
|
}
|
274779
|
+
// ../../node_modules/viem/_esm/index.js
|
274780
|
+
init_isAddress();
|
274781
|
+
|
275035
274782
|
// ../viem/dist/viem.mjs
|
275036
|
-
var
|
275037
|
-
var
|
274783
|
+
var u6 = ((r6) => (r6.PINCODE = "PINCODE", r6.OTP = "OTP", r6.SECRET_CODES = "SECRET_CODES", r6))(u6 || {});
|
274784
|
+
var g5 = ((i6) => (i6.SHA1 = "SHA1", i6.SHA224 = "SHA224", i6.SHA256 = "SHA256", i6.SHA384 = "SHA384", i6.SHA512 = "SHA512", i6.SHA3_224 = "SHA3-224", i6.SHA3_256 = "SHA3-256", i6.SHA3_384 = "SHA3-384", i6.SHA3_512 = "SHA3-512", i6))(g5 || {});
|
275038
274785
|
var R7 = exports_external.object({ accessToken: ApplicationAccessTokenSchema2.optional(), chainId: exports_external.string().optional(), chainName: exports_external.string(), rpcUrl: UrlOrPathSchema2, httpTransportConfig: exports_external.any().optional() });
|
275039
|
-
var b4 = exports_external.object({ accessToken: ApplicationAccessTokenSchema2.optional(), rpcUrl: UrlOrPathSchema2 });
|
275040
|
-
async function
|
274786
|
+
var b4 = exports_external.object({ accessToken: ApplicationAccessTokenSchema2.optional(), rpcUrl: UrlOrPathSchema2, httpTransportConfig: exports_external.any().optional() });
|
274787
|
+
async function ae4(t8) {
|
275041
274788
|
ensureServer();
|
275042
274789
|
let e10 = validate2(b4, t8);
|
275043
|
-
return createPublicClient({ transport: http(e10.rpcUrl, { fetchOptions: { headers: e10
|
274790
|
+
return createPublicClient({ transport: http(e10.rpcUrl, { ...e10.httpTransportConfig, fetchOptions: { ...e10?.httpTransportConfig?.fetchOptions, headers: appendHeaders(e10?.httpTransportConfig?.fetchOptions?.headers, { "x-auth-token": e10.accessToken }) } }) }).getChainId();
|
275044
274791
|
}
|
275045
274792
|
|
275046
274793
|
// src/commands/codegen/codegen-viem.ts
|
@@ -275052,7 +274799,7 @@ async function codegenViem(env2) {
|
|
275052
274799
|
note("[Codegen] No RPC endpoints found, skipping Viem resources generation", "warn");
|
275053
274800
|
return;
|
275054
274801
|
}
|
275055
|
-
const chainId = env2.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID ?? await
|
274802
|
+
const chainId = env2.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID ?? await ae4({
|
275056
274803
|
accessToken: env2.SETTLEMINT_ACCESS_TOKEN,
|
275057
274804
|
rpcUrl: env2.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT
|
275058
274805
|
});
|
@@ -275078,7 +274825,7 @@ async function codegenViem(env2) {
|
|
275078
274825
|
* The public client. Use this if you need to read from the blockchain.
|
275079
274826
|
*/
|
275080
274827
|
export const publicClient = getPublicClient({
|
275081
|
-
accessToken: process.env.SETTLEMINT_BLOCKCHAIN_ACCESS_TOKEN,
|
274828
|
+
accessToken: process.env.SETTLEMINT_BLOCKCHAIN_ACCESS_TOKEN ?? "",
|
275082
274829
|
chainId: ${env2.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID ? "process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!" : `"${chainId}"`},
|
275083
274830
|
chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,
|
275084
274831
|
rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,
|
@@ -275090,7 +274837,7 @@ export const publicClient = getPublicClient({
|
|
275090
274837
|
* The wallet client. Use this if you need to write to the blockchain.
|
275091
274838
|
*/
|
275092
274839
|
export const walletClient = getWalletClient({
|
275093
|
-
accessToken: process.env.SETTLEMINT_BLOCKCHAIN_ACCESS_TOKEN,
|
274840
|
+
accessToken: process.env.SETTLEMINT_BLOCKCHAIN_ACCESS_TOKEN ?? "",
|
275094
274841
|
chainId: ${env2.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID ? "process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!" : `"${chainId}"`},
|
275095
274842
|
chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,
|
275096
274843
|
rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT!,
|
@@ -275101,7 +274848,7 @@ export const walletClient = getWalletClient({
|
|
275101
274848
|
* HD wallets require a challenge response to be sent with the request.
|
275102
274849
|
*/
|
275103
274850
|
export const hdWalletClient = getWalletClient({
|
275104
|
-
accessToken: process.env.SETTLEMINT_BLOCKCHAIN_ACCESS_TOKEN,
|
274851
|
+
accessToken: process.env.SETTLEMINT_BLOCKCHAIN_ACCESS_TOKEN ?? "",
|
275105
274852
|
chainId: ${env2.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID ? "process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!" : `"${chainId}"`},
|
275106
274853
|
chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,
|
275107
274854
|
rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT!,
|
@@ -275748,7 +275495,12 @@ async function theGraphPrompt({
|
|
275748
275495
|
}
|
275749
275496
|
|
275750
275497
|
// src/prompts/instance.prompt.ts
|
275751
|
-
async function instancePrompt(
|
275498
|
+
async function instancePrompt({
|
275499
|
+
env: env2,
|
275500
|
+
accept,
|
275501
|
+
freeTextInput = false,
|
275502
|
+
isCi = is_in_ci_default
|
275503
|
+
}) {
|
275752
275504
|
const autoAccept = !!accept || isCi;
|
275753
275505
|
const defaultInstance = env2.SETTLEMINT_INSTANCE;
|
275754
275506
|
const defaultPossible = autoAccept && defaultInstance;
|
@@ -275778,10 +275530,7 @@ async function instancePrompt(env2, accept, freeTextInput = false, isCi = is_in_
|
|
275778
275530
|
return sanitizeInstanceUrl(instance);
|
275779
275531
|
}
|
275780
275532
|
if (knownInstances.length === 0) {
|
275781
|
-
|
275782
|
-
}
|
275783
|
-
if (knownInstances.length === 1) {
|
275784
|
-
return sanitizeInstanceUrl(knownInstances[0]);
|
275533
|
+
note("No instances found. Run `settlemint login` to configure an instance.", "warn");
|
275785
275534
|
}
|
275786
275535
|
return esm_default3({
|
275787
275536
|
message: "What instance do you want to connect to?",
|
@@ -275791,16 +275540,17 @@ async function instancePrompt(env2, accept, freeTextInput = false, isCi = is_in_
|
|
275791
275540
|
value: sanitizeInstanceUrl(instance)
|
275792
275541
|
})),
|
275793
275542
|
{
|
275794
|
-
name: "Standalone (
|
275543
|
+
name: "Standalone (services run independently of SettleMint platform)",
|
275795
275544
|
value: STANDALONE_INSTANCE2
|
275796
275545
|
}
|
275797
275546
|
],
|
275798
|
-
default: sanitizeInstanceUrl(defaultPromptInstance)
|
275547
|
+
default: sanitizeInstanceUrl(knownInstances.length > 0 ? defaultPromptInstance : STANDALONE_INSTANCE2)
|
275799
275548
|
});
|
275800
275549
|
}
|
275801
275550
|
|
275802
275551
|
// src/prompts/standalone/service-secret.prompt.ts
|
275803
275552
|
async function serviceSecretPrompt({
|
275553
|
+
name: name3,
|
275804
275554
|
defaultSecret,
|
275805
275555
|
message = "Enter service secret:",
|
275806
275556
|
accept = false,
|
@@ -275811,11 +275561,11 @@ async function serviceSecretPrompt({
|
|
275811
275561
|
return defaultSecret;
|
275812
275562
|
}
|
275813
275563
|
if (isCi) {
|
275814
|
-
return defaultSecret
|
275564
|
+
return defaultSecret;
|
275815
275565
|
}
|
275816
275566
|
if (defaultSecret) {
|
275817
275567
|
const keep = await esm_default4({
|
275818
|
-
message:
|
275568
|
+
message: `Do you want to use the existing ${name3} secret?`,
|
275819
275569
|
default: true
|
275820
275570
|
});
|
275821
275571
|
if (keep) {
|
@@ -275825,7 +275575,7 @@ async function serviceSecretPrompt({
|
|
275825
275575
|
const serviceSecret = await esm_default5({
|
275826
275576
|
message
|
275827
275577
|
});
|
275828
|
-
return serviceSecret
|
275578
|
+
return serviceSecret || undefined;
|
275829
275579
|
}
|
275830
275580
|
|
275831
275581
|
// src/prompts/standalone/service-url.prompt.ts
|
@@ -275838,10 +275588,10 @@ async function serviceUrlPrompt({
|
|
275838
275588
|
}) {
|
275839
275589
|
const autoAccept = !!accept || isCi;
|
275840
275590
|
if (autoAccept && defaultUrl) {
|
275841
|
-
return
|
275591
|
+
return new URL(defaultUrl).toString();
|
275842
275592
|
}
|
275843
275593
|
if (isCi) {
|
275844
|
-
return
|
275594
|
+
return defaultUrl ? new URL(defaultUrl).toString() : undefined;
|
275845
275595
|
}
|
275846
275596
|
const serviceUrl = await esm_default2({
|
275847
275597
|
message: example ? `${message} (eg ${example})` : message,
|
@@ -275857,7 +275607,7 @@ async function serviceUrlPrompt({
|
|
275857
275607
|
},
|
275858
275608
|
transformer: (value4) => value4.trim()
|
275859
275609
|
});
|
275860
|
-
return
|
275610
|
+
return serviceUrl || undefined;
|
275861
275611
|
}
|
275862
275612
|
|
275863
275613
|
// src/prompts/workspace.prompt.ts
|
@@ -276122,9 +275872,130 @@ function getHdPrivateKeyEnv(service) {
|
|
276122
275872
|
};
|
276123
275873
|
}
|
276124
275874
|
|
275875
|
+
// src/utils/subgraph/thegraph-url.ts
|
275876
|
+
function getUpdatedSubgraphEndpoints({
|
275877
|
+
existingEndpoints,
|
275878
|
+
newSubgraphName,
|
275879
|
+
middlewareAdminUrl,
|
275880
|
+
removedSubgraphName
|
275881
|
+
}) {
|
275882
|
+
const existingEndpointsWithoutRemoved = existingEndpoints.filter((endpoint) => {
|
275883
|
+
return getSubgraphName(endpoint) !== removedSubgraphName;
|
275884
|
+
});
|
275885
|
+
if (newSubgraphName) {
|
275886
|
+
if (!middlewareAdminUrl) {
|
275887
|
+
throw new Error("Middleware admin URL is required to add a new subgraph");
|
275888
|
+
}
|
275889
|
+
const baseUrl = extractBaseUrlBeforeSegment(middlewareAdminUrl, "/admin");
|
275890
|
+
if (baseUrl) {
|
275891
|
+
const endpoint = `${getTheGraphSubgraphUrl(baseUrl, newSubgraphName)}`;
|
275892
|
+
if (!existingEndpointsWithoutRemoved.includes(endpoint)) {
|
275893
|
+
existingEndpointsWithoutRemoved.push(endpoint);
|
275894
|
+
}
|
275895
|
+
}
|
275896
|
+
}
|
275897
|
+
return existingEndpointsWithoutRemoved;
|
275898
|
+
}
|
275899
|
+
function getTheGraphUrl(subgraphUrls) {
|
275900
|
+
if (Array.isArray(subgraphUrls) && subgraphUrls.length > 0) {
|
275901
|
+
return extractBaseUrlBeforeSegment(subgraphUrls[0], "/subgraphs");
|
275902
|
+
}
|
275903
|
+
return;
|
275904
|
+
}
|
275905
|
+
function getTheGraphSubgraphNames(subgraphUrls) {
|
275906
|
+
if (Array.isArray(subgraphUrls) && subgraphUrls.length > 0) {
|
275907
|
+
return subgraphUrls.map((url2) => getSubgraphName(url2));
|
275908
|
+
}
|
275909
|
+
return [];
|
275910
|
+
}
|
275911
|
+
function getTheGraphSubgraphUrl(theGraphUrl, subgraphName) {
|
275912
|
+
return `${theGraphUrl}/subgraphs/name/${subgraphName}`;
|
275913
|
+
}
|
275914
|
+
|
275915
|
+
// ../utils/dist/logging.mjs
|
275916
|
+
var maskTokens4 = (output) => {
|
275917
|
+
return output.replace(/sm_(pat|aat|sat)_[0-9a-zA-Z]+/g, "***");
|
275918
|
+
};
|
275919
|
+
function createLogger(options = {}) {
|
275920
|
+
const { level = "warn", prefix = "" } = options;
|
275921
|
+
const logLevels = {
|
275922
|
+
debug: 0,
|
275923
|
+
info: 1,
|
275924
|
+
warn: 2,
|
275925
|
+
error: 3,
|
275926
|
+
none: 4
|
275927
|
+
};
|
275928
|
+
const currentLevelValue = logLevels[level];
|
275929
|
+
const formatArgs = (args) => {
|
275930
|
+
if (args.length === 0 || args.every((arg) => arg === undefined || arg === null)) {
|
275931
|
+
return "";
|
275932
|
+
}
|
275933
|
+
const formatted = args.map((arg) => {
|
275934
|
+
if (arg instanceof Error) {
|
275935
|
+
return `
|
275936
|
+
${arg.stack || arg.message}`;
|
275937
|
+
}
|
275938
|
+
if (typeof arg === "object" && arg !== null) {
|
275939
|
+
return `
|
275940
|
+
${JSON.stringify(arg, null, 2)}`;
|
275941
|
+
}
|
275942
|
+
return ` ${String(arg)}`;
|
275943
|
+
}).join("");
|
275944
|
+
return `, args:${formatted}`;
|
275945
|
+
};
|
275946
|
+
const shouldLog = (level2) => {
|
275947
|
+
return logLevels[level2] >= currentLevelValue;
|
275948
|
+
};
|
275949
|
+
return {
|
275950
|
+
debug: (message, ...args) => {
|
275951
|
+
if (shouldLog("debug")) {
|
275952
|
+
console.debug(`\x1B[32m${prefix}[DEBUG] ${maskTokens4(message)}${maskTokens4(formatArgs(args))}\x1B[0m`);
|
275953
|
+
}
|
275954
|
+
},
|
275955
|
+
info: (message, ...args) => {
|
275956
|
+
if (shouldLog("info")) {
|
275957
|
+
console.info(`\x1B[34m${prefix}[INFO] ${maskTokens4(message)}${maskTokens4(formatArgs(args))}\x1B[0m`);
|
275958
|
+
}
|
275959
|
+
},
|
275960
|
+
warn: (message, ...args) => {
|
275961
|
+
if (shouldLog("warn")) {
|
275962
|
+
console.warn(`\x1B[33m${prefix}[WARN] ${maskTokens4(message)}${maskTokens4(formatArgs(args))}\x1B[0m`);
|
275963
|
+
}
|
275964
|
+
},
|
275965
|
+
error: (message, ...args) => {
|
275966
|
+
if (shouldLog("error")) {
|
275967
|
+
console.error(`\x1B[31m${prefix}[ERROR] ${maskTokens4(message)}${maskTokens4(formatArgs(args))}\x1B[0m`);
|
275968
|
+
}
|
275969
|
+
}
|
275970
|
+
};
|
275971
|
+
}
|
275972
|
+
var logger = createLogger();
|
275973
|
+
|
275974
|
+
// src/prompts/standalone/service-value.prompt.ts
|
275975
|
+
async function serviceValuePrompt({
|
275976
|
+
defaultValue,
|
275977
|
+
example,
|
275978
|
+
message = "Enter service value:",
|
275979
|
+
accept = false,
|
275980
|
+
isCi = is_in_ci_default
|
275981
|
+
}) {
|
275982
|
+
const autoAccept = !!accept || isCi;
|
275983
|
+
if (autoAccept && defaultValue) {
|
275984
|
+
return defaultValue;
|
275985
|
+
}
|
275986
|
+
if (isCi) {
|
275987
|
+
return defaultValue;
|
275988
|
+
}
|
275989
|
+
const serviceSecret = await esm_default2({
|
275990
|
+
message: example ? `${message} (eg ${example})` : message,
|
275991
|
+
default: defaultValue
|
275992
|
+
});
|
275993
|
+
return serviceSecret || undefined;
|
275994
|
+
}
|
275995
|
+
|
276125
275996
|
// src/commands/connect.ts
|
276126
275997
|
function connectCommand() {
|
276127
|
-
return new Command("connect").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").option("-i, --instance <instance>", "The instance to connect to (defaults to the instance in the .env file). Use 'standalone' if your resources are not
|
275998
|
+
return new Command("connect").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").option("-i, --instance <instance>", "The instance to connect to (defaults to the instance in the .env file). Use 'standalone' if your resources are not deployed on the SettleMint platform").description("Connects your dApp to your application").usage(createExamples([
|
276128
275999
|
{
|
276129
276000
|
description: "Connect to your environment",
|
276130
276001
|
command: "connect"
|
@@ -276136,17 +276007,24 @@ function connectCommand() {
|
|
276136
276007
|
{
|
276137
276008
|
description: "Connect to your production environment",
|
276138
276009
|
command: "connect --prod"
|
276010
|
+
},
|
276011
|
+
{
|
276012
|
+
description: "Connect to a standalone environment (when not using the SettleMint platform)",
|
276013
|
+
command: "connect --instance standalone"
|
276139
276014
|
}
|
276140
276015
|
])).action(async ({ acceptDefaults, prod, instance }) => {
|
276141
276016
|
intro("Connecting your dApp");
|
276142
276017
|
const env2 = await loadEnv(false, !!prod);
|
276143
|
-
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(
|
276018
|
+
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt({
|
276019
|
+
env: env2,
|
276020
|
+
accept: true
|
276021
|
+
});
|
276144
276022
|
if (selectedInstance === STANDALONE_INSTANCE2) {
|
276145
276023
|
await connectToStandalone(env2, acceptDefaults, prod);
|
276146
276024
|
} else {
|
276147
276025
|
await connectToPlatform(env2, selectedInstance, acceptDefaults, prod);
|
276148
276026
|
}
|
276149
|
-
outro("
|
276027
|
+
outro("dApp connected");
|
276150
276028
|
});
|
276151
276029
|
}
|
276152
276030
|
async function connectToPlatform(env2, selectedInstance, acceptDefaults, prod) {
|
@@ -276342,7 +276220,7 @@ async function connectToStandalone(env2, acceptDefaults, prod) {
|
|
276342
276220
|
message: "What is the JSON RPC endpoint for the blockchain node you want to use for sending transactions?",
|
276343
276221
|
example: "https://blockchain-node.mydomain.com",
|
276344
276222
|
defaultValue: env2.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT,
|
276345
|
-
|
276223
|
+
type: "url"
|
276346
276224
|
},
|
276347
276225
|
{
|
276348
276226
|
id: "loadBalancerJsonRpcEndpoint",
|
@@ -276350,7 +276228,7 @@ async function connectToStandalone(env2, acceptDefaults, prod) {
|
|
276350
276228
|
message: "What is the JSON RPC endpoint for the load balancer or blockchain node you want to use for read operations?",
|
276351
276229
|
example: "https://load-balancer.mydomain.com",
|
276352
276230
|
defaultValue: env2.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT,
|
276353
|
-
|
276231
|
+
type: "url"
|
276354
276232
|
},
|
276355
276233
|
{
|
276356
276234
|
id: "hasuraEndpoint",
|
@@ -276358,7 +276236,7 @@ async function connectToStandalone(env2, acceptDefaults, prod) {
|
|
276358
276236
|
message: "What is the GraphQL endpoint for the Hasura instance you want to connect to?",
|
276359
276237
|
example: "https://hasura.mydomain.com/v1/graphql",
|
276360
276238
|
defaultValue: env2.SETTLEMINT_HASURA_ENDPOINT,
|
276361
|
-
|
276239
|
+
type: "url"
|
276362
276240
|
},
|
276363
276241
|
{
|
276364
276242
|
id: "hasuraAdminSecret",
|
@@ -276366,7 +276244,7 @@ async function connectToStandalone(env2, acceptDefaults, prod) {
|
|
276366
276244
|
message: "What is the admin secret for the Hasura instance you want to connect to?",
|
276367
276245
|
example: "",
|
276368
276246
|
defaultValue: env2.SETTLEMINT_HASURA_ADMIN_SECRET,
|
276369
|
-
|
276247
|
+
type: "secret"
|
276370
276248
|
},
|
276371
276249
|
{
|
276372
276250
|
id: "hasuraDatabaseUrl",
|
@@ -276374,15 +276252,23 @@ async function connectToStandalone(env2, acceptDefaults, prod) {
|
|
276374
276252
|
message: "What is the database URL for the Hasura instance you want to connect to?",
|
276375
276253
|
example: "postgresql://username:password@host:port/database",
|
276376
276254
|
defaultValue: env2.SETTLEMINT_HASURA_DATABASE_URL,
|
276377
|
-
|
276255
|
+
type: "url"
|
276378
276256
|
},
|
276379
276257
|
{
|
276380
276258
|
id: "theGraphEndpoint",
|
276381
|
-
label: "The Graph
|
276382
|
-
message: "What is the
|
276383
|
-
example: "https://thegraph.mydomain.com
|
276384
|
-
defaultValue:
|
276385
|
-
|
276259
|
+
label: "The Graph Endpoint",
|
276260
|
+
message: "What is the endpoint for the The Graph instance you want to connect to?",
|
276261
|
+
example: "https://thegraph.mydomain.com",
|
276262
|
+
defaultValue: getTheGraphUrl(env2.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS),
|
276263
|
+
type: "url"
|
276264
|
+
},
|
276265
|
+
{
|
276266
|
+
id: "theGraphSubgraphNames",
|
276267
|
+
label: "The Graph subgraph names",
|
276268
|
+
message: "What are the names of the subgraphs you want to connect to (separated by commas)?",
|
276269
|
+
example: "subgraph-1,subgraph-2",
|
276270
|
+
defaultValue: getTheGraphSubgraphNames(env2.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS).join(","),
|
276271
|
+
type: "value"
|
276386
276272
|
},
|
276387
276273
|
{
|
276388
276274
|
id: "portalGraphqlEndpoint",
|
@@ -276390,7 +276276,7 @@ async function connectToStandalone(env2, acceptDefaults, prod) {
|
|
276390
276276
|
message: "What is the GraphQL endpoint for the Smart Contract Portal instance you want to connect to?",
|
276391
276277
|
example: "https://portal.mydomain.com/graphql",
|
276392
276278
|
defaultValue: env2.SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT,
|
276393
|
-
|
276279
|
+
type: "url"
|
276394
276280
|
},
|
276395
276281
|
{
|
276396
276282
|
id: "minioEndpoint",
|
@@ -276398,7 +276284,7 @@ async function connectToStandalone(env2, acceptDefaults, prod) {
|
|
276398
276284
|
message: "What is the endpoint for the MinIO instance you want to connect to?",
|
276399
276285
|
example: "s3://minio.mydomain.com",
|
276400
276286
|
defaultValue: env2.SETTLEMINT_MINIO_ENDPOINT,
|
276401
|
-
|
276287
|
+
type: "url"
|
276402
276288
|
},
|
276403
276289
|
{
|
276404
276290
|
id: "minioAccessKey",
|
@@ -276406,7 +276292,7 @@ async function connectToStandalone(env2, acceptDefaults, prod) {
|
|
276406
276292
|
message: "What is the access key for the MinIO instance you want to connect to?",
|
276407
276293
|
example: "",
|
276408
276294
|
defaultValue: env2.SETTLEMINT_MINIO_ACCESS_KEY,
|
276409
|
-
|
276295
|
+
type: "secret"
|
276410
276296
|
},
|
276411
276297
|
{
|
276412
276298
|
id: "minioSecretKey",
|
@@ -276414,7 +276300,7 @@ async function connectToStandalone(env2, acceptDefaults, prod) {
|
|
276414
276300
|
message: "What is the secret key for the MinIO instance you want to connect to?",
|
276415
276301
|
example: "",
|
276416
276302
|
defaultValue: env2.SETTLEMINT_MINIO_SECRET_KEY,
|
276417
|
-
|
276303
|
+
type: "secret"
|
276418
276304
|
},
|
276419
276305
|
{
|
276420
276306
|
id: "ipfsApiEndpoint",
|
@@ -276422,7 +276308,7 @@ async function connectToStandalone(env2, acceptDefaults, prod) {
|
|
276422
276308
|
message: "What is the endpoint for the IPFS instance you want to connect to?",
|
276423
276309
|
example: "https://ipfs.mydomain.com/api/v0",
|
276424
276310
|
defaultValue: env2.SETTLEMINT_IPFS_API_ENDPOINT,
|
276425
|
-
|
276311
|
+
type: "url"
|
276426
276312
|
},
|
276427
276313
|
{
|
276428
276314
|
id: "blockscoutGraphqlEndpoint",
|
@@ -276430,30 +276316,44 @@ async function connectToStandalone(env2, acceptDefaults, prod) {
|
|
276430
276316
|
message: "What is the GraphQL endpoint for the Blockscout instance you want to connect to?",
|
276431
276317
|
example: "https://blockscout.mydomain.com/api/v1/graphql",
|
276432
276318
|
defaultValue: env2.SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT,
|
276433
|
-
|
276319
|
+
type: "url"
|
276434
276320
|
}
|
276435
276321
|
];
|
276436
276322
|
const selectedServices = {};
|
276437
276323
|
for (const prompt of standalonePrompts) {
|
276438
|
-
const { id, message, example, defaultValue,
|
276439
|
-
const result =
|
276324
|
+
const { id, label, message, example, defaultValue, type: type4 } = prompt;
|
276325
|
+
const result = type4 === "secret" ? await serviceSecretPrompt({
|
276326
|
+
name: label,
|
276440
276327
|
message,
|
276441
276328
|
defaultSecret: defaultValue,
|
276442
276329
|
accept: acceptDefaults
|
276443
|
-
}) : await serviceUrlPrompt({
|
276330
|
+
}) : type4 === "url" ? await serviceUrlPrompt({
|
276444
276331
|
message,
|
276445
276332
|
example,
|
276446
276333
|
defaultUrl: defaultValue,
|
276447
276334
|
accept: acceptDefaults
|
276335
|
+
}) : await serviceValuePrompt({
|
276336
|
+
message,
|
276337
|
+
example,
|
276338
|
+
defaultValue,
|
276339
|
+
accept: acceptDefaults
|
276448
276340
|
});
|
276449
276341
|
selectedServices[id] = {
|
276450
276342
|
label: prompt.label,
|
276451
|
-
result
|
276343
|
+
result,
|
276344
|
+
isSecret: type4 === "secret"
|
276452
276345
|
};
|
276453
276346
|
}
|
276454
276347
|
if (acceptDefaults) {
|
276455
|
-
table("
|
276348
|
+
table("Configuration", Object.values(selectedServices).filter((item) => !item.isSecret).map((item) => {
|
276349
|
+
return {
|
276350
|
+
name: item.label,
|
276351
|
+
value: item.result ? maskTokens4(item.result) : undefined
|
276352
|
+
};
|
276353
|
+
}).filter(Boolean));
|
276456
276354
|
}
|
276355
|
+
const theGraphUrl = selectedServices.theGraphEndpoint?.result;
|
276356
|
+
const theGraphSubgraphNames = selectedServices.theGraphSubgraphNames?.result;
|
276457
276357
|
await writeEnvSpinner(!!prod, {
|
276458
276358
|
SETTLEMINT_INSTANCE: STANDALONE_INSTANCE2,
|
276459
276359
|
SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT: selectedServices.blockchainNodeJsonRpcEndpoint?.result,
|
@@ -276461,8 +276361,8 @@ async function connectToStandalone(env2, acceptDefaults, prod) {
|
|
276461
276361
|
SETTLEMINT_HASURA_ENDPOINT: selectedServices.hasuraEndpoint?.result,
|
276462
276362
|
SETTLEMINT_HASURA_ADMIN_SECRET: selectedServices.hasuraAdminSecret?.result,
|
276463
276363
|
SETTLEMINT_HASURA_DATABASE_URL: selectedServices.hasuraDatabaseUrl?.result,
|
276464
|
-
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS:
|
276465
|
-
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH:
|
276364
|
+
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: theGraphUrl && theGraphSubgraphNames ? theGraphSubgraphNames.split(",").map((name3) => getTheGraphSubgraphUrl(theGraphUrl, name3)) : [],
|
276365
|
+
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: theGraphSubgraphNames ? theGraphSubgraphNames.split(",")[0] : undefined,
|
276466
276366
|
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: selectedServices.portalGraphqlEndpoint?.result,
|
276467
276367
|
SETTLEMINT_MINIO_ENDPOINT: selectedServices.minioEndpoint?.result,
|
276468
276368
|
SETTLEMINT_MINIO_ACCESS_KEY: selectedServices.minioAccessKey?.result,
|
@@ -276888,12 +276788,12 @@ var U6 = l3((Ae3, G4) => {
|
|
276888
276788
|
}
|
276889
276789
|
});
|
276890
276790
|
var et3 = l3((Re3, tt2) => {
|
276891
|
-
var
|
276892
|
-
let n6 = e10.colon || Bt2, r6 = t8.match(/\//) ||
|
276893
|
-
...
|
276791
|
+
var g6 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys", Y4 = h8("path"), Bt2 = g6 ? ";" : ":", V5 = U6(), J3 = (t8) => Object.assign(new Error(`not found: ${t8}`), { code: "ENOENT" }), Q4 = (t8, e10) => {
|
276792
|
+
let n6 = e10.colon || Bt2, r6 = t8.match(/\//) || g6 && t8.match(/\\/) ? [""] : [
|
276793
|
+
...g6 ? [process.cwd()] : [],
|
276894
276794
|
...(e10.path || process.env.PATH || "").split(n6)
|
276895
|
-
], s7 =
|
276896
|
-
return
|
276795
|
+
], s7 = g6 ? e10.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "", o8 = g6 ? s7.split(n6) : [""];
|
276796
|
+
return g6 && t8.indexOf(".") !== -1 && o8[0] !== "" && o8.unshift(""), {
|
276897
276797
|
pathEnv: r6,
|
276898
276798
|
pathExt: o8,
|
276899
276799
|
pathExtExe: s7
|
@@ -276977,12 +276877,12 @@ var ct3 = l3((Ne3, it2) => {
|
|
276977
276877
|
it2.exports = Yt2;
|
276978
276878
|
});
|
276979
276879
|
var ut3 = l3((qe2, P5) => {
|
276980
|
-
var
|
276880
|
+
var C4 = /([()\][%!^"`<>&|;, *?])/g;
|
276981
276881
|
function Vt2(t8) {
|
276982
|
-
return t8 = t8.replace(
|
276882
|
+
return t8 = t8.replace(C4, "^$1"), t8;
|
276983
276883
|
}
|
276984
276884
|
function Jt2(t8, e10) {
|
276985
|
-
return t8 = `${t8}`, t8 = t8.replace(/(\\*)"/g, "$1$1\\\""), t8 = t8.replace(/(\\*)$/, "$1$1"), t8 = `"${t8}"`, t8 = t8.replace(
|
276885
|
+
return t8 = `${t8}`, t8 = t8.replace(/(\\*)"/g, "$1$1\\\""), t8 = t8.replace(/(\\*)$/, "$1$1"), t8 = `"${t8}"`, t8 = t8.replace(C4, "^$1"), e10 && (t8 = t8.replace(C4, "^$1")), t8;
|
276986
276886
|
}
|
276987
276887
|
P5.exports.command = Vt2;
|
276988
276888
|
P5.exports.argument = Jt2;
|
@@ -277012,14 +276912,14 @@ var ht3 = l3((je3, ft2) => {
|
|
277012
276912
|
ft2.exports = te4;
|
277013
276913
|
});
|
277014
276914
|
var wt3 = l3((Fe3, Et2) => {
|
277015
|
-
var ee4 = h8("path"), mt2 = ct3(), gt3 = ut3(), ne3 = ht3(),
|
276915
|
+
var ee4 = h8("path"), mt2 = ct3(), gt3 = ut3(), ne3 = ht3(), re4 = process.platform === "win32", se4 = /\.(?:com|exe)$/i, oe4 = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
277016
276916
|
function ie4(t8) {
|
277017
276917
|
t8.file = mt2(t8);
|
277018
276918
|
let e10 = t8.file && ne3(t8.file);
|
277019
276919
|
return e10 ? (t8.args.unshift(t8.file), t8.command = e10, mt2(t8)) : t8.file;
|
277020
276920
|
}
|
277021
276921
|
function ce3(t8) {
|
277022
|
-
if (!
|
276922
|
+
if (!re4)
|
277023
276923
|
return t8;
|
277024
276924
|
let e10 = ie4(t8), n6 = !se4.test(e10);
|
277025
276925
|
if (t8.options.forceShell || n6) {
|
@@ -277057,7 +276957,7 @@ var bt3 = l3((ze3, vt2) => {
|
|
277057
276957
|
spawnargs: t8.args
|
277058
276958
|
});
|
277059
276959
|
}
|
277060
|
-
function
|
276960
|
+
function ae5(t8, e10) {
|
277061
276961
|
if (!S4)
|
277062
276962
|
return;
|
277063
276963
|
let n6 = t8.emit;
|
@@ -277077,7 +276977,7 @@ var bt3 = l3((ze3, vt2) => {
|
|
277077
276977
|
return S4 && t8 === 1 && !e10.file ? k5(e10.original, "spawnSync") : null;
|
277078
276978
|
}
|
277079
276979
|
vt2.exports = {
|
277080
|
-
hookChildProcess:
|
276980
|
+
hookChildProcess: ae5,
|
277081
276981
|
verifyENOENT: xt2,
|
277082
276982
|
verifyENOENTSync: le4,
|
277083
276983
|
notFoundError: k5
|
@@ -277457,8 +277357,8 @@ async function detectPackageManager2(cwd2, options = {}) {
|
|
277457
277357
|
const scriptArg = process.argv[1];
|
277458
277358
|
if (scriptArg) {
|
277459
277359
|
for (const packageManager of packageManagers) {
|
277460
|
-
const
|
277461
|
-
if (
|
277360
|
+
const re4 = new RegExp(`[/\\\\]\\.?${packageManager.command}`);
|
277361
|
+
if (re4.test(scriptArg)) {
|
277462
277362
|
return packageManager;
|
277463
277363
|
}
|
277464
277364
|
}
|
@@ -277523,7 +277423,7 @@ function w$1() {
|
|
277523
277423
|
i$5 = 1;
|
277524
277424
|
const v6 = (e10, r6) => {
|
277525
277425
|
if (Number.isSafeInteger(e10))
|
277526
|
-
e10 < 0 ?
|
277426
|
+
e10 < 0 ? g6(e10, r6) : p5(e10, r6);
|
277527
277427
|
else
|
277528
277428
|
throw Error("cannot encode number outside of javascript safe integer range");
|
277529
277429
|
return r6;
|
@@ -277531,7 +277431,7 @@ function w$1() {
|
|
277531
277431
|
r6[0] = 128;
|
277532
277432
|
for (var o8 = r6.length;o8 > 1; o8--)
|
277533
277433
|
r6[o8 - 1] = e10 & 255, e10 = Math.floor(e10 / 256);
|
277534
|
-
},
|
277434
|
+
}, g6 = (e10, r6) => {
|
277535
277435
|
r6[0] = 255;
|
277536
277436
|
var o8 = false;
|
277537
277437
|
e10 = e10 * -1;
|
@@ -277599,7 +277499,7 @@ function E6() {
|
|
277599
277499
|
if (e10 || (e10 = this.block = Buffer.alloc(512), t8 = 0), t8 || (t8 = 0), !(e10.length >= t8 + 512))
|
277600
277500
|
throw new Error("need 512 bytes for header");
|
277601
277501
|
const i6 = this.ctime || this.atime ? 130 : 155, h9 = L6(this.path || "", i6), l4 = h9[0], n6 = h9[1];
|
277602
|
-
this.needPax = h9[2], this.needPax = m7(e10, t8, 100, l4) || this.needPax, this.needPax = c3(e10, t8 + 100, 8, this.mode) || this.needPax, this.needPax = c3(e10, t8 + 108, 8, this.uid) || this.needPax, this.needPax = c3(e10, t8 + 116, 8, this.gid) || this.needPax, this.needPax = c3(e10, t8 + 124, 12, this.size) || this.needPax, this.needPax =
|
277502
|
+
this.needPax = h9[2], this.needPax = m7(e10, t8, 100, l4) || this.needPax, this.needPax = c3(e10, t8 + 100, 8, this.mode) || this.needPax, this.needPax = c3(e10, t8 + 108, 8, this.uid) || this.needPax, this.needPax = c3(e10, t8 + 116, 8, this.gid) || this.needPax, this.needPax = c3(e10, t8 + 124, 12, this.size) || this.needPax, this.needPax = g6(e10, t8 + 136, 12, this.mtime) || this.needPax, e10[t8 + 156] = this[a7].charCodeAt(0), this.needPax = m7(e10, t8 + 157, 100, this.linkpath) || this.needPax, e10.write("ustar\x0000", t8 + 257, 8), this.needPax = m7(e10, t8 + 265, 32, this.uname) || this.needPax, this.needPax = m7(e10, t8 + 297, 32, this.gname) || this.needPax, this.needPax = c3(e10, t8 + 329, 8, this.devmaj) || this.needPax, this.needPax = c3(e10, t8 + 337, 8, this.devmin) || this.needPax, this.needPax = m7(e10, t8 + 345, i6, n6) || this.needPax, e10[t8 + 475] !== 0 ? this.needPax = m7(e10, t8 + 345, 155, n6) || this.needPax : (this.needPax = m7(e10, t8 + 345, 130, n6) || this.needPax, this.needPax = g6(e10, t8 + 476, 12, this.atime) || this.needPax, this.needPax = g6(e10, t8 + 488, 12, this.ctime) || this.needPax);
|
277603
277503
|
let S4 = 8 * 32;
|
277604
277504
|
for (let p5 = t8;p5 < t8 + 148; p5++)
|
277605
277505
|
S4 += e10[p5];
|
@@ -277634,7 +277534,7 @@ function E6() {
|
|
277634
277534
|
l4 || (l4 = [s7.slice(0, 99), "", true]);
|
277635
277535
|
}
|
277636
277536
|
return l4;
|
277637
|
-
}, d6 = (s7, e10, t8) => s7.slice(e10, e10 + t8).toString("utf8").replace(/\0.*/, ""), o8 = (s7, e10, t8) => N7(r6(s7, e10, t8)), N7 = (s7) => s7 === null ? null : new Date(s7 * 1000), r6 = (s7, e10, t8) => s7[e10] & 128 ? y4.parse(s7.slice(e10, e10 + t8)) : j3(s7, e10, t8), q7 = (s7) => isNaN(s7) ? null : s7, j3 = (s7, e10, t8) => q7(parseInt(s7.slice(e10, e10 + t8).toString("utf8").replace(/\0.*$/, "").trim(), 8)), v6 = { 12: 8589934591, 8: 2097151 }, c3 = (s7, e10, t8, i6) => i6 === null ? false : i6 > v6[t8] || i6 < 0 ? (y4.encode(i6, s7.slice(e10, e10 + t8)), true) : ($6(s7, e10, t8, i6), false), $6 = (s7, e10, t8, i6) => s7.write(_5(i6, t8), e10, t8, "ascii"), _5 = (s7, e10) => z4(Math.floor(s7).toString(8), e10), z4 = (s7, e10) => (s7.length === e10 - 1 ? s7 : new Array(e10 - s7.length - 1).join("0") + s7 + " ") + "\x00",
|
277537
|
+
}, d6 = (s7, e10, t8) => s7.slice(e10, e10 + t8).toString("utf8").replace(/\0.*/, ""), o8 = (s7, e10, t8) => N7(r6(s7, e10, t8)), N7 = (s7) => s7 === null ? null : new Date(s7 * 1000), r6 = (s7, e10, t8) => s7[e10] & 128 ? y4.parse(s7.slice(e10, e10 + t8)) : j3(s7, e10, t8), q7 = (s7) => isNaN(s7) ? null : s7, j3 = (s7, e10, t8) => q7(parseInt(s7.slice(e10, e10 + t8).toString("utf8").replace(/\0.*$/, "").trim(), 8)), v6 = { 12: 8589934591, 8: 2097151 }, c3 = (s7, e10, t8, i6) => i6 === null ? false : i6 > v6[t8] || i6 < 0 ? (y4.encode(i6, s7.slice(e10, e10 + t8)), true) : ($6(s7, e10, t8, i6), false), $6 = (s7, e10, t8, i6) => s7.write(_5(i6, t8), e10, t8, "ascii"), _5 = (s7, e10) => z4(Math.floor(s7).toString(8), e10), z4 = (s7, e10) => (s7.length === e10 - 1 ? s7 : new Array(e10 - s7.length - 1).join("0") + s7 + " ") + "\x00", g6 = (s7, e10, t8, i6) => i6 === null ? false : c3(s7, e10, t8, i6.getTime() / 1000), A5 = new Array(156).join("\x00"), m7 = (s7, e10, t8, i6) => i6 === null ? false : (s7.write(i6 + A5, e10, t8, "utf8"), i6.length !== Buffer.byteLength(i6) || i6.length > t8);
|
277638
277538
|
return k5 = B4, k5;
|
277639
277539
|
}
|
277640
277540
|
var e$3;
|
@@ -277822,7 +277722,7 @@ function ft2() {
|
|
277822
277722
|
if (X$1)
|
277823
277723
|
return s$5;
|
277824
277724
|
X$1 = 1;
|
277825
|
-
const H4 = typeof process == "object" && process ? process : { stdout: null, stderr: null }, Z4 = nt2, q7 = ot2, G4 = ht4.StringDecoder, m7 = Symbol("EOF"), d6 = Symbol("maybeEmitEnd"), y4 = Symbol("emittedEnd"), R9 = Symbol("emittingEnd"),
|
277725
|
+
const H4 = typeof process == "object" && process ? process : { stdout: null, stderr: null }, Z4 = nt2, q7 = ot2, G4 = ht4.StringDecoder, m7 = Symbol("EOF"), d6 = Symbol("maybeEmitEnd"), y4 = Symbol("emittedEnd"), R9 = Symbol("emittingEnd"), g6 = Symbol("emittedError"), B4 = Symbol("closed"), Y4 = Symbol("read"), T4 = Symbol("flush"), $6 = Symbol("flushChunk"), f5 = Symbol("encoding"), c3 = Symbol("decoder"), M5 = Symbol("flowing"), S4 = Symbol("paused"), b5 = Symbol("resume"), i6 = Symbol("buffer"), a7 = Symbol("pipes"), n6 = Symbol("bufferLength"), j3 = Symbol("bufferPush"), I7 = Symbol("bufferShift"), o8 = Symbol("objectMode"), r6 = Symbol("destroyed"), P6 = Symbol("error"), x7 = Symbol("emitData"), V6 = Symbol("emitEnd"), N7 = Symbol("emitEnd2"), p5 = Symbol("async"), _5 = Symbol("abort"), O6 = Symbol("aborted"), E7 = Symbol("signal"), w6 = (h9) => Promise.resolve().then(h9), J3 = commonjsGlobal._MP_NO_ITERATOR_SYMBOLS_ !== "1", K4 = J3 && Symbol.asyncIterator || Symbol("asyncIterator not implemented"), W6 = J3 && Symbol.iterator || Symbol("iterator not implemented"), k6 = (h9) => h9 === "end" || h9 === "finish" || h9 === "prefinish", tt2 = (h9) => h9 instanceof ArrayBuffer || typeof h9 == "object" && h9.constructor && h9.constructor.name === "ArrayBuffer" && h9.byteLength >= 0, et4 = (h9) => !Buffer.isBuffer(h9) && ArrayBuffer.isView(h9);
|
277826
277726
|
|
277827
277727
|
class z4 {
|
277828
277728
|
constructor(t8, e10, s7) {
|
@@ -277848,7 +277748,7 @@ function ft2() {
|
|
277848
277748
|
|
277849
277749
|
class F3 extends q7 {
|
277850
277750
|
constructor(t8) {
|
277851
|
-
super(), this[M5] = false, this[S4] = false, this[a7] = [], this[i6] = [], this[o8] = t8 && t8.objectMode || false, this[o8] ? this[f5] = null : this[f5] = t8 && t8.encoding || null, this[f5] === "buffer" && (this[f5] = null), this[p5] = t8 && !!t8.async || false, this[c3] = this[f5] ? new G4(this[f5]) : null, this[m7] = false, this[y4] = false, this[R9] = false, this[B4] = false, this[
|
277751
|
+
super(), this[M5] = false, this[S4] = false, this[a7] = [], this[i6] = [], this[o8] = t8 && t8.objectMode || false, this[o8] ? this[f5] = null : this[f5] = t8 && t8.encoding || null, this[f5] === "buffer" && (this[f5] = null), this[p5] = t8 && !!t8.async || false, this[c3] = this[f5] ? new G4(this[f5]) : null, this[m7] = false, this[y4] = false, this[R9] = false, this[B4] = false, this[g6] = null, this.writable = true, this.readable = true, this[n6] = 0, this[r6] = false, t8 && t8.debugExposeBuffer === true && Object.defineProperty(this, "buffer", { get: () => this[i6] }), t8 && t8.debugExposePipes === true && Object.defineProperty(this, "pipes", { get: () => this[a7] }), this[E7] = t8 && t8.signal, this[O6] = false, this[E7] && (this[E7].addEventListener("abort", () => this[_5]()), this[E7].aborted && this[_5]());
|
277852
277752
|
}
|
277853
277753
|
get bufferLength() {
|
277854
277754
|
return this[n6];
|
@@ -277959,7 +277859,7 @@ function ft2() {
|
|
277959
277859
|
}
|
277960
277860
|
on(t8, e10) {
|
277961
277861
|
const s7 = super.on(t8, e10);
|
277962
|
-
return t8 === "data" && !this[a7].length && !this.flowing ? this[b5]() : t8 === "readable" && this[n6] !== 0 ? super.emit("readable") : k6(t8) && this[y4] ? (super.emit(t8), this.removeAllListeners(t8)) : t8 === "error" && this[
|
277862
|
+
return t8 === "data" && !this[a7].length && !this.flowing ? this[b5]() : t8 === "readable" && this[n6] !== 0 ? super.emit("readable") : k6(t8) && this[y4] ? (super.emit(t8), this.removeAllListeners(t8)) : t8 === "error" && this[g6] && (this[p5] ? w6(() => e10.call(this, this[g6])) : e10.call(this, this[g6])), s7;
|
277963
277863
|
}
|
277964
277864
|
get emittedEnd() {
|
277965
277865
|
return this[y4];
|
@@ -277980,7 +277880,7 @@ function ft2() {
|
|
277980
277880
|
const u7 = super.emit("close");
|
277981
277881
|
return this.removeAllListeners("close"), u7;
|
277982
277882
|
} else if (t8 === "error") {
|
277983
|
-
this[
|
277883
|
+
this[g6] = e10, super.emit(P6, e10);
|
277984
277884
|
const u7 = !this[E7] || this.listeners("error").length ? super.emit("error", e10) : false;
|
277985
277885
|
return this[d6](), u7;
|
277986
277886
|
} else if (t8 === "resume") {
|
@@ -278045,14 +277945,14 @@ function ft2() {
|
|
278045
277945
|
return e10();
|
278046
277946
|
let u7 = null, Q4 = null;
|
278047
277947
|
const A5 = (L6) => {
|
278048
|
-
this.removeListener("data", U7), this.removeListener("end",
|
277948
|
+
this.removeListener("data", U7), this.removeListener("end", C4), this.removeListener(r6, D3), e10(), Q4(L6);
|
278049
277949
|
}, U7 = (L6) => {
|
278050
|
-
this.removeListener("error", A5), this.removeListener("end",
|
278051
|
-
},
|
277950
|
+
this.removeListener("error", A5), this.removeListener("end", C4), this.removeListener(r6, D3), this.pause(), u7({ value: L6, done: !!this[m7] });
|
277951
|
+
}, C4 = () => {
|
278052
277952
|
this.removeListener("error", A5), this.removeListener("data", U7), this.removeListener(r6, D3), e10(), u7({ done: true });
|
278053
277953
|
}, D3 = () => A5(new Error("stream destroyed"));
|
278054
277954
|
return new Promise((L6, it2) => {
|
278055
|
-
Q4 = it2, u7 = L6, this.once(r6, D3), this.once("error", A5), this.once("end",
|
277955
|
+
Q4 = it2, u7 = L6, this.once(r6, D3), this.once("error", A5), this.once("end", C4), this.once("data", U7);
|
278056
277956
|
});
|
278057
277957
|
}, throw: e10, return: e10, [K4]() {
|
278058
277958
|
return this;
|
@@ -278198,7 +278098,7 @@ function tt2() {
|
|
278198
278098
|
if (H$1)
|
278199
278099
|
return j3;
|
278200
278100
|
H$1 = 1;
|
278201
|
-
const I7 = typeof process == "object" && process ? process : { stdout: null, stderr: null }, Y4 = nt2, x7 = ot2, N7 = ht4.StringDecoder, u7 = Symbol("EOF"), a7 = Symbol("maybeEmitEnd"), c3 = Symbol("emittedEnd"), S4 = Symbol("emittingEnd"), E7 = Symbol("emittedError"), w6 = Symbol("closed"), P6 = Symbol("read"), L6 = Symbol("flush"), _6 = Symbol("flushChunk"), h9 = Symbol("encoding"), m7 = Symbol("decoder"), M5 = Symbol("flowing"), y4 = Symbol("paused"), p5 = Symbol("resume"), s7 = Symbol("bufferLength"), T5 = Symbol("bufferPush"), B4 = Symbol("bufferShift"), r6 = Symbol("objectMode"), n6 = Symbol("destroyed"), D3 = Symbol("emitData"), F3 = Symbol("emitEnd"), R9 = Symbol("emitEnd2"), d6 = Symbol("async"), b5 = (o8) => Promise.resolve().then(o8),
|
278101
|
+
const I7 = typeof process == "object" && process ? process : { stdout: null, stderr: null }, Y4 = nt2, x7 = ot2, N7 = ht4.StringDecoder, u7 = Symbol("EOF"), a7 = Symbol("maybeEmitEnd"), c3 = Symbol("emittedEnd"), S4 = Symbol("emittingEnd"), E7 = Symbol("emittedError"), w6 = Symbol("closed"), P6 = Symbol("read"), L6 = Symbol("flush"), _6 = Symbol("flushChunk"), h9 = Symbol("encoding"), m7 = Symbol("decoder"), M5 = Symbol("flowing"), y4 = Symbol("paused"), p5 = Symbol("resume"), s7 = Symbol("bufferLength"), T5 = Symbol("bufferPush"), B4 = Symbol("bufferShift"), r6 = Symbol("objectMode"), n6 = Symbol("destroyed"), D3 = Symbol("emitData"), F3 = Symbol("emitEnd"), R9 = Symbol("emitEnd2"), d6 = Symbol("async"), b5 = (o8) => Promise.resolve().then(o8), C4 = commonjsGlobal._MP_NO_ITERATOR_SYMBOLS_ !== "1", $6 = C4 && Symbol.asyncIterator || Symbol("asyncIterator not implemented"), G4 = C4 && Symbol.iterator || Symbol("iterator not implemented"), V6 = (o8) => o8 === "end" || o8 === "finish" || o8 === "prefinish", v6 = (o8) => o8 instanceof ArrayBuffer || typeof o8 == "object" && o8.constructor && o8.constructor.name === "ArrayBuffer" && o8.byteLength >= 0, J3 = (o8) => !Buffer.isBuffer(o8) && ArrayBuffer.isView(o8);
|
278202
278102
|
|
278203
278103
|
class U7 {
|
278204
278104
|
constructor(t8, e10, i6) {
|
@@ -278406,15 +278306,15 @@ function tt2() {
|
|
278406
278306
|
if (this[u7])
|
278407
278307
|
return Promise.resolve({ done: true });
|
278408
278308
|
let i6 = null, l4 = null;
|
278409
|
-
const f5 = (
|
278410
|
-
this.removeListener("data", A5), this.removeListener("end", O6), l4(
|
278411
|
-
}, A5 = (
|
278412
|
-
this.removeListener("error", f5), this.removeListener("end", O6), this.pause(), i6({ value:
|
278309
|
+
const f5 = (g6) => {
|
278310
|
+
this.removeListener("data", A5), this.removeListener("end", O6), l4(g6);
|
278311
|
+
}, A5 = (g6) => {
|
278312
|
+
this.removeListener("error", f5), this.removeListener("end", O6), this.pause(), i6({ value: g6, done: !!this[u7] });
|
278413
278313
|
}, O6 = () => {
|
278414
278314
|
this.removeListener("error", f5), this.removeListener("data", A5), i6({ done: true });
|
278415
278315
|
}, W6 = () => f5(new Error("stream destroyed"));
|
278416
|
-
return new Promise((
|
278417
|
-
l4 = z4, i6 =
|
278316
|
+
return new Promise((g6, z4) => {
|
278317
|
+
l4 = z4, i6 = g6, this.once(n6, W6), this.once("error", f5), this.once("end", O6), this.once("data", A5);
|
278418
278318
|
});
|
278419
278319
|
} };
|
278420
278320
|
}
|
@@ -278432,11 +278332,11 @@ function tt2() {
|
|
278432
278332
|
}
|
278433
278333
|
}, j3;
|
278434
278334
|
}
|
278435
|
-
var
|
278335
|
+
var C4;
|
278436
278336
|
function J3() {
|
278437
|
-
if (
|
278337
|
+
if (C4)
|
278438
278338
|
return i$3;
|
278439
|
-
|
278339
|
+
C4 = 1;
|
278440
278340
|
const w6 = j$1, n6 = P5.Buffer, z4 = O$2, u7 = i$3.constants = T4(), L6 = tt2(), E7 = n6.concat, c3 = Symbol("_superWrite");
|
278441
278341
|
|
278442
278342
|
class d6 extends Error {
|
@@ -278447,13 +278347,13 @@ function J3() {
|
|
278447
278347
|
return "ZlibError";
|
278448
278348
|
}
|
278449
278349
|
}
|
278450
|
-
const Z4 = Symbol("opts"), p5 = Symbol("flushFlag"), I7 = Symbol("finishFlushFlag"), y4 = Symbol("fullFlushFlag"), t8 = Symbol("handle"), _6 = Symbol("onError"), f5 = Symbol("sawError"), F3 = Symbol("level"), S4 = Symbol("strategy"),
|
278350
|
+
const Z4 = Symbol("opts"), p5 = Symbol("flushFlag"), I7 = Symbol("finishFlushFlag"), y4 = Symbol("fullFlushFlag"), t8 = Symbol("handle"), _6 = Symbol("onError"), f5 = Symbol("sawError"), F3 = Symbol("level"), S4 = Symbol("strategy"), g6 = Symbol("ended");
|
278451
278351
|
|
278452
278352
|
class x7 extends L6 {
|
278453
278353
|
constructor(s7, e10) {
|
278454
278354
|
if (!s7 || typeof s7 != "object")
|
278455
278355
|
throw new TypeError("invalid options for ZlibBase constructor");
|
278456
|
-
super(s7), this[f5] = false, this[
|
278356
|
+
super(s7), this[f5] = false, this[g6] = false, this[Z4] = s7, this[p5] = s7.flush, this[I7] = s7.finishFlush;
|
278457
278357
|
try {
|
278458
278358
|
this[t8] = new z4[e10](s7);
|
278459
278359
|
} catch (i6) {
|
@@ -278474,10 +278374,10 @@ function J3() {
|
|
278474
278374
|
this.ended || (typeof s7 != "number" && (s7 = this[y4]), this.write(Object.assign(n6.alloc(0), { [p5]: s7 })));
|
278475
278375
|
}
|
278476
278376
|
end(s7, e10, i6) {
|
278477
|
-
return s7 && this.write(s7, e10), this.flush(this[I7]), this[
|
278377
|
+
return s7 && this.write(s7, e10), this.flush(this[I7]), this[g6] = true, super.end(null, null, i6);
|
278478
278378
|
}
|
278479
278379
|
get ended() {
|
278480
|
-
return this[
|
278380
|
+
return this[g6];
|
278481
278381
|
}
|
278482
278382
|
write(s7, e10, i6) {
|
278483
278383
|
if (typeof e10 == "function" && (i6 = e10, e10 = "utf8"), typeof s7 == "string" && (s7 = n6.from(s7, e10)), this[f5])
|
@@ -278613,7 +278513,7 @@ function rt4() {
|
|
278613
278513
|
if (F$2)
|
278614
278514
|
return O$1;
|
278615
278515
|
F$2 = 1;
|
278616
|
-
const P6 = c$4(), $6 = E6(), v6 = nt2, W6 = c$3(), G4 = 1024 * 1024, k6 = u$3(),
|
278516
|
+
const P6 = c$4(), $6 = E6(), v6 = nt2, W6 = c$3(), G4 = 1024 * 1024, k6 = u$3(), C5 = f$2(), x7 = J3(), { nextTick: j4 } = nt$1, B4 = Buffer.from([31, 139]), h9 = Symbol("state"), d6 = Symbol("writeEntry"), a7 = Symbol("readEntry"), I7 = Symbol("nextEntry"), U7 = Symbol("processEntry"), l4 = Symbol("extendedHeader"), y4 = Symbol("globalExtendedHeader"), c3 = Symbol("meta"), H4 = Symbol("emitMeta"), n6 = Symbol("buffer"), f5 = Symbol("queue"), u7 = Symbol("ended"), L6 = Symbol("emittedEnd"), b5 = Symbol("emit"), r6 = Symbol("unzip"), _6 = Symbol("consumeChunk"), g6 = Symbol("consumeChunkSub"), q7 = Symbol("consumeBody"), z4 = Symbol("consumeMeta"), Y4 = Symbol("consumeHeader"), N7 = Symbol("consuming"), D3 = Symbol("bufferConcat"), M5 = Symbol("maybeEnd"), S4 = Symbol("writing"), m7 = Symbol("aborted"), T5 = Symbol("onDone"), E$1 = Symbol("sawValidEntry"), R9 = Symbol("sawNullBlock"), A5 = Symbol("sawEOF"), V6 = Symbol("closeStream"), K4 = (X6) => true;
|
278617
278517
|
return O$1 = P6(class extends v6 {
|
278618
278518
|
constructor(t8) {
|
278619
278519
|
t8 = t8 || {}, super(t8), this.file = t8.file || "", this[E$1] = null, this.on(T5, (s7) => {
|
@@ -278689,10 +278589,10 @@ function rt4() {
|
|
278689
278589
|
switch (this[b5]("meta", this[c3]), t8.type) {
|
278690
278590
|
case "ExtendedHeader":
|
278691
278591
|
case "OldExtendedHeader":
|
278692
|
-
this[l4] =
|
278592
|
+
this[l4] = C5.parse(this[c3], this[l4], false);
|
278693
278593
|
break;
|
278694
278594
|
case "GlobalExtendedHeader":
|
278695
|
-
this[y4] =
|
278595
|
+
this[y4] = C5.parse(this[c3], this[y4], true);
|
278696
278596
|
break;
|
278697
278597
|
case "NextFileHasLongPath":
|
278698
278598
|
case "OldGnuLongPath":
|
@@ -278765,18 +278665,18 @@ function rt4() {
|
|
278765
278665
|
if (this[N7] = true, this[n6]) {
|
278766
278666
|
this[D3](t8);
|
278767
278667
|
const i6 = this[n6];
|
278768
|
-
this[n6] = null, this[
|
278668
|
+
this[n6] = null, this[g6](i6);
|
278769
278669
|
} else
|
278770
|
-
this[
|
278670
|
+
this[g6](t8);
|
278771
278671
|
for (;this[n6] && this[n6].length >= 512 && !this[m7] && !this[A5]; ) {
|
278772
278672
|
const i6 = this[n6];
|
278773
|
-
this[n6] = null, this[
|
278673
|
+
this[n6] = null, this[g6](i6);
|
278774
278674
|
}
|
278775
278675
|
this[N7] = false;
|
278776
278676
|
}
|
278777
278677
|
(!this[n6] || this[u7]) && this[M5]();
|
278778
278678
|
}
|
278779
|
-
[
|
278679
|
+
[g6](t8) {
|
278780
278680
|
let i6 = 0;
|
278781
278681
|
const s7 = t8.length;
|
278782
278682
|
for (;i6 + 512 <= s7 && !this[m7] && !this[A5]; )
|
@@ -278817,7 +278717,7 @@ function X6() {
|
|
278817
278717
|
j4.oncomplete = G4, c3.writeBuffers(e10, i6, $6, j4);
|
278818
278718
|
};
|
278819
278719
|
}
|
278820
|
-
const m7 = Symbol("_autoClose"), h9 = Symbol("_close"),
|
278720
|
+
const m7 = Symbol("_autoClose"), h9 = Symbol("_close"), g6 = Symbol("_ended"), s7 = Symbol("_fd"), B4 = Symbol("_finished"), o8 = Symbol("_flags"), x7 = Symbol("_flush"), z4 = Symbol("_handleChunk"), T5 = Symbol("_makeBuf"), q7 = Symbol("_mode"), E7 = Symbol("_needDrain"), d6 = Symbol("_onerror"), y4 = Symbol("_onopen"), W6 = Symbol("_onread"), _6 = Symbol("_onwrite"), a7 = Symbol("_open"), l4 = Symbol("_path"), u7 = Symbol("_pos"), n6 = Symbol("_queue"), S4 = Symbol("_read"), M5 = Symbol("_readSize"), f5 = Symbol("_reading"), k6 = Symbol("_remain"), N7 = Symbol("_size"), C5 = Symbol("_write"), b5 = Symbol("_writing"), F3 = Symbol("_defaultFlag"), p5 = Symbol("_errored");
|
278821
278721
|
|
278822
278722
|
class D3 extends H4 {
|
278823
278723
|
constructor(t8, e10) {
|
@@ -278923,7 +278823,7 @@ function X6() {
|
|
278923
278823
|
|
278924
278824
|
class O6 extends I7 {
|
278925
278825
|
constructor(t8, e10) {
|
278926
|
-
e10 = e10 || {}, super(e10), this.readable = false, this.writable = true, this[p5] = false, this[b5] = false, this[
|
278826
|
+
e10 = e10 || {}, super(e10), this.readable = false, this.writable = true, this[p5] = false, this[b5] = false, this[g6] = false, this[E7] = false, this[n6] = [], this[l4] = t8, this[s7] = typeof e10.fd == "number" ? e10.fd : null, this[q7] = e10.mode === undefined ? 438 : e10.mode, this[u7] = typeof e10.start == "number" ? e10.start : null, this[m7] = typeof e10.autoClose == "boolean" ? e10.autoClose : true;
|
278927
278827
|
const i6 = this[u7] !== null ? "r+" : "w";
|
278928
278828
|
this[F3] = e10.flags === undefined, this[o8] = this[F3] ? i6 : e10.flags, this[s7] === null && this[a7]();
|
278929
278829
|
}
|
@@ -278951,22 +278851,22 @@ function X6() {
|
|
278951
278851
|
this[F3] && this[o8] === "r+" && t8 && t8.code === "ENOENT" ? (this[o8] = "w", this[a7]()) : t8 ? this[d6](t8) : (this[s7] = e10, this.emit("open", e10), this[x7]());
|
278952
278852
|
}
|
278953
278853
|
end(t8, e10) {
|
278954
|
-
return t8 && this.write(t8, e10), this[
|
278854
|
+
return t8 && this.write(t8, e10), this[g6] = true, !this[b5] && !this[n6].length && typeof this[s7] == "number" && this[_6](null, 0), this;
|
278955
278855
|
}
|
278956
278856
|
write(t8, e10) {
|
278957
|
-
return typeof t8 == "string" && (t8 = Buffer.from(t8, e10)), this[
|
278857
|
+
return typeof t8 == "string" && (t8 = Buffer.from(t8, e10)), this[g6] ? (this.emit("error", new Error("write() after end()")), false) : this[s7] === null || this[b5] || this[n6].length ? (this[n6].push(t8), this[E7] = true, false) : (this[b5] = true, this[C5](t8), true);
|
278958
278858
|
}
|
278959
|
-
[
|
278859
|
+
[C5](t8) {
|
278960
278860
|
r6.write(this[s7], t8, 0, t8.length, this[u7], (e10, i6) => this[_6](e10, i6));
|
278961
278861
|
}
|
278962
278862
|
[_6](t8, e10) {
|
278963
|
-
t8 ? this[d6](t8) : (this[u7] !== null && (this[u7] += e10), this[n6].length ? this[x7]() : (this[b5] = false, this[
|
278863
|
+
t8 ? this[d6](t8) : (this[u7] !== null && (this[u7] += e10), this[n6].length ? this[x7]() : (this[b5] = false, this[g6] && !this[B4] ? (this[B4] = true, this[h9](), this.emit("finish")) : this[E7] && (this[E7] = false, this.emit("drain"))));
|
278964
278864
|
}
|
278965
278865
|
[x7]() {
|
278966
278866
|
if (this[n6].length === 0)
|
278967
|
-
this[
|
278867
|
+
this[g6] && this[_6](null, 0);
|
278968
278868
|
else if (this[n6].length === 1)
|
278969
|
-
this[
|
278869
|
+
this[C5](this[n6].pop());
|
278970
278870
|
else {
|
278971
278871
|
const t8 = this[n6];
|
278972
278872
|
this[n6] = [], R9(this[s7], t8, this[u7], (e10, i6) => this[_6](e10, i6));
|
@@ -279001,7 +278901,7 @@ function X6() {
|
|
279001
278901
|
this[s7] = null, r6.closeSync(t8), this.emit("close");
|
279002
278902
|
}
|
279003
278903
|
}
|
279004
|
-
[
|
278904
|
+
[C5](t8) {
|
279005
278905
|
let e10 = true;
|
279006
278906
|
try {
|
279007
278907
|
this[_6](null, r6.writeSync(this[s7], t8, 0, t8.length, this[u7])), e10 = false;
|
@@ -279241,7 +279141,7 @@ function F$1() {
|
|
279241
279141
|
};
|
279242
279142
|
s7.forEach((l4) => S5(r6, l4, e10, n6, H4));
|
279243
279143
|
});
|
279244
|
-
},
|
279144
|
+
}, C5 = (r6, e10, n6, t9) => {
|
279245
279145
|
if (typeof e10 == "string")
|
279246
279146
|
try {
|
279247
279147
|
const o8 = c3.lstatSync(a7.resolve(r6, e10));
|
@@ -279263,7 +279163,7 @@ function F$1() {
|
|
279263
279163
|
return w6(r6, e10, n6);
|
279264
279164
|
throw o8;
|
279265
279165
|
}
|
279266
|
-
return t9 && t9.length && t9.forEach((o8) =>
|
279166
|
+
return t9 && t9.length && t9.forEach((o8) => C5(r6, o8, e10, n6)), w6(r6, e10, n6);
|
279267
279167
|
};
|
279268
279168
|
return y$12 = E7, E7.sync = m8, y$12;
|
279269
279169
|
}
|
@@ -279272,7 +279172,7 @@ function H4() {
|
|
279272
279172
|
if (R9)
|
279273
279173
|
return r$1.exports;
|
279274
279174
|
R9 = 1;
|
279275
|
-
const
|
279175
|
+
const g6 = S4(), l4 = V5, p5 = H$2, x7 = F$1(), y4 = a$7();
|
279276
279176
|
|
279277
279177
|
class D3 extends Error {
|
279278
279178
|
constructor(e10, s7) {
|
@@ -279306,23 +279206,23 @@ function H4() {
|
|
279306
279206
|
if (n6 === d6)
|
279307
279207
|
return I7(n6, w6);
|
279308
279208
|
if (u7)
|
279309
|
-
return
|
279209
|
+
return g6(n6, { mode: c3 }).then((k6) => w6(null, k6), w6);
|
279310
279210
|
const S5 = y4(p5.relative(d6, n6)).split("/");
|
279311
|
-
|
279211
|
+
C5(d6, S5, c3, h9, m8, d6, null, w6);
|
279312
279212
|
};
|
279313
|
-
const
|
279213
|
+
const C5 = (n6, e10, s7, r6, c3, f5, t9, i6) => {
|
279314
279214
|
if (!e10.length)
|
279315
279215
|
return i6(null, t9);
|
279316
279216
|
const a7 = e10.shift(), u7 = y4(p5.resolve(n6 + "/" + a7));
|
279317
279217
|
if (v6(r6, u7))
|
279318
|
-
return
|
279218
|
+
return C5(u7, e10, s7, r6, c3, f5, t9, i6);
|
279319
279219
|
l4.mkdir(u7, s7, j4(u7, e10, s7, r6, c3, f5, t9, i6));
|
279320
279220
|
}, j4 = (n6, e10, s7, r6, c3, f5, t9, i6) => (a7) => {
|
279321
279221
|
a7 ? l4.lstat(n6, (u7, m8) => {
|
279322
279222
|
if (u7)
|
279323
279223
|
u7.path = u7.path && y4(u7.path), i6(u7);
|
279324
279224
|
else if (m8.isDirectory())
|
279325
|
-
|
279225
|
+
C5(n6, e10, s7, r6, c3, f5, t9, i6);
|
279326
279226
|
else if (c3)
|
279327
279227
|
l4.unlink(n6, (h9) => {
|
279328
279228
|
if (h9)
|
@@ -279334,7 +279234,7 @@ function H4() {
|
|
279334
279234
|
return i6(new D3(n6, n6 + "/" + e10.join("/")));
|
279335
279235
|
i6(a7);
|
279336
279236
|
}
|
279337
|
-
}) : (t9 = t9 || n6,
|
279237
|
+
}) : (t9 = t9 || n6, C5(n6, e10, s7, r6, c3, f5, t9, i6));
|
279338
279238
|
}, L6 = (n6) => {
|
279339
279239
|
let e10 = false, s7 = "ENOTDIR";
|
279340
279240
|
try {
|
@@ -279356,7 +279256,7 @@ function H4() {
|
|
279356
279256
|
if (n6 === h9)
|
279357
279257
|
return L6(h9), d6();
|
279358
279258
|
if (a7)
|
279359
|
-
return d6(
|
279259
|
+
return d6(g6.sync(n6, r6));
|
279360
279260
|
const $6 = y4(p5.relative(h9, n6)).split("/");
|
279361
279261
|
let S5 = null;
|
279362
279262
|
for (let k6 = $6.shift(), o8 = h9;k6 && (o8 += "/" + k6); k6 = $6.shift())
|
@@ -279411,7 +279311,7 @@ function z4() {
|
|
279411
279311
|
if (f$1)
|
279412
279312
|
return u$1;
|
279413
279313
|
f$1 = 1;
|
279414
|
-
const l5 = j$1, m8 = a$12(),
|
279314
|
+
const l5 = j$1, m8 = a$12(), g6 = s7(), { join: d6 } = H$2, q7 = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32";
|
279415
279315
|
return u$1 = () => {
|
279416
279316
|
const i7 = new Map, c3 = new Map, v6 = (e10) => e10.split("/").slice(0, -1).reduce((o8, r6) => (o8.length && (r6 = d6(o8[o8.length - 1], r6)), o8.push(r6 || "/"), o8), []), a8 = new Set, w6 = (e10) => {
|
279417
279317
|
const s8 = c3.get(e10);
|
@@ -279434,7 +279334,7 @@ function z4() {
|
|
279434
279334
|
}), a8.delete(e10), r6.forEach((t9) => p6(t9)), true;
|
279435
279335
|
};
|
279436
279336
|
return { check: h9, reserve: (e10, s8) => {
|
279437
|
-
e10 = q7 ? ["win32 parallelization disabled"] : e10.map((r6) =>
|
279337
|
+
e10 = q7 ? ["win32 parallelization disabled"] : e10.map((r6) => g6(d6(m8(r6))).toLowerCase());
|
279438
279338
|
const o8 = new Set(e10.map((r6) => v6(r6)).reduce((r6, t9) => r6.concat(t9)));
|
279439
279339
|
return c3.set(s8, { dirs: o8, paths: e10 }), e10.forEach((r6) => {
|
279440
279340
|
const t9 = i7.get(r6);
|
@@ -279477,8 +279377,8 @@ function Os() {
|
|
279477
279377
|
if (y4)
|
279478
279378
|
return G4;
|
279479
279379
|
y4 = 1;
|
279480
|
-
const ss = j$1, is = rt4(), r6 = V5, es = X6(), w6 = H$2, M5 = H4(), K4 = p5(), ts = z4(), os = c3(), l5 = a$7(), rs = s7(), hs = a$12(), H$12 = Symbol("onEntry"), q7 = Symbol("checkFs"), Y4 = Symbol("checkFs2"), v6 = Symbol("pruneCache"), N7 = Symbol("isReusable"), d6 = Symbol("makeFs"), U7 = Symbol("file"), F$12 = Symbol("directory"), O7 = Symbol("link"), B4 = Symbol("symlink"), z$1 = Symbol("hardlink"), W6 = Symbol("unsupported"), j4 = Symbol("checkPath"), b5 = Symbol("mkdir"), m8 = Symbol("onError"), $6 = Symbol("pending"), V$1 = Symbol("pend"), S5 = Symbol("unpend"), P6 = Symbol("ended"), A5 = Symbol("maybeClose"), x7 = Symbol("skip"), E7 = Symbol("doChown"), R10 = Symbol("uid"), _6 = Symbol("gid"),
|
279481
|
-
if (!
|
279380
|
+
const ss = j$1, is = rt4(), r6 = V5, es = X6(), w6 = H$2, M5 = H4(), K4 = p5(), ts = z4(), os = c3(), l5 = a$7(), rs = s7(), hs = a$12(), H$12 = Symbol("onEntry"), q7 = Symbol("checkFs"), Y4 = Symbol("checkFs2"), v6 = Symbol("pruneCache"), N7 = Symbol("isReusable"), d6 = Symbol("makeFs"), U7 = Symbol("file"), F$12 = Symbol("directory"), O7 = Symbol("link"), B4 = Symbol("symlink"), z$1 = Symbol("hardlink"), W6 = Symbol("unsupported"), j4 = Symbol("checkPath"), b5 = Symbol("mkdir"), m8 = Symbol("onError"), $6 = Symbol("pending"), V$1 = Symbol("pend"), S5 = Symbol("unpend"), P6 = Symbol("ended"), A5 = Symbol("maybeClose"), x7 = Symbol("skip"), E7 = Symbol("doChown"), R10 = Symbol("uid"), _6 = Symbol("gid"), g6 = Symbol("checkedCwd"), X$12 = Ds, J4 = F3(), C5 = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32", cs = 1024, as = (a8, s8) => {
|
279381
|
+
if (!C5)
|
279482
279382
|
return r6.unlink(a8, s8);
|
279483
279383
|
const i7 = a8 + ".DELETE." + X$12.randomBytes(16).toString("hex");
|
279484
279384
|
r6.rename(a8, i7, (e11) => {
|
@@ -279487,7 +279387,7 @@ function Os() {
|
|
279487
279387
|
r6.unlink(i7, s8);
|
279488
279388
|
});
|
279489
279389
|
}, us = (a8) => {
|
279490
|
-
if (!
|
279390
|
+
if (!C5)
|
279491
279391
|
return r6.unlinkSync(a8);
|
279492
279392
|
const s8 = a8 + ".DELETE." + X$12.randomBytes(16).toString("hex");
|
279493
279393
|
r6.renameSync(a8, s8), r6.unlinkSync(s8);
|
@@ -279506,7 +279406,7 @@ function Os() {
|
|
279506
279406
|
constructor(s8) {
|
279507
279407
|
if (s8 || (s8 = {}), s8.ondone = (i7) => {
|
279508
279408
|
this[P6] = true, this[A5]();
|
279509
|
-
}, super(s8), this[
|
279409
|
+
}, super(s8), this[g6] = false, this.reservations = ts(), this.transform = typeof s8.transform == "function" ? s8.transform : null, this.writable = true, this.readable = false, this[$6] = 0, this[P6] = false, this.dirCache = s8.dirCache || new Map, typeof s8.uid == "number" || typeof s8.gid == "number") {
|
279510
279410
|
if (typeof s8.uid != "number" || typeof s8.gid != "number")
|
279511
279411
|
throw new TypeError("cannot set owner without number uid and gid");
|
279512
279412
|
if (s8.preserveOwner)
|
@@ -279514,7 +279414,7 @@ function Os() {
|
|
279514
279414
|
this.uid = s8.uid, this.gid = s8.gid, this.setOwner = true;
|
279515
279415
|
} else
|
279516
279416
|
this.uid = null, this.gid = null, this.setOwner = false;
|
279517
|
-
s8.preserveOwner === undefined && typeof s8.uid != "number" ? this.preserveOwner = process.getuid && process.getuid() === 0 : this.preserveOwner = !!s8.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : null, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : null, this.maxDepth = typeof s8.maxDepth == "number" ? s8.maxDepth : cs, this.forceChown = s8.forceChown === true, this.win32 = !!s8.win32 ||
|
279417
|
+
s8.preserveOwner === undefined && typeof s8.uid != "number" ? this.preserveOwner = process.getuid && process.getuid() === 0 : this.preserveOwner = !!s8.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : null, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : null, this.maxDepth = typeof s8.maxDepth == "number" ? s8.maxDepth : cs, this.forceChown = s8.forceChown === true, this.win32 = !!s8.win32 || C5, this.newer = !!s8.newer, this.keep = !!s8.keep, this.noMtime = !!s8.noMtime, this.preservePaths = !!s8.preservePaths, this.unlink = !!s8.unlink, this.cwd = l5(w6.resolve(s8.cwd || process.cwd())), this.strip = +s8.strip || 0, this.processUmask = s8.noChmod ? 0 : process.umask(), this.umask = typeof s8.umask == "number" ? s8.umask : this.processUmask, this.dmode = s8.dmode || 511 & ~this.umask, this.fmode = s8.fmode || 438 & ~this.umask, this.on("entry", (i7) => this[H$12](i7));
|
279518
279418
|
}
|
279519
279419
|
warn(s8, i7, e11 = {}) {
|
279520
279420
|
return (s8 === "TAR_BAD_ARCHIVE" || s8 === "TAR_ABORT") && (e11.recoverable = false), super.warn(s8, i7, e11);
|
@@ -279539,7 +279439,7 @@ function Os() {
|
|
279539
279439
|
if (isFinite(this.maxDepth) && e11.length > this.maxDepth)
|
279540
279440
|
return this.warn("TAR_ENTRY_ERROR", "path excessively deep", { entry: s8, path: i7, depth: e11.length, maxDepth: this.maxDepth }), false;
|
279541
279441
|
if (!this.preservePaths) {
|
279542
|
-
if (e11.includes("..") ||
|
279442
|
+
if (e11.includes("..") || C5 && /^[a-z]:\.\.$/i.test(e11[0]))
|
279543
279443
|
return this.warn("TAR_ENTRY_ERROR", "path contains '..'", { entry: s8, path: i7 }), false;
|
279544
279444
|
const [t9, o9] = os(i7);
|
279545
279445
|
t9 && (s8.path = o9, this.warn("TAR_ENTRY_INFO", `stripping ${t9} from absolute path`, { entry: s8, path: i7 }));
|
@@ -279659,7 +279559,7 @@ function Os() {
|
|
279659
279559
|
this[S5](), s8.resume();
|
279660
279560
|
}
|
279661
279561
|
[N7](s8, i7) {
|
279662
|
-
return s8.type === "File" && !this.unlink && i7.isFile() && i7.nlink <= 1 && !
|
279562
|
+
return s8.type === "File" && !this.unlink && i7.isFile() && i7.nlink <= 1 && !C5;
|
279663
279563
|
}
|
279664
279564
|
[q7](s8) {
|
279665
279565
|
this[V$1]();
|
@@ -279679,7 +279579,7 @@ function Os() {
|
|
279679
279579
|
this[m8](h9, s8), e11();
|
279680
279580
|
return;
|
279681
279581
|
}
|
279682
|
-
this[
|
279582
|
+
this[g6] = true, o9();
|
279683
279583
|
});
|
279684
279584
|
}, o9 = () => {
|
279685
279585
|
if (s8.absolute !== this.cwd) {
|
@@ -279715,7 +279615,7 @@ function Os() {
|
|
279715
279615
|
as(s8.absolute, (n7) => this[d6](n7, s8, e11));
|
279716
279616
|
});
|
279717
279617
|
};
|
279718
|
-
this[
|
279618
|
+
this[g6] ? o9() : t9();
|
279719
279619
|
}
|
279720
279620
|
[d6](s8, i7, e11) {
|
279721
279621
|
if (s8) {
|
@@ -279755,11 +279655,11 @@ function Os() {
|
|
279755
279655
|
return super[d6](s8, i7, () => {});
|
279756
279656
|
}
|
279757
279657
|
[q7](s8) {
|
279758
|
-
if (this[v6](s8), !this[
|
279658
|
+
if (this[v6](s8), !this[g6]) {
|
279759
279659
|
const o9 = this[b5](this.cwd, this.dmode);
|
279760
279660
|
if (o9)
|
279761
279661
|
return this[m8](o9, s8);
|
279762
|
-
this[
|
279662
|
+
this[g6] = true;
|
279763
279663
|
}
|
279764
279664
|
if (s8.absolute !== this.cwd) {
|
279765
279665
|
const o9 = l5(w6.dirname(s8.absolute));
|
@@ -280263,7 +280163,10 @@ function createCommand2() {
|
|
280263
280163
|
if (version5 && !template) {
|
280264
280164
|
cancel2("The --version option requires the --template option to be set");
|
280265
280165
|
}
|
280266
|
-
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(
|
280166
|
+
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt({
|
280167
|
+
env: env2,
|
280168
|
+
accept: true
|
280169
|
+
});
|
280267
280170
|
const settlemint = createSettleMintClient({
|
280268
280171
|
instance: selectedInstance,
|
280269
280172
|
accessToken: "",
|
@@ -280368,38 +280271,49 @@ function hasuraTrackCommand() {
|
|
280368
280271
|
])).option("-a, --accept-defaults", "Accept the default and previously set values").option("-d, --database <database>", "Database name", "default").action(async ({ acceptDefaults, database }) => {
|
280369
280272
|
intro("Tracking all tables in Hasura");
|
280370
280273
|
const env2 = await loadEnv(false, false);
|
280371
|
-
const
|
280372
|
-
if (!applicationUniqueName) {
|
280373
|
-
return missingApplication();
|
280374
|
-
}
|
280375
|
-
const selectedInstance = await instancePrompt(env2, true);
|
280376
|
-
const accessToken = await getApplicationOrPersonalAccessToken({
|
280274
|
+
const selectedInstance = await instancePrompt({
|
280377
280275
|
env: env2,
|
280378
|
-
|
280379
|
-
prefer: "application"
|
280380
|
-
});
|
280381
|
-
const settlemint = createSettleMintClient({
|
280382
|
-
accessToken,
|
280383
|
-
instance: selectedInstance
|
280276
|
+
accept: true
|
280384
280277
|
});
|
280385
|
-
|
280386
|
-
|
280387
|
-
|
280388
|
-
|
280389
|
-
|
280390
|
-
|
280391
|
-
}
|
280392
|
-
|
280393
|
-
|
280278
|
+
let hasuraGraphqlEndpoint;
|
280279
|
+
let hasuraAdminSecret;
|
280280
|
+
let accessToken;
|
280281
|
+
if (selectedInstance === STANDALONE_INSTANCE2) {
|
280282
|
+
hasuraGraphqlEndpoint = env2.SETTLEMINT_HASURA_ENDPOINT;
|
280283
|
+
hasuraAdminSecret = env2.SETTLEMINT_HASURA_ADMIN_SECRET;
|
280284
|
+
} else {
|
280285
|
+
const applicationUniqueName = env2.SETTLEMINT_APPLICATION;
|
280286
|
+
if (!applicationUniqueName) {
|
280287
|
+
return missingApplication();
|
280288
|
+
}
|
280289
|
+
accessToken = await getApplicationOrPersonalAccessToken({
|
280290
|
+
env: env2,
|
280291
|
+
instance: selectedInstance,
|
280292
|
+
prefer: "application"
|
280293
|
+
});
|
280294
|
+
const settlemint = createSettleMintClient({
|
280295
|
+
accessToken,
|
280296
|
+
instance: selectedInstance
|
280297
|
+
});
|
280298
|
+
const integrationTools = await serviceSpinner("integration tool", () => settlemint.integrationTool.list(applicationUniqueName));
|
280299
|
+
const hasura = await hasuraPrompt({
|
280300
|
+
env: env2,
|
280301
|
+
integrations: integrationTools,
|
280302
|
+
accept: acceptDefaults,
|
280303
|
+
isRequired: true
|
280304
|
+
});
|
280305
|
+
if (!hasura) {
|
280306
|
+
return nothingSelectedError("Hasura instance");
|
280307
|
+
}
|
280308
|
+
const hasuraEnv = getHasuraEnv(hasura);
|
280309
|
+
hasuraGraphqlEndpoint = hasuraEnv.SETTLEMINT_HASURA_ENDPOINT;
|
280310
|
+
hasuraAdminSecret = hasuraEnv.SETTLEMINT_HASURA_ADMIN_SECRET;
|
280394
280311
|
}
|
280395
|
-
const hasuraEnv = getHasuraEnv(hasura);
|
280396
|
-
const hasuraGraphqlEndpoint = hasuraEnv.SETTLEMINT_HASURA_ENDPOINT;
|
280397
|
-
const hasuraAdminSecret = hasuraEnv.SETTLEMINT_HASURA_ADMIN_SECRET;
|
280398
280312
|
if (!hasuraGraphqlEndpoint || !hasuraAdminSecret) {
|
280399
280313
|
return note("Could not retrieve Hasura endpoint or admin secret. Please check your configuration.");
|
280400
280314
|
}
|
280401
|
-
const baseUrl =
|
280402
|
-
const queryEndpoint = new URL(
|
280315
|
+
const baseUrl = extractBaseUrlBeforeSegment(hasuraGraphqlEndpoint, "/v1/graphql");
|
280316
|
+
const queryEndpoint = new URL(`${baseUrl}/v1/metadata`).toString();
|
280403
280317
|
const messages = [];
|
280404
280318
|
const { result } = await spinner({
|
280405
280319
|
startMessage: `Tracking all tables in Hasura from database "${database}"`,
|
@@ -280408,11 +280322,12 @@ function hasuraTrackCommand() {
|
|
280408
280322
|
const executeHasuraQuery = async (query) => {
|
280409
280323
|
const response = await fetch(queryEndpoint, {
|
280410
280324
|
method: "POST",
|
280411
|
-
headers: {
|
280325
|
+
headers: appendHeaders({
|
280412
280326
|
"Content-Type": "application/json",
|
280413
|
-
"X-Hasura-Admin-Secret": hasuraAdminSecret
|
280327
|
+
"X-Hasura-Admin-Secret": hasuraAdminSecret
|
280328
|
+
}, {
|
280414
280329
|
"x-auth-token": accessToken
|
280415
|
-
},
|
280330
|
+
}),
|
280416
280331
|
body: JSON.stringify(query)
|
280417
280332
|
});
|
280418
280333
|
if (!response.ok) {
|
@@ -280531,7 +280446,11 @@ function loginCommand() {
|
|
280531
280446
|
intro("Login to your SettleMint account");
|
280532
280447
|
const autoAccept = !!acceptDefaults || !!tokenStdin;
|
280533
280448
|
const env2 = await loadEnv(false, false);
|
280534
|
-
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(
|
280449
|
+
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt({
|
280450
|
+
env: env2,
|
280451
|
+
accept: autoAccept,
|
280452
|
+
freeTextInput: true
|
280453
|
+
});
|
280535
280454
|
let personalAccessToken = "";
|
280536
280455
|
if (tokenStdin) {
|
280537
280456
|
if (cmd2.args.length > 0) {
|
@@ -280648,11 +280567,17 @@ function pincodeVerificationResponseCommand() {
|
|
280648
280567
|
])).action(async ({ instance, blockchainNode, walletAddress }) => {
|
280649
280568
|
intro("Generating pincode verification response for wallet address");
|
280650
280569
|
const env2 = await loadEnv(false, false);
|
280570
|
+
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt({
|
280571
|
+
env: env2,
|
280572
|
+
accept: true
|
280573
|
+
});
|
280574
|
+
if (selectedInstance === STANDALONE_INSTANCE2) {
|
280575
|
+
return cancel2("This command does not support standalone instances");
|
280576
|
+
}
|
280651
280577
|
const applicationUniqueName = env2.SETTLEMINT_APPLICATION;
|
280652
280578
|
if (!applicationUniqueName) {
|
280653
280579
|
return missingApplication();
|
280654
280580
|
}
|
280655
|
-
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, true);
|
280656
280581
|
const personalAccessToken = await getInstanceCredentials(selectedInstance);
|
280657
280582
|
if (!personalAccessToken) {
|
280658
280583
|
return missingPersonalAccessTokenError();
|
@@ -280871,7 +280796,7 @@ function getCreateCommand({
|
|
280871
280796
|
execute2(cmd2, async ({ acceptDefaults, prod, default: isDefault, wait: wait2, restartIfTimeout, provider, region }, createFunction) => {
|
280872
280797
|
intro(`Creating ${type4} in the SettleMint platform`);
|
280873
280798
|
const env2 = await loadEnv(false, !!prod);
|
280874
|
-
const instance = await instancePrompt(env2, acceptDefaults);
|
280799
|
+
const instance = await instancePrompt({ env: env2, accept: acceptDefaults });
|
280875
280800
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
280876
280801
|
env: env2,
|
280877
280802
|
instance,
|
@@ -282296,7 +282221,7 @@ function getDeleteCommand({
|
|
282296
282221
|
await deleteConfirmationPrompt(`this ${type4}`);
|
282297
282222
|
}
|
282298
282223
|
const env2 = await loadEnv(false, !!prod);
|
282299
|
-
const instance = await instancePrompt(env2, acceptDefaults);
|
282224
|
+
const instance = await instancePrompt({ env: env2, accept: acceptDefaults });
|
282300
282225
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
282301
282226
|
env: env2,
|
282302
282227
|
instance,
|
@@ -282390,7 +282315,7 @@ function getRestartCommand({
|
|
282390
282315
|
])).argument("<unique-name>", `The unique name of the ${type4}, use 'default' to restart the default one from your .env file`).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").option("-w, --wait", "Wait until restarted").action(async (uniqueName, { acceptDefaults, prod, wait: wait2 }) => {
|
282391
282316
|
intro(`Restarting ${type4} in the SettleMint platform`);
|
282392
282317
|
const env2 = await loadEnv(false, !!prod);
|
282393
|
-
const instance = await instancePrompt(env2, acceptDefaults);
|
282318
|
+
const instance = await instancePrompt({ env: env2, accept: acceptDefaults });
|
282394
282319
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
282395
282320
|
env: env2,
|
282396
282321
|
instance,
|
@@ -282606,7 +282531,10 @@ function customDeploymentsUpdateCommand() {
|
|
282606
282531
|
if (!customDeploymentUniqueName) {
|
282607
282532
|
cancel2("No custom deployment unique name specified. Please provide it either via the --unique-name flag or by setting the SETTLEMINT_CUSTOM_DEPLOYMENT environment variable");
|
282608
282533
|
}
|
282609
|
-
const instance = await instancePrompt(
|
282534
|
+
const instance = await instancePrompt({
|
282535
|
+
env: env2,
|
282536
|
+
accept: true
|
282537
|
+
});
|
282610
282538
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
282611
282539
|
env: env2,
|
282612
282540
|
instance,
|
@@ -282714,7 +282642,10 @@ function configCommand() {
|
|
282714
282642
|
])).action(async ({ prod, instance, output }) => {
|
282715
282643
|
intro("Getting platform configuration");
|
282716
282644
|
const env2 = await loadEnv(false, !!prod);
|
282717
|
-
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(
|
282645
|
+
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt({
|
282646
|
+
env: env2,
|
282647
|
+
accept: true
|
282648
|
+
});
|
282718
282649
|
const settlemint = createSettleMintClient({
|
282719
282650
|
accessToken: "",
|
282720
282651
|
instance: selectedInstance,
|
@@ -282833,7 +282764,10 @@ function applicationsListCommand() {
|
|
282833
282764
|
])).option("-w, --workspace <workspace>", "The workspace unique name to list applications for (defaults to workspace from env)").addOption(new Option("-o, --output <output>", "The output format").choices(["wide", "json", "yaml"])).action(async ({ workspace, output }) => {
|
282834
282765
|
intro("Listing applications");
|
282835
282766
|
const env2 = await loadEnv(false, false);
|
282836
|
-
const selectedInstance = await instancePrompt(
|
282767
|
+
const selectedInstance = await instancePrompt({
|
282768
|
+
env: env2,
|
282769
|
+
accept: true
|
282770
|
+
});
|
282837
282771
|
const personalAccessToken = await getInstanceCredentials(selectedInstance);
|
282838
282772
|
if (!personalAccessToken) {
|
282839
282773
|
return missingPersonalAccessTokenError();
|
@@ -282951,7 +282885,10 @@ function servicesCommand() {
|
|
282951
282885
|
])).option("--app, --application <application>", "The application unique name to list the services in (defaults to application from env)").addOption(new Option("-t, --type <type...>", "The type(s) of service to list").choices(SERVICE_TYPES)).addOption(new Option("-o, --output <output>", "The output format").choices(["wide", "json", "yaml"])).arguments("[typeOperands...]").action(async (typeOperands, options) => {
|
282952
282886
|
intro("Listing application services");
|
282953
282887
|
const env2 = await loadEnv(false, false);
|
282954
|
-
const selectedInstance = await instancePrompt(
|
282888
|
+
const selectedInstance = await instancePrompt({
|
282889
|
+
env: env2,
|
282890
|
+
accept: true
|
282891
|
+
});
|
282955
282892
|
const personalAccessToken = await getInstanceCredentials(selectedInstance);
|
282956
282893
|
if (!personalAccessToken) {
|
282957
282894
|
return missingPersonalAccessTokenError();
|
@@ -283104,7 +283041,10 @@ function workspacesListCommand() {
|
|
283104
283041
|
intro("Listing workspaces");
|
283105
283042
|
}
|
283106
283043
|
const env2 = await loadEnv(false, false);
|
283107
|
-
const selectedInstance = await instancePrompt(
|
283044
|
+
const selectedInstance = await instancePrompt({
|
283045
|
+
env: env2,
|
283046
|
+
accept: true
|
283047
|
+
});
|
283108
283048
|
const personalAccessToken = await getInstanceCredentials(selectedInstance);
|
283109
283049
|
if (!personalAccessToken) {
|
283110
283050
|
return missingPersonalAccessTokenError();
|
@@ -283215,7 +283155,10 @@ function createCommand4() {
|
|
283215
283155
|
intro("Creating a new smart contract set");
|
283216
283156
|
const env2 = await loadEnv(false, false);
|
283217
283157
|
const name3 = await projectNamePrompt(env2, projectName);
|
283218
|
-
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(
|
283158
|
+
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt({
|
283159
|
+
env: env2,
|
283160
|
+
accept: true
|
283161
|
+
});
|
283219
283162
|
const settlemint = createSettleMintClient({
|
283220
283163
|
instance: selectedInstance,
|
283221
283164
|
accessToken: "",
|
@@ -283518,6 +283461,17 @@ async function addressPrompt({
|
|
283518
283461
|
node,
|
283519
283462
|
hardhatConfig
|
283520
283463
|
}) {
|
283464
|
+
if (!node) {
|
283465
|
+
return esm_default2({
|
283466
|
+
message: "Which private key address do you want to deploy from?",
|
283467
|
+
validate: (value4) => {
|
283468
|
+
if (!isAddress(value4)) {
|
283469
|
+
return "Invalid address";
|
283470
|
+
}
|
283471
|
+
return true;
|
283472
|
+
}
|
283473
|
+
});
|
283474
|
+
}
|
283521
283475
|
const possiblePrivateKeys = node.privateKeys?.filter(isValidPrivateKey) ?? [];
|
283522
283476
|
const defaultAddress = hardhatConfig.networks?.btp?.from ?? possiblePrivateKeys[0]?.address;
|
283523
283477
|
const defaultPossible = accept && defaultAddress;
|
@@ -283616,19 +283570,28 @@ function hardhatDeployRemoteCommand() {
|
|
283616
283570
|
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
283617
283571
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
283618
283572
|
const env2 = await loadEnv(false, !!prod);
|
283619
|
-
|
283620
|
-
|
283573
|
+
let node;
|
283574
|
+
let envHardhatConfig = {};
|
283575
|
+
const instance = await instancePrompt({
|
283621
283576
|
env: env2,
|
283622
|
-
|
283623
|
-
prefer: "application"
|
283577
|
+
accept: true
|
283624
283578
|
});
|
283625
|
-
|
283626
|
-
|
283627
|
-
|
283628
|
-
|
283629
|
-
|
283630
|
-
|
283631
|
-
|
283579
|
+
if (instance === STANDALONE_INSTANCE2) {
|
283580
|
+
envHardhatConfig.BTP_RPC_URL = env2.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT ?? "";
|
283581
|
+
} else {
|
283582
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
283583
|
+
env: env2,
|
283584
|
+
instance,
|
283585
|
+
prefer: "application"
|
283586
|
+
});
|
283587
|
+
const settlemint = createSettleMintClient({
|
283588
|
+
accessToken,
|
283589
|
+
instance
|
283590
|
+
});
|
283591
|
+
node = await selectTargetNode({ env: env2, blockchainNodeUniqueName, autoAccept, settlemint });
|
283592
|
+
envHardhatConfig = await settlemint.foundry.env(node.uniqueName);
|
283593
|
+
}
|
283594
|
+
const hardhatConfig = await getHardhatConfigData(envHardhatConfig);
|
283632
283595
|
if (verify && !hardhatConfig?.etherscan?.apiKey) {
|
283633
283596
|
cancel2("It is not possible to verify the deployment on this network unless you supply an Etherscan API key in the hardhat.config.ts file");
|
283634
283597
|
}
|
@@ -283656,7 +283619,7 @@ function hardhatDeployRemoteCommand() {
|
|
283656
283619
|
"--default-sender",
|
283657
283620
|
address,
|
283658
283621
|
module ?? "ignition/modules/main.ts"
|
283659
|
-
].filter(Boolean), { env:
|
283622
|
+
].filter(Boolean), { env: envHardhatConfig });
|
283660
283623
|
const outputStr = output.join(`
|
283661
283624
|
`);
|
283662
283625
|
if (!outputStr.includes("Deploy cancelled")) {
|
@@ -283749,20 +283712,28 @@ function hardhatScriptRemoteCommand() {
|
|
283749
283712
|
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
283750
283713
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
283751
283714
|
const env2 = await loadEnv(false, !!prod);
|
283752
|
-
|
283753
|
-
const
|
283715
|
+
let envHardhatConfig = {};
|
283716
|
+
const instance = await instancePrompt({
|
283754
283717
|
env: env2,
|
283755
|
-
|
283756
|
-
prefer: "application"
|
283757
|
-
});
|
283758
|
-
const settlemint = createSettleMintClient({
|
283759
|
-
accessToken,
|
283760
|
-
instance
|
283718
|
+
accept: true
|
283761
283719
|
});
|
283762
|
-
|
283763
|
-
|
283720
|
+
if (instance === STANDALONE_INSTANCE2) {
|
283721
|
+
envHardhatConfig.BTP_RPC_URL = env2.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT ?? "";
|
283722
|
+
} else {
|
283723
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
283724
|
+
env: env2,
|
283725
|
+
instance,
|
283726
|
+
prefer: "application"
|
283727
|
+
});
|
283728
|
+
const settlemint = createSettleMintClient({
|
283729
|
+
accessToken,
|
283730
|
+
instance
|
283731
|
+
});
|
283732
|
+
const node = await selectTargetNode({ env: env2, blockchainNodeUniqueName, autoAccept, settlemint });
|
283733
|
+
envHardhatConfig = await settlemint.foundry.env(node.uniqueName);
|
283734
|
+
}
|
283764
283735
|
const { command, args } = await getPackageManagerExecutable();
|
283765
|
-
await executeCommand(command, [...args, "hardhat", "run", script, "--network", "btp", ...compile ? ["--no-compile"] : []], { env:
|
283736
|
+
await executeCommand(command, [...args, "hardhat", "run", script, "--network", "btp", ...compile ? ["--no-compile"] : []], { env: envHardhatConfig });
|
283766
283737
|
outro("Script execution completed successfully");
|
283767
283738
|
});
|
283768
283739
|
return cmd2;
|
@@ -283932,8 +283903,11 @@ async function getTheGraphNetwork({
|
|
283932
283903
|
theGraphMiddleware,
|
283933
283904
|
env: env2,
|
283934
283905
|
instance,
|
283935
|
-
accessToken
|
283906
|
+
accessToken = ""
|
283936
283907
|
}) {
|
283908
|
+
if (instance === STANDALONE_INSTANCE2) {
|
283909
|
+
return SETTLEMINT_NETWORK;
|
283910
|
+
}
|
283937
283911
|
const isFixedNetwork = (theGraphMiddleware?.entityVersion ?? 4) >= 4;
|
283938
283912
|
return isFixedNetwork ? SETTLEMINT_NETWORK : sanitizeName(await getNodeName({ env: env2, instance, accessToken }), 30);
|
283939
283913
|
}
|
@@ -284005,30 +283979,37 @@ function subgraphDeployCommand() {
|
|
284005
283979
|
description: "Deploy the subgraph with a specific name",
|
284006
283980
|
command: "scs subgraph deploy my-subgraph"
|
284007
283981
|
}
|
284008
|
-
])).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").argument("[subgraph-name]", "The name of the subgraph to deploy (defaults to value in .env if not provided)").action(async (subgraphName, { prod, acceptDefaults }) => {
|
283982
|
+
])).option("--ipfs <ipfs-url>", "The IPFS URL to use for the subgraph deployment (defaults to https://ipfs.console.settlemint.com)").option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").argument("[subgraph-name]", "The name of the subgraph to deploy (defaults to value in .env if not provided)").action(async (subgraphName, { prod, acceptDefaults, ipfs }) => {
|
284009
283983
|
intro("Deploying subgraph");
|
284010
283984
|
await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
|
284011
283985
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
284012
283986
|
const env2 = await loadEnv(false, !!prod);
|
284013
|
-
const instance = await instancePrompt(
|
284014
|
-
const accessToken = await getApplicationOrPersonalAccessToken({
|
283987
|
+
const instance = await instancePrompt({
|
284015
283988
|
env: env2,
|
284016
|
-
|
284017
|
-
prefer: "application"
|
283989
|
+
accept: true
|
284018
283990
|
});
|
284019
|
-
|
284020
|
-
|
284021
|
-
|
284022
|
-
|
284023
|
-
|
284024
|
-
|
283991
|
+
let theGraphMiddleware;
|
283992
|
+
let accessToken;
|
283993
|
+
if (instance !== STANDALONE_INSTANCE2) {
|
283994
|
+
accessToken = await getApplicationOrPersonalAccessToken({
|
283995
|
+
env: env2,
|
283996
|
+
instance,
|
283997
|
+
prefer: "application"
|
283998
|
+
});
|
283999
|
+
theGraphMiddleware = await getTheGraphMiddleware({ env: env2, instance, accessToken, autoAccept });
|
284000
|
+
if (!theGraphMiddleware) {
|
284001
|
+
return nothingSelectedError("graph middleware");
|
284002
|
+
}
|
284003
|
+
if (theGraphMiddleware.status !== "COMPLETED") {
|
284004
|
+
serviceNotRunningError("graph middleware", theGraphMiddleware.status);
|
284005
|
+
}
|
284006
|
+
await updateSpecVersion(theGraphMiddleware.specVersion);
|
284025
284007
|
}
|
284026
284008
|
const network = await getTheGraphNetwork({ theGraphMiddleware, env: env2, instance, accessToken });
|
284027
284009
|
await subgraphSetup({
|
284028
284010
|
network
|
284029
284011
|
});
|
284030
284012
|
const subgraphYamlFile = await getSubgraphYamlFile();
|
284031
|
-
await updateSpecVersion(theGraphMiddleware.specVersion);
|
284032
284013
|
const { command, args } = await getPackageManagerExecutable();
|
284033
284014
|
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile]);
|
284034
284015
|
const generated = await isGenerated();
|
@@ -284057,7 +284038,21 @@ function subgraphDeployCommand() {
|
|
284057
284038
|
if (!graphName) {
|
284058
284039
|
cancel2("No subgraph name provided. Please provide a subgraph name to continue.");
|
284059
284040
|
}
|
284060
|
-
|
284041
|
+
let middlewareAdminUrl;
|
284042
|
+
if (accessToken && theGraphMiddleware) {
|
284043
|
+
middlewareAdminUrl = new URL(`/${encodeURIComponent(accessToken)}/admin`, theGraphMiddleware.serviceUrl).toString();
|
284044
|
+
} else {
|
284045
|
+
const serviceUrl = await serviceUrlPrompt({
|
284046
|
+
defaultUrl: `${getTheGraphUrl(env2.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS)}/admin`,
|
284047
|
+
accept: autoAccept,
|
284048
|
+
message: "What is the admin endpoint for the The Graph instance you want to connect to?",
|
284049
|
+
example: "https://thegraph.mydomain.com/admin"
|
284050
|
+
});
|
284051
|
+
if (!serviceUrl) {
|
284052
|
+
cancel2("No The Graph admin URL provided. Please provide a The Graph admin URL to continue.");
|
284053
|
+
}
|
284054
|
+
middlewareAdminUrl = serviceUrl.includes("/admin") ? serviceUrl : new URL(`${serviceUrl}/admin`).toString();
|
284055
|
+
}
|
284061
284056
|
await executeCommand(command, [...args, "graph", "create", "--node", middlewareAdminUrl, graphName]);
|
284062
284057
|
await executeCommand(command, [
|
284063
284058
|
...args,
|
@@ -284068,22 +284063,34 @@ function subgraphDeployCommand() {
|
|
284068
284063
|
"--node",
|
284069
284064
|
middlewareAdminUrl,
|
284070
284065
|
"--ipfs",
|
284071
|
-
"https://ipfs.console.settlemint.com",
|
284066
|
+
ipfs ?? "https://ipfs.console.settlemint.com",
|
284072
284067
|
graphName,
|
284073
284068
|
subgraphYamlFile
|
284074
284069
|
]);
|
284075
|
-
|
284076
|
-
|
284077
|
-
|
284078
|
-
|
284079
|
-
|
284080
|
-
|
284081
|
-
|
284082
|
-
|
284083
|
-
|
284084
|
-
|
284085
|
-
|
284086
|
-
|
284070
|
+
if (accessToken && theGraphMiddleware) {
|
284071
|
+
const settlemintClient = createSettleMintClient({
|
284072
|
+
accessToken,
|
284073
|
+
instance
|
284074
|
+
});
|
284075
|
+
const middleware = await settlemintClient.middleware.read(theGraphMiddleware.uniqueName);
|
284076
|
+
const graphEnv = await getGraphEnv(settlemintClient, middleware, graphName);
|
284077
|
+
await writeEnvSpinner(!!prod, {
|
284078
|
+
...env2,
|
284079
|
+
SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
|
284080
|
+
...graphEnv,
|
284081
|
+
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH ?? graphName
|
284082
|
+
});
|
284083
|
+
} else {
|
284084
|
+
await writeEnvSpinner(!!prod, {
|
284085
|
+
...env2,
|
284086
|
+
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: getUpdatedSubgraphEndpoints({
|
284087
|
+
existingEndpoints: env2.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS ?? [],
|
284088
|
+
middlewareAdminUrl,
|
284089
|
+
newSubgraphName: graphName
|
284090
|
+
}),
|
284091
|
+
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH ?? graphName
|
284092
|
+
});
|
284093
|
+
}
|
284087
284094
|
outro(`Subgraph ${graphName} deployed successfully`);
|
284088
284095
|
});
|
284089
284096
|
}
|
@@ -284094,7 +284101,6 @@ async function updateSpecVersion(specVersion) {
|
|
284094
284101
|
}
|
284095
284102
|
|
284096
284103
|
// src/commands/smart-contract-set/subgraph/remove.ts
|
284097
|
-
import { dirname as dirname10 } from "node:path";
|
284098
284104
|
function subgraphRemoveCommand() {
|
284099
284105
|
return new Command("remove").description("Remove a subgraph").usage(createExamples([
|
284100
284106
|
{
|
@@ -284115,46 +284121,76 @@ function subgraphRemoveCommand() {
|
|
284115
284121
|
if (!force) {
|
284116
284122
|
await deleteConfirmationPrompt(`the subgraph ${graphName}`);
|
284117
284123
|
}
|
284118
|
-
const instance = await instancePrompt(
|
284119
|
-
const accessToken = await getApplicationOrPersonalAccessToken({
|
284124
|
+
const instance = await instancePrompt({
|
284120
284125
|
env: env2,
|
284121
|
-
|
284122
|
-
prefer: "application"
|
284126
|
+
accept: true
|
284123
284127
|
});
|
284124
|
-
|
284125
|
-
|
284126
|
-
|
284127
|
-
|
284128
|
-
|
284129
|
-
|
284128
|
+
let theGraphMiddleware;
|
284129
|
+
let accessToken;
|
284130
|
+
if (instance !== STANDALONE_INSTANCE2) {
|
284131
|
+
accessToken = await getApplicationOrPersonalAccessToken({
|
284132
|
+
env: env2,
|
284133
|
+
instance,
|
284134
|
+
prefer: "application"
|
284135
|
+
});
|
284136
|
+
theGraphMiddleware = await getTheGraphMiddleware({ env: env2, instance, accessToken, autoAccept });
|
284137
|
+
if (!theGraphMiddleware) {
|
284138
|
+
return nothingSelectedError("graph middleware");
|
284139
|
+
}
|
284140
|
+
if (theGraphMiddleware.status !== "COMPLETED") {
|
284141
|
+
serviceNotRunningError("graph middleware", theGraphMiddleware.status);
|
284142
|
+
}
|
284130
284143
|
}
|
284131
|
-
const subgraphYamlFile = await getSubgraphYamlFile();
|
284132
|
-
const cwd2 = dirname10(subgraphYamlFile);
|
284133
284144
|
const { command, args } = await getPackageManagerExecutable();
|
284134
|
-
|
284145
|
+
let middlewareAdminUrl;
|
284146
|
+
if (accessToken && theGraphMiddleware) {
|
284147
|
+
middlewareAdminUrl = new URL(`/${encodeURIComponent(accessToken)}/admin`, theGraphMiddleware.serviceUrl).toString();
|
284148
|
+
} else {
|
284149
|
+
const serviceUrl = await serviceUrlPrompt({
|
284150
|
+
defaultUrl: `${getTheGraphUrl(env2.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS)}/admin`,
|
284151
|
+
accept: autoAccept,
|
284152
|
+
message: "What is the admin endpoint for the The Graph instance you want to connect to?",
|
284153
|
+
example: "https://thegraph.mydomain.com/admin"
|
284154
|
+
});
|
284155
|
+
if (!serviceUrl) {
|
284156
|
+
cancel2("No The Graph admin URL provided. Please provide a The Graph admin URL to continue.");
|
284157
|
+
}
|
284158
|
+
middlewareAdminUrl = serviceUrl.includes("/admin") ? serviceUrl : new URL(`${serviceUrl}/admin`).toString();
|
284159
|
+
}
|
284135
284160
|
await executeCommand(command, [...args, "graph", "remove", "--node", middlewareAdminUrl, graphName]);
|
284136
|
-
|
284137
|
-
|
284138
|
-
|
284139
|
-
|
284140
|
-
|
284141
|
-
|
284142
|
-
|
284143
|
-
|
284144
|
-
|
284145
|
-
|
284146
|
-
|
284147
|
-
|
284148
|
-
|
284149
|
-
|
284150
|
-
|
284151
|
-
|
284152
|
-
|
284153
|
-
|
284154
|
-
|
284155
|
-
|
284156
|
-
|
284157
|
-
|
284161
|
+
if (accessToken && theGraphMiddleware) {
|
284162
|
+
const settlemintClient = createSettleMintClient({
|
284163
|
+
accessToken,
|
284164
|
+
instance
|
284165
|
+
});
|
284166
|
+
const graphEndpoints = await spinner({
|
284167
|
+
startMessage: "Waiting for subgraph to be removed",
|
284168
|
+
task: () => retryWhenFailed2(async () => {
|
284169
|
+
const middleware = await settlemintClient.middleware.read(theGraphMiddleware.uniqueName);
|
284170
|
+
const endpoints = await getGraphEnv(settlemintClient, middleware);
|
284171
|
+
if (endpoints.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS?.some((endpoint) => endpoint.endsWith(graphName))) {
|
284172
|
+
throw new Error(`Subgraph '${graphName}' not removed from middleware '${theGraphMiddleware.uniqueName}'`);
|
284173
|
+
}
|
284174
|
+
return endpoints;
|
284175
|
+
}, 5, 5000),
|
284176
|
+
stopMessage: "Waiting finished"
|
284177
|
+
});
|
284178
|
+
await writeEnvSpinner(!!prod, {
|
284179
|
+
...env2,
|
284180
|
+
SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
|
284181
|
+
...graphEndpoints,
|
284182
|
+
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH === graphName ? undefined : env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH
|
284183
|
+
});
|
284184
|
+
} else {
|
284185
|
+
await writeEnvSpinner(!!prod, {
|
284186
|
+
...env2,
|
284187
|
+
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: getUpdatedSubgraphEndpoints({
|
284188
|
+
existingEndpoints: env2.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS ?? [],
|
284189
|
+
removedSubgraphName: graphName
|
284190
|
+
}),
|
284191
|
+
SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH === graphName ? undefined : env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH
|
284192
|
+
});
|
284193
|
+
}
|
284158
284194
|
outro(`Subgraph ${graphName} removed successfully`);
|
284159
284195
|
});
|
284160
284196
|
}
|
@@ -284302,4 +284338,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
284302
284338
|
// src/cli.ts
|
284303
284339
|
sdkCliCommand();
|
284304
284340
|
|
284305
|
-
//# debugId=
|
284341
|
+
//# debugId=20010C3E369919A864756E2164756E21
|