@algolia/ingestion 1.52.1 → 1.54.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.
@@ -29,7 +29,7 @@ __export(ingestionClient_exports, {
29
29
  });
30
30
  module.exports = __toCommonJS(ingestionClient_exports);
31
31
  var import_client_common = require("@algolia/client-common");
32
- var apiClientVersion = "1.52.1";
32
+ var apiClientVersion = "1.54.0";
33
33
  var REGIONS = ["eu", "us"];
34
34
  function getDefaultHosts(region) {
35
35
  const url = "data.{region}.algolia.com".replace("{region}", region);
@@ -126,6 +126,7 @@ function createIngestionClient({
126
126
  * @param chunkedPush.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
127
127
  * @param chunkedPush.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
128
128
  * @param chunkedPush.referenceIndexName - This is required when targeting an index that does not have a push connector setup (e.g. a tmp index), but you wish to attach another index's transformation to it (e.g. the source index name).
129
+ * @param chunkedPush.maxRetries - The maximum number of retries when polling for task completion. 100 by default.
129
130
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getEvent` method and merged with the transporter requestOptions.
130
131
  */
131
132
  async chunkedPush({
@@ -134,7 +135,8 @@ function createIngestionClient({
134
135
  action = "addObject",
135
136
  waitForTasks,
136
137
  batchSize = 1e3,
137
- referenceIndexName
138
+ referenceIndexName,
139
+ maxRetries = 100
138
140
  }, requestOptions) {
139
141
  let records = [];
140
142
  let offset = 0;
@@ -170,8 +172,8 @@ function createIngestionClient({
170
172
  validate: (response) => response !== void 0,
171
173
  aggregator: () => retryCount += 1,
172
174
  error: {
173
- validate: () => retryCount >= 50,
174
- message: () => `The maximum number of retries exceeded. (${retryCount}/${50})`
175
+ validate: () => retryCount >= maxRetries,
176
+ message: () => `Stopped waiting for the task after ${maxRetries} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`
175
177
  },
176
178
  timeout: () => Math.min(retryCount * 1500, 5e3)
177
179
  });
@@ -192,18 +194,10 @@ function createIngestionClient({
192
194
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
193
195
  */
194
196
  createAuthentication(authenticationCreate, requestOptions) {
195
- if (!authenticationCreate) {
196
- throw new Error("Parameter `authenticationCreate` is required when calling `createAuthentication`.");
197
- }
198
- if (!authenticationCreate.type) {
199
- throw new Error("Parameter `authenticationCreate.type` is required when calling `createAuthentication`.");
200
- }
201
- if (!authenticationCreate.name) {
202
- throw new Error("Parameter `authenticationCreate.name` is required when calling `createAuthentication`.");
203
- }
204
- if (!authenticationCreate.input) {
205
- throw new Error("Parameter `authenticationCreate.input` is required when calling `createAuthentication`.");
206
- }
197
+ (0, import_client_common.validateRequired)("authenticationCreate", "createAuthentication", authenticationCreate);
198
+ (0, import_client_common.validateRequired)("authenticationCreate.type", "createAuthentication", authenticationCreate.type);
199
+ (0, import_client_common.validateRequired)("authenticationCreate.name", "createAuthentication", authenticationCreate.name);
200
+ (0, import_client_common.validateRequired)("authenticationCreate.input", "createAuthentication", authenticationCreate.input);
207
201
  const requestPath = "/1/authentications";
208
202
  const headers = {};
209
203
  const queryParameters = {};
@@ -227,18 +221,10 @@ function createIngestionClient({
227
221
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
228
222
  */
229
223
  createDestination(destinationCreate, requestOptions) {
230
- if (!destinationCreate) {
231
- throw new Error("Parameter `destinationCreate` is required when calling `createDestination`.");
232
- }
233
- if (!destinationCreate.type) {
234
- throw new Error("Parameter `destinationCreate.type` is required when calling `createDestination`.");
235
- }
236
- if (!destinationCreate.name) {
237
- throw new Error("Parameter `destinationCreate.name` is required when calling `createDestination`.");
238
- }
239
- if (!destinationCreate.input) {
240
- throw new Error("Parameter `destinationCreate.input` is required when calling `createDestination`.");
241
- }
224
+ (0, import_client_common.validateRequired)("destinationCreate", "createDestination", destinationCreate);
225
+ (0, import_client_common.validateRequired)("destinationCreate.type", "createDestination", destinationCreate.type);
226
+ (0, import_client_common.validateRequired)("destinationCreate.name", "createDestination", destinationCreate.name);
227
+ (0, import_client_common.validateRequired)("destinationCreate.input", "createDestination", destinationCreate.input);
242
228
  const requestPath = "/1/destinations";
243
229
  const headers = {};
244
230
  const queryParameters = {};
@@ -262,15 +248,9 @@ function createIngestionClient({
262
248
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
263
249
  */
264
250
  createSource(sourceCreate, requestOptions) {
265
- if (!sourceCreate) {
266
- throw new Error("Parameter `sourceCreate` is required when calling `createSource`.");
267
- }
268
- if (!sourceCreate.type) {
269
- throw new Error("Parameter `sourceCreate.type` is required when calling `createSource`.");
270
- }
271
- if (!sourceCreate.name) {
272
- throw new Error("Parameter `sourceCreate.name` is required when calling `createSource`.");
273
- }
251
+ (0, import_client_common.validateRequired)("sourceCreate", "createSource", sourceCreate);
252
+ (0, import_client_common.validateRequired)("sourceCreate.type", "createSource", sourceCreate.type);
253
+ (0, import_client_common.validateRequired)("sourceCreate.name", "createSource", sourceCreate.name);
274
254
  const requestPath = "/1/sources";
275
255
  const headers = {};
276
256
  const queryParameters = {};
@@ -294,18 +274,10 @@ function createIngestionClient({
294
274
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
295
275
  */
296
276
  createTask(taskCreate, requestOptions) {
297
- if (!taskCreate) {
298
- throw new Error("Parameter `taskCreate` is required when calling `createTask`.");
299
- }
300
- if (!taskCreate.sourceID) {
301
- throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTask`.");
302
- }
303
- if (!taskCreate.destinationID) {
304
- throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTask`.");
305
- }
306
- if (!taskCreate.action) {
307
- throw new Error("Parameter `taskCreate.action` is required when calling `createTask`.");
308
- }
277
+ (0, import_client_common.validateRequired)("taskCreate", "createTask", taskCreate);
278
+ (0, import_client_common.validateRequired)("taskCreate.sourceID", "createTask", taskCreate.sourceID);
279
+ (0, import_client_common.validateRequired)("taskCreate.destinationID", "createTask", taskCreate.destinationID);
280
+ (0, import_client_common.validateRequired)("taskCreate.action", "createTask", taskCreate.action);
309
281
  const requestPath = "/2/tasks";
310
282
  const headers = {};
311
283
  const queryParameters = {};
@@ -331,21 +303,11 @@ function createIngestionClient({
331
303
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
332
304
  */
333
305
  createTaskV1(taskCreate, requestOptions) {
334
- if (!taskCreate) {
335
- throw new Error("Parameter `taskCreate` is required when calling `createTaskV1`.");
336
- }
337
- if (!taskCreate.sourceID) {
338
- throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTaskV1`.");
339
- }
340
- if (!taskCreate.destinationID) {
341
- throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTaskV1`.");
342
- }
343
- if (!taskCreate.trigger) {
344
- throw new Error("Parameter `taskCreate.trigger` is required when calling `createTaskV1`.");
345
- }
346
- if (!taskCreate.action) {
347
- throw new Error("Parameter `taskCreate.action` is required when calling `createTaskV1`.");
348
- }
306
+ (0, import_client_common.validateRequired)("taskCreate", "createTaskV1", taskCreate);
307
+ (0, import_client_common.validateRequired)("taskCreate.sourceID", "createTaskV1", taskCreate.sourceID);
308
+ (0, import_client_common.validateRequired)("taskCreate.destinationID", "createTaskV1", taskCreate.destinationID);
309
+ (0, import_client_common.validateRequired)("taskCreate.trigger", "createTaskV1", taskCreate.trigger);
310
+ (0, import_client_common.validateRequired)("taskCreate.action", "createTaskV1", taskCreate.action);
349
311
  const requestPath = "/1/tasks";
350
312
  const headers = {};
351
313
  const queryParameters = {};
@@ -369,12 +331,8 @@ function createIngestionClient({
369
331
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
370
332
  */
371
333
  createTransformation(transformationCreate, requestOptions) {
372
- if (!transformationCreate) {
373
- throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");
374
- }
375
- if (!transformationCreate.name) {
376
- throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");
377
- }
334
+ (0, import_client_common.validateRequired)("transformationCreate", "createTransformation", transformationCreate);
335
+ (0, import_client_common.validateRequired)("transformationCreate.name", "createTransformation", transformationCreate.name);
378
336
  const requestPath = "/1/transformations";
379
337
  const headers = {};
380
338
  const queryParameters = {};
@@ -395,9 +353,7 @@ function createIngestionClient({
395
353
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
396
354
  */
397
355
  customDelete({ path, parameters }, requestOptions) {
398
- if (!path) {
399
- throw new Error("Parameter `path` is required when calling `customDelete`.");
400
- }
356
+ (0, import_client_common.validateRequired)("path", "customDelete", path);
401
357
  const requestPath = "/{path}".replace("{path}", path);
402
358
  const headers = {};
403
359
  const queryParameters = parameters ? parameters : {};
@@ -417,9 +373,7 @@ function createIngestionClient({
417
373
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
418
374
  */
419
375
  customGet({ path, parameters }, requestOptions) {
420
- if (!path) {
421
- throw new Error("Parameter `path` is required when calling `customGet`.");
422
- }
376
+ (0, import_client_common.validateRequired)("path", "customGet", path);
423
377
  const requestPath = "/{path}".replace("{path}", path);
424
378
  const headers = {};
425
379
  const queryParameters = parameters ? parameters : {};
@@ -440,9 +394,7 @@ function createIngestionClient({
440
394
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
441
395
  */
442
396
  customPost({ path, parameters, body }, requestOptions) {
443
- if (!path) {
444
- throw new Error("Parameter `path` is required when calling `customPost`.");
445
- }
397
+ (0, import_client_common.validateRequired)("path", "customPost", path);
446
398
  const requestPath = "/{path}".replace("{path}", path);
447
399
  const headers = {};
448
400
  const queryParameters = parameters ? parameters : {};
@@ -464,9 +416,7 @@ function createIngestionClient({
464
416
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
465
417
  */
466
418
  customPut({ path, parameters, body }, requestOptions) {
467
- if (!path) {
468
- throw new Error("Parameter `path` is required when calling `customPut`.");
469
- }
419
+ (0, import_client_common.validateRequired)("path", "customPut", path);
470
420
  const requestPath = "/{path}".replace("{path}", path);
471
421
  const headers = {};
472
422
  const queryParameters = parameters ? parameters : {};
@@ -491,9 +441,7 @@ function createIngestionClient({
491
441
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
492
442
  */
493
443
  deleteAuthentication({ authenticationID }, requestOptions) {
494
- if (!authenticationID) {
495
- throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");
496
- }
444
+ (0, import_client_common.validateRequired)("authenticationID", "deleteAuthentication", authenticationID);
497
445
  const requestPath = "/1/authentications/{authenticationID}".replace(
498
446
  "{authenticationID}",
499
447
  encodeURIComponent(authenticationID)
@@ -520,9 +468,7 @@ function createIngestionClient({
520
468
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
521
469
  */
522
470
  deleteDestination({ destinationID }, requestOptions) {
523
- if (!destinationID) {
524
- throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");
525
- }
471
+ (0, import_client_common.validateRequired)("destinationID", "deleteDestination", destinationID);
526
472
  const requestPath = "/1/destinations/{destinationID}".replace(
527
473
  "{destinationID}",
528
474
  encodeURIComponent(destinationID)
@@ -549,9 +495,7 @@ function createIngestionClient({
549
495
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
550
496
  */
551
497
  deleteSource({ sourceID }, requestOptions) {
552
- if (!sourceID) {
553
- throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");
554
- }
498
+ (0, import_client_common.validateRequired)("sourceID", "deleteSource", sourceID);
555
499
  const requestPath = "/1/sources/{sourceID}".replace("{sourceID}", encodeURIComponent(sourceID));
556
500
  const headers = {};
557
501
  const queryParameters = {};
@@ -575,9 +519,7 @@ function createIngestionClient({
575
519
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
576
520
  */
577
521
  deleteTask({ taskID }, requestOptions) {
578
- if (!taskID) {
579
- throw new Error("Parameter `taskID` is required when calling `deleteTask`.");
580
- }
522
+ (0, import_client_common.validateRequired)("taskID", "deleteTask", taskID);
581
523
  const requestPath = "/2/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
582
524
  const headers = {};
583
525
  const queryParameters = {};
@@ -603,9 +545,7 @@ function createIngestionClient({
603
545
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
604
546
  */
605
547
  deleteTaskV1({ taskID }, requestOptions) {
606
- if (!taskID) {
607
- throw new Error("Parameter `taskID` is required when calling `deleteTaskV1`.");
608
- }
548
+ (0, import_client_common.validateRequired)("taskID", "deleteTaskV1", taskID);
609
549
  const requestPath = "/1/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
610
550
  const headers = {};
611
551
  const queryParameters = {};
@@ -629,9 +569,7 @@ function createIngestionClient({
629
569
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
630
570
  */
631
571
  deleteTransformation({ transformationID }, requestOptions) {
632
- if (!transformationID) {
633
- throw new Error("Parameter `transformationID` is required when calling `deleteTransformation`.");
634
- }
572
+ (0, import_client_common.validateRequired)("transformationID", "deleteTransformation", transformationID);
635
573
  const requestPath = "/1/transformations/{transformationID}".replace(
636
574
  "{transformationID}",
637
575
  encodeURIComponent(transformationID)
@@ -658,9 +596,7 @@ function createIngestionClient({
658
596
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
659
597
  */
660
598
  disableTask({ taskID }, requestOptions) {
661
- if (!taskID) {
662
- throw new Error("Parameter `taskID` is required when calling `disableTask`.");
663
- }
599
+ (0, import_client_common.validateRequired)("taskID", "disableTask", taskID);
664
600
  const requestPath = "/2/tasks/{taskID}/disable".replace("{taskID}", encodeURIComponent(taskID));
665
601
  const headers = {};
666
602
  const queryParameters = {};
@@ -686,9 +622,7 @@ function createIngestionClient({
686
622
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
687
623
  */
688
624
  disableTaskV1({ taskID }, requestOptions) {
689
- if (!taskID) {
690
- throw new Error("Parameter `taskID` is required when calling `disableTaskV1`.");
691
- }
625
+ (0, import_client_common.validateRequired)("taskID", "disableTaskV1", taskID);
692
626
  const requestPath = "/1/tasks/{taskID}/disable".replace("{taskID}", encodeURIComponent(taskID));
693
627
  const headers = {};
694
628
  const queryParameters = {};
@@ -712,9 +646,7 @@ function createIngestionClient({
712
646
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
713
647
  */
714
648
  enableTask({ taskID }, requestOptions) {
715
- if (!taskID) {
716
- throw new Error("Parameter `taskID` is required when calling `enableTask`.");
717
- }
649
+ (0, import_client_common.validateRequired)("taskID", "enableTask", taskID);
718
650
  const requestPath = "/2/tasks/{taskID}/enable".replace("{taskID}", encodeURIComponent(taskID));
719
651
  const headers = {};
720
652
  const queryParameters = {};
@@ -740,9 +672,7 @@ function createIngestionClient({
740
672
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
741
673
  */
742
674
  enableTaskV1({ taskID }, requestOptions) {
743
- if (!taskID) {
744
- throw new Error("Parameter `taskID` is required when calling `enableTaskV1`.");
745
- }
675
+ (0, import_client_common.validateRequired)("taskID", "enableTaskV1", taskID);
746
676
  const requestPath = "/1/tasks/{taskID}/enable".replace("{taskID}", encodeURIComponent(taskID));
747
677
  const headers = {};
748
678
  const queryParameters = {};
@@ -766,9 +696,7 @@ function createIngestionClient({
766
696
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
767
697
  */
768
698
  getAuthentication({ authenticationID }, requestOptions) {
769
- if (!authenticationID) {
770
- throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");
771
- }
699
+ (0, import_client_common.validateRequired)("authenticationID", "getAuthentication", authenticationID);
772
700
  const requestPath = "/1/authentications/{authenticationID}".replace(
773
701
  "{authenticationID}",
774
702
  encodeURIComponent(authenticationID)
@@ -795,9 +723,7 @@ function createIngestionClient({
795
723
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
796
724
  */
797
725
  getDestination({ destinationID }, requestOptions) {
798
- if (!destinationID) {
799
- throw new Error("Parameter `destinationID` is required when calling `getDestination`.");
800
- }
726
+ (0, import_client_common.validateRequired)("destinationID", "getDestination", destinationID);
801
727
  const requestPath = "/1/destinations/{destinationID}".replace(
802
728
  "{destinationID}",
803
729
  encodeURIComponent(destinationID)
@@ -825,12 +751,8 @@ function createIngestionClient({
825
751
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
826
752
  */
827
753
  getEvent({ runID, eventID }, requestOptions) {
828
- if (!runID) {
829
- throw new Error("Parameter `runID` is required when calling `getEvent`.");
830
- }
831
- if (!eventID) {
832
- throw new Error("Parameter `eventID` is required when calling `getEvent`.");
833
- }
754
+ (0, import_client_common.validateRequired)("runID", "getEvent", runID);
755
+ (0, import_client_common.validateRequired)("eventID", "getEvent", eventID);
834
756
  const requestPath = "/1/runs/{runID}/events/{eventID}".replace("{runID}", encodeURIComponent(runID)).replace("{eventID}", encodeURIComponent(eventID));
835
757
  const headers = {};
836
758
  const queryParameters = {};
@@ -854,9 +776,7 @@ function createIngestionClient({
854
776
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
855
777
  */
856
778
  getRun({ runID }, requestOptions) {
857
- if (!runID) {
858
- throw new Error("Parameter `runID` is required when calling `getRun`.");
859
- }
779
+ (0, import_client_common.validateRequired)("runID", "getRun", runID);
860
780
  const requestPath = "/1/runs/{runID}".replace("{runID}", encodeURIComponent(runID));
861
781
  const headers = {};
862
782
  const queryParameters = {};
@@ -880,9 +800,7 @@ function createIngestionClient({
880
800
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
881
801
  */
882
802
  getSource({ sourceID }, requestOptions) {
883
- if (!sourceID) {
884
- throw new Error("Parameter `sourceID` is required when calling `getSource`.");
885
- }
803
+ (0, import_client_common.validateRequired)("sourceID", "getSource", sourceID);
886
804
  const requestPath = "/1/sources/{sourceID}".replace("{sourceID}", encodeURIComponent(sourceID));
887
805
  const headers = {};
888
806
  const queryParameters = {};
@@ -906,9 +824,7 @@ function createIngestionClient({
906
824
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
907
825
  */
908
826
  getTask({ taskID }, requestOptions) {
909
- if (!taskID) {
910
- throw new Error("Parameter `taskID` is required when calling `getTask`.");
911
- }
827
+ (0, import_client_common.validateRequired)("taskID", "getTask", taskID);
912
828
  const requestPath = "/2/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
913
829
  const headers = {};
914
830
  const queryParameters = {};
@@ -934,9 +850,7 @@ function createIngestionClient({
934
850
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
935
851
  */
936
852
  getTaskV1({ taskID }, requestOptions) {
937
- if (!taskID) {
938
- throw new Error("Parameter `taskID` is required when calling `getTaskV1`.");
939
- }
853
+ (0, import_client_common.validateRequired)("taskID", "getTaskV1", taskID);
940
854
  const requestPath = "/1/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
941
855
  const headers = {};
942
856
  const queryParameters = {};
@@ -960,9 +874,7 @@ function createIngestionClient({
960
874
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
961
875
  */
962
876
  getTransformation({ transformationID }, requestOptions) {
963
- if (!transformationID) {
964
- throw new Error("Parameter `transformationID` is required when calling `getTransformation`.");
965
- }
877
+ (0, import_client_common.validateRequired)("transformationID", "getTransformation", transformationID);
966
878
  const requestPath = "/1/transformations/{transformationID}".replace(
967
879
  "{transformationID}",
968
880
  encodeURIComponent(transformationID)
@@ -1093,9 +1005,7 @@ function createIngestionClient({
1093
1005
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1094
1006
  */
1095
1007
  listEvents({ runID, itemsPerPage, page, status, type, sort, order, startDate, endDate }, requestOptions) {
1096
- if (!runID) {
1097
- throw new Error("Parameter `runID` is required when calling `listEvents`.");
1098
- }
1008
+ (0, import_client_common.validateRequired)("runID", "listEvents", runID);
1099
1009
  const requestPath = "/1/runs/{runID}/events".replace("{runID}", encodeURIComponent(runID));
1100
1010
  const headers = {};
1101
1011
  const queryParameters = {};
@@ -1430,18 +1340,10 @@ function createIngestionClient({
1430
1340
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1431
1341
  */
1432
1342
  push({ indexName, pushTaskPayload, watch, referenceIndexName }, requestOptions) {
1433
- if (!indexName) {
1434
- throw new Error("Parameter `indexName` is required when calling `push`.");
1435
- }
1436
- if (!pushTaskPayload) {
1437
- throw new Error("Parameter `pushTaskPayload` is required when calling `push`.");
1438
- }
1439
- if (!pushTaskPayload.action) {
1440
- throw new Error("Parameter `pushTaskPayload.action` is required when calling `push`.");
1441
- }
1442
- if (!pushTaskPayload.records) {
1443
- throw new Error("Parameter `pushTaskPayload.records` is required when calling `push`.");
1444
- }
1343
+ (0, import_client_common.validateRequired)("indexName", "push", indexName);
1344
+ (0, import_client_common.validateRequired)("pushTaskPayload", "push", pushTaskPayload);
1345
+ (0, import_client_common.validateRequired)("pushTaskPayload.action", "push", pushTaskPayload.action);
1346
+ (0, import_client_common.validateRequired)("pushTaskPayload.records", "push", pushTaskPayload.records);
1445
1347
  const requestPath = "/1/push/{indexName}".replace("{indexName}", encodeURIComponent(indexName));
1446
1348
  const headers = {};
1447
1349
  const queryParameters = {};
@@ -1482,18 +1384,10 @@ function createIngestionClient({
1482
1384
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1483
1385
  */
1484
1386
  pushTask({ taskID, pushTaskPayload, watch }, requestOptions) {
1485
- if (!taskID) {
1486
- throw new Error("Parameter `taskID` is required when calling `pushTask`.");
1487
- }
1488
- if (!pushTaskPayload) {
1489
- throw new Error("Parameter `pushTaskPayload` is required when calling `pushTask`.");
1490
- }
1491
- if (!pushTaskPayload.action) {
1492
- throw new Error("Parameter `pushTaskPayload.action` is required when calling `pushTask`.");
1493
- }
1494
- if (!pushTaskPayload.records) {
1495
- throw new Error("Parameter `pushTaskPayload.records` is required when calling `pushTask`.");
1496
- }
1387
+ (0, import_client_common.validateRequired)("taskID", "pushTask", taskID);
1388
+ (0, import_client_common.validateRequired)("pushTaskPayload", "pushTask", pushTaskPayload);
1389
+ (0, import_client_common.validateRequired)("pushTaskPayload.action", "pushTask", pushTaskPayload.action);
1390
+ (0, import_client_common.validateRequired)("pushTaskPayload.records", "pushTask", pushTaskPayload.records);
1497
1391
  const requestPath = "/2/tasks/{taskID}/push".replace("{taskID}", encodeURIComponent(taskID));
1498
1392
  const headers = {};
1499
1393
  const queryParameters = {};
@@ -1530,18 +1424,10 @@ function createIngestionClient({
1530
1424
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1531
1425
  */
1532
1426
  replaceTask({ taskID, taskReplace }, requestOptions) {
1533
- if (!taskID) {
1534
- throw new Error("Parameter `taskID` is required when calling `replaceTask`.");
1535
- }
1536
- if (!taskReplace) {
1537
- throw new Error("Parameter `taskReplace` is required when calling `replaceTask`.");
1538
- }
1539
- if (!taskReplace.destinationID) {
1540
- throw new Error("Parameter `taskReplace.destinationID` is required when calling `replaceTask`.");
1541
- }
1542
- if (!taskReplace.action) {
1543
- throw new Error("Parameter `taskReplace.action` is required when calling `replaceTask`.");
1544
- }
1427
+ (0, import_client_common.validateRequired)("taskID", "replaceTask", taskID);
1428
+ (0, import_client_common.validateRequired)("taskReplace", "replaceTask", taskReplace);
1429
+ (0, import_client_common.validateRequired)("taskReplace.destinationID", "replaceTask", taskReplace.destinationID);
1430
+ (0, import_client_common.validateRequired)("taskReplace.action", "replaceTask", taskReplace.action);
1545
1431
  const requestPath = "/2/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
1546
1432
  const headers = {};
1547
1433
  const queryParameters = {};
@@ -1567,9 +1453,7 @@ function createIngestionClient({
1567
1453
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1568
1454
  */
1569
1455
  runSource({ sourceID, runSourcePayload }, requestOptions) {
1570
- if (!sourceID) {
1571
- throw new Error("Parameter `sourceID` is required when calling `runSource`.");
1572
- }
1456
+ (0, import_client_common.validateRequired)("sourceID", "runSource", sourceID);
1573
1457
  const requestPath = "/1/sources/{sourceID}/run".replace("{sourceID}", encodeURIComponent(sourceID));
1574
1458
  const headers = {};
1575
1459
  const queryParameters = {};
@@ -1595,9 +1479,7 @@ function createIngestionClient({
1595
1479
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1596
1480
  */
1597
1481
  runTask({ taskID, runTaskPayload }, requestOptions) {
1598
- if (!taskID) {
1599
- throw new Error("Parameter `taskID` is required when calling `runTask`.");
1600
- }
1482
+ (0, import_client_common.validateRequired)("taskID", "runTask", taskID);
1601
1483
  const requestPath = "/2/tasks/{taskID}/run".replace("{taskID}", encodeURIComponent(taskID));
1602
1484
  const headers = {};
1603
1485
  const queryParameters = {};
@@ -1625,9 +1507,7 @@ function createIngestionClient({
1625
1507
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1626
1508
  */
1627
1509
  runTaskV1({ taskID, runTaskPayload }, requestOptions) {
1628
- if (!taskID) {
1629
- throw new Error("Parameter `taskID` is required when calling `runTaskV1`.");
1630
- }
1510
+ (0, import_client_common.validateRequired)("taskID", "runTaskV1", taskID);
1631
1511
  const requestPath = "/1/tasks/{taskID}/run".replace("{taskID}", encodeURIComponent(taskID));
1632
1512
  const headers = {};
1633
1513
  const queryParameters = {};
@@ -1651,14 +1531,12 @@ function createIngestionClient({
1651
1531
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1652
1532
  */
1653
1533
  searchAuthentications(authenticationSearch, requestOptions) {
1654
- if (!authenticationSearch) {
1655
- throw new Error("Parameter `authenticationSearch` is required when calling `searchAuthentications`.");
1656
- }
1657
- if (!authenticationSearch.authenticationIDs) {
1658
- throw new Error(
1659
- "Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`."
1660
- );
1661
- }
1534
+ (0, import_client_common.validateRequired)("authenticationSearch", "searchAuthentications", authenticationSearch);
1535
+ (0, import_client_common.validateRequired)(
1536
+ "authenticationSearch.authenticationIDs",
1537
+ "searchAuthentications",
1538
+ authenticationSearch.authenticationIDs
1539
+ );
1662
1540
  const requestPath = "/1/authentications/search";
1663
1541
  const headers = {};
1664
1542
  const queryParameters = {};
@@ -1682,12 +1560,8 @@ function createIngestionClient({
1682
1560
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1683
1561
  */
1684
1562
  searchDestinations(destinationSearch, requestOptions) {
1685
- if (!destinationSearch) {
1686
- throw new Error("Parameter `destinationSearch` is required when calling `searchDestinations`.");
1687
- }
1688
- if (!destinationSearch.destinationIDs) {
1689
- throw new Error("Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.");
1690
- }
1563
+ (0, import_client_common.validateRequired)("destinationSearch", "searchDestinations", destinationSearch);
1564
+ (0, import_client_common.validateRequired)("destinationSearch.destinationIDs", "searchDestinations", destinationSearch.destinationIDs);
1691
1565
  const requestPath = "/1/destinations/search";
1692
1566
  const headers = {};
1693
1567
  const queryParameters = {};
@@ -1711,12 +1585,8 @@ function createIngestionClient({
1711
1585
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1712
1586
  */
1713
1587
  searchSources(sourceSearch, requestOptions) {
1714
- if (!sourceSearch) {
1715
- throw new Error("Parameter `sourceSearch` is required when calling `searchSources`.");
1716
- }
1717
- if (!sourceSearch.sourceIDs) {
1718
- throw new Error("Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.");
1719
- }
1588
+ (0, import_client_common.validateRequired)("sourceSearch", "searchSources", sourceSearch);
1589
+ (0, import_client_common.validateRequired)("sourceSearch.sourceIDs", "searchSources", sourceSearch.sourceIDs);
1720
1590
  const requestPath = "/1/sources/search";
1721
1591
  const headers = {};
1722
1592
  const queryParameters = {};
@@ -1740,12 +1610,8 @@ function createIngestionClient({
1740
1610
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1741
1611
  */
1742
1612
  searchTasks(taskSearch, requestOptions) {
1743
- if (!taskSearch) {
1744
- throw new Error("Parameter `taskSearch` is required when calling `searchTasks`.");
1745
- }
1746
- if (!taskSearch.taskIDs) {
1747
- throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.");
1748
- }
1613
+ (0, import_client_common.validateRequired)("taskSearch", "searchTasks", taskSearch);
1614
+ (0, import_client_common.validateRequired)("taskSearch.taskIDs", "searchTasks", taskSearch.taskIDs);
1749
1615
  const requestPath = "/2/tasks/search";
1750
1616
  const headers = {};
1751
1617
  const queryParameters = {};
@@ -1771,12 +1637,8 @@ function createIngestionClient({
1771
1637
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1772
1638
  */
1773
1639
  searchTasksV1(taskSearch, requestOptions) {
1774
- if (!taskSearch) {
1775
- throw new Error("Parameter `taskSearch` is required when calling `searchTasksV1`.");
1776
- }
1777
- if (!taskSearch.taskIDs) {
1778
- throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasksV1`.");
1779
- }
1640
+ (0, import_client_common.validateRequired)("taskSearch", "searchTasksV1", taskSearch);
1641
+ (0, import_client_common.validateRequired)("taskSearch.taskIDs", "searchTasksV1", taskSearch.taskIDs);
1780
1642
  const requestPath = "/1/tasks/search";
1781
1643
  const headers = {};
1782
1644
  const queryParameters = {};
@@ -1800,14 +1662,12 @@ function createIngestionClient({
1800
1662
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1801
1663
  */
1802
1664
  searchTransformations(transformationSearch, requestOptions) {
1803
- if (!transformationSearch) {
1804
- throw new Error("Parameter `transformationSearch` is required when calling `searchTransformations`.");
1805
- }
1806
- if (!transformationSearch.transformationIDs) {
1807
- throw new Error(
1808
- "Parameter `transformationSearch.transformationIDs` is required when calling `searchTransformations`."
1809
- );
1810
- }
1665
+ (0, import_client_common.validateRequired)("transformationSearch", "searchTransformations", transformationSearch);
1666
+ (0, import_client_common.validateRequired)(
1667
+ "transformationSearch.transformationIDs",
1668
+ "searchTransformations",
1669
+ transformationSearch.transformationIDs
1670
+ );
1811
1671
  const requestPath = "/1/transformations/search";
1812
1672
  const headers = {};
1813
1673
  const queryParameters = {};
@@ -1832,9 +1692,7 @@ function createIngestionClient({
1832
1692
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1833
1693
  */
1834
1694
  triggerDockerSourceDiscover({ sourceID }, requestOptions) {
1835
- if (!sourceID) {
1836
- throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");
1837
- }
1695
+ (0, import_client_common.validateRequired)("sourceID", "triggerDockerSourceDiscover", sourceID);
1838
1696
  const requestPath = "/1/sources/{sourceID}/discover".replace("{sourceID}", encodeURIComponent(sourceID));
1839
1697
  const headers = {};
1840
1698
  const queryParameters = {};
@@ -1865,12 +1723,8 @@ function createIngestionClient({
1865
1723
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1866
1724
  */
1867
1725
  tryTransformation(transformationTry, requestOptions) {
1868
- if (!transformationTry) {
1869
- throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");
1870
- }
1871
- if (!transformationTry.sampleRecord) {
1872
- throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");
1873
- }
1726
+ (0, import_client_common.validateRequired)("transformationTry", "tryTransformation", transformationTry);
1727
+ (0, import_client_common.validateRequired)("transformationTry.sampleRecord", "tryTransformation", transformationTry.sampleRecord);
1874
1728
  const requestPath = "/1/transformations/try";
1875
1729
  const headers = {};
1876
1730
  const queryParameters = {};
@@ -1896,17 +1750,13 @@ function createIngestionClient({
1896
1750
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1897
1751
  */
1898
1752
  tryTransformationBeforeUpdate({ transformationID, transformationTry }, requestOptions) {
1899
- if (!transformationID) {
1900
- throw new Error("Parameter `transformationID` is required when calling `tryTransformationBeforeUpdate`.");
1901
- }
1902
- if (!transformationTry) {
1903
- throw new Error("Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");
1904
- }
1905
- if (!transformationTry.sampleRecord) {
1906
- throw new Error(
1907
- "Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`."
1908
- );
1909
- }
1753
+ (0, import_client_common.validateRequired)("transformationID", "tryTransformationBeforeUpdate", transformationID);
1754
+ (0, import_client_common.validateRequired)("transformationTry", "tryTransformationBeforeUpdate", transformationTry);
1755
+ (0, import_client_common.validateRequired)(
1756
+ "transformationTry.sampleRecord",
1757
+ "tryTransformationBeforeUpdate",
1758
+ transformationTry.sampleRecord
1759
+ );
1910
1760
  const requestPath = "/1/transformations/{transformationID}/try".replace(
1911
1761
  "{transformationID}",
1912
1762
  encodeURIComponent(transformationID)
@@ -1935,12 +1785,8 @@ function createIngestionClient({
1935
1785
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1936
1786
  */
1937
1787
  updateAuthentication({ authenticationID, authenticationUpdate }, requestOptions) {
1938
- if (!authenticationID) {
1939
- throw new Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");
1940
- }
1941
- if (!authenticationUpdate) {
1942
- throw new Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");
1943
- }
1788
+ (0, import_client_common.validateRequired)("authenticationID", "updateAuthentication", authenticationID);
1789
+ (0, import_client_common.validateRequired)("authenticationUpdate", "updateAuthentication", authenticationUpdate);
1944
1790
  const requestPath = "/1/authentications/{authenticationID}".replace(
1945
1791
  "{authenticationID}",
1946
1792
  encodeURIComponent(authenticationID)
@@ -1969,12 +1815,8 @@ function createIngestionClient({
1969
1815
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1970
1816
  */
1971
1817
  updateDestination({ destinationID, destinationUpdate }, requestOptions) {
1972
- if (!destinationID) {
1973
- throw new Error("Parameter `destinationID` is required when calling `updateDestination`.");
1974
- }
1975
- if (!destinationUpdate) {
1976
- throw new Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");
1977
- }
1818
+ (0, import_client_common.validateRequired)("destinationID", "updateDestination", destinationID);
1819
+ (0, import_client_common.validateRequired)("destinationUpdate", "updateDestination", destinationUpdate);
1978
1820
  const requestPath = "/1/destinations/{destinationID}".replace(
1979
1821
  "{destinationID}",
1980
1822
  encodeURIComponent(destinationID)
@@ -2003,12 +1845,8 @@ function createIngestionClient({
2003
1845
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2004
1846
  */
2005
1847
  updateSource({ sourceID, sourceUpdate }, requestOptions) {
2006
- if (!sourceID) {
2007
- throw new Error("Parameter `sourceID` is required when calling `updateSource`.");
2008
- }
2009
- if (!sourceUpdate) {
2010
- throw new Error("Parameter `sourceUpdate` is required when calling `updateSource`.");
2011
- }
1848
+ (0, import_client_common.validateRequired)("sourceID", "updateSource", sourceID);
1849
+ (0, import_client_common.validateRequired)("sourceUpdate", "updateSource", sourceUpdate);
2012
1850
  const requestPath = "/1/sources/{sourceID}".replace("{sourceID}", encodeURIComponent(sourceID));
2013
1851
  const headers = {};
2014
1852
  const queryParameters = {};
@@ -2034,12 +1872,8 @@ function createIngestionClient({
2034
1872
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2035
1873
  */
2036
1874
  updateTask({ taskID, taskUpdate }, requestOptions) {
2037
- if (!taskID) {
2038
- throw new Error("Parameter `taskID` is required when calling `updateTask`.");
2039
- }
2040
- if (!taskUpdate) {
2041
- throw new Error("Parameter `taskUpdate` is required when calling `updateTask`.");
2042
- }
1875
+ (0, import_client_common.validateRequired)("taskID", "updateTask", taskID);
1876
+ (0, import_client_common.validateRequired)("taskUpdate", "updateTask", taskUpdate);
2043
1877
  const requestPath = "/2/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
2044
1878
  const headers = {};
2045
1879
  const queryParameters = {};
@@ -2067,12 +1901,8 @@ function createIngestionClient({
2067
1901
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2068
1902
  */
2069
1903
  updateTaskV1({ taskID, taskUpdate }, requestOptions) {
2070
- if (!taskID) {
2071
- throw new Error("Parameter `taskID` is required when calling `updateTaskV1`.");
2072
- }
2073
- if (!taskUpdate) {
2074
- throw new Error("Parameter `taskUpdate` is required when calling `updateTaskV1`.");
2075
- }
1904
+ (0, import_client_common.validateRequired)("taskID", "updateTaskV1", taskID);
1905
+ (0, import_client_common.validateRequired)("taskUpdate", "updateTaskV1", taskUpdate);
2076
1906
  const requestPath = "/1/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
2077
1907
  const headers = {};
2078
1908
  const queryParameters = {};
@@ -2098,15 +1928,9 @@ function createIngestionClient({
2098
1928
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2099
1929
  */
2100
1930
  updateTransformation({ transformationID, transformationCreate }, requestOptions) {
2101
- if (!transformationID) {
2102
- throw new Error("Parameter `transformationID` is required when calling `updateTransformation`.");
2103
- }
2104
- if (!transformationCreate) {
2105
- throw new Error("Parameter `transformationCreate` is required when calling `updateTransformation`.");
2106
- }
2107
- if (!transformationCreate.name) {
2108
- throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");
2109
- }
1931
+ (0, import_client_common.validateRequired)("transformationID", "updateTransformation", transformationID);
1932
+ (0, import_client_common.validateRequired)("transformationCreate", "updateTransformation", transformationCreate);
1933
+ (0, import_client_common.validateRequired)("transformationCreate.name", "updateTransformation", transformationCreate.name);
2110
1934
  const requestPath = "/1/transformations/{transformationID}".replace(
2111
1935
  "{transformationID}",
2112
1936
  encodeURIComponent(transformationID)
@@ -2166,12 +1990,8 @@ function createIngestionClient({
2166
1990
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2167
1991
  */
2168
1992
  validateSourceBeforeUpdate({ sourceID, sourceUpdate }, requestOptions) {
2169
- if (!sourceID) {
2170
- throw new Error("Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.");
2171
- }
2172
- if (!sourceUpdate) {
2173
- throw new Error("Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.");
2174
- }
1993
+ (0, import_client_common.validateRequired)("sourceID", "validateSourceBeforeUpdate", sourceID);
1994
+ (0, import_client_common.validateRequired)("sourceUpdate", "validateSourceBeforeUpdate", sourceUpdate);
2175
1995
  const requestPath = "/1/sources/{sourceID}/validate".replace("{sourceID}", encodeURIComponent(sourceID));
2176
1996
  const headers = {};
2177
1997
  const queryParameters = {};