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