@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
|
@@ -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';
|
|
@@ -19,6 +19,20 @@ export {
|
|
|
19
19
|
type AddonListResponsesMyCursorIDPage,
|
|
20
20
|
type AddonListChargesResponsesMyCursorIDPage,
|
|
21
21
|
} from './addons/index';
|
|
22
|
+
export {
|
|
23
|
+
Contracts,
|
|
24
|
+
type ContractCreateResponse,
|
|
25
|
+
type ContractRetrieveResponse,
|
|
26
|
+
type ContractUpdateResponse,
|
|
27
|
+
type ContractListResponse,
|
|
28
|
+
type ContractDeleteResponse,
|
|
29
|
+
type ContractCreateParams,
|
|
30
|
+
type ContractRetrieveParams,
|
|
31
|
+
type ContractUpdateParams,
|
|
32
|
+
type ContractListParams,
|
|
33
|
+
type ContractDeleteParams,
|
|
34
|
+
type ContractListResponsesMyCursorIDPage,
|
|
35
|
+
} from './contracts';
|
|
22
36
|
export {
|
|
23
37
|
Coupons,
|
|
24
38
|
type Coupon,
|
|
@@ -47,6 +61,8 @@ export {
|
|
|
47
61
|
type CustomerListResponse,
|
|
48
62
|
type CustomerCheckEntitlementResponse,
|
|
49
63
|
type CustomerImportResponse,
|
|
64
|
+
type CustomerListContractsResponse,
|
|
65
|
+
type CustomerListInvoicesResponse,
|
|
50
66
|
type CustomerListResourcesResponse,
|
|
51
67
|
type CustomerRetrieveEntitlementsResponse,
|
|
52
68
|
type CustomerRetrieveParams,
|
|
@@ -55,18 +71,21 @@ export {
|
|
|
55
71
|
type CustomerArchiveParams,
|
|
56
72
|
type CustomerCheckEntitlementParams,
|
|
57
73
|
type CustomerImportParams,
|
|
74
|
+
type CustomerListContractsParams,
|
|
75
|
+
type CustomerListInvoicesParams,
|
|
58
76
|
type CustomerListResourcesParams,
|
|
59
77
|
type CustomerProvisionParams,
|
|
60
78
|
type CustomerRetrieveEntitlementsParams,
|
|
61
79
|
type CustomerUnarchiveParams,
|
|
62
80
|
type CustomerListResponsesMyCursorIDPage,
|
|
81
|
+
type CustomerListInvoicesResponsesMyCursorIDPage,
|
|
63
82
|
type CustomerListResourcesResponsesMyCursorIDPage,
|
|
64
83
|
} from './customers/index';
|
|
65
84
|
export {
|
|
66
85
|
Events,
|
|
67
|
-
type
|
|
86
|
+
type EventEstimateResponse,
|
|
68
87
|
type EventReportResponse,
|
|
69
|
-
type
|
|
88
|
+
type EventEstimateParams,
|
|
70
89
|
type EventReportParams,
|
|
71
90
|
} from './events/index';
|
|
72
91
|
export {
|
|
@@ -136,10 +155,10 @@ export {
|
|
|
136
155
|
} from './subscriptions/index';
|
|
137
156
|
export {
|
|
138
157
|
Usage,
|
|
139
|
-
type
|
|
158
|
+
type UsageEstimateResponse,
|
|
140
159
|
type UsageHistoryResponse,
|
|
141
160
|
type UsageReportResponse,
|
|
142
|
-
type
|
|
161
|
+
type UsageEstimateParams,
|
|
143
162
|
type UsageHistoryParams,
|
|
144
163
|
type UsageReportParams,
|
|
145
164
|
} from './usage';
|
|
@@ -2035,6 +2035,17 @@ export namespace PlanUpdateParams {
|
|
|
2035
2035
|
*/
|
|
2036
2036
|
billingCadence?: 'RECURRING' | 'ONE_OFF';
|
|
2037
2037
|
|
|
2038
|
+
/**
|
|
2039
|
+
* Credit entitlement to grant when a credit overage targets a currency not yet
|
|
2040
|
+
* granted on the plan
|
|
2041
|
+
*/
|
|
2042
|
+
creditEntitlement?: OveragePricingModel.CreditEntitlement;
|
|
2043
|
+
|
|
2044
|
+
/**
|
|
2045
|
+
* The refId of the custom currency this credit overage applies to
|
|
2046
|
+
*/
|
|
2047
|
+
currencyId?: string;
|
|
2048
|
+
|
|
2038
2049
|
/**
|
|
2039
2050
|
* Entitlement configuration for the overage feature
|
|
2040
2051
|
*/
|
|
@@ -2044,11 +2055,6 @@ export namespace PlanUpdateParams {
|
|
|
2044
2055
|
* The feature ID for overage pricing
|
|
2045
2056
|
*/
|
|
2046
2057
|
featureId?: string;
|
|
2047
|
-
|
|
2048
|
-
/**
|
|
2049
|
-
* Custom currency ID for overage top-up
|
|
2050
|
-
*/
|
|
2051
|
-
topUpCustomCurrencyId?: string;
|
|
2052
2058
|
}
|
|
2053
2059
|
|
|
2054
2060
|
export namespace OveragePricingModel {
|
|
@@ -2529,6 +2535,27 @@ export namespace PlanUpdateParams {
|
|
|
2529
2535
|
}
|
|
2530
2536
|
}
|
|
2531
2537
|
|
|
2538
|
+
/**
|
|
2539
|
+
* Credit entitlement to grant when a credit overage targets a currency not yet
|
|
2540
|
+
* granted on the plan
|
|
2541
|
+
*/
|
|
2542
|
+
export interface CreditEntitlement {
|
|
2543
|
+
/**
|
|
2544
|
+
* The base credit balance granted per cadence
|
|
2545
|
+
*/
|
|
2546
|
+
amount: number;
|
|
2547
|
+
|
|
2548
|
+
/**
|
|
2549
|
+
* The credit grant cadence (MONTH or YEAR)
|
|
2550
|
+
*/
|
|
2551
|
+
cadence: 'MONTH' | 'YEAR';
|
|
2552
|
+
|
|
2553
|
+
/**
|
|
2554
|
+
* The refId of the custom currency to grant
|
|
2555
|
+
*/
|
|
2556
|
+
customCurrencyId: string;
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2532
2559
|
/**
|
|
2533
2560
|
* Entitlement configuration for the overage feature
|
|
2534
2561
|
*/
|
|
@@ -336,6 +336,11 @@ export namespace Subscription {
|
|
|
336
336
|
| 'AutoCancellationRule'
|
|
337
337
|
| null;
|
|
338
338
|
|
|
339
|
+
/**
|
|
340
|
+
* The Stigg contract this subscription is linked to, when any
|
|
341
|
+
*/
|
|
342
|
+
contractId?: string | null;
|
|
343
|
+
|
|
339
344
|
/**
|
|
340
345
|
* Coupons applied to the subscription
|
|
341
346
|
*/
|
|
@@ -1392,6 +1397,11 @@ export interface SubscriptionListResponse {
|
|
|
1392
1397
|
| 'AutoCancellationRule'
|
|
1393
1398
|
| null;
|
|
1394
1399
|
|
|
1400
|
+
/**
|
|
1401
|
+
* The Stigg contract this subscription is linked to, when any
|
|
1402
|
+
*/
|
|
1403
|
+
contractId?: string | null;
|
|
1404
|
+
|
|
1395
1405
|
/**
|
|
1396
1406
|
* Coupons applied to the subscription
|
|
1397
1407
|
*/
|
|
@@ -3039,6 +3049,11 @@ export namespace SubscriptionProvisionResponse {
|
|
|
3039
3049
|
| 'AutoCancellationRule'
|
|
3040
3050
|
| null;
|
|
3041
3051
|
|
|
3052
|
+
/**
|
|
3053
|
+
* The Stigg contract this subscription is linked to, when any
|
|
3054
|
+
*/
|
|
3055
|
+
contractId?: string | null;
|
|
3056
|
+
|
|
3042
3057
|
/**
|
|
3043
3058
|
* Coupons applied to the subscription
|
|
3044
3059
|
*/
|