@layr-labs/ecloud-sdk 1.0.0-dev.4 → 1.0.0-dev.5
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 +60 -0
- package/dist/billing.cjs.map +1 -1
- package/dist/billing.d.cts +2 -1
- package/dist/billing.d.ts +2 -1
- package/dist/billing.js +60 -0
- package/dist/billing.js.map +1 -1
- package/dist/browser.cjs +58 -1
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +4 -4
- package/dist/browser.d.ts +4 -4
- package/dist/browser.js +58 -1
- package/dist/browser.js.map +1 -1
- package/dist/{compute-B6SZ0VQG.d.ts → compute-9bzsfthb.d.ts} +1 -1
- package/dist/{compute-BK4PxhNh.d.cts → compute-RhRi2H8h.d.cts} +1 -1
- package/dist/compute.cjs +1 -1
- 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 +1 -1
- package/dist/compute.js.map +1 -1
- package/dist/{helpers-Qq5W-qNn.d.cts → helpers-CqrBJ39N.d.cts} +15 -1
- package/dist/{helpers-F7CeDSVX.d.ts → helpers-DEGFGA-T.d.ts} +15 -1
- package/dist/{index-BoCE0hIh.d.cts → index-CLhRJNai.d.cts} +34 -1
- package/dist/{index-BoCE0hIh.d.ts → index-CLhRJNai.d.ts} +34 -1
- package/dist/index.cjs +101 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -7
- package/dist/index.d.ts +31 -7
- package/dist/index.js +100 -1
- 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 { a as
|
|
3
|
-
import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-
|
|
4
|
-
export { A as AppInfo, c as AppInfoResponse, d as AppMetrics, e as AppProfileInfo, B as BillingApiClient, f as BillingApiClientOptions, g as BillingApiConfig, h as BillingLoginRequest, i as BillingLoginResult, j as BillingSessionError, k as BillingSessionInfo, l as CreateAppParams, E as EstimateBatchGasOptions, m as ExecuteBatchOptions, n as Execution, G as GeneratedKey, L as LogVisibility, o as LoginRequest, p as LoginResult, q as LogsParams, r as SiweMessageResult, U as UserApiClient, s as UserApiClientOptions, t as addHexPrefix, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, y as estimateBatchGas, z as executeBatch, D as extractAppNameFromImage, F as generateNewPrivateKey, H as generateNonce, I as getAvailableEnvironments, J as getBillingApiSession, K as getBillingEnvironmentConfig, M as getBuildType, N as getChainFromID, O as getComputeApiSession, P as getEnvironmentConfig, Q as isBillingSessionValid, R as isEnvironmentAvailable, T as isMainnet, V as isSessionValid, W as isSiweMessageExpired, X as isSiweMessageNotYetValid, Y as isSubscriptionActive, Z as loginToBillingApi, _ as loginToBothApis, $ as loginToComputeApi, a0 as logoutFromBillingApi, a1 as logoutFromBothApis, a2 as logoutFromComputeApi, a3 as parseSiweMessage, a4 as sanitizeString, a5 as sanitizeURL, a6 as sanitizeXURL, a7 as stripHexPrefix, a8 as validateAppID, a9 as validateAppName, aa as validateCreateAppParams, ab as validateDescription, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, ah as validateURL, ai as validateXURL } from './helpers-
|
|
1
|
+
import { A as AppId } from './index-CLhRJNai.cjs';
|
|
2
|
+
export { a as AddAdminResponse, b as AdminCoupon, c as AdminUser, d as AlreadyActiveResponse, e as AppConfig, f as AppProfile, g as AppProfileResponse, h as AppRecord, B as BatchedDeployResult, i as BillingEnvironmentConfig, C as CalculateAppIDOptions, j as CancelResponse, k as CancelSuccessResponse, l as ChainID, m as CheckoutCreatedResponse, n as CreateCouponResponse, o as CreateSubscriptionOptions, p as CreateSubscriptionResponse, q as CreditPurchaseResponse, D as DeployAppOptions, r as DeployAppOpts, s as DeployOptions, t as DeployProgressCallback, u as DeployResult, v as DeployStep, w as DockerImageConfig, E as EnvironmentConfig, x as EstimateGasOptions, y as ExecuteDeployBatchedOptions, z as ExecuteDeployResult, F as ExecuteDeploySequentialOptions, G as ExecuteUpgradeResult, H as GasEstimate, I as GasOpts, J as GetCouponResponse, K as GetSubscriptionOptions, L as ImageDigestResult, M as IsDelegatedOptions, N as LifecycleOpts, O as ListAdminsResponse, P as ListCouponsResponse, Q as Logger, R as NoActiveSubscriptionResponse, S as ParsedEnvironment, T as PaymentIssueResponse, U as PaymentMethod, V as PaymentMethodsResponse, W as PrepareDeployBatchOptions, X as PrepareDeployFromVerifiableBuildOpts, Y as PrepareDeployOpts, Z as PrepareUpgradeBatchOptions, _ as PrepareUpgradeFromVerifiableBuildOpts, $ as PrepareUpgradeOpts, a0 as PreparedDeploy, a1 as PreparedDeployBatch, a2 as PreparedDeployData, a3 as PreparedUpgrade, a4 as PreparedUpgradeBatch, a5 as PreparedUpgradeData, a6 as ProductID, a7 as ProductSubscriptionResponse, a8 as RedeemCouponResponse, a9 as Release, aa as SendTransactionOptions, ab as SequentialDeployResult, ac as SubscribeResponse, ad as SubscriptionLineItem, ae as SubscriptionOpts, af as SubscriptionStatus, ag as SuspendOptions, ah as UndelegateOptions, ai as UpgradeAppOptions, aj as UpgradeAppOpts, ak as calculateAppID, al as deployApp, am as estimateTransactionGas, an as executeDeployBatch, ao as executeDeployBatched, ap as executeDeploySequential, aq as executeUpgradeBatch, ar as formatETH, as as getActiveAppCount, at as getAllAppsByDeveloper, au as getAppsByBillingAccount, av as getAppsByCreator, aw as getAppsByDeveloper, ax as getBillingType, ay as getMaxActiveAppsPerUser, az as isDelegated, aA as logVisibility, aB as noopLogger, aC as prepareDeployBatch, aD as prepareUpgradeBatch, aE as sendAndWaitForTransaction, aF as supportsEIP5792, aG as supportsEIP7702, aH as suspend, aI as undelegate, aJ as upgradeApp } from './index-CLhRJNai.cjs';
|
|
3
|
+
import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-CqrBJ39N.cjs';
|
|
4
|
+
export { A as AppInfo, c as AppInfoResponse, d as AppMetrics, e as AppProfileInfo, B as BillingApiClient, f as BillingApiClientOptions, g as BillingApiConfig, h as BillingLoginRequest, i as BillingLoginResult, j as BillingSessionError, k as BillingSessionInfo, l as CreateAppParams, E as EstimateBatchGasOptions, m as ExecuteBatchOptions, n as Execution, G as GeneratedKey, L as LogVisibility, o as LoginRequest, p as LoginResult, q as LogsParams, r as SiweMessageResult, U as UserApiClient, s as UserApiClientOptions, t as addHexPrefix, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, y as estimateBatchGas, z as executeBatch, D as extractAppNameFromImage, F as generateNewPrivateKey, H as generateNonce, I as getAvailableEnvironments, J as getBillingApiSession, K as getBillingEnvironmentConfig, M as getBuildType, N as getChainFromID, O as getComputeApiSession, P as getEnvironmentConfig, Q as isBillingSessionValid, R as isEnvironmentAvailable, T as isMainnet, V as isSessionValid, W as isSiweMessageExpired, X as isSiweMessageNotYetValid, Y as isSubscriptionActive, Z as loginToBillingApi, _ as loginToBothApis, $ as loginToComputeApi, a0 as logoutFromBillingApi, a1 as logoutFromBothApis, a2 as logoutFromComputeApi, a3 as parseSiweMessage, a4 as sanitizeString, a5 as sanitizeURL, a6 as sanitizeXURL, a7 as stripHexPrefix, a8 as validateAppID, a9 as validateAppName, aa as validateCreateAppParams, ab as validateDescription, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, ah as validateURL, ai as validateXURL } from './helpers-CqrBJ39N.cjs';
|
|
5
5
|
import { WalletClient, Address, Hex } from 'viem';
|
|
6
6
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
7
7
|
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as AppId } from './index-
|
|
2
|
-
export { a as
|
|
3
|
-
import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-
|
|
4
|
-
export { A as AppInfo, c as AppInfoResponse, d as AppMetrics, e as AppProfileInfo, B as BillingApiClient, f as BillingApiClientOptions, g as BillingApiConfig, h as BillingLoginRequest, i as BillingLoginResult, j as BillingSessionError, k as BillingSessionInfo, l as CreateAppParams, E as EstimateBatchGasOptions, m as ExecuteBatchOptions, n as Execution, G as GeneratedKey, L as LogVisibility, o as LoginRequest, p as LoginResult, q as LogsParams, r as SiweMessageResult, U as UserApiClient, s as UserApiClientOptions, t as addHexPrefix, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, y as estimateBatchGas, z as executeBatch, D as extractAppNameFromImage, F as generateNewPrivateKey, H as generateNonce, I as getAvailableEnvironments, J as getBillingApiSession, K as getBillingEnvironmentConfig, M as getBuildType, N as getChainFromID, O as getComputeApiSession, P as getEnvironmentConfig, Q as isBillingSessionValid, R as isEnvironmentAvailable, T as isMainnet, V as isSessionValid, W as isSiweMessageExpired, X as isSiweMessageNotYetValid, Y as isSubscriptionActive, Z as loginToBillingApi, _ as loginToBothApis, $ as loginToComputeApi, a0 as logoutFromBillingApi, a1 as logoutFromBothApis, a2 as logoutFromComputeApi, a3 as parseSiweMessage, a4 as sanitizeString, a5 as sanitizeURL, a6 as sanitizeXURL, a7 as stripHexPrefix, a8 as validateAppID, a9 as validateAppName, aa as validateCreateAppParams, ab as validateDescription, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, ah as validateURL, ai as validateXURL } from './helpers-
|
|
1
|
+
import { A as AppId } from './index-CLhRJNai.js';
|
|
2
|
+
export { a as AddAdminResponse, b as AdminCoupon, c as AdminUser, d as AlreadyActiveResponse, e as AppConfig, f as AppProfile, g as AppProfileResponse, h as AppRecord, B as BatchedDeployResult, i as BillingEnvironmentConfig, C as CalculateAppIDOptions, j as CancelResponse, k as CancelSuccessResponse, l as ChainID, m as CheckoutCreatedResponse, n as CreateCouponResponse, o as CreateSubscriptionOptions, p as CreateSubscriptionResponse, q as CreditPurchaseResponse, D as DeployAppOptions, r as DeployAppOpts, s as DeployOptions, t as DeployProgressCallback, u as DeployResult, v as DeployStep, w as DockerImageConfig, E as EnvironmentConfig, x as EstimateGasOptions, y as ExecuteDeployBatchedOptions, z as ExecuteDeployResult, F as ExecuteDeploySequentialOptions, G as ExecuteUpgradeResult, H as GasEstimate, I as GasOpts, J as GetCouponResponse, K as GetSubscriptionOptions, L as ImageDigestResult, M as IsDelegatedOptions, N as LifecycleOpts, O as ListAdminsResponse, P as ListCouponsResponse, Q as Logger, R as NoActiveSubscriptionResponse, S as ParsedEnvironment, T as PaymentIssueResponse, U as PaymentMethod, V as PaymentMethodsResponse, W as PrepareDeployBatchOptions, X as PrepareDeployFromVerifiableBuildOpts, Y as PrepareDeployOpts, Z as PrepareUpgradeBatchOptions, _ as PrepareUpgradeFromVerifiableBuildOpts, $ as PrepareUpgradeOpts, a0 as PreparedDeploy, a1 as PreparedDeployBatch, a2 as PreparedDeployData, a3 as PreparedUpgrade, a4 as PreparedUpgradeBatch, a5 as PreparedUpgradeData, a6 as ProductID, a7 as ProductSubscriptionResponse, a8 as RedeemCouponResponse, a9 as Release, aa as SendTransactionOptions, ab as SequentialDeployResult, ac as SubscribeResponse, ad as SubscriptionLineItem, ae as SubscriptionOpts, af as SubscriptionStatus, ag as SuspendOptions, ah as UndelegateOptions, ai as UpgradeAppOptions, aj as UpgradeAppOpts, ak as calculateAppID, al as deployApp, am as estimateTransactionGas, an as executeDeployBatch, ao as executeDeployBatched, ap as executeDeploySequential, aq as executeUpgradeBatch, ar as formatETH, as as getActiveAppCount, at as getAllAppsByDeveloper, au as getAppsByBillingAccount, av as getAppsByCreator, aw as getAppsByDeveloper, ax as getBillingType, ay as getMaxActiveAppsPerUser, az as isDelegated, aA as logVisibility, aB as noopLogger, aC as prepareDeployBatch, aD as prepareUpgradeBatch, aE as sendAndWaitForTransaction, aF as supportsEIP5792, aG as supportsEIP7702, aH as suspend, aI as undelegate, aJ as upgradeApp } from './index-CLhRJNai.js';
|
|
3
|
+
import { C as ComputeApiConfig, S as SessionInfo, a as SessionError, b as SiweMessageParams } from './helpers-DEGFGA-T.js';
|
|
4
|
+
export { A as AppInfo, c as AppInfoResponse, d as AppMetrics, e as AppProfileInfo, B as BillingApiClient, f as BillingApiClientOptions, g as BillingApiConfig, h as BillingLoginRequest, i as BillingLoginResult, j as BillingSessionError, k as BillingSessionInfo, l as CreateAppParams, E as EstimateBatchGasOptions, m as ExecuteBatchOptions, n as Execution, G as GeneratedKey, L as LogVisibility, o as LoginRequest, p as LoginResult, q as LogsParams, r as SiweMessageResult, U as UserApiClient, s as UserApiClientOptions, t as addHexPrefix, u as assertValidImageReference, v as assertValidPrivateKey, w as checkERC7702Delegation, x as createSiweMessage, y as estimateBatchGas, z as executeBatch, D as extractAppNameFromImage, F as generateNewPrivateKey, H as generateNonce, I as getAvailableEnvironments, J as getBillingApiSession, K as getBillingEnvironmentConfig, M as getBuildType, N as getChainFromID, O as getComputeApiSession, P as getEnvironmentConfig, Q as isBillingSessionValid, R as isEnvironmentAvailable, T as isMainnet, V as isSessionValid, W as isSiweMessageExpired, X as isSiweMessageNotYetValid, Y as isSubscriptionActive, Z as loginToBillingApi, _ as loginToBothApis, $ as loginToComputeApi, a0 as logoutFromBillingApi, a1 as logoutFromBothApis, a2 as logoutFromComputeApi, a3 as parseSiweMessage, a4 as sanitizeString, a5 as sanitizeURL, a6 as sanitizeXURL, a7 as stripHexPrefix, a8 as validateAppID, a9 as validateAppName, aa as validateCreateAppParams, ab as validateDescription, ac as validateImageReference, ad as validateInstanceTypeSKU, ae as validateLogVisibility, af as validateLogsParams, ag as validatePrivateKeyFormat, ah as validateURL, ai as validateXURL } from './helpers-DEGFGA-T.js';
|
|
5
5
|
import { WalletClient, Address, Hex } from 'viem';
|
|
6
6
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
7
7
|
|
package/dist/browser.js
CHANGED
|
@@ -633,7 +633,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
|
|
|
633
633
|
var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
|
|
634
634
|
var CanUpdateAppProfilePermission = "0x036fef61";
|
|
635
635
|
function getDefaultClientId() {
|
|
636
|
-
const version = true ? "1.0.0-dev.
|
|
636
|
+
const version = true ? "1.0.0-dev.5" : "0.0.0";
|
|
637
637
|
return `ecloud-sdk/v${version}`;
|
|
638
638
|
}
|
|
639
639
|
var UserApiClient = class {
|
|
@@ -1236,6 +1236,63 @@ var BillingApiClient = class {
|
|
|
1236
1236
|
return resp.json();
|
|
1237
1237
|
}
|
|
1238
1238
|
// ==========================================================================
|
|
1239
|
+
// Admin - Coupon Methods
|
|
1240
|
+
// ==========================================================================
|
|
1241
|
+
async createCoupon(amountCents) {
|
|
1242
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons`;
|
|
1243
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { amountCents });
|
|
1244
|
+
return resp.json();
|
|
1245
|
+
}
|
|
1246
|
+
async listCoupons(opts) {
|
|
1247
|
+
const params = new URLSearchParams();
|
|
1248
|
+
if (opts?.offset !== void 0) params.set("offset", opts.offset.toString());
|
|
1249
|
+
if (opts?.limit !== void 0) params.set("limit", opts.limit.toString());
|
|
1250
|
+
if (opts?.active !== void 0) params.set("active", opts.active.toString());
|
|
1251
|
+
if (opts?.redeemed !== void 0) params.set("redeemed", opts.redeemed.toString());
|
|
1252
|
+
const qs = params.toString();
|
|
1253
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons${qs ? `?${qs}` : ""}`;
|
|
1254
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
|
|
1255
|
+
return resp.json();
|
|
1256
|
+
}
|
|
1257
|
+
async getCoupon(id) {
|
|
1258
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}`;
|
|
1259
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
|
|
1260
|
+
return resp.json();
|
|
1261
|
+
}
|
|
1262
|
+
async deactivateCoupon(id) {
|
|
1263
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}/deactivate`;
|
|
1264
|
+
await this.makeAuthenticatedRequest(endpoint, "POST", "compute");
|
|
1265
|
+
}
|
|
1266
|
+
async redeemCouponForUser(id, address) {
|
|
1267
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}/redeem`;
|
|
1268
|
+
await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { address });
|
|
1269
|
+
}
|
|
1270
|
+
// ==========================================================================
|
|
1271
|
+
// Admin - Admin Management Methods
|
|
1272
|
+
// ==========================================================================
|
|
1273
|
+
async addAdmin(address) {
|
|
1274
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/admins`;
|
|
1275
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { address });
|
|
1276
|
+
return resp.json();
|
|
1277
|
+
}
|
|
1278
|
+
async removeAdmin(address) {
|
|
1279
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/admins/${address}`;
|
|
1280
|
+
await this.makeAuthenticatedRequest(endpoint, "DELETE", "compute");
|
|
1281
|
+
}
|
|
1282
|
+
async listAdmins() {
|
|
1283
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/admins`;
|
|
1284
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
|
|
1285
|
+
return resp.json();
|
|
1286
|
+
}
|
|
1287
|
+
// ==========================================================================
|
|
1288
|
+
// User - Coupon Redemption
|
|
1289
|
+
// ==========================================================================
|
|
1290
|
+
async redeemCoupon(code) {
|
|
1291
|
+
const endpoint = `${this.config.billingApiServerURL}/v1/coupons/redeem`;
|
|
1292
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { code });
|
|
1293
|
+
return resp.json();
|
|
1294
|
+
}
|
|
1295
|
+
// ==========================================================================
|
|
1239
1296
|
// Internal Methods
|
|
1240
1297
|
// ==========================================================================
|
|
1241
1298
|
/**
|