@gemina/sdk 0.14.0 → 0.16.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.js CHANGED
@@ -1268,6 +1268,110 @@ var ContactApi = class extends BaseAPI {
1268
1268
  }
1269
1269
  };
1270
1270
 
1271
+ // src/generated/models/ModelType.ts
1272
+ var ModelType = {
1273
+ Gemina: "gemina",
1274
+ Google: "google",
1275
+ Openai: "openai",
1276
+ Velox: "velox",
1277
+ Praetorian: "praetorian",
1278
+ Invictus: "invictus"
1279
+ };
1280
+ function instanceOfModelType(value) {
1281
+ for (const key in ModelType) {
1282
+ if (Object.prototype.hasOwnProperty.call(ModelType, key)) {
1283
+ if (ModelType[key] === value) {
1284
+ return true;
1285
+ }
1286
+ }
1287
+ }
1288
+ return false;
1289
+ }
1290
+ function ModelTypeFromJSON(json) {
1291
+ return ModelTypeFromJSONTyped(json, false);
1292
+ }
1293
+ function ModelTypeFromJSONTyped(json, ignoreDiscriminator) {
1294
+ return json;
1295
+ }
1296
+ function ModelTypeToJSON(value) {
1297
+ return value;
1298
+ }
1299
+ function ModelTypeToJSONTyped(value, ignoreDiscriminator) {
1300
+ return value;
1301
+ }
1302
+
1303
+ // src/generated/models/UploadExtractionTypeEnum.ts
1304
+ var UploadExtractionTypeEnum = {
1305
+ Ocr: "ocr",
1306
+ DocumentDetailsHebrew: "document_details_hebrew",
1307
+ DocumentLineItemsHebrew: "document_line_items_hebrew",
1308
+ InvoiceHeaders: "invoice_headers",
1309
+ InvoiceLineItems: "invoice_line_items",
1310
+ CustomTemplate: "custom_template"
1311
+ };
1312
+ function instanceOfUploadExtractionTypeEnum(value) {
1313
+ for (const key in UploadExtractionTypeEnum) {
1314
+ if (Object.prototype.hasOwnProperty.call(UploadExtractionTypeEnum, key)) {
1315
+ if (UploadExtractionTypeEnum[key] === value) {
1316
+ return true;
1317
+ }
1318
+ }
1319
+ }
1320
+ return false;
1321
+ }
1322
+ function UploadExtractionTypeEnumFromJSON(json) {
1323
+ return UploadExtractionTypeEnumFromJSONTyped(json, false);
1324
+ }
1325
+ function UploadExtractionTypeEnumFromJSONTyped(json, ignoreDiscriminator) {
1326
+ return json;
1327
+ }
1328
+ function UploadExtractionTypeEnumToJSON(value) {
1329
+ return value;
1330
+ }
1331
+ function UploadExtractionTypeEnumToJSONTyped(value, ignoreDiscriminator) {
1332
+ return value;
1333
+ }
1334
+
1335
+ // src/generated/models/AddExtractionsInDTO.ts
1336
+ function instanceOfAddExtractionsInDTO(value) {
1337
+ if (!("extractionTypes" in value) || value["extractionTypes"] === void 0) return false;
1338
+ return true;
1339
+ }
1340
+ function AddExtractionsInDTOFromJSON(json) {
1341
+ return AddExtractionsInDTOFromJSONTyped(json, false);
1342
+ }
1343
+ function AddExtractionsInDTOFromJSONTyped(json, ignoreDiscriminator) {
1344
+ if (json == null) {
1345
+ return json;
1346
+ }
1347
+ return {
1348
+ "correction": json["correction"] == null ? void 0 : json["correction"],
1349
+ "evaluation": json["evaluation"] == null ? void 0 : json["evaluation"],
1350
+ "extractionTypes": json["extractionTypes"].map(UploadExtractionTypeEnumFromJSON),
1351
+ "includeCoordinates": json["includeCoordinates"] == null ? void 0 : json["includeCoordinates"],
1352
+ "modelType": json["modelType"] == null ? void 0 : ModelTypeFromJSON(json["modelType"]),
1353
+ "templateId": json["templateId"] == null ? void 0 : json["templateId"],
1354
+ "thinking": json["thinking"] == null ? void 0 : json["thinking"]
1355
+ };
1356
+ }
1357
+ function AddExtractionsInDTOToJSON(json) {
1358
+ return AddExtractionsInDTOToJSONTyped(json, false);
1359
+ }
1360
+ function AddExtractionsInDTOToJSONTyped(value, ignoreDiscriminator = false) {
1361
+ if (value == null) {
1362
+ return value;
1363
+ }
1364
+ return {
1365
+ "correction": value["correction"],
1366
+ "evaluation": value["evaluation"],
1367
+ "extractionTypes": value["extractionTypes"].map(UploadExtractionTypeEnumToJSON),
1368
+ "includeCoordinates": value["includeCoordinates"],
1369
+ "modelType": ModelTypeToJSON(value["modelType"]),
1370
+ "templateId": value["templateId"],
1371
+ "thinking": value["thinking"]
1372
+ };
1373
+ }
1374
+
1271
1375
  // src/generated/models/ResponseStatus.ts
1272
1376
  var ResponseStatus = {
1273
1377
  Pending: "pending",
@@ -1359,16 +1463,16 @@ function DataCenterRegionModelToJSONTyped(value, ignoreDiscriminator) {
1359
1463
  return value;
1360
1464
  }
1361
1465
 
1362
- // src/generated/models/DocumentViewMetaOutDTO.ts
1363
- function instanceOfDocumentViewMetaOutDTO(value) {
1466
+ // src/generated/models/DocumentAddExtractionsMetaOutDTO.ts
1467
+ function instanceOfDocumentAddExtractionsMetaOutDTO(value) {
1364
1468
  if (!("contentPurgedAt" in value) || value["contentPurgedAt"] === void 0) return false;
1365
1469
  if (!("createdAt" in value) || value["createdAt"] === void 0) return false;
1366
1470
  return true;
1367
1471
  }
1368
- function DocumentViewMetaOutDTOFromJSON(json) {
1369
- return DocumentViewMetaOutDTOFromJSONTyped(json, false);
1472
+ function DocumentAddExtractionsMetaOutDTOFromJSON(json) {
1473
+ return DocumentAddExtractionsMetaOutDTOFromJSONTyped(json, false);
1370
1474
  }
1371
- function DocumentViewMetaOutDTOFromJSONTyped(json, ignoreDiscriminator) {
1475
+ function DocumentAddExtractionsMetaOutDTOFromJSONTyped(json, ignoreDiscriminator) {
1372
1476
  if (json == null) {
1373
1477
  return json;
1374
1478
  }
@@ -1376,6 +1480,7 @@ function DocumentViewMetaOutDTOFromJSONTyped(json, ignoreDiscriminator) {
1376
1480
  "apiKeyId": json["apiKeyId"] == null ? void 0 : json["apiKeyId"],
1377
1481
  "contentPurgedAt": json["contentPurgedAt"] == null ? null : new Date(json["contentPurgedAt"]),
1378
1482
  "contentType": json["contentType"] == null ? void 0 : json["contentType"],
1483
+ "correlationId": json["correlationId"] == null ? void 0 : json["correlationId"],
1379
1484
  "createdAt": new Date(json["createdAt"]),
1380
1485
  "documentFileType": json["documentFileType"] == null ? void 0 : DocumentFileTypeModelFromJSON(json["documentFileType"]),
1381
1486
  "documentId": json["documentId"] == null ? void 0 : json["documentId"],
@@ -1384,6 +1489,7 @@ function DocumentViewMetaOutDTOFromJSONTyped(json, ignoreDiscriminator) {
1384
1489
  "fileSize": json["fileSize"] == null ? void 0 : json["fileSize"],
1385
1490
  "filename": json["filename"] == null ? void 0 : json["filename"],
1386
1491
  "imageUrl": json["imageUrl"] == null ? void 0 : json["imageUrl"],
1492
+ "next": json["next"] == null ? void 0 : json["next"],
1387
1493
  "normalizedHeight": json["normalizedHeight"] == null ? void 0 : json["normalizedHeight"],
1388
1494
  "normalizedMegapixels": json["normalizedMegapixels"] == null ? void 0 : json["normalizedMegapixels"],
1389
1495
  "normalizedWidth": json["normalizedWidth"] == null ? void 0 : json["normalizedWidth"],
@@ -1395,10 +1501,10 @@ function DocumentViewMetaOutDTOFromJSONTyped(json, ignoreDiscriminator) {
1395
1501
  "userId": json["userId"] == null ? void 0 : json["userId"]
1396
1502
  };
1397
1503
  }
1398
- function DocumentViewMetaOutDTOToJSON(json) {
1399
- return DocumentViewMetaOutDTOToJSONTyped(json, false);
1504
+ function DocumentAddExtractionsMetaOutDTOToJSON(json) {
1505
+ return DocumentAddExtractionsMetaOutDTOToJSONTyped(json, false);
1400
1506
  }
1401
- function DocumentViewMetaOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
1507
+ function DocumentAddExtractionsMetaOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
1402
1508
  if (value == null) {
1403
1509
  return value;
1404
1510
  }
@@ -1406,6 +1512,7 @@ function DocumentViewMetaOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
1406
1512
  "apiKeyId": value["apiKeyId"],
1407
1513
  "contentPurgedAt": value["contentPurgedAt"] == null ? value["contentPurgedAt"] : value["contentPurgedAt"].toISOString(),
1408
1514
  "contentType": value["contentType"],
1515
+ "correlationId": value["correlationId"],
1409
1516
  "createdAt": value["createdAt"].toISOString(),
1410
1517
  "documentFileType": DocumentFileTypeModelToJSON(value["documentFileType"]),
1411
1518
  "documentId": value["documentId"],
@@ -1414,6 +1521,7 @@ function DocumentViewMetaOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
1414
1521
  "fileSize": value["fileSize"],
1415
1522
  "filename": value["filename"],
1416
1523
  "imageUrl": value["imageUrl"],
1524
+ "next": value["next"],
1417
1525
  "normalizedHeight": value["normalizedHeight"],
1418
1526
  "normalizedMegapixels": value["normalizedMegapixels"],
1419
1527
  "normalizedWidth": value["normalizedWidth"],
@@ -1530,38 +1638,6 @@ function ExtractionTypeModelToJSONTyped(value, ignoreDiscriminator) {
1530
1638
  return value;
1531
1639
  }
1532
1640
 
1533
- // src/generated/models/ModelType.ts
1534
- var ModelType = {
1535
- Gemina: "gemina",
1536
- Google: "google",
1537
- Openai: "openai",
1538
- Velox: "velox",
1539
- Praetorian: "praetorian",
1540
- Invictus: "invictus"
1541
- };
1542
- function instanceOfModelType(value) {
1543
- for (const key in ModelType) {
1544
- if (Object.prototype.hasOwnProperty.call(ModelType, key)) {
1545
- if (ModelType[key] === value) {
1546
- return true;
1547
- }
1548
- }
1549
- }
1550
- return false;
1551
- }
1552
- function ModelTypeFromJSON(json) {
1553
- return ModelTypeFromJSONTyped(json, false);
1554
- }
1555
- function ModelTypeFromJSONTyped(json, ignoreDiscriminator) {
1556
- return json;
1557
- }
1558
- function ModelTypeToJSON(value) {
1559
- return value;
1560
- }
1561
- function ModelTypeToJSONTyped(value, ignoreDiscriminator) {
1562
- return value;
1563
- }
1564
-
1565
1641
  // src/generated/models/ValidationFieldModel.ts
1566
1642
  var ValidationFieldModelTypeEnum = {
1567
1643
  String: "string",
@@ -1850,6 +1926,118 @@ function DocumentDataOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
1850
1926
  };
1851
1927
  }
1852
1928
 
1929
+ // src/generated/models/DocumentAddExtractionsOutDTO.ts
1930
+ function instanceOfDocumentAddExtractionsOutDTO(value) {
1931
+ if (!("data" in value) || value["data"] === void 0) return false;
1932
+ if (!("meta" in value) || value["meta"] === void 0) return false;
1933
+ if (!("pollCorrelationId" in value) || value["pollCorrelationId"] === void 0) return false;
1934
+ if (!("status" in value) || value["status"] === void 0) return false;
1935
+ return true;
1936
+ }
1937
+ function DocumentAddExtractionsOutDTOFromJSON(json) {
1938
+ return DocumentAddExtractionsOutDTOFromJSONTyped(json, false);
1939
+ }
1940
+ function DocumentAddExtractionsOutDTOFromJSONTyped(json, ignoreDiscriminator) {
1941
+ if (json == null) {
1942
+ return json;
1943
+ }
1944
+ return {
1945
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
1946
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
1947
+ "data": DocumentDataOutDTOFromJSON(json["data"]),
1948
+ "errors": json["errors"] == null ? void 0 : json["errors"],
1949
+ "meta": DocumentAddExtractionsMetaOutDTOFromJSON(json["meta"]),
1950
+ "newExtractionIds": json["newExtractionIds"] == null ? void 0 : json["newExtractionIds"],
1951
+ "pollCorrelationId": json["pollCorrelationId"],
1952
+ "status": ResponseStatusFromJSON(json["status"])
1953
+ };
1954
+ }
1955
+ function DocumentAddExtractionsOutDTOToJSON(json) {
1956
+ return DocumentAddExtractionsOutDTOToJSONTyped(json, false);
1957
+ }
1958
+ function DocumentAddExtractionsOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
1959
+ if (value == null) {
1960
+ return value;
1961
+ }
1962
+ return {
1963
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
1964
+ "createdAtTimestamp": value["createdAtTimestamp"],
1965
+ "data": DocumentDataOutDTOToJSON(value["data"]),
1966
+ "errors": value["errors"],
1967
+ "meta": DocumentAddExtractionsMetaOutDTOToJSON(value["meta"]),
1968
+ "newExtractionIds": value["newExtractionIds"],
1969
+ "pollCorrelationId": value["pollCorrelationId"],
1970
+ "status": ResponseStatusToJSON(value["status"])
1971
+ };
1972
+ }
1973
+
1974
+ // src/generated/models/DocumentViewMetaOutDTO.ts
1975
+ function instanceOfDocumentViewMetaOutDTO(value) {
1976
+ if (!("contentPurgedAt" in value) || value["contentPurgedAt"] === void 0) return false;
1977
+ if (!("createdAt" in value) || value["createdAt"] === void 0) return false;
1978
+ return true;
1979
+ }
1980
+ function DocumentViewMetaOutDTOFromJSON(json) {
1981
+ return DocumentViewMetaOutDTOFromJSONTyped(json, false);
1982
+ }
1983
+ function DocumentViewMetaOutDTOFromJSONTyped(json, ignoreDiscriminator) {
1984
+ if (json == null) {
1985
+ return json;
1986
+ }
1987
+ return {
1988
+ "apiKeyId": json["apiKeyId"] == null ? void 0 : json["apiKeyId"],
1989
+ "contentPurgedAt": json["contentPurgedAt"] == null ? null : new Date(json["contentPurgedAt"]),
1990
+ "contentType": json["contentType"] == null ? void 0 : json["contentType"],
1991
+ "createdAt": new Date(json["createdAt"]),
1992
+ "documentFileType": json["documentFileType"] == null ? void 0 : DocumentFileTypeModelFromJSON(json["documentFileType"]),
1993
+ "documentId": json["documentId"] == null ? void 0 : json["documentId"],
1994
+ "endUserId": json["endUserId"] == null ? void 0 : json["endUserId"],
1995
+ "externalId": json["externalId"] == null ? void 0 : json["externalId"],
1996
+ "fileSize": json["fileSize"] == null ? void 0 : json["fileSize"],
1997
+ "filename": json["filename"] == null ? void 0 : json["filename"],
1998
+ "imageUrl": json["imageUrl"] == null ? void 0 : json["imageUrl"],
1999
+ "normalizedHeight": json["normalizedHeight"] == null ? void 0 : json["normalizedHeight"],
2000
+ "normalizedMegapixels": json["normalizedMegapixels"] == null ? void 0 : json["normalizedMegapixels"],
2001
+ "normalizedWidth": json["normalizedWidth"] == null ? void 0 : json["normalizedWidth"],
2002
+ "numberOfPages": json["numberOfPages"] == null ? void 0 : json["numberOfPages"],
2003
+ "originalDocumentUrl": json["originalDocumentUrl"] == null ? void 0 : json["originalDocumentUrl"],
2004
+ "processingStatus": json["processingStatus"] == null ? void 0 : ResponseStatusFromJSON(json["processingStatus"]),
2005
+ "storageLocation": json["storageLocation"] == null ? void 0 : DataCenterRegionModelFromJSON(json["storageLocation"]),
2006
+ "thumbnailUrl": json["thumbnailUrl"] == null ? void 0 : json["thumbnailUrl"],
2007
+ "userId": json["userId"] == null ? void 0 : json["userId"]
2008
+ };
2009
+ }
2010
+ function DocumentViewMetaOutDTOToJSON(json) {
2011
+ return DocumentViewMetaOutDTOToJSONTyped(json, false);
2012
+ }
2013
+ function DocumentViewMetaOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
2014
+ if (value == null) {
2015
+ return value;
2016
+ }
2017
+ return {
2018
+ "apiKeyId": value["apiKeyId"],
2019
+ "contentPurgedAt": value["contentPurgedAt"] == null ? value["contentPurgedAt"] : value["contentPurgedAt"].toISOString(),
2020
+ "contentType": value["contentType"],
2021
+ "createdAt": value["createdAt"].toISOString(),
2022
+ "documentFileType": DocumentFileTypeModelToJSON(value["documentFileType"]),
2023
+ "documentId": value["documentId"],
2024
+ "endUserId": value["endUserId"],
2025
+ "externalId": value["externalId"],
2026
+ "fileSize": value["fileSize"],
2027
+ "filename": value["filename"],
2028
+ "imageUrl": value["imageUrl"],
2029
+ "normalizedHeight": value["normalizedHeight"],
2030
+ "normalizedMegapixels": value["normalizedMegapixels"],
2031
+ "normalizedWidth": value["normalizedWidth"],
2032
+ "numberOfPages": value["numberOfPages"],
2033
+ "originalDocumentUrl": value["originalDocumentUrl"],
2034
+ "processingStatus": ResponseStatusToJSON(value["processingStatus"]),
2035
+ "storageLocation": DataCenterRegionModelToJSON(value["storageLocation"]),
2036
+ "thumbnailUrl": value["thumbnailUrl"],
2037
+ "userId": value["userId"]
2038
+ };
2039
+ }
2040
+
1853
2041
  // src/generated/models/DocumentPrimaryViewOutDTO.ts
1854
2042
  function instanceOfDocumentPrimaryViewOutDTO(value) {
1855
2043
  if (!("data" in value) || value["data"] === void 0) return false;
@@ -3196,38 +3384,6 @@ function NumberOfStoredDocumentsOutDTOToJSONTyped(value, ignoreDiscriminator = f
3196
3384
  };
3197
3385
  }
3198
3386
 
3199
- // src/generated/models/UploadExtractionTypeEnum.ts
3200
- var UploadExtractionTypeEnum = {
3201
- Ocr: "ocr",
3202
- DocumentDetailsHebrew: "document_details_hebrew",
3203
- DocumentLineItemsHebrew: "document_line_items_hebrew",
3204
- InvoiceHeaders: "invoice_headers",
3205
- InvoiceLineItems: "invoice_line_items",
3206
- CustomTemplate: "custom_template"
3207
- };
3208
- function instanceOfUploadExtractionTypeEnum(value) {
3209
- for (const key in UploadExtractionTypeEnum) {
3210
- if (Object.prototype.hasOwnProperty.call(UploadExtractionTypeEnum, key)) {
3211
- if (UploadExtractionTypeEnum[key] === value) {
3212
- return true;
3213
- }
3214
- }
3215
- }
3216
- return false;
3217
- }
3218
- function UploadExtractionTypeEnumFromJSON(json) {
3219
- return UploadExtractionTypeEnumFromJSONTyped(json, false);
3220
- }
3221
- function UploadExtractionTypeEnumFromJSONTyped(json, ignoreDiscriminator) {
3222
- return json;
3223
- }
3224
- function UploadExtractionTypeEnumToJSON(value) {
3225
- return value;
3226
- }
3227
- function UploadExtractionTypeEnumToJSONTyped(value, ignoreDiscriminator) {
3228
- return value;
3229
- }
3230
-
3231
3387
  // src/generated/models/WebDocumentUploadInDTO.ts
3232
3388
  function instanceOfWebDocumentUploadInDTO(value) {
3233
3389
  if (!("externalId" in value) || value["externalId"] === void 0) return false;
@@ -3282,6 +3438,102 @@ function WebDocumentUploadInDTOToJSONTyped(value, ignoreDiscriminator = false) {
3282
3438
 
3283
3439
  // src/generated/apis/DocumentApi.ts
3284
3440
  var DocumentApi = class extends BaseAPI {
3441
+ /**
3442
+ * Creates request options for addDocumentExtractions without sending the request
3443
+ */
3444
+ async addDocumentExtractionsRequestOpts(requestParameters) {
3445
+ if (requestParameters["documentId"] == null) {
3446
+ throw new RequiredError(
3447
+ "documentId",
3448
+ 'Required parameter "documentId" was null or undefined when calling addDocumentExtractions().'
3449
+ );
3450
+ }
3451
+ if (requestParameters["addExtractionsInDTO"] == null) {
3452
+ throw new RequiredError(
3453
+ "addExtractionsInDTO",
3454
+ 'Required parameter "addExtractionsInDTO" was null or undefined when calling addDocumentExtractions().'
3455
+ );
3456
+ }
3457
+ const queryParameters = {};
3458
+ const headerParameters = {};
3459
+ headerParameters["Content-Type"] = "application/json";
3460
+ if (this.configuration && this.configuration.apiKey) {
3461
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
3462
+ }
3463
+ let urlPath = `/api/v1/documents/{document_id}/extractions`;
3464
+ urlPath = urlPath.replace("{document_id}", encodeURIComponent(String(requestParameters["documentId"])));
3465
+ return {
3466
+ path: urlPath,
3467
+ method: "POST",
3468
+ headers: headerParameters,
3469
+ query: queryParameters,
3470
+ body: AddExtractionsInDTOToJSON(requestParameters["addExtractionsInDTO"])
3471
+ };
3472
+ }
3473
+ /**
3474
+ * Run additional extraction types on a document that is already stored. No upload: the document\'s stored artifacts are reused and only the extraction step runs. Billed per extraction like an upload. Returns the whole document (all extractions, old and new). When the new extractions are still running the response is HTTP 202 and ``pollCorrelationId`` / ``Location`` point at the existing results endpoint.
3475
+ * Add extraction types to an existing document
3476
+ */
3477
+ async addDocumentExtractionsRaw(requestParameters, initOverrides) {
3478
+ const requestOptions = await this.addDocumentExtractionsRequestOpts(requestParameters);
3479
+ const response = await this.request(requestOptions, initOverrides);
3480
+ return new JSONApiResponse(response, (jsonValue) => DocumentAddExtractionsOutDTOFromJSON(jsonValue));
3481
+ }
3482
+ /**
3483
+ * Run additional extraction types on a document that is already stored. No upload: the document\'s stored artifacts are reused and only the extraction step runs. Billed per extraction like an upload. Returns the whole document (all extractions, old and new). When the new extractions are still running the response is HTTP 202 and ``pollCorrelationId`` / ``Location`` point at the existing results endpoint.
3484
+ * Add extraction types to an existing document
3485
+ */
3486
+ async addDocumentExtractions(requestParameters, initOverrides) {
3487
+ const response = await this.addDocumentExtractionsRaw(requestParameters, initOverrides);
3488
+ return await response.value();
3489
+ }
3490
+ /**
3491
+ * Creates request options for addDocumentExtractionsByUser without sending the request
3492
+ */
3493
+ async addDocumentExtractionsByUserRequestOpts(requestParameters) {
3494
+ if (requestParameters["documentId"] == null) {
3495
+ throw new RequiredError(
3496
+ "documentId",
3497
+ 'Required parameter "documentId" was null or undefined when calling addDocumentExtractionsByUser().'
3498
+ );
3499
+ }
3500
+ if (requestParameters["addExtractionsInDTO"] == null) {
3501
+ throw new RequiredError(
3502
+ "addExtractionsInDTO",
3503
+ 'Required parameter "addExtractionsInDTO" was null or undefined when calling addDocumentExtractionsByUser().'
3504
+ );
3505
+ }
3506
+ const queryParameters = {};
3507
+ const headerParameters = {};
3508
+ headerParameters["Content-Type"] = "application/json";
3509
+ if (this.configuration && this.configuration.accessToken) {
3510
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
3511
+ }
3512
+ let urlPath = `/api/v1/documents/{document_id}/extractions/user`;
3513
+ urlPath = urlPath.replace("{document_id}", encodeURIComponent(String(requestParameters["documentId"])));
3514
+ return {
3515
+ path: urlPath,
3516
+ method: "POST",
3517
+ headers: headerParameters,
3518
+ query: queryParameters,
3519
+ body: AddExtractionsInDTOToJSON(requestParameters["addExtractionsInDTO"])
3520
+ };
3521
+ }
3522
+ /**
3523
+ * Add extraction types to an existing document (user credentials)
3524
+ */
3525
+ async addDocumentExtractionsByUserRaw(requestParameters, initOverrides) {
3526
+ const requestOptions = await this.addDocumentExtractionsByUserRequestOpts(requestParameters);
3527
+ const response = await this.request(requestOptions, initOverrides);
3528
+ return new JSONApiResponse(response, (jsonValue) => DocumentAddExtractionsOutDTOFromJSON(jsonValue));
3529
+ }
3530
+ /**
3531
+ * Add extraction types to an existing document (user credentials)
3532
+ */
3533
+ async addDocumentExtractionsByUser(requestParameters, initOverrides) {
3534
+ const response = await this.addDocumentExtractionsByUserRaw(requestParameters, initOverrides);
3535
+ return await response.value();
3536
+ }
3285
3537
  /**
3286
3538
  * Creates request options for createDocumentProcessingRequest without sending the request
3287
3539
  */
@@ -4477,6 +4729,63 @@ var DocumentApi = class extends BaseAPI {
4477
4729
  const response = await this.purgeDocumentsWithExternalIdByUserRaw(requestParameters, initOverrides);
4478
4730
  return await response.value();
4479
4731
  }
4732
+ /**
4733
+ * Creates request options for resumeTutorialRequest without sending the request
4734
+ */
4735
+ async resumeTutorialRequestRequestOpts(requestParameters) {
4736
+ if (requestParameters["attemptId"] == null) {
4737
+ throw new RequiredError(
4738
+ "attemptId",
4739
+ 'Required parameter "attemptId" was null or undefined when calling resumeTutorialRequest().'
4740
+ );
4741
+ }
4742
+ const queryParameters = {};
4743
+ const headerParameters = {};
4744
+ if (this.configuration && this.configuration.apiKey) {
4745
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
4746
+ }
4747
+ const consumes = [
4748
+ { contentType: "multipart/form-data" }
4749
+ ];
4750
+ const canConsumeForm2 = canConsumeForm(consumes);
4751
+ let formParams;
4752
+ let useForm = false;
4753
+ useForm = canConsumeForm2;
4754
+ if (useForm) {
4755
+ formParams = new FormData();
4756
+ } else {
4757
+ formParams = new URLSearchParams();
4758
+ }
4759
+ if (requestParameters["file"] != null) {
4760
+ formParams.append("file", requestParameters["file"]);
4761
+ }
4762
+ let urlPath = `/api/v1/documents/tutorials/{attempt_id}/resume`;
4763
+ urlPath = urlPath.replace("{attempt_id}", encodeURIComponent(String(requestParameters["attemptId"])));
4764
+ return {
4765
+ path: urlPath,
4766
+ method: "POST",
4767
+ headers: headerParameters,
4768
+ query: queryParameters,
4769
+ body: formParams
4770
+ };
4771
+ }
4772
+ /**
4773
+ * Explicitly recover an interrupted guided API request, using its original key and file.
4774
+ * Resume Tutorial Request
4775
+ */
4776
+ async resumeTutorialRequestRaw(requestParameters, initOverrides) {
4777
+ const requestOptions = await this.resumeTutorialRequestRequestOpts(requestParameters);
4778
+ const response = await this.request(requestOptions, initOverrides);
4779
+ return new JSONApiResponse(response, (jsonValue) => DocumentProcessingResultOutDTOFromJSON(jsonValue));
4780
+ }
4781
+ /**
4782
+ * Explicitly recover an interrupted guided API request, using its original key and file.
4783
+ * Resume Tutorial Request
4784
+ */
4785
+ async resumeTutorialRequest(requestParameters, initOverrides) {
4786
+ const response = await this.resumeTutorialRequestRaw(requestParameters, initOverrides);
4787
+ return await response.value();
4788
+ }
4480
4789
  /**
4481
4790
  * Creates request options for uploadDocument without sending the request
4482
4791
  */
@@ -5884,6 +6193,87 @@ var FileTagApi = class extends BaseAPI {
5884
6193
  const response = await this.getMyFiletagCreditHistoryRaw(requestParameters, initOverrides);
5885
6194
  return await response.value();
5886
6195
  }
6196
+ /**
6197
+ * Creates request options for savedFiletagResult without sending the request
6198
+ */
6199
+ async savedFiletagResultRequestOpts(requestParameters) {
6200
+ if (requestParameters["documentId"] == null) {
6201
+ throw new RequiredError(
6202
+ "documentId",
6203
+ 'Required parameter "documentId" was null or undefined when calling savedFiletagResult().'
6204
+ );
6205
+ }
6206
+ const queryParameters = {};
6207
+ const headerParameters = {};
6208
+ if (this.configuration && this.configuration.apiKey) {
6209
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
6210
+ }
6211
+ let urlPath = `/api/v1/filetag/results/{document_id}`;
6212
+ urlPath = urlPath.replace("{document_id}", encodeURIComponent(String(requestParameters["documentId"])));
6213
+ return {
6214
+ path: urlPath,
6215
+ method: "GET",
6216
+ headers: headerParameters,
6217
+ query: queryParameters
6218
+ };
6219
+ }
6220
+ /**
6221
+ * Saved Filetag Result
6222
+ */
6223
+ async savedFiletagResultRaw(requestParameters, initOverrides) {
6224
+ const requestOptions = await this.savedFiletagResultRequestOpts(requestParameters);
6225
+ const response = await this.request(requestOptions, initOverrides);
6226
+ return new JSONApiResponse(response, (jsonValue) => FileTagResultOutDTOFromJSON(jsonValue));
6227
+ }
6228
+ /**
6229
+ * Saved Filetag Result
6230
+ */
6231
+ async savedFiletagResult(requestParameters, initOverrides) {
6232
+ const response = await this.savedFiletagResultRaw(requestParameters, initOverrides);
6233
+ return await response.value();
6234
+ }
6235
+ /**
6236
+ * Creates request options for savedFiletagResultUser without sending the request
6237
+ */
6238
+ async savedFiletagResultUserRequestOpts(requestParameters) {
6239
+ if (requestParameters["documentId"] == null) {
6240
+ throw new RequiredError(
6241
+ "documentId",
6242
+ 'Required parameter "documentId" was null or undefined when calling savedFiletagResultUser().'
6243
+ );
6244
+ }
6245
+ const queryParameters = {};
6246
+ const headerParameters = {};
6247
+ if (this.configuration && this.configuration.apiKey) {
6248
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
6249
+ }
6250
+ if (this.configuration && this.configuration.accessToken) {
6251
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
6252
+ }
6253
+ let urlPath = `/api/v1/filetag/results/user/{document_id}`;
6254
+ urlPath = urlPath.replace("{document_id}", encodeURIComponent(String(requestParameters["documentId"])));
6255
+ return {
6256
+ path: urlPath,
6257
+ method: "GET",
6258
+ headers: headerParameters,
6259
+ query: queryParameters
6260
+ };
6261
+ }
6262
+ /**
6263
+ * Saved Filetag Result User
6264
+ */
6265
+ async savedFiletagResultUserRaw(requestParameters, initOverrides) {
6266
+ const requestOptions = await this.savedFiletagResultUserRequestOpts(requestParameters);
6267
+ const response = await this.request(requestOptions, initOverrides);
6268
+ return new JSONApiResponse(response, (jsonValue) => FileTagResultOutDTOFromJSON(jsonValue));
6269
+ }
6270
+ /**
6271
+ * Saved Filetag Result User
6272
+ */
6273
+ async savedFiletagResultUser(requestParameters, initOverrides) {
6274
+ const response = await this.savedFiletagResultUserRaw(requestParameters, initOverrides);
6275
+ return await response.value();
6276
+ }
5887
6277
  /**
5888
6278
  * Creates request options for tagDocument without sending the request
5889
6279
  */
@@ -5895,6 +6285,9 @@ var FileTagApi = class extends BaseAPI {
5895
6285
  );
5896
6286
  }
5897
6287
  const queryParameters = {};
6288
+ if (requestParameters["externalId"] != null) {
6289
+ queryParameters["external_id"] = requestParameters["externalId"];
6290
+ }
5898
6291
  const headerParameters = {};
5899
6292
  if (this.configuration && this.configuration.apiKey) {
5900
6293
  headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
@@ -5951,6 +6344,9 @@ var FileTagApi = class extends BaseAPI {
5951
6344
  );
5952
6345
  }
5953
6346
  const queryParameters = {};
6347
+ if (requestParameters["externalId"] != null) {
6348
+ queryParameters["external_id"] = requestParameters["externalId"];
6349
+ }
5954
6350
  const headerParameters = {};
5955
6351
  if (this.configuration && this.configuration.apiKey) {
5956
6352
  headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
@@ -6131,6 +6527,7 @@ function FilesUploadInstructionsOutDTOFromJSONTyped(json, ignoreDiscriminator) {
6131
6527
  }
6132
6528
  return {
6133
6529
  "fileId": json["fileId"],
6530
+ "handoffExpiresAt": json["handoffExpiresAt"] == null ? void 0 : new Date(json["handoffExpiresAt"]),
6134
6531
  "nextToolCall": FilesNextToolCallOutDTOFromJSON(json["nextToolCall"]),
6135
6532
  "upload": FilesUploadDetailsOutDTOFromJSON(json["upload"])
6136
6533
  };
@@ -6144,6 +6541,7 @@ function FilesUploadInstructionsOutDTOToJSONTyped(value, ignoreDiscriminator = f
6144
6541
  }
6145
6542
  return {
6146
6543
  "fileId": value["fileId"],
6544
+ "handoffExpiresAt": value["handoffExpiresAt"] == null ? value["handoffExpiresAt"] : value["handoffExpiresAt"].toISOString(),
6147
6545
  "nextToolCall": FilesNextToolCallOutDTOToJSON(value["nextToolCall"]),
6148
6546
  "upload": FilesUploadDetailsOutDTOToJSON(value["upload"])
6149
6547
  };
@@ -6545,10 +6943,14 @@ function RetrievalFiltersDTOFromJSONTyped(json, ignoreDiscriminator) {
6545
6943
  }
6546
6944
  return {
6547
6945
  "buyerName": json["buyerName"] == null ? void 0 : json["buyerName"],
6946
+ "currencies": json["currencies"] == null ? void 0 : json["currencies"],
6548
6947
  "currency": json["currency"] == null ? void 0 : json["currency"],
6549
6948
  "docNumber": json["docNumber"] == null ? void 0 : json["docNumber"],
6949
+ "docNumbers": json["docNumbers"] == null ? void 0 : json["docNumbers"],
6550
6950
  "documentId": json["documentId"] == null ? void 0 : json["documentId"],
6951
+ "documentIds": json["documentIds"] == null ? void 0 : json["documentIds"],
6551
6952
  "documentType": json["documentType"] == null ? void 0 : json["documentType"],
6953
+ "documentTypes": json["documentTypes"] == null ? void 0 : json["documentTypes"],
6552
6954
  "dueDateFrom": json["dueDateFrom"] == null ? void 0 : new Date(json["dueDateFrom"]),
6553
6955
  "dueDateTo": json["dueDateTo"] == null ? void 0 : new Date(json["dueDateTo"]),
6554
6956
  "endUserId": json["endUserId"] == null ? void 0 : json["endUserId"],
@@ -6560,6 +6962,7 @@ function RetrievalFiltersDTOFromJSONTyped(json, ignoreDiscriminator) {
6560
6962
  "totalAmountMax": json["totalAmountMax"] == null ? void 0 : json["totalAmountMax"],
6561
6963
  "totalAmountMin": json["totalAmountMin"] == null ? void 0 : json["totalAmountMin"],
6562
6964
  "vendorName": json["vendorName"] == null ? void 0 : json["vendorName"],
6965
+ "vendorNames": json["vendorNames"] == null ? void 0 : json["vendorNames"],
6563
6966
  "vendorTaxId": json["vendorTaxId"] == null ? void 0 : json["vendorTaxId"]
6564
6967
  };
6565
6968
  }
@@ -6572,10 +6975,14 @@ function RetrievalFiltersDTOToJSONTyped(value, ignoreDiscriminator = false) {
6572
6975
  }
6573
6976
  return {
6574
6977
  "buyerName": value["buyerName"],
6978
+ "currencies": value["currencies"],
6575
6979
  "currency": value["currency"],
6576
6980
  "docNumber": value["docNumber"],
6981
+ "docNumbers": value["docNumbers"],
6577
6982
  "documentId": value["documentId"],
6983
+ "documentIds": value["documentIds"],
6578
6984
  "documentType": value["documentType"],
6985
+ "documentTypes": value["documentTypes"],
6579
6986
  "dueDateFrom": value["dueDateFrom"] == null ? value["dueDateFrom"] : value["dueDateFrom"].toISOString().substring(0, 10),
6580
6987
  "dueDateTo": value["dueDateTo"] == null ? value["dueDateTo"] : value["dueDateTo"].toISOString().substring(0, 10),
6581
6988
  "endUserId": value["endUserId"],
@@ -6587,6 +6994,7 @@ function RetrievalFiltersDTOToJSONTyped(value, ignoreDiscriminator = false) {
6587
6994
  "totalAmountMax": value["totalAmountMax"],
6588
6995
  "totalAmountMin": value["totalAmountMin"],
6589
6996
  "vendorName": value["vendorName"],
6997
+ "vendorNames": value["vendorNames"],
6590
6998
  "vendorTaxId": value["vendorTaxId"]
6591
6999
  };
6592
7000
  }
@@ -6655,7 +7063,8 @@ var AggregateMetricDTOFieldEnum = {
6655
7063
  TotalAmount: "total_amount",
6656
7064
  NetAmount: "net_amount",
6657
7065
  VatAmount: "vat_amount",
6658
- MeasurableQuantity: "measurable_quantity"
7066
+ MeasurableQuantity: "measurable_quantity",
7067
+ LineTotal: "line_total"
6659
7068
  };
6660
7069
  var AggregateMetricDTOOpEnum = {
6661
7070
  Sum: "sum",
@@ -6706,7 +7115,10 @@ var RetrievalAggregateInDTOGroupByEnum = {
6706
7115
  Month: "month",
6707
7116
  Year: "year",
6708
7117
  MeasurableUom: "measurable_uom",
6709
- Description: "description"
7118
+ Description: "description",
7119
+ DocNumber: "doc_number",
7120
+ IssueDate: "issue_date",
7121
+ DocumentId: "document_id"
6710
7122
  };
6711
7123
  function instanceOfRetrievalAggregateInDTO(value) {
6712
7124
  if (!("metrics" in value) || value["metrics"] === void 0) return false;
@@ -6990,6 +7402,11 @@ function RetrievalQueryInDTOToJSONTyped(value, ignoreDiscriminator = false) {
6990
7402
  }
6991
7403
 
6992
7404
  // src/generated/models/QueryMetaDTO.ts
7405
+ var QueryMetaDTOIndexingStateEnum = {
7406
+ Preparing: "preparing",
7407
+ Ready: "ready",
7408
+ Unavailable: "unavailable"
7409
+ };
6993
7410
  function instanceOfQueryMetaDTO(value) {
6994
7411
  if (!("count" in value) || value["count"] === void 0) return false;
6995
7412
  if (!("mode" in value) || value["mode"] === void 0) return false;
@@ -7004,6 +7421,8 @@ function QueryMetaDTOFromJSONTyped(json, ignoreDiscriminator) {
7004
7421
  }
7005
7422
  return {
7006
7423
  "count": json["count"],
7424
+ "indexingReady": json["indexingReady"] == null ? void 0 : json["indexingReady"],
7425
+ "indexingState": json["indexingState"] == null ? void 0 : json["indexingState"],
7007
7426
  "limit": json["limit"] == null ? void 0 : json["limit"],
7008
7427
  "mode": json["mode"],
7009
7428
  "skip": json["skip"] == null ? void 0 : json["skip"]
@@ -7018,6 +7437,8 @@ function QueryMetaDTOToJSONTyped(value, ignoreDiscriminator = false) {
7018
7437
  }
7019
7438
  return {
7020
7439
  "count": value["count"],
7440
+ "indexingReady": value["indexingReady"],
7441
+ "indexingState": value["indexingState"],
7021
7442
  "limit": value["limit"],
7022
7443
  "mode": value["mode"],
7023
7444
  "skip": value["skip"]
@@ -7571,6 +7992,48 @@ function CheckoutOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
7571
7992
  };
7572
7993
  }
7573
7994
 
7995
+ // src/generated/models/PaymentMethodUpdateOutDTO.ts
7996
+ var PaymentMethodUpdateOutDTOPurposeEnum = {
7997
+ UpdatePaymentMethod: "update_payment_method",
7998
+ PayOverdue: "pay_overdue",
7999
+ ResumeSubscription: "resume_subscription"
8000
+ };
8001
+ function instanceOfPaymentMethodUpdateOutDTO(value) {
8002
+ if (!("paddleTransactionId" in value) || value["paddleTransactionId"] === void 0) return false;
8003
+ if (!("purpose" in value) || value["purpose"] === void 0) return false;
8004
+ return true;
8005
+ }
8006
+ function PaymentMethodUpdateOutDTOFromJSON(json) {
8007
+ return PaymentMethodUpdateOutDTOFromJSONTyped(json, false);
8008
+ }
8009
+ function PaymentMethodUpdateOutDTOFromJSONTyped(json, ignoreDiscriminator) {
8010
+ if (json == null) {
8011
+ return json;
8012
+ }
8013
+ return {
8014
+ "checkoutUrl": json["checkoutUrl"] == null ? void 0 : json["checkoutUrl"],
8015
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
8016
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
8017
+ "paddleTransactionId": json["paddleTransactionId"],
8018
+ "purpose": json["purpose"]
8019
+ };
8020
+ }
8021
+ function PaymentMethodUpdateOutDTOToJSON(json) {
8022
+ return PaymentMethodUpdateOutDTOToJSONTyped(json, false);
8023
+ }
8024
+ function PaymentMethodUpdateOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
8025
+ if (value == null) {
8026
+ return value;
8027
+ }
8028
+ return {
8029
+ "checkoutUrl": value["checkoutUrl"],
8030
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
8031
+ "createdAtTimestamp": value["createdAtTimestamp"],
8032
+ "paddleTransactionId": value["paddleTransactionId"],
8033
+ "purpose": value["purpose"]
8034
+ };
8035
+ }
8036
+
7574
8037
  // src/generated/models/DataRetentionPeriodModel.ts
7575
8038
  var DataRetentionPeriodModel = {
7576
8039
  OneDay: "one_day",
@@ -8825,6 +9288,40 @@ var SubscriptionsApi = class extends BaseAPI {
8825
9288
  const response = await this.purchaseTopUpRaw(requestParameters, initOverrides);
8826
9289
  return await response.value();
8827
9290
  }
9291
+ /**
9292
+ * Creates request options for startPaymentMethodUpdate without sending the request
9293
+ */
9294
+ async startPaymentMethodUpdateRequestOpts() {
9295
+ const queryParameters = {};
9296
+ const headerParameters = {};
9297
+ if (this.configuration && this.configuration.accessToken) {
9298
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
9299
+ }
9300
+ let urlPath = `/api/v1/subscriptions/me/payment-method-update`;
9301
+ return {
9302
+ path: urlPath,
9303
+ method: "POST",
9304
+ headers: headerParameters,
9305
+ query: queryParameters
9306
+ };
9307
+ }
9308
+ /**
9309
+ * Start replacing the card on file for the caller\'s subscription (or enterprise contract). POST, not GET: for an active subscription Paddle creates a new zero-value transaction on every call.
9310
+ * Start Payment Method Update
9311
+ */
9312
+ async startPaymentMethodUpdateRaw(initOverrides) {
9313
+ const requestOptions = await this.startPaymentMethodUpdateRequestOpts();
9314
+ const response = await this.request(requestOptions, initOverrides);
9315
+ return new JSONApiResponse(response, (jsonValue) => PaymentMethodUpdateOutDTOFromJSON(jsonValue));
9316
+ }
9317
+ /**
9318
+ * Start replacing the card on file for the caller\'s subscription (or enterprise contract). POST, not GET: for an active subscription Paddle creates a new zero-value transaction on every call.
9319
+ * Start Payment Method Update
9320
+ */
9321
+ async startPaymentMethodUpdate(initOverrides) {
9322
+ const response = await this.startPaymentMethodUpdateRaw(initOverrides);
9323
+ return await response.value();
9324
+ }
8828
9325
  /**
8829
9326
  * Creates request options for subscribe without sending the request
8830
9327
  */
@@ -9162,6 +9659,7 @@ function TemplateOutDTOFromJSONTyped(json, ignoreDiscriminator) {
9162
9659
  "error": json["error"] == null ? void 0 : json["error"],
9163
9660
  "id": json["id"],
9164
9661
  "isActive": json["isActive"] == null ? void 0 : json["isActive"],
9662
+ "isStarter": json["isStarter"] == null ? void 0 : json["isStarter"],
9165
9663
  "name": json["name"],
9166
9664
  "schema": json["schema"] == null ? void 0 : TemplateSchemaDTOOutputFromJSON(json["schema"]),
9167
9665
  "sourceFilename": json["sourceFilename"] == null ? void 0 : json["sourceFilename"],
@@ -9182,6 +9680,7 @@ function TemplateOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
9182
9680
  "error": value["error"],
9183
9681
  "id": value["id"],
9184
9682
  "isActive": value["isActive"],
9683
+ "isStarter": value["isStarter"],
9185
9684
  "name": value["name"],
9186
9685
  "schema": TemplateSchemaDTOOutputToJSON(value["schema"]),
9187
9686
  "sourceFilename": value["sourceFilename"],
@@ -10316,9 +10815,6 @@ var GeminaClient = class _GeminaClient {
10316
10815
  'Unsupported document source: pass a Blob/File or { url: "https://..." }. In Node, convert a Buffer with new Blob([buf]).'
10317
10816
  );
10318
10817
  }
10319
- return this.pollUntilTerminal(submitted, options);
10320
- }
10321
- async pollUntilTerminal(submitted, options) {
10322
10818
  if (isTerminal(submitted.status)) {
10323
10819
  return finalizeTerminal(submitted);
10324
10820
  }
@@ -10328,6 +10824,47 @@ var GeminaClient = class _GeminaClient {
10328
10824
  "Malformed server response: non-terminal submit response is missing meta.correlationId"
10329
10825
  );
10330
10826
  }
10827
+ return this.pollUntilTerminal(correlationId, options, submitted);
10828
+ }
10829
+ /**
10830
+ * Add extraction types to a document Gemina already stores, then poll until
10831
+ * terminal and return the typed result — the add-on twin of
10832
+ * `processDocument` for a document you uploaded earlier (via
10833
+ * `processDocument`, FileTag, or an MCP tool), addressed by its id. No file
10834
+ * is re-uploaded; the stored document is re-extracted with the new
10835
+ * `extractionTypes`. Billing and page limits apply per added type exactly as
10836
+ * on an upload.
10837
+ *
10838
+ * @param documentId The stored document's id (from a prior upload's
10839
+ * `meta.documentId`, a FileTag result, or
10840
+ * `client.documents.getDocument(...)`).
10841
+ * @param extractionTypes Non-empty list of types to add.
10842
+ * @param options Per-extraction options + polling knobs.
10843
+ * @throws GeminaProcessingError on terminal `failed`.
10844
+ * @throws GeminaTimeoutError on the deadline; `.correlationId` resumes polling.
10845
+ * @throws ResponseError if the add-on request itself is rejected —
10846
+ * 404 (unknown document), 409 (type already present), 410 (content purged),
10847
+ * 422 (`custom_template` without `templateId`), 429 (out of credits / over quota). Not retried.
10848
+ */
10849
+ async addExtractionsAndWait(documentId, extractionTypes, options = {}) {
10850
+ if (!Array.isArray(extractionTypes) || extractionTypes.length === 0) {
10851
+ throw new GeminaError("extractionTypes must be a non-empty array");
10852
+ }
10853
+ const submitted = await this.documents.addDocumentExtractions({
10854
+ documentId,
10855
+ addExtractionsInDTO: {
10856
+ extractionTypes,
10857
+ templateId: options.templateId,
10858
+ modelType: options.modelType,
10859
+ thinking: options.thinking,
10860
+ evaluation: options.evaluation,
10861
+ correction: options.correction,
10862
+ includeCoordinates: options.includeCoordinates
10863
+ }
10864
+ });
10865
+ return this.pollUntilTerminal(submitted.pollCorrelationId, options);
10866
+ }
10867
+ async pollUntilTerminal(correlationId, options, initialResult) {
10331
10868
  const timeoutSeconds = options.timeoutSeconds ?? DEFAULT_TIMEOUT_SECONDS;
10332
10869
  const initialIntervalSeconds = options.initialIntervalSeconds ?? DEFAULT_INITIAL_INTERVAL_SECONDS;
10333
10870
  const maxIntervalSeconds = options.maxIntervalSeconds ?? DEFAULT_MAX_INTERVAL_SECONDS;
@@ -10336,7 +10873,7 @@ var GeminaClient = class _GeminaClient {
10336
10873
  const startedAt = Date.now();
10337
10874
  let sleptSeconds = 0;
10338
10875
  let nominalInterval = Math.min(initialIntervalSeconds, maxIntervalSeconds);
10339
- let lastResult = submitted;
10876
+ let lastResult = initialResult;
10340
10877
  let consecutivePollFailures = 0;
10341
10878
  for (; ; ) {
10342
10879
  const wait = nominalInterval * (JITTER_MIN + JITTER_SPAN * random());
@@ -10399,8 +10936,12 @@ async function asProcessingErrorIfFailedResult(error) {
10399
10936
  }
10400
10937
 
10401
10938
  // src/version.ts
10402
- var VERSION = "0.14.0";
10939
+ var VERSION = "0.16.1";
10403
10940
  export {
10941
+ AddExtractionsInDTOFromJSON,
10942
+ AddExtractionsInDTOFromJSONTyped,
10943
+ AddExtractionsInDTOToJSON,
10944
+ AddExtractionsInDTOToJSONTyped,
10404
10945
  AggregateMetaDTOFromJSON,
10405
10946
  AggregateMetaDTOFromJSONTyped,
10406
10947
  AggregateMetaDTOToJSON,
@@ -10516,6 +11057,14 @@ export {
10516
11057
  DataRetentionPeriodModelToJSON,
10517
11058
  DataRetentionPeriodModelToJSONTyped,
10518
11059
  DefaultConfig,
11060
+ DocumentAddExtractionsMetaOutDTOFromJSON,
11061
+ DocumentAddExtractionsMetaOutDTOFromJSONTyped,
11062
+ DocumentAddExtractionsMetaOutDTOToJSON,
11063
+ DocumentAddExtractionsMetaOutDTOToJSONTyped,
11064
+ DocumentAddExtractionsOutDTOFromJSON,
11065
+ DocumentAddExtractionsOutDTOFromJSONTyped,
11066
+ DocumentAddExtractionsOutDTOToJSON,
11067
+ DocumentAddExtractionsOutDTOToJSONTyped,
10519
11068
  DocumentApi,
10520
11069
  DocumentDataOutDTOFromJSON,
10521
11070
  DocumentDataOutDTOFromJSONTyped,
@@ -10774,6 +11323,11 @@ export {
10774
11323
  OperationTypeFromJSONTyped,
10775
11324
  OperationTypeToJSON,
10776
11325
  OperationTypeToJSONTyped,
11326
+ PaymentMethodUpdateOutDTOFromJSON,
11327
+ PaymentMethodUpdateOutDTOFromJSONTyped,
11328
+ PaymentMethodUpdateOutDTOPurposeEnum,
11329
+ PaymentMethodUpdateOutDTOToJSON,
11330
+ PaymentMethodUpdateOutDTOToJSONTyped,
10777
11331
  PeriodPresetModel,
10778
11332
  PeriodPresetModelFromJSON,
10779
11333
  PeriodPresetModelFromJSONTyped,
@@ -10810,6 +11364,7 @@ export {
10810
11364
  PurgedDocumentsDataOutDTOToJSONTyped,
10811
11365
  QueryMetaDTOFromJSON,
10812
11366
  QueryMetaDTOFromJSONTyped,
11367
+ QueryMetaDTOIndexingStateEnum,
10813
11368
  QueryMetaDTOToJSON,
10814
11369
  QueryMetaDTOToJSONTyped,
10815
11370
  QueryResultItemDTOFromJSON,
@@ -11061,6 +11616,7 @@ export {
11061
11616
  WebhookResponseDTOToJSONTyped,
11062
11617
  canConsumeForm,
11063
11618
  exists,
11619
+ instanceOfAddExtractionsInDTO,
11064
11620
  instanceOfAggregateMetaDTO,
11065
11621
  instanceOfAggregateMetricDTO,
11066
11622
  instanceOfAggregateRowDTO,
@@ -11085,6 +11641,8 @@ export {
11085
11641
  instanceOfCreditTransactionType,
11086
11642
  instanceOfDataCenterRegionModel,
11087
11643
  instanceOfDataRetentionPeriodModel,
11644
+ instanceOfDocumentAddExtractionsMetaOutDTO,
11645
+ instanceOfDocumentAddExtractionsOutDTO,
11088
11646
  instanceOfDocumentDataOutDTO,
11089
11647
  instanceOfDocumentFileTypeModel,
11090
11648
  instanceOfDocumentMetaOutDTO,
@@ -11143,6 +11701,7 @@ export {
11143
11701
  instanceOfNextActionOutDTO,
11144
11702
  instanceOfNumberOfStoredDocumentsOutDTO,
11145
11703
  instanceOfOperationType,
11704
+ instanceOfPaymentMethodUpdateOutDTO,
11146
11705
  instanceOfPeriodPresetModel,
11147
11706
  instanceOfPlanCreditCostOutDTO,
11148
11707
  instanceOfPlanDetailOutDTO,