@stigg/typescript 0.1.0-beta.45 → 0.1.0-beta.47
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/credits/grants.d.mts +38 -2
- package/resources/v1/credits/grants.d.mts.map +1 -1
- package/resources/v1/credits/grants.d.ts +38 -2
- package/resources/v1/credits/grants.d.ts.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 +2 -2
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +2 -2
- package/resources/v1/index.d.ts.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/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 +4 -4
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +4 -4
- package/resources/v1/v1.d.ts.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/credits/grants.ts +74 -2
- 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 +4 -4
- package/src/resources/v1/plans/plans.ts +32 -5
- package/src/resources/v1/usage.ts +7 -10
- package/src/resources/v1/v1.ts +8 -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
|
@@ -147,7 +147,7 @@ export namespace CreditGrantResponse {
|
|
|
147
147
|
expireAt: string | null;
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
|
-
* The type of credit grant (PAID, PROMOTIONAL, RECURRING)
|
|
150
|
+
* The type of credit grant (PAID, PROMOTIONAL, RECURRING, OVERDRAFT)
|
|
151
151
|
*/
|
|
152
152
|
grantType: 'PAID' | 'PROMOTIONAL' | 'RECURRING' | 'OVERDRAFT';
|
|
153
153
|
|
|
@@ -191,6 +191,11 @@ export namespace CreditGrantResponse {
|
|
|
191
191
|
*/
|
|
192
192
|
status: 'PAYMENT_PENDING' | 'ACTIVE' | 'EXPIRED' | 'VOIDED' | 'SCHEDULED';
|
|
193
193
|
|
|
194
|
+
/**
|
|
195
|
+
* The synchronization states of the entity with external systems
|
|
196
|
+
*/
|
|
197
|
+
syncStates: Array<Data.SyncState> | null;
|
|
198
|
+
|
|
194
199
|
/**
|
|
195
200
|
* Timestamp of when the record was last updated
|
|
196
201
|
*/
|
|
@@ -292,6 +297,37 @@ export namespace CreditGrantResponse {
|
|
|
292
297
|
*/
|
|
293
298
|
updatedAt: string;
|
|
294
299
|
}
|
|
300
|
+
|
|
301
|
+
export interface SyncState {
|
|
302
|
+
/**
|
|
303
|
+
* Status of the integration sync
|
|
304
|
+
*/
|
|
305
|
+
status: 'PENDING' | 'ERROR' | 'SUCCESS' | 'NO_SYNC_REQUIRED';
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Synced entity id
|
|
309
|
+
*/
|
|
310
|
+
syncedEntityId: string | null;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* The vendor identifier of integration
|
|
314
|
+
*/
|
|
315
|
+
vendorIdentifier:
|
|
316
|
+
| 'AUTH0'
|
|
317
|
+
| 'ZUORA'
|
|
318
|
+
| 'STRIPE'
|
|
319
|
+
| 'HUBSPOT'
|
|
320
|
+
| 'AWS_MARKETPLACE'
|
|
321
|
+
| 'SNOWFLAKE'
|
|
322
|
+
| 'SALESFORCE'
|
|
323
|
+
| 'BIG_QUERY'
|
|
324
|
+
| 'OPEN_FGA'
|
|
325
|
+
| 'APP_STORE'
|
|
326
|
+
| 'RECEIVED'
|
|
327
|
+
| 'PREQUEL'
|
|
328
|
+
| 'AIRWALLEX'
|
|
329
|
+
| 'STRIPE_INVOICING';
|
|
330
|
+
}
|
|
295
331
|
}
|
|
296
332
|
}
|
|
297
333
|
|
|
@@ -355,7 +391,7 @@ export interface GrantListResponse {
|
|
|
355
391
|
expireAt: string | null;
|
|
356
392
|
|
|
357
393
|
/**
|
|
358
|
-
* The type of credit grant (PAID, PROMOTIONAL, RECURRING)
|
|
394
|
+
* The type of credit grant (PAID, PROMOTIONAL, RECURRING, OVERDRAFT)
|
|
359
395
|
*/
|
|
360
396
|
grantType: 'PAID' | 'PROMOTIONAL' | 'RECURRING' | 'OVERDRAFT';
|
|
361
397
|
|
|
@@ -399,6 +435,11 @@ export interface GrantListResponse {
|
|
|
399
435
|
*/
|
|
400
436
|
status: 'PAYMENT_PENDING' | 'ACTIVE' | 'EXPIRED' | 'VOIDED' | 'SCHEDULED';
|
|
401
437
|
|
|
438
|
+
/**
|
|
439
|
+
* The synchronization states of the entity with external systems
|
|
440
|
+
*/
|
|
441
|
+
syncStates: Array<GrantListResponse.SyncState> | null;
|
|
442
|
+
|
|
402
443
|
/**
|
|
403
444
|
* Timestamp of when the record was last updated
|
|
404
445
|
*/
|
|
@@ -500,6 +541,37 @@ export namespace GrantListResponse {
|
|
|
500
541
|
*/
|
|
501
542
|
updatedAt: string;
|
|
502
543
|
}
|
|
544
|
+
|
|
545
|
+
export interface SyncState {
|
|
546
|
+
/**
|
|
547
|
+
* Status of the integration sync
|
|
548
|
+
*/
|
|
549
|
+
status: 'PENDING' | 'ERROR' | 'SUCCESS' | 'NO_SYNC_REQUIRED';
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Synced entity id
|
|
553
|
+
*/
|
|
554
|
+
syncedEntityId: string | null;
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* The vendor identifier of integration
|
|
558
|
+
*/
|
|
559
|
+
vendorIdentifier:
|
|
560
|
+
| 'AUTH0'
|
|
561
|
+
| 'ZUORA'
|
|
562
|
+
| 'STRIPE'
|
|
563
|
+
| 'HUBSPOT'
|
|
564
|
+
| 'AWS_MARKETPLACE'
|
|
565
|
+
| 'SNOWFLAKE'
|
|
566
|
+
| 'SALESFORCE'
|
|
567
|
+
| 'BIG_QUERY'
|
|
568
|
+
| 'OPEN_FGA'
|
|
569
|
+
| 'APP_STORE'
|
|
570
|
+
| 'RECEIVED'
|
|
571
|
+
| 'PREQUEL'
|
|
572
|
+
| 'AIRWALLEX'
|
|
573
|
+
| 'STRIPE_INVOICING';
|
|
574
|
+
}
|
|
503
575
|
}
|
|
504
576
|
|
|
505
577
|
export interface GrantCreateParams {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../../core/resource';
|
|
4
|
+
import * as CustomersAPI from './customers';
|
|
5
|
+
import { CustomerRetrieveGovernanceParams, CustomerRetrieveGovernanceResponse, Customers } from './customers';
|
|
6
|
+
|
|
7
|
+
export class Beta extends APIResource {
|
|
8
|
+
customers: CustomersAPI.Customers = new CustomersAPI.Customers(this._client);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
Beta.Customers = Customers;
|
|
12
|
+
|
|
13
|
+
export declare namespace Beta {
|
|
14
|
+
export {
|
|
15
|
+
Customers as Customers,
|
|
16
|
+
type CustomerRetrieveGovernanceResponse as CustomerRetrieveGovernanceResponse,
|
|
17
|
+
type CustomerRetrieveGovernanceParams as CustomerRetrieveGovernanceParams,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../../../internal/request-options';
|
|
7
|
+
import { path } from '../../../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class Customers extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Queries the customer's governance hierarchy tree, returning a cursor-paginated
|
|
12
|
+
* list of nodes with their usage configuration (limit, cadence, scope) and current
|
|
13
|
+
* usage, sortable and filterable by usage. Each node carries `parentId` so the
|
|
14
|
+
* tree can be rebuilt client-side. Usage is read from a periodically-refreshed
|
|
15
|
+
* read model and never gates access.
|
|
16
|
+
*/
|
|
17
|
+
retrieveGovernance(
|
|
18
|
+
id: string,
|
|
19
|
+
params: CustomerRetrieveGovernanceParams | null | undefined = {},
|
|
20
|
+
options?: RequestOptions,
|
|
21
|
+
): APIPromise<CustomerRetrieveGovernanceResponse> {
|
|
22
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
|
|
23
|
+
return this._client.get(path`/api/v1-beta/customers/${id}/governance`, {
|
|
24
|
+
query,
|
|
25
|
+
...options,
|
|
26
|
+
headers: buildHeaders([
|
|
27
|
+
{
|
|
28
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
29
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
30
|
+
},
|
|
31
|
+
options?.headers,
|
|
32
|
+
]),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Paginated list of governance tree nodes, each with its usage configuration and
|
|
39
|
+
* current usage.
|
|
40
|
+
*/
|
|
41
|
+
export interface CustomerRetrieveGovernanceResponse {
|
|
42
|
+
data: Array<CustomerRetrieveGovernanceResponse.Data>;
|
|
43
|
+
|
|
44
|
+
pagination: CustomerRetrieveGovernanceResponse.Pagination;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export namespace CustomerRetrieveGovernanceResponse {
|
|
48
|
+
/**
|
|
49
|
+
* A node of the governance hierarchy tree with its usage configuration (limit,
|
|
50
|
+
* cadence, scope) and current usage. Usage is read from a periodically-refreshed
|
|
51
|
+
* read model and may lag the live counter by a short interval; it never gates
|
|
52
|
+
* access.
|
|
53
|
+
*/
|
|
54
|
+
export interface Data {
|
|
55
|
+
/**
|
|
56
|
+
* Usage-reset cadence as an ISO-8601 single-unit duration, e.g. `P1M`, `P30D`,
|
|
57
|
+
* `PT1M`; `null` when the node has no usage configuration.
|
|
58
|
+
*/
|
|
59
|
+
cadence: string | null;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Usage consumed in the current cadence period (may lag the live counter by a
|
|
63
|
+
* short interval).
|
|
64
|
+
*/
|
|
65
|
+
currentUsage: number | null;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* External id of the entity at this node.
|
|
69
|
+
*/
|
|
70
|
+
entityId: string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* External id of the entity type (e.g. `team`, `user`).
|
|
74
|
+
*/
|
|
75
|
+
entityTypeId: string;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* External id of the parent entity in the tree; `null` for a root. Use it to
|
|
79
|
+
* rebuild the tree.
|
|
80
|
+
*/
|
|
81
|
+
parentId: string | null;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The configuration scope (entity ids). Empty is the node-wide configuration; a
|
|
85
|
+
* non-empty set is a dimension-scoped sub-configuration.
|
|
86
|
+
*/
|
|
87
|
+
scopeEntityIds: Array<string>;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Hard usage limit for this node per cadence period.
|
|
91
|
+
*/
|
|
92
|
+
usageLimit: number | null;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Exclusive end of the cadence period — when usage resets; `null` once the period
|
|
96
|
+
* has rolled over.
|
|
97
|
+
*/
|
|
98
|
+
usagePeriodEnd: string | null;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Start of the cadence period the usage snapshot belongs to; `null` once the
|
|
102
|
+
* period has rolled over.
|
|
103
|
+
*/
|
|
104
|
+
usagePeriodStart: string | null;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* `currentUsage / usageLimit` (1 when usageLimit is 0 — always at limit). The
|
|
108
|
+
* cross-capability-safe sort key.
|
|
109
|
+
*/
|
|
110
|
+
utilization: number | null;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* The metered currency ID (present when the configured capability is a credit
|
|
114
|
+
* currency).
|
|
115
|
+
*/
|
|
116
|
+
currencyId?: string;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The metered feature ID (present when the configured capability is a feature).
|
|
120
|
+
*/
|
|
121
|
+
featureId?: string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface Pagination {
|
|
125
|
+
/**
|
|
126
|
+
* Cursor for fetching the next page of results, or null if no additional pages
|
|
127
|
+
* exist
|
|
128
|
+
*/
|
|
129
|
+
next: string | null;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface CustomerRetrieveGovernanceParams {
|
|
134
|
+
/**
|
|
135
|
+
* Query param: Return items that come after this cursor
|
|
136
|
+
*/
|
|
137
|
+
after?: string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Query param: Currency ids to include, repeated per value (e.g.
|
|
141
|
+
* `?currencyIds=credits`). Omit both featureIds and currencyIds for tree mode.
|
|
142
|
+
*/
|
|
143
|
+
currencyIds?: Array<string>;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Query param: Case-insensitive substring match on the entity id (`%`/`_` matched
|
|
147
|
+
* literally).
|
|
148
|
+
*/
|
|
149
|
+
entityIdSearch?: string;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Query param: Filter to one or more entity types, repeated per value (e.g.
|
|
153
|
+
* `?entityTypeIds=team&entityTypeIds=user`).
|
|
154
|
+
*/
|
|
155
|
+
entityTypeIds?: Array<string>;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Query param: Feature ids to include, repeated per value (e.g.
|
|
159
|
+
* `?featureIds=ai-tokens&featureIds=seats`). Omit both featureIds and currencyIds
|
|
160
|
+
* for tree mode — every node in the hierarchy with no usage configuration
|
|
161
|
+
* attached.
|
|
162
|
+
*/
|
|
163
|
+
featureIds?: Array<string>;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Query param: Maximum number of items to return
|
|
167
|
+
*/
|
|
168
|
+
limit?: number;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Query param: Only nodes with utilization ≥ this value (e.g. 0.8 for ≥80%, 1 for
|
|
172
|
+
* at/over limit).
|
|
173
|
+
*/
|
|
174
|
+
minUtilization?: number;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Query param: Sort direction: `asc` or `desc` (default `desc`).
|
|
178
|
+
*/
|
|
179
|
+
order?: 'asc' | 'desc';
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Query param: Filter by configuration scope: `all` (default), `nodeWide` (`[]`
|
|
183
|
+
* only), or `scoped` (non-empty only).
|
|
184
|
+
*/
|
|
185
|
+
scope?: 'all' | 'nodeWide' | 'scoped';
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Query param: Sort key: `utilization` (default, cross-capability-safe),
|
|
189
|
+
* `currentUsage`, `usageLimit`, `scopeSize`, `id`, or `createdAt`.
|
|
190
|
+
*/
|
|
191
|
+
sortBy?: 'utilization' | 'currentUsage' | 'usageLimit' | 'scopeSize' | 'id' | 'createdAt';
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
195
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
196
|
+
*/
|
|
197
|
+
'X-ACCOUNT-ID'?: string;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
201
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
202
|
+
* intrinsic to the key).
|
|
203
|
+
*/
|
|
204
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export declare namespace Customers {
|
|
208
|
+
export {
|
|
209
|
+
type CustomerRetrieveGovernanceResponse as CustomerRetrieveGovernanceResponse,
|
|
210
|
+
type CustomerRetrieveGovernanceParams as CustomerRetrieveGovernanceParams,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
DestinationCreateResponse,
|
|
8
8
|
DestinationDeleteParams,
|
|
9
9
|
DestinationDeleteResponse,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
DestinationUpdateSelectionParams,
|
|
11
|
+
DestinationUpdateSelectionResponse,
|
|
12
12
|
Destinations,
|
|
13
13
|
} from './destinations';
|
|
14
14
|
import { APIPromise } from '../../../../core/api-promise';
|
|
@@ -307,10 +307,10 @@ export declare namespace DataExport {
|
|
|
307
307
|
export {
|
|
308
308
|
Destinations as Destinations,
|
|
309
309
|
type DestinationCreateResponse as DestinationCreateResponse,
|
|
310
|
-
type DestinationUpdateResponse as DestinationUpdateResponse,
|
|
311
310
|
type DestinationDeleteResponse as DestinationDeleteResponse,
|
|
311
|
+
type DestinationUpdateSelectionResponse as DestinationUpdateSelectionResponse,
|
|
312
312
|
type DestinationCreateParams as DestinationCreateParams,
|
|
313
|
-
type DestinationUpdateParams as DestinationUpdateParams,
|
|
314
313
|
type DestinationDeleteParams as DestinationDeleteParams,
|
|
314
|
+
type DestinationUpdateSelectionParams as DestinationUpdateSelectionParams,
|
|
315
315
|
};
|
|
316
316
|
}
|
|
@@ -28,18 +28,17 @@ export class Destinations extends APIResource {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
31
|
+
* Disconnect a destination: stops the provider sync (deletes the provider
|
|
32
|
+
* destination) and removes it from the DATA_EXPORT integration. Non-destructive —
|
|
33
|
+
* the warehouse table is left intact. Idempotent.
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
delete(
|
|
36
36
|
destinationID: string,
|
|
37
|
-
params:
|
|
37
|
+
params: DestinationDeleteParams | null | undefined = {},
|
|
38
38
|
options?: RequestOptions,
|
|
39
|
-
): APIPromise<
|
|
40
|
-
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID
|
|
41
|
-
return this._client.
|
|
42
|
-
body,
|
|
39
|
+
): APIPromise<DestinationDeleteResponse> {
|
|
40
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
|
|
41
|
+
return this._client.delete(path`/api/v1/data-export/destinations/${destinationID}`, {
|
|
43
42
|
...options,
|
|
44
43
|
headers: buildHeaders([
|
|
45
44
|
{
|
|
@@ -52,17 +51,18 @@ export class Destinations extends APIResource {
|
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
54
|
+
* Update a destination's entity selection. Pushes the new enabled_models to the
|
|
55
|
+
* provider first, then persists the selection. Applies on the next scheduled
|
|
56
|
+
* transfer.
|
|
58
57
|
*/
|
|
59
|
-
|
|
58
|
+
updateSelection(
|
|
60
59
|
destinationID: string,
|
|
61
|
-
params:
|
|
60
|
+
params: DestinationUpdateSelectionParams,
|
|
62
61
|
options?: RequestOptions,
|
|
63
|
-
): APIPromise<
|
|
64
|
-
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params
|
|
65
|
-
return this._client.
|
|
62
|
+
): APIPromise<DestinationUpdateSelectionResponse> {
|
|
63
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
64
|
+
return this._client.patch(path`/api/v1/data-export/destinations/${destinationID}`, {
|
|
65
|
+
body,
|
|
66
66
|
...options,
|
|
67
67
|
headers: buildHeaders([
|
|
68
68
|
{
|
|
@@ -171,14 +171,14 @@ export namespace DestinationCreateResponse {
|
|
|
171
171
|
/**
|
|
172
172
|
* Response object
|
|
173
173
|
*/
|
|
174
|
-
export interface
|
|
174
|
+
export interface DestinationDeleteResponse {
|
|
175
175
|
/**
|
|
176
176
|
* Current destinations under the DATA_EXPORT integration.
|
|
177
177
|
*/
|
|
178
|
-
data:
|
|
178
|
+
data: DestinationDeleteResponse.Data;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
export namespace
|
|
181
|
+
export namespace DestinationDeleteResponse {
|
|
182
182
|
/**
|
|
183
183
|
* Current destinations under the DATA_EXPORT integration.
|
|
184
184
|
*/
|
|
@@ -264,14 +264,14 @@ export namespace DestinationUpdateResponse {
|
|
|
264
264
|
/**
|
|
265
265
|
* Response object
|
|
266
266
|
*/
|
|
267
|
-
export interface
|
|
267
|
+
export interface DestinationUpdateSelectionResponse {
|
|
268
268
|
/**
|
|
269
269
|
* Current destinations under the DATA_EXPORT integration.
|
|
270
270
|
*/
|
|
271
|
-
data:
|
|
271
|
+
data: DestinationUpdateSelectionResponse.Data;
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
export namespace
|
|
274
|
+
export namespace DestinationUpdateSelectionResponse {
|
|
275
275
|
/**
|
|
276
276
|
* Current destinations under the DATA_EXPORT integration.
|
|
277
277
|
*/
|
|
@@ -384,7 +384,22 @@ export interface DestinationCreateParams {
|
|
|
384
384
|
'X-ENVIRONMENT-ID'?: string;
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
-
export interface
|
|
387
|
+
export interface DestinationDeleteParams {
|
|
388
|
+
/**
|
|
389
|
+
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
390
|
+
* back to the user's first membership. Ignored for API-key auth.
|
|
391
|
+
*/
|
|
392
|
+
'X-ACCOUNT-ID'?: string;
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
396
|
+
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
397
|
+
* key).
|
|
398
|
+
*/
|
|
399
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export interface DestinationUpdateSelectionParams {
|
|
388
403
|
/**
|
|
389
404
|
* Body param
|
|
390
405
|
*/
|
|
@@ -409,28 +424,13 @@ export interface DestinationUpdateParams {
|
|
|
409
424
|
'X-ENVIRONMENT-ID'?: string;
|
|
410
425
|
}
|
|
411
426
|
|
|
412
|
-
export interface DestinationDeleteParams {
|
|
413
|
-
/**
|
|
414
|
-
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
415
|
-
* back to the user's first membership. Ignored for API-key auth.
|
|
416
|
-
*/
|
|
417
|
-
'X-ACCOUNT-ID'?: string;
|
|
418
|
-
|
|
419
|
-
/**
|
|
420
|
-
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
421
|
-
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
422
|
-
* key).
|
|
423
|
-
*/
|
|
424
|
-
'X-ENVIRONMENT-ID'?: string;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
427
|
export declare namespace Destinations {
|
|
428
428
|
export {
|
|
429
429
|
type DestinationCreateResponse as DestinationCreateResponse,
|
|
430
|
-
type DestinationUpdateResponse as DestinationUpdateResponse,
|
|
431
430
|
type DestinationDeleteResponse as DestinationDeleteResponse,
|
|
431
|
+
type DestinationUpdateSelectionResponse as DestinationUpdateSelectionResponse,
|
|
432
432
|
type DestinationCreateParams as DestinationCreateParams,
|
|
433
|
-
type DestinationUpdateParams as DestinationUpdateParams,
|
|
434
433
|
type DestinationDeleteParams as DestinationDeleteParams,
|
|
434
|
+
type DestinationUpdateSelectionParams as DestinationUpdateSelectionParams,
|
|
435
435
|
};
|
|
436
436
|
}
|
|
@@ -12,9 +12,9 @@ export {
|
|
|
12
12
|
export {
|
|
13
13
|
Destinations,
|
|
14
14
|
type DestinationCreateResponse,
|
|
15
|
-
type DestinationUpdateResponse,
|
|
16
15
|
type DestinationDeleteResponse,
|
|
16
|
+
type DestinationUpdateSelectionResponse,
|
|
17
17
|
type DestinationCreateParams,
|
|
18
|
-
type DestinationUpdateParams,
|
|
19
18
|
type DestinationDeleteParams,
|
|
19
|
+
type DestinationUpdateSelectionParams,
|
|
20
20
|
} from './destinations';
|
|
@@ -1,6 +1,8 @@
|
|
|
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 BetaAPI from './beta/beta';
|
|
5
|
+
import { Beta } from './beta/beta';
|
|
4
6
|
import * as DataExportAPI from './data-export/data-export';
|
|
5
7
|
import {
|
|
6
8
|
DataExport,
|
|
@@ -20,16 +22,14 @@ import { RequestOptions } from '../../../internal/request-options';
|
|
|
20
22
|
*/
|
|
21
23
|
export class Events extends APIResource {
|
|
22
24
|
dataExport: DataExportAPI.DataExport = new DataExportAPI.DataExport(this._client);
|
|
25
|
+
beta: BetaAPI.Beta = new BetaAPI.Beta(this._client);
|
|
23
26
|
|
|
24
27
|
/**
|
|
25
28
|
* Estimates the credit cost of a usage event without ingesting it. Returns the
|
|
26
29
|
* estimated cost per credit currency, the current balance, and the balance after
|
|
27
30
|
* the estimated consumption.
|
|
28
31
|
*/
|
|
29
|
-
|
|
30
|
-
params: EventEstimateCostParams,
|
|
31
|
-
options?: RequestOptions,
|
|
32
|
-
): APIPromise<EventEstimateCostResponse> {
|
|
32
|
+
estimate(params: EventEstimateParams, options?: RequestOptions): APIPromise<EventEstimateResponse> {
|
|
33
33
|
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
34
34
|
return this._client.post('/api/v1/events/estimate', {
|
|
35
35
|
body,
|
|
@@ -67,14 +67,14 @@ export class Events extends APIResource {
|
|
|
67
67
|
/**
|
|
68
68
|
* Response object
|
|
69
69
|
*/
|
|
70
|
-
export interface
|
|
70
|
+
export interface EventEstimateResponse {
|
|
71
71
|
/**
|
|
72
72
|
* Estimated credit cost, current balance and balance after
|
|
73
73
|
*/
|
|
74
|
-
data:
|
|
74
|
+
data: EventEstimateResponse.Data;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
export namespace
|
|
77
|
+
export namespace EventEstimateResponse {
|
|
78
78
|
/**
|
|
79
79
|
* Estimated credit cost, current balance and balance after
|
|
80
80
|
*/
|
|
@@ -155,7 +155,7 @@ export interface EventReportResponse {
|
|
|
155
155
|
data: unknown;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
export interface
|
|
158
|
+
export interface EventEstimateParams {
|
|
159
159
|
/**
|
|
160
160
|
* Body param: Customer id
|
|
161
161
|
*/
|
|
@@ -248,12 +248,13 @@ export namespace EventReportParams {
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
Events.DataExport = DataExport;
|
|
251
|
+
Events.Beta = Beta;
|
|
251
252
|
|
|
252
253
|
export declare namespace Events {
|
|
253
254
|
export {
|
|
254
|
-
type
|
|
255
|
+
type EventEstimateResponse as EventEstimateResponse,
|
|
255
256
|
type EventReportResponse as EventReportResponse,
|
|
256
|
-
type
|
|
257
|
+
type EventEstimateParams as EventEstimateParams,
|
|
257
258
|
type EventReportParams as EventReportParams,
|
|
258
259
|
};
|
|
259
260
|
|
|
@@ -266,4 +267,6 @@ export declare namespace Events {
|
|
|
266
267
|
type DataExportMintScopedTokenParams as DataExportMintScopedTokenParams,
|
|
267
268
|
type DataExportTriggerSyncParams as DataExportTriggerSyncParams,
|
|
268
269
|
};
|
|
270
|
+
|
|
271
|
+
export { Beta as Beta };
|
|
269
272
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
export { Beta } from './beta/index';
|
|
3
4
|
export {
|
|
4
5
|
DataExport,
|
|
5
6
|
type DataExportListModelsResponse,
|
|
@@ -11,8 +12,8 @@ export {
|
|
|
11
12
|
} from './data-export/index';
|
|
12
13
|
export {
|
|
13
14
|
Events,
|
|
14
|
-
type
|
|
15
|
+
type EventEstimateResponse,
|
|
15
16
|
type EventReportResponse,
|
|
16
|
-
type
|
|
17
|
+
type EventEstimateParams,
|
|
17
18
|
type EventReportParams,
|
|
18
19
|
} from './events';
|
|
@@ -64,9 +64,9 @@ export {
|
|
|
64
64
|
} from './customers/index';
|
|
65
65
|
export {
|
|
66
66
|
Events,
|
|
67
|
-
type
|
|
67
|
+
type EventEstimateResponse,
|
|
68
68
|
type EventReportResponse,
|
|
69
|
-
type
|
|
69
|
+
type EventEstimateParams,
|
|
70
70
|
type EventReportParams,
|
|
71
71
|
} from './events/index';
|
|
72
72
|
export {
|
|
@@ -136,10 +136,10 @@ export {
|
|
|
136
136
|
} from './subscriptions/index';
|
|
137
137
|
export {
|
|
138
138
|
Usage,
|
|
139
|
-
type
|
|
139
|
+
type UsageEstimateResponse,
|
|
140
140
|
type UsageHistoryResponse,
|
|
141
141
|
type UsageReportResponse,
|
|
142
|
-
type
|
|
142
|
+
type UsageEstimateParams,
|
|
143
143
|
type UsageHistoryParams,
|
|
144
144
|
type UsageReportParams,
|
|
145
145
|
} from './usage';
|