@stigg/typescript 0.1.0-beta.65 → 0.1.0-beta.66
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/CHANGELOG.md +16 -0
- package/package.json +1 -1
- package/resources/v1/addons/addons.d.mts +59 -0
- package/resources/v1/addons/addons.d.mts.map +1 -1
- package/resources/v1/addons/addons.d.ts +59 -0
- package/resources/v1/addons/addons.d.ts.map +1 -1
- package/resources/v1/addons/addons.js +59 -0
- package/resources/v1/addons/addons.js.map +1 -1
- package/resources/v1/addons/addons.mjs +59 -0
- package/resources/v1/addons/addons.mjs.map +1 -1
- package/resources/v1/addons/entitlements.d.mts +31 -0
- package/resources/v1/addons/entitlements.d.mts.map +1 -1
- package/resources/v1/addons/entitlements.d.ts +31 -0
- package/resources/v1/addons/entitlements.d.ts.map +1 -1
- package/resources/v1/addons/entitlements.js +31 -0
- package/resources/v1/addons/entitlements.js.map +1 -1
- package/resources/v1/addons/entitlements.mjs +31 -0
- package/resources/v1/addons/entitlements.mjs.map +1 -1
- package/resources/v1/contracts.d.mts +30 -0
- package/resources/v1/contracts.d.mts.map +1 -1
- package/resources/v1/contracts.d.ts +30 -0
- package/resources/v1/contracts.d.ts.map +1 -1
- package/resources/v1/contracts.js +30 -0
- package/resources/v1/contracts.js.map +1 -1
- package/resources/v1/contracts.mjs +30 -0
- package/resources/v1/contracts.mjs.map +1 -1
- package/resources/v1/coupons.d.mts +36 -0
- package/resources/v1/coupons.d.mts.map +1 -1
- package/resources/v1/coupons.d.ts +36 -0
- package/resources/v1/coupons.d.ts.map +1 -1
- package/resources/v1/coupons.js +36 -0
- package/resources/v1/coupons.js.map +1 -1
- package/resources/v1/coupons.mjs +36 -0
- package/resources/v1/coupons.mjs.map +1 -1
- package/resources/v1/credits/consumption.d.mts +26 -0
- package/resources/v1/credits/consumption.d.mts.map +1 -1
- package/resources/v1/credits/consumption.d.ts +26 -0
- package/resources/v1/credits/consumption.d.ts.map +1 -1
- package/resources/v1/credits/consumption.js +26 -0
- package/resources/v1/credits/consumption.js.map +1 -1
- package/resources/v1/credits/consumption.mjs +26 -0
- package/resources/v1/credits/consumption.mjs.map +1 -1
- package/resources/v1/credits/credits.d.mts +25 -0
- package/resources/v1/credits/credits.d.mts.map +1 -1
- package/resources/v1/credits/credits.d.ts +25 -0
- package/resources/v1/credits/credits.d.ts.map +1 -1
- package/resources/v1/credits/credits.js +25 -0
- package/resources/v1/credits/credits.js.map +1 -1
- package/resources/v1/credits/credits.mjs +25 -0
- package/resources/v1/credits/credits.mjs.map +1 -1
- package/resources/v1/credits/custom-currencies.d.mts +49 -0
- package/resources/v1/credits/custom-currencies.d.mts.map +1 -1
- package/resources/v1/credits/custom-currencies.d.ts +49 -0
- package/resources/v1/credits/custom-currencies.d.ts.map +1 -1
- package/resources/v1/credits/custom-currencies.js +49 -0
- package/resources/v1/credits/custom-currencies.js.map +1 -1
- package/resources/v1/credits/custom-currencies.mjs +49 -0
- package/resources/v1/credits/custom-currencies.mjs.map +1 -1
- package/resources/v1/credits/grants.d.mts +28 -0
- package/resources/v1/credits/grants.d.mts.map +1 -1
- package/resources/v1/credits/grants.d.ts +28 -0
- package/resources/v1/credits/grants.d.ts.map +1 -1
- package/resources/v1/credits/grants.js +28 -0
- package/resources/v1/credits/grants.js.map +1 -1
- package/resources/v1/credits/grants.mjs +28 -0
- package/resources/v1/credits/grants.mjs.map +1 -1
- package/resources/v1/credits/reservations.d.mts +10 -0
- package/resources/v1/credits/reservations.d.mts.map +1 -1
- package/resources/v1/credits/reservations.d.ts +10 -0
- package/resources/v1/credits/reservations.d.ts.map +1 -1
- package/resources/v1/credits/reservations.js +10 -0
- package/resources/v1/credits/reservations.js.map +1 -1
- package/resources/v1/credits/reservations.mjs +10 -0
- package/resources/v1/credits/reservations.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +182 -7
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +182 -7
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +106 -6
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +106 -6
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/entities/entities.d.mts +332 -0
- package/resources/v1/customers/entities/entities.d.mts.map +1 -0
- package/resources/v1/customers/entities/entities.d.ts +332 -0
- package/resources/v1/customers/entities/entities.d.ts.map +1 -0
- package/resources/v1/customers/entities/entities.js +139 -0
- package/resources/v1/customers/entities/entities.js.map +1 -0
- package/resources/v1/customers/entities/entities.mjs +134 -0
- package/resources/v1/customers/entities/entities.mjs.map +1 -0
- package/resources/v1/customers/entities/entitlements.d.mts +260 -0
- package/resources/v1/customers/entities/entitlements.d.mts.map +1 -0
- package/resources/v1/customers/entities/entitlements.d.ts +260 -0
- package/resources/v1/customers/entities/entitlements.d.ts.map +1 -0
- package/resources/v1/customers/entities/entitlements.js +87 -0
- package/resources/v1/customers/entities/entitlements.js.map +1 -0
- package/resources/v1/customers/entities/entitlements.mjs +83 -0
- package/resources/v1/customers/entities/entitlements.mjs.map +1 -0
- package/resources/v1/customers/entities/index.d.mts +3 -0
- package/resources/v1/customers/entities/index.d.mts.map +1 -0
- package/resources/v1/customers/entities/index.d.ts +3 -0
- package/resources/v1/customers/entities/index.d.ts.map +1 -0
- package/resources/v1/customers/entities/index.js +9 -0
- package/resources/v1/customers/entities/index.js.map +1 -0
- package/resources/v1/customers/entities/index.mjs +4 -0
- package/resources/v1/customers/entities/index.mjs.map +1 -0
- package/resources/v1/customers/entities.d.mts +2 -0
- package/resources/v1/customers/entities.d.mts.map +1 -0
- package/resources/v1/customers/entities.d.ts +2 -0
- package/resources/v1/customers/entities.d.ts.map +1 -0
- package/resources/v1/customers/entities.js +6 -0
- package/resources/v1/customers/entities.js.map +1 -0
- package/resources/v1/customers/entities.mjs +3 -0
- package/resources/v1/customers/entities.mjs.map +1 -0
- package/resources/v1/customers/index.d.mts +1 -0
- package/resources/v1/customers/index.d.mts.map +1 -1
- package/resources/v1/customers/index.d.ts +1 -0
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js +3 -1
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs +1 -0
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/integrations.d.mts +47 -0
- package/resources/v1/customers/integrations.d.mts.map +1 -1
- package/resources/v1/customers/integrations.d.ts +47 -0
- package/resources/v1/customers/integrations.d.ts.map +1 -1
- package/resources/v1/customers/integrations.js +47 -0
- package/resources/v1/customers/integrations.js.map +1 -1
- package/resources/v1/customers/integrations.mjs +47 -0
- package/resources/v1/customers/integrations.mjs.map +1 -1
- package/resources/v1/customers/payment-method.d.mts +16 -0
- package/resources/v1/customers/payment-method.d.mts.map +1 -1
- package/resources/v1/customers/payment-method.d.ts +16 -0
- package/resources/v1/customers/payment-method.d.ts.map +1 -1
- package/resources/v1/customers/payment-method.js +16 -0
- package/resources/v1/customers/payment-method.js.map +1 -1
- package/resources/v1/customers/payment-method.mjs +16 -0
- package/resources/v1/customers/payment-method.mjs.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.mts +51 -0
- package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.ts +51 -0
- package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -1
- package/resources/v1/customers/promotional-entitlements.js +51 -0
- package/resources/v1/customers/promotional-entitlements.js.map +1 -1
- package/resources/v1/customers/promotional-entitlements.mjs +51 -0
- package/resources/v1/customers/promotional-entitlements.mjs.map +1 -1
- package/resources/v1/entity-types.d.mts +291 -0
- package/resources/v1/entity-types.d.mts.map +1 -0
- package/resources/v1/entity-types.d.ts +291 -0
- package/resources/v1/entity-types.d.ts.map +1 -0
- package/resources/v1/entity-types.js +128 -0
- package/resources/v1/entity-types.js.map +1 -0
- package/resources/v1/entity-types.mjs +124 -0
- package/resources/v1/entity-types.mjs.map +1 -0
- package/resources/v1/events/beta/customers.d.mts +8 -0
- package/resources/v1/events/beta/customers.d.mts.map +1 -1
- package/resources/v1/events/beta/customers.d.ts +8 -0
- package/resources/v1/events/beta/customers.d.ts.map +1 -1
- package/resources/v1/events/beta/customers.js +8 -0
- package/resources/v1/events/beta/customers.js.map +1 -1
- package/resources/v1/events/beta/customers.mjs +8 -0
- package/resources/v1/events/beta/customers.mjs.map +1 -1
- package/resources/v1/events/data-export/data-export.d.mts +12 -0
- package/resources/v1/events/data-export/data-export.d.mts.map +1 -1
- package/resources/v1/events/data-export/data-export.d.ts +12 -0
- package/resources/v1/events/data-export/data-export.d.ts.map +1 -1
- package/resources/v1/events/data-export/data-export.js +12 -0
- package/resources/v1/events/data-export/data-export.js.map +1 -1
- package/resources/v1/events/data-export/data-export.mjs +12 -0
- package/resources/v1/events/data-export/data-export.mjs.map +1 -1
- package/resources/v1/events/data-export/destinations.d.mts +26 -0
- package/resources/v1/events/data-export/destinations.d.mts.map +1 -1
- package/resources/v1/events/data-export/destinations.d.ts +26 -0
- package/resources/v1/events/data-export/destinations.d.ts.map +1 -1
- package/resources/v1/events/data-export/destinations.js +26 -0
- package/resources/v1/events/data-export/destinations.js.map +1 -1
- package/resources/v1/events/data-export/destinations.mjs +26 -0
- package/resources/v1/events/data-export/destinations.mjs.map +1 -1
- package/resources/v1/events/events.d.mts +21 -0
- package/resources/v1/events/events.d.mts.map +1 -1
- package/resources/v1/events/events.d.ts +21 -0
- package/resources/v1/events/events.d.ts.map +1 -1
- package/resources/v1/events/events.js +21 -0
- package/resources/v1/events/events.js.map +1 -1
- package/resources/v1/events/events.mjs +21 -0
- package/resources/v1/events/events.mjs.map +1 -1
- package/resources/v1/features.d.mts +43 -0
- package/resources/v1/features.d.mts.map +1 -1
- package/resources/v1/features.d.ts +43 -0
- package/resources/v1/features.d.ts.map +1 -1
- package/resources/v1/features.js +43 -0
- package/resources/v1/features.js.map +1 -1
- package/resources/v1/features.mjs +43 -0
- package/resources/v1/features.mjs.map +1 -1
- package/resources/v1/index.d.mts +1 -0
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +1 -0
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +3 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +1 -0
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/plans/entitlements.d.mts +31 -0
- package/resources/v1/plans/entitlements.d.mts.map +1 -1
- package/resources/v1/plans/entitlements.d.ts +31 -0
- package/resources/v1/plans/entitlements.d.ts.map +1 -1
- package/resources/v1/plans/entitlements.js +31 -0
- package/resources/v1/plans/entitlements.js.map +1 -1
- package/resources/v1/plans/entitlements.mjs +31 -0
- package/resources/v1/plans/entitlements.mjs.map +1 -1
- package/resources/v1/plans/plans.d.mts +69 -0
- package/resources/v1/plans/plans.d.mts.map +1 -1
- package/resources/v1/plans/plans.d.ts +69 -0
- package/resources/v1/plans/plans.d.ts.map +1 -1
- package/resources/v1/plans/plans.js +69 -0
- package/resources/v1/plans/plans.js.map +1 -1
- package/resources/v1/plans/plans.mjs +69 -0
- package/resources/v1/plans/plans.mjs.map +1 -1
- package/resources/v1/products.d.mts +43 -0
- package/resources/v1/products.d.mts.map +1 -1
- package/resources/v1/products.d.ts +43 -0
- package/resources/v1/products.d.ts.map +1 -1
- package/resources/v1/products.js +43 -0
- package/resources/v1/products.js.map +1 -1
- package/resources/v1/products.mjs +43 -0
- package/resources/v1/products.mjs.map +1 -1
- package/resources/v1/subscriptions/future-update.d.mts +16 -0
- package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
- package/resources/v1/subscriptions/future-update.d.ts +16 -0
- package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
- package/resources/v1/subscriptions/future-update.js +16 -0
- package/resources/v1/subscriptions/future-update.js.map +1 -1
- package/resources/v1/subscriptions/future-update.mjs +16 -0
- package/resources/v1/subscriptions/future-update.mjs.map +1 -1
- package/resources/v1/subscriptions/invoice.d.mts +6 -0
- package/resources/v1/subscriptions/invoice.d.mts.map +1 -1
- package/resources/v1/subscriptions/invoice.d.ts +6 -0
- package/resources/v1/subscriptions/invoice.d.ts.map +1 -1
- package/resources/v1/subscriptions/invoice.js +6 -0
- package/resources/v1/subscriptions/invoice.js.map +1 -1
- package/resources/v1/subscriptions/invoice.mjs +6 -0
- package/resources/v1/subscriptions/invoice.mjs.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.mts +81 -0
- package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.ts +81 -0
- package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.js +81 -0
- package/resources/v1/subscriptions/subscriptions.js.map +1 -1
- package/resources/v1/subscriptions/subscriptions.mjs +81 -0
- package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
- package/resources/v1/subscriptions/usage.d.mts +13 -0
- package/resources/v1/subscriptions/usage.d.mts.map +1 -1
- package/resources/v1/subscriptions/usage.d.ts +13 -0
- package/resources/v1/subscriptions/usage.d.ts.map +1 -1
- package/resources/v1/subscriptions/usage.js +13 -0
- package/resources/v1/subscriptions/usage.js.map +1 -1
- package/resources/v1/subscriptions/usage.mjs +13 -0
- package/resources/v1/subscriptions/usage.mjs.map +1 -1
- package/resources/v1/usage.d.mts +20 -0
- package/resources/v1/usage.d.mts.map +1 -1
- package/resources/v1/usage.d.ts +20 -0
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +20 -0
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +20 -0
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +4 -0
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +4 -0
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +4 -0
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +4 -0
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v1-beta/customers/assignments.d.mts +12 -33
- package/resources/v1-beta/customers/assignments.d.mts.map +1 -1
- package/resources/v1-beta/customers/assignments.d.ts +12 -33
- package/resources/v1-beta/customers/assignments.d.ts.map +1 -1
- package/resources/v1-beta/customers/assignments.js +7 -33
- package/resources/v1-beta/customers/assignments.js.map +1 -1
- package/resources/v1-beta/customers/assignments.mjs +7 -33
- package/resources/v1-beta/customers/assignments.mjs.map +1 -1
- package/resources/v1-beta/customers/entities.d.mts +17 -50
- package/resources/v1-beta/customers/entities.d.mts.map +1 -1
- package/resources/v1-beta/customers/entities.d.ts +17 -50
- package/resources/v1-beta/customers/entities.d.ts.map +1 -1
- package/resources/v1-beta/customers/entities.js +17 -50
- package/resources/v1-beta/customers/entities.js.map +1 -1
- package/resources/v1-beta/customers/entities.mjs +17 -50
- package/resources/v1-beta/customers/entities.mjs.map +1 -1
- package/resources/v1-beta/customers/entitlements.d.mts +7 -10
- package/resources/v1-beta/customers/entitlements.d.mts.map +1 -1
- package/resources/v1-beta/customers/entitlements.d.ts +7 -10
- package/resources/v1-beta/customers/entitlements.d.ts.map +1 -1
- package/resources/v1-beta/customers/entitlements.js +2 -5
- package/resources/v1-beta/customers/entitlements.js.map +1 -1
- package/resources/v1-beta/customers/entitlements.mjs +2 -5
- package/resources/v1-beta/customers/entitlements.mjs.map +1 -1
- package/resources/v1-beta/entity-types.d.mts +4 -27
- package/resources/v1-beta/entity-types.d.mts.map +1 -1
- package/resources/v1-beta/entity-types.d.ts +4 -27
- package/resources/v1-beta/entity-types.d.ts.map +1 -1
- package/resources/v1-beta/entity-types.js +4 -27
- package/resources/v1-beta/entity-types.js.map +1 -1
- package/resources/v1-beta/entity-types.mjs +4 -27
- package/resources/v1-beta/entity-types.mjs.map +1 -1
- package/src/resources/v1/addons/addons.ts +59 -0
- package/src/resources/v1/addons/entitlements.ts +31 -0
- package/src/resources/v1/contracts.ts +30 -0
- package/src/resources/v1/coupons.ts +36 -0
- package/src/resources/v1/credits/consumption.ts +26 -0
- package/src/resources/v1/credits/credits.ts +25 -0
- package/src/resources/v1/credits/custom-currencies.ts +49 -0
- package/src/resources/v1/credits/grants.ts +28 -0
- package/src/resources/v1/credits/reservations.ts +10 -0
- package/src/resources/v1/customers/customers.ts +217 -7
- package/src/resources/v1/customers/entities/entities.ts +470 -0
- package/src/resources/v1/customers/entities/entitlements.ts +347 -0
- package/src/resources/v1/customers/entities/index.ts +22 -0
- package/src/resources/v1/customers/entities.ts +3 -0
- package/src/resources/v1/customers/index.ts +12 -0
- package/src/resources/v1/customers/integrations.ts +47 -0
- package/src/resources/v1/customers/payment-method.ts +16 -0
- package/src/resources/v1/customers/promotional-entitlements.ts +51 -0
- package/src/resources/v1/entity-types.ts +402 -0
- package/src/resources/v1/events/beta/customers.ts +8 -0
- package/src/resources/v1/events/data-export/data-export.ts +12 -0
- package/src/resources/v1/events/data-export/destinations.ts +26 -0
- package/src/resources/v1/events/events.ts +21 -0
- package/src/resources/v1/features.ts +43 -0
- package/src/resources/v1/index.ts +12 -0
- package/src/resources/v1/plans/entitlements.ts +31 -0
- package/src/resources/v1/plans/plans.ts +69 -0
- package/src/resources/v1/products.ts +43 -0
- package/src/resources/v1/subscriptions/future-update.ts +16 -0
- package/src/resources/v1/subscriptions/invoice.ts +6 -0
- package/src/resources/v1/subscriptions/subscriptions.ts +81 -0
- package/src/resources/v1/subscriptions/usage.ts +13 -0
- package/src/resources/v1/usage.ts +20 -0
- package/src/resources/v1/v1.ts +28 -0
- package/src/resources/v1-beta/customers/assignments.ts +12 -33
- package/src/resources/v1-beta/customers/entities.ts +17 -50
- package/src/resources/v1-beta/customers/entitlements.ts +7 -10
- package/src/resources/v1-beta/entity-types.ts +4 -27
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -14,6 +14,18 @@ export class Grants extends APIResource {
|
|
|
14
14
|
/**
|
|
15
15
|
* Creates a new credit grant for a customer with specified amount, type, and
|
|
16
16
|
* optional billing configuration.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const creditGrantResponse =
|
|
21
|
+
* await client.v1.credits.grants.create({
|
|
22
|
+
* amount: 0,
|
|
23
|
+
* currencyId: 'currencyId',
|
|
24
|
+
* customerId: 'customerId',
|
|
25
|
+
* displayName: 'displayName',
|
|
26
|
+
* grantType: 'PAID',
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
17
29
|
*/
|
|
18
30
|
create(params: GrantCreateParams, options?: RequestOptions): APIPromise<CreditGrantResponse> {
|
|
19
31
|
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
@@ -32,6 +44,16 @@ export class Grants extends APIResource {
|
|
|
32
44
|
|
|
33
45
|
/**
|
|
34
46
|
* Retrieves a paginated list of credit grants for a customer.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* // Automatically fetches more pages as needed.
|
|
51
|
+
* for await (const grantListResponse of client.v1.credits.grants.list(
|
|
52
|
+
* { customerId: 'customerId' },
|
|
53
|
+
* )) {
|
|
54
|
+
* // ...
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
35
57
|
*/
|
|
36
58
|
list(
|
|
37
59
|
params: GrantListParams,
|
|
@@ -54,6 +76,12 @@ export class Grants extends APIResource {
|
|
|
54
76
|
/**
|
|
55
77
|
* Voids an existing credit grant, preventing further consumption of the remaining
|
|
56
78
|
* credits.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* const creditGrantResponse =
|
|
83
|
+
* await client.v1.credits.grants.void('x');
|
|
84
|
+
* ```
|
|
57
85
|
*/
|
|
58
86
|
void(
|
|
59
87
|
id: string,
|
|
@@ -11,6 +11,16 @@ export class Reservations extends APIResource {
|
|
|
11
11
|
* Releases a credit reservation, consuming the given amount and returning the rest
|
|
12
12
|
* of the held credits to the balance. Retry a failed release with the same
|
|
13
13
|
* reservation ID; it is applied once.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const response =
|
|
18
|
+
* await client.v1.credits.reservations.release('x', {
|
|
19
|
+
* consumedAmount: 0,
|
|
20
|
+
* currencyId: 'currencyId',
|
|
21
|
+
* customerId: 'customerId',
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
14
24
|
*/
|
|
15
25
|
release(
|
|
16
26
|
reservationID: string,
|
|
@@ -25,6 +25,19 @@ import {
|
|
|
25
25
|
PromotionalEntitlementRevokeResponse,
|
|
26
26
|
PromotionalEntitlements,
|
|
27
27
|
} from './promotional-entitlements';
|
|
28
|
+
import * as EntitiesAPI from './entities/entities';
|
|
29
|
+
import {
|
|
30
|
+
Entities,
|
|
31
|
+
EntityArchiveParams,
|
|
32
|
+
EntityArchiveResponse,
|
|
33
|
+
EntityListParams,
|
|
34
|
+
EntityListResponse,
|
|
35
|
+
EntityListResponsesMyCursorIDPage,
|
|
36
|
+
EntityRetrieveParams,
|
|
37
|
+
EntityRetrieveResponse,
|
|
38
|
+
EntityUpsertParams,
|
|
39
|
+
EntityUpsertResponse,
|
|
40
|
+
} from './entities/entities';
|
|
28
41
|
import { APIPromise } from '../../../core/api-promise';
|
|
29
42
|
import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from '../../../core/pagination';
|
|
30
43
|
import { buildHeaders } from '../../../internal/headers';
|
|
@@ -36,10 +49,18 @@ export class Customers extends APIResource {
|
|
|
36
49
|
promotionalEntitlements: PromotionalEntitlementsAPI.PromotionalEntitlements =
|
|
37
50
|
new PromotionalEntitlementsAPI.PromotionalEntitlements(this._client);
|
|
38
51
|
integrations: IntegrationsAPI.Integrations = new IntegrationsAPI.Integrations(this._client);
|
|
52
|
+
entities: EntitiesAPI.Entities = new EntitiesAPI.Entities(this._client);
|
|
39
53
|
|
|
40
54
|
/**
|
|
41
55
|
* Retrieves a customer by their unique identifier, including billing information
|
|
42
56
|
* and subscription status.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const customerResponse = await client.v1.customers.retrieve(
|
|
61
|
+
* 'x',
|
|
62
|
+
* );
|
|
63
|
+
* ```
|
|
43
64
|
*/
|
|
44
65
|
retrieve(
|
|
45
66
|
id: string,
|
|
@@ -62,6 +83,13 @@ export class Customers extends APIResource {
|
|
|
62
83
|
/**
|
|
63
84
|
* Updates an existing customer's properties such as name, email, and billing
|
|
64
85
|
* information.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* const customerResponse = await client.v1.customers.update(
|
|
90
|
+
* 'x',
|
|
91
|
+
* );
|
|
92
|
+
* ```
|
|
65
93
|
*/
|
|
66
94
|
update(id: string, params: CustomerUpdateParams, options?: RequestOptions): APIPromise<CustomerResponse> {
|
|
67
95
|
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
@@ -80,6 +108,14 @@ export class Customers extends APIResource {
|
|
|
80
108
|
|
|
81
109
|
/**
|
|
82
110
|
* Retrieves a paginated list of customers in the environment.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```ts
|
|
114
|
+
* // Automatically fetches more pages as needed.
|
|
115
|
+
* for await (const customerListResponse of client.v1.customers.list()) {
|
|
116
|
+
* // ...
|
|
117
|
+
* }
|
|
118
|
+
* ```
|
|
83
119
|
*/
|
|
84
120
|
list(
|
|
85
121
|
params: CustomerListParams | null | undefined = {},
|
|
@@ -102,6 +138,13 @@ export class Customers extends APIResource {
|
|
|
102
138
|
/**
|
|
103
139
|
* Archives a customer, preventing new subscriptions. Optionally cancels existing
|
|
104
140
|
* subscriptions.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```ts
|
|
144
|
+
* const customerResponse = await client.v1.customers.archive(
|
|
145
|
+
* 'x',
|
|
146
|
+
* );
|
|
147
|
+
* ```
|
|
105
148
|
*/
|
|
106
149
|
archive(
|
|
107
150
|
id: string,
|
|
@@ -124,12 +167,21 @@ export class Customers extends APIResource {
|
|
|
124
167
|
/**
|
|
125
168
|
* Checks a single entitlement (feature or credit) for a customer or resource.
|
|
126
169
|
* Supports `requestedUsage` and `requestedValues` to evaluate against limits or
|
|
127
|
-
* enum values.
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
170
|
+
* enum values. Pass `dimensions` to also check the governance budgets of the
|
|
171
|
+
* entities the usage is attributed to; the response then includes `chains`. Each
|
|
172
|
+
* call reaches the Stigg API directly, so latency reflects a network round trip.
|
|
173
|
+
* For entitlement checks on a hot path (e.g. gating a request in real time), the
|
|
174
|
+
* Stigg Node Server SDK (with its built-in cache) or the Sidecar will typically
|
|
175
|
+
* respond faster and keep working through brief Stigg outages; reach for this
|
|
176
|
+
* endpoint when a live HTTP call is the natural fit, such as from a non-Node
|
|
177
|
+
* backend or a server-side job.
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```ts
|
|
181
|
+
* const response = await client.v1.customers.checkEntitlement(
|
|
182
|
+
* 'x',
|
|
183
|
+
* );
|
|
184
|
+
* ```
|
|
133
185
|
*/
|
|
134
186
|
checkEntitlement(
|
|
135
187
|
id: string,
|
|
@@ -153,6 +205,19 @@ export class Customers extends APIResource {
|
|
|
153
205
|
/**
|
|
154
206
|
* Imports multiple customers in bulk. Used for migrating customer data from
|
|
155
207
|
* external systems.
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```ts
|
|
211
|
+
* const response = await client.v1.customers.import({
|
|
212
|
+
* customers: [
|
|
213
|
+
* {
|
|
214
|
+
* id: 'id',
|
|
215
|
+
* email: 'dev@stainless.com',
|
|
216
|
+
* name: 'name',
|
|
217
|
+
* },
|
|
218
|
+
* ],
|
|
219
|
+
* });
|
|
220
|
+
* ```
|
|
156
221
|
*/
|
|
157
222
|
import(params: CustomerImportParams, options?: RequestOptions): APIPromise<CustomerImportResponse> {
|
|
158
223
|
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
@@ -173,6 +238,13 @@ export class Customers extends APIResource {
|
|
|
173
238
|
* Retrieves a customer's contracts. Each contract that has a billing contract is
|
|
174
239
|
* enriched with a preview of its upcoming (next) invoice when available. Returns
|
|
175
240
|
* an empty list when the customer has no contracts.
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* ```ts
|
|
244
|
+
* const response = await client.v1.customers.listContracts(
|
|
245
|
+
* 'id',
|
|
246
|
+
* );
|
|
247
|
+
* ```
|
|
176
248
|
*/
|
|
177
249
|
listContracts(
|
|
178
250
|
id: string,
|
|
@@ -199,6 +271,16 @@ export class Customers extends APIResource {
|
|
|
199
271
|
* Optionally narrowed to one contract, an issue-date range, and/or a set of
|
|
200
272
|
* invoice states. Returns an empty list when no billing provider is connected or
|
|
201
273
|
* the customer is not synced.
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* ```ts
|
|
277
|
+
* // Automatically fetches more pages as needed.
|
|
278
|
+
* for await (const customerListInvoicesResponse of client.v1.customers.listInvoices(
|
|
279
|
+
* 'id',
|
|
280
|
+
* )) {
|
|
281
|
+
* // ...
|
|
282
|
+
* }
|
|
283
|
+
* ```
|
|
202
284
|
*/
|
|
203
285
|
listInvoices(
|
|
204
286
|
id: string,
|
|
@@ -225,6 +307,16 @@ export class Customers extends APIResource {
|
|
|
225
307
|
|
|
226
308
|
/**
|
|
227
309
|
* Retrieves a paginated list of resources within the same customer.
|
|
310
|
+
*
|
|
311
|
+
* @example
|
|
312
|
+
* ```ts
|
|
313
|
+
* // Automatically fetches more pages as needed.
|
|
314
|
+
* for await (const customerListResourcesResponse of client.v1.customers.listResources(
|
|
315
|
+
* 'x',
|
|
316
|
+
* )) {
|
|
317
|
+
* // ...
|
|
318
|
+
* }
|
|
319
|
+
* ```
|
|
228
320
|
*/
|
|
229
321
|
listResources(
|
|
230
322
|
id: string,
|
|
@@ -251,6 +343,12 @@ export class Customers extends APIResource {
|
|
|
251
343
|
|
|
252
344
|
/**
|
|
253
345
|
* Creates a new customer.
|
|
346
|
+
*
|
|
347
|
+
* @example
|
|
348
|
+
* ```ts
|
|
349
|
+
* const customerResponse =
|
|
350
|
+
* await client.v1.customers.provision({ id: 'id' });
|
|
351
|
+
* ```
|
|
254
352
|
*/
|
|
255
353
|
provision(params: CustomerProvisionParams, options?: RequestOptions): APIPromise<CustomerResponse> {
|
|
256
354
|
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
@@ -275,6 +373,12 @@ export class Customers extends APIResource {
|
|
|
275
373
|
* built-in cache) or the Sidecar will typically respond faster and keep working
|
|
276
374
|
* through brief Stigg outages; reach for this endpoint when a live HTTP call is
|
|
277
375
|
* the natural fit, such as from a non-Node backend or a server-side job.
|
|
376
|
+
*
|
|
377
|
+
* @example
|
|
378
|
+
* ```ts
|
|
379
|
+
* const response =
|
|
380
|
+
* await client.v1.customers.retrieveEntitlements('x');
|
|
381
|
+
* ```
|
|
278
382
|
*/
|
|
279
383
|
retrieveEntitlements(
|
|
280
384
|
id: string,
|
|
@@ -297,6 +401,12 @@ export class Customers extends APIResource {
|
|
|
297
401
|
|
|
298
402
|
/**
|
|
299
403
|
* Restores an archived customer, allowing them to create new subscriptions again.
|
|
404
|
+
*
|
|
405
|
+
* @example
|
|
406
|
+
* ```ts
|
|
407
|
+
* const customerResponse =
|
|
408
|
+
* await client.v1.customers.unarchive('x');
|
|
409
|
+
* ```
|
|
300
410
|
*/
|
|
301
411
|
unarchive(
|
|
302
412
|
id: string,
|
|
@@ -1689,6 +1799,12 @@ export namespace CustomerCheckEntitlementResponse {
|
|
|
1689
1799
|
|
|
1690
1800
|
type: 'FEATURE';
|
|
1691
1801
|
|
|
1802
|
+
/**
|
|
1803
|
+
* Per-entity rollups, one chain per resolved dimension. Omitted when dimensions
|
|
1804
|
+
* was not provided.
|
|
1805
|
+
*/
|
|
1806
|
+
chains?: Array<Array<Feature.Chain>>;
|
|
1807
|
+
|
|
1692
1808
|
currentUsage?: number;
|
|
1693
1809
|
|
|
1694
1810
|
/**
|
|
@@ -1729,6 +1845,39 @@ export namespace CustomerCheckEntitlementResponse {
|
|
|
1729
1845
|
}
|
|
1730
1846
|
|
|
1731
1847
|
export namespace Feature {
|
|
1848
|
+
/**
|
|
1849
|
+
* Per-entity governance node — limit and current usage for a single resolved
|
|
1850
|
+
* entity.
|
|
1851
|
+
*/
|
|
1852
|
+
export interface Chain {
|
|
1853
|
+
/**
|
|
1854
|
+
* Amount consumed by this entity in the current cadence period.
|
|
1855
|
+
*/
|
|
1856
|
+
currentUsage: number;
|
|
1857
|
+
|
|
1858
|
+
/**
|
|
1859
|
+
* External id of the entity within the customer.
|
|
1860
|
+
*/
|
|
1861
|
+
entityId: string;
|
|
1862
|
+
|
|
1863
|
+
/**
|
|
1864
|
+
* Whether this node alone permits the requested usage.
|
|
1865
|
+
*/
|
|
1866
|
+
isGranted: boolean;
|
|
1867
|
+
|
|
1868
|
+
/**
|
|
1869
|
+
* External ids of the entities this budget is scoped to. Empty (`[]`) is the
|
|
1870
|
+
* node-wide budget; a non-empty set is the dimension-scoped budget that matched
|
|
1871
|
+
* this request — use it to tell apart multiple budgets on the same entity.
|
|
1872
|
+
*/
|
|
1873
|
+
scopeEntityIds: Array<string>;
|
|
1874
|
+
|
|
1875
|
+
/**
|
|
1876
|
+
* Hard usage limit for this node; null when the entity has no entity entitlement.
|
|
1877
|
+
*/
|
|
1878
|
+
usageLimit: number | null;
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1732
1881
|
export interface Feature {
|
|
1733
1882
|
/**
|
|
1734
1883
|
* The unique reference ID of the entitlement.
|
|
@@ -1788,6 +1937,12 @@ export namespace CustomerCheckEntitlementResponse {
|
|
|
1788
1937
|
*/
|
|
1789
1938
|
usageUpdatedAt: string;
|
|
1790
1939
|
|
|
1940
|
+
/**
|
|
1941
|
+
* Per-entity rollups, one chain per resolved dimension. Omitted when dimensions
|
|
1942
|
+
* was not provided.
|
|
1943
|
+
*/
|
|
1944
|
+
chains?: Array<Array<Credit.Chain>>;
|
|
1945
|
+
|
|
1791
1946
|
/**
|
|
1792
1947
|
* Timestamp of the last update to the entitlement grant or configuration.
|
|
1793
1948
|
*/
|
|
@@ -1859,6 +2014,39 @@ export namespace CustomerCheckEntitlementResponse {
|
|
|
1859
2014
|
unitSingular?: string | null;
|
|
1860
2015
|
}
|
|
1861
2016
|
|
|
2017
|
+
/**
|
|
2018
|
+
* Per-entity governance node — limit and current usage for a single resolved
|
|
2019
|
+
* entity.
|
|
2020
|
+
*/
|
|
2021
|
+
export interface Chain {
|
|
2022
|
+
/**
|
|
2023
|
+
* Amount consumed by this entity in the current cadence period.
|
|
2024
|
+
*/
|
|
2025
|
+
currentUsage: number;
|
|
2026
|
+
|
|
2027
|
+
/**
|
|
2028
|
+
* External id of the entity within the customer.
|
|
2029
|
+
*/
|
|
2030
|
+
entityId: string;
|
|
2031
|
+
|
|
2032
|
+
/**
|
|
2033
|
+
* Whether this node alone permits the requested usage.
|
|
2034
|
+
*/
|
|
2035
|
+
isGranted: boolean;
|
|
2036
|
+
|
|
2037
|
+
/**
|
|
2038
|
+
* External ids of the entities this budget is scoped to. Empty (`[]`) is the
|
|
2039
|
+
* node-wide budget; a non-empty set is the dimension-scoped budget that matched
|
|
2040
|
+
* this request — use it to tell apart multiple budgets on the same entity.
|
|
2041
|
+
*/
|
|
2042
|
+
scopeEntityIds: Array<string>;
|
|
2043
|
+
|
|
2044
|
+
/**
|
|
2045
|
+
* Hard usage limit for this node; null when the entity has no entity entitlement.
|
|
2046
|
+
*/
|
|
2047
|
+
usageLimit: number | null;
|
|
2048
|
+
}
|
|
2049
|
+
|
|
1862
2050
|
/**
|
|
1863
2051
|
* The reservation created by this request, when it asked to reserve credits and
|
|
1864
2052
|
* was granted.
|
|
@@ -3292,6 +3480,13 @@ export interface CustomerCheckEntitlementParams {
|
|
|
3292
3480
|
*/
|
|
3293
3481
|
currencyId?: string;
|
|
3294
3482
|
|
|
3483
|
+
/**
|
|
3484
|
+
* Query param: Attribution map of the entities the usage is attributed to (e.g.
|
|
3485
|
+
* `dimensions[userId]=u1`). When provided, their governance budgets are checked
|
|
3486
|
+
* too and the response includes `chains`.
|
|
3487
|
+
*/
|
|
3488
|
+
dimensions?: { [key: string]: string };
|
|
3489
|
+
|
|
3295
3490
|
/**
|
|
3296
3491
|
* Query param: Feature ID (refId) to check. Mutually exclusive with `currencyId`.
|
|
3297
3492
|
*/
|
|
@@ -3335,7 +3530,8 @@ export interface CustomerCheckEntitlementParams {
|
|
|
3335
3530
|
|
|
3336
3531
|
/**
|
|
3337
3532
|
* Query param: Credits to reserve (credit entitlements only). The check is decided
|
|
3338
|
-
* and the credits held atomically; `requestedUsage` is ignored.
|
|
3533
|
+
* and the credits held atomically; `requestedUsage` is ignored. Not supported with
|
|
3534
|
+
* `dimensions`.
|
|
3339
3535
|
*/
|
|
3340
3536
|
reserveAmount?: number;
|
|
3341
3537
|
|
|
@@ -4148,6 +4344,7 @@ export interface CustomerUnarchiveParams {
|
|
|
4148
4344
|
Customers.PaymentMethod = PaymentMethod;
|
|
4149
4345
|
Customers.PromotionalEntitlements = PromotionalEntitlements;
|
|
4150
4346
|
Customers.Integrations = Integrations;
|
|
4347
|
+
Customers.Entities = Entities;
|
|
4151
4348
|
|
|
4152
4349
|
export declare namespace Customers {
|
|
4153
4350
|
export {
|
|
@@ -4204,4 +4401,17 @@ export declare namespace Customers {
|
|
|
4204
4401
|
type IntegrationLinkParams as IntegrationLinkParams,
|
|
4205
4402
|
type IntegrationUnlinkParams as IntegrationUnlinkParams,
|
|
4206
4403
|
};
|
|
4404
|
+
|
|
4405
|
+
export {
|
|
4406
|
+
Entities as Entities,
|
|
4407
|
+
type EntityRetrieveResponse as EntityRetrieveResponse,
|
|
4408
|
+
type EntityListResponse as EntityListResponse,
|
|
4409
|
+
type EntityArchiveResponse as EntityArchiveResponse,
|
|
4410
|
+
type EntityUpsertResponse as EntityUpsertResponse,
|
|
4411
|
+
type EntityListResponsesMyCursorIDPage as EntityListResponsesMyCursorIDPage,
|
|
4412
|
+
type EntityRetrieveParams as EntityRetrieveParams,
|
|
4413
|
+
type EntityListParams as EntityListParams,
|
|
4414
|
+
type EntityArchiveParams as EntityArchiveParams,
|
|
4415
|
+
type EntityUpsertParams as EntityUpsertParams,
|
|
4416
|
+
};
|
|
4207
4417
|
}
|