bem-ai-sdk 0.26.0 → 0.27.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 (174) hide show
  1. package/CHANGELOG.md +14 -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 +516 -0
  20. package/resources/entities/entities.d.mts.map +1 -0
  21. package/resources/entities/entities.d.ts +516 -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/eval/eval.d.mts +4 -0
  84. package/resources/eval/eval.d.mts.map +1 -1
  85. package/resources/eval/eval.d.ts +4 -0
  86. package/resources/eval/eval.d.ts.map +1 -1
  87. package/resources/eval/eval.js +4 -0
  88. package/resources/eval/eval.js.map +1 -1
  89. package/resources/eval/eval.mjs +4 -0
  90. package/resources/eval/eval.mjs.map +1 -1
  91. package/resources/eval/index.d.mts +1 -0
  92. package/resources/eval/index.d.mts.map +1 -1
  93. package/resources/eval/index.d.ts +1 -0
  94. package/resources/eval/index.d.ts.map +1 -1
  95. package/resources/eval/index.js +3 -1
  96. package/resources/eval/index.js.map +1 -1
  97. package/resources/eval/index.mjs +1 -0
  98. package/resources/eval/index.mjs.map +1 -1
  99. package/resources/eval/score.d.mts +486 -0
  100. package/resources/eval/score.d.mts.map +1 -0
  101. package/resources/eval/score.d.ts +486 -0
  102. package/resources/eval/score.d.ts.map +1 -0
  103. package/resources/eval/score.js +126 -0
  104. package/resources/eval/score.js.map +1 -0
  105. package/resources/eval/score.mjs +122 -0
  106. package/resources/eval/score.mjs.map +1 -0
  107. package/resources/fs.d.mts +28 -0
  108. package/resources/fs.d.mts.map +1 -1
  109. package/resources/fs.d.ts +28 -0
  110. package/resources/fs.d.ts.map +1 -1
  111. package/resources/index.d.mts +6 -0
  112. package/resources/index.d.mts.map +1 -1
  113. package/resources/index.d.ts +6 -0
  114. package/resources/index.d.ts.map +1 -1
  115. package/resources/index.js +13 -1
  116. package/resources/index.js.map +1 -1
  117. package/resources/index.mjs +6 -0
  118. package/resources/index.mjs.map +1 -1
  119. package/resources/knowledge-graph.d.mts +125 -0
  120. package/resources/knowledge-graph.d.mts.map +1 -0
  121. package/resources/knowledge-graph.d.ts +125 -0
  122. package/resources/knowledge-graph.d.ts.map +1 -0
  123. package/resources/knowledge-graph.js +34 -0
  124. package/resources/knowledge-graph.js.map +1 -0
  125. package/resources/knowledge-graph.mjs +30 -0
  126. package/resources/knowledge-graph.mjs.map +1 -0
  127. package/resources/review-queue.d.mts +192 -0
  128. package/resources/review-queue.d.mts.map +1 -0
  129. package/resources/review-queue.d.ts +192 -0
  130. package/resources/review-queue.d.ts.map +1 -0
  131. package/resources/review-queue.js +49 -0
  132. package/resources/review-queue.js.map +1 -0
  133. package/resources/review-queue.mjs +45 -0
  134. package/resources/review-queue.mjs.map +1 -0
  135. package/resources/subscriptions.d.mts +14 -2
  136. package/resources/subscriptions.d.mts.map +1 -1
  137. package/resources/subscriptions.d.ts +14 -2
  138. package/resources/subscriptions.d.ts.map +1 -1
  139. package/resources/subscriptions.js +14 -2
  140. package/resources/subscriptions.js.map +1 -1
  141. package/resources/subscriptions.mjs +14 -2
  142. package/resources/subscriptions.mjs.map +1 -1
  143. package/resources/users.d.mts +62 -0
  144. package/resources/users.d.mts.map +1 -0
  145. package/resources/users.d.ts +62 -0
  146. package/resources/users.d.ts.map +1 -0
  147. package/resources/users.js +35 -0
  148. package/resources/users.js.map +1 -0
  149. package/resources/users.mjs +31 -0
  150. package/resources/users.mjs.map +1 -0
  151. package/src/client.ts +220 -3
  152. package/src/resources/buckets.ts +351 -0
  153. package/src/resources/entities/entities.ts +639 -0
  154. package/src/resources/entities/index.ts +20 -0
  155. package/src/resources/entities/synonyms.ts +140 -0
  156. package/src/resources/entities.ts +3 -0
  157. package/src/resources/entity-types/entity-types.ts +396 -0
  158. package/src/resources/entity-types/index.ts +19 -0
  159. package/src/resources/entity-types/reviewers.ts +175 -0
  160. package/src/resources/entity-types.ts +3 -0
  161. package/src/resources/eval/eval.ts +18 -0
  162. package/src/resources/eval/index.ts +7 -0
  163. package/src/resources/eval/score.ts +590 -0
  164. package/src/resources/fs.ts +30 -0
  165. package/src/resources/index.ts +40 -0
  166. package/src/resources/knowledge-graph.ts +153 -0
  167. package/src/resources/review-queue.ts +234 -0
  168. package/src/resources/subscriptions.ts +14 -2
  169. package/src/resources/users.ts +76 -0
  170. package/src/version.ts +1 -1
  171. package/version.d.mts +1 -1
  172. package/version.d.ts +1 -1
  173. package/version.js +1 -1
  174. package/version.mjs +1 -1
@@ -0,0 +1,639 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as SynonymsAPI from './synonyms';
5
+ import { SynonymAddParams, SynonymAddResponse, SynonymRemoveParams, Synonyms } from './synonyms';
6
+ import { APIPromise } from '../../core/api-promise';
7
+ import { RequestOptions } from '../../internal/request-options';
8
+ import { path } from '../../internal/utils/path';
9
+
10
+ export class Entities extends APIResource {
11
+ synonyms: SynonymsAPI.Synonyms = new SynonymsAPI.Synonyms(this._client);
12
+
13
+ /**
14
+ * Update Entity
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const entity = await client.entities.update('id', {
19
+ * status: 'approved',
20
+ * });
21
+ * ```
22
+ */
23
+ update(id: string, body: EntityUpdateParams, options?: RequestOptions): APIPromise<EntityUpdateResponse> {
24
+ return this._client.patch(path`/v3/entities/${id}`, { body, ...options });
25
+ }
26
+
27
+ /**
28
+ * Bulk Seed Entities
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const response = await client.entities.bulkCreate({
33
+ * entities: [
34
+ * {
35
+ * canonical: 'Acme Corporation',
36
+ * type: 'organization',
37
+ * description: 'Industrial conglomerate',
38
+ * synonyms: ['ACME', 'Acme Corp'],
39
+ * attributes: { headquarters: 'Springfield' },
40
+ * },
41
+ * ],
42
+ * onConflict: 'merge',
43
+ * });
44
+ * ```
45
+ */
46
+ bulkCreate(body: EntityBulkCreateParams, options?: RequestOptions): APIPromise<EntityBulkCreateResponse> {
47
+ return this._client.post('/v3/entities/bulk', { body, ...options });
48
+ }
49
+
50
+ /**
51
+ * Bulk Validate Entities
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * const response = await client.entities.bulkValidate({
56
+ * entityIDs: ['ent_2abc', 'ent_2def'],
57
+ * status: 'approved',
58
+ * });
59
+ * ```
60
+ */
61
+ bulkValidate(
62
+ body: EntityBulkValidateParams,
63
+ options?: RequestOptions,
64
+ ): APIPromise<EntityBulkValidateResponse> {
65
+ return this._client.post('/v3/entities/bulk-validate', { body, ...options });
66
+ }
67
+
68
+ /**
69
+ * Get an Entity's Relations
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * const response = await client.entities.retrieveRelations(
74
+ * 'id',
75
+ * );
76
+ * ```
77
+ */
78
+ retrieveRelations(
79
+ id: string,
80
+ query: EntityRetrieveRelationsParams | null | undefined = {},
81
+ options?: RequestOptions,
82
+ ): APIPromise<EntityRetrieveRelationsResponse> {
83
+ return this._client.get(path`/v3/entities/${id}/relations`, { query, ...options });
84
+ }
85
+
86
+ /**
87
+ * Get Seed Job Status
88
+ *
89
+ * @example
90
+ * ```ts
91
+ * const response = await client.entities.retrieveSeedStatus(
92
+ * 'id',
93
+ * );
94
+ * ```
95
+ */
96
+ retrieveSeedStatus(id: string, options?: RequestOptions): APIPromise<EntityRetrieveSeedStatusResponse> {
97
+ return this._client.get(path`/v3/entities/seed/${id}`, options);
98
+ }
99
+ }
100
+
101
+ /**
102
+ * An entity record, including its curation status and assigned type.
103
+ */
104
+ export interface EntityUpdateResponse {
105
+ /**
106
+ * The canonical (longest / most descriptive) surface form.
107
+ */
108
+ canonical: string;
109
+
110
+ /**
111
+ * Creation timestamp.
112
+ */
113
+ createdAt: string;
114
+
115
+ /**
116
+ * Public ID (`ent_...`).
117
+ */
118
+ entityID: string;
119
+
120
+ /**
121
+ * Total mentions across parsed documents.
122
+ */
123
+ mentionCount: number;
124
+
125
+ /**
126
+ * Curation lifecycle state.
127
+ */
128
+ status: 'extracted' | 'proposed' | 'approved' | 'rejected';
129
+
130
+ /**
131
+ * Distinct surface forms resolved to this entity.
132
+ */
133
+ surfaceForms: Array<string>;
134
+
135
+ /**
136
+ * The entity's effective type name (assigned type if set, else inferred).
137
+ */
138
+ type: string;
139
+
140
+ /**
141
+ * Last-update timestamp.
142
+ */
143
+ updatedAt: string;
144
+
145
+ /**
146
+ * Free-form description.
147
+ */
148
+ description?: string;
149
+
150
+ /**
151
+ * `ety_...` public ID of the assigned type, when one is set.
152
+ */
153
+ typeID?: string;
154
+
155
+ /**
156
+ * When the entity was approved/rejected. Present only once validated.
157
+ */
158
+ validatedAt?: string;
159
+
160
+ /**
161
+ * `usr_...` public ID of the validating user (dashboard transitions only).
162
+ */
163
+ validatedByUserID?: string;
164
+ }
165
+
166
+ /**
167
+ * `200` response for a synchronously processed (small) batch.
168
+ */
169
+ export interface EntityBulkCreateResponse {
170
+ /**
171
+ * Per-row outcomes, in request order.
172
+ */
173
+ results: Array<EntityBulkCreateResponse.Result>;
174
+
175
+ /**
176
+ * Per-outcome tally across a batch.
177
+ */
178
+ summary: EntityBulkCreateResponse.Summary;
179
+ }
180
+
181
+ export namespace EntityBulkCreateResponse {
182
+ /**
183
+ * The outcome of seeding one row.
184
+ */
185
+ export interface Result {
186
+ /**
187
+ * The canonical name from the input row.
188
+ */
189
+ canonical: string;
190
+
191
+ /**
192
+ * What happened to this row: `created` (new entity), `merged-with` (matched an
193
+ * existing entity), or `rejected` (see `reason`).
194
+ */
195
+ outcome: 'created' | 'merged-with' | 'rejected';
196
+
197
+ /**
198
+ * Public ID (`ent_...`) of the created or merged entity. Absent when rejected.
199
+ */
200
+ entityID?: string;
201
+
202
+ /**
203
+ * Human-readable explanation when `outcome` is `rejected`.
204
+ */
205
+ reason?: string;
206
+ }
207
+
208
+ /**
209
+ * Per-outcome tally across a batch.
210
+ */
211
+ export interface Summary {
212
+ /**
213
+ * Number of rows that created a new entity.
214
+ */
215
+ created: number;
216
+
217
+ /**
218
+ * Number of rows merged into an existing entity.
219
+ */
220
+ merged: number;
221
+
222
+ /**
223
+ * Number of rows rejected.
224
+ */
225
+ rejected: number;
226
+ }
227
+ }
228
+
229
+ /**
230
+ * `200` response for `POST /v3/entities/bulk-validate`.
231
+ */
232
+ export interface EntityBulkValidateResponse {
233
+ /**
234
+ * Per-row outcomes, in request order.
235
+ */
236
+ results: Array<EntityBulkValidateResponse.Result>;
237
+
238
+ /**
239
+ * Per-outcome tally across a bulk-validate batch.
240
+ */
241
+ summary: EntityBulkValidateResponse.Summary;
242
+ }
243
+
244
+ export namespace EntityBulkValidateResponse {
245
+ /**
246
+ * The outcome of validating one row.
247
+ */
248
+ export interface Result {
249
+ /**
250
+ * The `ent_...` ID from the request.
251
+ */
252
+ entityID: string;
253
+
254
+ /**
255
+ * `validated` (transition applied), `skipped` (not found or not authorized), or
256
+ * `rejected-row` (the transition itself was illegal, e.g. already terminal).
257
+ */
258
+ outcome: 'validated' | 'skipped' | 'rejected-row';
259
+
260
+ /**
261
+ * Explanation for a `skipped` or `rejected-row` outcome.
262
+ */
263
+ reason?: string;
264
+ }
265
+
266
+ /**
267
+ * Per-outcome tally across a bulk-validate batch.
268
+ */
269
+ export interface Summary {
270
+ /**
271
+ * Rows whose transition was illegal.
272
+ */
273
+ rejectedRow: number;
274
+
275
+ /**
276
+ * Rows skipped (not found / not authorized).
277
+ */
278
+ skipped: number;
279
+
280
+ /**
281
+ * Rows whose transition was applied.
282
+ */
283
+ validated: number;
284
+ }
285
+ }
286
+
287
+ /**
288
+ * Response body for `GET /v3/entities/{id}/relations`.
289
+ */
290
+ export interface EntityRetrieveRelationsResponse {
291
+ /**
292
+ * Edges pointing at the queried entity.
293
+ */
294
+ inbound: Array<EntityRetrieveRelationsResponse.Inbound>;
295
+
296
+ /**
297
+ * Edges pointing away from the queried entity.
298
+ */
299
+ outbound: Array<EntityRetrieveRelationsResponse.Outbound>;
300
+
301
+ /**
302
+ * Opaque cursor for the next page of edges, or absent on the last page. Pass it
303
+ * back as `cursor`.
304
+ */
305
+ nextCursor?: string;
306
+ }
307
+
308
+ export namespace EntityRetrieveRelationsResponse {
309
+ /**
310
+ * One edge pointing AT the queried entity (some other entity is the source).
311
+ */
312
+ export interface Inbound {
313
+ /**
314
+ * First-seen timestamp of the edge (RFC 3339).
315
+ */
316
+ firstSeenAt: string;
317
+
318
+ /**
319
+ * How many times this edge has been observed across parsed documents.
320
+ */
321
+ mentionCount: number;
322
+
323
+ /**
324
+ * Free-form relation label (e.g. `author_of`, `affiliated_with`).
325
+ */
326
+ relationType: string;
327
+
328
+ /**
329
+ * A compact view of an entity sitting on the far end of a relation edge — the
330
+ * stable public id, the canonical name, and the effective type. The full entity is
331
+ * fetched separately via the entity detail / File System endpoints.
332
+ */
333
+ sourceEntity: Inbound.SourceEntity;
334
+ }
335
+
336
+ export namespace Inbound {
337
+ /**
338
+ * A compact view of an entity sitting on the far end of a relation edge — the
339
+ * stable public id, the canonical name, and the effective type. The full entity is
340
+ * fetched separately via the entity detail / File System endpoints.
341
+ */
342
+ export interface SourceEntity {
343
+ /**
344
+ * Stable public identifier for the entity (`ent_...`).
345
+ */
346
+ id: string;
347
+
348
+ /**
349
+ * Canonical (most descriptive) surface form of the entity.
350
+ */
351
+ canonical: string;
352
+
353
+ /**
354
+ * Effective entity type.
355
+ */
356
+ type: string;
357
+ }
358
+ }
359
+
360
+ /**
361
+ * One edge pointing AWAY from the queried entity (it is the source).
362
+ */
363
+ export interface Outbound {
364
+ /**
365
+ * First-seen timestamp of the edge (RFC 3339).
366
+ */
367
+ firstSeenAt: string;
368
+
369
+ /**
370
+ * How many times this edge has been observed across parsed documents.
371
+ */
372
+ mentionCount: number;
373
+
374
+ /**
375
+ * Free-form relation label (e.g. `author_of`, `affiliated_with`).
376
+ */
377
+ relationType: string;
378
+
379
+ /**
380
+ * A compact view of an entity sitting on the far end of a relation edge — the
381
+ * stable public id, the canonical name, and the effective type. The full entity is
382
+ * fetched separately via the entity detail / File System endpoints.
383
+ */
384
+ targetEntity: Outbound.TargetEntity;
385
+ }
386
+
387
+ export namespace Outbound {
388
+ /**
389
+ * A compact view of an entity sitting on the far end of a relation edge — the
390
+ * stable public id, the canonical name, and the effective type. The full entity is
391
+ * fetched separately via the entity detail / File System endpoints.
392
+ */
393
+ export interface TargetEntity {
394
+ /**
395
+ * Stable public identifier for the entity (`ent_...`).
396
+ */
397
+ id: string;
398
+
399
+ /**
400
+ * Canonical (most descriptive) surface form of the entity.
401
+ */
402
+ canonical: string;
403
+
404
+ /**
405
+ * Effective entity type.
406
+ */
407
+ type: string;
408
+ }
409
+ }
410
+ }
411
+
412
+ /**
413
+ * `GET /v3/entities/seed/{id}` response.
414
+ */
415
+ export interface EntityRetrieveSeedStatusResponse {
416
+ /**
417
+ * Rows that created a new entity.
418
+ */
419
+ createdCount: number;
420
+
421
+ /**
422
+ * Rows merged into an existing entity.
423
+ */
424
+ mergedCount: number;
425
+
426
+ /**
427
+ * Rows rejected.
428
+ */
429
+ rejectedCount: number;
430
+
431
+ /**
432
+ * Public ID (`esj_...`) of the seed job.
433
+ */
434
+ seedJobID: string;
435
+
436
+ /**
437
+ * Lifecycle state.
438
+ */
439
+ status: 'pending' | 'processing' | 'completed' | 'failed';
440
+
441
+ /**
442
+ * Total rows in the submitted batch.
443
+ */
444
+ totalRows: number;
445
+
446
+ /**
447
+ * Terminal error message when `status` is `failed`.
448
+ */
449
+ error?: string;
450
+
451
+ /**
452
+ * Per-row outcomes. Present only once `status` is `completed`.
453
+ */
454
+ results?: Array<EntityRetrieveSeedStatusResponse.Result>;
455
+ }
456
+
457
+ export namespace EntityRetrieveSeedStatusResponse {
458
+ /**
459
+ * The outcome of seeding one row.
460
+ */
461
+ export interface Result {
462
+ /**
463
+ * The canonical name from the input row.
464
+ */
465
+ canonical: string;
466
+
467
+ /**
468
+ * What happened to this row: `created` (new entity), `merged-with` (matched an
469
+ * existing entity), or `rejected` (see `reason`).
470
+ */
471
+ outcome: 'created' | 'merged-with' | 'rejected';
472
+
473
+ /**
474
+ * Public ID (`ent_...`) of the created or merged entity. Absent when rejected.
475
+ */
476
+ entityID?: string;
477
+
478
+ /**
479
+ * Human-readable explanation when `outcome` is `rejected`.
480
+ */
481
+ reason?: string;
482
+ }
483
+ }
484
+
485
+ export interface EntityUpdateParams {
486
+ /**
487
+ * Surface forms to attach as `customer_defined` synonyms.
488
+ */
489
+ addSynonyms?: Array<string>;
490
+
491
+ /**
492
+ * The `ety_...` public ID of the type to assign (overriding the bem-inferred
493
+ * type). The empty string clears the assignment. Omit to leave unchanged.
494
+ */
495
+ assignedTypeID?: string;
496
+
497
+ /**
498
+ * Replace the entity's canonical surface form (re-derives its normalized form).
499
+ */
500
+ canonical?: string;
501
+
502
+ /**
503
+ * Optional BCP 47 locale tag stamped on any added synonyms.
504
+ */
505
+ locale?: string;
506
+
507
+ /**
508
+ * `esn_...` synonym IDs to soft-delete. Only `customer_defined` / `sme_approved`
509
+ * synonyms may be removed; an `extracted` synonym is rejected with `409`.
510
+ */
511
+ removeSynonymIDs?: Array<string>;
512
+
513
+ /**
514
+ * Transition the entity's curation status. Only `approved` or `rejected` are
515
+ * accepted, and only from `extracted` or `proposed` (any other transition is
516
+ * rejected with `409`).
517
+ */
518
+ status?: 'approved' | 'rejected';
519
+ }
520
+
521
+ export interface EntityBulkCreateParams {
522
+ /**
523
+ * The entities to seed. Must be non-empty.
524
+ */
525
+ entities: Array<EntityBulkCreateParams.Entity>;
526
+
527
+ /**
528
+ * Optional bucket public ID (`bkt_...`) to seed into. Omit to use the
529
+ * account+environment default bucket.
530
+ */
531
+ bucket?: string;
532
+
533
+ /**
534
+ * Conflict strategy for an entity that already exists. Only `merge` is supported
535
+ * and it is the default: synonyms are added additively, a longer description
536
+ * replaces the old one, and attributes are merged with new keys winning.
537
+ */
538
+ onConflict?: 'merge';
539
+ }
540
+
541
+ export namespace EntityBulkCreateParams {
542
+ /**
543
+ * One entity to seed in a `POST /v3/entities/bulk` batch.
544
+ */
545
+ export interface Entity {
546
+ /**
547
+ * The canonical (longest / most descriptive) surface form for the entity, e.g.
548
+ * `Acme Corporation`. Required. Normalized (lowercased, whitespace-folded) for the
549
+ * uniqueness key.
550
+ */
551
+ canonical: string;
552
+
553
+ /**
554
+ * The entity type name, e.g. `instrument` or `organization`. Required. Resolved
555
+ * against your taxonomy and created if it does not yet exist.
556
+ */
557
+ type: string;
558
+
559
+ /**
560
+ * Optional per-entity structured attribute values, e.g.
561
+ * `{ "manufacturer": "Acme", "dosageMg": 50 }`. When the entity's type declares an
562
+ * attribute schema, keys not present in that schema cause the row to be rejected.
563
+ */
564
+ attributes?: unknown;
565
+
566
+ /**
567
+ * Optional free-form description of the entity.
568
+ */
569
+ description?: string;
570
+
571
+ /**
572
+ * Optional additional surface forms to attach as `customer_defined` synonyms.
573
+ */
574
+ synonyms?: Array<string>;
575
+ }
576
+ }
577
+
578
+ export interface EntityBulkValidateParams {
579
+ /**
580
+ * The `ent_...` IDs to transition. Must be non-empty.
581
+ */
582
+ entityIDs: Array<string>;
583
+
584
+ /**
585
+ * Terminal status to apply to every entity.
586
+ */
587
+ status: 'approved' | 'rejected';
588
+ }
589
+
590
+ export interface EntityRetrieveRelationsParams {
591
+ /**
592
+ * Optional bucket public ID (`bkt_...`) to scope the read to one bucket. Omit for
593
+ * the unscoped (all account+environment) view.
594
+ */
595
+ bucket?: string;
596
+
597
+ /**
598
+ * Cursor: return edges whose KSUID sorts after this value.
599
+ */
600
+ cursor?: string;
601
+
602
+ /**
603
+ * Which edges to return relative to the entity. Defaults to `both`.
604
+ */
605
+ direction?: 'inbound' | 'outbound' | 'both';
606
+
607
+ /**
608
+ * Maximum number of edges to return (default 50, max 200).
609
+ */
610
+ limit?: number;
611
+
612
+ /**
613
+ * Exact-match filter on the relation label.
614
+ */
615
+ relationType?: string;
616
+ }
617
+
618
+ Entities.Synonyms = Synonyms;
619
+
620
+ export declare namespace Entities {
621
+ export {
622
+ type EntityUpdateResponse as EntityUpdateResponse,
623
+ type EntityBulkCreateResponse as EntityBulkCreateResponse,
624
+ type EntityBulkValidateResponse as EntityBulkValidateResponse,
625
+ type EntityRetrieveRelationsResponse as EntityRetrieveRelationsResponse,
626
+ type EntityRetrieveSeedStatusResponse as EntityRetrieveSeedStatusResponse,
627
+ type EntityUpdateParams as EntityUpdateParams,
628
+ type EntityBulkCreateParams as EntityBulkCreateParams,
629
+ type EntityBulkValidateParams as EntityBulkValidateParams,
630
+ type EntityRetrieveRelationsParams as EntityRetrieveRelationsParams,
631
+ };
632
+
633
+ export {
634
+ Synonyms as Synonyms,
635
+ type SynonymAddResponse as SynonymAddResponse,
636
+ type SynonymAddParams as SynonymAddParams,
637
+ type SynonymRemoveParams as SynonymRemoveParams,
638
+ };
639
+ }
@@ -0,0 +1,20 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ Entities,
5
+ type EntityUpdateResponse,
6
+ type EntityBulkCreateResponse,
7
+ type EntityBulkValidateResponse,
8
+ type EntityRetrieveRelationsResponse,
9
+ type EntityRetrieveSeedStatusResponse,
10
+ type EntityUpdateParams,
11
+ type EntityBulkCreateParams,
12
+ type EntityBulkValidateParams,
13
+ type EntityRetrieveRelationsParams,
14
+ } from './entities';
15
+ export {
16
+ Synonyms,
17
+ type SynonymAddResponse,
18
+ type SynonymAddParams,
19
+ type SynonymRemoveParams,
20
+ } from './synonyms';