bem-ai-sdk 0.26.0 → 0.28.0

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 (205) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/client.d.mts +127 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +127 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +136 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +136 -3
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/buckets.d.mts +272 -0
  12. package/resources/buckets.d.mts.map +1 -0
  13. package/resources/buckets.d.ts +272 -0
  14. package/resources/buckets.d.ts.map +1 -0
  15. package/resources/buckets.js +93 -0
  16. package/resources/buckets.js.map +1 -0
  17. package/resources/buckets.mjs +89 -0
  18. package/resources/buckets.mjs.map +1 -0
  19. package/resources/entities/entities.d.mts +526 -0
  20. package/resources/entities/entities.d.mts.map +1 -0
  21. package/resources/entities/entities.d.ts +526 -0
  22. package/resources/entities/entities.d.ts.map +1 -0
  23. package/resources/entities/entities.js +93 -0
  24. package/resources/entities/entities.js.map +1 -0
  25. package/resources/entities/entities.mjs +88 -0
  26. package/resources/entities/entities.mjs.map +1 -0
  27. package/resources/entities/index.d.mts +3 -0
  28. package/resources/entities/index.d.mts.map +1 -0
  29. package/resources/entities/index.d.ts +3 -0
  30. package/resources/entities/index.d.ts.map +1 -0
  31. package/resources/entities/index.js +9 -0
  32. package/resources/entities/index.js.map +1 -0
  33. package/resources/entities/index.mjs +4 -0
  34. package/resources/entities/index.mjs.map +1 -0
  35. package/resources/entities/synonyms.d.mts +109 -0
  36. package/resources/entities/synonyms.d.mts.map +1 -0
  37. package/resources/entities/synonyms.d.ts +109 -0
  38. package/resources/entities/synonyms.d.ts.map +1 -0
  39. package/resources/entities/synonyms.js +61 -0
  40. package/resources/entities/synonyms.js.map +1 -0
  41. package/resources/entities/synonyms.mjs +57 -0
  42. package/resources/entities/synonyms.mjs.map +1 -0
  43. package/resources/entities.d.mts +2 -0
  44. package/resources/entities.d.mts.map +1 -0
  45. package/resources/entities.d.ts +2 -0
  46. package/resources/entities.d.ts.map +1 -0
  47. package/resources/entities.js +6 -0
  48. package/resources/entities.js.map +1 -0
  49. package/resources/entities.mjs +3 -0
  50. package/resources/entities.mjs.map +1 -0
  51. package/resources/entity-types/entity-types.d.mts +302 -0
  52. package/resources/entity-types/entity-types.d.mts.map +1 -0
  53. package/resources/entity-types/entity-types.d.ts +302 -0
  54. package/resources/entity-types/entity-types.d.ts.map +1 -0
  55. package/resources/entity-types/entity-types.js +104 -0
  56. package/resources/entity-types/entity-types.js.map +1 -0
  57. package/resources/entity-types/entity-types.mjs +99 -0
  58. package/resources/entity-types/entity-types.mjs.map +1 -0
  59. package/resources/entity-types/index.d.mts +3 -0
  60. package/resources/entity-types/index.d.mts.map +1 -0
  61. package/resources/entity-types/index.d.ts +3 -0
  62. package/resources/entity-types/index.d.ts.map +1 -0
  63. package/resources/entity-types/index.js +9 -0
  64. package/resources/entity-types/index.js.map +1 -0
  65. package/resources/entity-types/index.mjs +4 -0
  66. package/resources/entity-types/index.mjs.map +1 -0
  67. package/resources/entity-types/reviewers.d.mts +136 -0
  68. package/resources/entity-types/reviewers.d.mts.map +1 -0
  69. package/resources/entity-types/reviewers.d.ts +136 -0
  70. package/resources/entity-types/reviewers.d.ts.map +1 -0
  71. package/resources/entity-types/reviewers.js +74 -0
  72. package/resources/entity-types/reviewers.js.map +1 -0
  73. package/resources/entity-types/reviewers.mjs +70 -0
  74. package/resources/entity-types/reviewers.mjs.map +1 -0
  75. package/resources/entity-types.d.mts +2 -0
  76. package/resources/entity-types.d.mts.map +1 -0
  77. package/resources/entity-types.d.ts +2 -0
  78. package/resources/entity-types.d.ts.map +1 -0
  79. package/resources/entity-types.js +6 -0
  80. package/resources/entity-types.js.map +1 -0
  81. package/resources/entity-types.mjs +3 -0
  82. package/resources/entity-types.mjs.map +1 -0
  83. package/resources/errors.d.mts +9 -0
  84. package/resources/errors.d.mts.map +1 -1
  85. package/resources/errors.d.ts +9 -0
  86. package/resources/errors.d.ts.map +1 -1
  87. package/resources/eval/eval.d.mts +4 -0
  88. package/resources/eval/eval.d.mts.map +1 -1
  89. package/resources/eval/eval.d.ts +4 -0
  90. package/resources/eval/eval.d.ts.map +1 -1
  91. package/resources/eval/eval.js +4 -0
  92. package/resources/eval/eval.js.map +1 -1
  93. package/resources/eval/eval.mjs +4 -0
  94. package/resources/eval/eval.mjs.map +1 -1
  95. package/resources/eval/index.d.mts +1 -0
  96. package/resources/eval/index.d.mts.map +1 -1
  97. package/resources/eval/index.d.ts +1 -0
  98. package/resources/eval/index.d.ts.map +1 -1
  99. package/resources/eval/index.js +3 -1
  100. package/resources/eval/index.js.map +1 -1
  101. package/resources/eval/index.mjs +1 -0
  102. package/resources/eval/index.mjs.map +1 -1
  103. package/resources/eval/score.d.mts +486 -0
  104. package/resources/eval/score.d.mts.map +1 -0
  105. package/resources/eval/score.d.ts +486 -0
  106. package/resources/eval/score.d.ts.map +1 -0
  107. package/resources/eval/score.js +126 -0
  108. package/resources/eval/score.js.map +1 -0
  109. package/resources/eval/score.mjs +122 -0
  110. package/resources/eval/score.mjs.map +1 -0
  111. package/resources/fs.d.mts +28 -0
  112. package/resources/fs.d.mts.map +1 -1
  113. package/resources/fs.d.ts +28 -0
  114. package/resources/fs.d.ts.map +1 -1
  115. package/resources/functions/functions.d.mts +338 -8
  116. package/resources/functions/functions.d.mts.map +1 -1
  117. package/resources/functions/functions.d.ts +338 -8
  118. package/resources/functions/functions.d.ts.map +1 -1
  119. package/resources/functions/functions.js +2 -2
  120. package/resources/functions/functions.js.map +1 -1
  121. package/resources/functions/functions.mjs +2 -2
  122. package/resources/functions/functions.mjs.map +1 -1
  123. package/resources/functions/versions.d.mts +133 -1
  124. package/resources/functions/versions.d.mts.map +1 -1
  125. package/resources/functions/versions.d.ts +133 -1
  126. package/resources/functions/versions.d.ts.map +1 -1
  127. package/resources/index.d.mts +6 -0
  128. package/resources/index.d.mts.map +1 -1
  129. package/resources/index.d.ts +6 -0
  130. package/resources/index.d.ts.map +1 -1
  131. package/resources/index.js +13 -1
  132. package/resources/index.js.map +1 -1
  133. package/resources/index.mjs +6 -0
  134. package/resources/index.mjs.map +1 -1
  135. package/resources/knowledge-graph.d.mts +143 -0
  136. package/resources/knowledge-graph.d.mts.map +1 -0
  137. package/resources/knowledge-graph.d.ts +143 -0
  138. package/resources/knowledge-graph.d.ts.map +1 -0
  139. package/resources/knowledge-graph.js +34 -0
  140. package/resources/knowledge-graph.js.map +1 -0
  141. package/resources/knowledge-graph.mjs +30 -0
  142. package/resources/knowledge-graph.mjs.map +1 -0
  143. package/resources/outputs.d.mts +80 -2
  144. package/resources/outputs.d.mts.map +1 -1
  145. package/resources/outputs.d.ts +80 -2
  146. package/resources/outputs.d.ts.map +1 -1
  147. package/resources/review-queue.d.mts +192 -0
  148. package/resources/review-queue.d.mts.map +1 -0
  149. package/resources/review-queue.d.ts +192 -0
  150. package/resources/review-queue.d.ts.map +1 -0
  151. package/resources/review-queue.js +49 -0
  152. package/resources/review-queue.js.map +1 -0
  153. package/resources/review-queue.mjs +45 -0
  154. package/resources/review-queue.mjs.map +1 -0
  155. package/resources/subscriptions.d.mts +14 -2
  156. package/resources/subscriptions.d.mts.map +1 -1
  157. package/resources/subscriptions.d.ts +14 -2
  158. package/resources/subscriptions.d.ts.map +1 -1
  159. package/resources/subscriptions.js +14 -2
  160. package/resources/subscriptions.js.map +1 -1
  161. package/resources/subscriptions.mjs +14 -2
  162. package/resources/subscriptions.mjs.map +1 -1
  163. package/resources/users.d.mts +62 -0
  164. package/resources/users.d.mts.map +1 -0
  165. package/resources/users.d.ts +62 -0
  166. package/resources/users.d.ts.map +1 -0
  167. package/resources/users.js +35 -0
  168. package/resources/users.js.map +1 -0
  169. package/resources/users.mjs +31 -0
  170. package/resources/users.mjs.map +1 -0
  171. package/resources/workflows/workflows.d.mts +8 -0
  172. package/resources/workflows/workflows.d.mts.map +1 -1
  173. package/resources/workflows/workflows.d.ts +8 -0
  174. package/resources/workflows/workflows.d.ts.map +1 -1
  175. package/resources/workflows/workflows.js.map +1 -1
  176. package/resources/workflows/workflows.mjs.map +1 -1
  177. package/src/client.ts +220 -3
  178. package/src/resources/buckets.ts +351 -0
  179. package/src/resources/entities/entities.ts +651 -0
  180. package/src/resources/entities/index.ts +20 -0
  181. package/src/resources/entities/synonyms.ts +140 -0
  182. package/src/resources/entities.ts +3 -0
  183. package/src/resources/entity-types/entity-types.ts +396 -0
  184. package/src/resources/entity-types/index.ts +19 -0
  185. package/src/resources/entity-types/reviewers.ts +175 -0
  186. package/src/resources/entity-types.ts +3 -0
  187. package/src/resources/errors.ts +10 -0
  188. package/src/resources/eval/eval.ts +18 -0
  189. package/src/resources/eval/index.ts +7 -0
  190. package/src/resources/eval/score.ts +590 -0
  191. package/src/resources/fs.ts +30 -0
  192. package/src/resources/functions/functions.ts +395 -8
  193. package/src/resources/functions/versions.ts +153 -1
  194. package/src/resources/index.ts +40 -0
  195. package/src/resources/knowledge-graph.ts +174 -0
  196. package/src/resources/outputs.ts +101 -1
  197. package/src/resources/review-queue.ts +234 -0
  198. package/src/resources/subscriptions.ts +14 -2
  199. package/src/resources/users.ts +76 -0
  200. package/src/resources/workflows/workflows.ts +9 -0
  201. package/src/version.ts +1 -1
  202. package/version.d.mts +1 -1
  203. package/version.d.ts +1 -1
  204. package/version.js +1 -1
  205. package/version.mjs +1 -1
@@ -0,0 +1,140 @@
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
+ /**
10
+ * Manage the human-readable surface forms (synonyms) attached to a canonical
11
+ * entity. Synonyms feed the matcher's exact-match path, so adding the right
12
+ * synonyms improves cross-document entity resolution.
13
+ *
14
+ * - **`POST /v3/entities/{id}/synonyms`** attaches a `customer_defined`
15
+ * synonym. If the same normalized form already exists as an `extracted`
16
+ * synonym, it is upgraded to `customer_defined` (so the matcher weights it
17
+ * higher); an existing customer/SME synonym is returned unchanged.
18
+ * - **`DELETE /v3/entities/{id}/synonyms/{synonymID}`** soft-deletes a
19
+ * synonym. Only `customer_defined` and `sme_approved` synonyms are
20
+ * deletable; `extracted` synonyms are resolver-owned and the request is
21
+ * rejected with `409 Conflict`.
22
+ *
23
+ * A merged-away entity id transparently resolves to its surviving canonical
24
+ * entity, so a synonym added to a stale id lands on the entity that persists.
25
+ */
26
+ export class Synonyms extends APIResource {
27
+ /**
28
+ * Add a Synonym to an Entity
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const response = await client.entities.synonyms.add('id', {
33
+ * text: 'ACME Corporation',
34
+ * locale: 'en-US',
35
+ * });
36
+ * ```
37
+ */
38
+ add(id: string, params: SynonymAddParams, options?: RequestOptions): APIPromise<SynonymAddResponse> {
39
+ const { bucket, ...body } = params;
40
+ return this._client.post(path`/v3/entities/${id}/synonyms`, { query: { bucket }, body, ...options });
41
+ }
42
+
43
+ /**
44
+ * Remove a Synonym from an Entity
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * await client.entities.synonyms.remove('synonymID', {
49
+ * id: 'id',
50
+ * });
51
+ * ```
52
+ */
53
+ remove(synonymID: string, params: SynonymRemoveParams, options?: RequestOptions): APIPromise<void> {
54
+ const { id, bucket } = params;
55
+ return this._client.delete(path`/v3/entities/${id}/synonyms/${synonymID}`, {
56
+ query: { bucket },
57
+ ...options,
58
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
59
+ });
60
+ }
61
+ }
62
+
63
+ /**
64
+ * One synonym attached to an entity.
65
+ */
66
+ export interface SynonymAddResponse {
67
+ /**
68
+ * Creation timestamp of the synonym (RFC 3339).
69
+ */
70
+ createdAt: string;
71
+
72
+ /**
73
+ * Lowercased, whitespace-folded form of `text`.
74
+ */
75
+ normalizedText: string;
76
+
77
+ /**
78
+ * Provenance of the synonym. `customer_defined` and `sme_approved` synonyms are
79
+ * deletable; `extracted` synonyms are resolver-owned and cannot be deleted.
80
+ */
81
+ source: 'extracted' | 'customer_defined' | 'sme_approved';
82
+
83
+ /**
84
+ * Stable public identifier for the synonym (`esn_...`).
85
+ */
86
+ synonymID: string;
87
+
88
+ /**
89
+ * The human-readable synonym as authored.
90
+ */
91
+ text: string;
92
+
93
+ /**
94
+ * Optional BCP 47 locale tag, when one was supplied.
95
+ */
96
+ locale?: string;
97
+ }
98
+
99
+ export interface SynonymAddParams {
100
+ /**
101
+ * Body param: The human-readable synonym surface form to attach (e.g. `Acme Corp`,
102
+ * `ACME`). It is normalized (lowercased, whitespace-folded) for the uniqueness key
103
+ * and the matcher's exact-match path.
104
+ */
105
+ text: string;
106
+
107
+ /**
108
+ * Query param: Optional bucket public ID (`bkt_...`) to scope the entity lookup to
109
+ * one bucket. Omit for the unscoped (all account+environment) view.
110
+ */
111
+ bucket?: string;
112
+
113
+ /**
114
+ * Body param: Optional BCP 47 locale tag (e.g. `en-US`) for language-specific
115
+ * synonyms.
116
+ */
117
+ locale?: string;
118
+ }
119
+
120
+ export interface SynonymRemoveParams {
121
+ /**
122
+ * Path param: Entity public ID (`ent_...`). A merged-away id resolves to the
123
+ * surviving entity.
124
+ */
125
+ id: string;
126
+
127
+ /**
128
+ * Query param: Optional bucket public ID (`bkt_...`) to scope the entity lookup to
129
+ * one bucket. Omit for the unscoped (all account+environment) view.
130
+ */
131
+ bucket?: string;
132
+ }
133
+
134
+ export declare namespace Synonyms {
135
+ export {
136
+ type SynonymAddResponse as SynonymAddResponse,
137
+ type SynonymAddParams as SynonymAddParams,
138
+ type SynonymRemoveParams as SynonymRemoveParams,
139
+ };
140
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './entities/index';
@@ -0,0 +1,396 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as ReviewersAPI from './reviewers';
5
+ import {
6
+ ReviewerAssignParams,
7
+ ReviewerAssignResponse,
8
+ ReviewerListResponse,
9
+ ReviewerRemoveParams,
10
+ Reviewers,
11
+ } from './reviewers';
12
+ import { APIPromise } from '../../core/api-promise';
13
+ import { buildHeaders } from '../../internal/headers';
14
+ import { RequestOptions } from '../../internal/request-options';
15
+ import { path } from '../../internal/utils/path';
16
+
17
+ /**
18
+ * Entity Types are the customer-defined taxonomy for the knowledge graph,
19
+ * scoped to an account+environment. Each type has a unique, immutable name
20
+ * and can be organised into hierarchies via `parentTypeID`. A type may
21
+ * carry per-type structured attribute metadata in `attributeSchema` (for
22
+ * example `{"unit": "mg", "range": [0, 100]}`).
23
+ *
24
+ * Use these endpoints to create, list, fetch, update, and delete entity
25
+ * types:
26
+ *
27
+ * - **`POST /v3/entity-types`** creates a type, optionally under a parent.
28
+ * - **`GET /v3/entity-types`** lists types with cursor pagination
29
+ * (`startingAfter` / `endingBefore` over `typeID`) and an optional
30
+ * `parentTypeId` filter for direct children.
31
+ * - **`PATCH /v3/entity-types/{typeID}`** updates `description`,
32
+ * `parentTypeID`, and/or `attributeSchema`. The `name` is immutable.
33
+ * - **`DELETE /v3/entity-types/{typeID}`** soft-deletes a type. The request
34
+ * is rejected with `409 Conflict` while any live entity is assigned to
35
+ * the type or any live child type points at it.
36
+ */
37
+ export class EntityTypes extends APIResource {
38
+ reviewers: ReviewersAPI.Reviewers = new ReviewersAPI.Reviewers(this._client);
39
+
40
+ /**
41
+ * Create an Entity Type
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * const entityType = await client.entityTypes.create({
46
+ * name: 'Drug',
47
+ * description: 'A pharmaceutical compound',
48
+ * });
49
+ * ```
50
+ */
51
+ create(body: EntityTypeCreateParams, options?: RequestOptions): APIPromise<EntityTypeCreateResponse> {
52
+ return this._client.post('/v3/entity-types', { body, ...options });
53
+ }
54
+
55
+ /**
56
+ * Get an Entity Type
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * const entityType = await client.entityTypes.retrieve(
61
+ * 'typeID',
62
+ * );
63
+ * ```
64
+ */
65
+ retrieve(typeID: string, options?: RequestOptions): APIPromise<EntityTypeRetrieveResponse> {
66
+ return this._client.get(path`/v3/entity-types/${typeID}`, options);
67
+ }
68
+
69
+ /**
70
+ * Update an Entity Type
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * const entityType = await client.entityTypes.update(
75
+ * 'typeID',
76
+ * );
77
+ * ```
78
+ */
79
+ update(
80
+ typeID: string,
81
+ body: EntityTypeUpdateParams,
82
+ options?: RequestOptions,
83
+ ): APIPromise<EntityTypeUpdateResponse> {
84
+ return this._client.patch(path`/v3/entity-types/${typeID}`, { body, ...options });
85
+ }
86
+
87
+ /**
88
+ * List Entity Types
89
+ *
90
+ * @example
91
+ * ```ts
92
+ * const entityTypes = await client.entityTypes.list();
93
+ * ```
94
+ */
95
+ list(
96
+ query: EntityTypeListParams | null | undefined = {},
97
+ options?: RequestOptions,
98
+ ): APIPromise<EntityTypeListResponse> {
99
+ return this._client.get('/v3/entity-types', { query, ...options });
100
+ }
101
+
102
+ /**
103
+ * Delete an Entity Type
104
+ *
105
+ * @example
106
+ * ```ts
107
+ * await client.entityTypes.delete('typeID');
108
+ * ```
109
+ */
110
+ delete(typeID: string, options?: RequestOptions): APIPromise<void> {
111
+ return this._client.delete(path`/v3/entity-types/${typeID}`, {
112
+ ...options,
113
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
114
+ });
115
+ }
116
+ }
117
+
118
+ /**
119
+ * An EntityType is a customer-defined type in the knowledge-graph taxonomy, scoped
120
+ * to an account+environment. Types may be organised into hierarchies via
121
+ * `parentTypeID`, and may carry per-type structured attribute metadata in
122
+ * `attributeSchema` (for example `{"unit": "mg", "range": [0, 100]}`).
123
+ */
124
+ export interface EntityTypeCreateResponse {
125
+ /**
126
+ * Creation timestamp (RFC 3339).
127
+ */
128
+ createdAt: string;
129
+
130
+ /**
131
+ * Optional human-facing note about the type.
132
+ */
133
+ description: string;
134
+
135
+ /**
136
+ * Human-facing type name. Unique within an account+environment, and immutable once
137
+ * set.
138
+ */
139
+ name: string;
140
+
141
+ /**
142
+ * Public ID (`ety_...`) of the parent type, or an empty string when the type is
143
+ * top-level.
144
+ */
145
+ parentTypeID: string;
146
+
147
+ /**
148
+ * Stable public identifier for the entity type (`ety_...`).
149
+ */
150
+ typeID: string;
151
+
152
+ /**
153
+ * Last-update timestamp (RFC 3339).
154
+ */
155
+ updatedAt: string;
156
+
157
+ /**
158
+ * Optional per-type structured attribute metadata.
159
+ */
160
+ attributeSchema?: unknown;
161
+ }
162
+
163
+ /**
164
+ * An EntityType is a customer-defined type in the knowledge-graph taxonomy, scoped
165
+ * to an account+environment. Types may be organised into hierarchies via
166
+ * `parentTypeID`, and may carry per-type structured attribute metadata in
167
+ * `attributeSchema` (for example `{"unit": "mg", "range": [0, 100]}`).
168
+ */
169
+ export interface EntityTypeRetrieveResponse {
170
+ /**
171
+ * Creation timestamp (RFC 3339).
172
+ */
173
+ createdAt: string;
174
+
175
+ /**
176
+ * Optional human-facing note about the type.
177
+ */
178
+ description: string;
179
+
180
+ /**
181
+ * Human-facing type name. Unique within an account+environment, and immutable once
182
+ * set.
183
+ */
184
+ name: string;
185
+
186
+ /**
187
+ * Public ID (`ety_...`) of the parent type, or an empty string when the type is
188
+ * top-level.
189
+ */
190
+ parentTypeID: string;
191
+
192
+ /**
193
+ * Stable public identifier for the entity type (`ety_...`).
194
+ */
195
+ typeID: string;
196
+
197
+ /**
198
+ * Last-update timestamp (RFC 3339).
199
+ */
200
+ updatedAt: string;
201
+
202
+ /**
203
+ * Optional per-type structured attribute metadata.
204
+ */
205
+ attributeSchema?: unknown;
206
+ }
207
+
208
+ /**
209
+ * An EntityType is a customer-defined type in the knowledge-graph taxonomy, scoped
210
+ * to an account+environment. Types may be organised into hierarchies via
211
+ * `parentTypeID`, and may carry per-type structured attribute metadata in
212
+ * `attributeSchema` (for example `{"unit": "mg", "range": [0, 100]}`).
213
+ */
214
+ export interface EntityTypeUpdateResponse {
215
+ /**
216
+ * Creation timestamp (RFC 3339).
217
+ */
218
+ createdAt: string;
219
+
220
+ /**
221
+ * Optional human-facing note about the type.
222
+ */
223
+ description: string;
224
+
225
+ /**
226
+ * Human-facing type name. Unique within an account+environment, and immutable once
227
+ * set.
228
+ */
229
+ name: string;
230
+
231
+ /**
232
+ * Public ID (`ety_...`) of the parent type, or an empty string when the type is
233
+ * top-level.
234
+ */
235
+ parentTypeID: string;
236
+
237
+ /**
238
+ * Stable public identifier for the entity type (`ety_...`).
239
+ */
240
+ typeID: string;
241
+
242
+ /**
243
+ * Last-update timestamp (RFC 3339).
244
+ */
245
+ updatedAt: string;
246
+
247
+ /**
248
+ * Optional per-type structured attribute metadata.
249
+ */
250
+ attributeSchema?: unknown;
251
+ }
252
+
253
+ /**
254
+ * Response body for listing entity types.
255
+ */
256
+ export interface EntityTypeListResponse {
257
+ entityTypes: Array<EntityTypeListResponse.EntityType>;
258
+
259
+ /**
260
+ * Total number of entity types matching the query, ignoring pagination.
261
+ */
262
+ totalCount: number;
263
+ }
264
+
265
+ export namespace EntityTypeListResponse {
266
+ /**
267
+ * An EntityType is a customer-defined type in the knowledge-graph taxonomy, scoped
268
+ * to an account+environment. Types may be organised into hierarchies via
269
+ * `parentTypeID`, and may carry per-type structured attribute metadata in
270
+ * `attributeSchema` (for example `{"unit": "mg", "range": [0, 100]}`).
271
+ */
272
+ export interface EntityType {
273
+ /**
274
+ * Creation timestamp (RFC 3339).
275
+ */
276
+ createdAt: string;
277
+
278
+ /**
279
+ * Optional human-facing note about the type.
280
+ */
281
+ description: string;
282
+
283
+ /**
284
+ * Human-facing type name. Unique within an account+environment, and immutable once
285
+ * set.
286
+ */
287
+ name: string;
288
+
289
+ /**
290
+ * Public ID (`ety_...`) of the parent type, or an empty string when the type is
291
+ * top-level.
292
+ */
293
+ parentTypeID: string;
294
+
295
+ /**
296
+ * Stable public identifier for the entity type (`ety_...`).
297
+ */
298
+ typeID: string;
299
+
300
+ /**
301
+ * Last-update timestamp (RFC 3339).
302
+ */
303
+ updatedAt: string;
304
+
305
+ /**
306
+ * Optional per-type structured attribute metadata.
307
+ */
308
+ attributeSchema?: unknown;
309
+ }
310
+ }
311
+
312
+ export interface EntityTypeCreateParams {
313
+ /**
314
+ * Type name. Required and unique within the account+environment.
315
+ */
316
+ name: string;
317
+
318
+ /**
319
+ * Optional per-type structured attribute metadata.
320
+ */
321
+ attributeSchema?: unknown;
322
+
323
+ /**
324
+ * Optional description.
325
+ */
326
+ description?: string;
327
+
328
+ /**
329
+ * Optional public ID (`ety_...`) of the parent type. Must belong to the same
330
+ * account+environment.
331
+ */
332
+ parentTypeID?: string;
333
+ }
334
+
335
+ export interface EntityTypeUpdateParams {
336
+ /**
337
+ * New per-type structured attribute metadata.
338
+ */
339
+ attributeSchema?: unknown;
340
+
341
+ /**
342
+ * New description.
343
+ */
344
+ description?: string;
345
+
346
+ /**
347
+ * New parent type public ID (`ety_...`), or an empty string to clear the parent
348
+ * (promote to top-level). Must belong to the same account+environment and may not
349
+ * be the type itself.
350
+ */
351
+ parentTypeID?: string;
352
+ }
353
+
354
+ export interface EntityTypeListParams {
355
+ /**
356
+ * Cursor: return types whose `typeID` sorts before this value.
357
+ */
358
+ endingBefore?: string;
359
+
360
+ /**
361
+ * Maximum number of entity types to return (default 50, max 200).
362
+ */
363
+ limit?: number;
364
+
365
+ /**
366
+ * Filter to the direct children of this parent type (`ety_...`).
367
+ */
368
+ parentTypeId?: string;
369
+
370
+ /**
371
+ * Cursor: return types whose `typeID` sorts after this value.
372
+ */
373
+ startingAfter?: string;
374
+ }
375
+
376
+ EntityTypes.Reviewers = Reviewers;
377
+
378
+ export declare namespace EntityTypes {
379
+ export {
380
+ type EntityTypeCreateResponse as EntityTypeCreateResponse,
381
+ type EntityTypeRetrieveResponse as EntityTypeRetrieveResponse,
382
+ type EntityTypeUpdateResponse as EntityTypeUpdateResponse,
383
+ type EntityTypeListResponse as EntityTypeListResponse,
384
+ type EntityTypeCreateParams as EntityTypeCreateParams,
385
+ type EntityTypeUpdateParams as EntityTypeUpdateParams,
386
+ type EntityTypeListParams as EntityTypeListParams,
387
+ };
388
+
389
+ export {
390
+ Reviewers as Reviewers,
391
+ type ReviewerListResponse as ReviewerListResponse,
392
+ type ReviewerAssignResponse as ReviewerAssignResponse,
393
+ type ReviewerAssignParams as ReviewerAssignParams,
394
+ type ReviewerRemoveParams as ReviewerRemoveParams,
395
+ };
396
+ }
@@ -0,0 +1,19 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ EntityTypes,
5
+ type EntityTypeCreateResponse,
6
+ type EntityTypeRetrieveResponse,
7
+ type EntityTypeUpdateResponse,
8
+ type EntityTypeListResponse,
9
+ type EntityTypeCreateParams,
10
+ type EntityTypeUpdateParams,
11
+ type EntityTypeListParams,
12
+ } from './entity-types';
13
+ export {
14
+ Reviewers,
15
+ type ReviewerListResponse,
16
+ type ReviewerAssignResponse,
17
+ type ReviewerAssignParams,
18
+ type ReviewerRemoveParams,
19
+ } from './reviewers';