@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
|
@@ -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
|
|
|
@@ -21,8 +22,22 @@ export class Products extends APIResource {
|
|
|
21
22
|
* );
|
|
22
23
|
* ```
|
|
23
24
|
*/
|
|
24
|
-
archiveProduct(
|
|
25
|
-
|
|
25
|
+
archiveProduct(
|
|
26
|
+
id: string,
|
|
27
|
+
params: ProductArchiveProductParams | null | undefined = {},
|
|
28
|
+
options?: RequestOptions,
|
|
29
|
+
): APIPromise<Product> {
|
|
30
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
|
|
31
|
+
return this._client.post(path`/api/v1/products/${id}/archive`, {
|
|
32
|
+
...options,
|
|
33
|
+
headers: buildHeaders([
|
|
34
|
+
{
|
|
35
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
36
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
37
|
+
},
|
|
38
|
+
options?.headers,
|
|
39
|
+
]),
|
|
40
|
+
});
|
|
26
41
|
}
|
|
27
42
|
|
|
28
43
|
/**
|
|
@@ -36,8 +51,19 @@ export class Products extends APIResource {
|
|
|
36
51
|
* });
|
|
37
52
|
* ```
|
|
38
53
|
*/
|
|
39
|
-
createProduct(
|
|
40
|
-
|
|
54
|
+
createProduct(params: ProductCreateProductParams, options?: RequestOptions): APIPromise<Product> {
|
|
55
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
56
|
+
return this._client.post('/api/v1/products', {
|
|
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
|
+
});
|
|
41
67
|
}
|
|
42
68
|
|
|
43
69
|
/**
|
|
@@ -53,10 +79,21 @@ export class Products extends APIResource {
|
|
|
53
79
|
*/
|
|
54
80
|
duplicateProduct(
|
|
55
81
|
id: string,
|
|
56
|
-
|
|
82
|
+
params: ProductDuplicateProductParams,
|
|
57
83
|
options?: RequestOptions,
|
|
58
84
|
): APIPromise<Product> {
|
|
59
|
-
|
|
85
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
86
|
+
return this._client.post(path`/api/v1/products/${id}/duplicate`, {
|
|
87
|
+
body,
|
|
88
|
+
...options,
|
|
89
|
+
headers: buildHeaders([
|
|
90
|
+
{
|
|
91
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
92
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
93
|
+
},
|
|
94
|
+
options?.headers,
|
|
95
|
+
]),
|
|
96
|
+
});
|
|
60
97
|
}
|
|
61
98
|
|
|
62
99
|
/**
|
|
@@ -71,12 +108,20 @@ export class Products extends APIResource {
|
|
|
71
108
|
* ```
|
|
72
109
|
*/
|
|
73
110
|
listProducts(
|
|
74
|
-
|
|
111
|
+
params: ProductListProductsParams | null | undefined = {},
|
|
75
112
|
options?: RequestOptions,
|
|
76
113
|
): PagePromise<ProductListProductsResponsesMyCursorIDPage, ProductListProductsResponse> {
|
|
114
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
|
|
77
115
|
return this._client.getAPIList('/api/v1/products', MyCursorIDPage<ProductListProductsResponse>, {
|
|
78
116
|
query,
|
|
79
117
|
...options,
|
|
118
|
+
headers: buildHeaders([
|
|
119
|
+
{
|
|
120
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
121
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
122
|
+
},
|
|
123
|
+
options?.headers,
|
|
124
|
+
]),
|
|
80
125
|
});
|
|
81
126
|
}
|
|
82
127
|
|
|
@@ -90,8 +135,22 @@ export class Products extends APIResource {
|
|
|
90
135
|
* );
|
|
91
136
|
* ```
|
|
92
137
|
*/
|
|
93
|
-
unarchiveProduct(
|
|
94
|
-
|
|
138
|
+
unarchiveProduct(
|
|
139
|
+
id: string,
|
|
140
|
+
params: ProductUnarchiveProductParams | null | undefined = {},
|
|
141
|
+
options?: RequestOptions,
|
|
142
|
+
): APIPromise<Product> {
|
|
143
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
|
|
144
|
+
return this._client.post(path`/api/v1/products/${id}/unarchive`, {
|
|
145
|
+
...options,
|
|
146
|
+
headers: buildHeaders([
|
|
147
|
+
{
|
|
148
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
149
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
150
|
+
},
|
|
151
|
+
options?.headers,
|
|
152
|
+
]),
|
|
153
|
+
});
|
|
95
154
|
}
|
|
96
155
|
|
|
97
156
|
/**
|
|
@@ -103,8 +162,23 @@ export class Products extends APIResource {
|
|
|
103
162
|
* const product = await client.v1.products.updateProduct('x');
|
|
104
163
|
* ```
|
|
105
164
|
*/
|
|
106
|
-
updateProduct(
|
|
107
|
-
|
|
165
|
+
updateProduct(
|
|
166
|
+
id: string,
|
|
167
|
+
params: ProductUpdateProductParams,
|
|
168
|
+
options?: RequestOptions,
|
|
169
|
+
): APIPromise<Product> {
|
|
170
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
171
|
+
return this._client.patch(path`/api/v1/products/${id}`, {
|
|
172
|
+
body,
|
|
173
|
+
...options,
|
|
174
|
+
headers: buildHeaders([
|
|
175
|
+
{
|
|
176
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
177
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
178
|
+
},
|
|
179
|
+
options?.headers,
|
|
180
|
+
]),
|
|
181
|
+
});
|
|
108
182
|
}
|
|
109
183
|
}
|
|
110
184
|
|
|
@@ -298,65 +372,120 @@ export namespace ProductListProductsResponse {
|
|
|
298
372
|
}
|
|
299
373
|
}
|
|
300
374
|
|
|
375
|
+
export interface ProductArchiveProductParams {
|
|
376
|
+
/**
|
|
377
|
+
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
378
|
+
* back to the user's first membership. Ignored for API-key auth.
|
|
379
|
+
*/
|
|
380
|
+
'X-ACCOUNT-ID'?: string;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
384
|
+
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
385
|
+
* key).
|
|
386
|
+
*/
|
|
387
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
388
|
+
}
|
|
389
|
+
|
|
301
390
|
export interface ProductCreateProductParams {
|
|
302
391
|
/**
|
|
303
|
-
* The unique identifier for the entity
|
|
392
|
+
* Body param: The unique identifier for the entity
|
|
304
393
|
*/
|
|
305
394
|
id: string;
|
|
306
395
|
|
|
307
396
|
/**
|
|
308
|
-
* Display name of the product
|
|
397
|
+
* Body param: Display name of the product
|
|
309
398
|
*/
|
|
310
399
|
displayName: string;
|
|
311
400
|
|
|
312
401
|
/**
|
|
313
|
-
* Description of the product
|
|
402
|
+
* Body param: Description of the product
|
|
314
403
|
*/
|
|
315
404
|
description?: string | null;
|
|
316
405
|
|
|
317
406
|
/**
|
|
318
|
-
* Additional metadata for the product
|
|
407
|
+
* Body param: Additional metadata for the product
|
|
319
408
|
*/
|
|
320
409
|
metadata?: { [key: string]: string } | null;
|
|
321
410
|
|
|
322
411
|
/**
|
|
323
|
-
* Indicates if multiple subscriptions to this product are allowed
|
|
412
|
+
* Body param: Indicates if multiple subscriptions to this product are allowed
|
|
324
413
|
*/
|
|
325
414
|
multipleSubscriptions?: boolean;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
418
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
419
|
+
*/
|
|
420
|
+
'X-ACCOUNT-ID'?: string;
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
424
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
425
|
+
* intrinsic to the key).
|
|
426
|
+
*/
|
|
427
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
326
428
|
}
|
|
327
429
|
|
|
328
430
|
export interface ProductDuplicateProductParams {
|
|
329
431
|
/**
|
|
330
|
-
* The unique identifier for the entity
|
|
432
|
+
* Body param: The unique identifier for the entity
|
|
331
433
|
*/
|
|
332
434
|
targetId: string;
|
|
333
435
|
|
|
334
436
|
/**
|
|
335
|
-
* Description of the product
|
|
437
|
+
* Body param: Description of the product
|
|
336
438
|
*/
|
|
337
439
|
description?: string | null;
|
|
338
440
|
|
|
339
441
|
/**
|
|
340
|
-
* Display name of the product
|
|
442
|
+
* Body param: Display name of the product
|
|
341
443
|
*/
|
|
342
444
|
displayName?: string;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
448
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
449
|
+
*/
|
|
450
|
+
'X-ACCOUNT-ID'?: string;
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
454
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
455
|
+
* intrinsic to the key).
|
|
456
|
+
*/
|
|
457
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
343
458
|
}
|
|
344
459
|
|
|
345
460
|
export interface ProductListProductsParams extends MyCursorIDPageParams {
|
|
346
461
|
/**
|
|
347
|
-
* Filter by entity ID
|
|
462
|
+
* Query param: Filter by entity ID
|
|
348
463
|
*/
|
|
349
464
|
id?: string;
|
|
350
465
|
|
|
351
466
|
/**
|
|
352
|
-
* Filter by creation date using range operators: gt, gte, lt, lte
|
|
467
|
+
* Query param: Filter by creation date using range operators: gt, gte, lt, lte
|
|
353
468
|
*/
|
|
354
469
|
createdAt?: ProductListProductsParams.CreatedAt;
|
|
355
470
|
|
|
356
471
|
/**
|
|
357
|
-
* Filter by product status. Supports comma-separated values for
|
|
472
|
+
* Query param: Filter by product status. Supports comma-separated values for
|
|
473
|
+
* multiple statuses
|
|
358
474
|
*/
|
|
359
475
|
status?: Array<'PUBLISHED' | 'ARCHIVED'>;
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
479
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
480
|
+
*/
|
|
481
|
+
'X-ACCOUNT-ID'?: string;
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
485
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
486
|
+
* intrinsic to the key).
|
|
487
|
+
*/
|
|
488
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
360
489
|
}
|
|
361
490
|
|
|
362
491
|
export namespace ProductListProductsParams {
|
|
@@ -386,33 +515,64 @@ export namespace ProductListProductsParams {
|
|
|
386
515
|
}
|
|
387
516
|
}
|
|
388
517
|
|
|
518
|
+
export interface ProductUnarchiveProductParams {
|
|
519
|
+
/**
|
|
520
|
+
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
521
|
+
* back to the user's first membership. Ignored for API-key auth.
|
|
522
|
+
*/
|
|
523
|
+
'X-ACCOUNT-ID'?: string;
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
527
|
+
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
528
|
+
* key).
|
|
529
|
+
*/
|
|
530
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
531
|
+
}
|
|
532
|
+
|
|
389
533
|
export interface ProductUpdateProductParams {
|
|
390
534
|
/**
|
|
391
|
-
* Description of the product
|
|
535
|
+
* Body param: Description of the product
|
|
392
536
|
*/
|
|
393
537
|
description?: string | null;
|
|
394
538
|
|
|
395
539
|
/**
|
|
396
|
-
* Display name of the product
|
|
540
|
+
* Body param: Display name of the product
|
|
397
541
|
*/
|
|
398
542
|
displayName?: string;
|
|
399
543
|
|
|
400
544
|
/**
|
|
401
|
-
* Additional metadata for the product
|
|
545
|
+
* Body param: Additional metadata for the product
|
|
402
546
|
*/
|
|
403
547
|
metadata?: { [key: string]: string } | null;
|
|
404
548
|
|
|
405
549
|
/**
|
|
406
|
-
* Indicates if multiple subscriptions to this product are allowed
|
|
550
|
+
* Body param: Indicates if multiple subscriptions to this product are allowed
|
|
407
551
|
*/
|
|
408
552
|
multipleSubscriptions?: boolean;
|
|
409
553
|
|
|
554
|
+
/**
|
|
555
|
+
* Body param
|
|
556
|
+
*/
|
|
410
557
|
productSettings?: ProductUpdateProductParams.ProductSettings;
|
|
411
558
|
|
|
412
559
|
/**
|
|
413
|
-
* Rule defining when usage resets upon subscription update.
|
|
560
|
+
* Body param: Rule defining when usage resets upon subscription update.
|
|
414
561
|
*/
|
|
415
562
|
usageResetCutoffRule?: ProductUpdateProductParams.UsageResetCutoffRule;
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
566
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
567
|
+
*/
|
|
568
|
+
'X-ACCOUNT-ID'?: string;
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
572
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
573
|
+
* intrinsic to the key).
|
|
574
|
+
*/
|
|
575
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
416
576
|
}
|
|
417
577
|
|
|
418
578
|
export namespace ProductUpdateProductParams {
|
|
@@ -465,9 +625,11 @@ export declare namespace Products {
|
|
|
465
625
|
type Product as Product,
|
|
466
626
|
type ProductListProductsResponse as ProductListProductsResponse,
|
|
467
627
|
type ProductListProductsResponsesMyCursorIDPage as ProductListProductsResponsesMyCursorIDPage,
|
|
628
|
+
type ProductArchiveProductParams as ProductArchiveProductParams,
|
|
468
629
|
type ProductCreateProductParams as ProductCreateProductParams,
|
|
469
630
|
type ProductDuplicateProductParams as ProductDuplicateProductParams,
|
|
470
631
|
type ProductListProductsParams as ProductListProductsParams,
|
|
632
|
+
type ProductUnarchiveProductParams as ProductUnarchiveProductParams,
|
|
471
633
|
type ProductUpdateProductParams as ProductUpdateProductParams,
|
|
472
634
|
};
|
|
473
635
|
}
|
|
@@ -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
|
|
|
@@ -20,8 +21,22 @@ export class FutureUpdate extends APIResource {
|
|
|
20
21
|
* );
|
|
21
22
|
* ```
|
|
22
23
|
*/
|
|
23
|
-
cancelPendingPayment(
|
|
24
|
-
|
|
24
|
+
cancelPendingPayment(
|
|
25
|
+
id: string,
|
|
26
|
+
params: FutureUpdateCancelPendingPaymentParams | null | undefined = {},
|
|
27
|
+
options?: RequestOptions,
|
|
28
|
+
): APIPromise<CancelSubscription> {
|
|
29
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
|
|
30
|
+
return this._client.delete(path`/api/v1/subscriptions/${id}/future-update/pending-payment`, {
|
|
31
|
+
...options,
|
|
32
|
+
headers: buildHeaders([
|
|
33
|
+
{
|
|
34
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
35
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
36
|
+
},
|
|
37
|
+
options?.headers,
|
|
38
|
+
]),
|
|
39
|
+
});
|
|
25
40
|
}
|
|
26
41
|
|
|
27
42
|
/**
|
|
@@ -36,8 +51,22 @@ export class FutureUpdate extends APIResource {
|
|
|
36
51
|
* );
|
|
37
52
|
* ```
|
|
38
53
|
*/
|
|
39
|
-
cancelSchedule(
|
|
40
|
-
|
|
54
|
+
cancelSchedule(
|
|
55
|
+
id: string,
|
|
56
|
+
params: FutureUpdateCancelScheduleParams | null | undefined = {},
|
|
57
|
+
options?: RequestOptions,
|
|
58
|
+
): APIPromise<CancelSubscription> {
|
|
59
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
|
|
60
|
+
return this._client.delete(path`/api/v1/subscriptions/${id}/future-update/schedule`, {
|
|
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
|
+
});
|
|
41
70
|
}
|
|
42
71
|
}
|
|
43
72
|
|
|
@@ -57,6 +86,40 @@ export namespace CancelSubscription {
|
|
|
57
86
|
}
|
|
58
87
|
}
|
|
59
88
|
|
|
89
|
+
export interface FutureUpdateCancelPendingPaymentParams {
|
|
90
|
+
/**
|
|
91
|
+
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
92
|
+
* back to the user's first membership. Ignored for API-key auth.
|
|
93
|
+
*/
|
|
94
|
+
'X-ACCOUNT-ID'?: string;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
98
|
+
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
99
|
+
* key).
|
|
100
|
+
*/
|
|
101
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface FutureUpdateCancelScheduleParams {
|
|
105
|
+
/**
|
|
106
|
+
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
107
|
+
* back to the user's first membership. Ignored for API-key auth.
|
|
108
|
+
*/
|
|
109
|
+
'X-ACCOUNT-ID'?: string;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
113
|
+
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
114
|
+
* key).
|
|
115
|
+
*/
|
|
116
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
60
119
|
export declare namespace FutureUpdate {
|
|
61
|
-
export {
|
|
120
|
+
export {
|
|
121
|
+
type CancelSubscription as CancelSubscription,
|
|
122
|
+
type FutureUpdateCancelPendingPaymentParams as FutureUpdateCancelPendingPaymentParams,
|
|
123
|
+
type FutureUpdateCancelScheduleParams as FutureUpdateCancelScheduleParams,
|
|
124
|
+
};
|
|
62
125
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export {
|
|
4
|
-
|
|
3
|
+
export {
|
|
4
|
+
FutureUpdate,
|
|
5
|
+
type CancelSubscription,
|
|
6
|
+
type FutureUpdateCancelPendingPaymentParams,
|
|
7
|
+
type FutureUpdateCancelScheduleParams,
|
|
8
|
+
} from './future-update';
|
|
9
|
+
export { Invoice, type InvoiceMarkAsPaidResponse, type InvoiceMarkAsPaidParams } from './invoice';
|
|
5
10
|
export {
|
|
6
11
|
Subscriptions,
|
|
7
12
|
type Subscription,
|
|
@@ -9,6 +14,7 @@ export {
|
|
|
9
14
|
type SubscriptionImportResponse,
|
|
10
15
|
type SubscriptionPreviewResponse,
|
|
11
16
|
type SubscriptionProvisionResponse,
|
|
17
|
+
type SubscriptionRetrieveParams,
|
|
12
18
|
type SubscriptionUpdateParams,
|
|
13
19
|
type SubscriptionListParams,
|
|
14
20
|
type SubscriptionCancelParams,
|
|
@@ -25,4 +31,5 @@ export {
|
|
|
25
31
|
type UsageChargeUsageResponse,
|
|
26
32
|
type UsageSyncResponse,
|
|
27
33
|
type UsageChargeUsageParams,
|
|
34
|
+
type UsageSyncParams,
|
|
28
35
|
} from './usage';
|
|
@@ -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,8 +20,22 @@ export class Invoice extends APIResource {
|
|
|
19
20
|
* await client.v1.subscriptions.invoice.markAsPaid('x');
|
|
20
21
|
* ```
|
|
21
22
|
*/
|
|
22
|
-
markAsPaid(
|
|
23
|
-
|
|
23
|
+
markAsPaid(
|
|
24
|
+
id: string,
|
|
25
|
+
params: InvoiceMarkAsPaidParams | null | undefined = {},
|
|
26
|
+
options?: RequestOptions,
|
|
27
|
+
): APIPromise<InvoiceMarkAsPaidResponse> {
|
|
28
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
|
|
29
|
+
return this._client.post(path`/api/v1/subscriptions/${id}/invoice/paid`, {
|
|
30
|
+
...options,
|
|
31
|
+
headers: buildHeaders([
|
|
32
|
+
{
|
|
33
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
34
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
35
|
+
},
|
|
36
|
+
options?.headers,
|
|
37
|
+
]),
|
|
38
|
+
});
|
|
24
39
|
}
|
|
25
40
|
}
|
|
26
41
|
|
|
@@ -46,6 +61,24 @@ export namespace InvoiceMarkAsPaidResponse {
|
|
|
46
61
|
}
|
|
47
62
|
}
|
|
48
63
|
|
|
64
|
+
export interface InvoiceMarkAsPaidParams {
|
|
65
|
+
/**
|
|
66
|
+
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
67
|
+
* back to the user's first membership. Ignored for API-key auth.
|
|
68
|
+
*/
|
|
69
|
+
'X-ACCOUNT-ID'?: string;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
73
|
+
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
74
|
+
* key).
|
|
75
|
+
*/
|
|
76
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
49
79
|
export declare namespace Invoice {
|
|
50
|
-
export {
|
|
80
|
+
export {
|
|
81
|
+
type InvoiceMarkAsPaidResponse as InvoiceMarkAsPaidResponse,
|
|
82
|
+
type InvoiceMarkAsPaidParams as InvoiceMarkAsPaidParams,
|
|
83
|
+
};
|
|
51
84
|
}
|