bem-ai-sdk 0.25.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 (186) hide show
  1. package/CHANGELOG.md +22 -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/functions/functions.d.mts +308 -99
  112. package/resources/functions/functions.d.mts.map +1 -1
  113. package/resources/functions/functions.d.ts +308 -99
  114. package/resources/functions/functions.d.ts.map +1 -1
  115. package/resources/functions/functions.js.map +1 -1
  116. package/resources/functions/functions.mjs.map +1 -1
  117. package/resources/functions/versions.d.mts +20 -13
  118. package/resources/functions/versions.d.mts.map +1 -1
  119. package/resources/functions/versions.d.ts +20 -13
  120. package/resources/functions/versions.d.ts.map +1 -1
  121. package/resources/index.d.mts +6 -0
  122. package/resources/index.d.mts.map +1 -1
  123. package/resources/index.d.ts +6 -0
  124. package/resources/index.d.ts.map +1 -1
  125. package/resources/index.js +13 -1
  126. package/resources/index.js.map +1 -1
  127. package/resources/index.mjs +6 -0
  128. package/resources/index.mjs.map +1 -1
  129. package/resources/knowledge-graph.d.mts +125 -0
  130. package/resources/knowledge-graph.d.mts.map +1 -0
  131. package/resources/knowledge-graph.d.ts +125 -0
  132. package/resources/knowledge-graph.d.ts.map +1 -0
  133. package/resources/knowledge-graph.js +34 -0
  134. package/resources/knowledge-graph.js.map +1 -0
  135. package/resources/knowledge-graph.mjs +30 -0
  136. package/resources/knowledge-graph.mjs.map +1 -0
  137. package/resources/review-queue.d.mts +192 -0
  138. package/resources/review-queue.d.mts.map +1 -0
  139. package/resources/review-queue.d.ts +192 -0
  140. package/resources/review-queue.d.ts.map +1 -0
  141. package/resources/review-queue.js +49 -0
  142. package/resources/review-queue.js.map +1 -0
  143. package/resources/review-queue.mjs +45 -0
  144. package/resources/review-queue.mjs.map +1 -0
  145. package/resources/subscriptions.d.mts +14 -2
  146. package/resources/subscriptions.d.mts.map +1 -1
  147. package/resources/subscriptions.d.ts +14 -2
  148. package/resources/subscriptions.d.ts.map +1 -1
  149. package/resources/subscriptions.js +14 -2
  150. package/resources/subscriptions.js.map +1 -1
  151. package/resources/subscriptions.mjs +14 -2
  152. package/resources/subscriptions.mjs.map +1 -1
  153. package/resources/users.d.mts +62 -0
  154. package/resources/users.d.mts.map +1 -0
  155. package/resources/users.d.ts +62 -0
  156. package/resources/users.d.ts.map +1 -0
  157. package/resources/users.js +35 -0
  158. package/resources/users.js.map +1 -0
  159. package/resources/users.mjs +31 -0
  160. package/resources/users.mjs.map +1 -0
  161. package/src/client.ts +220 -3
  162. package/src/resources/buckets.ts +351 -0
  163. package/src/resources/entities/entities.ts +639 -0
  164. package/src/resources/entities/index.ts +20 -0
  165. package/src/resources/entities/synonyms.ts +140 -0
  166. package/src/resources/entities.ts +3 -0
  167. package/src/resources/entity-types/entity-types.ts +396 -0
  168. package/src/resources/entity-types/index.ts +19 -0
  169. package/src/resources/entity-types/reviewers.ts +175 -0
  170. package/src/resources/entity-types.ts +3 -0
  171. package/src/resources/eval/eval.ts +18 -0
  172. package/src/resources/eval/index.ts +7 -0
  173. package/src/resources/eval/score.ts +590 -0
  174. package/src/resources/fs.ts +30 -0
  175. package/src/resources/functions/functions.ts +325 -100
  176. package/src/resources/functions/versions.ts +20 -13
  177. package/src/resources/index.ts +40 -0
  178. package/src/resources/knowledge-graph.ts +153 -0
  179. package/src/resources/review-queue.ts +234 -0
  180. package/src/resources/subscriptions.ts +14 -2
  181. package/src/resources/users.ts +76 -0
  182. package/src/version.ts +1 -1
  183. package/version.d.mts +1 -1
  184. package/version.d.ts +1 -1
  185. package/version.js +1 -1
  186. package/version.mjs +1 -1
@@ -0,0 +1,89 @@
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
+ /**
6
+ * Buckets are named partitions of the knowledge graph within an
7
+ * account+environment. Entities, mentions, and relations are scoped to a
8
+ * bucket so a single account+environment can host multiple isolated graphs
9
+ * — for example one per data source or workspace.
10
+ *
11
+ * Every account+environment has exactly one **default** bucket, used by
12
+ * unscoped flows. The default bucket can be renamed but never deleted.
13
+ *
14
+ * Use these endpoints to create, list, fetch, rename, and delete buckets:
15
+ *
16
+ * - **`POST /v3/buckets`** creates a non-default bucket.
17
+ * - **`GET /v3/buckets`** lists buckets with cursor pagination
18
+ * (`startingAfter` / `endingBefore` over `bucketID`).
19
+ * - **`PATCH /v3/buckets/{bucketID}`** updates `name` and/or `description`.
20
+ * - **`DELETE /v3/buckets/{bucketID}`** soft-deletes a bucket. A non-empty
21
+ * bucket is rejected with `409 Conflict` unless `?cascade=true` is
22
+ * passed; the default bucket can never be deleted.
23
+ */
24
+ export class Buckets extends APIResource {
25
+ /**
26
+ * Create a Bucket
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const bucket = await client.buckets.create({
31
+ * name: 'invoices',
32
+ * description: 'Knowledge graph for invoice documents',
33
+ * });
34
+ * ```
35
+ */
36
+ create(body, options) {
37
+ return this._client.post('/v3/buckets', { body, ...options });
38
+ }
39
+ /**
40
+ * Get a Bucket
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const bucket = await client.buckets.retrieve('bucketID');
45
+ * ```
46
+ */
47
+ retrieve(bucketID, options) {
48
+ return this._client.get(path `/v3/buckets/${bucketID}`, options);
49
+ }
50
+ /**
51
+ * Update a Bucket
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * const bucket = await client.buckets.update('bucketID');
56
+ * ```
57
+ */
58
+ update(bucketID, body, options) {
59
+ return this._client.patch(path `/v3/buckets/${bucketID}`, { body, ...options });
60
+ }
61
+ /**
62
+ * List Buckets
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * const buckets = await client.buckets.list();
67
+ * ```
68
+ */
69
+ list(query = {}, options) {
70
+ return this._client.get('/v3/buckets', { query, ...options });
71
+ }
72
+ /**
73
+ * Delete a Bucket
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * await client.buckets.delete('bucketID');
78
+ * ```
79
+ */
80
+ delete(bucketID, params = {}, options) {
81
+ const { cascade } = params ?? {};
82
+ return this._client.delete(path `/v3/buckets/${bucketID}`, {
83
+ query: { cascade },
84
+ ...options,
85
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
86
+ });
87
+ }
88
+ }
89
+ //# sourceMappingURL=buckets.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buckets.mjs","sourceRoot":"","sources":["../src/resources/buckets.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,eAAe,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CACJ,QAAgB,EAChB,IAAwB,EACxB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,eAAe,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CACJ,QAAgB,EAChB,SAAgD,EAAE,EAClD,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,eAAe,QAAQ,EAAE,EAAE;YACxD,KAAK,EAAE,EAAE,OAAO,EAAE;YAClB,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,516 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import * as SynonymsAPI from "./synonyms.mjs";
3
+ import { SynonymAddParams, SynonymAddResponse, SynonymRemoveParams, Synonyms } from "./synonyms.mjs";
4
+ import { APIPromise } from "../../core/api-promise.mjs";
5
+ import { RequestOptions } from "../../internal/request-options.mjs";
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.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entities.d.mts","sourceRoot":"","sources":["../../src/resources/entities/entities.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,WAAW,uBAAmB;AAC1C,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,uBAAmB;AACjG,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;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,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