@layr-labs/ecloud-sdk 0.0.1-dev.2 → 0.0.1-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/index.cjs +22 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +22 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -292,6 +292,8 @@ interface SDKLogsOptions {
|
|
|
292
292
|
privateKey?: string;
|
|
293
293
|
/** RPC URL - optional, uses environment default */
|
|
294
294
|
rpcUrl?: string;
|
|
295
|
+
/** Client ID for API requests - optional */
|
|
296
|
+
clientId?: string;
|
|
295
297
|
}
|
|
296
298
|
/**
|
|
297
299
|
* Legacy interface for backward compatibility
|
|
@@ -303,6 +305,7 @@ interface LogsOptions {
|
|
|
303
305
|
environment?: string;
|
|
304
306
|
privateKey?: string;
|
|
305
307
|
rpcUrl?: string;
|
|
308
|
+
clientId?: string;
|
|
306
309
|
}
|
|
307
310
|
/**
|
|
308
311
|
* View app logs
|
|
@@ -364,6 +367,7 @@ interface AppModuleConfig {
|
|
|
364
367
|
privateKey: `0x${string}`;
|
|
365
368
|
rpcUrl: string;
|
|
366
369
|
environment: string;
|
|
370
|
+
clientId?: string;
|
|
367
371
|
}
|
|
368
372
|
declare function createAppModule(ctx: AppModuleConfig): AppModule;
|
|
369
373
|
|
|
@@ -743,7 +747,7 @@ declare function executeDeploy(prepared: PreparedDeploy, gas: {
|
|
|
743
747
|
* Call this after executeDeploy to wait for the app to be provisioned.
|
|
744
748
|
* Can be called separately to allow for intermediate operations (e.g., profile upload).
|
|
745
749
|
*/
|
|
746
|
-
declare function watchDeployment(appId: string, privateKey: string, rpcUrl: string, environment: string, logger?: Logger): Promise<string | undefined>;
|
|
750
|
+
declare function watchDeployment(appId: string, privateKey: string, rpcUrl: string, environment: string, logger?: Logger, clientId?: string): Promise<string | undefined>;
|
|
747
751
|
|
|
748
752
|
/**
|
|
749
753
|
* Main upgrade function
|
|
@@ -845,7 +849,7 @@ declare function executeUpgrade(prepared: PreparedUpgrade, gas: {
|
|
|
845
849
|
* Call this after executeUpgrade to wait for the upgrade to finish.
|
|
846
850
|
* Can be called separately to allow for intermediate operations.
|
|
847
851
|
*/
|
|
848
|
-
declare function watchUpgrade(appId: string, privateKey: string, rpcUrl: string, environment: string, logger?: Logger): Promise<void>;
|
|
852
|
+
declare function watchUpgrade(appId: string, privateKey: string, rpcUrl: string, environment: string, logger?: Logger, clientId?: string): Promise<void>;
|
|
849
853
|
|
|
850
854
|
/**
|
|
851
855
|
* Environment configuration for different networks
|
|
@@ -1082,7 +1086,7 @@ interface PreflightContext {
|
|
|
1082
1086
|
* Returns empty string if unable to fetch (API unavailable, app info not ready, etc.).
|
|
1083
1087
|
* This is used as a convenience default for the upgrade flow.
|
|
1084
1088
|
*/
|
|
1085
|
-
declare function getCurrentInstanceType(preflightCtx: PreflightContext, appID: Address, logger: Logger): Promise<string>;
|
|
1089
|
+
declare function getCurrentInstanceType(preflightCtx: PreflightContext, appID: Address, logger: Logger, clientId?: string): Promise<string>;
|
|
1086
1090
|
|
|
1087
1091
|
/**
|
|
1088
1092
|
* UserAPI Client to manage interactions with the coordinator
|
package/dist/index.d.ts
CHANGED
|
@@ -292,6 +292,8 @@ interface SDKLogsOptions {
|
|
|
292
292
|
privateKey?: string;
|
|
293
293
|
/** RPC URL - optional, uses environment default */
|
|
294
294
|
rpcUrl?: string;
|
|
295
|
+
/** Client ID for API requests - optional */
|
|
296
|
+
clientId?: string;
|
|
295
297
|
}
|
|
296
298
|
/**
|
|
297
299
|
* Legacy interface for backward compatibility
|
|
@@ -303,6 +305,7 @@ interface LogsOptions {
|
|
|
303
305
|
environment?: string;
|
|
304
306
|
privateKey?: string;
|
|
305
307
|
rpcUrl?: string;
|
|
308
|
+
clientId?: string;
|
|
306
309
|
}
|
|
307
310
|
/**
|
|
308
311
|
* View app logs
|
|
@@ -364,6 +367,7 @@ interface AppModuleConfig {
|
|
|
364
367
|
privateKey: `0x${string}`;
|
|
365
368
|
rpcUrl: string;
|
|
366
369
|
environment: string;
|
|
370
|
+
clientId?: string;
|
|
367
371
|
}
|
|
368
372
|
declare function createAppModule(ctx: AppModuleConfig): AppModule;
|
|
369
373
|
|
|
@@ -743,7 +747,7 @@ declare function executeDeploy(prepared: PreparedDeploy, gas: {
|
|
|
743
747
|
* Call this after executeDeploy to wait for the app to be provisioned.
|
|
744
748
|
* Can be called separately to allow for intermediate operations (e.g., profile upload).
|
|
745
749
|
*/
|
|
746
|
-
declare function watchDeployment(appId: string, privateKey: string, rpcUrl: string, environment: string, logger?: Logger): Promise<string | undefined>;
|
|
750
|
+
declare function watchDeployment(appId: string, privateKey: string, rpcUrl: string, environment: string, logger?: Logger, clientId?: string): Promise<string | undefined>;
|
|
747
751
|
|
|
748
752
|
/**
|
|
749
753
|
* Main upgrade function
|
|
@@ -845,7 +849,7 @@ declare function executeUpgrade(prepared: PreparedUpgrade, gas: {
|
|
|
845
849
|
* Call this after executeUpgrade to wait for the upgrade to finish.
|
|
846
850
|
* Can be called separately to allow for intermediate operations.
|
|
847
851
|
*/
|
|
848
|
-
declare function watchUpgrade(appId: string, privateKey: string, rpcUrl: string, environment: string, logger?: Logger): Promise<void>;
|
|
852
|
+
declare function watchUpgrade(appId: string, privateKey: string, rpcUrl: string, environment: string, logger?: Logger, clientId?: string): Promise<void>;
|
|
849
853
|
|
|
850
854
|
/**
|
|
851
855
|
* Environment configuration for different networks
|
|
@@ -1082,7 +1086,7 @@ interface PreflightContext {
|
|
|
1082
1086
|
* Returns empty string if unable to fetch (API unavailable, app info not ready, etc.).
|
|
1083
1087
|
* This is used as a convenience default for the upgrade flow.
|
|
1084
1088
|
*/
|
|
1085
|
-
declare function getCurrentInstanceType(preflightCtx: PreflightContext, appID: Address, logger: Logger): Promise<string>;
|
|
1089
|
+
declare function getCurrentInstanceType(preflightCtx: PreflightContext, appID: Address, logger: Logger, clientId?: string): Promise<string>;
|
|
1086
1090
|
|
|
1087
1091
|
/**
|
|
1088
1092
|
* UserAPI Client to manage interactions with the coordinator
|
package/dist/index.js
CHANGED
|
@@ -2420,7 +2420,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
|
|
|
2420
2420
|
var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
|
|
2421
2421
|
var CanUpdateAppProfilePermission = "0x036fef61";
|
|
2422
2422
|
function getDefaultClientId() {
|
|
2423
|
-
const version = true ? "0.0.1-dev.
|
|
2423
|
+
const version = true ? "0.0.1-dev.3" : "0.0.0";
|
|
2424
2424
|
return `ecloud-sdk/v${version}`;
|
|
2425
2425
|
}
|
|
2426
2426
|
var UserApiClient = class {
|
|
@@ -4746,8 +4746,8 @@ var WATCH_POLL_INTERVAL_SECONDS = 5;
|
|
|
4746
4746
|
var APP_STATUS_RUNNING = "Running";
|
|
4747
4747
|
var APP_STATUS_FAILED = "Failed";
|
|
4748
4748
|
async function watchUntilRunning(options, logger) {
|
|
4749
|
-
const { environmentConfig, appId, privateKey, rpcUrl } = options;
|
|
4750
|
-
const userApiClient = new UserApiClient(environmentConfig, privateKey, rpcUrl);
|
|
4749
|
+
const { environmentConfig, appId, privateKey, rpcUrl, clientId } = options;
|
|
4750
|
+
const userApiClient = new UserApiClient(environmentConfig, privateKey, rpcUrl, clientId);
|
|
4751
4751
|
let initialStatus;
|
|
4752
4752
|
let initialIP;
|
|
4753
4753
|
let hasChanged = false;
|
|
@@ -4796,8 +4796,8 @@ async function watchUntilRunning(options, logger) {
|
|
|
4796
4796
|
}
|
|
4797
4797
|
var APP_STATUS_STOPPED = "Stopped";
|
|
4798
4798
|
async function watchUntilUpgradeComplete(options, logger) {
|
|
4799
|
-
const { environmentConfig, appId, privateKey, rpcUrl } = options;
|
|
4800
|
-
const userApiClient = new UserApiClient(environmentConfig, privateKey, rpcUrl);
|
|
4799
|
+
const { environmentConfig, appId, privateKey, rpcUrl, clientId } = options;
|
|
4800
|
+
const userApiClient = new UserApiClient(environmentConfig, privateKey, rpcUrl, clientId);
|
|
4801
4801
|
let initialStatus;
|
|
4802
4802
|
let initialIP;
|
|
4803
4803
|
let hasChanged = false;
|
|
@@ -5445,7 +5445,7 @@ async function executeDeploy(prepared, gas, logger = defaultLogger) {
|
|
|
5445
5445
|
imageRef: prepared.imageRef
|
|
5446
5446
|
};
|
|
5447
5447
|
}
|
|
5448
|
-
async function watchDeployment(appId, privateKey, rpcUrl, environment, logger = defaultLogger) {
|
|
5448
|
+
async function watchDeployment(appId, privateKey, rpcUrl, environment, logger = defaultLogger, clientId) {
|
|
5449
5449
|
const environmentConfig = getEnvironmentConfig(environment);
|
|
5450
5450
|
logger.info("Waiting for app to start...");
|
|
5451
5451
|
return watchUntilRunning(
|
|
@@ -5453,7 +5453,8 @@ async function watchDeployment(appId, privateKey, rpcUrl, environment, logger =
|
|
|
5453
5453
|
privateKey,
|
|
5454
5454
|
rpcUrl,
|
|
5455
5455
|
environmentConfig,
|
|
5456
|
-
appId
|
|
5456
|
+
appId,
|
|
5457
|
+
clientId
|
|
5457
5458
|
},
|
|
5458
5459
|
logger
|
|
5459
5460
|
);
|
|
@@ -5653,7 +5654,7 @@ async function executeUpgrade(prepared, gas, logger = defaultLogger) {
|
|
|
5653
5654
|
txHash
|
|
5654
5655
|
};
|
|
5655
5656
|
}
|
|
5656
|
-
async function watchUpgrade(appId, privateKey, rpcUrl, environment, logger = defaultLogger) {
|
|
5657
|
+
async function watchUpgrade(appId, privateKey, rpcUrl, environment, logger = defaultLogger, clientId) {
|
|
5657
5658
|
const environmentConfig = getEnvironmentConfig(environment);
|
|
5658
5659
|
logger.info("Waiting for upgrade to complete...");
|
|
5659
5660
|
await watchUntilUpgradeComplete(
|
|
@@ -5661,7 +5662,8 @@ async function watchUpgrade(appId, privateKey, rpcUrl, environment, logger = def
|
|
|
5661
5662
|
privateKey,
|
|
5662
5663
|
rpcUrl,
|
|
5663
5664
|
environmentConfig,
|
|
5664
|
-
appId
|
|
5665
|
+
appId,
|
|
5666
|
+
clientId
|
|
5665
5667
|
},
|
|
5666
5668
|
logger
|
|
5667
5669
|
);
|
|
@@ -6225,7 +6227,12 @@ async function logs(options, logger = defaultLogger) {
|
|
|
6225
6227
|
}
|
|
6226
6228
|
const appID = validateAppID(options.appID);
|
|
6227
6229
|
const formattedApp = formatAppDisplay(environmentConfig.name, appID, "");
|
|
6228
|
-
const userApiClient = new UserApiClient(
|
|
6230
|
+
const userApiClient = new UserApiClient(
|
|
6231
|
+
environmentConfig,
|
|
6232
|
+
options.privateKey,
|
|
6233
|
+
rpcUrl,
|
|
6234
|
+
options.clientId
|
|
6235
|
+
);
|
|
6229
6236
|
let logsText;
|
|
6230
6237
|
let logsError = null;
|
|
6231
6238
|
try {
|
|
@@ -6381,7 +6388,8 @@ function createAppModule(ctx) {
|
|
|
6381
6388
|
privateKey,
|
|
6382
6389
|
appID: opts.appID,
|
|
6383
6390
|
watch: opts.watch,
|
|
6384
|
-
environment: ctx.environment
|
|
6391
|
+
environment: ctx.environment,
|
|
6392
|
+
clientId: ctx.clientId
|
|
6385
6393
|
},
|
|
6386
6394
|
logger
|
|
6387
6395
|
);
|
|
@@ -6842,12 +6850,13 @@ function generateNewPrivateKey() {
|
|
|
6842
6850
|
}
|
|
6843
6851
|
|
|
6844
6852
|
// src/client/common/utils/instance.ts
|
|
6845
|
-
async function getCurrentInstanceType(preflightCtx, appID, logger) {
|
|
6853
|
+
async function getCurrentInstanceType(preflightCtx, appID, logger, clientId) {
|
|
6846
6854
|
try {
|
|
6847
6855
|
const userApiClient = new UserApiClient(
|
|
6848
6856
|
preflightCtx.environmentConfig,
|
|
6849
6857
|
preflightCtx.privateKey,
|
|
6850
|
-
preflightCtx.rpcUrl
|
|
6858
|
+
preflightCtx.rpcUrl,
|
|
6859
|
+
clientId
|
|
6851
6860
|
);
|
|
6852
6861
|
const infos = await userApiClient.getInfos([appID], 1);
|
|
6853
6862
|
if (infos.length === 0) {
|