@settlemint/sdk-cli 2.4.0-pr3f71e882 → 2.4.0-pr3fd1ae9a
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 +146 -119
- package/dist/cli.js.map +44 -38
- 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-pr3fd1ae9a",
|
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.13",
|
263891
|
+
"@inquirer/input": "4.2.0",
|
263892
|
+
"@inquirer/password": "4.0.16",
|
263893
|
+
"@inquirer/select": "4.2.4",
|
263894
|
+
"@settlemint/sdk-js": "2.4.0-pr3fd1ae9a",
|
263895
|
+
"@settlemint/sdk-utils": "2.4.0-pr3fd1ae9a",
|
263896
|
+
"@settlemint/sdk-viem": "2.4.0-pr3fd1ae9a",
|
263897
|
+
"@types/node": "24.0.10",
|
263898
263898
|
"@types/semver": "7.7.0",
|
263899
263899
|
"@types/which": "3.0.4",
|
263900
263900
|
"get-tsconfig": "4.10.1",
|
@@ -287954,8 +287954,9 @@ 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
|
+
}
|
287959
287960
|
return acc;
|
287960
287961
|
}, []);
|
287961
287962
|
return allWorkspaces.sort((a3, b) => a3.name.localeCompare(b.name));
|
@@ -287982,8 +287983,9 @@ var workspaceDelete = (gqlClient) => {
|
|
287982
287983
|
var workspaceAddCredits = (gqlClient) => {
|
287983
287984
|
return async (workspaceId, amount) => {
|
287984
287985
|
const id = validate2(IdSchema2, workspaceId);
|
287985
|
-
if (amount <= 0)
|
287986
|
+
if (amount <= 0) {
|
287986
287987
|
throw new Error("Credit amount must be a positive number");
|
287988
|
+
}
|
287987
287989
|
const { addCredits: result } = await gqlClient.request(addCredits, {
|
287988
287990
|
workspaceId: id,
|
287989
287991
|
amount
|
@@ -288105,8 +288107,9 @@ var applicationAccessTokenCreate = (gqlClient) => {
|
|
288105
288107
|
...otherArgs,
|
288106
288108
|
applicationId: application.id
|
288107
288109
|
});
|
288108
|
-
if (!applicationAccessToken.token)
|
288110
|
+
if (!applicationAccessToken.token) {
|
288109
288111
|
throw new Error("Failed to create application access token");
|
288112
|
+
}
|
288110
288113
|
return applicationAccessToken.token;
|
288111
288114
|
};
|
288112
288115
|
};
|
@@ -288119,7 +288122,7 @@ function setClusterServiceDefaults(args) {
|
|
288119
288122
|
}
|
288120
288123
|
function setNetworkDefaults(args) {
|
288121
288124
|
const clusterServiceArgs = setClusterServiceDefaults(args);
|
288122
|
-
if (args.consensusAlgorithm === "BESU_QBFT")
|
288125
|
+
if (args.consensusAlgorithm === "BESU_QBFT") {
|
288123
288126
|
return {
|
288124
288127
|
...clusterServiceArgs,
|
288125
288128
|
chainId: args.chainId ?? 46040,
|
@@ -288129,6 +288132,7 @@ function setNetworkDefaults(args) {
|
|
288129
288132
|
gasPrice: args.gasPrice ?? 0,
|
288130
288133
|
secondsPerBlock: args.secondsPerBlock ?? 2
|
288131
288134
|
};
|
288135
|
+
}
|
288132
288136
|
return clusterServiceArgs;
|
288133
288137
|
}
|
288134
288138
|
var BlockchainNetworkFragment = graphql(`
|
@@ -289543,26 +289547,30 @@ async function getPincodeVerificationChallenges({ userWalletAddress, accessToken
|
|
289543
289547
|
}
|
289544
289548
|
});
|
289545
289549
|
if (!response.ok) {
|
289546
|
-
if (response.status === 404)
|
289550
|
+
if (response.status === 404) {
|
289547
289551
|
throw new Error(`No user wallet found with address '${userWalletAddress}' for node '${nodeId}'`);
|
289552
|
+
}
|
289548
289553
|
throw new Error("Failed to get verification challenge");
|
289549
289554
|
}
|
289550
289555
|
const verificationChallenges = await response.json();
|
289551
289556
|
return verificationChallenges;
|
289552
289557
|
}
|
289553
289558
|
function getPincodeVerificationChallengeResponse({ verificationChallenge, pincode }) {
|
289554
|
-
if (!verificationChallenge?.challenge?.secret || !verificationChallenge?.challenge?.salt)
|
289559
|
+
if (!verificationChallenge?.challenge?.secret || !verificationChallenge?.challenge?.salt) {
|
289555
289560
|
throw new Error("Could not authenticate pin code, invalid challenge format");
|
289561
|
+
}
|
289556
289562
|
const { secret, salt } = verificationChallenge.challenge;
|
289557
289563
|
return generateResponse(pincode, salt, secret);
|
289558
289564
|
}
|
289559
289565
|
function createSettleMintClient(options) {
|
289560
289566
|
ensureServer();
|
289561
|
-
if (options.instance === STANDALONE_INSTANCE2 || options.instance === LOCAL_INSTANCE2)
|
289562
|
-
if (options.anonymous)
|
289567
|
+
if (options.instance === STANDALONE_INSTANCE2 || options.instance === LOCAL_INSTANCE2) {
|
289568
|
+
if (options.anonymous) {
|
289563
289569
|
options.instance = "https://console.settlemint.com";
|
289564
|
-
else
|
289570
|
+
} else {
|
289565
289571
|
throw new Error("Standalone and local instances cannot connect to the SettleMint platform");
|
289572
|
+
}
|
289573
|
+
}
|
289566
289574
|
const validatedOptions = options.anonymous ? validate2(exports_external.object({
|
289567
289575
|
...ClientOptionsSchema.shape,
|
289568
289576
|
accessToken: exports_external.literal("")
|
@@ -303234,7 +303242,7 @@ var inputTheme = {
|
|
303234
303242
|
validationFailureMode: "keep"
|
303235
303243
|
};
|
303236
303244
|
var esm_default2 = createPrompt((config4, done) => {
|
303237
|
-
const { required: required4, validate: validate3 = () => true } = config4;
|
303245
|
+
const { required: required4, validate: validate3 = () => true, prefill = "tab" } = config4;
|
303238
303246
|
const theme = makeTheme(inputTheme, config4.theme);
|
303239
303247
|
const [status, setStatus] = useState("idle");
|
303240
303248
|
const [defaultValue = "", setDefaultValue] = useState(config4.default);
|
@@ -303274,6 +303282,12 @@ var esm_default2 = createPrompt((config4, done) => {
|
|
303274
303282
|
setError(undefined);
|
303275
303283
|
}
|
303276
303284
|
});
|
303285
|
+
useEffect((rl) => {
|
303286
|
+
if (prefill === "editable" && defaultValue) {
|
303287
|
+
rl.write(defaultValue);
|
303288
|
+
setValue(defaultValue);
|
303289
|
+
}
|
303290
|
+
}, []);
|
303277
303291
|
const message = theme.style.message(config4.message, status);
|
303278
303292
|
let formattedValue = value4;
|
303279
303293
|
if (typeof config4.transformer === "function") {
|
@@ -326488,13 +326502,17 @@ function addClusterServiceArgs(cmd2) {
|
|
326488
326502
|
// src/commands/platform/utils/wait-for-completion.ts
|
326489
326503
|
class TimeoutError2 extends Error {
|
326490
326504
|
}
|
326505
|
+
|
326506
|
+
class DeploymentFailedError extends Error {
|
326507
|
+
}
|
326491
326508
|
async function waitForCompletion({
|
326492
326509
|
settlemint,
|
326493
326510
|
type: type4,
|
326494
326511
|
uniqueName,
|
326495
326512
|
action,
|
326496
326513
|
maxTimeout = 10 * 60 * 1000,
|
326497
|
-
restartIfTimeout = false
|
326514
|
+
restartIfTimeout = false,
|
326515
|
+
restartOnError = false
|
326498
326516
|
}) {
|
326499
326517
|
const serviceType = SETTLEMINT_CLIENT_MAP[type4];
|
326500
326518
|
if (serviceType === "workspace" || serviceType === "application" || serviceType === "foundry" || serviceType === "applicationAccessToken" || serviceType === "platform" || serviceType === "wallet") {
|
@@ -326504,26 +326522,7 @@ async function waitForCompletion({
|
|
326504
326522
|
if (!service || !("read" in service)) {
|
326505
326523
|
throw new Error(`Service ${serviceType} does not support status checking`);
|
326506
326524
|
}
|
326507
|
-
|
326508
|
-
if (spinner2) {
|
326509
|
-
spinner2.text = message;
|
326510
|
-
} else {
|
326511
|
-
note(message);
|
326512
|
-
}
|
326513
|
-
}
|
326514
|
-
function isActionComplete(action2, status) {
|
326515
|
-
switch (action2) {
|
326516
|
-
case "pause":
|
326517
|
-
return status === "PAUSED" || status === "AUTO_PAUSED";
|
326518
|
-
case "resume":
|
326519
|
-
case "deploy":
|
326520
|
-
case "destroy":
|
326521
|
-
case "restart":
|
326522
|
-
return status === "COMPLETED";
|
326523
|
-
default:
|
326524
|
-
return false;
|
326525
|
-
}
|
326526
|
-
}
|
326525
|
+
let hasRestarted = false;
|
326527
326526
|
function showSpinner() {
|
326528
326527
|
return spinner({
|
326529
326528
|
startMessage: `Waiting for ${type4} to be ${getActionLabel(action)}`,
|
@@ -326535,6 +326534,9 @@ async function waitForCompletion({
|
|
326535
326534
|
const resource = await service.read(uniqueName);
|
326536
326535
|
if (resource.status === "FAILED") {
|
326537
326536
|
updateStatus(spinner2, `${capitalizeFirstLetter2(type4)} failed to ${getActionLabel(action)}`);
|
326537
|
+
if (restartOnError) {
|
326538
|
+
throw new DeploymentFailedError;
|
326539
|
+
}
|
326538
326540
|
return false;
|
326539
326541
|
}
|
326540
326542
|
if (isActionComplete(action, resource.status)) {
|
@@ -326556,15 +326558,44 @@ async function waitForCompletion({
|
|
326556
326558
|
try {
|
326557
326559
|
return await showSpinner();
|
326558
326560
|
} catch (error45) {
|
326559
|
-
|
326560
|
-
if (restartIfTimeout && isTimeoutError) {
|
326561
|
+
if (!hasRestarted && shouldRestart(error45, restartIfTimeout)) {
|
326561
326562
|
note(`Restarting ${capitalizeFirstLetter2(type4)}`);
|
326563
|
+
hasRestarted = true;
|
326562
326564
|
await service.restart(uniqueName);
|
326563
326565
|
return showSpinner();
|
326564
326566
|
}
|
326565
326567
|
throw error45;
|
326566
326568
|
}
|
326567
326569
|
}
|
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
|
+
function updateStatus(spinner2, message) {
|
326580
|
+
if (spinner2) {
|
326581
|
+
spinner2.text = message;
|
326582
|
+
} else {
|
326583
|
+
note(message);
|
326584
|
+
}
|
326585
|
+
}
|
326586
|
+
function isActionComplete(action, status) {
|
326587
|
+
switch (action) {
|
326588
|
+
case "pause":
|
326589
|
+
return status === "PAUSED" || status === "AUTO_PAUSED";
|
326590
|
+
case "resume":
|
326591
|
+
case "deploy":
|
326592
|
+
case "destroy":
|
326593
|
+
case "restart":
|
326594
|
+
return status === "COMPLETED";
|
326595
|
+
default:
|
326596
|
+
return false;
|
326597
|
+
}
|
326598
|
+
}
|
326568
326599
|
function getActionLabel(action) {
|
326569
326600
|
switch (action) {
|
326570
326601
|
case "restart":
|
@@ -326660,9 +326691,9 @@ function getCreateCommand({
|
|
326660
326691
|
cmd2.alias(alias);
|
326661
326692
|
}
|
326662
326693
|
if (requiresDeployment) {
|
326663
|
-
cmd2.option("-w, --wait", "Wait until deployed").option("
|
326694
|
+
cmd2.option("-w, --wait", "Wait until deployed").option("--restart-if-timeout", "Restart if wait time is exceeded").option("--restart-on-error", "Restart if deployment fails");
|
326664
326695
|
}
|
326665
|
-
execute2(cmd2, async ({ acceptDefaults, prod, default: isDefault, wait: wait2, restartIfTimeout, provider, region }, createFunction) => {
|
326696
|
+
execute2(cmd2, async ({ acceptDefaults, prod, default: isDefault, wait: wait2, restartIfTimeout, restartOnError, provider, region }, createFunction) => {
|
326666
326697
|
intro(`Creating ${type4} in the SettleMint platform`);
|
326667
326698
|
const env2 = await loadEnv(false, !!prod);
|
326668
326699
|
const instance = await instancePrompt({ env: env2, accept: acceptDefaults });
|
@@ -326706,7 +326737,8 @@ function getCreateCommand({
|
|
326706
326737
|
type: waitFor?.resourceType ?? type4,
|
326707
326738
|
uniqueName: waitFor?.uniqueName ?? result.uniqueName,
|
326708
326739
|
action: "deploy",
|
326709
|
-
restartIfTimeout
|
326740
|
+
restartIfTimeout,
|
326741
|
+
restartOnError
|
326710
326742
|
});
|
326711
326743
|
if (!isDeployed) {
|
326712
326744
|
throw new Error(`Failed to deploy ${waitFor?.resourceType ?? type4} ${waitFor?.uniqueName ?? result.uniqueName}`);
|
@@ -328181,21 +328213,22 @@ function deleteCommand() {
|
|
328181
328213
|
function getPauseCommand({
|
328182
328214
|
name: name3,
|
328183
328215
|
type: type4,
|
328184
|
-
subType,
|
328185
328216
|
alias,
|
328186
328217
|
envKey,
|
328187
328218
|
pauseFunction,
|
328188
328219
|
usePersonalAccessToken = true
|
328189
328220
|
}) {
|
328190
328221
|
const commandName = sanitizeCommandName(name3);
|
328222
|
+
const typeCommandName = sanitizeCommandName(type4);
|
328223
|
+
const exampleCommandPrefix = `platform pause ${typeCommandName !== commandName ? `${typeCommandName} ` : ""}${commandName}`;
|
328191
328224
|
return new Command(commandName).alias(alias).description(`Pause a ${type4} in the SettleMint platform. Provide the ${type4} unique name or use 'default' to pause the default ${type4} from your .env file.`).usage(createExamples([
|
328192
328225
|
{
|
328193
328226
|
description: `Pauses the specified ${type4} by unique name`,
|
328194
|
-
command:
|
328227
|
+
command: `${exampleCommandPrefix} <unique-name>`
|
328195
328228
|
},
|
328196
328229
|
{
|
328197
328230
|
description: `Pauses the default ${type4} in the production environment`,
|
328198
|
-
command:
|
328231
|
+
command: `${exampleCommandPrefix} default --prod`
|
328199
328232
|
}
|
328200
328233
|
])).argument("<unique-name>", `The unique name of the ${type4}, use 'default' to pause 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 paused").action(async (uniqueName, { acceptDefaults, prod, wait: wait2 }) => {
|
328201
328234
|
intro(`Pausing ${type4} in the SettleMint platform`);
|
@@ -328281,7 +328314,6 @@ function blockscoutPauseCommand() {
|
|
328281
328314
|
return getPauseCommand({
|
328282
328315
|
name: "blockscout",
|
328283
328316
|
type: "insights",
|
328284
|
-
subType: "blockscout",
|
328285
328317
|
alias: "bs",
|
328286
328318
|
envKey: "SETTLEMINT_BLOCKSCOUT",
|
328287
328319
|
pauseFunction: async (settlemint, id) => {
|
@@ -328290,12 +328322,16 @@ function blockscoutPauseCommand() {
|
|
328290
328322
|
});
|
328291
328323
|
}
|
328292
328324
|
|
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
|
+
|
328293
328330
|
// src/commands/platform/integration-tools/hasura/pause.ts
|
328294
328331
|
function hasuraPauseCommand() {
|
328295
328332
|
return getPauseCommand({
|
328296
328333
|
name: "hasura",
|
328297
328334
|
type: "integration tool",
|
328298
|
-
subType: "hasura",
|
328299
328335
|
alias: "ha",
|
328300
328336
|
envKey: "SETTLEMINT_HASURA",
|
328301
328337
|
pauseFunction: async (settlemint, id) => {
|
@@ -328304,12 +328340,16 @@ function hasuraPauseCommand() {
|
|
328304
328340
|
});
|
328305
328341
|
}
|
328306
328342
|
|
328307
|
-
// src/commands/platform/
|
328308
|
-
function
|
328343
|
+
// src/commands/platform/integration-tools/pause.ts
|
328344
|
+
function integrationToolPauseCommand() {
|
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() {
|
328309
328350
|
return getPauseCommand({
|
328310
328351
|
name: "evm",
|
328311
328352
|
type: "load balancer",
|
328312
|
-
subType: "evm",
|
328313
328353
|
alias: "lb",
|
328314
328354
|
envKey: "SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER",
|
328315
328355
|
pauseFunction: async (settlemint, id) => {
|
@@ -328323,7 +328363,6 @@ function graphMiddlewarePauseCommand() {
|
|
328323
328363
|
return getPauseCommand({
|
328324
328364
|
name: "graph",
|
328325
328365
|
type: "middleware",
|
328326
|
-
subType: "graph",
|
328327
328366
|
alias: "gr",
|
328328
328367
|
envKey: "SETTLEMINT_THEGRAPH",
|
328329
328368
|
pauseFunction: async (settlemint, id) => {
|
@@ -328337,7 +328376,6 @@ function smartContractPortalMiddlewarePauseCommand() {
|
|
328337
328376
|
return getPauseCommand({
|
328338
328377
|
name: "smart-contract-portal",
|
328339
328378
|
type: "middleware",
|
328340
|
-
subType: "smart-contract-portal",
|
328341
328379
|
alias: "scp",
|
328342
328380
|
envKey: "SETTLEMINT_PORTAL",
|
328343
328381
|
pauseFunction: async (settlemint, id) => {
|
@@ -328346,28 +328384,18 @@ function smartContractPortalMiddlewarePauseCommand() {
|
|
328346
328384
|
});
|
328347
328385
|
}
|
328348
328386
|
|
328349
|
-
// src/commands/platform/
|
328350
|
-
function
|
328351
|
-
return
|
328352
|
-
name: "accessible-ecdsa-p256",
|
328353
|
-
type: "private key",
|
328354
|
-
subType: "accessible-ecdsa-p256",
|
328355
|
-
alias: "acc",
|
328356
|
-
envKey: "SETTLEMINT_ACCESSIBLE_PRIVATE_KEY",
|
328357
|
-
pauseFunction: async (settlemint, id) => {
|
328358
|
-
return settlemint.privateKey.pause(id);
|
328359
|
-
}
|
328360
|
-
});
|
328387
|
+
// src/commands/platform/middleware/pause.ts
|
328388
|
+
function middlewarePauseCommand() {
|
328389
|
+
return new Command("middleware").alias("mw").description("Pause a middleware service in the SettleMint platform").addCommand(graphMiddlewarePauseCommand()).addCommand(smartContractPortalMiddlewarePauseCommand());
|
328361
328390
|
}
|
328362
328391
|
|
328363
|
-
// src/commands/platform/private-key/
|
328364
|
-
function
|
328392
|
+
// src/commands/platform/private-key/pause.ts
|
328393
|
+
function privateKeyPauseCommand() {
|
328365
328394
|
return getPauseCommand({
|
328366
|
-
name: "
|
328395
|
+
name: "private-key",
|
328367
328396
|
type: "private key",
|
328368
|
-
|
328369
|
-
|
328370
|
-
envKey: "SETTLEMINT_HD_PRIVATE_KEY",
|
328397
|
+
alias: "pk",
|
328398
|
+
envKey: "SETTLEMINT_ACCESSIBLE_PRIVATE_KEY",
|
328371
328399
|
pauseFunction: async (settlemint, id) => {
|
328372
328400
|
return settlemint.privateKey.pause(id);
|
328373
328401
|
}
|
@@ -328379,7 +328407,6 @@ function ipfsStoragePauseCommand() {
|
|
328379
328407
|
return getPauseCommand({
|
328380
328408
|
name: "ipfs",
|
328381
328409
|
type: "storage",
|
328382
|
-
subType: "ipfs",
|
328383
328410
|
alias: "ip",
|
328384
328411
|
envKey: "SETTLEMINT_IPFS",
|
328385
328412
|
pauseFunction: async (settlemint, id) => {
|
@@ -328393,7 +328420,6 @@ function minioStoragePauseCommand() {
|
|
328393
328420
|
return getPauseCommand({
|
328394
328421
|
name: "minio",
|
328395
328422
|
type: "storage",
|
328396
|
-
subType: "minio",
|
328397
328423
|
alias: "m",
|
328398
328424
|
envKey: "SETTLEMINT_MINIO",
|
328399
328425
|
pauseFunction: async (settlemint, id) => {
|
@@ -328402,9 +328428,14 @@ function minioStoragePauseCommand() {
|
|
328402
328428
|
});
|
328403
328429
|
}
|
328404
328430
|
|
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
|
+
|
328405
328436
|
// src/commands/platform/pause.ts
|
328406
328437
|
function pauseCommand() {
|
328407
|
-
const cmd2 = new Command("pause").description("Pause a resource in the SettleMint platform").addCommand(blockchainNodePauseCommand()).addCommand(blockchainNetworkPauseCommand()).addCommand(customDeploymentPauseCommand()).addCommand(
|
328438
|
+
const cmd2 = new Command("pause").description("Pause a resource in the SettleMint platform").addCommand(blockchainNodePauseCommand()).addCommand(blockchainNetworkPauseCommand()).addCommand(customDeploymentPauseCommand()).addCommand(insightsPauseCommand()).addCommand(integrationToolPauseCommand()).addCommand(loadBalancerPauseCommand()).addCommand(middlewarePauseCommand()).addCommand(privateKeyPauseCommand()).addCommand(storagePauseCommand());
|
328408
328439
|
return cmd2;
|
328409
328440
|
}
|
328410
328441
|
|
@@ -328412,21 +328443,22 @@ function pauseCommand() {
|
|
328412
328443
|
function getRestartCommand({
|
328413
328444
|
name: name3,
|
328414
328445
|
type: type4,
|
328415
|
-
subType,
|
328416
328446
|
alias,
|
328417
328447
|
envKey,
|
328418
328448
|
restartFunction,
|
328419
328449
|
usePersonalAccessToken = true
|
328420
328450
|
}) {
|
328421
328451
|
const commandName = sanitizeCommandName(name3);
|
328452
|
+
const typeCommandName = sanitizeCommandName(type4);
|
328453
|
+
const exampleCommandPrefix = `platform restart ${typeCommandName !== commandName ? `${typeCommandName} ` : ""}${commandName}`;
|
328422
328454
|
return new Command(commandName).alias(alias).description(`Restart a ${type4} in the SettleMint platform. Provide the ${type4} unique name or use 'default' to restart the default ${type4} from your .env file.`).usage(createExamples([
|
328423
328455
|
{
|
328424
328456
|
description: `Restarts the specified ${type4} by unique name`,
|
328425
|
-
command:
|
328457
|
+
command: `${exampleCommandPrefix} <unique-name>`
|
328426
328458
|
},
|
328427
328459
|
{
|
328428
328460
|
description: `Restarts the default ${type4} in the production environment`,
|
328429
|
-
command:
|
328461
|
+
command: `${exampleCommandPrefix} default --prod`
|
328430
328462
|
}
|
328431
328463
|
])).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 }) => {
|
328432
328464
|
intro(`Restarting ${type4} in the SettleMint platform`);
|
@@ -328513,7 +328545,6 @@ function blockscoutRestartCommand() {
|
|
328513
328545
|
return getRestartCommand({
|
328514
328546
|
name: "blockscout",
|
328515
328547
|
type: "insights",
|
328516
|
-
subType: "blockscout",
|
328517
328548
|
alias: "bs",
|
328518
328549
|
envKey: "SETTLEMINT_BLOCKSCOUT",
|
328519
328550
|
restartFunction: async (settlemint, uniqueName) => {
|
@@ -328532,7 +328563,6 @@ function hasuraRestartCommand() {
|
|
328532
328563
|
return getRestartCommand({
|
328533
328564
|
name: "hasura",
|
328534
328565
|
type: "integration tool",
|
328535
|
-
subType: "hasura",
|
328536
328566
|
alias: "ha",
|
328537
328567
|
envKey: "SETTLEMINT_HASURA",
|
328538
328568
|
restartFunction: async (settlemint, uniqueName) => {
|
@@ -328564,7 +328594,6 @@ function graphRestartCommand() {
|
|
328564
328594
|
return getRestartCommand({
|
328565
328595
|
name: "graph",
|
328566
328596
|
type: "middleware",
|
328567
|
-
subType: "graph",
|
328568
328597
|
alias: "gr",
|
328569
328598
|
envKey: "SETTLEMINT_THEGRAPH",
|
328570
328599
|
restartFunction: async (settlemint, id) => {
|
@@ -328578,7 +328607,6 @@ function smartContractPortalRestartCommand() {
|
|
328578
328607
|
return getRestartCommand({
|
328579
328608
|
name: "smart-contract-portal",
|
328580
328609
|
type: "middleware",
|
328581
|
-
subType: "smart-contract-portal",
|
328582
328610
|
alias: "scp",
|
328583
328611
|
envKey: "SETTLEMINT_PORTAL",
|
328584
328612
|
restartFunction: async (settlemint, uniqueName) => {
|
@@ -328633,21 +328661,22 @@ function restartCommand() {
|
|
328633
328661
|
function getResumeCommand({
|
328634
328662
|
name: name3,
|
328635
328663
|
type: type4,
|
328636
|
-
subType,
|
328637
328664
|
alias,
|
328638
328665
|
envKey,
|
328639
328666
|
resumeFunction,
|
328640
328667
|
usePersonalAccessToken = true
|
328641
328668
|
}) {
|
328642
328669
|
const commandName = sanitizeCommandName(name3);
|
328670
|
+
const typeCommandName = sanitizeCommandName(type4);
|
328671
|
+
const exampleCommandPrefix = `platform resume ${typeCommandName !== commandName ? `${typeCommandName} ` : ""}${commandName}`;
|
328643
328672
|
return new Command(commandName).alias(alias).description(`Resume a ${type4} in the SettleMint platform. Provide the ${type4} unique name or use 'default' to resume the default ${type4} from your .env file.`).usage(createExamples([
|
328644
328673
|
{
|
328645
328674
|
description: `Resumes the specified ${type4} by unique name`,
|
328646
|
-
command:
|
328675
|
+
command: `${exampleCommandPrefix} <unique-name>`
|
328647
328676
|
},
|
328648
328677
|
{
|
328649
328678
|
description: `Resumes the default ${type4} in the production environment`,
|
328650
|
-
command:
|
328679
|
+
command: `${exampleCommandPrefix} default --prod`
|
328651
328680
|
}
|
328652
328681
|
])).argument("<unique-name>", `The unique name of the ${type4}, use 'default' to resume 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 resumed").action(async (uniqueName, { acceptDefaults, prod, wait: wait2 }) => {
|
328653
328682
|
intro(`Resuming ${type4} in the SettleMint platform`);
|
@@ -328733,7 +328762,6 @@ function blockscoutResumeCommand() {
|
|
328733
328762
|
return getResumeCommand({
|
328734
328763
|
name: "blockscout",
|
328735
328764
|
type: "insights",
|
328736
|
-
subType: "blockscout",
|
328737
328765
|
alias: "bs",
|
328738
328766
|
envKey: "SETTLEMINT_BLOCKSCOUT",
|
328739
328767
|
resumeFunction: async (settlemint, id) => {
|
@@ -328742,12 +328770,16 @@ function blockscoutResumeCommand() {
|
|
328742
328770
|
});
|
328743
328771
|
}
|
328744
328772
|
|
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
|
+
|
328745
328778
|
// src/commands/platform/integration-tools/hasura/resume.ts
|
328746
328779
|
function hasuraResumeCommand() {
|
328747
328780
|
return getResumeCommand({
|
328748
328781
|
name: "hasura",
|
328749
328782
|
type: "integration tool",
|
328750
|
-
subType: "hasura",
|
328751
328783
|
alias: "ha",
|
328752
328784
|
envKey: "SETTLEMINT_HASURA",
|
328753
328785
|
resumeFunction: async (settlemint, id) => {
|
@@ -328756,12 +328788,16 @@ function hasuraResumeCommand() {
|
|
328756
328788
|
});
|
328757
328789
|
}
|
328758
328790
|
|
328759
|
-
// src/commands/platform/
|
328760
|
-
function
|
328791
|
+
// src/commands/platform/integration-tools/resume.ts
|
328792
|
+
function integrationToolResumeCommand() {
|
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() {
|
328761
328798
|
return getResumeCommand({
|
328762
|
-
name: "
|
328799
|
+
name: "load-balancer",
|
328763
328800
|
type: "load balancer",
|
328764
|
-
subType: "evm",
|
328765
328801
|
alias: "lb",
|
328766
328802
|
envKey: "SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER",
|
328767
328803
|
resumeFunction: async (settlemint, id) => {
|
@@ -328775,7 +328811,6 @@ function graphMiddlewareResumeCommand() {
|
|
328775
328811
|
return getResumeCommand({
|
328776
328812
|
name: "graph",
|
328777
328813
|
type: "middleware",
|
328778
|
-
subType: "graph",
|
328779
328814
|
alias: "gr",
|
328780
328815
|
envKey: "SETTLEMINT_THEGRAPH",
|
328781
328816
|
resumeFunction: async (settlemint, id) => {
|
@@ -328789,7 +328824,6 @@ function smartContractPortalMiddlewareResumeCommand() {
|
|
328789
328824
|
return getResumeCommand({
|
328790
328825
|
name: "smart-contract-portal",
|
328791
328826
|
type: "middleware",
|
328792
|
-
subType: "smart-contract-portal",
|
328793
328827
|
alias: "scp",
|
328794
328828
|
envKey: "SETTLEMINT_PORTAL",
|
328795
328829
|
resumeFunction: async (settlemint, id) => {
|
@@ -328798,28 +328832,18 @@ function smartContractPortalMiddlewareResumeCommand() {
|
|
328798
328832
|
});
|
328799
328833
|
}
|
328800
328834
|
|
328801
|
-
// src/commands/platform/
|
328802
|
-
function
|
328803
|
-
return
|
328804
|
-
name: "accessible-ecdsa-p256",
|
328805
|
-
type: "private key",
|
328806
|
-
subType: "accessible-ecdsa-p256",
|
328807
|
-
alias: "acc",
|
328808
|
-
envKey: "SETTLEMINT_ACCESSIBLE_PRIVATE_KEY",
|
328809
|
-
resumeFunction: async (settlemint, id) => {
|
328810
|
-
return settlemint.privateKey.resume(id);
|
328811
|
-
}
|
328812
|
-
});
|
328835
|
+
// src/commands/platform/middleware/resume.ts
|
328836
|
+
function middlewareResumeCommand() {
|
328837
|
+
return new Command("middleware").alias("mw").description("Resume a middleware service in the SettleMint platform").addCommand(graphMiddlewareResumeCommand()).addCommand(smartContractPortalMiddlewareResumeCommand());
|
328813
328838
|
}
|
328814
328839
|
|
328815
|
-
// src/commands/platform/private-key/
|
328816
|
-
function
|
328840
|
+
// src/commands/platform/private-key/resume.ts
|
328841
|
+
function privateKeyResumeCommand() {
|
328817
328842
|
return getResumeCommand({
|
328818
|
-
name: "
|
328843
|
+
name: "private-key",
|
328819
328844
|
type: "private key",
|
328820
|
-
|
328821
|
-
|
328822
|
-
envKey: "SETTLEMINT_HD_PRIVATE_KEY",
|
328845
|
+
alias: "pk",
|
328846
|
+
envKey: "SETTLEMINT_ACCESSIBLE_PRIVATE_KEY",
|
328823
328847
|
resumeFunction: async (settlemint, id) => {
|
328824
328848
|
return settlemint.privateKey.resume(id);
|
328825
328849
|
}
|
@@ -328831,7 +328855,6 @@ function ipfsStorageResumeCommand() {
|
|
328831
328855
|
return getResumeCommand({
|
328832
328856
|
name: "ipfs",
|
328833
328857
|
type: "storage",
|
328834
|
-
subType: "ipfs",
|
328835
328858
|
alias: "ip",
|
328836
328859
|
envKey: "SETTLEMINT_IPFS",
|
328837
328860
|
resumeFunction: async (settlemint, id) => {
|
@@ -328845,7 +328868,6 @@ function minioStorageResumeCommand() {
|
|
328845
328868
|
return getResumeCommand({
|
328846
328869
|
name: "minio",
|
328847
328870
|
type: "storage",
|
328848
|
-
subType: "minio",
|
328849
328871
|
alias: "m",
|
328850
328872
|
envKey: "SETTLEMINT_MINIO",
|
328851
328873
|
resumeFunction: async (settlemint, id) => {
|
@@ -328854,9 +328876,14 @@ function minioStorageResumeCommand() {
|
|
328854
328876
|
});
|
328855
328877
|
}
|
328856
328878
|
|
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
|
+
|
328857
328884
|
// src/commands/platform/resume.ts
|
328858
328885
|
function resumeCommand() {
|
328859
|
-
const cmd2 = new Command("resume").description("Resume a resource in the SettleMint platform").addCommand(blockchainNodeResumeCommand()).addCommand(blockchainNetworkResumeCommand()).addCommand(customDeploymentResumeCommand()).addCommand(
|
328886
|
+
const cmd2 = new Command("resume").description("Resume a resource in the SettleMint platform").addCommand(blockchainNodeResumeCommand()).addCommand(blockchainNetworkResumeCommand()).addCommand(customDeploymentResumeCommand()).addCommand(insightsResumeCommand()).addCommand(integrationToolResumeCommand()).addCommand(loadBalancerResumeCommand()).addCommand(middlewareResumeCommand()).addCommand(privateKeyResumeCommand()).addCommand(storageResumeCommand());
|
328860
328887
|
return cmd2;
|
328861
328888
|
}
|
328862
328889
|
|
@@ -330371,12 +330398,12 @@ async function getNodeName({
|
|
330371
330398
|
|
330372
330399
|
// src/commands/smart-contract-set/subgraph/build.ts
|
330373
330400
|
function subgraphBuildCommand() {
|
330374
|
-
return new Command("build").description("Build the subgraph").usage(createExamples([
|
330401
|
+
return new Command("build").description("Build the subgraph").option("--ipfs <ipfs-url>", "The IPFS URL to use for the subgraph deployment").usage(createExamples([
|
330375
330402
|
{
|
330376
330403
|
description: "Build the subgraph",
|
330377
330404
|
command: "scs subgraph build"
|
330378
330405
|
}
|
330379
|
-
])).action(async () => {
|
330406
|
+
])).action(async ({ ipfs }) => {
|
330380
330407
|
intro("Building subgraph");
|
330381
330408
|
await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
|
330382
330409
|
await subgraphSetup({
|
@@ -330385,7 +330412,7 @@ function subgraphBuildCommand() {
|
|
330385
330412
|
const { command, args } = await getPackageManagerExecutable();
|
330386
330413
|
const subgraphYamlFile = await getSubgraphYamlFile();
|
330387
330414
|
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile]);
|
330388
|
-
await executeCommand(command, [...args, "graph", "build", subgraphYamlFile]);
|
330415
|
+
await executeCommand(command, [...args, "graph", "build", ...ipfs ? ["--ipfs", ipfs] : [], subgraphYamlFile]);
|
330389
330416
|
outro("Subgraph built successfully");
|
330390
330417
|
});
|
330391
330418
|
}
|
@@ -330781,4 +330808,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
330781
330808
|
// src/cli.ts
|
330782
330809
|
sdkCliCommand();
|
330783
330810
|
|
330784
|
-
//# debugId=
|
330811
|
+
//# debugId=780AEB39E4A4224C64756E2164756E21
|