@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
|
|
|
@@ -21,10 +22,21 @@ export class Usage extends APIResource {
|
|
|
21
22
|
*/
|
|
22
23
|
chargeUsage(
|
|
23
24
|
id: string,
|
|
24
|
-
|
|
25
|
+
params: UsageChargeUsageParams,
|
|
25
26
|
options?: RequestOptions,
|
|
26
27
|
): APIPromise<UsageChargeUsageResponse> {
|
|
27
|
-
|
|
28
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
29
|
+
return this._client.post(path`/api/v1/subscriptions/${id}/usage/charge`, {
|
|
30
|
+
body,
|
|
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
|
+
});
|
|
28
40
|
}
|
|
29
41
|
|
|
30
42
|
/**
|
|
@@ -38,8 +50,22 @@ export class Usage extends APIResource {
|
|
|
38
50
|
* );
|
|
39
51
|
* ```
|
|
40
52
|
*/
|
|
41
|
-
sync(
|
|
42
|
-
|
|
53
|
+
sync(
|
|
54
|
+
id: string,
|
|
55
|
+
params: UsageSyncParams | null | undefined = {},
|
|
56
|
+
options?: RequestOptions,
|
|
57
|
+
): APIPromise<UsageSyncResponse> {
|
|
58
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
|
|
59
|
+
return this._client.post(path`/api/v1/subscriptions/${id}/usage/sync`, {
|
|
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
|
+
});
|
|
43
69
|
}
|
|
44
70
|
}
|
|
45
71
|
|
|
@@ -128,9 +154,38 @@ export namespace UsageSyncResponse {
|
|
|
128
154
|
|
|
129
155
|
export interface UsageChargeUsageParams {
|
|
130
156
|
/**
|
|
131
|
-
* Cutoff date for usage calculation. If not provided, the current time
|
|
157
|
+
* Body param: Cutoff date for usage calculation. If not provided, the current time
|
|
158
|
+
* is used.
|
|
132
159
|
*/
|
|
133
160
|
untilDate?: string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
164
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
165
|
+
*/
|
|
166
|
+
'X-ACCOUNT-ID'?: string;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
170
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
171
|
+
* intrinsic to the key).
|
|
172
|
+
*/
|
|
173
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export interface UsageSyncParams {
|
|
177
|
+
/**
|
|
178
|
+
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
179
|
+
* back to the user's first membership. Ignored for API-key auth.
|
|
180
|
+
*/
|
|
181
|
+
'X-ACCOUNT-ID'?: string;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
185
|
+
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
186
|
+
* key).
|
|
187
|
+
*/
|
|
188
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
134
189
|
}
|
|
135
190
|
|
|
136
191
|
export declare namespace Usage {
|
|
@@ -138,5 +193,6 @@ export declare namespace Usage {
|
|
|
138
193
|
type UsageChargeUsageResponse as UsageChargeUsageResponse,
|
|
139
194
|
type UsageSyncResponse as UsageSyncResponse,
|
|
140
195
|
type UsageChargeUsageParams as UsageChargeUsageParams,
|
|
196
|
+
type UsageSyncParams as UsageSyncParams,
|
|
141
197
|
};
|
|
142
198
|
}
|
|
@@ -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
|
|
|
@@ -28,8 +29,18 @@ export class Usage extends APIResource {
|
|
|
28
29
|
params: UsageHistoryParams,
|
|
29
30
|
options?: RequestOptions,
|
|
30
31
|
): APIPromise<UsageHistoryResponse> {
|
|
31
|
-
const { customerId, ...query } = params;
|
|
32
|
-
return this._client.get(path`/api/v1/usage/${customerId}/history/${featureID}`, {
|
|
32
|
+
const { customerId, 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params;
|
|
33
|
+
return this._client.get(path`/api/v1/usage/${customerId}/history/${featureID}`, {
|
|
34
|
+
query,
|
|
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
|
+
});
|
|
33
44
|
}
|
|
34
45
|
|
|
35
46
|
/**
|
|
@@ -49,8 +60,19 @@ export class Usage extends APIResource {
|
|
|
49
60
|
* });
|
|
50
61
|
* ```
|
|
51
62
|
*/
|
|
52
|
-
report(
|
|
53
|
-
|
|
63
|
+
report(params: UsageReportParams, options?: RequestOptions): APIPromise<UsageReportResponse> {
|
|
64
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
65
|
+
return this._client.post('/api/v1/usage', {
|
|
66
|
+
body,
|
|
67
|
+
...options,
|
|
68
|
+
headers: buildHeaders([
|
|
69
|
+
{
|
|
70
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
71
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
72
|
+
},
|
|
73
|
+
options?.headers,
|
|
74
|
+
]),
|
|
75
|
+
});
|
|
54
76
|
}
|
|
55
77
|
}
|
|
56
78
|
|
|
@@ -250,13 +272,39 @@ export interface UsageHistoryParams {
|
|
|
250
272
|
* Query param: Resource id
|
|
251
273
|
*/
|
|
252
274
|
resourceId?: string | null;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
278
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
279
|
+
*/
|
|
280
|
+
'X-ACCOUNT-ID'?: string;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
284
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
285
|
+
* intrinsic to the key).
|
|
286
|
+
*/
|
|
287
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
253
288
|
}
|
|
254
289
|
|
|
255
290
|
export interface UsageReportParams {
|
|
256
291
|
/**
|
|
257
|
-
* A list of usage reports to be submitted in bulk
|
|
292
|
+
* Body param: A list of usage reports to be submitted in bulk
|
|
258
293
|
*/
|
|
259
294
|
usages: Array<UsageReportParams.Usage>;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
298
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
299
|
+
*/
|
|
300
|
+
'X-ACCOUNT-ID'?: string;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
304
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
305
|
+
* intrinsic to the key).
|
|
306
|
+
*/
|
|
307
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
260
308
|
}
|
|
261
309
|
|
|
262
310
|
export namespace UsageReportParams {
|
package/src/resources/v1/v1.ts
CHANGED
|
@@ -4,31 +4,38 @@ import { APIResource } from '../../core/resource';
|
|
|
4
4
|
import * as CouponsAPI from './coupons';
|
|
5
5
|
import {
|
|
6
6
|
Coupon,
|
|
7
|
+
CouponArchiveCouponParams,
|
|
7
8
|
CouponCreateParams,
|
|
8
9
|
CouponListParams,
|
|
9
10
|
CouponListResponse,
|
|
10
11
|
CouponListResponsesMyCursorIDPage,
|
|
12
|
+
CouponRetrieveParams,
|
|
11
13
|
CouponUpdateCouponParams,
|
|
12
14
|
Coupons,
|
|
13
15
|
} from './coupons';
|
|
14
16
|
import * as FeaturesAPI from './features';
|
|
15
17
|
import {
|
|
16
18
|
Feature,
|
|
19
|
+
FeatureArchiveFeatureParams,
|
|
17
20
|
FeatureCreateFeatureParams,
|
|
18
21
|
FeatureListFeaturesParams,
|
|
19
22
|
FeatureListFeaturesResponse,
|
|
20
23
|
FeatureListFeaturesResponsesMyCursorIDPage,
|
|
24
|
+
FeatureRetrieveFeatureParams,
|
|
25
|
+
FeatureUnarchiveFeatureParams,
|
|
21
26
|
FeatureUpdateFeatureParams,
|
|
22
27
|
Features,
|
|
23
28
|
} from './features';
|
|
24
29
|
import * as ProductsAPI from './products';
|
|
25
30
|
import {
|
|
26
31
|
Product,
|
|
32
|
+
ProductArchiveProductParams,
|
|
27
33
|
ProductCreateProductParams,
|
|
28
34
|
ProductDuplicateProductParams,
|
|
29
35
|
ProductListProductsParams,
|
|
30
36
|
ProductListProductsResponse,
|
|
31
37
|
ProductListProductsResponsesMyCursorIDPage,
|
|
38
|
+
ProductUnarchiveProductParams,
|
|
32
39
|
ProductUpdateProductParams,
|
|
33
40
|
Products,
|
|
34
41
|
} from './products';
|
|
@@ -43,6 +50,8 @@ import {
|
|
|
43
50
|
import * as AddonsAPI from './addons/addons';
|
|
44
51
|
import {
|
|
45
52
|
Addon,
|
|
53
|
+
AddonArchiveParams,
|
|
54
|
+
AddonCreateDraftParams,
|
|
46
55
|
AddonCreateParams,
|
|
47
56
|
AddonListChargesParams,
|
|
48
57
|
AddonListChargesResponse,
|
|
@@ -52,7 +61,9 @@ import {
|
|
|
52
61
|
AddonListResponsesMyCursorIDPage,
|
|
53
62
|
AddonPublishParams,
|
|
54
63
|
AddonPublishResponse,
|
|
64
|
+
AddonRemoveDraftParams,
|
|
55
65
|
AddonRemoveDraftResponse,
|
|
66
|
+
AddonRetrieveParams,
|
|
56
67
|
AddonUpdateParams,
|
|
57
68
|
Addons,
|
|
58
69
|
} from './addons/addons';
|
|
@@ -69,6 +80,7 @@ import {
|
|
|
69
80
|
} from './credits/credits';
|
|
70
81
|
import * as CustomersAPI from './customers/customers';
|
|
71
82
|
import {
|
|
83
|
+
CustomerArchiveParams,
|
|
72
84
|
CustomerCheckEntitlementParams,
|
|
73
85
|
CustomerCheckEntitlementResponse,
|
|
74
86
|
CustomerImportParams,
|
|
@@ -84,6 +96,8 @@ import {
|
|
|
84
96
|
CustomerResponse,
|
|
85
97
|
CustomerRetrieveEntitlementsParams,
|
|
86
98
|
CustomerRetrieveEntitlementsResponse,
|
|
99
|
+
CustomerRetrieveParams,
|
|
100
|
+
CustomerUnarchiveParams,
|
|
87
101
|
CustomerUpdateParams,
|
|
88
102
|
Customers,
|
|
89
103
|
} from './customers/customers';
|
|
@@ -92,6 +106,8 @@ import { EventReportParams, EventReportResponse, Events } from './events/events'
|
|
|
92
106
|
import * as PlansAPI from './plans/plans';
|
|
93
107
|
import {
|
|
94
108
|
Plan,
|
|
109
|
+
PlanArchiveParams,
|
|
110
|
+
PlanCreateDraftParams,
|
|
95
111
|
PlanCreateParams,
|
|
96
112
|
PlanListChargesParams,
|
|
97
113
|
PlanListChargesResponse,
|
|
@@ -104,7 +120,9 @@ import {
|
|
|
104
120
|
PlanListResponsesMyCursorIDPage,
|
|
105
121
|
PlanPublishParams,
|
|
106
122
|
PlanPublishResponse,
|
|
123
|
+
PlanRemoveDraftParams,
|
|
107
124
|
PlanRemoveDraftResponse,
|
|
125
|
+
PlanRetrieveParams,
|
|
108
126
|
PlanUpdateParams,
|
|
109
127
|
Plans,
|
|
110
128
|
} from './plans/plans';
|
|
@@ -123,6 +141,7 @@ import {
|
|
|
123
141
|
SubscriptionPreviewResponse,
|
|
124
142
|
SubscriptionProvisionParams,
|
|
125
143
|
SubscriptionProvisionResponse,
|
|
144
|
+
SubscriptionRetrieveParams,
|
|
126
145
|
SubscriptionTransferParams,
|
|
127
146
|
SubscriptionUpdateParams,
|
|
128
147
|
Subscriptions,
|
|
@@ -164,13 +183,16 @@ export declare namespace V1 {
|
|
|
164
183
|
type CustomerRetrieveEntitlementsResponse as CustomerRetrieveEntitlementsResponse,
|
|
165
184
|
type CustomerListResponsesMyCursorIDPage as CustomerListResponsesMyCursorIDPage,
|
|
166
185
|
type CustomerListResourcesResponsesMyCursorIDPage as CustomerListResourcesResponsesMyCursorIDPage,
|
|
186
|
+
type CustomerRetrieveParams as CustomerRetrieveParams,
|
|
167
187
|
type CustomerUpdateParams as CustomerUpdateParams,
|
|
168
188
|
type CustomerListParams as CustomerListParams,
|
|
189
|
+
type CustomerArchiveParams as CustomerArchiveParams,
|
|
169
190
|
type CustomerCheckEntitlementParams as CustomerCheckEntitlementParams,
|
|
170
191
|
type CustomerImportParams as CustomerImportParams,
|
|
171
192
|
type CustomerListResourcesParams as CustomerListResourcesParams,
|
|
172
193
|
type CustomerProvisionParams as CustomerProvisionParams,
|
|
173
194
|
type CustomerRetrieveEntitlementsParams as CustomerRetrieveEntitlementsParams,
|
|
195
|
+
type CustomerUnarchiveParams as CustomerUnarchiveParams,
|
|
174
196
|
};
|
|
175
197
|
|
|
176
198
|
export {
|
|
@@ -181,6 +203,7 @@ export declare namespace V1 {
|
|
|
181
203
|
type SubscriptionPreviewResponse as SubscriptionPreviewResponse,
|
|
182
204
|
type SubscriptionProvisionResponse as SubscriptionProvisionResponse,
|
|
183
205
|
type SubscriptionListResponsesMyCursorIDPage as SubscriptionListResponsesMyCursorIDPage,
|
|
206
|
+
type SubscriptionRetrieveParams as SubscriptionRetrieveParams,
|
|
184
207
|
type SubscriptionUpdateParams as SubscriptionUpdateParams,
|
|
185
208
|
type SubscriptionListParams as SubscriptionListParams,
|
|
186
209
|
type SubscriptionCancelParams as SubscriptionCancelParams,
|
|
@@ -198,7 +221,9 @@ export declare namespace V1 {
|
|
|
198
221
|
type CouponListResponse as CouponListResponse,
|
|
199
222
|
type CouponListResponsesMyCursorIDPage as CouponListResponsesMyCursorIDPage,
|
|
200
223
|
type CouponCreateParams as CouponCreateParams,
|
|
224
|
+
type CouponRetrieveParams as CouponRetrieveParams,
|
|
201
225
|
type CouponListParams as CouponListParams,
|
|
226
|
+
type CouponArchiveCouponParams as CouponArchiveCouponParams,
|
|
202
227
|
type CouponUpdateCouponParams as CouponUpdateCouponParams,
|
|
203
228
|
};
|
|
204
229
|
|
|
@@ -224,8 +249,11 @@ export declare namespace V1 {
|
|
|
224
249
|
type Feature as Feature,
|
|
225
250
|
type FeatureListFeaturesResponse as FeatureListFeaturesResponse,
|
|
226
251
|
type FeatureListFeaturesResponsesMyCursorIDPage as FeatureListFeaturesResponsesMyCursorIDPage,
|
|
252
|
+
type FeatureArchiveFeatureParams as FeatureArchiveFeatureParams,
|
|
227
253
|
type FeatureCreateFeatureParams as FeatureCreateFeatureParams,
|
|
228
254
|
type FeatureListFeaturesParams as FeatureListFeaturesParams,
|
|
255
|
+
type FeatureRetrieveFeatureParams as FeatureRetrieveFeatureParams,
|
|
256
|
+
type FeatureUnarchiveFeatureParams as FeatureUnarchiveFeatureParams,
|
|
229
257
|
type FeatureUpdateFeatureParams as FeatureUpdateFeatureParams,
|
|
230
258
|
};
|
|
231
259
|
|
|
@@ -239,10 +267,14 @@ export declare namespace V1 {
|
|
|
239
267
|
type AddonListResponsesMyCursorIDPage as AddonListResponsesMyCursorIDPage,
|
|
240
268
|
type AddonListChargesResponsesMyCursorIDPage as AddonListChargesResponsesMyCursorIDPage,
|
|
241
269
|
type AddonCreateParams as AddonCreateParams,
|
|
270
|
+
type AddonRetrieveParams as AddonRetrieveParams,
|
|
242
271
|
type AddonUpdateParams as AddonUpdateParams,
|
|
243
272
|
type AddonListParams as AddonListParams,
|
|
273
|
+
type AddonArchiveParams as AddonArchiveParams,
|
|
274
|
+
type AddonCreateDraftParams as AddonCreateDraftParams,
|
|
244
275
|
type AddonListChargesParams as AddonListChargesParams,
|
|
245
276
|
type AddonPublishParams as AddonPublishParams,
|
|
277
|
+
type AddonRemoveDraftParams as AddonRemoveDraftParams,
|
|
246
278
|
};
|
|
247
279
|
|
|
248
280
|
export {
|
|
@@ -257,11 +289,15 @@ export declare namespace V1 {
|
|
|
257
289
|
type PlanListChargesResponsesMyCursorIDPage as PlanListChargesResponsesMyCursorIDPage,
|
|
258
290
|
type PlanListOverageChargesResponsesMyCursorIDPage as PlanListOverageChargesResponsesMyCursorIDPage,
|
|
259
291
|
type PlanCreateParams as PlanCreateParams,
|
|
292
|
+
type PlanRetrieveParams as PlanRetrieveParams,
|
|
260
293
|
type PlanUpdateParams as PlanUpdateParams,
|
|
261
294
|
type PlanListParams as PlanListParams,
|
|
295
|
+
type PlanArchiveParams as PlanArchiveParams,
|
|
296
|
+
type PlanCreateDraftParams as PlanCreateDraftParams,
|
|
262
297
|
type PlanListChargesParams as PlanListChargesParams,
|
|
263
298
|
type PlanListOverageChargesParams as PlanListOverageChargesParams,
|
|
264
299
|
type PlanPublishParams as PlanPublishParams,
|
|
300
|
+
type PlanRemoveDraftParams as PlanRemoveDraftParams,
|
|
265
301
|
};
|
|
266
302
|
|
|
267
303
|
export {
|
|
@@ -277,9 +313,11 @@ export declare namespace V1 {
|
|
|
277
313
|
type Product as Product,
|
|
278
314
|
type ProductListProductsResponse as ProductListProductsResponse,
|
|
279
315
|
type ProductListProductsResponsesMyCursorIDPage as ProductListProductsResponsesMyCursorIDPage,
|
|
316
|
+
type ProductArchiveProductParams as ProductArchiveProductParams,
|
|
280
317
|
type ProductCreateProductParams as ProductCreateProductParams,
|
|
281
318
|
type ProductDuplicateProductParams as ProductDuplicateProductParams,
|
|
282
319
|
type ProductListProductsParams as ProductListProductsParams,
|
|
320
|
+
type ProductUnarchiveProductParams as ProductUnarchiveProductParams,
|
|
283
321
|
type ProductUpdateProductParams as ProductUpdateProductParams,
|
|
284
322
|
};
|
|
285
323
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-beta.
|
|
1
|
+
export const VERSION = '0.1.0-beta.21'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.0-beta.
|
|
1
|
+
export declare const VERSION = "0.1.0-beta.21";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.0-beta.
|
|
1
|
+
export declare const VERSION = "0.1.0-beta.21";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
|
-
exports.VERSION = '0.1.0-beta.
|
|
4
|
+
exports.VERSION = '0.1.0-beta.21'; // x-release-please-version
|
|
5
5
|
//# sourceMappingURL=version.js.map
|
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-beta.
|
|
1
|
+
export const VERSION = '0.1.0-beta.21'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|