@stigg/typescript 0.1.0-beta.2 → 0.1.0-beta.4
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 +22 -0
- package/package.json +1 -1
- package/resources/v1/addons/addons.d.mts +172 -1
- package/resources/v1/addons/addons.d.mts.map +1 -1
- package/resources/v1/addons/addons.d.ts +172 -1
- package/resources/v1/addons/addons.d.ts.map +1 -1
- package/resources/v1/addons/addons.js +6 -0
- package/resources/v1/addons/addons.js.map +1 -1
- package/resources/v1/addons/addons.mjs +6 -0
- package/resources/v1/addons/addons.mjs.map +1 -1
- package/resources/v1/addons/index.d.mts +1 -1
- package/resources/v1/addons/index.d.mts.map +1 -1
- package/resources/v1/addons/index.d.ts +1 -1
- 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/credits/credits.d.mts +78 -7
- package/resources/v1/credits/credits.d.mts.map +1 -1
- package/resources/v1/credits/credits.d.ts +78 -7
- package/resources/v1/credits/credits.d.ts.map +1 -1
- package/resources/v1/credits/credits.js +7 -4
- package/resources/v1/credits/credits.js.map +1 -1
- package/resources/v1/credits/credits.mjs +7 -4
- package/resources/v1/credits/credits.mjs.map +1 -1
- package/resources/v1/credits/custom-currencies.d.mts +8 -8
- package/resources/v1/credits/custom-currencies.d.mts.map +1 -1
- package/resources/v1/credits/custom-currencies.d.ts +8 -8
- package/resources/v1/credits/custom-currencies.d.ts.map +1 -1
- package/resources/v1/credits/index.d.mts +2 -3
- package/resources/v1/credits/index.d.mts.map +1 -1
- package/resources/v1/credits/index.d.ts +2 -3
- package/resources/v1/credits/index.d.ts.map +1 -1
- package/resources/v1/credits/index.js +1 -3
- package/resources/v1/credits/index.js.map +1 -1
- package/resources/v1/credits/index.mjs +0 -1
- package/resources/v1/credits/index.mjs.map +1 -1
- package/resources/v1/index.d.mts +3 -3
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +3 -3
- 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/index.d.mts +1 -1
- package/resources/v1/plans/index.d.mts.map +1 -1
- package/resources/v1/plans/index.d.ts +1 -1
- 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 +343 -1
- package/resources/v1/plans/plans.d.mts.map +1 -1
- package/resources/v1/plans/plans.d.ts +343 -1
- package/resources/v1/plans/plans.d.ts.map +1 -1
- package/resources/v1/plans/plans.js +12 -0
- package/resources/v1/plans/plans.js.map +1 -1
- package/resources/v1/plans/plans.mjs +12 -0
- package/resources/v1/plans/plans.mjs.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.mts +12 -9
- package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.ts +12 -9
- package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.js.map +1 -1
- package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
- package/resources/v1/v1.d.mts +6 -6
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +6 -6
- 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 +566 -0
- package/src/resources/v1/addons/index.ts +3 -0
- package/src/resources/v1/credits/credits.ts +99 -16
- package/src/resources/v1/credits/custom-currencies.ts +8 -8
- package/src/resources/v1/credits/index.ts +3 -6
- package/src/resources/v1/index.ts +11 -0
- package/src/resources/v1/plans/index.ts +6 -0
- package/src/resources/v1/plans/plans.ts +1132 -0
- package/src/resources/v1/subscriptions/subscriptions.ts +12 -9
- package/src/resources/v1/v1.ts +22 -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
- package/resources/v1/credits/auto-recharge.d.mts +0 -84
- package/resources/v1/credits/auto-recharge.d.mts.map +0 -1
- package/resources/v1/credits/auto-recharge.d.ts +0 -84
- package/resources/v1/credits/auto-recharge.d.ts.map +0 -1
- package/resources/v1/credits/auto-recharge.js +0 -16
- package/resources/v1/credits/auto-recharge.js.map +0 -1
- package/resources/v1/credits/auto-recharge.mjs +0 -12
- package/resources/v1/credits/auto-recharge.mjs.map +0 -1
- package/src/resources/v1/credits/auto-recharge.ts +0 -109
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../../core/resource';
|
|
4
|
-
import * as AutoRechargeAPI from './auto-recharge';
|
|
5
|
-
import {
|
|
6
|
-
AutoRecharge,
|
|
7
|
-
AutoRechargeGetAutoRechargeParams,
|
|
8
|
-
AutoRechargeGetAutoRechargeResponse,
|
|
9
|
-
} from './auto-recharge';
|
|
10
4
|
import * as CustomCurrenciesAPI from './custom-currencies';
|
|
11
5
|
import {
|
|
12
6
|
CustomCurrencies,
|
|
13
|
-
CustomCurrency,
|
|
14
7
|
CustomCurrencyCreateParams,
|
|
15
8
|
CustomCurrencyListAssociatedEntitiesResponse,
|
|
16
9
|
CustomCurrencyListParams,
|
|
17
10
|
CustomCurrencyListResponse,
|
|
18
11
|
CustomCurrencyListResponsesMyCursorIDPage,
|
|
12
|
+
CustomCurrencyResponse,
|
|
19
13
|
CustomCurrencyUpdateParams,
|
|
20
14
|
} from './custom-currencies';
|
|
21
15
|
import * as GrantsAPI from './grants';
|
|
@@ -36,7 +30,17 @@ export class Credits extends APIResource {
|
|
|
36
30
|
customCurrencies: CustomCurrenciesAPI.CustomCurrencies = new CustomCurrenciesAPI.CustomCurrencies(
|
|
37
31
|
this._client,
|
|
38
32
|
);
|
|
39
|
-
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Retrieves the automatic recharge configuration for a customer and currency.
|
|
36
|
+
* Returns default settings if no configuration exists.
|
|
37
|
+
*/
|
|
38
|
+
getAutoRecharge(
|
|
39
|
+
query: CreditGetAutoRechargeParams,
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<CreditGetAutoRechargeResponse> {
|
|
42
|
+
return this._client.get('/api/v1/credits/auto-recharge', { query, ...options });
|
|
43
|
+
}
|
|
40
44
|
|
|
41
45
|
/**
|
|
42
46
|
* Retrieves credit usage time-series data for a customer, grouped by feature, over
|
|
@@ -62,6 +66,78 @@ export class Credits extends APIResource {
|
|
|
62
66
|
|
|
63
67
|
export type CreditListLedgerResponsesMyCursorIDPage = MyCursorIDPage<CreditListLedgerResponse>;
|
|
64
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Response object
|
|
71
|
+
*/
|
|
72
|
+
export interface CreditGetAutoRechargeResponse {
|
|
73
|
+
/**
|
|
74
|
+
* Automatic recharge configuration for a customer and currency
|
|
75
|
+
*/
|
|
76
|
+
data: CreditGetAutoRechargeResponse.Data;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export namespace CreditGetAutoRechargeResponse {
|
|
80
|
+
/**
|
|
81
|
+
* Automatic recharge configuration for a customer and currency
|
|
82
|
+
*/
|
|
83
|
+
export interface Data {
|
|
84
|
+
/**
|
|
85
|
+
* The unique configuration ID
|
|
86
|
+
*/
|
|
87
|
+
id: string | null;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Timestamp of when the record was created
|
|
91
|
+
*/
|
|
92
|
+
createdAt: string | null;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The currency ID for this configuration
|
|
96
|
+
*/
|
|
97
|
+
currencyId: string;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The customer ID this configuration belongs to
|
|
101
|
+
*/
|
|
102
|
+
customerId: string;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Expiration period for auto-recharge grants (1_MONTH or 1_YEAR)
|
|
106
|
+
*/
|
|
107
|
+
grantExpirationPeriod: '1_MONTH' | '1_YEAR';
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Whether automatic recharge is enabled
|
|
111
|
+
*/
|
|
112
|
+
isEnabled: boolean;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Maximum monthly spend limit for automatic recharges
|
|
116
|
+
*/
|
|
117
|
+
maxSpendLimit: number | null;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The target credit balance to recharge to
|
|
121
|
+
*/
|
|
122
|
+
targetBalance: number;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* The threshold type (CREDIT_AMOUNT or DOLLAR_AMOUNT)
|
|
126
|
+
*/
|
|
127
|
+
thresholdType: 'CREDIT_AMOUNT' | 'DOLLAR_AMOUNT';
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* The threshold value that triggers a recharge
|
|
131
|
+
*/
|
|
132
|
+
thresholdValue: number;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Timestamp of when the record was last updated
|
|
136
|
+
*/
|
|
137
|
+
updatedAt: string | null;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
65
141
|
/**
|
|
66
142
|
* Response object
|
|
67
143
|
*/
|
|
@@ -220,6 +296,18 @@ export interface CreditListLedgerResponse {
|
|
|
220
296
|
timestamp: string;
|
|
221
297
|
}
|
|
222
298
|
|
|
299
|
+
export interface CreditGetAutoRechargeParams {
|
|
300
|
+
/**
|
|
301
|
+
* Filter by currency ID (required)
|
|
302
|
+
*/
|
|
303
|
+
currencyId: string;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Filter by customer ID (required)
|
|
307
|
+
*/
|
|
308
|
+
customerId: string;
|
|
309
|
+
}
|
|
310
|
+
|
|
223
311
|
export interface CreditGetUsageParams {
|
|
224
312
|
/**
|
|
225
313
|
* Filter by customer ID (required)
|
|
@@ -274,13 +362,14 @@ export interface CreditListLedgerParams extends MyCursorIDPageParams {
|
|
|
274
362
|
|
|
275
363
|
Credits.Grants = Grants;
|
|
276
364
|
Credits.CustomCurrencies = CustomCurrencies;
|
|
277
|
-
Credits.AutoRecharge = AutoRecharge;
|
|
278
365
|
|
|
279
366
|
export declare namespace Credits {
|
|
280
367
|
export {
|
|
368
|
+
type CreditGetAutoRechargeResponse as CreditGetAutoRechargeResponse,
|
|
281
369
|
type CreditGetUsageResponse as CreditGetUsageResponse,
|
|
282
370
|
type CreditListLedgerResponse as CreditListLedgerResponse,
|
|
283
371
|
type CreditListLedgerResponsesMyCursorIDPage as CreditListLedgerResponsesMyCursorIDPage,
|
|
372
|
+
type CreditGetAutoRechargeParams as CreditGetAutoRechargeParams,
|
|
284
373
|
type CreditGetUsageParams as CreditGetUsageParams,
|
|
285
374
|
type CreditListLedgerParams as CreditListLedgerParams,
|
|
286
375
|
};
|
|
@@ -296,7 +385,7 @@ export declare namespace Credits {
|
|
|
296
385
|
|
|
297
386
|
export {
|
|
298
387
|
CustomCurrencies as CustomCurrencies,
|
|
299
|
-
type
|
|
388
|
+
type CustomCurrencyResponse as CustomCurrencyResponse,
|
|
300
389
|
type CustomCurrencyListResponse as CustomCurrencyListResponse,
|
|
301
390
|
type CustomCurrencyListAssociatedEntitiesResponse as CustomCurrencyListAssociatedEntitiesResponse,
|
|
302
391
|
type CustomCurrencyListResponsesMyCursorIDPage as CustomCurrencyListResponsesMyCursorIDPage,
|
|
@@ -304,10 +393,4 @@ export declare namespace Credits {
|
|
|
304
393
|
type CustomCurrencyUpdateParams as CustomCurrencyUpdateParams,
|
|
305
394
|
type CustomCurrencyListParams as CustomCurrencyListParams,
|
|
306
395
|
};
|
|
307
|
-
|
|
308
|
-
export {
|
|
309
|
-
AutoRecharge as AutoRecharge,
|
|
310
|
-
type AutoRechargeGetAutoRechargeResponse as AutoRechargeGetAutoRechargeResponse,
|
|
311
|
-
type AutoRechargeGetAutoRechargeParams as AutoRechargeGetAutoRechargeParams,
|
|
312
|
-
};
|
|
313
396
|
}
|
|
@@ -13,7 +13,7 @@ export class CustomCurrencies extends APIResource {
|
|
|
13
13
|
/**
|
|
14
14
|
* Creates a new custom currency in the environment.
|
|
15
15
|
*/
|
|
16
|
-
create(body: CustomCurrencyCreateParams, options?: RequestOptions): APIPromise<
|
|
16
|
+
create(body: CustomCurrencyCreateParams, options?: RequestOptions): APIPromise<CustomCurrencyResponse> {
|
|
17
17
|
return this._client.post('/api/v1/credits/custom-currencies', { body, ...options });
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -24,7 +24,7 @@ export class CustomCurrencies extends APIResource {
|
|
|
24
24
|
currencyID: string,
|
|
25
25
|
body: CustomCurrencyUpdateParams,
|
|
26
26
|
options?: RequestOptions,
|
|
27
|
-
): APIPromise<
|
|
27
|
+
): APIPromise<CustomCurrencyResponse> {
|
|
28
28
|
return this._client.patch(path`/api/v1/credits/custom-currencies/${currencyID}`, { body, ...options });
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -49,7 +49,7 @@ export class CustomCurrencies extends APIResource {
|
|
|
49
49
|
* active plan or addon — use the associated-entities endpoint first to inspect
|
|
50
50
|
* dependencies.
|
|
51
51
|
*/
|
|
52
|
-
archive(currencyID: string, options?: RequestOptions): APIPromise<
|
|
52
|
+
archive(currencyID: string, options?: RequestOptions): APIPromise<CustomCurrencyResponse> {
|
|
53
53
|
return this._client.post(path`/api/v1/credits/custom-currencies/${currencyID}/archive`, options);
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -71,7 +71,7 @@ export class CustomCurrencies extends APIResource {
|
|
|
71
71
|
* Restores a previously archived custom currency. Fails if another active currency
|
|
72
72
|
* with the same ID already exists.
|
|
73
73
|
*/
|
|
74
|
-
unarchive(currencyID: string, options?: RequestOptions): APIPromise<
|
|
74
|
+
unarchive(currencyID: string, options?: RequestOptions): APIPromise<CustomCurrencyResponse> {
|
|
75
75
|
return this._client.post(path`/api/v1/credits/custom-currencies/${currencyID}/unarchive`, options);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
@@ -81,14 +81,14 @@ export type CustomCurrencyListResponsesMyCursorIDPage = MyCursorIDPage<CustomCur
|
|
|
81
81
|
/**
|
|
82
82
|
* Response object
|
|
83
83
|
*/
|
|
84
|
-
export interface
|
|
84
|
+
export interface CustomCurrencyResponse {
|
|
85
85
|
/**
|
|
86
86
|
* A custom currency used to denominate credit-based entitlements and pricing
|
|
87
87
|
*/
|
|
88
|
-
data:
|
|
88
|
+
data: CustomCurrencyResponse.Data;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
export namespace
|
|
91
|
+
export namespace CustomCurrencyResponse {
|
|
92
92
|
/**
|
|
93
93
|
* A custom currency used to denominate credit-based entitlements and pricing
|
|
94
94
|
*/
|
|
@@ -361,7 +361,7 @@ export interface CustomCurrencyListParams extends MyCursorIDPageParams {
|
|
|
361
361
|
|
|
362
362
|
export declare namespace CustomCurrencies {
|
|
363
363
|
export {
|
|
364
|
-
type
|
|
364
|
+
type CustomCurrencyResponse as CustomCurrencyResponse,
|
|
365
365
|
type CustomCurrencyListResponse as CustomCurrencyListResponse,
|
|
366
366
|
type CustomCurrencyListAssociatedEntitiesResponse as CustomCurrencyListAssociatedEntitiesResponse,
|
|
367
367
|
type CustomCurrencyListResponsesMyCursorIDPage as CustomCurrencyListResponsesMyCursorIDPage,
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export {
|
|
4
|
-
AutoRecharge,
|
|
5
|
-
type AutoRechargeGetAutoRechargeResponse,
|
|
6
|
-
type AutoRechargeGetAutoRechargeParams,
|
|
7
|
-
} from './auto-recharge';
|
|
8
3
|
export {
|
|
9
4
|
Credits,
|
|
5
|
+
type CreditGetAutoRechargeResponse,
|
|
10
6
|
type CreditGetUsageResponse,
|
|
11
7
|
type CreditListLedgerResponse,
|
|
8
|
+
type CreditGetAutoRechargeParams,
|
|
12
9
|
type CreditGetUsageParams,
|
|
13
10
|
type CreditListLedgerParams,
|
|
14
11
|
type CreditListLedgerResponsesMyCursorIDPage,
|
|
15
12
|
} from './credits';
|
|
16
13
|
export {
|
|
17
14
|
CustomCurrencies,
|
|
18
|
-
type
|
|
15
|
+
type CustomCurrencyResponse,
|
|
19
16
|
type CustomCurrencyListResponse,
|
|
20
17
|
type CustomCurrencyListAssociatedEntitiesResponse,
|
|
21
18
|
type CustomCurrencyCreateParams,
|
|
@@ -4,13 +4,16 @@ export {
|
|
|
4
4
|
Addons,
|
|
5
5
|
type Addon,
|
|
6
6
|
type AddonListResponse,
|
|
7
|
+
type AddonListChargesResponse,
|
|
7
8
|
type AddonPublishResponse,
|
|
8
9
|
type AddonRemoveDraftResponse,
|
|
9
10
|
type AddonCreateParams,
|
|
10
11
|
type AddonUpdateParams,
|
|
11
12
|
type AddonListParams,
|
|
13
|
+
type AddonListChargesParams,
|
|
12
14
|
type AddonPublishParams,
|
|
13
15
|
type AddonListResponsesMyCursorIDPage,
|
|
16
|
+
type AddonListChargesResponsesMyCursorIDPage,
|
|
14
17
|
} from './addons/index';
|
|
15
18
|
export {
|
|
16
19
|
Coupons,
|
|
@@ -23,8 +26,10 @@ export {
|
|
|
23
26
|
} from './coupons';
|
|
24
27
|
export {
|
|
25
28
|
Credits,
|
|
29
|
+
type CreditGetAutoRechargeResponse,
|
|
26
30
|
type CreditGetUsageResponse,
|
|
27
31
|
type CreditListLedgerResponse,
|
|
32
|
+
type CreditGetAutoRechargeParams,
|
|
28
33
|
type CreditGetUsageParams,
|
|
29
34
|
type CreditListLedgerParams,
|
|
30
35
|
type CreditListLedgerResponsesMyCursorIDPage,
|
|
@@ -62,13 +67,19 @@ export {
|
|
|
62
67
|
Plans,
|
|
63
68
|
type Plan,
|
|
64
69
|
type PlanListResponse,
|
|
70
|
+
type PlanListChargesResponse,
|
|
71
|
+
type PlanListOverageChargesResponse,
|
|
65
72
|
type PlanPublishResponse,
|
|
66
73
|
type PlanRemoveDraftResponse,
|
|
67
74
|
type PlanCreateParams,
|
|
68
75
|
type PlanUpdateParams,
|
|
69
76
|
type PlanListParams,
|
|
77
|
+
type PlanListChargesParams,
|
|
78
|
+
type PlanListOverageChargesParams,
|
|
70
79
|
type PlanPublishParams,
|
|
71
80
|
type PlanListResponsesMyCursorIDPage,
|
|
81
|
+
type PlanListChargesResponsesMyCursorIDPage,
|
|
82
|
+
type PlanListOverageChargesResponsesMyCursorIDPage,
|
|
72
83
|
} from './plans/index';
|
|
73
84
|
export {
|
|
74
85
|
Products,
|
|
@@ -13,11 +13,17 @@ export {
|
|
|
13
13
|
Plans,
|
|
14
14
|
type Plan,
|
|
15
15
|
type PlanListResponse,
|
|
16
|
+
type PlanListChargesResponse,
|
|
17
|
+
type PlanListOverageChargesResponse,
|
|
16
18
|
type PlanPublishResponse,
|
|
17
19
|
type PlanRemoveDraftResponse,
|
|
18
20
|
type PlanCreateParams,
|
|
19
21
|
type PlanUpdateParams,
|
|
20
22
|
type PlanListParams,
|
|
23
|
+
type PlanListChargesParams,
|
|
24
|
+
type PlanListOverageChargesParams,
|
|
21
25
|
type PlanPublishParams,
|
|
22
26
|
type PlanListResponsesMyCursorIDPage,
|
|
27
|
+
type PlanListChargesResponsesMyCursorIDPage,
|
|
28
|
+
type PlanListOverageChargesResponsesMyCursorIDPage,
|
|
23
29
|
} from './plans';
|