@algolia/ingestion 1.2.3 → 5.2.4-beta.2

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