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.
- package/CHANGELOG.md +14 -0
- package/client.d.mts +127 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +127 -2
- package/client.d.ts.map +1 -1
- package/client.js +136 -3
- package/client.js.map +1 -1
- package/client.mjs +136 -3
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/buckets.d.mts +272 -0
- package/resources/buckets.d.mts.map +1 -0
- package/resources/buckets.d.ts +272 -0
- package/resources/buckets.d.ts.map +1 -0
- package/resources/buckets.js +93 -0
- package/resources/buckets.js.map +1 -0
- package/resources/buckets.mjs +89 -0
- package/resources/buckets.mjs.map +1 -0
- package/resources/entities/entities.d.mts +516 -0
- package/resources/entities/entities.d.mts.map +1 -0
- package/resources/entities/entities.d.ts +516 -0
- package/resources/entities/entities.d.ts.map +1 -0
- package/resources/entities/entities.js +93 -0
- package/resources/entities/entities.js.map +1 -0
- package/resources/entities/entities.mjs +88 -0
- package/resources/entities/entities.mjs.map +1 -0
- package/resources/entities/index.d.mts +3 -0
- package/resources/entities/index.d.mts.map +1 -0
- package/resources/entities/index.d.ts +3 -0
- package/resources/entities/index.d.ts.map +1 -0
- package/resources/entities/index.js +9 -0
- package/resources/entities/index.js.map +1 -0
- package/resources/entities/index.mjs +4 -0
- package/resources/entities/index.mjs.map +1 -0
- package/resources/entities/synonyms.d.mts +109 -0
- package/resources/entities/synonyms.d.mts.map +1 -0
- package/resources/entities/synonyms.d.ts +109 -0
- package/resources/entities/synonyms.d.ts.map +1 -0
- package/resources/entities/synonyms.js +61 -0
- package/resources/entities/synonyms.js.map +1 -0
- package/resources/entities/synonyms.mjs +57 -0
- package/resources/entities/synonyms.mjs.map +1 -0
- package/resources/entities.d.mts +2 -0
- package/resources/entities.d.mts.map +1 -0
- package/resources/entities.d.ts +2 -0
- package/resources/entities.d.ts.map +1 -0
- package/resources/entities.js +6 -0
- package/resources/entities.js.map +1 -0
- package/resources/entities.mjs +3 -0
- package/resources/entities.mjs.map +1 -0
- package/resources/entity-types/entity-types.d.mts +302 -0
- package/resources/entity-types/entity-types.d.mts.map +1 -0
- package/resources/entity-types/entity-types.d.ts +302 -0
- package/resources/entity-types/entity-types.d.ts.map +1 -0
- package/resources/entity-types/entity-types.js +104 -0
- package/resources/entity-types/entity-types.js.map +1 -0
- package/resources/entity-types/entity-types.mjs +99 -0
- package/resources/entity-types/entity-types.mjs.map +1 -0
- package/resources/entity-types/index.d.mts +3 -0
- package/resources/entity-types/index.d.mts.map +1 -0
- package/resources/entity-types/index.d.ts +3 -0
- package/resources/entity-types/index.d.ts.map +1 -0
- package/resources/entity-types/index.js +9 -0
- package/resources/entity-types/index.js.map +1 -0
- package/resources/entity-types/index.mjs +4 -0
- package/resources/entity-types/index.mjs.map +1 -0
- package/resources/entity-types/reviewers.d.mts +136 -0
- package/resources/entity-types/reviewers.d.mts.map +1 -0
- package/resources/entity-types/reviewers.d.ts +136 -0
- package/resources/entity-types/reviewers.d.ts.map +1 -0
- package/resources/entity-types/reviewers.js +74 -0
- package/resources/entity-types/reviewers.js.map +1 -0
- package/resources/entity-types/reviewers.mjs +70 -0
- package/resources/entity-types/reviewers.mjs.map +1 -0
- package/resources/entity-types.d.mts +2 -0
- package/resources/entity-types.d.mts.map +1 -0
- package/resources/entity-types.d.ts +2 -0
- package/resources/entity-types.d.ts.map +1 -0
- package/resources/entity-types.js +6 -0
- package/resources/entity-types.js.map +1 -0
- package/resources/entity-types.mjs +3 -0
- package/resources/entity-types.mjs.map +1 -0
- package/resources/eval/eval.d.mts +4 -0
- package/resources/eval/eval.d.mts.map +1 -1
- package/resources/eval/eval.d.ts +4 -0
- package/resources/eval/eval.d.ts.map +1 -1
- package/resources/eval/eval.js +4 -0
- package/resources/eval/eval.js.map +1 -1
- package/resources/eval/eval.mjs +4 -0
- package/resources/eval/eval.mjs.map +1 -1
- package/resources/eval/index.d.mts +1 -0
- package/resources/eval/index.d.mts.map +1 -1
- package/resources/eval/index.d.ts +1 -0
- package/resources/eval/index.d.ts.map +1 -1
- package/resources/eval/index.js +3 -1
- package/resources/eval/index.js.map +1 -1
- package/resources/eval/index.mjs +1 -0
- package/resources/eval/index.mjs.map +1 -1
- package/resources/eval/score.d.mts +486 -0
- package/resources/eval/score.d.mts.map +1 -0
- package/resources/eval/score.d.ts +486 -0
- package/resources/eval/score.d.ts.map +1 -0
- package/resources/eval/score.js +126 -0
- package/resources/eval/score.js.map +1 -0
- package/resources/eval/score.mjs +122 -0
- package/resources/eval/score.mjs.map +1 -0
- package/resources/fs.d.mts +28 -0
- package/resources/fs.d.mts.map +1 -1
- package/resources/fs.d.ts +28 -0
- package/resources/fs.d.ts.map +1 -1
- package/resources/index.d.mts +6 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +13 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +6 -0
- package/resources/index.mjs.map +1 -1
- package/resources/knowledge-graph.d.mts +125 -0
- package/resources/knowledge-graph.d.mts.map +1 -0
- package/resources/knowledge-graph.d.ts +125 -0
- package/resources/knowledge-graph.d.ts.map +1 -0
- package/resources/knowledge-graph.js +34 -0
- package/resources/knowledge-graph.js.map +1 -0
- package/resources/knowledge-graph.mjs +30 -0
- package/resources/knowledge-graph.mjs.map +1 -0
- package/resources/review-queue.d.mts +192 -0
- package/resources/review-queue.d.mts.map +1 -0
- package/resources/review-queue.d.ts +192 -0
- package/resources/review-queue.d.ts.map +1 -0
- package/resources/review-queue.js +49 -0
- package/resources/review-queue.js.map +1 -0
- package/resources/review-queue.mjs +45 -0
- package/resources/review-queue.mjs.map +1 -0
- package/resources/subscriptions.d.mts +14 -2
- package/resources/subscriptions.d.mts.map +1 -1
- package/resources/subscriptions.d.ts +14 -2
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +14 -2
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +14 -2
- package/resources/subscriptions.mjs.map +1 -1
- package/resources/users.d.mts +62 -0
- package/resources/users.d.mts.map +1 -0
- package/resources/users.d.ts +62 -0
- package/resources/users.d.ts.map +1 -0
- package/resources/users.js +35 -0
- package/resources/users.js.map +1 -0
- package/resources/users.mjs +31 -0
- package/resources/users.mjs.map +1 -0
- package/src/client.ts +220 -3
- package/src/resources/buckets.ts +351 -0
- package/src/resources/entities/entities.ts +639 -0
- package/src/resources/entities/index.ts +20 -0
- package/src/resources/entities/synonyms.ts +140 -0
- package/src/resources/entities.ts +3 -0
- package/src/resources/entity-types/entity-types.ts +396 -0
- package/src/resources/entity-types/index.ts +19 -0
- package/src/resources/entity-types/reviewers.ts +175 -0
- package/src/resources/entity-types.ts +3 -0
- package/src/resources/eval/eval.ts +18 -0
- package/src/resources/eval/index.ts +7 -0
- package/src/resources/eval/score.ts +590 -0
- package/src/resources/fs.ts +30 -0
- package/src/resources/index.ts +40 -0
- package/src/resources/knowledge-graph.ts +153 -0
- package/src/resources/review-queue.ts +234 -0
- package/src/resources/subscriptions.ts +14 -2
- package/src/resources/users.ts +76 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as SynonymsAPI from "./synonyms.js";
|
|
3
|
+
import { SynonymAddParams, SynonymAddResponse, SynonymRemoveParams, Synonyms } from "./synonyms.js";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
5
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
6
|
+
export declare class Entities extends APIResource {
|
|
7
|
+
synonyms: SynonymsAPI.Synonyms;
|
|
8
|
+
/**
|
|
9
|
+
* Update Entity
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const entity = await client.entities.update('id', {
|
|
14
|
+
* status: 'approved',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
update(id: string, body: EntityUpdateParams, options?: RequestOptions): APIPromise<EntityUpdateResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Bulk Seed Entities
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const response = await client.entities.bulkCreate({
|
|
25
|
+
* entities: [
|
|
26
|
+
* {
|
|
27
|
+
* canonical: 'Acme Corporation',
|
|
28
|
+
* type: 'organization',
|
|
29
|
+
* description: 'Industrial conglomerate',
|
|
30
|
+
* synonyms: ['ACME', 'Acme Corp'],
|
|
31
|
+
* attributes: { headquarters: 'Springfield' },
|
|
32
|
+
* },
|
|
33
|
+
* ],
|
|
34
|
+
* onConflict: 'merge',
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
bulkCreate(body: EntityBulkCreateParams, options?: RequestOptions): APIPromise<EntityBulkCreateResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Bulk Validate Entities
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const response = await client.entities.bulkValidate({
|
|
45
|
+
* entityIDs: ['ent_2abc', 'ent_2def'],
|
|
46
|
+
* status: 'approved',
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
bulkValidate(body: EntityBulkValidateParams, options?: RequestOptions): APIPromise<EntityBulkValidateResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Get an Entity's Relations
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const response = await client.entities.retrieveRelations(
|
|
57
|
+
* 'id',
|
|
58
|
+
* );
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
retrieveRelations(id: string, query?: EntityRetrieveRelationsParams | null | undefined, options?: RequestOptions): APIPromise<EntityRetrieveRelationsResponse>;
|
|
62
|
+
/**
|
|
63
|
+
* Get Seed Job Status
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const response = await client.entities.retrieveSeedStatus(
|
|
68
|
+
* 'id',
|
|
69
|
+
* );
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
retrieveSeedStatus(id: string, options?: RequestOptions): APIPromise<EntityRetrieveSeedStatusResponse>;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* An entity record, including its curation status and assigned type.
|
|
76
|
+
*/
|
|
77
|
+
export interface EntityUpdateResponse {
|
|
78
|
+
/**
|
|
79
|
+
* The canonical (longest / most descriptive) surface form.
|
|
80
|
+
*/
|
|
81
|
+
canonical: string;
|
|
82
|
+
/**
|
|
83
|
+
* Creation timestamp.
|
|
84
|
+
*/
|
|
85
|
+
createdAt: string;
|
|
86
|
+
/**
|
|
87
|
+
* Public ID (`ent_...`).
|
|
88
|
+
*/
|
|
89
|
+
entityID: string;
|
|
90
|
+
/**
|
|
91
|
+
* Total mentions across parsed documents.
|
|
92
|
+
*/
|
|
93
|
+
mentionCount: number;
|
|
94
|
+
/**
|
|
95
|
+
* Curation lifecycle state.
|
|
96
|
+
*/
|
|
97
|
+
status: 'extracted' | 'proposed' | 'approved' | 'rejected';
|
|
98
|
+
/**
|
|
99
|
+
* Distinct surface forms resolved to this entity.
|
|
100
|
+
*/
|
|
101
|
+
surfaceForms: Array<string>;
|
|
102
|
+
/**
|
|
103
|
+
* The entity's effective type name (assigned type if set, else inferred).
|
|
104
|
+
*/
|
|
105
|
+
type: string;
|
|
106
|
+
/**
|
|
107
|
+
* Last-update timestamp.
|
|
108
|
+
*/
|
|
109
|
+
updatedAt: string;
|
|
110
|
+
/**
|
|
111
|
+
* Free-form description.
|
|
112
|
+
*/
|
|
113
|
+
description?: string;
|
|
114
|
+
/**
|
|
115
|
+
* `ety_...` public ID of the assigned type, when one is set.
|
|
116
|
+
*/
|
|
117
|
+
typeID?: string;
|
|
118
|
+
/**
|
|
119
|
+
* When the entity was approved/rejected. Present only once validated.
|
|
120
|
+
*/
|
|
121
|
+
validatedAt?: string;
|
|
122
|
+
/**
|
|
123
|
+
* `usr_...` public ID of the validating user (dashboard transitions only).
|
|
124
|
+
*/
|
|
125
|
+
validatedByUserID?: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* `200` response for a synchronously processed (small) batch.
|
|
129
|
+
*/
|
|
130
|
+
export interface EntityBulkCreateResponse {
|
|
131
|
+
/**
|
|
132
|
+
* Per-row outcomes, in request order.
|
|
133
|
+
*/
|
|
134
|
+
results: Array<EntityBulkCreateResponse.Result>;
|
|
135
|
+
/**
|
|
136
|
+
* Per-outcome tally across a batch.
|
|
137
|
+
*/
|
|
138
|
+
summary: EntityBulkCreateResponse.Summary;
|
|
139
|
+
}
|
|
140
|
+
export declare namespace EntityBulkCreateResponse {
|
|
141
|
+
/**
|
|
142
|
+
* The outcome of seeding one row.
|
|
143
|
+
*/
|
|
144
|
+
interface Result {
|
|
145
|
+
/**
|
|
146
|
+
* The canonical name from the input row.
|
|
147
|
+
*/
|
|
148
|
+
canonical: string;
|
|
149
|
+
/**
|
|
150
|
+
* What happened to this row: `created` (new entity), `merged-with` (matched an
|
|
151
|
+
* existing entity), or `rejected` (see `reason`).
|
|
152
|
+
*/
|
|
153
|
+
outcome: 'created' | 'merged-with' | 'rejected';
|
|
154
|
+
/**
|
|
155
|
+
* Public ID (`ent_...`) of the created or merged entity. Absent when rejected.
|
|
156
|
+
*/
|
|
157
|
+
entityID?: string;
|
|
158
|
+
/**
|
|
159
|
+
* Human-readable explanation when `outcome` is `rejected`.
|
|
160
|
+
*/
|
|
161
|
+
reason?: string;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Per-outcome tally across a batch.
|
|
165
|
+
*/
|
|
166
|
+
interface Summary {
|
|
167
|
+
/**
|
|
168
|
+
* Number of rows that created a new entity.
|
|
169
|
+
*/
|
|
170
|
+
created: number;
|
|
171
|
+
/**
|
|
172
|
+
* Number of rows merged into an existing entity.
|
|
173
|
+
*/
|
|
174
|
+
merged: number;
|
|
175
|
+
/**
|
|
176
|
+
* Number of rows rejected.
|
|
177
|
+
*/
|
|
178
|
+
rejected: number;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* `200` response for `POST /v3/entities/bulk-validate`.
|
|
183
|
+
*/
|
|
184
|
+
export interface EntityBulkValidateResponse {
|
|
185
|
+
/**
|
|
186
|
+
* Per-row outcomes, in request order.
|
|
187
|
+
*/
|
|
188
|
+
results: Array<EntityBulkValidateResponse.Result>;
|
|
189
|
+
/**
|
|
190
|
+
* Per-outcome tally across a bulk-validate batch.
|
|
191
|
+
*/
|
|
192
|
+
summary: EntityBulkValidateResponse.Summary;
|
|
193
|
+
}
|
|
194
|
+
export declare namespace EntityBulkValidateResponse {
|
|
195
|
+
/**
|
|
196
|
+
* The outcome of validating one row.
|
|
197
|
+
*/
|
|
198
|
+
interface Result {
|
|
199
|
+
/**
|
|
200
|
+
* The `ent_...` ID from the request.
|
|
201
|
+
*/
|
|
202
|
+
entityID: string;
|
|
203
|
+
/**
|
|
204
|
+
* `validated` (transition applied), `skipped` (not found or not authorized), or
|
|
205
|
+
* `rejected-row` (the transition itself was illegal, e.g. already terminal).
|
|
206
|
+
*/
|
|
207
|
+
outcome: 'validated' | 'skipped' | 'rejected-row';
|
|
208
|
+
/**
|
|
209
|
+
* Explanation for a `skipped` or `rejected-row` outcome.
|
|
210
|
+
*/
|
|
211
|
+
reason?: string;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Per-outcome tally across a bulk-validate batch.
|
|
215
|
+
*/
|
|
216
|
+
interface Summary {
|
|
217
|
+
/**
|
|
218
|
+
* Rows whose transition was illegal.
|
|
219
|
+
*/
|
|
220
|
+
rejectedRow: number;
|
|
221
|
+
/**
|
|
222
|
+
* Rows skipped (not found / not authorized).
|
|
223
|
+
*/
|
|
224
|
+
skipped: number;
|
|
225
|
+
/**
|
|
226
|
+
* Rows whose transition was applied.
|
|
227
|
+
*/
|
|
228
|
+
validated: number;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Response body for `GET /v3/entities/{id}/relations`.
|
|
233
|
+
*/
|
|
234
|
+
export interface EntityRetrieveRelationsResponse {
|
|
235
|
+
/**
|
|
236
|
+
* Edges pointing at the queried entity.
|
|
237
|
+
*/
|
|
238
|
+
inbound: Array<EntityRetrieveRelationsResponse.Inbound>;
|
|
239
|
+
/**
|
|
240
|
+
* Edges pointing away from the queried entity.
|
|
241
|
+
*/
|
|
242
|
+
outbound: Array<EntityRetrieveRelationsResponse.Outbound>;
|
|
243
|
+
/**
|
|
244
|
+
* Opaque cursor for the next page of edges, or absent on the last page. Pass it
|
|
245
|
+
* back as `cursor`.
|
|
246
|
+
*/
|
|
247
|
+
nextCursor?: string;
|
|
248
|
+
}
|
|
249
|
+
export declare namespace EntityRetrieveRelationsResponse {
|
|
250
|
+
/**
|
|
251
|
+
* One edge pointing AT the queried entity (some other entity is the source).
|
|
252
|
+
*/
|
|
253
|
+
interface Inbound {
|
|
254
|
+
/**
|
|
255
|
+
* First-seen timestamp of the edge (RFC 3339).
|
|
256
|
+
*/
|
|
257
|
+
firstSeenAt: string;
|
|
258
|
+
/**
|
|
259
|
+
* How many times this edge has been observed across parsed documents.
|
|
260
|
+
*/
|
|
261
|
+
mentionCount: number;
|
|
262
|
+
/**
|
|
263
|
+
* Free-form relation label (e.g. `author_of`, `affiliated_with`).
|
|
264
|
+
*/
|
|
265
|
+
relationType: string;
|
|
266
|
+
/**
|
|
267
|
+
* A compact view of an entity sitting on the far end of a relation edge — the
|
|
268
|
+
* stable public id, the canonical name, and the effective type. The full entity is
|
|
269
|
+
* fetched separately via the entity detail / File System endpoints.
|
|
270
|
+
*/
|
|
271
|
+
sourceEntity: Inbound.SourceEntity;
|
|
272
|
+
}
|
|
273
|
+
namespace Inbound {
|
|
274
|
+
/**
|
|
275
|
+
* A compact view of an entity sitting on the far end of a relation edge — the
|
|
276
|
+
* stable public id, the canonical name, and the effective type. The full entity is
|
|
277
|
+
* fetched separately via the entity detail / File System endpoints.
|
|
278
|
+
*/
|
|
279
|
+
interface SourceEntity {
|
|
280
|
+
/**
|
|
281
|
+
* Stable public identifier for the entity (`ent_...`).
|
|
282
|
+
*/
|
|
283
|
+
id: string;
|
|
284
|
+
/**
|
|
285
|
+
* Canonical (most descriptive) surface form of the entity.
|
|
286
|
+
*/
|
|
287
|
+
canonical: string;
|
|
288
|
+
/**
|
|
289
|
+
* Effective entity type.
|
|
290
|
+
*/
|
|
291
|
+
type: string;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* One edge pointing AWAY from the queried entity (it is the source).
|
|
296
|
+
*/
|
|
297
|
+
interface Outbound {
|
|
298
|
+
/**
|
|
299
|
+
* First-seen timestamp of the edge (RFC 3339).
|
|
300
|
+
*/
|
|
301
|
+
firstSeenAt: string;
|
|
302
|
+
/**
|
|
303
|
+
* How many times this edge has been observed across parsed documents.
|
|
304
|
+
*/
|
|
305
|
+
mentionCount: number;
|
|
306
|
+
/**
|
|
307
|
+
* Free-form relation label (e.g. `author_of`, `affiliated_with`).
|
|
308
|
+
*/
|
|
309
|
+
relationType: string;
|
|
310
|
+
/**
|
|
311
|
+
* A compact view of an entity sitting on the far end of a relation edge — the
|
|
312
|
+
* stable public id, the canonical name, and the effective type. The full entity is
|
|
313
|
+
* fetched separately via the entity detail / File System endpoints.
|
|
314
|
+
*/
|
|
315
|
+
targetEntity: Outbound.TargetEntity;
|
|
316
|
+
}
|
|
317
|
+
namespace Outbound {
|
|
318
|
+
/**
|
|
319
|
+
* A compact view of an entity sitting on the far end of a relation edge — the
|
|
320
|
+
* stable public id, the canonical name, and the effective type. The full entity is
|
|
321
|
+
* fetched separately via the entity detail / File System endpoints.
|
|
322
|
+
*/
|
|
323
|
+
interface TargetEntity {
|
|
324
|
+
/**
|
|
325
|
+
* Stable public identifier for the entity (`ent_...`).
|
|
326
|
+
*/
|
|
327
|
+
id: string;
|
|
328
|
+
/**
|
|
329
|
+
* Canonical (most descriptive) surface form of the entity.
|
|
330
|
+
*/
|
|
331
|
+
canonical: string;
|
|
332
|
+
/**
|
|
333
|
+
* Effective entity type.
|
|
334
|
+
*/
|
|
335
|
+
type: string;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* `GET /v3/entities/seed/{id}` response.
|
|
341
|
+
*/
|
|
342
|
+
export interface EntityRetrieveSeedStatusResponse {
|
|
343
|
+
/**
|
|
344
|
+
* Rows that created a new entity.
|
|
345
|
+
*/
|
|
346
|
+
createdCount: number;
|
|
347
|
+
/**
|
|
348
|
+
* Rows merged into an existing entity.
|
|
349
|
+
*/
|
|
350
|
+
mergedCount: number;
|
|
351
|
+
/**
|
|
352
|
+
* Rows rejected.
|
|
353
|
+
*/
|
|
354
|
+
rejectedCount: number;
|
|
355
|
+
/**
|
|
356
|
+
* Public ID (`esj_...`) of the seed job.
|
|
357
|
+
*/
|
|
358
|
+
seedJobID: string;
|
|
359
|
+
/**
|
|
360
|
+
* Lifecycle state.
|
|
361
|
+
*/
|
|
362
|
+
status: 'pending' | 'processing' | 'completed' | 'failed';
|
|
363
|
+
/**
|
|
364
|
+
* Total rows in the submitted batch.
|
|
365
|
+
*/
|
|
366
|
+
totalRows: number;
|
|
367
|
+
/**
|
|
368
|
+
* Terminal error message when `status` is `failed`.
|
|
369
|
+
*/
|
|
370
|
+
error?: string;
|
|
371
|
+
/**
|
|
372
|
+
* Per-row outcomes. Present only once `status` is `completed`.
|
|
373
|
+
*/
|
|
374
|
+
results?: Array<EntityRetrieveSeedStatusResponse.Result>;
|
|
375
|
+
}
|
|
376
|
+
export declare namespace EntityRetrieveSeedStatusResponse {
|
|
377
|
+
/**
|
|
378
|
+
* The outcome of seeding one row.
|
|
379
|
+
*/
|
|
380
|
+
interface Result {
|
|
381
|
+
/**
|
|
382
|
+
* The canonical name from the input row.
|
|
383
|
+
*/
|
|
384
|
+
canonical: string;
|
|
385
|
+
/**
|
|
386
|
+
* What happened to this row: `created` (new entity), `merged-with` (matched an
|
|
387
|
+
* existing entity), or `rejected` (see `reason`).
|
|
388
|
+
*/
|
|
389
|
+
outcome: 'created' | 'merged-with' | 'rejected';
|
|
390
|
+
/**
|
|
391
|
+
* Public ID (`ent_...`) of the created or merged entity. Absent when rejected.
|
|
392
|
+
*/
|
|
393
|
+
entityID?: string;
|
|
394
|
+
/**
|
|
395
|
+
* Human-readable explanation when `outcome` is `rejected`.
|
|
396
|
+
*/
|
|
397
|
+
reason?: string;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
export interface EntityUpdateParams {
|
|
401
|
+
/**
|
|
402
|
+
* Surface forms to attach as `customer_defined` synonyms.
|
|
403
|
+
*/
|
|
404
|
+
addSynonyms?: Array<string>;
|
|
405
|
+
/**
|
|
406
|
+
* The `ety_...` public ID of the type to assign (overriding the bem-inferred
|
|
407
|
+
* type). The empty string clears the assignment. Omit to leave unchanged.
|
|
408
|
+
*/
|
|
409
|
+
assignedTypeID?: string;
|
|
410
|
+
/**
|
|
411
|
+
* Replace the entity's canonical surface form (re-derives its normalized form).
|
|
412
|
+
*/
|
|
413
|
+
canonical?: string;
|
|
414
|
+
/**
|
|
415
|
+
* Optional BCP 47 locale tag stamped on any added synonyms.
|
|
416
|
+
*/
|
|
417
|
+
locale?: string;
|
|
418
|
+
/**
|
|
419
|
+
* `esn_...` synonym IDs to soft-delete. Only `customer_defined` / `sme_approved`
|
|
420
|
+
* synonyms may be removed; an `extracted` synonym is rejected with `409`.
|
|
421
|
+
*/
|
|
422
|
+
removeSynonymIDs?: Array<string>;
|
|
423
|
+
/**
|
|
424
|
+
* Transition the entity's curation status. Only `approved` or `rejected` are
|
|
425
|
+
* accepted, and only from `extracted` or `proposed` (any other transition is
|
|
426
|
+
* rejected with `409`).
|
|
427
|
+
*/
|
|
428
|
+
status?: 'approved' | 'rejected';
|
|
429
|
+
}
|
|
430
|
+
export interface EntityBulkCreateParams {
|
|
431
|
+
/**
|
|
432
|
+
* The entities to seed. Must be non-empty.
|
|
433
|
+
*/
|
|
434
|
+
entities: Array<EntityBulkCreateParams.Entity>;
|
|
435
|
+
/**
|
|
436
|
+
* Optional bucket public ID (`bkt_...`) to seed into. Omit to use the
|
|
437
|
+
* account+environment default bucket.
|
|
438
|
+
*/
|
|
439
|
+
bucket?: string;
|
|
440
|
+
/**
|
|
441
|
+
* Conflict strategy for an entity that already exists. Only `merge` is supported
|
|
442
|
+
* and it is the default: synonyms are added additively, a longer description
|
|
443
|
+
* replaces the old one, and attributes are merged with new keys winning.
|
|
444
|
+
*/
|
|
445
|
+
onConflict?: 'merge';
|
|
446
|
+
}
|
|
447
|
+
export declare namespace EntityBulkCreateParams {
|
|
448
|
+
/**
|
|
449
|
+
* One entity to seed in a `POST /v3/entities/bulk` batch.
|
|
450
|
+
*/
|
|
451
|
+
interface Entity {
|
|
452
|
+
/**
|
|
453
|
+
* The canonical (longest / most descriptive) surface form for the entity, e.g.
|
|
454
|
+
* `Acme Corporation`. Required. Normalized (lowercased, whitespace-folded) for the
|
|
455
|
+
* uniqueness key.
|
|
456
|
+
*/
|
|
457
|
+
canonical: string;
|
|
458
|
+
/**
|
|
459
|
+
* The entity type name, e.g. `instrument` or `organization`. Required. Resolved
|
|
460
|
+
* against your taxonomy and created if it does not yet exist.
|
|
461
|
+
*/
|
|
462
|
+
type: string;
|
|
463
|
+
/**
|
|
464
|
+
* Optional per-entity structured attribute values, e.g.
|
|
465
|
+
* `{ "manufacturer": "Acme", "dosageMg": 50 }`. When the entity's type declares an
|
|
466
|
+
* attribute schema, keys not present in that schema cause the row to be rejected.
|
|
467
|
+
*/
|
|
468
|
+
attributes?: unknown;
|
|
469
|
+
/**
|
|
470
|
+
* Optional free-form description of the entity.
|
|
471
|
+
*/
|
|
472
|
+
description?: string;
|
|
473
|
+
/**
|
|
474
|
+
* Optional additional surface forms to attach as `customer_defined` synonyms.
|
|
475
|
+
*/
|
|
476
|
+
synonyms?: Array<string>;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
export interface EntityBulkValidateParams {
|
|
480
|
+
/**
|
|
481
|
+
* The `ent_...` IDs to transition. Must be non-empty.
|
|
482
|
+
*/
|
|
483
|
+
entityIDs: Array<string>;
|
|
484
|
+
/**
|
|
485
|
+
* Terminal status to apply to every entity.
|
|
486
|
+
*/
|
|
487
|
+
status: 'approved' | 'rejected';
|
|
488
|
+
}
|
|
489
|
+
export interface EntityRetrieveRelationsParams {
|
|
490
|
+
/**
|
|
491
|
+
* Optional bucket public ID (`bkt_...`) to scope the read to one bucket. Omit for
|
|
492
|
+
* the unscoped (all account+environment) view.
|
|
493
|
+
*/
|
|
494
|
+
bucket?: string;
|
|
495
|
+
/**
|
|
496
|
+
* Cursor: return edges whose KSUID sorts after this value.
|
|
497
|
+
*/
|
|
498
|
+
cursor?: string;
|
|
499
|
+
/**
|
|
500
|
+
* Which edges to return relative to the entity. Defaults to `both`.
|
|
501
|
+
*/
|
|
502
|
+
direction?: 'inbound' | 'outbound' | 'both';
|
|
503
|
+
/**
|
|
504
|
+
* Maximum number of edges to return (default 50, max 200).
|
|
505
|
+
*/
|
|
506
|
+
limit?: number;
|
|
507
|
+
/**
|
|
508
|
+
* Exact-match filter on the relation label.
|
|
509
|
+
*/
|
|
510
|
+
relationType?: string;
|
|
511
|
+
}
|
|
512
|
+
export declare namespace Entities {
|
|
513
|
+
export { type EntityUpdateResponse as EntityUpdateResponse, type EntityBulkCreateResponse as EntityBulkCreateResponse, type EntityBulkValidateResponse as EntityBulkValidateResponse, type EntityRetrieveRelationsResponse as EntityRetrieveRelationsResponse, type EntityRetrieveSeedStatusResponse as EntityRetrieveSeedStatusResponse, type EntityUpdateParams as EntityUpdateParams, type EntityBulkCreateParams as EntityBulkCreateParams, type EntityBulkValidateParams as EntityBulkValidateParams, type EntityRetrieveRelationsParams as EntityRetrieveRelationsParams, };
|
|
514
|
+
export { Synonyms as Synonyms, type SynonymAddResponse as SynonymAddResponse, type SynonymAddParams as SynonymAddParams, type SynonymRemoveParams as SynonymRemoveParams, };
|
|
515
|
+
}
|
|
516
|
+
//# sourceMappingURL=entities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/resources/entities/entities.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,WAAW,sBAAmB;AAC1C,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,sBAAmB;AACjG,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE,qBAAa,QAAS,SAAQ,WAAW;IACvC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IAExE;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAIxG;;;;;;;;;;;;;;;;;;OAkBG;IACH,UAAU,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAIxG;;;;;;;;;;OAUG;IACH,YAAY,CACV,IAAI,EAAE,wBAAwB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,0BAA0B,CAAC;IAIzC;;;;;;;;;OASG;IACH,iBAAiB,CACf,EAAE,EAAE,MAAM,EACV,KAAK,GAAE,6BAA6B,GAAG,IAAI,GAAG,SAAc,EAC5D,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,+BAA+B,CAAC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AM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IAE5C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAID,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,6BAA6B,IAAI,6BAA6B,GACpE,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
|
@@ -0,0 +1,93 @@
|
|
|
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.Entities = void 0;
|
|
5
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../core/resource.js");
|
|
7
|
+
const SynonymsAPI = tslib_1.__importStar(require("./synonyms.js"));
|
|
8
|
+
const synonyms_1 = require("./synonyms.js");
|
|
9
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
10
|
+
class Entities extends resource_1.APIResource {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.synonyms = new SynonymsAPI.Synonyms(this._client);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Update Entity
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const entity = await client.entities.update('id', {
|
|
21
|
+
* status: 'approved',
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
update(id, body, options) {
|
|
26
|
+
return this._client.patch((0, path_1.path) `/v3/entities/${id}`, { body, ...options });
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Bulk Seed Entities
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const response = await client.entities.bulkCreate({
|
|
34
|
+
* entities: [
|
|
35
|
+
* {
|
|
36
|
+
* canonical: 'Acme Corporation',
|
|
37
|
+
* type: 'organization',
|
|
38
|
+
* description: 'Industrial conglomerate',
|
|
39
|
+
* synonyms: ['ACME', 'Acme Corp'],
|
|
40
|
+
* attributes: { headquarters: 'Springfield' },
|
|
41
|
+
* },
|
|
42
|
+
* ],
|
|
43
|
+
* onConflict: 'merge',
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
bulkCreate(body, options) {
|
|
48
|
+
return this._client.post('/v3/entities/bulk', { body, ...options });
|
|
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(body, options) {
|
|
62
|
+
return this._client.post('/v3/entities/bulk-validate', { body, ...options });
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Get an Entity's Relations
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const response = await client.entities.retrieveRelations(
|
|
70
|
+
* 'id',
|
|
71
|
+
* );
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
retrieveRelations(id, query = {}, options) {
|
|
75
|
+
return this._client.get((0, path_1.path) `/v3/entities/${id}/relations`, { query, ...options });
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get Seed Job Status
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* const response = await client.entities.retrieveSeedStatus(
|
|
83
|
+
* 'id',
|
|
84
|
+
* );
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
retrieveSeedStatus(id, options) {
|
|
88
|
+
return this._client.get((0, path_1.path) `/v3/entities/seed/${id}`, options);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.Entities = Entities;
|
|
92
|
+
Entities.Synonyms = synonyms_1.Synonyms;
|
|
93
|
+
//# sourceMappingURL=entities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entities.js","sourceRoot":"","sources":["../../src/resources/entities/entities.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,mEAA0C;AAC1C,4CAAiG;AAGjG,uDAAiD;AAEjD,MAAa,QAAS,SAAQ,sBAAW;IAAzC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAwF1E,CAAC;IAtFC;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAU,EAAE,IAAwB,EAAE,OAAwB;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,gBAAgB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;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