@algolia/ingestion 1.2.4 → 1.3.0

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