@limai.io/cli 0.1.1
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/dist/cli.js +65 -0
- package/dist/index.d.ts +1119 -0
- package/dist/index.js +10 -0
- package/package.json +46 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1119 @@
|
|
|
1
|
+
declare class HttpClient {
|
|
2
|
+
private baseUrl;
|
|
3
|
+
private token;
|
|
4
|
+
constructor(opts: {
|
|
5
|
+
apiUrl: string;
|
|
6
|
+
token: string;
|
|
7
|
+
});
|
|
8
|
+
private buildUrl;
|
|
9
|
+
private authHeaders;
|
|
10
|
+
private parseErrorBody;
|
|
11
|
+
private shouldRetry;
|
|
12
|
+
private getRetryDelay;
|
|
13
|
+
private request;
|
|
14
|
+
get<T>(apiPath: string, params?: Record<string, string | undefined>, timeoutMs?: number): Promise<T>;
|
|
15
|
+
post<T>(apiPath: string, body?: unknown, timeoutMs?: number): Promise<T>;
|
|
16
|
+
patch<T>(apiPath: string, body?: unknown): Promise<T>;
|
|
17
|
+
del<T>(apiPath: string, body?: unknown): Promise<T>;
|
|
18
|
+
putRaw(url: string, body: Uint8Array | Buffer | Blob, contentType: string, onProgress?: (uploaded: number, total: number) => void): Promise<void>;
|
|
19
|
+
putFile(url: string, filePath: string, contentType: string, onProgress?: (uploaded: number, total: number) => void): Promise<number>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type GetUrlResponse = {
|
|
23
|
+
url: string;
|
|
24
|
+
fileId: string;
|
|
25
|
+
fileName: string;
|
|
26
|
+
isDuplicate: boolean;
|
|
27
|
+
};
|
|
28
|
+
type ProcessFileAsyncResponse = {
|
|
29
|
+
message: string;
|
|
30
|
+
fileId: string;
|
|
31
|
+
jobId: string;
|
|
32
|
+
};
|
|
33
|
+
type BulkProcessResult = {
|
|
34
|
+
status: "queued" | "error";
|
|
35
|
+
jobId?: string;
|
|
36
|
+
error?: string;
|
|
37
|
+
};
|
|
38
|
+
type BulkProcessResponse = {
|
|
39
|
+
extractionSchemaId: string;
|
|
40
|
+
results: Record<string, BulkProcessResult>;
|
|
41
|
+
summary: {
|
|
42
|
+
queued: number;
|
|
43
|
+
errors: number;
|
|
44
|
+
total: number;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
type JobStatusValue = "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | "STALLED";
|
|
48
|
+
type StageStatus = "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | "SKIPPED";
|
|
49
|
+
type JobStatus = {
|
|
50
|
+
id: string;
|
|
51
|
+
status: JobStatusValue;
|
|
52
|
+
extractionStageStatus: StageStatus;
|
|
53
|
+
confidenceStageStatus?: StageStatus;
|
|
54
|
+
bboxStageStatus?: StageStatus;
|
|
55
|
+
};
|
|
56
|
+
type CellValue = {
|
|
57
|
+
value: string | number | boolean | null;
|
|
58
|
+
columnId: string;
|
|
59
|
+
metadata?: {
|
|
60
|
+
id: string;
|
|
61
|
+
type: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
type Row = {
|
|
66
|
+
id: string;
|
|
67
|
+
index: string;
|
|
68
|
+
status: string;
|
|
69
|
+
cells: Record<string, CellValue>;
|
|
70
|
+
childTables?: Record<string, TableData>;
|
|
71
|
+
};
|
|
72
|
+
type Column = {
|
|
73
|
+
id: string;
|
|
74
|
+
name: string;
|
|
75
|
+
type: string;
|
|
76
|
+
description?: string;
|
|
77
|
+
sharedColumnId?: string;
|
|
78
|
+
};
|
|
79
|
+
type TableData = {
|
|
80
|
+
id: string;
|
|
81
|
+
name: string;
|
|
82
|
+
columns: Column[];
|
|
83
|
+
rows: Row[];
|
|
84
|
+
};
|
|
85
|
+
type FileData = {
|
|
86
|
+
message?: string;
|
|
87
|
+
fileId?: string;
|
|
88
|
+
extractionSchemaId?: string;
|
|
89
|
+
deployment?: {
|
|
90
|
+
id: string;
|
|
91
|
+
name: string;
|
|
92
|
+
};
|
|
93
|
+
status?: string;
|
|
94
|
+
jobId?: string;
|
|
95
|
+
errorMessage?: string;
|
|
96
|
+
data?: {
|
|
97
|
+
tables: Record<string, TableData>;
|
|
98
|
+
};
|
|
99
|
+
error?: string;
|
|
100
|
+
};
|
|
101
|
+
type OffsetPagination = {
|
|
102
|
+
total: number;
|
|
103
|
+
limit: number;
|
|
104
|
+
offset: number;
|
|
105
|
+
};
|
|
106
|
+
type PagePagination = {
|
|
107
|
+
currentPage: number;
|
|
108
|
+
totalPages: number;
|
|
109
|
+
totalRows: number;
|
|
110
|
+
limit: number;
|
|
111
|
+
};
|
|
112
|
+
type OffsetPaginatedResponse<T> = {
|
|
113
|
+
data: T[];
|
|
114
|
+
pagination: OffsetPagination;
|
|
115
|
+
};
|
|
116
|
+
type PagePaginatedResponse<T> = {
|
|
117
|
+
data: T[];
|
|
118
|
+
pagination: PagePagination;
|
|
119
|
+
};
|
|
120
|
+
type DeploymentStatus = "ACTIVE" | "PAUSED";
|
|
121
|
+
type DeploymentType = "PRODUCTION" | "MODEL";
|
|
122
|
+
type Deployment = {
|
|
123
|
+
id: string;
|
|
124
|
+
name: string;
|
|
125
|
+
type: DeploymentType;
|
|
126
|
+
status: DeploymentStatus;
|
|
127
|
+
projectId: string;
|
|
128
|
+
extractionSchemaId: string;
|
|
129
|
+
createdAt: string;
|
|
130
|
+
updatedAt: string;
|
|
131
|
+
};
|
|
132
|
+
type DeploymentConfig = {
|
|
133
|
+
id: string;
|
|
134
|
+
modelName?: string;
|
|
135
|
+
temperature?: number;
|
|
136
|
+
instructions?: string;
|
|
137
|
+
bigTableExtraction?: string;
|
|
138
|
+
bboxTier?: "OFF" | "FAST" | "BALANCED" | "PRO";
|
|
139
|
+
enableConfidenceScore?: boolean;
|
|
140
|
+
enableLLMConfidence?: boolean;
|
|
141
|
+
enableLayoutConfidence?: boolean;
|
|
142
|
+
maxPagesToProcess?: number;
|
|
143
|
+
useExamples?: boolean;
|
|
144
|
+
numberOfExamples?: number;
|
|
145
|
+
};
|
|
146
|
+
type FileStatus = "UPLOADING" | "PARSING" | "UPLOADED" | "FAILED";
|
|
147
|
+
type Document = {
|
|
148
|
+
id: string;
|
|
149
|
+
name: string;
|
|
150
|
+
originalExtension: string;
|
|
151
|
+
status: FileStatus;
|
|
152
|
+
createdAt: string;
|
|
153
|
+
updatedAt: string;
|
|
154
|
+
confidenceScore?: number;
|
|
155
|
+
validationFailCount?: number;
|
|
156
|
+
inExamplePool?: boolean;
|
|
157
|
+
};
|
|
158
|
+
type Project = {
|
|
159
|
+
id: string;
|
|
160
|
+
name: string;
|
|
161
|
+
organizationId: string;
|
|
162
|
+
createdAt: string;
|
|
163
|
+
updatedAt: string;
|
|
164
|
+
};
|
|
165
|
+
type ClassificationResult = {
|
|
166
|
+
fileId: string | null;
|
|
167
|
+
deploymentName?: string;
|
|
168
|
+
extractionSchemaId?: string;
|
|
169
|
+
status?: "CLASSIFIED" | "UNCLASSIFIED";
|
|
170
|
+
};
|
|
171
|
+
type ClassificationAsyncResponse = {
|
|
172
|
+
fileId: string | null;
|
|
173
|
+
deploymentName?: string;
|
|
174
|
+
extractionSchemaId?: string;
|
|
175
|
+
status?: "UNCLASSIFIED";
|
|
176
|
+
};
|
|
177
|
+
type ClassificationStatus = {
|
|
178
|
+
classificationId: string;
|
|
179
|
+
status: "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED";
|
|
180
|
+
result?: ClassificationResult;
|
|
181
|
+
};
|
|
182
|
+
type SplitSegment = {
|
|
183
|
+
segmentId: string;
|
|
184
|
+
pageStart: number;
|
|
185
|
+
pageEnd: number;
|
|
186
|
+
fileId?: string;
|
|
187
|
+
};
|
|
188
|
+
type SplitResult = {
|
|
189
|
+
splitId: string;
|
|
190
|
+
status: "COMPLETED" | "FAILED";
|
|
191
|
+
segmentCount: number;
|
|
192
|
+
segments: SplitSegment[];
|
|
193
|
+
};
|
|
194
|
+
type SplitAsyncResponse = {
|
|
195
|
+
splitId: string;
|
|
196
|
+
fileId: string;
|
|
197
|
+
};
|
|
198
|
+
type SplitStatus = {
|
|
199
|
+
splitId: string;
|
|
200
|
+
status: "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED";
|
|
201
|
+
result?: SplitResult;
|
|
202
|
+
};
|
|
203
|
+
type ExtractionRow = {
|
|
204
|
+
tableId: string;
|
|
205
|
+
tableName: string;
|
|
206
|
+
rows: Row[];
|
|
207
|
+
};
|
|
208
|
+
type ExtractionsResponse = {
|
|
209
|
+
data: ExtractionRow[];
|
|
210
|
+
pagination: PagePagination;
|
|
211
|
+
};
|
|
212
|
+
type UploadResult = {
|
|
213
|
+
fileId: string;
|
|
214
|
+
filename: string;
|
|
215
|
+
isDuplicate: boolean;
|
|
216
|
+
bytesUploaded: number;
|
|
217
|
+
};
|
|
218
|
+
type BulkUploadFileStatus = {
|
|
219
|
+
path: string;
|
|
220
|
+
filename: string;
|
|
221
|
+
fileId?: string;
|
|
222
|
+
jobId?: string;
|
|
223
|
+
status: "pending" | "uploading" | "uploaded" | "queued" | "processing" | "completed" | "failed";
|
|
224
|
+
error?: string;
|
|
225
|
+
};
|
|
226
|
+
type BulkUploadResult = {
|
|
227
|
+
total: number;
|
|
228
|
+
uploaded: number;
|
|
229
|
+
queued: number;
|
|
230
|
+
failed: number;
|
|
231
|
+
files: BulkUploadFileStatus[];
|
|
232
|
+
};
|
|
233
|
+
type ProcessOptions = {
|
|
234
|
+
columnsOverride?: Record<string, string>[];
|
|
235
|
+
columnDescriptions?: Record<string, string>;
|
|
236
|
+
tableInstructions?: Record<string, string>;
|
|
237
|
+
};
|
|
238
|
+
type Table = {
|
|
239
|
+
id: string;
|
|
240
|
+
name: string;
|
|
241
|
+
deploymentId: string;
|
|
242
|
+
parentTableId?: string;
|
|
243
|
+
columns: Column[];
|
|
244
|
+
};
|
|
245
|
+
type ExtractionSchema = {
|
|
246
|
+
id: string;
|
|
247
|
+
projectId: string;
|
|
248
|
+
deploymentId: string;
|
|
249
|
+
modelName?: string;
|
|
250
|
+
instructions?: string;
|
|
251
|
+
temperature?: number;
|
|
252
|
+
bigTableExtraction?: string;
|
|
253
|
+
bboxTier?: "OFF" | "FAST" | "BALANCED" | "PRO";
|
|
254
|
+
enableConfidenceScore?: boolean;
|
|
255
|
+
};
|
|
256
|
+
type JobContextColumn = {
|
|
257
|
+
id: string;
|
|
258
|
+
name: string;
|
|
259
|
+
type: string;
|
|
260
|
+
description?: string;
|
|
261
|
+
isList: boolean;
|
|
262
|
+
};
|
|
263
|
+
type JobContextTable = {
|
|
264
|
+
id: string;
|
|
265
|
+
name: string;
|
|
266
|
+
instructions?: string;
|
|
267
|
+
isPrimary: boolean;
|
|
268
|
+
columns: JobContextColumn[];
|
|
269
|
+
};
|
|
270
|
+
type JobContext = {
|
|
271
|
+
jobId: string;
|
|
272
|
+
fileId: string;
|
|
273
|
+
fileName: string;
|
|
274
|
+
sourceFileUrl: string;
|
|
275
|
+
extractionSchemaId: string;
|
|
276
|
+
deploymentId: string;
|
|
277
|
+
organizationId: string;
|
|
278
|
+
schema: {
|
|
279
|
+
instructions?: string;
|
|
280
|
+
tables: JobContextTable[];
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
type CreateRowInput = {
|
|
284
|
+
cells: Record<string, unknown>;
|
|
285
|
+
parentRowId?: string;
|
|
286
|
+
index?: number;
|
|
287
|
+
};
|
|
288
|
+
type CreateRowsRequest = {
|
|
289
|
+
fileId: string;
|
|
290
|
+
deploymentId: string;
|
|
291
|
+
rows: CreateRowInput[];
|
|
292
|
+
};
|
|
293
|
+
type CreateRowsResponse = {
|
|
294
|
+
rowsCreated: number;
|
|
295
|
+
rowIds: string[];
|
|
296
|
+
};
|
|
297
|
+
type DeleteRowsRequest = {
|
|
298
|
+
fileId: string;
|
|
299
|
+
deploymentId: string;
|
|
300
|
+
};
|
|
301
|
+
type DeleteRowsResponse = {
|
|
302
|
+
rowsDeleted: number;
|
|
303
|
+
};
|
|
304
|
+
type UpdateStatusRequest = {
|
|
305
|
+
status: "PROCESSING" | "COMPLETED" | "FAILED";
|
|
306
|
+
errorMessage?: string;
|
|
307
|
+
pages?: number;
|
|
308
|
+
rows?: number;
|
|
309
|
+
};
|
|
310
|
+
type UpdateStatusResponse = {
|
|
311
|
+
id: string;
|
|
312
|
+
status: string;
|
|
313
|
+
extractionStageStatus: string;
|
|
314
|
+
updatedAt: string;
|
|
315
|
+
};
|
|
316
|
+
type AgentRowData = {
|
|
317
|
+
index: number;
|
|
318
|
+
cells: Record<string, unknown>;
|
|
319
|
+
parentIndex?: number;
|
|
320
|
+
};
|
|
321
|
+
type AgentSubmission = {
|
|
322
|
+
tables: Record<string, AgentRowData[]>;
|
|
323
|
+
metadata?: {
|
|
324
|
+
pages?: number;
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
type Bucket = {
|
|
328
|
+
id: string;
|
|
329
|
+
name: string;
|
|
330
|
+
description: string | null;
|
|
331
|
+
projectId: string;
|
|
332
|
+
fileCount: number;
|
|
333
|
+
createdAt: string;
|
|
334
|
+
updatedAt: string;
|
|
335
|
+
};
|
|
336
|
+
type BucketFile = {
|
|
337
|
+
id: string;
|
|
338
|
+
name: string;
|
|
339
|
+
labels: string[];
|
|
340
|
+
sizeBytes: number | null;
|
|
341
|
+
status: string;
|
|
342
|
+
createdAt: string;
|
|
343
|
+
};
|
|
344
|
+
type AgentTriggerType = "DOCUMENT_EXTRACTED" | "DOCUMENT_REVIEWED" | "EMAIL_RECEIVED";
|
|
345
|
+
type AgentStatus = "ACTIVE" | "PAUSED" | "DISABLED";
|
|
346
|
+
type AgentDeploymentRoute = {
|
|
347
|
+
deploymentId: string;
|
|
348
|
+
deploymentName: string;
|
|
349
|
+
};
|
|
350
|
+
type AgentIntegrationConfig = {
|
|
351
|
+
id: string;
|
|
352
|
+
provider: "SHAREPOINT" | "GOOGLE_DRIVE" | string;
|
|
353
|
+
connectionId: string;
|
|
354
|
+
enabled: boolean;
|
|
355
|
+
config: Record<string, unknown>;
|
|
356
|
+
connection?: {
|
|
357
|
+
id: string;
|
|
358
|
+
provider: string;
|
|
359
|
+
status: string;
|
|
360
|
+
grantedScopes: string[];
|
|
361
|
+
};
|
|
362
|
+
createdAt: string;
|
|
363
|
+
updatedAt: string;
|
|
364
|
+
};
|
|
365
|
+
type AgentFile = {
|
|
366
|
+
id: string;
|
|
367
|
+
fileName: string;
|
|
368
|
+
mimeType: string;
|
|
369
|
+
sizeBytes: number;
|
|
370
|
+
createdAt: string;
|
|
371
|
+
};
|
|
372
|
+
type AgentSkillLinkedFile = {
|
|
373
|
+
id: string;
|
|
374
|
+
fileName: string;
|
|
375
|
+
mimeType: string;
|
|
376
|
+
sizeBytes: number;
|
|
377
|
+
};
|
|
378
|
+
type AgentSkill = {
|
|
379
|
+
id: string;
|
|
380
|
+
name: string;
|
|
381
|
+
content: string;
|
|
382
|
+
createdAt: string;
|
|
383
|
+
updatedAt: string;
|
|
384
|
+
linkedFiles?: AgentSkillLinkedFile[];
|
|
385
|
+
};
|
|
386
|
+
type Agent = {
|
|
387
|
+
id: string;
|
|
388
|
+
name: string;
|
|
389
|
+
status: AgentStatus;
|
|
390
|
+
tier?: "STANDARD" | "STANDARD_PLUS" | "MAX";
|
|
391
|
+
processContent: string;
|
|
392
|
+
triggerTypes: AgentTriggerType[];
|
|
393
|
+
ingestEmailAddress: string | null;
|
|
394
|
+
connectionId: string | null;
|
|
395
|
+
integrationConfigs?: AgentIntegrationConfig[];
|
|
396
|
+
deploymentRoutes: AgentDeploymentRoute[];
|
|
397
|
+
runCount: number;
|
|
398
|
+
createdAt: string;
|
|
399
|
+
updatedAt: string;
|
|
400
|
+
};
|
|
401
|
+
type AgentDetail = Agent & {
|
|
402
|
+
autoSendEmails: boolean;
|
|
403
|
+
connection: {
|
|
404
|
+
id: string;
|
|
405
|
+
provider: string;
|
|
406
|
+
status: string;
|
|
407
|
+
grantedScopes: string[];
|
|
408
|
+
} | null;
|
|
409
|
+
files: AgentFile[];
|
|
410
|
+
skills: AgentSkill[];
|
|
411
|
+
};
|
|
412
|
+
type AgentRunStatus = "PENDING" | "RUNNING" | "PAUSED" | "WAITING_HUMAN" | "COMPLETED" | "FAILED";
|
|
413
|
+
type AgentRun = {
|
|
414
|
+
id: string;
|
|
415
|
+
triggerEventId: string;
|
|
416
|
+
triggerType: AgentTriggerType;
|
|
417
|
+
status: AgentRunStatus;
|
|
418
|
+
title: string;
|
|
419
|
+
sandboxId: string | null;
|
|
420
|
+
metadata: Record<string, unknown> | null;
|
|
421
|
+
errorMessage: string | null;
|
|
422
|
+
executionDurationMs: number | null;
|
|
423
|
+
startedAt: string | null;
|
|
424
|
+
completedAt: string | null;
|
|
425
|
+
createdAt: string;
|
|
426
|
+
stepsCount: number;
|
|
427
|
+
emailDraftsCount: number;
|
|
428
|
+
};
|
|
429
|
+
type AgentStepType = "EMAIL_DRAFT" | "DATA_REVIEW" | "FILE_OUTPUT" | "TASK" | "USER_INPUT";
|
|
430
|
+
type AgentStep = {
|
|
431
|
+
id: string;
|
|
432
|
+
type: AgentStepType;
|
|
433
|
+
title: string;
|
|
434
|
+
description: string | null;
|
|
435
|
+
status: string;
|
|
436
|
+
order: number;
|
|
437
|
+
createdAt: string;
|
|
438
|
+
completedAt: string | null;
|
|
439
|
+
};
|
|
440
|
+
type AgentRunDetail = AgentRun & {
|
|
441
|
+
steps: AgentStep[];
|
|
442
|
+
emailDrafts: Array<{
|
|
443
|
+
id: string;
|
|
444
|
+
toAddress: string;
|
|
445
|
+
subject: string;
|
|
446
|
+
status: string;
|
|
447
|
+
createdAt: string;
|
|
448
|
+
}>;
|
|
449
|
+
};
|
|
450
|
+
type AgentRunConversation = {
|
|
451
|
+
messages: unknown[];
|
|
452
|
+
unavailable?: boolean;
|
|
453
|
+
source?: "s3" | "sandbox" | "unavailable";
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
declare class QueueResource {
|
|
457
|
+
private http;
|
|
458
|
+
constructor(http: HttpClient);
|
|
459
|
+
getStatus(jobId: string): Promise<JobStatus>;
|
|
460
|
+
cancel(jobId: string): Promise<void>;
|
|
461
|
+
updateStatus(jobId: string, request: UpdateStatusRequest): Promise<UpdateStatusResponse>;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
type PollOptions = {
|
|
465
|
+
intervalMs?: number;
|
|
466
|
+
maxIntervalMs?: number;
|
|
467
|
+
backoffMultiplier?: number;
|
|
468
|
+
timeoutMs?: number;
|
|
469
|
+
onStatus?: (status: JobStatus) => void;
|
|
470
|
+
};
|
|
471
|
+
declare class JobPoller {
|
|
472
|
+
private queue;
|
|
473
|
+
constructor(queue: QueueResource);
|
|
474
|
+
poll(jobId: string, opts?: PollOptions): AsyncGenerator<JobStatus, void, undefined>;
|
|
475
|
+
waitForCompletion(jobId: string, opts?: PollOptions): Promise<JobStatus>;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
declare class DocumentsResource {
|
|
479
|
+
private http;
|
|
480
|
+
constructor(http: HttpClient);
|
|
481
|
+
getUploadUrl(extractionSchemaId: string, filename: string, contentHash?: string): Promise<GetUrlResponse>;
|
|
482
|
+
processSync(extractionSchemaId: string, fileId: string, opts?: ProcessOptions): Promise<FileData>;
|
|
483
|
+
processAsync(extractionSchemaId: string, fileId: string, opts?: ProcessOptions): Promise<ProcessFileAsyncResponse>;
|
|
484
|
+
processFilesAsync(extractionSchemaId: string, fileIds: string[], opts?: ProcessOptions): Promise<BulkProcessResponse>;
|
|
485
|
+
getFileData(fileId: string, extractionSchemaId?: string): Promise<FileData>;
|
|
486
|
+
getFilesData(fileIds: string[], extractionSchemaId: string): Promise<FileData[]>;
|
|
487
|
+
submitCorrections(extractionSchemaId: string, fileId: string, corrections: unknown): Promise<unknown>;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
type CreateProjectBody = {
|
|
491
|
+
name: string;
|
|
492
|
+
teamId?: string;
|
|
493
|
+
icon?: string;
|
|
494
|
+
};
|
|
495
|
+
type NotificationChannelType = "SLACK" | "TEAMS_CHANNEL" | "TEAMS_CHAT" | "EMAIL_ADDRESS";
|
|
496
|
+
type NotificationIntegrationProvider = "SLACK" | "TEAMS" | "SHAREPOINT" | "GOOGLE_DRIVE";
|
|
497
|
+
type NotificationRoute = {
|
|
498
|
+
id: string;
|
|
499
|
+
scope: string;
|
|
500
|
+
projectId: string | null;
|
|
501
|
+
deploymentId: string | null;
|
|
502
|
+
agentId: string | null;
|
|
503
|
+
channelType: NotificationChannelType;
|
|
504
|
+
connectionId: string | null;
|
|
505
|
+
destination: unknown;
|
|
506
|
+
destinationLabel: string | null;
|
|
507
|
+
subscribedEvents: string[];
|
|
508
|
+
enabled: boolean;
|
|
509
|
+
createdAt: string;
|
|
510
|
+
updatedAt: string;
|
|
511
|
+
};
|
|
512
|
+
type CreateNotificationRouteBody = {
|
|
513
|
+
channelType: NotificationChannelType;
|
|
514
|
+
connectionId?: string | null;
|
|
515
|
+
destination: Record<string, unknown>;
|
|
516
|
+
destinationLabel?: string | null;
|
|
517
|
+
subscribedEvents: string[];
|
|
518
|
+
deploymentId?: string | null;
|
|
519
|
+
agentId?: string | null;
|
|
520
|
+
enabled?: boolean;
|
|
521
|
+
};
|
|
522
|
+
type UpdateNotificationRoutePatch = {
|
|
523
|
+
connectionId?: string | null;
|
|
524
|
+
destination?: Record<string, unknown>;
|
|
525
|
+
destinationLabel?: string | null;
|
|
526
|
+
subscribedEvents?: string[];
|
|
527
|
+
deploymentId?: string | null;
|
|
528
|
+
agentId?: string | null;
|
|
529
|
+
enabled?: boolean;
|
|
530
|
+
};
|
|
531
|
+
type IntegrationConnectionSummary = {
|
|
532
|
+
id: string;
|
|
533
|
+
provider: string;
|
|
534
|
+
tenantId: string | null;
|
|
535
|
+
tenantName: string | null;
|
|
536
|
+
};
|
|
537
|
+
type SlackChannelSummary = {
|
|
538
|
+
id: string;
|
|
539
|
+
name: string;
|
|
540
|
+
isPrivate: boolean;
|
|
541
|
+
};
|
|
542
|
+
type TeamsTeamSummary = {
|
|
543
|
+
id: string;
|
|
544
|
+
displayName: string;
|
|
545
|
+
};
|
|
546
|
+
type TeamsChannelSummary = {
|
|
547
|
+
id: string;
|
|
548
|
+
displayName: string;
|
|
549
|
+
membershipType: string;
|
|
550
|
+
};
|
|
551
|
+
declare class ProjectsResource {
|
|
552
|
+
private http;
|
|
553
|
+
constructor(http: HttpClient);
|
|
554
|
+
list(): Promise<Project[]>;
|
|
555
|
+
create(body: CreateProjectBody): Promise<Project>;
|
|
556
|
+
getSchema(projectId: string): Promise<unknown>;
|
|
557
|
+
getSharedColumnIds(projectId: string): Promise<unknown>;
|
|
558
|
+
listDeployments(projectId: string): Promise<unknown>;
|
|
559
|
+
listBenchmarks(projectId: string): Promise<unknown>;
|
|
560
|
+
listNotificationRoutes(projectId: string): Promise<NotificationRoute[]>;
|
|
561
|
+
createNotificationRoute(projectId: string, body: CreateNotificationRouteBody): Promise<NotificationRoute>;
|
|
562
|
+
updateNotificationRoute(projectId: string, routeId: string, patch: UpdateNotificationRoutePatch): Promise<NotificationRoute>;
|
|
563
|
+
deleteNotificationRoute(projectId: string, routeId: string): Promise<unknown>;
|
|
564
|
+
listNotificationIntegrations(projectId: string, provider?: NotificationIntegrationProvider): Promise<IntegrationConnectionSummary[]>;
|
|
565
|
+
listNotificationSlackChannels(projectId: string, connectionId: string): Promise<SlackChannelSummary[]>;
|
|
566
|
+
listNotificationTeamsTeams(projectId: string, connectionId: string): Promise<TeamsTeamSummary[]>;
|
|
567
|
+
listNotificationTeamsChannels(projectId: string, connectionId: string, teamId: string): Promise<TeamsChannelSummary[]>;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
type ListDeploymentsOpts = {
|
|
571
|
+
status?: string;
|
|
572
|
+
type?: string;
|
|
573
|
+
};
|
|
574
|
+
type ListDocumentsOpts = {
|
|
575
|
+
limit?: number;
|
|
576
|
+
offset?: number;
|
|
577
|
+
status?: string;
|
|
578
|
+
};
|
|
579
|
+
type CreateDeploymentBody = {
|
|
580
|
+
name: string;
|
|
581
|
+
type: string;
|
|
582
|
+
tables?: unknown;
|
|
583
|
+
};
|
|
584
|
+
declare class DeploymentsResource {
|
|
585
|
+
private http;
|
|
586
|
+
constructor(http: HttpClient);
|
|
587
|
+
list(projectId: string, opts?: ListDeploymentsOpts): Promise<Deployment[]>;
|
|
588
|
+
create(projectId: string, body: CreateDeploymentBody): Promise<Deployment>;
|
|
589
|
+
getConfig(deploymentId: string): Promise<DeploymentConfig>;
|
|
590
|
+
updateConfig(deploymentId: string, body: Partial<DeploymentConfig>): Promise<void>;
|
|
591
|
+
listDocuments(deploymentId: string, opts?: ListDocumentsOpts): Promise<OffsetPaginatedResponse<Document>>;
|
|
592
|
+
getDocument(deploymentId: string, fileId: string): Promise<Document>;
|
|
593
|
+
deleteDocument(deploymentId: string, fileId: string): Promise<void>;
|
|
594
|
+
bulkDelete(deploymentId: string, fileIds: string[]): Promise<void>;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
type ListRowsOpts = {
|
|
598
|
+
limit?: number;
|
|
599
|
+
offset?: number;
|
|
600
|
+
status?: string;
|
|
601
|
+
};
|
|
602
|
+
declare class TablesResource {
|
|
603
|
+
private http;
|
|
604
|
+
constructor(http: HttpClient);
|
|
605
|
+
get(tableId: string): Promise<Table>;
|
|
606
|
+
listColumns(tableId: string): Promise<Column[]>;
|
|
607
|
+
listRows(tableId: string, opts?: ListRowsOpts): Promise<OffsetPaginatedResponse<Row>>;
|
|
608
|
+
createRows(tableId: string, request: CreateRowsRequest): Promise<CreateRowsResponse>;
|
|
609
|
+
deleteRows(tableId: string, request: DeleteRowsRequest): Promise<DeleteRowsResponse>;
|
|
610
|
+
createTable(deploymentId: string, body: unknown): Promise<unknown>;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
type OffsetFetcher<T> = (limit: number, offset: number) => Promise<{
|
|
614
|
+
data: T[];
|
|
615
|
+
pagination: {
|
|
616
|
+
total: number;
|
|
617
|
+
limit: number;
|
|
618
|
+
offset: number;
|
|
619
|
+
};
|
|
620
|
+
}>;
|
|
621
|
+
type PageFetcher<T> = (page: number, limit: number) => Promise<{
|
|
622
|
+
data: T[];
|
|
623
|
+
pagination: {
|
|
624
|
+
currentPage: number;
|
|
625
|
+
totalPages: number;
|
|
626
|
+
totalRows: number;
|
|
627
|
+
limit: number;
|
|
628
|
+
};
|
|
629
|
+
}>;
|
|
630
|
+
type PaginationOptions = {
|
|
631
|
+
pageSize?: number;
|
|
632
|
+
maxItems?: number;
|
|
633
|
+
};
|
|
634
|
+
declare function paginateOffset<T>(fetcher: OffsetFetcher<T>, opts?: PaginationOptions): AsyncGenerator<T[], void, undefined>;
|
|
635
|
+
declare function paginatePage<T>(fetcher: PageFetcher<T>, opts?: PaginationOptions): AsyncGenerator<T[], void, undefined>;
|
|
636
|
+
declare function collectAll<T>(generator: AsyncGenerator<T[], void, undefined>): Promise<T[]>;
|
|
637
|
+
|
|
638
|
+
type GetExtractionsOpts = {
|
|
639
|
+
page?: number;
|
|
640
|
+
limit?: number;
|
|
641
|
+
order?: "asc" | "desc";
|
|
642
|
+
status?: string;
|
|
643
|
+
};
|
|
644
|
+
declare class ExtractionsResource {
|
|
645
|
+
private http;
|
|
646
|
+
constructor(http: HttpClient);
|
|
647
|
+
getRows(tableId: string, opts?: GetExtractionsOpts): Promise<ExtractionsResponse>;
|
|
648
|
+
getAllRows(tableId: string, opts?: PaginationOptions & {
|
|
649
|
+
order?: "asc" | "desc";
|
|
650
|
+
status?: string;
|
|
651
|
+
}): AsyncGenerator<ExtractionRow[], void, undefined>;
|
|
652
|
+
collectAllRows(tableId: string, opts?: PaginationOptions & {
|
|
653
|
+
order?: "asc" | "desc";
|
|
654
|
+
status?: string;
|
|
655
|
+
}): Promise<ExtractionRow[]>;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
declare class ClassifyResource {
|
|
659
|
+
private http;
|
|
660
|
+
constructor(http: HttpClient);
|
|
661
|
+
list(projectId: string): Promise<unknown>;
|
|
662
|
+
getUploadUrl(classifierId: string, filename: string): Promise<GetUrlResponse>;
|
|
663
|
+
classify(classifierId: string, fileId: string): Promise<ClassificationResult>;
|
|
664
|
+
classifyAsync(classifierId: string, fileId: string): Promise<ClassificationAsyncResponse>;
|
|
665
|
+
getStatus(classifierId: string, classificationId: string): Promise<ClassificationStatus>;
|
|
666
|
+
createClassifier(body: {
|
|
667
|
+
name: string;
|
|
668
|
+
projectId: string;
|
|
669
|
+
}): Promise<unknown>;
|
|
670
|
+
createRoute(classifierId: string, body: {
|
|
671
|
+
deploymentId: string;
|
|
672
|
+
name: string;
|
|
673
|
+
description: string;
|
|
674
|
+
}): Promise<unknown>;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
declare class SplitResource {
|
|
678
|
+
private http;
|
|
679
|
+
constructor(http: HttpClient);
|
|
680
|
+
list(projectId: string): Promise<unknown>;
|
|
681
|
+
getUploadUrl(splitterId: string, filename: string): Promise<GetUrlResponse>;
|
|
682
|
+
split(splitterId: string, fileId: string): Promise<SplitResult>;
|
|
683
|
+
splitAsync(splitterId: string, fileId: string): Promise<SplitAsyncResponse>;
|
|
684
|
+
getStatus(splitterId: string, splitId: string): Promise<SplitStatus>;
|
|
685
|
+
listSplits(splitterId: string): Promise<unknown>;
|
|
686
|
+
createSplitter(body: {
|
|
687
|
+
name: string;
|
|
688
|
+
prompt: string;
|
|
689
|
+
outputType: string;
|
|
690
|
+
deploymentId?: string;
|
|
691
|
+
classifierId?: string;
|
|
692
|
+
projectId: string;
|
|
693
|
+
mergeSegments?: boolean;
|
|
694
|
+
}): Promise<unknown>;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
declare class SchemaResource {
|
|
698
|
+
private http;
|
|
699
|
+
constructor(http: HttpClient);
|
|
700
|
+
get(extractionSchemaId: string): Promise<ExtractionSchema>;
|
|
701
|
+
update(extractionSchemaId: string, body: Partial<DeploymentConfig>): Promise<void>;
|
|
702
|
+
getAllData(extractionSchemaId: string): Promise<unknown>;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
declare class BucketsResource {
|
|
706
|
+
private http;
|
|
707
|
+
constructor(http: HttpClient);
|
|
708
|
+
list(projectId: string): Promise<Bucket[]>;
|
|
709
|
+
get(bucketId: string): Promise<Bucket>;
|
|
710
|
+
create(projectId: string, name: string, description?: string): Promise<Bucket>;
|
|
711
|
+
delete(bucketId: string): Promise<void>;
|
|
712
|
+
getUploadUrl(bucketId: string, filename: string): Promise<GetUrlResponse>;
|
|
713
|
+
confirmUpload(bucketId: string, fileId: string, sizeBytes?: number): Promise<void>;
|
|
714
|
+
listFiles(bucketId: string, labels?: string[]): Promise<BucketFile[]>;
|
|
715
|
+
getDownloadUrl(bucketId: string, fileId: string): Promise<{
|
|
716
|
+
url: string;
|
|
717
|
+
fileName: string;
|
|
718
|
+
}>;
|
|
719
|
+
updateLabels(bucketId: string, fileId: string, labels: string[]): Promise<BucketFile>;
|
|
720
|
+
deleteFile(bucketId: string, fileId: string): Promise<void>;
|
|
721
|
+
sendTo(bucketId: string, fileId: string, targetType: string, targetId: string): Promise<unknown>;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
declare class AgentsResource {
|
|
725
|
+
private http;
|
|
726
|
+
constructor(http: HttpClient);
|
|
727
|
+
list(projectId: string, opts?: {
|
|
728
|
+
status?: string;
|
|
729
|
+
}): Promise<Agent[]>;
|
|
730
|
+
get(projectId: string, agentId: string): Promise<AgentDetail>;
|
|
731
|
+
create(projectId: string, body: {
|
|
732
|
+
name: string;
|
|
733
|
+
processContent: string;
|
|
734
|
+
triggerTypes: string[];
|
|
735
|
+
deploymentIds?: string[];
|
|
736
|
+
connectionId?: string;
|
|
737
|
+
integrationConfigs?: Array<{
|
|
738
|
+
provider: "SHAREPOINT" | "GOOGLE_DRIVE";
|
|
739
|
+
connectionId: string;
|
|
740
|
+
enabled?: boolean;
|
|
741
|
+
config?: Record<string, unknown>;
|
|
742
|
+
}>;
|
|
743
|
+
emailLocalPart?: string;
|
|
744
|
+
}): Promise<AgentDetail>;
|
|
745
|
+
update(projectId: string, agentId: string, body: {
|
|
746
|
+
name?: string;
|
|
747
|
+
processContent?: string;
|
|
748
|
+
triggerTypes?: string[];
|
|
749
|
+
deploymentIds?: string[];
|
|
750
|
+
connectionId?: string | null;
|
|
751
|
+
integrationConfigs?: Array<{
|
|
752
|
+
provider: "SHAREPOINT" | "GOOGLE_DRIVE";
|
|
753
|
+
connectionId: string;
|
|
754
|
+
enabled?: boolean;
|
|
755
|
+
config?: Record<string, unknown>;
|
|
756
|
+
}>;
|
|
757
|
+
status?: string;
|
|
758
|
+
tier?: string;
|
|
759
|
+
emailLocalPart?: string;
|
|
760
|
+
}): Promise<Agent>;
|
|
761
|
+
delete(projectId: string, agentId: string): Promise<void>;
|
|
762
|
+
getFileUploadUrl(projectId: string, agentId: string, filename: string): Promise<GetUrlResponse>;
|
|
763
|
+
deleteFile(projectId: string, agentId: string, fileId: string): Promise<void>;
|
|
764
|
+
updateFileMetadata(projectId: string, agentId: string, fileId: string, body: {
|
|
765
|
+
sizeBytes: number;
|
|
766
|
+
mimeType?: string;
|
|
767
|
+
}): Promise<{
|
|
768
|
+
id: string;
|
|
769
|
+
sizeBytes: number;
|
|
770
|
+
mimeType: string;
|
|
771
|
+
}>;
|
|
772
|
+
getFileDownloadUrl(projectId: string, agentId: string, fileId: string): Promise<{
|
|
773
|
+
url: string;
|
|
774
|
+
fileName: string;
|
|
775
|
+
}>;
|
|
776
|
+
listSkills(projectId: string, agentId: string): Promise<AgentSkill[]>;
|
|
777
|
+
createSkill(projectId: string, agentId: string, body: {
|
|
778
|
+
name: string;
|
|
779
|
+
content: string;
|
|
780
|
+
}): Promise<AgentSkill>;
|
|
781
|
+
updateSkill(projectId: string, agentId: string, skillId: string, body: {
|
|
782
|
+
name?: string;
|
|
783
|
+
content?: string;
|
|
784
|
+
}): Promise<AgentSkill>;
|
|
785
|
+
deleteSkill(projectId: string, agentId: string, skillId: string): Promise<void>;
|
|
786
|
+
linkFileToSkill(projectId: string, agentId: string, skillId: string, fileId: string): Promise<{
|
|
787
|
+
id: string;
|
|
788
|
+
file: {
|
|
789
|
+
id: string;
|
|
790
|
+
fileName: string;
|
|
791
|
+
mimeType: string;
|
|
792
|
+
sizeBytes: number;
|
|
793
|
+
};
|
|
794
|
+
}>;
|
|
795
|
+
unlinkFileFromSkill(projectId: string, agentId: string, skillId: string, fileId: string): Promise<void>;
|
|
796
|
+
listRuns(projectId: string, agentId: string, opts?: {
|
|
797
|
+
limit?: number;
|
|
798
|
+
status?: string;
|
|
799
|
+
}): Promise<AgentRun[]>;
|
|
800
|
+
getRun(projectId: string, agentId: string, runId: string): Promise<AgentRunDetail>;
|
|
801
|
+
getRunConversation(projectId: string, agentId: string, runId: string, opts?: {
|
|
802
|
+
stepId?: string;
|
|
803
|
+
}): Promise<AgentRunConversation>;
|
|
804
|
+
createRun(projectId: string, agentId: string, body: {
|
|
805
|
+
triggerEventId: string;
|
|
806
|
+
triggerType: string;
|
|
807
|
+
title: string;
|
|
808
|
+
metadata?: Record<string, unknown>;
|
|
809
|
+
}): Promise<{
|
|
810
|
+
id: string;
|
|
811
|
+
status: string;
|
|
812
|
+
title: string;
|
|
813
|
+
triggerType: string;
|
|
814
|
+
createdAt: string;
|
|
815
|
+
}>;
|
|
816
|
+
createStep(projectId: string, agentId: string, runId: string, body: {
|
|
817
|
+
type: string;
|
|
818
|
+
title: string;
|
|
819
|
+
description?: string;
|
|
820
|
+
postReviewAction?: string;
|
|
821
|
+
data?: Record<string, unknown>;
|
|
822
|
+
order: number;
|
|
823
|
+
conditions?: Array<{
|
|
824
|
+
type: string;
|
|
825
|
+
entityId: string;
|
|
826
|
+
label?: string;
|
|
827
|
+
}>;
|
|
828
|
+
}): Promise<{
|
|
829
|
+
id: string;
|
|
830
|
+
type: string;
|
|
831
|
+
title: string;
|
|
832
|
+
status: string;
|
|
833
|
+
order: number;
|
|
834
|
+
createdAt: string;
|
|
835
|
+
conditions?: Array<{
|
|
836
|
+
id: string;
|
|
837
|
+
type: string;
|
|
838
|
+
entityId: string;
|
|
839
|
+
label: string | null;
|
|
840
|
+
met: boolean;
|
|
841
|
+
}>;
|
|
842
|
+
}>;
|
|
843
|
+
updateRun(projectId: string, agentId: string, runId: string, body: {
|
|
844
|
+
status?: string;
|
|
845
|
+
metadata?: Record<string, unknown>;
|
|
846
|
+
errorMessage?: string;
|
|
847
|
+
}): Promise<{
|
|
848
|
+
id: string;
|
|
849
|
+
status: string;
|
|
850
|
+
metadata: unknown;
|
|
851
|
+
}>;
|
|
852
|
+
updateStep(projectId: string, agentId: string, runId: string, stepId: string, body: {
|
|
853
|
+
status?: string;
|
|
854
|
+
data?: Record<string, unknown>;
|
|
855
|
+
}): Promise<{
|
|
856
|
+
id: string;
|
|
857
|
+
status: string;
|
|
858
|
+
}>;
|
|
859
|
+
updateStepConditions(projectId: string, agentId: string, runId: string, stepId: string, conditions: Array<{
|
|
860
|
+
type: string;
|
|
861
|
+
entityId: string;
|
|
862
|
+
label?: string;
|
|
863
|
+
}>): Promise<{
|
|
864
|
+
id: string;
|
|
865
|
+
status: string;
|
|
866
|
+
}>;
|
|
867
|
+
pauseRun(projectId: string, agentId: string, runId: string): Promise<{
|
|
868
|
+
success: boolean;
|
|
869
|
+
runId: string;
|
|
870
|
+
status: string;
|
|
871
|
+
}>;
|
|
872
|
+
submitStepAction(projectId: string, agentId: string, runId: string, stepId: string, body: {
|
|
873
|
+
action: string;
|
|
874
|
+
data?: Record<string, unknown>;
|
|
875
|
+
}): Promise<{
|
|
876
|
+
success: boolean;
|
|
877
|
+
stepId: string;
|
|
878
|
+
status: string;
|
|
879
|
+
}>;
|
|
880
|
+
sendEmail(projectId: string, agentId: string, body: {
|
|
881
|
+
executionId: string;
|
|
882
|
+
to: string;
|
|
883
|
+
subject: string;
|
|
884
|
+
body: string;
|
|
885
|
+
htmlBody?: string;
|
|
886
|
+
inReplyTo?: string;
|
|
887
|
+
}): Promise<{
|
|
888
|
+
success: boolean;
|
|
889
|
+
draftId: string;
|
|
890
|
+
status: string;
|
|
891
|
+
}>;
|
|
892
|
+
completeExecution(projectId: string, agentId: string, body: {
|
|
893
|
+
executionId: string;
|
|
894
|
+
status: "COMPLETED" | "FAILED";
|
|
895
|
+
errorMessage?: string;
|
|
896
|
+
outputFileName?: string;
|
|
897
|
+
outputUrl?: string;
|
|
898
|
+
}): Promise<{
|
|
899
|
+
success: boolean;
|
|
900
|
+
executionId: string;
|
|
901
|
+
status: string;
|
|
902
|
+
sandboxArchived: boolean;
|
|
903
|
+
}>;
|
|
904
|
+
getSharePointToken(projectId: string, agentId: string, body: {
|
|
905
|
+
executionId: string;
|
|
906
|
+
}): Promise<{
|
|
907
|
+
accessToken: string;
|
|
908
|
+
}>;
|
|
909
|
+
getArtifactUploadUrl(projectId: string, agentId: string, body: {
|
|
910
|
+
executionId: string;
|
|
911
|
+
fileName: string;
|
|
912
|
+
}): Promise<{
|
|
913
|
+
uploadUrl: string;
|
|
914
|
+
s3Key: string;
|
|
915
|
+
fileName: string;
|
|
916
|
+
}>;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
type VisionFile = {
|
|
920
|
+
data: string;
|
|
921
|
+
mimeType: string;
|
|
922
|
+
};
|
|
923
|
+
type VisionAskBody = {
|
|
924
|
+
prompt: string;
|
|
925
|
+
files: VisionFile[];
|
|
926
|
+
schema?: Record<string, unknown>;
|
|
927
|
+
};
|
|
928
|
+
type VisionAskResponse = {
|
|
929
|
+
text: string;
|
|
930
|
+
} | {
|
|
931
|
+
data: unknown;
|
|
932
|
+
};
|
|
933
|
+
declare class VisionResource {
|
|
934
|
+
private http;
|
|
935
|
+
constructor(http: HttpClient);
|
|
936
|
+
ask(projectId: string, body: VisionAskBody): Promise<VisionAskResponse>;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
type LabelListResponse = {
|
|
940
|
+
labels: string[];
|
|
941
|
+
};
|
|
942
|
+
type LabelUpdateResponse = {
|
|
943
|
+
labels: string[];
|
|
944
|
+
};
|
|
945
|
+
type LabelSearchResult = {
|
|
946
|
+
entityType: "file" | "email";
|
|
947
|
+
entityId: string;
|
|
948
|
+
labels: string[];
|
|
949
|
+
name?: string;
|
|
950
|
+
subject?: string;
|
|
951
|
+
fromAddress?: string;
|
|
952
|
+
status?: string;
|
|
953
|
+
deploymentId?: string | null;
|
|
954
|
+
createdAt?: string;
|
|
955
|
+
receivedAt?: string;
|
|
956
|
+
};
|
|
957
|
+
type LabelSearchResponse = {
|
|
958
|
+
results: LabelSearchResult[];
|
|
959
|
+
};
|
|
960
|
+
declare class LabelsResource {
|
|
961
|
+
private http;
|
|
962
|
+
constructor(http: HttpClient);
|
|
963
|
+
list(projectId: string, opts?: {
|
|
964
|
+
entityType?: string;
|
|
965
|
+
}): Promise<LabelListResponse>;
|
|
966
|
+
addRemove(projectId: string, entityType: string, entityId: string, add?: string[], remove?: string[]): Promise<LabelUpdateResponse>;
|
|
967
|
+
search(projectId: string, opts?: {
|
|
968
|
+
entityType?: string;
|
|
969
|
+
labels?: string;
|
|
970
|
+
key?: string;
|
|
971
|
+
}): Promise<LabelSearchResponse>;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
type LimaiClientConfig = {
|
|
975
|
+
apiUrl: string;
|
|
976
|
+
token: string;
|
|
977
|
+
sseUrl?: string;
|
|
978
|
+
};
|
|
979
|
+
declare class LimaiClient {
|
|
980
|
+
readonly http: HttpClient;
|
|
981
|
+
readonly documents: DocumentsResource;
|
|
982
|
+
readonly projects: ProjectsResource;
|
|
983
|
+
readonly deployments: DeploymentsResource;
|
|
984
|
+
readonly tables: TablesResource;
|
|
985
|
+
readonly extractions: ExtractionsResource;
|
|
986
|
+
readonly queue: QueueResource;
|
|
987
|
+
readonly classify: ClassifyResource;
|
|
988
|
+
readonly split: SplitResource;
|
|
989
|
+
readonly schema: SchemaResource;
|
|
990
|
+
readonly buckets: BucketsResource;
|
|
991
|
+
readonly agents: AgentsResource;
|
|
992
|
+
readonly vision: VisionResource;
|
|
993
|
+
readonly labels: LabelsResource;
|
|
994
|
+
constructor(config: LimaiClientConfig);
|
|
995
|
+
uploadFile(extractionSchemaId: string, filePath: string, onProgress?: (uploaded: number, total: number) => void): Promise<UploadResult>;
|
|
996
|
+
uploadFolder(extractionSchemaId: string, dirPath: string, opts?: {
|
|
997
|
+
concurrency?: number;
|
|
998
|
+
process?: boolean;
|
|
999
|
+
globPattern?: string;
|
|
1000
|
+
onFileStatus?: (status: BulkUploadFileStatus) => void;
|
|
1001
|
+
}): Promise<BulkUploadResult>;
|
|
1002
|
+
processAndWait(extractionSchemaId: string, fileId: string, opts?: {
|
|
1003
|
+
processOptions?: ProcessOptions;
|
|
1004
|
+
pollOptions?: PollOptions;
|
|
1005
|
+
}): Promise<FileData>;
|
|
1006
|
+
downloadAll(tableId: string, opts?: PaginationOptions & {
|
|
1007
|
+
order?: "asc" | "desc";
|
|
1008
|
+
status?: string;
|
|
1009
|
+
}): AsyncGenerator<ExtractionRow[], void, undefined>;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
type LimaiConfig = {
|
|
1013
|
+
apiUrl: string;
|
|
1014
|
+
token: string;
|
|
1015
|
+
sseUrl?: string;
|
|
1016
|
+
defaultProjectId?: string;
|
|
1017
|
+
defaultDeploymentId?: string;
|
|
1018
|
+
};
|
|
1019
|
+
declare function loadConfig(): LimaiConfig | null;
|
|
1020
|
+
declare function saveConfig(config: Partial<LimaiConfig>): void;
|
|
1021
|
+
declare function requireConfig(): LimaiConfig;
|
|
1022
|
+
|
|
1023
|
+
type SSEEventType = "QUEUE_STATUS_CHANGED" | "TABLE_DATA_CHANGED" | "TRAINING_EXAMPLE_ADDED" | "FILE_REVIEWED" | "CONFIDENCE_SCORE_UPDATED" | "LAYOUT_SIMILARITY_UPDATED" | "CLASSIFICATION_STATUS_CHANGED" | "CLASSIFICATION_COMPLETED" | "CLASSIFICATION_FAILED" | "CLASSIFIER_CREATED" | "CLASSIFIER_UPDATED" | "CLASSIFIER_DELETED" | "SPLIT_STATUS_CHANGED" | "SPLIT_COMPLETED" | "SPLIT_FAILED" | "SPLITTER_CREATED" | "SPLITTER_UPDATED" | "SPLITTER_DELETED";
|
|
1024
|
+
type SSEEvent = {
|
|
1025
|
+
type: SSEEventType;
|
|
1026
|
+
data: Record<string, unknown>;
|
|
1027
|
+
timestamp: string;
|
|
1028
|
+
sequenceNumber?: number;
|
|
1029
|
+
};
|
|
1030
|
+
type EventHandler = (event: SSEEvent) => void;
|
|
1031
|
+
|
|
1032
|
+
type SSEClientConfig = {
|
|
1033
|
+
sseUrl: string;
|
|
1034
|
+
token: string;
|
|
1035
|
+
sessionId?: string;
|
|
1036
|
+
};
|
|
1037
|
+
declare class SSEClient {
|
|
1038
|
+
private eventSource;
|
|
1039
|
+
private handlers;
|
|
1040
|
+
private config;
|
|
1041
|
+
private reconnectAttempts;
|
|
1042
|
+
private maxReconnectAttempts;
|
|
1043
|
+
private baseReconnectDelay;
|
|
1044
|
+
private connected;
|
|
1045
|
+
constructor(config: SSEClientConfig);
|
|
1046
|
+
connect(): Promise<void>;
|
|
1047
|
+
subscribe(projectId: string): Promise<void>;
|
|
1048
|
+
unsubscribe(projectId: string): Promise<void>;
|
|
1049
|
+
on(eventType: SSEEventType | "*", handler: EventHandler): () => void;
|
|
1050
|
+
disconnect(): void;
|
|
1051
|
+
get isConnected(): boolean;
|
|
1052
|
+
private dispatchEvent;
|
|
1053
|
+
private handleReconnect;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
declare function loadJobContext(contextPath?: string): JobContext;
|
|
1057
|
+
declare function getJobId(contextPath?: string): string;
|
|
1058
|
+
declare function getFileId(contextPath?: string): string;
|
|
1059
|
+
declare function getDeploymentId(contextPath?: string): string;
|
|
1060
|
+
|
|
1061
|
+
type ValidationResult = {
|
|
1062
|
+
valid: boolean;
|
|
1063
|
+
errors: string[];
|
|
1064
|
+
warnings: string[];
|
|
1065
|
+
summary: {
|
|
1066
|
+
tablesFound: number;
|
|
1067
|
+
totalRows: number;
|
|
1068
|
+
tableDetails: Array<{
|
|
1069
|
+
name: string;
|
|
1070
|
+
rowCount: number;
|
|
1071
|
+
isChild: boolean;
|
|
1072
|
+
}>;
|
|
1073
|
+
};
|
|
1074
|
+
};
|
|
1075
|
+
declare function validateSubmission(submission: AgentSubmission, context: JobContext): ValidationResult;
|
|
1076
|
+
|
|
1077
|
+
declare class LimaiError extends Error {
|
|
1078
|
+
readonly code: string;
|
|
1079
|
+
readonly statusCode?: number;
|
|
1080
|
+
readonly exitCode: number;
|
|
1081
|
+
readonly details?: unknown;
|
|
1082
|
+
constructor(message: string, opts: {
|
|
1083
|
+
code: string;
|
|
1084
|
+
statusCode?: number;
|
|
1085
|
+
exitCode?: number;
|
|
1086
|
+
details?: unknown;
|
|
1087
|
+
});
|
|
1088
|
+
}
|
|
1089
|
+
declare class AuthError extends LimaiError {
|
|
1090
|
+
constructor(message: string, details?: unknown);
|
|
1091
|
+
}
|
|
1092
|
+
declare class ForbiddenError extends LimaiError {
|
|
1093
|
+
constructor(message: string, details?: unknown);
|
|
1094
|
+
}
|
|
1095
|
+
declare class NotFoundError extends LimaiError {
|
|
1096
|
+
constructor(message: string, details?: unknown);
|
|
1097
|
+
}
|
|
1098
|
+
declare class ValidationError extends LimaiError {
|
|
1099
|
+
constructor(message: string, details?: unknown);
|
|
1100
|
+
}
|
|
1101
|
+
declare class ConflictError extends LimaiError {
|
|
1102
|
+
constructor(message: string, details?: unknown);
|
|
1103
|
+
}
|
|
1104
|
+
declare class RateLimitError extends LimaiError {
|
|
1105
|
+
readonly retryAfterMs?: number;
|
|
1106
|
+
constructor(message: string, retryAfterMs?: number);
|
|
1107
|
+
}
|
|
1108
|
+
declare class ServerError extends LimaiError {
|
|
1109
|
+
constructor(message: string, statusCode?: number, details?: unknown);
|
|
1110
|
+
}
|
|
1111
|
+
declare class TimeoutError extends LimaiError {
|
|
1112
|
+
constructor(message: string);
|
|
1113
|
+
}
|
|
1114
|
+
declare class UploadError extends LimaiError {
|
|
1115
|
+
constructor(message: string, details?: unknown);
|
|
1116
|
+
}
|
|
1117
|
+
declare function mapHttpError(status: number, message: string, details?: unknown): LimaiError;
|
|
1118
|
+
|
|
1119
|
+
export { type Agent, type AgentDeploymentRoute, type AgentDetail, type AgentFile, type AgentIntegrationConfig, type AgentRowData, type AgentRun, type AgentRunConversation, type AgentRunDetail, type AgentRunStatus, type AgentSkill, type AgentSkillLinkedFile, type AgentStatus, type AgentStep, type AgentStepType, type AgentSubmission, type AgentTriggerType, AuthError, type Bucket, type BucketFile, type BulkProcessResponse, type BulkProcessResult, type BulkUploadFileStatus, type BulkUploadResult, type CellValue, type ClassificationAsyncResponse, type ClassificationResult, type ClassificationStatus, type Column, ConflictError, type CreateRowInput, type CreateRowsRequest, type CreateRowsResponse, type DeleteRowsRequest, type DeleteRowsResponse, type Deployment, type DeploymentConfig, type DeploymentStatus, type DeploymentType, type Document, type ExtractionRow, type ExtractionSchema, type ExtractionsResponse, type FileData, type FileStatus, ForbiddenError, type GetUrlResponse, HttpClient, type JobContext, type JobContextColumn, type JobContextTable, JobPoller, type JobStatus, type JobStatusValue, LimaiClient, type LimaiClientConfig, type LimaiConfig, LimaiError, NotFoundError, type OffsetPaginatedResponse, type OffsetPagination, type PagePaginatedResponse, type PagePagination, type PaginationOptions, type PollOptions, type ProcessFileAsyncResponse, type ProcessOptions, type Project, RateLimitError, type Row, SSEClient, ServerError, type SplitAsyncResponse, type SplitResult, type SplitSegment, type SplitStatus, type StageStatus, type Table, type TableData, TimeoutError, type UpdateStatusRequest, type UpdateStatusResponse, UploadError, type UploadResult, ValidationError, type ValidationResult, collectAll, getDeploymentId, getFileId, getJobId, loadConfig, loadJobContext, mapHttpError, paginateOffset, paginatePage, requireConfig, saveConfig, validateSubmission };
|