@settlemint/sdk-cli 0.7.1 → 0.7.2-main03ea530
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 +96 -58
- package/dist/cli.js.map +17 -16
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -197427,7 +197427,7 @@ ${Bt.cyan(Yt)}
|
|
|
197427
197427
|
code: "ENOENT"
|
|
197428
197428
|
}), getPathInfo = (e9, t7) => {
|
|
197429
197429
|
var r6 = t7.colon || or;
|
|
197430
|
-
var i6 = e9.match(/\//) || nr && e9.match(/\\/) ? [""] : [...nr ? [process.cwd()] : [], ...(t7.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
197430
|
+
var i6 = e9.match(/\//) || nr && e9.match(/\\/) ? [""] : [...nr ? [process.cwd()] : [], ...(t7.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.wgZWKb8SKe:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(r6)];
|
|
197431
197431
|
var n6 = nr ? t7.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
197432
197432
|
var a5 = nr ? n6.split(r6) : [""];
|
|
197433
197433
|
if (nr) {
|
|
@@ -200564,7 +200564,7 @@ ${whileRunning(e9)}`;
|
|
|
200564
200564
|
};
|
|
200565
200565
|
ni = Object.assign(async function _main() {
|
|
200566
200566
|
var e9 = new Cli({
|
|
200567
|
-
binaryVersion: "0.7.
|
|
200567
|
+
binaryVersion: "0.7.2-main03ea530",
|
|
200568
200568
|
binaryLabel: "gql.tada CLI",
|
|
200569
200569
|
binaryName: "gql.tada"
|
|
200570
200570
|
});
|
|
@@ -218401,7 +218401,7 @@ var require_lib4 = __commonJS((exports, module) => {
|
|
|
218401
218401
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
218402
218402
|
var getNotFoundError2 = (cmd2) => Object.assign(new Error(`not found: ${cmd2}`), { code: "ENOENT" });
|
|
218403
218403
|
var getPathInfo2 = (cmd2, {
|
|
218404
|
-
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
218404
|
+
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.wgZWKb8SKe:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
218405
218405
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
218406
218406
|
delimiter: optDelimiter = delimiter
|
|
218407
218407
|
}) => {
|
|
@@ -218605,7 +218605,7 @@ var require_lib5 = __commonJS((exports, module) => {
|
|
|
218605
218605
|
let pathToInitial;
|
|
218606
218606
|
try {
|
|
218607
218607
|
pathToInitial = which.sync(initialCmd, {
|
|
218608
|
-
path: options.env && findInObject(options.env, "PATH") || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
218608
|
+
path: options.env && findInObject(options.env, "PATH") || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.wgZWKb8SKe:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
218609
218609
|
pathext: options.env && findInObject(options.env, "PATHEXT") || process.env.PATHEXT
|
|
218610
218610
|
}).toLowerCase();
|
|
218611
218611
|
} catch (err) {
|
|
@@ -219322,7 +219322,7 @@ var require_lib6 = __commonJS((exports, module) => {
|
|
|
219322
219322
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
219323
219323
|
var getNotFoundError2 = (cmd2) => Object.assign(new Error(`not found: ${cmd2}`), { code: "ENOENT" });
|
|
219324
219324
|
var getPathInfo2 = (cmd2, {
|
|
219325
|
-
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
219325
|
+
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.wgZWKb8SKe:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
219326
219326
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
219327
219327
|
delimiter: optDelimiter = delimiter
|
|
219328
219328
|
}) => {
|
|
@@ -235213,7 +235213,7 @@ var require_which2 = __commonJS((exports, module) => {
|
|
|
235213
235213
|
const colon = opt2.colon || COLON;
|
|
235214
235214
|
const pathEnv = cmd2.match(/\//) || isWindows2 && cmd2.match(/\\/) ? [""] : [
|
|
235215
235215
|
...isWindows2 ? [process.cwd()] : [],
|
|
235216
|
-
...(opt2.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
235216
|
+
...(opt2.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.wgZWKb8SKe:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(colon)
|
|
235217
235217
|
];
|
|
235218
235218
|
const pathExtExe = isWindows2 ? opt2.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
235219
235219
|
const pathExt = isWindows2 ? pathExtExe.split(colon) : [""];
|
|
@@ -268842,14 +268842,14 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
|
268842
268842
|
}
|
|
268843
268843
|
const tadaConfig = {
|
|
268844
268844
|
name: "@0no-co/graphqlsp",
|
|
268845
|
+
trackFieldUsage: false,
|
|
268845
268846
|
schemas: [
|
|
268846
268847
|
...hasura ? [
|
|
268847
268848
|
{
|
|
268848
268849
|
name: "hasura",
|
|
268849
268850
|
schema: "hasura-schema.graphql",
|
|
268850
268851
|
tadaOutputLocation: "hasura-env.d.ts",
|
|
268851
|
-
tadaTurboLocation: "hasura-cache.d.ts"
|
|
268852
|
-
trackFieldUsage: false
|
|
268852
|
+
tadaTurboLocation: "hasura-cache.d.ts"
|
|
268853
268853
|
}
|
|
268854
268854
|
] : [],
|
|
268855
268855
|
...thegraph ? theGraphEndpoints.map((endpoint) => {
|
|
@@ -268858,8 +268858,7 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
|
268858
268858
|
name: `thegraph-${name2}`,
|
|
268859
268859
|
schema: `the-graph-schema-${name2}.graphql`,
|
|
268860
268860
|
tadaOutputLocation: `the-graph-env-${name2}.d.ts`,
|
|
268861
|
-
tadaTurboLocation: `the-graph-cache-${name2}.d.ts
|
|
268862
|
-
trackFieldUsage: false
|
|
268861
|
+
tadaTurboLocation: `the-graph-cache-${name2}.d.ts`
|
|
268863
268862
|
};
|
|
268864
268863
|
}) : [],
|
|
268865
268864
|
...portal ? [
|
|
@@ -268867,8 +268866,7 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
|
268867
268866
|
name: "portal",
|
|
268868
268867
|
schema: "portal-schema.graphql",
|
|
268869
268868
|
tadaOutputLocation: "portal-env.d.ts",
|
|
268870
|
-
tadaTurboLocation: "portal-cache.d.ts"
|
|
268871
|
-
trackFieldUsage: false
|
|
268869
|
+
tadaTurboLocation: "portal-cache.d.ts"
|
|
268872
268870
|
}
|
|
268873
268871
|
] : [],
|
|
268874
268872
|
...blockscout ? [
|
|
@@ -268876,8 +268874,7 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
|
268876
268874
|
name: "blockscout",
|
|
268877
268875
|
schema: "blockscout-schema.graphql",
|
|
268878
268876
|
tadaOutputLocation: "blockscout-env.d.ts",
|
|
268879
|
-
tadaTurboLocation: "blockscout-cache.d.ts"
|
|
268880
|
-
trackFieldUsage: false
|
|
268877
|
+
tadaTurboLocation: "blockscout-cache.d.ts"
|
|
268881
268878
|
}
|
|
268882
268879
|
] : []
|
|
268883
268880
|
]
|
|
@@ -270326,7 +270323,7 @@ async function codegenIpfs(env2) {
|
|
|
270326
270323
|
const clientTemplate = `import { createServerIpfsClient } from "@settlemint/sdk-ipfs";
|
|
270327
270324
|
|
|
270328
270325
|
export const { client } = createServerIpfsClient({
|
|
270329
|
-
instance: process.env.
|
|
270326
|
+
instance: process.env.SETTLEMINT_IPFS_API_ENDPOINT!,
|
|
270330
270327
|
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN!,
|
|
270331
270328
|
});`;
|
|
270332
270329
|
await writeTemplate(clientTemplate, "/lib/settlemint", "ipfs.ts");
|
|
@@ -270344,7 +270341,7 @@ async function codegenMinio(env2) {
|
|
|
270344
270341
|
const clientTemplate = `import { createServerMinioClient } from "@settlemint/sdk-minio";
|
|
270345
270342
|
|
|
270346
270343
|
export const { client } = createServerMinioClient({
|
|
270347
|
-
instance: process.env.
|
|
270344
|
+
instance: process.env.SETTLEMINT_MINIO_ENDPOINT!,
|
|
270348
270345
|
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN!,
|
|
270349
270346
|
accessKey: process.env.SETTLEMINT_MINIO_ACCESS_KEY!,
|
|
270350
270347
|
secretKey: process.env.SETTLEMINT_MINIO_SECRET_KEY!
|
|
@@ -270460,8 +270457,11 @@ async function writeEnvSpinner(prod, env2) {
|
|
|
270460
270457
|
}
|
|
270461
270458
|
|
|
270462
270459
|
// src/error/missing-config-error.ts
|
|
270463
|
-
function missingAccessTokenError() {
|
|
270464
|
-
|
|
270460
|
+
function missingAccessTokenError(personalAccessTokenExists) {
|
|
270461
|
+
if (personalAccessTokenExists) {
|
|
270462
|
+
return cancel2("No access token found, please run `settlemint connect` to connect to your instance.");
|
|
270463
|
+
}
|
|
270464
|
+
return cancel2("No personal access token found, please run `settlemint login`, then run `settlemint connect` to connect using an application access token.");
|
|
270465
270465
|
}
|
|
270466
270466
|
function missingPersonalAccessTokenError() {
|
|
270467
270467
|
return cancel2("No personal access token found for instance, please run `settlemint login` to login to your instance");
|
|
@@ -273259,7 +273259,7 @@ function connectCommand() {
|
|
|
273259
273259
|
var package_default = {
|
|
273260
273260
|
name: "@settlemint/sdk-cli",
|
|
273261
273261
|
description: "SettleMint SDK, integrate SettleMint into your application with ease.",
|
|
273262
|
-
version: "0.7.
|
|
273262
|
+
version: "0.7.2-main03ea530",
|
|
273263
273263
|
type: "module",
|
|
273264
273264
|
private: false,
|
|
273265
273265
|
license: "FSL-1.1-MIT",
|
|
@@ -273310,8 +273310,8 @@ var package_default = {
|
|
|
273310
273310
|
"@inquirer/input": "4.1.1",
|
|
273311
273311
|
"@inquirer/password": "4.0.4",
|
|
273312
273312
|
"@inquirer/select": "4.0.4",
|
|
273313
|
-
"@settlemint/sdk-js": "0.7.
|
|
273314
|
-
"@settlemint/sdk-utils": "0.7.
|
|
273313
|
+
"@settlemint/sdk-js": "0.7.2-main03ea530",
|
|
273314
|
+
"@settlemint/sdk-utils": "0.7.2-main03ea530",
|
|
273315
273315
|
"get-tsconfig": "4.8.1",
|
|
273316
273316
|
giget: "1.2.3"
|
|
273317
273317
|
},
|
|
@@ -274370,6 +274370,26 @@ function getActionLabel(action) {
|
|
|
274370
274370
|
return "deployed";
|
|
274371
274371
|
}
|
|
274372
274372
|
|
|
274373
|
+
// src/utils/get-app-or-personal-token.ts
|
|
274374
|
+
var getApplicationOrPersonalAccessToken = async ({
|
|
274375
|
+
env: env2,
|
|
274376
|
+
instance,
|
|
274377
|
+
prefer,
|
|
274378
|
+
allowFallback
|
|
274379
|
+
}) => {
|
|
274380
|
+
const applicationAccessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
274381
|
+
const personalAccessToken = (await getInstanceCredentials(instance))?.personalAccessToken;
|
|
274382
|
+
const preferredToken = prefer === "application" ? applicationAccessToken : personalAccessToken;
|
|
274383
|
+
const fallbackToken = prefer === "application" ? personalAccessToken : applicationAccessToken;
|
|
274384
|
+
if (preferredToken) {
|
|
274385
|
+
return preferredToken;
|
|
274386
|
+
}
|
|
274387
|
+
if (allowFallback && fallbackToken) {
|
|
274388
|
+
return fallbackToken;
|
|
274389
|
+
}
|
|
274390
|
+
return prefer === "personal" ? missingPersonalAccessTokenError() : missingAccessTokenError(!!personalAccessToken);
|
|
274391
|
+
};
|
|
274392
|
+
|
|
274373
274393
|
// src/utils/sanitize-command-name.ts
|
|
274374
274394
|
function sanitizeCommandName(name2) {
|
|
274375
274395
|
return name2.split(" ").join("-").toLowerCase();
|
|
@@ -274391,10 +274411,12 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
|
|
|
274391
274411
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274392
274412
|
const env2 = await loadEnv2(false, !!prod);
|
|
274393
274413
|
const instance = await instancePrompt(env2, autoAccept);
|
|
274394
|
-
const accessToken =
|
|
274395
|
-
|
|
274396
|
-
|
|
274397
|
-
|
|
274414
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
274415
|
+
env: env2,
|
|
274416
|
+
instance,
|
|
274417
|
+
prefer: usePersonalAccessToken ? "personal" : "application",
|
|
274418
|
+
allowFallback: false
|
|
274419
|
+
});
|
|
274398
274420
|
const settlemint = createSettleMintClient({
|
|
274399
274421
|
accessToken,
|
|
274400
274422
|
instance
|
|
@@ -275386,10 +275408,12 @@ ${createExamples([
|
|
|
275386
275408
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275387
275409
|
const env2 = await loadEnv2(false, !!prod);
|
|
275388
275410
|
const instance = await instancePrompt(env2, autoAccept);
|
|
275389
|
-
const accessToken =
|
|
275390
|
-
|
|
275391
|
-
|
|
275392
|
-
|
|
275411
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275412
|
+
env: env2,
|
|
275413
|
+
instance,
|
|
275414
|
+
prefer: usePersonalAccessToken ? "personal" : "application",
|
|
275415
|
+
allowFallback: false
|
|
275416
|
+
});
|
|
275393
275417
|
const settlemint = createSettleMintClient({
|
|
275394
275418
|
accessToken,
|
|
275395
275419
|
instance
|
|
@@ -275484,10 +275508,12 @@ ${createExamples([
|
|
|
275484
275508
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275485
275509
|
const env2 = await loadEnv2(false, !!prod);
|
|
275486
275510
|
const instance = await instancePrompt(env2, autoAccept);
|
|
275487
|
-
const accessToken =
|
|
275488
|
-
|
|
275489
|
-
|
|
275490
|
-
|
|
275511
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275512
|
+
env: env2,
|
|
275513
|
+
instance,
|
|
275514
|
+
prefer: usePersonalAccessToken ? "personal" : "application",
|
|
275515
|
+
allowFallback: false
|
|
275516
|
+
});
|
|
275491
275517
|
const settlemint = createSettleMintClient({
|
|
275492
275518
|
accessToken,
|
|
275493
275519
|
instance
|
|
@@ -275674,11 +275700,13 @@ function customDeploymentsUpdateCommand() {
|
|
|
275674
275700
|
if (!customDeploymentId) {
|
|
275675
275701
|
throw new Error("No custom deployment ID specified. Please provide it either via the --id flag or by setting the SETTLEMINT_CUSTOM_DEPLOYMENT environment variable");
|
|
275676
275702
|
}
|
|
275677
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
275678
|
-
if (!accessToken) {
|
|
275679
|
-
return missingAccessTokenError();
|
|
275680
|
-
}
|
|
275681
275703
|
const instance = await instancePrompt(env2, true);
|
|
275704
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275705
|
+
env: env2,
|
|
275706
|
+
instance,
|
|
275707
|
+
prefer: "application",
|
|
275708
|
+
allowFallback: false
|
|
275709
|
+
});
|
|
275682
275710
|
const settlemint = createSettleMintClient({
|
|
275683
275711
|
accessToken,
|
|
275684
275712
|
instance
|
|
@@ -276095,11 +276123,13 @@ function hardhatDeployRemoteCommand() {
|
|
|
276095
276123
|
}) => {
|
|
276096
276124
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276097
276125
|
const env2 = await loadEnv(false, !!prod);
|
|
276098
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276099
|
-
if (!accessToken) {
|
|
276100
|
-
return missingAccessTokenError();
|
|
276101
|
-
}
|
|
276102
276126
|
const instance = await instancePrompt(env2, true);
|
|
276127
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
276128
|
+
env: env2,
|
|
276129
|
+
instance,
|
|
276130
|
+
prefer: "application",
|
|
276131
|
+
allowFallback: true
|
|
276132
|
+
});
|
|
276103
276133
|
const settlemint = createSettleMintClient({
|
|
276104
276134
|
accessToken,
|
|
276105
276135
|
instance
|
|
@@ -276196,11 +276226,13 @@ function hardhatScriptRemoteCommand() {
|
|
|
276196
276226
|
cmd2.action(async ({ script, prod, blockchainNodeId, acceptDefaults, compile }) => {
|
|
276197
276227
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276198
276228
|
const env2 = await loadEnv(false, !!prod);
|
|
276199
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276200
|
-
if (!accessToken) {
|
|
276201
|
-
return missingAccessTokenError();
|
|
276202
|
-
}
|
|
276203
276229
|
const instance = await instancePrompt(env2, true);
|
|
276230
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
276231
|
+
env: env2,
|
|
276232
|
+
instance,
|
|
276233
|
+
prefer: "application",
|
|
276234
|
+
allowFallback: true
|
|
276235
|
+
});
|
|
276204
276236
|
const settlemint = createSettleMintClient({
|
|
276205
276237
|
accessToken,
|
|
276206
276238
|
instance
|
|
@@ -276442,11 +276474,13 @@ function subgraphBuildCommand() {
|
|
|
276442
276474
|
return new Command2("build").description("Build the subgraph").option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").action(async ({ acceptDefaults, prod }) => {
|
|
276443
276475
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276444
276476
|
const env2 = await loadEnv(false, !!prod);
|
|
276445
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276446
|
-
if (!accessToken) {
|
|
276447
|
-
return missingAccessTokenError();
|
|
276448
|
-
}
|
|
276449
276477
|
const instance = await instancePrompt(env2, true);
|
|
276478
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
276479
|
+
env: env2,
|
|
276480
|
+
instance,
|
|
276481
|
+
prefer: "application",
|
|
276482
|
+
allowFallback: false
|
|
276483
|
+
});
|
|
276450
276484
|
await subgraphSetup({
|
|
276451
276485
|
env: env2,
|
|
276452
276486
|
instance,
|
|
@@ -276467,11 +276501,13 @@ function subgraphCodegenCommand() {
|
|
|
276467
276501
|
return new Command2("codegen").option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").description("Codegen the subgraph types").action(async ({ acceptDefaults, prod }) => {
|
|
276468
276502
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276469
276503
|
const env2 = await loadEnv(false, !!prod);
|
|
276470
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276471
|
-
if (!accessToken) {
|
|
276472
|
-
return missingAccessTokenError();
|
|
276473
|
-
}
|
|
276474
276504
|
const instance = await instancePrompt(env2, true);
|
|
276505
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
276506
|
+
env: env2,
|
|
276507
|
+
instance,
|
|
276508
|
+
prefer: "application",
|
|
276509
|
+
allowFallback: false
|
|
276510
|
+
});
|
|
276475
276511
|
await subgraphSetup({
|
|
276476
276512
|
env: env2,
|
|
276477
276513
|
instance,
|
|
@@ -276521,11 +276557,13 @@ function subgraphDeployCommand() {
|
|
|
276521
276557
|
return new Command2("deploy").description("Deploy the subgraph").option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").argument("[subgraphName]", "The name of the subgraph to deploy (defaults to value in .env if not provided)").action(async (subgraphName, { prod, acceptDefaults }) => {
|
|
276522
276558
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276523
276559
|
const env2 = await loadEnv(false, !!prod);
|
|
276524
|
-
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
276525
|
-
if (!accessToken) {
|
|
276526
|
-
return missingAccessTokenError();
|
|
276527
|
-
}
|
|
276528
276560
|
const instance = await instancePrompt(env2, true);
|
|
276561
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
276562
|
+
env: env2,
|
|
276563
|
+
instance,
|
|
276564
|
+
prefer: "application",
|
|
276565
|
+
allowFallback: false
|
|
276566
|
+
});
|
|
276529
276567
|
const theGraphMiddleware = await subgraphSetup({
|
|
276530
276568
|
env: env2,
|
|
276531
276569
|
instance,
|
|
@@ -276617,4 +276655,4 @@ sdkcli.parseAsync(process.argv).catch((reason) => {
|
|
|
276617
276655
|
cancel2(reason);
|
|
276618
276656
|
});
|
|
276619
276657
|
|
|
276620
|
-
//# debugId=
|
|
276658
|
+
//# debugId=BD59FE361EAACF5E64756E2164756E21
|