@stigg/typescript 0.1.0-beta.2 → 0.1.0-beta.21
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 +170 -0
- package/api-promise.d.mts +1 -0
- package/api-promise.d.mts.map +1 -1
- package/api-promise.d.ts +1 -0
- package/api-promise.d.ts.map +1 -1
- package/api-promise.mjs +1 -0
- package/api-promise.mjs.map +1 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts.map +1 -1
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.mjs.map +1 -1
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.mjs.map +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/uploads.d.mts.map +1 -1
- package/core/uploads.d.ts.map +1 -1
- package/core/uploads.mjs.map +1 -1
- package/error.d.mts +1 -0
- package/error.d.mts.map +1 -1
- package/error.d.ts +1 -0
- package/error.d.ts.map +1 -1
- package/error.mjs +1 -0
- package/error.mjs.map +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.mjs.map +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/qs/formats.d.mts.map +1 -1
- package/internal/qs/formats.d.ts.map +1 -1
- package/internal/qs/index.d.mts +2 -2
- package/internal/qs/index.d.mts.map +1 -1
- package/internal/qs/index.d.ts +2 -2
- package/internal/qs/index.d.ts.map +1 -1
- package/internal/qs/index.mjs.map +1 -1
- package/internal/qs/stringify.d.mts.map +1 -1
- package/internal/qs/stringify.d.ts.map +1 -1
- package/internal/qs/stringify.mjs.map +1 -1
- package/internal/qs/utils.d.mts.map +1 -1
- package/internal/qs/utils.d.ts.map +1 -1
- package/internal/qs/utils.mjs.map +1 -1
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/shims.d.mts +6 -0
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +6 -0
- package/internal/shims.d.ts.map +1 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.mjs.map +1 -1
- package/internal/types.d.mts +4 -4
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +4 -4
- package/internal/types.d.ts.map +1 -1
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/query.mjs.map +1 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.d.mts.map +1 -1
- package/internal/utils.d.ts.map +1 -1
- package/internal/utils.mjs.map +1 -1
- package/package.json +1 -1
- package/pagination.d.mts +1 -0
- package/pagination.d.mts.map +1 -1
- package/pagination.d.ts +1 -0
- package/pagination.d.ts.map +1 -1
- package/pagination.mjs +1 -0
- package/pagination.mjs.map +1 -1
- package/resource.d.mts +1 -0
- package/resource.d.mts.map +1 -1
- package/resource.d.ts +1 -0
- package/resource.d.ts.map +1 -1
- package/resource.mjs +1 -0
- package/resource.mjs.map +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/v1/addons/addons.d.mts +372 -32
- package/resources/v1/addons/addons.d.mts.map +1 -1
- package/resources/v1/addons/addons.d.ts +372 -32
- package/resources/v1/addons/addons.d.ts.map +1 -1
- package/resources/v1/addons/addons.js +173 -15
- package/resources/v1/addons/addons.js.map +1 -1
- package/resources/v1/addons/addons.mjs +173 -15
- package/resources/v1/addons/addons.mjs.map +1 -1
- package/resources/v1/addons/entitlements.d.mts +93 -5
- package/resources/v1/addons/entitlements.d.mts.map +1 -1
- package/resources/v1/addons/entitlements.d.ts +93 -5
- package/resources/v1/addons/entitlements.d.ts.map +1 -1
- package/resources/v1/addons/entitlements.js +80 -8
- package/resources/v1/addons/entitlements.js.map +1 -1
- package/resources/v1/addons/entitlements.mjs +80 -8
- 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/addons.d.mts.map +1 -1
- package/resources/v1/addons.d.ts.map +1 -1
- package/resources/v1/addons.mjs.map +1 -1
- package/resources/v1/coupons.d.mts +117 -21
- package/resources/v1/coupons.d.mts.map +1 -1
- package/resources/v1/coupons.d.ts +117 -21
- package/resources/v1/coupons.d.ts.map +1 -1
- package/resources/v1/coupons.js +96 -9
- package/resources/v1/coupons.js.map +1 -1
- package/resources/v1/coupons.mjs +96 -9
- package/resources/v1/coupons.mjs.map +1 -1
- package/resources/v1/credits/credits.d.mts +212 -27
- package/resources/v1/credits/credits.d.mts.map +1 -1
- package/resources/v1/credits/credits.d.ts +212 -27
- package/resources/v1/credits/credits.d.ts.map +1 -1
- package/resources/v1/credits/credits.js +66 -7
- package/resources/v1/credits/credits.js.map +1 -1
- package/resources/v1/credits/credits.mjs +66 -7
- package/resources/v1/credits/credits.mjs.map +1 -1
- package/resources/v1/credits/custom-currencies.d.mts +150 -28
- package/resources/v1/credits/custom-currencies.d.mts.map +1 -1
- package/resources/v1/credits/custom-currencies.d.ts +150 -28
- package/resources/v1/credits/custom-currencies.d.ts.map +1 -1
- package/resources/v1/credits/custom-currencies.js +125 -12
- package/resources/v1/credits/custom-currencies.js.map +1 -1
- package/resources/v1/credits/custom-currencies.mjs +125 -12
- package/resources/v1/credits/custom-currencies.mjs.map +1 -1
- package/resources/v1/credits/grants.d.mts +91 -26
- package/resources/v1/credits/grants.d.mts.map +1 -1
- package/resources/v1/credits/grants.d.ts +91 -26
- package/resources/v1/credits/grants.d.ts.map +1 -1
- package/resources/v1/credits/grants.js +63 -5
- package/resources/v1/credits/grants.js.map +1 -1
- package/resources/v1/credits/grants.mjs +63 -5
- package/resources/v1/credits/grants.mjs.map +1 -1
- package/resources/v1/credits/index.d.mts +3 -4
- package/resources/v1/credits/index.d.mts.map +1 -1
- package/resources/v1/credits/index.d.ts +3 -4
- package/resources/v1/credits/index.d.ts.map +1 -1
- package/resources/v1/credits/index.js +1 -3
- package/resources/v1/credits/index.js.map +1 -1
- package/resources/v1/credits/index.mjs +0 -1
- package/resources/v1/credits/index.mjs.map +1 -1
- package/resources/v1/credits.d.mts.map +1 -1
- package/resources/v1/credits.d.ts.map +1 -1
- package/resources/v1/credits.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +249 -55
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +249 -55
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +201 -19
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +201 -19
- 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 +116 -14
- package/resources/v1/customers/integrations.d.mts.map +1 -1
- package/resources/v1/customers/integrations.d.ts +116 -14
- package/resources/v1/customers/integrations.d.ts.map +1 -1
- package/resources/v1/customers/integrations.js +104 -9
- package/resources/v1/customers/integrations.js.map +1 -1
- package/resources/v1/customers/integrations.mjs +104 -9
- package/resources/v1/customers/integrations.mjs.map +1 -1
- package/resources/v1/customers/payment-method.d.mts +48 -8
- package/resources/v1/customers/payment-method.d.mts.map +1 -1
- package/resources/v1/customers/payment-method.d.ts +48 -8
- package/resources/v1/customers/payment-method.d.ts.map +1 -1
- package/resources/v1/customers/payment-method.js +42 -4
- package/resources/v1/customers/payment-method.js.map +1 -1
- package/resources/v1/customers/payment-method.mjs +42 -4
- package/resources/v1/customers/payment-method.mjs.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.mts +93 -9
- package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.ts +93 -9
- package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -1
- package/resources/v1/customers/promotional-entitlements.js +89 -6
- package/resources/v1/customers/promotional-entitlements.js.map +1 -1
- package/resources/v1/customers/promotional-entitlements.mjs +89 -6
- package/resources/v1/customers/promotional-entitlements.mjs.map +1 -1
- package/resources/v1/customers.d.mts.map +1 -1
- package/resources/v1/customers.d.ts.map +1 -1
- package/resources/v1/customers.mjs.map +1 -1
- package/resources/v1/events/beta/beta.d.mts +14 -0
- package/resources/v1/events/beta/beta.d.mts.map +1 -0
- package/resources/v1/events/beta/beta.d.ts +14 -0
- package/resources/v1/events/beta/beta.d.ts.map +1 -0
- package/resources/v1/events/beta/beta.js +21 -0
- package/resources/v1/events/beta/beta.js.map +1 -0
- package/resources/v1/events/beta/beta.mjs +16 -0
- package/resources/v1/events/beta/beta.mjs.map +1 -0
- package/resources/v1/events/beta/customers/assignments.d.mts +200 -0
- package/resources/v1/events/beta/customers/assignments.d.mts.map +1 -0
- package/resources/v1/events/beta/customers/assignments.d.ts +200 -0
- package/resources/v1/events/beta/customers/assignments.d.ts.map +1 -0
- package/resources/v1/events/beta/customers/assignments.js +85 -0
- package/resources/v1/events/beta/customers/assignments.js.map +1 -0
- package/resources/v1/events/beta/customers/assignments.mjs +81 -0
- package/resources/v1/events/beta/customers/assignments.mjs.map +1 -0
- package/resources/v1/events/beta/customers/customers.d.mts +18 -0
- package/resources/v1/events/beta/customers/customers.d.mts.map +1 -0
- package/resources/v1/events/beta/customers/customers.d.ts +18 -0
- package/resources/v1/events/beta/customers/customers.d.ts.map +1 -0
- package/resources/v1/events/beta/customers/customers.js +25 -0
- package/resources/v1/events/beta/customers/customers.js.map +1 -0
- package/resources/v1/events/beta/customers/customers.mjs +20 -0
- package/resources/v1/events/beta/customers/customers.mjs.map +1 -0
- package/resources/v1/events/beta/customers/entities.d.mts +360 -0
- package/resources/v1/events/beta/customers/entities.d.mts.map +1 -0
- package/resources/v1/events/beta/customers/entities.d.ts +360 -0
- package/resources/v1/events/beta/customers/entities.d.ts.map +1 -0
- package/resources/v1/events/beta/customers/entities.js +159 -0
- package/resources/v1/events/beta/customers/entities.js.map +1 -0
- package/resources/v1/events/beta/customers/entities.mjs +155 -0
- package/resources/v1/events/beta/customers/entities.mjs.map +1 -0
- package/resources/v1/events/beta/customers/entitlements.d.mts +251 -0
- package/resources/v1/events/beta/customers/entitlements.d.mts.map +1 -0
- package/resources/v1/events/beta/customers/entitlements.d.ts +251 -0
- package/resources/v1/events/beta/customers/entitlements.d.ts.map +1 -0
- package/resources/v1/events/beta/customers/entitlements.js +38 -0
- package/resources/v1/events/beta/customers/entitlements.js.map +1 -0
- package/resources/v1/events/beta/customers/entitlements.mjs +34 -0
- package/resources/v1/events/beta/customers/entitlements.mjs.map +1 -0
- package/resources/v1/events/beta/customers/index.d.mts +5 -0
- package/resources/v1/events/beta/customers/index.d.mts.map +1 -0
- package/resources/v1/events/beta/customers/index.d.ts +5 -0
- package/resources/v1/events/beta/customers/index.d.ts.map +1 -0
- package/resources/v1/events/beta/customers/index.js +13 -0
- package/resources/v1/events/beta/customers/index.js.map +1 -0
- package/resources/v1/events/beta/customers/index.mjs +6 -0
- package/resources/v1/events/beta/customers/index.mjs.map +1 -0
- package/resources/v1/events/beta/customers.d.mts +2 -0
- package/resources/v1/events/beta/customers.d.mts.map +1 -0
- package/resources/v1/events/beta/customers.d.ts +2 -0
- package/resources/v1/events/beta/customers.d.ts.map +1 -0
- package/resources/v1/events/beta/customers.js +6 -0
- package/resources/v1/events/beta/customers.js.map +1 -0
- package/resources/v1/events/beta/customers.mjs +3 -0
- package/resources/v1/events/beta/customers.mjs.map +1 -0
- package/resources/v1/events/beta/entity-types.d.mts +166 -0
- package/resources/v1/events/beta/entity-types.d.mts.map +1 -0
- package/resources/v1/events/beta/entity-types.d.ts +166 -0
- package/resources/v1/events/beta/entity-types.d.ts.map +1 -0
- package/resources/v1/events/beta/entity-types.js +76 -0
- package/resources/v1/events/beta/entity-types.js.map +1 -0
- package/resources/v1/events/beta/entity-types.mjs +72 -0
- package/resources/v1/events/beta/entity-types.mjs.map +1 -0
- package/resources/v1/events/beta/index.d.mts +4 -0
- package/resources/v1/events/beta/index.d.mts.map +1 -0
- package/resources/v1/events/beta/index.d.ts +4 -0
- package/resources/v1/events/beta/index.d.ts.map +1 -0
- package/resources/v1/events/beta/index.js +11 -0
- package/resources/v1/events/beta/index.js.map +1 -0
- package/resources/v1/events/beta/index.mjs +5 -0
- 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/events/beta.js +6 -0
- package/resources/v1/events/beta.js.map +1 -0
- package/resources/v1/events/beta.mjs +3 -0
- package/resources/v1/events/beta.mjs.map +1 -0
- package/resources/v1/events/data-export/data-export.d.mts +126 -0
- package/resources/v1/events/data-export/data-export.d.mts.map +1 -0
- package/resources/v1/events/data-export/data-export.d.ts +126 -0
- package/resources/v1/events/data-export/data-export.d.ts.map +1 -0
- package/resources/v1/events/data-export/data-export.js +45 -0
- package/resources/v1/events/data-export/data-export.js.map +1 -0
- package/resources/v1/events/data-export/data-export.mjs +40 -0
- package/resources/v1/events/data-export/data-export.mjs.map +1 -0
- package/resources/v1/events/data-export/destinations.d.mts +202 -0
- package/resources/v1/events/data-export/destinations.d.mts.map +1 -0
- package/resources/v1/events/data-export/destinations.d.ts +202 -0
- package/resources/v1/events/data-export/destinations.d.ts.map +1 -0
- package/resources/v1/events/data-export/destinations.js +41 -0
- package/resources/v1/events/data-export/destinations.js.map +1 -0
- package/resources/v1/events/data-export/destinations.mjs +37 -0
- package/resources/v1/events/data-export/destinations.mjs.map +1 -0
- package/resources/v1/events/data-export/index.d.mts +3 -0
- package/resources/v1/events/data-export/index.d.mts.map +1 -0
- package/resources/v1/events/data-export/index.d.ts +3 -0
- package/resources/v1/events/data-export/index.d.ts.map +1 -0
- package/resources/v1/events/data-export/index.js +9 -0
- package/resources/v1/events/data-export/index.js.map +1 -0
- package/resources/v1/events/data-export/index.mjs +4 -0
- package/resources/v1/events/data-export/index.mjs.map +1 -0
- package/resources/v1/events/data-export.d.mts +2 -0
- package/resources/v1/events/data-export.d.mts.map +1 -0
- package/resources/v1/events/data-export.d.ts +2 -0
- package/resources/v1/events/data-export.d.ts.map +1 -0
- package/resources/v1/events/data-export.js +6 -0
- package/resources/v1/events/data-export.js.map +1 -0
- package/resources/v1/events/data-export.mjs +3 -0
- package/resources/v1/events/data-export.mjs.map +1 -0
- package/resources/v1/events/events.d.mts +98 -0
- package/resources/v1/events/events.d.mts.map +1 -0
- package/resources/v1/events/events.d.ts +98 -0
- package/resources/v1/events/events.d.ts.map +1 -0
- package/resources/v1/events/events.js +56 -0
- package/resources/v1/events/events.js.map +1 -0
- package/resources/v1/events/events.mjs +51 -0
- package/resources/v1/events/events.mjs.map +1 -0
- package/resources/v1/events/index.d.mts +4 -0
- package/resources/v1/events/index.d.mts.map +1 -0
- package/resources/v1/events/index.d.ts +4 -0
- package/resources/v1/events/index.d.ts.map +1 -0
- package/resources/v1/events/index.js +11 -0
- package/resources/v1/events/index.js.map +1 -0
- package/resources/v1/events/index.mjs +5 -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 +152 -31
- package/resources/v1/features.d.mts.map +1 -1
- package/resources/v1/features.d.ts +152 -31
- package/resources/v1/features.d.ts.map +1 -1
- package/resources/v1/features.js +115 -11
- package/resources/v1/features.js.map +1 -1
- package/resources/v1/features.mjs +115 -11
- package/resources/v1/features.mjs.map +1 -1
- package/resources/v1/index.d.mts +9 -9
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +9 -9
- 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 +93 -5
- package/resources/v1/plans/entitlements.d.mts.map +1 -1
- package/resources/v1/plans/entitlements.d.ts +93 -5
- package/resources/v1/plans/entitlements.d.ts.map +1 -1
- package/resources/v1/plans/entitlements.js +80 -8
- package/resources/v1/plans/entitlements.js.map +1 -1
- package/resources/v1/plans/entitlements.mjs +80 -8
- 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 +565 -32
- package/resources/v1/plans/plans.d.mts.map +1 -1
- package/resources/v1/plans/plans.d.ts +565 -32
- package/resources/v1/plans/plans.d.ts.map +1 -1
- package/resources/v1/plans/plans.js +204 -16
- package/resources/v1/plans/plans.js.map +1 -1
- package/resources/v1/plans/plans.mjs +204 -16
- package/resources/v1/plans/plans.mjs.map +1 -1
- package/resources/v1/plans.d.mts.map +1 -1
- package/resources/v1/plans.d.ts.map +1 -1
- package/resources/v1/plans.mjs.map +1 -1
- package/resources/v1/products.d.mts +140 -23
- package/resources/v1/products.d.mts.map +1 -1
- package/resources/v1/products.d.ts +140 -23
- package/resources/v1/products.d.ts.map +1 -1
- package/resources/v1/products.js +116 -11
- package/resources/v1/products.js.map +1 -1
- package/resources/v1/products.mjs +116 -11
- package/resources/v1/products.mjs.map +1 -1
- package/resources/v1/subscriptions/future-update.d.mts +45 -3
- package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
- package/resources/v1/subscriptions/future-update.d.ts +45 -3
- package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
- package/resources/v1/subscriptions/future-update.js +41 -4
- package/resources/v1/subscriptions/future-update.js.map +1 -1
- package/resources/v1/subscriptions/future-update.mjs +41 -4
- 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 +21 -2
- package/resources/v1/subscriptions/invoice.d.mts.map +1 -1
- package/resources/v1/subscriptions/invoice.d.ts +21 -2
- package/resources/v1/subscriptions/invoice.d.ts.map +1 -1
- package/resources/v1/subscriptions/invoice.js +19 -2
- package/resources/v1/subscriptions/invoice.js.map +1 -1
- package/resources/v1/subscriptions/invoice.mjs +19 -2
- package/resources/v1/subscriptions/invoice.mjs.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.mts +341 -85
- package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.ts +341 -85
- package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.js +207 -19
- package/resources/v1/subscriptions/subscriptions.js.map +1 -1
- package/resources/v1/subscriptions/subscriptions.mjs +209 -21
- package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
- package/resources/v1/subscriptions/usage.d.mts +42 -4
- package/resources/v1/subscriptions/usage.d.mts.map +1 -1
- package/resources/v1/subscriptions/usage.d.ts +42 -4
- package/resources/v1/subscriptions/usage.d.ts.map +1 -1
- package/resources/v1/subscriptions/usage.js +39 -4
- package/resources/v1/subscriptions/usage.js.map +1 -1
- package/resources/v1/subscriptions/usage.mjs +39 -4
- package/resources/v1/subscriptions/usage.mjs.map +1 -1
- package/resources/v1/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions.d.ts.map +1 -1
- package/resources/v1/subscriptions.mjs.map +1 -1
- package/resources/v1/usage.d.mts +48 -2
- package/resources/v1/usage.d.mts.map +1 -1
- package/resources/v1/usage.d.ts +48 -2
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +50 -4
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +50 -4
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +18 -18
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +18 -18
- 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/resources/v1.d.mts.map +1 -1
- package/resources/v1.d.ts.map +1 -1
- package/resources/v1.mjs.map +1 -1
- package/resources.d.mts.map +1 -1
- package/resources.d.ts.map +1 -1
- package/resources.mjs.map +1 -1
- package/src/resources/v1/addons/addons.ts +908 -36
- package/src/resources/v1/addons/entitlements.ts +154 -10
- package/src/resources/v1/addons/index.ts +8 -0
- package/src/resources/v1/coupons.ts +194 -27
- package/src/resources/v1/credits/credits.ts +287 -35
- package/src/resources/v1/credits/custom-currencies.ts +245 -38
- package/src/resources/v1/credits/grants.ts +132 -26
- package/src/resources/v1/credits/index.ts +7 -6
- package/src/resources/v1/customers/customers.ts +415 -67
- package/src/resources/v1/customers/index.ts +8 -1
- package/src/resources/v1/customers/integrations.ts +184 -18
- package/src/resources/v1/customers/payment-method.ts +85 -10
- package/src/resources/v1/customers/promotional-entitlements.ts +133 -11
- package/src/resources/v1/events/beta/beta.ts +35 -0
- package/src/resources/v1/events/beta/customers/assignments.ts +277 -0
- package/src/resources/v1/events/beta/customers/customers.ts +71 -0
- package/src/resources/v1/events/beta/customers/entities.ts +501 -0
- package/src/resources/v1/events/beta/customers/entitlements.ts +354 -0
- package/src/resources/v1/events/beta/customers/index.ts +26 -0
- package/src/resources/v1/events/beta/customers.ts +3 -0
- package/src/resources/v1/events/beta/entity-types.ts +226 -0
- package/src/resources/v1/events/beta/index.ts +12 -0
- package/src/resources/v1/events/beta.ts +3 -0
- package/src/resources/v1/events/data-export/data-export.ts +170 -0
- package/src/resources/v1/events/data-export/destinations.ts +243 -0
- package/src/resources/v1/events/data-export/index.ts +15 -0
- package/src/resources/v1/events/data-export.ts +3 -0
- package/src/resources/v1/events/events.ts +141 -0
- package/src/resources/v1/events/index.ts +11 -0
- package/src/resources/v1/events.ts +1 -75
- package/src/resources/v1/features.ts +252 -39
- package/src/resources/v1/index.ts +31 -1
- package/src/resources/v1/plans/entitlements.ts +154 -10
- package/src/resources/v1/plans/index.ts +11 -0
- package/src/resources/v1/plans/plans.ts +1509 -37
- package/src/resources/v1/products.ts +235 -30
- package/src/resources/v1/subscriptions/future-update.ts +84 -5
- package/src/resources/v1/subscriptions/index.ts +9 -2
- package/src/resources/v1/subscriptions/invoice.ts +42 -3
- package/src/resources/v1/subscriptions/subscriptions.ts +509 -90
- package/src/resources/v1/subscriptions/usage.ts +74 -5
- package/src/resources/v1/usage.ts +77 -5
- package/src/resources/v1/v1.ts +62 -2
- package/src/version.ts +1 -1
- package/uploads.d.mts +1 -0
- package/uploads.d.mts.map +1 -1
- package/uploads.d.ts +1 -0
- package/uploads.d.ts.map +1 -1
- package/uploads.mjs +1 -0
- package/uploads.mjs.map +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/v1/credits/auto-recharge.d.mts +0 -84
- package/resources/v1/credits/auto-recharge.d.mts.map +0 -1
- package/resources/v1/credits/auto-recharge.d.ts +0 -84
- package/resources/v1/credits/auto-recharge.d.ts.map +0 -1
- package/resources/v1/credits/auto-recharge.js +0 -16
- package/resources/v1/credits/auto-recharge.js.map +0 -1
- package/resources/v1/credits/auto-recharge.mjs +0 -12
- package/resources/v1/credits/auto-recharge.mjs.map +0 -1
- package/src/resources/v1/credits/auto-recharge.ts +0 -109
|
@@ -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,75 +19,262 @@ 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.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const subscription = await client.v1.subscriptions.retrieve(
|
|
26
|
+
* 'x',
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
21
29
|
*/
|
|
22
|
-
retrieve(id, options) {
|
|
23
|
-
|
|
30
|
+
retrieve(id, params = {}, options) {
|
|
31
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
|
|
32
|
+
return this._client.get(path `/api/v1/subscriptions/${id}`, {
|
|
33
|
+
...options,
|
|
34
|
+
headers: buildHeaders([
|
|
35
|
+
{
|
|
36
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
37
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
38
|
+
},
|
|
39
|
+
options?.headers,
|
|
40
|
+
]),
|
|
41
|
+
});
|
|
24
42
|
}
|
|
25
43
|
/**
|
|
26
44
|
* Updates an active subscription's properties including billing period, add-ons,
|
|
27
45
|
* unit quantities, and discounts.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const subscription = await client.v1.subscriptions.update(
|
|
50
|
+
* 'x',
|
|
51
|
+
* );
|
|
52
|
+
* ```
|
|
28
53
|
*/
|
|
29
|
-
update(id,
|
|
30
|
-
|
|
54
|
+
update(id, params, options) {
|
|
55
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
56
|
+
return this._client.patch(path `/api/v1/subscriptions/${id}`, {
|
|
57
|
+
body,
|
|
58
|
+
...options,
|
|
59
|
+
headers: buildHeaders([
|
|
60
|
+
{
|
|
61
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
62
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
63
|
+
},
|
|
64
|
+
options?.headers,
|
|
65
|
+
]),
|
|
66
|
+
});
|
|
31
67
|
}
|
|
32
68
|
/**
|
|
33
69
|
* Retrieves a paginated list of subscriptions, with optional filters for customer,
|
|
34
70
|
* status, and plan.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* // Automatically fetches more pages as needed.
|
|
75
|
+
* for await (const subscriptionListResponse of client.v1.subscriptions.list()) {
|
|
76
|
+
* // ...
|
|
77
|
+
* }
|
|
78
|
+
* ```
|
|
35
79
|
*/
|
|
36
|
-
list(
|
|
80
|
+
list(params = {}, options) {
|
|
81
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
|
|
37
82
|
return this._client.getAPIList('/api/v1/subscriptions', (MyCursorIDPage), {
|
|
38
83
|
query,
|
|
39
84
|
...options,
|
|
85
|
+
headers: buildHeaders([
|
|
86
|
+
{
|
|
87
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
88
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
89
|
+
},
|
|
90
|
+
options?.headers,
|
|
91
|
+
]),
|
|
40
92
|
});
|
|
41
93
|
}
|
|
42
94
|
/**
|
|
43
95
|
* Cancels an active subscription, either immediately or at a specified time such
|
|
44
96
|
* as end of billing period.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```ts
|
|
100
|
+
* const subscription = await client.v1.subscriptions.cancel(
|
|
101
|
+
* 'x',
|
|
102
|
+
* );
|
|
103
|
+
* ```
|
|
45
104
|
*/
|
|
46
|
-
cancel(id,
|
|
47
|
-
|
|
105
|
+
cancel(id, params, options) {
|
|
106
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
107
|
+
return this._client.post(path `/api/v1/subscriptions/${id}/cancel`, {
|
|
108
|
+
body,
|
|
109
|
+
...options,
|
|
110
|
+
headers: buildHeaders([
|
|
111
|
+
{
|
|
112
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
113
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
114
|
+
},
|
|
115
|
+
options?.headers,
|
|
116
|
+
]),
|
|
117
|
+
});
|
|
48
118
|
}
|
|
49
119
|
/**
|
|
50
120
|
* Delegates the payment responsibility of a subscription to a different customer.
|
|
51
121
|
* The delegated customer will be billed for this subscription.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```ts
|
|
125
|
+
* const subscription = await client.v1.subscriptions.delegate(
|
|
126
|
+
* 'x',
|
|
127
|
+
* { targetCustomerId: 'targetCustomerId' },
|
|
128
|
+
* );
|
|
129
|
+
* ```
|
|
52
130
|
*/
|
|
53
|
-
delegate(id,
|
|
54
|
-
|
|
131
|
+
delegate(id, params, options) {
|
|
132
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
133
|
+
return this._client.post(path `/api/v1/subscriptions/${id}/delegate`, {
|
|
134
|
+
body,
|
|
135
|
+
...options,
|
|
136
|
+
headers: buildHeaders([
|
|
137
|
+
{
|
|
138
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
139
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
140
|
+
},
|
|
141
|
+
options?.headers,
|
|
142
|
+
]),
|
|
143
|
+
});
|
|
55
144
|
}
|
|
56
145
|
/**
|
|
57
146
|
* Imports multiple subscriptions in bulk. Used for migrating subscription data
|
|
58
147
|
* from external systems.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```ts
|
|
151
|
+
* const response = await client.v1.subscriptions.import({
|
|
152
|
+
* subscriptions: [
|
|
153
|
+
* {
|
|
154
|
+
* id: 'id',
|
|
155
|
+
* customerId: 'customerId',
|
|
156
|
+
* planId: 'planId',
|
|
157
|
+
* },
|
|
158
|
+
* ],
|
|
159
|
+
* });
|
|
160
|
+
* ```
|
|
59
161
|
*/
|
|
60
|
-
import(
|
|
61
|
-
|
|
162
|
+
import(params, options) {
|
|
163
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
164
|
+
return this._client.post('/api/v1/subscriptions/import', {
|
|
165
|
+
body,
|
|
166
|
+
...options,
|
|
167
|
+
headers: buildHeaders([
|
|
168
|
+
{
|
|
169
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
170
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
171
|
+
},
|
|
172
|
+
options?.headers,
|
|
173
|
+
]),
|
|
174
|
+
});
|
|
62
175
|
}
|
|
63
176
|
/**
|
|
64
177
|
* Migrates a subscription to the latest published version of its plan or add-ons.
|
|
65
178
|
* Handles prorated charges or credits automatically.
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* ```ts
|
|
182
|
+
* const subscription = await client.v1.subscriptions.migrate(
|
|
183
|
+
* 'x',
|
|
184
|
+
* );
|
|
185
|
+
* ```
|
|
66
186
|
*/
|
|
67
|
-
migrate(id,
|
|
68
|
-
|
|
187
|
+
migrate(id, params, options) {
|
|
188
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
189
|
+
return this._client.post(path `/api/v1/subscriptions/${id}/migrate`, {
|
|
190
|
+
body,
|
|
191
|
+
...options,
|
|
192
|
+
headers: buildHeaders([
|
|
193
|
+
{
|
|
194
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
195
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
196
|
+
},
|
|
197
|
+
options?.headers,
|
|
198
|
+
]),
|
|
199
|
+
});
|
|
69
200
|
}
|
|
70
201
|
/**
|
|
71
202
|
* Previews the pricing impact of creating or updating a subscription without
|
|
72
203
|
* making changes. Returns estimated costs, taxes, and proration details.
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* ```ts
|
|
207
|
+
* const response = await client.v1.subscriptions.preview({
|
|
208
|
+
* customerId: 'customerId',
|
|
209
|
+
* planId: 'planId',
|
|
210
|
+
* });
|
|
211
|
+
* ```
|
|
73
212
|
*/
|
|
74
|
-
preview(
|
|
75
|
-
|
|
213
|
+
preview(params, options) {
|
|
214
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
215
|
+
return this._client.post('/api/v1/subscriptions/preview', {
|
|
216
|
+
body,
|
|
217
|
+
...options,
|
|
218
|
+
headers: buildHeaders([
|
|
219
|
+
{
|
|
220
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
221
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
222
|
+
},
|
|
223
|
+
options?.headers,
|
|
224
|
+
]),
|
|
225
|
+
});
|
|
76
226
|
}
|
|
77
227
|
/**
|
|
78
228
|
* Creates a new subscription for an existing customer. When payment is required
|
|
79
229
|
* and no payment method exists, returns a checkout URL.
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* ```ts
|
|
233
|
+
* const response = await client.v1.subscriptions.provision({
|
|
234
|
+
* customerId: 'customerId',
|
|
235
|
+
* planId: 'planId',
|
|
236
|
+
* });
|
|
237
|
+
* ```
|
|
80
238
|
*/
|
|
81
|
-
provision(
|
|
82
|
-
|
|
239
|
+
provision(params, options) {
|
|
240
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
241
|
+
return this._client.post('/api/v1/subscriptions', {
|
|
242
|
+
body,
|
|
243
|
+
...options,
|
|
244
|
+
headers: buildHeaders([
|
|
245
|
+
{
|
|
246
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
247
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
248
|
+
},
|
|
249
|
+
options?.headers,
|
|
250
|
+
]),
|
|
251
|
+
});
|
|
83
252
|
}
|
|
84
253
|
/**
|
|
85
254
|
* Transfers a subscription to a different resource ID. Used for multi-resource
|
|
86
255
|
* products where subscriptions apply to specific entities like websites or apps.
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```ts
|
|
259
|
+
* const subscription = await client.v1.subscriptions.transfer(
|
|
260
|
+
* 'x',
|
|
261
|
+
* { destinationResourceId: 'destinationResourceId' },
|
|
262
|
+
* );
|
|
263
|
+
* ```
|
|
87
264
|
*/
|
|
88
|
-
transfer(id,
|
|
89
|
-
|
|
265
|
+
transfer(id, params, options) {
|
|
266
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
267
|
+
return this._client.post(path `/api/v1/subscriptions/${id}/transfer`, {
|
|
268
|
+
body,
|
|
269
|
+
...options,
|
|
270
|
+
headers: buildHeaders([
|
|
271
|
+
{
|
|
272
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
273
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
274
|
+
},
|
|
275
|
+
options?.headers,
|
|
276
|
+
]),
|
|
277
|
+
});
|
|
90
278
|
}
|
|
91
279
|
}
|
|
92
280
|
Subscriptions.FutureUpdate = FutureUpdateAPIFutureUpdate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.mjs","sourceRoot":"","sources":["../../../src/resources/v1/subscriptions/subscriptions.ts"],"names":[],"mappings":"AAAA,sFAAsF;
|
|
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;IAoSrE,CAAC;IAlSC;;;;;;;;;;OAUG;IACH,QAAQ,CACN,EAAU,EACV,SAAwD,EAAE,EAC1D,OAAwB;QAExB,MAAM,EAAE,cAAc,EAAE,UAAU,EA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C;AACzD,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC;AAC5B,aAAa,CAAC,OAAO,GAAG,OAAO,CAAC"}
|
|
@@ -8,13 +8,26 @@ 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
|
+
* ```
|
|
11
17
|
*/
|
|
12
|
-
chargeUsage(id: string,
|
|
18
|
+
chargeUsage(id: string, params: UsageChargeUsageParams, options?: RequestOptions): APIPromise<UsageChargeUsageResponse>;
|
|
13
19
|
/**
|
|
14
20
|
* Triggers a usage sync for a subscription, reporting current usage to the billing
|
|
15
21
|
* provider.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const response = await client.v1.subscriptions.usage.sync(
|
|
26
|
+
* 'x',
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
16
29
|
*/
|
|
17
|
-
sync(id: string, options?: RequestOptions): APIPromise<UsageSyncResponse>;
|
|
30
|
+
sync(id: string, params?: UsageSyncParams | null | undefined, options?: RequestOptions): APIPromise<UsageSyncResponse>;
|
|
18
31
|
}
|
|
19
32
|
/**
|
|
20
33
|
* Response object
|
|
@@ -91,11 +104,36 @@ export declare namespace UsageSyncResponse {
|
|
|
91
104
|
}
|
|
92
105
|
export interface UsageChargeUsageParams {
|
|
93
106
|
/**
|
|
94
|
-
* Cutoff date for usage calculation. If not provided, the current time
|
|
107
|
+
* Body param: Cutoff date for usage calculation. If not provided, the current time
|
|
108
|
+
* is used.
|
|
95
109
|
*/
|
|
96
110
|
untilDate?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
113
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
114
|
+
*/
|
|
115
|
+
'X-ACCOUNT-ID'?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
118
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
119
|
+
* intrinsic to the key).
|
|
120
|
+
*/
|
|
121
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
122
|
+
}
|
|
123
|
+
export interface UsageSyncParams {
|
|
124
|
+
/**
|
|
125
|
+
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
126
|
+
* back to the user's first membership. Ignored for API-key auth.
|
|
127
|
+
*/
|
|
128
|
+
'X-ACCOUNT-ID'?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
131
|
+
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
132
|
+
* key).
|
|
133
|
+
*/
|
|
134
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
97
135
|
}
|
|
98
136
|
export declare namespace Usage {
|
|
99
|
-
export { type UsageChargeUsageResponse as UsageChargeUsageResponse, type UsageSyncResponse as UsageSyncResponse, type UsageChargeUsageParams as UsageChargeUsageParams, };
|
|
137
|
+
export { type UsageChargeUsageResponse as UsageChargeUsageResponse, type UsageSyncResponse as UsageSyncResponse, type UsageChargeUsageParams as UsageChargeUsageParams, type UsageSyncParams as UsageSyncParams, };
|
|
100
138
|
}
|
|
101
139
|
//# sourceMappingURL=usage.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/subscriptions/usage.ts"],"names":[],"mappings":"
|
|
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,sCAAk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AAsB;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"}
|
|
@@ -8,13 +8,26 @@ 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
|
+
* ```
|
|
11
17
|
*/
|
|
12
|
-
chargeUsage(id: string,
|
|
18
|
+
chargeUsage(id: string, params: UsageChargeUsageParams, options?: RequestOptions): APIPromise<UsageChargeUsageResponse>;
|
|
13
19
|
/**
|
|
14
20
|
* Triggers a usage sync for a subscription, reporting current usage to the billing
|
|
15
21
|
* provider.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const response = await client.v1.subscriptions.usage.sync(
|
|
26
|
+
* 'x',
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
16
29
|
*/
|
|
17
|
-
sync(id: string, options?: RequestOptions): APIPromise<UsageSyncResponse>;
|
|
30
|
+
sync(id: string, params?: UsageSyncParams | null | undefined, options?: RequestOptions): APIPromise<UsageSyncResponse>;
|
|
18
31
|
}
|
|
19
32
|
/**
|
|
20
33
|
* Response object
|
|
@@ -91,11 +104,36 @@ export declare namespace UsageSyncResponse {
|
|
|
91
104
|
}
|
|
92
105
|
export interface UsageChargeUsageParams {
|
|
93
106
|
/**
|
|
94
|
-
* Cutoff date for usage calculation. If not provided, the current time
|
|
107
|
+
* Body param: Cutoff date for usage calculation. If not provided, the current time
|
|
108
|
+
* is used.
|
|
95
109
|
*/
|
|
96
110
|
untilDate?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
113
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
114
|
+
*/
|
|
115
|
+
'X-ACCOUNT-ID'?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
118
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
119
|
+
* intrinsic to the key).
|
|
120
|
+
*/
|
|
121
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
122
|
+
}
|
|
123
|
+
export interface UsageSyncParams {
|
|
124
|
+
/**
|
|
125
|
+
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
126
|
+
* back to the user's first membership. Ignored for API-key auth.
|
|
127
|
+
*/
|
|
128
|
+
'X-ACCOUNT-ID'?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
131
|
+
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
132
|
+
* key).
|
|
133
|
+
*/
|
|
134
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
97
135
|
}
|
|
98
136
|
export declare namespace Usage {
|
|
99
|
-
export { type UsageChargeUsageResponse as UsageChargeUsageResponse, type UsageSyncResponse as UsageSyncResponse, type UsageChargeUsageParams as UsageChargeUsageParams, };
|
|
137
|
+
export { type UsageChargeUsageResponse as UsageChargeUsageResponse, type UsageSyncResponse as UsageSyncResponse, type UsageChargeUsageParams as UsageChargeUsageParams, type UsageSyncParams as UsageSyncParams, };
|
|
100
138
|
}
|
|
101
139
|
//# sourceMappingURL=usage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/subscriptions/usage.ts"],"names":[],"mappings":"
|
|
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;;;;;;;;;OASG;IACH,WAAW,CACT,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,sBAAsB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;IAevC;;;;;;;;;;OAUG;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,16 +12,50 @@ 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.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const response =
|
|
19
|
+
* await client.v1.subscriptions.usage.chargeUsage('x');
|
|
20
|
+
* ```
|
|
14
21
|
*/
|
|
15
|
-
chargeUsage(id,
|
|
16
|
-
|
|
22
|
+
chargeUsage(id, params, options) {
|
|
23
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
24
|
+
return this._client.post((0, path_1.path) `/api/v1/subscriptions/${id}/usage/charge`, {
|
|
25
|
+
body,
|
|
26
|
+
...options,
|
|
27
|
+
headers: (0, headers_1.buildHeaders)([
|
|
28
|
+
{
|
|
29
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
30
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
31
|
+
},
|
|
32
|
+
options?.headers,
|
|
33
|
+
]),
|
|
34
|
+
});
|
|
17
35
|
}
|
|
18
36
|
/**
|
|
19
37
|
* Triggers a usage sync for a subscription, reporting current usage to the billing
|
|
20
38
|
* provider.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const response = await client.v1.subscriptions.usage.sync(
|
|
43
|
+
* 'x',
|
|
44
|
+
* );
|
|
45
|
+
* ```
|
|
21
46
|
*/
|
|
22
|
-
sync(id, options) {
|
|
23
|
-
|
|
47
|
+
sync(id, params = {}, options) {
|
|
48
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
|
|
49
|
+
return this._client.post((0, path_1.path) `/api/v1/subscriptions/${id}/usage/sync`, {
|
|
50
|
+
...options,
|
|
51
|
+
headers: (0, headers_1.buildHeaders)([
|
|
52
|
+
{
|
|
53
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
54
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
55
|
+
},
|
|
56
|
+
options?.headers,
|
|
57
|
+
]),
|
|
58
|
+
});
|
|
24
59
|
}
|
|
25
60
|
}
|
|
26
61
|
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;;;;;;;;;OASG;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;;;;;;;;;;OAUG;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;AA1DD,sBA0DC"}
|
|
@@ -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,16 +9,50 @@ 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.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const response =
|
|
16
|
+
* await client.v1.subscriptions.usage.chargeUsage('x');
|
|
17
|
+
* ```
|
|
11
18
|
*/
|
|
12
|
-
chargeUsage(id,
|
|
13
|
-
|
|
19
|
+
chargeUsage(id, params, options) {
|
|
20
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
21
|
+
return this._client.post(path `/api/v1/subscriptions/${id}/usage/charge`, {
|
|
22
|
+
body,
|
|
23
|
+
...options,
|
|
24
|
+
headers: buildHeaders([
|
|
25
|
+
{
|
|
26
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
27
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
28
|
+
},
|
|
29
|
+
options?.headers,
|
|
30
|
+
]),
|
|
31
|
+
});
|
|
14
32
|
}
|
|
15
33
|
/**
|
|
16
34
|
* Triggers a usage sync for a subscription, reporting current usage to the billing
|
|
17
35
|
* provider.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const response = await client.v1.subscriptions.usage.sync(
|
|
40
|
+
* 'x',
|
|
41
|
+
* );
|
|
42
|
+
* ```
|
|
18
43
|
*/
|
|
19
|
-
sync(id, options) {
|
|
20
|
-
|
|
44
|
+
sync(id, params = {}, options) {
|
|
45
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
|
|
46
|
+
return this._client.post(path `/api/v1/subscriptions/${id}/usage/sync`, {
|
|
47
|
+
...options,
|
|
48
|
+
headers: buildHeaders([
|
|
49
|
+
{
|
|
50
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
51
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
52
|
+
},
|
|
53
|
+
options?.headers,
|
|
54
|
+
]),
|
|
55
|
+
});
|
|
21
56
|
}
|
|
22
57
|
}
|
|
23
58
|
//# sourceMappingURL=usage.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.mjs","sourceRoot":"","sources":["../../../src/resources/v1/subscriptions/usage.ts"],"names":[],"mappings":"AAAA,sFAAsF;
|
|
1
|
+
{"version":3,"file":"usage.mjs","sourceRoot":"","sources":["../../../src/resources/v1/subscriptions/usage.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAErD,OAAO,EAAE,YAAY,EAAE,sCAAkC;AAEzD,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;OASG;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,IAAI,CAAA,yBAAyB,EAAE,eAAe,EAAE;YACvE,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;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;;;;;;;;;;OAUG;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,IAAI,CAAA,yBAAyB,EAAE,aAAa,EAAE;YACrE,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.d.mts","sourceRoot":"","sources":["../../src/resources/v1/subscriptions.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"subscriptions.d.mts","sourceRoot":"","sources":["../../src/resources/v1/subscriptions.ts"],"names":[],"mappings":"AAEA,0CAAsC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/resources/v1/subscriptions.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/resources/v1/subscriptions.ts"],"names":[],"mappings":"AAEA,yCAAsC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.mjs","sourceRoot":"","sources":["../../src/resources/v1/subscriptions.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
|
1
|
+
{"version":3,"file":"subscriptions.mjs","sourceRoot":"","sources":["../../src/resources/v1/subscriptions.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,0CAAsC"}
|