@layr-labs/ecloud-sdk 0.2.2-dev → 0.3.0-dev
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/billing.cjs +273 -4
- package/dist/billing.cjs.map +1 -1
- package/dist/billing.d.cts +1 -1
- package/dist/billing.d.ts +1 -1
- package/dist/billing.js +275 -4
- package/dist/billing.js.map +1 -1
- package/dist/browser.cjs +527 -147
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +53 -12
- package/dist/browser.d.ts +53 -12
- package/dist/browser.js +527 -147
- package/dist/browser.js.map +1 -1
- package/dist/{compute-BYhSs8en.d.ts → compute-CdZxISln.d.ts} +1 -1
- package/dist/{compute-Bpjb3hYD.d.cts → compute-Dstl0CA0.d.cts} +1 -1
- package/dist/compute.cjs +130 -120
- package/dist/compute.cjs.map +1 -1
- package/dist/compute.d.cts +2 -2
- package/dist/compute.d.ts +2 -2
- package/dist/compute.js +132 -120
- package/dist/compute.js.map +1 -1
- package/dist/{helpers-CEvhJz7f.d.cts → helpers-4w0Iojmm.d.ts} +245 -4
- package/dist/{helpers-CQuBwQnu.d.ts → helpers-Dk0zwgms.d.cts} +245 -4
- package/dist/{index-DeQzn_yM.d.cts → index-C0w92tCs.d.cts} +4 -0
- package/dist/{index-DeQzn_yM.d.ts → index-C0w92tCs.d.ts} +4 -0
- package/dist/index.cjs +489 -148
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +491 -148
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/browser.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as AppId } from './index-
|
|
2
|
-
export { al as AlreadyActiveResponse, w as AppConfig, ac as AppProfile, ad as AppProfileResponse, a2 as AppRecord, K as BatchedDeployResult, a5 as BillingEnvironmentConfig, C as CalculateAppIDOptions, aq as CancelResponse, ao as CancelSuccessResponse, af as ChainID, ak as CheckoutCreatedResponse, ai as CreateSubscriptionOptions, aj as CreateSubscriptionResponse, D as DeployAppOptions, N as DeployAppOpts, a3 as DeployOptions, at as DeployProgressCallback, a4 as DeployResult, au as DeployStep, aa as DockerImageConfig, a6 as EnvironmentConfig, E as EstimateGasOptions, J as ExecuteDeployBatchedOptions, X as ExecuteDeployResult, H as ExecuteDeploySequentialOptions, Y as ExecuteUpgradeResult, G as GasEstimate, W as GasOpts, a9 as ImageDigestResult, I as IsDelegatedOptions, a1 as LifecycleOpts, ab as Logger, ap as NoActiveSubscriptionResponse, a8 as ParsedEnvironment, am as PaymentIssueResponse, P as PrepareDeployBatchOptions, T as PrepareDeployFromVerifiableBuildOpts, Q as PrepareDeployOpts, x as PrepareUpgradeBatchOptions, V as PrepareUpgradeFromVerifiableBuildOpts, R as PrepareUpgradeOpts, $ as PreparedDeploy, y as PreparedDeployBatch, Z as PreparedDeployData, a0 as PreparedUpgrade, z as PreparedUpgradeBatch, _ as PreparedUpgradeData, ae as ProductID, ar as ProductSubscriptionResponse, a7 as Release, S as SendTransactionOptions, av as SequentialDeployResult, an as SubscribeResponse, ah as SubscriptionLineItem, as as SubscriptionOpts, ag as SubscriptionStatus, B as SuspendOptions, F as UndelegateOptions, U as UpgradeAppOptions, O as UpgradeAppOpts, j as calculateAppID, i as deployApp, e as estimateTransactionGas, h as executeDeployBatch, l as executeDeployBatched, k as executeDeploySequential, o as executeUpgradeBatch, f as formatETH, c as getActiveAppCount, g as getAllAppsByDeveloper, a as getAppsByCreator, b as getAppsByDeveloper, d as getMaxActiveAppsPerUser, r as isDelegated, M as logVisibility, L as noopLogger, p as prepareDeployBatch, n as prepareUpgradeBatch, q as sendAndWaitForTransaction, m as supportsEIP5792, s as supportsEIP7702, t as suspend, v as undelegate, u as upgradeApp } from './index-
|
|
3
|
-
import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-
|
|
4
|
-
export { F as AppInfo, J as AppInfoResponse, I as AppMetrics, H as AppProfileInfo, K as BillingApiClient, z as CreateAppParams,
|
|
1
|
+
import { A as AppId } from './index-C0w92tCs.cjs';
|
|
2
|
+
export { al as AlreadyActiveResponse, w as AppConfig, ac as AppProfile, ad as AppProfileResponse, a2 as AppRecord, K as BatchedDeployResult, a5 as BillingEnvironmentConfig, C as CalculateAppIDOptions, aq as CancelResponse, ao as CancelSuccessResponse, af as ChainID, ak as CheckoutCreatedResponse, ai as CreateSubscriptionOptions, aj as CreateSubscriptionResponse, D as DeployAppOptions, N as DeployAppOpts, a3 as DeployOptions, at as DeployProgressCallback, a4 as DeployResult, au as DeployStep, aa as DockerImageConfig, a6 as EnvironmentConfig, E as EstimateGasOptions, J as ExecuteDeployBatchedOptions, X as ExecuteDeployResult, H as ExecuteDeploySequentialOptions, Y as ExecuteUpgradeResult, G as GasEstimate, W as GasOpts, a9 as ImageDigestResult, I as IsDelegatedOptions, a1 as LifecycleOpts, ab as Logger, ap as NoActiveSubscriptionResponse, a8 as ParsedEnvironment, am as PaymentIssueResponse, P as PrepareDeployBatchOptions, T as PrepareDeployFromVerifiableBuildOpts, Q as PrepareDeployOpts, x as PrepareUpgradeBatchOptions, V as PrepareUpgradeFromVerifiableBuildOpts, R as PrepareUpgradeOpts, $ as PreparedDeploy, y as PreparedDeployBatch, Z as PreparedDeployData, a0 as PreparedUpgrade, z as PreparedUpgradeBatch, _ as PreparedUpgradeData, ae as ProductID, ar as ProductSubscriptionResponse, a7 as Release, S as SendTransactionOptions, av as SequentialDeployResult, an as SubscribeResponse, ah as SubscriptionLineItem, as as SubscriptionOpts, ag as SubscriptionStatus, B as SuspendOptions, F as UndelegateOptions, U as UpgradeAppOptions, O as UpgradeAppOpts, j as calculateAppID, i as deployApp, e as estimateTransactionGas, h as executeDeployBatch, l as executeDeployBatched, k as executeDeploySequential, o as executeUpgradeBatch, f as formatETH, c as getActiveAppCount, g as getAllAppsByDeveloper, a as getAppsByCreator, b as getAppsByDeveloper, d as getMaxActiveAppsPerUser, r as isDelegated, M as logVisibility, L as noopLogger, p as prepareDeployBatch, n as prepareUpgradeBatch, q as sendAndWaitForTransaction, m as supportsEIP5792, s as supportsEIP7702, t as suspend, v as undelegate, u as upgradeApp } from './index-C0w92tCs.cjs';
|
|
3
|
+
import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-Dk0zwgms.cjs';
|
|
4
|
+
export { F as AppInfo, J as AppInfoResponse, I as AppMetrics, H as AppProfileInfo, K as BillingApiClient, M as BillingApiClientOptions, ac as BillingApiConfig, af as BillingLoginRequest, ae as BillingLoginResult, ab as BillingSessionError, ad as BillingSessionInfo, z as CreateAppParams, Q as EstimateBatchGasOptions, R as ExecuteBatchOptions, T as Execution, G as GeneratedKey, L as LogVisibility, a4 as LoginRequest, a3 as LoginResult, A as LogsParams, _ as SiweMessageResult, U as UserApiClient, E as UserApiClientOptions, ah as addHexPrefix, j as assertValidImageReference, n as assertValidPrivateKey, P as checkERC7702Delegation, V as createSiweMessage, N as estimateBatchGas, O as executeBatch, k as extractAppNameFromImage, D as generateNewPrivateKey, X as generateNonce, d as getAvailableEnvironments, a7 as getBillingApiSession, c as getBillingEnvironmentConfig, e as getBuildType, ag as getChainFromID, a1 as getComputeApiSession, g as getEnvironmentConfig, a8 as isBillingSessionValid, i as isEnvironmentAvailable, f as isMainnet, a2 as isSessionValid, Y as isSiweMessageExpired, Z as isSiweMessageNotYetValid, B as isSubscriptionActive, a5 as loginToBillingApi, a9 as loginToBothApis, $ as loginToComputeApi, a6 as logoutFromBillingApi, aa as logoutFromBothApis, a0 as logoutFromComputeApi, W as parseSiweMessage, t as sanitizeString, u as sanitizeURL, w as sanitizeXURL, ai as stripHexPrefix, r as validateAppID, v as validateAppName, x as validateCreateAppParams, q as validateDescription, h as validateImageReference, l as validateInstanceTypeSKU, s as validateLogVisibility, y as validateLogsParams, m as validatePrivateKeyFormat, o as validateURL, p as validateXURL } from './helpers-Dk0zwgms.cjs';
|
|
5
5
|
import { WalletClient, Address, Hex } from 'viem';
|
|
6
6
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
7
7
|
|
|
@@ -11,19 +11,42 @@ import { Buffer as Buffer$1 } from 'buffer';
|
|
|
11
11
|
* This is a standalone HTTP client that talks to the (compute) UserAPI host.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
interface BuildApiClientOptions {
|
|
15
|
+
baseUrl: string;
|
|
16
|
+
walletClient?: WalletClient;
|
|
17
|
+
clientId?: string;
|
|
18
|
+
/** Use session-based auth (cookies) instead of signature-based auth */
|
|
19
|
+
useSession?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Billing session ID (value of the billing_session cookie).
|
|
22
|
+
* When provided with useSession=true, this is sent via X-Billing-Session header
|
|
23
|
+
* to authenticate with the billing API for subscription verification.
|
|
24
|
+
* Required for submitBuild when using session auth.
|
|
25
|
+
*/
|
|
26
|
+
billingSessionId?: string;
|
|
27
|
+
}
|
|
14
28
|
declare class BuildApiClient {
|
|
15
29
|
private readonly baseUrl;
|
|
16
30
|
private readonly walletClient?;
|
|
17
31
|
private readonly clientId?;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
32
|
+
private readonly useSession;
|
|
33
|
+
private billingSessionId?;
|
|
34
|
+
constructor(options: BuildApiClientOptions);
|
|
35
|
+
/**
|
|
36
|
+
* Update the billing session ID.
|
|
37
|
+
* Call this after logging into the billing API to enable session-based auth for builds.
|
|
38
|
+
*/
|
|
39
|
+
setBillingSessionId(sessionId: string | undefined): void;
|
|
23
40
|
/**
|
|
24
41
|
* Get the address of the connected wallet
|
|
25
42
|
*/
|
|
26
43
|
get address(): Address;
|
|
44
|
+
/**
|
|
45
|
+
* Submit a new build request.
|
|
46
|
+
* Supports two auth modes (session auth is tried first when billingSessionId is available):
|
|
47
|
+
* 1. Session-based auth: X-Billing-Session header (forwarded billing_session cookie)
|
|
48
|
+
* 2. Signature-based auth: Authorization + X-Account + X-eigenx-expiry headers (requires walletClient)
|
|
49
|
+
*/
|
|
27
50
|
submitBuild(payload: {
|
|
28
51
|
repo_url: string;
|
|
29
52
|
git_ref: string;
|
|
@@ -37,6 +60,9 @@ declare class BuildApiClient {
|
|
|
37
60
|
getBuild(buildId: string): Promise<any>;
|
|
38
61
|
getBuildByDigest(digest: string): Promise<any>;
|
|
39
62
|
verify(identifier: string): Promise<any>;
|
|
63
|
+
/**
|
|
64
|
+
* Get build logs. Supports session auth (identity verification only, no billing check).
|
|
65
|
+
*/
|
|
40
66
|
getLogs(buildId: string): Promise<string>;
|
|
41
67
|
listBuilds(params: {
|
|
42
68
|
billing_address: string;
|
|
@@ -44,8 +70,23 @@ declare class BuildApiClient {
|
|
|
44
70
|
offset?: number;
|
|
45
71
|
}): Promise<any[]>;
|
|
46
72
|
private publicJsonRequest;
|
|
47
|
-
|
|
48
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Make a request that ALWAYS requires signature auth (for billing verification).
|
|
75
|
+
* Used for endpoints like POST /builds that need to verify subscription status.
|
|
76
|
+
*/
|
|
77
|
+
private signatureAuthJsonRequest;
|
|
78
|
+
/**
|
|
79
|
+
* Make a request using billing session auth (for billing verification without wallet signature).
|
|
80
|
+
* Forwards the billing_session cookie value via X-Billing-Session header.
|
|
81
|
+
* Used for endpoints that need to verify subscription status when using session-based auth.
|
|
82
|
+
*/
|
|
83
|
+
private billingSessionAuthJsonRequest;
|
|
84
|
+
/**
|
|
85
|
+
* Make an authenticated request that can use session OR signature auth.
|
|
86
|
+
* When useSession is true, relies on cookies for identity verification.
|
|
87
|
+
* Used for endpoints that only need identity verification (not billing).
|
|
88
|
+
*/
|
|
89
|
+
private sessionOrSignatureTextRequest;
|
|
49
90
|
}
|
|
50
91
|
|
|
51
92
|
/**
|
|
@@ -236,4 +277,4 @@ declare function getKMSKeysForEnvironment(environment: string, build?: BuildType
|
|
|
236
277
|
|
|
237
278
|
type Environment = "sepolia" | "sepolia-dev" | "mainnet-alpha";
|
|
238
279
|
|
|
239
|
-
export { AppId, BuildApiClient, ComputeApiConfig, type Environment, SessionError, SessionInfo, SiweMessageParams, type UseComputeSessionConfig, type UseComputeSessionReturn, encodeStartAppData, encodeStopAppData, encodeTerminateAppData, encryptRSAOAEPAndAES256GCM, getAppProtectedHeaders, getKMSKeysForEnvironment, useComputeSession };
|
|
280
|
+
export { AppId, BuildApiClient, type BuildApiClientOptions, ComputeApiConfig, type Environment, SessionError, SessionInfo, SiweMessageParams, type UseComputeSessionConfig, type UseComputeSessionReturn, encodeStartAppData, encodeStopAppData, encodeTerminateAppData, encryptRSAOAEPAndAES256GCM, getAppProtectedHeaders, getKMSKeysForEnvironment, useComputeSession };
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as AppId } from './index-
|
|
2
|
-
export { al as AlreadyActiveResponse, w as AppConfig, ac as AppProfile, ad as AppProfileResponse, a2 as AppRecord, K as BatchedDeployResult, a5 as BillingEnvironmentConfig, C as CalculateAppIDOptions, aq as CancelResponse, ao as CancelSuccessResponse, af as ChainID, ak as CheckoutCreatedResponse, ai as CreateSubscriptionOptions, aj as CreateSubscriptionResponse, D as DeployAppOptions, N as DeployAppOpts, a3 as DeployOptions, at as DeployProgressCallback, a4 as DeployResult, au as DeployStep, aa as DockerImageConfig, a6 as EnvironmentConfig, E as EstimateGasOptions, J as ExecuteDeployBatchedOptions, X as ExecuteDeployResult, H as ExecuteDeploySequentialOptions, Y as ExecuteUpgradeResult, G as GasEstimate, W as GasOpts, a9 as ImageDigestResult, I as IsDelegatedOptions, a1 as LifecycleOpts, ab as Logger, ap as NoActiveSubscriptionResponse, a8 as ParsedEnvironment, am as PaymentIssueResponse, P as PrepareDeployBatchOptions, T as PrepareDeployFromVerifiableBuildOpts, Q as PrepareDeployOpts, x as PrepareUpgradeBatchOptions, V as PrepareUpgradeFromVerifiableBuildOpts, R as PrepareUpgradeOpts, $ as PreparedDeploy, y as PreparedDeployBatch, Z as PreparedDeployData, a0 as PreparedUpgrade, z as PreparedUpgradeBatch, _ as PreparedUpgradeData, ae as ProductID, ar as ProductSubscriptionResponse, a7 as Release, S as SendTransactionOptions, av as SequentialDeployResult, an as SubscribeResponse, ah as SubscriptionLineItem, as as SubscriptionOpts, ag as SubscriptionStatus, B as SuspendOptions, F as UndelegateOptions, U as UpgradeAppOptions, O as UpgradeAppOpts, j as calculateAppID, i as deployApp, e as estimateTransactionGas, h as executeDeployBatch, l as executeDeployBatched, k as executeDeploySequential, o as executeUpgradeBatch, f as formatETH, c as getActiveAppCount, g as getAllAppsByDeveloper, a as getAppsByCreator, b as getAppsByDeveloper, d as getMaxActiveAppsPerUser, r as isDelegated, M as logVisibility, L as noopLogger, p as prepareDeployBatch, n as prepareUpgradeBatch, q as sendAndWaitForTransaction, m as supportsEIP5792, s as supportsEIP7702, t as suspend, v as undelegate, u as upgradeApp } from './index-
|
|
3
|
-
import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-
|
|
4
|
-
export { F as AppInfo, J as AppInfoResponse, I as AppMetrics, H as AppProfileInfo, K as BillingApiClient, z as CreateAppParams,
|
|
1
|
+
import { A as AppId } from './index-C0w92tCs.js';
|
|
2
|
+
export { al as AlreadyActiveResponse, w as AppConfig, ac as AppProfile, ad as AppProfileResponse, a2 as AppRecord, K as BatchedDeployResult, a5 as BillingEnvironmentConfig, C as CalculateAppIDOptions, aq as CancelResponse, ao as CancelSuccessResponse, af as ChainID, ak as CheckoutCreatedResponse, ai as CreateSubscriptionOptions, aj as CreateSubscriptionResponse, D as DeployAppOptions, N as DeployAppOpts, a3 as DeployOptions, at as DeployProgressCallback, a4 as DeployResult, au as DeployStep, aa as DockerImageConfig, a6 as EnvironmentConfig, E as EstimateGasOptions, J as ExecuteDeployBatchedOptions, X as ExecuteDeployResult, H as ExecuteDeploySequentialOptions, Y as ExecuteUpgradeResult, G as GasEstimate, W as GasOpts, a9 as ImageDigestResult, I as IsDelegatedOptions, a1 as LifecycleOpts, ab as Logger, ap as NoActiveSubscriptionResponse, a8 as ParsedEnvironment, am as PaymentIssueResponse, P as PrepareDeployBatchOptions, T as PrepareDeployFromVerifiableBuildOpts, Q as PrepareDeployOpts, x as PrepareUpgradeBatchOptions, V as PrepareUpgradeFromVerifiableBuildOpts, R as PrepareUpgradeOpts, $ as PreparedDeploy, y as PreparedDeployBatch, Z as PreparedDeployData, a0 as PreparedUpgrade, z as PreparedUpgradeBatch, _ as PreparedUpgradeData, ae as ProductID, ar as ProductSubscriptionResponse, a7 as Release, S as SendTransactionOptions, av as SequentialDeployResult, an as SubscribeResponse, ah as SubscriptionLineItem, as as SubscriptionOpts, ag as SubscriptionStatus, B as SuspendOptions, F as UndelegateOptions, U as UpgradeAppOptions, O as UpgradeAppOpts, j as calculateAppID, i as deployApp, e as estimateTransactionGas, h as executeDeployBatch, l as executeDeployBatched, k as executeDeploySequential, o as executeUpgradeBatch, f as formatETH, c as getActiveAppCount, g as getAllAppsByDeveloper, a as getAppsByCreator, b as getAppsByDeveloper, d as getMaxActiveAppsPerUser, r as isDelegated, M as logVisibility, L as noopLogger, p as prepareDeployBatch, n as prepareUpgradeBatch, q as sendAndWaitForTransaction, m as supportsEIP5792, s as supportsEIP7702, t as suspend, v as undelegate, u as upgradeApp } from './index-C0w92tCs.js';
|
|
3
|
+
import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-4w0Iojmm.js';
|
|
4
|
+
export { F as AppInfo, J as AppInfoResponse, I as AppMetrics, H as AppProfileInfo, K as BillingApiClient, M as BillingApiClientOptions, ac as BillingApiConfig, af as BillingLoginRequest, ae as BillingLoginResult, ab as BillingSessionError, ad as BillingSessionInfo, z as CreateAppParams, Q as EstimateBatchGasOptions, R as ExecuteBatchOptions, T as Execution, G as GeneratedKey, L as LogVisibility, a4 as LoginRequest, a3 as LoginResult, A as LogsParams, _ as SiweMessageResult, U as UserApiClient, E as UserApiClientOptions, ah as addHexPrefix, j as assertValidImageReference, n as assertValidPrivateKey, P as checkERC7702Delegation, V as createSiweMessage, N as estimateBatchGas, O as executeBatch, k as extractAppNameFromImage, D as generateNewPrivateKey, X as generateNonce, d as getAvailableEnvironments, a7 as getBillingApiSession, c as getBillingEnvironmentConfig, e as getBuildType, ag as getChainFromID, a1 as getComputeApiSession, g as getEnvironmentConfig, a8 as isBillingSessionValid, i as isEnvironmentAvailable, f as isMainnet, a2 as isSessionValid, Y as isSiweMessageExpired, Z as isSiweMessageNotYetValid, B as isSubscriptionActive, a5 as loginToBillingApi, a9 as loginToBothApis, $ as loginToComputeApi, a6 as logoutFromBillingApi, aa as logoutFromBothApis, a0 as logoutFromComputeApi, W as parseSiweMessage, t as sanitizeString, u as sanitizeURL, w as sanitizeXURL, ai as stripHexPrefix, r as validateAppID, v as validateAppName, x as validateCreateAppParams, q as validateDescription, h as validateImageReference, l as validateInstanceTypeSKU, s as validateLogVisibility, y as validateLogsParams, m as validatePrivateKeyFormat, o as validateURL, p as validateXURL } from './helpers-4w0Iojmm.js';
|
|
5
5
|
import { WalletClient, Address, Hex } from 'viem';
|
|
6
6
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
7
7
|
|
|
@@ -11,19 +11,42 @@ import { Buffer as Buffer$1 } from 'buffer';
|
|
|
11
11
|
* This is a standalone HTTP client that talks to the (compute) UserAPI host.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
interface BuildApiClientOptions {
|
|
15
|
+
baseUrl: string;
|
|
16
|
+
walletClient?: WalletClient;
|
|
17
|
+
clientId?: string;
|
|
18
|
+
/** Use session-based auth (cookies) instead of signature-based auth */
|
|
19
|
+
useSession?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Billing session ID (value of the billing_session cookie).
|
|
22
|
+
* When provided with useSession=true, this is sent via X-Billing-Session header
|
|
23
|
+
* to authenticate with the billing API for subscription verification.
|
|
24
|
+
* Required for submitBuild when using session auth.
|
|
25
|
+
*/
|
|
26
|
+
billingSessionId?: string;
|
|
27
|
+
}
|
|
14
28
|
declare class BuildApiClient {
|
|
15
29
|
private readonly baseUrl;
|
|
16
30
|
private readonly walletClient?;
|
|
17
31
|
private readonly clientId?;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
32
|
+
private readonly useSession;
|
|
33
|
+
private billingSessionId?;
|
|
34
|
+
constructor(options: BuildApiClientOptions);
|
|
35
|
+
/**
|
|
36
|
+
* Update the billing session ID.
|
|
37
|
+
* Call this after logging into the billing API to enable session-based auth for builds.
|
|
38
|
+
*/
|
|
39
|
+
setBillingSessionId(sessionId: string | undefined): void;
|
|
23
40
|
/**
|
|
24
41
|
* Get the address of the connected wallet
|
|
25
42
|
*/
|
|
26
43
|
get address(): Address;
|
|
44
|
+
/**
|
|
45
|
+
* Submit a new build request.
|
|
46
|
+
* Supports two auth modes (session auth is tried first when billingSessionId is available):
|
|
47
|
+
* 1. Session-based auth: X-Billing-Session header (forwarded billing_session cookie)
|
|
48
|
+
* 2. Signature-based auth: Authorization + X-Account + X-eigenx-expiry headers (requires walletClient)
|
|
49
|
+
*/
|
|
27
50
|
submitBuild(payload: {
|
|
28
51
|
repo_url: string;
|
|
29
52
|
git_ref: string;
|
|
@@ -37,6 +60,9 @@ declare class BuildApiClient {
|
|
|
37
60
|
getBuild(buildId: string): Promise<any>;
|
|
38
61
|
getBuildByDigest(digest: string): Promise<any>;
|
|
39
62
|
verify(identifier: string): Promise<any>;
|
|
63
|
+
/**
|
|
64
|
+
* Get build logs. Supports session auth (identity verification only, no billing check).
|
|
65
|
+
*/
|
|
40
66
|
getLogs(buildId: string): Promise<string>;
|
|
41
67
|
listBuilds(params: {
|
|
42
68
|
billing_address: string;
|
|
@@ -44,8 +70,23 @@ declare class BuildApiClient {
|
|
|
44
70
|
offset?: number;
|
|
45
71
|
}): Promise<any[]>;
|
|
46
72
|
private publicJsonRequest;
|
|
47
|
-
|
|
48
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Make a request that ALWAYS requires signature auth (for billing verification).
|
|
75
|
+
* Used for endpoints like POST /builds that need to verify subscription status.
|
|
76
|
+
*/
|
|
77
|
+
private signatureAuthJsonRequest;
|
|
78
|
+
/**
|
|
79
|
+
* Make a request using billing session auth (for billing verification without wallet signature).
|
|
80
|
+
* Forwards the billing_session cookie value via X-Billing-Session header.
|
|
81
|
+
* Used for endpoints that need to verify subscription status when using session-based auth.
|
|
82
|
+
*/
|
|
83
|
+
private billingSessionAuthJsonRequest;
|
|
84
|
+
/**
|
|
85
|
+
* Make an authenticated request that can use session OR signature auth.
|
|
86
|
+
* When useSession is true, relies on cookies for identity verification.
|
|
87
|
+
* Used for endpoints that only need identity verification (not billing).
|
|
88
|
+
*/
|
|
89
|
+
private sessionOrSignatureTextRequest;
|
|
49
90
|
}
|
|
50
91
|
|
|
51
92
|
/**
|
|
@@ -236,4 +277,4 @@ declare function getKMSKeysForEnvironment(environment: string, build?: BuildType
|
|
|
236
277
|
|
|
237
278
|
type Environment = "sepolia" | "sepolia-dev" | "mainnet-alpha";
|
|
238
279
|
|
|
239
|
-
export { AppId, BuildApiClient, ComputeApiConfig, type Environment, SessionError, SessionInfo, SiweMessageParams, type UseComputeSessionConfig, type UseComputeSessionReturn, encodeStartAppData, encodeStopAppData, encodeTerminateAppData, encryptRSAOAEPAndAES256GCM, getAppProtectedHeaders, getKMSKeysForEnvironment, useComputeSession };
|
|
280
|
+
export { AppId, BuildApiClient, type BuildApiClientOptions, ComputeApiConfig, type Environment, SessionError, SessionInfo, SiweMessageParams, type UseComputeSessionConfig, type UseComputeSessionReturn, encodeStartAppData, encodeStopAppData, encodeTerminateAppData, encryptRSAOAEPAndAES256GCM, getAppProtectedHeaders, getKMSKeysForEnvironment, useComputeSession };
|