@stigg/typescript 0.1.0-beta.20 → 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 +8 -0
- package/package.json +1 -1
- package/resources/v1/addons/addons.d.mts +143 -33
- package/resources/v1/addons/addons.d.mts.map +1 -1
- package/resources/v1/addons/addons.d.ts +143 -33
- package/resources/v1/addons/addons.d.ts.map +1 -1
- package/resources/v1/addons/addons.js +110 -17
- package/resources/v1/addons/addons.js.map +1 -1
- package/resources/v1/addons/addons.mjs +110 -17
- package/resources/v1/addons/addons.mjs.map +1 -1
- package/resources/v1/addons/entitlements.d.mts +62 -5
- package/resources/v1/addons/entitlements.d.mts.map +1 -1
- package/resources/v1/addons/entitlements.d.ts +62 -5
- package/resources/v1/addons/entitlements.d.ts.map +1 -1
- package/resources/v1/addons/entitlements.js +49 -8
- package/resources/v1/addons/entitlements.js.map +1 -1
- package/resources/v1/addons/entitlements.mjs +49 -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/coupons.d.mts +80 -20
- package/resources/v1/coupons.d.mts.map +1 -1
- package/resources/v1/coupons.d.ts +80 -20
- package/resources/v1/coupons.d.ts.map +1 -1
- package/resources/v1/coupons.js +60 -9
- package/resources/v1/coupons.js.map +1 -1
- package/resources/v1/coupons.mjs +60 -9
- package/resources/v1/coupons.mjs.map +1 -1
- package/resources/v1/credits/credits.d.mts +59 -26
- package/resources/v1/credits/credits.d.mts.map +1 -1
- package/resources/v1/credits/credits.d.ts +59 -26
- package/resources/v1/credits/credits.d.ts.map +1 -1
- package/resources/v1/credits/credits.js +36 -5
- package/resources/v1/credits/credits.js.map +1 -1
- package/resources/v1/credits/credits.mjs +36 -5
- package/resources/v1/credits/credits.mjs.map +1 -1
- package/resources/v1/credits/custom-currencies.d.mts +96 -23
- package/resources/v1/credits/custom-currencies.d.mts.map +1 -1
- package/resources/v1/credits/custom-currencies.d.ts +96 -23
- package/resources/v1/credits/custom-currencies.d.ts.map +1 -1
- package/resources/v1/credits/custom-currencies.js +76 -12
- package/resources/v1/credits/custom-currencies.js.map +1 -1
- package/resources/v1/credits/custom-currencies.mjs +76 -12
- package/resources/v1/credits/custom-currencies.mjs.map +1 -1
- package/resources/v1/credits/grants.d.mts +60 -23
- package/resources/v1/credits/grants.d.mts.map +1 -1
- package/resources/v1/credits/grants.d.ts +60 -23
- package/resources/v1/credits/grants.d.ts.map +1 -1
- package/resources/v1/credits/grants.js +35 -5
- package/resources/v1/credits/grants.js.map +1 -1
- package/resources/v1/credits/grants.mjs +35 -5
- package/resources/v1/credits/grants.mjs.map +1 -1
- package/resources/v1/credits/index.d.mts +2 -2
- package/resources/v1/credits/index.d.mts.map +1 -1
- package/resources/v1/credits/index.d.ts +2 -2
- package/resources/v1/credits/index.d.ts.map +1 -1
- package/resources/v1/credits/index.js.map +1 -1
- package/resources/v1/credits/index.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +165 -48
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +165 -48
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +124 -19
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +124 -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 +64 -9
- package/resources/v1/customers/integrations.d.mts.map +1 -1
- package/resources/v1/customers/integrations.d.ts +64 -9
- package/resources/v1/customers/integrations.d.ts.map +1 -1
- package/resources/v1/customers/integrations.js +57 -9
- package/resources/v1/customers/integrations.js.map +1 -1
- package/resources/v1/customers/integrations.mjs +57 -9
- package/resources/v1/customers/integrations.mjs.map +1 -1
- package/resources/v1/customers/payment-method.d.mts +31 -7
- package/resources/v1/customers/payment-method.d.mts.map +1 -1
- package/resources/v1/customers/payment-method.d.ts +31 -7
- package/resources/v1/customers/payment-method.d.ts.map +1 -1
- package/resources/v1/customers/payment-method.js +26 -4
- package/resources/v1/customers/payment-method.js.map +1 -1
- package/resources/v1/customers/payment-method.mjs +26 -4
- package/resources/v1/customers/payment-method.mjs.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.mts +40 -7
- package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.ts +40 -7
- package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -1
- package/resources/v1/customers/promotional-entitlements.js +38 -6
- package/resources/v1/customers/promotional-entitlements.js.map +1 -1
- package/resources/v1/customers/promotional-entitlements.mjs +38 -6
- package/resources/v1/customers/promotional-entitlements.mjs.map +1 -1
- package/resources/v1/events/beta/customers/assignments.d.mts +27 -5
- package/resources/v1/events/beta/customers/assignments.d.mts.map +1 -1
- package/resources/v1/events/beta/customers/assignments.d.ts +27 -5
- package/resources/v1/events/beta/customers/assignments.d.ts.map +1 -1
- package/resources/v1/events/beta/customers/assignments.js +27 -4
- package/resources/v1/events/beta/customers/assignments.js.map +1 -1
- package/resources/v1/events/beta/customers/assignments.mjs +27 -4
- package/resources/v1/events/beta/customers/assignments.mjs.map +1 -1
- package/resources/v1/events/beta/customers/entities.d.mts +66 -10
- package/resources/v1/events/beta/customers/entities.d.mts.map +1 -1
- package/resources/v1/events/beta/customers/entities.d.ts +66 -10
- package/resources/v1/events/beta/customers/entities.d.ts.map +1 -1
- package/resources/v1/events/beta/customers/entities.js +64 -10
- package/resources/v1/events/beta/customers/entities.js.map +1 -1
- package/resources/v1/events/beta/customers/entities.mjs +64 -10
- package/resources/v1/events/beta/customers/entities.mjs.map +1 -1
- package/resources/v1/events/beta/customers/entitlements.d.mts +23 -10
- package/resources/v1/events/beta/customers/entitlements.d.mts.map +1 -1
- package/resources/v1/events/beta/customers/entitlements.d.ts +23 -10
- package/resources/v1/events/beta/customers/entitlements.d.ts.map +1 -1
- package/resources/v1/events/beta/customers/entitlements.js +14 -2
- package/resources/v1/events/beta/customers/entitlements.js.map +1 -1
- package/resources/v1/events/beta/customers/entitlements.mjs +14 -2
- package/resources/v1/events/beta/customers/entitlements.mjs.map +1 -1
- package/resources/v1/events/beta/entity-types.d.mts +25 -3
- package/resources/v1/events/beta/entity-types.d.mts.map +1 -1
- package/resources/v1/events/beta/entity-types.d.ts +25 -3
- package/resources/v1/events/beta/entity-types.d.ts.map +1 -1
- package/resources/v1/events/beta/entity-types.js +23 -3
- package/resources/v1/events/beta/entity-types.js.map +1 -1
- package/resources/v1/events/beta/entity-types.mjs +23 -3
- package/resources/v1/events/beta/entity-types.mjs.map +1 -1
- package/resources/v1/events/events.d.mts +13 -2
- package/resources/v1/events/events.d.mts.map +1 -1
- package/resources/v1/events/events.d.ts +13 -2
- package/resources/v1/events/events.d.ts.map +1 -1
- package/resources/v1/events/events.js +14 -2
- package/resources/v1/events/events.js.map +1 -1
- package/resources/v1/events/events.mjs +14 -2
- package/resources/v1/events/events.mjs.map +1 -1
- package/resources/v1/features.d.mts +108 -30
- package/resources/v1/features.d.mts.map +1 -1
- package/resources/v1/features.d.ts +108 -30
- package/resources/v1/features.d.ts.map +1 -1
- package/resources/v1/features.js +72 -11
- package/resources/v1/features.js.map +1 -1
- package/resources/v1/features.mjs +72 -11
- package/resources/v1/features.mjs.map +1 -1
- package/resources/v1/index.d.mts +7 -7
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +7 -7
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/plans/entitlements.d.mts +62 -5
- package/resources/v1/plans/entitlements.d.mts.map +1 -1
- package/resources/v1/plans/entitlements.d.ts +62 -5
- package/resources/v1/plans/entitlements.d.ts.map +1 -1
- package/resources/v1/plans/entitlements.js +49 -8
- package/resources/v1/plans/entitlements.js.map +1 -1
- package/resources/v1/plans/entitlements.mjs +49 -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 +156 -34
- package/resources/v1/plans/plans.d.mts.map +1 -1
- package/resources/v1/plans/plans.d.ts +156 -34
- package/resources/v1/plans/plans.d.ts.map +1 -1
- package/resources/v1/plans/plans.js +127 -20
- package/resources/v1/plans/plans.js.map +1 -1
- package/resources/v1/plans/plans.mjs +127 -20
- package/resources/v1/plans/plans.mjs.map +1 -1
- package/resources/v1/products.d.mts +97 -23
- package/resources/v1/products.d.mts.map +1 -1
- package/resources/v1/products.d.ts +97 -23
- package/resources/v1/products.d.ts.map +1 -1
- package/resources/v1/products.js +73 -11
- package/resources/v1/products.js.map +1 -1
- package/resources/v1/products.mjs +73 -11
- package/resources/v1/products.mjs.map +1 -1
- package/resources/v1/subscriptions/future-update.d.mts +29 -3
- package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
- package/resources/v1/subscriptions/future-update.d.ts +29 -3
- package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
- package/resources/v1/subscriptions/future-update.js +25 -4
- package/resources/v1/subscriptions/future-update.js.map +1 -1
- package/resources/v1/subscriptions/future-update.mjs +25 -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 +15 -2
- package/resources/v1/subscriptions/invoice.d.mts.map +1 -1
- package/resources/v1/subscriptions/invoice.d.ts +15 -2
- package/resources/v1/subscriptions/invoice.d.ts.map +1 -1
- package/resources/v1/subscriptions/invoice.js +13 -2
- package/resources/v1/subscriptions/invoice.js.map +1 -1
- package/resources/v1/subscriptions/invoice.mjs +13 -2
- package/resources/v1/subscriptions/invoice.mjs.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.mts +242 -78
- package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.ts +242 -78
- package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.js +126 -19
- package/resources/v1/subscriptions/subscriptions.js.map +1 -1
- package/resources/v1/subscriptions/subscriptions.mjs +128 -21
- package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
- package/resources/v1/subscriptions/usage.d.mts +29 -4
- package/resources/v1/subscriptions/usage.d.mts.map +1 -1
- package/resources/v1/subscriptions/usage.d.ts +29 -4
- package/resources/v1/subscriptions/usage.d.ts.map +1 -1
- package/resources/v1/subscriptions/usage.js +26 -4
- package/resources/v1/subscriptions/usage.js.map +1 -1
- package/resources/v1/subscriptions/usage.mjs +26 -4
- package/resources/v1/subscriptions/usage.mjs.map +1 -1
- package/resources/v1/usage.d.mts +24 -2
- package/resources/v1/usage.d.mts.map +1 -1
- package/resources/v1/usage.d.ts +24 -2
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +26 -4
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +26 -4
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +14 -14
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +14 -14
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/src/resources/v1/addons/addons.ts +286 -39
- package/src/resources/v1/addons/entitlements.ts +123 -10
- package/src/resources/v1/addons/index.ts +5 -0
- package/src/resources/v1/coupons.ts +154 -23
- package/src/resources/v1/credits/credits.ts +102 -24
- package/src/resources/v1/credits/custom-currencies.ts +188 -30
- package/src/resources/v1/credits/grants.ts +102 -24
- package/src/resources/v1/credits/index.ts +4 -0
- package/src/resources/v1/customers/customers.ts +318 -57
- package/src/resources/v1/customers/index.ts +8 -1
- package/src/resources/v1/customers/integrations.ts +129 -16
- package/src/resources/v1/customers/payment-method.ts +66 -9
- package/src/resources/v1/customers/promotional-entitlements.ts +82 -11
- package/src/resources/v1/events/beta/customers/assignments.ts +56 -7
- package/src/resources/v1/events/beta/customers/entities.ts +136 -16
- package/src/resources/v1/events/beta/customers/entitlements.ts +38 -11
- package/src/resources/v1/events/beta/entity-types.ts +51 -5
- package/src/resources/v1/events/events.ts +28 -3
- package/src/resources/v1/features.ts +204 -34
- package/src/resources/v1/index.ts +19 -0
- package/src/resources/v1/plans/entitlements.ts +123 -10
- package/src/resources/v1/plans/index.ts +5 -0
- package/src/resources/v1/plans/plans.ts +314 -43
- package/src/resources/v1/products.ts +189 -27
- package/src/resources/v1/subscriptions/future-update.ts +68 -5
- package/src/resources/v1/subscriptions/index.ts +9 -2
- package/src/resources/v1/subscriptions/invoice.ts +36 -3
- package/src/resources/v1/subscriptions/subscriptions.ts +410 -85
- package/src/resources/v1/subscriptions/usage.ts +61 -5
- package/src/resources/v1/usage.ts +53 -5
- package/src/resources/v1/v1.ts +38 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../../core/resource';
|
|
4
4
|
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
5
6
|
import { RequestOptions } from '../../../internal/request-options';
|
|
6
7
|
import { path } from '../../../internal/utils/path';
|
|
7
8
|
|
|
@@ -19,10 +20,21 @@ export class Entitlements extends APIResource {
|
|
|
19
20
|
*/
|
|
20
21
|
create(
|
|
21
22
|
addonID: string,
|
|
22
|
-
|
|
23
|
+
params: EntitlementCreateParams,
|
|
23
24
|
options?: RequestOptions,
|
|
24
25
|
): APIPromise<EntitlementCreateResponse> {
|
|
25
|
-
|
|
26
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
27
|
+
return this._client.post(path`/api/v1/addons/${addonID}/entitlements`, {
|
|
28
|
+
body,
|
|
29
|
+
...options,
|
|
30
|
+
headers: buildHeaders([
|
|
31
|
+
{
|
|
32
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
33
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
34
|
+
},
|
|
35
|
+
options?.headers,
|
|
36
|
+
]),
|
|
37
|
+
});
|
|
26
38
|
}
|
|
27
39
|
|
|
28
40
|
/**
|
|
@@ -42,8 +54,18 @@ export class Entitlements extends APIResource {
|
|
|
42
54
|
params: EntitlementUpdateParams,
|
|
43
55
|
options?: RequestOptions,
|
|
44
56
|
): APIPromise<AddonPackageEntitlement> {
|
|
45
|
-
const { addonId, ...body } = params;
|
|
46
|
-
return this._client.patch(path`/api/v1/addons/${addonId}/entitlements/${id}`, {
|
|
57
|
+
const { addonId, 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
58
|
+
return this._client.patch(path`/api/v1/addons/${addonId}/entitlements/${id}`, {
|
|
59
|
+
body,
|
|
60
|
+
...options,
|
|
61
|
+
headers: buildHeaders([
|
|
62
|
+
{
|
|
63
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
64
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
65
|
+
},
|
|
66
|
+
options?.headers,
|
|
67
|
+
]),
|
|
68
|
+
});
|
|
47
69
|
}
|
|
48
70
|
|
|
49
71
|
/**
|
|
@@ -55,8 +77,22 @@ export class Entitlements extends APIResource {
|
|
|
55
77
|
* await client.v1.addons.entitlements.list('addonId');
|
|
56
78
|
* ```
|
|
57
79
|
*/
|
|
58
|
-
list(
|
|
59
|
-
|
|
80
|
+
list(
|
|
81
|
+
addonID: string,
|
|
82
|
+
params: EntitlementListParams | null | undefined = {},
|
|
83
|
+
options?: RequestOptions,
|
|
84
|
+
): APIPromise<EntitlementListResponse> {
|
|
85
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
|
|
86
|
+
return this._client.get(path`/api/v1/addons/${addonID}/entitlements`, {
|
|
87
|
+
...options,
|
|
88
|
+
headers: buildHeaders([
|
|
89
|
+
{
|
|
90
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
91
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
92
|
+
},
|
|
93
|
+
options?.headers,
|
|
94
|
+
]),
|
|
95
|
+
});
|
|
60
96
|
}
|
|
61
97
|
|
|
62
98
|
/**
|
|
@@ -75,8 +111,17 @@ export class Entitlements extends APIResource {
|
|
|
75
111
|
params: EntitlementDeleteParams,
|
|
76
112
|
options?: RequestOptions,
|
|
77
113
|
): APIPromise<AddonPackageEntitlement> {
|
|
78
|
-
const { addonId } = params;
|
|
79
|
-
return this._client.delete(path`/api/v1/addons/${addonId}/entitlements/${id}`,
|
|
114
|
+
const { addonId, 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params;
|
|
115
|
+
return this._client.delete(path`/api/v1/addons/${addonId}/entitlements/${id}`, {
|
|
116
|
+
...options,
|
|
117
|
+
headers: buildHeaders([
|
|
118
|
+
{
|
|
119
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
120
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
121
|
+
},
|
|
122
|
+
options?.headers,
|
|
123
|
+
]),
|
|
124
|
+
});
|
|
80
125
|
}
|
|
81
126
|
}
|
|
82
127
|
|
|
@@ -766,9 +811,22 @@ export namespace EntitlementListResponse {
|
|
|
766
811
|
|
|
767
812
|
export interface EntitlementCreateParams {
|
|
768
813
|
/**
|
|
769
|
-
* Entitlements to create
|
|
814
|
+
* Body param: Entitlements to create
|
|
770
815
|
*/
|
|
771
816
|
entitlements: Array<EntitlementCreateParams.Feature | EntitlementCreateParams.Credit>;
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
820
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
821
|
+
*/
|
|
822
|
+
'X-ACCOUNT-ID'?: string;
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
826
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
827
|
+
* intrinsic to the key).
|
|
828
|
+
*/
|
|
829
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
772
830
|
}
|
|
773
831
|
|
|
774
832
|
export namespace EntitlementCreateParams {
|
|
@@ -1059,6 +1117,19 @@ export declare namespace EntitlementUpdateParams {
|
|
|
1059
1117
|
* Body param: Configuration for yearly reset period
|
|
1060
1118
|
*/
|
|
1061
1119
|
yearlyResetPeriodConfiguration?: UpdateFeatureEntitlementRequest.YearlyResetPeriodConfiguration | null;
|
|
1120
|
+
|
|
1121
|
+
/**
|
|
1122
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
1123
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
1124
|
+
*/
|
|
1125
|
+
'X-ACCOUNT-ID'?: string;
|
|
1126
|
+
|
|
1127
|
+
/**
|
|
1128
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
1129
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
1130
|
+
* intrinsic to the key).
|
|
1131
|
+
*/
|
|
1132
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
1062
1133
|
}
|
|
1063
1134
|
|
|
1064
1135
|
export namespace UpdateFeatureEntitlementRequest {
|
|
@@ -1162,14 +1233,55 @@ export declare namespace EntitlementUpdateParams {
|
|
|
1162
1233
|
* Body param: Display order of the entitlement
|
|
1163
1234
|
*/
|
|
1164
1235
|
order?: number;
|
|
1236
|
+
|
|
1237
|
+
/**
|
|
1238
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
1239
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
1240
|
+
*/
|
|
1241
|
+
'X-ACCOUNT-ID'?: string;
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
1245
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
1246
|
+
* intrinsic to the key).
|
|
1247
|
+
*/
|
|
1248
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
1165
1249
|
}
|
|
1166
1250
|
}
|
|
1167
1251
|
|
|
1252
|
+
export interface EntitlementListParams {
|
|
1253
|
+
/**
|
|
1254
|
+
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
1255
|
+
* back to the user's first membership. Ignored for API-key auth.
|
|
1256
|
+
*/
|
|
1257
|
+
'X-ACCOUNT-ID'?: string;
|
|
1258
|
+
|
|
1259
|
+
/**
|
|
1260
|
+
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
1261
|
+
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
1262
|
+
* key).
|
|
1263
|
+
*/
|
|
1264
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1168
1267
|
export interface EntitlementDeleteParams {
|
|
1169
1268
|
/**
|
|
1170
|
-
* The addon ID
|
|
1269
|
+
* Path param: The addon ID
|
|
1171
1270
|
*/
|
|
1172
1271
|
addonId: string;
|
|
1272
|
+
|
|
1273
|
+
/**
|
|
1274
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
1275
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
1276
|
+
*/
|
|
1277
|
+
'X-ACCOUNT-ID'?: string;
|
|
1278
|
+
|
|
1279
|
+
/**
|
|
1280
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
1281
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
1282
|
+
* intrinsic to the key).
|
|
1283
|
+
*/
|
|
1284
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
1173
1285
|
}
|
|
1174
1286
|
|
|
1175
1287
|
export declare namespace Entitlements {
|
|
@@ -1179,6 +1291,7 @@ export declare namespace Entitlements {
|
|
|
1179
1291
|
type EntitlementListResponse as EntitlementListResponse,
|
|
1180
1292
|
type EntitlementCreateParams as EntitlementCreateParams,
|
|
1181
1293
|
type EntitlementUpdateParams as EntitlementUpdateParams,
|
|
1294
|
+
type EntitlementListParams as EntitlementListParams,
|
|
1182
1295
|
type EntitlementDeleteParams as EntitlementDeleteParams,
|
|
1183
1296
|
};
|
|
1184
1297
|
}
|
|
@@ -8,10 +8,14 @@ export {
|
|
|
8
8
|
type AddonPublishResponse,
|
|
9
9
|
type AddonRemoveDraftResponse,
|
|
10
10
|
type AddonCreateParams,
|
|
11
|
+
type AddonRetrieveParams,
|
|
11
12
|
type AddonUpdateParams,
|
|
12
13
|
type AddonListParams,
|
|
14
|
+
type AddonArchiveParams,
|
|
15
|
+
type AddonCreateDraftParams,
|
|
13
16
|
type AddonListChargesParams,
|
|
14
17
|
type AddonPublishParams,
|
|
18
|
+
type AddonRemoveDraftParams,
|
|
15
19
|
type AddonListResponsesMyCursorIDPage,
|
|
16
20
|
type AddonListChargesResponsesMyCursorIDPage,
|
|
17
21
|
} from './addons';
|
|
@@ -22,5 +26,6 @@ export {
|
|
|
22
26
|
type EntitlementListResponse,
|
|
23
27
|
type EntitlementCreateParams,
|
|
24
28
|
type EntitlementUpdateParams,
|
|
29
|
+
type EntitlementListParams,
|
|
25
30
|
type EntitlementDeleteParams,
|
|
26
31
|
} from './entitlements';
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import { APIPromise } from '../../core/api-promise';
|
|
5
5
|
import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from '../../core/pagination';
|
|
6
|
+
import { buildHeaders } from '../../internal/headers';
|
|
6
7
|
import { RequestOptions } from '../../internal/request-options';
|
|
7
8
|
import { path } from '../../internal/utils/path';
|
|
8
9
|
|
|
@@ -27,8 +28,19 @@ export class Coupons extends APIResource {
|
|
|
27
28
|
* });
|
|
28
29
|
* ```
|
|
29
30
|
*/
|
|
30
|
-
create(
|
|
31
|
-
|
|
31
|
+
create(params: CouponCreateParams, options?: RequestOptions): APIPromise<Coupon> {
|
|
32
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
33
|
+
return this._client.post('/api/v1/coupons', {
|
|
34
|
+
body,
|
|
35
|
+
...options,
|
|
36
|
+
headers: buildHeaders([
|
|
37
|
+
{
|
|
38
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
39
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
40
|
+
},
|
|
41
|
+
options?.headers,
|
|
42
|
+
]),
|
|
43
|
+
});
|
|
32
44
|
}
|
|
33
45
|
|
|
34
46
|
/**
|
|
@@ -39,8 +51,22 @@ export class Coupons extends APIResource {
|
|
|
39
51
|
* const coupon = await client.v1.coupons.retrieve('x');
|
|
40
52
|
* ```
|
|
41
53
|
*/
|
|
42
|
-
retrieve(
|
|
43
|
-
|
|
54
|
+
retrieve(
|
|
55
|
+
id: string,
|
|
56
|
+
params: CouponRetrieveParams | null | undefined = {},
|
|
57
|
+
options?: RequestOptions,
|
|
58
|
+
): APIPromise<Coupon> {
|
|
59
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
|
|
60
|
+
return this._client.get(path`/api/v1/coupons/${id}`, {
|
|
61
|
+
...options,
|
|
62
|
+
headers: buildHeaders([
|
|
63
|
+
{
|
|
64
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
65
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
66
|
+
},
|
|
67
|
+
options?.headers,
|
|
68
|
+
]),
|
|
69
|
+
});
|
|
44
70
|
}
|
|
45
71
|
|
|
46
72
|
/**
|
|
@@ -55,12 +81,20 @@ export class Coupons extends APIResource {
|
|
|
55
81
|
* ```
|
|
56
82
|
*/
|
|
57
83
|
list(
|
|
58
|
-
|
|
84
|
+
params: CouponListParams | null | undefined = {},
|
|
59
85
|
options?: RequestOptions,
|
|
60
86
|
): PagePromise<CouponListResponsesMyCursorIDPage, CouponListResponse> {
|
|
87
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
|
|
61
88
|
return this._client.getAPIList('/api/v1/coupons', MyCursorIDPage<CouponListResponse>, {
|
|
62
89
|
query,
|
|
63
90
|
...options,
|
|
91
|
+
headers: buildHeaders([
|
|
92
|
+
{
|
|
93
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
94
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
95
|
+
},
|
|
96
|
+
options?.headers,
|
|
97
|
+
]),
|
|
64
98
|
});
|
|
65
99
|
}
|
|
66
100
|
|
|
@@ -72,8 +106,22 @@ export class Coupons extends APIResource {
|
|
|
72
106
|
* const coupon = await client.v1.coupons.archiveCoupon('x');
|
|
73
107
|
* ```
|
|
74
108
|
*/
|
|
75
|
-
archiveCoupon(
|
|
76
|
-
|
|
109
|
+
archiveCoupon(
|
|
110
|
+
id: string,
|
|
111
|
+
params: CouponArchiveCouponParams | null | undefined = {},
|
|
112
|
+
options?: RequestOptions,
|
|
113
|
+
): APIPromise<Coupon> {
|
|
114
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
|
|
115
|
+
return this._client.post(path`/api/v1/coupons/${id}/archive`, {
|
|
116
|
+
...options,
|
|
117
|
+
headers: buildHeaders([
|
|
118
|
+
{
|
|
119
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
120
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
121
|
+
},
|
|
122
|
+
options?.headers,
|
|
123
|
+
]),
|
|
124
|
+
});
|
|
77
125
|
}
|
|
78
126
|
|
|
79
127
|
/**
|
|
@@ -84,8 +132,19 @@ export class Coupons extends APIResource {
|
|
|
84
132
|
* const coupon = await client.v1.coupons.updateCoupon('x');
|
|
85
133
|
* ```
|
|
86
134
|
*/
|
|
87
|
-
updateCoupon(id: string,
|
|
88
|
-
|
|
135
|
+
updateCoupon(id: string, params: CouponUpdateCouponParams, options?: RequestOptions): APIPromise<Coupon> {
|
|
136
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
137
|
+
return this._client.patch(path`/api/v1/coupons/${id}`, {
|
|
138
|
+
body,
|
|
139
|
+
...options,
|
|
140
|
+
headers: buildHeaders([
|
|
141
|
+
{
|
|
142
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
143
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
144
|
+
},
|
|
145
|
+
options?.headers,
|
|
146
|
+
]),
|
|
147
|
+
});
|
|
89
148
|
}
|
|
90
149
|
}
|
|
91
150
|
|
|
@@ -521,39 +580,52 @@ export namespace CouponListResponse {
|
|
|
521
580
|
|
|
522
581
|
export interface CouponCreateParams {
|
|
523
582
|
/**
|
|
524
|
-
* The unique identifier for the entity
|
|
583
|
+
* Body param: The unique identifier for the entity
|
|
525
584
|
*/
|
|
526
585
|
id: string;
|
|
527
586
|
|
|
528
587
|
/**
|
|
529
|
-
* Fixed amount discounts in different currencies
|
|
588
|
+
* Body param: Fixed amount discounts in different currencies
|
|
530
589
|
*/
|
|
531
590
|
amountsOff: Array<CouponCreateParams.AmountsOff> | null;
|
|
532
591
|
|
|
533
592
|
/**
|
|
534
|
-
* Description of the coupon
|
|
593
|
+
* Body param: Description of the coupon
|
|
535
594
|
*/
|
|
536
595
|
description: string | null;
|
|
537
596
|
|
|
538
597
|
/**
|
|
539
|
-
* Duration of the coupon validity in months
|
|
598
|
+
* Body param: Duration of the coupon validity in months
|
|
540
599
|
*/
|
|
541
600
|
durationInMonths: number | null;
|
|
542
601
|
|
|
543
602
|
/**
|
|
544
|
-
* Metadata associated with the entity
|
|
603
|
+
* Body param: Metadata associated with the entity
|
|
545
604
|
*/
|
|
546
605
|
metadata: { [key: string]: string } | null;
|
|
547
606
|
|
|
548
607
|
/**
|
|
549
|
-
* Name of the coupon
|
|
608
|
+
* Body param: Name of the coupon
|
|
550
609
|
*/
|
|
551
610
|
name: string;
|
|
552
611
|
|
|
553
612
|
/**
|
|
554
|
-
* Percentage discount off the original price
|
|
613
|
+
* Body param: Percentage discount off the original price
|
|
555
614
|
*/
|
|
556
615
|
percentOff: number | null;
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
619
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
620
|
+
*/
|
|
621
|
+
'X-ACCOUNT-ID'?: string;
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
625
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
626
|
+
* intrinsic to the key).
|
|
627
|
+
*/
|
|
628
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
557
629
|
}
|
|
558
630
|
|
|
559
631
|
export namespace CouponCreateParams {
|
|
@@ -689,26 +761,55 @@ export namespace CouponCreateParams {
|
|
|
689
761
|
}
|
|
690
762
|
}
|
|
691
763
|
|
|
764
|
+
export interface CouponRetrieveParams {
|
|
765
|
+
/**
|
|
766
|
+
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
767
|
+
* back to the user's first membership. Ignored for API-key auth.
|
|
768
|
+
*/
|
|
769
|
+
'X-ACCOUNT-ID'?: string;
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
773
|
+
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
774
|
+
* key).
|
|
775
|
+
*/
|
|
776
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
777
|
+
}
|
|
778
|
+
|
|
692
779
|
export interface CouponListParams extends MyCursorIDPageParams {
|
|
693
780
|
/**
|
|
694
|
-
* Filter by entity ID
|
|
781
|
+
* Query param: Filter by entity ID
|
|
695
782
|
*/
|
|
696
783
|
id?: string;
|
|
697
784
|
|
|
698
785
|
/**
|
|
699
|
-
* Filter by creation date using range operators: gt, gte, lt, lte
|
|
786
|
+
* Query param: Filter by creation date using range operators: gt, gte, lt, lte
|
|
700
787
|
*/
|
|
701
788
|
createdAt?: CouponListParams.CreatedAt;
|
|
702
789
|
|
|
703
790
|
/**
|
|
704
|
-
* Filter by coupon status. Supports comma-separated values for
|
|
791
|
+
* Query param: Filter by coupon status. Supports comma-separated values for
|
|
792
|
+
* multiple statuses
|
|
705
793
|
*/
|
|
706
794
|
status?: Array<'ACTIVE' | 'ARCHIVED'>;
|
|
707
795
|
|
|
708
796
|
/**
|
|
709
|
-
* Filter by coupon type (FIXED or PERCENTAGE)
|
|
797
|
+
* Query param: Filter by coupon type (FIXED or PERCENTAGE)
|
|
710
798
|
*/
|
|
711
799
|
type?: 'FIXED' | 'PERCENTAGE';
|
|
800
|
+
|
|
801
|
+
/**
|
|
802
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
803
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
804
|
+
*/
|
|
805
|
+
'X-ACCOUNT-ID'?: string;
|
|
806
|
+
|
|
807
|
+
/**
|
|
808
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
809
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
810
|
+
* intrinsic to the key).
|
|
811
|
+
*/
|
|
812
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
712
813
|
}
|
|
713
814
|
|
|
714
815
|
export namespace CouponListParams {
|
|
@@ -738,21 +839,49 @@ export namespace CouponListParams {
|
|
|
738
839
|
}
|
|
739
840
|
}
|
|
740
841
|
|
|
842
|
+
export interface CouponArchiveCouponParams {
|
|
843
|
+
/**
|
|
844
|
+
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
845
|
+
* back to the user's first membership. Ignored for API-key auth.
|
|
846
|
+
*/
|
|
847
|
+
'X-ACCOUNT-ID'?: string;
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
851
|
+
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
852
|
+
* key).
|
|
853
|
+
*/
|
|
854
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
855
|
+
}
|
|
856
|
+
|
|
741
857
|
export interface CouponUpdateCouponParams {
|
|
742
858
|
/**
|
|
743
|
-
* Description of the coupon
|
|
859
|
+
* Body param: Description of the coupon
|
|
744
860
|
*/
|
|
745
861
|
description?: string | null;
|
|
746
862
|
|
|
747
863
|
/**
|
|
748
|
-
* Metadata associated with the entity
|
|
864
|
+
* Body param: Metadata associated with the entity
|
|
749
865
|
*/
|
|
750
866
|
metadata?: { [key: string]: string } | null;
|
|
751
867
|
|
|
752
868
|
/**
|
|
753
|
-
* Name of the coupon
|
|
869
|
+
* Body param: Name of the coupon
|
|
754
870
|
*/
|
|
755
871
|
name?: string;
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
875
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
876
|
+
*/
|
|
877
|
+
'X-ACCOUNT-ID'?: string;
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
881
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
882
|
+
* intrinsic to the key).
|
|
883
|
+
*/
|
|
884
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
756
885
|
}
|
|
757
886
|
|
|
758
887
|
export declare namespace Coupons {
|
|
@@ -761,7 +890,9 @@ export declare namespace Coupons {
|
|
|
761
890
|
type CouponListResponse as CouponListResponse,
|
|
762
891
|
type CouponListResponsesMyCursorIDPage as CouponListResponsesMyCursorIDPage,
|
|
763
892
|
type CouponCreateParams as CouponCreateParams,
|
|
893
|
+
type CouponRetrieveParams as CouponRetrieveParams,
|
|
764
894
|
type CouponListParams as CouponListParams,
|
|
895
|
+
type CouponArchiveCouponParams as CouponArchiveCouponParams,
|
|
765
896
|
type CouponUpdateCouponParams as CouponUpdateCouponParams,
|
|
766
897
|
};
|
|
767
898
|
}
|