@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.cjs
CHANGED
|
@@ -744,7 +744,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
|
|
|
744
744
|
var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
|
|
745
745
|
var CanUpdateAppProfilePermission = "0x036fef61";
|
|
746
746
|
function getDefaultClientId() {
|
|
747
|
-
const version = true ? "1.0.0-dev.
|
|
747
|
+
const version = true ? "1.0.0-dev.5" : "0.0.0";
|
|
748
748
|
return `ecloud-sdk/v${version}`;
|
|
749
749
|
}
|
|
750
750
|
var UserApiClient = class {
|
|
@@ -1347,6 +1347,63 @@ var BillingApiClient = class {
|
|
|
1347
1347
|
return resp.json();
|
|
1348
1348
|
}
|
|
1349
1349
|
// ==========================================================================
|
|
1350
|
+
// Admin - Coupon Methods
|
|
1351
|
+
// ==========================================================================
|
|
1352
|
+
async createCoupon(amountCents) {
|
|
1353
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons`;
|
|
1354
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { amountCents });
|
|
1355
|
+
return resp.json();
|
|
1356
|
+
}
|
|
1357
|
+
async listCoupons(opts) {
|
|
1358
|
+
const params = new URLSearchParams();
|
|
1359
|
+
if (opts?.offset !== void 0) params.set("offset", opts.offset.toString());
|
|
1360
|
+
if (opts?.limit !== void 0) params.set("limit", opts.limit.toString());
|
|
1361
|
+
if (opts?.active !== void 0) params.set("active", opts.active.toString());
|
|
1362
|
+
if (opts?.redeemed !== void 0) params.set("redeemed", opts.redeemed.toString());
|
|
1363
|
+
const qs = params.toString();
|
|
1364
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons${qs ? `?${qs}` : ""}`;
|
|
1365
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
|
|
1366
|
+
return resp.json();
|
|
1367
|
+
}
|
|
1368
|
+
async getCoupon(id) {
|
|
1369
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}`;
|
|
1370
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
|
|
1371
|
+
return resp.json();
|
|
1372
|
+
}
|
|
1373
|
+
async deactivateCoupon(id) {
|
|
1374
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}/deactivate`;
|
|
1375
|
+
await this.makeAuthenticatedRequest(endpoint, "POST", "compute");
|
|
1376
|
+
}
|
|
1377
|
+
async redeemCouponForUser(id, address) {
|
|
1378
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/coupons/${id}/redeem`;
|
|
1379
|
+
await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { address });
|
|
1380
|
+
}
|
|
1381
|
+
// ==========================================================================
|
|
1382
|
+
// Admin - Admin Management Methods
|
|
1383
|
+
// ==========================================================================
|
|
1384
|
+
async addAdmin(address) {
|
|
1385
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/admins`;
|
|
1386
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { address });
|
|
1387
|
+
return resp.json();
|
|
1388
|
+
}
|
|
1389
|
+
async removeAdmin(address) {
|
|
1390
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/admins/${address}`;
|
|
1391
|
+
await this.makeAuthenticatedRequest(endpoint, "DELETE", "compute");
|
|
1392
|
+
}
|
|
1393
|
+
async listAdmins() {
|
|
1394
|
+
const endpoint = `${this.config.billingApiServerURL}/admin/admins`;
|
|
1395
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "GET", "compute");
|
|
1396
|
+
return resp.json();
|
|
1397
|
+
}
|
|
1398
|
+
// ==========================================================================
|
|
1399
|
+
// User - Coupon Redemption
|
|
1400
|
+
// ==========================================================================
|
|
1401
|
+
async redeemCoupon(code) {
|
|
1402
|
+
const endpoint = `${this.config.billingApiServerURL}/v1/coupons/redeem`;
|
|
1403
|
+
const resp = await this.makeAuthenticatedRequest(endpoint, "POST", "compute", { code });
|
|
1404
|
+
return resp.json();
|
|
1405
|
+
}
|
|
1406
|
+
// ==========================================================================
|
|
1350
1407
|
// Internal Methods
|
|
1351
1408
|
// ==========================================================================
|
|
1352
1409
|
/**
|