@llamaindex/llama-cloud 2.9.0 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/client.d.mts +11 -8
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +11 -8
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/batches.d.mts +4 -4
  12. package/resources/batches.d.mts.map +1 -1
  13. package/resources/batches.d.ts +4 -4
  14. package/resources/batches.d.ts.map +1 -1
  15. package/resources/beta/agent-data.d.mts +94 -94
  16. package/resources/beta/agent-data.d.mts.map +1 -1
  17. package/resources/beta/agent-data.d.ts +94 -94
  18. package/resources/beta/agent-data.d.ts.map +1 -1
  19. package/resources/beta/agent-data.js +41 -41
  20. package/resources/beta/agent-data.js.map +1 -1
  21. package/resources/beta/agent-data.mjs +41 -41
  22. package/resources/beta/agent-data.mjs.map +1 -1
  23. package/resources/beta/batch/batch.d.mts +36 -29
  24. package/resources/beta/batch/batch.d.mts.map +1 -1
  25. package/resources/beta/batch/batch.d.ts +36 -29
  26. package/resources/beta/batch/batch.d.ts.map +1 -1
  27. package/resources/beta/batch/batch.js +16 -16
  28. package/resources/beta/batch/batch.js.map +1 -1
  29. package/resources/beta/batch/batch.mjs +16 -16
  30. package/resources/beta/batch/batch.mjs.map +1 -1
  31. package/resources/beta/batch/index.d.mts +1 -1
  32. package/resources/beta/batch/index.d.mts.map +1 -1
  33. package/resources/beta/batch/index.d.ts +1 -1
  34. package/resources/beta/batch/index.d.ts.map +1 -1
  35. package/resources/beta/batch/job-items.d.mts +14 -7
  36. package/resources/beta/batch/job-items.d.mts.map +1 -1
  37. package/resources/beta/batch/job-items.d.ts +14 -7
  38. package/resources/beta/batch/job-items.d.ts.map +1 -1
  39. package/resources/beta/beta.d.mts +6 -6
  40. package/resources/beta/beta.d.mts.map +1 -1
  41. package/resources/beta/beta.d.ts +6 -6
  42. package/resources/beta/beta.d.ts.map +1 -1
  43. package/resources/beta/chat.d.mts +39 -39
  44. package/resources/beta/chat.d.mts.map +1 -1
  45. package/resources/beta/chat.d.ts +39 -39
  46. package/resources/beta/chat.d.ts.map +1 -1
  47. package/resources/beta/chat.js +14 -14
  48. package/resources/beta/chat.js.map +1 -1
  49. package/resources/beta/chat.mjs +14 -14
  50. package/resources/beta/chat.mjs.map +1 -1
  51. package/resources/beta/directories/directories.d.mts +48 -39
  52. package/resources/beta/directories/directories.d.mts.map +1 -1
  53. package/resources/beta/directories/directories.d.ts +48 -39
  54. package/resources/beta/directories/directories.d.ts.map +1 -1
  55. package/resources/beta/directories/directories.js +30 -30
  56. package/resources/beta/directories/directories.js.map +1 -1
  57. package/resources/beta/directories/directories.mjs +30 -30
  58. package/resources/beta/directories/directories.mjs.map +1 -1
  59. package/resources/beta/directories/files.d.mts +47 -47
  60. package/resources/beta/directories/files.d.mts.map +1 -1
  61. package/resources/beta/directories/files.d.ts +47 -47
  62. package/resources/beta/directories/files.d.ts.map +1 -1
  63. package/resources/beta/directories/files.js +32 -32
  64. package/resources/beta/directories/files.js.map +1 -1
  65. package/resources/beta/directories/files.mjs +32 -32
  66. package/resources/beta/directories/files.mjs.map +1 -1
  67. package/resources/beta/directories/index.d.mts +2 -2
  68. package/resources/beta/directories/index.d.mts.map +1 -1
  69. package/resources/beta/directories/index.d.ts +2 -2
  70. package/resources/beta/directories/index.d.ts.map +1 -1
  71. package/resources/beta/index.d.mts +6 -6
  72. package/resources/beta/index.d.mts.map +1 -1
  73. package/resources/beta/index.d.ts +6 -6
  74. package/resources/beta/index.d.ts.map +1 -1
  75. package/resources/beta/indexes.d.mts +44 -32
  76. package/resources/beta/indexes.d.mts.map +1 -1
  77. package/resources/beta/indexes.d.ts +44 -32
  78. package/resources/beta/indexes.d.ts.map +1 -1
  79. package/resources/beta/indexes.js +28 -28
  80. package/resources/beta/indexes.js.map +1 -1
  81. package/resources/beta/indexes.mjs +28 -28
  82. package/resources/beta/indexes.mjs.map +1 -1
  83. package/resources/beta/retrieval.d.mts +3 -3
  84. package/resources/beta/retrieval.d.mts.map +1 -1
  85. package/resources/beta/retrieval.d.ts +3 -3
  86. package/resources/beta/retrieval.d.ts.map +1 -1
  87. package/resources/beta/sheets.d.mts +37 -56
  88. package/resources/beta/sheets.d.mts.map +1 -1
  89. package/resources/beta/sheets.d.ts +37 -56
  90. package/resources/beta/sheets.d.ts.map +1 -1
  91. package/resources/beta/sheets.js +19 -52
  92. package/resources/beta/sheets.js.map +1 -1
  93. package/resources/beta/sheets.mjs +19 -52
  94. package/resources/beta/sheets.mjs.map +1 -1
  95. package/resources/beta/split.d.mts +2 -2
  96. package/resources/beta/split.d.mts.map +1 -1
  97. package/resources/beta/split.d.ts +2 -2
  98. package/resources/beta/split.d.ts.map +1 -1
  99. package/resources/classifier/jobs.d.mts +8 -1
  100. package/resources/classifier/jobs.d.mts.map +1 -1
  101. package/resources/classifier/jobs.d.ts +8 -1
  102. package/resources/classifier/jobs.d.ts.map +1 -1
  103. package/resources/classify.d.mts +27 -11
  104. package/resources/classify.d.mts.map +1 -1
  105. package/resources/classify.d.ts +27 -11
  106. package/resources/classify.d.ts.map +1 -1
  107. package/resources/configurations.d.mts +73 -43
  108. package/resources/configurations.d.mts.map +1 -1
  109. package/resources/configurations.d.ts +73 -43
  110. package/resources/configurations.d.ts.map +1 -1
  111. package/resources/configurations.js +9 -9
  112. package/resources/configurations.js.map +1 -1
  113. package/resources/configurations.mjs +9 -9
  114. package/resources/configurations.mjs.map +1 -1
  115. package/resources/data-sinks.d.mts +16 -16
  116. package/resources/data-sinks.d.mts.map +1 -1
  117. package/resources/data-sinks.d.ts +16 -16
  118. package/resources/data-sinks.d.ts.map +1 -1
  119. package/resources/data-sinks.js +12 -12
  120. package/resources/data-sinks.js.map +1 -1
  121. package/resources/data-sinks.mjs +12 -12
  122. package/resources/data-sinks.mjs.map +1 -1
  123. package/resources/data-sources.d.mts +17 -17
  124. package/resources/data-sources.d.mts.map +1 -1
  125. package/resources/data-sources.d.ts +17 -17
  126. package/resources/data-sources.d.ts.map +1 -1
  127. package/resources/data-sources.js +13 -13
  128. package/resources/data-sources.js.map +1 -1
  129. package/resources/data-sources.mjs +13 -13
  130. package/resources/data-sources.mjs.map +1 -1
  131. package/resources/extract.d.mts +62 -46
  132. package/resources/extract.d.mts.map +1 -1
  133. package/resources/extract.d.ts +62 -46
  134. package/resources/extract.d.ts.map +1 -1
  135. package/resources/extract.js +33 -33
  136. package/resources/extract.js.map +1 -1
  137. package/resources/extract.mjs +33 -33
  138. package/resources/extract.mjs.map +1 -1
  139. package/resources/files.d.mts +41 -41
  140. package/resources/files.d.mts.map +1 -1
  141. package/resources/files.d.ts +41 -41
  142. package/resources/files.d.ts.map +1 -1
  143. package/resources/files.js +13 -13
  144. package/resources/files.js.map +1 -1
  145. package/resources/files.mjs +13 -13
  146. package/resources/files.mjs.map +1 -1
  147. package/resources/index.d.mts +9 -8
  148. package/resources/index.d.mts.map +1 -1
  149. package/resources/index.d.ts +9 -8
  150. package/resources/index.d.ts.map +1 -1
  151. package/resources/index.js +3 -1
  152. package/resources/index.js.map +1 -1
  153. package/resources/index.mjs +1 -0
  154. package/resources/index.mjs.map +1 -1
  155. package/resources/parsing.d.mts +131 -51
  156. package/resources/parsing.d.mts.map +1 -1
  157. package/resources/parsing.d.ts +131 -51
  158. package/resources/parsing.d.ts.map +1 -1
  159. package/resources/parsing.js +33 -12
  160. package/resources/parsing.js.map +1 -1
  161. package/resources/parsing.mjs +33 -12
  162. package/resources/parsing.mjs.map +1 -1
  163. package/resources/pipelines/data-sources.d.mts +40 -30
  164. package/resources/pipelines/data-sources.d.mts.map +1 -1
  165. package/resources/pipelines/data-sources.d.ts +40 -30
  166. package/resources/pipelines/data-sources.d.ts.map +1 -1
  167. package/resources/pipelines/data-sources.js +23 -13
  168. package/resources/pipelines/data-sources.js.map +1 -1
  169. package/resources/pipelines/data-sources.mjs +23 -13
  170. package/resources/pipelines/data-sources.mjs.map +1 -1
  171. package/resources/pipelines/documents.d.mts +28 -12
  172. package/resources/pipelines/documents.d.mts.map +1 -1
  173. package/resources/pipelines/documents.d.ts +28 -12
  174. package/resources/pipelines/documents.d.ts.map +1 -1
  175. package/resources/pipelines/documents.js +30 -14
  176. package/resources/pipelines/documents.js.map +1 -1
  177. package/resources/pipelines/documents.mjs +30 -14
  178. package/resources/pipelines/documents.mjs.map +1 -1
  179. package/resources/pipelines/files.d.mts +34 -24
  180. package/resources/pipelines/files.d.mts.map +1 -1
  181. package/resources/pipelines/files.d.ts +34 -24
  182. package/resources/pipelines/files.d.ts.map +1 -1
  183. package/resources/pipelines/files.js +27 -17
  184. package/resources/pipelines/files.js.map +1 -1
  185. package/resources/pipelines/files.mjs +27 -17
  186. package/resources/pipelines/files.mjs.map +1 -1
  187. package/resources/pipelines/images.d.mts +17 -17
  188. package/resources/pipelines/images.d.mts.map +1 -1
  189. package/resources/pipelines/images.d.ts +17 -17
  190. package/resources/pipelines/images.d.ts.map +1 -1
  191. package/resources/pipelines/images.js +13 -13
  192. package/resources/pipelines/images.js.map +1 -1
  193. package/resources/pipelines/images.mjs +13 -13
  194. package/resources/pipelines/images.mjs.map +1 -1
  195. package/resources/pipelines/index.d.mts +5 -5
  196. package/resources/pipelines/index.d.mts.map +1 -1
  197. package/resources/pipelines/index.d.ts +5 -5
  198. package/resources/pipelines/index.d.ts.map +1 -1
  199. package/resources/pipelines/metadata.d.mts +4 -0
  200. package/resources/pipelines/metadata.d.mts.map +1 -1
  201. package/resources/pipelines/metadata.d.ts +4 -0
  202. package/resources/pipelines/metadata.d.ts.map +1 -1
  203. package/resources/pipelines/metadata.js +4 -0
  204. package/resources/pipelines/metadata.js.map +1 -1
  205. package/resources/pipelines/metadata.mjs +4 -0
  206. package/resources/pipelines/metadata.mjs.map +1 -1
  207. package/resources/pipelines/pipelines.d.mts +149 -126
  208. package/resources/pipelines/pipelines.d.mts.map +1 -1
  209. package/resources/pipelines/pipelines.d.ts +149 -126
  210. package/resources/pipelines/pipelines.d.ts.map +1 -1
  211. package/resources/pipelines/pipelines.js +39 -23
  212. package/resources/pipelines/pipelines.js.map +1 -1
  213. package/resources/pipelines/pipelines.mjs +39 -23
  214. package/resources/pipelines/pipelines.mjs.map +1 -1
  215. package/resources/pipelines/sync.d.mts +4 -0
  216. package/resources/pipelines/sync.d.mts.map +1 -1
  217. package/resources/pipelines/sync.d.ts +4 -0
  218. package/resources/pipelines/sync.d.ts.map +1 -1
  219. package/resources/pipelines/sync.js +4 -0
  220. package/resources/pipelines/sync.js.map +1 -1
  221. package/resources/pipelines/sync.mjs +4 -0
  222. package/resources/pipelines/sync.mjs.map +1 -1
  223. package/resources/retrievers/index.d.mts +1 -1
  224. package/resources/retrievers/index.d.mts.map +1 -1
  225. package/resources/retrievers/index.d.ts +1 -1
  226. package/resources/retrievers/index.d.ts.map +1 -1
  227. package/resources/retrievers/retrievers.d.mts +39 -39
  228. package/resources/retrievers/retrievers.d.mts.map +1 -1
  229. package/resources/retrievers/retrievers.d.ts +39 -39
  230. package/resources/retrievers/retrievers.d.ts.map +1 -1
  231. package/resources/retrievers/retrievers.js +20 -20
  232. package/resources/retrievers/retrievers.js.map +1 -1
  233. package/resources/retrievers/retrievers.mjs +20 -20
  234. package/resources/retrievers/retrievers.mjs.map +1 -1
  235. package/resources/shared.d.mts +11 -3
  236. package/resources/shared.d.mts.map +1 -1
  237. package/resources/shared.d.ts +11 -3
  238. package/resources/shared.d.ts.map +1 -1
  239. package/resources/sheets.d.mts +206 -0
  240. package/resources/sheets.d.mts.map +1 -0
  241. package/resources/sheets.d.ts +206 -0
  242. package/resources/sheets.d.ts.map +1 -0
  243. package/resources/sheets.js +101 -0
  244. package/resources/sheets.js.map +1 -0
  245. package/resources/sheets.mjs +97 -0
  246. package/resources/sheets.mjs.map +1 -0
  247. package/src/client.ts +33 -12
  248. package/src/resources/batches.ts +4 -4
  249. package/src/resources/beta/agent-data.ts +131 -131
  250. package/src/resources/beta/batch/batch.ts +67 -54
  251. package/src/resources/beta/batch/index.ts +1 -1
  252. package/src/resources/beta/batch/job-items.ts +34 -21
  253. package/src/resources/beta/beta.ts +12 -12
  254. package/src/resources/beta/chat.ts +57 -57
  255. package/src/resources/beta/directories/directories.ts +80 -71
  256. package/src/resources/beta/directories/files.ts +66 -66
  257. package/src/resources/beta/directories/index.ts +5 -5
  258. package/src/resources/beta/index.ts +12 -12
  259. package/src/resources/beta/indexes.ts +68 -53
  260. package/src/resources/beta/retrieval.ts +3 -3
  261. package/src/resources/beta/sheets.ts +90 -97
  262. package/src/resources/beta/split.ts +2 -2
  263. package/src/resources/classifier/jobs.ts +9 -1
  264. package/src/resources/classify.ts +67 -39
  265. package/src/resources/configurations.ts +97 -63
  266. package/src/resources/data-sinks.ts +26 -26
  267. package/src/resources/data-sources.ts +43 -43
  268. package/src/resources/extract.ts +125 -97
  269. package/src/resources/files.ts +61 -61
  270. package/src/resources/index.ts +21 -12
  271. package/src/resources/parsing.ts +285 -204
  272. package/src/resources/pipelines/data-sources.ts +59 -49
  273. package/src/resources/pipelines/documents.ts +42 -26
  274. package/src/resources/pipelines/files.ts +62 -52
  275. package/src/resources/pipelines/images.ts +36 -36
  276. package/src/resources/pipelines/index.ts +10 -10
  277. package/src/resources/pipelines/metadata.ts +4 -0
  278. package/src/resources/pipelines/pipelines.ts +236 -207
  279. package/src/resources/pipelines/sync.ts +4 -0
  280. package/src/resources/retrievers/index.ts +3 -3
  281. package/src/resources/retrievers/retrievers.ts +64 -64
  282. package/src/resources/shared.ts +12 -3
  283. package/src/resources/sheets.ts +322 -0
  284. package/src/version.ts +1 -1
  285. package/version.d.mts +1 -1
  286. package/version.d.mts.map +1 -1
  287. package/version.d.ts +1 -1
  288. package/version.d.ts.map +1 -1
  289. package/version.js +1 -1
  290. package/version.js.map +1 -1
  291. package/version.mjs +1 -1
  292. package/version.mjs.map +1 -1
@@ -8,6 +8,17 @@ import { RequestOptions } from '../internal/request-options';
8
8
  import { path } from '../internal/utils/path';
9
9
 
10
10
  export class DataSources extends APIResource {
11
+ /**
12
+ * List data sources for a given project. If project_id is not provided, uses the
13
+ * default project.
14
+ */
15
+ list(
16
+ query: DataSourceListParams | null | undefined = {},
17
+ options?: RequestOptions,
18
+ ): APIPromise<DataSourceListResponse> {
19
+ return this._client.get('/api/v1/data-sources', { query, ...options });
20
+ }
21
+
11
22
  /**
12
23
  * Create a new data source.
13
24
  */
@@ -20,6 +31,13 @@ export class DataSources extends APIResource {
20
31
  });
21
32
  }
22
33
 
34
+ /**
35
+ * Get a data source by ID.
36
+ */
37
+ get(dataSourceID: string, options?: RequestOptions): APIPromise<DataSource> {
38
+ return this._client.get(path`/api/v1/data-sources/${dataSourceID}`, options);
39
+ }
40
+
23
41
  /**
24
42
  * Update a data source by ID.
25
43
  */
@@ -31,17 +49,6 @@ export class DataSources extends APIResource {
31
49
  return this._client.put(path`/api/v1/data-sources/${dataSourceID}`, { body, ...options });
32
50
  }
33
51
 
34
- /**
35
- * List data sources for a given project. If project_id is not provided, uses the
36
- * default project.
37
- */
38
- list(
39
- query: DataSourceListParams | null | undefined = {},
40
- options?: RequestOptions,
41
- ): APIPromise<DataSourceListResponse> {
42
- return this._client.get('/api/v1/data-sources', { query, ...options });
43
- }
44
-
45
52
  /**
46
53
  * Delete a data source by ID.
47
54
  */
@@ -51,13 +58,6 @@ export class DataSources extends APIResource {
51
58
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
52
59
  });
53
60
  }
54
-
55
- /**
56
- * Get a data source by ID.
57
- */
58
- get(dataSourceID: string, options?: RequestOptions): APIPromise<DataSource> {
59
- return this._client.get(path`/api/v1/data-sources/${dataSourceID}`, options);
60
- }
61
61
  }
62
62
 
63
63
  /**
@@ -94,17 +94,17 @@ export interface DataSource {
94
94
  project_id: string;
95
95
 
96
96
  source_type:
97
- | 'S3'
98
97
  | 'AZURE_STORAGE_BLOB'
98
+ | 'BOX'
99
+ | 'CONFLUENCE'
99
100
  | 'GOOGLE_DRIVE'
101
+ | 'JIRA'
102
+ | 'JIRA_V2'
100
103
  | 'MICROSOFT_ONEDRIVE'
101
104
  | 'MICROSOFT_SHAREPOINT'
102
- | 'SLACK'
103
105
  | 'NOTION_PAGE'
104
- | 'CONFLUENCE'
105
- | 'JIRA'
106
- | 'JIRA_V2'
107
- | 'BOX';
106
+ | 'S3'
107
+ | 'SLACK';
108
108
 
109
109
  /**
110
110
  * Creation datetime
@@ -138,6 +138,12 @@ export interface DataSourceReaderVersionMetadata {
138
138
 
139
139
  export type DataSourceListResponse = Array<DataSource>;
140
140
 
141
+ export interface DataSourceListParams {
142
+ organization_id?: string | null;
143
+
144
+ project_id?: string | null;
145
+ }
146
+
141
147
  export interface DataSourceCreateParams {
142
148
  /**
143
149
  * Body param: Component that implements the data source
@@ -165,17 +171,17 @@ export interface DataSourceCreateParams {
165
171
  * Body param
166
172
  */
167
173
  source_type:
168
- | 'S3'
169
174
  | 'AZURE_STORAGE_BLOB'
175
+ | 'BOX'
176
+ | 'CONFLUENCE'
170
177
  | 'GOOGLE_DRIVE'
178
+ | 'JIRA'
179
+ | 'JIRA_V2'
171
180
  | 'MICROSOFT_ONEDRIVE'
172
181
  | 'MICROSOFT_SHAREPOINT'
173
- | 'SLACK'
174
182
  | 'NOTION_PAGE'
175
- | 'CONFLUENCE'
176
- | 'JIRA'
177
- | 'JIRA_V2'
178
- | 'BOX';
183
+ | 'S3'
184
+ | 'SLACK';
179
185
 
180
186
  /**
181
187
  * Query param
@@ -198,17 +204,17 @@ export interface DataSourceCreateParams {
198
204
 
199
205
  export interface DataSourceUpdateParams {
200
206
  source_type:
201
- | 'S3'
202
207
  | 'AZURE_STORAGE_BLOB'
208
+ | 'BOX'
209
+ | 'CONFLUENCE'
203
210
  | 'GOOGLE_DRIVE'
211
+ | 'JIRA'
212
+ | 'JIRA_V2'
204
213
  | 'MICROSOFT_ONEDRIVE'
205
214
  | 'MICROSOFT_SHAREPOINT'
206
- | 'SLACK'
207
215
  | 'NOTION_PAGE'
208
- | 'CONFLUENCE'
209
- | 'JIRA'
210
- | 'JIRA_V2'
211
- | 'BOX';
216
+ | 'S3'
217
+ | 'SLACK';
212
218
 
213
219
  /**
214
220
  * Component that implements the data source
@@ -241,19 +247,13 @@ export interface DataSourceUpdateParams {
241
247
  name?: string | null;
242
248
  }
243
249
 
244
- export interface DataSourceListParams {
245
- organization_id?: string | null;
246
-
247
- project_id?: string | null;
248
- }
249
-
250
250
  export declare namespace DataSources {
251
251
  export {
252
252
  type DataSource as DataSource,
253
253
  type DataSourceReaderVersionMetadata as DataSourceReaderVersionMetadata,
254
254
  type DataSourceListResponse as DataSourceListResponse,
255
+ type DataSourceListParams as DataSourceListParams,
255
256
  type DataSourceCreateParams as DataSourceCreateParams,
256
257
  type DataSourceUpdateParams as DataSourceUpdateParams,
257
- type DataSourceListParams as DataSourceListParams,
258
258
  };
259
259
  }
@@ -66,66 +66,45 @@ export class Extract extends APIResource {
66
66
  }
67
67
 
68
68
  /**
69
- * Delete an extraction job and its results.
69
+ * Get a single extraction job by ID.
70
+ *
71
+ * Returns the job status and results when complete. Use `expand=configuration` to
72
+ * include the full configuration used, and `expand=extract_metadata` for per-field
73
+ * metadata.
70
74
  *
71
75
  * @example
72
76
  * ```ts
73
- * const extract = await client.extract.delete('job_id');
77
+ * const extractV2Job = await client.extract.get('job_id');
74
78
  * ```
75
79
  */
76
- delete(
80
+ get(
77
81
  jobID: string,
78
- params: ExtractDeleteParams | null | undefined = {},
82
+ query: ExtractGetParams | null | undefined = {},
79
83
  options?: RequestOptions,
80
- ): APIPromise<unknown> {
81
- const { organization_id, project_id } = params ?? {};
82
- return this._client.delete(path`/api/v2/extract/${jobID}`, {
83
- query: { organization_id, project_id },
84
- ...options,
85
- });
84
+ ): APIPromise<ExtractV2Job> {
85
+ return this._client.get(path`/api/v2/extract/${jobID}`, { query, ...options });
86
86
  }
87
87
 
88
88
  /**
89
- * Generate a JSON schema and return a product configuration request.
89
+ * Delete an extraction job and its results.
90
90
  *
91
91
  * @example
92
92
  * ```ts
93
- * const configurationCreate =
94
- * await client.extract.generateSchema();
93
+ * const extract = await client.extract.delete('job_id');
95
94
  * ```
96
95
  */
97
- generateSchema(
98
- params: ExtractGenerateSchemaParams,
96
+ delete(
97
+ jobID: string,
98
+ params: ExtractDeleteParams | null | undefined = {},
99
99
  options?: RequestOptions,
100
- ): APIPromise<ConfigurationsAPI.ConfigurationCreate> {
101
- const { organization_id, project_id, ...body } = params;
102
- return this._client.post('/api/v2/extract/schema/generate', {
100
+ ): APIPromise<unknown> {
101
+ const { organization_id, project_id } = params ?? {};
102
+ return this._client.delete(path`/api/v2/extract/${jobID}`, {
103
103
  query: { organization_id, project_id },
104
- body,
105
104
  ...options,
106
105
  });
107
106
  }
108
107
 
109
- /**
110
- * Get a single extraction job by ID.
111
- *
112
- * Returns the job status and results when complete. Use `expand=configuration` to
113
- * include the full configuration used, and `expand=extract_metadata` for per-field
114
- * metadata.
115
- *
116
- * @example
117
- * ```ts
118
- * const extractV2Job = await client.extract.get('job_id');
119
- * ```
120
- */
121
- get(
122
- jobID: string,
123
- query: ExtractGetParams | null | undefined = {},
124
- options?: RequestOptions,
125
- ): APIPromise<ExtractV2Job> {
126
- return this._client.get(path`/api/v2/extract/${jobID}`, { query, ...options });
127
- }
128
-
129
108
  /**
130
109
  * Validate a JSON schema for extraction.
131
110
  *
@@ -135,15 +114,15 @@ export class Extract extends APIResource {
135
114
  * await client.extract.validateSchema({
136
115
  * data_schema: {
137
116
  * properties: {
138
- * vendor_name: 'bar',
139
117
  * invoice_number: 'bar',
140
- * total_amount: 'bar',
141
118
  * line_items: 'bar',
119
+ * total_amount: 'bar',
120
+ * vendor_name: 'bar',
142
121
  * },
143
122
  * required: [
144
- * 'vendor_name',
145
123
  * 'invoice_number',
146
124
  * 'total_amount',
125
+ * 'vendor_name',
147
126
  * ],
148
127
  * type: 'object',
149
128
  * },
@@ -157,6 +136,27 @@ export class Extract extends APIResource {
157
136
  return this._client.post('/api/v2/extract/schema/validation', { body, ...options });
158
137
  }
159
138
 
139
+ /**
140
+ * Generate a JSON schema and return a product configuration request.
141
+ *
142
+ * @example
143
+ * ```ts
144
+ * const configurationCreate =
145
+ * await client.extract.generateSchema();
146
+ * ```
147
+ */
148
+ generateSchema(
149
+ params: ExtractGenerateSchemaParams,
150
+ options?: RequestOptions,
151
+ ): APIPromise<ConfigurationsAPI.ConfigurationCreate> {
152
+ const { organization_id, project_id, ...body } = params;
153
+ return this._client.post('/api/v2/extract/schema/generate', {
154
+ query: { organization_id, project_id },
155
+ body,
156
+ ...options,
157
+ });
158
+ }
159
+
160
160
  /**
161
161
  * Wait for an extraction job to complete by polling until it reaches a terminal state.
162
162
  *
@@ -326,11 +326,13 @@ export interface ExtractConfiguration {
326
326
  /**
327
327
  * Extract tier: cost_effective (5 credits/page) or agentic (15 credits/page)
328
328
  */
329
- tier?: 'cost_effective' | 'agentic';
329
+ tier?: 'agentic' | 'cost_effective';
330
330
 
331
331
  /**
332
332
  * Use 'latest' for the latest release for the selected tier or a date string
333
- * (YYYY-MM-DD format) to pin to the nearest release at or before that date.
333
+ * (YYYY-MM-DD format) to pin to the nearest release at or before that date. Job
334
+ * responses always report the concrete resolved version the job runs, fixed at job
335
+ * creation; saved configurations keep the value as provided.
334
336
  */
335
337
  version?: string;
336
338
  }
@@ -490,28 +492,33 @@ export namespace ExtractV2JobCreate {
490
492
  * events are delivered.
491
493
  */
492
494
  webhook_events?: Array<
493
- | 'extract.pending'
494
- | 'extract.success'
495
+ | 'classify.cancelled'
496
+ | 'classify.error'
497
+ | 'classify.partial_success'
498
+ | 'classify.pending'
499
+ | 'classify.running'
500
+ | 'classify.success'
501
+ | 'extract.cancelled'
495
502
  | 'extract.error'
496
503
  | 'extract.partial_success'
497
- | 'extract.cancelled'
504
+ | 'extract.pending'
505
+ | 'extract.success'
506
+ | 'parse.cancelled'
507
+ | 'parse.error'
508
+ | 'parse.partial_success'
498
509
  | 'parse.pending'
499
510
  | 'parse.running'
500
511
  | 'parse.success'
501
- | 'parse.error'
502
- | 'parse.partial_success'
503
- | 'parse.cancelled'
504
- | 'classify.pending'
505
- | 'classify.running'
506
- | 'classify.success'
507
- | 'classify.error'
508
- | 'classify.partial_success'
509
- | 'classify.cancelled'
510
- | 'sheets.pending'
511
- | 'sheets.success'
512
+ | 'sheets.cancelled'
512
513
  | 'sheets.error'
513
514
  | 'sheets.partial_success'
514
- | 'sheets.cancelled'
515
+ | 'sheets.pending'
516
+ | 'sheets.success'
517
+ | 'split.cancelled'
518
+ | 'split.error'
519
+ | 'split.pending'
520
+ | 'split.processing'
521
+ | 'split.success'
515
522
  | 'unmapped_event'
516
523
  > | null;
517
524
 
@@ -525,6 +532,14 @@ export namespace ExtractV2JobCreate {
525
532
  */
526
533
  webhook_output_format?: string | null;
527
534
 
535
+ /**
536
+ * Shared signing secret used to sign webhook deliveries. When set, each request
537
+ * includes an HMAC-SHA256 signature of the request body in the 'LC-Signature'
538
+ * header (value 'sha256=<hex>'). Recompute the HMAC over the raw request body with
539
+ * this secret to verify the delivery is authentic.
540
+ */
541
+ webhook_signing_secret?: string | null;
542
+
528
543
  /**
529
544
  * URL to receive webhook POST notifications
530
545
  */
@@ -680,28 +695,33 @@ export namespace ExtractCreateParams {
680
695
  * events are delivered.
681
696
  */
682
697
  webhook_events?: Array<
683
- | 'extract.pending'
684
- | 'extract.success'
698
+ | 'classify.cancelled'
699
+ | 'classify.error'
700
+ | 'classify.partial_success'
701
+ | 'classify.pending'
702
+ | 'classify.running'
703
+ | 'classify.success'
704
+ | 'extract.cancelled'
685
705
  | 'extract.error'
686
706
  | 'extract.partial_success'
687
- | 'extract.cancelled'
707
+ | 'extract.pending'
708
+ | 'extract.success'
709
+ | 'parse.cancelled'
710
+ | 'parse.error'
711
+ | 'parse.partial_success'
688
712
  | 'parse.pending'
689
713
  | 'parse.running'
690
714
  | 'parse.success'
691
- | 'parse.error'
692
- | 'parse.partial_success'
693
- | 'parse.cancelled'
694
- | 'classify.pending'
695
- | 'classify.running'
696
- | 'classify.success'
697
- | 'classify.error'
698
- | 'classify.partial_success'
699
- | 'classify.cancelled'
700
- | 'sheets.pending'
701
- | 'sheets.success'
715
+ | 'sheets.cancelled'
702
716
  | 'sheets.error'
703
717
  | 'sheets.partial_success'
704
- | 'sheets.cancelled'
718
+ | 'sheets.pending'
719
+ | 'sheets.success'
720
+ | 'split.cancelled'
721
+ | 'split.error'
722
+ | 'split.pending'
723
+ | 'split.processing'
724
+ | 'split.success'
705
725
  | 'unmapped_event'
706
726
  > | null;
707
727
 
@@ -715,6 +735,14 @@ export namespace ExtractCreateParams {
715
735
  */
716
736
  webhook_output_format?: string | null;
717
737
 
738
+ /**
739
+ * Shared signing secret used to sign webhook deliveries. When set, each request
740
+ * includes an HMAC-SHA256 signature of the request body in the 'LC-Signature'
741
+ * header (value 'sha256=<hex>'). Recompute the HMAC over the raw request body with
742
+ * this secret to verify the delivery is authentic.
743
+ */
744
+ webhook_signing_secret?: string | null;
745
+
718
746
  /**
719
747
  * URL to receive webhook POST notifications
720
748
  */
@@ -770,7 +798,18 @@ export interface ExtractListParams extends PaginatedCursorParams {
770
798
  /**
771
799
  * Filter by status
772
800
  */
773
- status?: 'PENDING' | 'THROTTLED' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | null;
801
+ status?: 'CANCELLED' | 'COMPLETED' | 'FAILED' | 'PENDING' | 'RUNNING' | 'THROTTLED' | null;
802
+ }
803
+
804
+ export interface ExtractGetParams {
805
+ /**
806
+ * Additional fields to include: configuration, extract_metadata
807
+ */
808
+ expand?: Array<string>;
809
+
810
+ organization_id?: string | null;
811
+
812
+ project_id?: string | null;
774
813
  }
775
814
 
776
815
  export interface ExtractDeleteParams {
@@ -779,6 +818,15 @@ export interface ExtractDeleteParams {
779
818
  project_id?: string | null;
780
819
  }
781
820
 
821
+ export interface ExtractValidateSchemaParams {
822
+ /**
823
+ * JSON Schema to validate for use with extract jobs
824
+ */
825
+ data_schema: {
826
+ [key: string]: { [key: string]: unknown } | Array<unknown> | string | number | boolean | null;
827
+ };
828
+ }
829
+
782
830
  export interface ExtractGenerateSchemaParams {
783
831
  /**
784
832
  * Query param
@@ -813,26 +861,6 @@ export interface ExtractGenerateSchemaParams {
813
861
  prompt?: string | null;
814
862
  }
815
863
 
816
- export interface ExtractGetParams {
817
- /**
818
- * Additional fields to include: configuration, extract_metadata
819
- */
820
- expand?: Array<string>;
821
-
822
- organization_id?: string | null;
823
-
824
- project_id?: string | null;
825
- }
826
-
827
- export interface ExtractValidateSchemaParams {
828
- /**
829
- * JSON Schema to validate for use with extract jobs
830
- */
831
- data_schema: {
832
- [key: string]: { [key: string]: unknown } | Array<unknown> | string | number | boolean | null;
833
- };
834
- }
835
-
836
864
  export declare namespace Extract {
837
865
  export {
838
866
  type ExtractConfiguration as ExtractConfiguration,
@@ -849,9 +877,9 @@ export declare namespace Extract {
849
877
  type ExtractV2JobsPaginatedCursor as ExtractV2JobsPaginatedCursor,
850
878
  type ExtractCreateParams as ExtractCreateParams,
851
879
  type ExtractListParams as ExtractListParams,
852
- type ExtractDeleteParams as ExtractDeleteParams,
853
- type ExtractGenerateSchemaParams as ExtractGenerateSchemaParams,
854
880
  type ExtractGetParams as ExtractGetParams,
881
+ type ExtractDeleteParams as ExtractDeleteParams,
855
882
  type ExtractValidateSchemaParams as ExtractValidateSchemaParams,
883
+ type ExtractGenerateSchemaParams as ExtractGenerateSchemaParams,
856
884
  };
857
885
  }
@@ -28,6 +28,20 @@ export class Files extends APIResource {
28
28
  );
29
29
  }
30
30
 
31
+ /**
32
+ * Query files with filtering and pagination. Deprecated: use `GET /files`.
33
+ *
34
+ * @deprecated Use the GET /files endpoint instead
35
+ */
36
+ query(params: FileQueryParams, options?: RequestOptions): APIPromise<FileQueryResponse> {
37
+ const { organization_id, project_id, ...body } = params;
38
+ return this._client.post('/api/v1/beta/files/query', {
39
+ query: { organization_id, project_id },
40
+ body,
41
+ ...options,
42
+ });
43
+ }
44
+
31
45
  /**
32
46
  * List files with optional filtering and pagination.
33
47
  *
@@ -70,20 +84,6 @@ export class Files extends APIResource {
70
84
  ): APIPromise<PresignedURL> {
71
85
  return this._client.get(path`/api/v1/beta/files/${fileID}/content`, { query, ...options });
72
86
  }
73
-
74
- /**
75
- * Query files with filtering and pagination. Deprecated: use `GET /files`.
76
- *
77
- * @deprecated Use the GET /files endpoint instead
78
- */
79
- query(params: FileQueryParams, options?: RequestOptions): APIPromise<FileQueryResponse> {
80
- const { organization_id, project_id, ...body } = params;
81
- return this._client.post('/api/v1/beta/files/query', {
82
- query: { organization_id, project_id },
83
- body,
84
- ...options,
85
- });
86
- }
87
87
  }
88
88
 
89
89
  export type FileListResponsesPaginatedCursor = PaginatedCursor<FileListResponse>;
@@ -395,52 +395,6 @@ export interface FileCreateParams {
395
395
  external_file_id?: string | null;
396
396
  }
397
397
 
398
- export interface FileListParams extends PaginatedCursorParams {
399
- /**
400
- * Fields to expand on each file.
401
- */
402
- expand?: Array<string> | null;
403
-
404
- /**
405
- * Filter by external file ID.
406
- */
407
- external_file_id?: string | null;
408
-
409
- /**
410
- * Filter by specific file IDs.
411
- */
412
- file_ids?: Array<string> | null;
413
-
414
- /**
415
- * Filter by file name (exact match).
416
- */
417
- file_name?: string | null;
418
-
419
- /**
420
- * A comma-separated list of fields to order by, sorted in ascending order. Use
421
- * 'field_name desc' to specify descending order.
422
- */
423
- order_by?: string | null;
424
-
425
- organization_id?: string | null;
426
-
427
- project_id?: string | null;
428
- }
429
-
430
- export interface FileDeleteParams {
431
- organization_id?: string | null;
432
-
433
- project_id?: string | null;
434
- }
435
-
436
- export interface FileGetParams {
437
- expires_at_seconds?: number | null;
438
-
439
- organization_id?: string | null;
440
-
441
- project_id?: string | null;
442
- }
443
-
444
398
  export interface FileQueryParams {
445
399
  /**
446
400
  * Query param
@@ -514,6 +468,52 @@ export namespace FileQueryParams {
514
468
  }
515
469
  }
516
470
 
471
+ export interface FileListParams extends PaginatedCursorParams {
472
+ /**
473
+ * Fields to expand on each file.
474
+ */
475
+ expand?: Array<string> | null;
476
+
477
+ /**
478
+ * Filter by external file ID.
479
+ */
480
+ external_file_id?: string | null;
481
+
482
+ /**
483
+ * Filter by specific file IDs.
484
+ */
485
+ file_ids?: Array<string> | null;
486
+
487
+ /**
488
+ * Filter by file name (exact match).
489
+ */
490
+ file_name?: string | null;
491
+
492
+ /**
493
+ * A comma-separated list of fields to order by, sorted in ascending order. Use
494
+ * 'field_name desc' to specify descending order.
495
+ */
496
+ order_by?: string | null;
497
+
498
+ organization_id?: string | null;
499
+
500
+ project_id?: string | null;
501
+ }
502
+
503
+ export interface FileDeleteParams {
504
+ organization_id?: string | null;
505
+
506
+ project_id?: string | null;
507
+ }
508
+
509
+ export interface FileGetParams {
510
+ expires_at_seconds?: number | null;
511
+
512
+ organization_id?: string | null;
513
+
514
+ project_id?: string | null;
515
+ }
516
+
517
517
  export declare namespace Files {
518
518
  export {
519
519
  type File as File,
@@ -523,9 +523,9 @@ export declare namespace Files {
523
523
  type FileQueryResponse as FileQueryResponse,
524
524
  type FileListResponsesPaginatedCursor as FileListResponsesPaginatedCursor,
525
525
  type FileCreateParams as FileCreateParams,
526
+ type FileQueryParams as FileQueryParams,
526
527
  type FileListParams as FileListParams,
527
528
  type FileDeleteParams as FileDeleteParams,
528
529
  type FileGetParams as FileGetParams,
529
- type FileQueryParams as FileQueryParams,
530
530
  };
531
531
  }