@gemina/sdk 0.15.0 → 0.17.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.js CHANGED
@@ -4729,6 +4729,63 @@ var DocumentApi = class extends BaseAPI {
4729
4729
  const response = await this.purgeDocumentsWithExternalIdByUserRaw(requestParameters, initOverrides);
4730
4730
  return await response.value();
4731
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
+ }
4732
4789
  /**
4733
4790
  * Creates request options for uploadDocument without sending the request
4734
4791
  */
@@ -6136,6 +6193,87 @@ var FileTagApi = class extends BaseAPI {
6136
6193
  const response = await this.getMyFiletagCreditHistoryRaw(requestParameters, initOverrides);
6137
6194
  return await response.value();
6138
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
+ }
6139
6277
  /**
6140
6278
  * Creates request options for tagDocument without sending the request
6141
6279
  */
@@ -6147,6 +6285,9 @@ var FileTagApi = class extends BaseAPI {
6147
6285
  );
6148
6286
  }
6149
6287
  const queryParameters = {};
6288
+ if (requestParameters["externalId"] != null) {
6289
+ queryParameters["external_id"] = requestParameters["externalId"];
6290
+ }
6150
6291
  const headerParameters = {};
6151
6292
  if (this.configuration && this.configuration.apiKey) {
6152
6293
  headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
@@ -6203,6 +6344,9 @@ var FileTagApi = class extends BaseAPI {
6203
6344
  );
6204
6345
  }
6205
6346
  const queryParameters = {};
6347
+ if (requestParameters["externalId"] != null) {
6348
+ queryParameters["external_id"] = requestParameters["externalId"];
6349
+ }
6206
6350
  const headerParameters = {};
6207
6351
  if (this.configuration && this.configuration.apiKey) {
6208
6352
  headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
@@ -6383,6 +6527,7 @@ function FilesUploadInstructionsOutDTOFromJSONTyped(json, ignoreDiscriminator) {
6383
6527
  }
6384
6528
  return {
6385
6529
  "fileId": json["fileId"],
6530
+ "handoffExpiresAt": json["handoffExpiresAt"] == null ? void 0 : new Date(json["handoffExpiresAt"]),
6386
6531
  "nextToolCall": FilesNextToolCallOutDTOFromJSON(json["nextToolCall"]),
6387
6532
  "upload": FilesUploadDetailsOutDTOFromJSON(json["upload"])
6388
6533
  };
@@ -6396,6 +6541,7 @@ function FilesUploadInstructionsOutDTOToJSONTyped(value, ignoreDiscriminator = f
6396
6541
  }
6397
6542
  return {
6398
6543
  "fileId": value["fileId"],
6544
+ "handoffExpiresAt": value["handoffExpiresAt"] == null ? value["handoffExpiresAt"] : value["handoffExpiresAt"].toISOString(),
6399
6545
  "nextToolCall": FilesNextToolCallOutDTOToJSON(value["nextToolCall"]),
6400
6546
  "upload": FilesUploadDetailsOutDTOToJSON(value["upload"])
6401
6547
  };
@@ -6797,10 +6943,14 @@ function RetrievalFiltersDTOFromJSONTyped(json, ignoreDiscriminator) {
6797
6943
  }
6798
6944
  return {
6799
6945
  "buyerName": json["buyerName"] == null ? void 0 : json["buyerName"],
6946
+ "currencies": json["currencies"] == null ? void 0 : json["currencies"],
6800
6947
  "currency": json["currency"] == null ? void 0 : json["currency"],
6801
6948
  "docNumber": json["docNumber"] == null ? void 0 : json["docNumber"],
6949
+ "docNumbers": json["docNumbers"] == null ? void 0 : json["docNumbers"],
6802
6950
  "documentId": json["documentId"] == null ? void 0 : json["documentId"],
6951
+ "documentIds": json["documentIds"] == null ? void 0 : json["documentIds"],
6803
6952
  "documentType": json["documentType"] == null ? void 0 : json["documentType"],
6953
+ "documentTypes": json["documentTypes"] == null ? void 0 : json["documentTypes"],
6804
6954
  "dueDateFrom": json["dueDateFrom"] == null ? void 0 : new Date(json["dueDateFrom"]),
6805
6955
  "dueDateTo": json["dueDateTo"] == null ? void 0 : new Date(json["dueDateTo"]),
6806
6956
  "endUserId": json["endUserId"] == null ? void 0 : json["endUserId"],
@@ -6812,6 +6962,7 @@ function RetrievalFiltersDTOFromJSONTyped(json, ignoreDiscriminator) {
6812
6962
  "totalAmountMax": json["totalAmountMax"] == null ? void 0 : json["totalAmountMax"],
6813
6963
  "totalAmountMin": json["totalAmountMin"] == null ? void 0 : json["totalAmountMin"],
6814
6964
  "vendorName": json["vendorName"] == null ? void 0 : json["vendorName"],
6965
+ "vendorNames": json["vendorNames"] == null ? void 0 : json["vendorNames"],
6815
6966
  "vendorTaxId": json["vendorTaxId"] == null ? void 0 : json["vendorTaxId"]
6816
6967
  };
6817
6968
  }
@@ -6824,10 +6975,14 @@ function RetrievalFiltersDTOToJSONTyped(value, ignoreDiscriminator = false) {
6824
6975
  }
6825
6976
  return {
6826
6977
  "buyerName": value["buyerName"],
6978
+ "currencies": value["currencies"],
6827
6979
  "currency": value["currency"],
6828
6980
  "docNumber": value["docNumber"],
6981
+ "docNumbers": value["docNumbers"],
6829
6982
  "documentId": value["documentId"],
6983
+ "documentIds": value["documentIds"],
6830
6984
  "documentType": value["documentType"],
6985
+ "documentTypes": value["documentTypes"],
6831
6986
  "dueDateFrom": value["dueDateFrom"] == null ? value["dueDateFrom"] : value["dueDateFrom"].toISOString().substring(0, 10),
6832
6987
  "dueDateTo": value["dueDateTo"] == null ? value["dueDateTo"] : value["dueDateTo"].toISOString().substring(0, 10),
6833
6988
  "endUserId": value["endUserId"],
@@ -6839,6 +6994,7 @@ function RetrievalFiltersDTOToJSONTyped(value, ignoreDiscriminator = false) {
6839
6994
  "totalAmountMax": value["totalAmountMax"],
6840
6995
  "totalAmountMin": value["totalAmountMin"],
6841
6996
  "vendorName": value["vendorName"],
6997
+ "vendorNames": value["vendorNames"],
6842
6998
  "vendorTaxId": value["vendorTaxId"]
6843
6999
  };
6844
7000
  }
@@ -6907,7 +7063,8 @@ var AggregateMetricDTOFieldEnum = {
6907
7063
  TotalAmount: "total_amount",
6908
7064
  NetAmount: "net_amount",
6909
7065
  VatAmount: "vat_amount",
6910
- MeasurableQuantity: "measurable_quantity"
7066
+ MeasurableQuantity: "measurable_quantity",
7067
+ LineTotal: "line_total"
6911
7068
  };
6912
7069
  var AggregateMetricDTOOpEnum = {
6913
7070
  Sum: "sum",
@@ -6958,7 +7115,10 @@ var RetrievalAggregateInDTOGroupByEnum = {
6958
7115
  Month: "month",
6959
7116
  Year: "year",
6960
7117
  MeasurableUom: "measurable_uom",
6961
- Description: "description"
7118
+ Description: "description",
7119
+ DocNumber: "doc_number",
7120
+ IssueDate: "issue_date",
7121
+ DocumentId: "document_id"
6962
7122
  };
6963
7123
  function instanceOfRetrievalAggregateInDTO(value) {
6964
7124
  if (!("metrics" in value) || value["metrics"] === void 0) return false;
@@ -7242,6 +7402,11 @@ function RetrievalQueryInDTOToJSONTyped(value, ignoreDiscriminator = false) {
7242
7402
  }
7243
7403
 
7244
7404
  // src/generated/models/QueryMetaDTO.ts
7405
+ var QueryMetaDTOIndexingStateEnum = {
7406
+ Preparing: "preparing",
7407
+ Ready: "ready",
7408
+ Unavailable: "unavailable"
7409
+ };
7245
7410
  function instanceOfQueryMetaDTO(value) {
7246
7411
  if (!("count" in value) || value["count"] === void 0) return false;
7247
7412
  if (!("mode" in value) || value["mode"] === void 0) return false;
@@ -7256,6 +7421,8 @@ function QueryMetaDTOFromJSONTyped(json, ignoreDiscriminator) {
7256
7421
  }
7257
7422
  return {
7258
7423
  "count": json["count"],
7424
+ "indexingReady": json["indexingReady"] == null ? void 0 : json["indexingReady"],
7425
+ "indexingState": json["indexingState"] == null ? void 0 : json["indexingState"],
7259
7426
  "limit": json["limit"] == null ? void 0 : json["limit"],
7260
7427
  "mode": json["mode"],
7261
7428
  "skip": json["skip"] == null ? void 0 : json["skip"]
@@ -7270,6 +7437,8 @@ function QueryMetaDTOToJSONTyped(value, ignoreDiscriminator = false) {
7270
7437
  }
7271
7438
  return {
7272
7439
  "count": value["count"],
7440
+ "indexingReady": value["indexingReady"],
7441
+ "indexingState": value["indexingState"],
7273
7442
  "limit": value["limit"],
7274
7443
  "mode": value["mode"],
7275
7444
  "skip": value["skip"]
@@ -7823,6 +7992,48 @@ function CheckoutOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
7823
7992
  };
7824
7993
  }
7825
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
+
7826
8037
  // src/generated/models/DataRetentionPeriodModel.ts
7827
8038
  var DataRetentionPeriodModel = {
7828
8039
  OneDay: "one_day",
@@ -9077,6 +9288,40 @@ var SubscriptionsApi = class extends BaseAPI {
9077
9288
  const response = await this.purchaseTopUpRaw(requestParameters, initOverrides);
9078
9289
  return await response.value();
9079
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
+ }
9080
9325
  /**
9081
9326
  * Creates request options for subscribe without sending the request
9082
9327
  */
@@ -9414,6 +9659,7 @@ function TemplateOutDTOFromJSONTyped(json, ignoreDiscriminator) {
9414
9659
  "error": json["error"] == null ? void 0 : json["error"],
9415
9660
  "id": json["id"],
9416
9661
  "isActive": json["isActive"] == null ? void 0 : json["isActive"],
9662
+ "isStarter": json["isStarter"] == null ? void 0 : json["isStarter"],
9417
9663
  "name": json["name"],
9418
9664
  "schema": json["schema"] == null ? void 0 : TemplateSchemaDTOOutputFromJSON(json["schema"]),
9419
9665
  "sourceFilename": json["sourceFilename"] == null ? void 0 : json["sourceFilename"],
@@ -9434,6 +9680,7 @@ function TemplateOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
9434
9680
  "error": value["error"],
9435
9681
  "id": value["id"],
9436
9682
  "isActive": value["isActive"],
9683
+ "isStarter": value["isStarter"],
9437
9684
  "name": value["name"],
9438
9685
  "schema": TemplateSchemaDTOOutputToJSON(value["schema"]),
9439
9686
  "sourceFilename": value["sourceFilename"],
@@ -10044,112 +10291,1085 @@ var TemplatesApi = class extends BaseAPI {
10044
10291
  }
10045
10292
  };
10046
10293
 
10047
- // src/generated/models/CreditMeterFilter.ts
10048
- var CreditMeterFilter = {
10049
- ProcessingCredits: "processing_credits",
10050
- FiletagCredits: "filetag_credits",
10051
- All: "all"
10294
+ // src/generated/models/CreatedWebhookEndpointOutDTO.ts
10295
+ var CreatedWebhookEndpointOutDTODisabledReasonEnum = {
10296
+ User: "user",
10297
+ Gone: "gone",
10298
+ Failing: "failing",
10299
+ AccountDeleted: "account_deleted",
10300
+ Operator: "operator"
10052
10301
  };
10053
- function instanceOfCreditMeterFilter(value) {
10054
- for (const key in CreditMeterFilter) {
10055
- if (Object.prototype.hasOwnProperty.call(CreditMeterFilter, key)) {
10056
- if (CreditMeterFilter[key] === value) {
10057
- return true;
10058
- }
10059
- }
10060
- }
10061
- return false;
10302
+ function instanceOfCreatedWebhookEndpointOutDTO(value) {
10303
+ if (!("enabled" in value) || value["enabled"] === void 0) return false;
10304
+ if (!("id" in value) || value["id"] === void 0) return false;
10305
+ if (!("notBefore" in value) || value["notBefore"] === void 0) return false;
10306
+ if (!("secret" in value) || value["secret"] === void 0) return false;
10307
+ if (!("url" in value) || value["url"] === void 0) return false;
10308
+ return true;
10062
10309
  }
10063
- function CreditMeterFilterFromJSON(json) {
10064
- return CreditMeterFilterFromJSONTyped(json, false);
10310
+ function CreatedWebhookEndpointOutDTOFromJSON(json) {
10311
+ return CreatedWebhookEndpointOutDTOFromJSONTyped(json, false);
10065
10312
  }
10066
- function CreditMeterFilterFromJSONTyped(json, ignoreDiscriminator) {
10067
- return json;
10313
+ function CreatedWebhookEndpointOutDTOFromJSONTyped(json, ignoreDiscriminator) {
10314
+ if (json == null) {
10315
+ return json;
10316
+ }
10317
+ return {
10318
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
10319
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
10320
+ "description": json["description"] == null ? void 0 : json["description"],
10321
+ "disabledAt": json["disabledAt"] == null ? void 0 : new Date(json["disabledAt"]),
10322
+ "disabledReason": json["disabledReason"] == null ? void 0 : json["disabledReason"],
10323
+ "enabled": json["enabled"],
10324
+ "failing": json["failing"] == null ? void 0 : json["failing"],
10325
+ "failingSince": json["failingSince"] == null ? void 0 : new Date(json["failingSince"]),
10326
+ "id": json["id"],
10327
+ "lastDeliveredAt": json["lastDeliveredAt"] == null ? void 0 : new Date(json["lastDeliveredAt"]),
10328
+ "lastTestSucceededAt": json["lastTestSucceededAt"] == null ? void 0 : new Date(json["lastTestSucceededAt"]),
10329
+ "notBefore": new Date(json["notBefore"]),
10330
+ "previousSecretExpiresAt": json["previousSecretExpiresAt"] == null ? void 0 : new Date(json["previousSecretExpiresAt"]),
10331
+ "secret": json["secret"],
10332
+ "url": json["url"]
10333
+ };
10068
10334
  }
10069
- function CreditMeterFilterToJSON(value) {
10070
- return value;
10335
+ function CreatedWebhookEndpointOutDTOToJSON(json) {
10336
+ return CreatedWebhookEndpointOutDTOToJSONTyped(json, false);
10071
10337
  }
10072
- function CreditMeterFilterToJSONTyped(value, ignoreDiscriminator) {
10073
- return value;
10338
+ function CreatedWebhookEndpointOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
10339
+ if (value == null) {
10340
+ return value;
10341
+ }
10342
+ return {
10343
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
10344
+ "createdAtTimestamp": value["createdAtTimestamp"],
10345
+ "description": value["description"],
10346
+ "disabledAt": value["disabledAt"] == null ? value["disabledAt"] : value["disabledAt"].toISOString(),
10347
+ "disabledReason": value["disabledReason"],
10348
+ "enabled": value["enabled"],
10349
+ "failing": value["failing"],
10350
+ "failingSince": value["failingSince"] == null ? value["failingSince"] : value["failingSince"].toISOString(),
10351
+ "id": value["id"],
10352
+ "lastDeliveredAt": value["lastDeliveredAt"] == null ? value["lastDeliveredAt"] : value["lastDeliveredAt"].toISOString(),
10353
+ "lastTestSucceededAt": value["lastTestSucceededAt"] == null ? value["lastTestSucceededAt"] : value["lastTestSucceededAt"].toISOString(),
10354
+ "notBefore": value["notBefore"].toISOString(),
10355
+ "previousSecretExpiresAt": value["previousSecretExpiresAt"] == null ? value["previousSecretExpiresAt"] : value["previousSecretExpiresAt"].toISOString(),
10356
+ "secret": value["secret"],
10357
+ "url": value["url"]
10358
+ };
10074
10359
  }
10075
10360
 
10076
- // src/generated/models/FoundationDTO.ts
10077
- function instanceOfFoundationDTO(value) {
10078
- if (!("status" in value) || value["status"] === void 0) return false;
10361
+ // src/generated/models/WebhookDeliveryResultOutDTO.ts
10362
+ function instanceOfWebhookDeliveryResultOutDTO(value) {
10363
+ if (!("attemptId" in value) || value["attemptId"] === void 0) return false;
10364
+ if (!("eventId" in value) || value["eventId"] === void 0) return false;
10079
10365
  return true;
10080
10366
  }
10081
- function FoundationDTOFromJSON(json) {
10082
- return FoundationDTOFromJSONTyped(json, false);
10367
+ function WebhookDeliveryResultOutDTOFromJSON(json) {
10368
+ return WebhookDeliveryResultOutDTOFromJSONTyped(json, false);
10083
10369
  }
10084
- function FoundationDTOFromJSONTyped(json, ignoreDiscriminator) {
10370
+ function WebhookDeliveryResultOutDTOFromJSONTyped(json, ignoreDiscriminator) {
10085
10371
  if (json == null) {
10086
10372
  return json;
10087
10373
  }
10088
10374
  return {
10375
+ "attemptId": json["attemptId"],
10089
10376
  "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
10090
10377
  "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
10091
- "data": json["data"] == null ? void 0 : json["data"],
10092
- "errors": json["errors"] == null ? void 0 : json["errors"],
10093
- "meta": json["meta"] == null ? void 0 : FoundationMetaDTOFromJSON(json["meta"]),
10378
+ "delivered": json["delivered"] == null ? void 0 : json["delivered"],
10379
+ "durationMs": json["durationMs"] == null ? void 0 : json["durationMs"],
10380
+ "error": json["error"] == null ? void 0 : json["error"],
10381
+ "eventId": json["eventId"],
10382
+ "httpStatus": json["httpStatus"] == null ? void 0 : json["httpStatus"],
10383
+ "pending": json["pending"] == null ? void 0 : json["pending"],
10384
+ "responseSnippet": json["responseSnippet"] == null ? void 0 : json["responseSnippet"],
10094
10385
  "servedAt": json["servedAt"] == null ? void 0 : new Date(json["servedAt"]),
10095
- "servedAtTimestamp": json["servedAtTimestamp"] == null ? void 0 : json["servedAtTimestamp"],
10096
- "status": ResponseStatusFromJSON(json["status"])
10386
+ "servedAtTimestamp": json["servedAtTimestamp"] == null ? void 0 : json["servedAtTimestamp"]
10097
10387
  };
10098
10388
  }
10099
- function FoundationDTOToJSON(json) {
10100
- return FoundationDTOToJSONTyped(json, false);
10389
+ function WebhookDeliveryResultOutDTOToJSON(json) {
10390
+ return WebhookDeliveryResultOutDTOToJSONTyped(json, false);
10101
10391
  }
10102
- function FoundationDTOToJSONTyped(value, ignoreDiscriminator = false) {
10392
+ function WebhookDeliveryResultOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
10103
10393
  if (value == null) {
10104
10394
  return value;
10105
10395
  }
10106
10396
  return {
10397
+ "attemptId": value["attemptId"],
10107
10398
  "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
10108
10399
  "createdAtTimestamp": value["createdAtTimestamp"],
10109
- "data": value["data"],
10110
- "errors": value["errors"],
10111
- "meta": FoundationMetaDTOToJSON(value["meta"]),
10400
+ "delivered": value["delivered"],
10401
+ "durationMs": value["durationMs"],
10402
+ "error": value["error"],
10403
+ "eventId": value["eventId"],
10404
+ "httpStatus": value["httpStatus"],
10405
+ "pending": value["pending"],
10406
+ "responseSnippet": value["responseSnippet"],
10112
10407
  "servedAt": value["servedAt"] == null ? value["servedAt"] : value["servedAt"].toISOString(),
10113
- "servedAtTimestamp": value["servedAtTimestamp"],
10114
- "status": ResponseStatusToJSON(value["status"])
10408
+ "servedAtTimestamp": value["servedAtTimestamp"]
10115
10409
  };
10116
10410
  }
10117
10411
 
10118
- // src/generated/models/LocationInner.ts
10119
- function instanceOfLocationInner(value) {
10120
- return true;
10121
- }
10122
- function LocationInnerFromJSON(json) {
10123
- return LocationInnerFromJSONTyped(json, false);
10124
- }
10125
- function LocationInnerFromJSONTyped(json, ignoreDiscriminator) {
10126
- return json;
10127
- }
10128
- function LocationInnerToJSON(json) {
10129
- return LocationInnerToJSONTyped(json, false);
10130
- }
10131
- function LocationInnerToJSONTyped(value, ignoreDiscriminator = false) {
10132
- return value;
10133
- }
10134
-
10135
- // src/generated/models/ValidationError.ts
10136
- function instanceOfValidationError(value) {
10137
- if (!("loc" in value) || value["loc"] === void 0) return false;
10138
- if (!("msg" in value) || value["msg"] === void 0) return false;
10139
- if (!("type" in value) || value["type"] === void 0) return false;
10412
+ // src/generated/models/WebhookEndpointCreateInDTO.ts
10413
+ function instanceOfWebhookEndpointCreateInDTO(value) {
10414
+ if (!("url" in value) || value["url"] === void 0) return false;
10140
10415
  return true;
10141
10416
  }
10142
- function ValidationErrorFromJSON(json) {
10143
- return ValidationErrorFromJSONTyped(json, false);
10417
+ function WebhookEndpointCreateInDTOFromJSON(json) {
10418
+ return WebhookEndpointCreateInDTOFromJSONTyped(json, false);
10144
10419
  }
10145
- function ValidationErrorFromJSONTyped(json, ignoreDiscriminator) {
10420
+ function WebhookEndpointCreateInDTOFromJSONTyped(json, ignoreDiscriminator) {
10146
10421
  if (json == null) {
10147
10422
  return json;
10148
10423
  }
10149
10424
  return {
10150
- "loc": json["loc"].map(LocationInnerFromJSON),
10151
- "msg": json["msg"],
10152
- "type": json["type"]
10425
+ "description": json["description"] == null ? void 0 : json["description"],
10426
+ "url": json["url"]
10427
+ };
10428
+ }
10429
+ function WebhookEndpointCreateInDTOToJSON(json) {
10430
+ return WebhookEndpointCreateInDTOToJSONTyped(json, false);
10431
+ }
10432
+ function WebhookEndpointCreateInDTOToJSONTyped(value, ignoreDiscriminator = false) {
10433
+ if (value == null) {
10434
+ return value;
10435
+ }
10436
+ return {
10437
+ "description": value["description"],
10438
+ "url": value["url"]
10439
+ };
10440
+ }
10441
+
10442
+ // src/generated/models/WebhookEndpointOutDTO.ts
10443
+ var WebhookEndpointOutDTODisabledReasonEnum = {
10444
+ User: "user",
10445
+ Gone: "gone",
10446
+ Failing: "failing",
10447
+ AccountDeleted: "account_deleted",
10448
+ Operator: "operator"
10449
+ };
10450
+ function instanceOfWebhookEndpointOutDTO(value) {
10451
+ if (!("enabled" in value) || value["enabled"] === void 0) return false;
10452
+ if (!("id" in value) || value["id"] === void 0) return false;
10453
+ if (!("notBefore" in value) || value["notBefore"] === void 0) return false;
10454
+ if (!("url" in value) || value["url"] === void 0) return false;
10455
+ return true;
10456
+ }
10457
+ function WebhookEndpointOutDTOFromJSON(json) {
10458
+ return WebhookEndpointOutDTOFromJSONTyped(json, false);
10459
+ }
10460
+ function WebhookEndpointOutDTOFromJSONTyped(json, ignoreDiscriminator) {
10461
+ if (json == null) {
10462
+ return json;
10463
+ }
10464
+ return {
10465
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
10466
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
10467
+ "description": json["description"] == null ? void 0 : json["description"],
10468
+ "disabledAt": json["disabledAt"] == null ? void 0 : new Date(json["disabledAt"]),
10469
+ "disabledReason": json["disabledReason"] == null ? void 0 : json["disabledReason"],
10470
+ "enabled": json["enabled"],
10471
+ "failing": json["failing"] == null ? void 0 : json["failing"],
10472
+ "failingSince": json["failingSince"] == null ? void 0 : new Date(json["failingSince"]),
10473
+ "id": json["id"],
10474
+ "lastDeliveredAt": json["lastDeliveredAt"] == null ? void 0 : new Date(json["lastDeliveredAt"]),
10475
+ "lastTestSucceededAt": json["lastTestSucceededAt"] == null ? void 0 : new Date(json["lastTestSucceededAt"]),
10476
+ "notBefore": new Date(json["notBefore"]),
10477
+ "previousSecretExpiresAt": json["previousSecretExpiresAt"] == null ? void 0 : new Date(json["previousSecretExpiresAt"]),
10478
+ "url": json["url"]
10479
+ };
10480
+ }
10481
+ function WebhookEndpointOutDTOToJSON(json) {
10482
+ return WebhookEndpointOutDTOToJSONTyped(json, false);
10483
+ }
10484
+ function WebhookEndpointOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
10485
+ if (value == null) {
10486
+ return value;
10487
+ }
10488
+ return {
10489
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
10490
+ "createdAtTimestamp": value["createdAtTimestamp"],
10491
+ "description": value["description"],
10492
+ "disabledAt": value["disabledAt"] == null ? value["disabledAt"] : value["disabledAt"].toISOString(),
10493
+ "disabledReason": value["disabledReason"],
10494
+ "enabled": value["enabled"],
10495
+ "failing": value["failing"],
10496
+ "failingSince": value["failingSince"] == null ? value["failingSince"] : value["failingSince"].toISOString(),
10497
+ "id": value["id"],
10498
+ "lastDeliveredAt": value["lastDeliveredAt"] == null ? value["lastDeliveredAt"] : value["lastDeliveredAt"].toISOString(),
10499
+ "lastTestSucceededAt": value["lastTestSucceededAt"] == null ? value["lastTestSucceededAt"] : value["lastTestSucceededAt"].toISOString(),
10500
+ "notBefore": value["notBefore"].toISOString(),
10501
+ "previousSecretExpiresAt": value["previousSecretExpiresAt"] == null ? value["previousSecretExpiresAt"] : value["previousSecretExpiresAt"].toISOString(),
10502
+ "url": value["url"]
10503
+ };
10504
+ }
10505
+
10506
+ // src/generated/models/WebhookEndpointListOutDTO.ts
10507
+ function instanceOfWebhookEndpointListOutDTO(value) {
10508
+ if (!("count" in value) || value["count"] === void 0) return false;
10509
+ if (!("endpoints" in value) || value["endpoints"] === void 0) return false;
10510
+ return true;
10511
+ }
10512
+ function WebhookEndpointListOutDTOFromJSON(json) {
10513
+ return WebhookEndpointListOutDTOFromJSONTyped(json, false);
10514
+ }
10515
+ function WebhookEndpointListOutDTOFromJSONTyped(json, ignoreDiscriminator) {
10516
+ if (json == null) {
10517
+ return json;
10518
+ }
10519
+ return {
10520
+ "count": json["count"],
10521
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
10522
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
10523
+ "endpoints": json["endpoints"].map(WebhookEndpointOutDTOFromJSON),
10524
+ "servedAt": json["servedAt"] == null ? void 0 : new Date(json["servedAt"]),
10525
+ "servedAtTimestamp": json["servedAtTimestamp"] == null ? void 0 : json["servedAtTimestamp"]
10526
+ };
10527
+ }
10528
+ function WebhookEndpointListOutDTOToJSON(json) {
10529
+ return WebhookEndpointListOutDTOToJSONTyped(json, false);
10530
+ }
10531
+ function WebhookEndpointListOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
10532
+ if (value == null) {
10533
+ return value;
10534
+ }
10535
+ return {
10536
+ "count": value["count"],
10537
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
10538
+ "createdAtTimestamp": value["createdAtTimestamp"],
10539
+ "endpoints": value["endpoints"].map(WebhookEndpointOutDTOToJSON),
10540
+ "servedAt": value["servedAt"] == null ? value["servedAt"] : value["servedAt"].toISOString(),
10541
+ "servedAtTimestamp": value["servedAtTimestamp"]
10542
+ };
10543
+ }
10544
+
10545
+ // src/generated/models/WebhookEndpointUpdateInDTO.ts
10546
+ function instanceOfWebhookEndpointUpdateInDTO(value) {
10547
+ return true;
10548
+ }
10549
+ function WebhookEndpointUpdateInDTOFromJSON(json) {
10550
+ return WebhookEndpointUpdateInDTOFromJSONTyped(json, false);
10551
+ }
10552
+ function WebhookEndpointUpdateInDTOFromJSONTyped(json, ignoreDiscriminator) {
10553
+ if (json == null) {
10554
+ return json;
10555
+ }
10556
+ return {
10557
+ "description": json["description"] == null ? void 0 : json["description"],
10558
+ "enabled": json["enabled"] == null ? void 0 : json["enabled"],
10559
+ "url": json["url"] == null ? void 0 : json["url"]
10560
+ };
10561
+ }
10562
+ function WebhookEndpointUpdateInDTOToJSON(json) {
10563
+ return WebhookEndpointUpdateInDTOToJSONTyped(json, false);
10564
+ }
10565
+ function WebhookEndpointUpdateInDTOToJSONTyped(value, ignoreDiscriminator = false) {
10566
+ if (value == null) {
10567
+ return value;
10568
+ }
10569
+ return {
10570
+ "description": value["description"],
10571
+ "enabled": value["enabled"],
10572
+ "url": value["url"]
10573
+ };
10574
+ }
10575
+
10576
+ // src/generated/models/WebhookAttemptOutDTO.ts
10577
+ function instanceOfWebhookAttemptOutDTO(value) {
10578
+ if (!("attemptNumber" in value) || value["attemptNumber"] === void 0) return false;
10579
+ if (!("attemptedAt" in value) || value["attemptedAt"] === void 0) return false;
10580
+ if (!("durationMs" in value) || value["durationMs"] === void 0) return false;
10581
+ if (!("id" in value) || value["id"] === void 0) return false;
10582
+ return true;
10583
+ }
10584
+ function WebhookAttemptOutDTOFromJSON(json) {
10585
+ return WebhookAttemptOutDTOFromJSONTyped(json, false);
10586
+ }
10587
+ function WebhookAttemptOutDTOFromJSONTyped(json, ignoreDiscriminator) {
10588
+ if (json == null) {
10589
+ return json;
10590
+ }
10591
+ return {
10592
+ "attemptNumber": json["attemptNumber"],
10593
+ "attemptedAt": new Date(json["attemptedAt"]),
10594
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
10595
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
10596
+ "durationMs": json["durationMs"],
10597
+ "error": json["error"] == null ? void 0 : json["error"],
10598
+ "httpStatus": json["httpStatus"] == null ? void 0 : json["httpStatus"],
10599
+ "id": json["id"],
10600
+ "responseSnippet": json["responseSnippet"] == null ? void 0 : json["responseSnippet"]
10601
+ };
10602
+ }
10603
+ function WebhookAttemptOutDTOToJSON(json) {
10604
+ return WebhookAttemptOutDTOToJSONTyped(json, false);
10605
+ }
10606
+ function WebhookAttemptOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
10607
+ if (value == null) {
10608
+ return value;
10609
+ }
10610
+ return {
10611
+ "attemptNumber": value["attemptNumber"],
10612
+ "attemptedAt": value["attemptedAt"].toISOString(),
10613
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
10614
+ "createdAtTimestamp": value["createdAtTimestamp"],
10615
+ "durationMs": value["durationMs"],
10616
+ "error": value["error"],
10617
+ "httpStatus": value["httpStatus"],
10618
+ "id": value["id"],
10619
+ "responseSnippet": value["responseSnippet"]
10620
+ };
10621
+ }
10622
+
10623
+ // src/generated/models/WebhookEventOutDTO.ts
10624
+ var WebhookEventOutDTOFailureReasonEnum = {
10625
+ EndpointDisabled: "endpoint_disabled",
10626
+ RetriesExhausted: "retries_exhausted",
10627
+ Failed: "failed",
10628
+ Gone: "gone",
10629
+ NotFinal: "not_final",
10630
+ Unavailable: "unavailable",
10631
+ Superseded: "superseded"
10632
+ };
10633
+ var WebhookEventOutDTOStatusEnum = {
10634
+ Pending: "pending",
10635
+ Delivered: "delivered",
10636
+ Failed: "failed",
10637
+ Superseded: "superseded"
10638
+ };
10639
+ var WebhookEventOutDTOTypeEnum = {
10640
+ ExtractionCompleted: "extraction.completed",
10641
+ WebhookTest: "webhook.test"
10642
+ };
10643
+ function instanceOfWebhookEventOutDTO(value) {
10644
+ if (!("attemptCount" in value) || value["attemptCount"] === void 0) return false;
10645
+ if (!("endpointId" in value) || value["endpointId"] === void 0) return false;
10646
+ if (!("id" in value) || value["id"] === void 0) return false;
10647
+ if (!("manual" in value) || value["manual"] === void 0) return false;
10648
+ if (!("occurredAt" in value) || value["occurredAt"] === void 0) return false;
10649
+ if (!("status" in value) || value["status"] === void 0) return false;
10650
+ if (!("type" in value) || value["type"] === void 0) return false;
10651
+ if (!("webhookId" in value) || value["webhookId"] === void 0) return false;
10652
+ return true;
10653
+ }
10654
+ function WebhookEventOutDTOFromJSON(json) {
10655
+ return WebhookEventOutDTOFromJSONTyped(json, false);
10656
+ }
10657
+ function WebhookEventOutDTOFromJSONTyped(json, ignoreDiscriminator) {
10658
+ if (json == null) {
10659
+ return json;
10660
+ }
10661
+ return {
10662
+ "attemptCount": json["attemptCount"],
10663
+ "attempts": json["attempts"] == null ? void 0 : json["attempts"].map(WebhookAttemptOutDTOFromJSON),
10664
+ "correlationId": json["correlationId"] == null ? void 0 : json["correlationId"],
10665
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
10666
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
10667
+ "deliveredAt": json["deliveredAt"] == null ? void 0 : new Date(json["deliveredAt"]),
10668
+ "documentId": json["documentId"] == null ? void 0 : json["documentId"],
10669
+ "endpointId": json["endpointId"],
10670
+ "externalId": json["externalId"] == null ? void 0 : json["externalId"],
10671
+ "failureReason": json["failureReason"] == null ? void 0 : json["failureReason"],
10672
+ "id": json["id"],
10673
+ "manual": json["manual"],
10674
+ "nextAttemptAt": json["nextAttemptAt"] == null ? void 0 : new Date(json["nextAttemptAt"]),
10675
+ "occurredAt": new Date(json["occurredAt"]),
10676
+ "outcome": json["outcome"] == null ? void 0 : json["outcome"],
10677
+ "status": json["status"],
10678
+ "type": json["type"],
10679
+ "webhookId": json["webhookId"]
10680
+ };
10681
+ }
10682
+ function WebhookEventOutDTOToJSON(json) {
10683
+ return WebhookEventOutDTOToJSONTyped(json, false);
10684
+ }
10685
+ function WebhookEventOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
10686
+ if (value == null) {
10687
+ return value;
10688
+ }
10689
+ return {
10690
+ "attemptCount": value["attemptCount"],
10691
+ "attempts": value["attempts"] == null ? void 0 : value["attempts"].map(WebhookAttemptOutDTOToJSON),
10692
+ "correlationId": value["correlationId"],
10693
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
10694
+ "createdAtTimestamp": value["createdAtTimestamp"],
10695
+ "deliveredAt": value["deliveredAt"] == null ? value["deliveredAt"] : value["deliveredAt"].toISOString(),
10696
+ "documentId": value["documentId"],
10697
+ "endpointId": value["endpointId"],
10698
+ "externalId": value["externalId"],
10699
+ "failureReason": value["failureReason"],
10700
+ "id": value["id"],
10701
+ "manual": value["manual"],
10702
+ "nextAttemptAt": value["nextAttemptAt"] == null ? value["nextAttemptAt"] : value["nextAttemptAt"].toISOString(),
10703
+ "occurredAt": value["occurredAt"].toISOString(),
10704
+ "outcome": value["outcome"],
10705
+ "status": value["status"],
10706
+ "type": value["type"],
10707
+ "webhookId": value["webhookId"]
10708
+ };
10709
+ }
10710
+
10711
+ // src/generated/models/WebhookEventListOutDTO.ts
10712
+ function instanceOfWebhookEventListOutDTO(value) {
10713
+ if (!("count" in value) || value["count"] === void 0) return false;
10714
+ if (!("events" in value) || value["events"] === void 0) return false;
10715
+ return true;
10716
+ }
10717
+ function WebhookEventListOutDTOFromJSON(json) {
10718
+ return WebhookEventListOutDTOFromJSONTyped(json, false);
10719
+ }
10720
+ function WebhookEventListOutDTOFromJSONTyped(json, ignoreDiscriminator) {
10721
+ if (json == null) {
10722
+ return json;
10723
+ }
10724
+ return {
10725
+ "count": json["count"],
10726
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
10727
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
10728
+ "events": json["events"].map(WebhookEventOutDTOFromJSON),
10729
+ "hasMore": json["hasMore"] == null ? void 0 : json["hasMore"],
10730
+ "nextCreatedBefore": json["nextCreatedBefore"] == null ? void 0 : json["nextCreatedBefore"],
10731
+ "servedAt": json["servedAt"] == null ? void 0 : new Date(json["servedAt"]),
10732
+ "servedAtTimestamp": json["servedAtTimestamp"] == null ? void 0 : json["servedAtTimestamp"]
10733
+ };
10734
+ }
10735
+ function WebhookEventListOutDTOToJSON(json) {
10736
+ return WebhookEventListOutDTOToJSONTyped(json, false);
10737
+ }
10738
+ function WebhookEventListOutDTOToJSONTyped(value, ignoreDiscriminator = false) {
10739
+ if (value == null) {
10740
+ return value;
10741
+ }
10742
+ return {
10743
+ "count": value["count"],
10744
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
10745
+ "createdAtTimestamp": value["createdAtTimestamp"],
10746
+ "events": value["events"].map(WebhookEventOutDTOToJSON),
10747
+ "hasMore": value["hasMore"],
10748
+ "nextCreatedBefore": value["nextCreatedBefore"],
10749
+ "servedAt": value["servedAt"] == null ? value["servedAt"] : value["servedAt"].toISOString(),
10750
+ "servedAtTimestamp": value["servedAtTimestamp"]
10751
+ };
10752
+ }
10753
+
10754
+ // src/generated/apis/WebhooksApi.ts
10755
+ var WebhooksApi = class extends BaseAPI {
10756
+ /**
10757
+ * Creates request options for createWebhookEndpoint without sending the request
10758
+ */
10759
+ async createWebhookEndpointRequestOpts(requestParameters) {
10760
+ if (requestParameters["webhookEndpointCreateInDTO"] == null) {
10761
+ throw new RequiredError(
10762
+ "webhookEndpointCreateInDTO",
10763
+ 'Required parameter "webhookEndpointCreateInDTO" was null or undefined when calling createWebhookEndpoint().'
10764
+ );
10765
+ }
10766
+ const queryParameters = {};
10767
+ const headerParameters = {};
10768
+ headerParameters["Content-Type"] = "application/json";
10769
+ if (this.configuration && this.configuration.accessToken) {
10770
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
10771
+ }
10772
+ let urlPath = `/api/v1/webhooks/endpoints`;
10773
+ return {
10774
+ path: urlPath,
10775
+ method: "POST",
10776
+ headers: headerParameters,
10777
+ query: queryParameters,
10778
+ body: WebhookEndpointCreateInDTOToJSON(requestParameters["webhookEndpointCreateInDTO"])
10779
+ };
10780
+ }
10781
+ /**
10782
+ * Register the account\'s webhook endpoint. The signing secret is returned once, here.
10783
+ * Create Webhook Endpoint
10784
+ */
10785
+ async createWebhookEndpointRaw(requestParameters, initOverrides) {
10786
+ const requestOptions = await this.createWebhookEndpointRequestOpts(requestParameters);
10787
+ const response = await this.request(requestOptions, initOverrides);
10788
+ return new JSONApiResponse(response, (jsonValue) => CreatedWebhookEndpointOutDTOFromJSON(jsonValue));
10789
+ }
10790
+ /**
10791
+ * Register the account\'s webhook endpoint. The signing secret is returned once, here.
10792
+ * Create Webhook Endpoint
10793
+ */
10794
+ async createWebhookEndpoint(requestParameters, initOverrides) {
10795
+ const response = await this.createWebhookEndpointRaw(requestParameters, initOverrides);
10796
+ return await response.value();
10797
+ }
10798
+ /**
10799
+ * Creates request options for deleteWebhookEndpoint without sending the request
10800
+ */
10801
+ async deleteWebhookEndpointRequestOpts(requestParameters) {
10802
+ if (requestParameters["endpointId"] == null) {
10803
+ throw new RequiredError(
10804
+ "endpointId",
10805
+ 'Required parameter "endpointId" was null or undefined when calling deleteWebhookEndpoint().'
10806
+ );
10807
+ }
10808
+ const queryParameters = {};
10809
+ const headerParameters = {};
10810
+ if (this.configuration && this.configuration.accessToken) {
10811
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
10812
+ }
10813
+ let urlPath = `/api/v1/webhooks/endpoints/{endpoint_id}`;
10814
+ urlPath = urlPath.replace("{endpoint_id}", encodeURIComponent(String(requestParameters["endpointId"])));
10815
+ return {
10816
+ path: urlPath,
10817
+ method: "DELETE",
10818
+ headers: headerParameters,
10819
+ query: queryParameters
10820
+ };
10821
+ }
10822
+ /**
10823
+ * Delete the endpoint. Its pending events are failed and nothing more is sent.
10824
+ * Delete Webhook Endpoint
10825
+ */
10826
+ async deleteWebhookEndpointRaw(requestParameters, initOverrides) {
10827
+ const requestOptions = await this.deleteWebhookEndpointRequestOpts(requestParameters);
10828
+ const response = await this.request(requestOptions, initOverrides);
10829
+ return new VoidApiResponse(response);
10830
+ }
10831
+ /**
10832
+ * Delete the endpoint. Its pending events are failed and nothing more is sent.
10833
+ * Delete Webhook Endpoint
10834
+ */
10835
+ async deleteWebhookEndpoint(requestParameters, initOverrides) {
10836
+ await this.deleteWebhookEndpointRaw(requestParameters, initOverrides);
10837
+ }
10838
+ /**
10839
+ * Creates request options for getWebhookEndpoint without sending the request
10840
+ */
10841
+ async getWebhookEndpointRequestOpts(requestParameters) {
10842
+ if (requestParameters["endpointId"] == null) {
10843
+ throw new RequiredError(
10844
+ "endpointId",
10845
+ 'Required parameter "endpointId" was null or undefined when calling getWebhookEndpoint().'
10846
+ );
10847
+ }
10848
+ const queryParameters = {};
10849
+ const headerParameters = {};
10850
+ if (this.configuration && this.configuration.accessToken) {
10851
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
10852
+ }
10853
+ let urlPath = `/api/v1/webhooks/endpoints/{endpoint_id}`;
10854
+ urlPath = urlPath.replace("{endpoint_id}", encodeURIComponent(String(requestParameters["endpointId"])));
10855
+ return {
10856
+ path: urlPath,
10857
+ method: "GET",
10858
+ headers: headerParameters,
10859
+ query: queryParameters
10860
+ };
10861
+ }
10862
+ /**
10863
+ * One webhook endpoint. The signing secret is never returned here.
10864
+ * Get Webhook Endpoint
10865
+ */
10866
+ async getWebhookEndpointRaw(requestParameters, initOverrides) {
10867
+ const requestOptions = await this.getWebhookEndpointRequestOpts(requestParameters);
10868
+ const response = await this.request(requestOptions, initOverrides);
10869
+ return new JSONApiResponse(response, (jsonValue) => WebhookEndpointOutDTOFromJSON(jsonValue));
10870
+ }
10871
+ /**
10872
+ * One webhook endpoint. The signing secret is never returned here.
10873
+ * Get Webhook Endpoint
10874
+ */
10875
+ async getWebhookEndpoint(requestParameters, initOverrides) {
10876
+ const response = await this.getWebhookEndpointRaw(requestParameters, initOverrides);
10877
+ return await response.value();
10878
+ }
10879
+ /**
10880
+ * Creates request options for getWebhookEvent without sending the request
10881
+ */
10882
+ async getWebhookEventRequestOpts(requestParameters) {
10883
+ if (requestParameters["eventId"] == null) {
10884
+ throw new RequiredError(
10885
+ "eventId",
10886
+ 'Required parameter "eventId" was null or undefined when calling getWebhookEvent().'
10887
+ );
10888
+ }
10889
+ const queryParameters = {};
10890
+ const headerParameters = {};
10891
+ if (this.configuration && this.configuration.accessToken) {
10892
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
10893
+ }
10894
+ let urlPath = `/api/v1/webhooks/events/{event_id}`;
10895
+ urlPath = urlPath.replace("{event_id}", encodeURIComponent(String(requestParameters["eventId"])));
10896
+ return {
10897
+ path: urlPath,
10898
+ method: "GET",
10899
+ headers: headerParameters,
10900
+ query: queryParameters
10901
+ };
10902
+ }
10903
+ /**
10904
+ * One event with its delivery attempts. Use it to follow a test or a resend that was still pending.
10905
+ * Get Webhook Event
10906
+ */
10907
+ async getWebhookEventRaw(requestParameters, initOverrides) {
10908
+ const requestOptions = await this.getWebhookEventRequestOpts(requestParameters);
10909
+ const response = await this.request(requestOptions, initOverrides);
10910
+ return new JSONApiResponse(response, (jsonValue) => WebhookEventOutDTOFromJSON(jsonValue));
10911
+ }
10912
+ /**
10913
+ * One event with its delivery attempts. Use it to follow a test or a resend that was still pending.
10914
+ * Get Webhook Event
10915
+ */
10916
+ async getWebhookEvent(requestParameters, initOverrides) {
10917
+ const response = await this.getWebhookEventRaw(requestParameters, initOverrides);
10918
+ return await response.value();
10919
+ }
10920
+ /**
10921
+ * Creates request options for listWebhookEndpoints without sending the request
10922
+ */
10923
+ async listWebhookEndpointsRequestOpts() {
10924
+ const queryParameters = {};
10925
+ const headerParameters = {};
10926
+ if (this.configuration && this.configuration.accessToken) {
10927
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
10928
+ }
10929
+ let urlPath = `/api/v1/webhooks/endpoints`;
10930
+ return {
10931
+ path: urlPath,
10932
+ method: "GET",
10933
+ headers: headerParameters,
10934
+ query: queryParameters
10935
+ };
10936
+ }
10937
+ /**
10938
+ * The account\'s webhook endpoint, as a list (an account has at most one).
10939
+ * List Webhook Endpoints
10940
+ */
10941
+ async listWebhookEndpointsRaw(initOverrides) {
10942
+ const requestOptions = await this.listWebhookEndpointsRequestOpts();
10943
+ const response = await this.request(requestOptions, initOverrides);
10944
+ return new JSONApiResponse(response, (jsonValue) => WebhookEndpointListOutDTOFromJSON(jsonValue));
10945
+ }
10946
+ /**
10947
+ * The account\'s webhook endpoint, as a list (an account has at most one).
10948
+ * List Webhook Endpoints
10949
+ */
10950
+ async listWebhookEndpoints(initOverrides) {
10951
+ const response = await this.listWebhookEndpointsRaw(initOverrides);
10952
+ return await response.value();
10953
+ }
10954
+ /**
10955
+ * Creates request options for listWebhookEvents without sending the request
10956
+ */
10957
+ async listWebhookEventsRequestOpts(requestParameters) {
10958
+ const queryParameters = {};
10959
+ if (requestParameters["status"] != null) {
10960
+ queryParameters["status"] = requestParameters["status"];
10961
+ }
10962
+ if (requestParameters["skip"] != null) {
10963
+ queryParameters["skip"] = requestParameters["skip"];
10964
+ }
10965
+ if (requestParameters["limit"] != null) {
10966
+ queryParameters["limit"] = requestParameters["limit"];
10967
+ }
10968
+ if (requestParameters["createdBefore"] != null) {
10969
+ queryParameters["createdBefore"] = requestParameters["createdBefore"];
10970
+ }
10971
+ const headerParameters = {};
10972
+ if (this.configuration && this.configuration.accessToken) {
10973
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
10974
+ }
10975
+ let urlPath = `/api/v1/webhooks/events`;
10976
+ return {
10977
+ path: urlPath,
10978
+ method: "GET",
10979
+ headers: headerParameters,
10980
+ query: queryParameters
10981
+ };
10982
+ }
10983
+ /**
10984
+ * Events of the last 30 days, newest first, each with its delivery attempts. `count` is the size of this page; `hasMore` says whether another follows. `skip` stops at 100,000; `createdBefore` reaches every event.
10985
+ * List Webhook Events
10986
+ */
10987
+ async listWebhookEventsRaw(requestParameters, initOverrides) {
10988
+ const requestOptions = await this.listWebhookEventsRequestOpts(requestParameters);
10989
+ const response = await this.request(requestOptions, initOverrides);
10990
+ return new JSONApiResponse(response, (jsonValue) => WebhookEventListOutDTOFromJSON(jsonValue));
10991
+ }
10992
+ /**
10993
+ * Events of the last 30 days, newest first, each with its delivery attempts. `count` is the size of this page; `hasMore` says whether another follows. `skip` stops at 100,000; `createdBefore` reaches every event.
10994
+ * List Webhook Events
10995
+ */
10996
+ async listWebhookEvents(requestParameters = {}, initOverrides) {
10997
+ const response = await this.listWebhookEventsRaw(requestParameters, initOverrides);
10998
+ return await response.value();
10999
+ }
11000
+ /**
11001
+ * Creates request options for resendWebhookEvent without sending the request
11002
+ */
11003
+ async resendWebhookEventRequestOpts(requestParameters) {
11004
+ if (requestParameters["eventId"] == null) {
11005
+ throw new RequiredError(
11006
+ "eventId",
11007
+ 'Required parameter "eventId" was null or undefined when calling resendWebhookEvent().'
11008
+ );
11009
+ }
11010
+ const queryParameters = {};
11011
+ const headerParameters = {};
11012
+ if (this.configuration && this.configuration.accessToken) {
11013
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
11014
+ }
11015
+ let urlPath = `/api/v1/webhooks/events/{event_id}/resend`;
11016
+ urlPath = urlPath.replace("{event_id}", encodeURIComponent(String(requestParameters["eventId"])));
11017
+ return {
11018
+ path: urlPath,
11019
+ method: "POST",
11020
+ headers: headerParameters,
11021
+ query: queryParameters
11022
+ };
11023
+ }
11024
+ /**
11025
+ * Deliver a finished event once more and wait up to 20 seconds for the endpoint\'s answer. `pending: true` means the outcome is not known yet: read the event by `eventId` and look for the attempt whose id is `attemptId`.
11026
+ * Resend Webhook Event
11027
+ */
11028
+ async resendWebhookEventRaw(requestParameters, initOverrides) {
11029
+ const requestOptions = await this.resendWebhookEventRequestOpts(requestParameters);
11030
+ const response = await this.request(requestOptions, initOverrides);
11031
+ return new JSONApiResponse(response, (jsonValue) => WebhookDeliveryResultOutDTOFromJSON(jsonValue));
11032
+ }
11033
+ /**
11034
+ * Deliver a finished event once more and wait up to 20 seconds for the endpoint\'s answer. `pending: true` means the outcome is not known yet: read the event by `eventId` and look for the attempt whose id is `attemptId`.
11035
+ * Resend Webhook Event
11036
+ */
11037
+ async resendWebhookEvent(requestParameters, initOverrides) {
11038
+ const response = await this.resendWebhookEventRaw(requestParameters, initOverrides);
11039
+ return await response.value();
11040
+ }
11041
+ /**
11042
+ * Creates request options for rotateWebhookEndpointSecret without sending the request
11043
+ */
11044
+ async rotateWebhookEndpointSecretRequestOpts(requestParameters) {
11045
+ if (requestParameters["endpointId"] == null) {
11046
+ throw new RequiredError(
11047
+ "endpointId",
11048
+ 'Required parameter "endpointId" was null or undefined when calling rotateWebhookEndpointSecret().'
11049
+ );
11050
+ }
11051
+ const queryParameters = {};
11052
+ const headerParameters = {};
11053
+ if (this.configuration && this.configuration.accessToken) {
11054
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
11055
+ }
11056
+ let urlPath = `/api/v1/webhooks/endpoints/{endpoint_id}/rotate-secret`;
11057
+ urlPath = urlPath.replace("{endpoint_id}", encodeURIComponent(String(requestParameters["endpointId"])));
11058
+ return {
11059
+ path: urlPath,
11060
+ method: "POST",
11061
+ headers: headerParameters,
11062
+ query: queryParameters
11063
+ };
11064
+ }
11065
+ /**
11066
+ * Issue a new signing secret. For 24 hours each delivery is signed with both the old and the new one; a second rotation is refused until then.
11067
+ * Rotate Webhook Endpoint Secret
11068
+ */
11069
+ async rotateWebhookEndpointSecretRaw(requestParameters, initOverrides) {
11070
+ const requestOptions = await this.rotateWebhookEndpointSecretRequestOpts(requestParameters);
11071
+ const response = await this.request(requestOptions, initOverrides);
11072
+ return new JSONApiResponse(response, (jsonValue) => CreatedWebhookEndpointOutDTOFromJSON(jsonValue));
11073
+ }
11074
+ /**
11075
+ * Issue a new signing secret. For 24 hours each delivery is signed with both the old and the new one; a second rotation is refused until then.
11076
+ * Rotate Webhook Endpoint Secret
11077
+ */
11078
+ async rotateWebhookEndpointSecret(requestParameters, initOverrides) {
11079
+ const response = await this.rotateWebhookEndpointSecretRaw(requestParameters, initOverrides);
11080
+ return await response.value();
11081
+ }
11082
+ /**
11083
+ * Creates request options for sendWebhookTestEvent without sending the request
11084
+ */
11085
+ async sendWebhookTestEventRequestOpts(requestParameters) {
11086
+ if (requestParameters["endpointId"] == null) {
11087
+ throw new RequiredError(
11088
+ "endpointId",
11089
+ 'Required parameter "endpointId" was null or undefined when calling sendWebhookTestEvent().'
11090
+ );
11091
+ }
11092
+ const queryParameters = {};
11093
+ const headerParameters = {};
11094
+ if (this.configuration && this.configuration.accessToken) {
11095
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
11096
+ }
11097
+ let urlPath = `/api/v1/webhooks/endpoints/{endpoint_id}/test`;
11098
+ urlPath = urlPath.replace("{endpoint_id}", encodeURIComponent(String(requestParameters["endpointId"])));
11099
+ return {
11100
+ path: urlPath,
11101
+ method: "POST",
11102
+ headers: headerParameters,
11103
+ query: queryParameters
11104
+ };
11105
+ }
11106
+ /**
11107
+ * Send one `webhook.test` event and wait up to 20 seconds for the endpoint\'s answer. Not retried. `pending: true` means the outcome is not known yet: read the event by `eventId` and look for the attempt whose id is `attemptId`.
11108
+ * Send Webhook Test Event
11109
+ */
11110
+ async sendWebhookTestEventRaw(requestParameters, initOverrides) {
11111
+ const requestOptions = await this.sendWebhookTestEventRequestOpts(requestParameters);
11112
+ const response = await this.request(requestOptions, initOverrides);
11113
+ return new JSONApiResponse(response, (jsonValue) => WebhookDeliveryResultOutDTOFromJSON(jsonValue));
11114
+ }
11115
+ /**
11116
+ * Send one `webhook.test` event and wait up to 20 seconds for the endpoint\'s answer. Not retried. `pending: true` means the outcome is not known yet: read the event by `eventId` and look for the attempt whose id is `attemptId`.
11117
+ * Send Webhook Test Event
11118
+ */
11119
+ async sendWebhookTestEvent(requestParameters, initOverrides) {
11120
+ const response = await this.sendWebhookTestEventRaw(requestParameters, initOverrides);
11121
+ return await response.value();
11122
+ }
11123
+ /**
11124
+ * Creates request options for updateWebhookEndpoint without sending the request
11125
+ */
11126
+ async updateWebhookEndpointRequestOpts(requestParameters) {
11127
+ if (requestParameters["endpointId"] == null) {
11128
+ throw new RequiredError(
11129
+ "endpointId",
11130
+ 'Required parameter "endpointId" was null or undefined when calling updateWebhookEndpoint().'
11131
+ );
11132
+ }
11133
+ if (requestParameters["webhookEndpointUpdateInDTO"] == null) {
11134
+ throw new RequiredError(
11135
+ "webhookEndpointUpdateInDTO",
11136
+ 'Required parameter "webhookEndpointUpdateInDTO" was null or undefined when calling updateWebhookEndpoint().'
11137
+ );
11138
+ }
11139
+ const queryParameters = {};
11140
+ const headerParameters = {};
11141
+ headerParameters["Content-Type"] = "application/json";
11142
+ if (this.configuration && this.configuration.accessToken) {
11143
+ headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2PasswordBearer", []);
11144
+ }
11145
+ let urlPath = `/api/v1/webhooks/endpoints/{endpoint_id}`;
11146
+ urlPath = urlPath.replace("{endpoint_id}", encodeURIComponent(String(requestParameters["endpointId"])));
11147
+ return {
11148
+ path: urlPath,
11149
+ method: "PATCH",
11150
+ headers: headerParameters,
11151
+ query: queryParameters,
11152
+ body: WebhookEndpointUpdateInDTOToJSON(requestParameters["webhookEndpointUpdateInDTO"])
11153
+ };
11154
+ }
11155
+ /**
11156
+ * Change the URL or description, or enable or disable the endpoint.
11157
+ * Update Webhook Endpoint
11158
+ */
11159
+ async updateWebhookEndpointRaw(requestParameters, initOverrides) {
11160
+ const requestOptions = await this.updateWebhookEndpointRequestOpts(requestParameters);
11161
+ const response = await this.request(requestOptions, initOverrides);
11162
+ return new JSONApiResponse(response, (jsonValue) => WebhookEndpointOutDTOFromJSON(jsonValue));
11163
+ }
11164
+ /**
11165
+ * Change the URL or description, or enable or disable the endpoint.
11166
+ * Update Webhook Endpoint
11167
+ */
11168
+ async updateWebhookEndpoint(requestParameters, initOverrides) {
11169
+ const response = await this.updateWebhookEndpointRaw(requestParameters, initOverrides);
11170
+ return await response.value();
11171
+ }
11172
+ };
11173
+ var ListWebhookEventsStatusEnum = {
11174
+ Pending: "pending",
11175
+ Delivered: "delivered",
11176
+ Failed: "failed",
11177
+ Superseded: "superseded"
11178
+ };
11179
+
11180
+ // src/generated/models/CreditMeterFilter.ts
11181
+ var CreditMeterFilter = {
11182
+ ProcessingCredits: "processing_credits",
11183
+ FiletagCredits: "filetag_credits",
11184
+ All: "all"
11185
+ };
11186
+ function instanceOfCreditMeterFilter(value) {
11187
+ for (const key in CreditMeterFilter) {
11188
+ if (Object.prototype.hasOwnProperty.call(CreditMeterFilter, key)) {
11189
+ if (CreditMeterFilter[key] === value) {
11190
+ return true;
11191
+ }
11192
+ }
11193
+ }
11194
+ return false;
11195
+ }
11196
+ function CreditMeterFilterFromJSON(json) {
11197
+ return CreditMeterFilterFromJSONTyped(json, false);
11198
+ }
11199
+ function CreditMeterFilterFromJSONTyped(json, ignoreDiscriminator) {
11200
+ return json;
11201
+ }
11202
+ function CreditMeterFilterToJSON(value) {
11203
+ return value;
11204
+ }
11205
+ function CreditMeterFilterToJSONTyped(value, ignoreDiscriminator) {
11206
+ return value;
11207
+ }
11208
+
11209
+ // src/generated/models/FoundationDTO.ts
11210
+ function instanceOfFoundationDTO(value) {
11211
+ if (!("status" in value) || value["status"] === void 0) return false;
11212
+ return true;
11213
+ }
11214
+ function FoundationDTOFromJSON(json) {
11215
+ return FoundationDTOFromJSONTyped(json, false);
11216
+ }
11217
+ function FoundationDTOFromJSONTyped(json, ignoreDiscriminator) {
11218
+ if (json == null) {
11219
+ return json;
11220
+ }
11221
+ return {
11222
+ "createdAt": json["createdAt"] == null ? void 0 : new Date(json["createdAt"]),
11223
+ "createdAtTimestamp": json["createdAtTimestamp"] == null ? void 0 : json["createdAtTimestamp"],
11224
+ "data": json["data"] == null ? void 0 : json["data"],
11225
+ "errors": json["errors"] == null ? void 0 : json["errors"],
11226
+ "meta": json["meta"] == null ? void 0 : FoundationMetaDTOFromJSON(json["meta"]),
11227
+ "servedAt": json["servedAt"] == null ? void 0 : new Date(json["servedAt"]),
11228
+ "servedAtTimestamp": json["servedAtTimestamp"] == null ? void 0 : json["servedAtTimestamp"],
11229
+ "status": ResponseStatusFromJSON(json["status"])
11230
+ };
11231
+ }
11232
+ function FoundationDTOToJSON(json) {
11233
+ return FoundationDTOToJSONTyped(json, false);
11234
+ }
11235
+ function FoundationDTOToJSONTyped(value, ignoreDiscriminator = false) {
11236
+ if (value == null) {
11237
+ return value;
11238
+ }
11239
+ return {
11240
+ "createdAt": value["createdAt"] == null ? value["createdAt"] : value["createdAt"].toISOString(),
11241
+ "createdAtTimestamp": value["createdAtTimestamp"],
11242
+ "data": value["data"],
11243
+ "errors": value["errors"],
11244
+ "meta": FoundationMetaDTOToJSON(value["meta"]),
11245
+ "servedAt": value["servedAt"] == null ? value["servedAt"] : value["servedAt"].toISOString(),
11246
+ "servedAtTimestamp": value["servedAtTimestamp"],
11247
+ "status": ResponseStatusToJSON(value["status"])
11248
+ };
11249
+ }
11250
+
11251
+ // src/generated/models/ExtractionCompletedEventData.ts
11252
+ function instanceOfExtractionCompletedEventData(value) {
11253
+ if (!("correlationId" in value) || value["correlationId"] === void 0) return false;
11254
+ if (!("resultIncluded" in value) || value["resultIncluded"] === void 0) return false;
11255
+ if (!("resultPath" in value) || value["resultPath"] === void 0) return false;
11256
+ if (!("status" in value) || value["status"] === void 0) return false;
11257
+ return true;
11258
+ }
11259
+ function ExtractionCompletedEventDataFromJSON(json) {
11260
+ return ExtractionCompletedEventDataFromJSONTyped(json, false);
11261
+ }
11262
+ function ExtractionCompletedEventDataFromJSONTyped(json, ignoreDiscriminator) {
11263
+ if (json == null) {
11264
+ return json;
11265
+ }
11266
+ return {
11267
+ "channel": json["channel"] == null ? void 0 : json["channel"],
11268
+ "correlationId": json["correlationId"],
11269
+ "documentId": json["documentId"] == null ? void 0 : json["documentId"],
11270
+ "endUserId": json["endUserId"] == null ? void 0 : json["endUserId"],
11271
+ "error": json["error"] == null ? void 0 : FoundationDTOFromJSON(json["error"]),
11272
+ "externalId": json["externalId"] == null ? void 0 : json["externalId"],
11273
+ "result": json["result"] == null ? void 0 : DocumentProcessingResultOutDTOFromJSON(json["result"]),
11274
+ "resultIncluded": json["resultIncluded"],
11275
+ "resultPath": json["resultPath"],
11276
+ "status": json["status"]
11277
+ };
11278
+ }
11279
+ function ExtractionCompletedEventDataToJSON(json) {
11280
+ return ExtractionCompletedEventDataToJSONTyped(json, false);
11281
+ }
11282
+ function ExtractionCompletedEventDataToJSONTyped(value, ignoreDiscriminator = false) {
11283
+ if (value == null) {
11284
+ return value;
11285
+ }
11286
+ return {
11287
+ "channel": value["channel"],
11288
+ "correlationId": value["correlationId"],
11289
+ "documentId": value["documentId"],
11290
+ "endUserId": value["endUserId"],
11291
+ "error": FoundationDTOToJSON(value["error"]),
11292
+ "externalId": value["externalId"],
11293
+ "result": DocumentProcessingResultOutDTOToJSON(value["result"]),
11294
+ "resultIncluded": value["resultIncluded"],
11295
+ "resultPath": value["resultPath"],
11296
+ "status": value["status"]
11297
+ };
11298
+ }
11299
+
11300
+ // src/generated/models/ExtractionCompletedEvent.ts
11301
+ var ExtractionCompletedEventTypeEnum = {
11302
+ ExtractionCompleted: "extraction.completed"
11303
+ };
11304
+ function instanceOfExtractionCompletedEvent(value) {
11305
+ if (!("data" in value) || value["data"] === void 0) return false;
11306
+ if (!("timestamp" in value) || value["timestamp"] === void 0) return false;
11307
+ if (!("type" in value) || value["type"] === void 0) return false;
11308
+ if (value["type"] !== "extraction.completed") return false;
11309
+ return true;
11310
+ }
11311
+ function ExtractionCompletedEventFromJSON(json) {
11312
+ return ExtractionCompletedEventFromJSONTyped(json, false);
11313
+ }
11314
+ function ExtractionCompletedEventFromJSONTyped(json, ignoreDiscriminator) {
11315
+ if (json == null) {
11316
+ return json;
11317
+ }
11318
+ return {
11319
+ "data": ExtractionCompletedEventDataFromJSON(json["data"]),
11320
+ "timestamp": new Date(json["timestamp"]),
11321
+ "type": json["type"]
11322
+ };
11323
+ }
11324
+ function ExtractionCompletedEventToJSON(json) {
11325
+ return ExtractionCompletedEventToJSONTyped(json, false);
11326
+ }
11327
+ function ExtractionCompletedEventToJSONTyped(value, ignoreDiscriminator = false) {
11328
+ if (value == null) {
11329
+ return value;
11330
+ }
11331
+ return {
11332
+ "data": ExtractionCompletedEventDataToJSON(value["data"]),
11333
+ "timestamp": value["timestamp"].toISOString(),
11334
+ "type": value["type"]
11335
+ };
11336
+ }
11337
+
11338
+ // src/generated/models/LocationInner.ts
11339
+ function instanceOfLocationInner(value) {
11340
+ return true;
11341
+ }
11342
+ function LocationInnerFromJSON(json) {
11343
+ return LocationInnerFromJSONTyped(json, false);
11344
+ }
11345
+ function LocationInnerFromJSONTyped(json, ignoreDiscriminator) {
11346
+ return json;
11347
+ }
11348
+ function LocationInnerToJSON(json) {
11349
+ return LocationInnerToJSONTyped(json, false);
11350
+ }
11351
+ function LocationInnerToJSONTyped(value, ignoreDiscriminator = false) {
11352
+ return value;
11353
+ }
11354
+
11355
+ // src/generated/models/ValidationError.ts
11356
+ function instanceOfValidationError(value) {
11357
+ if (!("loc" in value) || value["loc"] === void 0) return false;
11358
+ if (!("msg" in value) || value["msg"] === void 0) return false;
11359
+ if (!("type" in value) || value["type"] === void 0) return false;
11360
+ return true;
11361
+ }
11362
+ function ValidationErrorFromJSON(json) {
11363
+ return ValidationErrorFromJSONTyped(json, false);
11364
+ }
11365
+ function ValidationErrorFromJSONTyped(json, ignoreDiscriminator) {
11366
+ if (json == null) {
11367
+ return json;
11368
+ }
11369
+ return {
11370
+ "loc": json["loc"].map(LocationInnerFromJSON),
11371
+ "msg": json["msg"],
11372
+ "type": json["type"]
10153
11373
  };
10154
11374
  }
10155
11375
  function ValidationErrorToJSON(json) {
@@ -10280,6 +11500,72 @@ function ValueAnyOfInnerToJSONTyped(value, ignoreDiscriminator = false) {
10280
11500
  return value;
10281
11501
  }
10282
11502
 
11503
+ // src/generated/models/WebhookTestEventData.ts
11504
+ function instanceOfWebhookTestEventData(value) {
11505
+ if (!("message" in value) || value["message"] === void 0) return false;
11506
+ return true;
11507
+ }
11508
+ function WebhookTestEventDataFromJSON(json) {
11509
+ return WebhookTestEventDataFromJSONTyped(json, false);
11510
+ }
11511
+ function WebhookTestEventDataFromJSONTyped(json, ignoreDiscriminator) {
11512
+ if (json == null) {
11513
+ return json;
11514
+ }
11515
+ return {
11516
+ "message": json["message"]
11517
+ };
11518
+ }
11519
+ function WebhookTestEventDataToJSON(json) {
11520
+ return WebhookTestEventDataToJSONTyped(json, false);
11521
+ }
11522
+ function WebhookTestEventDataToJSONTyped(value, ignoreDiscriminator = false) {
11523
+ if (value == null) {
11524
+ return value;
11525
+ }
11526
+ return {
11527
+ "message": value["message"]
11528
+ };
11529
+ }
11530
+
11531
+ // src/generated/models/WebhookTestEvent.ts
11532
+ var WebhookTestEventTypeEnum = {
11533
+ WebhookTest: "webhook.test"
11534
+ };
11535
+ function instanceOfWebhookTestEvent(value) {
11536
+ if (!("data" in value) || value["data"] === void 0) return false;
11537
+ if (!("timestamp" in value) || value["timestamp"] === void 0) return false;
11538
+ if (!("type" in value) || value["type"] === void 0) return false;
11539
+ if (value["type"] !== "webhook.test") return false;
11540
+ return true;
11541
+ }
11542
+ function WebhookTestEventFromJSON(json) {
11543
+ return WebhookTestEventFromJSONTyped(json, false);
11544
+ }
11545
+ function WebhookTestEventFromJSONTyped(json, ignoreDiscriminator) {
11546
+ if (json == null) {
11547
+ return json;
11548
+ }
11549
+ return {
11550
+ "data": WebhookTestEventDataFromJSON(json["data"]),
11551
+ "timestamp": new Date(json["timestamp"]),
11552
+ "type": json["type"]
11553
+ };
11554
+ }
11555
+ function WebhookTestEventToJSON(json) {
11556
+ return WebhookTestEventToJSONTyped(json, false);
11557
+ }
11558
+ function WebhookTestEventToJSONTyped(value, ignoreDiscriminator = false) {
11559
+ if (value == null) {
11560
+ return value;
11561
+ }
11562
+ return {
11563
+ "data": WebhookTestEventDataToJSON(value["data"]),
11564
+ "timestamp": value["timestamp"].toISOString(),
11565
+ "type": value["type"]
11566
+ };
11567
+ }
11568
+
10283
11569
  // src/errors.ts
10284
11570
  var GeminaError = class extends Error {
10285
11571
  constructor(message) {
@@ -10305,6 +11591,13 @@ var GeminaTimeoutError = class extends GeminaError {
10305
11591
  Object.setPrototypeOf(this, new.target.prototype);
10306
11592
  }
10307
11593
  };
11594
+ var GeminaWebhookVerificationError = class extends GeminaError {
11595
+ constructor(reason, message) {
11596
+ super(message);
11597
+ this.reason = reason;
11598
+ Object.setPrototypeOf(this, new.target.prototype);
11599
+ }
11600
+ };
10308
11601
 
10309
11602
  // src/helpers.ts
10310
11603
  var DEFAULT_BASE_URL = "https://api.gemina.co";
@@ -10441,6 +11734,10 @@ var GeminaClient = class _GeminaClient {
10441
11734
  * Build a client authenticated with a short-lived session token
10442
11735
  * (`OAuth2PasswordBearer` bearer scheme) instead of an API key. Use this
10443
11736
  * in browser/session contexts — never ship the API key to a browser.
11737
+ *
11738
+ * The factory sends whatever bearer token it is given. A retrieval token
11739
+ * from `sessions` does not reach the `webhooks` group, which needs the
11740
+ * account-login JWT (the token the console signs in with).
10444
11741
  */
10445
11742
  static withSessionToken(token, baseUrl = DEFAULT_BASE_URL, options = {}) {
10446
11743
  const headerValue = token.startsWith("Bearer ") ? token : `Bearer ${token}`;
@@ -10490,6 +11787,15 @@ var GeminaClient = class _GeminaClient {
10490
11787
  var _a;
10491
11788
  return (_a = this.apiCache).billing ?? (_a.billing = this.apiOverrides.billing ?? new BillingApi(this.configuration));
10492
11789
  }
11790
+ /**
11791
+ * Webhook endpoints and their delivery log. These routes need the
11792
+ * account-login token (build the client with {@link GeminaClient.withSessionToken});
11793
+ * an API key is refused.
11794
+ */
11795
+ get webhooks() {
11796
+ var _a;
11797
+ return (_a = this.apiCache).webhooks ?? (_a.webhooks = this.apiOverrides.webhooks ?? new WebhooksApi(this.configuration));
11798
+ }
10493
11799
  // --- Stateful chat convenience ---
10494
11800
  /**
10495
11801
  * Start a stateful chat {@link GeminaChatConversation} that threads the
@@ -10688,8 +11994,171 @@ async function asProcessingErrorIfFailedResult(error) {
10688
11994
  return new GeminaProcessingError(DocumentProcessingResultOutDTOFromJSON(json));
10689
11995
  }
10690
11996
 
11997
+ // src/webhooks.ts
11998
+ var SECRET_PREFIX = "whsec_";
11999
+ var DEFAULT_TOLERANCE_SECONDS = 300;
12000
+ var BASE64 = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
12001
+ var TIMESTAMP = /^[0-9]{1,12}$/;
12002
+ function isExtractionCompleted(event) {
12003
+ return event.type === "extraction.completed";
12004
+ }
12005
+ function isWebhookTest(event) {
12006
+ return event.type === "webhook.test";
12007
+ }
12008
+ var REQUIRED = {
12009
+ "extraction.completed": { correlationId: "string", status: "string", resultIncluded: "boolean", resultPath: "string" },
12010
+ "webhook.test": { message: "string" }
12011
+ };
12012
+ var fail = (reason, message) => new GeminaWebhookVerificationError(reason, message);
12013
+ function isObject(value) {
12014
+ return value !== null && typeof value === "object" && !Array.isArray(value);
12015
+ }
12016
+ var asciiLower = (text) => text.replace(/[A-Z]/g, (c) => String.fromCharCode(c.charCodeAt(0) + 32));
12017
+ function isComplete(type, data) {
12018
+ if (!isObject(data)) return false;
12019
+ if (Object.entries(REQUIRED[type]).some(([field, kind]) => typeof data[field] !== kind)) return false;
12020
+ if (type !== "extraction.completed") return true;
12021
+ const result = data.result ?? null;
12022
+ const error = data.error ?? null;
12023
+ if (result !== null && error !== null) return false;
12024
+ if (result !== null && !(isObject(result) && typeof result.status === "string" && isObject(result.meta) && "data" in result)) {
12025
+ return false;
12026
+ }
12027
+ return error === null || isObject(error) && typeof error.status === "string";
12028
+ }
12029
+ function header(headers, name) {
12030
+ const values = [];
12031
+ const add = (value) => {
12032
+ for (const part of value.split(", ")) if (!values.includes(part)) values.push(part);
12033
+ };
12034
+ const fromEntries = (entries) => {
12035
+ for (const [key, value] of entries) {
12036
+ if (asciiLower(String(key)) !== name || value === void 0 || value === null) continue;
12037
+ for (const item of Array.isArray(value) ? value : [value]) add(String(item));
12038
+ }
12039
+ };
12040
+ if (headers === null || headers === void 0) {
12041
+ } else if (headers instanceof Map) {
12042
+ fromEntries(headers.entries());
12043
+ } else if (typeof headers.get === "function") {
12044
+ const value = headers.get(name);
12045
+ if (value != null) add(String(value));
12046
+ } else {
12047
+ fromEntries(Object.entries(headers));
12048
+ }
12049
+ if (values.length === 0) throw fail("missing_header", `The ${name} header is missing.`);
12050
+ if (values.length > 1) throw fail("ambiguous_header", `The ${name} header was sent more than once with different values.`);
12051
+ return values[0];
12052
+ }
12053
+ function decodeBase64(text) {
12054
+ if (!BASE64.test(text)) return void 0;
12055
+ const binary = atob(text);
12056
+ const bytes = new Uint8Array(binary.length);
12057
+ for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
12058
+ return bytes;
12059
+ }
12060
+ function constantTimeEqual(a, b) {
12061
+ if (a.length !== b.length) return false;
12062
+ let difference = 0;
12063
+ for (let i = 0; i < a.length; i++) difference |= a[i] ^ b[i];
12064
+ return difference === 0;
12065
+ }
12066
+ function copyBody(body) {
12067
+ if (typeof body === "string") return new TextEncoder().encode(body);
12068
+ if (body == null) return new Uint8Array(0);
12069
+ const source = ArrayBuffer.isView(body) ? new Uint8Array(body.buffer, body.byteOffset, body.byteLength) : new Uint8Array(body);
12070
+ const copy = new Uint8Array(source.length);
12071
+ copy.set(source);
12072
+ return copy;
12073
+ }
12074
+ async function subtleCrypto() {
12075
+ const global = globalThis.crypto;
12076
+ if (global?.subtle) return global.subtle;
12077
+ const nodeCrypto = "node:crypto";
12078
+ const module = await import(
12079
+ /* @vite-ignore */
12080
+ /* webpackIgnore: true */
12081
+ nodeCrypto
12082
+ );
12083
+ return module.webcrypto.subtle;
12084
+ }
12085
+ async function unwrapWebhook(body, headers, secret, options = {}) {
12086
+ let rawBody;
12087
+ try {
12088
+ rawBody = copyBody(body);
12089
+ } catch (error) {
12090
+ if (!(error instanceof TypeError)) throw error;
12091
+ throw fail("invalid_body", "The webhook body cannot be read: its buffer was detached.");
12092
+ }
12093
+ options = options ?? {};
12094
+ const id = header(headers, "webhook-id");
12095
+ const timestampText = header(headers, "webhook-timestamp");
12096
+ const signatureHeader = header(headers, "webhook-signature");
12097
+ if (!TIMESTAMP.test(timestampText)) {
12098
+ throw fail("invalid_timestamp", "The webhook-timestamp header is not a whole number of seconds.");
12099
+ }
12100
+ const tolerance = options.toleranceSeconds ?? DEFAULT_TOLERANCE_SECONDS;
12101
+ const clock = (options.now ?? (() => Date.now() / 1e3))();
12102
+ if (!Number.isFinite(clock) || !Number.isFinite(tolerance) || tolerance < 0) {
12103
+ throw fail(
12104
+ "timestamp_out_of_tolerance",
12105
+ "The clock or the tolerance is not a finite number, so the timestamp cannot be checked."
12106
+ );
12107
+ }
12108
+ if (Math.abs(Math.floor(clock) - Number(timestampText)) > tolerance) {
12109
+ throw fail(
12110
+ "timestamp_out_of_tolerance",
12111
+ `The webhook timestamp is more than ${tolerance} seconds from the current time.`
12112
+ );
12113
+ }
12114
+ const key = typeof secret === "string" ? decodeBase64(secret.startsWith(SECRET_PREFIX) ? secret.slice(SECRET_PREFIX.length) : secret) : void 0;
12115
+ if (key === void 0 || key.length === 0) {
12116
+ throw fail("invalid_secret", "The signing secret is not valid: expected whsec_ followed by base64.");
12117
+ }
12118
+ const prefix = new TextEncoder().encode(`${id}.${timestampText}.`);
12119
+ const signed = new Uint8Array(prefix.length + rawBody.length);
12120
+ signed.set(prefix, 0);
12121
+ signed.set(rawBody, prefix.length);
12122
+ const subtle = await subtleCrypto();
12123
+ const verifiedBody = signed.subarray(prefix.length);
12124
+ const cryptoKey = await subtle.importKey("raw", key, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
12125
+ const expected = new Uint8Array(await subtle.sign("HMAC", cryptoKey, signed));
12126
+ let matched = false;
12127
+ for (const entry of signatureHeader.split(" ")) {
12128
+ const comma = entry.indexOf(",");
12129
+ if (comma < 0 || entry.slice(0, comma) !== "v1") continue;
12130
+ const candidate = decodeBase64(entry.slice(comma + 1));
12131
+ if (candidate !== void 0 && constantTimeEqual(candidate, expected)) matched = true;
12132
+ }
12133
+ if (!matched) throw fail("no_matching_signature", "No signature in the webhook-signature header matches.");
12134
+ if (verifiedBody.length >= 3 && verifiedBody[0] === 239 && verifiedBody[1] === 187 && verifiedBody[2] === 191) {
12135
+ throw fail("invalid_body", "The webhook body starts with a byte order mark.");
12136
+ }
12137
+ let parsed;
12138
+ try {
12139
+ parsed = JSON.parse(new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(verifiedBody));
12140
+ } catch {
12141
+ throw fail("invalid_body", "The webhook body is not valid JSON.");
12142
+ }
12143
+ if (!isObject(parsed)) throw fail("invalid_body", "The webhook body is not a JSON object.");
12144
+ const type = typeof parsed.type === "string" ? parsed.type : null;
12145
+ const timestamp = typeof parsed.timestamp === "string" ? parsed.timestamp : null;
12146
+ let data = parsed.data;
12147
+ if (type !== null && Object.prototype.hasOwnProperty.call(REQUIRED, type)) {
12148
+ if (!isComplete(type, data)) {
12149
+ throw fail("invalid_body", `The data of this ${type} event is missing a required field.`);
12150
+ }
12151
+ try {
12152
+ data = type === "extraction.completed" ? ExtractionCompletedEventDataFromJSON(data) : WebhookTestEventDataFromJSON(data);
12153
+ } catch {
12154
+ throw fail("invalid_body", `The data of this ${type} event could not be read.`);
12155
+ }
12156
+ }
12157
+ return { id, type, timestamp, data, raw: parsed };
12158
+ }
12159
+
10691
12160
  // src/version.ts
10692
- var VERSION = "0.15.0";
12161
+ var VERSION = "0.17.0";
10693
12162
  export {
10694
12163
  AddExtractionsInDTOFromJSON,
10695
12164
  AddExtractionsInDTOFromJSONTyped,
@@ -10775,6 +12244,11 @@ export {
10775
12244
  CreateTemplateInDTOFromJSONTyped,
10776
12245
  CreateTemplateInDTOToJSON,
10777
12246
  CreateTemplateInDTOToJSONTyped,
12247
+ CreatedWebhookEndpointOutDTODisabledReasonEnum,
12248
+ CreatedWebhookEndpointOutDTOFromJSON,
12249
+ CreatedWebhookEndpointOutDTOFromJSONTyped,
12250
+ CreatedWebhookEndpointOutDTOToJSON,
12251
+ CreatedWebhookEndpointOutDTOToJSONTyped,
10778
12252
  CreditMeter,
10779
12253
  CreditMeterFilter,
10780
12254
  CreditMeterFilterFromJSON,
@@ -10873,6 +12347,15 @@ export {
10873
12347
  EnterpriseTransactionOutDTOFromJSONTyped,
10874
12348
  EnterpriseTransactionOutDTOToJSON,
10875
12349
  EnterpriseTransactionOutDTOToJSONTyped,
12350
+ ExtractionCompletedEventDataFromJSON,
12351
+ ExtractionCompletedEventDataFromJSONTyped,
12352
+ ExtractionCompletedEventDataToJSON,
12353
+ ExtractionCompletedEventDataToJSONTyped,
12354
+ ExtractionCompletedEventFromJSON,
12355
+ ExtractionCompletedEventFromJSONTyped,
12356
+ ExtractionCompletedEventToJSON,
12357
+ ExtractionCompletedEventToJSONTyped,
12358
+ ExtractionCompletedEventTypeEnum,
10876
12359
  ExtractionCostOutDTOFromJSON,
10877
12360
  ExtractionCostOutDTOFromJSONTyped,
10878
12361
  ExtractionCostOutDTOToJSON,
@@ -11016,6 +12499,7 @@ export {
11016
12499
  GeminaError,
11017
12500
  GeminaProcessingError,
11018
12501
  GeminaTimeoutError,
12502
+ GeminaWebhookVerificationError,
11019
12503
  GenerateTemplateFromUrlInDTOFromJSON,
11020
12504
  GenerateTemplateFromUrlInDTOFromJSONTyped,
11021
12505
  GenerateTemplateFromUrlInDTOToJSON,
@@ -11048,6 +12532,7 @@ export {
11048
12532
  InvoiceTypeToJSONTyped,
11049
12533
  JSONApiResponse,
11050
12534
  LegalApi,
12535
+ ListWebhookEventsStatusEnum,
11051
12536
  LocationInnerFromJSON,
11052
12537
  LocationInnerFromJSONTyped,
11053
12538
  LocationInnerToJSON,
@@ -11076,6 +12561,11 @@ export {
11076
12561
  OperationTypeFromJSONTyped,
11077
12562
  OperationTypeToJSON,
11078
12563
  OperationTypeToJSONTyped,
12564
+ PaymentMethodUpdateOutDTOFromJSON,
12565
+ PaymentMethodUpdateOutDTOFromJSONTyped,
12566
+ PaymentMethodUpdateOutDTOPurposeEnum,
12567
+ PaymentMethodUpdateOutDTOToJSON,
12568
+ PaymentMethodUpdateOutDTOToJSONTyped,
11079
12569
  PeriodPresetModel,
11080
12570
  PeriodPresetModelFromJSON,
11081
12571
  PeriodPresetModelFromJSONTyped,
@@ -11112,6 +12602,7 @@ export {
11112
12602
  PurgedDocumentsDataOutDTOToJSONTyped,
11113
12603
  QueryMetaDTOFromJSON,
11114
12604
  QueryMetaDTOFromJSONTyped,
12605
+ QueryMetaDTOIndexingStateEnum,
11115
12606
  QueryMetaDTOToJSON,
11116
12607
  QueryMetaDTOToJSONTyped,
11117
12608
  QueryResultItemDTOFromJSON,
@@ -11357,10 +12848,56 @@ export {
11357
12848
  WebDocumentUploadInDTOFromJSONTyped,
11358
12849
  WebDocumentUploadInDTOToJSON,
11359
12850
  WebDocumentUploadInDTOToJSONTyped,
12851
+ WebhookAttemptOutDTOFromJSON,
12852
+ WebhookAttemptOutDTOFromJSONTyped,
12853
+ WebhookAttemptOutDTOToJSON,
12854
+ WebhookAttemptOutDTOToJSONTyped,
12855
+ WebhookDeliveryResultOutDTOFromJSON,
12856
+ WebhookDeliveryResultOutDTOFromJSONTyped,
12857
+ WebhookDeliveryResultOutDTOToJSON,
12858
+ WebhookDeliveryResultOutDTOToJSONTyped,
12859
+ WebhookEndpointCreateInDTOFromJSON,
12860
+ WebhookEndpointCreateInDTOFromJSONTyped,
12861
+ WebhookEndpointCreateInDTOToJSON,
12862
+ WebhookEndpointCreateInDTOToJSONTyped,
12863
+ WebhookEndpointListOutDTOFromJSON,
12864
+ WebhookEndpointListOutDTOFromJSONTyped,
12865
+ WebhookEndpointListOutDTOToJSON,
12866
+ WebhookEndpointListOutDTOToJSONTyped,
12867
+ WebhookEndpointOutDTODisabledReasonEnum,
12868
+ WebhookEndpointOutDTOFromJSON,
12869
+ WebhookEndpointOutDTOFromJSONTyped,
12870
+ WebhookEndpointOutDTOToJSON,
12871
+ WebhookEndpointOutDTOToJSONTyped,
12872
+ WebhookEndpointUpdateInDTOFromJSON,
12873
+ WebhookEndpointUpdateInDTOFromJSONTyped,
12874
+ WebhookEndpointUpdateInDTOToJSON,
12875
+ WebhookEndpointUpdateInDTOToJSONTyped,
12876
+ WebhookEventListOutDTOFromJSON,
12877
+ WebhookEventListOutDTOFromJSONTyped,
12878
+ WebhookEventListOutDTOToJSON,
12879
+ WebhookEventListOutDTOToJSONTyped,
12880
+ WebhookEventOutDTOFailureReasonEnum,
12881
+ WebhookEventOutDTOFromJSON,
12882
+ WebhookEventOutDTOFromJSONTyped,
12883
+ WebhookEventOutDTOStatusEnum,
12884
+ WebhookEventOutDTOToJSON,
12885
+ WebhookEventOutDTOToJSONTyped,
12886
+ WebhookEventOutDTOTypeEnum,
11360
12887
  WebhookResponseDTOFromJSON,
11361
12888
  WebhookResponseDTOFromJSONTyped,
11362
12889
  WebhookResponseDTOToJSON,
11363
12890
  WebhookResponseDTOToJSONTyped,
12891
+ WebhookTestEventDataFromJSON,
12892
+ WebhookTestEventDataFromJSONTyped,
12893
+ WebhookTestEventDataToJSON,
12894
+ WebhookTestEventDataToJSONTyped,
12895
+ WebhookTestEventFromJSON,
12896
+ WebhookTestEventFromJSONTyped,
12897
+ WebhookTestEventToJSON,
12898
+ WebhookTestEventToJSONTyped,
12899
+ WebhookTestEventTypeEnum,
12900
+ WebhooksApi,
11364
12901
  canConsumeForm,
11365
12902
  exists,
11366
12903
  instanceOfAddExtractionsInDTO,
@@ -11381,6 +12918,7 @@ export {
11381
12918
  instanceOfContractStatus,
11382
12919
  instanceOfCountBreakdownModel,
11383
12920
  instanceOfCreateTemplateInDTO,
12921
+ instanceOfCreatedWebhookEndpointOutDTO,
11384
12922
  instanceOfCreditMeter,
11385
12923
  instanceOfCreditMeterFilter,
11386
12924
  instanceOfCreditTransactionListOutDTO,
@@ -11403,6 +12941,8 @@ export {
11403
12941
  instanceOfDocumentsViewOutDTO,
11404
12942
  instanceOfEnterpriseTransactionListOutDTO,
11405
12943
  instanceOfEnterpriseTransactionOutDTO,
12944
+ instanceOfExtractionCompletedEvent,
12945
+ instanceOfExtractionCompletedEventData,
11406
12946
  instanceOfExtractionCostOutDTO,
11407
12947
  instanceOfExtractionCostOutResultDTO,
11408
12948
  instanceOfExtractionCostStateModel,
@@ -11448,6 +12988,7 @@ export {
11448
12988
  instanceOfNextActionOutDTO,
11449
12989
  instanceOfNumberOfStoredDocumentsOutDTO,
11450
12990
  instanceOfOperationType,
12991
+ instanceOfPaymentMethodUpdateOutDTO,
11451
12992
  instanceOfPeriodPresetModel,
11452
12993
  instanceOfPlanCreditCostOutDTO,
11453
12994
  instanceOfPlanDetailOutDTO,
@@ -11511,8 +13052,21 @@ export {
11511
13052
  instanceOfViewMetaOutDTO,
11512
13053
  instanceOfVolumeDiscountTierOutDTO,
11513
13054
  instanceOfWebDocumentUploadInDTO,
13055
+ instanceOfWebhookAttemptOutDTO,
13056
+ instanceOfWebhookDeliveryResultOutDTO,
13057
+ instanceOfWebhookEndpointCreateInDTO,
13058
+ instanceOfWebhookEndpointListOutDTO,
13059
+ instanceOfWebhookEndpointOutDTO,
13060
+ instanceOfWebhookEndpointUpdateInDTO,
13061
+ instanceOfWebhookEventListOutDTO,
13062
+ instanceOfWebhookEventOutDTO,
11514
13063
  instanceOfWebhookResponseDTO,
13064
+ instanceOfWebhookTestEvent,
13065
+ instanceOfWebhookTestEventData,
13066
+ isExtractionCompleted,
13067
+ isWebhookTest,
11515
13068
  mapValues,
11516
- querystring
13069
+ querystring,
13070
+ unwrapWebhook
11517
13071
  };
11518
13072
  //# sourceMappingURL=index.js.map