@algolia/ingestion 1.0.0-beta.1 → 1.0.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/LICENSE +21 -0
  2. package/dist/builds/browser.d.ts +41 -33
  3. package/dist/builds/browser.d.ts.map +1 -1
  4. package/dist/builds/node.d.ts +41 -33
  5. package/dist/builds/node.d.ts.map +1 -1
  6. package/dist/ingestion.cjs +265 -32
  7. package/dist/ingestion.esm.browser.js +275 -49
  8. package/dist/ingestion.esm.node.js +265 -32
  9. package/dist/ingestion.umd.js +2 -2
  10. package/dist/model/authentication.d.ts +2 -2
  11. package/dist/model/authenticationCreateResponse.d.ts +1 -1
  12. package/dist/model/authenticationUpdateResponse.d.ts +1 -1
  13. package/dist/model/clientMethodProps.d.ts +57 -13
  14. package/dist/model/clientMethodProps.d.ts.map +1 -1
  15. package/dist/model/deleteResponse.d.ts +1 -1
  16. package/dist/model/destination.d.ts +2 -2
  17. package/dist/model/destinationCreateResponse.d.ts +1 -1
  18. package/dist/model/destinationUpdateResponse.d.ts +1 -1
  19. package/dist/model/dockerStreamsInput.d.ts +4 -0
  20. package/dist/model/dockerStreamsInput.d.ts.map +1 -0
  21. package/dist/model/event.d.ts +1 -1
  22. package/dist/model/index.d.ts +13 -5
  23. package/dist/model/index.d.ts.map +1 -1
  24. package/dist/model/listTransformationsResponse.d.ts +10 -0
  25. package/dist/model/listTransformationsResponse.d.ts.map +1 -0
  26. package/dist/model/onDemandTrigger.d.ts +1 -1
  27. package/dist/model/run.d.ts +3 -3
  28. package/dist/model/runResponse.d.ts +1 -1
  29. package/dist/model/scheduleTrigger.d.ts +2 -2
  30. package/dist/model/sortKeys.d.ts +5 -0
  31. package/dist/model/sortKeys.d.ts.map +1 -0
  32. package/dist/model/source.d.ts +2 -2
  33. package/dist/model/sourceCreateResponse.d.ts +1 -1
  34. package/dist/model/sourceUpdateResponse.d.ts +1 -1
  35. package/dist/model/sourceUpdateShopify.d.ts +2 -26
  36. package/dist/model/sourceUpdateShopify.d.ts.map +1 -1
  37. package/dist/model/sourceWatchResponse.d.ts +20 -0
  38. package/dist/model/sourceWatchResponse.d.ts.map +1 -0
  39. package/dist/model/{streamingUtilsInput.d.ts → streamingInput.d.ts} +2 -2
  40. package/dist/model/streamingInput.d.ts.map +1 -0
  41. package/dist/model/task.d.ts +6 -2
  42. package/dist/model/task.d.ts.map +1 -1
  43. package/dist/model/taskCreate.d.ts +4 -0
  44. package/dist/model/taskCreate.d.ts.map +1 -1
  45. package/dist/model/taskCreateResponse.d.ts +1 -1
  46. package/dist/model/taskInput.d.ts +3 -4
  47. package/dist/model/taskInput.d.ts.map +1 -1
  48. package/dist/model/taskUpdateResponse.d.ts +1 -1
  49. package/dist/model/transformation.d.ts +27 -0
  50. package/dist/model/transformation.d.ts.map +1 -0
  51. package/dist/model/transformationCreate.d.ts +18 -0
  52. package/dist/model/transformationCreate.d.ts.map +1 -0
  53. package/dist/model/transformationCreateResponse.d.ts +14 -0
  54. package/dist/model/transformationCreateResponse.d.ts.map +1 -0
  55. package/dist/model/transformationSearch.d.ts +4 -0
  56. package/dist/model/transformationSearch.d.ts.map +1 -0
  57. package/dist/model/transformationTry.d.ts +11 -0
  58. package/dist/model/transformationTry.d.ts.map +1 -0
  59. package/dist/model/transformationTryResponse.d.ts +9 -0
  60. package/dist/model/transformationTryResponse.d.ts.map +1 -0
  61. package/dist/model/transformationTryResponseError.d.ts +14 -0
  62. package/dist/model/transformationTryResponseError.d.ts.map +1 -0
  63. package/dist/model/transformationUpdateResponse.d.ts +14 -0
  64. package/dist/model/transformationUpdateResponse.d.ts.map +1 -0
  65. package/dist/model/window.d.ts +2 -2
  66. package/dist/src/ingestionClient.d.ts +117 -22
  67. package/dist/src/ingestionClient.d.ts.map +1 -1
  68. package/model/authentication.ts +2 -2
  69. package/model/authenticationCreateResponse.ts +1 -1
  70. package/model/authenticationUpdateResponse.ts +1 -1
  71. package/model/clientMethodProps.ts +62 -14
  72. package/model/deleteResponse.ts +1 -1
  73. package/model/destination.ts +2 -2
  74. package/model/destinationCreateResponse.ts +1 -1
  75. package/model/destinationUpdateResponse.ts +1 -1
  76. package/model/{dockerSourceStreams.ts → dockerStreamsInput.ts} +2 -2
  77. package/model/event.ts +1 -1
  78. package/model/index.ts +13 -5
  79. package/model/listTransformationsResponse.ts +13 -0
  80. package/model/onDemandTrigger.ts +1 -1
  81. package/model/run.ts +3 -3
  82. package/model/runResponse.ts +1 -1
  83. package/model/scheduleTrigger.ts +2 -2
  84. package/model/sortKeys.ts +6 -0
  85. package/model/source.ts +2 -2
  86. package/model/sourceCreateResponse.ts +1 -1
  87. package/model/sourceUpdateResponse.ts +1 -1
  88. package/model/sourceUpdateShopify.ts +2 -32
  89. package/model/sourceWatchResponse.ts +25 -0
  90. package/model/{streamingUtilsInput.ts → streamingInput.ts} +1 -1
  91. package/model/task.ts +7 -2
  92. package/model/taskCreate.ts +5 -0
  93. package/model/taskCreateResponse.ts +1 -1
  94. package/model/taskInput.ts +3 -8
  95. package/model/taskUpdateResponse.ts +1 -1
  96. package/model/transformation.ts +33 -0
  97. package/model/transformationCreate.ts +21 -0
  98. package/model/transformationCreateResponse.ts +16 -0
  99. package/model/transformationSearch.ts +5 -0
  100. package/model/{dockerSourceDiscover.ts → transformationTry.ts} +5 -5
  101. package/model/transformationTryResponse.ts +12 -0
  102. package/model/transformationTryResponseError.ts +16 -0
  103. package/model/transformationUpdateResponse.ts +16 -0
  104. package/model/window.ts +2 -2
  105. package/package.json +11 -8
  106. package/dist/model/dockerSourceDiscover.d.ts +0 -11
  107. package/dist/model/dockerSourceDiscover.d.ts.map +0 -1
  108. package/dist/model/dockerSourceStreams.d.ts +0 -4
  109. package/dist/model/dockerSourceStreams.d.ts.map +0 -1
  110. package/dist/model/onDemandDateUtilsInput.d.ts +0 -16
  111. package/dist/model/onDemandDateUtilsInput.d.ts.map +0 -1
  112. package/dist/model/scheduleDateUtilsInput.d.ts +0 -12
  113. package/dist/model/scheduleDateUtilsInput.d.ts.map +0 -1
  114. package/dist/model/streamingUtilsInput.d.ts.map +0 -1
  115. package/model/onDemandDateUtilsInput.ts +0 -20
  116. package/model/scheduleDateUtilsInput.ts +0 -15
@@ -2,7 +2,7 @@ import { createAuth, createTransporter, getAlgoliaAgent, DEFAULT_CONNECT_TIMEOUT
2
2
  import { createHttpRequester } from '@algolia/requester-node-http';
3
3
 
4
4
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
5
- const apiClientVersion = '1.0.0-beta.1';
5
+ const apiClientVersion = '1.0.0-beta.11';
6
6
  const REGIONS = ['eu', 'us'];
7
7
  function getDefaultHosts(region) {
8
8
  const url = 'data.{region}.algolia.com'.replace('{region}', region);
@@ -228,6 +228,34 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
228
228
  };
229
229
  return transporter.request(request, requestOptions);
230
230
  },
231
+ /**
232
+ * Creates a new transformation.
233
+ *
234
+ * @param transformationCreate - Request body for creating a transformation.
235
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
236
+ */
237
+ createTransformation(transformationCreate, requestOptions) {
238
+ if (!transformationCreate) {
239
+ throw new Error('Parameter `transformationCreate` is required when calling `createTransformation`.');
240
+ }
241
+ if (!transformationCreate.code) {
242
+ throw new Error('Parameter `transformationCreate.code` is required when calling `createTransformation`.');
243
+ }
244
+ if (!transformationCreate.name) {
245
+ throw new Error('Parameter `transformationCreate.name` is required when calling `createTransformation`.');
246
+ }
247
+ const requestPath = '/1/transformations';
248
+ const headers = {};
249
+ const queryParameters = {};
250
+ const request = {
251
+ method: 'POST',
252
+ path: requestPath,
253
+ queryParameters,
254
+ headers,
255
+ data: transformationCreate,
256
+ };
257
+ return transporter.request(request, requestOptions);
258
+ },
231
259
  /**
232
260
  * This method allow you to send requests to the Algolia REST API.
233
261
  *
@@ -427,6 +455,28 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
427
455
  };
428
456
  return transporter.request(request, requestOptions);
429
457
  },
458
+ /**
459
+ * Deletes a transformation by its ID.
460
+ *
461
+ * @param deleteTransformation - The deleteTransformation object.
462
+ * @param deleteTransformation.transformationID - Unique identifier of a transformation.
463
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
464
+ */
465
+ deleteTransformation({ transformationID }, requestOptions) {
466
+ if (!transformationID) {
467
+ throw new Error('Parameter `transformationID` is required when calling `deleteTransformation`.');
468
+ }
469
+ const requestPath = '/1/transformations/{transformationID}'.replace('{transformationID}', encodeURIComponent(transformationID));
470
+ const headers = {};
471
+ const queryParameters = {};
472
+ const request = {
473
+ method: 'DELETE',
474
+ path: requestPath,
475
+ queryParameters,
476
+ headers,
477
+ };
478
+ return transporter.request(request, requestOptions);
479
+ },
430
480
  /**
431
481
  * Disables a task.
432
482
  *
@@ -629,33 +679,6 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
629
679
  };
630
680
  return transporter.request(request, requestOptions);
631
681
  },
632
- /**
633
- * Retrieves a stream listing for a source. Listing streams only works with sources with `type: docker` and `imageType: singer`.
634
- *
635
- * Required API Key ACLs:
636
- * - addObject
637
- * - deleteIndex
638
- * - editSettings.
639
- *
640
- * @param getDockerSourceStreams - The getDockerSourceStreams object.
641
- * @param getDockerSourceStreams.sourceID - Unique identifier of a source.
642
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
643
- */
644
- getDockerSourceStreams({ sourceID }, requestOptions) {
645
- if (!sourceID) {
646
- throw new Error('Parameter `sourceID` is required when calling `getDockerSourceStreams`.');
647
- }
648
- const requestPath = '/1/sources/{sourceID}/discover'.replace('{sourceID}', encodeURIComponent(sourceID));
649
- const headers = {};
650
- const queryParameters = {};
651
- const request = {
652
- method: 'GET',
653
- path: requestPath,
654
- queryParameters,
655
- headers,
656
- };
657
- return transporter.request(request, requestOptions);
658
- },
659
682
  /**
660
683
  * Retrieves a single task run event by its ID.
661
684
  *
@@ -705,8 +728,8 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
705
728
  * @param getEvents.type - Event type for filtering the list of task runs.
706
729
  * @param getEvents.sort - Property by which to sort the list of task run events.
707
730
  * @param getEvents.order - Sort order of the response, ascending or descending.
708
- * @param getEvents.startDate - Date and time in RFC3339 format for the earliest events to retrieve. By default, the current time minus three hours is used.
709
- * @param getEvents.endDate - Date and time in RFC3339 format for the latest events to retrieve. By default, the current time is used.
731
+ * @param getEvents.startDate - Date and time in RFC 3339 format for the earliest events to retrieve. By default, the current time minus three hours is used.
732
+ * @param getEvents.endDate - Date and time in RFC 3339 format for the latest events to retrieve. By default, the current time is used.
710
733
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
711
734
  */
712
735
  getEvents({ runID, itemsPerPage, page, status, type, sort, order, startDate, endDate, }, requestOptions) {
@@ -790,8 +813,8 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
790
813
  * @param getRuns.taskID - Task ID for filtering the list of task runs.
791
814
  * @param getRuns.sort - Property by which to sort the list of task runs.
792
815
  * @param getRuns.order - Sort order of the response, ascending or descending.
793
- * @param getRuns.startDate - Date in RFC3339 format for the earliest run to retrieve. By default, the current day minus seven days is used.
794
- * @param getRuns.endDate - Date in RFC3339 format for the latest run to retrieve. By default, the current day is used.
816
+ * @param getRuns.startDate - Date in RFC 3339 format for the earliest run to retrieve. By default, the current day minus seven days is used.
817
+ * @param getRuns.endDate - Date in RFC 3339 format for the latest run to retrieve. By default, the current day is used.
795
818
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
796
819
  */
797
820
  getRuns({ itemsPerPage, page, status, taskID, sort, order, startDate, endDate, } = {}, requestOptions = undefined) {
@@ -990,6 +1013,64 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
990
1013
  };
991
1014
  return transporter.request(request, requestOptions);
992
1015
  },
1016
+ /**
1017
+ * Retrieves a transformation by its ID.
1018
+ *
1019
+ * Required API Key ACLs:
1020
+ * - addObject
1021
+ * - deleteIndex
1022
+ * - editSettings.
1023
+ *
1024
+ * @param getTransformation - The getTransformation object.
1025
+ * @param getTransformation.transformationID - Unique identifier of a transformation.
1026
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1027
+ */
1028
+ getTransformation({ transformationID }, requestOptions) {
1029
+ if (!transformationID) {
1030
+ throw new Error('Parameter `transformationID` is required when calling `getTransformation`.');
1031
+ }
1032
+ const requestPath = '/1/transformations/{transformationID}'.replace('{transformationID}', encodeURIComponent(transformationID));
1033
+ const headers = {};
1034
+ const queryParameters = {};
1035
+ const request = {
1036
+ method: 'GET',
1037
+ path: requestPath,
1038
+ queryParameters,
1039
+ headers,
1040
+ };
1041
+ return transporter.request(request, requestOptions);
1042
+ },
1043
+ /**
1044
+ * Retrieves a list of transformations.
1045
+ *
1046
+ * Required API Key ACLs:
1047
+ * - addObject
1048
+ * - deleteIndex
1049
+ * - editSettings.
1050
+ *
1051
+ * @param getTransformations - The getTransformations object.
1052
+ * @param getTransformations.sort - Property by which to sort the list.
1053
+ * @param getTransformations.order - Sort order of the response, ascending or descending.
1054
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1055
+ */
1056
+ getTransformations({ sort, order } = {}, requestOptions = undefined) {
1057
+ const requestPath = '/1/transformations';
1058
+ const headers = {};
1059
+ const queryParameters = {};
1060
+ if (sort !== undefined) {
1061
+ queryParameters.sort = sort.toString();
1062
+ }
1063
+ if (order !== undefined) {
1064
+ queryParameters.order = order.toString();
1065
+ }
1066
+ const request = {
1067
+ method: 'GET',
1068
+ path: requestPath,
1069
+ queryParameters,
1070
+ headers,
1071
+ };
1072
+ return transporter.request(request, requestOptions);
1073
+ },
993
1074
  /**
994
1075
  * Runs a task. You can check the status of task runs with the observability endpoints.
995
1076
  *
@@ -1137,6 +1218,36 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1137
1218
  };
1138
1219
  return transporter.request(request, requestOptions);
1139
1220
  },
1221
+ /**
1222
+ * Searches for transformations.
1223
+ *
1224
+ * Required API Key ACLs:
1225
+ * - addObject
1226
+ * - deleteIndex
1227
+ * - editSettings.
1228
+ *
1229
+ * @param transformationSearch - The transformationSearch object.
1230
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1231
+ */
1232
+ searchTransformations(transformationSearch, requestOptions) {
1233
+ if (!transformationSearch) {
1234
+ throw new Error('Parameter `transformationSearch` is required when calling `searchTransformations`.');
1235
+ }
1236
+ if (!transformationSearch.transformationsIDs) {
1237
+ throw new Error('Parameter `transformationSearch.transformationsIDs` is required when calling `searchTransformations`.');
1238
+ }
1239
+ const requestPath = '/1/transformations/search';
1240
+ const headers = {};
1241
+ const queryParameters = {};
1242
+ const request = {
1243
+ method: 'POST',
1244
+ path: requestPath,
1245
+ queryParameters,
1246
+ headers,
1247
+ data: transformationSearch,
1248
+ };
1249
+ return transporter.request(request, requestOptions);
1250
+ },
1140
1251
  /**
1141
1252
  * Triggers a stream-listing request for a source. Triggering stream-listing requests only works with sources with `type: docker` and `imageType: singer`.
1142
1253
  *
@@ -1164,6 +1275,39 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1164
1275
  };
1165
1276
  return transporter.request(request, requestOptions);
1166
1277
  },
1278
+ /**
1279
+ * Try a transformation.
1280
+ *
1281
+ * Required API Key ACLs:
1282
+ * - addObject
1283
+ * - deleteIndex
1284
+ * - editSettings.
1285
+ *
1286
+ * @param transformationTry - The transformationTry object.
1287
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1288
+ */
1289
+ tryTransformations(transformationTry, requestOptions) {
1290
+ if (!transformationTry) {
1291
+ throw new Error('Parameter `transformationTry` is required when calling `tryTransformations`.');
1292
+ }
1293
+ if (!transformationTry.code) {
1294
+ throw new Error('Parameter `transformationTry.code` is required when calling `tryTransformations`.');
1295
+ }
1296
+ if (!transformationTry.sampleRecord) {
1297
+ throw new Error('Parameter `transformationTry.sampleRecord` is required when calling `tryTransformations`.');
1298
+ }
1299
+ const requestPath = '/1/transformations/try';
1300
+ const headers = {};
1301
+ const queryParameters = {};
1302
+ const request = {
1303
+ method: 'POST',
1304
+ path: requestPath,
1305
+ queryParameters,
1306
+ headers,
1307
+ data: transformationTry,
1308
+ };
1309
+ return transporter.request(request, requestOptions);
1310
+ },
1167
1311
  /**
1168
1312
  * Updates an authentication resource.
1169
1313
  *
@@ -1287,6 +1431,95 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1287
1431
  };
1288
1432
  return transporter.request(request, requestOptions);
1289
1433
  },
1434
+ /**
1435
+ * Updates a transformation by its ID.
1436
+ *
1437
+ * @param updateTransformation - The updateTransformation object.
1438
+ * @param updateTransformation.transformationID - Unique identifier of a transformation.
1439
+ * @param updateTransformation.transformationCreate - The transformationCreate object.
1440
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1441
+ */
1442
+ updateTransformation({ transformationID, transformationCreate }, requestOptions) {
1443
+ if (!transformationID) {
1444
+ throw new Error('Parameter `transformationID` is required when calling `updateTransformation`.');
1445
+ }
1446
+ if (!transformationCreate) {
1447
+ throw new Error('Parameter `transformationCreate` is required when calling `updateTransformation`.');
1448
+ }
1449
+ if (!transformationCreate.code) {
1450
+ throw new Error('Parameter `transformationCreate.code` is required when calling `updateTransformation`.');
1451
+ }
1452
+ if (!transformationCreate.name) {
1453
+ throw new Error('Parameter `transformationCreate.name` is required when calling `updateTransformation`.');
1454
+ }
1455
+ const requestPath = '/1/transformations/{transformationID}'.replace('{transformationID}', encodeURIComponent(transformationID));
1456
+ const headers = {};
1457
+ const queryParameters = {};
1458
+ const request = {
1459
+ method: 'PUT',
1460
+ path: requestPath,
1461
+ queryParameters,
1462
+ headers,
1463
+ data: transformationCreate,
1464
+ };
1465
+ return transporter.request(request, requestOptions);
1466
+ },
1467
+ /**
1468
+ * Validates a source payload to ensure it can be created and that the data source can be reached by Algolia.
1469
+ *
1470
+ * Required API Key ACLs:
1471
+ * - addObject
1472
+ * - deleteIndex
1473
+ * - editSettings.
1474
+ *
1475
+ * @param sourceCreate -.
1476
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1477
+ */
1478
+ validateSource(sourceCreate, requestOptions = undefined) {
1479
+ const requestPath = '/1/sources/validate';
1480
+ const headers = {};
1481
+ const queryParameters = {};
1482
+ const request = {
1483
+ method: 'POST',
1484
+ path: requestPath,
1485
+ queryParameters,
1486
+ headers,
1487
+ data: sourceCreate ? sourceCreate : {},
1488
+ };
1489
+ return transporter.request(request, requestOptions);
1490
+ },
1491
+ /**
1492
+ * Validates an update of a source payload to ensure it can be created and that the data source can be reached by Algolia.
1493
+ *
1494
+ * Required API Key ACLs:
1495
+ * - addObject
1496
+ * - deleteIndex
1497
+ * - editSettings.
1498
+ *
1499
+ * @param validateSourceBeforeUpdate - The validateSourceBeforeUpdate object.
1500
+ * @param validateSourceBeforeUpdate.sourceID - Unique identifier of a source.
1501
+ * @param validateSourceBeforeUpdate.sourceUpdate - The sourceUpdate object.
1502
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1503
+ */
1504
+ validateSourceBeforeUpdate({ sourceID, sourceUpdate }, requestOptions) {
1505
+ if (!sourceID) {
1506
+ throw new Error('Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.');
1507
+ }
1508
+ if (!sourceUpdate) {
1509
+ throw new Error('Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.');
1510
+ }
1511
+ const requestPath = '/1/sources/{sourceID}/validate'.replace('{sourceID}', encodeURIComponent(sourceID));
1512
+ const headers = {};
1513
+ const queryParameters = {};
1514
+ const request = {
1515
+ method: 'POST',
1516
+ path: requestPath,
1517
+ queryParameters,
1518
+ headers,
1519
+ data: sourceUpdate,
1520
+ };
1521
+ return transporter.request(request, requestOptions);
1522
+ },
1290
1523
  };
1291
1524
  }
1292
1525
 
@@ -1,2 +1,2 @@
1
- /*! ingestion.umd.js | 1.0.0-beta.1 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
2
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/ingestion"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function a(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function n(){return JSON.parse(a().getItem(r)||"{}")}function s(e){a().setItem(r,JSON.stringify(e))}return{get:(t,r,a={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>(function(){const t=e.timeToLive?1e3*e.timeToLive:null,r=n(),a=Object.fromEntries(Object.entries(r).filter((([,e])=>void 0!==e.timestamp)));if(s(a),!t)return;s(Object.fromEntries(Object.entries(a).filter((([,e])=>{const r=(new Date).getTime();return!(e.timestamp+t<r)}))))}(),n()[JSON.stringify(t)]))).then((e=>Promise.all([e?e.value:r(),void 0!==e]))).then((([e,t])=>Promise.all([e,t||a.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const s=n();return s[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},a().setItem(r,JSON.stringify(s)),t})),delete:e=>Promise.resolve().then((()=>{const t=n();delete t[JSON.stringify(e)],a().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{a().removeItem(r)}))}}function r(e){const t=[...e.caches],a=t.shift();return void 0===a?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,n,s={miss:()=>Promise.resolve()})=>a.get(e,n,s).catch((()=>r({caches:t}).get(e,n,s))),set:(e,n)=>a.set(e,n).catch((()=>r({caches:t}).set(e,n))),delete:e=>a.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>a.clear().catch((()=>r({caches:t}).clear()))}}function a(e={serializable:!0}){let t={};return{get(r,a,n={miss:()=>Promise.resolve()}){const s=JSON.stringify(r);if(s in t)return Promise.resolve(e.serializable?JSON.parse(t[s]):t[s]);const o=a();return o.then((e=>n.miss(e))).then((()=>o))},set:(r,a)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(a):a,Promise.resolve(a)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const n=12e4;function s(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>n},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=n}}}function o(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function i(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class c extends Error{constructor(e,t){super(e),i(this,"name","AlgoliaError"),t&&(this.name=t)}}class u extends c{constructor(e,t,r){super(e,r),i(this,"stackTrace",void 0),this.stackTrace=t}}class d extends u{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please create a ticket at https://support.algolia.com/ sharing steps we can use to reproduce the issue.",e,"RetryError")}}class h extends u{constructor(e,t,r,a="ApiError"){super(e,r,a),i(this,"status",void 0),this.status=t}}class l extends c{constructor(e,t){super(e,"DeserializationError"),i(this,"response",void 0),this.response=t}}class m extends h{constructor(e,t,r,a){super(e,t,a,"DetailedApiError"),i(this,"error",void 0),this.error=r}}function p(e,t,r){const a=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r]).replaceAll("+","%20")}`)).join("&")}(r);let n=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===t.charAt(0)?t.substring(1):t}`;return a.length&&(n+=`?${a}`),n}function g(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function w({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:a,algoliaAgent:n,timeouts:o,requester:i,requestsCache:c,responsesCache:u}){async function w(c,u,w=!0){const P=[],f=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,u),q=function(e,t,r){const a={Accept:"application/json",...e,...t,...r},n={};return Object.keys(a).forEach((e=>{const t=a[e];n[e.toLowerCase()]=t})),n}(r,c.headers,u.headers),D="GET"===c.method?{...c.data,...u.data}:{},I={...a,...c.queryParameters,...D};if(n.value&&(I["x-algolia-agent"]=n.value),u&&u.queryParameters)for(const e of Object.keys(u.queryParameters))u.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(u.queryParameters[e])?I[e]=u.queryParameters[e].toString():I[e]=u.queryParameters[e];let y=0;const v=async(e,r)=>{const a=e.pop();if(void 0===a)throw new d(function(e){return e.map((e=>g(e)))}(P));let n=w?u.timeouts?.read||o.read:u.timeouts?.write||o.write;const D={data:f,headers:q,method:c.method,url:p(a,c.path,I),connectTimeout:r(y,u.timeouts?.connect||o.connect),responseTimeout:r(y,n)},S=t=>{const r={request:D,response:t,host:a,triesLeft:e.length};return P.push(r),r},E=await i.send(D);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&!~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(E)){const n=S(E);return E.isTimedOut&&y++,console.log("Retryable failure",g(n)),await t.set(a,s(a,E.isTimedOut?"timed out":"down")),v(e,r)}if(function({status:e}){return 2==~~(e/100)}(E))return function(e){try{return JSON.parse(e.content)}catch(t){throw new l(t.message,e)}}(E);throw S(E),function({content:e,status:t},r){try{const a=JSON.parse(e);return"error"in a?new m(a.message,t,a.error,r):new h(a.message,t,r)}catch(e){}return new h(e,t,r)}(E,P)},S=e.filter((e=>"readWrite"===e.accept||(w?"read"===e.accept:"write"===e.accept))),E=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(s(e))))))),a=r.filter((e=>e.isUp())),n=r.filter((e=>e.isTimedOut())),o=[...a,...n];return{hosts:o.length>0?o:e,getTimeout:(e,t)=>(0===n.length&&0===e?1:n.length+3+e)*t}}(S);return v([...E.hosts].reverse(),E.getTimeout)}return{hostsCache:t,requester:i,timeouts:o,algoliaAgent:n,baseHeaders:r,baseQueryParameters:a,hosts:e,request:function(e,t={}){const n=e.useReadTransporter||"GET"===e.method;if(!n)return w(e,t,n);const s=()=>w(e,t);if(!0!==(t.cacheable||e.cacheable))return s();const o={request:e,requestOptions:t,transporter:{queryParameters:a,headers:r}};return u.get(o,(()=>c.get(o,(()=>c.set(o,s()).then((e=>Promise.all([c.delete(o),e])),(e=>Promise.all([c.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>u.set(o,e)})},requestsCache:c,responsesCache:u}}function P({algoliaAgents:e,client:t,version:r}){const a=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>a.add(e))),a}const f="1.0.0-beta.1",q=["eu","us"];e.apiClientVersion=f,e.ingestionClient=function(e,n,s,o){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!n||"string"!=typeof n)throw new Error("`apiKey` is missing.");if(!s||s&&("string"!=typeof s||!q.includes(s)))throw new Error(`\`region\` is required and must be one of the following: ${q.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:a,region:n,...s}){const o=function(e,t,r="WithinHeaders"){const a={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?a:{},queryParameters:()=>"WithinQueryParameters"===r?a:{}}}(e,t,r),i=w({hosts:(c=n,[{url:"data.{region}.algolia.com".replace("{region}",c),accept:"readWrite",protocol:"https"}]),...s,algoliaAgent:P({algoliaAgents:a,client:"Ingestion",version:f}),baseHeaders:{"content-type":"text/plain",...o.headers(),...s.baseHeaders},baseQueryParameters:{...o.queryParameters(),...s.baseQueryParameters}});var c;return{transporter:i,appId:e,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then((()=>{})),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,t){i.algoliaAgent.add({segment:e,version:t})},createAuthentication(e,t){if(!e)throw new Error("Parameter `authenticationCreate` is required when calling `createAuthentication`.");if(!e.type)throw new Error("Parameter `authenticationCreate.type` is required when calling `createAuthentication`.");if(!e.name)throw new Error("Parameter `authenticationCreate.name` is required when calling `createAuthentication`.");if(!e.input)throw new Error("Parameter `authenticationCreate.input` is required when calling `createAuthentication`.");const r={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:e};return i.request(r,t)},createDestination(e,t){if(!e)throw new Error("Parameter `destinationCreate` is required when calling `createDestination`.");if(!e.type)throw new Error("Parameter `destinationCreate.type` is required when calling `createDestination`.");if(!e.name)throw new Error("Parameter `destinationCreate.name` is required when calling `createDestination`.");if(!e.input)throw new Error("Parameter `destinationCreate.input` is required when calling `createDestination`.");const r={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:e};return i.request(r,t)},createSource(e,t){if(!e)throw new Error("Parameter `sourceCreate` is required when calling `createSource`.");if(!e.type)throw new Error("Parameter `sourceCreate.type` is required when calling `createSource`.");if(!e.name)throw new Error("Parameter `sourceCreate.name` is required when calling `createSource`.");if(!e.input)throw new Error("Parameter `sourceCreate.input` is required when calling `createSource`.");const r={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:e};return i.request(r,t)},createTask(e,t){if(!e)throw new Error("Parameter `taskCreate` is required when calling `createTask`.");if(!e.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTask`.");if(!e.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTask`.");if(!e.trigger)throw new Error("Parameter `taskCreate.trigger` is required when calling `createTask`.");if(!e.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTask`.");const r={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:e};return i.request(r,t)},customDelete({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const a={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(a,r)},customGet({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const a={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(a,r)},customPost({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const n={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(n,a)},customPut({path:e,parameters:t,body:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const n={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(n,a)},deleteAuthentication({authenticationID:e},t){if(!e)throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");const r={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},deleteDestination({destinationID:e},t){if(!e)throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");const r={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},deleteSource({sourceID:e},t){if(!e)throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");const r={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},deleteTask({taskID:e},t){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTask`.");const r={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},disableTask({taskID:e},t){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTask`.");const r={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},enableTask({taskID:e},t){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTask`.");const r={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getAuthentication({authenticationID:e},t){if(!e)throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");const r={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getAuthentications({itemsPerPage:e,page:t,type:r,platform:a,sort:n,order:s}={},o=void 0){const c={};void 0!==e&&(c.itemsPerPage=e.toString()),void 0!==t&&(c.page=t.toString()),void 0!==r&&(c.type=r.toString()),void 0!==a&&(c.platform=a.toString()),void 0!==n&&(c.sort=n.toString()),void 0!==s&&(c.order=s.toString());const u={method:"GET",path:"/1/authentications",queryParameters:c,headers:{}};return i.request(u,o)},getDestination({destinationID:e},t){if(!e)throw new Error("Parameter `destinationID` is required when calling `getDestination`.");const r={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getDestinations({itemsPerPage:e,page:t,type:r,authenticationID:a,sort:n,order:s}={},o=void 0){const c={};void 0!==e&&(c.itemsPerPage=e.toString()),void 0!==t&&(c.page=t.toString()),void 0!==r&&(c.type=r.toString()),void 0!==a&&(c.authenticationID=a.toString()),void 0!==n&&(c.sort=n.toString()),void 0!==s&&(c.order=s.toString());const u={method:"GET",path:"/1/destinations",queryParameters:c,headers:{}};return i.request(u,o)},getDockerSourceStreams({sourceID:e},t){if(!e)throw new Error("Parameter `sourceID` is required when calling `getDockerSourceStreams`.");const r={method:"GET",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getEvent({runID:e,eventID:t},r){if(!e)throw new Error("Parameter `runID` is required when calling `getEvent`.");if(!t)throw new Error("Parameter `eventID` is required when calling `getEvent`.");const a={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return i.request(a,r)},getEvents({runID:e,itemsPerPage:t,page:r,status:a,type:n,sort:s,order:o,startDate:c,endDate:u},d){if(!e)throw new Error("Parameter `runID` is required when calling `getEvents`.");const h="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),l={};void 0!==t&&(l.itemsPerPage=t.toString()),void 0!==r&&(l.page=r.toString()),void 0!==a&&(l.status=a.toString()),void 0!==n&&(l.type=n.toString()),void 0!==s&&(l.sort=s.toString()),void 0!==o&&(l.order=o.toString()),void 0!==c&&(l.startDate=c.toString()),void 0!==u&&(l.endDate=u.toString());const m={method:"GET",path:h,queryParameters:l,headers:{}};return i.request(m,d)},getRun({runID:e},t){if(!e)throw new Error("Parameter `runID` is required when calling `getRun`.");const r={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getRuns({itemsPerPage:e,page:t,status:r,taskID:a,sort:n,order:s,startDate:o,endDate:c}={},u=void 0){const d={};void 0!==e&&(d.itemsPerPage=e.toString()),void 0!==t&&(d.page=t.toString()),void 0!==r&&(d.status=r.toString()),void 0!==a&&(d.taskID=a.toString()),void 0!==n&&(d.sort=n.toString()),void 0!==s&&(d.order=s.toString()),void 0!==o&&(d.startDate=o.toString()),void 0!==c&&(d.endDate=c.toString());const h={method:"GET",path:"/1/runs",queryParameters:d,headers:{}};return i.request(h,u)},getSource({sourceID:e},t){if(!e)throw new Error("Parameter `sourceID` is required when calling `getSource`.");const r={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getSources({itemsPerPage:e,page:t,type:r,authenticationID:a,sort:n,order:s}={},o=void 0){const c={};void 0!==e&&(c.itemsPerPage=e.toString()),void 0!==t&&(c.page=t.toString()),void 0!==r&&(c.type=r.toString()),void 0!==a&&(c.authenticationID=a.toString()),void 0!==n&&(c.sort=n.toString()),void 0!==s&&(c.order=s.toString());const u={method:"GET",path:"/1/sources",queryParameters:c,headers:{}};return i.request(u,o)},getTask({taskID:e},t){if(!e)throw new Error("Parameter `taskID` is required when calling `getTask`.");const r={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getTasks({itemsPerPage:e,page:t,action:r,enabled:a,sourceID:n,destinationID:s,triggerType:o,sort:c,order:u}={},d=void 0){const h={};void 0!==e&&(h.itemsPerPage=e.toString()),void 0!==t&&(h.page=t.toString()),void 0!==r&&(h.action=r.toString()),void 0!==a&&(h.enabled=a.toString()),void 0!==n&&(h.sourceID=n.toString()),void 0!==s&&(h.destinationID=s.toString()),void 0!==o&&(h.triggerType=o.toString()),void 0!==c&&(h.sort=c.toString()),void 0!==u&&(h.order=u.toString());const l={method:"GET",path:"/1/tasks",queryParameters:h,headers:{}};return i.request(l,d)},runTask({taskID:e},t){if(!e)throw new Error("Parameter `taskID` is required when calling `runTask`.");const r={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},searchAuthentications(e,t){if(!e)throw new Error("Parameter `authenticationSearch` is required when calling `searchAuthentications`.");if(!e.authenticationIDs)throw new Error("Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.");const r={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:e};return i.request(r,t)},searchDestinations(e,t){if(!e)throw new Error("Parameter `destinationSearch` is required when calling `searchDestinations`.");if(!e.destinationIDs)throw new Error("Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.");const r={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:e};return i.request(r,t)},searchSources(e,t){if(!e)throw new Error("Parameter `sourceSearch` is required when calling `searchSources`.");if(!e.sourceIDs)throw new Error("Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.");const r={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:e};return i.request(r,t)},searchTasks(e,t){if(!e)throw new Error("Parameter `taskSearch` is required when calling `searchTasks`.");if(!e.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.");const r={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:e};return i.request(r,t)},triggerDockerSourceDiscover({sourceID:e},t){if(!e)throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");const r={method:"POST",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},updateAuthentication({authenticationID:e,authenticationUpdate:t},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");if(!t)throw new Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");const a={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.request(a,r)},updateDestination({destinationID:e,destinationUpdate:t},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `updateDestination`.");if(!t)throw new Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");const a={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.request(a,r)},updateSource({sourceID:e,sourceUpdate:t},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `updateSource`.");if(!t)throw new Error("Parameter `sourceUpdate` is required when calling `updateSource`.");const a={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.request(a,r)},updateTask({taskID:e,taskUpdate:t},r){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTask`.");if(!t)throw new Error("Parameter `taskUpdate` is required when calling `updateTask`.");const a={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.request(a,r)}}}({appId:e,apiKey:n,region:s,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const a=(e,a)=>setTimeout((()=>{r.abort(),t({status:0,content:a,isTimedOut:!0})}),e),n=a(e.connectTimeout,"Connection timeout");let s;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===s&&(clearTimeout(n),s=a(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(n),clearTimeout(s),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(n),clearTimeout(s),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:a(),requestsCache:a({serializable:!1}),hostsCache:r({caches:[t({key:`${f}-${e}`}),a()]}),...o})},e.isOnDemandTrigger=function(e){return"onDemand"===e.type},e.isScheduleTrigger=function(e){return"schedule"===e.type},e.isSubscriptionTrigger=function(e){return"subscription"===e.type}}));
1
+ /*! ingestion.umd.js | 1.0.0-beta.11 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
2
+ !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/ingestion"]={})}(this,(function(e){"use strict";function r(e){let r;const t=`algolia-client-js-${e.key}`;function a(){return void 0===r&&(r=e.localStorage||window.localStorage),r}function n(){return JSON.parse(a().getItem(t)||"{}")}function o(e){a().setItem(t,JSON.stringify(e))}return{get:(r,t,a={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>(function(){const r=e.timeToLive?1e3*e.timeToLive:null,t=n(),a=Object.fromEntries(Object.entries(t).filter((([,e])=>void 0!==e.timestamp)));if(o(a),!r)return;o(Object.fromEntries(Object.entries(a).filter((([,e])=>{const t=(new Date).getTime();return!(e.timestamp+r<t)}))))}(),n()[JSON.stringify(r)]))).then((e=>Promise.all([e?e.value:t(),void 0!==e]))).then((([e,r])=>Promise.all([e,r||a.miss(e)]))).then((([e])=>e)),set:(e,r)=>Promise.resolve().then((()=>{const o=n();return o[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:r},a().setItem(t,JSON.stringify(o)),r})),delete:e=>Promise.resolve().then((()=>{const r=n();delete r[JSON.stringify(e)],a().setItem(t,JSON.stringify(r))})),clear:()=>Promise.resolve().then((()=>{a().removeItem(t)}))}}function t(e){const r=[...e.caches],a=r.shift();return void 0===a?{get:(e,r,t={miss:()=>Promise.resolve()})=>r().then((e=>Promise.all([e,t.miss(e)]))).then((([e])=>e)),set:(e,r)=>Promise.resolve(r),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,n,o={miss:()=>Promise.resolve()})=>a.get(e,n,o).catch((()=>t({caches:r}).get(e,n,o))),set:(e,n)=>a.set(e,n).catch((()=>t({caches:r}).set(e,n))),delete:e=>a.delete(e).catch((()=>t({caches:r}).delete(e))),clear:()=>a.clear().catch((()=>t({caches:r}).clear()))}}function a(e={serializable:!0}){let r={};return{get(t,a,n={miss:()=>Promise.resolve()}){const o=JSON.stringify(t);if(o in r)return Promise.resolve(e.serializable?JSON.parse(r[o]):r[o]);const s=a();return s.then((e=>n.miss(e))).then((()=>s))},set:(t,a)=>(r[JSON.stringify(t)]=e.serializable?JSON.stringify(a):a,Promise.resolve(a)),delete:e=>(delete r[JSON.stringify(e)],Promise.resolve()),clear:()=>(r={},Promise.resolve())}}const n=12e4;function o(e,r="up"){const t=Date.now();return{...e,status:r,lastUpdate:t,isUp:function(){return"up"===r||Date.now()-t>n},isTimedOut:function(){return"timed out"===r&&Date.now()-t<=n}}}function s(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,r||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}class i extends Error{constructor(e,r){super(e),s(this,"name","AlgoliaError"),r&&(this.name=r)}}class u extends i{constructor(e,r,t){super(e,t),s(this,"stackTrace",void 0),this.stackTrace=r}}class c extends u{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",e,"RetryError")}}class d extends u{constructor(e,r,t,a="ApiError"){super(e,t,a),s(this,"status",void 0),this.status=r}}class h extends i{constructor(e,r){super(e,"DeserializationError"),s(this,"response",void 0),this.response=r}}class m extends d{constructor(e,r,t,a){super(e,r,a,"DetailedApiError"),s(this,"error",void 0),this.error=t}}function l(e,r,t){const a=(n=t,Object.keys(n).filter((e=>void 0!==n[e])).sort().map((e=>`${e}=${encodeURIComponent("[object Array]"===Object.prototype.toString.call(n[e])?n[e].join(","):n[e]).replaceAll("+","%20")}`)).join("&"));var n;let o=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===r.charAt(0)?r.substring(1):r}`;return a.length&&(o+=`?${a}`),o}function p(e){const r=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...r}}}}function g({hosts:e,hostsCache:r,baseHeaders:t,baseQueryParameters:a,algoliaAgent:n,timeouts:s,requester:i,requestsCache:u,responsesCache:g}){async function w(u,g,w=!0){const f=[],P=function(e,r){if("GET"===e.method||void 0===e.data&&void 0===r.data)return;const t=Array.isArray(e.data)?e.data:{...e.data,...r.data};return JSON.stringify(t)}(u,g),q=function(e,r,t){const a={Accept:"application/json",...e,...r,...t},n={};return Object.keys(a).forEach((e=>{const r=a[e];n[e.toLowerCase()]=r})),n}(t,u.headers,g.headers),D="GET"===u.method?{...u.data,...g.data}:{},I={...a,...u.queryParameters,...D};if(n.value&&(I["x-algolia-agent"]=n.value),g&&g.queryParameters)for(const e of Object.keys(g.queryParameters))g.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(g.queryParameters[e])?I[e]=g.queryParameters[e].toString():I[e]=g.queryParameters[e];let y=0;const T=async(e,t)=>{const a=e.pop();if(void 0===a)throw new c(function(e){return e.map((e=>p(e)))}(f));let n=w?g.timeouts?.read||s.read:g.timeouts?.write||s.write;const D={data:P,headers:q,method:u.method,url:l(a,u.path,I),connectTimeout:t(y,g.timeouts?.connect||s.connect),responseTimeout:t(y,n)},v=r=>{const t={request:D,response:r,host:a,triesLeft:e.length};return f.push(t),t},E=await i.send(D);if(function({isTimedOut:e,status:r}){return e||function({isTimedOut:e,status:r}){return!e&&!~~r}({isTimedOut:e,status:r})||2!=~~(r/100)&&4!=~~(r/100)}(E)){const n=v(E);return E.isTimedOut&&y++,console.log("Retryable failure",p(n)),await r.set(a,o(a,E.isTimedOut?"timed out":"down")),T(e,t)}if(function({status:e}){return 2==~~(e/100)}(E))return function(e){try{return JSON.parse(e.content)}catch(r){throw new h(r.message,e)}}(E);throw v(E),function({content:e,status:r},t){try{const a=JSON.parse(e);return"error"in a?new m(a.message,r,a.error,t):new d(a.message,r,t)}catch(e){}return new d(e,r,t)}(E,f)},v=e.filter((e=>"readWrite"===e.accept||(w?"read"===e.accept:"write"===e.accept))),E=await async function(e){const t=await Promise.all(e.map((e=>r.get(e,(()=>Promise.resolve(o(e))))))),a=t.filter((e=>e.isUp())),n=t.filter((e=>e.isTimedOut())),s=[...a,...n];return{hosts:s.length>0?s:e,getTimeout:(e,r)=>(0===n.length&&0===e?1:n.length+3+e)*r}}(v);return T([...E.hosts].reverse(),E.getTimeout)}return{hostsCache:r,requester:i,timeouts:s,algoliaAgent:n,baseHeaders:t,baseQueryParameters:a,hosts:e,request:function(e,r={}){const n=e.useReadTransporter||"GET"===e.method;if(!n)return w(e,r,n);const o=()=>w(e,r);if(!0!==(r.cacheable||e.cacheable))return o();const s={request:e,requestOptions:r,transporter:{queryParameters:a,headers:t}};return g.get(s,(()=>u.get(s,(()=>u.set(s,o()).then((e=>Promise.all([u.delete(s),e])),(e=>Promise.all([u.delete(s),Promise.reject(e)]))).then((([e,r])=>r))))),{miss:e=>g.set(s,e)})},requestsCache:u,responsesCache:g}}function w({algoliaAgents:e,client:r,version:t}){const a=function(e){const r={value:`Algolia for JavaScript (${e})`,add(e){const t=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===r.value.indexOf(t)&&(r.value=`${r.value}${t}`),r}};return r}(t).add({segment:r,version:t});return e.forEach((e=>a.add(e))),a}const f="1.0.0-beta.11",P=["eu","us"];e.apiClientVersion=f,e.ingestionClient=function(e,n,o,s){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!n||"string"!=typeof n)throw new Error("`apiKey` is missing.");if(!o||o&&("string"!=typeof o||!P.includes(o)))throw new Error(`\`region\` is required and must be one of the following: ${P.join(", ")}`);return function({appId:e,apiKey:r,authMode:t,algoliaAgents:a,region:n,...o}){const s=function(e,r,t="WithinHeaders"){const a={"x-algolia-api-key":r,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===t?a:{},queryParameters:()=>"WithinQueryParameters"===t?a:{}}}(e,r,t),i=g({hosts:(u=n,[{url:"data.{region}.algolia.com".replace("{region}",u),accept:"readWrite",protocol:"https"}]),...o,algoliaAgent:w({algoliaAgents:a,client:"Ingestion",version:f}),baseHeaders:{"content-type":"text/plain",...s.headers(),...o.baseHeaders},baseQueryParameters:{...s.queryParameters(),...o.baseQueryParameters}});var u;return{transporter:i,appId:e,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then((()=>{})),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,r){i.algoliaAgent.add({segment:e,version:r})},createAuthentication(e,r){if(!e)throw new Error("Parameter `authenticationCreate` is required when calling `createAuthentication`.");if(!e.type)throw new Error("Parameter `authenticationCreate.type` is required when calling `createAuthentication`.");if(!e.name)throw new Error("Parameter `authenticationCreate.name` is required when calling `createAuthentication`.");if(!e.input)throw new Error("Parameter `authenticationCreate.input` is required when calling `createAuthentication`.");const t={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:e};return i.request(t,r)},createDestination(e,r){if(!e)throw new Error("Parameter `destinationCreate` is required when calling `createDestination`.");if(!e.type)throw new Error("Parameter `destinationCreate.type` is required when calling `createDestination`.");if(!e.name)throw new Error("Parameter `destinationCreate.name` is required when calling `createDestination`.");if(!e.input)throw new Error("Parameter `destinationCreate.input` is required when calling `createDestination`.");const t={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:e};return i.request(t,r)},createSource(e,r){if(!e)throw new Error("Parameter `sourceCreate` is required when calling `createSource`.");if(!e.type)throw new Error("Parameter `sourceCreate.type` is required when calling `createSource`.");if(!e.name)throw new Error("Parameter `sourceCreate.name` is required when calling `createSource`.");if(!e.input)throw new Error("Parameter `sourceCreate.input` is required when calling `createSource`.");const t={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:e};return i.request(t,r)},createTask(e,r){if(!e)throw new Error("Parameter `taskCreate` is required when calling `createTask`.");if(!e.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTask`.");if(!e.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTask`.");if(!e.trigger)throw new Error("Parameter `taskCreate.trigger` is required when calling `createTask`.");if(!e.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTask`.");const t={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:e};return i.request(t,r)},createTransformation(e,r){if(!e)throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");if(!e.code)throw new Error("Parameter `transformationCreate.code` is required when calling `createTransformation`.");if(!e.name)throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");const t={method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:e};return i.request(t,r)},customDelete({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const a={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(a,t)},customGet({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const a={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(a,t)},customPost({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const n={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return i.request(n,a)},customPut({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const n={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return i.request(n,a)},deleteAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");const t={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");const t={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");const t={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTask`.");const t={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `deleteTransformation`.");const t={method:"DELETE",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},disableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTask`.");const t={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},enableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTask`.");const t={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");const t={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getAuthentications({itemsPerPage:e,page:r,type:t,platform:a,sort:n,order:o}={},s=void 0){const u={};void 0!==e&&(u.itemsPerPage=e.toString()),void 0!==r&&(u.page=r.toString()),void 0!==t&&(u.type=t.toString()),void 0!==a&&(u.platform=a.toString()),void 0!==n&&(u.sort=n.toString()),void 0!==o&&(u.order=o.toString());const c={method:"GET",path:"/1/authentications",queryParameters:u,headers:{}};return i.request(c,s)},getDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `getDestination`.");const t={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getDestinations({itemsPerPage:e,page:r,type:t,authenticationID:a,sort:n,order:o}={},s=void 0){const u={};void 0!==e&&(u.itemsPerPage=e.toString()),void 0!==r&&(u.page=r.toString()),void 0!==t&&(u.type=t.toString()),void 0!==a&&(u.authenticationID=a.toString()),void 0!==n&&(u.sort=n.toString()),void 0!==o&&(u.order=o.toString());const c={method:"GET",path:"/1/destinations",queryParameters:u,headers:{}};return i.request(c,s)},getEvent({runID:e,eventID:r},t){if(!e)throw new Error("Parameter `runID` is required when calling `getEvent`.");if(!r)throw new Error("Parameter `eventID` is required when calling `getEvent`.");const a={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(a,t)},getEvents({runID:e,itemsPerPage:r,page:t,status:a,type:n,sort:o,order:s,startDate:u,endDate:c},d){if(!e)throw new Error("Parameter `runID` is required when calling `getEvents`.");const h="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),m={};void 0!==r&&(m.itemsPerPage=r.toString()),void 0!==t&&(m.page=t.toString()),void 0!==a&&(m.status=a.toString()),void 0!==n&&(m.type=n.toString()),void 0!==o&&(m.sort=o.toString()),void 0!==s&&(m.order=s.toString()),void 0!==u&&(m.startDate=u.toString()),void 0!==c&&(m.endDate=c.toString());const l={method:"GET",path:h,queryParameters:m,headers:{}};return i.request(l,d)},getRun({runID:e},r){if(!e)throw new Error("Parameter `runID` is required when calling `getRun`.");const t={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getRuns({itemsPerPage:e,page:r,status:t,taskID:a,sort:n,order:o,startDate:s,endDate:u}={},c=void 0){const d={};void 0!==e&&(d.itemsPerPage=e.toString()),void 0!==r&&(d.page=r.toString()),void 0!==t&&(d.status=t.toString()),void 0!==a&&(d.taskID=a.toString()),void 0!==n&&(d.sort=n.toString()),void 0!==o&&(d.order=o.toString()),void 0!==s&&(d.startDate=s.toString()),void 0!==u&&(d.endDate=u.toString());const h={method:"GET",path:"/1/runs",queryParameters:d,headers:{}};return i.request(h,c)},getSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `getSource`.");const t={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getSources({itemsPerPage:e,page:r,type:t,authenticationID:a,sort:n,order:o}={},s=void 0){const u={};void 0!==e&&(u.itemsPerPage=e.toString()),void 0!==r&&(u.page=r.toString()),void 0!==t&&(u.type=t.toString()),void 0!==a&&(u.authenticationID=a.toString()),void 0!==n&&(u.sort=n.toString()),void 0!==o&&(u.order=o.toString());const c={method:"GET",path:"/1/sources",queryParameters:u,headers:{}};return i.request(c,s)},getTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTask`.");const t={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getTasks({itemsPerPage:e,page:r,action:t,enabled:a,sourceID:n,destinationID:o,triggerType:s,sort:u,order:c}={},d=void 0){const h={};void 0!==e&&(h.itemsPerPage=e.toString()),void 0!==r&&(h.page=r.toString()),void 0!==t&&(h.action=t.toString()),void 0!==a&&(h.enabled=a.toString()),void 0!==n&&(h.sourceID=n.toString()),void 0!==o&&(h.destinationID=o.toString()),void 0!==s&&(h.triggerType=s.toString()),void 0!==u&&(h.sort=u.toString()),void 0!==c&&(h.order=c.toString());const m={method:"GET",path:"/1/tasks",queryParameters:h,headers:{}};return i.request(m,d)},getTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `getTransformation`.");const t={method:"GET",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getTransformations({sort:e,order:r}={},t=void 0){const a={};void 0!==e&&(a.sort=e.toString()),void 0!==r&&(a.order=r.toString());const n={method:"GET",path:"/1/transformations",queryParameters:a,headers:{}};return i.request(n,t)},runTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `runTask`.");const t={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},searchAuthentications(e,r){if(!e)throw new Error("Parameter `authenticationSearch` is required when calling `searchAuthentications`.");if(!e.authenticationIDs)throw new Error("Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.");const t={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchDestinations(e,r){if(!e)throw new Error("Parameter `destinationSearch` is required when calling `searchDestinations`.");if(!e.destinationIDs)throw new Error("Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.");const t={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchSources(e,r){if(!e)throw new Error("Parameter `sourceSearch` is required when calling `searchSources`.");if(!e.sourceIDs)throw new Error("Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.");const t={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchTasks(e,r){if(!e)throw new Error("Parameter `taskSearch` is required when calling `searchTasks`.");if(!e.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.");const t={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchTransformations(e,r){if(!e)throw new Error("Parameter `transformationSearch` is required when calling `searchTransformations`.");if(!e.transformationsIDs)throw new Error("Parameter `transformationSearch.transformationsIDs` is required when calling `searchTransformations`.");const t={method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},triggerDockerSourceDiscover({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");const t={method:"POST",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},tryTransformations(e,r){if(!e)throw new Error("Parameter `transformationTry` is required when calling `tryTransformations`.");if(!e.code)throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformations`.");if(!e.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformations`.");const t={method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:e};return i.request(t,r)},updateAuthentication({authenticationID:e,authenticationUpdate:r},t){if(!e)throw new Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");if(!r)throw new Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");const a={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},updateDestination({destinationID:e,destinationUpdate:r},t){if(!e)throw new Error("Parameter `destinationID` is required when calling `updateDestination`.");if(!r)throw new Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");const a={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},updateSource({sourceID:e,sourceUpdate:r},t){if(!e)throw new Error("Parameter `sourceID` is required when calling `updateSource`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `updateSource`.");const a={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},updateTask({taskID:e,taskUpdate:r},t){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTask`.");if(!r)throw new Error("Parameter `taskUpdate` is required when calling `updateTask`.");const a={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},updateTransformation({transformationID:e,transformationCreate:r},t){if(!e)throw new Error("Parameter `transformationID` is required when calling `updateTransformation`.");if(!r)throw new Error("Parameter `transformationCreate` is required when calling `updateTransformation`.");if(!r.code)throw new Error("Parameter `transformationCreate.code` is required when calling `updateTransformation`.");if(!r.name)throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");const a={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},validateSource(e,r=void 0){const t={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}};return i.request(t,r)},validateSourceBeforeUpdate({sourceID:e,sourceUpdate:r},t){if(!e)throw new Error("Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.");const a={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)}}}({appId:e,apiKey:n,region:o,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((r=>{const t=new XMLHttpRequest;t.open(e.method,e.url,!0),Object.keys(e.headers).forEach((r=>t.setRequestHeader(r,e.headers[r])));const a=(e,a)=>setTimeout((()=>{t.abort(),r({status:0,content:a,isTimedOut:!0})}),e),n=a(e.connectTimeout,"Connection timeout");let o;t.onreadystatechange=()=>{t.readyState>t.OPENED&&void 0===o&&(clearTimeout(n),o=a(e.responseTimeout,"Socket timeout"))},t.onerror=()=>{0===t.status&&(clearTimeout(n),clearTimeout(o),r({content:t.responseText||"Network request failed",status:t.status,isTimedOut:!1}))},t.onload=()=>{clearTimeout(n),clearTimeout(o),r({content:t.responseText,status:t.status,isTimedOut:!1})},t.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:a(),requestsCache:a({serializable:!1}),hostsCache:t({caches:[r({key:`${f}-${e}`}),a()]}),...s})},e.isOnDemandTrigger=function(e){return"onDemand"===e.type},e.isScheduleTrigger=function(e){return"schedule"===e.type},e.isSubscriptionTrigger=function(e){return"subscription"===e.type}}));
@@ -17,11 +17,11 @@ export type Authentication = {
17
17
  platform?: Platform | null;
18
18
  input: AuthInputPartial;
19
19
  /**
20
- * Date of creation in RFC3339 format.
20
+ * Date of creation in RFC 3339 format.
21
21
  */
22
22
  createdAt: string;
23
23
  /**
24
- * Date of last update in RFC3339 format.
24
+ * Date of last update in RFC 3339 format.
25
25
  */
26
26
  updatedAt?: string;
27
27
  };
@@ -11,7 +11,7 @@ export type AuthenticationCreateResponse = {
11
11
  */
12
12
  name: string;
13
13
  /**
14
- * Date of creation in RFC3339 format.
14
+ * Date of creation in RFC 3339 format.
15
15
  */
16
16
  createdAt: string;
17
17
  };
@@ -11,7 +11,7 @@ export type AuthenticationUpdateResponse = {
11
11
  */
12
12
  name: string;
13
13
  /**
14
- * Date of last update in RFC3339 format.
14
+ * Date of last update in RFC 3339 format.
15
15
  */
16
16
  updatedAt: string;
17
17
  };
@@ -12,11 +12,13 @@ import type { OrderKeys } from './orderKeys';
12
12
  import type { PlatformWithNone } from './platformWithNone';
13
13
  import type { RunSortKeys } from './runSortKeys';
14
14
  import type { RunStatus } from './runStatus';
15
+ import type { SortKeys } from './sortKeys';
15
16
  import type { SourceSortKeys } from './sourceSortKeys';
16
17
  import type { SourceType } from './sourceType';
17
18
  import type { SourceUpdate } from './sourceUpdate';
18
19
  import type { TaskSortKeys } from './taskSortKeys';
19
20
  import type { TaskUpdate } from './taskUpdate';
21
+ import type { TransformationCreate } from './transformationCreate';
20
22
  import type { TriggerType } from './triggerType';
21
23
  /**
22
24
  * Properties for the `customDelete` method.
@@ -114,6 +116,15 @@ export type DeleteTaskProps = {
114
116
  */
115
117
  taskID: string;
116
118
  };
119
+ /**
120
+ * Properties for the `deleteTransformation` method.
121
+ */
122
+ export type DeleteTransformationProps = {
123
+ /**
124
+ * Unique identifier of a transformation.
125
+ */
126
+ transformationID: string;
127
+ };
117
128
  /**
118
129
  * Properties for the `disableTask` method.
119
130
  */
@@ -208,15 +219,6 @@ export type GetDestinationsProps = {
208
219
  */
209
220
  order?: OrderKeys;
210
221
  };
211
- /**
212
- * Properties for the `getDockerSourceStreams` method.
213
- */
214
- export type GetDockerSourceStreamsProps = {
215
- /**
216
- * Unique identifier of a source.
217
- */
218
- sourceID: string;
219
- };
220
222
  /**
221
223
  * Properties for the `getEvent` method.
222
224
  */
@@ -263,11 +265,11 @@ export type GetEventsProps = {
263
265
  */
264
266
  order?: OrderKeys;
265
267
  /**
266
- * Date and time in RFC3339 format for the earliest events to retrieve. By default, the current time minus three hours is used.
268
+ * Date and time in RFC 3339 format for the earliest events to retrieve. By default, the current time minus three hours is used.
267
269
  */
268
270
  startDate?: string;
269
271
  /**
270
- * Date and time in RFC3339 format for the latest events to retrieve. By default, the current time is used.
272
+ * Date and time in RFC 3339 format for the latest events to retrieve. By default, the current time is used.
271
273
  */
272
274
  endDate?: string;
273
275
  };
@@ -309,11 +311,11 @@ export type GetRunsProps = {
309
311
  */
310
312
  order?: OrderKeys;
311
313
  /**
312
- * Date in RFC3339 format for the earliest run to retrieve. By default, the current day minus seven days is used.
314
+ * Date in RFC 3339 format for the earliest run to retrieve. By default, the current day minus seven days is used.
313
315
  */
314
316
  startDate?: string;
315
317
  /**
316
- * Date in RFC3339 format for the latest run to retrieve. By default, the current day is used.
318
+ * Date in RFC 3339 format for the latest run to retrieve. By default, the current day is used.
317
319
  */
318
320
  endDate?: string;
319
321
  };
@@ -405,6 +407,28 @@ export type GetTasksProps = {
405
407
  */
406
408
  order?: OrderKeys;
407
409
  };
410
+ /**
411
+ * Properties for the `getTransformation` method.
412
+ */
413
+ export type GetTransformationProps = {
414
+ /**
415
+ * Unique identifier of a transformation.
416
+ */
417
+ transformationID: string;
418
+ };
419
+ /**
420
+ * Properties for the `getTransformations` method.
421
+ */
422
+ export type GetTransformationsProps = {
423
+ /**
424
+ * Property by which to sort the list.
425
+ */
426
+ sort?: SortKeys;
427
+ /**
428
+ * Sort order of the response, ascending or descending.
429
+ */
430
+ order?: OrderKeys;
431
+ };
408
432
  /**
409
433
  * Properties for the `runTask` method.
410
434
  */
@@ -463,4 +487,24 @@ export type UpdateTaskProps = {
463
487
  taskID: string;
464
488
  taskUpdate: TaskUpdate;
465
489
  };
490
+ /**
491
+ * Properties for the `updateTransformation` method.
492
+ */
493
+ export type UpdateTransformationProps = {
494
+ /**
495
+ * Unique identifier of a transformation.
496
+ */
497
+ transformationID: string;
498
+ transformationCreate: TransformationCreate;
499
+ };
500
+ /**
501
+ * Properties for the `validateSourceBeforeUpdate` method.
502
+ */
503
+ export type ValidateSourceBeforeUpdateProps = {
504
+ /**
505
+ * Unique identifier of a source.
506
+ */
507
+ sourceID: string;
508
+ sourceUpdate: SourceUpdate;
509
+ };
466
510
  //# sourceMappingURL=clientMethodProps.d.ts.map