@layr-labs/ecloud-cli 0.4.3 → 0.5.0-dev.3
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/login.js +84 -54
- package/dist/commands/auth/login.js.map +1 -1
- package/dist/commands/auth/migrate.js +66 -30
- package/dist/commands/auth/migrate.js.map +1 -1
- package/dist/commands/auth/whoami.js +0 -1
- package/dist/commands/auth/whoami.js.map +1 -1
- package/dist/commands/billing/__tests__/status.test.js +11 -9
- package/dist/commands/billing/__tests__/status.test.js.map +1 -1
- package/dist/commands/billing/__tests__/subscribe.test.js +11 -9
- package/dist/commands/billing/__tests__/subscribe.test.js.map +1 -1
- package/dist/commands/billing/__tests__/top-up.test.js +11 -9
- package/dist/commands/billing/__tests__/top-up.test.js.map +1 -1
- package/dist/commands/billing/cancel.js +11 -9
- package/dist/commands/billing/cancel.js.map +1 -1
- package/dist/commands/billing/status.js +11 -9
- package/dist/commands/billing/status.js.map +1 -1
- package/dist/commands/billing/subscribe.js +11 -9
- package/dist/commands/billing/subscribe.js.map +1 -1
- package/dist/commands/billing/top-up.js +11 -9
- package/dist/commands/billing/top-up.js.map +1 -1
- package/dist/commands/compute/app/configure/tls.js +138 -50
- package/dist/commands/compute/app/configure/tls.js.map +1 -1
- package/dist/commands/compute/app/create.js +0 -1
- package/dist/commands/compute/app/create.js.map +1 -1
- package/dist/commands/compute/app/deploy.js +76 -29
- package/dist/commands/compute/app/deploy.js.map +1 -1
- package/dist/commands/compute/app/info.js +17 -17
- package/dist/commands/compute/app/info.js.map +1 -1
- package/dist/commands/compute/app/list.js +12 -10
- package/dist/commands/compute/app/list.js.map +1 -1
- package/dist/commands/compute/app/logs.js +17 -17
- package/dist/commands/compute/app/logs.js.map +1 -1
- package/dist/commands/compute/app/profile/set.js +18 -17
- package/dist/commands/compute/app/profile/set.js.map +1 -1
- package/dist/commands/compute/app/releases.js +17 -17
- package/dist/commands/compute/app/releases.js.map +1 -1
- package/dist/commands/compute/app/start.js +29 -20
- package/dist/commands/compute/app/start.js.map +1 -1
- package/dist/commands/compute/app/stop.js +29 -20
- package/dist/commands/compute/app/stop.js.map +1 -1
- package/dist/commands/compute/app/terminate.js +22 -17
- package/dist/commands/compute/app/terminate.js.map +1 -1
- package/dist/commands/compute/app/upgrade.js +115 -32
- package/dist/commands/compute/app/upgrade.js.map +1 -1
- package/dist/commands/compute/build/info.js +12 -10
- package/dist/commands/compute/build/info.js.map +1 -1
- package/dist/commands/compute/build/list.js +12 -10
- package/dist/commands/compute/build/list.js.map +1 -1
- package/dist/commands/compute/build/logs.js +12 -10
- package/dist/commands/compute/build/logs.js.map +1 -1
- package/dist/commands/compute/build/status.js +12 -10
- package/dist/commands/compute/build/status.js.map +1 -1
- package/dist/commands/compute/build/submit.js +13 -10
- package/dist/commands/compute/build/submit.js.map +1 -1
- package/dist/commands/compute/build/verify.js +12 -10
- package/dist/commands/compute/build/verify.js.map +1 -1
- package/dist/commands/compute/environment/set.js +12 -11
- package/dist/commands/compute/environment/set.js.map +1 -1
- package/dist/commands/compute/undelegate.js +12 -10
- package/dist/commands/compute/undelegate.js.map +1 -1
- package/dist/hooks/init/__tests__/version-check.test.js +1 -1
- package/dist/hooks/init/__tests__/version-check.test.js.map +1 -1
- package/dist/hooks/init/version-check.js +1 -1
- package/dist/hooks/init/version-check.js.map +1 -1
- package/package.json +26 -21
|
@@ -19,7 +19,6 @@ import { privateKeyToAccount as privateKeyToAccount3 } from "viem/accounts";
|
|
|
19
19
|
import {
|
|
20
20
|
getEnvironmentConfig as getEnvironmentConfig2,
|
|
21
21
|
getAvailableEnvironments,
|
|
22
|
-
isEnvironmentAvailable,
|
|
23
22
|
getAllAppsByDeveloper as getAllAppsByDeveloper2,
|
|
24
23
|
getCategoryDescriptions,
|
|
25
24
|
fetchTemplateCatalog,
|
|
@@ -286,7 +285,7 @@ function listApps(environment) {
|
|
|
286
285
|
|
|
287
286
|
// src/utils/version.ts
|
|
288
287
|
function getCliVersion() {
|
|
289
|
-
return true ? "0.
|
|
288
|
+
return true ? "0.5.0-dev.3" : "0.0.0";
|
|
290
289
|
}
|
|
291
290
|
function getClientId() {
|
|
292
291
|
return `ecloud-cli/v${getCliVersion()}`;
|
|
@@ -483,6 +482,13 @@ function addHexPrefix2(value) {
|
|
|
483
482
|
}
|
|
484
483
|
return `0x${value}`;
|
|
485
484
|
}
|
|
485
|
+
function ensureInteractive(missingFlagHint) {
|
|
486
|
+
if (!process.stdin.isTTY) {
|
|
487
|
+
throw new Error(
|
|
488
|
+
`Cannot prompt in non-interactive mode. Provide ${missingFlagHint} via CLI flags or environment variables.`
|
|
489
|
+
);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
486
492
|
function getCurrentProjectPath() {
|
|
487
493
|
return process.env.INIT_CWD || process.cwd();
|
|
488
494
|
}
|
|
@@ -560,9 +566,10 @@ async function getOrPromptAppID(appIDOrOptions, environment) {
|
|
|
560
566
|
return addHexPrefix2(foundAppID);
|
|
561
567
|
}
|
|
562
568
|
throw new Error(
|
|
563
|
-
`App name '${options.appID}' not found in environment '${options.environment}'
|
|
569
|
+
`App name '${options.appID}' not found in environment '${options.environment}'. Name lookup uses a local cache that may be stale. Try using the app ID (0x...) directly, or run 'ecloud compute app list' to refresh the cache.`
|
|
564
570
|
);
|
|
565
571
|
}
|
|
572
|
+
ensureInteractive("app-id argument");
|
|
566
573
|
return getAppIDInteractive(options);
|
|
567
574
|
}
|
|
568
575
|
async function getAppIDInteractive(options) {
|
|
@@ -595,12 +602,9 @@ Select an app to ${action}:
|
|
|
595
602
|
let cachedProfiles = getProfileCache(environment);
|
|
596
603
|
if (!cachedProfiles) {
|
|
597
604
|
try {
|
|
598
|
-
const userApiClient = new UserApiClient2(
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
publicClient,
|
|
602
|
-
{ clientId: getClientId() }
|
|
603
|
-
);
|
|
605
|
+
const userApiClient = new UserApiClient2(environmentConfig, walletClient, publicClient, {
|
|
606
|
+
clientId: getClientId()
|
|
607
|
+
});
|
|
604
608
|
const appInfos = await getAppInfosChunked(userApiClient, apps);
|
|
605
609
|
const freshProfiles = {};
|
|
606
610
|
for (const info of appInfos) {
|
|
@@ -800,6 +804,7 @@ async function getPrivateKeyInteractive(privateKey) {
|
|
|
800
804
|
if (result) {
|
|
801
805
|
return result.key;
|
|
802
806
|
}
|
|
807
|
+
ensureInteractive("--private-key or ECLOUD_PRIVATE_KEY");
|
|
803
808
|
const key = await password({
|
|
804
809
|
message: "Enter private key:",
|
|
805
810
|
mask: true,
|
|
@@ -817,15 +822,10 @@ async function getPrivateKeyInteractive(privateKey) {
|
|
|
817
822
|
}
|
|
818
823
|
async function getEnvironmentInteractive(environment) {
|
|
819
824
|
if (environment) {
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
if (!isEnvironmentAvailable(environment)) {
|
|
823
|
-
throw new Error(`Environment ${environment} is not available in this build`);
|
|
824
|
-
}
|
|
825
|
-
return environment;
|
|
826
|
-
} catch {
|
|
827
|
-
}
|
|
825
|
+
getEnvironmentConfig2(environment);
|
|
826
|
+
return environment;
|
|
828
827
|
}
|
|
828
|
+
ensureInteractive("--environment or ECLOUD_ENV");
|
|
829
829
|
const availableEnvs = getAvailableEnvironments();
|
|
830
830
|
let defaultEnv;
|
|
831
831
|
const configDefaultEnv = getDefaultEnvironment();
|
|
@@ -963,6 +963,7 @@ function validateAppProfile(profile) {
|
|
|
963
963
|
return void 0;
|
|
964
964
|
}
|
|
965
965
|
async function getAppProfileInteractive(defaultName = "", allowRetry = true) {
|
|
966
|
+
ensureInteractive("--skip-profile or --website/--description/--x-url/--image");
|
|
966
967
|
while (true) {
|
|
967
968
|
const name = await getAppNameForProfile(defaultName);
|
|
968
969
|
const website = await getAppWebsiteInteractive();
|