@limai.io/cli 0.3.1 → 0.4.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/index.d.ts CHANGED
@@ -12,8 +12,12 @@ declare class HttpClient {
12
12
  private getRetryDelay;
13
13
  private request;
14
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>;
15
+ post<T>(apiPath: string, body?: unknown, timeoutMs?: number, opts?: {
16
+ retry?: boolean;
17
+ }): Promise<T>;
18
+ patch<T>(apiPath: string, body?: unknown, opts?: {
19
+ retry?: boolean;
20
+ }): Promise<T>;
17
21
  del<T>(apiPath: string, body?: unknown): Promise<T>;
18
22
  putRaw(url: string, body: Uint8Array | Buffer | Blob, contentType: string, onProgress?: (uploaded: number, total: number) => void): Promise<void>;
19
23
  putFile(url: string, filePath: string, contentType: string, onProgress?: (uploaded: number, total: number) => void): Promise<number>;
@@ -53,6 +57,47 @@ type JobStatus = {
53
57
  confidenceStageStatus?: StageStatus;
54
58
  bboxStageStatus?: StageStatus;
55
59
  };
60
+ type IncludeOption = "confidence" | "boundingBoxes" | "validations";
61
+ type CellConfidence = {
62
+ overall: number | null;
63
+ llm: number | null;
64
+ layout: number | null;
65
+ consensus: number | null;
66
+ };
67
+ type CellBoundingBox = {
68
+ page: string;
69
+ bbox: [number, number, number, number];
70
+ };
71
+ type CellValidation = {
72
+ checkKey: string | null;
73
+ source: "RULE" | "SCRIPT" | "AGENT";
74
+ passed: boolean;
75
+ message: string | null;
76
+ expected: string | null;
77
+ actual: string | null;
78
+ amended: boolean;
79
+ };
80
+ type FileValidationCheck = {
81
+ key: string;
82
+ name: string;
83
+ source: "STATIC" | "AGENT";
84
+ status: "PENDING" | "RUNNING" | "PASSED" | "FAILED" | "RESEND_PASSED" | "RESEND_FAILED" | "ERROR";
85
+ behavior: "SURFACE" | "RESEND";
86
+ findings: unknown[] | null;
87
+ errorMessage: string | null;
88
+ startedAt: string | null;
89
+ completedAt: string | null;
90
+ };
91
+ type FileValidations = {
92
+ status: "pending" | "passed" | "failed" | "error" | null;
93
+ failCount: number | null;
94
+ checks: FileValidationCheck[];
95
+ rules: {
96
+ crossField: unknown[];
97
+ row: unknown[];
98
+ document: unknown[];
99
+ } | null;
100
+ };
56
101
  type CellValue = {
57
102
  value: string | number | boolean | null;
58
103
  columnId: string;
@@ -60,7 +105,11 @@ type CellValue = {
60
105
  id: string;
61
106
  type: string;
62
107
  description?: string;
108
+ slug?: string | null;
63
109
  };
110
+ confidence?: CellConfidence;
111
+ boundingBoxes?: CellBoundingBox[] | null;
112
+ validations?: CellValidation[];
64
113
  };
65
114
  type Row = {
66
115
  id: string;
@@ -69,16 +118,73 @@ type Row = {
69
118
  cells: Record<string, CellValue>;
70
119
  childTables?: Record<string, TableData>;
71
120
  };
121
+ type ColumnLabel = {
122
+ id: string;
123
+ name: string;
124
+ color: string;
125
+ };
126
+ type ColumnUnit = {
127
+ id: string;
128
+ name: string;
129
+ };
72
130
  type Column = {
73
131
  id: string;
74
132
  name: string;
133
+ slug?: string | null;
75
134
  type: string;
76
- description?: string;
135
+ description?: string | null;
77
136
  sharedColumnId?: string;
137
+ isKey?: boolean;
138
+ isList?: boolean;
139
+ dateFormat?: string | null;
140
+ measurementType?: string;
141
+ excludedFromExtraction?: boolean;
142
+ defaultValue?: unknown;
143
+ defaultValueEnabled?: boolean;
144
+ autoGenerateLabels?: boolean;
145
+ autoGenerateUnits?: boolean;
146
+ pinned?: boolean;
147
+ size?: number;
148
+ sharedId?: string | null;
149
+ index?: number;
150
+ tableId?: string;
151
+ labels?: ColumnLabel[];
152
+ units?: ColumnUnit[];
153
+ createdAt?: string;
154
+ updatedAt?: string;
155
+ };
156
+ type ColumnInput = {
157
+ name: string;
158
+ slug?: string;
159
+ type?: string;
160
+ description?: string | null;
161
+ isKey?: boolean;
162
+ isList?: boolean;
163
+ dateFormat?: string;
164
+ measurementType?: string;
165
+ excludedFromExtraction?: boolean;
166
+ pinned?: boolean;
167
+ size?: number;
168
+ defaultValue?: unknown;
169
+ defaultValueEnabled?: boolean;
170
+ autoGenerateLabels?: boolean;
171
+ autoGenerateUnits?: boolean;
172
+ labels?: Array<{
173
+ name: string;
174
+ color?: string;
175
+ }>;
176
+ units?: Array<{
177
+ name: string;
178
+ }>;
179
+ };
180
+ type ColumnUpdateInput = Partial<Omit<ColumnInput, "name">> & {
181
+ name?: string;
182
+ confirmSlugChange?: boolean;
78
183
  };
79
184
  type TableData = {
80
185
  id: string;
81
186
  name: string;
187
+ slug?: string | null;
82
188
  columns: Column[];
83
189
  rows: Row[];
84
190
  };
@@ -96,6 +202,82 @@ type FileData = {
96
202
  data?: {
97
203
  tables: Record<string, TableData>;
98
204
  };
205
+ validations?: FileValidations;
206
+ error?: string;
207
+ };
208
+ type BulkFileResult = {
209
+ status: "COMPLETED" | "PROCESSING" | "FAILED" | "CLASSIFYING" | "NOT_FOUND";
210
+ fileId: string;
211
+ extractionSchemaId?: string;
212
+ deployment?: {
213
+ id: string;
214
+ name: string;
215
+ };
216
+ jobId?: string;
217
+ errorMessage?: string;
218
+ data?: {
219
+ tables: Record<string, TableData>;
220
+ };
221
+ validations?: FileValidations;
222
+ };
223
+ type BulkGetFilesDataResponse = {
224
+ results: Record<string, BulkFileResult>;
225
+ summary: {
226
+ completed: number;
227
+ processing: number;
228
+ failed: number;
229
+ classifying: number;
230
+ not_found: number;
231
+ total: number;
232
+ };
233
+ };
234
+ type FlatCellValidation = {
235
+ check: string | null;
236
+ source: "RULE" | "SCRIPT" | "AGENT";
237
+ passed: boolean;
238
+ message: string | null;
239
+ };
240
+ type FlatCellData = {
241
+ value: string | number | boolean | null;
242
+ confidence?: number | null;
243
+ boundingBoxes?: CellBoundingBox[] | null;
244
+ validations?: FlatCellValidation[];
245
+ };
246
+ type FlatRow = {
247
+ $id: string;
248
+ $index: string;
249
+ } & Record<string, unknown>;
250
+ type FlatFileValidations = {
251
+ status: "pending" | "passed" | "failed" | "error" | null;
252
+ failCount: number | null;
253
+ checks: {
254
+ key: string;
255
+ source: "STATIC" | "AGENT";
256
+ status: string;
257
+ passed: boolean | null;
258
+ message: string | null;
259
+ }[];
260
+ };
261
+ type FlatDocumentDataResponse = {
262
+ fileId?: string;
263
+ status?: "COMPLETED" | "PROCESSING" | "FAILED";
264
+ jobId?: string;
265
+ errorMessage?: string;
266
+ data?: Record<string, FlatRow[]>;
267
+ validations?: FlatFileValidations;
268
+ error?: string;
269
+ };
270
+ type FlatDocumentEntry = {
271
+ fileId: string;
272
+ status: "COMPLETED" | "PROCESSING" | "FAILED";
273
+ jobId?: string;
274
+ errorMessage?: string;
275
+ data?: Record<string, FlatRow[]>;
276
+ validations?: FlatFileValidations;
277
+ };
278
+ type BulkFlatDocumentDataResponse = {
279
+ documents?: FlatDocumentEntry[];
280
+ missing?: string[];
99
281
  error?: string;
100
282
  };
101
283
  type OffsetPagination = {
@@ -135,6 +317,7 @@ type DeploymentConfig = {
135
317
  temperature?: number;
136
318
  instructions?: string;
137
319
  bigTableExtraction?: string;
320
+ useDynamicMapping?: boolean;
138
321
  bboxTier?: "OFF" | "FAST" | "BALANCED" | "PRO";
139
322
  enableConfidenceScore?: boolean;
140
323
  enableLLMConfidence?: boolean;
@@ -238,6 +421,7 @@ type ProcessOptions = {
238
421
  type Table = {
239
422
  id: string;
240
423
  name: string;
424
+ slug?: string | null;
241
425
  deploymentId: string;
242
426
  parentTableId?: string;
243
427
  columns: Column[];
@@ -250,12 +434,14 @@ type ExtractionSchema = {
250
434
  instructions?: string;
251
435
  temperature?: number;
252
436
  bigTableExtraction?: string;
437
+ useDynamicMapping?: boolean;
253
438
  bboxTier?: "OFF" | "FAST" | "BALANCED" | "PRO";
254
439
  enableConfidenceScore?: boolean;
255
440
  };
256
441
  type JobContextColumn = {
257
442
  id: string;
258
443
  name: string;
444
+ slug?: string | null;
259
445
  type: string;
260
446
  description?: string;
261
447
  isList: boolean;
@@ -263,6 +449,7 @@ type JobContextColumn = {
263
449
  type JobContextTable = {
264
450
  id: string;
265
451
  name: string;
452
+ slug?: string | null;
266
453
  instructions?: string;
267
454
  isPrimary: boolean;
268
455
  columns: JobContextColumn[];
@@ -383,10 +570,12 @@ type AgentSkill = {
383
570
  updatedAt: string;
384
571
  linkedFiles?: AgentSkillLinkedFile[];
385
572
  };
573
+ type AgentRole = "GENERAL" | "VALIDATOR";
386
574
  type Agent = {
387
575
  id: string;
388
576
  name: string;
389
577
  status: AgentStatus;
578
+ role?: AgentRole;
390
579
  tier?: "STANDARD" | "STANDARD_PLUS" | "MAX";
391
580
  processContent: string;
392
581
  triggerTypes: AgentTriggerType[];
@@ -452,6 +641,45 @@ type AgentRunConversation = {
452
641
  unavailable?: boolean;
453
642
  source?: "s3" | "sandbox" | "unavailable";
454
643
  };
644
+ type AgentRunInferenceLog = {
645
+ id: string;
646
+ createdAt: string;
647
+ processingLogId: string | null;
648
+ serviceType: string | null;
649
+ callType: string;
650
+ model: string;
651
+ temperature: number | null;
652
+ stepNumber: number | null;
653
+ attemptNumber: number | null;
654
+ tableName: string | null;
655
+ durationMs: number;
656
+ inputTokens: number | null;
657
+ outputTokens: number | null;
658
+ cachedInputTokens: number | null;
659
+ reasoningTokens: number | null;
660
+ status: string;
661
+ errorMessage: string | null;
662
+ files: Array<{
663
+ filename: string;
664
+ mediaType: string;
665
+ role?: string;
666
+ }>;
667
+ };
668
+ type AgentRunInferenceLogSummary = {
669
+ totalCalls: number;
670
+ successCount: number;
671
+ errorCount: number;
672
+ totalInputTokens: number;
673
+ totalOutputTokens: number;
674
+ totalDurationMs: number;
675
+ };
676
+ type AgentRunInferenceLogs = {
677
+ runId: string;
678
+ data: AgentRunInferenceLog[];
679
+ summary: AgentRunInferenceLogSummary;
680
+ truncated: boolean;
681
+ redactions: Record<string, number>;
682
+ };
455
683
 
456
684
  declare class QueueResource {
457
685
  private http;
@@ -482,8 +710,10 @@ declare class DocumentsResource {
482
710
  processSync(extractionSchemaId: string, fileId: string, opts?: ProcessOptions): Promise<FileData>;
483
711
  processAsync(extractionSchemaId: string, fileId: string, opts?: ProcessOptions): Promise<ProcessFileAsyncResponse>;
484
712
  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[]>;
713
+ getFileData(fileId: string, extractionSchemaId?: string, include?: IncludeOption[]): Promise<FileData>;
714
+ getFilesData(fileIds: string[], include?: IncludeOption[]): Promise<BulkGetFilesDataResponse>;
715
+ getDocumentData(deploymentId: string, fileId: string, include?: IncludeOption[]): Promise<FlatDocumentDataResponse>;
716
+ getDocumentsData(deploymentId: string, fileIds: string[], include?: IncludeOption[]): Promise<BulkFlatDocumentDataResponse>;
487
717
  submitCorrections(extractionSchemaId: string, fileId: string, corrections: unknown): Promise<unknown>;
488
718
  }
489
719
 
@@ -492,6 +722,11 @@ type CreateProjectBody = {
492
722
  teamId?: string;
493
723
  icon?: string;
494
724
  };
725
+ type DeleteProjectResponse = {
726
+ success: boolean;
727
+ id: string;
728
+ name: string;
729
+ };
495
730
  type NotificationChannelType = "SLACK" | "TEAMS_CHANNEL" | "TEAMS_CHAT" | "EMAIL_ADDRESS";
496
731
  type NotificationIntegrationProvider = "SLACK" | "TEAMS" | "SHAREPOINT" | "GOOGLE_DRIVE";
497
732
  type NotificationRoute = {
@@ -553,7 +788,7 @@ declare class ProjectsResource {
553
788
  constructor(http: HttpClient);
554
789
  list(): Promise<Project[]>;
555
790
  create(body: CreateProjectBody): Promise<Project>;
556
- getSchema(projectId: string): Promise<unknown>;
791
+ delete(projectId: string): Promise<DeleteProjectResponse>;
557
792
  getSharedColumnIds(projectId: string): Promise<unknown>;
558
793
  listDeployments(projectId: string): Promise<unknown>;
559
794
  listBenchmarks(projectId: string): Promise<unknown>;
@@ -615,6 +850,17 @@ declare class TablesResource {
615
850
  }): Promise<Table>;
616
851
  }
617
852
 
853
+ declare class ColumnsResource {
854
+ private http;
855
+ constructor(http: HttpClient);
856
+ list(tableId: string): Promise<Column[]>;
857
+ get(columnId: string): Promise<Column>;
858
+ create(tableId: string, body: ColumnInput | {
859
+ columns: ColumnInput[];
860
+ }): Promise<Column[]>;
861
+ update(columnId: string, body: ColumnUpdateInput): Promise<Column>;
862
+ }
863
+
618
864
  type OffsetFetcher<T> = (limit: number, offset: number) => Promise<{
619
865
  data: T[];
620
866
  pagination: {
@@ -660,10 +906,38 @@ declare class ExtractionsResource {
660
906
  }): Promise<ExtractionRow[]>;
661
907
  }
662
908
 
909
+ type ClassifierRouteProject = {
910
+ id: string;
911
+ name: string;
912
+ };
913
+ type ClassifierDeploymentRoute = {
914
+ id: string;
915
+ name: string;
916
+ description: string;
917
+ deploymentId: string;
918
+ deployment?: {
919
+ id: string;
920
+ name: string;
921
+ type: string;
922
+ projectId: string;
923
+ project?: ClassifierRouteProject;
924
+ };
925
+ };
926
+ type ClassifierSummary = {
927
+ id: string;
928
+ name: string;
929
+ projectId: string | null;
930
+ isGlobal?: boolean;
931
+ routeProjects?: ClassifierRouteProject[];
932
+ deploymentRoutes?: ClassifierDeploymentRoute[];
933
+ classificationCount?: number;
934
+ createdAt: string;
935
+ updatedAt: string;
936
+ };
663
937
  declare class ClassifyResource {
664
938
  private http;
665
939
  constructor(http: HttpClient);
666
- list(projectId: string): Promise<unknown>;
940
+ list(projectId: string): Promise<ClassifierSummary[]>;
667
941
  getUploadUrl(classifierId: string, filename: string): Promise<GetUrlResponse>;
668
942
  classify(classifierId: string, fileId: string): Promise<ClassificationResult>;
669
943
  classifyAsync(classifierId: string, fileId: string): Promise<ClassificationAsyncResponse>;
@@ -703,7 +977,7 @@ declare class SchemaResource {
703
977
  private http;
704
978
  constructor(http: HttpClient);
705
979
  get(extractionSchemaId: string): Promise<ExtractionSchema>;
706
- update(extractionSchemaId: string, body: Partial<DeploymentConfig>): Promise<void>;
980
+ update(extractionSchemaId: string, body: Partial<DeploymentConfig>): Promise<DeploymentConfig>;
707
981
  getAllData(extractionSchemaId: string): Promise<unknown>;
708
982
  }
709
983
 
@@ -745,6 +1019,8 @@ declare class AgentsResource {
745
1019
  enabled?: boolean;
746
1020
  config?: Record<string, unknown>;
747
1021
  }>;
1022
+ tier?: string;
1023
+ role?: string;
748
1024
  emailLocalPart?: string;
749
1025
  }): Promise<AgentDetail>;
750
1026
  update(projectId: string, agentId: string, body: {
@@ -761,6 +1037,7 @@ declare class AgentsResource {
761
1037
  }>;
762
1038
  status?: string;
763
1039
  tier?: string;
1040
+ role?: string;
764
1041
  emailLocalPart?: string;
765
1042
  }): Promise<Agent>;
766
1043
  delete(projectId: string, agentId: string): Promise<void>;
@@ -806,6 +1083,10 @@ declare class AgentsResource {
806
1083
  getRunConversation(projectId: string, agentId: string, runId: string, opts?: {
807
1084
  stepId?: string;
808
1085
  }): Promise<AgentRunConversation>;
1086
+ getRunInferenceLogs(projectId: string, agentId: string, runId: string, opts?: {
1087
+ limit?: number;
1088
+ status?: string;
1089
+ }): Promise<AgentRunInferenceLogs>;
809
1090
  createRun(projectId: string, agentId: string, body: {
810
1091
  triggerEventId: string;
811
1092
  triggerType: string;
@@ -845,6 +1126,35 @@ declare class AgentsResource {
845
1126
  met: boolean;
846
1127
  }>;
847
1128
  }>;
1129
+ createSteps(projectId: string, agentId: string, runId: string, steps: Array<{
1130
+ type: string;
1131
+ title: string;
1132
+ description?: string;
1133
+ postReviewAction?: string;
1134
+ data?: Record<string, unknown>;
1135
+ order: number;
1136
+ conditions?: Array<{
1137
+ type: string;
1138
+ entityId: string;
1139
+ label?: string;
1140
+ }>;
1141
+ }>): Promise<{
1142
+ steps: Array<{
1143
+ id: string;
1144
+ type: string;
1145
+ title: string;
1146
+ status: string;
1147
+ order: number;
1148
+ createdAt: string;
1149
+ conditions?: Array<{
1150
+ id: string;
1151
+ type: string;
1152
+ entityId: string;
1153
+ label: string | null;
1154
+ met: boolean;
1155
+ }>;
1156
+ }>;
1157
+ }>;
848
1158
  updateRun(projectId: string, agentId: string, runId: string, body: {
849
1159
  status?: string;
850
1160
  metadata?: Record<string, unknown>;
@@ -942,6 +1252,38 @@ declare class VisionResource {
942
1252
  ask(projectId: string, body: VisionAskBody): Promise<VisionAskResponse>;
943
1253
  }
944
1254
 
1255
+ type ValidationScript = {
1256
+ id: string;
1257
+ extractionSchemaId: string;
1258
+ key: string;
1259
+ name: string;
1260
+ description: string | null;
1261
+ behavior: "SURFACE" | "RESEND";
1262
+ s3Key: string;
1263
+ version: number;
1264
+ contentHash: string;
1265
+ enabled: boolean;
1266
+ timeoutMs: number;
1267
+ createdAt: string;
1268
+ updatedAt: string;
1269
+ source?: string;
1270
+ };
1271
+ type PushValidationScriptBody = {
1272
+ key: string;
1273
+ name: string;
1274
+ description?: string | null;
1275
+ behavior?: "SURFACE" | "RESEND";
1276
+ source: string;
1277
+ enabled?: boolean;
1278
+ timeoutMs?: number;
1279
+ };
1280
+ type UpdateValidationScriptBody = {
1281
+ name?: string;
1282
+ description?: string | null;
1283
+ behavior?: "SURFACE" | "RESEND";
1284
+ enabled?: boolean;
1285
+ timeoutMs?: number;
1286
+ };
945
1287
  declare class ValidationsResource {
946
1288
  private http;
947
1289
  constructor(http: HttpClient);
@@ -950,7 +1292,22 @@ declare class ValidationsResource {
950
1292
  cellChanges?: unknown;
951
1293
  breakdown?: unknown;
952
1294
  newRows?: unknown;
1295
+ strict?: boolean;
953
1296
  }): Promise<unknown>;
1297
+ listScripts(extractionSchemaId: string): Promise<ValidationScript[]>;
1298
+ getScript(extractionSchemaId: string, key: string, opts?: {
1299
+ includeSource?: boolean;
1300
+ }): Promise<ValidationScript>;
1301
+ pushScript(extractionSchemaId: string, body: PushValidationScriptBody): Promise<{
1302
+ action: string;
1303
+ script: ValidationScript;
1304
+ }>;
1305
+ updateScript(extractionSchemaId: string, key: string, body: UpdateValidationScriptBody): Promise<ValidationScript>;
1306
+ deleteScript(extractionSchemaId: string, key: string): Promise<{
1307
+ deleted: boolean;
1308
+ key: string;
1309
+ deletedResults: number;
1310
+ }>;
954
1311
  }
955
1312
 
956
1313
  type LabelListResponse = {
@@ -988,6 +1345,163 @@ declare class LabelsResource {
988
1345
  }): Promise<LabelSearchResponse>;
989
1346
  }
990
1347
 
1348
+ declare const WEBHOOK_EVENT_TYPES: readonly ["DOCUMENT_EXTRACTED", "DOCUMENT_REVIEWED", "DOCUMENT_EXTRACTION_FAILED", "DOCUMENT_VALIDATED", "DOCUMENT_VALIDATION_STARTED", "DOCUMENT_VALIDATION_FAILED", "DOCUMENT_CLASSIFIED", "DOCUMENT_CLASSIFICATION_FAILED", "DOCUMENT_SPLIT", "DOCUMENT_SPLIT_FAILED", "AGENT_RUN_STARTED", "AGENT_RUN_COMPLETED", "AGENT_RUN_FAILED", "AGENT_RUN_WAITING_HUMAN"];
1349
+ type WebhookEventType = (typeof WEBHOOK_EVENT_TYPES)[number];
1350
+ declare const WEBHOOK_DELIVERY_STATUSES: readonly ["success", "failed", "dead_lettered", "retrying", "pending"];
1351
+ type WebhookDeliveryStatus = (typeof WEBHOOK_DELIVERY_STATUSES)[number];
1352
+ declare const WEBHOOK_METRICS_WINDOWS: readonly ["24h", "7d", "30d"];
1353
+ type WebhookMetricsWindow = (typeof WEBHOOK_METRICS_WINDOWS)[number];
1354
+ declare const WEBHOOK_METRICS_BUCKETS: readonly ["hour", "day"];
1355
+ type WebhookMetricsBucket = (typeof WEBHOOK_METRICS_BUCKETS)[number];
1356
+ type WebhookRouteFamily = "deployment" | "agent" | "classifier" | "splitter";
1357
+ type WebhookDeploymentRoute = {
1358
+ id: string;
1359
+ name: string;
1360
+ type: string;
1361
+ };
1362
+ type WebhookNamedRoute = {
1363
+ id: string;
1364
+ name: string;
1365
+ };
1366
+ type Webhook = {
1367
+ id: string;
1368
+ projectId: string;
1369
+ url: string;
1370
+ events: WebhookEventType[];
1371
+ isActive: boolean;
1372
+ isVerified: boolean;
1373
+ createdAt: string;
1374
+ updatedAt: string;
1375
+ deployments: WebhookDeploymentRoute[];
1376
+ agents: WebhookNamedRoute[];
1377
+ classifiers: WebhookNamedRoute[];
1378
+ splitters: WebhookNamedRoute[];
1379
+ };
1380
+ type WebhookWithSecret = Webhook & {
1381
+ secretKey: string;
1382
+ };
1383
+ type WebhookListResponse = {
1384
+ webhooks: Webhook[];
1385
+ };
1386
+ type WebhookRouteIdsInput = {
1387
+ deploymentIds?: string[];
1388
+ agentIds?: string[];
1389
+ classifierIds?: string[];
1390
+ splitterIds?: string[];
1391
+ };
1392
+ type CreateWebhookInput = WebhookRouteIdsInput & {
1393
+ url?: string;
1394
+ events?: WebhookEventType[];
1395
+ };
1396
+ type UpdateWebhookInput = CreateWebhookInput & {
1397
+ isActive?: boolean;
1398
+ };
1399
+ type WebhookDelivery = {
1400
+ eventId: string;
1401
+ subscriptionId: string;
1402
+ eventType: string;
1403
+ timestamp: string;
1404
+ url: string;
1405
+ status: WebhookDeliveryStatus;
1406
+ responseCode?: number;
1407
+ responseBody?: string;
1408
+ errorType?: string;
1409
+ durationMs?: number;
1410
+ retryCount: number;
1411
+ routeFamily?: WebhookRouteFamily;
1412
+ deploymentId?: string;
1413
+ deploymentName?: string;
1414
+ agentId?: string;
1415
+ agentName?: string;
1416
+ classifierId?: string;
1417
+ classifierName?: string;
1418
+ splitterId?: string;
1419
+ splitterName?: string;
1420
+ };
1421
+ type WebhookDeliveriesResponse = {
1422
+ deliveries: WebhookDelivery[];
1423
+ total: number;
1424
+ limit: number;
1425
+ offset: number;
1426
+ };
1427
+ type WebhookDeliveriesQuery = {
1428
+ status?: string;
1429
+ eventType?: string;
1430
+ deploymentId?: string;
1431
+ agentId?: string;
1432
+ classifierId?: string;
1433
+ splitterId?: string;
1434
+ limit?: number;
1435
+ offset?: number;
1436
+ };
1437
+ type WebhookRouteMetrics = {
1438
+ routeFamily: WebhookRouteFamily;
1439
+ routeId: string;
1440
+ routeName: string;
1441
+ totalEvents: number;
1442
+ successfulEvents: number;
1443
+ failedEvents: number;
1444
+ pendingEvents: number;
1445
+ successRate: number;
1446
+ };
1447
+ type WebhookDeliveryPoint = {
1448
+ bucket: string;
1449
+ successful: number;
1450
+ failed: number;
1451
+ pending: number;
1452
+ };
1453
+ type WebhookMetrics = {
1454
+ organizationId: string;
1455
+ totalEvents: number;
1456
+ successfulEvents: number;
1457
+ failedEvents: number;
1458
+ pendingEvents: number;
1459
+ successRate: number;
1460
+ averageResponseTime?: number;
1461
+ perRoute: WebhookRouteMetrics[];
1462
+ series: WebhookDeliveryPoint[];
1463
+ window: WebhookMetricsWindow;
1464
+ bucket: WebhookMetricsBucket;
1465
+ };
1466
+ type WebhookMetricsQuery = {
1467
+ window?: WebhookMetricsWindow;
1468
+ bucket?: WebhookMetricsBucket;
1469
+ };
1470
+ type WebhookVerifyResponse = {
1471
+ success: boolean;
1472
+ message: string;
1473
+ };
1474
+ type WebhookRetryDelivery = {
1475
+ eventId: string;
1476
+ url: string;
1477
+ };
1478
+ type WebhookRetrySkip = WebhookRetryDelivery & {
1479
+ reason: string;
1480
+ };
1481
+ type WebhookRetryResponse = {
1482
+ retriedCount: number;
1483
+ retried: WebhookRetryDelivery[];
1484
+ skipped: WebhookRetrySkip[];
1485
+ message: string;
1486
+ };
1487
+ declare class WebhooksResource {
1488
+ private http;
1489
+ constructor(http: HttpClient);
1490
+ private basePath;
1491
+ list(projectId: string): Promise<WebhookListResponse>;
1492
+ get(projectId: string, webhookId: string): Promise<Webhook>;
1493
+ create(projectId: string, input: CreateWebhookInput): Promise<WebhookWithSecret>;
1494
+ update(projectId: string, webhookId: string, input: UpdateWebhookInput): Promise<Webhook>;
1495
+ delete(projectId: string, webhookId: string): Promise<void>;
1496
+ pause(projectId: string, webhookId: string): Promise<Webhook>;
1497
+ resume(projectId: string, webhookId: string): Promise<Webhook>;
1498
+ verify(projectId: string, webhookId: string): Promise<WebhookVerifyResponse>;
1499
+ rotateSecret(projectId: string, webhookId: string): Promise<WebhookWithSecret>;
1500
+ deliveries(projectId: string, webhookId: string, query?: WebhookDeliveriesQuery): Promise<WebhookDeliveriesResponse>;
1501
+ metrics(projectId: string, webhookId: string, query?: WebhookMetricsQuery): Promise<WebhookMetrics>;
1502
+ retry(projectId: string, webhookId: string, eventIds: string[]): Promise<WebhookRetryResponse>;
1503
+ }
1504
+
991
1505
  type LimaiClientConfig = {
992
1506
  apiUrl: string;
993
1507
  token: string;
@@ -999,6 +1513,7 @@ declare class LimaiClient {
999
1513
  readonly projects: ProjectsResource;
1000
1514
  readonly deployments: DeploymentsResource;
1001
1515
  readonly tables: TablesResource;
1516
+ readonly columns: ColumnsResource;
1002
1517
  readonly extractions: ExtractionsResource;
1003
1518
  readonly queue: QueueResource;
1004
1519
  readonly classify: ClassifyResource;
@@ -1009,6 +1524,7 @@ declare class LimaiClient {
1009
1524
  readonly vision: VisionResource;
1010
1525
  readonly validations: ValidationsResource;
1011
1526
  readonly labels: LabelsResource;
1527
+ readonly webhooks: WebhooksResource;
1012
1528
  constructor(config: LimaiClientConfig);
1013
1529
  uploadFile(extractionSchemaId: string, filePath: string, onProgress?: (uploaded: number, total: number) => void): Promise<UploadResult>;
1014
1530
  uploadFolder(extractionSchemaId: string, dirPath: string, opts?: {
@@ -1134,4 +1650,4 @@ declare class UploadError extends LimaiError {
1134
1650
  }
1135
1651
  declare function mapHttpError(status: number, message: string, details?: unknown): LimaiError;
1136
1652
 
1137
- 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 };
1653
+ export { type Agent, type AgentDeploymentRoute, type AgentDetail, type AgentFile, type AgentIntegrationConfig, type AgentRole, type AgentRowData, type AgentRun, type AgentRunConversation, type AgentRunDetail, type AgentRunInferenceLog, type AgentRunInferenceLogSummary, type AgentRunInferenceLogs, type AgentRunStatus, type AgentSkill, type AgentSkillLinkedFile, type AgentStatus, type AgentStep, type AgentStepType, type AgentSubmission, type AgentTriggerType, AuthError, type Bucket, type BucketFile, type BulkFileResult, type BulkFlatDocumentDataResponse, type BulkGetFilesDataResponse, type BulkProcessResponse, type BulkProcessResult, type BulkUploadFileStatus, type BulkUploadResult, type CellBoundingBox, type CellConfidence, type CellValidation, type CellValue, type ClassificationAsyncResponse, type ClassificationResult, type ClassificationStatus, type Column, type ColumnInput, type ColumnLabel, type ColumnUnit, type ColumnUpdateInput, 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, type FileValidationCheck, type FileValidations, type FlatCellData, type FlatCellValidation, type FlatDocumentDataResponse, type FlatDocumentEntry, type FlatFileValidations, type FlatRow, ForbiddenError, type GetUrlResponse, HttpClient, type IncludeOption, 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 };