@algolia/ingestion 5.2.4-beta.5 → 5.10.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/README.md +15 -7
  2. package/dist/browser.d.ts +1266 -634
  3. package/dist/builds/browser.js +223 -322
  4. package/dist/builds/browser.js.map +1 -1
  5. package/dist/builds/browser.min.js +1 -1
  6. package/dist/builds/browser.min.js.map +1 -1
  7. package/dist/builds/browser.umd.js +6 -6
  8. package/dist/builds/fetch.js +1943 -0
  9. package/dist/builds/fetch.js.map +1 -0
  10. package/dist/builds/node.cjs +220 -320
  11. package/dist/builds/node.cjs.map +1 -1
  12. package/dist/builds/node.js +221 -320
  13. package/dist/builds/node.js.map +1 -1
  14. package/dist/fetch.d.ts +3001 -0
  15. package/dist/node.d.cts +1267 -634
  16. package/dist/node.d.ts +1267 -634
  17. package/dist/src/ingestionClient.cjs +218 -319
  18. package/dist/src/ingestionClient.cjs.map +1 -1
  19. package/dist/src/ingestionClient.js +218 -319
  20. package/dist/src/ingestionClient.js.map +1 -1
  21. package/index.d.ts +0 -1
  22. package/index.js +1 -2
  23. package/package.json +16 -11
  24. package/model/action.ts +0 -13
  25. package/model/actionType.ts +0 -6
  26. package/model/authAPIKey.ts +0 -11
  27. package/model/authAPIKeyPartial.ts +0 -11
  28. package/model/authAlgolia.ts +0 -16
  29. package/model/authAlgoliaInsights.ts +0 -16
  30. package/model/authAlgoliaInsightsPartial.ts +0 -16
  31. package/model/authAlgoliaPartial.ts +0 -16
  32. package/model/authBasic.ts +0 -16
  33. package/model/authBasicPartial.ts +0 -16
  34. package/model/authGoogleServiceAccount.ts +0 -16
  35. package/model/authGoogleServiceAccountPartial.ts +0 -16
  36. package/model/authInput.ts +0 -16
  37. package/model/authInputPartial.ts +0 -16
  38. package/model/authOAuth.ts +0 -26
  39. package/model/authOAuthPartial.ts +0 -26
  40. package/model/authentication.ts +0 -36
  41. package/model/authenticationCreate.ts +0 -21
  42. package/model/authenticationCreateResponse.ts +0 -21
  43. package/model/authenticationSearch.ts +0 -8
  44. package/model/authenticationSortKeys.ts +0 -6
  45. package/model/authenticationType.ts +0 -6
  46. package/model/authenticationUpdate.ts +0 -21
  47. package/model/authenticationUpdateResponse.ts +0 -21
  48. package/model/bigCommerceChannel.ts +0 -13
  49. package/model/bigCommerceMetafield.ts +0 -13
  50. package/model/bigQueryDataType.ts +0 -3
  51. package/model/clientMethodProps.ts +0 -703
  52. package/model/commercetoolsCustomFields.ts +0 -21
  53. package/model/deleteResponse.ts +0 -8
  54. package/model/destination.ts +0 -40
  55. package/model/destinationCreate.ts +0 -25
  56. package/model/destinationCreateResponse.ts +0 -21
  57. package/model/destinationIndexName.ts +0 -17
  58. package/model/destinationInput.ts +0 -5
  59. package/model/destinationSearch.ts +0 -8
  60. package/model/destinationSortKeys.ts +0 -6
  61. package/model/destinationType.ts +0 -6
  62. package/model/destinationUpdate.ts +0 -25
  63. package/model/destinationUpdateResponse.ts +0 -21
  64. package/model/dockerImageType.ts +0 -6
  65. package/model/dockerRegistry.ts +0 -6
  66. package/model/dockerStreams.ts +0 -17
  67. package/model/dockerStreamsInput.ts +0 -10
  68. package/model/dockerStreamsSyncMode.ts +0 -6
  69. package/model/entityType.ts +0 -6
  70. package/model/errorBase.ts +0 -8
  71. package/model/event.ts +0 -40
  72. package/model/eventSortKeys.ts +0 -6
  73. package/model/eventStatus.ts +0 -3
  74. package/model/eventType.ts +0 -3
  75. package/model/generateTransformationCodePayload.ts +0 -9
  76. package/model/generateTransformationCodeResponse.ts +0 -5
  77. package/model/index.ts +0 -151
  78. package/model/listAuthenticationsResponse.ts +0 -10
  79. package/model/listDestinationsResponse.ts +0 -10
  80. package/model/listEventsResponse.ts +0 -13
  81. package/model/listSourcesResponse.ts +0 -10
  82. package/model/listTasksResponse.ts +0 -13
  83. package/model/listTasksResponseV1.ts +0 -13
  84. package/model/listTransformationsResponse.ts +0 -13
  85. package/model/mappingFieldDirective.ts +0 -16
  86. package/model/mappingFormatSchema.ts +0 -6
  87. package/model/mappingInput.ts +0 -13
  88. package/model/mappingKitAction.ts +0 -25
  89. package/model/mappingTypeCSV.ts +0 -3
  90. package/model/methodType.ts +0 -6
  91. package/model/model.ts +0 -13
  92. package/model/onDemandTrigger.ts +0 -15
  93. package/model/onDemandTriggerInput.ts +0 -10
  94. package/model/onDemandTriggerType.ts +0 -6
  95. package/model/orderKeys.ts +0 -6
  96. package/model/pagination.ts +0 -26
  97. package/model/platform.ts +0 -6
  98. package/model/platformNone.ts +0 -6
  99. package/model/platformWithNone.ts +0 -6
  100. package/model/pushTaskPayload.ts +0 -10
  101. package/model/pushTaskRecords.ts +0 -8
  102. package/model/recordType.ts +0 -6
  103. package/model/run.ts +0 -56
  104. package/model/runListResponse.ts +0 -13
  105. package/model/runOutcome.ts +0 -6
  106. package/model/runProgress.ts +0 -7
  107. package/model/runReasonCode.ts +0 -6
  108. package/model/runResponse.ts +0 -16
  109. package/model/runSortKeys.ts +0 -6
  110. package/model/runSourcePayload.ts +0 -22
  111. package/model/runSourceResponse.ts +0 -13
  112. package/model/runStatus.ts +0 -6
  113. package/model/runType.ts +0 -6
  114. package/model/scheduleTrigger.ts +0 -25
  115. package/model/scheduleTriggerInput.ts +0 -15
  116. package/model/scheduleTriggerType.ts +0 -6
  117. package/model/shopifyInput.ts +0 -13
  118. package/model/shopifyMarket.ts +0 -12
  119. package/model/shopifyMetafield.ts +0 -12
  120. package/model/sortKeys.ts +0 -6
  121. package/model/source.ts +0 -32
  122. package/model/sourceBigCommerce.ts +0 -19
  123. package/model/sourceBigQuery.ts +0 -37
  124. package/model/sourceCSV.ts +0 -28
  125. package/model/sourceCommercetools.ts +0 -23
  126. package/model/sourceCreate.ts +0 -20
  127. package/model/sourceCreateResponse.ts +0 -18
  128. package/model/sourceDocker.ts +0 -25
  129. package/model/sourceGA4BigQueryExport.ts +0 -18
  130. package/model/sourceInput.ts +0 -20
  131. package/model/sourceJSON.ts +0 -17
  132. package/model/sourceSearch.ts +0 -5
  133. package/model/sourceShopify.ts +0 -6
  134. package/model/sourceShopifyBase.ts +0 -8
  135. package/model/sourceSortKeys.ts +0 -6
  136. package/model/sourceType.ts +0 -13
  137. package/model/sourceUpdate.ts +0 -17
  138. package/model/sourceUpdateCommercetools.ts +0 -21
  139. package/model/sourceUpdateDocker.ts +0 -22
  140. package/model/sourceUpdateInput.ts +0 -18
  141. package/model/sourceUpdateResponse.ts +0 -18
  142. package/model/sourceUpdateShopify.ts +0 -8
  143. package/model/sourceWatchResponse.ts +0 -25
  144. package/model/streamingInput.ts +0 -10
  145. package/model/streamingTrigger.ts +0 -10
  146. package/model/streamingTriggerType.ts +0 -6
  147. package/model/subscriptionTrigger.ts +0 -10
  148. package/model/subscriptionTriggerType.ts +0 -6
  149. package/model/task.ts +0 -65
  150. package/model/taskCreate.ts +0 -43
  151. package/model/taskCreateResponse.ts +0 -16
  152. package/model/taskCreateTrigger.ts +0 -8
  153. package/model/taskCreateV1.ts +0 -41
  154. package/model/taskInput.ts +0 -10
  155. package/model/taskSearch.ts +0 -5
  156. package/model/taskSortKeys.ts +0 -6
  157. package/model/taskUpdate.ts +0 -30
  158. package/model/taskUpdateResponse.ts +0 -16
  159. package/model/taskUpdateV1.ts +0 -28
  160. package/model/taskV1.ts +0 -56
  161. package/model/transformation.ts +0 -38
  162. package/model/transformationCreate.ts +0 -26
  163. package/model/transformationCreateResponse.ts +0 -16
  164. package/model/transformationError.ts +0 -16
  165. package/model/transformationModels.ts +0 -10
  166. package/model/transformationSearch.ts +0 -5
  167. package/model/transformationTry.ts +0 -17
  168. package/model/transformationTryResponse.ts +0 -12
  169. package/model/transformationUpdateResponse.ts +0 -16
  170. package/model/trigger.ts +0 -11
  171. package/model/triggerType.ts +0 -6
  172. package/model/triggerUpdateInput.ts +0 -11
  173. package/model/window.ts +0 -16
@@ -0,0 +1,1943 @@
1
+ // builds/fetch.ts
2
+ import {
3
+ createMemoryCache,
4
+ createNullCache,
5
+ createNullLogger,
6
+ DEFAULT_CONNECT_TIMEOUT_NODE,
7
+ DEFAULT_READ_TIMEOUT_NODE,
8
+ DEFAULT_WRITE_TIMEOUT_NODE
9
+ } from "@algolia/client-common";
10
+ import { createFetchRequester } from "@algolia/requester-fetch";
11
+
12
+ // src/ingestionClient.ts
13
+ import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
14
+ var apiClientVersion = "1.10.0";
15
+ var REGIONS = ["eu", "us"];
16
+ function getDefaultHosts(region) {
17
+ const url = "data.{region}.algolia.com".replace("{region}", region);
18
+ return [{ url, accept: "readWrite", protocol: "https" }];
19
+ }
20
+ function isOnDemandTrigger(trigger) {
21
+ return trigger.type === "onDemand";
22
+ }
23
+ function isScheduleTrigger(trigger) {
24
+ return trigger.type === "schedule";
25
+ }
26
+ function isSubscriptionTrigger(trigger) {
27
+ return trigger.type === "subscription";
28
+ }
29
+ function createIngestionClient({
30
+ appId: appIdOption,
31
+ apiKey: apiKeyOption,
32
+ authMode,
33
+ algoliaAgents,
34
+ region: regionOption,
35
+ ...options
36
+ }) {
37
+ const auth = createAuth(appIdOption, apiKeyOption, authMode);
38
+ const transporter = createTransporter({
39
+ hosts: getDefaultHosts(regionOption),
40
+ ...options,
41
+ algoliaAgent: getAlgoliaAgent({
42
+ algoliaAgents,
43
+ client: "Ingestion",
44
+ version: apiClientVersion
45
+ }),
46
+ baseHeaders: {
47
+ "content-type": "text/plain",
48
+ ...auth.headers(),
49
+ ...options.baseHeaders
50
+ },
51
+ baseQueryParameters: {
52
+ ...auth.queryParameters(),
53
+ ...options.baseQueryParameters
54
+ }
55
+ });
56
+ return {
57
+ transporter,
58
+ /**
59
+ * The `appId` currently in use.
60
+ */
61
+ appId: appIdOption,
62
+ /**
63
+ * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
64
+ */
65
+ clearCache() {
66
+ return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
67
+ },
68
+ /**
69
+ * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
70
+ */
71
+ get _ua() {
72
+ return transporter.algoliaAgent.value;
73
+ },
74
+ /**
75
+ * Adds a `segment` to the `x-algolia-agent` sent with every requests.
76
+ *
77
+ * @param segment - The algolia agent (user-agent) segment to add.
78
+ * @param version - The version of the agent.
79
+ */
80
+ addAlgoliaAgent(segment, version) {
81
+ transporter.algoliaAgent.add({ segment, version });
82
+ },
83
+ /**
84
+ * Helper method to switch the API key used to authenticate the requests.
85
+ *
86
+ * @param params - Method params.
87
+ * @param params.apiKey - The new API Key to use.
88
+ */
89
+ setClientApiKey({ apiKey }) {
90
+ if (!authMode || authMode === "WithinHeaders") {
91
+ transporter.baseHeaders["x-algolia-api-key"] = apiKey;
92
+ } else {
93
+ transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
94
+ }
95
+ },
96
+ /**
97
+ * Creates a new authentication resource.
98
+ *
99
+ * Required API Key ACLs:
100
+ * - addObject
101
+ * - deleteIndex
102
+ * - editSettings
103
+ * @param authenticationCreate -
104
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
105
+ */
106
+ createAuthentication(authenticationCreate, requestOptions) {
107
+ if (!authenticationCreate) {
108
+ throw new Error("Parameter `authenticationCreate` is required when calling `createAuthentication`.");
109
+ }
110
+ if (!authenticationCreate.type) {
111
+ throw new Error("Parameter `authenticationCreate.type` is required when calling `createAuthentication`.");
112
+ }
113
+ if (!authenticationCreate.name) {
114
+ throw new Error("Parameter `authenticationCreate.name` is required when calling `createAuthentication`.");
115
+ }
116
+ if (!authenticationCreate.input) {
117
+ throw new Error("Parameter `authenticationCreate.input` is required when calling `createAuthentication`.");
118
+ }
119
+ const requestPath = "/1/authentications";
120
+ const headers = {};
121
+ const queryParameters = {};
122
+ const request = {
123
+ method: "POST",
124
+ path: requestPath,
125
+ queryParameters,
126
+ headers,
127
+ data: authenticationCreate
128
+ };
129
+ return transporter.request(request, requestOptions);
130
+ },
131
+ /**
132
+ * Creates a new destination.
133
+ *
134
+ * Required API Key ACLs:
135
+ * - addObject
136
+ * - deleteIndex
137
+ * - editSettings
138
+ * @param destinationCreate -
139
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
140
+ */
141
+ createDestination(destinationCreate, requestOptions) {
142
+ if (!destinationCreate) {
143
+ throw new Error("Parameter `destinationCreate` is required when calling `createDestination`.");
144
+ }
145
+ if (!destinationCreate.type) {
146
+ throw new Error("Parameter `destinationCreate.type` is required when calling `createDestination`.");
147
+ }
148
+ if (!destinationCreate.name) {
149
+ throw new Error("Parameter `destinationCreate.name` is required when calling `createDestination`.");
150
+ }
151
+ if (!destinationCreate.input) {
152
+ throw new Error("Parameter `destinationCreate.input` is required when calling `createDestination`.");
153
+ }
154
+ const requestPath = "/1/destinations";
155
+ const headers = {};
156
+ const queryParameters = {};
157
+ const request = {
158
+ method: "POST",
159
+ path: requestPath,
160
+ queryParameters,
161
+ headers,
162
+ data: destinationCreate
163
+ };
164
+ return transporter.request(request, requestOptions);
165
+ },
166
+ /**
167
+ * Creates a new source.
168
+ *
169
+ * Required API Key ACLs:
170
+ * - addObject
171
+ * - deleteIndex
172
+ * - editSettings
173
+ * @param sourceCreate -
174
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
175
+ */
176
+ createSource(sourceCreate, requestOptions) {
177
+ if (!sourceCreate) {
178
+ throw new Error("Parameter `sourceCreate` is required when calling `createSource`.");
179
+ }
180
+ if (!sourceCreate.type) {
181
+ throw new Error("Parameter `sourceCreate.type` is required when calling `createSource`.");
182
+ }
183
+ if (!sourceCreate.name) {
184
+ throw new Error("Parameter `sourceCreate.name` is required when calling `createSource`.");
185
+ }
186
+ const requestPath = "/1/sources";
187
+ const headers = {};
188
+ const queryParameters = {};
189
+ const request = {
190
+ method: "POST",
191
+ path: requestPath,
192
+ queryParameters,
193
+ headers,
194
+ data: sourceCreate
195
+ };
196
+ return transporter.request(request, requestOptions);
197
+ },
198
+ /**
199
+ * Creates a new task.
200
+ * @param taskCreate - Request body for creating a task.
201
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
202
+ */
203
+ createTask(taskCreate, requestOptions) {
204
+ if (!taskCreate) {
205
+ throw new Error("Parameter `taskCreate` is required when calling `createTask`.");
206
+ }
207
+ if (!taskCreate.sourceID) {
208
+ throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTask`.");
209
+ }
210
+ if (!taskCreate.destinationID) {
211
+ throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTask`.");
212
+ }
213
+ if (!taskCreate.action) {
214
+ throw new Error("Parameter `taskCreate.action` is required when calling `createTask`.");
215
+ }
216
+ const requestPath = "/2/tasks";
217
+ const headers = {};
218
+ const queryParameters = {};
219
+ const request = {
220
+ method: "POST",
221
+ path: requestPath,
222
+ queryParameters,
223
+ headers,
224
+ data: taskCreate
225
+ };
226
+ return transporter.request(request, requestOptions);
227
+ },
228
+ /**
229
+ * Creates a new task using the v1 endpoint, please use `createTask` instead.
230
+ * @param taskCreate - Request body for creating a task.
231
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
232
+ */
233
+ createTaskV1(taskCreate, requestOptions) {
234
+ if (!taskCreate) {
235
+ throw new Error("Parameter `taskCreate` is required when calling `createTaskV1`.");
236
+ }
237
+ if (!taskCreate.sourceID) {
238
+ throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTaskV1`.");
239
+ }
240
+ if (!taskCreate.destinationID) {
241
+ throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTaskV1`.");
242
+ }
243
+ if (!taskCreate.trigger) {
244
+ throw new Error("Parameter `taskCreate.trigger` is required when calling `createTaskV1`.");
245
+ }
246
+ if (!taskCreate.action) {
247
+ throw new Error("Parameter `taskCreate.action` is required when calling `createTaskV1`.");
248
+ }
249
+ const requestPath = "/1/tasks";
250
+ const headers = {};
251
+ const queryParameters = {};
252
+ const request = {
253
+ method: "POST",
254
+ path: requestPath,
255
+ queryParameters,
256
+ headers,
257
+ data: taskCreate
258
+ };
259
+ return transporter.request(request, requestOptions);
260
+ },
261
+ /**
262
+ * Creates a new transformation.
263
+ * @param transformationCreate - Request body for creating a transformation.
264
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
265
+ */
266
+ createTransformation(transformationCreate, requestOptions) {
267
+ if (!transformationCreate) {
268
+ throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");
269
+ }
270
+ if (!transformationCreate.code) {
271
+ throw new Error("Parameter `transformationCreate.code` is required when calling `createTransformation`.");
272
+ }
273
+ if (!transformationCreate.name) {
274
+ throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");
275
+ }
276
+ const requestPath = "/1/transformations";
277
+ const headers = {};
278
+ const queryParameters = {};
279
+ const request = {
280
+ method: "POST",
281
+ path: requestPath,
282
+ queryParameters,
283
+ headers,
284
+ data: transformationCreate
285
+ };
286
+ return transporter.request(request, requestOptions);
287
+ },
288
+ /**
289
+ * This method allow you to send requests to the Algolia REST API.
290
+ * @param customDelete - The customDelete object.
291
+ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
292
+ * @param customDelete.parameters - Query parameters to apply to the current query.
293
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
294
+ */
295
+ customDelete({ path, parameters }, requestOptions) {
296
+ if (!path) {
297
+ throw new Error("Parameter `path` is required when calling `customDelete`.");
298
+ }
299
+ const requestPath = "/{path}".replace("{path}", path);
300
+ const headers = {};
301
+ const queryParameters = parameters ? parameters : {};
302
+ const request = {
303
+ method: "DELETE",
304
+ path: requestPath,
305
+ queryParameters,
306
+ headers
307
+ };
308
+ return transporter.request(request, requestOptions);
309
+ },
310
+ /**
311
+ * This method allow you to send requests to the Algolia REST API.
312
+ * @param customGet - The customGet object.
313
+ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
314
+ * @param customGet.parameters - Query parameters to apply to the current query.
315
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
316
+ */
317
+ customGet({ path, parameters }, requestOptions) {
318
+ if (!path) {
319
+ throw new Error("Parameter `path` is required when calling `customGet`.");
320
+ }
321
+ const requestPath = "/{path}".replace("{path}", path);
322
+ const headers = {};
323
+ const queryParameters = parameters ? parameters : {};
324
+ const request = {
325
+ method: "GET",
326
+ path: requestPath,
327
+ queryParameters,
328
+ headers
329
+ };
330
+ return transporter.request(request, requestOptions);
331
+ },
332
+ /**
333
+ * This method allow you to send requests to the Algolia REST API.
334
+ * @param customPost - The customPost object.
335
+ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
336
+ * @param customPost.parameters - Query parameters to apply to the current query.
337
+ * @param customPost.body - Parameters to send with the custom request.
338
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
339
+ */
340
+ customPost({ path, parameters, body }, requestOptions) {
341
+ if (!path) {
342
+ throw new Error("Parameter `path` is required when calling `customPost`.");
343
+ }
344
+ const requestPath = "/{path}".replace("{path}", path);
345
+ const headers = {};
346
+ const queryParameters = parameters ? parameters : {};
347
+ const request = {
348
+ method: "POST",
349
+ path: requestPath,
350
+ queryParameters,
351
+ headers,
352
+ data: body ? body : {}
353
+ };
354
+ return transporter.request(request, requestOptions);
355
+ },
356
+ /**
357
+ * This method allow you to send requests to the Algolia REST API.
358
+ * @param customPut - The customPut object.
359
+ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
360
+ * @param customPut.parameters - Query parameters to apply to the current query.
361
+ * @param customPut.body - Parameters to send with the custom request.
362
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
363
+ */
364
+ customPut({ path, parameters, body }, requestOptions) {
365
+ if (!path) {
366
+ throw new Error("Parameter `path` is required when calling `customPut`.");
367
+ }
368
+ const requestPath = "/{path}".replace("{path}", path);
369
+ const headers = {};
370
+ const queryParameters = parameters ? parameters : {};
371
+ const request = {
372
+ method: "PUT",
373
+ path: requestPath,
374
+ queryParameters,
375
+ headers,
376
+ data: body ? body : {}
377
+ };
378
+ return transporter.request(request, requestOptions);
379
+ },
380
+ /**
381
+ * Deletes an authentication resource. You can\'t delete authentication resources that are used by a source or a destination.
382
+ *
383
+ * Required API Key ACLs:
384
+ * - addObject
385
+ * - deleteIndex
386
+ * - editSettings
387
+ * @param deleteAuthentication - The deleteAuthentication object.
388
+ * @param deleteAuthentication.authenticationID - Unique identifier of an authentication resource.
389
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
390
+ */
391
+ deleteAuthentication({ authenticationID }, requestOptions) {
392
+ if (!authenticationID) {
393
+ throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");
394
+ }
395
+ const requestPath = "/1/authentications/{authenticationID}".replace(
396
+ "{authenticationID}",
397
+ encodeURIComponent(authenticationID)
398
+ );
399
+ const headers = {};
400
+ const queryParameters = {};
401
+ const request = {
402
+ method: "DELETE",
403
+ path: requestPath,
404
+ queryParameters,
405
+ headers
406
+ };
407
+ return transporter.request(request, requestOptions);
408
+ },
409
+ /**
410
+ * Deletes a destination by its ID. You can\'t delete destinations that are referenced in tasks.
411
+ *
412
+ * Required API Key ACLs:
413
+ * - addObject
414
+ * - deleteIndex
415
+ * - editSettings
416
+ * @param deleteDestination - The deleteDestination object.
417
+ * @param deleteDestination.destinationID - Unique identifier of a destination.
418
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
419
+ */
420
+ deleteDestination({ destinationID }, requestOptions) {
421
+ if (!destinationID) {
422
+ throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");
423
+ }
424
+ const requestPath = "/1/destinations/{destinationID}".replace(
425
+ "{destinationID}",
426
+ encodeURIComponent(destinationID)
427
+ );
428
+ const headers = {};
429
+ const queryParameters = {};
430
+ const request = {
431
+ method: "DELETE",
432
+ path: requestPath,
433
+ queryParameters,
434
+ headers
435
+ };
436
+ return transporter.request(request, requestOptions);
437
+ },
438
+ /**
439
+ * Deletes a source by its ID. You can\'t delete sources that are referenced in tasks.
440
+ *
441
+ * Required API Key ACLs:
442
+ * - addObject
443
+ * - deleteIndex
444
+ * - editSettings
445
+ * @param deleteSource - The deleteSource object.
446
+ * @param deleteSource.sourceID - Unique identifier of a source.
447
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
448
+ */
449
+ deleteSource({ sourceID }, requestOptions) {
450
+ if (!sourceID) {
451
+ throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");
452
+ }
453
+ const requestPath = "/1/sources/{sourceID}".replace("{sourceID}", encodeURIComponent(sourceID));
454
+ const headers = {};
455
+ const queryParameters = {};
456
+ const request = {
457
+ method: "DELETE",
458
+ path: requestPath,
459
+ queryParameters,
460
+ headers
461
+ };
462
+ return transporter.request(request, requestOptions);
463
+ },
464
+ /**
465
+ * Deletes a task by its ID.
466
+ * @param deleteTask - The deleteTask object.
467
+ * @param deleteTask.taskID - Unique identifier of a task.
468
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
469
+ */
470
+ deleteTask({ taskID }, requestOptions) {
471
+ if (!taskID) {
472
+ throw new Error("Parameter `taskID` is required when calling `deleteTask`.");
473
+ }
474
+ const requestPath = "/2/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
475
+ const headers = {};
476
+ const queryParameters = {};
477
+ const request = {
478
+ method: "DELETE",
479
+ path: requestPath,
480
+ queryParameters,
481
+ headers
482
+ };
483
+ return transporter.request(request, requestOptions);
484
+ },
485
+ /**
486
+ * Deletes a task by its ID using the v1 endpoint, please use `deleteTask` instead.
487
+ * @param deleteTaskV1 - The deleteTaskV1 object.
488
+ * @param deleteTaskV1.taskID - Unique identifier of a task.
489
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
490
+ */
491
+ deleteTaskV1({ taskID }, requestOptions) {
492
+ if (!taskID) {
493
+ throw new Error("Parameter `taskID` is required when calling `deleteTaskV1`.");
494
+ }
495
+ const requestPath = "/1/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
496
+ const headers = {};
497
+ const queryParameters = {};
498
+ const request = {
499
+ method: "DELETE",
500
+ path: requestPath,
501
+ queryParameters,
502
+ headers
503
+ };
504
+ return transporter.request(request, requestOptions);
505
+ },
506
+ /**
507
+ * Deletes a transformation by its ID.
508
+ * @param deleteTransformation - The deleteTransformation object.
509
+ * @param deleteTransformation.transformationID - Unique identifier of a transformation.
510
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
511
+ */
512
+ deleteTransformation({ transformationID }, requestOptions) {
513
+ if (!transformationID) {
514
+ throw new Error("Parameter `transformationID` is required when calling `deleteTransformation`.");
515
+ }
516
+ const requestPath = "/1/transformations/{transformationID}".replace(
517
+ "{transformationID}",
518
+ encodeURIComponent(transformationID)
519
+ );
520
+ const headers = {};
521
+ const queryParameters = {};
522
+ const request = {
523
+ method: "DELETE",
524
+ path: requestPath,
525
+ queryParameters,
526
+ headers
527
+ };
528
+ return transporter.request(request, requestOptions);
529
+ },
530
+ /**
531
+ * Disables a task.
532
+ *
533
+ * Required API Key ACLs:
534
+ * - addObject
535
+ * - deleteIndex
536
+ * - editSettings
537
+ * @param disableTask - The disableTask object.
538
+ * @param disableTask.taskID - Unique identifier of a task.
539
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
540
+ */
541
+ disableTask({ taskID }, requestOptions) {
542
+ if (!taskID) {
543
+ throw new Error("Parameter `taskID` is required when calling `disableTask`.");
544
+ }
545
+ const requestPath = "/2/tasks/{taskID}/disable".replace("{taskID}", encodeURIComponent(taskID));
546
+ const headers = {};
547
+ const queryParameters = {};
548
+ const request = {
549
+ method: "PUT",
550
+ path: requestPath,
551
+ queryParameters,
552
+ headers
553
+ };
554
+ return transporter.request(request, requestOptions);
555
+ },
556
+ /**
557
+ * Disables a task using the v1 endpoint, please use `disableTask` instead.
558
+ *
559
+ * Required API Key ACLs:
560
+ * - addObject
561
+ * - deleteIndex
562
+ * - editSettings
563
+ * @param disableTaskV1 - The disableTaskV1 object.
564
+ * @param disableTaskV1.taskID - Unique identifier of a task.
565
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
566
+ */
567
+ disableTaskV1({ taskID }, requestOptions) {
568
+ if (!taskID) {
569
+ throw new Error("Parameter `taskID` is required when calling `disableTaskV1`.");
570
+ }
571
+ const requestPath = "/1/tasks/{taskID}/disable".replace("{taskID}", encodeURIComponent(taskID));
572
+ const headers = {};
573
+ const queryParameters = {};
574
+ const request = {
575
+ method: "PUT",
576
+ path: requestPath,
577
+ queryParameters,
578
+ headers
579
+ };
580
+ return transporter.request(request, requestOptions);
581
+ },
582
+ /**
583
+ * Enables a task.
584
+ *
585
+ * Required API Key ACLs:
586
+ * - addObject
587
+ * - deleteIndex
588
+ * - editSettings
589
+ * @param enableTask - The enableTask object.
590
+ * @param enableTask.taskID - Unique identifier of a task.
591
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
592
+ */
593
+ enableTask({ taskID }, requestOptions) {
594
+ if (!taskID) {
595
+ throw new Error("Parameter `taskID` is required when calling `enableTask`.");
596
+ }
597
+ const requestPath = "/2/tasks/{taskID}/enable".replace("{taskID}", encodeURIComponent(taskID));
598
+ const headers = {};
599
+ const queryParameters = {};
600
+ const request = {
601
+ method: "PUT",
602
+ path: requestPath,
603
+ queryParameters,
604
+ headers
605
+ };
606
+ return transporter.request(request, requestOptions);
607
+ },
608
+ /**
609
+ * Enables a task using the v1 endpoint, please use `enableTask` instead.
610
+ *
611
+ * Required API Key ACLs:
612
+ * - addObject
613
+ * - deleteIndex
614
+ * - editSettings
615
+ * @param enableTaskV1 - The enableTaskV1 object.
616
+ * @param enableTaskV1.taskID - Unique identifier of a task.
617
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
618
+ */
619
+ enableTaskV1({ taskID }, requestOptions) {
620
+ if (!taskID) {
621
+ throw new Error("Parameter `taskID` is required when calling `enableTaskV1`.");
622
+ }
623
+ const requestPath = "/1/tasks/{taskID}/enable".replace("{taskID}", encodeURIComponent(taskID));
624
+ const headers = {};
625
+ const queryParameters = {};
626
+ const request = {
627
+ method: "PUT",
628
+ path: requestPath,
629
+ queryParameters,
630
+ headers
631
+ };
632
+ return transporter.request(request, requestOptions);
633
+ },
634
+ /**
635
+ * Retrieves an authentication resource by its ID.
636
+ *
637
+ * Required API Key ACLs:
638
+ * - addObject
639
+ * - deleteIndex
640
+ * - editSettings
641
+ * @param getAuthentication - The getAuthentication object.
642
+ * @param getAuthentication.authenticationID - Unique identifier of an authentication resource.
643
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
644
+ */
645
+ getAuthentication({ authenticationID }, requestOptions) {
646
+ if (!authenticationID) {
647
+ throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");
648
+ }
649
+ const requestPath = "/1/authentications/{authenticationID}".replace(
650
+ "{authenticationID}",
651
+ encodeURIComponent(authenticationID)
652
+ );
653
+ const headers = {};
654
+ const queryParameters = {};
655
+ const request = {
656
+ method: "GET",
657
+ path: requestPath,
658
+ queryParameters,
659
+ headers
660
+ };
661
+ return transporter.request(request, requestOptions);
662
+ },
663
+ /**
664
+ * Retrieves a destination by its ID.
665
+ *
666
+ * Required API Key ACLs:
667
+ * - addObject
668
+ * - deleteIndex
669
+ * - editSettings
670
+ * @param getDestination - The getDestination object.
671
+ * @param getDestination.destinationID - Unique identifier of a destination.
672
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
673
+ */
674
+ getDestination({ destinationID }, requestOptions) {
675
+ if (!destinationID) {
676
+ throw new Error("Parameter `destinationID` is required when calling `getDestination`.");
677
+ }
678
+ const requestPath = "/1/destinations/{destinationID}".replace(
679
+ "{destinationID}",
680
+ encodeURIComponent(destinationID)
681
+ );
682
+ const headers = {};
683
+ const queryParameters = {};
684
+ const request = {
685
+ method: "GET",
686
+ path: requestPath,
687
+ queryParameters,
688
+ headers
689
+ };
690
+ return transporter.request(request, requestOptions);
691
+ },
692
+ /**
693
+ * Retrieves a single task run event by its ID.
694
+ *
695
+ * Required API Key ACLs:
696
+ * - addObject
697
+ * - deleteIndex
698
+ * - editSettings
699
+ * @param getEvent - The getEvent object.
700
+ * @param getEvent.runID - Unique identifier of a task run.
701
+ * @param getEvent.eventID - Unique identifier of an event.
702
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
703
+ */
704
+ getEvent({ runID, eventID }, requestOptions) {
705
+ if (!runID) {
706
+ throw new Error("Parameter `runID` is required when calling `getEvent`.");
707
+ }
708
+ if (!eventID) {
709
+ throw new Error("Parameter `eventID` is required when calling `getEvent`.");
710
+ }
711
+ const requestPath = "/1/runs/{runID}/events/{eventID}".replace("{runID}", encodeURIComponent(runID)).replace("{eventID}", encodeURIComponent(eventID));
712
+ const headers = {};
713
+ const queryParameters = {};
714
+ const request = {
715
+ method: "GET",
716
+ path: requestPath,
717
+ queryParameters,
718
+ headers
719
+ };
720
+ return transporter.request(request, requestOptions);
721
+ },
722
+ /**
723
+ * Retrieve a single task run by its ID.
724
+ *
725
+ * Required API Key ACLs:
726
+ * - addObject
727
+ * - deleteIndex
728
+ * - editSettings
729
+ * @param getRun - The getRun object.
730
+ * @param getRun.runID - Unique identifier of a task run.
731
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
732
+ */
733
+ getRun({ runID }, requestOptions) {
734
+ if (!runID) {
735
+ throw new Error("Parameter `runID` is required when calling `getRun`.");
736
+ }
737
+ const requestPath = "/1/runs/{runID}".replace("{runID}", encodeURIComponent(runID));
738
+ const headers = {};
739
+ const queryParameters = {};
740
+ const request = {
741
+ method: "GET",
742
+ path: requestPath,
743
+ queryParameters,
744
+ headers
745
+ };
746
+ return transporter.request(request, requestOptions);
747
+ },
748
+ /**
749
+ * Retrieve a source by its ID.
750
+ *
751
+ * Required API Key ACLs:
752
+ * - addObject
753
+ * - deleteIndex
754
+ * - editSettings
755
+ * @param getSource - The getSource object.
756
+ * @param getSource.sourceID - Unique identifier of a source.
757
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
758
+ */
759
+ getSource({ sourceID }, requestOptions) {
760
+ if (!sourceID) {
761
+ throw new Error("Parameter `sourceID` is required when calling `getSource`.");
762
+ }
763
+ const requestPath = "/1/sources/{sourceID}".replace("{sourceID}", encodeURIComponent(sourceID));
764
+ const headers = {};
765
+ const queryParameters = {};
766
+ const request = {
767
+ method: "GET",
768
+ path: requestPath,
769
+ queryParameters,
770
+ headers
771
+ };
772
+ return transporter.request(request, requestOptions);
773
+ },
774
+ /**
775
+ * Retrieves a task by its ID.
776
+ *
777
+ * Required API Key ACLs:
778
+ * - addObject
779
+ * - deleteIndex
780
+ * - editSettings
781
+ * @param getTask - The getTask object.
782
+ * @param getTask.taskID - Unique identifier of a task.
783
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
784
+ */
785
+ getTask({ taskID }, requestOptions) {
786
+ if (!taskID) {
787
+ throw new Error("Parameter `taskID` is required when calling `getTask`.");
788
+ }
789
+ const requestPath = "/2/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
790
+ const headers = {};
791
+ const queryParameters = {};
792
+ const request = {
793
+ method: "GET",
794
+ path: requestPath,
795
+ queryParameters,
796
+ headers
797
+ };
798
+ return transporter.request(request, requestOptions);
799
+ },
800
+ /**
801
+ * Retrieves a task by its ID using the v1 endpoint, please use `getTask` instead.
802
+ *
803
+ * Required API Key ACLs:
804
+ * - addObject
805
+ * - deleteIndex
806
+ * - editSettings
807
+ * @param getTaskV1 - The getTaskV1 object.
808
+ * @param getTaskV1.taskID - Unique identifier of a task.
809
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
810
+ */
811
+ getTaskV1({ taskID }, requestOptions) {
812
+ if (!taskID) {
813
+ throw new Error("Parameter `taskID` is required when calling `getTaskV1`.");
814
+ }
815
+ const requestPath = "/1/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
816
+ const headers = {};
817
+ const queryParameters = {};
818
+ const request = {
819
+ method: "GET",
820
+ path: requestPath,
821
+ queryParameters,
822
+ headers
823
+ };
824
+ return transporter.request(request, requestOptions);
825
+ },
826
+ /**
827
+ * Retrieves a transformation by its ID.
828
+ *
829
+ * Required API Key ACLs:
830
+ * - addObject
831
+ * - deleteIndex
832
+ * - editSettings
833
+ * @param getTransformation - The getTransformation object.
834
+ * @param getTransformation.transformationID - Unique identifier of a transformation.
835
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
836
+ */
837
+ getTransformation({ transformationID }, requestOptions) {
838
+ if (!transformationID) {
839
+ throw new Error("Parameter `transformationID` is required when calling `getTransformation`.");
840
+ }
841
+ const requestPath = "/1/transformations/{transformationID}".replace(
842
+ "{transformationID}",
843
+ encodeURIComponent(transformationID)
844
+ );
845
+ const headers = {};
846
+ const queryParameters = {};
847
+ const request = {
848
+ method: "GET",
849
+ path: requestPath,
850
+ queryParameters,
851
+ headers
852
+ };
853
+ return transporter.request(request, requestOptions);
854
+ },
855
+ /**
856
+ * Retrieves a list of all authentication resources.
857
+ *
858
+ * Required API Key ACLs:
859
+ * - addObject
860
+ * - deleteIndex
861
+ * - editSettings
862
+ * @param listAuthentications - The listAuthentications object.
863
+ * @param listAuthentications.itemsPerPage - Number of items per page.
864
+ * @param listAuthentications.page - Page number of the paginated API response.
865
+ * @param listAuthentications.type - Type of authentication resource to retrieve.
866
+ * @param listAuthentications.platform - Ecommerce platform for which to retrieve authentications.
867
+ * @param listAuthentications.sort - Property by which to sort the list of authentications.
868
+ * @param listAuthentications.order - Sort order of the response, ascending or descending.
869
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
870
+ */
871
+ listAuthentications({ itemsPerPage, page, type, platform, sort, order } = {}, requestOptions = void 0) {
872
+ const requestPath = "/1/authentications";
873
+ const headers = {};
874
+ const queryParameters = {};
875
+ if (itemsPerPage !== void 0) {
876
+ queryParameters["itemsPerPage"] = itemsPerPage.toString();
877
+ }
878
+ if (page !== void 0) {
879
+ queryParameters["page"] = page.toString();
880
+ }
881
+ if (type !== void 0) {
882
+ queryParameters["type"] = type.toString();
883
+ }
884
+ if (platform !== void 0) {
885
+ queryParameters["platform"] = platform.toString();
886
+ }
887
+ if (sort !== void 0) {
888
+ queryParameters["sort"] = sort.toString();
889
+ }
890
+ if (order !== void 0) {
891
+ queryParameters["order"] = order.toString();
892
+ }
893
+ const request = {
894
+ method: "GET",
895
+ path: requestPath,
896
+ queryParameters,
897
+ headers
898
+ };
899
+ return transporter.request(request, requestOptions);
900
+ },
901
+ /**
902
+ * Retrieves a list of destinations.
903
+ *
904
+ * Required API Key ACLs:
905
+ * - addObject
906
+ * - deleteIndex
907
+ * - editSettings
908
+ * @param listDestinations - The listDestinations object.
909
+ * @param listDestinations.itemsPerPage - Number of items per page.
910
+ * @param listDestinations.page - Page number of the paginated API response.
911
+ * @param listDestinations.type - Destination type.
912
+ * @param listDestinations.authenticationID - Authentication ID used by destinations.
913
+ * @param listDestinations.transformationID - Get the list of destinations used by a transformation.
914
+ * @param listDestinations.sort - Property by which to sort the destinations.
915
+ * @param listDestinations.order - Sort order of the response, ascending or descending.
916
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
917
+ */
918
+ listDestinations({ itemsPerPage, page, type, authenticationID, transformationID, sort, order } = {}, requestOptions = void 0) {
919
+ const requestPath = "/1/destinations";
920
+ const headers = {};
921
+ const queryParameters = {};
922
+ if (itemsPerPage !== void 0) {
923
+ queryParameters["itemsPerPage"] = itemsPerPage.toString();
924
+ }
925
+ if (page !== void 0) {
926
+ queryParameters["page"] = page.toString();
927
+ }
928
+ if (type !== void 0) {
929
+ queryParameters["type"] = type.toString();
930
+ }
931
+ if (authenticationID !== void 0) {
932
+ queryParameters["authenticationID"] = authenticationID.toString();
933
+ }
934
+ if (transformationID !== void 0) {
935
+ queryParameters["transformationID"] = transformationID.toString();
936
+ }
937
+ if (sort !== void 0) {
938
+ queryParameters["sort"] = sort.toString();
939
+ }
940
+ if (order !== void 0) {
941
+ queryParameters["order"] = order.toString();
942
+ }
943
+ const request = {
944
+ method: "GET",
945
+ path: requestPath,
946
+ queryParameters,
947
+ headers
948
+ };
949
+ return transporter.request(request, requestOptions);
950
+ },
951
+ /**
952
+ * Retrieves a list of events for a task run, identified by its ID.
953
+ *
954
+ * Required API Key ACLs:
955
+ * - addObject
956
+ * - deleteIndex
957
+ * - editSettings
958
+ * @param listEvents - The listEvents object.
959
+ * @param listEvents.runID - Unique identifier of a task run.
960
+ * @param listEvents.itemsPerPage - Number of items per page.
961
+ * @param listEvents.page - Page number of the paginated API response.
962
+ * @param listEvents.status - Event status for filtering the list of task runs.
963
+ * @param listEvents.type - Event type for filtering the list of task runs.
964
+ * @param listEvents.sort - Property by which to sort the list of task run events.
965
+ * @param listEvents.order - Sort order of the response, ascending or descending.
966
+ * @param listEvents.startDate - Date and time in RFC 3339 format for the earliest events to retrieve. By default, the current time minus three hours is used.
967
+ * @param listEvents.endDate - Date and time in RFC 3339 format for the latest events to retrieve. By default, the current time is used.
968
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
969
+ */
970
+ listEvents({ runID, itemsPerPage, page, status, type, sort, order, startDate, endDate }, requestOptions) {
971
+ if (!runID) {
972
+ throw new Error("Parameter `runID` is required when calling `listEvents`.");
973
+ }
974
+ const requestPath = "/1/runs/{runID}/events".replace("{runID}", encodeURIComponent(runID));
975
+ const headers = {};
976
+ const queryParameters = {};
977
+ if (itemsPerPage !== void 0) {
978
+ queryParameters["itemsPerPage"] = itemsPerPage.toString();
979
+ }
980
+ if (page !== void 0) {
981
+ queryParameters["page"] = page.toString();
982
+ }
983
+ if (status !== void 0) {
984
+ queryParameters["status"] = status.toString();
985
+ }
986
+ if (type !== void 0) {
987
+ queryParameters["type"] = type.toString();
988
+ }
989
+ if (sort !== void 0) {
990
+ queryParameters["sort"] = sort.toString();
991
+ }
992
+ if (order !== void 0) {
993
+ queryParameters["order"] = order.toString();
994
+ }
995
+ if (startDate !== void 0) {
996
+ queryParameters["startDate"] = startDate.toString();
997
+ }
998
+ if (endDate !== void 0) {
999
+ queryParameters["endDate"] = endDate.toString();
1000
+ }
1001
+ const request = {
1002
+ method: "GET",
1003
+ path: requestPath,
1004
+ queryParameters,
1005
+ headers
1006
+ };
1007
+ return transporter.request(request, requestOptions);
1008
+ },
1009
+ /**
1010
+ * Retrieve a list of task runs.
1011
+ *
1012
+ * Required API Key ACLs:
1013
+ * - addObject
1014
+ * - deleteIndex
1015
+ * - editSettings
1016
+ * @param listRuns - The listRuns object.
1017
+ * @param listRuns.itemsPerPage - Number of items per page.
1018
+ * @param listRuns.page - Page number of the paginated API response.
1019
+ * @param listRuns.status - Run status for filtering the list of task runs.
1020
+ * @param listRuns.type - Run type for filtering the list of task runs.
1021
+ * @param listRuns.taskID - Task ID for filtering the list of task runs.
1022
+ * @param listRuns.sort - Property by which to sort the list of task runs.
1023
+ * @param listRuns.order - Sort order of the response, ascending or descending.
1024
+ * @param listRuns.startDate - Date in RFC 3339 format for the earliest run to retrieve. By default, the current day minus seven days is used.
1025
+ * @param listRuns.endDate - Date in RFC 3339 format for the latest run to retrieve. By default, the current day is used.
1026
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1027
+ */
1028
+ listRuns({ itemsPerPage, page, status, type, taskID, sort, order, startDate, endDate } = {}, requestOptions = void 0) {
1029
+ const requestPath = "/1/runs";
1030
+ const headers = {};
1031
+ const queryParameters = {};
1032
+ if (itemsPerPage !== void 0) {
1033
+ queryParameters["itemsPerPage"] = itemsPerPage.toString();
1034
+ }
1035
+ if (page !== void 0) {
1036
+ queryParameters["page"] = page.toString();
1037
+ }
1038
+ if (status !== void 0) {
1039
+ queryParameters["status"] = status.toString();
1040
+ }
1041
+ if (type !== void 0) {
1042
+ queryParameters["type"] = type.toString();
1043
+ }
1044
+ if (taskID !== void 0) {
1045
+ queryParameters["taskID"] = taskID.toString();
1046
+ }
1047
+ if (sort !== void 0) {
1048
+ queryParameters["sort"] = sort.toString();
1049
+ }
1050
+ if (order !== void 0) {
1051
+ queryParameters["order"] = order.toString();
1052
+ }
1053
+ if (startDate !== void 0) {
1054
+ queryParameters["startDate"] = startDate.toString();
1055
+ }
1056
+ if (endDate !== void 0) {
1057
+ queryParameters["endDate"] = endDate.toString();
1058
+ }
1059
+ const request = {
1060
+ method: "GET",
1061
+ path: requestPath,
1062
+ queryParameters,
1063
+ headers
1064
+ };
1065
+ return transporter.request(request, requestOptions);
1066
+ },
1067
+ /**
1068
+ * Retrieves a list of sources.
1069
+ *
1070
+ * Required API Key ACLs:
1071
+ * - addObject
1072
+ * - deleteIndex
1073
+ * - editSettings
1074
+ * @param listSources - The listSources object.
1075
+ * @param listSources.itemsPerPage - Number of items per page.
1076
+ * @param listSources.page - Page number of the paginated API response.
1077
+ * @param listSources.type - Source type. Some sources require authentication.
1078
+ * @param listSources.authenticationID - Authentication IDs of the sources to retrieve. \'none\' returns sources that doesn\'t have an authentication.
1079
+ * @param listSources.sort - Property by which to sort the list of sources.
1080
+ * @param listSources.order - Sort order of the response, ascending or descending.
1081
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1082
+ */
1083
+ listSources({ itemsPerPage, page, type, authenticationID, sort, order } = {}, requestOptions = void 0) {
1084
+ const requestPath = "/1/sources";
1085
+ const headers = {};
1086
+ const queryParameters = {};
1087
+ if (itemsPerPage !== void 0) {
1088
+ queryParameters["itemsPerPage"] = itemsPerPage.toString();
1089
+ }
1090
+ if (page !== void 0) {
1091
+ queryParameters["page"] = page.toString();
1092
+ }
1093
+ if (type !== void 0) {
1094
+ queryParameters["type"] = type.toString();
1095
+ }
1096
+ if (authenticationID !== void 0) {
1097
+ queryParameters["authenticationID"] = authenticationID.toString();
1098
+ }
1099
+ if (sort !== void 0) {
1100
+ queryParameters["sort"] = sort.toString();
1101
+ }
1102
+ if (order !== void 0) {
1103
+ queryParameters["order"] = order.toString();
1104
+ }
1105
+ const request = {
1106
+ method: "GET",
1107
+ path: requestPath,
1108
+ queryParameters,
1109
+ headers
1110
+ };
1111
+ return transporter.request(request, requestOptions);
1112
+ },
1113
+ /**
1114
+ * Retrieves a list of tasks.
1115
+ *
1116
+ * Required API Key ACLs:
1117
+ * - addObject
1118
+ * - deleteIndex
1119
+ * - editSettings
1120
+ * @param listTasks - The listTasks object.
1121
+ * @param listTasks.itemsPerPage - Number of items per page.
1122
+ * @param listTasks.page - Page number of the paginated API response.
1123
+ * @param listTasks.action - Actions for filtering the list of tasks.
1124
+ * @param listTasks.enabled - Whether to filter the list of tasks by the `enabled` status.
1125
+ * @param listTasks.sourceID - Source IDs for filtering the list of tasks.
1126
+ * @param listTasks.destinationID - Destination IDs for filtering the list of tasks.
1127
+ * @param listTasks.triggerType - Type of task trigger for filtering the list of tasks.
1128
+ * @param listTasks.sort - Property by which to sort the list of tasks.
1129
+ * @param listTasks.order - Sort order of the response, ascending or descending.
1130
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1131
+ */
1132
+ listTasks({ itemsPerPage, page, action, enabled, sourceID, destinationID, triggerType, sort, order } = {}, requestOptions = void 0) {
1133
+ const requestPath = "/2/tasks";
1134
+ const headers = {};
1135
+ const queryParameters = {};
1136
+ if (itemsPerPage !== void 0) {
1137
+ queryParameters["itemsPerPage"] = itemsPerPage.toString();
1138
+ }
1139
+ if (page !== void 0) {
1140
+ queryParameters["page"] = page.toString();
1141
+ }
1142
+ if (action !== void 0) {
1143
+ queryParameters["action"] = action.toString();
1144
+ }
1145
+ if (enabled !== void 0) {
1146
+ queryParameters["enabled"] = enabled.toString();
1147
+ }
1148
+ if (sourceID !== void 0) {
1149
+ queryParameters["sourceID"] = sourceID.toString();
1150
+ }
1151
+ if (destinationID !== void 0) {
1152
+ queryParameters["destinationID"] = destinationID.toString();
1153
+ }
1154
+ if (triggerType !== void 0) {
1155
+ queryParameters["triggerType"] = triggerType.toString();
1156
+ }
1157
+ if (sort !== void 0) {
1158
+ queryParameters["sort"] = sort.toString();
1159
+ }
1160
+ if (order !== void 0) {
1161
+ queryParameters["order"] = order.toString();
1162
+ }
1163
+ const request = {
1164
+ method: "GET",
1165
+ path: requestPath,
1166
+ queryParameters,
1167
+ headers
1168
+ };
1169
+ return transporter.request(request, requestOptions);
1170
+ },
1171
+ /**
1172
+ * Retrieves a list of tasks using the v1 endpoint, please use `getTasks` instead.
1173
+ *
1174
+ * Required API Key ACLs:
1175
+ * - addObject
1176
+ * - deleteIndex
1177
+ * - editSettings
1178
+ * @param listTasksV1 - The listTasksV1 object.
1179
+ * @param listTasksV1.itemsPerPage - Number of items per page.
1180
+ * @param listTasksV1.page - Page number of the paginated API response.
1181
+ * @param listTasksV1.action - Actions for filtering the list of tasks.
1182
+ * @param listTasksV1.enabled - Whether to filter the list of tasks by the `enabled` status.
1183
+ * @param listTasksV1.sourceID - Source IDs for filtering the list of tasks.
1184
+ * @param listTasksV1.destinationID - Destination IDs for filtering the list of tasks.
1185
+ * @param listTasksV1.triggerType - Type of task trigger for filtering the list of tasks.
1186
+ * @param listTasksV1.sort - Property by which to sort the list of tasks.
1187
+ * @param listTasksV1.order - Sort order of the response, ascending or descending.
1188
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1189
+ */
1190
+ listTasksV1({ itemsPerPage, page, action, enabled, sourceID, destinationID, triggerType, sort, order } = {}, requestOptions = void 0) {
1191
+ const requestPath = "/1/tasks";
1192
+ const headers = {};
1193
+ const queryParameters = {};
1194
+ if (itemsPerPage !== void 0) {
1195
+ queryParameters["itemsPerPage"] = itemsPerPage.toString();
1196
+ }
1197
+ if (page !== void 0) {
1198
+ queryParameters["page"] = page.toString();
1199
+ }
1200
+ if (action !== void 0) {
1201
+ queryParameters["action"] = action.toString();
1202
+ }
1203
+ if (enabled !== void 0) {
1204
+ queryParameters["enabled"] = enabled.toString();
1205
+ }
1206
+ if (sourceID !== void 0) {
1207
+ queryParameters["sourceID"] = sourceID.toString();
1208
+ }
1209
+ if (destinationID !== void 0) {
1210
+ queryParameters["destinationID"] = destinationID.toString();
1211
+ }
1212
+ if (triggerType !== void 0) {
1213
+ queryParameters["triggerType"] = triggerType.toString();
1214
+ }
1215
+ if (sort !== void 0) {
1216
+ queryParameters["sort"] = sort.toString();
1217
+ }
1218
+ if (order !== void 0) {
1219
+ queryParameters["order"] = order.toString();
1220
+ }
1221
+ const request = {
1222
+ method: "GET",
1223
+ path: requestPath,
1224
+ queryParameters,
1225
+ headers
1226
+ };
1227
+ return transporter.request(request, requestOptions);
1228
+ },
1229
+ /**
1230
+ * Retrieves a list of transformations.
1231
+ *
1232
+ * Required API Key ACLs:
1233
+ * - addObject
1234
+ * - deleteIndex
1235
+ * - editSettings
1236
+ * @param listTransformations - The listTransformations object.
1237
+ * @param listTransformations.itemsPerPage - Number of items per page.
1238
+ * @param listTransformations.page - Page number of the paginated API response.
1239
+ * @param listTransformations.sort - Property by which to sort the list of transformations.
1240
+ * @param listTransformations.order - Sort order of the response, ascending or descending.
1241
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1242
+ */
1243
+ listTransformations({ itemsPerPage, page, sort, order } = {}, requestOptions = void 0) {
1244
+ const requestPath = "/1/transformations";
1245
+ const headers = {};
1246
+ const queryParameters = {};
1247
+ if (itemsPerPage !== void 0) {
1248
+ queryParameters["itemsPerPage"] = itemsPerPage.toString();
1249
+ }
1250
+ if (page !== void 0) {
1251
+ queryParameters["page"] = page.toString();
1252
+ }
1253
+ if (sort !== void 0) {
1254
+ queryParameters["sort"] = sort.toString();
1255
+ }
1256
+ if (order !== void 0) {
1257
+ queryParameters["order"] = order.toString();
1258
+ }
1259
+ const request = {
1260
+ method: "GET",
1261
+ path: requestPath,
1262
+ queryParameters,
1263
+ headers
1264
+ };
1265
+ return transporter.request(request, requestOptions);
1266
+ },
1267
+ /**
1268
+ * Push a `batch` request payload through the Pipeline. You can check the status of task pushes with the observability endpoints.
1269
+ *
1270
+ * Required API Key ACLs:
1271
+ * - addObject
1272
+ * - deleteIndex
1273
+ * - editSettings
1274
+ * @param pushTask - The pushTask object.
1275
+ * @param pushTask.taskID - Unique identifier of a task.
1276
+ * @param pushTask.pushTaskPayload - Request body of a Search API `batch` request that will be pushed in the Connectors pipeline.
1277
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1278
+ */
1279
+ pushTask({ taskID, pushTaskPayload }, requestOptions) {
1280
+ if (!taskID) {
1281
+ throw new Error("Parameter `taskID` is required when calling `pushTask`.");
1282
+ }
1283
+ if (!pushTaskPayload) {
1284
+ throw new Error("Parameter `pushTaskPayload` is required when calling `pushTask`.");
1285
+ }
1286
+ if (!pushTaskPayload.action) {
1287
+ throw new Error("Parameter `pushTaskPayload.action` is required when calling `pushTask`.");
1288
+ }
1289
+ if (!pushTaskPayload.records) {
1290
+ throw new Error("Parameter `pushTaskPayload.records` is required when calling `pushTask`.");
1291
+ }
1292
+ const requestPath = "/2/tasks/{taskID}/push".replace("{taskID}", encodeURIComponent(taskID));
1293
+ const headers = {};
1294
+ const queryParameters = {};
1295
+ const request = {
1296
+ method: "POST",
1297
+ path: requestPath,
1298
+ queryParameters,
1299
+ headers,
1300
+ data: pushTaskPayload
1301
+ };
1302
+ return transporter.request(request, requestOptions);
1303
+ },
1304
+ /**
1305
+ * Runs all tasks linked to a source, only available for Shopify sources. It will create 1 run per task.
1306
+ *
1307
+ * Required API Key ACLs:
1308
+ * - addObject
1309
+ * - deleteIndex
1310
+ * - editSettings
1311
+ * @param runSource - The runSource object.
1312
+ * @param runSource.sourceID - Unique identifier of a source.
1313
+ * @param runSource.runSourcePayload -
1314
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1315
+ */
1316
+ runSource({ sourceID, runSourcePayload }, requestOptions) {
1317
+ if (!sourceID) {
1318
+ throw new Error("Parameter `sourceID` is required when calling `runSource`.");
1319
+ }
1320
+ const requestPath = "/1/sources/{sourceID}/run".replace("{sourceID}", encodeURIComponent(sourceID));
1321
+ const headers = {};
1322
+ const queryParameters = {};
1323
+ const request = {
1324
+ method: "POST",
1325
+ path: requestPath,
1326
+ queryParameters,
1327
+ headers,
1328
+ data: runSourcePayload ? runSourcePayload : {}
1329
+ };
1330
+ return transporter.request(request, requestOptions);
1331
+ },
1332
+ /**
1333
+ * Runs a task. You can check the status of task runs with the observability endpoints.
1334
+ *
1335
+ * Required API Key ACLs:
1336
+ * - addObject
1337
+ * - deleteIndex
1338
+ * - editSettings
1339
+ * @param runTask - The runTask object.
1340
+ * @param runTask.taskID - Unique identifier of a task.
1341
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1342
+ */
1343
+ runTask({ taskID }, requestOptions) {
1344
+ if (!taskID) {
1345
+ throw new Error("Parameter `taskID` is required when calling `runTask`.");
1346
+ }
1347
+ const requestPath = "/2/tasks/{taskID}/run".replace("{taskID}", encodeURIComponent(taskID));
1348
+ const headers = {};
1349
+ const queryParameters = {};
1350
+ const request = {
1351
+ method: "POST",
1352
+ path: requestPath,
1353
+ queryParameters,
1354
+ headers
1355
+ };
1356
+ return transporter.request(request, requestOptions);
1357
+ },
1358
+ /**
1359
+ * Runs a task using the v1 endpoint, please use `runTask` instead. You can check the status of task runs with the observability endpoints.
1360
+ *
1361
+ * Required API Key ACLs:
1362
+ * - addObject
1363
+ * - deleteIndex
1364
+ * - editSettings
1365
+ * @param runTaskV1 - The runTaskV1 object.
1366
+ * @param runTaskV1.taskID - Unique identifier of a task.
1367
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1368
+ */
1369
+ runTaskV1({ taskID }, requestOptions) {
1370
+ if (!taskID) {
1371
+ throw new Error("Parameter `taskID` is required when calling `runTaskV1`.");
1372
+ }
1373
+ const requestPath = "/1/tasks/{taskID}/run".replace("{taskID}", encodeURIComponent(taskID));
1374
+ const headers = {};
1375
+ const queryParameters = {};
1376
+ const request = {
1377
+ method: "POST",
1378
+ path: requestPath,
1379
+ queryParameters,
1380
+ headers
1381
+ };
1382
+ return transporter.request(request, requestOptions);
1383
+ },
1384
+ /**
1385
+ * Searches for authentication resources.
1386
+ *
1387
+ * Required API Key ACLs:
1388
+ * - addObject
1389
+ * - deleteIndex
1390
+ * - editSettings
1391
+ * @param authenticationSearch - The authenticationSearch object.
1392
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1393
+ */
1394
+ searchAuthentications(authenticationSearch, requestOptions) {
1395
+ if (!authenticationSearch) {
1396
+ throw new Error("Parameter `authenticationSearch` is required when calling `searchAuthentications`.");
1397
+ }
1398
+ if (!authenticationSearch.authenticationIDs) {
1399
+ throw new Error(
1400
+ "Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`."
1401
+ );
1402
+ }
1403
+ const requestPath = "/1/authentications/search";
1404
+ const headers = {};
1405
+ const queryParameters = {};
1406
+ const request = {
1407
+ method: "POST",
1408
+ path: requestPath,
1409
+ queryParameters,
1410
+ headers,
1411
+ data: authenticationSearch
1412
+ };
1413
+ return transporter.request(request, requestOptions);
1414
+ },
1415
+ /**
1416
+ * Searches for destinations.
1417
+ *
1418
+ * Required API Key ACLs:
1419
+ * - addObject
1420
+ * - deleteIndex
1421
+ * - editSettings
1422
+ * @param destinationSearch - The destinationSearch object.
1423
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1424
+ */
1425
+ searchDestinations(destinationSearch, requestOptions) {
1426
+ if (!destinationSearch) {
1427
+ throw new Error("Parameter `destinationSearch` is required when calling `searchDestinations`.");
1428
+ }
1429
+ if (!destinationSearch.destinationIDs) {
1430
+ throw new Error("Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.");
1431
+ }
1432
+ const requestPath = "/1/destinations/search";
1433
+ const headers = {};
1434
+ const queryParameters = {};
1435
+ const request = {
1436
+ method: "POST",
1437
+ path: requestPath,
1438
+ queryParameters,
1439
+ headers,
1440
+ data: destinationSearch
1441
+ };
1442
+ return transporter.request(request, requestOptions);
1443
+ },
1444
+ /**
1445
+ * Searches for sources.
1446
+ *
1447
+ * Required API Key ACLs:
1448
+ * - addObject
1449
+ * - deleteIndex
1450
+ * - editSettings
1451
+ * @param sourceSearch - The sourceSearch object.
1452
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1453
+ */
1454
+ searchSources(sourceSearch, requestOptions) {
1455
+ if (!sourceSearch) {
1456
+ throw new Error("Parameter `sourceSearch` is required when calling `searchSources`.");
1457
+ }
1458
+ if (!sourceSearch.sourceIDs) {
1459
+ throw new Error("Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.");
1460
+ }
1461
+ const requestPath = "/1/sources/search";
1462
+ const headers = {};
1463
+ const queryParameters = {};
1464
+ const request = {
1465
+ method: "POST",
1466
+ path: requestPath,
1467
+ queryParameters,
1468
+ headers,
1469
+ data: sourceSearch
1470
+ };
1471
+ return transporter.request(request, requestOptions);
1472
+ },
1473
+ /**
1474
+ * Searches for tasks.
1475
+ *
1476
+ * Required API Key ACLs:
1477
+ * - addObject
1478
+ * - deleteIndex
1479
+ * - editSettings
1480
+ * @param taskSearch - The taskSearch object.
1481
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1482
+ */
1483
+ searchTasks(taskSearch, requestOptions) {
1484
+ if (!taskSearch) {
1485
+ throw new Error("Parameter `taskSearch` is required when calling `searchTasks`.");
1486
+ }
1487
+ if (!taskSearch.taskIDs) {
1488
+ throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.");
1489
+ }
1490
+ const requestPath = "/2/tasks/search";
1491
+ const headers = {};
1492
+ const queryParameters = {};
1493
+ const request = {
1494
+ method: "POST",
1495
+ path: requestPath,
1496
+ queryParameters,
1497
+ headers,
1498
+ data: taskSearch
1499
+ };
1500
+ return transporter.request(request, requestOptions);
1501
+ },
1502
+ /**
1503
+ * Searches for tasks using the v1 endpoint, please use `searchTasks` instead.
1504
+ *
1505
+ * Required API Key ACLs:
1506
+ * - addObject
1507
+ * - deleteIndex
1508
+ * - editSettings
1509
+ * @param taskSearch - The taskSearch object.
1510
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1511
+ */
1512
+ searchTasksV1(taskSearch, requestOptions) {
1513
+ if (!taskSearch) {
1514
+ throw new Error("Parameter `taskSearch` is required when calling `searchTasksV1`.");
1515
+ }
1516
+ if (!taskSearch.taskIDs) {
1517
+ throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasksV1`.");
1518
+ }
1519
+ const requestPath = "/1/tasks/search";
1520
+ const headers = {};
1521
+ const queryParameters = {};
1522
+ const request = {
1523
+ method: "POST",
1524
+ path: requestPath,
1525
+ queryParameters,
1526
+ headers,
1527
+ data: taskSearch
1528
+ };
1529
+ return transporter.request(request, requestOptions);
1530
+ },
1531
+ /**
1532
+ * Searches for transformations.
1533
+ *
1534
+ * Required API Key ACLs:
1535
+ * - addObject
1536
+ * - deleteIndex
1537
+ * - editSettings
1538
+ * @param transformationSearch - The transformationSearch object.
1539
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1540
+ */
1541
+ searchTransformations(transformationSearch, requestOptions) {
1542
+ if (!transformationSearch) {
1543
+ throw new Error("Parameter `transformationSearch` is required when calling `searchTransformations`.");
1544
+ }
1545
+ if (!transformationSearch.transformationIDs) {
1546
+ throw new Error(
1547
+ "Parameter `transformationSearch.transformationIDs` is required when calling `searchTransformations`."
1548
+ );
1549
+ }
1550
+ const requestPath = "/1/transformations/search";
1551
+ const headers = {};
1552
+ const queryParameters = {};
1553
+ const request = {
1554
+ method: "POST",
1555
+ path: requestPath,
1556
+ queryParameters,
1557
+ headers,
1558
+ data: transformationSearch
1559
+ };
1560
+ return transporter.request(request, requestOptions);
1561
+ },
1562
+ /**
1563
+ * Triggers a stream-listing request for a source. Triggering stream-listing requests only works with sources with `type: docker` and `imageType: singer`.
1564
+ *
1565
+ * Required API Key ACLs:
1566
+ * - addObject
1567
+ * - deleteIndex
1568
+ * - editSettings
1569
+ * @param triggerDockerSourceDiscover - The triggerDockerSourceDiscover object.
1570
+ * @param triggerDockerSourceDiscover.sourceID - Unique identifier of a source.
1571
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1572
+ */
1573
+ triggerDockerSourceDiscover({ sourceID }, requestOptions) {
1574
+ if (!sourceID) {
1575
+ throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");
1576
+ }
1577
+ const requestPath = "/1/sources/{sourceID}/discover".replace("{sourceID}", encodeURIComponent(sourceID));
1578
+ const headers = {};
1579
+ const queryParameters = {};
1580
+ const request = {
1581
+ method: "POST",
1582
+ path: requestPath,
1583
+ queryParameters,
1584
+ headers
1585
+ };
1586
+ return transporter.request(request, requestOptions);
1587
+ },
1588
+ /**
1589
+ * Try a transformation before creating it.
1590
+ *
1591
+ * Required API Key ACLs:
1592
+ * - addObject
1593
+ * - deleteIndex
1594
+ * - editSettings
1595
+ * @param transformationTry - The transformationTry object.
1596
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1597
+ */
1598
+ tryTransformation(transformationTry, requestOptions) {
1599
+ if (!transformationTry) {
1600
+ throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");
1601
+ }
1602
+ if (!transformationTry.code) {
1603
+ throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformation`.");
1604
+ }
1605
+ if (!transformationTry.sampleRecord) {
1606
+ throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");
1607
+ }
1608
+ const requestPath = "/1/transformations/try";
1609
+ const headers = {};
1610
+ const queryParameters = {};
1611
+ const request = {
1612
+ method: "POST",
1613
+ path: requestPath,
1614
+ queryParameters,
1615
+ headers,
1616
+ data: transformationTry
1617
+ };
1618
+ return transporter.request(request, requestOptions);
1619
+ },
1620
+ /**
1621
+ * Try a transformation before updating it.
1622
+ *
1623
+ * Required API Key ACLs:
1624
+ * - addObject
1625
+ * - deleteIndex
1626
+ * - editSettings
1627
+ * @param tryTransformationBeforeUpdate - The tryTransformationBeforeUpdate object.
1628
+ * @param tryTransformationBeforeUpdate.transformationID - Unique identifier of a transformation.
1629
+ * @param tryTransformationBeforeUpdate.transformationTry - The transformationTry object.
1630
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1631
+ */
1632
+ tryTransformationBeforeUpdate({ transformationID, transformationTry }, requestOptions) {
1633
+ if (!transformationID) {
1634
+ throw new Error("Parameter `transformationID` is required when calling `tryTransformationBeforeUpdate`.");
1635
+ }
1636
+ if (!transformationTry) {
1637
+ throw new Error("Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");
1638
+ }
1639
+ if (!transformationTry.code) {
1640
+ throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformationBeforeUpdate`.");
1641
+ }
1642
+ if (!transformationTry.sampleRecord) {
1643
+ throw new Error(
1644
+ "Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`."
1645
+ );
1646
+ }
1647
+ const requestPath = "/1/transformations/{transformationID}/try".replace(
1648
+ "{transformationID}",
1649
+ encodeURIComponent(transformationID)
1650
+ );
1651
+ const headers = {};
1652
+ const queryParameters = {};
1653
+ const request = {
1654
+ method: "POST",
1655
+ path: requestPath,
1656
+ queryParameters,
1657
+ headers,
1658
+ data: transformationTry
1659
+ };
1660
+ return transporter.request(request, requestOptions);
1661
+ },
1662
+ /**
1663
+ * Updates an authentication resource.
1664
+ *
1665
+ * Required API Key ACLs:
1666
+ * - addObject
1667
+ * - deleteIndex
1668
+ * - editSettings
1669
+ * @param updateAuthentication - The updateAuthentication object.
1670
+ * @param updateAuthentication.authenticationID - Unique identifier of an authentication resource.
1671
+ * @param updateAuthentication.authenticationUpdate - The authenticationUpdate object.
1672
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1673
+ */
1674
+ updateAuthentication({ authenticationID, authenticationUpdate }, requestOptions) {
1675
+ if (!authenticationID) {
1676
+ throw new Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");
1677
+ }
1678
+ if (!authenticationUpdate) {
1679
+ throw new Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");
1680
+ }
1681
+ const requestPath = "/1/authentications/{authenticationID}".replace(
1682
+ "{authenticationID}",
1683
+ encodeURIComponent(authenticationID)
1684
+ );
1685
+ const headers = {};
1686
+ const queryParameters = {};
1687
+ const request = {
1688
+ method: "PATCH",
1689
+ path: requestPath,
1690
+ queryParameters,
1691
+ headers,
1692
+ data: authenticationUpdate
1693
+ };
1694
+ return transporter.request(request, requestOptions);
1695
+ },
1696
+ /**
1697
+ * Updates the destination by its ID.
1698
+ *
1699
+ * Required API Key ACLs:
1700
+ * - addObject
1701
+ * - deleteIndex
1702
+ * - editSettings
1703
+ * @param updateDestination - The updateDestination object.
1704
+ * @param updateDestination.destinationID - Unique identifier of a destination.
1705
+ * @param updateDestination.destinationUpdate - The destinationUpdate object.
1706
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1707
+ */
1708
+ updateDestination({ destinationID, destinationUpdate }, requestOptions) {
1709
+ if (!destinationID) {
1710
+ throw new Error("Parameter `destinationID` is required when calling `updateDestination`.");
1711
+ }
1712
+ if (!destinationUpdate) {
1713
+ throw new Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");
1714
+ }
1715
+ const requestPath = "/1/destinations/{destinationID}".replace(
1716
+ "{destinationID}",
1717
+ encodeURIComponent(destinationID)
1718
+ );
1719
+ const headers = {};
1720
+ const queryParameters = {};
1721
+ const request = {
1722
+ method: "PATCH",
1723
+ path: requestPath,
1724
+ queryParameters,
1725
+ headers,
1726
+ data: destinationUpdate
1727
+ };
1728
+ return transporter.request(request, requestOptions);
1729
+ },
1730
+ /**
1731
+ * Updates a source by its ID.
1732
+ *
1733
+ * Required API Key ACLs:
1734
+ * - addObject
1735
+ * - deleteIndex
1736
+ * - editSettings
1737
+ * @param updateSource - The updateSource object.
1738
+ * @param updateSource.sourceID - Unique identifier of a source.
1739
+ * @param updateSource.sourceUpdate - The sourceUpdate object.
1740
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1741
+ */
1742
+ updateSource({ sourceID, sourceUpdate }, requestOptions) {
1743
+ if (!sourceID) {
1744
+ throw new Error("Parameter `sourceID` is required when calling `updateSource`.");
1745
+ }
1746
+ if (!sourceUpdate) {
1747
+ throw new Error("Parameter `sourceUpdate` is required when calling `updateSource`.");
1748
+ }
1749
+ const requestPath = "/1/sources/{sourceID}".replace("{sourceID}", encodeURIComponent(sourceID));
1750
+ const headers = {};
1751
+ const queryParameters = {};
1752
+ const request = {
1753
+ method: "PATCH",
1754
+ path: requestPath,
1755
+ queryParameters,
1756
+ headers,
1757
+ data: sourceUpdate
1758
+ };
1759
+ return transporter.request(request, requestOptions);
1760
+ },
1761
+ /**
1762
+ * Updates a task by its ID.
1763
+ * @param updateTask - The updateTask object.
1764
+ * @param updateTask.taskID - Unique identifier of a task.
1765
+ * @param updateTask.taskUpdate - The taskUpdate object.
1766
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1767
+ */
1768
+ updateTask({ taskID, taskUpdate }, requestOptions) {
1769
+ if (!taskID) {
1770
+ throw new Error("Parameter `taskID` is required when calling `updateTask`.");
1771
+ }
1772
+ if (!taskUpdate) {
1773
+ throw new Error("Parameter `taskUpdate` is required when calling `updateTask`.");
1774
+ }
1775
+ const requestPath = "/2/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
1776
+ const headers = {};
1777
+ const queryParameters = {};
1778
+ const request = {
1779
+ method: "PATCH",
1780
+ path: requestPath,
1781
+ queryParameters,
1782
+ headers,
1783
+ data: taskUpdate
1784
+ };
1785
+ return transporter.request(request, requestOptions);
1786
+ },
1787
+ /**
1788
+ * Updates a task by its ID using the v1 endpoint, please use `updateTask` instead.
1789
+ * @param updateTaskV1 - The updateTaskV1 object.
1790
+ * @param updateTaskV1.taskID - Unique identifier of a task.
1791
+ * @param updateTaskV1.taskUpdate - The taskUpdate object.
1792
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1793
+ */
1794
+ updateTaskV1({ taskID, taskUpdate }, requestOptions) {
1795
+ if (!taskID) {
1796
+ throw new Error("Parameter `taskID` is required when calling `updateTaskV1`.");
1797
+ }
1798
+ if (!taskUpdate) {
1799
+ throw new Error("Parameter `taskUpdate` is required when calling `updateTaskV1`.");
1800
+ }
1801
+ const requestPath = "/1/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
1802
+ const headers = {};
1803
+ const queryParameters = {};
1804
+ const request = {
1805
+ method: "PATCH",
1806
+ path: requestPath,
1807
+ queryParameters,
1808
+ headers,
1809
+ data: taskUpdate
1810
+ };
1811
+ return transporter.request(request, requestOptions);
1812
+ },
1813
+ /**
1814
+ * Updates a transformation by its ID.
1815
+ * @param updateTransformation - The updateTransformation object.
1816
+ * @param updateTransformation.transformationID - Unique identifier of a transformation.
1817
+ * @param updateTransformation.transformationCreate - The transformationCreate object.
1818
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1819
+ */
1820
+ updateTransformation({ transformationID, transformationCreate }, requestOptions) {
1821
+ if (!transformationID) {
1822
+ throw new Error("Parameter `transformationID` is required when calling `updateTransformation`.");
1823
+ }
1824
+ if (!transformationCreate) {
1825
+ throw new Error("Parameter `transformationCreate` is required when calling `updateTransformation`.");
1826
+ }
1827
+ if (!transformationCreate.code) {
1828
+ throw new Error("Parameter `transformationCreate.code` is required when calling `updateTransformation`.");
1829
+ }
1830
+ if (!transformationCreate.name) {
1831
+ throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");
1832
+ }
1833
+ const requestPath = "/1/transformations/{transformationID}".replace(
1834
+ "{transformationID}",
1835
+ encodeURIComponent(transformationID)
1836
+ );
1837
+ const headers = {};
1838
+ const queryParameters = {};
1839
+ const request = {
1840
+ method: "PUT",
1841
+ path: requestPath,
1842
+ queryParameters,
1843
+ headers,
1844
+ data: transformationCreate
1845
+ };
1846
+ return transporter.request(request, requestOptions);
1847
+ },
1848
+ /**
1849
+ * Validates a source payload to ensure it can be created and that the data source can be reached by Algolia.
1850
+ *
1851
+ * Required API Key ACLs:
1852
+ * - addObject
1853
+ * - deleteIndex
1854
+ * - editSettings
1855
+ * @param sourceCreate -
1856
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1857
+ */
1858
+ validateSource(sourceCreate, requestOptions = void 0) {
1859
+ const requestPath = "/1/sources/validate";
1860
+ const headers = {};
1861
+ const queryParameters = {};
1862
+ const request = {
1863
+ method: "POST",
1864
+ path: requestPath,
1865
+ queryParameters,
1866
+ headers,
1867
+ data: sourceCreate ? sourceCreate : {}
1868
+ };
1869
+ return transporter.request(request, requestOptions);
1870
+ },
1871
+ /**
1872
+ * Validates an update of a source payload to ensure it can be created and that the data source can be reached by Algolia.
1873
+ *
1874
+ * Required API Key ACLs:
1875
+ * - addObject
1876
+ * - deleteIndex
1877
+ * - editSettings
1878
+ * @param validateSourceBeforeUpdate - The validateSourceBeforeUpdate object.
1879
+ * @param validateSourceBeforeUpdate.sourceID - Unique identifier of a source.
1880
+ * @param validateSourceBeforeUpdate.sourceUpdate - The sourceUpdate object.
1881
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1882
+ */
1883
+ validateSourceBeforeUpdate({ sourceID, sourceUpdate }, requestOptions) {
1884
+ if (!sourceID) {
1885
+ throw new Error("Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.");
1886
+ }
1887
+ if (!sourceUpdate) {
1888
+ throw new Error("Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.");
1889
+ }
1890
+ const requestPath = "/1/sources/{sourceID}/validate".replace("{sourceID}", encodeURIComponent(sourceID));
1891
+ const headers = {};
1892
+ const queryParameters = {};
1893
+ const request = {
1894
+ method: "POST",
1895
+ path: requestPath,
1896
+ queryParameters,
1897
+ headers,
1898
+ data: sourceUpdate
1899
+ };
1900
+ return transporter.request(request, requestOptions);
1901
+ }
1902
+ };
1903
+ }
1904
+
1905
+ // builds/fetch.ts
1906
+ function ingestionClient(appId, apiKey, region, options) {
1907
+ if (!appId || typeof appId !== "string") {
1908
+ throw new Error("`appId` is missing.");
1909
+ }
1910
+ if (!apiKey || typeof apiKey !== "string") {
1911
+ throw new Error("`apiKey` is missing.");
1912
+ }
1913
+ if (!region || region && (typeof region !== "string" || !REGIONS.includes(region))) {
1914
+ throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(", ")}`);
1915
+ }
1916
+ return {
1917
+ ...createIngestionClient({
1918
+ appId,
1919
+ apiKey,
1920
+ region,
1921
+ timeouts: {
1922
+ connect: DEFAULT_CONNECT_TIMEOUT_NODE,
1923
+ read: DEFAULT_READ_TIMEOUT_NODE,
1924
+ write: DEFAULT_WRITE_TIMEOUT_NODE
1925
+ },
1926
+ logger: createNullLogger(),
1927
+ algoliaAgents: [{ segment: "Fetch" }],
1928
+ requester: createFetchRequester(),
1929
+ responsesCache: createNullCache(),
1930
+ requestsCache: createNullCache(),
1931
+ hostsCache: createMemoryCache(),
1932
+ ...options
1933
+ })
1934
+ };
1935
+ }
1936
+ export {
1937
+ apiClientVersion,
1938
+ ingestionClient,
1939
+ isOnDemandTrigger,
1940
+ isScheduleTrigger,
1941
+ isSubscriptionTrigger
1942
+ };
1943
+ //# sourceMappingURL=fetch.js.map