@settlemint/sdk-cli 2.4.0-prcf43b3a1 → 2.4.0-prd61aaa2c
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 +844 -126
- package/dist/cli.js.map +81 -47
- package/package.json +13 -11
package/dist/cli.js
CHANGED
@@ -231623,7 +231623,7 @@ function size(value4) {
|
|
231623
231623
|
var init_size = () => {};
|
231624
231624
|
|
231625
231625
|
// ../../node_modules/viem/_esm/errors/version.js
|
231626
|
-
var version5 = "2.31.
|
231626
|
+
var version5 = "2.31.6";
|
231627
231627
|
|
231628
231628
|
// ../../node_modules/viem/_esm/errors/base.js
|
231629
231629
|
function walk(err, fn) {
|
@@ -238855,7 +238855,7 @@ async function localBatchGatewayRequest(parameters) {
|
|
238855
238855
|
const responses = [];
|
238856
238856
|
await Promise.all(queries.map(async (query, i6) => {
|
238857
238857
|
try {
|
238858
|
-
responses[i6] = await ccipRequest(query);
|
238858
|
+
responses[i6] = query.urls.includes(localBatchGatewayUrl) ? await localBatchGatewayRequest({ data: query.data, ccipRequest }) : await ccipRequest(query);
|
238859
238859
|
failures[i6] = false;
|
238860
238860
|
} catch (err) {
|
238861
238861
|
failures[i6] = true;
|
@@ -258129,9 +258129,9 @@ ${formattedErrors}`);
|
|
258129
258129
|
throw error$37;
|
258130
258130
|
}
|
258131
258131
|
}
|
258132
|
-
var ApplicationAccessTokenSchema = string$1().regex(/^sm_aat_
|
258133
|
-
var PersonalAccessTokenSchema = string$1().regex(/^sm_pat_
|
258134
|
-
var AccessTokenSchema = string$1().regex(/^sm_pat_
|
258132
|
+
var ApplicationAccessTokenSchema = string$1().regex(/^sm_aat_.+$/);
|
258133
|
+
var PersonalAccessTokenSchema = string$1().regex(/^sm_pat_.+$/);
|
258134
|
+
var AccessTokenSchema = string$1().regex(/^(sm_pat_.+|sm_aat_.+)$/);
|
258135
258135
|
function tryParseJson(value, defaultValue = null) {
|
258136
258136
|
try {
|
258137
258137
|
const parsed = JSON.parse(value);
|
@@ -258139,7 +258139,7 @@ function tryParseJson(value, defaultValue = null) {
|
|
258139
258139
|
return defaultValue;
|
258140
258140
|
}
|
258141
258141
|
return parsed;
|
258142
|
-
} catch (
|
258142
|
+
} catch (_err) {
|
258143
258143
|
return defaultValue;
|
258144
258144
|
}
|
258145
258145
|
}
|
@@ -263769,7 +263769,7 @@ async function findMonoRepoPackages(projectDir) {
|
|
263769
263769
|
}));
|
263770
263770
|
const allPaths = packagePaths.flat();
|
263771
263771
|
return allPaths.length === 0 ? [projectDir] : [monoRepoRoot, ...allPaths];
|
263772
|
-
} catch (
|
263772
|
+
} catch (_error) {
|
263773
263773
|
return [projectDir];
|
263774
263774
|
}
|
263775
263775
|
}
|
@@ -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-prd61aaa2c",
|
263844
263844
|
type: "module",
|
263845
263845
|
private: false,
|
263846
263846
|
license: "FSL-1.1-MIT",
|
@@ -263859,7 +263859,9 @@ var package_default = {
|
|
263859
263859
|
url: "https://github.com/settlemint/sdk/issues",
|
263860
263860
|
email: "support@settlemint.com"
|
263861
263861
|
},
|
263862
|
-
files: [
|
263862
|
+
files: [
|
263863
|
+
"dist"
|
263864
|
+
],
|
263863
263865
|
exports: {
|
263864
263866
|
"./*": {
|
263865
263867
|
types: "./dist/*.d.ts",
|
@@ -263885,14 +263887,14 @@ var package_default = {
|
|
263885
263887
|
devDependencies: {
|
263886
263888
|
"@commander-js/extra-typings": "14.0.0",
|
263887
263889
|
commander: "14.0.0",
|
263888
|
-
"@inquirer/confirm": "5.1.
|
263889
|
-
"@inquirer/input": "4.
|
263890
|
-
"@inquirer/password": "4.0.
|
263891
|
-
"@inquirer/select": "4.2.
|
263892
|
-
"@settlemint/sdk-js": "2.4.0-
|
263893
|
-
"@settlemint/sdk-utils": "2.4.0-
|
263894
|
-
"@settlemint/sdk-viem": "2.4.0-
|
263895
|
-
"@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-prd61aaa2c",
|
263895
|
+
"@settlemint/sdk-utils": "2.4.0-prd61aaa2c",
|
263896
|
+
"@settlemint/sdk-viem": "2.4.0-prd61aaa2c",
|
263897
|
+
"@types/node": "24.0.10",
|
263896
263898
|
"@types/semver": "7.7.0",
|
263897
263899
|
"@types/which": "3.0.4",
|
263898
263900
|
"get-tsconfig": "4.10.1",
|
@@ -263900,7 +263902,7 @@ var package_default = {
|
|
263900
263902
|
"is-in-ci": "1.0.0",
|
263901
263903
|
semver: "7.7.2",
|
263902
263904
|
slugify: "1.6.6",
|
263903
|
-
viem: "2.31.
|
263905
|
+
viem: "2.31.6",
|
263904
263906
|
which: "5.0.0",
|
263905
263907
|
yaml: "2.8.0",
|
263906
263908
|
yoctocolors: "2.1.1"
|
@@ -263961,7 +263963,7 @@ async function telemetry(data) {
|
|
263961
263963
|
signal: controller.signal
|
263962
263964
|
});
|
263963
263965
|
clearTimeout(timeout);
|
263964
|
-
} catch (
|
263966
|
+
} catch (_error) {}
|
263965
263967
|
}
|
263966
263968
|
|
263967
263969
|
// ../../node_modules/@commander-js/extra-typings/esm.mjs
|
@@ -276513,9 +276515,9 @@ ${formattedErrors}`);
|
|
276513
276515
|
throw error$372;
|
276514
276516
|
}
|
276515
276517
|
}
|
276516
|
-
var ApplicationAccessTokenSchema2 = string$12().regex(/^sm_aat_
|
276517
|
-
var PersonalAccessTokenSchema2 = string$12().regex(/^sm_pat_
|
276518
|
-
var AccessTokenSchema2 = string$12().regex(/^sm_pat_
|
276518
|
+
var ApplicationAccessTokenSchema2 = string$12().regex(/^sm_aat_.+$/);
|
276519
|
+
var PersonalAccessTokenSchema2 = string$12().regex(/^sm_pat_.+$/);
|
276520
|
+
var AccessTokenSchema2 = string$12().regex(/^(sm_pat_.+|sm_aat_.+)$/);
|
276519
276521
|
function tryParseJson2(value, defaultValue = null) {
|
276520
276522
|
try {
|
276521
276523
|
const parsed = JSON.parse(value);
|
@@ -276523,7 +276525,7 @@ function tryParseJson2(value, defaultValue = null) {
|
|
276523
276525
|
return defaultValue;
|
276524
276526
|
}
|
276525
276527
|
return parsed;
|
276526
|
-
} catch (
|
276528
|
+
} catch (_err) {
|
276527
276529
|
return defaultValue;
|
276528
276530
|
}
|
276529
276531
|
}
|
@@ -287952,8 +287954,9 @@ var workspaceList = (gqlClient) => {
|
|
287952
287954
|
const { workspaces } = await gqlClient.request(getWorkspacesAndApplications);
|
287953
287955
|
const allWorkspaces = workspaces.reduce((acc, workspace) => {
|
287954
287956
|
acc.push(workspace);
|
287955
|
-
if (workspace.childWorkspaces)
|
287957
|
+
if (workspace.childWorkspaces) {
|
287956
287958
|
acc.push(...workspace.childWorkspaces);
|
287959
|
+
}
|
287957
287960
|
return acc;
|
287958
287961
|
}, []);
|
287959
287962
|
return allWorkspaces.sort((a3, b) => a3.name.localeCompare(b.name));
|
@@ -287980,8 +287983,9 @@ var workspaceDelete = (gqlClient) => {
|
|
287980
287983
|
var workspaceAddCredits = (gqlClient) => {
|
287981
287984
|
return async (workspaceId, amount) => {
|
287982
287985
|
const id = validate2(IdSchema2, workspaceId);
|
287983
|
-
if (amount <= 0)
|
287986
|
+
if (amount <= 0) {
|
287984
287987
|
throw new Error("Credit amount must be a positive number");
|
287988
|
+
}
|
287985
287989
|
const { addCredits: result } = await gqlClient.request(addCredits, {
|
287986
287990
|
workspaceId: id,
|
287987
287991
|
amount
|
@@ -288103,8 +288107,9 @@ var applicationAccessTokenCreate = (gqlClient) => {
|
|
288103
288107
|
...otherArgs,
|
288104
288108
|
applicationId: application.id
|
288105
288109
|
});
|
288106
|
-
if (!applicationAccessToken.token)
|
288110
|
+
if (!applicationAccessToken.token) {
|
288107
288111
|
throw new Error("Failed to create application access token");
|
288112
|
+
}
|
288108
288113
|
return applicationAccessToken.token;
|
288109
288114
|
};
|
288110
288115
|
};
|
@@ -288117,7 +288122,7 @@ function setClusterServiceDefaults(args) {
|
|
288117
288122
|
}
|
288118
288123
|
function setNetworkDefaults(args) {
|
288119
288124
|
const clusterServiceArgs = setClusterServiceDefaults(args);
|
288120
|
-
if (args.consensusAlgorithm === "BESU_QBFT")
|
288125
|
+
if (args.consensusAlgorithm === "BESU_QBFT") {
|
288121
288126
|
return {
|
288122
288127
|
...clusterServiceArgs,
|
288123
288128
|
chainId: args.chainId ?? 46040,
|
@@ -288127,6 +288132,7 @@ function setNetworkDefaults(args) {
|
|
288127
288132
|
gasPrice: args.gasPrice ?? 0,
|
288128
288133
|
secondsPerBlock: args.secondsPerBlock ?? 2
|
288129
288134
|
};
|
288135
|
+
}
|
288130
288136
|
return clusterServiceArgs;
|
288131
288137
|
}
|
288132
288138
|
var BlockchainNetworkFragment = graphql(`
|
@@ -288289,6 +288295,20 @@ var restartBlockchainNetwork = graphql(`
|
|
288289
288295
|
}
|
288290
288296
|
}
|
288291
288297
|
`, [BlockchainNetworkFragment]);
|
288298
|
+
var pauseBlockchainNetwork = graphql(`
|
288299
|
+
mutation PauseBlockchainNetwork($uniqueName: String!) {
|
288300
|
+
pauseBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {
|
288301
|
+
...BlockchainNetwork
|
288302
|
+
}
|
288303
|
+
}
|
288304
|
+
`, [BlockchainNetworkFragment]);
|
288305
|
+
var resumeBlockchainNetwork = graphql(`
|
288306
|
+
mutation ResumeBlockchainNetwork($uniqueName: String!) {
|
288307
|
+
resumeBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {
|
288308
|
+
...BlockchainNetwork
|
288309
|
+
}
|
288310
|
+
}
|
288311
|
+
`, [BlockchainNetworkFragment]);
|
288292
288312
|
var blockchainNetworkList = (gqlClient) => {
|
288293
288313
|
return async (applicationUniqueName) => {
|
288294
288314
|
const { blockchainNetworksByUniqueName: { items } } = await gqlClient.request(getBlockchainNetworks, { applicationUniqueName });
|
@@ -288323,6 +288343,14 @@ var blockchainNetworkRestart = (gqlClient) => async (blockchainNetworkUniqueName
|
|
288323
288343
|
const { restartBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(restartBlockchainNetwork, { uniqueName: blockchainNetworkUniqueName });
|
288324
288344
|
return blockchainNetwork;
|
288325
288345
|
};
|
288346
|
+
var blockchainNetworkPause = (gqlClient) => async (blockchainNetworkUniqueName) => {
|
288347
|
+
const { pauseBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(pauseBlockchainNetwork, { uniqueName: blockchainNetworkUniqueName });
|
288348
|
+
return blockchainNetwork;
|
288349
|
+
};
|
288350
|
+
var blockchainNetworkResume = (gqlClient) => async (blockchainNetworkUniqueName) => {
|
288351
|
+
const { resumeBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(resumeBlockchainNetwork, { uniqueName: blockchainNetworkUniqueName });
|
288352
|
+
return blockchainNetwork;
|
288353
|
+
};
|
288326
288354
|
var BlockchainNodeFragment = graphql(`
|
288327
288355
|
fragment BlockchainNode on BlockchainNode {
|
288328
288356
|
__typename
|
@@ -288456,6 +288484,20 @@ var restartBlockchainNode = graphql(`
|
|
288456
288484
|
}
|
288457
288485
|
}
|
288458
288486
|
`, [BlockchainNodeFragment]);
|
288487
|
+
var pauseBlockchainNode = graphql(`
|
288488
|
+
mutation PauseBlockchainNode($uniqueName: String!) {
|
288489
|
+
pauseBlockchainNodeByUniqueName(uniqueName: $uniqueName) {
|
288490
|
+
...BlockchainNode
|
288491
|
+
}
|
288492
|
+
}
|
288493
|
+
`, [BlockchainNodeFragment]);
|
288494
|
+
var resumeBlockchainNode = graphql(`
|
288495
|
+
mutation ResumeBlockchainNode($uniqueName: String!) {
|
288496
|
+
resumeBlockchainNodeByUniqueName(uniqueName: $uniqueName) {
|
288497
|
+
...BlockchainNode
|
288498
|
+
}
|
288499
|
+
}
|
288500
|
+
`, [BlockchainNodeFragment]);
|
288459
288501
|
var blockchainNodeList = (gqlClient) => {
|
288460
288502
|
return async (applicationUniqueName) => {
|
288461
288503
|
const { blockchainNodesByUniqueName: { items } } = await gqlClient.request(getBlockchainNodes, { applicationUniqueName });
|
@@ -288484,6 +288526,14 @@ var blockchainNodeRestart = (gqlClient) => async (blockchainNodeUniqueName) => {
|
|
288484
288526
|
const { restartBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(restartBlockchainNode, { uniqueName: blockchainNodeUniqueName });
|
288485
288527
|
return blockchainNode;
|
288486
288528
|
};
|
288529
|
+
var blockchainNodePause = (gqlClient) => async (blockchainNodeUniqueName) => {
|
288530
|
+
const { pauseBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(pauseBlockchainNode, { uniqueName: blockchainNodeUniqueName });
|
288531
|
+
return blockchainNode;
|
288532
|
+
};
|
288533
|
+
var blockchainNodeResume = (gqlClient) => async (blockchainNodeUniqueName) => {
|
288534
|
+
const { resumeBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(resumeBlockchainNode, { uniqueName: blockchainNodeUniqueName });
|
288535
|
+
return blockchainNode;
|
288536
|
+
};
|
288487
288537
|
var CustomDeploymentFragment = graphql(`
|
288488
288538
|
fragment CustomDeployment on CustomDeployment {
|
288489
288539
|
id
|
@@ -288566,6 +288616,20 @@ var restartCustomDeployment = graphql(`
|
|
288566
288616
|
}
|
288567
288617
|
}
|
288568
288618
|
`, [CustomDeploymentFragment]);
|
288619
|
+
var pauseCustomDeployment = graphql(`
|
288620
|
+
mutation PauseCustomDeployment($uniqueName: String!) {
|
288621
|
+
pauseCustomDeploymentByUniqueName(uniqueName: $uniqueName) {
|
288622
|
+
...CustomDeployment
|
288623
|
+
}
|
288624
|
+
}
|
288625
|
+
`, [CustomDeploymentFragment]);
|
288626
|
+
var resumeCustomDeployment = graphql(`
|
288627
|
+
mutation ResumeCustomDeployment($uniqueName: String!) {
|
288628
|
+
resumeCustomDeploymentByUniqueName(uniqueName: $uniqueName) {
|
288629
|
+
...CustomDeployment
|
288630
|
+
}
|
288631
|
+
}
|
288632
|
+
`, [CustomDeploymentFragment]);
|
288569
288633
|
var customdeploymentList = (gqlClient) => {
|
288570
288634
|
return async (applicationUniqueName) => {
|
288571
288635
|
const { customDeploymentsByUniqueName: { items } } = await gqlClient.request(getCustomDeployments, { applicationUniqueName });
|
@@ -288602,6 +288666,14 @@ var customDeploymentRestart = (gqlClient) => async (customDeploymentUniqueName)
|
|
288602
288666
|
const { restartCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(restartCustomDeployment, { uniqueName: customDeploymentUniqueName });
|
288603
288667
|
return customDeployment;
|
288604
288668
|
};
|
288669
|
+
var customDeploymentPause = (gqlClient) => async (customDeploymentUniqueName) => {
|
288670
|
+
const { pauseCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(pauseCustomDeployment, { uniqueName: customDeploymentUniqueName });
|
288671
|
+
return customDeployment;
|
288672
|
+
};
|
288673
|
+
var customDeploymentResume = (gqlClient) => async (customDeploymentUniqueName) => {
|
288674
|
+
const { resumeCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(resumeCustomDeployment, { uniqueName: customDeploymentUniqueName });
|
288675
|
+
return customDeployment;
|
288676
|
+
};
|
288605
288677
|
var getFoundryEnvConfig = graphql(`
|
288606
288678
|
query GetFoundryEnvConfig($blockchainNodeUniqueName: String!) {
|
288607
288679
|
foundryEnvConfigByUniqueName(blockchainNodeUniqueName: $blockchainNodeUniqueName)
|
@@ -288678,6 +288750,20 @@ var restartLoadBalancer = graphql(`
|
|
288678
288750
|
}
|
288679
288751
|
}
|
288680
288752
|
`, [LoadBalancerFragment]);
|
288753
|
+
var pauseLoadBalancer = graphql(`
|
288754
|
+
mutation PauseLoadBalancer($uniqueName: String!) {
|
288755
|
+
pauseLoadBalancerByUniqueName(uniqueName: $uniqueName) {
|
288756
|
+
...LoadBalancer
|
288757
|
+
}
|
288758
|
+
}
|
288759
|
+
`, [LoadBalancerFragment]);
|
288760
|
+
var resumeLoadBalancer = graphql(`
|
288761
|
+
mutation ResumeLoadBalancer($uniqueName: String!) {
|
288762
|
+
resumeLoadBalancerByUniqueName(uniqueName: $uniqueName) {
|
288763
|
+
...LoadBalancer
|
288764
|
+
}
|
288765
|
+
}
|
288766
|
+
`, [LoadBalancerFragment]);
|
288681
288767
|
var loadBalancerRead = (gqlClient) => {
|
288682
288768
|
return async (loadBalancerUniqueName) => {
|
288683
288769
|
const { loadBalancerByUniqueName: loadBalancer } = await gqlClient.request(getLoadBalancer, { uniqueName: loadBalancerUniqueName });
|
@@ -288711,6 +288797,14 @@ var loadBalancerRestart = (gqlClient) => async (loadBalancerUniqueName) => {
|
|
288711
288797
|
const { restartLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(restartLoadBalancer, { uniqueName: loadBalancerUniqueName });
|
288712
288798
|
return loadBalancer;
|
288713
288799
|
};
|
288800
|
+
var loadBalancerPause = (gqlClient) => async (loadBalancerUniqueName) => {
|
288801
|
+
const { pauseLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(pauseLoadBalancer, { uniqueName: loadBalancerUniqueName });
|
288802
|
+
return loadBalancer;
|
288803
|
+
};
|
288804
|
+
var loadBalancerResume = (gqlClient) => async (loadBalancerUniqueName) => {
|
288805
|
+
const { resumeLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(resumeLoadBalancer, { uniqueName: loadBalancerUniqueName });
|
288806
|
+
return loadBalancer;
|
288807
|
+
};
|
288714
288808
|
var InsightsFragment = graphql(`
|
288715
288809
|
fragment Insights on Insights {
|
288716
288810
|
__typename
|
@@ -288784,6 +288878,20 @@ var restartInsights = graphql(`
|
|
288784
288878
|
}
|
288785
288879
|
}
|
288786
288880
|
`, [InsightsFragment]);
|
288881
|
+
var pauseInsights = graphql(`
|
288882
|
+
mutation PauseInsights($uniqueName: String!) {
|
288883
|
+
pauseInsightsByUniqueName(uniqueName: $uniqueName) {
|
288884
|
+
...Insights
|
288885
|
+
}
|
288886
|
+
}
|
288887
|
+
`, [InsightsFragment]);
|
288888
|
+
var resumeInsights = graphql(`
|
288889
|
+
mutation ResumeInsights($uniqueName: String!) {
|
288890
|
+
resumeInsightsByUniqueName(uniqueName: $uniqueName) {
|
288891
|
+
...Insights
|
288892
|
+
}
|
288893
|
+
}
|
288894
|
+
`, [InsightsFragment]);
|
288787
288895
|
var insightsList = (gqlClient) => {
|
288788
288896
|
return async (applicationUniqueName) => {
|
288789
288897
|
const { insightsListByUniqueName: { items } } = await gqlClient.request(getInsights, { applicationUniqueName });
|
@@ -288817,6 +288925,14 @@ var insightsRestart = (gqlClient) => async (insightsUniqueName) => {
|
|
288817
288925
|
const { restartInsightsByUniqueName: insights } = await gqlClient.request(restartInsights, { uniqueName: insightsUniqueName });
|
288818
288926
|
return insights;
|
288819
288927
|
};
|
288928
|
+
var insightsPause = (gqlClient) => async (insightsUniqueName) => {
|
288929
|
+
const { pauseInsightsByUniqueName: insights } = await gqlClient.request(pauseInsights, { uniqueName: insightsUniqueName });
|
288930
|
+
return insights;
|
288931
|
+
};
|
288932
|
+
var insightsResume = (gqlClient) => async (insightsUniqueName) => {
|
288933
|
+
const { resumeInsightsByUniqueName: insights } = await gqlClient.request(resumeInsights, { uniqueName: insightsUniqueName });
|
288934
|
+
return insights;
|
288935
|
+
};
|
288820
288936
|
var IntegrationFragment = graphql(`
|
288821
288937
|
fragment Integration on Integration {
|
288822
288938
|
__typename
|
@@ -288886,6 +289002,20 @@ var restartIntegrationTool = graphql(`
|
|
288886
289002
|
}
|
288887
289003
|
}
|
288888
289004
|
`, [IntegrationFragment]);
|
289005
|
+
var pauseIntegrationTool = graphql(`
|
289006
|
+
mutation PauseIntegrationTool($uniqueName: String!) {
|
289007
|
+
pauseIntegrationByUniqueName(uniqueName: $uniqueName) {
|
289008
|
+
...Integration
|
289009
|
+
}
|
289010
|
+
}
|
289011
|
+
`, [IntegrationFragment]);
|
289012
|
+
var resumeIntegrationTool = graphql(`
|
289013
|
+
mutation ResumeIntegrationTool($uniqueName: String!) {
|
289014
|
+
resumeIntegrationByUniqueName(uniqueName: $uniqueName) {
|
289015
|
+
...Integration
|
289016
|
+
}
|
289017
|
+
}
|
289018
|
+
`, [IntegrationFragment]);
|
288889
289019
|
var integrationToolList = (gqlClient) => {
|
288890
289020
|
return async (applicationUniqueName) => {
|
288891
289021
|
const { integrationsByUniqueName: { items } } = await gqlClient.request(getIntegrations, { applicationUniqueName });
|
@@ -288913,6 +289043,14 @@ var integrationToolRestart = (gqlClient) => async (integrationUniqueName) => {
|
|
288913
289043
|
const { restartIntegrationByUniqueName: integration } = await gqlClient.request(restartIntegrationTool, { uniqueName: integrationUniqueName });
|
288914
289044
|
return integration;
|
288915
289045
|
};
|
289046
|
+
var integrationToolPause = (gqlClient) => async (integrationUniqueName) => {
|
289047
|
+
const { pauseIntegrationByUniqueName: integration } = await gqlClient.request(pauseIntegrationTool, { uniqueName: integrationUniqueName });
|
289048
|
+
return integration;
|
289049
|
+
};
|
289050
|
+
var integrationToolResume = (gqlClient) => async (integrationUniqueName) => {
|
289051
|
+
const { resumeIntegrationByUniqueName: integration } = await gqlClient.request(resumeIntegrationTool, { uniqueName: integrationUniqueName });
|
289052
|
+
return integration;
|
289053
|
+
};
|
288916
289054
|
var StorageFragment = graphql(`
|
288917
289055
|
fragment Storage on Storage {
|
288918
289056
|
__typename
|
@@ -288982,6 +289120,20 @@ var restartStorage = graphql(`
|
|
288982
289120
|
}
|
288983
289121
|
}
|
288984
289122
|
`, [StorageFragment]);
|
289123
|
+
var pauseStorage = graphql(`
|
289124
|
+
mutation PauseStorage($uniqueName: String!) {
|
289125
|
+
pauseStorageByUniqueName(uniqueName: $uniqueName) {
|
289126
|
+
...Storage
|
289127
|
+
}
|
289128
|
+
}
|
289129
|
+
`, [StorageFragment]);
|
289130
|
+
var resumeStorage = graphql(`
|
289131
|
+
mutation ResumeStorage($uniqueName: String!) {
|
289132
|
+
resumeStorageByUniqueName(uniqueName: $uniqueName) {
|
289133
|
+
...Storage
|
289134
|
+
}
|
289135
|
+
}
|
289136
|
+
`, [StorageFragment]);
|
288985
289137
|
var storageList = (gqlClient) => {
|
288986
289138
|
return async (applicationUniqueName) => {
|
288987
289139
|
const { storagesByUniqueName: { items } } = await gqlClient.request(getStorages, { applicationUniqueName });
|
@@ -289009,6 +289161,14 @@ var storageRestart = (gqlClient) => async (storageUniqueName) => {
|
|
289009
289161
|
const { restartStorageByUniqueName: storage } = await gqlClient.request(restartStorage, { uniqueName: storageUniqueName });
|
289010
289162
|
return storage;
|
289011
289163
|
};
|
289164
|
+
var storagePause = (gqlClient) => async (storageUniqueName) => {
|
289165
|
+
const { pauseStorageByUniqueName: storage } = await gqlClient.request(pauseStorage, { uniqueName: storageUniqueName });
|
289166
|
+
return storage;
|
289167
|
+
};
|
289168
|
+
var storageResume = (gqlClient) => async (storageUniqueName) => {
|
289169
|
+
const { resumeStorageByUniqueName: storage } = await gqlClient.request(resumeStorage, { uniqueName: storageUniqueName });
|
289170
|
+
return storage;
|
289171
|
+
};
|
289012
289172
|
var MiddlewareFragment = graphql(`
|
289013
289173
|
fragment Middleware on Middleware {
|
289014
289174
|
__typename
|
@@ -289109,6 +289269,20 @@ var restartMiddleware = graphql(`
|
|
289109
289269
|
}
|
289110
289270
|
}
|
289111
289271
|
`, [MiddlewareFragment]);
|
289272
|
+
var pauseMiddleware = graphql(`
|
289273
|
+
mutation PauseMiddleware($uniqueName: String!) {
|
289274
|
+
pauseMiddlewareByUniqueName(uniqueName: $uniqueName) {
|
289275
|
+
...Middleware
|
289276
|
+
}
|
289277
|
+
}
|
289278
|
+
`, [MiddlewareFragment]);
|
289279
|
+
var resumeMiddleware = graphql(`
|
289280
|
+
mutation ResumeMiddleware($uniqueName: String!) {
|
289281
|
+
resumeMiddlewareByUniqueName(uniqueName: $uniqueName) {
|
289282
|
+
...Middleware
|
289283
|
+
}
|
289284
|
+
}
|
289285
|
+
`, [MiddlewareFragment]);
|
289112
289286
|
var middlewareList = (gqlClient) => {
|
289113
289287
|
return async (applicationUniqueName) => {
|
289114
289288
|
const { middlewaresByUniqueName: { items } } = await gqlClient.request(getMiddlewares, { applicationUniqueName });
|
@@ -289153,6 +289327,14 @@ var middlewareRestart = (gqlClient) => async (middlewareUniqueName) => {
|
|
289153
289327
|
const { restartMiddlewareByUniqueName: middleware } = await gqlClient.request(restartMiddleware, { uniqueName: middlewareUniqueName });
|
289154
289328
|
return middleware;
|
289155
289329
|
};
|
289330
|
+
var middlewarePause = (gqlClient) => async (middlewareUniqueName) => {
|
289331
|
+
const { pauseMiddlewareByUniqueName: middleware } = await gqlClient.request(pauseMiddleware, { uniqueName: middlewareUniqueName });
|
289332
|
+
return middleware;
|
289333
|
+
};
|
289334
|
+
var middlewareResume = (gqlClient) => async (middlewareUniqueName) => {
|
289335
|
+
const { resumeMiddlewareByUniqueName: middleware } = await gqlClient.request(resumeMiddleware, { uniqueName: middlewareUniqueName });
|
289336
|
+
return middleware;
|
289337
|
+
};
|
289156
289338
|
var getPlatformConfigQuery = graphql(`
|
289157
289339
|
query platformConfig {
|
289158
289340
|
config {
|
@@ -289285,6 +289467,20 @@ var restartPrivateKey = graphql(`
|
|
289285
289467
|
}
|
289286
289468
|
}
|
289287
289469
|
`, [PrivateKeyFragment]);
|
289470
|
+
var pausePrivateKey = graphql(`
|
289471
|
+
mutation PausePrivateKey($uniqueName: String!) {
|
289472
|
+
pausePrivateKeyByUniqueName(uniqueName: $uniqueName) {
|
289473
|
+
...PrivateKey
|
289474
|
+
}
|
289475
|
+
}
|
289476
|
+
`, [PrivateKeyFragment]);
|
289477
|
+
var resumePrivateKey = graphql(`
|
289478
|
+
mutation ResumePrivateKey($uniqueName: String!) {
|
289479
|
+
resumePrivateKeyByUniqueName(uniqueName: $uniqueName) {
|
289480
|
+
...PrivateKey
|
289481
|
+
}
|
289482
|
+
}
|
289483
|
+
`, [PrivateKeyFragment]);
|
289288
289484
|
var privateKeyList = (gqlClient) => {
|
289289
289485
|
return async (applicationUniqueName) => {
|
289290
289486
|
const { privateKeysByUniqueName: { items } } = await gqlClient.request(getPrivateKeys, { applicationUniqueName });
|
@@ -289323,6 +289519,14 @@ var privateKeyRestart = (gqlClient) => async (privateKeyUniqueName) => {
|
|
289323
289519
|
const { restartPrivateKeyByUniqueName: privateKey } = await gqlClient.request(restartPrivateKey, { uniqueName: privateKeyUniqueName });
|
289324
289520
|
return privateKey;
|
289325
289521
|
};
|
289522
|
+
var privateKeyPause = (gqlClient) => async (privateKeyUniqueName) => {
|
289523
|
+
const { pausePrivateKeyByUniqueName: privateKey } = await gqlClient.request(pausePrivateKey, { uniqueName: privateKeyUniqueName });
|
289524
|
+
return privateKey;
|
289525
|
+
};
|
289526
|
+
var privateKeyResume = (gqlClient) => async (privateKeyUniqueName) => {
|
289527
|
+
const { resumePrivateKeyByUniqueName: privateKey } = await gqlClient.request(resumePrivateKey, { uniqueName: privateKeyUniqueName });
|
289528
|
+
return privateKey;
|
289529
|
+
};
|
289326
289530
|
var ClientOptionsSchema = exports_external.object({
|
289327
289531
|
accessToken: AccessTokenSchema2,
|
289328
289532
|
instance: UrlSchema2
|
@@ -289343,26 +289547,30 @@ async function getPincodeVerificationChallenges({ userWalletAddress, accessToken
|
|
289343
289547
|
}
|
289344
289548
|
});
|
289345
289549
|
if (!response.ok) {
|
289346
|
-
if (response.status === 404)
|
289550
|
+
if (response.status === 404) {
|
289347
289551
|
throw new Error(`No user wallet found with address '${userWalletAddress}' for node '${nodeId}'`);
|
289552
|
+
}
|
289348
289553
|
throw new Error("Failed to get verification challenge");
|
289349
289554
|
}
|
289350
289555
|
const verificationChallenges = await response.json();
|
289351
289556
|
return verificationChallenges;
|
289352
289557
|
}
|
289353
289558
|
function getPincodeVerificationChallengeResponse({ verificationChallenge, pincode }) {
|
289354
|
-
if (!verificationChallenge?.challenge?.secret || !verificationChallenge?.challenge?.salt)
|
289559
|
+
if (!verificationChallenge?.challenge?.secret || !verificationChallenge?.challenge?.salt) {
|
289355
289560
|
throw new Error("Could not authenticate pin code, invalid challenge format");
|
289561
|
+
}
|
289356
289562
|
const { secret, salt } = verificationChallenge.challenge;
|
289357
289563
|
return generateResponse(pincode, salt, secret);
|
289358
289564
|
}
|
289359
289565
|
function createSettleMintClient(options) {
|
289360
289566
|
ensureServer();
|
289361
|
-
if (options.instance === STANDALONE_INSTANCE2 || options.instance === LOCAL_INSTANCE2)
|
289362
|
-
if (options.anonymous)
|
289567
|
+
if (options.instance === STANDALONE_INSTANCE2 || options.instance === LOCAL_INSTANCE2) {
|
289568
|
+
if (options.anonymous) {
|
289363
289569
|
options.instance = "https://console.settlemint.com";
|
289364
|
-
else
|
289570
|
+
} else {
|
289365
289571
|
throw new Error("Standalone and local instances cannot connect to the SettleMint platform");
|
289572
|
+
}
|
289573
|
+
}
|
289366
289574
|
const validatedOptions = options.anonymous ? validate2(exports_external.object({
|
289367
289575
|
...ClientOptionsSchema.shape,
|
289368
289576
|
accessToken: exports_external.literal("")
|
@@ -289402,57 +289610,75 @@ function createSettleMintClient(options) {
|
|
289402
289610
|
read: blockchainNetworkRead(gqlClient),
|
289403
289611
|
create: blockchainNetworkCreate(gqlClient),
|
289404
289612
|
delete: blockchainNetworkDelete(gqlClient),
|
289405
|
-
restart: blockchainNetworkRestart(gqlClient)
|
289613
|
+
restart: blockchainNetworkRestart(gqlClient),
|
289614
|
+
pause: blockchainNetworkPause(gqlClient),
|
289615
|
+
resume: blockchainNetworkResume(gqlClient)
|
289406
289616
|
},
|
289407
289617
|
blockchainNode: {
|
289408
289618
|
list: blockchainNodeList(gqlClient),
|
289409
289619
|
read: blockchainNodeRead(gqlClient),
|
289410
289620
|
create: blockchainNodeCreate(gqlClient),
|
289411
|
-
restart: blockchainNodeRestart(gqlClient)
|
289621
|
+
restart: blockchainNodeRestart(gqlClient),
|
289622
|
+
pause: blockchainNodePause(gqlClient),
|
289623
|
+
resume: blockchainNodeResume(gqlClient)
|
289412
289624
|
},
|
289413
289625
|
loadBalancer: {
|
289414
289626
|
list: loadBalancerList(gqlClient),
|
289415
289627
|
read: loadBalancerRead(gqlClient),
|
289416
289628
|
create: loadBalancerCreate(gqlClient),
|
289417
|
-
restart: loadBalancerRestart(gqlClient)
|
289629
|
+
restart: loadBalancerRestart(gqlClient),
|
289630
|
+
pause: loadBalancerPause(gqlClient),
|
289631
|
+
resume: loadBalancerResume(gqlClient)
|
289418
289632
|
},
|
289419
289633
|
middleware: {
|
289420
289634
|
list: middlewareList(gqlClient),
|
289421
289635
|
read: middlewareRead(gqlClient),
|
289422
289636
|
graphSubgraphs: graphMiddlewareSubgraphs(gqlClient),
|
289423
289637
|
create: middlewareCreate(gqlClient),
|
289424
|
-
restart: middlewareRestart(gqlClient)
|
289638
|
+
restart: middlewareRestart(gqlClient),
|
289639
|
+
pause: middlewarePause(gqlClient),
|
289640
|
+
resume: middlewareResume(gqlClient)
|
289425
289641
|
},
|
289426
289642
|
integrationTool: {
|
289427
289643
|
list: integrationToolList(gqlClient),
|
289428
289644
|
read: integrationToolRead(gqlClient),
|
289429
289645
|
create: integrationToolCreate(gqlClient),
|
289430
|
-
restart: integrationToolRestart(gqlClient)
|
289646
|
+
restart: integrationToolRestart(gqlClient),
|
289647
|
+
pause: integrationToolPause(gqlClient),
|
289648
|
+
resume: integrationToolResume(gqlClient)
|
289431
289649
|
},
|
289432
289650
|
storage: {
|
289433
289651
|
list: storageList(gqlClient),
|
289434
289652
|
read: storageRead(gqlClient),
|
289435
289653
|
create: storageCreate(gqlClient),
|
289436
|
-
restart: storageRestart(gqlClient)
|
289654
|
+
restart: storageRestart(gqlClient),
|
289655
|
+
pause: storagePause(gqlClient),
|
289656
|
+
resume: storageResume(gqlClient)
|
289437
289657
|
},
|
289438
289658
|
privateKey: {
|
289439
289659
|
list: privateKeyList(gqlClient),
|
289440
289660
|
read: privatekeyRead(gqlClient),
|
289441
289661
|
create: privateKeyCreate(gqlClient),
|
289442
|
-
restart: privateKeyRestart(gqlClient)
|
289662
|
+
restart: privateKeyRestart(gqlClient),
|
289663
|
+
pause: privateKeyPause(gqlClient),
|
289664
|
+
resume: privateKeyResume(gqlClient)
|
289443
289665
|
},
|
289444
289666
|
insights: {
|
289445
289667
|
list: insightsList(gqlClient),
|
289446
289668
|
read: insightsRead(gqlClient),
|
289447
289669
|
create: insightsCreate(gqlClient),
|
289448
|
-
restart: insightsRestart(gqlClient)
|
289670
|
+
restart: insightsRestart(gqlClient),
|
289671
|
+
pause: insightsPause(gqlClient),
|
289672
|
+
resume: insightsResume(gqlClient)
|
289449
289673
|
},
|
289450
289674
|
customDeployment: {
|
289451
289675
|
list: customdeploymentList(gqlClient),
|
289452
289676
|
read: customdeploymentRead(gqlClient),
|
289453
289677
|
create: customdeploymentCreate(gqlClient),
|
289454
289678
|
update: customdeploymentUpdate(gqlClient),
|
289455
|
-
restart: customDeploymentRestart(gqlClient)
|
289679
|
+
restart: customDeploymentRestart(gqlClient),
|
289680
|
+
pause: customDeploymentPause(gqlClient),
|
289681
|
+
resume: customDeploymentResume(gqlClient)
|
289456
289682
|
},
|
289457
289683
|
foundry: { env: getEnv(gqlClient) },
|
289458
289684
|
applicationAccessToken: { create: applicationAccessTokenCreate(gqlClient) },
|
@@ -295869,17 +296095,6 @@ async function exists3(path$1) {
|
|
295869
296095
|
return false;
|
295870
296096
|
}
|
295871
296097
|
}
|
295872
|
-
function tryParseJson3(value2, defaultValue = null) {
|
295873
|
-
try {
|
295874
|
-
const parsed = JSON.parse(value2);
|
295875
|
-
if (parsed === undefined || parsed === null) {
|
295876
|
-
return defaultValue;
|
295877
|
-
}
|
295878
|
-
return parsed;
|
295879
|
-
} catch (err) {
|
295880
|
-
return defaultValue;
|
295881
|
-
}
|
295882
|
-
}
|
295883
296098
|
var require_balanced_match4 = __commonJS4({ "../../node_modules/balanced-match/index.js"(exports, module) {
|
295884
296099
|
module.exports = balanced$1;
|
295885
296100
|
function balanced$1(a3, b, str) {
|
@@ -301358,6 +301573,17 @@ var glob3 = Object.assign(glob_3, {
|
|
301358
301573
|
unescape: unescape4
|
301359
301574
|
});
|
301360
301575
|
glob3.glob = glob3;
|
301576
|
+
function tryParseJson3(value2, defaultValue = null) {
|
301577
|
+
try {
|
301578
|
+
const parsed = JSON.parse(value2);
|
301579
|
+
if (parsed === undefined || parsed === null) {
|
301580
|
+
return defaultValue;
|
301581
|
+
}
|
301582
|
+
return parsed;
|
301583
|
+
} catch (_err) {
|
301584
|
+
return defaultValue;
|
301585
|
+
}
|
301586
|
+
}
|
301361
301587
|
async function findMonoRepoRoot2(startDir) {
|
301362
301588
|
const lockFilePath = await findUp([
|
301363
301589
|
"package-lock.json",
|
@@ -301403,7 +301629,7 @@ function tryParseJson4(value2, defaultValue = null) {
|
|
301403
301629
|
return defaultValue;
|
301404
301630
|
}
|
301405
301631
|
return parsed;
|
301406
|
-
} catch (
|
301632
|
+
} catch (_err) {
|
301407
301633
|
return defaultValue;
|
301408
301634
|
}
|
301409
301635
|
}
|
@@ -301431,7 +301657,7 @@ async function readConfig() {
|
|
301431
301657
|
try {
|
301432
301658
|
const content = await readFile4(CONFIG_FILE, "utf-8");
|
301433
301659
|
return tryParseJson4(content, { instances: {} });
|
301434
|
-
} catch (
|
301660
|
+
} catch (_error) {
|
301435
301661
|
return { instances: {} };
|
301436
301662
|
}
|
301437
301663
|
}
|
@@ -303016,7 +303242,7 @@ var inputTheme = {
|
|
303016
303242
|
validationFailureMode: "keep"
|
303017
303243
|
};
|
303018
303244
|
var esm_default2 = createPrompt((config4, done) => {
|
303019
|
-
const { required: required4, validate: validate3 = () => true } = config4;
|
303245
|
+
const { required: required4, validate: validate3 = () => true, prefill = "tab" } = config4;
|
303020
303246
|
const theme = makeTheme(inputTheme, config4.theme);
|
303021
303247
|
const [status, setStatus] = useState("idle");
|
303022
303248
|
const [defaultValue = "", setDefaultValue] = useState(config4.default);
|
@@ -303056,6 +303282,12 @@ var esm_default2 = createPrompt((config4, done) => {
|
|
303056
303282
|
setError(undefined);
|
303057
303283
|
}
|
303058
303284
|
});
|
303285
|
+
useEffect((rl) => {
|
303286
|
+
if (prefill === "editable" && defaultValue) {
|
303287
|
+
rl.write(defaultValue);
|
303288
|
+
setValue(defaultValue);
|
303289
|
+
}
|
303290
|
+
}, []);
|
303059
303291
|
const message = theme.style.message(config4.message, status);
|
303060
303292
|
let formattedValue = value4;
|
303061
303293
|
if (typeof config4.transformer === "function") {
|
@@ -320557,7 +320789,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
320557
320789
|
try {
|
320558
320790
|
validate2(exports_external.string(), value4);
|
320559
320791
|
return true;
|
320560
|
-
} catch (
|
320792
|
+
} catch (_error) {
|
320561
320793
|
return "Invalid token name";
|
320562
320794
|
}
|
320563
320795
|
}
|
@@ -320610,7 +320842,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
320610
320842
|
try {
|
320611
320843
|
validate2(ApplicationAccessTokenSchema2, aat);
|
320612
320844
|
return aat;
|
320613
|
-
} catch (
|
320845
|
+
} catch (_error) {}
|
320614
320846
|
}
|
320615
320847
|
return esm_default5({
|
320616
320848
|
message: "What is the application access token for your application in SettleMint? (format: sm_aat_...)",
|
@@ -320618,7 +320850,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
320618
320850
|
try {
|
320619
320851
|
validate2(ApplicationAccessTokenSchema2, value4);
|
320620
320852
|
return true;
|
320621
|
-
} catch (
|
320853
|
+
} catch (_error) {
|
320622
320854
|
return "Invalid application access token, it should start with sm_aat_...";
|
320623
320855
|
}
|
320624
320856
|
}
|
@@ -321023,7 +321255,7 @@ async function instancePrompt({
|
|
321023
321255
|
try {
|
321024
321256
|
validate2(UrlSchema2, value4);
|
321025
321257
|
return true;
|
321026
|
-
} catch (
|
321258
|
+
} catch (_error) {
|
321027
321259
|
return "Invalid URL";
|
321028
321260
|
}
|
321029
321261
|
},
|
@@ -321107,7 +321339,7 @@ async function serviceUrlPrompt({
|
|
321107
321339
|
try {
|
321108
321340
|
validate2(UrlSchema2, value4);
|
321109
321341
|
return true;
|
321110
|
-
} catch (
|
321342
|
+
} catch (_error) {
|
321111
321343
|
return "Invalid URL";
|
321112
321344
|
}
|
321113
321345
|
},
|
@@ -322051,7 +322283,7 @@ async function projectNamePrompt(env2, argument) {
|
|
322051
322283
|
try {
|
322052
322284
|
validate2(exports_external.string(), value4);
|
322053
322285
|
return true;
|
322054
|
-
} catch (
|
322286
|
+
} catch (_error) {
|
322055
322287
|
return "Invalid projectname";
|
322056
322288
|
}
|
322057
322289
|
}
|
@@ -326039,7 +326271,7 @@ async function personalAccessTokenPrompt(env2, instance, accept) {
|
|
326039
326271
|
try {
|
326040
326272
|
validate2(PersonalAccessTokenSchema2, value4);
|
326041
326273
|
return true;
|
326042
|
-
} catch (
|
326274
|
+
} catch (_error) {
|
326043
326275
|
return "Invalid personal access token, it should start with sm_pat_...";
|
326044
326276
|
}
|
326045
326277
|
}
|
@@ -326120,7 +326352,7 @@ function loginCommand() {
|
|
326120
326352
|
});
|
326121
326353
|
try {
|
326122
326354
|
await loginSpinner(client);
|
326123
|
-
} catch (
|
326355
|
+
} catch (_error) {
|
326124
326356
|
cancel2(`Invalid personal access token for instance ${selectedInstance}`);
|
326125
326357
|
}
|
326126
326358
|
await storeCredentials(personalAccessToken, selectedInstance);
|
@@ -326270,13 +326502,17 @@ function addClusterServiceArgs(cmd2) {
|
|
326270
326502
|
// src/commands/platform/utils/wait-for-completion.ts
|
326271
326503
|
class TimeoutError2 extends Error {
|
326272
326504
|
}
|
326505
|
+
|
326506
|
+
class DeploymentFailedError extends Error {
|
326507
|
+
}
|
326273
326508
|
async function waitForCompletion({
|
326274
326509
|
settlemint,
|
326275
326510
|
type: type4,
|
326276
326511
|
uniqueName,
|
326277
326512
|
action,
|
326278
326513
|
maxTimeout = 10 * 60 * 1000,
|
326279
|
-
restartIfTimeout = false
|
326514
|
+
restartIfTimeout = false,
|
326515
|
+
restartOnError = false
|
326280
326516
|
}) {
|
326281
326517
|
const serviceType = SETTLEMINT_CLIENT_MAP[type4];
|
326282
326518
|
if (serviceType === "workspace" || serviceType === "application" || serviceType === "foundry" || serviceType === "applicationAccessToken" || serviceType === "platform" || serviceType === "wallet") {
|
@@ -326286,6 +326522,7 @@ async function waitForCompletion({
|
|
326286
326522
|
if (!service || !("read" in service)) {
|
326287
326523
|
throw new Error(`Service ${serviceType} does not support status checking`);
|
326288
326524
|
}
|
326525
|
+
let hasRestarted = false;
|
326289
326526
|
function showSpinner() {
|
326290
326527
|
return spinner({
|
326291
326528
|
startMessage: `Waiting for ${type4} to be ${getActionLabel(action)}`,
|
@@ -326295,33 +326532,20 @@ async function waitForCompletion({
|
|
326295
326532
|
while (true) {
|
326296
326533
|
try {
|
326297
326534
|
const resource = await service.read(uniqueName);
|
326298
|
-
if (resource.status === "COMPLETED") {
|
326299
|
-
if (spinner2) {
|
326300
|
-
spinner2.text = `${capitalizeFirstLetter2(type4)} is ${getActionLabel(action)}`;
|
326301
|
-
} else {
|
326302
|
-
note(`${capitalizeFirstLetter2(type4)} is ${getActionLabel(action)}`);
|
326303
|
-
}
|
326304
|
-
return true;
|
326305
|
-
}
|
326306
326535
|
if (resource.status === "FAILED") {
|
326307
|
-
|
326308
|
-
|
326309
|
-
|
326310
|
-
note(`${capitalizeFirstLetter2(type4)} failed to ${getActionLabel(action)}`);
|
326536
|
+
updateStatus(spinner2, `${capitalizeFirstLetter2(type4)} failed to ${getActionLabel(action)}`);
|
326537
|
+
if (restartOnError) {
|
326538
|
+
throw new DeploymentFailedError;
|
326311
326539
|
}
|
326312
326540
|
return false;
|
326313
326541
|
}
|
326314
|
-
if (
|
326315
|
-
spinner2
|
326316
|
-
|
326317
|
-
note(`${capitalizeFirstLetter2(type4)} is not ready yet (status: ${resource.status})`);
|
326318
|
-
}
|
326319
|
-
} catch (error45) {
|
326320
|
-
if (spinner2) {
|
326321
|
-
spinner2.text = `${capitalizeFirstLetter2(type4)} is not ready yet (status: UNKNOWN)`;
|
326322
|
-
} else {
|
326323
|
-
note(`${capitalizeFirstLetter2(type4)} is not ready yet (status: UNKNOWN)`);
|
326542
|
+
if (isActionComplete(action, resource.status)) {
|
326543
|
+
updateStatus(spinner2, `${capitalizeFirstLetter2(type4)} is ${getActionLabel(action)}`);
|
326544
|
+
return true;
|
326324
326545
|
}
|
326546
|
+
updateStatus(spinner2, `${capitalizeFirstLetter2(type4)} is not ready yet (status: ${resource.status})`);
|
326547
|
+
} catch (_error) {
|
326548
|
+
updateStatus(spinner2, `${capitalizeFirstLetter2(type4)} is not ready yet (status: UNKNOWN)`);
|
326325
326549
|
}
|
326326
326550
|
if (Date.now() - startTime > maxTimeout) {
|
326327
326551
|
throw new TimeoutError2(`Operation timed out after ${maxTimeout / 60000} minutes for ${type4} with unique name ${uniqueName}`);
|
@@ -326334,23 +326558,59 @@ async function waitForCompletion({
|
|
326334
326558
|
try {
|
326335
326559
|
return await showSpinner();
|
326336
326560
|
} catch (error45) {
|
326337
|
-
|
326338
|
-
if (restartIfTimeout && isTimeoutError) {
|
326561
|
+
if (!hasRestarted && shouldRestart(error45, restartIfTimeout)) {
|
326339
326562
|
note(`Restarting ${capitalizeFirstLetter2(type4)}`);
|
326563
|
+
hasRestarted = true;
|
326340
326564
|
await service.restart(uniqueName);
|
326341
326565
|
return showSpinner();
|
326342
326566
|
}
|
326343
326567
|
throw error45;
|
326344
326568
|
}
|
326345
326569
|
}
|
326346
|
-
function
|
326347
|
-
|
326348
|
-
|
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;
|
326349
326597
|
}
|
326350
|
-
|
326351
|
-
|
326598
|
+
}
|
326599
|
+
function getActionLabel(action) {
|
326600
|
+
switch (action) {
|
326601
|
+
case "restart":
|
326602
|
+
return "restarted";
|
326603
|
+
case "destroy":
|
326604
|
+
return "destroyed";
|
326605
|
+
case "pause":
|
326606
|
+
return "paused";
|
326607
|
+
case "resume":
|
326608
|
+
return "resumed";
|
326609
|
+
case "deploy":
|
326610
|
+
return "deployed";
|
326611
|
+
default:
|
326612
|
+
return "deployed";
|
326352
326613
|
}
|
326353
|
-
return "deployed";
|
326354
326614
|
}
|
326355
326615
|
|
326356
326616
|
// src/prompts/provider.prompt.ts
|
@@ -326431,9 +326691,9 @@ function getCreateCommand({
|
|
326431
326691
|
cmd2.alias(alias);
|
326432
326692
|
}
|
326433
326693
|
if (requiresDeployment) {
|
326434
|
-
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");
|
326435
326695
|
}
|
326436
|
-
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) => {
|
326437
326697
|
intro(`Creating ${type4} in the SettleMint platform`);
|
326438
326698
|
const env2 = await loadEnv(false, !!prod);
|
326439
326699
|
const instance = await instancePrompt({ env: env2, accept: acceptDefaults });
|
@@ -326447,8 +326707,8 @@ function getCreateCommand({
|
|
326447
326707
|
instance
|
326448
326708
|
});
|
326449
326709
|
const platformConfig = await settlemint.platform.config();
|
326450
|
-
let selectedProvider
|
326451
|
-
let selectedRegion
|
326710
|
+
let selectedProvider;
|
326711
|
+
let selectedRegion;
|
326452
326712
|
if (cmd2.options.some((option) => option.long === "--provider")) {
|
326453
326713
|
selectedProvider = await providerPrompt(platformConfig, provider);
|
326454
326714
|
if (!selectedProvider) {
|
@@ -326477,7 +326737,8 @@ function getCreateCommand({
|
|
326477
326737
|
type: waitFor?.resourceType ?? type4,
|
326478
326738
|
uniqueName: waitFor?.uniqueName ?? result.uniqueName,
|
326479
326739
|
action: "deploy",
|
326480
|
-
restartIfTimeout
|
326740
|
+
restartIfTimeout,
|
326741
|
+
restartOnError
|
326481
326742
|
});
|
326482
326743
|
if (!isDeployed) {
|
326483
326744
|
throw new Error(`Failed to deploy ${waitFor?.resourceType ?? type4} ${waitFor?.uniqueName ?? result.uniqueName}`);
|
@@ -327659,7 +327920,7 @@ function privateKeyHsmCreateCommand() {
|
|
327659
327920
|
return baseAction({
|
327660
327921
|
...defaultArgs,
|
327661
327922
|
acceptDefaults
|
327662
|
-
}, async ({ settlemint, env: env2, showSpinner, provider, region }) => {
|
327923
|
+
}, async ({ settlemint, env: env2, showSpinner, provider: _provider, region: _region }) => {
|
327663
327924
|
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
327664
327925
|
if (!applicationUniqueName) {
|
327665
327926
|
return missingApplication();
|
@@ -327948,25 +328209,256 @@ function deleteCommand() {
|
|
327948
328209
|
return new Command("delete").alias("d").description("Delete a resource in the SettleMint platform").addCommand(applicationDeleteCommand()).addCommand(workspaceDeleteCommand());
|
327949
328210
|
}
|
327950
328211
|
|
328212
|
+
// src/commands/platform/common/pause-command.ts
|
328213
|
+
function getPauseCommand({
|
328214
|
+
name: name3,
|
328215
|
+
type: type4,
|
328216
|
+
alias,
|
328217
|
+
envKey,
|
328218
|
+
pauseFunction,
|
328219
|
+
usePersonalAccessToken = true
|
328220
|
+
}) {
|
328221
|
+
const commandName = sanitizeCommandName(name3);
|
328222
|
+
const typeCommandName = sanitizeCommandName(type4);
|
328223
|
+
const exampleCommandPrefix = `platform pause ${typeCommandName !== commandName ? `${typeCommandName} ` : ""}${commandName}`;
|
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([
|
328225
|
+
{
|
328226
|
+
description: `Pauses the specified ${type4} by unique name`,
|
328227
|
+
command: `${exampleCommandPrefix} <unique-name>`
|
328228
|
+
},
|
328229
|
+
{
|
328230
|
+
description: `Pauses the default ${type4} in the production environment`,
|
328231
|
+
command: `${exampleCommandPrefix} default --prod`
|
328232
|
+
}
|
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 }) => {
|
328234
|
+
intro(`Pausing ${type4} in the SettleMint platform`);
|
328235
|
+
const env2 = await loadEnv(false, !!prod);
|
328236
|
+
const instance = await instancePrompt({ env: env2, accept: acceptDefaults });
|
328237
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
328238
|
+
env: env2,
|
328239
|
+
instance,
|
328240
|
+
prefer: usePersonalAccessToken ? "personal" : "application"
|
328241
|
+
});
|
328242
|
+
const settlemint = createSettleMintClient({
|
328243
|
+
accessToken,
|
328244
|
+
instance
|
328245
|
+
});
|
328246
|
+
const isDefaultUniqueName = uniqueName === "default";
|
328247
|
+
const serviceUniqueName = isDefaultUniqueName ? typeof env2[envKey] === "string" ? env2[envKey] : null : uniqueName;
|
328248
|
+
if (!serviceUniqueName) {
|
328249
|
+
cancel2(`No default ${type4} found in your .env file. Please provide a valid ${type4} unique name or set a default ${type4} first.`);
|
328250
|
+
}
|
328251
|
+
const result = await spinner({
|
328252
|
+
startMessage: `Pausing ${type4}`,
|
328253
|
+
task: async () => {
|
328254
|
+
return pauseFunction(settlemint, serviceUniqueName);
|
328255
|
+
},
|
328256
|
+
stopMessage: `${capitalizeFirstLetter2(type4)} pause initiated`
|
328257
|
+
});
|
328258
|
+
if (wait2) {
|
328259
|
+
const isPaused = await waitForCompletion({
|
328260
|
+
settlemint,
|
328261
|
+
type: type4,
|
328262
|
+
uniqueName: serviceUniqueName,
|
328263
|
+
action: "pause"
|
328264
|
+
});
|
328265
|
+
if (!isPaused) {
|
328266
|
+
throw new Error(`Failed to pause ${type4} ${serviceUniqueName}`);
|
328267
|
+
}
|
328268
|
+
}
|
328269
|
+
outro(`${capitalizeFirstLetter2(type4)} ${result.name} pause initiated successfully`);
|
328270
|
+
});
|
328271
|
+
}
|
328272
|
+
|
328273
|
+
// src/commands/platform/blockchain-network/pause.ts
|
328274
|
+
function blockchainNetworkPauseCommand() {
|
328275
|
+
return getPauseCommand({
|
328276
|
+
name: "blockchain-network",
|
328277
|
+
type: "blockchain network",
|
328278
|
+
alias: "bnw",
|
328279
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NETWORK",
|
328280
|
+
pauseFunction: async (settlemint, id) => {
|
328281
|
+
return settlemint.blockchainNetwork.pause(id);
|
328282
|
+
}
|
328283
|
+
});
|
328284
|
+
}
|
328285
|
+
|
328286
|
+
// src/commands/platform/blockchain-node/pause.ts
|
328287
|
+
function blockchainNodePauseCommand() {
|
328288
|
+
return getPauseCommand({
|
328289
|
+
name: "blockchain-node",
|
328290
|
+
type: "blockchain node",
|
328291
|
+
alias: "bn",
|
328292
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NODE",
|
328293
|
+
pauseFunction: async (settlemint, id) => {
|
328294
|
+
return settlemint.blockchainNode.pause(id);
|
328295
|
+
}
|
328296
|
+
});
|
328297
|
+
}
|
328298
|
+
|
328299
|
+
// src/commands/platform/custom-deployments/pause.ts
|
328300
|
+
function customDeploymentPauseCommand() {
|
328301
|
+
return getPauseCommand({
|
328302
|
+
name: "custom-deployment",
|
328303
|
+
type: "custom deployment",
|
328304
|
+
alias: "cd",
|
328305
|
+
envKey: "SETTLEMINT_CUSTOM_DEPLOYMENT",
|
328306
|
+
pauseFunction: async (settlemint, id) => {
|
328307
|
+
return settlemint.customDeployment.pause(id);
|
328308
|
+
}
|
328309
|
+
});
|
328310
|
+
}
|
328311
|
+
|
328312
|
+
// src/commands/platform/insights/blockscout/pause.ts
|
328313
|
+
function blockscoutPauseCommand() {
|
328314
|
+
return getPauseCommand({
|
328315
|
+
name: "blockscout",
|
328316
|
+
type: "insights",
|
328317
|
+
alias: "bs",
|
328318
|
+
envKey: "SETTLEMINT_BLOCKSCOUT",
|
328319
|
+
pauseFunction: async (settlemint, id) => {
|
328320
|
+
return settlemint.insights.pause(id);
|
328321
|
+
}
|
328322
|
+
});
|
328323
|
+
}
|
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
|
+
|
328330
|
+
// src/commands/platform/integration-tools/hasura/pause.ts
|
328331
|
+
function hasuraPauseCommand() {
|
328332
|
+
return getPauseCommand({
|
328333
|
+
name: "hasura",
|
328334
|
+
type: "integration tool",
|
328335
|
+
alias: "ha",
|
328336
|
+
envKey: "SETTLEMINT_HASURA",
|
328337
|
+
pauseFunction: async (settlemint, id) => {
|
328338
|
+
return settlemint.integrationTool.pause(id);
|
328339
|
+
}
|
328340
|
+
});
|
328341
|
+
}
|
328342
|
+
|
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() {
|
328350
|
+
return getPauseCommand({
|
328351
|
+
name: "evm",
|
328352
|
+
type: "load balancer",
|
328353
|
+
alias: "lb",
|
328354
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER",
|
328355
|
+
pauseFunction: async (settlemint, id) => {
|
328356
|
+
return settlemint.loadBalancer.pause(id);
|
328357
|
+
}
|
328358
|
+
});
|
328359
|
+
}
|
328360
|
+
|
328361
|
+
// src/commands/platform/middleware/graph/pause.ts
|
328362
|
+
function graphMiddlewarePauseCommand() {
|
328363
|
+
return getPauseCommand({
|
328364
|
+
name: "graph",
|
328365
|
+
type: "middleware",
|
328366
|
+
alias: "gr",
|
328367
|
+
envKey: "SETTLEMINT_THEGRAPH",
|
328368
|
+
pauseFunction: async (settlemint, id) => {
|
328369
|
+
return settlemint.middleware.pause(id);
|
328370
|
+
}
|
328371
|
+
});
|
328372
|
+
}
|
328373
|
+
|
328374
|
+
// src/commands/platform/middleware/smart-contract-portal/pause.ts
|
328375
|
+
function smartContractPortalMiddlewarePauseCommand() {
|
328376
|
+
return getPauseCommand({
|
328377
|
+
name: "smart-contract-portal",
|
328378
|
+
type: "middleware",
|
328379
|
+
alias: "scp",
|
328380
|
+
envKey: "SETTLEMINT_PORTAL",
|
328381
|
+
pauseFunction: async (settlemint, id) => {
|
328382
|
+
return settlemint.middleware.pause(id);
|
328383
|
+
}
|
328384
|
+
});
|
328385
|
+
}
|
328386
|
+
|
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());
|
328390
|
+
}
|
328391
|
+
|
328392
|
+
// src/commands/platform/private-key/pause.ts
|
328393
|
+
function privateKeyPauseCommand() {
|
328394
|
+
return getPauseCommand({
|
328395
|
+
name: "private-key",
|
328396
|
+
type: "private key",
|
328397
|
+
alias: "pk",
|
328398
|
+
envKey: "SETTLEMINT_ACCESSIBLE_PRIVATE_KEY",
|
328399
|
+
pauseFunction: async (settlemint, id) => {
|
328400
|
+
return settlemint.privateKey.pause(id);
|
328401
|
+
}
|
328402
|
+
});
|
328403
|
+
}
|
328404
|
+
|
328405
|
+
// src/commands/platform/storage/ipfs/pause.ts
|
328406
|
+
function ipfsStoragePauseCommand() {
|
328407
|
+
return getPauseCommand({
|
328408
|
+
name: "ipfs",
|
328409
|
+
type: "storage",
|
328410
|
+
alias: "ip",
|
328411
|
+
envKey: "SETTLEMINT_IPFS",
|
328412
|
+
pauseFunction: async (settlemint, id) => {
|
328413
|
+
return settlemint.storage.pause(id);
|
328414
|
+
}
|
328415
|
+
});
|
328416
|
+
}
|
328417
|
+
|
328418
|
+
// src/commands/platform/storage/minio/pause.ts
|
328419
|
+
function minioStoragePauseCommand() {
|
328420
|
+
return getPauseCommand({
|
328421
|
+
name: "minio",
|
328422
|
+
type: "storage",
|
328423
|
+
alias: "m",
|
328424
|
+
envKey: "SETTLEMINT_MINIO",
|
328425
|
+
pauseFunction: async (settlemint, id) => {
|
328426
|
+
return settlemint.storage.pause(id);
|
328427
|
+
}
|
328428
|
+
});
|
328429
|
+
}
|
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
|
+
|
328436
|
+
// src/commands/platform/pause.ts
|
328437
|
+
function pauseCommand() {
|
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());
|
328439
|
+
return cmd2;
|
328440
|
+
}
|
328441
|
+
|
327951
328442
|
// src/commands/platform/common/restart-command.ts
|
327952
328443
|
function getRestartCommand({
|
327953
328444
|
name: name3,
|
327954
328445
|
type: type4,
|
327955
|
-
subType,
|
327956
328446
|
alias,
|
327957
328447
|
envKey,
|
327958
328448
|
restartFunction,
|
327959
328449
|
usePersonalAccessToken = true
|
327960
328450
|
}) {
|
327961
328451
|
const commandName = sanitizeCommandName(name3);
|
328452
|
+
const typeCommandName = sanitizeCommandName(type4);
|
328453
|
+
const exampleCommandPrefix = `platform restart ${typeCommandName !== commandName ? `${typeCommandName} ` : ""}${commandName}`;
|
327962
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([
|
327963
328455
|
{
|
327964
|
-
description: `Restarts the specified ${type4} by
|
327965
|
-
command:
|
328456
|
+
description: `Restarts the specified ${type4} by unique name`,
|
328457
|
+
command: `${exampleCommandPrefix} <unique-name>`
|
327966
328458
|
},
|
327967
328459
|
{
|
327968
328460
|
description: `Restarts the default ${type4} in the production environment`,
|
327969
|
-
command:
|
328461
|
+
command: `${exampleCommandPrefix} default --prod`
|
327970
328462
|
}
|
327971
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 }) => {
|
327972
328464
|
intro(`Restarting ${type4} in the SettleMint platform`);
|
@@ -328053,7 +328545,6 @@ function blockscoutRestartCommand() {
|
|
328053
328545
|
return getRestartCommand({
|
328054
328546
|
name: "blockscout",
|
328055
328547
|
type: "insights",
|
328056
|
-
subType: "blockscout",
|
328057
328548
|
alias: "bs",
|
328058
328549
|
envKey: "SETTLEMINT_BLOCKSCOUT",
|
328059
328550
|
restartFunction: async (settlemint, uniqueName) => {
|
@@ -328072,7 +328563,6 @@ function hasuraRestartCommand() {
|
|
328072
328563
|
return getRestartCommand({
|
328073
328564
|
name: "hasura",
|
328074
328565
|
type: "integration tool",
|
328075
|
-
subType: "hasura",
|
328076
328566
|
alias: "ha",
|
328077
328567
|
envKey: "SETTLEMINT_HASURA",
|
328078
328568
|
restartFunction: async (settlemint, uniqueName) => {
|
@@ -328104,7 +328594,6 @@ function graphRestartCommand() {
|
|
328104
328594
|
return getRestartCommand({
|
328105
328595
|
name: "graph",
|
328106
328596
|
type: "middleware",
|
328107
|
-
subType: "graph",
|
328108
328597
|
alias: "gr",
|
328109
328598
|
envKey: "SETTLEMINT_THEGRAPH",
|
328110
328599
|
restartFunction: async (settlemint, id) => {
|
@@ -328118,7 +328607,6 @@ function smartContractPortalRestartCommand() {
|
|
328118
328607
|
return getRestartCommand({
|
328119
328608
|
name: "smart-contract-portal",
|
328120
328609
|
type: "middleware",
|
328121
|
-
subType: "smart-contract-portal",
|
328122
328610
|
alias: "scp",
|
328123
328611
|
envKey: "SETTLEMINT_PORTAL",
|
328124
328612
|
restartFunction: async (settlemint, uniqueName) => {
|
@@ -328169,6 +328657,236 @@ function restartCommand() {
|
|
328169
328657
|
return cmd2;
|
328170
328658
|
}
|
328171
328659
|
|
328660
|
+
// src/commands/platform/common/resume-command.ts
|
328661
|
+
function getResumeCommand({
|
328662
|
+
name: name3,
|
328663
|
+
type: type4,
|
328664
|
+
alias,
|
328665
|
+
envKey,
|
328666
|
+
resumeFunction,
|
328667
|
+
usePersonalAccessToken = true
|
328668
|
+
}) {
|
328669
|
+
const commandName = sanitizeCommandName(name3);
|
328670
|
+
const typeCommandName = sanitizeCommandName(type4);
|
328671
|
+
const exampleCommandPrefix = `platform resume ${typeCommandName !== commandName ? `${typeCommandName} ` : ""}${commandName}`;
|
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([
|
328673
|
+
{
|
328674
|
+
description: `Resumes the specified ${type4} by unique name`,
|
328675
|
+
command: `${exampleCommandPrefix} <unique-name>`
|
328676
|
+
},
|
328677
|
+
{
|
328678
|
+
description: `Resumes the default ${type4} in the production environment`,
|
328679
|
+
command: `${exampleCommandPrefix} default --prod`
|
328680
|
+
}
|
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 }) => {
|
328682
|
+
intro(`Resuming ${type4} in the SettleMint platform`);
|
328683
|
+
const env2 = await loadEnv(false, !!prod);
|
328684
|
+
const instance = await instancePrompt({ env: env2, accept: acceptDefaults });
|
328685
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
328686
|
+
env: env2,
|
328687
|
+
instance,
|
328688
|
+
prefer: usePersonalAccessToken ? "personal" : "application"
|
328689
|
+
});
|
328690
|
+
const settlemint = createSettleMintClient({
|
328691
|
+
accessToken,
|
328692
|
+
instance
|
328693
|
+
});
|
328694
|
+
const isDefaultUniqueName = uniqueName === "default";
|
328695
|
+
const serviceUniqueName = isDefaultUniqueName ? typeof env2[envKey] === "string" ? env2[envKey] : null : uniqueName;
|
328696
|
+
if (!serviceUniqueName) {
|
328697
|
+
cancel2(`No default ${type4} found in your .env file. Please provide a valid ${type4} unique name or set a default ${type4} first.`);
|
328698
|
+
}
|
328699
|
+
const result = await spinner({
|
328700
|
+
startMessage: `Resuming ${type4}`,
|
328701
|
+
task: async () => {
|
328702
|
+
return resumeFunction(settlemint, serviceUniqueName);
|
328703
|
+
},
|
328704
|
+
stopMessage: `${capitalizeFirstLetter2(type4)} resume initiated`
|
328705
|
+
});
|
328706
|
+
if (wait2) {
|
328707
|
+
const isResumed = await waitForCompletion({
|
328708
|
+
settlemint,
|
328709
|
+
type: type4,
|
328710
|
+
uniqueName: serviceUniqueName,
|
328711
|
+
action: "resume"
|
328712
|
+
});
|
328713
|
+
if (!isResumed) {
|
328714
|
+
throw new Error(`Failed to resume ${type4} ${serviceUniqueName}`);
|
328715
|
+
}
|
328716
|
+
}
|
328717
|
+
outro(`${capitalizeFirstLetter2(type4)} ${result.name} resume initiated successfully`);
|
328718
|
+
});
|
328719
|
+
}
|
328720
|
+
|
328721
|
+
// src/commands/platform/blockchain-network/resume.ts
|
328722
|
+
function blockchainNetworkResumeCommand() {
|
328723
|
+
return getResumeCommand({
|
328724
|
+
name: "blockchain-network",
|
328725
|
+
type: "blockchain network",
|
328726
|
+
alias: "bnw",
|
328727
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NETWORK",
|
328728
|
+
resumeFunction: async (settlemint, id) => {
|
328729
|
+
return settlemint.blockchainNetwork.resume(id);
|
328730
|
+
}
|
328731
|
+
});
|
328732
|
+
}
|
328733
|
+
|
328734
|
+
// src/commands/platform/blockchain-node/resume.ts
|
328735
|
+
function blockchainNodeResumeCommand() {
|
328736
|
+
return getResumeCommand({
|
328737
|
+
name: "blockchain-node",
|
328738
|
+
type: "blockchain node",
|
328739
|
+
alias: "bn",
|
328740
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NODE",
|
328741
|
+
resumeFunction: async (settlemint, id) => {
|
328742
|
+
return settlemint.blockchainNode.resume(id);
|
328743
|
+
}
|
328744
|
+
});
|
328745
|
+
}
|
328746
|
+
|
328747
|
+
// src/commands/platform/custom-deployments/resume.ts
|
328748
|
+
function customDeploymentResumeCommand() {
|
328749
|
+
return getResumeCommand({
|
328750
|
+
name: "custom-deployment",
|
328751
|
+
type: "custom deployment",
|
328752
|
+
alias: "cd",
|
328753
|
+
envKey: "SETTLEMINT_CUSTOM_DEPLOYMENT",
|
328754
|
+
resumeFunction: async (settlemint, id) => {
|
328755
|
+
return settlemint.customDeployment.resume(id);
|
328756
|
+
}
|
328757
|
+
});
|
328758
|
+
}
|
328759
|
+
|
328760
|
+
// src/commands/platform/insights/blockscout/resume.ts
|
328761
|
+
function blockscoutResumeCommand() {
|
328762
|
+
return getResumeCommand({
|
328763
|
+
name: "blockscout",
|
328764
|
+
type: "insights",
|
328765
|
+
alias: "bs",
|
328766
|
+
envKey: "SETTLEMINT_BLOCKSCOUT",
|
328767
|
+
resumeFunction: async (settlemint, id) => {
|
328768
|
+
return settlemint.insights.resume(id);
|
328769
|
+
}
|
328770
|
+
});
|
328771
|
+
}
|
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
|
+
|
328778
|
+
// src/commands/platform/integration-tools/hasura/resume.ts
|
328779
|
+
function hasuraResumeCommand() {
|
328780
|
+
return getResumeCommand({
|
328781
|
+
name: "hasura",
|
328782
|
+
type: "integration tool",
|
328783
|
+
alias: "ha",
|
328784
|
+
envKey: "SETTLEMINT_HASURA",
|
328785
|
+
resumeFunction: async (settlemint, id) => {
|
328786
|
+
return settlemint.integrationTool.resume(id);
|
328787
|
+
}
|
328788
|
+
});
|
328789
|
+
}
|
328790
|
+
|
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() {
|
328798
|
+
return getResumeCommand({
|
328799
|
+
name: "load-balancer",
|
328800
|
+
type: "load balancer",
|
328801
|
+
alias: "lb",
|
328802
|
+
envKey: "SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER",
|
328803
|
+
resumeFunction: async (settlemint, id) => {
|
328804
|
+
return settlemint.loadBalancer.resume(id);
|
328805
|
+
}
|
328806
|
+
});
|
328807
|
+
}
|
328808
|
+
|
328809
|
+
// src/commands/platform/middleware/graph/resume.ts
|
328810
|
+
function graphMiddlewareResumeCommand() {
|
328811
|
+
return getResumeCommand({
|
328812
|
+
name: "graph",
|
328813
|
+
type: "middleware",
|
328814
|
+
alias: "gr",
|
328815
|
+
envKey: "SETTLEMINT_THEGRAPH",
|
328816
|
+
resumeFunction: async (settlemint, id) => {
|
328817
|
+
return settlemint.middleware.resume(id);
|
328818
|
+
}
|
328819
|
+
});
|
328820
|
+
}
|
328821
|
+
|
328822
|
+
// src/commands/platform/middleware/smart-contract-portal/resume.ts
|
328823
|
+
function smartContractPortalMiddlewareResumeCommand() {
|
328824
|
+
return getResumeCommand({
|
328825
|
+
name: "smart-contract-portal",
|
328826
|
+
type: "middleware",
|
328827
|
+
alias: "scp",
|
328828
|
+
envKey: "SETTLEMINT_PORTAL",
|
328829
|
+
resumeFunction: async (settlemint, id) => {
|
328830
|
+
return settlemint.middleware.resume(id);
|
328831
|
+
}
|
328832
|
+
});
|
328833
|
+
}
|
328834
|
+
|
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());
|
328838
|
+
}
|
328839
|
+
|
328840
|
+
// src/commands/platform/private-key/resume.ts
|
328841
|
+
function privateKeyResumeCommand() {
|
328842
|
+
return getResumeCommand({
|
328843
|
+
name: "private-key",
|
328844
|
+
type: "private key",
|
328845
|
+
alias: "pk",
|
328846
|
+
envKey: "SETTLEMINT_ACCESSIBLE_PRIVATE_KEY",
|
328847
|
+
resumeFunction: async (settlemint, id) => {
|
328848
|
+
return settlemint.privateKey.resume(id);
|
328849
|
+
}
|
328850
|
+
});
|
328851
|
+
}
|
328852
|
+
|
328853
|
+
// src/commands/platform/storage/ipfs/resume.ts
|
328854
|
+
function ipfsStorageResumeCommand() {
|
328855
|
+
return getResumeCommand({
|
328856
|
+
name: "ipfs",
|
328857
|
+
type: "storage",
|
328858
|
+
alias: "ip",
|
328859
|
+
envKey: "SETTLEMINT_IPFS",
|
328860
|
+
resumeFunction: async (settlemint, id) => {
|
328861
|
+
return settlemint.storage.resume(id);
|
328862
|
+
}
|
328863
|
+
});
|
328864
|
+
}
|
328865
|
+
|
328866
|
+
// src/commands/platform/storage/minio/resume.ts
|
328867
|
+
function minioStorageResumeCommand() {
|
328868
|
+
return getResumeCommand({
|
328869
|
+
name: "minio",
|
328870
|
+
type: "storage",
|
328871
|
+
alias: "m",
|
328872
|
+
envKey: "SETTLEMINT_MINIO",
|
328873
|
+
resumeFunction: async (settlemint, id) => {
|
328874
|
+
return settlemint.storage.resume(id);
|
328875
|
+
}
|
328876
|
+
});
|
328877
|
+
}
|
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
|
+
|
328884
|
+
// src/commands/platform/resume.ts
|
328885
|
+
function resumeCommand() {
|
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());
|
328887
|
+
return cmd2;
|
328888
|
+
}
|
328889
|
+
|
328172
328890
|
// src/commands/platform/custom-deployments/update.ts
|
328173
328891
|
function customDeploymentsUpdateCommand() {
|
328174
328892
|
return new Command("custom-deployment").alias("cd").argument("<tag>", "The tag to update the custom deployment to").option("--unique-name <uniqueName>", "The unique name of the custom deployment to update. If not provided, will use SETTLEMINT_CUSTOM_DEPLOYMENT from env").option("--prod", "Connect to your production environment").option("--wait", "Wait for the custom deployment to be redeployed").description("Update a custom deployment in the SettleMint platform").usage(createExamples([
|
@@ -328559,7 +329277,7 @@ function servicesCommand() {
|
|
328559
329277
|
if (!applicationUniqueName) {
|
328560
329278
|
return nothingSelectedError("application");
|
328561
329279
|
}
|
328562
|
-
let effectiveTypes
|
329280
|
+
let effectiveTypes;
|
328563
329281
|
if (options.type && options.type.length > 0) {
|
328564
329282
|
effectiveTypes = options.type;
|
328565
329283
|
} else if (typeOperands && typeOperands.length > 0) {
|
@@ -328617,7 +329335,7 @@ async function getServicesAndMapResults({
|
|
328617
329335
|
const application = await settlemint.application.read(applicationUniqueName);
|
328618
329336
|
const services = await servicesSpinner(settlemint, applicationUniqueName, types4);
|
328619
329337
|
const results = (types4 ?? SERVICE_TYPES).filter((serviceType) => !types4 || types4.includes(serviceType)).map((serviceType) => {
|
328620
|
-
const [_6, labels] = Object.entries(LABELS_MAP).find(([
|
329338
|
+
const [_6, labels] = Object.entries(LABELS_MAP).find(([_key, value4]) => value4.command === serviceType) ?? [
|
328621
329339
|
null,
|
328622
329340
|
{ plural: serviceType }
|
328623
329341
|
];
|
@@ -328744,7 +329462,7 @@ function listCommand() {
|
|
328744
329462
|
|
328745
329463
|
// src/commands/platform.ts
|
328746
329464
|
function platformCommand() {
|
328747
|
-
return new Command("platform").description("Manage SettleMint platform resources").addCommand(configCommand()).addCommand(createCommand3()).addCommand(deleteCommand()).addCommand(listCommand()).addCommand(restartCommand()).addCommand(updateCommand());
|
329465
|
+
return new Command("platform").description("Manage SettleMint platform resources").addCommand(configCommand()).addCommand(createCommand3()).addCommand(deleteCommand()).addCommand(listCommand()).addCommand(pauseCommand()).addCommand(resumeCommand()).addCommand(restartCommand()).addCommand(updateCommand());
|
328748
329466
|
}
|
328749
329467
|
|
328750
329468
|
// src/commands/smart-contract-set/create.ts
|
@@ -328794,7 +329512,7 @@ var import_which = __toESM(require_lib5(), 1);
|
|
328794
329512
|
async function executeFoundryCommand(command, args) {
|
328795
329513
|
try {
|
328796
329514
|
await import_which.default(command);
|
328797
|
-
} catch (
|
329515
|
+
} catch (_error) {
|
328798
329516
|
cancel2("Foundry is not installed. Instructions to install Foundry can be found here: https://book.getfoundry.sh/getting-started/installation");
|
328799
329517
|
}
|
328800
329518
|
return executeCommand(command, args);
|
@@ -328882,7 +329600,7 @@ function foundryBuildCommand() {
|
|
328882
329600
|
description: "Build the smart contracts with additional Forge options",
|
328883
329601
|
command: "scs foundry build --optimize --force"
|
328884
329602
|
}
|
328885
|
-
])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options,
|
329603
|
+
])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, _cmd) => {
|
328886
329604
|
intro("Building smart contracts using Foundry");
|
328887
329605
|
const forgeOptions = mapPassthroughOptions(options, { args: operands });
|
328888
329606
|
await executeFoundryCommand("forge", ["build", ...forgeOptions]);
|
@@ -328905,7 +329623,7 @@ function foundryFormatCommand() {
|
|
328905
329623
|
description: "Format the smart contracts with additional Forge options",
|
328906
329624
|
command: "scs foundry format --check"
|
328907
329625
|
}
|
328908
|
-
])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options,
|
329626
|
+
])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, _cmd) => {
|
328909
329627
|
intro("Formatting smart contracts using Foundry");
|
328910
329628
|
const forgeOptions = mapPassthroughOptions(options, { args: operands });
|
328911
329629
|
await executeFoundryCommand("forge", ["fmt", ...forgeOptions]);
|
@@ -328928,7 +329646,7 @@ function foundryNetworkCommand() {
|
|
328928
329646
|
description: "Start a development network using Foundry with a specific port",
|
328929
329647
|
command: "scs foundry network --port 3000"
|
328930
329648
|
}
|
328931
|
-
])).helpOption(false).option("-h, --help", "Get list of possible anvil options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options,
|
329649
|
+
])).helpOption(false).option("-h, --help", "Get list of possible anvil options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, _cmd) => {
|
328932
329650
|
const anvilOptions = mapPassthroughOptions(options, { args: operands });
|
328933
329651
|
await executeFoundryCommand("anvil", anvilOptions);
|
328934
329652
|
});
|
@@ -328949,7 +329667,7 @@ function foundryTestCommand() {
|
|
328949
329667
|
description: "Run a specific test function",
|
328950
329668
|
command: "scs foundry test --match-test testToken"
|
328951
329669
|
}
|
328952
|
-
])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options,
|
329670
|
+
])).helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, _cmd) => {
|
328953
329671
|
intro("Running smart contract tests using Foundry");
|
328954
329672
|
const forgeOptions = mapPassthroughOptions(options, { args: operands });
|
328955
329673
|
await executeFoundryCommand("forge", ["test", ...forgeOptions]);
|
@@ -328963,7 +329681,7 @@ var validateIfRequiredPackagesAreInstalled = async (packages, cwd2) => {
|
|
328963
329681
|
try {
|
328964
329682
|
const isInstalled = await isPackageInstalled(pkg, cwd2);
|
328965
329683
|
return { packageName: pkg, isInstalled };
|
328966
|
-
} catch (
|
329684
|
+
} catch (_err) {
|
328967
329685
|
return { packageName: pkg, isInstalled: false };
|
328968
329686
|
}
|
328969
329687
|
}));
|
@@ -328988,7 +329706,7 @@ function hardhatBuildCommand() {
|
|
328988
329706
|
description: "Build the smart contracts using additional options to the Hardhat compile command",
|
328989
329707
|
command: "scs hardhat build --concurrency 2"
|
328990
329708
|
}
|
328991
|
-
])).helpOption(false).option("-h, --help", "Get list of possible hardhat compile options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options,
|
329709
|
+
])).helpOption(false).option("-h, --help", "Get list of possible hardhat compile options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, _cmd) => {
|
328992
329710
|
intro("Building smart contracts using Hardhat");
|
328993
329711
|
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
328994
329712
|
const hardhatOptions = mapPassthroughOptions(options, { args: operands });
|
@@ -329059,7 +329777,7 @@ async function selectTargetNode({
|
|
329059
329777
|
settlemint
|
329060
329778
|
}) {
|
329061
329779
|
const nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
|
329062
|
-
let node
|
329780
|
+
let node;
|
329063
329781
|
if (!nodeUniqueName) {
|
329064
329782
|
if (!env2.SETTLEMINT_APPLICATION) {
|
329065
329783
|
return missingApplication();
|
@@ -329283,7 +330001,7 @@ function hardhatDeployRemoteCommand() {
|
|
329283
330001
|
} else {
|
329284
330002
|
note("Smart contract deployment was cancelled");
|
329285
330003
|
}
|
329286
|
-
} catch (
|
330004
|
+
} catch (_error) {
|
329287
330005
|
cancel2("The smart contract deployment was unsuccessful. Please check the error details above and try again. You may need to review your contract code or deployment configuration.");
|
329288
330006
|
}
|
329289
330007
|
});
|
@@ -329313,7 +330031,7 @@ function hardhatNetworkCommand() {
|
|
329313
330031
|
description: "Start a development network using Hardhat with a specific port",
|
329314
330032
|
command: "scs hardhat network --port 3000"
|
329315
330033
|
}
|
329316
|
-
])).helpOption(false).option("-h, --help", "Get list of possible hardhat node options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options,
|
330034
|
+
])).helpOption(false).option("-h, --help", "Get list of possible hardhat node options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, _cmd) => {
|
329317
330035
|
intro("Starting development network using Hardhat");
|
329318
330036
|
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
329319
330037
|
const hardhatOptions = mapPassthroughOptions(options, { args: operands });
|
@@ -329422,7 +330140,7 @@ function hardhatTestCommand() {
|
|
329422
330140
|
description: "Run a specific test file",
|
329423
330141
|
command: "scs hardhat test test/token.test.ts"
|
329424
330142
|
}
|
329425
|
-
])).helpOption(false).option("-h, --help", "Get list of possible hardhat test options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options,
|
330143
|
+
])).helpOption(false).option("-h, --help", "Get list of possible hardhat test options").passThroughOptions().allowUnknownOption(true).arguments("[operands...]").action(async (operands, options, _cmd) => {
|
329426
330144
|
intro("Running smart contract tests using Hardhat");
|
329427
330145
|
await validateIfRequiredPackagesAreInstalled(["hardhat"]);
|
329428
330146
|
const hardhatOptions = mapPassthroughOptions(options, { args: operands });
|
@@ -329680,12 +330398,12 @@ async function getNodeName({
|
|
329680
330398
|
|
329681
330399
|
// src/commands/smart-contract-set/subgraph/build.ts
|
329682
330400
|
function subgraphBuildCommand() {
|
329683
|
-
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([
|
329684
330402
|
{
|
329685
330403
|
description: "Build the subgraph",
|
329686
330404
|
command: "scs subgraph build"
|
329687
330405
|
}
|
329688
|
-
])).action(async () => {
|
330406
|
+
])).action(async ({ ipfs }) => {
|
329689
330407
|
intro("Building subgraph");
|
329690
330408
|
await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
|
329691
330409
|
await subgraphSetup({
|
@@ -329694,7 +330412,7 @@ function subgraphBuildCommand() {
|
|
329694
330412
|
const { command, args } = await getPackageManagerExecutable();
|
329695
330413
|
const subgraphYamlFile = await getSubgraphYamlFile();
|
329696
330414
|
await executeCommand(command, [...args, "graph", "codegen", subgraphYamlFile]);
|
329697
|
-
await executeCommand(command, [...args, "graph", "build", subgraphYamlFile]);
|
330415
|
+
await executeCommand(command, [...args, "graph", "build", ...ipfs ? ["--ipfs", ipfs] : [], subgraphYamlFile]);
|
329698
330416
|
outro("Subgraph built successfully");
|
329699
330417
|
});
|
329700
330418
|
}
|
@@ -330090,4 +330808,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
330090
330808
|
// src/cli.ts
|
330091
330809
|
sdkCliCommand();
|
330092
330810
|
|
330093
|
-
//# debugId=
|
330811
|
+
//# debugId=78AB54BC3249E17164756E2164756E21
|