@layr-labs/ecloud-cli 0.2.0-dev.1 → 0.2.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION +2 -2
- package/dist/commands/auth/generate.js +2 -2
- package/dist/commands/auth/generate.js.map +1 -1
- package/dist/commands/auth/login.js.map +1 -1
- package/dist/commands/auth/logout.js.map +1 -1
- package/dist/commands/auth/migrate.js.map +1 -1
- package/dist/commands/auth/whoami.js +3 -5
- package/dist/commands/auth/whoami.js.map +1 -1
- package/dist/commands/billing/cancel.js +3 -6
- package/dist/commands/billing/cancel.js.map +1 -1
- package/dist/commands/billing/status.js +3 -6
- package/dist/commands/billing/status.js.map +1 -1
- package/dist/commands/billing/subscribe.js +7 -12
- package/dist/commands/billing/subscribe.js.map +1 -1
- package/dist/commands/compute/app/create.js.map +1 -1
- package/dist/commands/compute/app/deploy.js +86 -614
- package/dist/commands/compute/app/deploy.js.map +1 -1
- package/dist/commands/compute/app/info.js +10 -59
- package/dist/commands/compute/app/info.js.map +1 -1
- package/dist/commands/compute/app/list.js +9 -10
- package/dist/commands/compute/app/list.js.map +1 -1
- package/dist/commands/compute/app/logs.js +11 -61
- package/dist/commands/compute/app/logs.js.map +1 -1
- package/dist/commands/compute/app/profile/set.js +20 -145
- package/dist/commands/compute/app/profile/set.js.map +1 -1
- package/dist/commands/compute/app/start.js +11 -61
- package/dist/commands/compute/app/start.js.map +1 -1
- package/dist/commands/compute/app/stop.js +11 -61
- package/dist/commands/compute/app/stop.js.map +1 -1
- package/dist/commands/compute/app/terminate.js +11 -61
- package/dist/commands/compute/app/terminate.js.map +1 -1
- package/dist/commands/compute/app/upgrade.js +52 -615
- package/dist/commands/compute/app/upgrade.js.map +1 -1
- package/dist/commands/compute/environment/list.js.map +1 -1
- package/dist/commands/compute/environment/set.js.map +1 -1
- package/dist/commands/compute/environment/show.js.map +1 -1
- package/dist/commands/compute/undelegate.js +9 -11
- package/dist/commands/compute/undelegate.js.map +1 -1
- package/dist/commands/telemetry/disable.js.map +1 -1
- package/dist/commands/telemetry/enable.js.map +1 -1
- package/dist/commands/telemetry/status.js.map +1 -1
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/commands/version.js.map +1 -1
- package/package.json +2 -7
- package/dist/commands/compute/app/releases.js +0 -1111
- package/dist/commands/compute/app/releases.js.map +0 -1
- package/dist/commands/compute/build/info.js +0 -500
- package/dist/commands/compute/build/info.js.map +0 -1
- package/dist/commands/compute/build/list.js +0 -494
- package/dist/commands/compute/build/list.js.map +0 -1
- package/dist/commands/compute/build/logs.js +0 -459
- package/dist/commands/compute/build/logs.js.map +0 -1
- package/dist/commands/compute/build/status.js +0 -481
- package/dist/commands/compute/build/status.js.map +0 -1
- package/dist/commands/compute/build/submit.js +0 -618
- package/dist/commands/compute/build/submit.js.map +0 -1
- package/dist/commands/compute/build/verify.js +0 -439
- package/dist/commands/compute/build/verify.js.map +0 -1
|
@@ -8,7 +8,6 @@ import { getEnvironmentConfig as getEnvironmentConfig3 } from "@layr-labs/ecloud
|
|
|
8
8
|
import {
|
|
9
9
|
createComputeModule,
|
|
10
10
|
createBillingModule,
|
|
11
|
-
createBuildModule,
|
|
12
11
|
getEnvironmentConfig as getEnvironmentConfig2,
|
|
13
12
|
requirePrivateKey,
|
|
14
13
|
getPrivateKeyWithSource
|
|
@@ -16,7 +15,6 @@ import {
|
|
|
16
15
|
|
|
17
16
|
// src/flags.ts
|
|
18
17
|
import { Flags } from "@oclif/core";
|
|
19
|
-
import { getBuildType as getBuildType2 } from "@layr-labs/ecloud-sdk";
|
|
20
18
|
|
|
21
19
|
// src/utils/prompts.ts
|
|
22
20
|
import { input, select, password, confirm as inquirerConfirm } from "@inquirer/prompts";
|
|
@@ -98,27 +96,6 @@ function saveGlobalConfig(config) {
|
|
|
98
96
|
const content = dumpYaml(config, { lineWidth: -1 });
|
|
99
97
|
fs.writeFileSync(configPath, content, { mode: 420 });
|
|
100
98
|
}
|
|
101
|
-
function normalizeDirectoryPath(directoryPath) {
|
|
102
|
-
const resolved = path.resolve(directoryPath);
|
|
103
|
-
try {
|
|
104
|
-
return fs.realpathSync(resolved);
|
|
105
|
-
} catch {
|
|
106
|
-
return resolved;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
function getLinkedAppForDirectory(environment, directoryPath) {
|
|
110
|
-
if (!directoryPath) {
|
|
111
|
-
return null;
|
|
112
|
-
}
|
|
113
|
-
const config = loadGlobalConfig();
|
|
114
|
-
const links = config.directory_links?.[environment];
|
|
115
|
-
if (!links) {
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
const normalizedPath = normalizeDirectoryPath(directoryPath);
|
|
119
|
-
const appId = links[normalizedPath];
|
|
120
|
-
return appId || null;
|
|
121
|
-
}
|
|
122
99
|
function getDefaultEnvironment() {
|
|
123
100
|
const config = loadGlobalConfig();
|
|
124
101
|
return config.default_environment;
|
|
@@ -215,7 +192,7 @@ function listApps(environment) {
|
|
|
215
192
|
|
|
216
193
|
// src/utils/version.ts
|
|
217
194
|
function getCliVersion() {
|
|
218
|
-
return true ? "0.2.0-dev.
|
|
195
|
+
return true ? "0.2.0-dev.2" : "0.0.0";
|
|
219
196
|
}
|
|
220
197
|
function getClientId() {
|
|
221
198
|
return `ecloud-cli/v${getCliVersion()}`;
|
|
@@ -244,9 +221,6 @@ function addHexPrefix(value) {
|
|
|
244
221
|
}
|
|
245
222
|
return `0x${value}`;
|
|
246
223
|
}
|
|
247
|
-
function getCurrentProjectPath() {
|
|
248
|
-
return process.env.INIT_CWD || process.cwd();
|
|
249
|
-
}
|
|
250
224
|
var ContractAppStatusStarted = 1;
|
|
251
225
|
var ContractAppStatusStopped = 2;
|
|
252
226
|
var ContractAppStatusTerminated = 3;
|
|
@@ -385,7 +359,6 @@ Select an app to ${action}:
|
|
|
385
359
|
switch (action) {
|
|
386
360
|
case "view":
|
|
387
361
|
case "view info for":
|
|
388
|
-
case "view releases for":
|
|
389
362
|
case "set profile for":
|
|
390
363
|
return true;
|
|
391
364
|
case "start":
|
|
@@ -414,19 +387,7 @@ Select an app to ${action}:
|
|
|
414
387
|
index: i
|
|
415
388
|
});
|
|
416
389
|
}
|
|
417
|
-
const linkedAppId = getLinkedAppForDirectory(environment, getCurrentProjectPath());
|
|
418
|
-
const normalizedLinkedAppId = linkedAppId ? linkedAppId.toLowerCase() : "";
|
|
419
390
|
appItems.sort((a, b) => {
|
|
420
|
-
if (normalizedLinkedAppId) {
|
|
421
|
-
const aLinked = String(a.addr).toLowerCase() === normalizedLinkedAppId;
|
|
422
|
-
const bLinked = String(b.addr).toLowerCase() === normalizedLinkedAppId;
|
|
423
|
-
if (aLinked && !bLinked) {
|
|
424
|
-
return -1;
|
|
425
|
-
}
|
|
426
|
-
if (bLinked && !aLinked) {
|
|
427
|
-
return 1;
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
391
|
const aPriority = getStatusPriority(a.status, false);
|
|
431
392
|
const bPriority = getStatusPriority(b.status, false);
|
|
432
393
|
if (aPriority !== bPriority) {
|
|
@@ -492,18 +453,7 @@ async function getAppIDInteractiveFromRegistry(environment, action) {
|
|
|
492
453
|
}
|
|
493
454
|
throw new Error(`Invalid app ID address: ${appIDInput}`);
|
|
494
455
|
}
|
|
495
|
-
const
|
|
496
|
-
const linkedAppId = getLinkedAppForDirectory(environment, getCurrentProjectPath());
|
|
497
|
-
if (linkedAppId) {
|
|
498
|
-
const linkedIndex = entries.findIndex(
|
|
499
|
-
([, appId]) => String(appId).toLowerCase() === linkedAppId.toLowerCase()
|
|
500
|
-
);
|
|
501
|
-
if (linkedIndex > 0) {
|
|
502
|
-
const [linkedEntry] = entries.splice(linkedIndex, 1);
|
|
503
|
-
entries.unshift(linkedEntry);
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
const choices = entries.map(([name, appID]) => {
|
|
456
|
+
const choices = Object.entries(allApps).map(([name, appID]) => {
|
|
507
457
|
const displayName = `${name} (${appID})`;
|
|
508
458
|
return { name: displayName, value: appID };
|
|
509
459
|
});
|
|
@@ -622,8 +572,7 @@ var commonFlags = {
|
|
|
622
572
|
environment: Flags.string({
|
|
623
573
|
required: false,
|
|
624
574
|
description: "Deployment environment to use",
|
|
625
|
-
env: "ECLOUD_ENV"
|
|
626
|
-
default: async () => getDefaultEnvironment() || (getBuildType2() === "dev" ? "sepolia-dev" : "sepolia")
|
|
575
|
+
env: "ECLOUD_ENV"
|
|
627
576
|
}),
|
|
628
577
|
"private-key": Flags.string({
|
|
629
578
|
required: false,
|
|
@@ -641,11 +590,12 @@ var commonFlags = {
|
|
|
641
590
|
default: false
|
|
642
591
|
})
|
|
643
592
|
};
|
|
644
|
-
async function validateCommonFlags(flags
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
flags["private-key"] = await getPrivateKeyInteractive(flags["private-key"]);
|
|
593
|
+
async function validateCommonFlags(flags) {
|
|
594
|
+
if (!flags["environment"]) {
|
|
595
|
+
flags["environment"] = getDefaultEnvironment();
|
|
648
596
|
}
|
|
597
|
+
flags["environment"] = await getEnvironmentInteractive(flags["environment"]);
|
|
598
|
+
flags["private-key"] = await getPrivateKeyInteractive(flags["private-key"]);
|
|
649
599
|
return flags;
|
|
650
600
|
}
|
|
651
601
|
|
|
@@ -680,7 +630,7 @@ import {
|
|
|
680
630
|
addMetric,
|
|
681
631
|
addMetricWithDimensions,
|
|
682
632
|
emitMetrics,
|
|
683
|
-
getBuildType as
|
|
633
|
+
getBuildType as getBuildType2
|
|
684
634
|
} from "@layr-labs/ecloud-sdk";
|
|
685
635
|
function createCLITelemetryClient() {
|
|
686
636
|
const userUUID = getOrCreateUserUUID();
|
|
@@ -698,7 +648,7 @@ async function withTelemetry(command, action) {
|
|
|
698
648
|
metrics.properties["command"] = command.id || command.constructor.name;
|
|
699
649
|
const environment = getDefaultEnvironment() || "sepolia";
|
|
700
650
|
metrics.properties["environment"] = environment;
|
|
701
|
-
const buildType =
|
|
651
|
+
const buildType = getBuildType2() || "prod";
|
|
702
652
|
metrics.properties["build_type"] = buildType;
|
|
703
653
|
const cliVersion = command.config.version;
|
|
704
654
|
if (cliVersion) {
|
|
@@ -751,7 +701,7 @@ var AppLogs = class _AppLogs extends Command {
|
|
|
751
701
|
return withTelemetry(this, async () => {
|
|
752
702
|
const { args, flags } = await this.parse(_AppLogs);
|
|
753
703
|
const compute = await createComputeClient(flags);
|
|
754
|
-
const environment = flags.environment;
|
|
704
|
+
const environment = flags.environment || "sepolia";
|
|
755
705
|
const environmentConfig = getEnvironmentConfig3(environment);
|
|
756
706
|
const rpcUrl = flags["rpc-url"] || environmentConfig.defaultRPCURL;
|
|
757
707
|
const appID = await getOrPromptAppID({
|