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.
- package/CHANGELOG.md +22 -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/functions/functions.d.mts +308 -99
- package/resources/functions/functions.d.mts.map +1 -1
- package/resources/functions/functions.d.ts +308 -99
- package/resources/functions/functions.d.ts.map +1 -1
- package/resources/functions/functions.js.map +1 -1
- package/resources/functions/functions.mjs.map +1 -1
- package/resources/functions/versions.d.mts +20 -13
- package/resources/functions/versions.d.mts.map +1 -1
- package/resources/functions/versions.d.ts +20 -13
- package/resources/functions/versions.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/functions/functions.ts +325 -100
- package/src/resources/functions/versions.ts +20 -13
- 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,272 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Buckets are named partitions of the knowledge graph within an
|
|
6
|
+
* account+environment. Entities, mentions, and relations are scoped to a
|
|
7
|
+
* bucket so a single account+environment can host multiple isolated graphs
|
|
8
|
+
* — for example one per data source or workspace.
|
|
9
|
+
*
|
|
10
|
+
* Every account+environment has exactly one **default** bucket, used by
|
|
11
|
+
* unscoped flows. The default bucket can be renamed but never deleted.
|
|
12
|
+
*
|
|
13
|
+
* Use these endpoints to create, list, fetch, rename, and delete buckets:
|
|
14
|
+
*
|
|
15
|
+
* - **`POST /v3/buckets`** creates a non-default bucket.
|
|
16
|
+
* - **`GET /v3/buckets`** lists buckets with cursor pagination
|
|
17
|
+
* (`startingAfter` / `endingBefore` over `bucketID`).
|
|
18
|
+
* - **`PATCH /v3/buckets/{bucketID}`** updates `name` and/or `description`.
|
|
19
|
+
* - **`DELETE /v3/buckets/{bucketID}`** soft-deletes a bucket. A non-empty
|
|
20
|
+
* bucket is rejected with `409 Conflict` unless `?cascade=true` is
|
|
21
|
+
* passed; the default bucket can never be deleted.
|
|
22
|
+
*/
|
|
23
|
+
export declare class Buckets extends APIResource {
|
|
24
|
+
/**
|
|
25
|
+
* Create a Bucket
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const bucket = await client.buckets.create({
|
|
30
|
+
* name: 'invoices',
|
|
31
|
+
* description: 'Knowledge graph for invoice documents',
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
create(body: BucketCreateParams, options?: RequestOptions): APIPromise<BucketCreateResponse>;
|
|
36
|
+
/**
|
|
37
|
+
* Get a Bucket
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const bucket = await client.buckets.retrieve('bucketID');
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
retrieve(bucketID: string, options?: RequestOptions): APIPromise<BucketRetrieveResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Update a Bucket
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const bucket = await client.buckets.update('bucketID');
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
update(bucketID: string, body: BucketUpdateParams, options?: RequestOptions): APIPromise<BucketUpdateResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* List Buckets
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const buckets = await client.buckets.list();
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
list(query?: BucketListParams | null | undefined, options?: RequestOptions): APIPromise<BucketListResponse>;
|
|
63
|
+
/**
|
|
64
|
+
* Delete a Bucket
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* await client.buckets.delete('bucketID');
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
delete(bucketID: string, params?: BucketDeleteParams | null | undefined, options?: RequestOptions): APIPromise<void>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A Bucket is a named partition of the knowledge graph within an
|
|
75
|
+
* account+environment. Entities, mentions, and relations are scoped to a bucket so
|
|
76
|
+
* a single account+environment can host multiple isolated graphs.
|
|
77
|
+
*
|
|
78
|
+
* Every account+environment has exactly one default bucket. The default bucket can
|
|
79
|
+
* be renamed but never deleted.
|
|
80
|
+
*/
|
|
81
|
+
export interface BucketCreateResponse {
|
|
82
|
+
/**
|
|
83
|
+
* Stable public identifier for the bucket (`bkt_...`).
|
|
84
|
+
*/
|
|
85
|
+
bucketID: string;
|
|
86
|
+
/**
|
|
87
|
+
* Creation timestamp (RFC 3339).
|
|
88
|
+
*/
|
|
89
|
+
createdAt: string;
|
|
90
|
+
/**
|
|
91
|
+
* Optional human-facing note about the bucket.
|
|
92
|
+
*/
|
|
93
|
+
description: string;
|
|
94
|
+
/**
|
|
95
|
+
* Whether this is the account+environment's default bucket.
|
|
96
|
+
*/
|
|
97
|
+
isDefault: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Human-facing bucket name. Unique within an account+environment.
|
|
100
|
+
*/
|
|
101
|
+
name: string;
|
|
102
|
+
/**
|
|
103
|
+
* Last-update timestamp (RFC 3339).
|
|
104
|
+
*/
|
|
105
|
+
updatedAt: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* A Bucket is a named partition of the knowledge graph within an
|
|
109
|
+
* account+environment. Entities, mentions, and relations are scoped to a bucket so
|
|
110
|
+
* a single account+environment can host multiple isolated graphs.
|
|
111
|
+
*
|
|
112
|
+
* Every account+environment has exactly one default bucket. The default bucket can
|
|
113
|
+
* be renamed but never deleted.
|
|
114
|
+
*/
|
|
115
|
+
export interface BucketRetrieveResponse {
|
|
116
|
+
/**
|
|
117
|
+
* Stable public identifier for the bucket (`bkt_...`).
|
|
118
|
+
*/
|
|
119
|
+
bucketID: string;
|
|
120
|
+
/**
|
|
121
|
+
* Creation timestamp (RFC 3339).
|
|
122
|
+
*/
|
|
123
|
+
createdAt: string;
|
|
124
|
+
/**
|
|
125
|
+
* Optional human-facing note about the bucket.
|
|
126
|
+
*/
|
|
127
|
+
description: string;
|
|
128
|
+
/**
|
|
129
|
+
* Whether this is the account+environment's default bucket.
|
|
130
|
+
*/
|
|
131
|
+
isDefault: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Human-facing bucket name. Unique within an account+environment.
|
|
134
|
+
*/
|
|
135
|
+
name: string;
|
|
136
|
+
/**
|
|
137
|
+
* Last-update timestamp (RFC 3339).
|
|
138
|
+
*/
|
|
139
|
+
updatedAt: string;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* A Bucket is a named partition of the knowledge graph within an
|
|
143
|
+
* account+environment. Entities, mentions, and relations are scoped to a bucket so
|
|
144
|
+
* a single account+environment can host multiple isolated graphs.
|
|
145
|
+
*
|
|
146
|
+
* Every account+environment has exactly one default bucket. The default bucket can
|
|
147
|
+
* be renamed but never deleted.
|
|
148
|
+
*/
|
|
149
|
+
export interface BucketUpdateResponse {
|
|
150
|
+
/**
|
|
151
|
+
* Stable public identifier for the bucket (`bkt_...`).
|
|
152
|
+
*/
|
|
153
|
+
bucketID: string;
|
|
154
|
+
/**
|
|
155
|
+
* Creation timestamp (RFC 3339).
|
|
156
|
+
*/
|
|
157
|
+
createdAt: string;
|
|
158
|
+
/**
|
|
159
|
+
* Optional human-facing note about the bucket.
|
|
160
|
+
*/
|
|
161
|
+
description: string;
|
|
162
|
+
/**
|
|
163
|
+
* Whether this is the account+environment's default bucket.
|
|
164
|
+
*/
|
|
165
|
+
isDefault: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Human-facing bucket name. Unique within an account+environment.
|
|
168
|
+
*/
|
|
169
|
+
name: string;
|
|
170
|
+
/**
|
|
171
|
+
* Last-update timestamp (RFC 3339).
|
|
172
|
+
*/
|
|
173
|
+
updatedAt: string;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Response body for listing buckets.
|
|
177
|
+
*/
|
|
178
|
+
export interface BucketListResponse {
|
|
179
|
+
buckets: Array<BucketListResponse.Bucket>;
|
|
180
|
+
/**
|
|
181
|
+
* Total number of buckets matching the query, ignoring pagination.
|
|
182
|
+
*/
|
|
183
|
+
totalCount: number;
|
|
184
|
+
}
|
|
185
|
+
export declare namespace BucketListResponse {
|
|
186
|
+
/**
|
|
187
|
+
* A Bucket is a named partition of the knowledge graph within an
|
|
188
|
+
* account+environment. Entities, mentions, and relations are scoped to a bucket so
|
|
189
|
+
* a single account+environment can host multiple isolated graphs.
|
|
190
|
+
*
|
|
191
|
+
* Every account+environment has exactly one default bucket. The default bucket can
|
|
192
|
+
* be renamed but never deleted.
|
|
193
|
+
*/
|
|
194
|
+
interface Bucket {
|
|
195
|
+
/**
|
|
196
|
+
* Stable public identifier for the bucket (`bkt_...`).
|
|
197
|
+
*/
|
|
198
|
+
bucketID: string;
|
|
199
|
+
/**
|
|
200
|
+
* Creation timestamp (RFC 3339).
|
|
201
|
+
*/
|
|
202
|
+
createdAt: string;
|
|
203
|
+
/**
|
|
204
|
+
* Optional human-facing note about the bucket.
|
|
205
|
+
*/
|
|
206
|
+
description: string;
|
|
207
|
+
/**
|
|
208
|
+
* Whether this is the account+environment's default bucket.
|
|
209
|
+
*/
|
|
210
|
+
isDefault: boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Human-facing bucket name. Unique within an account+environment.
|
|
213
|
+
*/
|
|
214
|
+
name: string;
|
|
215
|
+
/**
|
|
216
|
+
* Last-update timestamp (RFC 3339).
|
|
217
|
+
*/
|
|
218
|
+
updatedAt: string;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
export interface BucketCreateParams {
|
|
222
|
+
/**
|
|
223
|
+
* Bucket name. Required and unique within the account+environment.
|
|
224
|
+
*/
|
|
225
|
+
name: string;
|
|
226
|
+
/**
|
|
227
|
+
* Optional description.
|
|
228
|
+
*/
|
|
229
|
+
description?: string;
|
|
230
|
+
}
|
|
231
|
+
export interface BucketUpdateParams {
|
|
232
|
+
/**
|
|
233
|
+
* New description.
|
|
234
|
+
*/
|
|
235
|
+
description?: string;
|
|
236
|
+
/**
|
|
237
|
+
* New name.
|
|
238
|
+
*/
|
|
239
|
+
name?: string;
|
|
240
|
+
}
|
|
241
|
+
export interface BucketListParams {
|
|
242
|
+
/**
|
|
243
|
+
* Cursor: return buckets whose `bucketID` sorts before this value.
|
|
244
|
+
*/
|
|
245
|
+
endingBefore?: string;
|
|
246
|
+
/**
|
|
247
|
+
* Maximum number of buckets to return (default 50, max 200).
|
|
248
|
+
*/
|
|
249
|
+
limit?: number;
|
|
250
|
+
/**
|
|
251
|
+
* Case-insensitive substring match on the bucket name.
|
|
252
|
+
*/
|
|
253
|
+
nameSubstring?: string;
|
|
254
|
+
/**
|
|
255
|
+
* Cursor: return buckets whose `bucketID` sorts after this value.
|
|
256
|
+
*/
|
|
257
|
+
startingAfter?: string;
|
|
258
|
+
}
|
|
259
|
+
export interface BucketDeleteParams {
|
|
260
|
+
/**
|
|
261
|
+
* When `true`, delete the bucket even if it still contains entities (the entities
|
|
262
|
+
* are removed along with it). When omitted or `false`, the request is rejected
|
|
263
|
+
* with `409 Conflict` if the bucket is non-empty.
|
|
264
|
+
*
|
|
265
|
+
* The default bucket can never be deleted regardless of this flag.
|
|
266
|
+
*/
|
|
267
|
+
cascade?: boolean;
|
|
268
|
+
}
|
|
269
|
+
export declare namespace Buckets {
|
|
270
|
+
export { type BucketCreateResponse as BucketCreateResponse, type BucketRetrieveResponse as BucketRetrieveResponse, type BucketUpdateResponse as BucketUpdateResponse, type BucketListResponse as BucketListResponse, type BucketCreateParams as BucketCreateParams, type BucketUpdateParams as BucketUpdateParams, type BucketListParams as BucketListParams, type BucketDeleteParams as BucketDeleteParams, };
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=buckets.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buckets.d.mts","sourceRoot":"","sources":["../src/resources/buckets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAI5F;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC;IAIxF;;;;;;;OAOG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,IAAI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B,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Buckets are named partitions of the knowledge graph within an
|
|
6
|
+
* account+environment. Entities, mentions, and relations are scoped to a
|
|
7
|
+
* bucket so a single account+environment can host multiple isolated graphs
|
|
8
|
+
* — for example one per data source or workspace.
|
|
9
|
+
*
|
|
10
|
+
* Every account+environment has exactly one **default** bucket, used by
|
|
11
|
+
* unscoped flows. The default bucket can be renamed but never deleted.
|
|
12
|
+
*
|
|
13
|
+
* Use these endpoints to create, list, fetch, rename, and delete buckets:
|
|
14
|
+
*
|
|
15
|
+
* - **`POST /v3/buckets`** creates a non-default bucket.
|
|
16
|
+
* - **`GET /v3/buckets`** lists buckets with cursor pagination
|
|
17
|
+
* (`startingAfter` / `endingBefore` over `bucketID`).
|
|
18
|
+
* - **`PATCH /v3/buckets/{bucketID}`** updates `name` and/or `description`.
|
|
19
|
+
* - **`DELETE /v3/buckets/{bucketID}`** soft-deletes a bucket. A non-empty
|
|
20
|
+
* bucket is rejected with `409 Conflict` unless `?cascade=true` is
|
|
21
|
+
* passed; the default bucket can never be deleted.
|
|
22
|
+
*/
|
|
23
|
+
export declare class Buckets extends APIResource {
|
|
24
|
+
/**
|
|
25
|
+
* Create a Bucket
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const bucket = await client.buckets.create({
|
|
30
|
+
* name: 'invoices',
|
|
31
|
+
* description: 'Knowledge graph for invoice documents',
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
create(body: BucketCreateParams, options?: RequestOptions): APIPromise<BucketCreateResponse>;
|
|
36
|
+
/**
|
|
37
|
+
* Get a Bucket
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const bucket = await client.buckets.retrieve('bucketID');
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
retrieve(bucketID: string, options?: RequestOptions): APIPromise<BucketRetrieveResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Update a Bucket
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const bucket = await client.buckets.update('bucketID');
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
update(bucketID: string, body: BucketUpdateParams, options?: RequestOptions): APIPromise<BucketUpdateResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* List Buckets
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const buckets = await client.buckets.list();
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
list(query?: BucketListParams | null | undefined, options?: RequestOptions): APIPromise<BucketListResponse>;
|
|
63
|
+
/**
|
|
64
|
+
* Delete a Bucket
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* await client.buckets.delete('bucketID');
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
delete(bucketID: string, params?: BucketDeleteParams | null | undefined, options?: RequestOptions): APIPromise<void>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A Bucket is a named partition of the knowledge graph within an
|
|
75
|
+
* account+environment. Entities, mentions, and relations are scoped to a bucket so
|
|
76
|
+
* a single account+environment can host multiple isolated graphs.
|
|
77
|
+
*
|
|
78
|
+
* Every account+environment has exactly one default bucket. The default bucket can
|
|
79
|
+
* be renamed but never deleted.
|
|
80
|
+
*/
|
|
81
|
+
export interface BucketCreateResponse {
|
|
82
|
+
/**
|
|
83
|
+
* Stable public identifier for the bucket (`bkt_...`).
|
|
84
|
+
*/
|
|
85
|
+
bucketID: string;
|
|
86
|
+
/**
|
|
87
|
+
* Creation timestamp (RFC 3339).
|
|
88
|
+
*/
|
|
89
|
+
createdAt: string;
|
|
90
|
+
/**
|
|
91
|
+
* Optional human-facing note about the bucket.
|
|
92
|
+
*/
|
|
93
|
+
description: string;
|
|
94
|
+
/**
|
|
95
|
+
* Whether this is the account+environment's default bucket.
|
|
96
|
+
*/
|
|
97
|
+
isDefault: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Human-facing bucket name. Unique within an account+environment.
|
|
100
|
+
*/
|
|
101
|
+
name: string;
|
|
102
|
+
/**
|
|
103
|
+
* Last-update timestamp (RFC 3339).
|
|
104
|
+
*/
|
|
105
|
+
updatedAt: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* A Bucket is a named partition of the knowledge graph within an
|
|
109
|
+
* account+environment. Entities, mentions, and relations are scoped to a bucket so
|
|
110
|
+
* a single account+environment can host multiple isolated graphs.
|
|
111
|
+
*
|
|
112
|
+
* Every account+environment has exactly one default bucket. The default bucket can
|
|
113
|
+
* be renamed but never deleted.
|
|
114
|
+
*/
|
|
115
|
+
export interface BucketRetrieveResponse {
|
|
116
|
+
/**
|
|
117
|
+
* Stable public identifier for the bucket (`bkt_...`).
|
|
118
|
+
*/
|
|
119
|
+
bucketID: string;
|
|
120
|
+
/**
|
|
121
|
+
* Creation timestamp (RFC 3339).
|
|
122
|
+
*/
|
|
123
|
+
createdAt: string;
|
|
124
|
+
/**
|
|
125
|
+
* Optional human-facing note about the bucket.
|
|
126
|
+
*/
|
|
127
|
+
description: string;
|
|
128
|
+
/**
|
|
129
|
+
* Whether this is the account+environment's default bucket.
|
|
130
|
+
*/
|
|
131
|
+
isDefault: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Human-facing bucket name. Unique within an account+environment.
|
|
134
|
+
*/
|
|
135
|
+
name: string;
|
|
136
|
+
/**
|
|
137
|
+
* Last-update timestamp (RFC 3339).
|
|
138
|
+
*/
|
|
139
|
+
updatedAt: string;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* A Bucket is a named partition of the knowledge graph within an
|
|
143
|
+
* account+environment. Entities, mentions, and relations are scoped to a bucket so
|
|
144
|
+
* a single account+environment can host multiple isolated graphs.
|
|
145
|
+
*
|
|
146
|
+
* Every account+environment has exactly one default bucket. The default bucket can
|
|
147
|
+
* be renamed but never deleted.
|
|
148
|
+
*/
|
|
149
|
+
export interface BucketUpdateResponse {
|
|
150
|
+
/**
|
|
151
|
+
* Stable public identifier for the bucket (`bkt_...`).
|
|
152
|
+
*/
|
|
153
|
+
bucketID: string;
|
|
154
|
+
/**
|
|
155
|
+
* Creation timestamp (RFC 3339).
|
|
156
|
+
*/
|
|
157
|
+
createdAt: string;
|
|
158
|
+
/**
|
|
159
|
+
* Optional human-facing note about the bucket.
|
|
160
|
+
*/
|
|
161
|
+
description: string;
|
|
162
|
+
/**
|
|
163
|
+
* Whether this is the account+environment's default bucket.
|
|
164
|
+
*/
|
|
165
|
+
isDefault: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Human-facing bucket name. Unique within an account+environment.
|
|
168
|
+
*/
|
|
169
|
+
name: string;
|
|
170
|
+
/**
|
|
171
|
+
* Last-update timestamp (RFC 3339).
|
|
172
|
+
*/
|
|
173
|
+
updatedAt: string;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Response body for listing buckets.
|
|
177
|
+
*/
|
|
178
|
+
export interface BucketListResponse {
|
|
179
|
+
buckets: Array<BucketListResponse.Bucket>;
|
|
180
|
+
/**
|
|
181
|
+
* Total number of buckets matching the query, ignoring pagination.
|
|
182
|
+
*/
|
|
183
|
+
totalCount: number;
|
|
184
|
+
}
|
|
185
|
+
export declare namespace BucketListResponse {
|
|
186
|
+
/**
|
|
187
|
+
* A Bucket is a named partition of the knowledge graph within an
|
|
188
|
+
* account+environment. Entities, mentions, and relations are scoped to a bucket so
|
|
189
|
+
* a single account+environment can host multiple isolated graphs.
|
|
190
|
+
*
|
|
191
|
+
* Every account+environment has exactly one default bucket. The default bucket can
|
|
192
|
+
* be renamed but never deleted.
|
|
193
|
+
*/
|
|
194
|
+
interface Bucket {
|
|
195
|
+
/**
|
|
196
|
+
* Stable public identifier for the bucket (`bkt_...`).
|
|
197
|
+
*/
|
|
198
|
+
bucketID: string;
|
|
199
|
+
/**
|
|
200
|
+
* Creation timestamp (RFC 3339).
|
|
201
|
+
*/
|
|
202
|
+
createdAt: string;
|
|
203
|
+
/**
|
|
204
|
+
* Optional human-facing note about the bucket.
|
|
205
|
+
*/
|
|
206
|
+
description: string;
|
|
207
|
+
/**
|
|
208
|
+
* Whether this is the account+environment's default bucket.
|
|
209
|
+
*/
|
|
210
|
+
isDefault: boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Human-facing bucket name. Unique within an account+environment.
|
|
213
|
+
*/
|
|
214
|
+
name: string;
|
|
215
|
+
/**
|
|
216
|
+
* Last-update timestamp (RFC 3339).
|
|
217
|
+
*/
|
|
218
|
+
updatedAt: string;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
export interface BucketCreateParams {
|
|
222
|
+
/**
|
|
223
|
+
* Bucket name. Required and unique within the account+environment.
|
|
224
|
+
*/
|
|
225
|
+
name: string;
|
|
226
|
+
/**
|
|
227
|
+
* Optional description.
|
|
228
|
+
*/
|
|
229
|
+
description?: string;
|
|
230
|
+
}
|
|
231
|
+
export interface BucketUpdateParams {
|
|
232
|
+
/**
|
|
233
|
+
* New description.
|
|
234
|
+
*/
|
|
235
|
+
description?: string;
|
|
236
|
+
/**
|
|
237
|
+
* New name.
|
|
238
|
+
*/
|
|
239
|
+
name?: string;
|
|
240
|
+
}
|
|
241
|
+
export interface BucketListParams {
|
|
242
|
+
/**
|
|
243
|
+
* Cursor: return buckets whose `bucketID` sorts before this value.
|
|
244
|
+
*/
|
|
245
|
+
endingBefore?: string;
|
|
246
|
+
/**
|
|
247
|
+
* Maximum number of buckets to return (default 50, max 200).
|
|
248
|
+
*/
|
|
249
|
+
limit?: number;
|
|
250
|
+
/**
|
|
251
|
+
* Case-insensitive substring match on the bucket name.
|
|
252
|
+
*/
|
|
253
|
+
nameSubstring?: string;
|
|
254
|
+
/**
|
|
255
|
+
* Cursor: return buckets whose `bucketID` sorts after this value.
|
|
256
|
+
*/
|
|
257
|
+
startingAfter?: string;
|
|
258
|
+
}
|
|
259
|
+
export interface BucketDeleteParams {
|
|
260
|
+
/**
|
|
261
|
+
* When `true`, delete the bucket even if it still contains entities (the entities
|
|
262
|
+
* are removed along with it). When omitted or `false`, the request is rejected
|
|
263
|
+
* with `409 Conflict` if the bucket is non-empty.
|
|
264
|
+
*
|
|
265
|
+
* The default bucket can never be deleted regardless of this flag.
|
|
266
|
+
*/
|
|
267
|
+
cascade?: boolean;
|
|
268
|
+
}
|
|
269
|
+
export declare namespace Buckets {
|
|
270
|
+
export { type BucketCreateResponse as BucketCreateResponse, type BucketRetrieveResponse as BucketRetrieveResponse, type BucketUpdateResponse as BucketUpdateResponse, type BucketListResponse as BucketListResponse, type BucketCreateParams as BucketCreateParams, type BucketUpdateParams as BucketUpdateParams, type BucketListParams as BucketListParams, type BucketDeleteParams as BucketDeleteParams, };
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=buckets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buckets.d.ts","sourceRoot":"","sources":["../src/resources/buckets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;;;;;;;;;;;;;;;;;GAkBG;AACH,qB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;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,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.Buckets = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const headers_1 = require("../internal/headers.js");
|
|
7
|
+
const path_1 = require("../internal/utils/path.js");
|
|
8
|
+
/**
|
|
9
|
+
* Buckets are named partitions of the knowledge graph within an
|
|
10
|
+
* account+environment. Entities, mentions, and relations are scoped to a
|
|
11
|
+
* bucket so a single account+environment can host multiple isolated graphs
|
|
12
|
+
* — for example one per data source or workspace.
|
|
13
|
+
*
|
|
14
|
+
* Every account+environment has exactly one **default** bucket, used by
|
|
15
|
+
* unscoped flows. The default bucket can be renamed but never deleted.
|
|
16
|
+
*
|
|
17
|
+
* Use these endpoints to create, list, fetch, rename, and delete buckets:
|
|
18
|
+
*
|
|
19
|
+
* - **`POST /v3/buckets`** creates a non-default bucket.
|
|
20
|
+
* - **`GET /v3/buckets`** lists buckets with cursor pagination
|
|
21
|
+
* (`startingAfter` / `endingBefore` over `bucketID`).
|
|
22
|
+
* - **`PATCH /v3/buckets/{bucketID}`** updates `name` and/or `description`.
|
|
23
|
+
* - **`DELETE /v3/buckets/{bucketID}`** soft-deletes a bucket. A non-empty
|
|
24
|
+
* bucket is rejected with `409 Conflict` unless `?cascade=true` is
|
|
25
|
+
* passed; the default bucket can never be deleted.
|
|
26
|
+
*/
|
|
27
|
+
class Buckets extends resource_1.APIResource {
|
|
28
|
+
/**
|
|
29
|
+
* Create a Bucket
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const bucket = await client.buckets.create({
|
|
34
|
+
* name: 'invoices',
|
|
35
|
+
* description: 'Knowledge graph for invoice documents',
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
create(body, options) {
|
|
40
|
+
return this._client.post('/v3/buckets', { body, ...options });
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get a Bucket
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const bucket = await client.buckets.retrieve('bucketID');
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
retrieve(bucketID, options) {
|
|
51
|
+
return this._client.get((0, path_1.path) `/v3/buckets/${bucketID}`, options);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Update a Bucket
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const bucket = await client.buckets.update('bucketID');
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
update(bucketID, body, options) {
|
|
62
|
+
return this._client.patch((0, path_1.path) `/v3/buckets/${bucketID}`, { body, ...options });
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* List Buckets
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const buckets = await client.buckets.list();
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
list(query = {}, options) {
|
|
73
|
+
return this._client.get('/v3/buckets', { query, ...options });
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Delete a Bucket
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* await client.buckets.delete('bucketID');
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
delete(bucketID, params = {}, options) {
|
|
84
|
+
const { cascade } = params ?? {};
|
|
85
|
+
return this._client.delete((0, path_1.path) `/v3/buckets/${bucketID}`, {
|
|
86
|
+
query: { cascade },
|
|
87
|
+
...options,
|
|
88
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.Buckets = Buckets;
|
|
93
|
+
//# sourceMappingURL=buckets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buckets.js","sourceRoot":"","sources":["../src/resources/buckets.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,oDAAmD;AAEnD,oDAA8C;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,OAAQ,SAAQ,sBAAW;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,IAAA,WAAI,EAAA,eAAe,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;I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