@gemina/sdk 0.13.3 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -20,6 +20,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ AddExtractionsInDTOFromJSON: () => AddExtractionsInDTOFromJSON,
24
+ AddExtractionsInDTOFromJSONTyped: () => AddExtractionsInDTOFromJSONTyped,
25
+ AddExtractionsInDTOToJSON: () => AddExtractionsInDTOToJSON,
26
+ AddExtractionsInDTOToJSONTyped: () => AddExtractionsInDTOToJSONTyped,
23
27
  AggregateMetaDTOFromJSON: () => AggregateMetaDTOFromJSON,
24
28
  AggregateMetaDTOFromJSONTyped: () => AggregateMetaDTOFromJSONTyped,
25
29
  AggregateMetaDTOToJSON: () => AggregateMetaDTOToJSON,
@@ -135,6 +139,14 @@ __export(index_exports, {
135
139
  DataRetentionPeriodModelToJSON: () => DataRetentionPeriodModelToJSON,
136
140
  DataRetentionPeriodModelToJSONTyped: () => DataRetentionPeriodModelToJSONTyped,
137
141
  DefaultConfig: () => DefaultConfig,
142
+ DocumentAddExtractionsMetaOutDTOFromJSON: () => DocumentAddExtractionsMetaOutDTOFromJSON,
143
+ DocumentAddExtractionsMetaOutDTOFromJSONTyped: () => DocumentAddExtractionsMetaOutDTOFromJSONTyped,
144
+ DocumentAddExtractionsMetaOutDTOToJSON: () => DocumentAddExtractionsMetaOutDTOToJSON,
145
+ DocumentAddExtractionsMetaOutDTOToJSONTyped: () => DocumentAddExtractionsMetaOutDTOToJSONTyped,
146
+ DocumentAddExtractionsOutDTOFromJSON: () => DocumentAddExtractionsOutDTOFromJSON,
147
+ DocumentAddExtractionsOutDTOFromJSONTyped: () => DocumentAddExtractionsOutDTOFromJSONTyped,
148
+ DocumentAddExtractionsOutDTOToJSON: () => DocumentAddExtractionsOutDTOToJSON,
149
+ DocumentAddExtractionsOutDTOToJSONTyped: () => DocumentAddExtractionsOutDTOToJSONTyped,
138
150
  DocumentApi: () => DocumentApi,
139
151
  DocumentDataOutDTOFromJSON: () => DocumentDataOutDTOFromJSON,
140
152
  DocumentDataOutDTOFromJSONTyped: () => DocumentDataOutDTOFromJSONTyped,
@@ -680,6 +692,7 @@ __export(index_exports, {
680
692
  WebhookResponseDTOToJSONTyped: () => WebhookResponseDTOToJSONTyped,
681
693
  canConsumeForm: () => canConsumeForm,
682
694
  exists: () => exists,
695
+ instanceOfAddExtractionsInDTO: () => instanceOfAddExtractionsInDTO,
683
696
  instanceOfAggregateMetaDTO: () => instanceOfAggregateMetaDTO,
684
697
  instanceOfAggregateMetricDTO: () => instanceOfAggregateMetricDTO,
685
698
  instanceOfAggregateRowDTO: () => instanceOfAggregateRowDTO,
@@ -704,6 +717,8 @@ __export(index_exports, {
704
717
  instanceOfCreditTransactionType: () => instanceOfCreditTransactionType,
705
718
  instanceOfDataCenterRegionModel: () => instanceOfDataCenterRegionModel,
706
719
  instanceOfDataRetentionPeriodModel: () => instanceOfDataRetentionPeriodModel,
720
+ instanceOfDocumentAddExtractionsMetaOutDTO: () => instanceOfDocumentAddExtractionsMetaOutDTO,
721
+ instanceOfDocumentAddExtractionsOutDTO: () => instanceOfDocumentAddExtractionsOutDTO,
707
722
  instanceOfDocumentDataOutDTO: () => instanceOfDocumentDataOutDTO,
708
723
  instanceOfDocumentFileTypeModel: () => instanceOfDocumentFileTypeModel,
709
724
  instanceOfDocumentMetaOutDTO: () => instanceOfDocumentMetaOutDTO,
@@ -2101,6 +2116,110 @@ var ContactApi = class extends BaseAPI {
2101
2116
  }
2102
2117
  };
2103
2118
 
2119
+ // src/generated/models/ModelType.ts
2120
+ var ModelType = {
2121
+ Gemina: "gemina",
2122
+ Google: "google",
2123
+ Openai: "openai",
2124
+ Velox: "velox",
2125
+ Praetorian: "praetorian",
2126
+ Invictus: "invictus"
2127
+ };
2128
+ function instanceOfModelType(value) {
2129
+ for (const key in ModelType) {
2130
+ if (Object.prototype.hasOwnProperty.call(ModelType, key)) {
2131
+ if (ModelType[key] === value) {
2132
+ return true;
2133
+ }
2134
+ }
2135
+ }
2136
+ return false;
2137
+ }
2138
+ function ModelTypeFromJSON(json) {
2139
+ return ModelTypeFromJSONTyped(json, false);
2140
+ }
2141
+ function ModelTypeFromJSONTyped(json, ignoreDiscriminator) {
2142
+ return json;
2143
+ }
2144
+ function ModelTypeToJSON(value) {
2145
+ return value;
2146
+ }
2147
+ function ModelTypeToJSONTyped(value, ignoreDiscriminator) {
2148
+ return value;
2149
+ }
2150
+
2151
+ // src/generated/models/UploadExtractionTypeEnum.ts
2152
+ var UploadExtractionTypeEnum = {
2153
+ Ocr: "ocr",
2154
+ DocumentDetailsHebrew: "document_details_hebrew",
2155
+ DocumentLineItemsHebrew: "document_line_items_hebrew",
2156
+ InvoiceHeaders: "invoice_headers",
2157
+ InvoiceLineItems: "invoice_line_items",
2158
+ CustomTemplate: "custom_template"
2159
+ };
2160
+ function instanceOfUploadExtractionTypeEnum(value) {
2161
+ for (const key in UploadExtractionTypeEnum) {
2162
+ if (Object.prototype.hasOwnProperty.call(UploadExtractionTypeEnum, key)) {
2163
+ if (UploadExtractionTypeEnum[key] === value) {
2164
+ return true;
2165
+ }
2166
+ }
2167
+ }
2168
+ return false;
2169
+ }
2170
+ function UploadExtractionTypeEnumFromJSON(json) {
2171
+ return UploadExtractionTypeEnumFromJSONTyped(json, false);
2172
+ }
2173
+ function UploadExtractionTypeEnumFromJSONTyped(json, ignoreDiscriminator) {
2174
+ return json;
2175
+ }
2176
+ function UploadExtractionTypeEnumToJSON(value) {
2177
+ return value;
2178
+ }
2179
+ function UploadExtractionTypeEnumToJSONTyped(value, ignoreDiscriminator) {
2180
+ return value;
2181
+ }
2182
+
2183
+ // src/generated/models/AddExtractionsInDTO.ts
2184
+ function instanceOfAddExtractionsInDTO(value) {
2185
+ if (!("extractionTypes" in value) || value["extractionTypes"] === void 0) return false;
2186
+ return true;
2187
+ }
2188
+ function AddExtractionsInDTOFromJSON(json) {
2189
+ return AddExtractionsInDTOFromJSONTyped(json, false);
2190
+ }
2191
+ function AddExtractionsInDTOFromJSONTyped(json, ignoreDiscriminator) {
2192
+ if (json == null) {
2193
+ return json;
2194
+ }
2195
+ return {
2196
+ "correction": json["correction"] == null ? void 0 : json["correction"],
2197
+ "evaluation": json["evaluation"] == null ? void 0 : json["evaluation"],
2198
+ "extractionTypes": json["extractionTypes"].map(UploadExtractionTypeEnumFromJSON),
2199
+ "includeCoordinates": json["includeCoordinates"] == null ? void 0 : json["includeCoordinates"],
2200
+ "modelType": json["modelType"] == null ? void 0 : ModelTypeFromJSON(json["modelType"]),
2201
+ "templateId": json["templateId"] == null ? void 0 : json["templateId"],
2202
+ "thinking": json["thinking"] == null ? void 0 : json["thinking"]
2203
+ };
2204
+ }
2205
+ function AddExtractionsInDTOToJSON(json) {
2206
+ return AddExtractionsInDTOToJSONTyped(json, false);
2207
+ }
2208
+ function AddExtractionsInDTOToJSONTyped(value, ignoreDiscriminator = false) {
2209
+ if (value == null) {
2210
+ return value;
2211
+ }
2212
+ return {
2213
+ "correction": value["correction"],
2214
+ "evaluation": value["evaluation"],
2215
+ "extractionTypes": value["extractionTypes"].map(UploadExtractionTypeEnumToJSON),
2216
+ "includeCoordinates": value["includeCoordinates"],
2217
+ "modelType": ModelTypeToJSON(value["modelType"]),
2218
+ "templateId": value["templateId"],
2219
+ "thinking": value["thinking"]
2220
+ };
2221
+ }
2222
+
2104
2223
  // src/generated/models/ResponseStatus.ts
2105
2224
  var ResponseStatus = {
2106
2225
  Pending: "pending",
@@ -2192,16 +2311,16 @@ function DataCenterRegionModelToJSONTyped(value, ignoreDiscriminator) {
2192
2311
  return value;
2193
2312
  }
2194
2313
 
2195
- // src/generated/models/DocumentViewMetaOutDTO.ts
2196
- function instanceOfDocumentViewMetaOutDTO(value) {
2314
+ // src/generated/models/DocumentAddExtractionsMetaOutDTO.ts
2315
+ function instanceOfDocumentAddExtractionsMetaOutDTO(value) {
2197
2316
  if (!("contentPurgedAt" in value) || value["contentPurgedAt"] === void 0) return false;
2198
2317
  if (!("createdAt" in value) || value["createdAt"] === void 0) return false;
2199
2318
  return true;
2200
2319
  }
2201
- function DocumentViewMetaOutDTOFromJSON(json) {
2202
- return DocumentViewMetaOutDTOFromJSONTyped(json, false);
2320
+ function DocumentAddExtractionsMetaOutDTOFromJSON(json) {
2321
+ return DocumentAddExtractionsMetaOutDTOFromJSONTyped(json, false);
2203
2322
  }
2204
- function DocumentViewMetaOutDTOFromJSONTyped(json, ignoreDiscriminator) {
2323
+ function DocumentAddExtractionsMetaOutDTOFromJSONTyped(json, ignoreDiscriminator) {
2205
2324
  if (json == null) {
2206
2325
  return json;
2207
2326
  }
@@ -2209,6 +2328,7 @@ function DocumentViewMetaOutDTOFromJSONTyped(json, ignoreDiscriminator) {
2209
2328
  "apiKeyId": json["apiKeyId"] == null ? void 0 : json["apiKeyId"],
2210
2329
  "contentPurgedAt": json["contentPurgedAt"] == null ? null : new Date(json["contentPurgedAt"]),
2211
2330
  "contentType": json["contentType"] == null ? void 0 : json["contentType"],
2331
+ "correlationId": json["correlationId"] == null ? void 0 : json["correlationId"],
2212
2332
  "createdAt": new Date(json["createdAt"]),
2213
2333
  "documentFileType": json["documentFileType"] == null ? void 0 : DocumentFileTypeModelFromJSON(json["documentFileType"]),
2214
2334
  "documentId": json["documentId"] == null ? void 0 : json["documentId"],
@@ -2217,6 +2337,7 @@ function DocumentViewMetaOutDTOFromJSONTyped(json, ignoreDiscriminator) {
2217
2337
  "fileSize": json["fileSize"] == null ? void 0 : json["fileSize"],
2218
2338
  "filename": json["filename"] == null ? void 0 : json["filename"],
2219
2339
  "imageUrl": json["imageUrl"] == null ? void 0 : json["imageUrl"],
2340
+ "next": json["next"] == null ? void 0 : json["next"],
2220
2341
  "normalizedHeight": json["normalizedHeight"] == null ? void 0 : json["normalizedHeight"],
2221
2342
  "normalizedMegapixels": json["normalizedMegapixels"] == null ? void 0 : json["normalizedMegapixels"],
2222
2343
  "normalizedWidth": json["normalizedWidth"] == null ? void 0 : json["normalizedWidth"],
@@ -2228,10 +2349,10 @@ function DocumentViewMetaOutDTOFromJSONTyped(json, ignoreDiscriminator) {
2228
2349
  "userId": json["userId"] == null ? void 0 : json["userId"]
2229
2350
  };
2230
2351
  }
2231
- function DocumentViewMetaOutDTOToJSON(json) {
2232
- return DocumentViewMetaOutDTOToJSONTyped(json, false);
2352
+ function DocumentAddExtractionsMetaOutDTOToJSON(json) {
2353
+ return DocumentAddExtractionsMetaOutDTOToJSONTyped(json, false);
2233
2354
  }
2234
- function DocumentViewMetaOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
2355
+ function DocumentAddExtractionsMetaOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
2235
2356
  if (value == null) {
2236
2357
  return value;
2237
2358
  }
@@ -2239,6 +2360,7 @@ function DocumentViewMetaOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
2239
2360
  "apiKeyId": value["apiKeyId"],
2240
2361
  "contentPurgedAt": value["contentPurgedAt"] == null ? value["contentPurgedAt"] : value["contentPurgedAt"].toISOString(),
2241
2362
  "contentType": value["contentType"],
2363
+ "correlationId": value["correlationId"],
2242
2364
  "createdAt": value["createdAt"].toISOString(),
2243
2365
  "documentFileType": DocumentFileTypeModelToJSON(value["documentFileType"]),
2244
2366
  "documentId": value["documentId"],
@@ -2247,6 +2369,7 @@ function DocumentViewMetaOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
2247
2369
  "fileSize": value["fileSize"],
2248
2370
  "filename": value["filename"],
2249
2371
  "imageUrl": value["imageUrl"],
2372
+ "next": value["next"],
2250
2373
  "normalizedHeight": value["normalizedHeight"],
2251
2374
  "normalizedMegapixels": value["normalizedMegapixels"],
2252
2375
  "normalizedWidth": value["normalizedWidth"],
@@ -2363,38 +2486,6 @@ function ExtractionTypeModelToJSONTyped(value, ignoreDiscriminator) {
2363
2486
  return value;
2364
2487
  }
2365
2488
 
2366
- // src/generated/models/ModelType.ts
2367
- var ModelType = {
2368
- Gemina: "gemina",
2369
- Google: "google",
2370
- Openai: "openai",
2371
- Velox: "velox",
2372
- Praetorian: "praetorian",
2373
- Invictus: "invictus"
2374
- };
2375
- function instanceOfModelType(value) {
2376
- for (const key in ModelType) {
2377
- if (Object.prototype.hasOwnProperty.call(ModelType, key)) {
2378
- if (ModelType[key] === value) {
2379
- return true;
2380
- }
2381
- }
2382
- }
2383
- return false;
2384
- }
2385
- function ModelTypeFromJSON(json) {
2386
- return ModelTypeFromJSONTyped(json, false);
2387
- }
2388
- function ModelTypeFromJSONTyped(json, ignoreDiscriminator) {
2389
- return json;
2390
- }
2391
- function ModelTypeToJSON(value) {
2392
- return value;
2393
- }
2394
- function ModelTypeToJSONTyped(value, ignoreDiscriminator) {
2395
- return value;
2396
- }
2397
-
2398
2489
  // src/generated/models/ValidationFieldModel.ts
2399
2490
  var ValidationFieldModelTypeEnum = {
2400
2491
  String: "string",
@@ -2683,6 +2774,118 @@ function DocumentDataOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
2683
2774
  };
2684
2775
  }
2685
2776
 
2777
+ // src/generated/models/DocumentAddExtractionsOutDTO.ts
2778
+ function instanceOfDocumentAddExtractionsOutDTO(value) {
2779
+ if (!("data" in value) || value["data"] === void 0) return false;
2780
+ if (!("meta" in value) || value["meta"] === void 0) return false;
2781
+ if (!("pollCorrelationId" in value) || value["pollCorrelationId"] === void 0) return false;
2782
+ if (!("status" in value) || value["status"] === void 0) return false;
2783
+ return true;
2784
+ }
2785
+ function DocumentAddExtractionsOutDTOFromJSON(json) {
2786
+ return DocumentAddExtractionsOutDTOFromJSONTyped(json, false);
2787
+ }
2788
+ function DocumentAddExtractionsOutDTOFromJSONTyped(json, ignoreDiscriminator) {
2789
+ if (json == null) {
2790
+ return json;
2791
+ }
2792
+ return {
2793
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
2794
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
2795
+ "data": DocumentDataOutDTOFromJSON(json["data"]),
2796
+ "errors": json["errors"] == null ? void 0 : json["errors"],
2797
+ "meta": DocumentAddExtractionsMetaOutDTOFromJSON(json["meta"]),
2798
+ "newExtractionIds": json["newExtractionIds"] == null ? void 0 : json["newExtractionIds"],
2799
+ "pollCorrelationId": json["pollCorrelationId"],
2800
+ "status": ResponseStatusFromJSON(json["status"])
2801
+ };
2802
+ }
2803
+ function DocumentAddExtractionsOutDTOToJSON(json) {
2804
+ return DocumentAddExtractionsOutDTOToJSONTyped(json, false);
2805
+ }
2806
+ function DocumentAddExtractionsOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
2807
+ if (value == null) {
2808
+ return value;
2809
+ }
2810
+ return {
2811
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
2812
+ "createdAtTimestamp": value["createdAtTimestamp"],
2813
+ "data": DocumentDataOutDTOToJSON(value["data"]),
2814
+ "errors": value["errors"],
2815
+ "meta": DocumentAddExtractionsMetaOutDTOToJSON(value["meta"]),
2816
+ "newExtractionIds": value["newExtractionIds"],
2817
+ "pollCorrelationId": value["pollCorrelationId"],
2818
+ "status": ResponseStatusToJSON(value["status"])
2819
+ };
2820
+ }
2821
+
2822
+ // src/generated/models/DocumentViewMetaOutDTO.ts
2823
+ function instanceOfDocumentViewMetaOutDTO(value) {
2824
+ if (!("contentPurgedAt" in value) || value["contentPurgedAt"] === void 0) return false;
2825
+ if (!("createdAt" in value) || value["createdAt"] === void 0) return false;
2826
+ return true;
2827
+ }
2828
+ function DocumentViewMetaOutDTOFromJSON(json) {
2829
+ return DocumentViewMetaOutDTOFromJSONTyped(json, false);
2830
+ }
2831
+ function DocumentViewMetaOutDTOFromJSONTyped(json, ignoreDiscriminator) {
2832
+ if (json == null) {
2833
+ return json;
2834
+ }
2835
+ return {
2836
+ "apiKeyId": json["apiKeyId"] == null ? void 0 : json["apiKeyId"],
2837
+ "contentPurgedAt": json["contentPurgedAt"] == null ? null : new Date(json["contentPurgedAt"]),
2838
+ "contentType": json["contentType"] == null ? void 0 : json["contentType"],
2839
+ "createdAt": new Date(json["createdAt"]),
2840
+ "documentFileType": json["documentFileType"] == null ? void 0 : DocumentFileTypeModelFromJSON(json["documentFileType"]),
2841
+ "documentId": json["documentId"] == null ? void 0 : json["documentId"],
2842
+ "endUserId": json["endUserId"] == null ? void 0 : json["endUserId"],
2843
+ "externalId": json["externalId"] == null ? void 0 : json["externalId"],
2844
+ "fileSize": json["fileSize"] == null ? void 0 : json["fileSize"],
2845
+ "filename": json["filename"] == null ? void 0 : json["filename"],
2846
+ "imageUrl": json["imageUrl"] == null ? void 0 : json["imageUrl"],
2847
+ "normalizedHeight": json["normalizedHeight"] == null ? void 0 : json["normalizedHeight"],
2848
+ "normalizedMegapixels": json["normalizedMegapixels"] == null ? void 0 : json["normalizedMegapixels"],
2849
+ "normalizedWidth": json["normalizedWidth"] == null ? void 0 : json["normalizedWidth"],
2850
+ "numberOfPages": json["numberOfPages"] == null ? void 0 : json["numberOfPages"],
2851
+ "originalDocumentUrl": json["originalDocumentUrl"] == null ? void 0 : json["originalDocumentUrl"],
2852
+ "processingStatus": json["processingStatus"] == null ? void 0 : ResponseStatusFromJSON(json["processingStatus"]),
2853
+ "storageLocation": json["storageLocation"] == null ? void 0 : DataCenterRegionModelFromJSON(json["storageLocation"]),
2854
+ "thumbnailUrl": json["thumbnailUrl"] == null ? void 0 : json["thumbnailUrl"],
2855
+ "userId": json["userId"] == null ? void 0 : json["userId"]
2856
+ };
2857
+ }
2858
+ function DocumentViewMetaOutDTOToJSON(json) {
2859
+ return DocumentViewMetaOutDTOToJSONTyped(json, false);
2860
+ }
2861
+ function DocumentViewMetaOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
2862
+ if (value == null) {
2863
+ return value;
2864
+ }
2865
+ return {
2866
+ "apiKeyId": value["apiKeyId"],
2867
+ "contentPurgedAt": value["contentPurgedAt"] == null ? value["contentPurgedAt"] : value["contentPurgedAt"].toISOString(),
2868
+ "contentType": value["contentType"],
2869
+ "createdAt": value["createdAt"].toISOString(),
2870
+ "documentFileType": DocumentFileTypeModelToJSON(value["documentFileType"]),
2871
+ "documentId": value["documentId"],
2872
+ "endUserId": value["endUserId"],
2873
+ "externalId": value["externalId"],
2874
+ "fileSize": value["fileSize"],
2875
+ "filename": value["filename"],
2876
+ "imageUrl": value["imageUrl"],
2877
+ "normalizedHeight": value["normalizedHeight"],
2878
+ "normalizedMegapixels": value["normalizedMegapixels"],
2879
+ "normalizedWidth": value["normalizedWidth"],
2880
+ "numberOfPages": value["numberOfPages"],
2881
+ "originalDocumentUrl": value["originalDocumentUrl"],
2882
+ "processingStatus": ResponseStatusToJSON(value["processingStatus"]),
2883
+ "storageLocation": DataCenterRegionModelToJSON(value["storageLocation"]),
2884
+ "thumbnailUrl": value["thumbnailUrl"],
2885
+ "userId": value["userId"]
2886
+ };
2887
+ }
2888
+
2686
2889
  // src/generated/models/DocumentPrimaryViewOutDTO.ts
2687
2890
  function instanceOfDocumentPrimaryViewOutDTO(value) {
2688
2891
  if (!("data" in value) || value["data"] === void 0) return false;
@@ -4029,38 +4232,6 @@ function NumberOfStoredDocumentsOutDTOToJSONTyped(value, ignoreDiscriminator = f
4029
4232
  };
4030
4233
  }
4031
4234
 
4032
- // src/generated/models/UploadExtractionTypeEnum.ts
4033
- var UploadExtractionTypeEnum = {
4034
- Ocr: "ocr",
4035
- DocumentDetailsHebrew: "document_details_hebrew",
4036
- DocumentLineItemsHebrew: "document_line_items_hebrew",
4037
- InvoiceHeaders: "invoice_headers",
4038
- InvoiceLineItems: "invoice_line_items",
4039
- CustomTemplate: "custom_template"
4040
- };
4041
- function instanceOfUploadExtractionTypeEnum(value) {
4042
- for (const key in UploadExtractionTypeEnum) {
4043
- if (Object.prototype.hasOwnProperty.call(UploadExtractionTypeEnum, key)) {
4044
- if (UploadExtractionTypeEnum[key] === value) {
4045
- return true;
4046
- }
4047
- }
4048
- }
4049
- return false;
4050
- }
4051
- function UploadExtractionTypeEnumFromJSON(json) {
4052
- return UploadExtractionTypeEnumFromJSONTyped(json, false);
4053
- }
4054
- function UploadExtractionTypeEnumFromJSONTyped(json, ignoreDiscriminator) {
4055
- return json;
4056
- }
4057
- function UploadExtractionTypeEnumToJSON(value) {
4058
- return value;
4059
- }
4060
- function UploadExtractionTypeEnumToJSONTyped(value, ignoreDiscriminator) {
4061
- return value;
4062
- }
4063
-
4064
4235
  // src/generated/models/WebDocumentUploadInDTO.ts
4065
4236
  function instanceOfWebDocumentUploadInDTO(value) {
4066
4237
  if (!("externalId" in value) || value["externalId"] === void 0) return false;
@@ -4115,6 +4286,102 @@ function WebDocumentUploadInDTOToJSONTyped(value, ignoreDiscriminator = false) {
4115
4286
 
4116
4287
  // src/generated/apis/DocumentApi.ts
4117
4288
  var DocumentApi = class extends BaseAPI {
4289
+ /**
4290
+ * Creates request options for addDocumentExtractions without sending the request
4291
+ */
4292
+ async addDocumentExtractionsRequestOpts(requestParameters) {
4293
+ if (requestParameters["documentId"] == null) {
4294
+ throw new RequiredError(
4295
+ "documentId",
4296
+ 'Required parameter "documentId" was null or undefined when calling addDocumentExtractions().'
4297
+ );
4298
+ }
4299
+ if (requestParameters["addExtractionsInDTO"] == null) {
4300
+ throw new RequiredError(
4301
+ "addExtractionsInDTO",
4302
+ 'Required parameter "addExtractionsInDTO" was null or undefined when calling addDocumentExtractions().'
4303
+ );
4304
+ }
4305
+ const queryParameters = {};
4306
+ const headerParameters = {};
4307
+ headerParameters["Content-Type"] = "application/json";
4308
+ if (this.configuration && this.configuration.apiKey) {
4309
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
4310
+ }
4311
+ let urlPath = `/api/v1/documents/{document_id}/extractions`;
4312
+ urlPath = urlPath.replace("{document_id}", encodeURIComponent(String(requestParameters["documentId"])));
4313
+ return {
4314
+ path: urlPath,
4315
+ method: "POST",
4316
+ headers: headerParameters,
4317
+ query: queryParameters,
4318
+ body: AddExtractionsInDTOToJSON(requestParameters["addExtractionsInDTO"])
4319
+ };
4320
+ }
4321
+ /**
4322
+ * 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.
4323
+ * Add extraction types to an existing document
4324
+ */
4325
+ async addDocumentExtractionsRaw(requestParameters, initOverrides) {
4326
+ const requestOptions = await this.addDocumentExtractionsRequestOpts(requestParameters);
4327
+ const response = await this.request(requestOptions, initOverrides);
4328
+ return new JSONApiResponse(response, (jsonValue) => DocumentAddExtractionsOutDTOFromJSON(jsonValue));
4329
+ }
4330
+ /**
4331
+ * 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.
4332
+ * Add extraction types to an existing document
4333
+ */
4334
+ async addDocumentExtractions(requestParameters, initOverrides) {
4335
+ const response = await this.addDocumentExtractionsRaw(requestParameters, initOverrides);
4336
+ return await response.value();
4337
+ }
4338
+ /**
4339
+ * Creates request options for addDocumentExtractionsByUser without sending the request
4340
+ */
4341
+ async addDocumentExtractionsByUserRequestOpts(requestParameters) {
4342
+ if (requestParameters["documentId"] == null) {
4343
+ throw new RequiredError(
4344
+ "documentId",
4345
+ 'Required parameter "documentId" was null or undefined when calling addDocumentExtractionsByUser().'
4346
+ );
4347
+ }
4348
+ if (requestParameters["addExtractionsInDTO"] == null) {
4349
+ throw new RequiredError(
4350
+ "addExtractionsInDTO",
4351
+ 'Required parameter "addExtractionsInDTO" was null or undefined when calling addDocumentExtractionsByUser().'
4352
+ );
4353
+ }
4354
+ const queryParameters = {};
4355
+ const headerParameters = {};
4356
+ headerParameters["Content-Type"] = "application/json";
4357
+ if (this.configuration && this.configuration.accessToken) {
4358
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
4359
+ }
4360
+ let urlPath = `/api/v1/documents/{document_id}/extractions/user`;
4361
+ urlPath = urlPath.replace("{document_id}", encodeURIComponent(String(requestParameters["documentId"])));
4362
+ return {
4363
+ path: urlPath,
4364
+ method: "POST",
4365
+ headers: headerParameters,
4366
+ query: queryParameters,
4367
+ body: AddExtractionsInDTOToJSON(requestParameters["addExtractionsInDTO"])
4368
+ };
4369
+ }
4370
+ /**
4371
+ * Add extraction types to an existing document (user credentials)
4372
+ */
4373
+ async addDocumentExtractionsByUserRaw(requestParameters, initOverrides) {
4374
+ const requestOptions = await this.addDocumentExtractionsByUserRequestOpts(requestParameters);
4375
+ const response = await this.request(requestOptions, initOverrides);
4376
+ return new JSONApiResponse(response, (jsonValue) => DocumentAddExtractionsOutDTOFromJSON(jsonValue));
4377
+ }
4378
+ /**
4379
+ * Add extraction types to an existing document (user credentials)
4380
+ */
4381
+ async addDocumentExtractionsByUser(requestParameters, initOverrides) {
4382
+ const response = await this.addDocumentExtractionsByUserRaw(requestParameters, initOverrides);
4383
+ return await response.value();
4384
+ }
4118
4385
  /**
4119
4386
  * Creates request options for createDocumentProcessingRequest without sending the request
4120
4387
  */
@@ -11149,9 +11416,6 @@ var GeminaClient = class _GeminaClient {
11149
11416
  'Unsupported document source: pass a Blob/File or { url: "https://..." }. In Node, convert a Buffer with new Blob([buf]).'
11150
11417
  );
11151
11418
  }
11152
- return this.pollUntilTerminal(submitted, options);
11153
- }
11154
- async pollUntilTerminal(submitted, options) {
11155
11419
  if (isTerminal(submitted.status)) {
11156
11420
  return finalizeTerminal(submitted);
11157
11421
  }
@@ -11161,6 +11425,47 @@ var GeminaClient = class _GeminaClient {
11161
11425
  "Malformed server response: non-terminal submit response is missing meta.correlationId"
11162
11426
  );
11163
11427
  }
11428
+ return this.pollUntilTerminal(correlationId, options, submitted);
11429
+ }
11430
+ /**
11431
+ * Add extraction types to a document Gemina already stores, then poll until
11432
+ * terminal and return the typed result — the add-on twin of
11433
+ * `processDocument` for a document you uploaded earlier (via
11434
+ * `processDocument`, FileTag, or an MCP tool), addressed by its id. No file
11435
+ * is re-uploaded; the stored document is re-extracted with the new
11436
+ * `extractionTypes`. Billing and page limits apply per added type exactly as
11437
+ * on an upload.
11438
+ *
11439
+ * @param documentId The stored document's id (from a prior upload's
11440
+ * `meta.documentId`, a FileTag result, or
11441
+ * `client.documents.getDocument(...)`).
11442
+ * @param extractionTypes Non-empty list of types to add.
11443
+ * @param options Per-extraction options + polling knobs.
11444
+ * @throws GeminaProcessingError on terminal `failed`.
11445
+ * @throws GeminaTimeoutError on the deadline; `.correlationId` resumes polling.
11446
+ * @throws ResponseError if the add-on request itself is rejected —
11447
+ * 404 (unknown document), 409 (type already present), 410 (content purged),
11448
+ * 422 (`custom_template` without `templateId`), 429 (out of credits / over quota). Not retried.
11449
+ */
11450
+ async addExtractionsAndWait(documentId, extractionTypes, options = {}) {
11451
+ if (!Array.isArray(extractionTypes) || extractionTypes.length === 0) {
11452
+ throw new GeminaError("extractionTypes must be a non-empty array");
11453
+ }
11454
+ const submitted = await this.documents.addDocumentExtractions({
11455
+ documentId,
11456
+ addExtractionsInDTO: {
11457
+ extractionTypes,
11458
+ templateId: options.templateId,
11459
+ modelType: options.modelType,
11460
+ thinking: options.thinking,
11461
+ evaluation: options.evaluation,
11462
+ correction: options.correction,
11463
+ includeCoordinates: options.includeCoordinates
11464
+ }
11465
+ });
11466
+ return this.pollUntilTerminal(submitted.pollCorrelationId, options);
11467
+ }
11468
+ async pollUntilTerminal(correlationId, options, initialResult) {
11164
11469
  const timeoutSeconds = options.timeoutSeconds ?? DEFAULT_TIMEOUT_SECONDS;
11165
11470
  const initialIntervalSeconds = options.initialIntervalSeconds ?? DEFAULT_INITIAL_INTERVAL_SECONDS;
11166
11471
  const maxIntervalSeconds = options.maxIntervalSeconds ?? DEFAULT_MAX_INTERVAL_SECONDS;
@@ -11169,7 +11474,7 @@ var GeminaClient = class _GeminaClient {
11169
11474
  const startedAt = Date.now();
11170
11475
  let sleptSeconds = 0;
11171
11476
  let nominalInterval = Math.min(initialIntervalSeconds, maxIntervalSeconds);
11172
- let lastResult = submitted;
11477
+ let lastResult = initialResult;
11173
11478
  let consecutivePollFailures = 0;
11174
11479
  for (; ; ) {
11175
11480
  const wait = nominalInterval * (JITTER_MIN + JITTER_SPAN * random());
@@ -11232,9 +11537,13 @@ async function asProcessingErrorIfFailedResult(error) {
11232
11537
  }
11233
11538
 
11234
11539
  // src/version.ts
11235
- var VERSION = "0.13.3";
11540
+ var VERSION = "0.15.0";
11236
11541
  // Annotate the CommonJS export names for ESM import in node:
11237
11542
  0 && (module.exports = {
11543
+ AddExtractionsInDTOFromJSON,
11544
+ AddExtractionsInDTOFromJSONTyped,
11545
+ AddExtractionsInDTOToJSON,
11546
+ AddExtractionsInDTOToJSONTyped,
11238
11547
  AggregateMetaDTOFromJSON,
11239
11548
  AggregateMetaDTOFromJSONTyped,
11240
11549
  AggregateMetaDTOToJSON,
@@ -11350,6 +11659,14 @@ var VERSION = "0.13.3";
11350
11659
  DataRetentionPeriodModelToJSON,
11351
11660
  DataRetentionPeriodModelToJSONTyped,
11352
11661
  DefaultConfig,
11662
+ DocumentAddExtractionsMetaOutDTOFromJSON,
11663
+ DocumentAddExtractionsMetaOutDTOFromJSONTyped,
11664
+ DocumentAddExtractionsMetaOutDTOToJSON,
11665
+ DocumentAddExtractionsMetaOutDTOToJSONTyped,
11666
+ DocumentAddExtractionsOutDTOFromJSON,
11667
+ DocumentAddExtractionsOutDTOFromJSONTyped,
11668
+ DocumentAddExtractionsOutDTOToJSON,
11669
+ DocumentAddExtractionsOutDTOToJSONTyped,
11353
11670
  DocumentApi,
11354
11671
  DocumentDataOutDTOFromJSON,
11355
11672
  DocumentDataOutDTOFromJSONTyped,
@@ -11895,6 +12212,7 @@ var VERSION = "0.13.3";
11895
12212
  WebhookResponseDTOToJSONTyped,
11896
12213
  canConsumeForm,
11897
12214
  exists,
12215
+ instanceOfAddExtractionsInDTO,
11898
12216
  instanceOfAggregateMetaDTO,
11899
12217
  instanceOfAggregateMetricDTO,
11900
12218
  instanceOfAggregateRowDTO,
@@ -11919,6 +12237,8 @@ var VERSION = "0.13.3";
11919
12237
  instanceOfCreditTransactionType,
11920
12238
  instanceOfDataCenterRegionModel,
11921
12239
  instanceOfDataRetentionPeriodModel,
12240
+ instanceOfDocumentAddExtractionsMetaOutDTO,
12241
+ instanceOfDocumentAddExtractionsOutDTO,
11922
12242
  instanceOfDocumentDataOutDTO,
11923
12243
  instanceOfDocumentFileTypeModel,
11924
12244
  instanceOfDocumentMetaOutDTO,