@stigg/typescript 0.1.0-beta.14 → 0.1.0-beta.15
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 +8 -0
- package/client.d.mts +0 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +0 -3
- package/client.d.ts.map +1 -1
- package/client.js +0 -3
- package/client.js.map +1 -1
- package/client.mjs +0 -3
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +0 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +0 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +0 -1
- package/resources/index.mjs.map +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/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/credits.d.mts +59 -0
- package/resources/v1/credits/credits.d.mts.map +1 -1
- package/resources/v1/credits/credits.d.ts +59 -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/customers/customers.d.mts +77 -0
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +77 -0
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +77 -0
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +77 -0
- package/resources/v1/customers/customers.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-beta/v1-beta.d.mts → v1/events/beta/beta.d.mts} +4 -4
- package/resources/v1/events/beta/beta.d.mts.map +1 -0
- package/resources/{v1-beta/v1-beta.d.ts → v1/events/beta/beta.d.ts} +4 -4
- package/resources/v1/events/beta/beta.d.ts.map +1 -0
- package/resources/{v1-beta/v1-beta.js → v1/events/beta/beta.js} +8 -8
- package/resources/v1/events/beta/beta.js.map +1 -0
- package/resources/{v1-beta/v1-beta.mjs → v1/events/beta/beta.mjs} +5 -5
- package/resources/v1/events/beta/beta.mjs.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/customers/assignments.d.mts +24 -21
- package/resources/v1/events/beta/customers/assignments.d.mts.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/customers/assignments.d.ts +24 -21
- package/resources/v1/events/beta/customers/assignments.d.ts.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/customers/assignments.js +23 -20
- package/resources/v1/events/beta/customers/assignments.js.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/customers/assignments.mjs +23 -20
- package/resources/v1/events/beta/customers/assignments.mjs.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/customers/customers.d.mts +1 -1
- package/resources/v1/events/beta/customers/customers.d.mts.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/customers/customers.d.ts +1 -1
- package/resources/v1/events/beta/customers/customers.d.ts.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/customers/customers.js +2 -2
- package/resources/v1/events/beta/customers/customers.js.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/customers/customers.mjs +1 -1
- package/resources/v1/events/beta/customers/customers.mjs.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/customers/entities.d.mts +37 -28
- package/resources/v1/events/beta/customers/entities.d.mts.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/customers/entities.d.ts +37 -28
- package/resources/v1/events/beta/customers/entities.d.ts.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/customers/entities.js +36 -27
- package/resources/v1/events/beta/customers/entities.js.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/customers/entities.mjs +36 -27
- package/resources/v1/events/beta/customers/entities.mjs.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/customers/entitlements.d.mts +6 -4
- package/resources/v1/events/beta/customers/entitlements.d.mts.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/customers/entitlements.d.ts +6 -4
- package/resources/v1/events/beta/customers/entitlements.d.ts.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/customers/entitlements.js +5 -3
- package/resources/v1/events/beta/customers/entitlements.js.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/customers/entitlements.mjs +5 -3
- package/resources/v1/events/beta/customers/entitlements.mjs.map +1 -0
- package/resources/v1/events/beta/customers/index.d.mts.map +1 -0
- package/resources/v1/events/beta/customers/index.d.ts.map +1 -0
- package/resources/v1/events/beta/customers/index.js.map +1 -0
- package/resources/v1/events/beta/customers/index.mjs.map +1 -0
- package/resources/v1/events/beta/customers.d.mts.map +1 -0
- package/resources/v1/events/beta/customers.d.ts.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/customers.js +1 -1
- package/resources/v1/events/beta/customers.js.map +1 -0
- package/resources/v1/events/beta/customers.mjs.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/entity-types.d.mts +20 -19
- package/resources/v1/events/beta/entity-types.d.mts.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/entity-types.d.ts +20 -19
- package/resources/v1/events/beta/entity-types.d.ts.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/entity-types.js +18 -17
- package/resources/v1/events/beta/entity-types.js.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/entity-types.mjs +18 -17
- package/resources/v1/events/beta/entity-types.mjs.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/index.d.mts +1 -1
- package/resources/v1/events/beta/index.d.mts.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/index.d.ts +1 -1
- package/resources/v1/events/beta/index.d.ts.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/index.js +3 -3
- package/resources/v1/events/beta/index.js.map +1 -0
- package/resources/{v1-beta → v1/events/beta}/index.mjs +1 -1
- package/resources/v1/events/beta/index.mjs.map +1 -0
- package/resources/v1/events/beta.d.mts +2 -0
- package/resources/v1/events/beta.d.mts.map +1 -0
- package/resources/v1/events/beta.d.ts +2 -0
- package/resources/v1/events/beta.d.ts.map +1 -0
- package/resources/{v1-beta.js → v1/events/beta.js} +3 -3
- package/resources/v1/events/beta.js.map +1 -0
- package/resources/{v1-beta.mjs → v1/events/beta.mjs} +2 -2
- package/resources/v1/events/beta.mjs.map +1 -0
- package/resources/v1/events/events.d.mts +83 -0
- package/resources/v1/events/events.d.mts.map +1 -0
- package/resources/v1/events/events.d.ts +83 -0
- package/resources/v1/events/events.d.ts.map +1 -0
- package/resources/v1/events/events.js +40 -0
- package/resources/v1/events/events.js.map +1 -0
- package/resources/v1/events/events.mjs +35 -0
- package/resources/v1/events/events.mjs.map +1 -0
- package/resources/v1/events/index.d.mts +3 -0
- package/resources/v1/events/index.d.mts.map +1 -0
- package/resources/v1/events/index.d.ts +3 -0
- package/resources/v1/events/index.d.ts.map +1 -0
- package/resources/v1/events/index.js +9 -0
- package/resources/v1/events/index.js.map +1 -0
- package/resources/v1/events/index.mjs +4 -0
- package/resources/v1/events/index.mjs.map +1 -0
- package/resources/v1/events.d.mts +1 -65
- package/resources/v1/events.d.mts.map +1 -1
- package/resources/v1/events.d.ts +1 -65
- package/resources/v1/events.d.ts.map +1 -1
- package/resources/v1/events.js +2 -15
- package/resources/v1/events.js.map +1 -1
- package/resources/v1/events.mjs +1 -13
- package/resources/v1/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 -1
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +1 -1
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +6 -6
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +1 -1
- 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 +24 -0
- package/resources/v1/usage.d.mts.map +1 -1
- package/resources/v1/usage.d.ts +24 -0
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +24 -0
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +24 -0
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +2 -2
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +2 -2
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +2 -2
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +2 -2
- package/resources/v1/v1.mjs.map +1 -1
- package/src/client.ts +0 -5
- package/src/resources/index.ts +0 -1
- package/src/resources/v1/addons/addons.ts +59 -0
- package/src/resources/v1/addons/entitlements.ts +31 -0
- package/src/resources/v1/coupons.ts +36 -0
- package/src/resources/v1/credits/credits.ts +65 -0
- package/src/resources/v1/credits/custom-currencies.ts +49 -0
- package/src/resources/v1/credits/grants.ts +28 -0
- package/src/resources/v1/customers/customers.ts +77 -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-beta/v1-beta.ts → v1/events/beta/beta.ts} +5 -5
- package/src/resources/{v1-beta → v1/events/beta}/customers/assignments.ts +25 -22
- package/src/resources/{v1-beta → v1/events/beta}/customers/customers.ts +1 -1
- package/src/resources/{v1-beta → v1/events/beta}/customers/entities.ts +38 -29
- package/src/resources/{v1-beta → v1/events/beta}/customers/entitlements.ts +7 -5
- package/src/resources/{v1-beta → v1/events/beta}/entity-types.ts +20 -19
- package/src/resources/{v1-beta → v1/events/beta}/index.ts +1 -1
- package/src/resources/{v1-beta.ts → v1/events/beta.ts} +1 -1
- package/src/resources/v1/events/events.ts +98 -0
- package/src/resources/v1/events/index.ts +4 -0
- package/src/resources/v1/events.ts +1 -75
- package/src/resources/v1/features.ts +43 -0
- package/src/resources/v1/index.ts +1 -1
- 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 +24 -0
- package/src/resources/v1/v1.ts +2 -2
- 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
- package/resources/v1-beta/customers/assignments.d.mts.map +0 -1
- package/resources/v1-beta/customers/assignments.d.ts.map +0 -1
- package/resources/v1-beta/customers/assignments.js.map +0 -1
- package/resources/v1-beta/customers/assignments.mjs.map +0 -1
- package/resources/v1-beta/customers/customers.d.mts.map +0 -1
- package/resources/v1-beta/customers/customers.d.ts.map +0 -1
- package/resources/v1-beta/customers/customers.js.map +0 -1
- package/resources/v1-beta/customers/customers.mjs.map +0 -1
- package/resources/v1-beta/customers/entities.d.mts.map +0 -1
- package/resources/v1-beta/customers/entities.d.ts.map +0 -1
- package/resources/v1-beta/customers/entities.js.map +0 -1
- package/resources/v1-beta/customers/entities.mjs.map +0 -1
- package/resources/v1-beta/customers/entitlements.d.mts.map +0 -1
- package/resources/v1-beta/customers/entitlements.d.ts.map +0 -1
- package/resources/v1-beta/customers/entitlements.js.map +0 -1
- package/resources/v1-beta/customers/entitlements.mjs.map +0 -1
- package/resources/v1-beta/customers/index.d.mts.map +0 -1
- package/resources/v1-beta/customers/index.d.ts.map +0 -1
- package/resources/v1-beta/customers/index.js.map +0 -1
- package/resources/v1-beta/customers/index.mjs.map +0 -1
- package/resources/v1-beta/customers.d.mts.map +0 -1
- package/resources/v1-beta/customers.d.ts.map +0 -1
- package/resources/v1-beta/customers.js.map +0 -1
- package/resources/v1-beta/customers.mjs.map +0 -1
- package/resources/v1-beta/entity-types.d.mts.map +0 -1
- package/resources/v1-beta/entity-types.d.ts.map +0 -1
- package/resources/v1-beta/entity-types.js.map +0 -1
- package/resources/v1-beta/entity-types.mjs.map +0 -1
- package/resources/v1-beta/index.d.mts.map +0 -1
- package/resources/v1-beta/index.d.ts.map +0 -1
- package/resources/v1-beta/index.js.map +0 -1
- package/resources/v1-beta/index.mjs.map +0 -1
- package/resources/v1-beta/v1-beta.d.mts.map +0 -1
- package/resources/v1-beta/v1-beta.d.ts.map +0 -1
- package/resources/v1-beta/v1-beta.js.map +0 -1
- package/resources/v1-beta/v1-beta.mjs.map +0 -1
- package/resources/v1-beta.d.mts +0 -2
- package/resources/v1-beta.d.mts.map +0 -1
- package/resources/v1-beta.d.ts +0 -2
- package/resources/v1-beta.d.ts.map +0 -1
- package/resources/v1-beta.js.map +0 -1
- package/resources/v1-beta.mjs.map +0 -1
- /package/resources/{v1-beta → v1/events/beta}/customers/index.d.mts +0 -0
- /package/resources/{v1-beta → v1/events/beta}/customers/index.d.ts +0 -0
- /package/resources/{v1-beta → v1/events/beta}/customers/index.js +0 -0
- /package/resources/{v1-beta → v1/events/beta}/customers/index.mjs +0 -0
- /package/resources/{v1-beta → v1/events/beta}/customers.d.mts +0 -0
- /package/resources/{v1-beta → v1/events/beta}/customers.d.ts +0 -0
- /package/resources/{v1-beta → v1/events/beta}/customers.mjs +0 -0
- /package/src/resources/{v1-beta → v1/events/beta}/customers/index.ts +0 -0
- /package/src/resources/{v1-beta → v1/events/beta}/customers.ts +0 -0
|
@@ -24,6 +24,15 @@ export class Addons extends APIResource {
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Creates a new addon in draft status, associated with a specific product.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const addon = await client.v1.addons.create({
|
|
31
|
+
* id: 'id',
|
|
32
|
+
* displayName: 'displayName',
|
|
33
|
+
* productId: 'productId',
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
27
36
|
*/
|
|
28
37
|
create(body: AddonCreateParams, options?: RequestOptions): APIPromise<Addon> {
|
|
29
38
|
return this._client.post('/api/v1/addons', { body, ...options });
|
|
@@ -32,6 +41,11 @@ export class Addons extends APIResource {
|
|
|
32
41
|
/**
|
|
33
42
|
* Retrieves an addon by its unique identifier, including entitlements and pricing
|
|
34
43
|
* details.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const addon = await client.v1.addons.retrieve('x');
|
|
48
|
+
* ```
|
|
35
49
|
*/
|
|
36
50
|
retrieve(id: string, options?: RequestOptions): APIPromise<Addon> {
|
|
37
51
|
return this._client.get(path`/api/v1/addons/${id}`, options);
|
|
@@ -40,6 +54,11 @@ export class Addons extends APIResource {
|
|
|
40
54
|
/**
|
|
41
55
|
* Updates an existing addon's properties such as display name, description, and
|
|
42
56
|
* metadata.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const addon = await client.v1.addons.update('x');
|
|
61
|
+
* ```
|
|
43
62
|
*/
|
|
44
63
|
update(id: string, body: AddonUpdateParams, options?: RequestOptions): APIPromise<Addon> {
|
|
45
64
|
return this._client.patch(path`/api/v1/addons/${id}`, { body, ...options });
|
|
@@ -47,6 +66,14 @@ export class Addons extends APIResource {
|
|
|
47
66
|
|
|
48
67
|
/**
|
|
49
68
|
* Retrieves a paginated list of addons in the environment.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* // Automatically fetches more pages as needed.
|
|
73
|
+
* for await (const addonListResponse of client.v1.addons.list()) {
|
|
74
|
+
* // ...
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
50
77
|
*/
|
|
51
78
|
list(
|
|
52
79
|
query: AddonListParams | null | undefined = {},
|
|
@@ -60,6 +87,11 @@ export class Addons extends APIResource {
|
|
|
60
87
|
|
|
61
88
|
/**
|
|
62
89
|
* Archives an addon, preventing it from being used in new subscriptions.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const addon = await client.v1.addons.archive('x');
|
|
94
|
+
* ```
|
|
63
95
|
*/
|
|
64
96
|
archive(id: string, options?: RequestOptions): APIPromise<Addon> {
|
|
65
97
|
return this._client.post(path`/api/v1/addons/${id}/archive`, options);
|
|
@@ -67,6 +99,11 @@ export class Addons extends APIResource {
|
|
|
67
99
|
|
|
68
100
|
/**
|
|
69
101
|
* Creates a draft version of an existing addon for modification before publishing.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* const addon = await client.v1.addons.createDraft('x');
|
|
106
|
+
* ```
|
|
70
107
|
*/
|
|
71
108
|
createDraft(id: string, options?: RequestOptions): APIPromise<Addon> {
|
|
72
109
|
return this._client.post(path`/api/v1/addons/${id}/draft`, options);
|
|
@@ -74,6 +111,16 @@ export class Addons extends APIResource {
|
|
|
74
111
|
|
|
75
112
|
/**
|
|
76
113
|
* Retrieves the list of charges configured on an addon.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```ts
|
|
117
|
+
* // Automatically fetches more pages as needed.
|
|
118
|
+
* for await (const addonListChargesResponse of client.v1.addons.listCharges(
|
|
119
|
+
* 'x',
|
|
120
|
+
* )) {
|
|
121
|
+
* // ...
|
|
122
|
+
* }
|
|
123
|
+
* ```
|
|
77
124
|
*/
|
|
78
125
|
listCharges(
|
|
79
126
|
id: string,
|
|
@@ -89,6 +136,13 @@ export class Addons extends APIResource {
|
|
|
89
136
|
|
|
90
137
|
/**
|
|
91
138
|
* Publishes a draft addon, making it available for use in subscriptions.
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```ts
|
|
142
|
+
* const response = await client.v1.addons.publish('x', {
|
|
143
|
+
* migrationType: 'NEW_CUSTOMERS',
|
|
144
|
+
* });
|
|
145
|
+
* ```
|
|
92
146
|
*/
|
|
93
147
|
publish(id: string, body: AddonPublishParams, options?: RequestOptions): APIPromise<AddonPublishResponse> {
|
|
94
148
|
return this._client.post(path`/api/v1/addons/${id}/publish`, { body, ...options });
|
|
@@ -96,6 +150,11 @@ export class Addons extends APIResource {
|
|
|
96
150
|
|
|
97
151
|
/**
|
|
98
152
|
* Removes a draft version of an addon.
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```ts
|
|
156
|
+
* const response = await client.v1.addons.removeDraft('x');
|
|
157
|
+
* ```
|
|
99
158
|
*/
|
|
100
159
|
removeDraft(id: string, options?: RequestOptions): APIPromise<AddonRemoveDraftResponse> {
|
|
101
160
|
return this._client.delete(path`/api/v1/addons/${id}/draft`, options);
|
|
@@ -8,6 +8,14 @@ import { path } from '../../../internal/utils/path';
|
|
|
8
8
|
export class Entitlements extends APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* Creates one or more entitlements (feature or credit) on a draft addon.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const entitlement =
|
|
15
|
+
* await client.v1.addons.entitlements.create('addonId', {
|
|
16
|
+
* entitlements: [{ id: 'id', type: 'FEATURE' }],
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
11
19
|
*/
|
|
12
20
|
create(
|
|
13
21
|
addonID: string,
|
|
@@ -19,6 +27,15 @@ export class Entitlements extends APIResource {
|
|
|
19
27
|
|
|
20
28
|
/**
|
|
21
29
|
* Updates an existing entitlement on a draft addon.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const addonPackageEntitlement =
|
|
34
|
+
* await client.v1.addons.entitlements.update('id', {
|
|
35
|
+
* addonId: 'addonId',
|
|
36
|
+
* type: 'FEATURE',
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
22
39
|
*/
|
|
23
40
|
update(
|
|
24
41
|
id: string,
|
|
@@ -31,6 +48,12 @@ export class Entitlements extends APIResource {
|
|
|
31
48
|
|
|
32
49
|
/**
|
|
33
50
|
* Retrieves a list of entitlements for an addon.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const entitlements =
|
|
55
|
+
* await client.v1.addons.entitlements.list('addonId');
|
|
56
|
+
* ```
|
|
34
57
|
*/
|
|
35
58
|
list(addonID: string, options?: RequestOptions): APIPromise<EntitlementListResponse> {
|
|
36
59
|
return this._client.get(path`/api/v1/addons/${addonID}/entitlements`, options);
|
|
@@ -38,6 +61,14 @@ export class Entitlements extends APIResource {
|
|
|
38
61
|
|
|
39
62
|
/**
|
|
40
63
|
* Deletes an entitlement from a draft addon.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const addonPackageEntitlement =
|
|
68
|
+
* await client.v1.addons.entitlements.delete('id', {
|
|
69
|
+
* addonId: 'addonId',
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
41
72
|
*/
|
|
42
73
|
delete(
|
|
43
74
|
id: string,
|
|
@@ -13,6 +13,19 @@ export class Coupons extends APIResource {
|
|
|
13
13
|
/**
|
|
14
14
|
* Creates a new discount coupon with percentage or fixed amount off, applicable to
|
|
15
15
|
* customer subscriptions.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const coupon = await client.v1.coupons.create({
|
|
20
|
+
* id: 'id',
|
|
21
|
+
* amountsOff: [{ amount: 0, currency: 'usd' }],
|
|
22
|
+
* description: 'description',
|
|
23
|
+
* durationInMonths: 1,
|
|
24
|
+
* metadata: { foo: 'string' },
|
|
25
|
+
* name: 'name',
|
|
26
|
+
* percentOff: 1,
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
16
29
|
*/
|
|
17
30
|
create(body: CouponCreateParams, options?: RequestOptions): APIPromise<Coupon> {
|
|
18
31
|
return this._client.post('/api/v1/coupons', { body, ...options });
|
|
@@ -20,6 +33,11 @@ export class Coupons extends APIResource {
|
|
|
20
33
|
|
|
21
34
|
/**
|
|
22
35
|
* Retrieves a coupon by its unique identifier.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const coupon = await client.v1.coupons.retrieve('x');
|
|
40
|
+
* ```
|
|
23
41
|
*/
|
|
24
42
|
retrieve(id: string, options?: RequestOptions): APIPromise<Coupon> {
|
|
25
43
|
return this._client.get(path`/api/v1/coupons/${id}`, options);
|
|
@@ -27,6 +45,14 @@ export class Coupons extends APIResource {
|
|
|
27
45
|
|
|
28
46
|
/**
|
|
29
47
|
* Retrieves a paginated list of coupons in the environment.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* // Automatically fetches more pages as needed.
|
|
52
|
+
* for await (const couponListResponse of client.v1.coupons.list()) {
|
|
53
|
+
* // ...
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
30
56
|
*/
|
|
31
57
|
list(
|
|
32
58
|
query: CouponListParams | null | undefined = {},
|
|
@@ -40,6 +66,11 @@ export class Coupons extends APIResource {
|
|
|
40
66
|
|
|
41
67
|
/**
|
|
42
68
|
* Archives a coupon, preventing it from being applied to new subscriptions.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const coupon = await client.v1.coupons.archiveCoupon('x');
|
|
73
|
+
* ```
|
|
43
74
|
*/
|
|
44
75
|
archiveCoupon(id: string, options?: RequestOptions): APIPromise<Coupon> {
|
|
45
76
|
return this._client.post(path`/api/v1/coupons/${id}/archive`, options);
|
|
@@ -47,6 +78,11 @@ export class Coupons extends APIResource {
|
|
|
47
78
|
|
|
48
79
|
/**
|
|
49
80
|
* Updates an existing coupon's properties such as name, description, and metadata.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* const coupon = await client.v1.coupons.updateCoupon('x');
|
|
85
|
+
* ```
|
|
50
86
|
*/
|
|
51
87
|
updateCoupon(id: string, body: CouponUpdateCouponParams, options?: RequestOptions): APIPromise<Coupon> {
|
|
52
88
|
return this._client.patch(path`/api/v1/coupons/${id}`, { body, ...options });
|
|
@@ -34,6 +34,14 @@ export class Credits extends APIResource {
|
|
|
34
34
|
/**
|
|
35
35
|
* Retrieves the automatic recharge configuration for a customer and currency.
|
|
36
36
|
* Returns default settings if no configuration exists.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const response = await client.v1.credits.getAutoRecharge({
|
|
41
|
+
* currencyId: 'currencyId',
|
|
42
|
+
* customerId: 'customerId',
|
|
43
|
+
* });
|
|
44
|
+
* ```
|
|
37
45
|
*/
|
|
38
46
|
getAutoRecharge(
|
|
39
47
|
query: CreditGetAutoRechargeParams,
|
|
@@ -45,6 +53,13 @@ export class Credits extends APIResource {
|
|
|
45
53
|
/**
|
|
46
54
|
* Retrieves credit usage time-series data for a customer, grouped by feature, over
|
|
47
55
|
* a specified time range.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const response = await client.v1.credits.getUsage({
|
|
60
|
+
* customerId: 'customerId',
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
48
63
|
*/
|
|
49
64
|
getUsage(query: CreditGetUsageParams, options?: RequestOptions): APIPromise<CreditGetUsageResponse> {
|
|
50
65
|
return this._client.get('/api/v1/credits/usage', { query, ...options });
|
|
@@ -52,6 +67,16 @@ export class Credits extends APIResource {
|
|
|
52
67
|
|
|
53
68
|
/**
|
|
54
69
|
* Retrieves a paginated list of credit ledger events for a customer.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* // Automatically fetches more pages as needed.
|
|
74
|
+
* for await (const creditListLedgerResponse of client.v1.credits.listLedger(
|
|
75
|
+
* { customerId: 'customerId' },
|
|
76
|
+
* )) {
|
|
77
|
+
* // ...
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
55
80
|
*/
|
|
56
81
|
listLedger(
|
|
57
82
|
query: CreditListLedgerParams,
|
|
@@ -158,6 +183,13 @@ export namespace CreditGetUsageResponse {
|
|
|
158
183
|
*/
|
|
159
184
|
currency: Data.Currency | null;
|
|
160
185
|
|
|
186
|
+
/**
|
|
187
|
+
* Cursor-based pagination for the returned series. `next`/`prev` are opaque
|
|
188
|
+
* cursors; pass them back as `after`/`before` to traverse pages. The series axis
|
|
189
|
+
* is `groupBy` when provided, otherwise `featureId`
|
|
190
|
+
*/
|
|
191
|
+
pagination: Data.Pagination;
|
|
192
|
+
|
|
161
193
|
/**
|
|
162
194
|
* Credit usage series grouped by feature
|
|
163
195
|
*/
|
|
@@ -195,6 +227,24 @@ export namespace CreditGetUsageResponse {
|
|
|
195
227
|
symbol: string | null;
|
|
196
228
|
}
|
|
197
229
|
|
|
230
|
+
/**
|
|
231
|
+
* Cursor-based pagination for the returned series. `next`/`prev` are opaque
|
|
232
|
+
* cursors; pass them back as `after`/`before` to traverse pages. The series axis
|
|
233
|
+
* is `groupBy` when provided, otherwise `featureId`
|
|
234
|
+
*/
|
|
235
|
+
export interface Pagination {
|
|
236
|
+
/**
|
|
237
|
+
* Cursor for fetching the next page of results, or null if no additional pages
|
|
238
|
+
* exist
|
|
239
|
+
*/
|
|
240
|
+
next: string | null;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Cursor for fetching the previous page of results, or null if at the beginning
|
|
244
|
+
*/
|
|
245
|
+
prev: string | null;
|
|
246
|
+
}
|
|
247
|
+
|
|
198
248
|
/**
|
|
199
249
|
* Credit usage data for a single feature
|
|
200
250
|
*/
|
|
@@ -334,6 +384,16 @@ export interface CreditGetUsageParams {
|
|
|
334
384
|
*/
|
|
335
385
|
customerId: string;
|
|
336
386
|
|
|
387
|
+
/**
|
|
388
|
+
* Return items that come after this cursor
|
|
389
|
+
*/
|
|
390
|
+
after?: string;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Return items that come before this cursor
|
|
394
|
+
*/
|
|
395
|
+
before?: string;
|
|
396
|
+
|
|
337
397
|
/**
|
|
338
398
|
* Filter by currency ID
|
|
339
399
|
*/
|
|
@@ -351,6 +411,11 @@ export interface CreditGetUsageParams {
|
|
|
351
411
|
*/
|
|
352
412
|
groupBy?: string;
|
|
353
413
|
|
|
414
|
+
/**
|
|
415
|
+
* Maximum number of items to return
|
|
416
|
+
*/
|
|
417
|
+
limit?: number;
|
|
418
|
+
|
|
354
419
|
/**
|
|
355
420
|
* Filter by resource ID
|
|
356
421
|
*/
|
|
@@ -12,6 +12,15 @@ import { path } from '../../../internal/utils/path';
|
|
|
12
12
|
export class CustomCurrencies extends APIResource {
|
|
13
13
|
/**
|
|
14
14
|
* Creates a new custom currency in the environment.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const customCurrencyResponse =
|
|
19
|
+
* await client.v1.credits.customCurrencies.create({
|
|
20
|
+
* id: 'id',
|
|
21
|
+
* displayName: 'displayName',
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
15
24
|
*/
|
|
16
25
|
create(body: CustomCurrencyCreateParams, options?: RequestOptions): APIPromise<CustomCurrencyResponse> {
|
|
17
26
|
return this._client.post('/api/v1/credits/custom-currencies', { body, ...options });
|
|
@@ -19,6 +28,14 @@ export class CustomCurrencies extends APIResource {
|
|
|
19
28
|
|
|
20
29
|
/**
|
|
21
30
|
* Updates an existing custom currency. Only the supplied fields are modified.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const customCurrencyResponse =
|
|
35
|
+
* await client.v1.credits.customCurrencies.update(
|
|
36
|
+
* 'currencyId',
|
|
37
|
+
* );
|
|
38
|
+
* ```
|
|
22
39
|
*/
|
|
23
40
|
update(
|
|
24
41
|
currencyID: string,
|
|
@@ -32,6 +49,14 @@ export class CustomCurrencies extends APIResource {
|
|
|
32
49
|
* Retrieves a paginated list of custom currencies in the environment. Archived
|
|
33
50
|
* currencies are excluded by default; pass `status=ARCHIVED` (or
|
|
34
51
|
* `status=ACTIVE,ARCHIVED`) to include them.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* // Automatically fetches more pages as needed.
|
|
56
|
+
* for await (const customCurrencyListResponse of client.v1.credits.customCurrencies.list()) {
|
|
57
|
+
* // ...
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
35
60
|
*/
|
|
36
61
|
list(
|
|
37
62
|
query: CustomCurrencyListParams | null | undefined = {},
|
|
@@ -48,6 +73,14 @@ export class CustomCurrencies extends APIResource {
|
|
|
48
73
|
* Archives a custom currency. Fails if the currency is still associated with any
|
|
49
74
|
* active plan or addon — use the associated-entities endpoint first to inspect
|
|
50
75
|
* dependencies.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const customCurrencyResponse =
|
|
80
|
+
* await client.v1.credits.customCurrencies.archive(
|
|
81
|
+
* 'currencyId',
|
|
82
|
+
* );
|
|
83
|
+
* ```
|
|
51
84
|
*/
|
|
52
85
|
archive(currencyID: string, options?: RequestOptions): APIPromise<CustomCurrencyResponse> {
|
|
53
86
|
return this._client.post(path`/api/v1/credits/custom-currencies/${currencyID}/archive`, options);
|
|
@@ -56,6 +89,14 @@ export class CustomCurrencies extends APIResource {
|
|
|
56
89
|
/**
|
|
57
90
|
* Lists the active plans and addons that reference a custom currency. Useful
|
|
58
91
|
* before archiving to inspect dependencies.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* const response =
|
|
96
|
+
* await client.v1.credits.customCurrencies.listAssociatedEntities(
|
|
97
|
+
* 'currencyId',
|
|
98
|
+
* );
|
|
99
|
+
* ```
|
|
59
100
|
*/
|
|
60
101
|
listAssociatedEntities(
|
|
61
102
|
currencyID: string,
|
|
@@ -70,6 +111,14 @@ export class CustomCurrencies extends APIResource {
|
|
|
70
111
|
/**
|
|
71
112
|
* Restores a previously archived custom currency. Fails if another active currency
|
|
72
113
|
* with the same ID already exists.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```ts
|
|
117
|
+
* const customCurrencyResponse =
|
|
118
|
+
* await client.v1.credits.customCurrencies.unarchive(
|
|
119
|
+
* 'currencyId',
|
|
120
|
+
* );
|
|
121
|
+
* ```
|
|
73
122
|
*/
|
|
74
123
|
unarchive(currencyID: string, options?: RequestOptions): APIPromise<CustomCurrencyResponse> {
|
|
75
124
|
return this._client.post(path`/api/v1/credits/custom-currencies/${currencyID}/unarchive`, options);
|
|
@@ -13,6 +13,18 @@ export class Grants extends APIResource {
|
|
|
13
13
|
/**
|
|
14
14
|
* Creates a new credit grant for a customer with specified amount, type, and
|
|
15
15
|
* optional billing configuration.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const creditGrantResponse =
|
|
20
|
+
* await client.v1.credits.grants.create({
|
|
21
|
+
* amount: 0,
|
|
22
|
+
* currencyId: 'currencyId',
|
|
23
|
+
* customerId: 'customerId',
|
|
24
|
+
* displayName: 'displayName',
|
|
25
|
+
* grantType: 'PAID',
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
16
28
|
*/
|
|
17
29
|
create(body: GrantCreateParams, options?: RequestOptions): APIPromise<CreditGrantResponse> {
|
|
18
30
|
return this._client.post('/api/v1/credits/grants', { body, ...options });
|
|
@@ -20,6 +32,16 @@ export class Grants extends APIResource {
|
|
|
20
32
|
|
|
21
33
|
/**
|
|
22
34
|
* Retrieves a paginated list of credit grants for a customer.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* // Automatically fetches more pages as needed.
|
|
39
|
+
* for await (const grantListResponse of client.v1.credits.grants.list(
|
|
40
|
+
* { customerId: 'customerId' },
|
|
41
|
+
* )) {
|
|
42
|
+
* // ...
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
23
45
|
*/
|
|
24
46
|
list(
|
|
25
47
|
query: GrantListParams,
|
|
@@ -34,6 +56,12 @@ export class Grants extends APIResource {
|
|
|
34
56
|
/**
|
|
35
57
|
* Voids an existing credit grant, preventing further consumption of the remaining
|
|
36
58
|
* credits.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const creditGrantResponse =
|
|
63
|
+
* await client.v1.credits.grants.void('x');
|
|
64
|
+
* ```
|
|
37
65
|
*/
|
|
38
66
|
void(id: string, options?: RequestOptions): APIPromise<CreditGrantResponse> {
|
|
39
67
|
return this._client.post(path`/api/v1/credits/grants/${id}/void`, options);
|
|
@@ -39,6 +39,13 @@ export class Customers extends APIResource {
|
|
|
39
39
|
/**
|
|
40
40
|
* Retrieves a customer by their unique identifier, including billing information
|
|
41
41
|
* and subscription status.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const customerResponse = await client.v1.customers.retrieve(
|
|
46
|
+
* 'x',
|
|
47
|
+
* );
|
|
48
|
+
* ```
|
|
42
49
|
*/
|
|
43
50
|
retrieve(id: string, options?: RequestOptions): APIPromise<CustomerResponse> {
|
|
44
51
|
return this._client.get(path`/api/v1/customers/${id}`, options);
|
|
@@ -47,6 +54,13 @@ export class Customers extends APIResource {
|
|
|
47
54
|
/**
|
|
48
55
|
* Updates an existing customer's properties such as name, email, and billing
|
|
49
56
|
* information.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const customerResponse = await client.v1.customers.update(
|
|
61
|
+
* 'x',
|
|
62
|
+
* );
|
|
63
|
+
* ```
|
|
50
64
|
*/
|
|
51
65
|
update(id: string, body: CustomerUpdateParams, options?: RequestOptions): APIPromise<CustomerResponse> {
|
|
52
66
|
return this._client.patch(path`/api/v1/customers/${id}`, { body, ...options });
|
|
@@ -54,6 +68,14 @@ export class Customers extends APIResource {
|
|
|
54
68
|
|
|
55
69
|
/**
|
|
56
70
|
* Retrieves a paginated list of customers in the environment.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* // Automatically fetches more pages as needed.
|
|
75
|
+
* for await (const customerListResponse of client.v1.customers.list()) {
|
|
76
|
+
* // ...
|
|
77
|
+
* }
|
|
78
|
+
* ```
|
|
57
79
|
*/
|
|
58
80
|
list(
|
|
59
81
|
query: CustomerListParams | null | undefined = {},
|
|
@@ -68,6 +90,13 @@ export class Customers extends APIResource {
|
|
|
68
90
|
/**
|
|
69
91
|
* Archives a customer, preventing new subscriptions. Optionally cancels existing
|
|
70
92
|
* subscriptions.
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```ts
|
|
96
|
+
* const customerResponse = await client.v1.customers.archive(
|
|
97
|
+
* 'x',
|
|
98
|
+
* );
|
|
99
|
+
* ```
|
|
71
100
|
*/
|
|
72
101
|
archive(id: string, options?: RequestOptions): APIPromise<CustomerResponse> {
|
|
73
102
|
return this._client.post(path`/api/v1/customers/${id}/archive`, options);
|
|
@@ -82,6 +111,13 @@ export class Customers extends APIResource {
|
|
|
82
111
|
* mechanisms, and low-latency guarantees. It is not recommended for hot-path
|
|
83
112
|
* entitlement checks. For production use, consider using the Stigg Node Server SDK
|
|
84
113
|
* with caching or the Sidecar for low-latency cached responses.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```ts
|
|
117
|
+
* const response = await client.v1.customers.checkEntitlement(
|
|
118
|
+
* 'x',
|
|
119
|
+
* );
|
|
120
|
+
* ```
|
|
85
121
|
*/
|
|
86
122
|
checkEntitlement(
|
|
87
123
|
id: string,
|
|
@@ -94,6 +130,19 @@ export class Customers extends APIResource {
|
|
|
94
130
|
/**
|
|
95
131
|
* Imports multiple customers in bulk. Used for migrating customer data from
|
|
96
132
|
* external systems.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```ts
|
|
136
|
+
* const response = await client.v1.customers.import({
|
|
137
|
+
* customers: [
|
|
138
|
+
* {
|
|
139
|
+
* id: 'id',
|
|
140
|
+
* email: 'dev@stainless.com',
|
|
141
|
+
* name: 'name',
|
|
142
|
+
* },
|
|
143
|
+
* ],
|
|
144
|
+
* });
|
|
145
|
+
* ```
|
|
97
146
|
*/
|
|
98
147
|
import(body: CustomerImportParams, options?: RequestOptions): APIPromise<CustomerImportResponse> {
|
|
99
148
|
return this._client.post('/api/v1/customers/import', { body, ...options });
|
|
@@ -101,6 +150,16 @@ export class Customers extends APIResource {
|
|
|
101
150
|
|
|
102
151
|
/**
|
|
103
152
|
* Retrieves a paginated list of resources within the same customer.
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```ts
|
|
156
|
+
* // Automatically fetches more pages as needed.
|
|
157
|
+
* for await (const customerListResourcesResponse of client.v1.customers.listResources(
|
|
158
|
+
* 'x',
|
|
159
|
+
* )) {
|
|
160
|
+
* // ...
|
|
161
|
+
* }
|
|
162
|
+
* ```
|
|
104
163
|
*/
|
|
105
164
|
listResources(
|
|
106
165
|
id: string,
|
|
@@ -117,6 +176,12 @@ export class Customers extends APIResource {
|
|
|
117
176
|
/**
|
|
118
177
|
* Creates a new customer and optionally provisions an initial subscription in a
|
|
119
178
|
* single operation.
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* ```ts
|
|
182
|
+
* const customerResponse =
|
|
183
|
+
* await client.v1.customers.provision({ id: 'id' });
|
|
184
|
+
* ```
|
|
120
185
|
*/
|
|
121
186
|
provision(body: CustomerProvisionParams, options?: RequestOptions): APIPromise<CustomerResponse> {
|
|
122
187
|
return this._client.post('/api/v1/customers', { body, ...options });
|
|
@@ -130,6 +195,12 @@ export class Customers extends APIResource {
|
|
|
130
195
|
* mechanisms, and low-latency guarantees. It is not recommended for hot-path
|
|
131
196
|
* entitlement checks. For production use, consider using the Stigg Node Server SDK
|
|
132
197
|
* with caching or the Sidecar for low-latency cached responses.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```ts
|
|
201
|
+
* const response =
|
|
202
|
+
* await client.v1.customers.retrieveEntitlements('x');
|
|
203
|
+
* ```
|
|
133
204
|
*/
|
|
134
205
|
retrieveEntitlements(
|
|
135
206
|
id: string,
|
|
@@ -141,6 +212,12 @@ export class Customers extends APIResource {
|
|
|
141
212
|
|
|
142
213
|
/**
|
|
143
214
|
* Restores an archived customer, allowing them to create new subscriptions again.
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```ts
|
|
218
|
+
* const customerResponse =
|
|
219
|
+
* await client.v1.customers.unarchive('x');
|
|
220
|
+
* ```
|
|
144
221
|
*/
|
|
145
222
|
unarchive(id: string, options?: RequestOptions): APIPromise<CustomerResponse> {
|
|
146
223
|
return this._client.post(path`/api/v1/customers/${id}/unarchive`, options);
|