@stigg/typescript 0.1.0-beta.43 → 0.1.0-beta.45

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 (101) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/package.json +1 -1
  3. package/resources/v1/credits/credits.d.mts +4 -0
  4. package/resources/v1/credits/credits.d.mts.map +1 -1
  5. package/resources/v1/credits/credits.d.ts +4 -0
  6. package/resources/v1/credits/credits.d.ts.map +1 -1
  7. package/resources/v1/credits/credits.js.map +1 -1
  8. package/resources/v1/credits/credits.mjs.map +1 -1
  9. package/resources/v1/events/events.d.mts +0 -4
  10. package/resources/v1/events/events.d.mts.map +1 -1
  11. package/resources/v1/events/events.d.ts +0 -4
  12. package/resources/v1/events/events.d.ts.map +1 -1
  13. package/resources/v1/events/events.js +0 -4
  14. package/resources/v1/events/events.js.map +1 -1
  15. package/resources/v1/events/events.mjs +0 -4
  16. package/resources/v1/events/events.mjs.map +1 -1
  17. package/resources/v1/events/index.d.mts +0 -1
  18. package/resources/v1/events/index.d.mts.map +1 -1
  19. package/resources/v1/events/index.d.ts +0 -1
  20. package/resources/v1/events/index.d.ts.map +1 -1
  21. package/resources/v1/events/index.js +3 -5
  22. package/resources/v1/events/index.js.map +1 -1
  23. package/resources/v1/events/index.mjs +0 -1
  24. package/resources/v1/events/index.mjs.map +1 -1
  25. package/resources/v1-beta/customers/customers.d.mts +160 -0
  26. package/resources/v1-beta/customers/customers.d.mts.map +1 -1
  27. package/resources/v1-beta/customers/customers.d.ts +160 -0
  28. package/resources/v1-beta/customers/customers.d.ts.map +1 -1
  29. package/resources/v1-beta/customers/customers.js +29 -0
  30. package/resources/v1-beta/customers/customers.js.map +1 -1
  31. package/resources/v1-beta/customers/customers.mjs +29 -0
  32. package/resources/v1-beta/customers/customers.mjs.map +1 -1
  33. package/resources/v1-beta/customers/index.d.mts +1 -1
  34. package/resources/v1-beta/customers/index.d.mts.map +1 -1
  35. package/resources/v1-beta/customers/index.d.ts +1 -1
  36. package/resources/v1-beta/customers/index.d.ts.map +1 -1
  37. package/resources/v1-beta/customers/index.js.map +1 -1
  38. package/resources/v1-beta/customers/index.mjs +1 -1
  39. package/resources/v1-beta/customers/index.mjs.map +1 -1
  40. package/resources/v1-beta/index.d.mts +1 -1
  41. package/resources/v1-beta/index.d.mts.map +1 -1
  42. package/resources/v1-beta/index.d.ts +1 -1
  43. package/resources/v1-beta/index.d.ts.map +1 -1
  44. package/resources/v1-beta/index.js.map +1 -1
  45. package/resources/v1-beta/index.mjs +1 -1
  46. package/resources/v1-beta/index.mjs.map +1 -1
  47. package/resources/v1-beta/v1-beta.d.mts +2 -2
  48. package/resources/v1-beta/v1-beta.d.mts.map +1 -1
  49. package/resources/v1-beta/v1-beta.d.ts +2 -2
  50. package/resources/v1-beta/v1-beta.d.ts.map +1 -1
  51. package/resources/v1-beta/v1-beta.js.map +1 -1
  52. package/resources/v1-beta/v1-beta.mjs +1 -1
  53. package/resources/v1-beta/v1-beta.mjs.map +1 -1
  54. package/src/resources/v1/credits/credits.ts +5 -0
  55. package/src/resources/v1/events/events.ts +0 -6
  56. package/src/resources/v1/events/index.ts +0 -1
  57. package/src/resources/v1-beta/customers/customers.ts +211 -0
  58. package/src/resources/v1-beta/customers/index.ts +5 -1
  59. package/src/resources/v1-beta/index.ts +5 -1
  60. package/src/resources/v1-beta/v1-beta.ts +10 -2
  61. package/src/version.ts +1 -1
  62. package/version.d.mts +1 -1
  63. package/version.d.ts +1 -1
  64. package/version.js +1 -1
  65. package/version.mjs +1 -1
  66. package/resources/v1/events/beta/beta.d.mts +0 -10
  67. package/resources/v1/events/beta/beta.d.mts.map +0 -1
  68. package/resources/v1/events/beta/beta.d.ts +0 -10
  69. package/resources/v1/events/beta/beta.d.ts.map +0 -1
  70. package/resources/v1/events/beta/beta.js +0 -17
  71. package/resources/v1/events/beta/beta.js.map +0 -1
  72. package/resources/v1/events/beta/beta.mjs +0 -12
  73. package/resources/v1/events/beta/beta.mjs.map +0 -1
  74. package/resources/v1/events/beta/customers.d.mts +0 -160
  75. package/resources/v1/events/beta/customers.d.mts.map +0 -1
  76. package/resources/v1/events/beta/customers.d.ts +0 -160
  77. package/resources/v1/events/beta/customers.d.ts.map +0 -1
  78. package/resources/v1/events/beta/customers.js +0 -32
  79. package/resources/v1/events/beta/customers.js.map +0 -1
  80. package/resources/v1/events/beta/customers.mjs +0 -28
  81. package/resources/v1/events/beta/customers.mjs.map +0 -1
  82. package/resources/v1/events/beta/index.d.mts +0 -3
  83. package/resources/v1/events/beta/index.d.mts.map +0 -1
  84. package/resources/v1/events/beta/index.d.ts +0 -3
  85. package/resources/v1/events/beta/index.d.ts.map +0 -1
  86. package/resources/v1/events/beta/index.js +0 -9
  87. package/resources/v1/events/beta/index.js.map +0 -1
  88. package/resources/v1/events/beta/index.mjs +0 -4
  89. package/resources/v1/events/beta/index.mjs.map +0 -1
  90. package/resources/v1/events/beta.d.mts +0 -2
  91. package/resources/v1/events/beta.d.mts.map +0 -1
  92. package/resources/v1/events/beta.d.ts +0 -2
  93. package/resources/v1/events/beta.d.ts.map +0 -1
  94. package/resources/v1/events/beta.js +0 -6
  95. package/resources/v1/events/beta.js.map +0 -1
  96. package/resources/v1/events/beta.mjs +0 -3
  97. package/resources/v1/events/beta.mjs.map +0 -1
  98. package/src/resources/v1/events/beta/beta.ts +0 -19
  99. package/src/resources/v1/events/beta/customers.ts +0 -212
  100. package/src/resources/v1/events/beta/index.ts +0 -8
  101. package/src/resources/v1/events/beta.ts +0 -3
@@ -1,160 +0,0 @@
1
- import { APIResource } from "../../../../core/resource.js";
2
- import { APIPromise } from "../../../../core/api-promise.js";
3
- import { RequestOptions } from "../../../../internal/request-options.js";
4
- export declare class Customers extends APIResource {
5
- /**
6
- * Queries the customer's governance hierarchy tree, returning a cursor-paginated
7
- * list of nodes with their usage configuration (limit, cadence, scope) and current
8
- * usage, sortable and filterable by usage. Each node carries `parentId` so the
9
- * tree can be rebuilt client-side. Usage is read from a periodically-refreshed
10
- * read model and never gates access.
11
- */
12
- retrieveGovernance(id: string, params?: CustomerRetrieveGovernanceParams | null | undefined, options?: RequestOptions): APIPromise<CustomerRetrieveGovernanceResponse>;
13
- }
14
- /**
15
- * Paginated list of governance tree nodes, each with its usage configuration and
16
- * current usage.
17
- */
18
- export interface CustomerRetrieveGovernanceResponse {
19
- data: Array<CustomerRetrieveGovernanceResponse.Data>;
20
- pagination: CustomerRetrieveGovernanceResponse.Pagination;
21
- }
22
- export declare namespace CustomerRetrieveGovernanceResponse {
23
- /**
24
- * A node of the governance hierarchy tree with its usage configuration (limit,
25
- * cadence, scope) and current usage. Usage is read from a periodically-refreshed
26
- * read model and may lag the live counter by a short interval; it never gates
27
- * access.
28
- */
29
- interface Data {
30
- /**
31
- * Usage-reset cadence as an ISO-8601 single-unit duration, e.g. `P1M`, `P30D`,
32
- * `PT1M`; `null` when the node has no usage configuration.
33
- */
34
- cadence: string | null;
35
- /**
36
- * Usage consumed in the current cadence period (may lag the live counter by a
37
- * short interval).
38
- */
39
- currentUsage: number | null;
40
- /**
41
- * External id of the entity at this node.
42
- */
43
- entityId: string;
44
- /**
45
- * External id of the entity type (e.g. `team`, `user`).
46
- */
47
- entityTypeId: string;
48
- /**
49
- * External id of the parent entity in the tree; `null` for a root. Use it to
50
- * rebuild the tree.
51
- */
52
- parentId: string | null;
53
- /**
54
- * The configuration scope (entity ids). Empty is the node-wide configuration; a
55
- * non-empty set is a dimension-scoped sub-configuration.
56
- */
57
- scopeEntityIds: Array<string>;
58
- /**
59
- * Hard usage limit for this node per cadence period.
60
- */
61
- usageLimit: number | null;
62
- /**
63
- * Exclusive end of the cadence period — when usage resets; `null` once the period
64
- * has rolled over.
65
- */
66
- usagePeriodEnd: string | null;
67
- /**
68
- * Start of the cadence period the usage snapshot belongs to; `null` once the
69
- * period has rolled over.
70
- */
71
- usagePeriodStart: string | null;
72
- /**
73
- * `currentUsage / usageLimit` (1 when usageLimit is 0 — always at limit). The
74
- * cross-capability-safe sort key.
75
- */
76
- utilization: number | null;
77
- /**
78
- * The metered currency ID (present when the configured capability is a credit
79
- * currency).
80
- */
81
- currencyId?: string;
82
- /**
83
- * The metered feature ID (present when the configured capability is a feature).
84
- */
85
- featureId?: string;
86
- }
87
- interface Pagination {
88
- /**
89
- * Cursor for fetching the next page of results, or null if no additional pages
90
- * exist
91
- */
92
- next: string | null;
93
- }
94
- }
95
- export interface CustomerRetrieveGovernanceParams {
96
- /**
97
- * Query param: Return items that come after this cursor
98
- */
99
- after?: string;
100
- /**
101
- * Query param: Currency ids to include, repeated per value (e.g.
102
- * `?currencyIds=credits`). Omit both featureIds and currencyIds for tree mode.
103
- */
104
- currencyIds?: Array<string>;
105
- /**
106
- * Query param: Case-insensitive substring match on the entity id (`%`/`_` matched
107
- * literally).
108
- */
109
- entityIdSearch?: string;
110
- /**
111
- * Query param: Filter to one or more entity types, repeated per value (e.g.
112
- * `?entityTypeIds=team&entityTypeIds=user`).
113
- */
114
- entityTypeIds?: Array<string>;
115
- /**
116
- * Query param: Feature ids to include, repeated per value (e.g.
117
- * `?featureIds=ai-tokens&featureIds=seats`). Omit both featureIds and currencyIds
118
- * for tree mode — every node in the hierarchy with no usage configuration
119
- * attached.
120
- */
121
- featureIds?: Array<string>;
122
- /**
123
- * Query param: Maximum number of items to return
124
- */
125
- limit?: number;
126
- /**
127
- * Query param: Only nodes with utilization ≥ this value (e.g. 0.8 for ≥80%, 1 for
128
- * at/over limit).
129
- */
130
- minUtilization?: number;
131
- /**
132
- * Query param: Sort direction: `asc` or `desc` (default `desc`).
133
- */
134
- order?: 'asc' | 'desc';
135
- /**
136
- * Query param: Filter by configuration scope: `all` (default), `nodeWide` (`[]`
137
- * only), or `scoped` (non-empty only).
138
- */
139
- scope?: 'all' | 'nodeWide' | 'scoped';
140
- /**
141
- * Query param: Sort key: `utilization` (default, cross-capability-safe),
142
- * `currentUsage`, `usageLimit`, `scopeSize`, `id`, or `createdAt`.
143
- */
144
- sortBy?: 'utilization' | 'currentUsage' | 'usageLimit' | 'scopeSize' | 'id' | 'createdAt';
145
- /**
146
- * Header param: Account ID — optional when authenticating with a user JWT (Bearer
147
- * token); falls back to the user's first membership. Ignored for API-key auth.
148
- */
149
- 'X-ACCOUNT-ID'?: string;
150
- /**
151
- * Header param: Environment ID — required when authenticating with a user JWT
152
- * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
153
- * intrinsic to the key).
154
- */
155
- 'X-ENVIRONMENT-ID'?: string;
156
- }
157
- export declare namespace Customers {
158
- export { type CustomerRetrieveGovernanceResponse as CustomerRetrieveGovernanceResponse, type CustomerRetrieveGovernanceParams as CustomerRetrieveGovernanceParams, };
159
- }
160
- //# sourceMappingURL=customers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../../../src/resources/v1/events/beta/customers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,qCAAkC;AACxD,OAAO,EAAE,UAAU,EAAE,wCAAqC;AAE1D,OAAO,EAAE,cAAc,EAAE,gDAA6C;AAGtE,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;OAMG;IACH,kBAAkB,CAChB,EAAE,EAAE,MAAM,EACV,MAAM,GAAE,gCAAgC,GAAG,IAAI,GAAG,SAAc,EAChE,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,kCAAkC,CAAC;CAclD;AAED;;;GAGG;AACH,MAAM,WAAW,kCAAkC;IACjD,IAAI,EAAE,KAAK,CAAC,kCAAkC,CAAC,IAAI,CAAC,CAAC;IAErD,UAAU,EAAE,kCAAkC,CAAC,UAAU,CAAC;CAC3D;AAED,yBAAiB,kCAAkC,CAAC;IAClD;;;;;OAKG;IACH,UAAiB,IAAI;QACnB;;;WAGG;QACH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QAEvB;;;WAGG;QACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAE5B;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;QAErB;;;WAGG;QACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QAExB;;;WAGG;QACH,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAE9B;;WAEG;QACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QAE1B;;;WAGG;QACH,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;QAE9B;;;WAGG;QACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;QAEhC;;;WAGG;QACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAE3B;;;WAGG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;IAED,UAAiB,UAAU;QACzB;;;WAGG;QACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;KACrB;CACF;AAED,MAAM,WAAW,gCAAgC;IAC/C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAE5B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAE9B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAE3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAEvB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,UAAU,GAAG,QAAQ,CAAC;IAEtC;;;OAGG;IACH,MAAM,CAAC,EAAE,aAAa,GAAG,cAAc,GAAG,YAAY,GAAG,WAAW,GAAG,IAAI,GAAG,WAAW,CAAC;IAE1F;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,gCAAgC,IAAI,gCAAgC,GAC1E,CAAC;CACH"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Customers = void 0;
5
- const resource_1 = require("../../../../core/resource.js");
6
- const headers_1 = require("../../../../internal/headers.js");
7
- const path_1 = require("../../../../internal/utils/path.js");
8
- class Customers extends resource_1.APIResource {
9
- /**
10
- * Queries the customer's governance hierarchy tree, returning a cursor-paginated
11
- * list of nodes with their usage configuration (limit, cadence, scope) and current
12
- * usage, sortable and filterable by usage. Each node carries `parentId` so the
13
- * tree can be rebuilt client-side. Usage is read from a periodically-refreshed
14
- * read model and never gates access.
15
- */
16
- retrieveGovernance(id, params = {}, options) {
17
- const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
18
- return this._client.get((0, path_1.path) `/api/v1-beta/customers/${id}/governance`, {
19
- query,
20
- ...options,
21
- headers: (0, headers_1.buildHeaders)([
22
- {
23
- ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
24
- ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
25
- },
26
- options?.headers,
27
- ]),
28
- });
29
- }
30
- }
31
- exports.Customers = Customers;
32
- //# sourceMappingURL=customers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"customers.js","sourceRoot":"","sources":["../../../../src/resources/v1/events/beta/customers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,2DAAwD;AAExD,6DAA4D;AAE5D,6DAAuD;AAEvD,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;OAMG;IACH,kBAAkB,CAChB,EAAU,EACV,SAA8D,EAAE,EAChE,OAAwB;QAExB,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAClG,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,0BAA0B,EAAE,aAAa,EAAE;YACrE,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB;oBACE,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;oBACpE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;iBACjF;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF;AA1BD,8BA0BC"}
@@ -1,28 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../../../../core/resource.mjs";
3
- import { buildHeaders } from "../../../../internal/headers.mjs";
4
- import { path } from "../../../../internal/utils/path.mjs";
5
- export class Customers extends APIResource {
6
- /**
7
- * Queries the customer's governance hierarchy tree, returning a cursor-paginated
8
- * list of nodes with their usage configuration (limit, cadence, scope) and current
9
- * usage, sortable and filterable by usage. Each node carries `parentId` so the
10
- * tree can be rebuilt client-side. Usage is read from a periodically-refreshed
11
- * read model and never gates access.
12
- */
13
- retrieveGovernance(id, params = {}, options) {
14
- const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
15
- return this._client.get(path `/api/v1-beta/customers/${id}/governance`, {
16
- query,
17
- ...options,
18
- headers: buildHeaders([
19
- {
20
- ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
21
- ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
22
- },
23
- options?.headers,
24
- ]),
25
- });
26
- }
27
- }
28
- //# sourceMappingURL=customers.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"customers.mjs","sourceRoot":"","sources":["../../../../src/resources/v1/events/beta/customers.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,sCAAkC;AAExD,OAAO,EAAE,YAAY,EAAE,yCAAqC;AAE5D,OAAO,EAAE,IAAI,EAAE,4CAAwC;AAEvD,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;;;;;OAMG;IACH,kBAAkB,CAChB,EAAU,EACV,SAA8D,EAAE,EAChE,OAAwB;QAExB,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAClG,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,0BAA0B,EAAE,aAAa,EAAE;YACrE,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB;oBACE,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;oBACpE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;iBACjF;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,3 +0,0 @@
1
- export { Beta } from "./beta.mjs";
2
- export { Customers, type CustomerRetrieveGovernanceResponse, type CustomerRetrieveGovernanceParams, } from "./customers.mjs";
3
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/resources/v1/events/beta/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,mBAAe;AAC9B,OAAO,EACL,SAAS,EACT,KAAK,kCAAkC,EACvC,KAAK,gCAAgC,GACtC,wBAAoB"}
@@ -1,3 +0,0 @@
1
- export { Beta } from "./beta.js";
2
- export { Customers, type CustomerRetrieveGovernanceResponse, type CustomerRetrieveGovernanceParams, } from "./customers.js";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/resources/v1/events/beta/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,kBAAe;AAC9B,OAAO,EACL,SAAS,EACT,KAAK,kCAAkC,EACvC,KAAK,gCAAgC,GACtC,uBAAoB"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Customers = exports.Beta = void 0;
5
- var beta_1 = require("./beta.js");
6
- Object.defineProperty(exports, "Beta", { enumerable: true, get: function () { return beta_1.Beta; } });
7
- var customers_1 = require("./customers.js");
8
- Object.defineProperty(exports, "Customers", { enumerable: true, get: function () { return customers_1.Customers; } });
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/resources/v1/events/beta/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,4CAIqB;AAHnB,sGAAA,SAAS,OAAA"}
@@ -1,4 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- export { Beta } from "./beta.mjs";
3
- export { Customers, } from "./customers.mjs";
4
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/resources/v1/events/beta/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,IAAI,EAAE,mBAAe;AAC9B,OAAO,EACL,SAAS,GAGV,wBAAoB"}
@@ -1,2 +0,0 @@
1
- export * from "./beta/index.mjs";
2
- //# sourceMappingURL=beta.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"beta.d.mts","sourceRoot":"","sources":["../../../src/resources/v1/events/beta.ts"],"names":[],"mappings":"AAEA,iCAA6B"}
@@ -1,2 +0,0 @@
1
- export * from "./beta/index.js";
2
- //# sourceMappingURL=beta.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"beta.d.ts","sourceRoot":"","sources":["../../../src/resources/v1/events/beta.ts"],"names":[],"mappings":"AAEA,gCAA6B"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const tslib_1 = require("../../../internal/tslib.js");
5
- tslib_1.__exportStar(require("./beta/index.js"), exports);
6
- //# sourceMappingURL=beta.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"beta.js","sourceRoot":"","sources":["../../../src/resources/v1/events/beta.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0DAA6B"}
@@ -1,3 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- export * from "./beta/index.mjs";
3
- //# sourceMappingURL=beta.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"beta.mjs","sourceRoot":"","sources":["../../../src/resources/v1/events/beta.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,iCAA6B"}
@@ -1,19 +0,0 @@
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
- }
@@ -1,212 +0,0 @@
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
- }
@@ -1,8 +0,0 @@
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';
@@ -1,3 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- export * from './beta/index';