@alchemy/cli 0.7.1 → 0.7.2
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/auth-7QNYRHIK.js +16 -0
- package/dist/{auth-JGON2JU6.js → auth-TA3SL4BL.js} +2 -2
- package/dist/{chunk-TOEVZMIP.js → chunk-5LCA2B6S.js} +2 -2
- package/dist/{chunk-7WD3YLRK.js → chunk-BAZ4NGOD.js} +1 -1
- package/dist/{chunk-5IFXLC2S.js → chunk-DGKUBK7G.js} +1 -1
- package/dist/{chunk-V4IK4CJN.js → chunk-EZ2ZD7YO.js} +2 -2
- package/dist/{chunk-HSKKIATB.js → chunk-INVT5BV6.js} +1 -1
- package/dist/{chunk-QEDAULQ2.js → chunk-KLPWJFWP.js} +4 -0
- package/dist/{chunk-SYP6KKP6.js → chunk-LQXLZLCY.js} +6 -6
- package/dist/{chunk-RS3DSL3X.js → chunk-MB6REYQL.js} +3 -3
- package/dist/{chunk-HYCRHNPX.js → chunk-RE5HSYJJ.js} +1 -1
- package/dist/{errors-3CNFGAXT.js → errors-J6HNGXVA.js} +3 -1
- package/dist/index.js +20 -16
- package/dist/{interactive-N33RCX33.js → interactive-JNTFVCUJ.js} +7 -7
- package/dist/{onboarding-S6HKWOEA.js → onboarding-WN3IMTGS.js} +6 -6
- package/dist/{resolve-R4JZZCCF.js → resolve-ZCR3YCHJ.js} +3 -3
- package/package.json +1 -1
- package/dist/auth-BNT5Z5GZ.js +0 -16
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
|
|
3
|
+
import {
|
|
4
|
+
registerAuth,
|
|
5
|
+
selectAppAfterAuth
|
|
6
|
+
} from "./chunk-LQXLZLCY.js";
|
|
7
|
+
import "./chunk-INVT5BV6.js";
|
|
8
|
+
import "./chunk-RE5HSYJJ.js";
|
|
9
|
+
import "./chunk-5LCA2B6S.js";
|
|
10
|
+
import "./chunk-DGKUBK7G.js";
|
|
11
|
+
import "./chunk-BAZ4NGOD.js";
|
|
12
|
+
import "./chunk-KLPWJFWP.js";
|
|
13
|
+
export {
|
|
14
|
+
registerAuth,
|
|
15
|
+
selectAppAfterAuth
|
|
16
|
+
};
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
configDir,
|
|
5
5
|
load,
|
|
6
6
|
save
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BAZ4NGOD.js";
|
|
8
8
|
import {
|
|
9
9
|
CLIError,
|
|
10
10
|
ErrorCode,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
parseBaseURLOverride,
|
|
30
30
|
redactSensitiveText,
|
|
31
31
|
verbose
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-KLPWJFWP.js";
|
|
33
33
|
|
|
34
34
|
// src/lib/resolve.ts
|
|
35
35
|
import { readFileSync as readFileSync2 } from "fs";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
|
|
3
3
|
import {
|
|
4
4
|
isInteractiveAllowed
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RE5HSYJJ.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveAuthToken
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5LCA2B6S.js";
|
|
9
9
|
|
|
10
10
|
// src/lib/onboarding.ts
|
|
11
11
|
function hasAPIKey(cfg) {
|
|
@@ -517,6 +517,9 @@ var replMode = false;
|
|
|
517
517
|
function setReplMode(enabled) {
|
|
518
518
|
replMode = enabled;
|
|
519
519
|
}
|
|
520
|
+
function isReplMode() {
|
|
521
|
+
return replMode;
|
|
522
|
+
}
|
|
520
523
|
function exitWithError(err) {
|
|
521
524
|
const cliErr = err instanceof CLIError ? err : new CLIError(
|
|
522
525
|
ErrorCode.INTERNAL_ERROR,
|
|
@@ -573,5 +576,6 @@ export {
|
|
|
573
576
|
errAdminAPI,
|
|
574
577
|
errSetupRequired,
|
|
575
578
|
setReplMode,
|
|
579
|
+
isReplMode,
|
|
576
580
|
exitWithError
|
|
577
581
|
};
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
completeLogin,
|
|
5
5
|
prepareLogin,
|
|
6
6
|
revokeToken
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-INVT5BV6.js";
|
|
8
8
|
import {
|
|
9
9
|
isInteractiveAllowed
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RE5HSYJJ.js";
|
|
11
11
|
import {
|
|
12
12
|
AdminClient,
|
|
13
13
|
resolveAuthToken
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-5LCA2B6S.js";
|
|
15
15
|
import {
|
|
16
16
|
bold,
|
|
17
17
|
brand,
|
|
@@ -20,13 +20,13 @@ import {
|
|
|
20
20
|
promptAutocomplete,
|
|
21
21
|
promptText,
|
|
22
22
|
withSpinner
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-DGKUBK7G.js";
|
|
24
24
|
import {
|
|
25
25
|
configPath,
|
|
26
26
|
load,
|
|
27
27
|
maskIf,
|
|
28
28
|
save
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-BAZ4NGOD.js";
|
|
30
30
|
import {
|
|
31
31
|
CLIError,
|
|
32
32
|
ErrorCode,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
exitWithError,
|
|
35
35
|
isJSONMode,
|
|
36
36
|
printHuman
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-KLPWJFWP.js";
|
|
38
38
|
|
|
39
39
|
// src/commands/auth.ts
|
|
40
40
|
function registerAuth(program) {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
|
|
3
3
|
import {
|
|
4
4
|
configPath
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-BAZ4NGOD.js";
|
|
6
6
|
import {
|
|
7
7
|
esc
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KLPWJFWP.js";
|
|
9
9
|
|
|
10
10
|
// src/lib/update-check.ts
|
|
11
11
|
import { execFileSync } from "child_process";
|
|
@@ -53,7 +53,7 @@ function semverLT(a, b) {
|
|
|
53
53
|
return false;
|
|
54
54
|
}
|
|
55
55
|
function currentVersion() {
|
|
56
|
-
return true ? "0.7.
|
|
56
|
+
return true ? "0.7.2" : "0.0.0";
|
|
57
57
|
}
|
|
58
58
|
function toUpdateStatus(latestVersion, checkedAt) {
|
|
59
59
|
const current = currentVersion();
|
|
@@ -24,8 +24,9 @@ import {
|
|
|
24
24
|
errSolanaWalletKeyRequired,
|
|
25
25
|
errWalletKeyRequired,
|
|
26
26
|
exitWithError,
|
|
27
|
+
isReplMode,
|
|
27
28
|
setReplMode
|
|
28
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-KLPWJFWP.js";
|
|
29
30
|
export {
|
|
30
31
|
CLIError,
|
|
31
32
|
EXIT_CODES,
|
|
@@ -50,5 +51,6 @@ export {
|
|
|
50
51
|
errSolanaWalletKeyRequired,
|
|
51
52
|
errWalletKeyRequired,
|
|
52
53
|
exitWithError,
|
|
54
|
+
isReplMode,
|
|
53
55
|
setReplMode
|
|
54
56
|
};
|
package/dist/index.js
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
|
|
3
3
|
import {
|
|
4
4
|
registerAuth
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LQXLZLCY.js";
|
|
6
6
|
import {
|
|
7
7
|
openBrowser
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-INVT5BV6.js";
|
|
9
9
|
import {
|
|
10
10
|
getSetupStatus,
|
|
11
11
|
isSetupComplete,
|
|
12
12
|
shouldRunOnboarding
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-EZ2ZD7YO.js";
|
|
14
14
|
import {
|
|
15
15
|
isInteractiveAllowed
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-RE5HSYJJ.js";
|
|
17
17
|
import {
|
|
18
18
|
adminClientFromFlags,
|
|
19
19
|
clearSession,
|
|
@@ -41,12 +41,12 @@ import {
|
|
|
41
41
|
resolveX402Client,
|
|
42
42
|
saveSession,
|
|
43
43
|
updateSession
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-5LCA2B6S.js";
|
|
45
45
|
import {
|
|
46
46
|
getAvailableUpdate,
|
|
47
47
|
getUpdateStatus,
|
|
48
48
|
printUpdateNotice
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-MB6REYQL.js";
|
|
50
50
|
import {
|
|
51
51
|
bold,
|
|
52
52
|
brand,
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
weiToEth,
|
|
71
71
|
withSpinner,
|
|
72
72
|
yellow
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-DGKUBK7G.js";
|
|
74
74
|
import {
|
|
75
75
|
KEY_MAP,
|
|
76
76
|
configDir,
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
save,
|
|
82
82
|
toMap,
|
|
83
83
|
validKeys
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-BAZ4NGOD.js";
|
|
85
85
|
import {
|
|
86
86
|
CLIError,
|
|
87
87
|
EXIT_CODES,
|
|
@@ -108,6 +108,7 @@ import {
|
|
|
108
108
|
identity,
|
|
109
109
|
isJSONMode,
|
|
110
110
|
isLocalhost,
|
|
111
|
+
isReplMode,
|
|
111
112
|
noColor,
|
|
112
113
|
parseBaseURLOverride,
|
|
113
114
|
printHuman,
|
|
@@ -116,7 +117,7 @@ import {
|
|
|
116
117
|
setFlags,
|
|
117
118
|
setNoColor,
|
|
118
119
|
verbose
|
|
119
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-KLPWJFWP.js";
|
|
120
121
|
|
|
121
122
|
// src/index.ts
|
|
122
123
|
import { Command, Help } from "commander";
|
|
@@ -623,7 +624,7 @@ function registerConfig(program2) {
|
|
|
623
624
|
printJSON(toMap(cfg));
|
|
624
625
|
return;
|
|
625
626
|
}
|
|
626
|
-
const { resolveAuthToken: resolveAuthToken2 } = await import("./resolve-
|
|
627
|
+
const { resolveAuthToken: resolveAuthToken2 } = await import("./resolve-ZCR3YCHJ.js");
|
|
627
628
|
const validToken = resolveAuthToken2(cfg);
|
|
628
629
|
const authStatus = cfg.auth_token ? validToken ? `${green("\u2713")} authenticated${cfg.auth_token_expires_at ? ` ${dim(`(expires ${cfg.auth_token_expires_at})`)}` : ""}` : `${yellow("\u25C6")} expired${cfg.auth_token_expires_at ? ` ${dim(`(${cfg.auth_token_expires_at})`)}` : ""}` : dim("(not set) \u2014 run 'alchemy auth' to log in");
|
|
629
630
|
const pairs = [
|
|
@@ -6634,7 +6635,7 @@ Examples:
|
|
|
6634
6635
|
signer: parseSignerOpt(opts.signer)
|
|
6635
6636
|
});
|
|
6636
6637
|
} catch (err) {
|
|
6637
|
-
const { exitWithError: exitWithError2 } = await import("./errors-
|
|
6638
|
+
const { exitWithError: exitWithError2 } = await import("./errors-J6HNGXVA.js");
|
|
6638
6639
|
exitWithError2(err);
|
|
6639
6640
|
}
|
|
6640
6641
|
});
|
|
@@ -7988,7 +7989,7 @@ function resetUpdateNoticeState() {
|
|
|
7988
7989
|
}
|
|
7989
7990
|
program.name("alchemy").description(
|
|
7990
7991
|
"The Alchemy CLI lets you query blockchain data, call JSON-RPC methods, and manage your Alchemy configuration."
|
|
7991
|
-
).version("0.7.
|
|
7992
|
+
).version("0.7.2", "-v, --version", "display CLI version").option("--api-key <key>", "Alchemy API key (env: ALCHEMY_API_KEY)").option(
|
|
7992
7993
|
"-n, --network <network>",
|
|
7993
7994
|
"Target network (default: eth-mainnet) (env: ALCHEMY_NETWORK)"
|
|
7994
7995
|
).option("--x402", "Use x402 wallet-based gateway auth").option(
|
|
@@ -8175,11 +8176,11 @@ ${styledLine}`;
|
|
|
8175
8176
|
"wallet"
|
|
8176
8177
|
];
|
|
8177
8178
|
if (!skipAppPrompt.includes(cmdName) && isInteractiveAllowed(program) && !opts.apiKey && !process.env.ALCHEMY_API_KEY) {
|
|
8178
|
-
const { resolveAuthToken: resolveAuthToken2 } = await import("./resolve-
|
|
8179
|
+
const { resolveAuthToken: resolveAuthToken2 } = await import("./resolve-ZCR3YCHJ.js");
|
|
8179
8180
|
const authToken = resolveAuthToken2(cfg);
|
|
8180
8181
|
const hasApiKey = Boolean(cfg.api_key?.trim() || cfg.app?.apiKey);
|
|
8181
8182
|
if (authToken && !hasApiKey) {
|
|
8182
|
-
const { selectAppAfterAuth } = await import("./auth-
|
|
8183
|
+
const { selectAppAfterAuth } = await import("./auth-7QNYRHIK.js");
|
|
8183
8184
|
console.log("");
|
|
8184
8185
|
console.log(` No app selected. Please select an app to continue.`);
|
|
8185
8186
|
await selectAppAfterAuth(authToken);
|
|
@@ -8194,6 +8195,9 @@ ${styledLine}`;
|
|
|
8194
8195
|
}
|
|
8195
8196
|
}
|
|
8196
8197
|
resetUpdateNoticeState();
|
|
8198
|
+
if (!isReplMode()) {
|
|
8199
|
+
process.exit(0);
|
|
8200
|
+
}
|
|
8197
8201
|
}).action(async (_opts, cmd) => {
|
|
8198
8202
|
const excessArgs = cmd.args;
|
|
8199
8203
|
if (excessArgs.length > 0) {
|
|
@@ -8210,7 +8214,7 @@ ${styledLine}`;
|
|
|
8210
8214
|
if (isInteractiveAllowed(program)) {
|
|
8211
8215
|
let latestForInteractiveStartup = null;
|
|
8212
8216
|
if (shouldRunOnboarding(program, cfg)) {
|
|
8213
|
-
const { runOnboarding } = await import("./onboarding-
|
|
8217
|
+
const { runOnboarding } = await import("./onboarding-WN3IMTGS.js");
|
|
8214
8218
|
const latest = getAvailableUpdateOnce();
|
|
8215
8219
|
const completed = await runOnboarding(program, latest);
|
|
8216
8220
|
updateShownDuringInteractiveStartup = Boolean(latest);
|
|
@@ -8224,7 +8228,7 @@ ${styledLine}`;
|
|
|
8224
8228
|
latestForInteractiveStartup
|
|
8225
8229
|
);
|
|
8226
8230
|
}
|
|
8227
|
-
const { startREPL } = await import("./interactive-
|
|
8231
|
+
const { startREPL } = await import("./interactive-JNTFVCUJ.js");
|
|
8228
8232
|
program.exitOverride();
|
|
8229
8233
|
program.configureOutput({
|
|
8230
8234
|
writeErr: () => {
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
|
|
3
3
|
import {
|
|
4
4
|
getSetupMethod
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-EZ2ZD7YO.js";
|
|
6
|
+
import "./chunk-RE5HSYJJ.js";
|
|
7
7
|
import {
|
|
8
8
|
getRPCNetworkIds
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5LCA2B6S.js";
|
|
10
10
|
import {
|
|
11
11
|
getUpdateNoticeLines
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MB6REYQL.js";
|
|
13
13
|
import {
|
|
14
14
|
bold,
|
|
15
15
|
brand,
|
|
@@ -17,18 +17,18 @@ import {
|
|
|
17
17
|
dim,
|
|
18
18
|
green,
|
|
19
19
|
setBrandedHelpSuppressed
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-DGKUBK7G.js";
|
|
21
21
|
import {
|
|
22
22
|
configDir,
|
|
23
23
|
load
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-BAZ4NGOD.js";
|
|
25
25
|
import {
|
|
26
26
|
bgRgb,
|
|
27
27
|
isJSONMode,
|
|
28
28
|
noColor,
|
|
29
29
|
rgb,
|
|
30
30
|
setReplMode
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-KLPWJFWP.js";
|
|
32
32
|
|
|
33
33
|
// src/commands/interactive.ts
|
|
34
34
|
import * as readline from "readline";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
|
|
3
3
|
import {
|
|
4
4
|
getUpdateNoticeLines
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MB6REYQL.js";
|
|
6
6
|
import {
|
|
7
7
|
bold,
|
|
8
8
|
brand,
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
dim,
|
|
11
11
|
green,
|
|
12
12
|
promptText
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-DGKUBK7G.js";
|
|
14
14
|
import {
|
|
15
15
|
load,
|
|
16
16
|
save
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-BAZ4NGOD.js";
|
|
18
|
+
import "./chunk-KLPWJFWP.js";
|
|
19
19
|
|
|
20
20
|
// src/commands/onboarding.ts
|
|
21
21
|
async function runOnboarding(_program, latestUpdate = null) {
|
|
@@ -38,7 +38,7 @@ async function runOnboarding(_program, latestUpdate = null) {
|
|
|
38
38
|
if (answer === null) {
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
|
-
const { performBrowserLogin, AUTH_PORT, getLoginUrl } = await import("./auth-
|
|
41
|
+
const { performBrowserLogin, AUTH_PORT, getLoginUrl } = await import("./auth-TA3SL4BL.js");
|
|
42
42
|
console.log(` Opening browser to log in...`);
|
|
43
43
|
console.log(` ${dim(getLoginUrl(AUTH_PORT))}`);
|
|
44
44
|
console.log(` ${dim("Waiting for authentication...")}`);
|
|
@@ -51,7 +51,7 @@ async function runOnboarding(_program, latestUpdate = null) {
|
|
|
51
51
|
auth_token_expires_at: result.expiresAt
|
|
52
52
|
});
|
|
53
53
|
console.log(` ${green("\u2713")} Logged in successfully`);
|
|
54
|
-
const { selectAppAfterAuth } = await import("./auth-
|
|
54
|
+
const { selectAppAfterAuth } = await import("./auth-7QNYRHIK.js");
|
|
55
55
|
await selectAppAfterAuth(result.token);
|
|
56
56
|
return true;
|
|
57
57
|
} catch (err) {
|
|
@@ -22,9 +22,9 @@ import {
|
|
|
22
22
|
resolveWalletSession,
|
|
23
23
|
resolveX402,
|
|
24
24
|
resolveX402Client
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-5LCA2B6S.js";
|
|
26
|
+
import "./chunk-BAZ4NGOD.js";
|
|
27
|
+
import "./chunk-KLPWJFWP.js";
|
|
28
28
|
export {
|
|
29
29
|
adminClientFromFlags,
|
|
30
30
|
clientFromFlags,
|
package/package.json
CHANGED
package/dist/auth-BNT5Z5GZ.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
if(process.argv.includes("--no-color"))process.env.NO_COLOR="1";
|
|
3
|
-
import {
|
|
4
|
-
registerAuth,
|
|
5
|
-
selectAppAfterAuth
|
|
6
|
-
} from "./chunk-SYP6KKP6.js";
|
|
7
|
-
import "./chunk-HSKKIATB.js";
|
|
8
|
-
import "./chunk-HYCRHNPX.js";
|
|
9
|
-
import "./chunk-TOEVZMIP.js";
|
|
10
|
-
import "./chunk-5IFXLC2S.js";
|
|
11
|
-
import "./chunk-7WD3YLRK.js";
|
|
12
|
-
import "./chunk-QEDAULQ2.js";
|
|
13
|
-
export {
|
|
14
|
-
registerAuth,
|
|
15
|
-
selectAppAfterAuth
|
|
16
|
-
};
|