@stigg/typescript 0.1.0-beta.23 → 0.1.0-beta.25

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/client.d.mts.map +1 -1
  3. package/client.d.ts.map +1 -1
  4. package/client.js +9 -1
  5. package/client.js.map +1 -1
  6. package/client.mjs +9 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/v1/events/beta/beta.d.mts +10 -0
  10. package/resources/v1/events/beta/beta.d.mts.map +1 -0
  11. package/resources/v1/events/beta/beta.d.ts +10 -0
  12. package/resources/v1/events/beta/beta.d.ts.map +1 -0
  13. package/resources/v1/events/beta/beta.js +17 -0
  14. package/resources/v1/events/beta/beta.js.map +1 -0
  15. package/resources/v1/events/beta/beta.mjs +12 -0
  16. package/resources/v1/events/beta/beta.mjs.map +1 -0
  17. package/resources/v1/events/beta/customers.d.mts +159 -0
  18. package/resources/v1/events/beta/customers.d.mts.map +1 -0
  19. package/resources/v1/events/beta/customers.d.ts +159 -0
  20. package/resources/v1/events/beta/customers.d.ts.map +1 -0
  21. package/resources/v1/events/beta/customers.js +32 -0
  22. package/resources/v1/events/beta/customers.js.map +1 -0
  23. package/resources/v1/events/beta/customers.mjs +28 -0
  24. package/resources/v1/events/beta/customers.mjs.map +1 -0
  25. package/resources/v1/events/beta/index.d.mts +3 -0
  26. package/resources/v1/events/beta/index.d.mts.map +1 -0
  27. package/resources/v1/events/beta/index.d.ts +3 -0
  28. package/resources/v1/events/beta/index.d.ts.map +1 -0
  29. package/resources/v1/events/beta/index.js +9 -0
  30. package/resources/v1/events/beta/index.js.map +1 -0
  31. package/resources/v1/events/beta/index.mjs +4 -0
  32. package/resources/v1/events/beta/index.mjs.map +1 -0
  33. package/resources/v1/events/beta.d.mts +2 -0
  34. package/resources/v1/events/beta.d.mts.map +1 -0
  35. package/resources/v1/events/beta.d.ts +2 -0
  36. package/resources/v1/events/beta.d.ts.map +1 -0
  37. package/resources/v1/events/beta.js +6 -0
  38. package/resources/v1/events/beta.js.map +1 -0
  39. package/resources/v1/events/beta.mjs +3 -0
  40. package/resources/v1/events/beta.mjs.map +1 -0
  41. package/resources/v1/events/events.d.mts +4 -0
  42. package/resources/v1/events/events.d.mts.map +1 -1
  43. package/resources/v1/events/events.d.ts +4 -0
  44. package/resources/v1/events/events.d.ts.map +1 -1
  45. package/resources/v1/events/events.js +4 -0
  46. package/resources/v1/events/events.js.map +1 -1
  47. package/resources/v1/events/events.mjs +4 -0
  48. package/resources/v1/events/events.mjs.map +1 -1
  49. package/resources/v1/events/index.d.mts +1 -0
  50. package/resources/v1/events/index.d.mts.map +1 -1
  51. package/resources/v1/events/index.d.ts +1 -0
  52. package/resources/v1/events/index.d.ts.map +1 -1
  53. package/resources/v1/events/index.js +5 -3
  54. package/resources/v1/events/index.js.map +1 -1
  55. package/resources/v1/events/index.mjs +1 -0
  56. package/resources/v1/events/index.mjs.map +1 -1
  57. package/src/client.ts +9 -1
  58. package/src/resources/v1/events/beta/beta.ts +19 -0
  59. package/src/resources/v1/events/beta/customers.ts +211 -0
  60. package/src/resources/v1/events/beta/index.ts +8 -0
  61. package/src/resources/v1/events/beta.ts +3 -0
  62. package/src/resources/v1/events/events.ts +6 -0
  63. package/src/resources/v1/events/index.ts +1 -0
  64. package/src/version.ts +1 -1
  65. package/version.d.mts +1 -1
  66. package/version.d.ts +1 -1
  67. package/version.js +1 -1
  68. package/version.mjs +1 -1
@@ -0,0 +1,211 @@
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. Currently only `MONTH` is supported.
57
+ */
58
+ cadence: 'MONTH' | null;
59
+
60
+ /**
61
+ * Usage consumed in the current cadence period (may lag the live counter by a
62
+ * short interval).
63
+ */
64
+ currentUsage: number | null;
65
+
66
+ /**
67
+ * External id of the entity at this node.
68
+ */
69
+ entityId: string;
70
+
71
+ /**
72
+ * External id of the entity type (e.g. `team`, `user`).
73
+ */
74
+ entityType: string;
75
+
76
+ /**
77
+ * External id of the parent entity in the tree; `null` for a root. Use it to
78
+ * rebuild the tree.
79
+ */
80
+ parentId: string | null;
81
+
82
+ /**
83
+ * The configuration scope (entity ids). Empty is the node-wide configuration; a
84
+ * non-empty set is a dimension-scoped sub-configuration.
85
+ */
86
+ scopeEntityIds: Array<string>;
87
+
88
+ /**
89
+ * Hard usage limit for this node per cadence period.
90
+ */
91
+ usageLimit: number | null;
92
+
93
+ /**
94
+ * Exclusive end of the cadence period — when usage resets; `null` once the period
95
+ * has rolled over.
96
+ */
97
+ usagePeriodEnd: string | null;
98
+
99
+ /**
100
+ * Start of the cadence period the usage snapshot belongs to; `null` once the
101
+ * period has rolled over.
102
+ */
103
+ usagePeriodStart: string | null;
104
+
105
+ /**
106
+ * `currentUsage / usageLimit` (1 when usageLimit is 0 — always at limit). The
107
+ * cross-capability-safe sort key.
108
+ */
109
+ utilization: number | null;
110
+
111
+ /**
112
+ * The metered currency refId (present when the configured capability is a credit
113
+ * currency).
114
+ */
115
+ currencyId?: string;
116
+
117
+ /**
118
+ * The metered feature refId (present when the configured capability is a feature).
119
+ */
120
+ featureId?: string;
121
+ }
122
+
123
+ export interface Pagination {
124
+ /**
125
+ * Cursor for fetching the next page of results, or null if no additional pages
126
+ * exist
127
+ */
128
+ next: string | null;
129
+ }
130
+ }
131
+
132
+ export interface CustomerRetrieveGovernanceParams {
133
+ /**
134
+ * Query param: Return items that come after this cursor
135
+ */
136
+ after?: string;
137
+
138
+ /**
139
+ * Query param: Currency ids to include, repeated per value (e.g.
140
+ * `?currencyIds=credits`). Omit both featureIds and currencyIds for tree mode.
141
+ */
142
+ currencyIds?: Array<string>;
143
+
144
+ /**
145
+ * Query param: Case-insensitive substring match on the entity id (`%`/`_` matched
146
+ * literally).
147
+ */
148
+ entityIdSearch?: string;
149
+
150
+ /**
151
+ * Query param: Filter to one or more entity types, repeated per value (e.g.
152
+ * `?entityTypeIds=team&entityTypeIds=user`).
153
+ */
154
+ entityTypeIds?: Array<string>;
155
+
156
+ /**
157
+ * Query param: Feature ids to include, repeated per value (e.g.
158
+ * `?featureIds=ai-tokens&featureIds=seats`). Omit both featureIds and currencyIds
159
+ * for tree mode — every node in the hierarchy with no usage configuration
160
+ * attached.
161
+ */
162
+ featureIds?: Array<string>;
163
+
164
+ /**
165
+ * Query param: Maximum number of items to return
166
+ */
167
+ limit?: number;
168
+
169
+ /**
170
+ * Query param: Only nodes with utilization ≥ this value (e.g. 0.8 for ≥80%, 1 for
171
+ * at/over limit).
172
+ */
173
+ minUtilization?: number;
174
+
175
+ /**
176
+ * Query param: Sort direction: `asc` or `desc` (default `desc`).
177
+ */
178
+ order?: 'asc' | 'desc';
179
+
180
+ /**
181
+ * Query param: Filter by configuration scope: `all` (default), `nodeWide` (`[]`
182
+ * only), or `scoped` (non-empty only).
183
+ */
184
+ scope?: 'all' | 'nodeWide' | 'scoped';
185
+
186
+ /**
187
+ * Query param: Sort key: `utilization` (default, cross-capability-safe),
188
+ * `currentUsage`, `usageLimit`, `scopeSize`, `id`, or `createdAt`.
189
+ */
190
+ sortBy?: 'utilization' | 'currentUsage' | 'usageLimit' | 'scopeSize' | 'id' | 'createdAt';
191
+
192
+ /**
193
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
194
+ * token); falls back to the user's first membership. Ignored for API-key auth.
195
+ */
196
+ 'X-ACCOUNT-ID'?: string;
197
+
198
+ /**
199
+ * Header param: Environment ID — required when authenticating with a user JWT
200
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
201
+ * intrinsic to the key).
202
+ */
203
+ 'X-ENVIRONMENT-ID'?: string;
204
+ }
205
+
206
+ export declare namespace Customers {
207
+ export {
208
+ type CustomerRetrieveGovernanceResponse as CustomerRetrieveGovernanceResponse,
209
+ type CustomerRetrieveGovernanceParams as CustomerRetrieveGovernanceParams,
210
+ };
211
+ }
@@ -0,0 +1,8 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { Beta } from './beta';
4
+ export {
5
+ Customers,
6
+ type CustomerRetrieveGovernanceResponse,
7
+ type CustomerRetrieveGovernanceParams,
8
+ } from './customers';
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './beta/index';
@@ -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,
@@ -18,6 +20,7 @@ import { RequestOptions } from '../../../internal/request-options';
18
20
  */
19
21
  export class Events extends APIResource {
20
22
  dataExport: DataExportAPI.DataExport = new DataExportAPI.DataExport(this._client);
23
+ beta: BetaAPI.Beta = new BetaAPI.Beta(this._client);
21
24
 
22
25
  /**
23
26
  * Reports raw usage events for event-based metering. Events are ingested
@@ -108,6 +111,7 @@ export namespace EventReportParams {
108
111
  }
109
112
 
110
113
  Events.DataExport = DataExport;
114
+ Events.Beta = Beta;
111
115
 
112
116
  export declare namespace Events {
113
117
  export { type EventReportResponse as EventReportResponse, type EventReportParams as EventReportParams };
@@ -119,4 +123,6 @@ export declare namespace Events {
119
123
  type DataExportMintScopedTokenParams as DataExportMintScopedTokenParams,
120
124
  type DataExportTriggerSyncParams as DataExportTriggerSyncParams,
121
125
  };
126
+
127
+ export { Beta as Beta };
122
128
  }
@@ -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 DataExportMintScopedTokenResponse,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.1.0-beta.23'; // x-release-please-version
1
+ export const VERSION = '0.1.0-beta.25'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.0-beta.23";
1
+ export declare const VERSION = "0.1.0-beta.25";
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.23";
1
+ export declare const VERSION = "0.1.0-beta.25";
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.23'; // x-release-please-version
4
+ exports.VERSION = '0.1.0-beta.25'; // 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.23'; // x-release-please-version
1
+ export const VERSION = '0.1.0-beta.25'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map