@stigg/typescript 0.1.0-alpha.2 → 0.1.0-alpha.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 +270 -0
- package/README.md +9 -0
- package/client.d.mts +7 -9
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -9
- package/client.d.ts.map +1 -1
- package/client.js +29 -26
- package/client.js.map +1 -1
- package/client.mjs +30 -27
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/tslib.js +17 -17
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +12 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/v1/addons/addons.d.mts +1305 -0
- package/resources/v1/addons/addons.d.mts.map +1 -0
- package/resources/v1/addons/addons.d.ts +1305 -0
- package/resources/v1/addons/addons.d.ts.map +1 -0
- package/resources/v1/addons/addons.js +81 -0
- package/resources/v1/addons/addons.js.map +1 -0
- package/resources/v1/addons/addons.mjs +76 -0
- package/resources/v1/addons/addons.mjs.map +1 -0
- package/resources/v1/addons/entitlements.d.mts +860 -0
- package/resources/v1/addons/entitlements.d.mts.map +1 -0
- package/resources/v1/addons/entitlements.d.ts +860 -0
- package/resources/v1/addons/entitlements.d.ts.map +1 -0
- package/resources/v1/addons/entitlements.js +36 -0
- package/resources/v1/addons/entitlements.js.map +1 -0
- package/resources/v1/addons/entitlements.mjs +32 -0
- package/resources/v1/addons/entitlements.mjs.map +1 -0
- package/resources/v1/addons/index.d.mts +3 -0
- package/resources/v1/addons/index.d.mts.map +1 -0
- package/resources/v1/addons/index.d.ts +3 -0
- package/resources/v1/addons/index.d.ts.map +1 -0
- package/resources/v1/addons/index.js +9 -0
- package/resources/v1/addons/index.js.map +1 -0
- package/resources/v1/addons/index.mjs +4 -0
- package/resources/v1/addons/index.mjs.map +1 -0
- package/resources/v1/addons.d.mts +2 -0
- package/resources/v1/addons.d.mts.map +1 -0
- package/resources/v1/addons.d.ts +2 -0
- package/resources/v1/addons.d.ts.map +1 -0
- package/resources/v1/addons.js +6 -0
- package/resources/v1/addons.js.map +1 -0
- package/resources/v1/addons.mjs +3 -0
- package/resources/v1/addons.mjs.map +1 -0
- package/resources/v1/coupons.d.mts +113 -82
- package/resources/v1/coupons.d.mts.map +1 -1
- package/resources/v1/coupons.d.ts +113 -82
- package/resources/v1/coupons.d.ts.map +1 -1
- package/resources/v1/coupons.js +19 -3
- package/resources/v1/coupons.js.map +1 -1
- package/resources/v1/coupons.mjs +19 -3
- package/resources/v1/coupons.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +221 -45
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +221 -45
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +32 -15
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +32 -15
- 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 +3 -3
- 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/payment-method.d.mts +10 -2
- package/resources/v1/customers/payment-method.d.mts.map +1 -1
- package/resources/v1/customers/payment-method.d.ts +10 -2
- package/resources/v1/customers/payment-method.d.ts.map +1 -1
- package/resources/v1/customers/payment-method.js +7 -2
- package/resources/v1/customers/payment-method.js.map +1 -1
- package/resources/v1/customers/payment-method.mjs +7 -2
- package/resources/v1/customers/payment-method.mjs.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.mts +501 -0
- package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -0
- package/resources/v1/customers/promotional-entitlements.d.ts +501 -0
- package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -0
- package/resources/v1/customers/promotional-entitlements.js +35 -0
- package/resources/v1/customers/promotional-entitlements.js.map +1 -0
- package/resources/v1/customers/promotional-entitlements.mjs +31 -0
- package/resources/v1/customers/promotional-entitlements.mjs.map +1 -0
- package/resources/v1/events/credits/credits.d.mts +260 -0
- package/resources/v1/events/credits/credits.d.mts.map +1 -0
- package/resources/v1/events/credits/credits.d.ts +260 -0
- package/resources/v1/events/credits/credits.d.ts.map +1 -0
- package/resources/v1/events/credits/credits.js +41 -0
- package/resources/v1/events/credits/credits.js.map +1 -0
- package/resources/v1/events/credits/credits.mjs +36 -0
- package/resources/v1/events/credits/credits.mjs.map +1 -0
- package/resources/v1/events/credits/grants.d.mts +549 -0
- package/resources/v1/events/credits/grants.d.mts.map +1 -0
- package/resources/v1/events/credits/grants.d.ts +549 -0
- package/resources/v1/events/credits/grants.d.ts.map +1 -0
- package/resources/v1/events/credits/grants.js +37 -0
- package/resources/v1/events/credits/grants.js.map +1 -0
- package/resources/v1/events/credits/grants.mjs +33 -0
- package/resources/v1/events/credits/grants.mjs.map +1 -0
- package/resources/v1/events/credits/index.d.mts +3 -0
- package/resources/v1/events/credits/index.d.mts.map +1 -0
- package/resources/v1/events/credits/index.d.ts +3 -0
- package/resources/v1/events/credits/index.d.ts.map +1 -0
- package/resources/v1/events/credits/index.js +9 -0
- package/resources/v1/events/credits/index.js.map +1 -0
- package/resources/v1/events/credits/index.mjs +4 -0
- package/resources/v1/events/credits/index.mjs.map +1 -0
- package/resources/v1/events/credits.d.mts +2 -0
- package/resources/v1/events/credits.d.mts.map +1 -0
- package/resources/v1/events/credits.d.ts +2 -0
- package/resources/v1/events/credits.d.ts.map +1 -0
- package/resources/v1/events/credits.js +6 -0
- package/resources/v1/events/credits.js.map +1 -0
- package/resources/v1/events/credits.mjs +3 -0
- package/resources/v1/events/credits.mjs.map +1 -0
- package/resources/v1/events/events.d.mts +70 -0
- package/resources/v1/events/events.d.mts.map +1 -0
- package/resources/v1/events/events.d.ts +70 -0
- package/resources/v1/events/events.d.ts.map +1 -0
- package/resources/v1/events/events.js +27 -0
- package/resources/v1/events/events.js.map +1 -0
- package/resources/v1/events/events.mjs +22 -0
- package/resources/v1/events/events.mjs.map +1 -0
- package/resources/v1/events/index.d.mts +3 -0
- package/resources/v1/events/index.d.mts.map +1 -0
- package/resources/v1/events/index.d.ts +3 -0
- package/resources/v1/events/index.d.ts.map +1 -0
- package/resources/v1/events/index.js +9 -0
- package/resources/v1/events/index.js.map +1 -0
- package/resources/v1/events/index.mjs +4 -0
- package/resources/v1/events/index.mjs.map +1 -0
- package/resources/v1/events.d.mts +2 -0
- package/resources/v1/events.d.mts.map +1 -0
- package/resources/v1/events.d.ts +2 -0
- package/resources/v1/events.d.ts.map +1 -0
- package/resources/v1/events.js +6 -0
- package/resources/v1/events.js.map +1 -0
- package/resources/v1/events.mjs +3 -0
- package/resources/v1/events.mjs.map +1 -0
- package/resources/v1/features.d.mts +447 -0
- package/resources/v1/features.d.mts.map +1 -0
- package/resources/v1/features.d.ts +447 -0
- package/resources/v1/features.d.ts.map +1 -0
- package/resources/v1/features.js +54 -0
- package/resources/v1/features.js.map +1 -0
- package/resources/v1/features.mjs +50 -0
- package/resources/v1/features.mjs.map +1 -0
- package/resources/v1/index.d.mts +10 -4
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +10 -4
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +17 -5
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +7 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/plans/entitlements.d.mts +860 -0
- package/resources/v1/plans/entitlements.d.mts.map +1 -0
- package/resources/v1/plans/entitlements.d.ts +860 -0
- package/resources/v1/plans/entitlements.d.ts.map +1 -0
- package/resources/v1/plans/entitlements.js +36 -0
- package/resources/v1/plans/entitlements.js.map +1 -0
- package/resources/v1/plans/entitlements.mjs +32 -0
- package/resources/v1/plans/entitlements.mjs.map +1 -0
- package/resources/v1/plans/index.d.mts +3 -0
- package/resources/v1/plans/index.d.mts.map +1 -0
- package/resources/v1/plans/index.d.ts +3 -0
- package/resources/v1/plans/index.d.ts.map +1 -0
- package/resources/v1/plans/index.js +9 -0
- package/resources/v1/plans/index.js.map +1 -0
- package/resources/v1/plans/index.mjs +4 -0
- package/resources/v1/plans/index.mjs.map +1 -0
- package/resources/v1/plans/plans.d.mts +976 -0
- package/resources/v1/plans/plans.d.mts.map +1 -0
- package/resources/v1/plans/plans.d.ts +976 -0
- package/resources/v1/plans/plans.d.ts.map +1 -0
- package/resources/v1/plans/plans.js +79 -0
- package/resources/v1/plans/plans.js.map +1 -0
- package/resources/v1/plans/plans.mjs +74 -0
- package/resources/v1/plans/plans.mjs.map +1 -0
- package/resources/v1/plans.d.mts +2 -0
- package/resources/v1/plans.d.mts.map +1 -0
- package/resources/v1/plans.d.ts +2 -0
- package/resources/v1/plans.d.ts.map +1 -0
- package/resources/v1/plans.js +6 -0
- package/resources/v1/plans.js.map +1 -0
- package/resources/v1/plans.mjs +3 -0
- package/resources/v1/plans.mjs.map +1 -0
- package/resources/v1/products.d.mts +335 -0
- package/resources/v1/products.d.mts.map +1 -0
- package/resources/v1/products.d.ts +335 -0
- package/resources/v1/products.d.ts.map +1 -0
- package/resources/v1/products.js +55 -0
- package/resources/v1/products.js.map +1 -0
- package/resources/v1/products.mjs +51 -0
- package/resources/v1/products.mjs.map +1 -0
- package/resources/v1/subscriptions/future-update.d.mts +15 -19
- package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
- package/resources/v1/subscriptions/future-update.d.ts +15 -19
- package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
- package/resources/v1/subscriptions/future-update.js +6 -2
- package/resources/v1/subscriptions/future-update.js.map +1 -1
- package/resources/v1/subscriptions/future-update.mjs +6 -2
- package/resources/v1/subscriptions/future-update.mjs.map +1 -1
- package/resources/v1/subscriptions/index.d.mts +4 -2
- package/resources/v1/subscriptions/index.d.mts.map +1 -1
- package/resources/v1/subscriptions/index.d.ts +4 -2
- package/resources/v1/subscriptions/index.d.ts.map +1 -1
- package/resources/v1/subscriptions/index.js +5 -1
- package/resources/v1/subscriptions/index.js.map +1 -1
- package/resources/v1/subscriptions/index.mjs +3 -1
- package/resources/v1/subscriptions/index.mjs.map +1 -1
- package/resources/v1/subscriptions/invoice.d.mts +37 -0
- package/resources/v1/subscriptions/invoice.d.mts.map +1 -0
- package/resources/v1/subscriptions/invoice.d.ts +37 -0
- package/resources/v1/subscriptions/invoice.d.ts.map +1 -0
- package/resources/v1/subscriptions/invoice.js +20 -0
- package/resources/v1/subscriptions/invoice.js.map +1 -0
- package/resources/v1/subscriptions/invoice.mjs +16 -0
- package/resources/v1/subscriptions/invoice.mjs.map +1 -0
- package/resources/v1/subscriptions/subscriptions.d.mts +2547 -561
- package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.ts +2547 -561
- package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.js +47 -11
- package/resources/v1/subscriptions/subscriptions.js.map +1 -1
- package/resources/v1/subscriptions/subscriptions.mjs +49 -13
- package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
- package/resources/v1/subscriptions/usage.d.mts +101 -0
- package/resources/v1/subscriptions/usage.d.mts.map +1 -0
- package/resources/v1/subscriptions/usage.d.ts +101 -0
- package/resources/v1/subscriptions/usage.d.ts.map +1 -0
- package/resources/v1/subscriptions/usage.js +27 -0
- package/resources/v1/subscriptions/usage.js.map +1 -0
- package/resources/v1/subscriptions/usage.mjs +23 -0
- package/resources/v1/subscriptions/usage.mjs.map +1 -0
- package/resources/v1/usage.d.mts +238 -0
- package/resources/v1/usage.d.mts.map +1 -0
- package/resources/v1/usage.d.ts +238 -0
- package/resources/v1/usage.d.ts.map +1 -0
- package/resources/v1/usage.js +27 -0
- package/resources/v1/usage.js.map +1 -0
- package/resources/v1/usage.mjs +23 -0
- package/resources/v1/usage.mjs.map +1 -0
- package/resources/v1/v1.d.mts +30 -149
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +30 -149
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +24 -12
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +24 -12
- package/resources/v1/v1.mjs.map +1 -1
- package/src/client.ts +41 -47
- package/src/internal/parse.ts +6 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/utils/query.ts +7 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/index.ts +1 -7
- package/src/resources/v1/addons/addons.ts +3253 -0
- package/src/resources/v1/addons/entitlements.ts +1120 -0
- package/src/resources/v1/addons/index.ts +26 -0
- package/src/resources/v1/addons.ts +3 -0
- package/src/resources/v1/coupons.ts +126 -216
- package/src/resources/v1/customers/customers.ts +296 -61
- package/src/resources/v1/customers/index.ts +16 -2
- package/src/resources/v1/customers/payment-method.ts +10 -2
- package/src/resources/v1/customers/promotional-entitlements.ts +672 -0
- package/src/resources/v1/events/credits/credits.ts +356 -0
- package/src/resources/v1/events/credits/grants.ts +795 -0
- package/src/resources/v1/events/credits/index.ts +20 -0
- package/src/resources/v1/events/credits.ts +3 -0
- package/src/resources/v1/events/events.ts +103 -0
- package/src/resources/v1/events/index.ts +13 -0
- package/src/resources/v1/events.ts +3 -0
- package/src/resources/v1/features.ts +574 -0
- package/src/resources/v1/index.ts +70 -15
- package/src/resources/v1/plans/entitlements.ts +1112 -0
- package/src/resources/v1/plans/index.ts +24 -0
- package/src/resources/v1/plans/plans.ts +2035 -0
- package/src/resources/v1/plans.ts +3 -0
- package/src/resources/v1/products.ts +426 -0
- package/src/resources/v1/subscriptions/future-update.ts +15 -27
- package/src/resources/v1/subscriptions/index.ts +15 -11
- package/src/resources/v1/subscriptions/invoice.ts +45 -0
- package/src/resources/v1/subscriptions/subscriptions.ts +5836 -777
- package/src/resources/v1/subscriptions/usage.ts +129 -0
- package/src/resources/v1/usage.ts +293 -0
- package/src/resources/v1/v1.ts +168 -197
- package/src/version.ts +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/customers/usage.d.mts +0 -98
- package/resources/v1/customers/usage.d.mts.map +0 -1
- package/resources/v1/customers/usage.d.ts +0 -98
- package/resources/v1/customers/usage.d.ts.map +0 -1
- package/resources/v1/customers/usage.js +0 -20
- package/resources/v1/customers/usage.js.map +0 -1
- package/resources/v1/customers/usage.mjs +0 -16
- package/resources/v1/customers/usage.mjs.map +0 -1
- package/src/resources/v1/customers/usage.ts +0 -132
|
@@ -0,0 +1,1112 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
6
|
+
import { path } from '../../../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class Entitlements extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Creates one or more entitlements (feature or credit) on a draft plan.
|
|
11
|
+
*/
|
|
12
|
+
create(
|
|
13
|
+
planID: string,
|
|
14
|
+
body: EntitlementCreateParams,
|
|
15
|
+
options?: RequestOptions,
|
|
16
|
+
): APIPromise<EntitlementCreateResponse> {
|
|
17
|
+
return this._client.post(path`/api/v1/plans/${planID}/entitlements`, { body, ...options });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Updates an existing entitlement on a draft plan.
|
|
22
|
+
*/
|
|
23
|
+
update(id: string, params: EntitlementUpdateParams, options?: RequestOptions): APIPromise<PlanEntitlement> {
|
|
24
|
+
const { planId, ...body } = params;
|
|
25
|
+
return this._client.patch(path`/api/v1/plans/${planId}/entitlements/${id}`, { body, ...options });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves a list of entitlements for a plan.
|
|
30
|
+
*/
|
|
31
|
+
list(planID: string, options?: RequestOptions): APIPromise<EntitlementListResponse> {
|
|
32
|
+
return this._client.get(path`/api/v1/plans/${planID}/entitlements`, options);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Deletes an entitlement from a draft plan.
|
|
37
|
+
*/
|
|
38
|
+
delete(id: string, params: EntitlementDeleteParams, options?: RequestOptions): APIPromise<PlanEntitlement> {
|
|
39
|
+
const { planId } = params;
|
|
40
|
+
return this._client.delete(path`/api/v1/plans/${planId}/entitlements/${id}`, options);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Response object
|
|
46
|
+
*/
|
|
47
|
+
export interface PlanEntitlement {
|
|
48
|
+
/**
|
|
49
|
+
* Feature entitlement response
|
|
50
|
+
*/
|
|
51
|
+
data: PlanEntitlement.Feature | PlanEntitlement.Credit;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export namespace PlanEntitlement {
|
|
55
|
+
/**
|
|
56
|
+
* Feature entitlement response
|
|
57
|
+
*/
|
|
58
|
+
export interface Feature {
|
|
59
|
+
/**
|
|
60
|
+
* Unique identifier of the entitlement
|
|
61
|
+
*/
|
|
62
|
+
id: string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Entitlement behavior (Increment or Override)
|
|
66
|
+
*/
|
|
67
|
+
behavior: 'Increment' | 'Override';
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Timestamp of when the record was created
|
|
71
|
+
*/
|
|
72
|
+
createdAt: string;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Optional description of the entitlement
|
|
76
|
+
*/
|
|
77
|
+
description: string | null;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Override display name for the entitlement
|
|
81
|
+
*/
|
|
82
|
+
displayNameOverride: string | null;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Allowed enum values (for feature entitlements)
|
|
86
|
+
*/
|
|
87
|
+
enumValues: Array<string> | null;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Whether the usage limit is a soft limit (for feature entitlements)
|
|
91
|
+
*/
|
|
92
|
+
hasSoftLimit: boolean | null;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Whether usage is unlimited (for feature entitlements)
|
|
96
|
+
*/
|
|
97
|
+
hasUnlimitedUsage: boolean | null;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Widget types where this entitlement is hidden
|
|
101
|
+
*/
|
|
102
|
+
hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Whether this is a custom entitlement
|
|
106
|
+
*/
|
|
107
|
+
isCustom: boolean | null;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Whether the entitlement is granted
|
|
111
|
+
*/
|
|
112
|
+
isGranted: boolean;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Display order of the entitlement
|
|
116
|
+
*/
|
|
117
|
+
order: number | null;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Usage reset period (for feature entitlements)
|
|
121
|
+
*/
|
|
122
|
+
resetPeriod: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | null;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Reset period configuration (for feature entitlements)
|
|
126
|
+
*/
|
|
127
|
+
resetPeriodConfiguration:
|
|
128
|
+
| Feature.YearlyResetPeriodConfig
|
|
129
|
+
| Feature.MonthlyResetPeriodConfig
|
|
130
|
+
| Feature.WeeklyResetPeriodConfig
|
|
131
|
+
| null;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Entitlement type (FEATURE or CREDIT)
|
|
135
|
+
*/
|
|
136
|
+
type: 'FEATURE';
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Timestamp of when the record was last updated
|
|
140
|
+
*/
|
|
141
|
+
updatedAt: string;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Usage limit (for feature entitlements)
|
|
145
|
+
*/
|
|
146
|
+
usageLimit: number | null;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export namespace Feature {
|
|
150
|
+
/**
|
|
151
|
+
* Yearly reset configuration
|
|
152
|
+
*/
|
|
153
|
+
export interface YearlyResetPeriodConfig {
|
|
154
|
+
/**
|
|
155
|
+
* Reset anchor (SubscriptionStart)
|
|
156
|
+
*/
|
|
157
|
+
accordingTo: 'SubscriptionStart';
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Monthly reset configuration
|
|
162
|
+
*/
|
|
163
|
+
export interface MonthlyResetPeriodConfig {
|
|
164
|
+
/**
|
|
165
|
+
* Reset anchor (SubscriptionStart or StartOfTheMonth)
|
|
166
|
+
*/
|
|
167
|
+
accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Weekly reset configuration
|
|
172
|
+
*/
|
|
173
|
+
export interface WeeklyResetPeriodConfig {
|
|
174
|
+
/**
|
|
175
|
+
* Reset anchor (SubscriptionStart or specific day)
|
|
176
|
+
*/
|
|
177
|
+
accordingTo:
|
|
178
|
+
| 'SubscriptionStart'
|
|
179
|
+
| 'EverySunday'
|
|
180
|
+
| 'EveryMonday'
|
|
181
|
+
| 'EveryTuesday'
|
|
182
|
+
| 'EveryWednesday'
|
|
183
|
+
| 'EveryThursday'
|
|
184
|
+
| 'EveryFriday'
|
|
185
|
+
| 'EverySaturday';
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Credit entitlement response
|
|
191
|
+
*/
|
|
192
|
+
export interface Credit {
|
|
193
|
+
/**
|
|
194
|
+
* Unique identifier of the entitlement
|
|
195
|
+
*/
|
|
196
|
+
id: string;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Credit amount (for credit entitlements)
|
|
200
|
+
*/
|
|
201
|
+
amount: number | null;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Entitlement behavior (Increment or Override)
|
|
205
|
+
*/
|
|
206
|
+
behavior: 'Increment' | 'Override';
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Credit grant cadence (for credit entitlements)
|
|
210
|
+
*/
|
|
211
|
+
cadence: 'MONTH' | 'YEAR' | null;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Timestamp of when the record was created
|
|
215
|
+
*/
|
|
216
|
+
createdAt: string;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Optional description of the entitlement
|
|
220
|
+
*/
|
|
221
|
+
description: string | null;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Override display name for the entitlement
|
|
225
|
+
*/
|
|
226
|
+
displayNameOverride: string | null;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Widget types where this entitlement is hidden
|
|
230
|
+
*/
|
|
231
|
+
hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Whether this is a custom entitlement
|
|
235
|
+
*/
|
|
236
|
+
isCustom: boolean | null;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Whether the entitlement is granted
|
|
240
|
+
*/
|
|
241
|
+
isGranted: boolean;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Display order of the entitlement
|
|
245
|
+
*/
|
|
246
|
+
order: number | null;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Entitlement type (FEATURE or CREDIT)
|
|
250
|
+
*/
|
|
251
|
+
type: 'CREDIT';
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Timestamp of when the record was last updated
|
|
255
|
+
*/
|
|
256
|
+
updatedAt: string;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Response object
|
|
262
|
+
*/
|
|
263
|
+
export interface EntitlementCreateResponse {
|
|
264
|
+
data: Array<EntitlementCreateResponse.Feature | EntitlementCreateResponse.Credit>;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export namespace EntitlementCreateResponse {
|
|
268
|
+
/**
|
|
269
|
+
* Feature entitlement response
|
|
270
|
+
*/
|
|
271
|
+
export interface Feature {
|
|
272
|
+
/**
|
|
273
|
+
* Unique identifier of the entitlement
|
|
274
|
+
*/
|
|
275
|
+
id: string;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Entitlement behavior (Increment or Override)
|
|
279
|
+
*/
|
|
280
|
+
behavior: 'Increment' | 'Override';
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Timestamp of when the record was created
|
|
284
|
+
*/
|
|
285
|
+
createdAt: string;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Optional description of the entitlement
|
|
289
|
+
*/
|
|
290
|
+
description: string | null;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Override display name for the entitlement
|
|
294
|
+
*/
|
|
295
|
+
displayNameOverride: string | null;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Allowed enum values (for feature entitlements)
|
|
299
|
+
*/
|
|
300
|
+
enumValues: Array<string> | null;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Whether the usage limit is a soft limit (for feature entitlements)
|
|
304
|
+
*/
|
|
305
|
+
hasSoftLimit: boolean | null;
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Whether usage is unlimited (for feature entitlements)
|
|
309
|
+
*/
|
|
310
|
+
hasUnlimitedUsage: boolean | null;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Widget types where this entitlement is hidden
|
|
314
|
+
*/
|
|
315
|
+
hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Whether this is a custom entitlement
|
|
319
|
+
*/
|
|
320
|
+
isCustom: boolean | null;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Whether the entitlement is granted
|
|
324
|
+
*/
|
|
325
|
+
isGranted: boolean;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Display order of the entitlement
|
|
329
|
+
*/
|
|
330
|
+
order: number | null;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Usage reset period (for feature entitlements)
|
|
334
|
+
*/
|
|
335
|
+
resetPeriod: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | null;
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Reset period configuration (for feature entitlements)
|
|
339
|
+
*/
|
|
340
|
+
resetPeriodConfiguration:
|
|
341
|
+
| Feature.YearlyResetPeriodConfig
|
|
342
|
+
| Feature.MonthlyResetPeriodConfig
|
|
343
|
+
| Feature.WeeklyResetPeriodConfig
|
|
344
|
+
| null;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Entitlement type (FEATURE or CREDIT)
|
|
348
|
+
*/
|
|
349
|
+
type: 'FEATURE';
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Timestamp of when the record was last updated
|
|
353
|
+
*/
|
|
354
|
+
updatedAt: string;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Usage limit (for feature entitlements)
|
|
358
|
+
*/
|
|
359
|
+
usageLimit: number | null;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export namespace Feature {
|
|
363
|
+
/**
|
|
364
|
+
* Yearly reset configuration
|
|
365
|
+
*/
|
|
366
|
+
export interface YearlyResetPeriodConfig {
|
|
367
|
+
/**
|
|
368
|
+
* Reset anchor (SubscriptionStart)
|
|
369
|
+
*/
|
|
370
|
+
accordingTo: 'SubscriptionStart';
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Monthly reset configuration
|
|
375
|
+
*/
|
|
376
|
+
export interface MonthlyResetPeriodConfig {
|
|
377
|
+
/**
|
|
378
|
+
* Reset anchor (SubscriptionStart or StartOfTheMonth)
|
|
379
|
+
*/
|
|
380
|
+
accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Weekly reset configuration
|
|
385
|
+
*/
|
|
386
|
+
export interface WeeklyResetPeriodConfig {
|
|
387
|
+
/**
|
|
388
|
+
* Reset anchor (SubscriptionStart or specific day)
|
|
389
|
+
*/
|
|
390
|
+
accordingTo:
|
|
391
|
+
| 'SubscriptionStart'
|
|
392
|
+
| 'EverySunday'
|
|
393
|
+
| 'EveryMonday'
|
|
394
|
+
| 'EveryTuesday'
|
|
395
|
+
| 'EveryWednesday'
|
|
396
|
+
| 'EveryThursday'
|
|
397
|
+
| 'EveryFriday'
|
|
398
|
+
| 'EverySaturday';
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Credit entitlement response
|
|
404
|
+
*/
|
|
405
|
+
export interface Credit {
|
|
406
|
+
/**
|
|
407
|
+
* Unique identifier of the entitlement
|
|
408
|
+
*/
|
|
409
|
+
id: string;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Credit amount (for credit entitlements)
|
|
413
|
+
*/
|
|
414
|
+
amount: number | null;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Entitlement behavior (Increment or Override)
|
|
418
|
+
*/
|
|
419
|
+
behavior: 'Increment' | 'Override';
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Credit grant cadence (for credit entitlements)
|
|
423
|
+
*/
|
|
424
|
+
cadence: 'MONTH' | 'YEAR' | null;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Timestamp of when the record was created
|
|
428
|
+
*/
|
|
429
|
+
createdAt: string;
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Optional description of the entitlement
|
|
433
|
+
*/
|
|
434
|
+
description: string | null;
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Override display name for the entitlement
|
|
438
|
+
*/
|
|
439
|
+
displayNameOverride: string | null;
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Widget types where this entitlement is hidden
|
|
443
|
+
*/
|
|
444
|
+
hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Whether this is a custom entitlement
|
|
448
|
+
*/
|
|
449
|
+
isCustom: boolean | null;
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Whether the entitlement is granted
|
|
453
|
+
*/
|
|
454
|
+
isGranted: boolean;
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Display order of the entitlement
|
|
458
|
+
*/
|
|
459
|
+
order: number | null;
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Entitlement type (FEATURE or CREDIT)
|
|
463
|
+
*/
|
|
464
|
+
type: 'CREDIT';
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Timestamp of when the record was last updated
|
|
468
|
+
*/
|
|
469
|
+
updatedAt: string;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Response list object
|
|
475
|
+
*/
|
|
476
|
+
export interface EntitlementListResponse {
|
|
477
|
+
data: Array<EntitlementListResponse.Feature | EntitlementListResponse.Credit>;
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Pagination metadata including cursors for navigating through results
|
|
481
|
+
*/
|
|
482
|
+
pagination: EntitlementListResponse.Pagination;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
export namespace EntitlementListResponse {
|
|
486
|
+
/**
|
|
487
|
+
* Feature entitlement response
|
|
488
|
+
*/
|
|
489
|
+
export interface Feature {
|
|
490
|
+
/**
|
|
491
|
+
* Unique identifier of the entitlement
|
|
492
|
+
*/
|
|
493
|
+
id: string;
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Entitlement behavior (Increment or Override)
|
|
497
|
+
*/
|
|
498
|
+
behavior: 'Increment' | 'Override';
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Timestamp of when the record was created
|
|
502
|
+
*/
|
|
503
|
+
createdAt: string;
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Optional description of the entitlement
|
|
507
|
+
*/
|
|
508
|
+
description: string | null;
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Override display name for the entitlement
|
|
512
|
+
*/
|
|
513
|
+
displayNameOverride: string | null;
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Allowed enum values (for feature entitlements)
|
|
517
|
+
*/
|
|
518
|
+
enumValues: Array<string> | null;
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Whether the usage limit is a soft limit (for feature entitlements)
|
|
522
|
+
*/
|
|
523
|
+
hasSoftLimit: boolean | null;
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Whether usage is unlimited (for feature entitlements)
|
|
527
|
+
*/
|
|
528
|
+
hasUnlimitedUsage: boolean | null;
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Widget types where this entitlement is hidden
|
|
532
|
+
*/
|
|
533
|
+
hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Whether this is a custom entitlement
|
|
537
|
+
*/
|
|
538
|
+
isCustom: boolean | null;
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Whether the entitlement is granted
|
|
542
|
+
*/
|
|
543
|
+
isGranted: boolean;
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Display order of the entitlement
|
|
547
|
+
*/
|
|
548
|
+
order: number | null;
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Usage reset period (for feature entitlements)
|
|
552
|
+
*/
|
|
553
|
+
resetPeriod: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | null;
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Reset period configuration (for feature entitlements)
|
|
557
|
+
*/
|
|
558
|
+
resetPeriodConfiguration:
|
|
559
|
+
| Feature.YearlyResetPeriodConfig
|
|
560
|
+
| Feature.MonthlyResetPeriodConfig
|
|
561
|
+
| Feature.WeeklyResetPeriodConfig
|
|
562
|
+
| null;
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Entitlement type (FEATURE or CREDIT)
|
|
566
|
+
*/
|
|
567
|
+
type: 'FEATURE';
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Timestamp of when the record was last updated
|
|
571
|
+
*/
|
|
572
|
+
updatedAt: string;
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Usage limit (for feature entitlements)
|
|
576
|
+
*/
|
|
577
|
+
usageLimit: number | null;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
export namespace Feature {
|
|
581
|
+
/**
|
|
582
|
+
* Yearly reset configuration
|
|
583
|
+
*/
|
|
584
|
+
export interface YearlyResetPeriodConfig {
|
|
585
|
+
/**
|
|
586
|
+
* Reset anchor (SubscriptionStart)
|
|
587
|
+
*/
|
|
588
|
+
accordingTo: 'SubscriptionStart';
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Monthly reset configuration
|
|
593
|
+
*/
|
|
594
|
+
export interface MonthlyResetPeriodConfig {
|
|
595
|
+
/**
|
|
596
|
+
* Reset anchor (SubscriptionStart or StartOfTheMonth)
|
|
597
|
+
*/
|
|
598
|
+
accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Weekly reset configuration
|
|
603
|
+
*/
|
|
604
|
+
export interface WeeklyResetPeriodConfig {
|
|
605
|
+
/**
|
|
606
|
+
* Reset anchor (SubscriptionStart or specific day)
|
|
607
|
+
*/
|
|
608
|
+
accordingTo:
|
|
609
|
+
| 'SubscriptionStart'
|
|
610
|
+
| 'EverySunday'
|
|
611
|
+
| 'EveryMonday'
|
|
612
|
+
| 'EveryTuesday'
|
|
613
|
+
| 'EveryWednesday'
|
|
614
|
+
| 'EveryThursday'
|
|
615
|
+
| 'EveryFriday'
|
|
616
|
+
| 'EverySaturday';
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Credit entitlement response
|
|
622
|
+
*/
|
|
623
|
+
export interface Credit {
|
|
624
|
+
/**
|
|
625
|
+
* Unique identifier of the entitlement
|
|
626
|
+
*/
|
|
627
|
+
id: string;
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* Credit amount (for credit entitlements)
|
|
631
|
+
*/
|
|
632
|
+
amount: number | null;
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Entitlement behavior (Increment or Override)
|
|
636
|
+
*/
|
|
637
|
+
behavior: 'Increment' | 'Override';
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Credit grant cadence (for credit entitlements)
|
|
641
|
+
*/
|
|
642
|
+
cadence: 'MONTH' | 'YEAR' | null;
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* Timestamp of when the record was created
|
|
646
|
+
*/
|
|
647
|
+
createdAt: string;
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Optional description of the entitlement
|
|
651
|
+
*/
|
|
652
|
+
description: string | null;
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Override display name for the entitlement
|
|
656
|
+
*/
|
|
657
|
+
displayNameOverride: string | null;
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Widget types where this entitlement is hidden
|
|
661
|
+
*/
|
|
662
|
+
hiddenFromWidgets: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* Whether this is a custom entitlement
|
|
666
|
+
*/
|
|
667
|
+
isCustom: boolean | null;
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Whether the entitlement is granted
|
|
671
|
+
*/
|
|
672
|
+
isGranted: boolean;
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* Display order of the entitlement
|
|
676
|
+
*/
|
|
677
|
+
order: number | null;
|
|
678
|
+
|
|
679
|
+
/**
|
|
680
|
+
* Entitlement type (FEATURE or CREDIT)
|
|
681
|
+
*/
|
|
682
|
+
type: 'CREDIT';
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Timestamp of when the record was last updated
|
|
686
|
+
*/
|
|
687
|
+
updatedAt: string;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* Pagination metadata including cursors for navigating through results
|
|
692
|
+
*/
|
|
693
|
+
export interface Pagination {
|
|
694
|
+
/**
|
|
695
|
+
* Cursor for fetching the next page of results, or null if no additional pages
|
|
696
|
+
* exist
|
|
697
|
+
*/
|
|
698
|
+
next: string | null;
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* Cursor for fetching the previous page of results, or null if at the beginning
|
|
702
|
+
*/
|
|
703
|
+
prev: string | null;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
export interface EntitlementCreateParams {
|
|
708
|
+
/**
|
|
709
|
+
* Entitlements to create
|
|
710
|
+
*/
|
|
711
|
+
entitlements: Array<EntitlementCreateParams.Feature | EntitlementCreateParams.Credit>;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
export namespace EntitlementCreateParams {
|
|
715
|
+
/**
|
|
716
|
+
* Request to create a feature entitlement
|
|
717
|
+
*/
|
|
718
|
+
export interface Feature {
|
|
719
|
+
/**
|
|
720
|
+
* The feature ID to attach the entitlement to
|
|
721
|
+
*/
|
|
722
|
+
id: string;
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* CreateFeatureEntitlementRequest
|
|
726
|
+
*/
|
|
727
|
+
type: 'FEATURE';
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* Entitlement behavior (Increment or Override)
|
|
731
|
+
*/
|
|
732
|
+
behavior?: 'Increment' | 'Override';
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* Description of the entitlement
|
|
736
|
+
*/
|
|
737
|
+
description?: string;
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* Override display name for the entitlement
|
|
741
|
+
*/
|
|
742
|
+
displayNameOverride?: string;
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* Allowed enum values for the feature entitlement
|
|
746
|
+
*/
|
|
747
|
+
enumValues?: Array<string>;
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Whether the usage limit is a soft limit
|
|
751
|
+
*/
|
|
752
|
+
hasSoftLimit?: boolean;
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* Whether usage is unlimited
|
|
756
|
+
*/
|
|
757
|
+
hasUnlimitedUsage?: boolean;
|
|
758
|
+
|
|
759
|
+
/**
|
|
760
|
+
* Widget types where this entitlement is hidden
|
|
761
|
+
*/
|
|
762
|
+
hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* Whether this is a custom entitlement
|
|
766
|
+
*/
|
|
767
|
+
isCustom?: boolean;
|
|
768
|
+
|
|
769
|
+
/**
|
|
770
|
+
* Whether the entitlement is granted
|
|
771
|
+
*/
|
|
772
|
+
isGranted?: boolean;
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* Configuration for monthly reset period
|
|
776
|
+
*/
|
|
777
|
+
monthlyResetPeriodConfiguration?: Feature.MonthlyResetPeriodConfiguration | null;
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Display order of the entitlement
|
|
781
|
+
*/
|
|
782
|
+
order?: number;
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* Period at which usage resets
|
|
786
|
+
*/
|
|
787
|
+
resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Maximum allowed usage for the feature
|
|
791
|
+
*/
|
|
792
|
+
usageLimit?: number | null;
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
* Configuration for weekly reset period
|
|
796
|
+
*/
|
|
797
|
+
weeklyResetPeriodConfiguration?: Feature.WeeklyResetPeriodConfiguration | null;
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Configuration for yearly reset period
|
|
801
|
+
*/
|
|
802
|
+
yearlyResetPeriodConfiguration?: Feature.YearlyResetPeriodConfiguration | null;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
export namespace Feature {
|
|
806
|
+
/**
|
|
807
|
+
* Configuration for monthly reset period
|
|
808
|
+
*/
|
|
809
|
+
export interface MonthlyResetPeriodConfiguration {
|
|
810
|
+
/**
|
|
811
|
+
* Reset anchor (SubscriptionStart or StartOfTheMonth)
|
|
812
|
+
*/
|
|
813
|
+
accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* Configuration for weekly reset period
|
|
818
|
+
*/
|
|
819
|
+
export interface WeeklyResetPeriodConfiguration {
|
|
820
|
+
/**
|
|
821
|
+
* Reset anchor (SubscriptionStart or specific day)
|
|
822
|
+
*/
|
|
823
|
+
accordingTo:
|
|
824
|
+
| 'SubscriptionStart'
|
|
825
|
+
| 'EverySunday'
|
|
826
|
+
| 'EveryMonday'
|
|
827
|
+
| 'EveryTuesday'
|
|
828
|
+
| 'EveryWednesday'
|
|
829
|
+
| 'EveryThursday'
|
|
830
|
+
| 'EveryFriday'
|
|
831
|
+
| 'EverySaturday';
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Configuration for yearly reset period
|
|
836
|
+
*/
|
|
837
|
+
export interface YearlyResetPeriodConfiguration {
|
|
838
|
+
/**
|
|
839
|
+
* Reset anchor (SubscriptionStart)
|
|
840
|
+
*/
|
|
841
|
+
accordingTo: 'SubscriptionStart';
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* Request to create a credit entitlement
|
|
847
|
+
*/
|
|
848
|
+
export interface Credit {
|
|
849
|
+
/**
|
|
850
|
+
* The custom currency ID for the credit entitlement
|
|
851
|
+
*/
|
|
852
|
+
id: string;
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* Credit grant amount
|
|
856
|
+
*/
|
|
857
|
+
amount: number | null;
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* Credit grant cadence (MONTH or YEAR)
|
|
861
|
+
*/
|
|
862
|
+
cadence: 'MONTH' | 'YEAR';
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* CreateCreditEntitlementRequest
|
|
866
|
+
*/
|
|
867
|
+
type: 'CREDIT';
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* Entitlement behavior (Increment or Override)
|
|
871
|
+
*/
|
|
872
|
+
behavior?: 'Increment' | 'Override';
|
|
873
|
+
|
|
874
|
+
/**
|
|
875
|
+
* Description of the entitlement
|
|
876
|
+
*/
|
|
877
|
+
description?: string;
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* Override display name for the entitlement
|
|
881
|
+
*/
|
|
882
|
+
displayNameOverride?: string;
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Widget types where this entitlement is hidden
|
|
886
|
+
*/
|
|
887
|
+
hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* Whether this is a custom entitlement
|
|
891
|
+
*/
|
|
892
|
+
isCustom?: boolean;
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
* Whether the entitlement is granted
|
|
896
|
+
*/
|
|
897
|
+
isGranted?: boolean;
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* Display order of the entitlement
|
|
901
|
+
*/
|
|
902
|
+
order?: number;
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
export type EntitlementUpdateParams =
|
|
907
|
+
| EntitlementUpdateParams.UpdateFeatureEntitlementRequest
|
|
908
|
+
| EntitlementUpdateParams.UpdateCreditEntitlementRequest;
|
|
909
|
+
|
|
910
|
+
export declare namespace EntitlementUpdateParams {
|
|
911
|
+
export interface UpdateFeatureEntitlementRequest {
|
|
912
|
+
/**
|
|
913
|
+
* Path param: The plan ID
|
|
914
|
+
*/
|
|
915
|
+
planId: string;
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* Body param: UpdateFeatureEntitlementRequest
|
|
919
|
+
*/
|
|
920
|
+
type: 'FEATURE';
|
|
921
|
+
|
|
922
|
+
/**
|
|
923
|
+
* Body param: Entitlement behavior (Increment or Override)
|
|
924
|
+
*/
|
|
925
|
+
behavior?: 'Increment' | 'Override';
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Body param: Description of the entitlement
|
|
929
|
+
*/
|
|
930
|
+
description?: string;
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Body param: Override display name for the entitlement
|
|
934
|
+
*/
|
|
935
|
+
displayNameOverride?: string;
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* Body param: Allowed enum values for the feature entitlement
|
|
939
|
+
*/
|
|
940
|
+
enumValues?: Array<string>;
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* Body param: Whether the usage limit is a soft limit
|
|
944
|
+
*/
|
|
945
|
+
hasSoftLimit?: boolean;
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Body param: Whether usage is unlimited
|
|
949
|
+
*/
|
|
950
|
+
hasUnlimitedUsage?: boolean;
|
|
951
|
+
|
|
952
|
+
/**
|
|
953
|
+
* Body param: Widget types where this entitlement is hidden
|
|
954
|
+
*/
|
|
955
|
+
hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* Body param: Whether this is a custom entitlement
|
|
959
|
+
*/
|
|
960
|
+
isCustom?: boolean;
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* Body param: Whether the entitlement is granted
|
|
964
|
+
*/
|
|
965
|
+
isGranted?: boolean;
|
|
966
|
+
|
|
967
|
+
/**
|
|
968
|
+
* Body param: Configuration for monthly reset period
|
|
969
|
+
*/
|
|
970
|
+
monthlyResetPeriodConfiguration?: UpdateFeatureEntitlementRequest.MonthlyResetPeriodConfiguration | null;
|
|
971
|
+
|
|
972
|
+
/**
|
|
973
|
+
* Body param: Display order of the entitlement
|
|
974
|
+
*/
|
|
975
|
+
order?: number;
|
|
976
|
+
|
|
977
|
+
/**
|
|
978
|
+
* Body param: Period at which usage resets
|
|
979
|
+
*/
|
|
980
|
+
resetPeriod?: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR';
|
|
981
|
+
|
|
982
|
+
/**
|
|
983
|
+
* Body param: Maximum allowed usage for the feature
|
|
984
|
+
*/
|
|
985
|
+
usageLimit?: number | null;
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* Body param: Configuration for weekly reset period
|
|
989
|
+
*/
|
|
990
|
+
weeklyResetPeriodConfiguration?: UpdateFeatureEntitlementRequest.WeeklyResetPeriodConfiguration | null;
|
|
991
|
+
|
|
992
|
+
/**
|
|
993
|
+
* Body param: Configuration for yearly reset period
|
|
994
|
+
*/
|
|
995
|
+
yearlyResetPeriodConfiguration?: UpdateFeatureEntitlementRequest.YearlyResetPeriodConfiguration | null;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
export namespace UpdateFeatureEntitlementRequest {
|
|
999
|
+
/**
|
|
1000
|
+
* Configuration for monthly reset period
|
|
1001
|
+
*/
|
|
1002
|
+
export interface MonthlyResetPeriodConfiguration {
|
|
1003
|
+
/**
|
|
1004
|
+
* Reset anchor (SubscriptionStart or StartOfTheMonth)
|
|
1005
|
+
*/
|
|
1006
|
+
accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
/**
|
|
1010
|
+
* Configuration for weekly reset period
|
|
1011
|
+
*/
|
|
1012
|
+
export interface WeeklyResetPeriodConfiguration {
|
|
1013
|
+
/**
|
|
1014
|
+
* Reset anchor (SubscriptionStart or specific day)
|
|
1015
|
+
*/
|
|
1016
|
+
accordingTo:
|
|
1017
|
+
| 'SubscriptionStart'
|
|
1018
|
+
| 'EverySunday'
|
|
1019
|
+
| 'EveryMonday'
|
|
1020
|
+
| 'EveryTuesday'
|
|
1021
|
+
| 'EveryWednesday'
|
|
1022
|
+
| 'EveryThursday'
|
|
1023
|
+
| 'EveryFriday'
|
|
1024
|
+
| 'EverySaturday';
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
/**
|
|
1028
|
+
* Configuration for yearly reset period
|
|
1029
|
+
*/
|
|
1030
|
+
export interface YearlyResetPeriodConfiguration {
|
|
1031
|
+
/**
|
|
1032
|
+
* Reset anchor (SubscriptionStart)
|
|
1033
|
+
*/
|
|
1034
|
+
accordingTo: 'SubscriptionStart';
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
export interface UpdateCreditEntitlementRequest {
|
|
1039
|
+
/**
|
|
1040
|
+
* Path param: The plan ID
|
|
1041
|
+
*/
|
|
1042
|
+
planId: string;
|
|
1043
|
+
|
|
1044
|
+
/**
|
|
1045
|
+
* Body param: UpdateCreditEntitlementRequest
|
|
1046
|
+
*/
|
|
1047
|
+
type: 'CREDIT';
|
|
1048
|
+
|
|
1049
|
+
/**
|
|
1050
|
+
* Body param: Credit grant amount
|
|
1051
|
+
*/
|
|
1052
|
+
amount?: number;
|
|
1053
|
+
|
|
1054
|
+
/**
|
|
1055
|
+
* Body param: Entitlement behavior (Increment or Override)
|
|
1056
|
+
*/
|
|
1057
|
+
behavior?: 'Increment' | 'Override';
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* Body param: Credit grant cadence (MONTH or YEAR)
|
|
1061
|
+
*/
|
|
1062
|
+
cadence?: 'MONTH' | 'YEAR';
|
|
1063
|
+
|
|
1064
|
+
/**
|
|
1065
|
+
* Body param: Description of the entitlement
|
|
1066
|
+
*/
|
|
1067
|
+
description?: string;
|
|
1068
|
+
|
|
1069
|
+
/**
|
|
1070
|
+
* Body param: Override display name for the entitlement
|
|
1071
|
+
*/
|
|
1072
|
+
displayNameOverride?: string;
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* Body param: Widget types where this entitlement is hidden
|
|
1076
|
+
*/
|
|
1077
|
+
hiddenFromWidgets?: Array<'PAYWALL' | 'CUSTOMER_PORTAL' | 'CHECKOUT'>;
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* Body param: Whether this is a custom entitlement
|
|
1081
|
+
*/
|
|
1082
|
+
isCustom?: boolean;
|
|
1083
|
+
|
|
1084
|
+
/**
|
|
1085
|
+
* Body param: Whether the entitlement is granted
|
|
1086
|
+
*/
|
|
1087
|
+
isGranted?: boolean;
|
|
1088
|
+
|
|
1089
|
+
/**
|
|
1090
|
+
* Body param: Display order of the entitlement
|
|
1091
|
+
*/
|
|
1092
|
+
order?: number;
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
export interface EntitlementDeleteParams {
|
|
1097
|
+
/**
|
|
1098
|
+
* The plan ID
|
|
1099
|
+
*/
|
|
1100
|
+
planId: string;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
export declare namespace Entitlements {
|
|
1104
|
+
export {
|
|
1105
|
+
type PlanEntitlement as PlanEntitlement,
|
|
1106
|
+
type EntitlementCreateResponse as EntitlementCreateResponse,
|
|
1107
|
+
type EntitlementListResponse as EntitlementListResponse,
|
|
1108
|
+
type EntitlementCreateParams as EntitlementCreateParams,
|
|
1109
|
+
type EntitlementUpdateParams as EntitlementUpdateParams,
|
|
1110
|
+
type EntitlementDeleteParams as EntitlementDeleteParams,
|
|
1111
|
+
};
|
|
1112
|
+
}
|