@stigg/typescript 0.1.0-beta.20 → 0.1.0-beta.22
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/client.d.mts +3 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -0
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/v1/addons/addons.d.mts +145 -94
- package/resources/v1/addons/addons.d.mts.map +1 -1
- package/resources/v1/addons/addons.d.ts +145 -94
- package/resources/v1/addons/addons.d.ts.map +1 -1
- package/resources/v1/addons/addons.js +110 -76
- package/resources/v1/addons/addons.js.map +1 -1
- package/resources/v1/addons/addons.mjs +110 -76
- package/resources/v1/addons/addons.mjs.map +1 -1
- package/resources/v1/addons/entitlements.d.mts +62 -36
- package/resources/v1/addons/entitlements.d.mts.map +1 -1
- package/resources/v1/addons/entitlements.d.ts +62 -36
- package/resources/v1/addons/entitlements.d.ts.map +1 -1
- package/resources/v1/addons/entitlements.js +49 -39
- package/resources/v1/addons/entitlements.js.map +1 -1
- package/resources/v1/addons/entitlements.mjs +49 -39
- package/resources/v1/addons/entitlements.mjs.map +1 -1
- package/resources/v1/addons/index.d.mts +2 -2
- package/resources/v1/addons/index.d.mts.map +1 -1
- package/resources/v1/addons/index.d.ts +2 -2
- package/resources/v1/addons/index.d.ts.map +1 -1
- package/resources/v1/addons/index.js.map +1 -1
- package/resources/v1/addons/index.mjs.map +1 -1
- package/resources/v1/coupons.d.mts +81 -57
- package/resources/v1/coupons.d.mts.map +1 -1
- package/resources/v1/coupons.d.ts +81 -57
- package/resources/v1/coupons.d.ts.map +1 -1
- package/resources/v1/coupons.js +60 -45
- package/resources/v1/coupons.js.map +1 -1
- package/resources/v1/coupons.mjs +60 -45
- package/resources/v1/coupons.mjs.map +1 -1
- package/resources/v1/credits/credits.d.mts +60 -52
- package/resources/v1/credits/credits.d.mts.map +1 -1
- package/resources/v1/credits/credits.d.ts +60 -52
- package/resources/v1/credits/credits.d.ts.map +1 -1
- package/resources/v1/credits/credits.js +36 -30
- package/resources/v1/credits/credits.js.map +1 -1
- package/resources/v1/credits/credits.mjs +36 -30
- package/resources/v1/credits/credits.mjs.map +1 -1
- package/resources/v1/credits/custom-currencies.d.mts +98 -74
- package/resources/v1/credits/custom-currencies.d.mts.map +1 -1
- package/resources/v1/credits/custom-currencies.d.ts +98 -74
- package/resources/v1/credits/custom-currencies.d.ts.map +1 -1
- package/resources/v1/credits/custom-currencies.js +76 -61
- package/resources/v1/credits/custom-currencies.js.map +1 -1
- package/resources/v1/credits/custom-currencies.mjs +76 -61
- package/resources/v1/credits/custom-currencies.mjs.map +1 -1
- package/resources/v1/credits/grants.d.mts +63 -54
- package/resources/v1/credits/grants.d.mts.map +1 -1
- package/resources/v1/credits/grants.d.ts +63 -54
- package/resources/v1/credits/grants.d.ts.map +1 -1
- package/resources/v1/credits/grants.js +35 -33
- package/resources/v1/credits/grants.js.map +1 -1
- package/resources/v1/credits/grants.mjs +35 -33
- package/resources/v1/credits/grants.mjs.map +1 -1
- package/resources/v1/credits/index.d.mts +2 -2
- package/resources/v1/credits/index.d.mts.map +1 -1
- package/resources/v1/credits/index.d.ts +2 -2
- package/resources/v1/credits/index.d.ts.map +1 -1
- package/resources/v1/credits/index.js.map +1 -1
- package/resources/v1/credits/index.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +167 -127
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +167 -127
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +124 -96
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +124 -96
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.mts +2 -2
- package/resources/v1/customers/index.d.mts.map +1 -1
- package/resources/v1/customers/index.d.ts +2 -2
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs +1 -1
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/integrations.d.mts +66 -58
- package/resources/v1/customers/integrations.d.mts.map +1 -1
- package/resources/v1/customers/integrations.d.ts +66 -58
- package/resources/v1/customers/integrations.d.ts.map +1 -1
- package/resources/v1/customers/integrations.js +57 -56
- package/resources/v1/customers/integrations.js.map +1 -1
- package/resources/v1/customers/integrations.mjs +57 -56
- package/resources/v1/customers/integrations.mjs.map +1 -1
- package/resources/v1/customers/payment-method.d.mts +33 -25
- package/resources/v1/customers/payment-method.d.mts.map +1 -1
- package/resources/v1/customers/payment-method.d.ts +33 -25
- package/resources/v1/customers/payment-method.d.ts.map +1 -1
- package/resources/v1/customers/payment-method.js +26 -20
- package/resources/v1/customers/payment-method.js.map +1 -1
- package/resources/v1/customers/payment-method.mjs +26 -20
- package/resources/v1/customers/payment-method.mjs.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.mts +42 -60
- package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.ts +42 -60
- package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -1
- package/resources/v1/customers/promotional-entitlements.js +38 -57
- package/resources/v1/customers/promotional-entitlements.js.map +1 -1
- package/resources/v1/customers/promotional-entitlements.mjs +38 -57
- package/resources/v1/customers/promotional-entitlements.mjs.map +1 -1
- package/resources/v1/events/data-export/data-export.d.mts +29 -21
- package/resources/v1/events/data-export/data-export.d.mts.map +1 -1
- package/resources/v1/events/data-export/data-export.d.ts +29 -21
- package/resources/v1/events/data-export/data-export.d.ts.map +1 -1
- package/resources/v1/events/data-export/data-export.js +27 -18
- package/resources/v1/events/data-export/data-export.js.map +1 -1
- package/resources/v1/events/data-export/data-export.mjs +27 -18
- package/resources/v1/events/data-export/data-export.mjs.map +1 -1
- package/resources/v1/events/data-export/destinations.d.mts +29 -22
- package/resources/v1/events/data-export/destinations.d.mts.map +1 -1
- package/resources/v1/events/data-export/destinations.d.ts +29 -22
- package/resources/v1/events/data-export/destinations.d.ts.map +1 -1
- package/resources/v1/events/data-export/destinations.js +26 -21
- package/resources/v1/events/data-export/destinations.js.map +1 -1
- package/resources/v1/events/data-export/destinations.mjs +26 -21
- package/resources/v1/events/data-export/destinations.mjs.map +1 -1
- package/resources/v1/events/data-export/index.d.mts +1 -1
- package/resources/v1/events/data-export/index.d.mts.map +1 -1
- package/resources/v1/events/data-export/index.d.ts +1 -1
- package/resources/v1/events/data-export/index.d.ts.map +1 -1
- package/resources/v1/events/data-export/index.js.map +1 -1
- package/resources/v1/events/data-export/index.mjs.map +1 -1
- package/resources/v1/events/events.d.mts +13 -19
- package/resources/v1/events/events.d.mts.map +1 -1
- package/resources/v1/events/events.d.ts +13 -19
- package/resources/v1/events/events.d.ts.map +1 -1
- package/resources/v1/events/events.js +14 -19
- package/resources/v1/events/events.js.map +1 -1
- package/resources/v1/events/events.mjs +14 -19
- package/resources/v1/events/events.mjs.map +1 -1
- package/resources/v1/events/index.d.mts +0 -1
- package/resources/v1/events/index.d.mts.map +1 -1
- package/resources/v1/events/index.d.ts +0 -1
- package/resources/v1/events/index.d.ts.map +1 -1
- package/resources/v1/events/index.js +3 -5
- package/resources/v1/events/index.js.map +1 -1
- package/resources/v1/events/index.mjs +0 -1
- package/resources/v1/events/index.mjs.map +1 -1
- package/resources/v1/features.d.mts +109 -74
- package/resources/v1/features.d.mts.map +1 -1
- package/resources/v1/features.d.ts +109 -74
- package/resources/v1/features.d.ts.map +1 -1
- package/resources/v1/features.js +72 -54
- package/resources/v1/features.js.map +1 -1
- package/resources/v1/features.mjs +72 -54
- package/resources/v1/features.mjs.map +1 -1
- package/resources/v1/index.d.mts +7 -7
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +7 -7
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/plans/entitlements.d.mts +62 -36
- package/resources/v1/plans/entitlements.d.mts.map +1 -1
- package/resources/v1/plans/entitlements.d.ts +62 -36
- package/resources/v1/plans/entitlements.d.ts.map +1 -1
- package/resources/v1/plans/entitlements.js +49 -39
- package/resources/v1/plans/entitlements.js.map +1 -1
- package/resources/v1/plans/entitlements.mjs +49 -39
- package/resources/v1/plans/entitlements.mjs.map +1 -1
- package/resources/v1/plans/index.d.mts +2 -2
- package/resources/v1/plans/index.d.mts.map +1 -1
- package/resources/v1/plans/index.d.ts +2 -2
- package/resources/v1/plans/index.d.ts.map +1 -1
- package/resources/v1/plans/index.js.map +1 -1
- package/resources/v1/plans/index.mjs.map +1 -1
- package/resources/v1/plans/plans.d.mts +159 -106
- package/resources/v1/plans/plans.d.mts.map +1 -1
- package/resources/v1/plans/plans.d.ts +159 -106
- package/resources/v1/plans/plans.d.ts.map +1 -1
- package/resources/v1/plans/plans.js +127 -89
- package/resources/v1/plans/plans.js.map +1 -1
- package/resources/v1/plans/plans.mjs +127 -89
- package/resources/v1/plans/plans.mjs.map +1 -1
- package/resources/v1/products.d.mts +97 -66
- package/resources/v1/products.d.mts.map +1 -1
- package/resources/v1/products.d.ts +97 -66
- package/resources/v1/products.d.ts.map +1 -1
- package/resources/v1/products.js +73 -54
- package/resources/v1/products.js.map +1 -1
- package/resources/v1/products.mjs +73 -54
- package/resources/v1/products.mjs.map +1 -1
- package/resources/v1/subscriptions/future-update.d.mts +29 -19
- package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
- package/resources/v1/subscriptions/future-update.d.ts +29 -19
- package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
- package/resources/v1/subscriptions/future-update.js +25 -20
- package/resources/v1/subscriptions/future-update.js.map +1 -1
- package/resources/v1/subscriptions/future-update.mjs +25 -20
- package/resources/v1/subscriptions/future-update.mjs.map +1 -1
- package/resources/v1/subscriptions/index.d.mts +4 -4
- package/resources/v1/subscriptions/index.d.mts.map +1 -1
- package/resources/v1/subscriptions/index.d.ts +4 -4
- package/resources/v1/subscriptions/index.d.ts.map +1 -1
- package/resources/v1/subscriptions/index.js.map +1 -1
- package/resources/v1/subscriptions/index.mjs +1 -1
- package/resources/v1/subscriptions/index.mjs.map +1 -1
- package/resources/v1/subscriptions/invoice.d.mts +15 -8
- package/resources/v1/subscriptions/invoice.d.mts.map +1 -1
- package/resources/v1/subscriptions/invoice.d.ts +15 -8
- package/resources/v1/subscriptions/invoice.d.ts.map +1 -1
- package/resources/v1/subscriptions/invoice.js +13 -8
- package/resources/v1/subscriptions/invoice.js.map +1 -1
- package/resources/v1/subscriptions/invoice.mjs +13 -8
- package/resources/v1/subscriptions/invoice.mjs.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.mts +244 -161
- package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.ts +244 -161
- package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.js +126 -100
- package/resources/v1/subscriptions/subscriptions.js.map +1 -1
- package/resources/v1/subscriptions/subscriptions.mjs +128 -102
- package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
- package/resources/v1/subscriptions/usage.d.mts +29 -17
- package/resources/v1/subscriptions/usage.d.mts.map +1 -1
- package/resources/v1/subscriptions/usage.d.ts +29 -17
- package/resources/v1/subscriptions/usage.d.ts.map +1 -1
- package/resources/v1/subscriptions/usage.js +26 -17
- package/resources/v1/subscriptions/usage.js.map +1 -1
- package/resources/v1/subscriptions/usage.mjs +26 -17
- package/resources/v1/subscriptions/usage.mjs.map +1 -1
- package/resources/v1/usage.d.mts +24 -26
- package/resources/v1/usage.d.mts.map +1 -1
- package/resources/v1/usage.d.ts +24 -26
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +26 -28
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +26 -28
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +14 -14
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +14 -14
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v1-beta/customers/assignments.d.mts +242 -0
- package/resources/v1-beta/customers/assignments.d.mts.map +1 -0
- package/resources/v1-beta/customers/assignments.d.ts +242 -0
- package/resources/v1-beta/customers/assignments.d.ts.map +1 -0
- package/resources/v1-beta/customers/assignments.js +84 -0
- package/resources/v1-beta/customers/assignments.js.map +1 -0
- package/resources/v1-beta/customers/assignments.mjs +80 -0
- package/resources/v1-beta/customers/assignments.mjs.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers/customers.d.mts +1 -1
- package/resources/v1-beta/customers/customers.d.mts.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers/customers.d.ts +1 -1
- package/resources/v1-beta/customers/customers.d.ts.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers/customers.js +2 -2
- package/resources/v1-beta/customers/customers.js.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers/customers.mjs +1 -1
- package/resources/v1-beta/customers/customers.mjs.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers/entities.d.mts +94 -47
- package/resources/v1-beta/customers/entities.d.mts.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers/entities.d.ts +94 -47
- package/resources/v1-beta/customers/entities.d.ts.map +1 -0
- package/resources/v1-beta/customers/entities.js +150 -0
- package/resources/v1-beta/customers/entities.js.map +1 -0
- package/resources/v1-beta/customers/entities.mjs +146 -0
- package/resources/v1-beta/customers/entities.mjs.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers/entitlements.d.mts +27 -16
- package/resources/v1-beta/customers/entitlements.d.mts.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers/entitlements.d.ts +27 -16
- package/resources/v1-beta/customers/entitlements.d.ts.map +1 -0
- package/resources/v1-beta/customers/entitlements.js +36 -0
- package/resources/v1-beta/customers/entitlements.js.map +1 -0
- package/resources/v1-beta/customers/entitlements.mjs +32 -0
- package/resources/v1-beta/customers/entitlements.mjs.map +1 -0
- package/resources/v1-beta/customers/index.d.mts.map +1 -0
- package/resources/v1-beta/customers/index.d.ts.map +1 -0
- package/resources/v1-beta/customers/index.js.map +1 -0
- package/resources/v1-beta/customers/index.mjs.map +1 -0
- package/resources/v1-beta/customers.d.mts.map +1 -0
- package/resources/v1-beta/customers.d.ts.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers.js +1 -1
- package/resources/v1-beta/customers.js.map +1 -0
- package/resources/v1-beta/customers.mjs.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/entity-types.d.mts +44 -23
- package/resources/v1-beta/entity-types.d.mts.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/entity-types.d.ts +44 -23
- package/resources/v1-beta/entity-types.d.ts.map +1 -0
- package/resources/v1-beta/entity-types.js +75 -0
- package/resources/v1-beta/entity-types.js.map +1 -0
- package/resources/v1-beta/entity-types.mjs +71 -0
- package/resources/v1-beta/entity-types.mjs.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/index.d.mts +1 -1
- package/resources/v1-beta/index.d.mts.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/index.d.ts +1 -1
- package/resources/v1-beta/index.d.ts.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/index.js +3 -3
- package/resources/v1-beta/index.js.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/index.mjs +1 -1
- package/resources/v1-beta/index.mjs.map +1 -0
- package/resources/{v1/events/beta/beta.d.mts → v1-beta/v1-beta.d.mts} +4 -4
- package/resources/v1-beta/v1-beta.d.mts.map +1 -0
- package/resources/{v1/events/beta/beta.d.ts → v1-beta/v1-beta.d.ts} +4 -4
- package/resources/v1-beta/v1-beta.d.ts.map +1 -0
- package/resources/{v1/events/beta/beta.js → v1-beta/v1-beta.js} +8 -8
- package/resources/v1-beta/v1-beta.js.map +1 -0
- package/resources/{v1/events/beta/beta.mjs → v1-beta/v1-beta.mjs} +5 -5
- package/resources/v1-beta/v1-beta.mjs.map +1 -0
- package/resources/v1-beta.d.mts +2 -0
- package/resources/v1-beta.d.mts.map +1 -0
- package/resources/v1-beta.d.ts +2 -0
- package/resources/v1-beta.d.ts.map +1 -0
- package/resources/{v1/events/beta.js → v1-beta.js} +3 -3
- package/resources/v1-beta.js.map +1 -0
- package/resources/{v1/events/beta.mjs → v1-beta.mjs} +2 -2
- package/resources/v1-beta.mjs.map +1 -0
- package/src/client.ts +5 -0
- package/src/resources/index.ts +1 -0
- package/src/resources/v1/addons/addons.ts +293 -105
- package/src/resources/v1/addons/entitlements.ts +123 -41
- package/src/resources/v1/addons/index.ts +5 -0
- package/src/resources/v1/coupons.ts +158 -63
- package/src/resources/v1/credits/credits.ts +103 -50
- package/src/resources/v1/credits/custom-currencies.ts +191 -82
- package/src/resources/v1/credits/grants.ts +104 -54
- package/src/resources/v1/credits/index.ts +4 -0
- package/src/resources/v1/customers/customers.ts +324 -140
- package/src/resources/v1/customers/index.ts +8 -1
- package/src/resources/v1/customers/integrations.ts +129 -63
- package/src/resources/v1/customers/payment-method.ts +66 -25
- package/src/resources/v1/customers/promotional-entitlements.ts +82 -62
- package/src/resources/v1/events/data-export/data-export.ts +58 -21
- package/src/resources/v1/events/data-export/destinations.ts +61 -23
- package/src/resources/v1/events/data-export/index.ts +1 -0
- package/src/resources/v1/events/events.ts +28 -22
- package/src/resources/v1/events/index.ts +0 -1
- package/src/resources/v1/features.ts +209 -82
- package/src/resources/v1/index.ts +19 -0
- package/src/resources/v1/plans/entitlements.ts +123 -41
- package/src/resources/v1/plans/index.ts +5 -0
- package/src/resources/v1/plans/plans.ts +321 -119
- package/src/resources/v1/products.ts +193 -74
- package/src/resources/v1/subscriptions/future-update.ts +68 -21
- package/src/resources/v1/subscriptions/index.ts +9 -2
- package/src/resources/v1/subscriptions/invoice.ts +36 -9
- package/src/resources/v1/subscriptions/subscriptions.ts +417 -173
- package/src/resources/v1/subscriptions/usage.ts +61 -18
- package/src/resources/v1/usage.ts +53 -29
- package/src/resources/v1/v1.ts +38 -0
- package/src/resources/v1-beta/customers/assignments.ts +328 -0
- package/src/resources/{v1/events/beta → v1-beta}/customers/customers.ts +1 -1
- package/src/resources/{v1/events/beta → v1-beta}/customers/entities.ts +165 -54
- package/src/resources/{v1/events/beta → v1-beta}/customers/entitlements.ts +43 -18
- package/src/resources/{v1/events/beta → v1-beta}/entity-types.ts +70 -25
- package/src/resources/{v1/events/beta → v1-beta}/index.ts +1 -1
- package/src/resources/{v1/events/beta/beta.ts → v1-beta/v1-beta.ts} +5 -5
- package/src/resources/{v1/events/beta.ts → v1-beta.ts} +1 -1
- 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/events/beta/beta.d.mts.map +0 -1
- package/resources/v1/events/beta/beta.d.ts.map +0 -1
- package/resources/v1/events/beta/beta.js.map +0 -1
- package/resources/v1/events/beta/beta.mjs.map +0 -1
- package/resources/v1/events/beta/customers/assignments.d.mts +0 -178
- package/resources/v1/events/beta/customers/assignments.d.mts.map +0 -1
- package/resources/v1/events/beta/customers/assignments.d.ts +0 -178
- package/resources/v1/events/beta/customers/assignments.d.ts.map +0 -1
- package/resources/v1/events/beta/customers/assignments.js +0 -62
- package/resources/v1/events/beta/customers/assignments.js.map +0 -1
- package/resources/v1/events/beta/customers/assignments.mjs +0 -58
- package/resources/v1/events/beta/customers/assignments.mjs.map +0 -1
- package/resources/v1/events/beta/customers/customers.d.mts.map +0 -1
- package/resources/v1/events/beta/customers/customers.d.ts.map +0 -1
- package/resources/v1/events/beta/customers/customers.js.map +0 -1
- package/resources/v1/events/beta/customers/customers.mjs.map +0 -1
- package/resources/v1/events/beta/customers/entities.d.mts.map +0 -1
- package/resources/v1/events/beta/customers/entities.d.ts.map +0 -1
- package/resources/v1/events/beta/customers/entities.js +0 -105
- package/resources/v1/events/beta/customers/entities.js.map +0 -1
- package/resources/v1/events/beta/customers/entities.mjs +0 -101
- package/resources/v1/events/beta/customers/entities.mjs.map +0 -1
- package/resources/v1/events/beta/customers/entitlements.d.mts.map +0 -1
- package/resources/v1/events/beta/customers/entitlements.d.ts.map +0 -1
- package/resources/v1/events/beta/customers/entitlements.js +0 -26
- package/resources/v1/events/beta/customers/entitlements.js.map +0 -1
- package/resources/v1/events/beta/customers/entitlements.mjs +0 -22
- package/resources/v1/events/beta/customers/entitlements.mjs.map +0 -1
- package/resources/v1/events/beta/customers/index.d.mts.map +0 -1
- package/resources/v1/events/beta/customers/index.d.ts.map +0 -1
- package/resources/v1/events/beta/customers/index.js.map +0 -1
- package/resources/v1/events/beta/customers/index.mjs.map +0 -1
- package/resources/v1/events/beta/customers.d.mts.map +0 -1
- package/resources/v1/events/beta/customers.d.ts.map +0 -1
- package/resources/v1/events/beta/customers.js.map +0 -1
- package/resources/v1/events/beta/customers.mjs.map +0 -1
- package/resources/v1/events/beta/entity-types.d.mts.map +0 -1
- package/resources/v1/events/beta/entity-types.d.ts.map +0 -1
- package/resources/v1/events/beta/entity-types.js +0 -56
- package/resources/v1/events/beta/entity-types.js.map +0 -1
- package/resources/v1/events/beta/entity-types.mjs +0 -52
- package/resources/v1/events/beta/entity-types.mjs.map +0 -1
- package/resources/v1/events/beta/index.d.mts.map +0 -1
- package/resources/v1/events/beta/index.d.ts.map +0 -1
- package/resources/v1/events/beta/index.js.map +0 -1
- package/resources/v1/events/beta/index.mjs.map +0 -1
- package/resources/v1/events/beta.d.mts +0 -2
- package/resources/v1/events/beta.d.mts.map +0 -1
- package/resources/v1/events/beta.d.ts +0 -2
- package/resources/v1/events/beta.d.ts.map +0 -1
- package/resources/v1/events/beta.js.map +0 -1
- package/resources/v1/events/beta.mjs.map +0 -1
- package/src/resources/v1/events/beta/customers/assignments.ts +0 -228
- /package/resources/{v1/events/beta → v1-beta}/customers/index.d.mts +0 -0
- /package/resources/{v1/events/beta → v1-beta}/customers/index.d.ts +0 -0
- /package/resources/{v1/events/beta → v1-beta}/customers/index.js +0 -0
- /package/resources/{v1/events/beta → v1-beta}/customers/index.mjs +0 -0
- /package/resources/{v1/events/beta → v1-beta}/customers.d.mts +0 -0
- /package/resources/{v1/events/beta → v1-beta}/customers.d.ts +0 -0
- /package/resources/{v1/events/beta → v1-beta}/customers.mjs +0 -0
- /package/src/resources/{v1/events/beta → v1-beta}/customers/index.ts +0 -0
- /package/src/resources/{v1/events/beta → v1-beta}/customers.ts +0 -0
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../../../core/resource.mjs";
|
|
3
3
|
import * as FutureUpdateAPI from "./future-update.mjs";
|
|
4
|
-
import { FutureUpdate as FutureUpdateAPIFutureUpdate } from "./future-update.mjs";
|
|
4
|
+
import { FutureUpdate as FutureUpdateAPIFutureUpdate, } from "./future-update.mjs";
|
|
5
5
|
import * as InvoiceAPI from "./invoice.mjs";
|
|
6
6
|
import { Invoice } from "./invoice.mjs";
|
|
7
7
|
import * as UsageAPI from "./usage.mjs";
|
|
8
|
-
import { Usage } from "./usage.mjs";
|
|
8
|
+
import { Usage, } from "./usage.mjs";
|
|
9
9
|
import { MyCursorIDPage } from "../../../core/pagination.mjs";
|
|
10
|
+
import { buildHeaders } from "../../../internal/headers.mjs";
|
|
10
11
|
import { path } from "../../../internal/utils/path.mjs";
|
|
11
12
|
export class Subscriptions extends APIResource {
|
|
12
13
|
constructor() {
|
|
@@ -18,156 +19,181 @@ export class Subscriptions extends APIResource {
|
|
|
18
19
|
/**
|
|
19
20
|
* Retrieves a subscription by its unique identifier, including plan details,
|
|
20
21
|
* billing period, status, and add-ons.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* const subscription = await client.v1.subscriptions.retrieve(
|
|
25
|
-
* 'x',
|
|
26
|
-
* );
|
|
27
|
-
* ```
|
|
28
22
|
*/
|
|
29
|
-
retrieve(id, options) {
|
|
30
|
-
|
|
23
|
+
retrieve(id, params = {}, options) {
|
|
24
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
|
|
25
|
+
return this._client.get(path `/api/v1/subscriptions/${id}`, {
|
|
26
|
+
...options,
|
|
27
|
+
headers: buildHeaders([
|
|
28
|
+
{
|
|
29
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
30
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
31
|
+
},
|
|
32
|
+
options?.headers,
|
|
33
|
+
]),
|
|
34
|
+
});
|
|
31
35
|
}
|
|
32
36
|
/**
|
|
33
37
|
* Updates an active subscription's properties including billing period, add-ons,
|
|
34
38
|
* unit quantities, and discounts.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```ts
|
|
38
|
-
* const subscription = await client.v1.subscriptions.update(
|
|
39
|
-
* 'x',
|
|
40
|
-
* );
|
|
41
|
-
* ```
|
|
42
39
|
*/
|
|
43
|
-
update(id,
|
|
44
|
-
|
|
40
|
+
update(id, params, options) {
|
|
41
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
42
|
+
return this._client.patch(path `/api/v1/subscriptions/${id}`, {
|
|
43
|
+
body,
|
|
44
|
+
...options,
|
|
45
|
+
headers: buildHeaders([
|
|
46
|
+
{
|
|
47
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
48
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
49
|
+
},
|
|
50
|
+
options?.headers,
|
|
51
|
+
]),
|
|
52
|
+
});
|
|
45
53
|
}
|
|
46
54
|
/**
|
|
47
55
|
* Retrieves a paginated list of subscriptions, with optional filters for customer,
|
|
48
56
|
* status, and plan.
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```ts
|
|
52
|
-
* // Automatically fetches more pages as needed.
|
|
53
|
-
* for await (const subscriptionListResponse of client.v1.subscriptions.list()) {
|
|
54
|
-
* // ...
|
|
55
|
-
* }
|
|
56
|
-
* ```
|
|
57
57
|
*/
|
|
58
|
-
list(
|
|
58
|
+
list(params = {}, options) {
|
|
59
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
|
|
59
60
|
return this._client.getAPIList('/api/v1/subscriptions', (MyCursorIDPage), {
|
|
60
61
|
query,
|
|
61
62
|
...options,
|
|
63
|
+
headers: buildHeaders([
|
|
64
|
+
{
|
|
65
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
66
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
67
|
+
},
|
|
68
|
+
options?.headers,
|
|
69
|
+
]),
|
|
62
70
|
});
|
|
63
71
|
}
|
|
64
72
|
/**
|
|
65
73
|
* Cancels an active subscription, either immediately or at a specified time such
|
|
66
74
|
* as end of billing period.
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* ```ts
|
|
70
|
-
* const subscription = await client.v1.subscriptions.cancel(
|
|
71
|
-
* 'x',
|
|
72
|
-
* );
|
|
73
|
-
* ```
|
|
74
75
|
*/
|
|
75
|
-
cancel(id,
|
|
76
|
-
|
|
76
|
+
cancel(id, params, options) {
|
|
77
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
78
|
+
return this._client.post(path `/api/v1/subscriptions/${id}/cancel`, {
|
|
79
|
+
body,
|
|
80
|
+
...options,
|
|
81
|
+
headers: buildHeaders([
|
|
82
|
+
{
|
|
83
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
84
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
85
|
+
},
|
|
86
|
+
options?.headers,
|
|
87
|
+
]),
|
|
88
|
+
});
|
|
77
89
|
}
|
|
78
90
|
/**
|
|
79
91
|
* Delegates the payment responsibility of a subscription to a different customer.
|
|
80
92
|
* The delegated customer will be billed for this subscription.
|
|
81
|
-
*
|
|
82
|
-
* @example
|
|
83
|
-
* ```ts
|
|
84
|
-
* const subscription = await client.v1.subscriptions.delegate(
|
|
85
|
-
* 'x',
|
|
86
|
-
* { targetCustomerId: 'targetCustomerId' },
|
|
87
|
-
* );
|
|
88
|
-
* ```
|
|
89
93
|
*/
|
|
90
|
-
delegate(id,
|
|
91
|
-
|
|
94
|
+
delegate(id, params, options) {
|
|
95
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
96
|
+
return this._client.post(path `/api/v1/subscriptions/${id}/delegate`, {
|
|
97
|
+
body,
|
|
98
|
+
...options,
|
|
99
|
+
headers: buildHeaders([
|
|
100
|
+
{
|
|
101
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
102
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
103
|
+
},
|
|
104
|
+
options?.headers,
|
|
105
|
+
]),
|
|
106
|
+
});
|
|
92
107
|
}
|
|
93
108
|
/**
|
|
94
109
|
* Imports multiple subscriptions in bulk. Used for migrating subscription data
|
|
95
110
|
* from external systems.
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* ```ts
|
|
99
|
-
* const response = await client.v1.subscriptions.import({
|
|
100
|
-
* subscriptions: [
|
|
101
|
-
* {
|
|
102
|
-
* id: 'id',
|
|
103
|
-
* customerId: 'customerId',
|
|
104
|
-
* planId: 'planId',
|
|
105
|
-
* },
|
|
106
|
-
* ],
|
|
107
|
-
* });
|
|
108
|
-
* ```
|
|
109
111
|
*/
|
|
110
|
-
import(
|
|
111
|
-
|
|
112
|
+
import(params, options) {
|
|
113
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
114
|
+
return this._client.post('/api/v1/subscriptions/import', {
|
|
115
|
+
body,
|
|
116
|
+
...options,
|
|
117
|
+
headers: buildHeaders([
|
|
118
|
+
{
|
|
119
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
120
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
121
|
+
},
|
|
122
|
+
options?.headers,
|
|
123
|
+
]),
|
|
124
|
+
});
|
|
112
125
|
}
|
|
113
126
|
/**
|
|
114
127
|
* Migrates a subscription to the latest published version of its plan or add-ons.
|
|
115
128
|
* Handles prorated charges or credits automatically.
|
|
116
|
-
*
|
|
117
|
-
* @example
|
|
118
|
-
* ```ts
|
|
119
|
-
* const subscription = await client.v1.subscriptions.migrate(
|
|
120
|
-
* 'x',
|
|
121
|
-
* );
|
|
122
|
-
* ```
|
|
123
129
|
*/
|
|
124
|
-
migrate(id,
|
|
125
|
-
|
|
130
|
+
migrate(id, params, options) {
|
|
131
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
132
|
+
return this._client.post(path `/api/v1/subscriptions/${id}/migrate`, {
|
|
133
|
+
body,
|
|
134
|
+
...options,
|
|
135
|
+
headers: buildHeaders([
|
|
136
|
+
{
|
|
137
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
138
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
139
|
+
},
|
|
140
|
+
options?.headers,
|
|
141
|
+
]),
|
|
142
|
+
});
|
|
126
143
|
}
|
|
127
144
|
/**
|
|
128
145
|
* Previews the pricing impact of creating or updating a subscription without
|
|
129
146
|
* making changes. Returns estimated costs, taxes, and proration details.
|
|
130
|
-
*
|
|
131
|
-
* @example
|
|
132
|
-
* ```ts
|
|
133
|
-
* const response = await client.v1.subscriptions.preview({
|
|
134
|
-
* customerId: 'customerId',
|
|
135
|
-
* planId: 'planId',
|
|
136
|
-
* });
|
|
137
|
-
* ```
|
|
138
147
|
*/
|
|
139
|
-
preview(
|
|
140
|
-
|
|
148
|
+
preview(params, options) {
|
|
149
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
150
|
+
return this._client.post('/api/v1/subscriptions/preview', {
|
|
151
|
+
body,
|
|
152
|
+
...options,
|
|
153
|
+
headers: buildHeaders([
|
|
154
|
+
{
|
|
155
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
156
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
157
|
+
},
|
|
158
|
+
options?.headers,
|
|
159
|
+
]),
|
|
160
|
+
});
|
|
141
161
|
}
|
|
142
162
|
/**
|
|
143
163
|
* Creates a new subscription for an existing customer. When payment is required
|
|
144
164
|
* and no payment method exists, returns a checkout URL.
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
* ```ts
|
|
148
|
-
* const response = await client.v1.subscriptions.provision({
|
|
149
|
-
* customerId: 'customerId',
|
|
150
|
-
* planId: 'planId',
|
|
151
|
-
* });
|
|
152
|
-
* ```
|
|
153
165
|
*/
|
|
154
|
-
provision(
|
|
155
|
-
|
|
166
|
+
provision(params, options) {
|
|
167
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
168
|
+
return this._client.post('/api/v1/subscriptions', {
|
|
169
|
+
body,
|
|
170
|
+
...options,
|
|
171
|
+
headers: buildHeaders([
|
|
172
|
+
{
|
|
173
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
174
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
175
|
+
},
|
|
176
|
+
options?.headers,
|
|
177
|
+
]),
|
|
178
|
+
});
|
|
156
179
|
}
|
|
157
180
|
/**
|
|
158
181
|
* Transfers a subscription to a different resource ID. Used for multi-resource
|
|
159
182
|
* products where subscriptions apply to specific entities like websites or apps.
|
|
160
|
-
*
|
|
161
|
-
* @example
|
|
162
|
-
* ```ts
|
|
163
|
-
* const subscription = await client.v1.subscriptions.transfer(
|
|
164
|
-
* 'x',
|
|
165
|
-
* { destinationResourceId: 'destinationResourceId' },
|
|
166
|
-
* );
|
|
167
|
-
* ```
|
|
168
183
|
*/
|
|
169
|
-
transfer(id,
|
|
170
|
-
|
|
184
|
+
transfer(id, params, options) {
|
|
185
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
186
|
+
return this._client.post(path `/api/v1/subscriptions/${id}/transfer`, {
|
|
187
|
+
body,
|
|
188
|
+
...options,
|
|
189
|
+
headers: buildHeaders([
|
|
190
|
+
{
|
|
191
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
192
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
193
|
+
},
|
|
194
|
+
options?.headers,
|
|
195
|
+
]),
|
|
196
|
+
});
|
|
171
197
|
}
|
|
172
198
|
}
|
|
173
199
|
Subscriptions.FutureUpdate = FutureUpdateAPIFutureUpdate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.mjs","sourceRoot":"","sources":["../../../src/resources/v1/subscriptions/subscriptions.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,KAAK,eAAe,4BAAwB;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"subscriptions.mjs","sourceRoot":"","sources":["../../../src/resources/v1/subscriptions/subscriptions.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,KAAK,eAAe,4BAAwB;AACnD,OAAO,EAEL,YAAY,IAAI,2BAA2B,GAG5C,4BAAwB;AACzB,OAAO,KAAK,UAAU,sBAAkB;AACxC,OAAO,EAAE,OAAO,EAAsD,sBAAkB;AACxF,OAAO,KAAK,QAAQ,oBAAgB;AACpC,OAAO,EACL,KAAK,GAKN,oBAAgB;AAEjB,OAAO,EAAE,cAAc,EAA0C,qCAAiC;AAClG,OAAO,EAAE,YAAY,EAAE,sCAAkC;AAEzD,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD,MAAM,OAAO,aAAc,SAAQ,WAAW;IAA9C;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5F,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAmNrE,CAAC;IAjNC;;;OAGG;IACH,QAAQ,CACN,EAAU,EACV,SAAwD,EAAE,EAC1D,OAAwB;QAExB,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACxF,OAAO,IAAI,CAAC,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a subscription via the billing integration.
|
|
10
10
|
* Calculates usage since the last charge and creates an invoice.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* const response =
|
|
15
|
-
* await client.v1.subscriptions.usage.chargeUsage('x');
|
|
16
|
-
* ```
|
|
17
11
|
*/
|
|
18
|
-
chargeUsage(id: string,
|
|
12
|
+
chargeUsage(id: string, params: UsageChargeUsageParams, options?: RequestOptions): APIPromise<UsageChargeUsageResponse>;
|
|
19
13
|
/**
|
|
20
14
|
* Triggers a usage sync for a subscription, reporting current usage to the billing
|
|
21
15
|
* provider.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* const response = await client.v1.subscriptions.usage.sync(
|
|
26
|
-
* 'x',
|
|
27
|
-
* );
|
|
28
|
-
* ```
|
|
29
16
|
*/
|
|
30
|
-
sync(id: string, options?: RequestOptions): APIPromise<UsageSyncResponse>;
|
|
17
|
+
sync(id: string, params?: UsageSyncParams | null | undefined, options?: RequestOptions): APIPromise<UsageSyncResponse>;
|
|
31
18
|
}
|
|
32
19
|
/**
|
|
33
20
|
* Response object
|
|
@@ -104,11 +91,36 @@ export declare namespace UsageSyncResponse {
|
|
|
104
91
|
}
|
|
105
92
|
export interface UsageChargeUsageParams {
|
|
106
93
|
/**
|
|
107
|
-
* Cutoff date for usage calculation. If not provided, the current time
|
|
94
|
+
* Body param: Cutoff date for usage calculation. If not provided, the current time
|
|
95
|
+
* is used.
|
|
108
96
|
*/
|
|
109
97
|
untilDate?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
100
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
101
|
+
*/
|
|
102
|
+
'X-ACCOUNT-ID'?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
105
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
106
|
+
* intrinsic to the key).
|
|
107
|
+
*/
|
|
108
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
109
|
+
}
|
|
110
|
+
export interface UsageSyncParams {
|
|
111
|
+
/**
|
|
112
|
+
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
113
|
+
* back to the user's first membership. Ignored for API-key auth.
|
|
114
|
+
*/
|
|
115
|
+
'X-ACCOUNT-ID'?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
118
|
+
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
119
|
+
* key).
|
|
120
|
+
*/
|
|
121
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
110
122
|
}
|
|
111
123
|
export declare namespace Usage {
|
|
112
|
-
export { type UsageChargeUsageResponse as UsageChargeUsageResponse, type UsageSyncResponse as UsageSyncResponse, type UsageChargeUsageParams as UsageChargeUsageParams, };
|
|
124
|
+
export { type UsageChargeUsageResponse as UsageChargeUsageResponse, type UsageSyncResponse as UsageSyncResponse, type UsageChargeUsageParams as UsageChargeUsageParams, type UsageSyncParams as UsageSyncParams, };
|
|
113
125
|
}
|
|
114
126
|
//# sourceMappingURL=usage.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/subscriptions/usage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,sCAAkC;
|
|
1
|
+
{"version":3,"file":"usage.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/subscriptions/usage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,sCAAkC;AAEvD,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAGnE;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;O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;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}
|
|
@@ -8,26 +8,13 @@ export declare class Usage extends APIResource {
|
|
|
8
8
|
/**
|
|
9
9
|
* Immediately charges usage for a subscription via the billing integration.
|
|
10
10
|
* Calculates usage since the last charge and creates an invoice.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* const response =
|
|
15
|
-
* await client.v1.subscriptions.usage.chargeUsage('x');
|
|
16
|
-
* ```
|
|
17
11
|
*/
|
|
18
|
-
chargeUsage(id: string,
|
|
12
|
+
chargeUsage(id: string, params: UsageChargeUsageParams, options?: RequestOptions): APIPromise<UsageChargeUsageResponse>;
|
|
19
13
|
/**
|
|
20
14
|
* Triggers a usage sync for a subscription, reporting current usage to the billing
|
|
21
15
|
* provider.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* const response = await client.v1.subscriptions.usage.sync(
|
|
26
|
-
* 'x',
|
|
27
|
-
* );
|
|
28
|
-
* ```
|
|
29
16
|
*/
|
|
30
|
-
sync(id: string, options?: RequestOptions): APIPromise<UsageSyncResponse>;
|
|
17
|
+
sync(id: string, params?: UsageSyncParams | null | undefined, options?: RequestOptions): APIPromise<UsageSyncResponse>;
|
|
31
18
|
}
|
|
32
19
|
/**
|
|
33
20
|
* Response object
|
|
@@ -104,11 +91,36 @@ export declare namespace UsageSyncResponse {
|
|
|
104
91
|
}
|
|
105
92
|
export interface UsageChargeUsageParams {
|
|
106
93
|
/**
|
|
107
|
-
* Cutoff date for usage calculation. If not provided, the current time
|
|
94
|
+
* Body param: Cutoff date for usage calculation. If not provided, the current time
|
|
95
|
+
* is used.
|
|
108
96
|
*/
|
|
109
97
|
untilDate?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
100
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
101
|
+
*/
|
|
102
|
+
'X-ACCOUNT-ID'?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
105
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
106
|
+
* intrinsic to the key).
|
|
107
|
+
*/
|
|
108
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
109
|
+
}
|
|
110
|
+
export interface UsageSyncParams {
|
|
111
|
+
/**
|
|
112
|
+
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
113
|
+
* back to the user's first membership. Ignored for API-key auth.
|
|
114
|
+
*/
|
|
115
|
+
'X-ACCOUNT-ID'?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
118
|
+
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
119
|
+
* key).
|
|
120
|
+
*/
|
|
121
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
110
122
|
}
|
|
111
123
|
export declare namespace Usage {
|
|
112
|
-
export { type UsageChargeUsageResponse as UsageChargeUsageResponse, type UsageSyncResponse as UsageSyncResponse, type UsageChargeUsageParams as UsageChargeUsageParams, };
|
|
124
|
+
export { type UsageChargeUsageResponse as UsageChargeUsageResponse, type UsageSyncResponse as UsageSyncResponse, type UsageChargeUsageParams as UsageChargeUsageParams, type UsageSyncParams as UsageSyncParams, };
|
|
113
125
|
}
|
|
114
126
|
//# sourceMappingURL=usage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/subscriptions/usage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,qCAAkC;
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/subscriptions/usage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,qCAAkC;AAEvD,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAGnE;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;OAGG;IACH,WAAW,CACT,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,sBAAsB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;IAevC;;;OAGG;IACH,IAAI,CACF,EAAE,EAAE,MAAM,EACV,MAAM,GAAE,eAAe,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iBAAiB,CAAC;CAajC;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,IAAI,EAAE,wBAAwB,CAAC,IAAI,CAAC;CACrC;AAED,yBAAiB,wBAAwB,CAAC;IACxC;;;OAGG;IACH,UAAiB,IAAI;QACnB;;WAEG;QACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;QAEhC;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH,WAAW,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,cAAc,EAAE,MAAM,CAAC;QAEvB;;WAEG;QACH,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KACxC;IAED,UAAiB,IAAI,CAAC;QACpB;;WAEG;QACH,UAAiB,YAAY;YAC3B;;eAEG;YACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;YAEzB;;eAEG;YACH,WAAW,EAAE,MAAM,CAAC;SACrB;KACF;CACF;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC;CAC9B;AAED,yBAAiB,iBAAiB,CAAC;IACjC;;OAEG;IACH,UAAiB,IAAI;QACnB;;WAEG;QACH,SAAS,EAAE,OAAO,CAAC;KACpB;CACF;AAED,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Usage = void 0;
|
|
5
5
|
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const headers_1 = require("../../../internal/headers.js");
|
|
6
7
|
const path_1 = require("../../../internal/utils/path.js");
|
|
7
8
|
/**
|
|
8
9
|
* Operations related to subscriptions
|
|
@@ -11,29 +12,37 @@ class Usage extends resource_1.APIResource {
|
|
|
11
12
|
/**
|
|
12
13
|
* Immediately charges usage for a subscription via the billing integration.
|
|
13
14
|
* Calculates usage since the last charge and creates an invoice.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts
|
|
17
|
-
* const response =
|
|
18
|
-
* await client.v1.subscriptions.usage.chargeUsage('x');
|
|
19
|
-
* ```
|
|
20
15
|
*/
|
|
21
|
-
chargeUsage(id,
|
|
22
|
-
|
|
16
|
+
chargeUsage(id, params, options) {
|
|
17
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
18
|
+
return this._client.post((0, path_1.path) `/api/v1/subscriptions/${id}/usage/charge`, {
|
|
19
|
+
body,
|
|
20
|
+
...options,
|
|
21
|
+
headers: (0, headers_1.buildHeaders)([
|
|
22
|
+
{
|
|
23
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
24
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
25
|
+
},
|
|
26
|
+
options?.headers,
|
|
27
|
+
]),
|
|
28
|
+
});
|
|
23
29
|
}
|
|
24
30
|
/**
|
|
25
31
|
* Triggers a usage sync for a subscription, reporting current usage to the billing
|
|
26
32
|
* provider.
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* const response = await client.v1.subscriptions.usage.sync(
|
|
31
|
-
* 'x',
|
|
32
|
-
* );
|
|
33
|
-
* ```
|
|
34
33
|
*/
|
|
35
|
-
sync(id, options) {
|
|
36
|
-
|
|
34
|
+
sync(id, params = {}, options) {
|
|
35
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
|
|
36
|
+
return this._client.post((0, path_1.path) `/api/v1/subscriptions/${id}/usage/sync`, {
|
|
37
|
+
...options,
|
|
38
|
+
headers: (0, headers_1.buildHeaders)([
|
|
39
|
+
{
|
|
40
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
41
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
42
|
+
},
|
|
43
|
+
options?.headers,
|
|
44
|
+
]),
|
|
45
|
+
});
|
|
37
46
|
}
|
|
38
47
|
}
|
|
39
48
|
exports.Usage = Usage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../../src/resources/v1/subscriptions/usage.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../../src/resources/v1/subscriptions/usage.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,0DAAyD;AAEzD,0DAAoD;AAEpD;;GAEG;AACH,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;OAGG;IACH,WAAW,CACT,EAAU,EACV,MAA8B,EAC9B,OAAwB;QAExB,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC3F,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,yBAAyB,EAAE,eAAe,EAAE;YACvE,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB;oBACE,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;oBACpE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;iBACjF;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,IAAI,CACF,EAAU,EACV,SAA6C,EAAE,EAC/C,OAAwB;QAExB,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACxF,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,yBAAyB,EAAE,aAAa,EAAE;YACrE,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB;oBACE,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;oBACpE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;iBACjF;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF;AA7CD,sBA6CC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import { buildHeaders } from "../../../internal/headers.mjs";
|
|
3
4
|
import { path } from "../../../internal/utils/path.mjs";
|
|
4
5
|
/**
|
|
5
6
|
* Operations related to subscriptions
|
|
@@ -8,29 +9,37 @@ export class Usage extends APIResource {
|
|
|
8
9
|
/**
|
|
9
10
|
* Immediately charges usage for a subscription via the billing integration.
|
|
10
11
|
* Calculates usage since the last charge and creates an invoice.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* const response =
|
|
15
|
-
* await client.v1.subscriptions.usage.chargeUsage('x');
|
|
16
|
-
* ```
|
|
17
12
|
*/
|
|
18
|
-
chargeUsage(id,
|
|
19
|
-
|
|
13
|
+
chargeUsage(id, params, options) {
|
|
14
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
15
|
+
return this._client.post(path `/api/v1/subscriptions/${id}/usage/charge`, {
|
|
16
|
+
body,
|
|
17
|
+
...options,
|
|
18
|
+
headers: buildHeaders([
|
|
19
|
+
{
|
|
20
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
21
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
22
|
+
},
|
|
23
|
+
options?.headers,
|
|
24
|
+
]),
|
|
25
|
+
});
|
|
20
26
|
}
|
|
21
27
|
/**
|
|
22
28
|
* Triggers a usage sync for a subscription, reporting current usage to the billing
|
|
23
29
|
* provider.
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```ts
|
|
27
|
-
* const response = await client.v1.subscriptions.usage.sync(
|
|
28
|
-
* 'x',
|
|
29
|
-
* );
|
|
30
|
-
* ```
|
|
31
30
|
*/
|
|
32
|
-
sync(id, options) {
|
|
33
|
-
|
|
31
|
+
sync(id, params = {}, options) {
|
|
32
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
|
|
33
|
+
return this._client.post(path `/api/v1/subscriptions/${id}/usage/sync`, {
|
|
34
|
+
...options,
|
|
35
|
+
headers: buildHeaders([
|
|
36
|
+
{
|
|
37
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
38
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
39
|
+
},
|
|
40
|
+
options?.headers,
|
|
41
|
+
]),
|
|
42
|
+
});
|
|
34
43
|
}
|
|
35
44
|
}
|
|
36
45
|
//# sourceMappingURL=usage.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.mjs","sourceRoot":"","sources":["../../../src/resources/v1/subscriptions/usage.ts"],"names":[],"mappings":"AAAA,sFAAsF;AA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