@stigg/typescript 0.1.0-beta.46 → 0.1.0-beta.48
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 +21 -0
- package/client.d.mts +1 -1
- package/client.d.ts +1 -1
- package/client.js +3 -3
- package/client.js.map +1 -1
- package/client.mjs +3 -3
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/v1/addons/addons.d.mts +27 -4
- package/resources/v1/addons/addons.d.mts.map +1 -1
- package/resources/v1/addons/addons.d.ts +27 -4
- package/resources/v1/addons/addons.d.ts.map +1 -1
- package/resources/v1/addons/addons.js.map +1 -1
- package/resources/v1/addons/addons.mjs.map +1 -1
- package/resources/v1/contracts.d.mts +1618 -0
- package/resources/v1/contracts.d.mts.map +1 -0
- package/resources/v1/contracts.d.ts +1618 -0
- package/resources/v1/contracts.d.ts.map +1 -0
- package/resources/v1/contracts.js +108 -0
- package/resources/v1/contracts.js.map +1 -0
- package/resources/v1/contracts.mjs +104 -0
- package/resources/v1/contracts.mjs.map +1 -0
- package/resources/v1/credits/grants.d.mts +2 -2
- package/resources/v1/credits/grants.d.ts +2 -2
- package/resources/v1/customers/customers.d.mts +342 -1
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +342 -1
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +41 -0
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +41 -0
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.mts +1 -1
- package/resources/v1/customers/index.d.mts.map +1 -1
- package/resources/v1/customers/index.d.ts +1 -1
- 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.map +1 -1
- package/resources/v1/events/beta/beta.d.mts +10 -0
- package/resources/v1/events/beta/beta.d.mts.map +1 -0
- package/resources/v1/events/beta/beta.d.ts +10 -0
- package/resources/v1/events/beta/beta.d.ts.map +1 -0
- package/resources/v1/events/beta/beta.js +17 -0
- package/resources/v1/events/beta/beta.js.map +1 -0
- package/resources/v1/events/beta/beta.mjs +12 -0
- package/resources/v1/events/beta/beta.mjs.map +1 -0
- package/resources/v1/events/beta/customers.d.mts +160 -0
- package/resources/v1/events/beta/customers.d.mts.map +1 -0
- package/resources/v1/events/beta/customers.d.ts +160 -0
- package/resources/v1/events/beta/customers.d.ts.map +1 -0
- package/resources/v1/events/beta/customers.js +32 -0
- package/resources/v1/events/beta/customers.js.map +1 -0
- package/resources/v1/events/beta/customers.mjs +28 -0
- package/resources/v1/events/beta/customers.mjs.map +1 -0
- package/resources/v1/events/beta/index.d.mts +3 -0
- package/resources/v1/events/beta/index.d.mts.map +1 -0
- package/resources/v1/events/beta/index.d.ts +3 -0
- package/resources/v1/events/beta/index.d.ts.map +1 -0
- package/resources/v1/events/beta/index.js +9 -0
- package/resources/v1/events/beta/index.js.map +1 -0
- package/resources/v1/events/beta/index.mjs +4 -0
- package/resources/v1/events/beta/index.mjs.map +1 -0
- package/resources/v1/events/beta.d.mts +2 -0
- package/resources/v1/events/beta.d.mts.map +1 -0
- package/resources/v1/events/beta.d.ts +2 -0
- package/resources/v1/events/beta.d.ts.map +1 -0
- package/resources/v1/events/beta.js +6 -0
- package/resources/v1/events/beta.js.map +1 -0
- package/resources/v1/events/beta.mjs +3 -0
- package/resources/v1/events/beta.mjs.map +1 -0
- package/resources/v1/events/data-export/data-export.d.mts +2 -2
- package/resources/v1/events/data-export/data-export.d.mts.map +1 -1
- package/resources/v1/events/data-export/data-export.d.ts +2 -2
- package/resources/v1/events/data-export/data-export.d.ts.map +1 -1
- package/resources/v1/events/data-export/destinations.d.mts +27 -27
- package/resources/v1/events/data-export/destinations.d.mts.map +1 -1
- package/resources/v1/events/data-export/destinations.d.ts +27 -27
- package/resources/v1/events/data-export/destinations.d.ts.map +1 -1
- package/resources/v1/events/data-export/destinations.js +13 -13
- package/resources/v1/events/data-export/destinations.js.map +1 -1
- package/resources/v1/events/data-export/destinations.mjs +13 -13
- package/resources/v1/events/data-export/destinations.mjs.map +1 -1
- package/resources/v1/events/data-export/index.d.mts +1 -1
- package/resources/v1/events/data-export/index.d.mts.map +1 -1
- package/resources/v1/events/data-export/index.d.ts +1 -1
- package/resources/v1/events/data-export/index.d.ts.map +1 -1
- package/resources/v1/events/events.d.mts +10 -6
- package/resources/v1/events/events.d.mts.map +1 -1
- package/resources/v1/events/events.d.ts +10 -6
- package/resources/v1/events/events.d.ts.map +1 -1
- package/resources/v1/events/events.js +5 -1
- package/resources/v1/events/events.js.map +1 -1
- package/resources/v1/events/events.mjs +5 -1
- package/resources/v1/events/events.mjs.map +1 -1
- package/resources/v1/events/index.d.mts +2 -1
- package/resources/v1/events/index.d.mts.map +1 -1
- package/resources/v1/events/index.d.ts +2 -1
- package/resources/v1/events/index.d.ts.map +1 -1
- package/resources/v1/events/index.js +5 -3
- package/resources/v1/events/index.js.map +1 -1
- package/resources/v1/events/index.mjs +1 -0
- package/resources/v1/events/index.mjs.map +1 -1
- package/resources/v1/index.d.mts +4 -3
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +4 -3
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +3 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +1 -0
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/plans/plans.d.mts +27 -4
- package/resources/v1/plans/plans.d.mts.map +1 -1
- package/resources/v1/plans/plans.d.ts +27 -4
- package/resources/v1/plans/plans.d.ts.map +1 -1
- package/resources/v1/plans/plans.js.map +1 -1
- package/resources/v1/plans/plans.mjs.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.mts +12 -0
- package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.ts +12 -0
- 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/usage.d.mts +6 -6
- package/resources/v1/usage.d.mts.map +1 -1
- package/resources/v1/usage.d.ts +6 -6
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +1 -1
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +1 -1
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +10 -6
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +10 -6
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +4 -0
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +4 -0
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v1-beta/customers/customers.d.mts +0 -160
- package/resources/v1-beta/customers/customers.d.mts.map +1 -1
- package/resources/v1-beta/customers/customers.d.ts +0 -160
- package/resources/v1-beta/customers/customers.d.ts.map +1 -1
- package/resources/v1-beta/customers/customers.js +0 -29
- package/resources/v1-beta/customers/customers.js.map +1 -1
- package/resources/v1-beta/customers/customers.mjs +0 -29
- package/resources/v1-beta/customers/customers.mjs.map +1 -1
- package/resources/v1-beta/customers/index.d.mts +1 -1
- package/resources/v1-beta/customers/index.d.mts.map +1 -1
- package/resources/v1-beta/customers/index.d.ts +1 -1
- package/resources/v1-beta/customers/index.d.ts.map +1 -1
- package/resources/v1-beta/customers/index.js.map +1 -1
- package/resources/v1-beta/customers/index.mjs +1 -1
- package/resources/v1-beta/customers/index.mjs.map +1 -1
- package/resources/v1-beta/index.d.mts +1 -1
- package/resources/v1-beta/index.d.mts.map +1 -1
- package/resources/v1-beta/index.d.ts +1 -1
- package/resources/v1-beta/index.d.ts.map +1 -1
- package/resources/v1-beta/index.js.map +1 -1
- package/resources/v1-beta/index.mjs +1 -1
- package/resources/v1-beta/index.mjs.map +1 -1
- package/resources/v1-beta/v1-beta.d.mts +2 -2
- package/resources/v1-beta/v1-beta.d.mts.map +1 -1
- package/resources/v1-beta/v1-beta.d.ts +2 -2
- package/resources/v1-beta/v1-beta.d.ts.map +1 -1
- package/resources/v1-beta/v1-beta.js.map +1 -1
- package/resources/v1-beta/v1-beta.mjs +1 -1
- package/resources/v1-beta/v1-beta.mjs.map +1 -1
- package/src/client.ts +3 -3
- package/src/resources/v1/addons/addons.ts +32 -5
- package/src/resources/v1/contracts.ts +3228 -0
- package/src/resources/v1/credits/grants.ts +2 -2
- package/src/resources/v1/customers/customers.ts +573 -0
- package/src/resources/v1/customers/index.ts +5 -0
- package/src/resources/v1/events/beta/beta.ts +19 -0
- package/src/resources/v1/events/beta/customers.ts +212 -0
- package/src/resources/v1/events/beta/index.ts +8 -0
- package/src/resources/v1/events/beta.ts +3 -0
- package/src/resources/v1/events/data-export/data-export.ts +4 -4
- package/src/resources/v1/events/data-export/destinations.ts +41 -41
- package/src/resources/v1/events/data-export/index.ts +2 -2
- package/src/resources/v1/events/events.ts +13 -10
- package/src/resources/v1/events/index.ts +3 -2
- package/src/resources/v1/index.ts +23 -4
- package/src/resources/v1/plans/plans.ts +32 -5
- package/src/resources/v1/subscriptions/subscriptions.ts +15 -0
- package/src/resources/v1/usage.ts +7 -10
- package/src/resources/v1/v1.ts +50 -8
- package/src/resources/v1-beta/customers/customers.ts +0 -211
- package/src/resources/v1-beta/customers/index.ts +1 -5
- package/src/resources/v1-beta/index.ts +1 -5
- package/src/resources/v1-beta/v1-beta.ts +2 -10
- 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
|
@@ -15,10 +15,7 @@ export class Usage extends APIResource {
|
|
|
15
15
|
* estimated cost per credit currency, the current balance, and the balance after
|
|
16
16
|
* the estimated consumption.
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
params: UsageEstimateCostParams,
|
|
20
|
-
options?: RequestOptions,
|
|
21
|
-
): APIPromise<UsageEstimateCostResponse> {
|
|
18
|
+
estimate(params: UsageEstimateParams, options?: RequestOptions): APIPromise<UsageEstimateResponse> {
|
|
22
19
|
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
23
20
|
return this._client.post('/api/v1/usage/estimate', {
|
|
24
21
|
body,
|
|
@@ -78,14 +75,14 @@ export class Usage extends APIResource {
|
|
|
78
75
|
/**
|
|
79
76
|
* Response object
|
|
80
77
|
*/
|
|
81
|
-
export interface
|
|
78
|
+
export interface UsageEstimateResponse {
|
|
82
79
|
/**
|
|
83
80
|
* Estimated credit cost, current balance and balance after
|
|
84
81
|
*/
|
|
85
|
-
data:
|
|
82
|
+
data: UsageEstimateResponse.Data;
|
|
86
83
|
}
|
|
87
84
|
|
|
88
|
-
export namespace
|
|
85
|
+
export namespace UsageEstimateResponse {
|
|
89
86
|
/**
|
|
90
87
|
* Estimated credit cost, current balance and balance after
|
|
91
88
|
*/
|
|
@@ -376,7 +373,7 @@ export namespace UsageReportResponse {
|
|
|
376
373
|
}
|
|
377
374
|
}
|
|
378
375
|
|
|
379
|
-
export interface
|
|
376
|
+
export interface UsageEstimateParams {
|
|
380
377
|
/**
|
|
381
378
|
* Body param: Customer id
|
|
382
379
|
*/
|
|
@@ -530,10 +527,10 @@ export namespace UsageReportParams {
|
|
|
530
527
|
|
|
531
528
|
export declare namespace Usage {
|
|
532
529
|
export {
|
|
533
|
-
type
|
|
530
|
+
type UsageEstimateResponse as UsageEstimateResponse,
|
|
534
531
|
type UsageHistoryResponse as UsageHistoryResponse,
|
|
535
532
|
type UsageReportResponse as UsageReportResponse,
|
|
536
|
-
type
|
|
533
|
+
type UsageEstimateParams as UsageEstimateParams,
|
|
537
534
|
type UsageHistoryParams as UsageHistoryParams,
|
|
538
535
|
type UsageReportParams as UsageReportParams,
|
|
539
536
|
};
|
package/src/resources/v1/v1.ts
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
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 ContractsAPI from './contracts';
|
|
5
|
+
import {
|
|
6
|
+
ContractCreateParams,
|
|
7
|
+
ContractCreateResponse,
|
|
8
|
+
ContractDeleteParams,
|
|
9
|
+
ContractDeleteResponse,
|
|
10
|
+
ContractListParams,
|
|
11
|
+
ContractListResponse,
|
|
12
|
+
ContractListResponsesMyCursorIDPage,
|
|
13
|
+
ContractRetrieveParams,
|
|
14
|
+
ContractRetrieveResponse,
|
|
15
|
+
ContractUpdateParams,
|
|
16
|
+
ContractUpdateResponse,
|
|
17
|
+
Contracts,
|
|
18
|
+
} from './contracts';
|
|
4
19
|
import * as CouponsAPI from './coupons';
|
|
5
20
|
import {
|
|
6
21
|
Coupon,
|
|
@@ -42,8 +57,8 @@ import {
|
|
|
42
57
|
import * as UsageAPI from './usage';
|
|
43
58
|
import {
|
|
44
59
|
Usage,
|
|
45
|
-
|
|
46
|
-
|
|
60
|
+
UsageEstimateParams,
|
|
61
|
+
UsageEstimateResponse,
|
|
47
62
|
UsageHistoryParams,
|
|
48
63
|
UsageHistoryResponse,
|
|
49
64
|
UsageReportParams,
|
|
@@ -88,6 +103,11 @@ import {
|
|
|
88
103
|
CustomerImportParams,
|
|
89
104
|
CustomerImportResponse,
|
|
90
105
|
CustomerIntegrationResponse,
|
|
106
|
+
CustomerListContractsParams,
|
|
107
|
+
CustomerListContractsResponse,
|
|
108
|
+
CustomerListInvoicesParams,
|
|
109
|
+
CustomerListInvoicesResponse,
|
|
110
|
+
CustomerListInvoicesResponsesMyCursorIDPage,
|
|
91
111
|
CustomerListParams,
|
|
92
112
|
CustomerListResourcesParams,
|
|
93
113
|
CustomerListResourcesResponse,
|
|
@@ -105,8 +125,8 @@ import {
|
|
|
105
125
|
} from './customers/customers';
|
|
106
126
|
import * as EventsAPI from './events/events';
|
|
107
127
|
import {
|
|
108
|
-
|
|
109
|
-
|
|
128
|
+
EventEstimateParams,
|
|
129
|
+
EventEstimateResponse,
|
|
110
130
|
EventReportParams,
|
|
111
131
|
EventReportResponse,
|
|
112
132
|
Events,
|
|
@@ -166,6 +186,7 @@ export class V1 extends APIResource {
|
|
|
166
186
|
plans: PlansAPI.Plans = new PlansAPI.Plans(this._client);
|
|
167
187
|
usage: UsageAPI.Usage = new UsageAPI.Usage(this._client);
|
|
168
188
|
products: ProductsAPI.Products = new ProductsAPI.Products(this._client);
|
|
189
|
+
contracts: ContractsAPI.Contracts = new ContractsAPI.Contracts(this._client);
|
|
169
190
|
}
|
|
170
191
|
|
|
171
192
|
V1.Customers = Customers;
|
|
@@ -178,6 +199,7 @@ V1.Addons = Addons;
|
|
|
178
199
|
V1.Plans = Plans;
|
|
179
200
|
V1.Usage = Usage;
|
|
180
201
|
V1.Products = Products;
|
|
202
|
+
V1.Contracts = Contracts;
|
|
181
203
|
|
|
182
204
|
export declare namespace V1 {
|
|
183
205
|
export {
|
|
@@ -187,9 +209,12 @@ export declare namespace V1 {
|
|
|
187
209
|
type CustomerListResponse as CustomerListResponse,
|
|
188
210
|
type CustomerCheckEntitlementResponse as CustomerCheckEntitlementResponse,
|
|
189
211
|
type CustomerImportResponse as CustomerImportResponse,
|
|
212
|
+
type CustomerListContractsResponse as CustomerListContractsResponse,
|
|
213
|
+
type CustomerListInvoicesResponse as CustomerListInvoicesResponse,
|
|
190
214
|
type CustomerListResourcesResponse as CustomerListResourcesResponse,
|
|
191
215
|
type CustomerRetrieveEntitlementsResponse as CustomerRetrieveEntitlementsResponse,
|
|
192
216
|
type CustomerListResponsesMyCursorIDPage as CustomerListResponsesMyCursorIDPage,
|
|
217
|
+
type CustomerListInvoicesResponsesMyCursorIDPage as CustomerListInvoicesResponsesMyCursorIDPage,
|
|
193
218
|
type CustomerListResourcesResponsesMyCursorIDPage as CustomerListResourcesResponsesMyCursorIDPage,
|
|
194
219
|
type CustomerRetrieveParams as CustomerRetrieveParams,
|
|
195
220
|
type CustomerUpdateParams as CustomerUpdateParams,
|
|
@@ -197,6 +222,8 @@ export declare namespace V1 {
|
|
|
197
222
|
type CustomerArchiveParams as CustomerArchiveParams,
|
|
198
223
|
type CustomerCheckEntitlementParams as CustomerCheckEntitlementParams,
|
|
199
224
|
type CustomerImportParams as CustomerImportParams,
|
|
225
|
+
type CustomerListContractsParams as CustomerListContractsParams,
|
|
226
|
+
type CustomerListInvoicesParams as CustomerListInvoicesParams,
|
|
200
227
|
type CustomerListResourcesParams as CustomerListResourcesParams,
|
|
201
228
|
type CustomerProvisionParams as CustomerProvisionParams,
|
|
202
229
|
type CustomerRetrieveEntitlementsParams as CustomerRetrieveEntitlementsParams,
|
|
@@ -237,9 +264,9 @@ export declare namespace V1 {
|
|
|
237
264
|
|
|
238
265
|
export {
|
|
239
266
|
Events as Events,
|
|
240
|
-
type
|
|
267
|
+
type EventEstimateResponse as EventEstimateResponse,
|
|
241
268
|
type EventReportResponse as EventReportResponse,
|
|
242
|
-
type
|
|
269
|
+
type EventEstimateParams as EventEstimateParams,
|
|
243
270
|
type EventReportParams as EventReportParams,
|
|
244
271
|
};
|
|
245
272
|
|
|
@@ -312,10 +339,10 @@ export declare namespace V1 {
|
|
|
312
339
|
|
|
313
340
|
export {
|
|
314
341
|
Usage as Usage,
|
|
315
|
-
type
|
|
342
|
+
type UsageEstimateResponse as UsageEstimateResponse,
|
|
316
343
|
type UsageHistoryResponse as UsageHistoryResponse,
|
|
317
344
|
type UsageReportResponse as UsageReportResponse,
|
|
318
|
-
type
|
|
345
|
+
type UsageEstimateParams as UsageEstimateParams,
|
|
319
346
|
type UsageHistoryParams as UsageHistoryParams,
|
|
320
347
|
type UsageReportParams as UsageReportParams,
|
|
321
348
|
};
|
|
@@ -332,4 +359,19 @@ export declare namespace V1 {
|
|
|
332
359
|
type ProductUnarchiveProductParams as ProductUnarchiveProductParams,
|
|
333
360
|
type ProductUpdateProductParams as ProductUpdateProductParams,
|
|
334
361
|
};
|
|
362
|
+
|
|
363
|
+
export {
|
|
364
|
+
Contracts as Contracts,
|
|
365
|
+
type ContractCreateResponse as ContractCreateResponse,
|
|
366
|
+
type ContractRetrieveResponse as ContractRetrieveResponse,
|
|
367
|
+
type ContractUpdateResponse as ContractUpdateResponse,
|
|
368
|
+
type ContractListResponse as ContractListResponse,
|
|
369
|
+
type ContractDeleteResponse as ContractDeleteResponse,
|
|
370
|
+
type ContractListResponsesMyCursorIDPage as ContractListResponsesMyCursorIDPage,
|
|
371
|
+
type ContractCreateParams as ContractCreateParams,
|
|
372
|
+
type ContractRetrieveParams as ContractRetrieveParams,
|
|
373
|
+
type ContractUpdateParams as ContractUpdateParams,
|
|
374
|
+
type ContractListParams as ContractListParams,
|
|
375
|
+
type ContractDeleteParams as ContractDeleteParams,
|
|
376
|
+
};
|
|
335
377
|
}
|
|
@@ -27,217 +27,11 @@ import {
|
|
|
27
27
|
} from './entities';
|
|
28
28
|
import * as EntitlementsAPI from './entitlements';
|
|
29
29
|
import { EntitlementCheckParams, EntitlementCheckResponse, Entitlements } from './entitlements';
|
|
30
|
-
import { APIPromise } from '../../../core/api-promise';
|
|
31
|
-
import { buildHeaders } from '../../../internal/headers';
|
|
32
|
-
import { RequestOptions } from '../../../internal/request-options';
|
|
33
|
-
import { path } from '../../../internal/utils/path';
|
|
34
30
|
|
|
35
31
|
export class Customers extends APIResource {
|
|
36
32
|
entitlements: EntitlementsAPI.Entitlements = new EntitlementsAPI.Entitlements(this._client);
|
|
37
33
|
entities: EntitiesAPI.Entities = new EntitiesAPI.Entities(this._client);
|
|
38
34
|
assignments: AssignmentsAPI.Assignments = new AssignmentsAPI.Assignments(this._client);
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Queries the customer's governance hierarchy tree, returning a cursor-paginated
|
|
42
|
-
* list of nodes with their usage configuration (limit, cadence, scope) and current
|
|
43
|
-
* usage, sortable and filterable by usage. Each node carries `parentId` so the
|
|
44
|
-
* tree can be rebuilt client-side. Usage is read from a periodically-refreshed
|
|
45
|
-
* read model and never gates access.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```ts
|
|
49
|
-
* const response =
|
|
50
|
-
* await client.v1Beta.customers.retrieveGovernance('id');
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
retrieveGovernance(
|
|
54
|
-
id: string,
|
|
55
|
-
params: CustomerRetrieveGovernanceParams | null | undefined = {},
|
|
56
|
-
options?: RequestOptions,
|
|
57
|
-
): APIPromise<CustomerRetrieveGovernanceResponse> {
|
|
58
|
-
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
|
|
59
|
-
return this._client.get(path`/api/v1-beta/customers/${id}/governance`, {
|
|
60
|
-
query,
|
|
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
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Paginated list of governance tree nodes, each with its usage configuration and
|
|
75
|
-
* current usage.
|
|
76
|
-
*/
|
|
77
|
-
export interface CustomerRetrieveGovernanceResponse {
|
|
78
|
-
data: Array<CustomerRetrieveGovernanceResponse.Data>;
|
|
79
|
-
|
|
80
|
-
pagination: CustomerRetrieveGovernanceResponse.Pagination;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export namespace CustomerRetrieveGovernanceResponse {
|
|
84
|
-
/**
|
|
85
|
-
* A node of the governance hierarchy tree with its usage configuration (limit,
|
|
86
|
-
* cadence, scope) and current usage. Usage is read from a periodically-refreshed
|
|
87
|
-
* read model and may lag the live counter by a short interval; it never gates
|
|
88
|
-
* access.
|
|
89
|
-
*/
|
|
90
|
-
export interface Data {
|
|
91
|
-
/**
|
|
92
|
-
* Usage-reset cadence as an ISO-8601 single-unit duration, e.g. `P1M`, `P30D`,
|
|
93
|
-
* `PT1M`; `null` when the node has no usage configuration.
|
|
94
|
-
*/
|
|
95
|
-
cadence: string | null;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Usage consumed in the current cadence period (may lag the live counter by a
|
|
99
|
-
* short interval).
|
|
100
|
-
*/
|
|
101
|
-
currentUsage: number | null;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* External id of the entity at this node.
|
|
105
|
-
*/
|
|
106
|
-
entityId: string;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* External id of the entity type (e.g. `team`, `user`).
|
|
110
|
-
*/
|
|
111
|
-
entityTypeId: string;
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* External id of the parent entity in the tree; `null` for a root. Use it to
|
|
115
|
-
* rebuild the tree.
|
|
116
|
-
*/
|
|
117
|
-
parentId: string | null;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* The configuration scope (entity ids). Empty is the node-wide configuration; a
|
|
121
|
-
* non-empty set is a dimension-scoped sub-configuration.
|
|
122
|
-
*/
|
|
123
|
-
scopeEntityIds: Array<string>;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Hard usage limit for this node per cadence period.
|
|
127
|
-
*/
|
|
128
|
-
usageLimit: number | null;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Exclusive end of the cadence period — when usage resets; `null` once the period
|
|
132
|
-
* has rolled over.
|
|
133
|
-
*/
|
|
134
|
-
usagePeriodEnd: string | null;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Start of the cadence period the usage snapshot belongs to; `null` once the
|
|
138
|
-
* period has rolled over.
|
|
139
|
-
*/
|
|
140
|
-
usagePeriodStart: string | null;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* `currentUsage / usageLimit` (1 when usageLimit is 0 — always at limit). The
|
|
144
|
-
* cross-capability-safe sort key.
|
|
145
|
-
*/
|
|
146
|
-
utilization: number | null;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* The metered currency ID (present when the configured capability is a credit
|
|
150
|
-
* currency).
|
|
151
|
-
*/
|
|
152
|
-
currencyId?: string;
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* The metered feature ID (present when the configured capability is a feature).
|
|
156
|
-
*/
|
|
157
|
-
featureId?: string;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export interface Pagination {
|
|
161
|
-
/**
|
|
162
|
-
* Cursor for fetching the next page of results, or null if no additional pages
|
|
163
|
-
* exist
|
|
164
|
-
*/
|
|
165
|
-
next: string | null;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export interface CustomerRetrieveGovernanceParams {
|
|
170
|
-
/**
|
|
171
|
-
* Query param: Return items that come after this cursor
|
|
172
|
-
*/
|
|
173
|
-
after?: string;
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Query param: Currency ids to include, repeated per value (e.g.
|
|
177
|
-
* `?currencyIds=credits`). Omit both featureIds and currencyIds for tree mode.
|
|
178
|
-
*/
|
|
179
|
-
currencyIds?: Array<string>;
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Query param: Case-insensitive substring match on the entity id (`%`/`_` matched
|
|
183
|
-
* literally).
|
|
184
|
-
*/
|
|
185
|
-
entityIdSearch?: string;
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Query param: Filter to one or more entity types, repeated per value (e.g.
|
|
189
|
-
* `?entityTypeIds=team&entityTypeIds=user`).
|
|
190
|
-
*/
|
|
191
|
-
entityTypeIds?: Array<string>;
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Query param: Feature ids to include, repeated per value (e.g.
|
|
195
|
-
* `?featureIds=ai-tokens&featureIds=seats`). Omit both featureIds and currencyIds
|
|
196
|
-
* for tree mode — every node in the hierarchy with no usage configuration
|
|
197
|
-
* attached.
|
|
198
|
-
*/
|
|
199
|
-
featureIds?: Array<string>;
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Query param: Maximum number of items to return
|
|
203
|
-
*/
|
|
204
|
-
limit?: number;
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Query param: Only nodes with utilization ≥ this value (e.g. 0.8 for ≥80%, 1 for
|
|
208
|
-
* at/over limit).
|
|
209
|
-
*/
|
|
210
|
-
minUtilization?: number;
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Query param: Sort direction: `asc` or `desc` (default `desc`).
|
|
214
|
-
*/
|
|
215
|
-
order?: 'asc' | 'desc';
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Query param: Filter by configuration scope: `all` (default), `nodeWide` (`[]`
|
|
219
|
-
* only), or `scoped` (non-empty only).
|
|
220
|
-
*/
|
|
221
|
-
scope?: 'all' | 'nodeWide' | 'scoped';
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Query param: Sort key: `utilization` (default, cross-capability-safe),
|
|
225
|
-
* `currentUsage`, `usageLimit`, `scopeSize`, `id`, or `createdAt`.
|
|
226
|
-
*/
|
|
227
|
-
sortBy?: 'utilization' | 'currentUsage' | 'usageLimit' | 'scopeSize' | 'id' | 'createdAt';
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
231
|
-
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
232
|
-
*/
|
|
233
|
-
'X-ACCOUNT-ID'?: string;
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* Header param: Environment ID — required when authenticating with a user JWT
|
|
237
|
-
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
238
|
-
* intrinsic to the key).
|
|
239
|
-
*/
|
|
240
|
-
'X-ENVIRONMENT-ID'?: string;
|
|
241
35
|
}
|
|
242
36
|
|
|
243
37
|
Customers.Entitlements = Entitlements;
|
|
@@ -245,11 +39,6 @@ Customers.Entities = Entities;
|
|
|
245
39
|
Customers.Assignments = Assignments;
|
|
246
40
|
|
|
247
41
|
export declare namespace Customers {
|
|
248
|
-
export {
|
|
249
|
-
type CustomerRetrieveGovernanceResponse as CustomerRetrieveGovernanceResponse,
|
|
250
|
-
type CustomerRetrieveGovernanceParams as CustomerRetrieveGovernanceParams,
|
|
251
|
-
};
|
|
252
|
-
|
|
253
42
|
export {
|
|
254
43
|
Entitlements as Entitlements,
|
|
255
44
|
type EntitlementCheckResponse as EntitlementCheckResponse,
|
|
@@ -8,11 +8,7 @@ export {
|
|
|
8
8
|
type AssignmentUpsertParams,
|
|
9
9
|
type AssignmentListResponsesMyCursorIDPage,
|
|
10
10
|
} from './assignments';
|
|
11
|
-
export {
|
|
12
|
-
Customers,
|
|
13
|
-
type CustomerRetrieveGovernanceResponse,
|
|
14
|
-
type CustomerRetrieveGovernanceParams,
|
|
15
|
-
} from './customers';
|
|
11
|
+
export { Customers } from './customers';
|
|
16
12
|
export {
|
|
17
13
|
Entities,
|
|
18
14
|
type EntityRetrieveResponse,
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export {
|
|
4
|
-
Customers,
|
|
5
|
-
type CustomerRetrieveGovernanceResponse,
|
|
6
|
-
type CustomerRetrieveGovernanceParams,
|
|
7
|
-
} from './customers/index';
|
|
3
|
+
export { Customers } from './customers/index';
|
|
8
4
|
export {
|
|
9
5
|
EntityTypes,
|
|
10
6
|
type EntityTypeListResponse,
|
|
@@ -11,11 +11,7 @@ import {
|
|
|
11
11
|
EntityTypes,
|
|
12
12
|
} from './entity-types';
|
|
13
13
|
import * as CustomersAPI from './customers/customers';
|
|
14
|
-
import {
|
|
15
|
-
CustomerRetrieveGovernanceParams,
|
|
16
|
-
CustomerRetrieveGovernanceResponse,
|
|
17
|
-
Customers,
|
|
18
|
-
} from './customers/customers';
|
|
14
|
+
import { Customers } from './customers/customers';
|
|
19
15
|
|
|
20
16
|
export class V1Beta extends APIResource {
|
|
21
17
|
customers: CustomersAPI.Customers = new CustomersAPI.Customers(this._client);
|
|
@@ -26,11 +22,7 @@ V1Beta.Customers = Customers;
|
|
|
26
22
|
V1Beta.EntityTypes = EntityTypes;
|
|
27
23
|
|
|
28
24
|
export declare namespace V1Beta {
|
|
29
|
-
export {
|
|
30
|
-
Customers as Customers,
|
|
31
|
-
type CustomerRetrieveGovernanceResponse as CustomerRetrieveGovernanceResponse,
|
|
32
|
-
type CustomerRetrieveGovernanceParams as CustomerRetrieveGovernanceParams,
|
|
33
|
-
};
|
|
25
|
+
export { Customers as Customers };
|
|
34
26
|
|
|
35
27
|
export {
|
|
36
28
|
EntityTypes as EntityTypes,
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-beta.
|
|
1
|
+
export const VERSION = '0.1.0-beta.48'; // 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.48";
|
|
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.48";
|
|
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.48'; // 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.48'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|