@settlemint/sdk-cli 2.4.0-pr5f5458f6 → 2.4.0-pr60c1cb59
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 +64 -104
- package/dist/cli.js.map +17 -23
- package/package.json +9 -9
package/dist/cli.js
CHANGED
@@ -263840,7 +263840,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
263840
263840
|
var package_default = {
|
263841
263841
|
name: "@settlemint/sdk-cli",
|
263842
263842
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
263843
|
-
version: "2.4.0-
|
263843
|
+
version: "2.4.0-pr60c1cb59",
|
263844
263844
|
type: "module",
|
263845
263845
|
private: false,
|
263846
263846
|
license: "FSL-1.1-MIT",
|
@@ -263887,14 +263887,14 @@ var package_default = {
|
|
263887
263887
|
devDependencies: {
|
263888
263888
|
"@commander-js/extra-typings": "14.0.0",
|
263889
263889
|
commander: "14.0.0",
|
263890
|
-
"@inquirer/confirm": "5.1.
|
263891
|
-
"@inquirer/input": "4.
|
263892
|
-
"@inquirer/password": "4.0.
|
263893
|
-
"@inquirer/select": "4.2.
|
263894
|
-
"@settlemint/sdk-js": "2.4.0-
|
263895
|
-
"@settlemint/sdk-utils": "2.4.0-
|
263896
|
-
"@settlemint/sdk-viem": "2.4.0-
|
263897
|
-
"@types/node": "24.0.
|
263890
|
+
"@inquirer/confirm": "5.1.12",
|
263891
|
+
"@inquirer/input": "4.1.12",
|
263892
|
+
"@inquirer/password": "4.0.15",
|
263893
|
+
"@inquirer/select": "4.2.3",
|
263894
|
+
"@settlemint/sdk-js": "2.4.0-pr60c1cb59",
|
263895
|
+
"@settlemint/sdk-utils": "2.4.0-pr60c1cb59",
|
263896
|
+
"@settlemint/sdk-viem": "2.4.0-pr60c1cb59",
|
263897
|
+
"@types/node": "24.0.8",
|
263898
263898
|
"@types/semver": "7.7.0",
|
263899
263899
|
"@types/which": "3.0.4",
|
263900
263900
|
"get-tsconfig": "4.10.1",
|
@@ -287954,9 +287954,8 @@ var workspaceList = (gqlClient) => {
|
|
287954
287954
|
const { workspaces } = await gqlClient.request(getWorkspacesAndApplications);
|
287955
287955
|
const allWorkspaces = workspaces.reduce((acc, workspace) => {
|
287956
287956
|
acc.push(workspace);
|
287957
|
-
if (workspace.childWorkspaces)
|
287957
|
+
if (workspace.childWorkspaces)
|
287958
287958
|
acc.push(...workspace.childWorkspaces);
|
287959
|
-
}
|
287960
287959
|
return acc;
|
287961
287960
|
}, []);
|
287962
287961
|
return allWorkspaces.sort((a3, b) => a3.name.localeCompare(b.name));
|
@@ -287983,9 +287982,8 @@ var workspaceDelete = (gqlClient) => {
|
|
287983
287982
|
var workspaceAddCredits = (gqlClient) => {
|
287984
287983
|
return async (workspaceId, amount) => {
|
287985
287984
|
const id = validate2(IdSchema2, workspaceId);
|
287986
|
-
if (amount <= 0)
|
287985
|
+
if (amount <= 0)
|
287987
287986
|
throw new Error("Credit amount must be a positive number");
|
287988
|
-
}
|
287989
287987
|
const { addCredits: result } = await gqlClient.request(addCredits, {
|
287990
287988
|
workspaceId: id,
|
287991
287989
|
amount
|
@@ -288107,9 +288105,8 @@ var applicationAccessTokenCreate = (gqlClient) => {
|
|
288107
288105
|
...otherArgs,
|
288108
288106
|
applicationId: application.id
|
288109
288107
|
});
|
288110
|
-
if (!applicationAccessToken.token)
|
288108
|
+
if (!applicationAccessToken.token)
|
288111
288109
|
throw new Error("Failed to create application access token");
|
288112
|
-
}
|
288113
288110
|
return applicationAccessToken.token;
|
288114
288111
|
};
|
288115
288112
|
};
|
@@ -288122,7 +288119,7 @@ function setClusterServiceDefaults(args) {
|
|
288122
288119
|
}
|
288123
288120
|
function setNetworkDefaults(args) {
|
288124
288121
|
const clusterServiceArgs = setClusterServiceDefaults(args);
|
288125
|
-
if (args.consensusAlgorithm === "BESU_QBFT")
|
288122
|
+
if (args.consensusAlgorithm === "BESU_QBFT")
|
288126
288123
|
return {
|
288127
288124
|
...clusterServiceArgs,
|
288128
288125
|
chainId: args.chainId ?? 46040,
|
@@ -288132,7 +288129,6 @@ function setNetworkDefaults(args) {
|
|
288132
288129
|
gasPrice: args.gasPrice ?? 0,
|
288133
288130
|
secondsPerBlock: args.secondsPerBlock ?? 2
|
288134
288131
|
};
|
288135
|
-
}
|
288136
288132
|
return clusterServiceArgs;
|
288137
288133
|
}
|
288138
288134
|
var BlockchainNetworkFragment = graphql(`
|
@@ -289547,30 +289543,26 @@ async function getPincodeVerificationChallenges({ userWalletAddress, accessToken
|
|
289547
289543
|
}
|
289548
289544
|
});
|
289549
289545
|
if (!response.ok) {
|
289550
|
-
if (response.status === 404)
|
289546
|
+
if (response.status === 404)
|
289551
289547
|
throw new Error(`No user wallet found with address '${userWalletAddress}' for node '${nodeId}'`);
|
289552
|
-
}
|
289553
289548
|
throw new Error("Failed to get verification challenge");
|
289554
289549
|
}
|
289555
289550
|
const verificationChallenges = await response.json();
|
289556
289551
|
return verificationChallenges;
|
289557
289552
|
}
|
289558
289553
|
function getPincodeVerificationChallengeResponse({ verificationChallenge, pincode }) {
|
289559
|
-
if (!verificationChallenge?.challenge?.secret || !verificationChallenge?.challenge?.salt)
|
289554
|
+
if (!verificationChallenge?.challenge?.secret || !verificationChallenge?.challenge?.salt)
|
289560
289555
|
throw new Error("Could not authenticate pin code, invalid challenge format");
|
289561
|
-
}
|
289562
289556
|
const { secret, salt } = verificationChallenge.challenge;
|
289563
289557
|
return generateResponse(pincode, salt, secret);
|
289564
289558
|
}
|
289565
289559
|
function createSettleMintClient(options) {
|
289566
289560
|
ensureServer();
|
289567
|
-
if (options.instance === STANDALONE_INSTANCE2 || options.instance === LOCAL_INSTANCE2)
|
289568
|
-
if (options.anonymous)
|
289561
|
+
if (options.instance === STANDALONE_INSTANCE2 || options.instance === LOCAL_INSTANCE2)
|
289562
|
+
if (options.anonymous)
|
289569
289563
|
options.instance = "https://console.settlemint.com";
|
289570
|
-
|
289564
|
+
else
|
289571
289565
|
throw new Error("Standalone and local instances cannot connect to the SettleMint platform");
|
289572
|
-
}
|
289573
|
-
}
|
289574
289566
|
const validatedOptions = options.anonymous ? validate2(exports_external.object({
|
289575
289567
|
...ClientOptionsSchema.shape,
|
289576
289568
|
accessToken: exports_external.literal("")
|
@@ -301827,7 +301819,7 @@ var getApplicationOrPersonalAccessToken = async ({
|
|
301827
301819
|
}) => {
|
301828
301820
|
const applicationAccessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
301829
301821
|
const instanceUrl = sanitizeInstanceUrl(instance);
|
301830
|
-
const personalAccessToken = (await getInstanceCredentials(instanceUrl
|
301822
|
+
const personalAccessToken = (await getInstanceCredentials(instanceUrl))?.personalAccessToken;
|
301831
301823
|
const preferredToken = prefer === "application" ? applicationAccessToken : personalAccessToken;
|
301832
301824
|
const fallbackToken = prefer === "application" ? personalAccessToken : applicationAccessToken;
|
301833
301825
|
const allowFallback = prefer === "application";
|
@@ -303242,7 +303234,7 @@ var inputTheme = {
|
|
303242
303234
|
validationFailureMode: "keep"
|
303243
303235
|
};
|
303244
303236
|
var esm_default2 = createPrompt((config4, done) => {
|
303245
|
-
const { required: required4, validate: validate3 = () => true
|
303237
|
+
const { required: required4, validate: validate3 = () => true } = config4;
|
303246
303238
|
const theme = makeTheme(inputTheme, config4.theme);
|
303247
303239
|
const [status, setStatus] = useState("idle");
|
303248
303240
|
const [defaultValue = "", setDefaultValue] = useState(config4.default);
|
@@ -303282,12 +303274,6 @@ var esm_default2 = createPrompt((config4, done) => {
|
|
303282
303274
|
setError(undefined);
|
303283
303275
|
}
|
303284
303276
|
});
|
303285
|
-
useEffect((rl) => {
|
303286
|
-
if (prefill === "editable" && defaultValue) {
|
303287
|
-
rl.write(defaultValue);
|
303288
|
-
setValue(defaultValue);
|
303289
|
-
}
|
303290
|
-
}, []);
|
303291
303277
|
const message = theme.style.message(config4.message, status);
|
303292
303278
|
let formattedValue = value4;
|
303293
303279
|
if (typeof config4.transformer === "function") {
|
@@ -326502,9 +326488,6 @@ function addClusterServiceArgs(cmd2) {
|
|
326502
326488
|
// src/commands/platform/utils/wait-for-completion.ts
|
326503
326489
|
class TimeoutError2 extends Error {
|
326504
326490
|
}
|
326505
|
-
|
326506
|
-
class DeploymentFailedError extends Error {
|
326507
|
-
}
|
326508
326491
|
async function waitForCompletion({
|
326509
326492
|
settlemint,
|
326510
326493
|
type: type4,
|
@@ -326522,7 +326505,6 @@ async function waitForCompletion({
|
|
326522
326505
|
if (!service || !("read" in service)) {
|
326523
326506
|
throw new Error(`Service ${serviceType} does not support status checking`);
|
326524
326507
|
}
|
326525
|
-
let hasRestarted = false;
|
326526
326508
|
function showSpinner() {
|
326527
326509
|
return spinner({
|
326528
326510
|
startMessage: `Waiting for ${type4} to be ${getActionLabel(action)}`,
|
@@ -326535,7 +326517,8 @@ async function waitForCompletion({
|
|
326535
326517
|
if (resource.status === "FAILED") {
|
326536
326518
|
updateStatus(spinner2, `${capitalizeFirstLetter2(type4)} failed to ${getActionLabel(action)}`);
|
326537
326519
|
if (restartOnError) {
|
326538
|
-
|
326520
|
+
note(`Restarting ${capitalizeFirstLetter2(type4)}`);
|
326521
|
+
await service.restart(uniqueName);
|
326539
326522
|
}
|
326540
326523
|
return false;
|
326541
326524
|
}
|
@@ -326558,24 +326541,15 @@ async function waitForCompletion({
|
|
326558
326541
|
try {
|
326559
326542
|
return await showSpinner();
|
326560
326543
|
} catch (error45) {
|
326561
|
-
|
326544
|
+
const isTimeoutError = error45 instanceof SpinnerError && error45.originalError instanceof TimeoutError2;
|
326545
|
+
if (restartIfTimeout && isTimeoutError) {
|
326562
326546
|
note(`Restarting ${capitalizeFirstLetter2(type4)}`);
|
326563
|
-
hasRestarted = true;
|
326564
326547
|
await service.restart(uniqueName);
|
326565
326548
|
return showSpinner();
|
326566
326549
|
}
|
326567
326550
|
throw error45;
|
326568
326551
|
}
|
326569
326552
|
}
|
326570
|
-
function shouldRestart(error45, restartIfTimeout) {
|
326571
|
-
const isSpinnerError = error45 instanceof SpinnerError;
|
326572
|
-
const isDeploymentFailedError = error45 instanceof DeploymentFailedError || isSpinnerError && error45.originalError instanceof DeploymentFailedError;
|
326573
|
-
if (isDeploymentFailedError) {
|
326574
|
-
return true;
|
326575
|
-
}
|
326576
|
-
const isTimeoutError = error45 instanceof TimeoutError2 || isSpinnerError && error45.originalError instanceof TimeoutError2;
|
326577
|
-
return restartIfTimeout && isTimeoutError;
|
326578
|
-
}
|
326579
326553
|
function updateStatus(spinner2, message) {
|
326580
326554
|
if (spinner2) {
|
326581
326555
|
spinner2.text = message;
|
@@ -328322,11 +328296,6 @@ function blockscoutPauseCommand() {
|
|
328322
328296
|
});
|
328323
328297
|
}
|
328324
328298
|
|
328325
|
-
// src/commands/platform/insights/pause.ts
|
328326
|
-
function insightsPauseCommand() {
|
328327
|
-
return new Command("insights").alias("in").description("Pause an insights service in the SettleMint platform").addCommand(blockscoutPauseCommand());
|
328328
|
-
}
|
328329
|
-
|
328330
328299
|
// src/commands/platform/integration-tools/hasura/pause.ts
|
328331
328300
|
function hasuraPauseCommand() {
|
328332
328301
|
return getPauseCommand({
|
@@ -328340,13 +328309,8 @@ function hasuraPauseCommand() {
|
|
328340
328309
|
});
|
328341
328310
|
}
|
328342
328311
|
|
328343
|
-
// src/commands/platform/
|
328344
|
-
function
|
328345
|
-
return new Command("integration-tool").alias("it").description("Pause an integration tool service in the SettleMint platform").addCommand(hasuraPauseCommand());
|
328346
|
-
}
|
328347
|
-
|
328348
|
-
// src/commands/platform/load-balancer/pause.ts
|
328349
|
-
function loadBalancerPauseCommand() {
|
328312
|
+
// src/commands/platform/load-balancer/evm/pause.ts
|
328313
|
+
function evmLoadBalancerPauseCommand() {
|
328350
328314
|
return getPauseCommand({
|
328351
328315
|
name: "evm",
|
328352
328316
|
type: "load balancer",
|
@@ -328384,18 +328348,26 @@ function smartContractPortalMiddlewarePauseCommand() {
|
|
328384
328348
|
});
|
328385
328349
|
}
|
328386
328350
|
|
328387
|
-
// src/commands/platform/
|
328388
|
-
function
|
328389
|
-
return
|
328351
|
+
// src/commands/platform/private-key/accessible-ecdsa-p256/pause.ts
|
328352
|
+
function accessibleEcdsaP256PrivateKeyPauseCommand() {
|
328353
|
+
return getPauseCommand({
|
328354
|
+
name: "accessible-ecdsa-p256",
|
328355
|
+
type: "private key",
|
328356
|
+
alias: "acc",
|
328357
|
+
envKey: "SETTLEMINT_ACCESSIBLE_PRIVATE_KEY",
|
328358
|
+
pauseFunction: async (settlemint, id) => {
|
328359
|
+
return settlemint.privateKey.pause(id);
|
328360
|
+
}
|
328361
|
+
});
|
328390
328362
|
}
|
328391
328363
|
|
328392
|
-
// src/commands/platform/private-key/pause.ts
|
328393
|
-
function
|
328364
|
+
// src/commands/platform/private-key/hd-ecdsa-p256/pause.ts
|
328365
|
+
function hdEcdsaP256PrivateKeyPauseCommand() {
|
328394
328366
|
return getPauseCommand({
|
328395
|
-
name: "
|
328367
|
+
name: "hd-ecdsa-p256",
|
328396
328368
|
type: "private key",
|
328397
|
-
alias: "
|
328398
|
-
envKey: "
|
328369
|
+
alias: "hd",
|
328370
|
+
envKey: "SETTLEMINT_HD_PRIVATE_KEY",
|
328399
328371
|
pauseFunction: async (settlemint, id) => {
|
328400
328372
|
return settlemint.privateKey.pause(id);
|
328401
328373
|
}
|
@@ -328428,14 +328400,9 @@ function minioStoragePauseCommand() {
|
|
328428
328400
|
});
|
328429
328401
|
}
|
328430
328402
|
|
328431
|
-
// src/commands/platform/storage/pause.ts
|
328432
|
-
function storagePauseCommand() {
|
328433
|
-
return new Command("storage").alias("st").description("Pause a storage service in the SettleMint platform").addCommand(ipfsStoragePauseCommand()).addCommand(minioStoragePauseCommand());
|
328434
|
-
}
|
328435
|
-
|
328436
328403
|
// src/commands/platform/pause.ts
|
328437
328404
|
function pauseCommand() {
|
328438
|
-
const cmd2 = new Command("pause").description("Pause a resource in the SettleMint platform").addCommand(blockchainNodePauseCommand()).addCommand(blockchainNetworkPauseCommand()).addCommand(customDeploymentPauseCommand()).addCommand(
|
328405
|
+
const cmd2 = new Command("pause").description("Pause a resource in the SettleMint platform").addCommand(blockchainNodePauseCommand()).addCommand(blockchainNetworkPauseCommand()).addCommand(customDeploymentPauseCommand()).addCommand(blockscoutPauseCommand()).addCommand(hasuraPauseCommand()).addCommand(evmLoadBalancerPauseCommand()).addCommand(graphMiddlewarePauseCommand()).addCommand(smartContractPortalMiddlewarePauseCommand()).addCommand(accessibleEcdsaP256PrivateKeyPauseCommand()).addCommand(hdEcdsaP256PrivateKeyPauseCommand()).addCommand(ipfsStoragePauseCommand()).addCommand(minioStoragePauseCommand());
|
328439
328406
|
return cmd2;
|
328440
328407
|
}
|
328441
328408
|
|
@@ -328770,11 +328737,6 @@ function blockscoutResumeCommand() {
|
|
328770
328737
|
});
|
328771
328738
|
}
|
328772
328739
|
|
328773
|
-
// src/commands/platform/insights/resume.ts
|
328774
|
-
function insightsResumeCommand() {
|
328775
|
-
return new Command("insights").alias("in").description("Resume an insights service in the SettleMint platform").addCommand(blockscoutResumeCommand());
|
328776
|
-
}
|
328777
|
-
|
328778
328740
|
// src/commands/platform/integration-tools/hasura/resume.ts
|
328779
328741
|
function hasuraResumeCommand() {
|
328780
328742
|
return getResumeCommand({
|
@@ -328788,15 +328750,10 @@ function hasuraResumeCommand() {
|
|
328788
328750
|
});
|
328789
328751
|
}
|
328790
328752
|
|
328791
|
-
// src/commands/platform/
|
328792
|
-
function
|
328793
|
-
return new Command("integration-tool").alias("it").description("Resume an integration tool service in the SettleMint platform").addCommand(hasuraResumeCommand());
|
328794
|
-
}
|
328795
|
-
|
328796
|
-
// src/commands/platform/load-balancer/resume.ts
|
328797
|
-
function loadBalancerResumeCommand() {
|
328753
|
+
// src/commands/platform/load-balancer/evm/resume.ts
|
328754
|
+
function evmLoadBalancerResumeCommand() {
|
328798
328755
|
return getResumeCommand({
|
328799
|
-
name: "
|
328756
|
+
name: "evm",
|
328800
328757
|
type: "load balancer",
|
328801
328758
|
alias: "lb",
|
328802
328759
|
envKey: "SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER",
|
@@ -328832,18 +328789,26 @@ function smartContractPortalMiddlewareResumeCommand() {
|
|
328832
328789
|
});
|
328833
328790
|
}
|
328834
328791
|
|
328835
|
-
// src/commands/platform/
|
328836
|
-
function
|
328837
|
-
return
|
328792
|
+
// src/commands/platform/private-key/accessible-ecdsa-p256/resume.ts
|
328793
|
+
function accessibleEcdsaP256PrivateKeyResumeCommand() {
|
328794
|
+
return getResumeCommand({
|
328795
|
+
name: "accessible-ecdsa-p256",
|
328796
|
+
type: "private key",
|
328797
|
+
alias: "acc",
|
328798
|
+
envKey: "SETTLEMINT_ACCESSIBLE_PRIVATE_KEY",
|
328799
|
+
resumeFunction: async (settlemint, id) => {
|
328800
|
+
return settlemint.privateKey.resume(id);
|
328801
|
+
}
|
328802
|
+
});
|
328838
328803
|
}
|
328839
328804
|
|
328840
|
-
// src/commands/platform/private-key/resume.ts
|
328841
|
-
function
|
328805
|
+
// src/commands/platform/private-key/hd-ecdsa-p256/resume.ts
|
328806
|
+
function hdEcdsaP256PrivateKeyResumeCommand() {
|
328842
328807
|
return getResumeCommand({
|
328843
|
-
name: "
|
328808
|
+
name: "hd-ecdsa-p256",
|
328844
328809
|
type: "private key",
|
328845
|
-
alias: "
|
328846
|
-
envKey: "
|
328810
|
+
alias: "hd",
|
328811
|
+
envKey: "SETTLEMINT_HD_PRIVATE_KEY",
|
328847
328812
|
resumeFunction: async (settlemint, id) => {
|
328848
328813
|
return settlemint.privateKey.resume(id);
|
328849
328814
|
}
|
@@ -328876,14 +328841,9 @@ function minioStorageResumeCommand() {
|
|
328876
328841
|
});
|
328877
328842
|
}
|
328878
328843
|
|
328879
|
-
// src/commands/platform/storage/resume.ts
|
328880
|
-
function storageResumeCommand() {
|
328881
|
-
return new Command("storage").alias("st").description("Resume a storage service in the SettleMint platform").addCommand(ipfsStorageResumeCommand()).addCommand(minioStorageResumeCommand());
|
328882
|
-
}
|
328883
|
-
|
328884
328844
|
// src/commands/platform/resume.ts
|
328885
328845
|
function resumeCommand() {
|
328886
|
-
const cmd2 = new Command("resume").description("Resume a resource in the SettleMint platform").addCommand(blockchainNodeResumeCommand()).addCommand(blockchainNetworkResumeCommand()).addCommand(customDeploymentResumeCommand()).addCommand(
|
328846
|
+
const cmd2 = new Command("resume").description("Resume a resource in the SettleMint platform").addCommand(blockchainNodeResumeCommand()).addCommand(blockchainNetworkResumeCommand()).addCommand(customDeploymentResumeCommand()).addCommand(blockscoutResumeCommand()).addCommand(hasuraResumeCommand()).addCommand(evmLoadBalancerResumeCommand()).addCommand(graphMiddlewareResumeCommand()).addCommand(smartContractPortalMiddlewareResumeCommand()).addCommand(accessibleEcdsaP256PrivateKeyResumeCommand()).addCommand(hdEcdsaP256PrivateKeyResumeCommand()).addCommand(ipfsStorageResumeCommand()).addCommand(minioStorageResumeCommand());
|
328887
328847
|
return cmd2;
|
328888
328848
|
}
|
328889
328849
|
|
@@ -330808,4 +330768,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
330808
330768
|
// src/cli.ts
|
330809
330769
|
sdkCliCommand();
|
330810
330770
|
|
330811
|
-
//# debugId=
|
330771
|
+
//# debugId=D64C4256BE37E01264756E2164756E21
|