@algolia/ingestion 1.0.0-alpha.9 → 1.0.0-beta.10

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 (434) hide show
  1. package/LICENSE +21 -0
  2. package/dist/builds/browser.d.ts +60 -5
  3. package/dist/builds/browser.d.ts.map +1 -1
  4. package/dist/builds/node.d.ts +60 -5
  5. package/dist/builds/node.d.ts.map +1 -1
  6. package/dist/ingestion.cjs +1565 -0
  7. package/dist/ingestion.esm.browser.js +1724 -979
  8. package/dist/ingestion.esm.node.js +1552 -819
  9. package/dist/ingestion.umd.js +2 -2
  10. package/dist/model/actionType.d.ts +4 -1
  11. package/dist/model/actionType.d.ts.map +1 -1
  12. package/dist/model/authAPIKey.d.ts +9 -3
  13. package/dist/model/authAPIKey.d.ts.map +1 -1
  14. package/dist/model/authAPIKeyPartial.d.ts +10 -0
  15. package/dist/model/authAPIKeyPartial.d.ts.map +1 -0
  16. package/dist/model/authAlgolia.d.ts +13 -4
  17. package/dist/model/authAlgolia.d.ts.map +1 -1
  18. package/dist/model/authAlgoliaInsights.d.ts +14 -0
  19. package/dist/model/authAlgoliaInsights.d.ts.map +1 -0
  20. package/dist/model/authAlgoliaInsightsPartial.d.ts +14 -0
  21. package/dist/model/authAlgoliaInsightsPartial.d.ts.map +1 -0
  22. package/dist/model/authAlgoliaPartial.d.ts +14 -0
  23. package/dist/model/authAlgoliaPartial.d.ts.map +1 -0
  24. package/dist/model/authBasic.d.ts +13 -4
  25. package/dist/model/authBasic.d.ts.map +1 -1
  26. package/dist/model/authBasicPartial.d.ts +14 -0
  27. package/dist/model/authBasicPartial.d.ts.map +1 -0
  28. package/dist/model/authGoogleServiceAccount.d.ts +13 -4
  29. package/dist/model/authGoogleServiceAccount.d.ts.map +1 -1
  30. package/dist/model/authGoogleServiceAccountPartial.d.ts +14 -0
  31. package/dist/model/authGoogleServiceAccountPartial.d.ts.map +1 -0
  32. package/dist/model/authInput.d.ts +7 -6
  33. package/dist/model/authInput.d.ts.map +1 -1
  34. package/dist/model/authInputPartial.d.ts +8 -0
  35. package/dist/model/authInputPartial.d.ts.map +1 -0
  36. package/dist/model/authOAuth.d.ts +21 -6
  37. package/dist/model/authOAuth.d.ts.map +1 -1
  38. package/dist/model/authOAuthPartial.d.ts +22 -0
  39. package/dist/model/authOAuthPartial.d.ts.map +1 -0
  40. package/dist/model/authentication.d.ts +27 -16
  41. package/dist/model/authentication.d.ts.map +1 -1
  42. package/dist/model/authenticationCreate.d.ts +15 -9
  43. package/dist/model/authenticationCreate.d.ts.map +1 -1
  44. package/dist/model/authenticationCreateResponse.d.ts +17 -8
  45. package/dist/model/authenticationCreateResponse.d.ts.map +1 -1
  46. package/dist/model/authenticationSearch.d.ts +7 -0
  47. package/dist/model/authenticationSearch.d.ts.map +1 -0
  48. package/dist/model/authenticationSortKeys.d.ts +5 -0
  49. package/dist/model/authenticationSortKeys.d.ts.map +1 -0
  50. package/dist/model/authenticationType.d.ts +4 -1
  51. package/dist/model/authenticationType.d.ts.map +1 -1
  52. package/dist/model/authenticationUpdate.d.ts +15 -9
  53. package/dist/model/authenticationUpdate.d.ts.map +1 -1
  54. package/dist/model/authenticationUpdateResponse.d.ts +17 -8
  55. package/dist/model/authenticationUpdateResponse.d.ts.map +1 -1
  56. package/dist/model/bigCommerceChannel.d.ts +11 -0
  57. package/dist/model/bigCommerceChannel.d.ts.map +1 -0
  58. package/dist/model/bigCommerceMetafield.d.ts +11 -0
  59. package/dist/model/bigCommerceMetafield.d.ts.map +1 -0
  60. package/dist/model/bigQueryDataType.d.ts +2 -0
  61. package/dist/model/bigQueryDataType.d.ts.map +1 -0
  62. package/dist/model/clientMethodProps.d.ts +509 -282
  63. package/dist/model/clientMethodProps.d.ts.map +1 -1
  64. package/dist/model/commercetoolsCustomFields.d.ts +18 -0
  65. package/dist/model/commercetoolsCustomFields.d.ts.map +1 -0
  66. package/dist/model/deleteResponse.d.ts +6 -6
  67. package/dist/model/deleteResponse.d.ts.map +1 -1
  68. package/dist/model/destination.d.ts +29 -17
  69. package/dist/model/destination.d.ts.map +1 -1
  70. package/dist/model/destinationCreate.d.ts +17 -8
  71. package/dist/model/destinationCreate.d.ts.map +1 -1
  72. package/dist/model/destinationCreateResponse.d.ts +17 -8
  73. package/dist/model/destinationCreateResponse.d.ts.map +1 -1
  74. package/dist/model/destinationIndexName.d.ts +12 -3
  75. package/dist/model/destinationIndexName.d.ts.map +1 -1
  76. package/dist/model/destinationIndexPrefix.d.ts +6 -3
  77. package/dist/model/destinationIndexPrefix.d.ts.map +1 -1
  78. package/dist/model/destinationInput.d.ts +3 -3
  79. package/dist/model/destinationInput.d.ts.map +1 -1
  80. package/dist/model/destinationSearch.d.ts +7 -0
  81. package/dist/model/destinationSearch.d.ts.map +1 -0
  82. package/dist/model/destinationSortKeys.d.ts +5 -0
  83. package/dist/model/destinationSortKeys.d.ts.map +1 -0
  84. package/dist/model/destinationType.d.ts +4 -1
  85. package/dist/model/destinationType.d.ts.map +1 -1
  86. package/dist/model/destinationUpdate.d.ts +17 -8
  87. package/dist/model/destinationUpdate.d.ts.map +1 -1
  88. package/dist/model/destinationUpdateResponse.d.ts +17 -8
  89. package/dist/model/destinationUpdateResponse.d.ts.map +1 -1
  90. package/dist/model/dockerImageType.d.ts +5 -0
  91. package/dist/model/dockerImageType.d.ts.map +1 -0
  92. package/dist/model/dockerRegistry.d.ts +5 -0
  93. package/dist/model/dockerRegistry.d.ts.map +1 -0
  94. package/dist/model/dockerStreamsInput.d.ts +4 -0
  95. package/dist/model/dockerStreamsInput.d.ts.map +1 -0
  96. package/dist/model/errorBase.d.ts +6 -6
  97. package/dist/model/errorBase.d.ts.map +1 -1
  98. package/dist/model/event.d.ts +30 -14
  99. package/dist/model/event.d.ts.map +1 -1
  100. package/dist/model/eventSortKeys.d.ts +5 -0
  101. package/dist/model/eventSortKeys.d.ts.map +1 -0
  102. package/dist/model/eventStatus.d.ts +1 -1
  103. package/dist/model/eventStatus.d.ts.map +1 -1
  104. package/dist/model/eventType.d.ts +1 -1
  105. package/dist/model/eventType.d.ts.map +1 -1
  106. package/dist/model/index.d.ts +134 -63
  107. package/dist/model/index.d.ts.map +1 -1
  108. package/dist/model/listAuthenticationsResponse.d.ts +6 -6
  109. package/dist/model/listAuthenticationsResponse.d.ts.map +1 -1
  110. package/dist/model/listDestinationsResponse.d.ts +6 -6
  111. package/dist/model/listDestinationsResponse.d.ts.map +1 -1
  112. package/dist/model/listEventsResponse.d.ts +8 -6
  113. package/dist/model/listEventsResponse.d.ts.map +1 -1
  114. package/dist/model/listSourcesResponse.d.ts +6 -6
  115. package/dist/model/listSourcesResponse.d.ts.map +1 -1
  116. package/dist/model/listTasksResponse.d.ts +9 -6
  117. package/dist/model/listTasksResponse.d.ts.map +1 -1
  118. package/dist/model/listTransformationsResponse.d.ts +10 -0
  119. package/dist/model/listTransformationsResponse.d.ts.map +1 -0
  120. package/dist/model/mappingFieldDirective.d.ts +14 -0
  121. package/dist/model/mappingFieldDirective.d.ts.map +1 -0
  122. package/dist/model/mappingFormatSchema.d.ts +5 -0
  123. package/dist/model/mappingFormatSchema.d.ts.map +1 -0
  124. package/dist/model/mappingInput.d.ts +10 -0
  125. package/dist/model/mappingInput.d.ts.map +1 -0
  126. package/dist/model/mappingKitAction.d.ts +20 -0
  127. package/dist/model/mappingKitAction.d.ts.map +1 -0
  128. package/dist/model/mappingTypeCSV.d.ts +2 -0
  129. package/dist/model/mappingTypeCSV.d.ts.map +1 -0
  130. package/dist/model/methodType.d.ts +4 -1
  131. package/dist/model/methodType.d.ts.map +1 -1
  132. package/dist/model/onDemandTrigger.d.ts +12 -0
  133. package/dist/model/onDemandTrigger.d.ts.map +1 -0
  134. package/dist/model/onDemandTriggerInput.d.ts +8 -0
  135. package/dist/model/onDemandTriggerInput.d.ts.map +1 -0
  136. package/dist/model/onDemandTriggerType.d.ts +5 -0
  137. package/dist/model/onDemandTriggerType.d.ts.map +1 -0
  138. package/dist/model/orderKeys.d.ts +5 -0
  139. package/dist/model/orderKeys.d.ts.map +1 -0
  140. package/dist/model/pagination.d.ts +21 -6
  141. package/dist/model/pagination.d.ts.map +1 -1
  142. package/dist/model/platform.d.ts +5 -0
  143. package/dist/model/platform.d.ts.map +1 -0
  144. package/dist/model/platformNone.d.ts +5 -0
  145. package/dist/model/platformNone.d.ts.map +1 -0
  146. package/dist/model/platformWithNone.d.ts +4 -0
  147. package/dist/model/platformWithNone.d.ts.map +1 -0
  148. package/dist/model/recordType.d.ts +5 -0
  149. package/dist/model/recordType.d.ts.map +1 -0
  150. package/dist/model/run.d.ts +41 -29
  151. package/dist/model/run.d.ts.map +1 -1
  152. package/dist/model/runListResponse.d.ts +8 -6
  153. package/dist/model/runListResponse.d.ts.map +1 -1
  154. package/dist/model/runOutcome.d.ts +4 -1
  155. package/dist/model/runOutcome.d.ts.map +1 -1
  156. package/dist/model/runProgress.d.ts +4 -4
  157. package/dist/model/runProgress.d.ts.map +1 -1
  158. package/dist/model/runReasonCode.d.ts +5 -0
  159. package/dist/model/runReasonCode.d.ts.map +1 -0
  160. package/dist/model/runResponse.d.ts +13 -7
  161. package/dist/model/runResponse.d.ts.map +1 -1
  162. package/dist/model/runSortKeys.d.ts +5 -0
  163. package/dist/model/runSortKeys.d.ts.map +1 -0
  164. package/dist/model/runStatus.d.ts +4 -1
  165. package/dist/model/runStatus.d.ts.map +1 -1
  166. package/dist/model/runType.d.ts +4 -1
  167. package/dist/model/runType.d.ts.map +1 -1
  168. package/dist/model/scheduleTrigger.d.ts +20 -0
  169. package/dist/model/scheduleTrigger.d.ts.map +1 -0
  170. package/dist/model/scheduleTriggerInput.d.ts +12 -0
  171. package/dist/model/scheduleTriggerInput.d.ts.map +1 -0
  172. package/dist/model/scheduleTriggerType.d.ts +5 -0
  173. package/dist/model/scheduleTriggerType.d.ts.map +1 -0
  174. package/dist/model/shopifyInput.d.ts +10 -0
  175. package/dist/model/shopifyInput.d.ts.map +1 -0
  176. package/dist/model/shopifyMarket.d.ts +9 -0
  177. package/dist/model/shopifyMarket.d.ts.map +1 -0
  178. package/dist/model/shopifyMetafield.d.ts +9 -0
  179. package/dist/model/shopifyMetafield.d.ts.map +1 -0
  180. package/dist/model/sortKeys.d.ts +5 -0
  181. package/dist/model/sortKeys.d.ts.map +1 -0
  182. package/dist/model/source.d.ts +23 -17
  183. package/dist/model/source.d.ts.map +1 -1
  184. package/dist/model/sourceBigCommerce.d.ts +12 -3
  185. package/dist/model/sourceBigCommerce.d.ts.map +1 -1
  186. package/dist/model/sourceBigQuery.d.ts +29 -0
  187. package/dist/model/sourceBigQuery.d.ts.map +1 -0
  188. package/dist/model/sourceCSV.d.ts +22 -0
  189. package/dist/model/sourceCSV.d.ts.map +1 -0
  190. package/dist/model/sourceCommercetools.d.ts +15 -9
  191. package/dist/model/sourceCommercetools.d.ts.map +1 -1
  192. package/dist/model/sourceCreate.d.ts +14 -8
  193. package/dist/model/sourceCreate.d.ts.map +1 -1
  194. package/dist/model/sourceCreateResponse.d.ts +14 -8
  195. package/dist/model/sourceCreateResponse.d.ts.map +1 -1
  196. package/dist/model/sourceDocker.d.ts +19 -0
  197. package/dist/model/sourceDocker.d.ts.map +1 -0
  198. package/dist/model/sourceGA4BigQueryExport.d.ts +15 -0
  199. package/dist/model/sourceGA4BigQueryExport.d.ts.map +1 -0
  200. package/dist/model/sourceInput.d.ts +9 -4
  201. package/dist/model/sourceInput.d.ts.map +1 -1
  202. package/dist/model/sourceJSON.d.ts +13 -0
  203. package/dist/model/sourceJSON.d.ts.map +1 -0
  204. package/dist/model/sourceSearch.d.ts +4 -0
  205. package/dist/model/sourceSearch.d.ts.map +1 -0
  206. package/dist/model/sourceShopify.d.ts +4 -0
  207. package/dist/model/sourceShopify.d.ts.map +1 -0
  208. package/dist/model/sourceShopifyBase.d.ts +7 -0
  209. package/dist/model/sourceShopifyBase.d.ts.map +1 -0
  210. package/dist/model/sourceSortKeys.d.ts +5 -0
  211. package/dist/model/sourceSortKeys.d.ts.map +1 -0
  212. package/dist/model/sourceType.d.ts +1 -1
  213. package/dist/model/sourceType.d.ts.map +1 -1
  214. package/dist/model/sourceUpdate.d.ts +12 -8
  215. package/dist/model/sourceUpdate.d.ts.map +1 -1
  216. package/dist/model/sourceUpdateCommercetools.d.ts +15 -0
  217. package/dist/model/sourceUpdateCommercetools.d.ts.map +1 -0
  218. package/dist/model/sourceUpdateDocker.d.ts +17 -0
  219. package/dist/model/sourceUpdateDocker.d.ts.map +1 -0
  220. package/dist/model/sourceUpdateInput.d.ts +9 -0
  221. package/dist/model/sourceUpdateInput.d.ts.map +1 -0
  222. package/dist/model/sourceUpdateResponse.d.ts +14 -8
  223. package/dist/model/sourceUpdateResponse.d.ts.map +1 -1
  224. package/dist/model/sourceUpdateShopify.d.ts +31 -0
  225. package/dist/model/sourceUpdateShopify.d.ts.map +1 -0
  226. package/dist/model/sourceWatchResponse.d.ts +20 -0
  227. package/dist/model/sourceWatchResponse.d.ts.map +1 -0
  228. package/dist/model/streamingInput.d.ts +8 -0
  229. package/dist/model/streamingInput.d.ts.map +1 -0
  230. package/dist/model/streamingTrigger.d.ts +8 -0
  231. package/dist/model/streamingTrigger.d.ts.map +1 -0
  232. package/dist/model/streamingTriggerType.d.ts +5 -0
  233. package/dist/model/streamingTriggerType.d.ts.map +1 -0
  234. package/dist/model/subscriptionTrigger.d.ts +8 -0
  235. package/dist/model/subscriptionTrigger.d.ts.map +1 -0
  236. package/dist/model/subscriptionTriggerType.d.ts +5 -0
  237. package/dist/model/subscriptionTriggerType.d.ts.map +1 -0
  238. package/dist/model/task.d.ts +40 -18
  239. package/dist/model/task.d.ts.map +1 -1
  240. package/dist/model/taskCreate.d.ts +31 -9
  241. package/dist/model/taskCreate.d.ts.map +1 -1
  242. package/dist/model/taskCreateResponse.d.ts +13 -7
  243. package/dist/model/taskCreateResponse.d.ts.map +1 -1
  244. package/dist/model/taskCreateTrigger.d.ts +6 -0
  245. package/dist/model/taskCreateTrigger.d.ts.map +1 -0
  246. package/dist/model/taskInput.d.ts +8 -0
  247. package/dist/model/taskInput.d.ts.map +1 -0
  248. package/dist/model/taskSearch.d.ts +4 -0
  249. package/dist/model/taskSearch.d.ts.map +1 -0
  250. package/dist/model/taskSortKeys.d.ts +5 -0
  251. package/dist/model/taskSortKeys.d.ts.map +1 -0
  252. package/dist/model/taskUpdate.d.ts +21 -6
  253. package/dist/model/taskUpdate.d.ts.map +1 -1
  254. package/dist/model/taskUpdateResponse.d.ts +13 -7
  255. package/dist/model/taskUpdateResponse.d.ts.map +1 -1
  256. package/dist/model/transformation.d.ts +27 -0
  257. package/dist/model/transformation.d.ts.map +1 -0
  258. package/dist/model/transformationCreate.d.ts +18 -0
  259. package/dist/model/transformationCreate.d.ts.map +1 -0
  260. package/dist/model/transformationCreateResponse.d.ts +14 -0
  261. package/dist/model/transformationCreateResponse.d.ts.map +1 -0
  262. package/dist/model/transformationSearch.d.ts +4 -0
  263. package/dist/model/transformationSearch.d.ts.map +1 -0
  264. package/dist/model/transformationTry.d.ts +11 -0
  265. package/dist/model/transformationTry.d.ts.map +1 -0
  266. package/dist/model/transformationTryResponse.d.ts +9 -0
  267. package/dist/model/transformationTryResponse.d.ts.map +1 -0
  268. package/dist/model/transformationTryResponseError.d.ts +14 -0
  269. package/dist/model/transformationTryResponseError.d.ts.map +1 -0
  270. package/dist/model/transformationUpdateResponse.d.ts +14 -0
  271. package/dist/model/transformationUpdateResponse.d.ts.map +1 -0
  272. package/dist/model/trigger.d.ts +8 -13
  273. package/dist/model/trigger.d.ts.map +1 -1
  274. package/dist/model/triggerType.d.ts +4 -1
  275. package/dist/model/triggerType.d.ts.map +1 -1
  276. package/dist/model/triggerUpdateInput.d.ts +10 -0
  277. package/dist/model/triggerUpdateInput.d.ts.map +1 -0
  278. package/dist/model/window.d.ts +14 -0
  279. package/dist/model/window.d.ts.map +1 -0
  280. package/dist/src/ingestionClient.d.ts +669 -325
  281. package/dist/src/ingestionClient.d.ts.map +1 -1
  282. package/index.js +1 -1
  283. package/model/actionType.ts +5 -2
  284. package/model/authAPIKey.ts +7 -1
  285. package/model/authAPIKeyPartial.ts +11 -0
  286. package/model/authAlgolia.ts +10 -1
  287. package/model/authAlgoliaInsights.ts +16 -0
  288. package/model/authAlgoliaInsightsPartial.ts +16 -0
  289. package/model/authAlgoliaPartial.ts +16 -0
  290. package/model/authBasic.ts +10 -1
  291. package/model/authBasicPartial.ts +16 -0
  292. package/model/authGoogleServiceAccount.ts +10 -1
  293. package/model/authGoogleServiceAccountPartial.ts +16 -0
  294. package/model/authInput.ts +3 -1
  295. package/model/authInputPartial.ts +16 -0
  296. package/model/authOAuth.ts +16 -1
  297. package/model/authOAuthPartial.ts +26 -0
  298. package/model/authentication.ts +17 -5
  299. package/model/authenticationCreate.ts +9 -3
  300. package/model/authenticationCreateResponse.ts +11 -2
  301. package/model/authenticationSearch.ts +8 -0
  302. package/model/authenticationSortKeys.ts +11 -0
  303. package/model/authenticationType.ts +5 -1
  304. package/model/authenticationUpdate.ts +11 -5
  305. package/model/authenticationUpdateResponse.ts +11 -2
  306. package/model/bigCommerceChannel.ts +13 -0
  307. package/model/bigCommerceMetafield.ts +13 -0
  308. package/model/bigQueryDataType.ts +3 -0
  309. package/model/clientMethodProps.ts +284 -48
  310. package/model/commercetoolsCustomFields.ts +21 -0
  311. package/model/deleteResponse.ts +2 -2
  312. package/model/destination.ts +15 -3
  313. package/model/destinationCreate.ts +11 -2
  314. package/model/destinationCreateResponse.ts +11 -2
  315. package/model/destinationIndexName.ts +13 -1
  316. package/model/destinationIndexPrefix.ts +4 -1
  317. package/model/destinationInput.ts +1 -1
  318. package/model/destinationSearch.ts +8 -0
  319. package/model/destinationSortKeys.ts +6 -0
  320. package/model/destinationType.ts +5 -2
  321. package/model/destinationUpdate.ts +10 -1
  322. package/model/destinationUpdateResponse.ts +11 -2
  323. package/model/dockerImageType.ts +6 -0
  324. package/model/dockerRegistry.ts +6 -0
  325. package/model/dockerStreamsInput.ts +5 -0
  326. package/model/errorBase.ts +1 -1
  327. package/model/event.ts +19 -2
  328. package/model/eventSortKeys.ts +6 -0
  329. package/model/eventStatus.ts +2 -1
  330. package/model/eventType.ts +2 -2
  331. package/model/index.ts +77 -6
  332. package/model/listAuthenticationsResponse.ts +1 -1
  333. package/model/listDestinationsResponse.ts +1 -1
  334. package/model/listEventsResponse.ts +4 -1
  335. package/model/listSourcesResponse.ts +1 -1
  336. package/model/listTasksResponse.ts +4 -1
  337. package/model/listTransformationsResponse.ts +13 -0
  338. package/model/mappingFieldDirective.ts +16 -0
  339. package/model/mappingFormatSchema.ts +6 -0
  340. package/model/mappingInput.ts +13 -0
  341. package/model/mappingKitAction.ts +25 -0
  342. package/model/mappingTypeCSV.ts +8 -0
  343. package/model/methodType.ts +4 -1
  344. package/model/onDemandTrigger.ts +15 -0
  345. package/model/onDemandTriggerInput.ts +10 -0
  346. package/model/onDemandTriggerType.ts +6 -0
  347. package/model/orderKeys.ts +6 -0
  348. package/model/pagination.ts +16 -1
  349. package/model/platform.ts +6 -0
  350. package/model/platformNone.ts +6 -0
  351. package/model/platformWithNone.ts +6 -0
  352. package/model/recordType.ts +6 -0
  353. package/model/run.ts +22 -8
  354. package/model/runListResponse.ts +4 -1
  355. package/model/runOutcome.ts +5 -2
  356. package/model/runProgress.ts +1 -1
  357. package/model/runReasonCode.ts +13 -0
  358. package/model/runResponse.ts +8 -2
  359. package/model/runSortKeys.ts +6 -0
  360. package/model/runStatus.ts +10 -2
  361. package/model/runType.ts +5 -2
  362. package/model/scheduleTrigger.ts +25 -0
  363. package/model/scheduleTriggerInput.ts +15 -0
  364. package/model/scheduleTriggerType.ts +6 -0
  365. package/model/shopifyInput.ts +13 -0
  366. package/model/shopifyMarket.ts +12 -0
  367. package/model/shopifyMetafield.ts +12 -0
  368. package/model/sortKeys.ts +6 -0
  369. package/model/source.ts +9 -3
  370. package/model/sourceBigCommerce.ts +16 -2
  371. package/model/sourceBigQuery.ts +37 -0
  372. package/model/sourceCSV.ts +28 -0
  373. package/model/sourceCommercetools.ts +11 -2
  374. package/model/sourceCreate.ts +8 -2
  375. package/model/sourceCreateResponse.ts +8 -2
  376. package/model/sourceDocker.ts +25 -0
  377. package/model/sourceGA4BigQueryExport.ts +18 -0
  378. package/model/sourceInput.ts +16 -3
  379. package/model/sourceJSON.ts +17 -0
  380. package/model/sourceSearch.ts +5 -0
  381. package/model/sourceShopify.ts +6 -0
  382. package/model/sourceShopifyBase.ts +8 -0
  383. package/model/sourceSortKeys.ts +6 -0
  384. package/model/sourceType.ts +11 -2
  385. package/model/sourceUpdate.ts +9 -6
  386. package/model/sourceUpdateCommercetools.ts +21 -0
  387. package/model/sourceUpdateDocker.ts +22 -0
  388. package/model/sourceUpdateInput.ts +18 -0
  389. package/model/sourceUpdateResponse.ts +8 -2
  390. package/model/sourceUpdateShopify.ts +38 -0
  391. package/model/sourceWatchResponse.ts +25 -0
  392. package/model/streamingInput.ts +10 -0
  393. package/model/streamingTrigger.ts +10 -0
  394. package/model/streamingTriggerType.ts +6 -0
  395. package/model/subscriptionTrigger.ts +10 -0
  396. package/model/subscriptionTriggerType.ts +6 -0
  397. package/model/task.ts +29 -4
  398. package/model/taskCreate.ts +28 -3
  399. package/model/taskCreateResponse.ts +8 -2
  400. package/model/taskCreateTrigger.ts +12 -0
  401. package/model/taskInput.ts +10 -0
  402. package/model/taskSearch.ts +5 -0
  403. package/model/taskSortKeys.ts +11 -0
  404. package/model/taskUpdate.ts +20 -3
  405. package/model/taskUpdateResponse.ts +8 -2
  406. package/model/transformation.ts +33 -0
  407. package/model/transformationCreate.ts +21 -0
  408. package/model/transformationCreateResponse.ts +16 -0
  409. package/model/transformationSearch.ts +5 -0
  410. package/model/transformationTry.ts +13 -0
  411. package/model/transformationTryResponse.ts +12 -0
  412. package/model/transformationTryResponseError.ts +16 -0
  413. package/model/transformationUpdateResponse.ts +16 -0
  414. package/model/trigger.ts +15 -19
  415. package/model/triggerType.ts +9 -2
  416. package/model/triggerUpdateInput.ts +11 -0
  417. package/model/window.ts +16 -0
  418. package/package.json +14 -10
  419. package/dist/ingestion.cjs.js +0 -831
  420. package/dist/model/authenticationInput.d.ts +0 -5
  421. package/dist/model/authenticationInput.d.ts.map +0 -1
  422. package/dist/model/authenticationWithInput.d.ts +0 -4
  423. package/dist/model/authenticationWithInput.d.ts.map +0 -1
  424. package/dist/model/platformType.d.ts +0 -2
  425. package/dist/model/platformType.d.ts.map +0 -1
  426. package/dist/model/sourceJson.d.ts +0 -6
  427. package/dist/model/sourceJson.d.ts.map +0 -1
  428. package/dist/model/triggerInput.d.ts +0 -6
  429. package/dist/model/triggerInput.d.ts.map +0 -1
  430. package/model/authenticationInput.ts +0 -7
  431. package/model/authenticationWithInput.ts +0 -6
  432. package/model/platformType.ts +0 -3
  433. package/model/sourceJson.ts +0 -9
  434. package/model/triggerInput.ts +0 -9
@@ -26,14 +26,35 @@ function createBrowserLocalStorageCache(options) {
26
26
  function getNamespace() {
27
27
  return JSON.parse(getStorage().getItem(namespaceKey) || '{}');
28
28
  }
29
+ function setNamespace(namespace) {
30
+ getStorage().setItem(namespaceKey, JSON.stringify(namespace));
31
+ }
32
+ function removeOutdatedCacheItems() {
33
+ const timeToLive = options.timeToLive ? options.timeToLive * 1000 : null;
34
+ const namespace = getNamespace();
35
+ const filteredNamespaceWithoutOldFormattedCacheItems = Object.fromEntries(Object.entries(namespace).filter(([, cacheItem]) => {
36
+ return cacheItem.timestamp !== undefined;
37
+ }));
38
+ setNamespace(filteredNamespaceWithoutOldFormattedCacheItems);
39
+ if (!timeToLive) {
40
+ return;
41
+ }
42
+ const filteredNamespaceWithoutExpiredItems = Object.fromEntries(Object.entries(filteredNamespaceWithoutOldFormattedCacheItems).filter(([, cacheItem]) => {
43
+ const currentTimestamp = new Date().getTime();
44
+ const isExpired = cacheItem.timestamp + timeToLive < currentTimestamp;
45
+ return !isExpired;
46
+ }));
47
+ setNamespace(filteredNamespaceWithoutExpiredItems);
48
+ }
29
49
  return {
30
50
  get(key, defaultValue, events = {
31
51
  miss: () => Promise.resolve()
32
52
  }) {
33
53
  return Promise.resolve().then(() => {
34
- const keyAsString = JSON.stringify(key);
35
- const value = getNamespace()[keyAsString];
36
- return Promise.all([value || defaultValue(), value !== undefined]);
54
+ removeOutdatedCacheItems();
55
+ return getNamespace()[JSON.stringify(key)];
56
+ }).then(value => {
57
+ return Promise.all([value ? value.value : defaultValue(), value !== undefined]);
37
58
  }).then(([value, exists]) => {
38
59
  return Promise.all([value, exists || events.miss(value)]);
39
60
  }).then(([value]) => value);
@@ -41,7 +62,10 @@ function createBrowserLocalStorageCache(options) {
41
62
  set(key, value) {
42
63
  return Promise.resolve().then(() => {
43
64
  const namespace = getNamespace();
44
- namespace[JSON.stringify(key)] = value;
65
+ namespace[JSON.stringify(key)] = {
66
+ timestamp: new Date().getTime(),
67
+ value
68
+ };
45
69
  getStorage().setItem(namespaceKey, JSON.stringify(namespace));
46
70
  return value;
47
71
  });
@@ -171,33 +195,27 @@ function createStatefulHost(host, status = 'up') {
171
195
  };
172
196
  }
173
197
 
174
- function _defineProperty(obj, key, value) {
175
- key = _toPropertyKey(key);
176
- if (key in obj) {
177
- Object.defineProperty(obj, key, {
178
- value: value,
179
- enumerable: true,
180
- configurable: true,
181
- writable: true
182
- });
183
- } else {
184
- obj[key] = value;
185
- }
186
- return obj;
198
+ function _defineProperty(e, r, t) {
199
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
200
+ value: t,
201
+ enumerable: !0,
202
+ configurable: !0,
203
+ writable: !0
204
+ }) : e[r] = t, e;
187
205
  }
188
- function _toPrimitive(input, hint) {
189
- if (typeof input !== "object" || input === null) return input;
190
- var prim = input[Symbol.toPrimitive];
191
- if (prim !== undefined) {
192
- var res = prim.call(input, hint || "default");
193
- if (typeof res !== "object") return res;
206
+ function _toPrimitive(t, r) {
207
+ if ("object" != typeof t || !t) return t;
208
+ var e = t[Symbol.toPrimitive];
209
+ if (void 0 !== e) {
210
+ var i = e.call(t, r || "default");
211
+ if ("object" != typeof i) return i;
194
212
  throw new TypeError("@@toPrimitive must return a primitive value.");
195
213
  }
196
- return (hint === "string" ? String : Number)(input);
214
+ return ("string" === r ? String : Number)(t);
197
215
  }
198
- function _toPropertyKey(arg) {
199
- var key = _toPrimitive(arg, "string");
200
- return typeof key === "symbol" ? key : String(key);
216
+ function _toPropertyKey(t) {
217
+ var i = _toPrimitive(t, "string");
218
+ return "symbol" == typeof i ? i : i + "";
201
219
  }
202
220
 
203
221
  class AlgoliaError extends Error {
@@ -219,7 +237,7 @@ class ErrorWithStackTrace extends AlgoliaError {
219
237
  }
220
238
  class RetryError extends ErrorWithStackTrace {
221
239
  constructor(stackTrace) {
222
- super('Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.', stackTrace, 'RetryError');
240
+ super('Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.', stackTrace, 'RetryError');
223
241
  }
224
242
  }
225
243
  class ApiError extends ErrorWithStackTrace {
@@ -246,15 +264,14 @@ class DetailedApiError extends ApiError {
246
264
  }
247
265
  function serializeUrl(host, path, queryParameters) {
248
266
  const queryParametersAsString = serializeQueryParameters(queryParameters);
249
- let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.substr(1) : path}`;
267
+ let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${path.charAt(0) === '/' ? path.substring(1) : path}`;
250
268
  if (queryParametersAsString.length) {
251
269
  url += `?${queryParametersAsString}`;
252
270
  }
253
271
  return url;
254
272
  }
255
273
  function serializeQueryParameters(parameters) {
256
- const isObjectOrArray = value => Object.prototype.toString.call(value) === '[object Object]' || Object.prototype.toString.call(value) === '[object Array]';
257
- return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key])}`).join('&');
274
+ return Object.keys(parameters).filter(key => parameters[key] !== undefined).sort().map(key => `${key}=${encodeURIComponent(Object.prototype.toString.call(parameters[key]) === '[object Array]' ? parameters[key].join(',') : parameters[key]).replaceAll('+', '%20')}`).join('&');
258
275
  }
259
276
  function serializeData(request, requestOptions) {
260
277
  if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {
@@ -368,16 +385,16 @@ function createTransporter({
368
385
  return {
369
386
  hosts: compatibleHostsAvailable,
370
387
  getTimeout(timeoutsCount, baseTimeout) {
371
- /**
372
- * Imagine that you have 4 hosts, if timeouts will increase
373
- * on the following way: 1 (timed out) > 4 (timed out) > 5 (200).
374
- *
375
- * Note that, the very next request, we start from the previous timeout.
376
- *
377
- * 5 (timed out) > 6 (timed out) > 7 ...
378
- *
379
- * This strategy may need to be reviewed, but is the strategy on the our
380
- * current v3 version.
388
+ /**
389
+ * Imagine that you have 4 hosts, if timeouts will increase
390
+ * on the following way: 1 (timed out) > 4 (timed out) > 5 (200).
391
+ *
392
+ * Note that, the very next request, we start from the previous timeout.
393
+ *
394
+ * 5 (timed out) > 6 (timed out) > 7 ...
395
+ *
396
+ * This strategy may need to be reviewed, but is the strategy on the our
397
+ * current v3 version.
381
398
  */
382
399
  const timeoutMultiplier = hostsTimedOut.length === 0 && timeoutsCount === 0 ? 1 : hostsTimedOut.length + 3 + timeoutsCount;
383
400
  return timeoutMultiplier * baseTimeout;
@@ -386,8 +403,8 @@ function createTransporter({
386
403
  }
387
404
  async function retryableRequest(request, requestOptions, isRead = true) {
388
405
  const stackTrace = [];
389
- /**
390
- * First we prepare the payload that do not depend from hosts.
406
+ /**
407
+ * First we prepare the payload that do not depend from hosts.
391
408
  */
392
409
  const data = serializeData(request, requestOptions);
393
410
  const headers = serializeHeaders(baseHeaders, request.headers, requestOptions.headers);
@@ -418,29 +435,26 @@ function createTransporter({
418
435
  }
419
436
  let timeoutsCount = 0;
420
437
  const retry = async (retryableHosts, getTimeout) => {
421
- /**
422
- * We iterate on each host, until there is no host left.
438
+ /**
439
+ * We iterate on each host, until there is no host left.
423
440
  */
424
441
  const host = retryableHosts.pop();
425
442
  if (host === undefined) {
426
443
  throw new RetryError(stackTraceWithoutCredentials(stackTrace));
427
444
  }
428
- let responseTimeout = requestOptions.timeout;
429
- if (responseTimeout === undefined) {
430
- responseTimeout = isRead ? timeouts.read : timeouts.write;
431
- }
445
+ let responseTimeout = isRead ? requestOptions.timeouts?.read || timeouts.read : requestOptions.timeouts?.write || timeouts.write;
432
446
  const payload = {
433
447
  data,
434
448
  headers,
435
449
  method: request.method,
436
450
  url: serializeUrl(host, request.path, queryParameters),
437
- connectTimeout: getTimeout(timeoutsCount, timeouts.connect),
451
+ connectTimeout: getTimeout(timeoutsCount, requestOptions.timeouts?.connect || timeouts.connect),
438
452
  responseTimeout: getTimeout(timeoutsCount, responseTimeout)
439
453
  };
440
- /**
441
- * The stackFrame is pushed to the stackTrace so we
442
- * can have information about onRetry and onFailure
443
- * decisions.
454
+ /**
455
+ * The stackFrame is pushed to the stackTrace so we
456
+ * can have information about onRetry and onFailure
457
+ * decisions.
444
458
  */
445
459
  const pushToStackTrace = response => {
446
460
  const stackFrame = {
@@ -459,17 +473,17 @@ function createTransporter({
459
473
  if (response.isTimedOut) {
460
474
  timeoutsCount++;
461
475
  }
462
- /**
463
- * Failures are individually sent to the logger, allowing
464
- * the end user to debug / store stack frames even
465
- * when a retry error does not happen.
476
+ /**
477
+ * Failures are individually sent to the logger, allowing
478
+ * the end user to debug / store stack frames even
479
+ * when a retry error does not happen.
466
480
  */
467
481
  // eslint-disable-next-line no-console -- this will be fixed by exposing a `logger` to the transporter
468
482
  console.log('Retryable failure', stackFrameWithoutCredentials(stackFrame));
469
- /**
470
- * We also store the state of the host in failure cases. If the host, is
471
- * down it will remain down for the next 2 minutes. In a timeout situation,
472
- * this host will be added end of the list of hosts on the next request.
483
+ /**
484
+ * We also store the state of the host in failure cases. If the host, is
485
+ * down it will remain down for the next 2 minutes. In a timeout situation,
486
+ * this host will be added end of the list of hosts on the next request.
473
487
  */
474
488
  await hostsCache.set(host, createStatefulHost(host, response.isTimedOut ? 'timed out' : 'down'));
475
489
  return retry(retryableHosts, getTimeout);
@@ -480,56 +494,56 @@ function createTransporter({
480
494
  pushToStackTrace(response);
481
495
  throw deserializeFailure(response, stackTrace);
482
496
  };
483
- /**
484
- * Finally, for each retryable host perform request until we got a non
485
- * retryable response. Some notes here:
486
- *
487
- * 1. The reverse here is applied so we can apply a `pop` later on => more performant.
488
- * 2. We also get from the retryable options a timeout multiplier that is tailored
489
- * for the current context.
497
+ /**
498
+ * Finally, for each retryable host perform request until we got a non
499
+ * retryable response. Some notes here:
500
+ *
501
+ * 1. The reverse here is applied so we can apply a `pop` later on => more performant.
502
+ * 2. We also get from the retryable options a timeout multiplier that is tailored
503
+ * for the current context.
490
504
  */
491
505
  const compatibleHosts = hosts.filter(host => host.accept === 'readWrite' || (isRead ? host.accept === 'read' : host.accept === 'write'));
492
506
  const options = await createRetryableOptions(compatibleHosts);
493
507
  return retry([...options.hosts].reverse(), options.getTimeout);
494
508
  }
495
509
  function createRequest(request, requestOptions = {}) {
496
- /**
497
- * A read request is either a `GET` request, or a request that we make
498
- * via the `read` transporter (e.g. `search`).
510
+ /**
511
+ * A read request is either a `GET` request, or a request that we make
512
+ * via the `read` transporter (e.g. `search`).
499
513
  */
500
514
  const isRead = request.useReadTransporter || request.method === 'GET';
501
515
  if (!isRead) {
502
- /**
503
- * On write requests, no cache mechanisms are applied, and we
504
- * proxy the request immediately to the requester.
516
+ /**
517
+ * On write requests, no cache mechanisms are applied, and we
518
+ * proxy the request immediately to the requester.
505
519
  */
506
520
  return retryableRequest(request, requestOptions, isRead);
507
521
  }
508
522
  const createRetryableRequest = () => {
509
- /**
510
- * Then, we prepare a function factory that contains the construction of
511
- * the retryable request. At this point, we may *not* perform the actual
512
- * request. But we want to have the function factory ready.
523
+ /**
524
+ * Then, we prepare a function factory that contains the construction of
525
+ * the retryable request. At this point, we may *not* perform the actual
526
+ * request. But we want to have the function factory ready.
513
527
  */
514
528
  return retryableRequest(request, requestOptions);
515
529
  };
516
- /**
517
- * Once we have the function factory ready, we need to determine of the
518
- * request is "cacheable" - should be cached. Note that, once again,
519
- * the user can force this option.
530
+ /**
531
+ * Once we have the function factory ready, we need to determine of the
532
+ * request is "cacheable" - should be cached. Note that, once again,
533
+ * the user can force this option.
520
534
  */
521
535
  const cacheable = requestOptions.cacheable || request.cacheable;
522
- /**
523
- * If is not "cacheable", we immediately trigger the retryable request, no
524
- * need to check cache implementations.
536
+ /**
537
+ * If is not "cacheable", we immediately trigger the retryable request, no
538
+ * need to check cache implementations.
525
539
  */
526
540
  if (cacheable !== true) {
527
541
  return createRetryableRequest();
528
542
  }
529
- /**
530
- * If the request is "cacheable", we need to first compute the key to ask
531
- * the cache implementations if this request is on progress or if the
532
- * response already exists on the cache.
543
+ /**
544
+ * If the request is "cacheable", we need to first compute the key to ask
545
+ * the cache implementations if this request is on progress or if the
546
+ * response already exists on the cache.
533
547
  */
534
548
  const key = {
535
549
  request,
@@ -539,27 +553,27 @@ function createTransporter({
539
553
  headers: baseHeaders
540
554
  }
541
555
  };
542
- /**
543
- * With the computed key, we first ask the responses cache
544
- * implementation if this request was been resolved before.
556
+ /**
557
+ * With the computed key, we first ask the responses cache
558
+ * implementation if this request was been resolved before.
545
559
  */
546
560
  return responsesCache.get(key, () => {
547
- /**
548
- * If the request has never resolved before, we actually ask if there
549
- * is a current request with the same key on progress.
561
+ /**
562
+ * If the request has never resolved before, we actually ask if there
563
+ * is a current request with the same key on progress.
550
564
  */
551
565
  return requestsCache.get(key, () =>
552
- /**
553
- * Finally, if there is no request in progress with the same key,
554
- * this `createRetryableRequest()` will actually trigger the
555
- * retryable request.
566
+ /**
567
+ * Finally, if there is no request in progress with the same key,
568
+ * this `createRetryableRequest()` will actually trigger the
569
+ * retryable request.
556
570
  */
557
571
  requestsCache.set(key, createRetryableRequest()).then(response => Promise.all([requestsCache.delete(key), response]), err => Promise.all([requestsCache.delete(key), Promise.reject(err)])).then(([_, response]) => response));
558
572
  }, {
559
- /**
560
- * Of course, once we get this response back from the server, we
561
- * tell response cache to actually store the received response
562
- * to be used later.
573
+ /**
574
+ * Of course, once we get this response back from the server, we
575
+ * tell response cache to actually store the received response
576
+ * to be used later.
563
577
  */
564
578
  miss: response => responsesCache.set(key, response)
565
579
  });
@@ -609,884 +623,1615 @@ const DEFAULT_CONNECT_TIMEOUT_BROWSER = 1000;
609
623
  const DEFAULT_READ_TIMEOUT_BROWSER = 2000;
610
624
  const DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;
611
625
 
612
- function createXhrRequester() {
613
- function send(request) {
614
- return new Promise((resolve) => {
615
- const baseRequester = new XMLHttpRequest();
616
- baseRequester.open(request.method, request.url, true);
617
- Object.keys(request.headers).forEach((key) => baseRequester.setRequestHeader(key, request.headers[key]));
618
- const createTimeout = (timeout, content) => {
619
- return setTimeout(() => {
620
- baseRequester.abort();
621
- resolve({
622
- status: 0,
623
- content,
624
- isTimedOut: true,
625
- });
626
- }, timeout);
627
- };
628
- const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');
629
- let responseTimeout;
630
- baseRequester.onreadystatechange = () => {
631
- if (baseRequester.readyState > baseRequester.OPENED &&
632
- responseTimeout === undefined) {
633
- clearTimeout(connectTimeout);
634
- responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');
635
- }
636
- };
637
- baseRequester.onerror = () => {
638
- // istanbul ignore next
639
- if (baseRequester.status === 0) {
640
- clearTimeout(connectTimeout);
641
- clearTimeout(responseTimeout);
642
- resolve({
643
- content: baseRequester.responseText || 'Network request failed',
644
- status: baseRequester.status,
645
- isTimedOut: false,
646
- });
647
- }
648
- };
649
- baseRequester.onload = () => {
650
- clearTimeout(connectTimeout);
651
- clearTimeout(responseTimeout);
652
- resolve({
653
- content: baseRequester.responseText,
654
- status: baseRequester.status,
655
- isTimedOut: false,
656
- });
657
- };
658
- baseRequester.send(request.data);
659
- });
660
- }
661
- return { send };
626
+ function createXhrRequester() {
627
+ function send(request) {
628
+ return new Promise((resolve) => {
629
+ const baseRequester = new XMLHttpRequest();
630
+ baseRequester.open(request.method, request.url, true);
631
+ Object.keys(request.headers).forEach((key) => baseRequester.setRequestHeader(key, request.headers[key]));
632
+ const createTimeout = (timeout, content) => {
633
+ return setTimeout(() => {
634
+ baseRequester.abort();
635
+ resolve({
636
+ status: 0,
637
+ content,
638
+ isTimedOut: true,
639
+ });
640
+ }, timeout);
641
+ };
642
+ const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');
643
+ let responseTimeout;
644
+ baseRequester.onreadystatechange = () => {
645
+ if (baseRequester.readyState > baseRequester.OPENED &&
646
+ responseTimeout === undefined) {
647
+ clearTimeout(connectTimeout);
648
+ responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');
649
+ }
650
+ };
651
+ baseRequester.onerror = () => {
652
+ // istanbul ignore next
653
+ if (baseRequester.status === 0) {
654
+ clearTimeout(connectTimeout);
655
+ clearTimeout(responseTimeout);
656
+ resolve({
657
+ content: baseRequester.responseText || 'Network request failed',
658
+ status: baseRequester.status,
659
+ isTimedOut: false,
660
+ });
661
+ }
662
+ };
663
+ baseRequester.onload = () => {
664
+ clearTimeout(connectTimeout);
665
+ clearTimeout(responseTimeout);
666
+ resolve({
667
+ content: baseRequester.responseText,
668
+ status: baseRequester.status,
669
+ isTimedOut: false,
670
+ });
671
+ };
672
+ baseRequester.send(request.data);
673
+ });
674
+ }
675
+ return { send };
662
676
  }
663
677
 
664
- // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
665
- const apiClientVersion = '1.0.0-alpha.9';
666
- const REGIONS = ['us'];
667
- function getDefaultHosts(region) {
668
- const url = 'data.{region}.algolia.com'.replace('{region}', region);
669
- return [{ url, accept: 'readWrite', protocol: 'https' }];
670
- }
671
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
672
- function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
673
- const auth = createAuth(appIdOption, apiKeyOption, authMode);
674
- const transporter = createTransporter({
675
- hosts: getDefaultHosts(regionOption),
676
- ...options,
677
- algoliaAgent: {
678
- ...getAlgoliaAgent({
679
- algoliaAgents,
680
- client: 'Ingestion',
681
- version: apiClientVersion,
682
- }),
683
- value: '',
684
- },
685
- baseHeaders: {
686
- 'content-type': 'text/plain',
687
- ...auth.headers(),
688
- ...options.baseHeaders,
689
- },
690
- baseQueryParameters: {
691
- ...auth.queryParameters(),
692
- ...options.baseQueryParameters,
693
- },
694
- });
695
- return {
696
- transporter,
697
- /**
698
- * The `appId` currently in use.
699
- */
700
- appId: appIdOption,
701
- /**
702
- * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
703
- */
704
- clearCache() {
705
- return Promise.all([
706
- transporter.requestsCache.clear(),
707
- transporter.responsesCache.clear(),
708
- ]).then(() => undefined);
709
- },
710
- /**
711
- * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
712
- */
713
- get _ua() {
714
- return transporter.algoliaAgent.value;
715
- },
716
- /**
717
- * Adds a `segment` to the `x-algolia-agent` sent with every requests.
718
- *
719
- * @param segment - The algolia agent (user-agent) segment to add.
720
- * @param version - The version of the agent.
721
- */
722
- addAlgoliaAgent(segment, version) {
723
- transporter.algoliaAgent.add({ segment, version });
724
- },
725
- /**
726
- * Create a authentication.
727
- *
728
- * @summary Create a authentication.
729
- * @param authenticationCreate -.
730
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
731
- */
732
- createAuthentication(authenticationCreate, requestOptions) {
733
- if (!authenticationCreate) {
734
- throw new Error('Parameter `authenticationCreate` is required when calling `createAuthentication`.');
735
- }
736
- const requestPath = '/1/authentications';
737
- const headers = {};
738
- const queryParameters = {};
739
- const request = {
740
- method: 'POST',
741
- path: requestPath,
742
- queryParameters,
743
- headers,
744
- data: authenticationCreate,
745
- };
746
- return transporter.request(request, requestOptions);
747
- },
748
- /**
749
- * Create a destination.
750
- *
751
- * @summary Create a destination.
752
- * @param destinationCreate -.
753
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
754
- */
755
- createDestination(destinationCreate, requestOptions) {
756
- if (!destinationCreate) {
757
- throw new Error('Parameter `destinationCreate` is required when calling `createDestination`.');
758
- }
759
- const requestPath = '/1/destinations';
760
- const headers = {};
761
- const queryParameters = {};
762
- const request = {
763
- method: 'POST',
764
- path: requestPath,
765
- queryParameters,
766
- headers,
767
- data: destinationCreate,
768
- };
769
- return transporter.request(request, requestOptions);
770
- },
771
- /**
772
- * Create a source.
773
- *
774
- * @summary Create a source.
775
- * @param sourceCreate -.
776
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
777
- */
778
- createSource(sourceCreate, requestOptions) {
779
- if (!sourceCreate) {
780
- throw new Error('Parameter `sourceCreate` is required when calling `createSource`.');
781
- }
782
- const requestPath = '/1/sources';
783
- const headers = {};
784
- const queryParameters = {};
785
- const request = {
786
- method: 'POST',
787
- path: requestPath,
788
- queryParameters,
789
- headers,
790
- data: sourceCreate,
791
- };
792
- return transporter.request(request, requestOptions);
793
- },
794
- /**
795
- * Create a task.
796
- *
797
- * @summary Create a task.
798
- * @param taskCreate -.
799
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
800
- */
801
- createTask(taskCreate, requestOptions) {
802
- if (!taskCreate) {
803
- throw new Error('Parameter `taskCreate` is required when calling `createTask`.');
804
- }
805
- if (!taskCreate.sourceID) {
806
- throw new Error('Parameter `taskCreate.sourceID` is required when calling `createTask`.');
807
- }
808
- if (!taskCreate.action) {
809
- throw new Error('Parameter `taskCreate.action` is required when calling `createTask`.');
810
- }
811
- const requestPath = '/1/tasks';
812
- const headers = {};
813
- const queryParameters = {};
814
- const request = {
815
- method: 'POST',
816
- path: requestPath,
817
- queryParameters,
818
- headers,
819
- data: taskCreate,
820
- };
821
- return transporter.request(request, requestOptions);
822
- },
823
- /**
824
- * Soft delete a authentication.
825
- *
826
- * @summary Delete a authentication.
827
- * @param deleteAuthentication - The deleteAuthentication object.
828
- * @param deleteAuthentication.authenticationID - The authentication uuid.
829
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
830
- */
831
- deleteAuthentication({ authenticationID }, requestOptions) {
832
- if (!authenticationID) {
833
- throw new Error('Parameter `authenticationID` is required when calling `deleteAuthentication`.');
834
- }
835
- const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
836
- const headers = {};
837
- const queryParameters = {};
838
- const request = {
839
- method: 'DELETE',
840
- path: requestPath,
841
- queryParameters,
842
- headers,
843
- };
844
- return transporter.request(request, requestOptions);
845
- },
846
- /**
847
- * Soft delete a destination.
848
- *
849
- * @summary Delete a destination.
850
- * @param deleteDestination - The deleteDestination object.
851
- * @param deleteDestination.destinationID - The destination uuid.
852
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
853
- */
854
- deleteDestination({ destinationID }, requestOptions) {
855
- if (!destinationID) {
856
- throw new Error('Parameter `destinationID` is required when calling `deleteDestination`.');
857
- }
858
- const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
859
- const headers = {};
860
- const queryParameters = {};
861
- const request = {
862
- method: 'DELETE',
863
- path: requestPath,
864
- queryParameters,
865
- headers,
866
- };
867
- return transporter.request(request, requestOptions);
868
- },
869
- /**
870
- * Soft delete a source.
871
- *
872
- * @summary Delete a source.
873
- * @param deleteSource - The deleteSource object.
874
- * @param deleteSource.sourceID - The source uuid.
875
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
876
- */
877
- deleteSource({ sourceID }, requestOptions) {
878
- if (!sourceID) {
879
- throw new Error('Parameter `sourceID` is required when calling `deleteSource`.');
880
- }
881
- const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
882
- const headers = {};
883
- const queryParameters = {};
884
- const request = {
885
- method: 'DELETE',
886
- path: requestPath,
887
- queryParameters,
888
- headers,
889
- };
890
- return transporter.request(request, requestOptions);
891
- },
892
- /**
893
- * Soft delete a task.
894
- *
895
- * @summary Delete a task.
896
- * @param deleteTask - The deleteTask object.
897
- * @param deleteTask.taskID - The task uuid.
898
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
899
- */
900
- deleteTask({ taskID }, requestOptions) {
901
- if (!taskID) {
902
- throw new Error('Parameter `taskID` is required when calling `deleteTask`.');
903
- }
904
- const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
905
- const headers = {};
906
- const queryParameters = {};
907
- const request = {
908
- method: 'DELETE',
909
- path: requestPath,
910
- queryParameters,
911
- headers,
912
- };
913
- return transporter.request(request, requestOptions);
914
- },
915
- /**
916
- * Disable a task.
917
- *
918
- * @summary Disable a task.
919
- * @param disableTask - The disableTask object.
920
- * @param disableTask.taskID - The task uuid.
921
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
922
- */
923
- disableTask({ taskID }, requestOptions) {
924
- if (!taskID) {
925
- throw new Error('Parameter `taskID` is required when calling `disableTask`.');
926
- }
927
- const requestPath = '/1/tasks/{taskID}/disable'.replace('{taskID}', encodeURIComponent(taskID));
928
- const headers = {};
929
- const queryParameters = {};
930
- const request = {
931
- method: 'PUT',
932
- path: requestPath,
933
- queryParameters,
934
- headers,
935
- };
936
- return transporter.request(request, requestOptions);
937
- },
938
- /**
939
- * Enable a task.
940
- *
941
- * @summary Enable a task.
942
- * @param enableTask - The enableTask object.
943
- * @param enableTask.taskID - The task uuid.
944
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
945
- */
946
- enableTask({ taskID }, requestOptions) {
947
- if (!taskID) {
948
- throw new Error('Parameter `taskID` is required when calling `enableTask`.');
949
- }
950
- const requestPath = '/1/tasks/{taskID}/enable'.replace('{taskID}', encodeURIComponent(taskID));
951
- const headers = {};
952
- const queryParameters = {};
953
- const request = {
954
- method: 'PUT',
955
- path: requestPath,
956
- queryParameters,
957
- headers,
958
- };
959
- return transporter.request(request, requestOptions);
960
- },
961
- /**
962
- * Get a authentication.
963
- *
964
- * @summary Get a authentication.
965
- * @param getAuthentication - The getAuthentication object.
966
- * @param getAuthentication.authenticationID - The authentication uuid.
967
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
968
- */
969
- getAuthentication({ authenticationID }, requestOptions) {
970
- if (!authenticationID) {
971
- throw new Error('Parameter `authenticationID` is required when calling `getAuthentication`.');
972
- }
973
- const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
974
- const headers = {};
975
- const queryParameters = {};
976
- const request = {
977
- method: 'GET',
978
- path: requestPath,
979
- queryParameters,
980
- headers,
981
- };
982
- return transporter.request(request, requestOptions);
983
- },
984
- /**
985
- * Get a list of authentications.
986
- *
987
- * @summary Get a list of authentications.
988
- * @param getAuthentications - The getAuthentications object.
989
- * @param getAuthentications.itemsPerPage - The number of items per page to return.
990
- * @param getAuthentications.page - The page number to fetch, starting at 1.
991
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
992
- */
993
- getAuthentications({ itemsPerPage, page } = {}, requestOptions = undefined) {
994
- const requestPath = '/1/authentications';
995
- const headers = {};
996
- const queryParameters = {};
997
- if (itemsPerPage !== undefined) {
998
- queryParameters.itemsPerPage = itemsPerPage.toString();
999
- }
1000
- if (page !== undefined) {
1001
- queryParameters.page = page.toString();
1002
- }
1003
- const request = {
1004
- method: 'GET',
1005
- path: requestPath,
1006
- queryParameters,
1007
- headers,
1008
- };
1009
- return transporter.request(request, requestOptions);
1010
- },
1011
- /**
1012
- * Get a destination.
1013
- *
1014
- * @summary Get a destination.
1015
- * @param getDestination - The getDestination object.
1016
- * @param getDestination.destinationID - The destination uuid.
1017
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1018
- */
1019
- getDestination({ destinationID }, requestOptions) {
1020
- if (!destinationID) {
1021
- throw new Error('Parameter `destinationID` is required when calling `getDestination`.');
1022
- }
1023
- const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
1024
- const headers = {};
1025
- const queryParameters = {};
1026
- const request = {
1027
- method: 'GET',
1028
- path: requestPath,
1029
- queryParameters,
1030
- headers,
1031
- };
1032
- return transporter.request(request, requestOptions);
1033
- },
1034
- /**
1035
- * Get a list of destinations.
1036
- *
1037
- * @summary Get a list of destinations.
1038
- * @param getDestinations - The getDestinations object.
1039
- * @param getDestinations.itemsPerPage - The number of items per page to return.
1040
- * @param getDestinations.page - The page number to fetch, starting at 1.
1041
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1042
- */
1043
- getDestinations({ itemsPerPage, page } = {}, requestOptions = undefined) {
1044
- const requestPath = '/1/destinations';
1045
- const headers = {};
1046
- const queryParameters = {};
1047
- if (itemsPerPage !== undefined) {
1048
- queryParameters.itemsPerPage = itemsPerPage.toString();
1049
- }
1050
- if (page !== undefined) {
1051
- queryParameters.page = page.toString();
1052
- }
1053
- const request = {
1054
- method: 'GET',
1055
- path: requestPath,
1056
- queryParameters,
1057
- headers,
1058
- };
1059
- return transporter.request(request, requestOptions);
1060
- },
1061
- /**
1062
- * Get an event in a specific run.
1063
- *
1064
- * @summary Get an event in a specific run.
1065
- * @param getEvent - The getEvent object.
1066
- * @param getEvent.runID - The run uuid.
1067
- * @param getEvent.eventID - The event uuid.
1068
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1069
- */
1070
- getEvent({ runID, eventID }, requestOptions) {
1071
- if (!runID) {
1072
- throw new Error('Parameter `runID` is required when calling `getEvent`.');
1073
- }
1074
- if (!eventID) {
1075
- throw new Error('Parameter `eventID` is required when calling `getEvent`.');
1076
- }
1077
- const requestPath = '/1/runs/{runID}/events/{eventID}'
1078
- .replace('{runID}', encodeURIComponent(runID))
1079
- .replace('{eventID}', encodeURIComponent(eventID));
1080
- const headers = {};
1081
- const queryParameters = {};
1082
- const request = {
1083
- method: 'GET',
1084
- path: requestPath,
1085
- queryParameters,
1086
- headers,
1087
- };
1088
- return transporter.request(request, requestOptions);
1089
- },
1090
- /**
1091
- * Get a list of events for a specific run.
1092
- *
1093
- * @summary Get a list of events for a specific run.
1094
- * @param getEvents - The getEvents object.
1095
- * @param getEvents.runID - The run uuid.
1096
- * @param getEvents.itemsPerPage - The number of items per page to return.
1097
- * @param getEvents.page - The page number to fetch, starting at 1.
1098
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1099
- */
1100
- getEvents({ runID, itemsPerPage, page }, requestOptions) {
1101
- if (!runID) {
1102
- throw new Error('Parameter `runID` is required when calling `getEvents`.');
1103
- }
1104
- const requestPath = '/1/runs/{runID}/events'.replace('{runID}', encodeURIComponent(runID));
1105
- const headers = {};
1106
- const queryParameters = {};
1107
- if (itemsPerPage !== undefined) {
1108
- queryParameters.itemsPerPage = itemsPerPage.toString();
1109
- }
1110
- if (page !== undefined) {
1111
- queryParameters.page = page.toString();
1112
- }
1113
- const request = {
1114
- method: 'GET',
1115
- path: requestPath,
1116
- queryParameters,
1117
- headers,
1118
- };
1119
- return transporter.request(request, requestOptions);
1120
- },
1121
- /**
1122
- * Get a run.
1123
- *
1124
- * @summary Get a run.
1125
- * @param getRun - The getRun object.
1126
- * @param getRun.runID - The run uuid.
1127
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1128
- */
1129
- getRun({ runID }, requestOptions) {
1130
- if (!runID) {
1131
- throw new Error('Parameter `runID` is required when calling `getRun`.');
1132
- }
1133
- const requestPath = '/1/runs/{runID}'.replace('{runID}', encodeURIComponent(runID));
1134
- const headers = {};
1135
- const queryParameters = {};
1136
- const request = {
1137
- method: 'GET',
1138
- path: requestPath,
1139
- queryParameters,
1140
- headers,
1141
- };
1142
- return transporter.request(request, requestOptions);
1143
- },
1144
- /**
1145
- * Get a list of runs.
1146
- *
1147
- * @summary Get a list of runs.
1148
- * @param getRuns - The getRuns object.
1149
- * @param getRuns.itemsPerPage - The number of items per page to return.
1150
- * @param getRuns.page - The page number to fetch, starting at 1.
1151
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1152
- */
1153
- getRuns({ itemsPerPage, page } = {}, requestOptions = undefined) {
1154
- const requestPath = '/1/runs';
1155
- const headers = {};
1156
- const queryParameters = {};
1157
- if (itemsPerPage !== undefined) {
1158
- queryParameters.itemsPerPage = itemsPerPage.toString();
1159
- }
1160
- if (page !== undefined) {
1161
- queryParameters.page = page.toString();
1162
- }
1163
- const request = {
1164
- method: 'GET',
1165
- path: requestPath,
1166
- queryParameters,
1167
- headers,
1168
- };
1169
- return transporter.request(request, requestOptions);
1170
- },
1171
- /**
1172
- * Get a list of runs associated with a taskID.
1173
- *
1174
- * @summary Get a list of runs associated with a taskID.
1175
- * @param getRunsByTaskID - The getRunsByTaskID object.
1176
- * @param getRunsByTaskID.taskID - The task uuid.
1177
- * @param getRunsByTaskID.itemsPerPage - The number of items per page to return.
1178
- * @param getRunsByTaskID.page - The page number to fetch, starting at 1.
1179
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1180
- */
1181
- getRunsByTaskID({ taskID, itemsPerPage, page }, requestOptions) {
1182
- if (!taskID) {
1183
- throw new Error('Parameter `taskID` is required when calling `getRunsByTaskID`.');
1184
- }
1185
- const requestPath = '/1/runs/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
1186
- const headers = {};
1187
- const queryParameters = {};
1188
- if (itemsPerPage !== undefined) {
1189
- queryParameters.itemsPerPage = itemsPerPage.toString();
1190
- }
1191
- if (page !== undefined) {
1192
- queryParameters.page = page.toString();
1193
- }
1194
- const request = {
1195
- method: 'GET',
1196
- path: requestPath,
1197
- queryParameters,
1198
- headers,
1199
- };
1200
- return transporter.request(request, requestOptions);
1201
- },
1202
- /**
1203
- * Get a source.
1204
- *
1205
- * @summary Get a source.
1206
- * @param getSource - The getSource object.
1207
- * @param getSource.sourceID - The source uuid.
1208
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1209
- */
1210
- getSource({ sourceID }, requestOptions) {
1211
- if (!sourceID) {
1212
- throw new Error('Parameter `sourceID` is required when calling `getSource`.');
1213
- }
1214
- const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
1215
- const headers = {};
1216
- const queryParameters = {};
1217
- const request = {
1218
- method: 'GET',
1219
- path: requestPath,
1220
- queryParameters,
1221
- headers,
1222
- };
1223
- return transporter.request(request, requestOptions);
1224
- },
1225
- /**
1226
- * Get a list of sources.
1227
- *
1228
- * @summary Get a list of sources.
1229
- * @param getSources - The getSources object.
1230
- * @param getSources.itemsPerPage - The number of items per page to return.
1231
- * @param getSources.page - The page number to fetch, starting at 1.
1232
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1233
- */
1234
- getSources({ itemsPerPage, page } = {}, requestOptions = undefined) {
1235
- const requestPath = '/1/sources';
1236
- const headers = {};
1237
- const queryParameters = {};
1238
- if (itemsPerPage !== undefined) {
1239
- queryParameters.itemsPerPage = itemsPerPage.toString();
1240
- }
1241
- if (page !== undefined) {
1242
- queryParameters.page = page.toString();
1243
- }
1244
- const request = {
1245
- method: 'GET',
1246
- path: requestPath,
1247
- queryParameters,
1248
- headers,
1249
- };
1250
- return transporter.request(request, requestOptions);
1251
- },
1252
- /**
1253
- * Get a task.
1254
- *
1255
- * @summary Get a task.
1256
- * @param getTask - The getTask object.
1257
- * @param getTask.taskID - The task uuid.
1258
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1259
- */
1260
- getTask({ taskID }, requestOptions) {
1261
- if (!taskID) {
1262
- throw new Error('Parameter `taskID` is required when calling `getTask`.');
1263
- }
1264
- const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
1265
- const headers = {};
1266
- const queryParameters = {};
1267
- const request = {
1268
- method: 'GET',
1269
- path: requestPath,
1270
- queryParameters,
1271
- headers,
1272
- };
1273
- return transporter.request(request, requestOptions);
1274
- },
1275
- /**
1276
- * Get a list of tasks.
1277
- *
1278
- * @summary Get a list of tasks.
1279
- * @param getTasks - The getTasks object.
1280
- * @param getTasks.itemsPerPage - The number of items per page to return.
1281
- * @param getTasks.page - The page number to fetch, starting at 1.
1282
- * @param getTasks.action - Which action the returned task should have. Can be a list of string separated with commas.
1283
- * @param getTasks.enabled - If the returned task should have its \'enabled\' property set to true.
1284
- * @param getTasks.destinationID - Which destinationID the returned task should have. Can be a list of string separated with commas.
1285
- * @param getTasks.triggerType - Which trigger type the returned task should have. Can be a list of string separated with commas.
1286
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1287
- */
1288
- getTasks({ itemsPerPage, page, action, enabled, destinationID, triggerType, } = {}, requestOptions = undefined) {
1289
- const requestPath = '/1/tasks';
1290
- const headers = {};
1291
- const queryParameters = {};
1292
- if (itemsPerPage !== undefined) {
1293
- queryParameters.itemsPerPage = itemsPerPage.toString();
1294
- }
1295
- if (page !== undefined) {
1296
- queryParameters.page = page.toString();
1297
- }
1298
- if (action !== undefined) {
1299
- queryParameters.action = action.toString();
1300
- }
1301
- if (enabled !== undefined) {
1302
- queryParameters.enabled = enabled.toString();
1303
- }
1304
- if (destinationID !== undefined) {
1305
- queryParameters.destinationID = destinationID.toString();
1306
- }
1307
- if (triggerType !== undefined) {
1308
- queryParameters.triggerType = triggerType.toString();
1309
- }
1310
- const request = {
1311
- method: 'GET',
1312
- path: requestPath,
1313
- queryParameters,
1314
- headers,
1315
- };
1316
- return transporter.request(request, requestOptions);
1317
- },
1318
- /**
1319
- * Run a task.
1320
- *
1321
- * @summary Run a task.
1322
- * @param runTask - The runTask object.
1323
- * @param runTask.taskID - The task uuid.
1324
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1325
- */
1326
- runTask({ taskID }, requestOptions) {
1327
- if (!taskID) {
1328
- throw new Error('Parameter `taskID` is required when calling `runTask`.');
1329
- }
1330
- const requestPath = '/1/tasks/{taskID}/run'.replace('{taskID}', encodeURIComponent(taskID));
1331
- const headers = {};
1332
- const queryParameters = {};
1333
- const request = {
1334
- method: 'POST',
1335
- path: requestPath,
1336
- queryParameters,
1337
- headers,
1338
- };
1339
- return transporter.request(request, requestOptions);
1340
- },
1341
- /**
1342
- * Update a authentication.
1343
- *
1344
- * @summary Update a authentication.
1345
- * @param updateAuthentication - The updateAuthentication object.
1346
- * @param updateAuthentication.authenticationID - The authentication uuid.
1347
- * @param updateAuthentication.authenticationUpdate - The authenticationUpdate object.
1348
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1349
- */
1350
- updateAuthentication({ authenticationID, authenticationUpdate }, requestOptions) {
1351
- if (!authenticationID) {
1352
- throw new Error('Parameter `authenticationID` is required when calling `updateAuthentication`.');
1353
- }
1354
- if (!authenticationUpdate) {
1355
- throw new Error('Parameter `authenticationUpdate` is required when calling `updateAuthentication`.');
1356
- }
1357
- const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
1358
- const headers = {};
1359
- const queryParameters = {};
1360
- const request = {
1361
- method: 'PUT',
1362
- path: requestPath,
1363
- queryParameters,
1364
- headers,
1365
- data: authenticationUpdate,
1366
- };
1367
- return transporter.request(request, requestOptions);
1368
- },
1369
- /**
1370
- * Update a destination.
1371
- *
1372
- * @summary Update a destination.
1373
- * @param updateDestination - The updateDestination object.
1374
- * @param updateDestination.destinationID - The destination uuid.
1375
- * @param updateDestination.destinationUpdate - The destinationUpdate object.
1376
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1377
- */
1378
- updateDestination({ destinationID, destinationUpdate }, requestOptions) {
1379
- if (!destinationID) {
1380
- throw new Error('Parameter `destinationID` is required when calling `updateDestination`.');
1381
- }
1382
- if (!destinationUpdate) {
1383
- throw new Error('Parameter `destinationUpdate` is required when calling `updateDestination`.');
1384
- }
1385
- const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
1386
- const headers = {};
1387
- const queryParameters = {};
1388
- const request = {
1389
- method: 'PUT',
1390
- path: requestPath,
1391
- queryParameters,
1392
- headers,
1393
- data: destinationUpdate,
1394
- };
1395
- return transporter.request(request, requestOptions);
1396
- },
1397
- /**
1398
- * Update a source.
1399
- *
1400
- * @summary Update a source.
1401
- * @param updateSource - The updateSource object.
1402
- * @param updateSource.sourceID - The source uuid.
1403
- * @param updateSource.sourceUpdate - The sourceUpdate object.
1404
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1405
- */
1406
- updateSource({ sourceID, sourceUpdate }, requestOptions) {
1407
- if (!sourceID) {
1408
- throw new Error('Parameter `sourceID` is required when calling `updateSource`.');
1409
- }
1410
- if (!sourceUpdate) {
1411
- throw new Error('Parameter `sourceUpdate` is required when calling `updateSource`.');
1412
- }
1413
- const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
1414
- const headers = {};
1415
- const queryParameters = {};
1416
- const request = {
1417
- method: 'POST',
1418
- path: requestPath,
1419
- queryParameters,
1420
- headers,
1421
- data: sourceUpdate,
1422
- };
1423
- return transporter.request(request, requestOptions);
1424
- },
1425
- /**
1426
- * Update a task.
1427
- *
1428
- * @summary Update a task.
1429
- * @param updateTask - The updateTask object.
1430
- * @param updateTask.taskID - The task uuid.
1431
- * @param updateTask.taskUpdate - The taskUpdate object.
1432
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1433
- */
1434
- updateTask({ taskID, taskUpdate }, requestOptions) {
1435
- if (!taskID) {
1436
- throw new Error('Parameter `taskID` is required when calling `updateTask`.');
1437
- }
1438
- if (!taskUpdate) {
1439
- throw new Error('Parameter `taskUpdate` is required when calling `updateTask`.');
1440
- }
1441
- const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
1442
- const headers = {};
1443
- const queryParameters = {};
1444
- const request = {
1445
- method: 'PUT',
1446
- path: requestPath,
1447
- queryParameters,
1448
- headers,
1449
- data: taskUpdate,
1450
- };
1451
- return transporter.request(request, requestOptions);
1452
- },
1453
- };
678
+ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
679
+ const apiClientVersion = '1.0.0-beta.10';
680
+ const REGIONS = ['eu', 'us'];
681
+ function getDefaultHosts(region) {
682
+ const url = 'data.{region}.algolia.com'.replace('{region}', region);
683
+ return [{ url, accept: 'readWrite', protocol: 'https' }];
684
+ }
685
+ /**
686
+ * Guard: Return strongly typed specific OnDemandTrigger for a given Trigger.
687
+ *
688
+ * @summary Guard method that returns a strongly typed specific OnDemandTrigger for a given Trigger.
689
+ * @param trigger - The given Task Trigger.
690
+ */
691
+ function isOnDemandTrigger(trigger) {
692
+ return trigger.type === 'onDemand';
693
+ }
694
+ /**
695
+ * Guard: Return strongly typed specific ScheduleTrigger for a given Trigger.
696
+ *
697
+ * @summary Guard method that returns a strongly typed specific ScheduleTrigger for a given Trigger.
698
+ * @param trigger - The given Task Trigger.
699
+ */
700
+ function isScheduleTrigger(trigger) {
701
+ return trigger.type === 'schedule';
702
+ }
703
+ /**
704
+ * Guard: Return strongly typed specific SubscriptionTrigger for a given Trigger.
705
+ *
706
+ * @summary Guard method that returns a strongly typed specific SubscriptionTrigger for a given Trigger.
707
+ * @param trigger - The given Task Trigger.
708
+ */
709
+ function isSubscriptionTrigger(trigger) {
710
+ return trigger.type === 'subscription';
711
+ }
712
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
713
+ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
714
+ const auth = createAuth(appIdOption, apiKeyOption, authMode);
715
+ const transporter = createTransporter({
716
+ hosts: getDefaultHosts(regionOption),
717
+ ...options,
718
+ algoliaAgent: getAlgoliaAgent({
719
+ algoliaAgents,
720
+ client: 'Ingestion',
721
+ version: apiClientVersion,
722
+ }),
723
+ baseHeaders: {
724
+ 'content-type': 'text/plain',
725
+ ...auth.headers(),
726
+ ...options.baseHeaders,
727
+ },
728
+ baseQueryParameters: {
729
+ ...auth.queryParameters(),
730
+ ...options.baseQueryParameters,
731
+ },
732
+ });
733
+ return {
734
+ transporter,
735
+ /**
736
+ * The `appId` currently in use.
737
+ */
738
+ appId: appIdOption,
739
+ /**
740
+ * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
741
+ */
742
+ clearCache() {
743
+ return Promise.all([
744
+ transporter.requestsCache.clear(),
745
+ transporter.responsesCache.clear(),
746
+ ]).then(() => undefined);
747
+ },
748
+ /**
749
+ * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
750
+ */
751
+ get _ua() {
752
+ return transporter.algoliaAgent.value;
753
+ },
754
+ /**
755
+ * Adds a `segment` to the `x-algolia-agent` sent with every requests.
756
+ *
757
+ * @param segment - The algolia agent (user-agent) segment to add.
758
+ * @param version - The version of the agent.
759
+ */
760
+ addAlgoliaAgent(segment, version) {
761
+ transporter.algoliaAgent.add({ segment, version });
762
+ },
763
+ /**
764
+ * Creates a new authentication resource.
765
+ *
766
+ * Required API Key ACLs:
767
+ * - addObject
768
+ * - deleteIndex
769
+ * - editSettings.
770
+ *
771
+ * @param authenticationCreate -.
772
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
773
+ */
774
+ createAuthentication(authenticationCreate, requestOptions) {
775
+ if (!authenticationCreate) {
776
+ throw new Error('Parameter `authenticationCreate` is required when calling `createAuthentication`.');
777
+ }
778
+ if (!authenticationCreate.type) {
779
+ throw new Error('Parameter `authenticationCreate.type` is required when calling `createAuthentication`.');
780
+ }
781
+ if (!authenticationCreate.name) {
782
+ throw new Error('Parameter `authenticationCreate.name` is required when calling `createAuthentication`.');
783
+ }
784
+ if (!authenticationCreate.input) {
785
+ throw new Error('Parameter `authenticationCreate.input` is required when calling `createAuthentication`.');
786
+ }
787
+ const requestPath = '/1/authentications';
788
+ const headers = {};
789
+ const queryParameters = {};
790
+ const request = {
791
+ method: 'POST',
792
+ path: requestPath,
793
+ queryParameters,
794
+ headers,
795
+ data: authenticationCreate,
796
+ };
797
+ return transporter.request(request, requestOptions);
798
+ },
799
+ /**
800
+ * Creates a new destination.
801
+ *
802
+ * Required API Key ACLs:
803
+ * - addObject
804
+ * - deleteIndex
805
+ * - editSettings.
806
+ *
807
+ * @param destinationCreate -.
808
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
809
+ */
810
+ createDestination(destinationCreate, requestOptions) {
811
+ if (!destinationCreate) {
812
+ throw new Error('Parameter `destinationCreate` is required when calling `createDestination`.');
813
+ }
814
+ if (!destinationCreate.type) {
815
+ throw new Error('Parameter `destinationCreate.type` is required when calling `createDestination`.');
816
+ }
817
+ if (!destinationCreate.name) {
818
+ throw new Error('Parameter `destinationCreate.name` is required when calling `createDestination`.');
819
+ }
820
+ if (!destinationCreate.input) {
821
+ throw new Error('Parameter `destinationCreate.input` is required when calling `createDestination`.');
822
+ }
823
+ const requestPath = '/1/destinations';
824
+ const headers = {};
825
+ const queryParameters = {};
826
+ const request = {
827
+ method: 'POST',
828
+ path: requestPath,
829
+ queryParameters,
830
+ headers,
831
+ data: destinationCreate,
832
+ };
833
+ return transporter.request(request, requestOptions);
834
+ },
835
+ /**
836
+ * Creates a new source.
837
+ *
838
+ * Required API Key ACLs:
839
+ * - addObject
840
+ * - deleteIndex
841
+ * - editSettings.
842
+ *
843
+ * @param sourceCreate -.
844
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
845
+ */
846
+ createSource(sourceCreate, requestOptions) {
847
+ if (!sourceCreate) {
848
+ throw new Error('Parameter `sourceCreate` is required when calling `createSource`.');
849
+ }
850
+ if (!sourceCreate.type) {
851
+ throw new Error('Parameter `sourceCreate.type` is required when calling `createSource`.');
852
+ }
853
+ if (!sourceCreate.name) {
854
+ throw new Error('Parameter `sourceCreate.name` is required when calling `createSource`.');
855
+ }
856
+ if (!sourceCreate.input) {
857
+ throw new Error('Parameter `sourceCreate.input` is required when calling `createSource`.');
858
+ }
859
+ const requestPath = '/1/sources';
860
+ const headers = {};
861
+ const queryParameters = {};
862
+ const request = {
863
+ method: 'POST',
864
+ path: requestPath,
865
+ queryParameters,
866
+ headers,
867
+ data: sourceCreate,
868
+ };
869
+ return transporter.request(request, requestOptions);
870
+ },
871
+ /**
872
+ * Creates a new task.
873
+ *
874
+ * @param taskCreate - Request body for creating a task.
875
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
876
+ */
877
+ createTask(taskCreate, requestOptions) {
878
+ if (!taskCreate) {
879
+ throw new Error('Parameter `taskCreate` is required when calling `createTask`.');
880
+ }
881
+ if (!taskCreate.sourceID) {
882
+ throw new Error('Parameter `taskCreate.sourceID` is required when calling `createTask`.');
883
+ }
884
+ if (!taskCreate.destinationID) {
885
+ throw new Error('Parameter `taskCreate.destinationID` is required when calling `createTask`.');
886
+ }
887
+ if (!taskCreate.trigger) {
888
+ throw new Error('Parameter `taskCreate.trigger` is required when calling `createTask`.');
889
+ }
890
+ if (!taskCreate.action) {
891
+ throw new Error('Parameter `taskCreate.action` is required when calling `createTask`.');
892
+ }
893
+ const requestPath = '/1/tasks';
894
+ const headers = {};
895
+ const queryParameters = {};
896
+ const request = {
897
+ method: 'POST',
898
+ path: requestPath,
899
+ queryParameters,
900
+ headers,
901
+ data: taskCreate,
902
+ };
903
+ return transporter.request(request, requestOptions);
904
+ },
905
+ /**
906
+ * Creates a new transformation.
907
+ *
908
+ * @param transformationCreate - Request body for creating a transformation.
909
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
910
+ */
911
+ createTransformation(transformationCreate, requestOptions) {
912
+ if (!transformationCreate) {
913
+ throw new Error('Parameter `transformationCreate` is required when calling `createTransformation`.');
914
+ }
915
+ if (!transformationCreate.code) {
916
+ throw new Error('Parameter `transformationCreate.code` is required when calling `createTransformation`.');
917
+ }
918
+ if (!transformationCreate.name) {
919
+ throw new Error('Parameter `transformationCreate.name` is required when calling `createTransformation`.');
920
+ }
921
+ const requestPath = '/1/transformations';
922
+ const headers = {};
923
+ const queryParameters = {};
924
+ const request = {
925
+ method: 'POST',
926
+ path: requestPath,
927
+ queryParameters,
928
+ headers,
929
+ data: transformationCreate,
930
+ };
931
+ return transporter.request(request, requestOptions);
932
+ },
933
+ /**
934
+ * This method allow you to send requests to the Algolia REST API.
935
+ *
936
+ * @param customDelete - The customDelete object.
937
+ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
938
+ * @param customDelete.parameters - Query parameters to apply to the current query.
939
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
940
+ */
941
+ customDelete({ path, parameters }, requestOptions) {
942
+ if (!path) {
943
+ throw new Error('Parameter `path` is required when calling `customDelete`.');
944
+ }
945
+ const requestPath = '/{path}'.replace('{path}', path);
946
+ const headers = {};
947
+ const queryParameters = parameters ? parameters : {};
948
+ const request = {
949
+ method: 'DELETE',
950
+ path: requestPath,
951
+ queryParameters,
952
+ headers,
953
+ };
954
+ return transporter.request(request, requestOptions);
955
+ },
956
+ /**
957
+ * This method allow you to send requests to the Algolia REST API.
958
+ *
959
+ * @param customGet - The customGet object.
960
+ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
961
+ * @param customGet.parameters - Query parameters to apply to the current query.
962
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
963
+ */
964
+ customGet({ path, parameters }, requestOptions) {
965
+ if (!path) {
966
+ throw new Error('Parameter `path` is required when calling `customGet`.');
967
+ }
968
+ const requestPath = '/{path}'.replace('{path}', path);
969
+ const headers = {};
970
+ const queryParameters = parameters ? parameters : {};
971
+ const request = {
972
+ method: 'GET',
973
+ path: requestPath,
974
+ queryParameters,
975
+ headers,
976
+ };
977
+ return transporter.request(request, requestOptions);
978
+ },
979
+ /**
980
+ * This method allow you to send requests to the Algolia REST API.
981
+ *
982
+ * @param customPost - The customPost object.
983
+ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
984
+ * @param customPost.parameters - Query parameters to apply to the current query.
985
+ * @param customPost.body - Parameters to send with the custom request.
986
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
987
+ */
988
+ customPost({ path, parameters, body }, requestOptions) {
989
+ if (!path) {
990
+ throw new Error('Parameter `path` is required when calling `customPost`.');
991
+ }
992
+ const requestPath = '/{path}'.replace('{path}', path);
993
+ const headers = {};
994
+ const queryParameters = parameters ? parameters : {};
995
+ const request = {
996
+ method: 'POST',
997
+ path: requestPath,
998
+ queryParameters,
999
+ headers,
1000
+ data: body ? body : {},
1001
+ };
1002
+ return transporter.request(request, requestOptions);
1003
+ },
1004
+ /**
1005
+ * This method allow you to send requests to the Algolia REST API.
1006
+ *
1007
+ * @param customPut - The customPut object.
1008
+ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
1009
+ * @param customPut.parameters - Query parameters to apply to the current query.
1010
+ * @param customPut.body - Parameters to send with the custom request.
1011
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1012
+ */
1013
+ customPut({ path, parameters, body }, requestOptions) {
1014
+ if (!path) {
1015
+ throw new Error('Parameter `path` is required when calling `customPut`.');
1016
+ }
1017
+ const requestPath = '/{path}'.replace('{path}', path);
1018
+ const headers = {};
1019
+ const queryParameters = parameters ? parameters : {};
1020
+ const request = {
1021
+ method: 'PUT',
1022
+ path: requestPath,
1023
+ queryParameters,
1024
+ headers,
1025
+ data: body ? body : {},
1026
+ };
1027
+ return transporter.request(request, requestOptions);
1028
+ },
1029
+ /**
1030
+ * Deletes an authentication resource. You can\'t delete authentication resources that are used by a source or a destination.
1031
+ *
1032
+ * Required API Key ACLs:
1033
+ * - addObject
1034
+ * - deleteIndex
1035
+ * - editSettings.
1036
+ *
1037
+ * @param deleteAuthentication - The deleteAuthentication object.
1038
+ * @param deleteAuthentication.authenticationID - Unique identifier of an authentication resource.
1039
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1040
+ */
1041
+ deleteAuthentication({ authenticationID }, requestOptions) {
1042
+ if (!authenticationID) {
1043
+ throw new Error('Parameter `authenticationID` is required when calling `deleteAuthentication`.');
1044
+ }
1045
+ const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
1046
+ const headers = {};
1047
+ const queryParameters = {};
1048
+ const request = {
1049
+ method: 'DELETE',
1050
+ path: requestPath,
1051
+ queryParameters,
1052
+ headers,
1053
+ };
1054
+ return transporter.request(request, requestOptions);
1055
+ },
1056
+ /**
1057
+ * Deletes a destination by its ID. You can\'t delete destinations that are referenced in tasks.
1058
+ *
1059
+ * Required API Key ACLs:
1060
+ * - addObject
1061
+ * - deleteIndex
1062
+ * - editSettings.
1063
+ *
1064
+ * @param deleteDestination - The deleteDestination object.
1065
+ * @param deleteDestination.destinationID - Unique identifier of a destination.
1066
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1067
+ */
1068
+ deleteDestination({ destinationID }, requestOptions) {
1069
+ if (!destinationID) {
1070
+ throw new Error('Parameter `destinationID` is required when calling `deleteDestination`.');
1071
+ }
1072
+ const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
1073
+ const headers = {};
1074
+ const queryParameters = {};
1075
+ const request = {
1076
+ method: 'DELETE',
1077
+ path: requestPath,
1078
+ queryParameters,
1079
+ headers,
1080
+ };
1081
+ return transporter.request(request, requestOptions);
1082
+ },
1083
+ /**
1084
+ * Deletes a source by its ID. You can\'t delete sources that are referenced in tasks.
1085
+ *
1086
+ * Required API Key ACLs:
1087
+ * - addObject
1088
+ * - deleteIndex
1089
+ * - editSettings.
1090
+ *
1091
+ * @param deleteSource - The deleteSource object.
1092
+ * @param deleteSource.sourceID - Unique identifier of a source.
1093
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1094
+ */
1095
+ deleteSource({ sourceID }, requestOptions) {
1096
+ if (!sourceID) {
1097
+ throw new Error('Parameter `sourceID` is required when calling `deleteSource`.');
1098
+ }
1099
+ const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
1100
+ const headers = {};
1101
+ const queryParameters = {};
1102
+ const request = {
1103
+ method: 'DELETE',
1104
+ path: requestPath,
1105
+ queryParameters,
1106
+ headers,
1107
+ };
1108
+ return transporter.request(request, requestOptions);
1109
+ },
1110
+ /**
1111
+ * Deletes a task by its ID.
1112
+ *
1113
+ * @param deleteTask - The deleteTask object.
1114
+ * @param deleteTask.taskID - Unique identifier of a task.
1115
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1116
+ */
1117
+ deleteTask({ taskID }, requestOptions) {
1118
+ if (!taskID) {
1119
+ throw new Error('Parameter `taskID` is required when calling `deleteTask`.');
1120
+ }
1121
+ const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
1122
+ const headers = {};
1123
+ const queryParameters = {};
1124
+ const request = {
1125
+ method: 'DELETE',
1126
+ path: requestPath,
1127
+ queryParameters,
1128
+ headers,
1129
+ };
1130
+ return transporter.request(request, requestOptions);
1131
+ },
1132
+ /**
1133
+ * Deletes a transformation by its ID.
1134
+ *
1135
+ * @param deleteTransformation - The deleteTransformation object.
1136
+ * @param deleteTransformation.transformationID - Unique identifier of a transformation.
1137
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1138
+ */
1139
+ deleteTransformation({ transformationID }, requestOptions) {
1140
+ if (!transformationID) {
1141
+ throw new Error('Parameter `transformationID` is required when calling `deleteTransformation`.');
1142
+ }
1143
+ const requestPath = '/1/transformations/{transformationID}'.replace('{transformationID}', encodeURIComponent(transformationID));
1144
+ const headers = {};
1145
+ const queryParameters = {};
1146
+ const request = {
1147
+ method: 'DELETE',
1148
+ path: requestPath,
1149
+ queryParameters,
1150
+ headers,
1151
+ };
1152
+ return transporter.request(request, requestOptions);
1153
+ },
1154
+ /**
1155
+ * Disables a task.
1156
+ *
1157
+ * Required API Key ACLs:
1158
+ * - addObject
1159
+ * - deleteIndex
1160
+ * - editSettings.
1161
+ *
1162
+ * @param disableTask - The disableTask object.
1163
+ * @param disableTask.taskID - Unique identifier of a task.
1164
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1165
+ */
1166
+ disableTask({ taskID }, requestOptions) {
1167
+ if (!taskID) {
1168
+ throw new Error('Parameter `taskID` is required when calling `disableTask`.');
1169
+ }
1170
+ const requestPath = '/1/tasks/{taskID}/disable'.replace('{taskID}', encodeURIComponent(taskID));
1171
+ const headers = {};
1172
+ const queryParameters = {};
1173
+ const request = {
1174
+ method: 'PUT',
1175
+ path: requestPath,
1176
+ queryParameters,
1177
+ headers,
1178
+ };
1179
+ return transporter.request(request, requestOptions);
1180
+ },
1181
+ /**
1182
+ * Enables a task.
1183
+ *
1184
+ * Required API Key ACLs:
1185
+ * - addObject
1186
+ * - deleteIndex
1187
+ * - editSettings.
1188
+ *
1189
+ * @param enableTask - The enableTask object.
1190
+ * @param enableTask.taskID - Unique identifier of a task.
1191
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1192
+ */
1193
+ enableTask({ taskID }, requestOptions) {
1194
+ if (!taskID) {
1195
+ throw new Error('Parameter `taskID` is required when calling `enableTask`.');
1196
+ }
1197
+ const requestPath = '/1/tasks/{taskID}/enable'.replace('{taskID}', encodeURIComponent(taskID));
1198
+ const headers = {};
1199
+ const queryParameters = {};
1200
+ const request = {
1201
+ method: 'PUT',
1202
+ path: requestPath,
1203
+ queryParameters,
1204
+ headers,
1205
+ };
1206
+ return transporter.request(request, requestOptions);
1207
+ },
1208
+ /**
1209
+ * Retrieves an authentication resource by its ID.
1210
+ *
1211
+ * Required API Key ACLs:
1212
+ * - addObject
1213
+ * - deleteIndex
1214
+ * - editSettings.
1215
+ *
1216
+ * @param getAuthentication - The getAuthentication object.
1217
+ * @param getAuthentication.authenticationID - Unique identifier of an authentication resource.
1218
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1219
+ */
1220
+ getAuthentication({ authenticationID }, requestOptions) {
1221
+ if (!authenticationID) {
1222
+ throw new Error('Parameter `authenticationID` is required when calling `getAuthentication`.');
1223
+ }
1224
+ const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
1225
+ const headers = {};
1226
+ const queryParameters = {};
1227
+ const request = {
1228
+ method: 'GET',
1229
+ path: requestPath,
1230
+ queryParameters,
1231
+ headers,
1232
+ };
1233
+ return transporter.request(request, requestOptions);
1234
+ },
1235
+ /**
1236
+ * Retrieves a list of all authentication resources.
1237
+ *
1238
+ * Required API Key ACLs:
1239
+ * - addObject
1240
+ * - deleteIndex
1241
+ * - editSettings.
1242
+ *
1243
+ * @param getAuthentications - The getAuthentications object.
1244
+ * @param getAuthentications.itemsPerPage - Number of items per page.
1245
+ * @param getAuthentications.page - Page number of the paginated API response.
1246
+ * @param getAuthentications.type - Type of authentication resource to retrieve.
1247
+ * @param getAuthentications.platform - Ecommerce platform for which to retrieve authentication resources.
1248
+ * @param getAuthentications.sort - Property by which to sort the list of authentication resources.
1249
+ * @param getAuthentications.order - Sort order of the response, ascending or descending.
1250
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1251
+ */
1252
+ getAuthentications({ itemsPerPage, page, type, platform, sort, order, } = {}, requestOptions = undefined) {
1253
+ const requestPath = '/1/authentications';
1254
+ const headers = {};
1255
+ const queryParameters = {};
1256
+ if (itemsPerPage !== undefined) {
1257
+ queryParameters.itemsPerPage = itemsPerPage.toString();
1258
+ }
1259
+ if (page !== undefined) {
1260
+ queryParameters.page = page.toString();
1261
+ }
1262
+ if (type !== undefined) {
1263
+ queryParameters.type = type.toString();
1264
+ }
1265
+ if (platform !== undefined) {
1266
+ queryParameters.platform = platform.toString();
1267
+ }
1268
+ if (sort !== undefined) {
1269
+ queryParameters.sort = sort.toString();
1270
+ }
1271
+ if (order !== undefined) {
1272
+ queryParameters.order = order.toString();
1273
+ }
1274
+ const request = {
1275
+ method: 'GET',
1276
+ path: requestPath,
1277
+ queryParameters,
1278
+ headers,
1279
+ };
1280
+ return transporter.request(request, requestOptions);
1281
+ },
1282
+ /**
1283
+ * Retrieves a destination by its ID.
1284
+ *
1285
+ * Required API Key ACLs:
1286
+ * - addObject
1287
+ * - deleteIndex
1288
+ * - editSettings.
1289
+ *
1290
+ * @param getDestination - The getDestination object.
1291
+ * @param getDestination.destinationID - Unique identifier of a destination.
1292
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1293
+ */
1294
+ getDestination({ destinationID }, requestOptions) {
1295
+ if (!destinationID) {
1296
+ throw new Error('Parameter `destinationID` is required when calling `getDestination`.');
1297
+ }
1298
+ const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
1299
+ const headers = {};
1300
+ const queryParameters = {};
1301
+ const request = {
1302
+ method: 'GET',
1303
+ path: requestPath,
1304
+ queryParameters,
1305
+ headers,
1306
+ };
1307
+ return transporter.request(request, requestOptions);
1308
+ },
1309
+ /**
1310
+ * Retrieves a list of destinations.
1311
+ *
1312
+ * Required API Key ACLs:
1313
+ * - addObject
1314
+ * - deleteIndex
1315
+ * - editSettings.
1316
+ *
1317
+ * @param getDestinations - The getDestinations object.
1318
+ * @param getDestinations.itemsPerPage - Number of items per page.
1319
+ * @param getDestinations.page - Page number of the paginated API response.
1320
+ * @param getDestinations.type - Destination type.
1321
+ * @param getDestinations.authenticationID - Authentication ID used by destinations.
1322
+ * @param getDestinations.sort - Property by which to sort the destinations.
1323
+ * @param getDestinations.order - Sort order of the response, ascending or descending.
1324
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1325
+ */
1326
+ getDestinations({ itemsPerPage, page, type, authenticationID, sort, order, } = {}, requestOptions = undefined) {
1327
+ const requestPath = '/1/destinations';
1328
+ const headers = {};
1329
+ const queryParameters = {};
1330
+ if (itemsPerPage !== undefined) {
1331
+ queryParameters.itemsPerPage = itemsPerPage.toString();
1332
+ }
1333
+ if (page !== undefined) {
1334
+ queryParameters.page = page.toString();
1335
+ }
1336
+ if (type !== undefined) {
1337
+ queryParameters.type = type.toString();
1338
+ }
1339
+ if (authenticationID !== undefined) {
1340
+ queryParameters.authenticationID = authenticationID.toString();
1341
+ }
1342
+ if (sort !== undefined) {
1343
+ queryParameters.sort = sort.toString();
1344
+ }
1345
+ if (order !== undefined) {
1346
+ queryParameters.order = order.toString();
1347
+ }
1348
+ const request = {
1349
+ method: 'GET',
1350
+ path: requestPath,
1351
+ queryParameters,
1352
+ headers,
1353
+ };
1354
+ return transporter.request(request, requestOptions);
1355
+ },
1356
+ /**
1357
+ * Retrieves a single task run event by its ID.
1358
+ *
1359
+ * Required API Key ACLs:
1360
+ * - addObject
1361
+ * - deleteIndex
1362
+ * - editSettings.
1363
+ *
1364
+ * @param getEvent - The getEvent object.
1365
+ * @param getEvent.runID - Unique identifier of a task run.
1366
+ * @param getEvent.eventID - Unique identifier of an event.
1367
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1368
+ */
1369
+ getEvent({ runID, eventID }, requestOptions) {
1370
+ if (!runID) {
1371
+ throw new Error('Parameter `runID` is required when calling `getEvent`.');
1372
+ }
1373
+ if (!eventID) {
1374
+ throw new Error('Parameter `eventID` is required when calling `getEvent`.');
1375
+ }
1376
+ const requestPath = '/1/runs/{runID}/events/{eventID}'
1377
+ .replace('{runID}', encodeURIComponent(runID))
1378
+ .replace('{eventID}', encodeURIComponent(eventID));
1379
+ const headers = {};
1380
+ const queryParameters = {};
1381
+ const request = {
1382
+ method: 'GET',
1383
+ path: requestPath,
1384
+ queryParameters,
1385
+ headers,
1386
+ };
1387
+ return transporter.request(request, requestOptions);
1388
+ },
1389
+ /**
1390
+ * Retrieves a list of events for a task run, identified by it\'s ID.
1391
+ *
1392
+ * Required API Key ACLs:
1393
+ * - addObject
1394
+ * - deleteIndex
1395
+ * - editSettings.
1396
+ *
1397
+ * @param getEvents - The getEvents object.
1398
+ * @param getEvents.runID - Unique identifier of a task run.
1399
+ * @param getEvents.itemsPerPage - Number of items per page.
1400
+ * @param getEvents.page - Page number of the paginated API response.
1401
+ * @param getEvents.status - Event status for filtering the list of task runs.
1402
+ * @param getEvents.type - Event type for filtering the list of task runs.
1403
+ * @param getEvents.sort - Property by which to sort the list of task run events.
1404
+ * @param getEvents.order - Sort order of the response, ascending or descending.
1405
+ * @param getEvents.startDate - Date and time in RFC 3339 format for the earliest events to retrieve. By default, the current time minus three hours is used.
1406
+ * @param getEvents.endDate - Date and time in RFC 3339 format for the latest events to retrieve. By default, the current time is used.
1407
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1408
+ */
1409
+ getEvents({ runID, itemsPerPage, page, status, type, sort, order, startDate, endDate, }, requestOptions) {
1410
+ if (!runID) {
1411
+ throw new Error('Parameter `runID` is required when calling `getEvents`.');
1412
+ }
1413
+ const requestPath = '/1/runs/{runID}/events'.replace('{runID}', encodeURIComponent(runID));
1414
+ const headers = {};
1415
+ const queryParameters = {};
1416
+ if (itemsPerPage !== undefined) {
1417
+ queryParameters.itemsPerPage = itemsPerPage.toString();
1418
+ }
1419
+ if (page !== undefined) {
1420
+ queryParameters.page = page.toString();
1421
+ }
1422
+ if (status !== undefined) {
1423
+ queryParameters.status = status.toString();
1424
+ }
1425
+ if (type !== undefined) {
1426
+ queryParameters.type = type.toString();
1427
+ }
1428
+ if (sort !== undefined) {
1429
+ queryParameters.sort = sort.toString();
1430
+ }
1431
+ if (order !== undefined) {
1432
+ queryParameters.order = order.toString();
1433
+ }
1434
+ if (startDate !== undefined) {
1435
+ queryParameters.startDate = startDate.toString();
1436
+ }
1437
+ if (endDate !== undefined) {
1438
+ queryParameters.endDate = endDate.toString();
1439
+ }
1440
+ const request = {
1441
+ method: 'GET',
1442
+ path: requestPath,
1443
+ queryParameters,
1444
+ headers,
1445
+ };
1446
+ return transporter.request(request, requestOptions);
1447
+ },
1448
+ /**
1449
+ * Retrieve a single task run by its ID.
1450
+ *
1451
+ * Required API Key ACLs:
1452
+ * - addObject
1453
+ * - deleteIndex
1454
+ * - editSettings.
1455
+ *
1456
+ * @param getRun - The getRun object.
1457
+ * @param getRun.runID - Unique identifier of a task run.
1458
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1459
+ */
1460
+ getRun({ runID }, requestOptions) {
1461
+ if (!runID) {
1462
+ throw new Error('Parameter `runID` is required when calling `getRun`.');
1463
+ }
1464
+ const requestPath = '/1/runs/{runID}'.replace('{runID}', encodeURIComponent(runID));
1465
+ const headers = {};
1466
+ const queryParameters = {};
1467
+ const request = {
1468
+ method: 'GET',
1469
+ path: requestPath,
1470
+ queryParameters,
1471
+ headers,
1472
+ };
1473
+ return transporter.request(request, requestOptions);
1474
+ },
1475
+ /**
1476
+ * Retrieve a list of task runs.
1477
+ *
1478
+ * Required API Key ACLs:
1479
+ * - addObject
1480
+ * - deleteIndex
1481
+ * - editSettings.
1482
+ *
1483
+ * @param getRuns - The getRuns object.
1484
+ * @param getRuns.itemsPerPage - Number of items per page.
1485
+ * @param getRuns.page - Page number of the paginated API response.
1486
+ * @param getRuns.status - Run status for filtering the list of task runs.
1487
+ * @param getRuns.taskID - Task ID for filtering the list of task runs.
1488
+ * @param getRuns.sort - Property by which to sort the list of task runs.
1489
+ * @param getRuns.order - Sort order of the response, ascending or descending.
1490
+ * @param getRuns.startDate - Date in RFC 3339 format for the earliest run to retrieve. By default, the current day minus seven days is used.
1491
+ * @param getRuns.endDate - Date in RFC 3339 format for the latest run to retrieve. By default, the current day is used.
1492
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1493
+ */
1494
+ getRuns({ itemsPerPage, page, status, taskID, sort, order, startDate, endDate, } = {}, requestOptions = undefined) {
1495
+ const requestPath = '/1/runs';
1496
+ const headers = {};
1497
+ const queryParameters = {};
1498
+ if (itemsPerPage !== undefined) {
1499
+ queryParameters.itemsPerPage = itemsPerPage.toString();
1500
+ }
1501
+ if (page !== undefined) {
1502
+ queryParameters.page = page.toString();
1503
+ }
1504
+ if (status !== undefined) {
1505
+ queryParameters.status = status.toString();
1506
+ }
1507
+ if (taskID !== undefined) {
1508
+ queryParameters.taskID = taskID.toString();
1509
+ }
1510
+ if (sort !== undefined) {
1511
+ queryParameters.sort = sort.toString();
1512
+ }
1513
+ if (order !== undefined) {
1514
+ queryParameters.order = order.toString();
1515
+ }
1516
+ if (startDate !== undefined) {
1517
+ queryParameters.startDate = startDate.toString();
1518
+ }
1519
+ if (endDate !== undefined) {
1520
+ queryParameters.endDate = endDate.toString();
1521
+ }
1522
+ const request = {
1523
+ method: 'GET',
1524
+ path: requestPath,
1525
+ queryParameters,
1526
+ headers,
1527
+ };
1528
+ return transporter.request(request, requestOptions);
1529
+ },
1530
+ /**
1531
+ * Retrieve a source by its ID.
1532
+ *
1533
+ * Required API Key ACLs:
1534
+ * - addObject
1535
+ * - deleteIndex
1536
+ * - editSettings.
1537
+ *
1538
+ * @param getSource - The getSource object.
1539
+ * @param getSource.sourceID - Unique identifier of a source.
1540
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1541
+ */
1542
+ getSource({ sourceID }, requestOptions) {
1543
+ if (!sourceID) {
1544
+ throw new Error('Parameter `sourceID` is required when calling `getSource`.');
1545
+ }
1546
+ const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
1547
+ const headers = {};
1548
+ const queryParameters = {};
1549
+ const request = {
1550
+ method: 'GET',
1551
+ path: requestPath,
1552
+ queryParameters,
1553
+ headers,
1554
+ };
1555
+ return transporter.request(request, requestOptions);
1556
+ },
1557
+ /**
1558
+ * Retrieves a list of sources.
1559
+ *
1560
+ * Required API Key ACLs:
1561
+ * - addObject
1562
+ * - deleteIndex
1563
+ * - editSettings.
1564
+ *
1565
+ * @param getSources - The getSources object.
1566
+ * @param getSources.itemsPerPage - Number of items per page.
1567
+ * @param getSources.page - Page number of the paginated API response.
1568
+ * @param getSources.type - Source type. Some sources require authentication.
1569
+ * @param getSources.authenticationID - Authentication IDs of the sources to retrieve. \'none\' returns sources that doesn\'t have an authentication resource.
1570
+ * @param getSources.sort - Property by which to sort the list of sources.
1571
+ * @param getSources.order - Sort order of the response, ascending or descending.
1572
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1573
+ */
1574
+ getSources({ itemsPerPage, page, type, authenticationID, sort, order, } = {}, requestOptions = undefined) {
1575
+ const requestPath = '/1/sources';
1576
+ const headers = {};
1577
+ const queryParameters = {};
1578
+ if (itemsPerPage !== undefined) {
1579
+ queryParameters.itemsPerPage = itemsPerPage.toString();
1580
+ }
1581
+ if (page !== undefined) {
1582
+ queryParameters.page = page.toString();
1583
+ }
1584
+ if (type !== undefined) {
1585
+ queryParameters.type = type.toString();
1586
+ }
1587
+ if (authenticationID !== undefined) {
1588
+ queryParameters.authenticationID = authenticationID.toString();
1589
+ }
1590
+ if (sort !== undefined) {
1591
+ queryParameters.sort = sort.toString();
1592
+ }
1593
+ if (order !== undefined) {
1594
+ queryParameters.order = order.toString();
1595
+ }
1596
+ const request = {
1597
+ method: 'GET',
1598
+ path: requestPath,
1599
+ queryParameters,
1600
+ headers,
1601
+ };
1602
+ return transporter.request(request, requestOptions);
1603
+ },
1604
+ /**
1605
+ * Retrieves a task by its ID.
1606
+ *
1607
+ * Required API Key ACLs:
1608
+ * - addObject
1609
+ * - deleteIndex
1610
+ * - editSettings.
1611
+ *
1612
+ * @param getTask - The getTask object.
1613
+ * @param getTask.taskID - Unique identifier of a task.
1614
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1615
+ */
1616
+ getTask({ taskID }, requestOptions) {
1617
+ if (!taskID) {
1618
+ throw new Error('Parameter `taskID` is required when calling `getTask`.');
1619
+ }
1620
+ const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
1621
+ const headers = {};
1622
+ const queryParameters = {};
1623
+ const request = {
1624
+ method: 'GET',
1625
+ path: requestPath,
1626
+ queryParameters,
1627
+ headers,
1628
+ };
1629
+ return transporter.request(request, requestOptions);
1630
+ },
1631
+ /**
1632
+ * Retrieves a list of tasks.
1633
+ *
1634
+ * Required API Key ACLs:
1635
+ * - addObject
1636
+ * - deleteIndex
1637
+ * - editSettings.
1638
+ *
1639
+ * @param getTasks - The getTasks object.
1640
+ * @param getTasks.itemsPerPage - Number of items per page.
1641
+ * @param getTasks.page - Page number of the paginated API response.
1642
+ * @param getTasks.action - Actions for filtering the list of tasks.
1643
+ * @param getTasks.enabled - Whether to filter the list of tasks by the `enabled` status.
1644
+ * @param getTasks.sourceID - Source IDs for filtering the list of tasks.
1645
+ * @param getTasks.destinationID - Destination IDs for filtering the list of tasks.
1646
+ * @param getTasks.triggerType - Type of task trigger for filtering the list of tasks.
1647
+ * @param getTasks.sort - Property by which to sort the list of tasks.
1648
+ * @param getTasks.order - Sort order of the response, ascending or descending.
1649
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1650
+ */
1651
+ getTasks({ itemsPerPage, page, action, enabled, sourceID, destinationID, triggerType, sort, order, } = {}, requestOptions = undefined) {
1652
+ const requestPath = '/1/tasks';
1653
+ const headers = {};
1654
+ const queryParameters = {};
1655
+ if (itemsPerPage !== undefined) {
1656
+ queryParameters.itemsPerPage = itemsPerPage.toString();
1657
+ }
1658
+ if (page !== undefined) {
1659
+ queryParameters.page = page.toString();
1660
+ }
1661
+ if (action !== undefined) {
1662
+ queryParameters.action = action.toString();
1663
+ }
1664
+ if (enabled !== undefined) {
1665
+ queryParameters.enabled = enabled.toString();
1666
+ }
1667
+ if (sourceID !== undefined) {
1668
+ queryParameters.sourceID = sourceID.toString();
1669
+ }
1670
+ if (destinationID !== undefined) {
1671
+ queryParameters.destinationID = destinationID.toString();
1672
+ }
1673
+ if (triggerType !== undefined) {
1674
+ queryParameters.triggerType = triggerType.toString();
1675
+ }
1676
+ if (sort !== undefined) {
1677
+ queryParameters.sort = sort.toString();
1678
+ }
1679
+ if (order !== undefined) {
1680
+ queryParameters.order = order.toString();
1681
+ }
1682
+ const request = {
1683
+ method: 'GET',
1684
+ path: requestPath,
1685
+ queryParameters,
1686
+ headers,
1687
+ };
1688
+ return transporter.request(request, requestOptions);
1689
+ },
1690
+ /**
1691
+ * Retrieves a transformation by its ID.
1692
+ *
1693
+ * Required API Key ACLs:
1694
+ * - addObject
1695
+ * - deleteIndex
1696
+ * - editSettings.
1697
+ *
1698
+ * @param getTransformation - The getTransformation object.
1699
+ * @param getTransformation.transformationID - Unique identifier of a transformation.
1700
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1701
+ */
1702
+ getTransformation({ transformationID }, requestOptions) {
1703
+ if (!transformationID) {
1704
+ throw new Error('Parameter `transformationID` is required when calling `getTransformation`.');
1705
+ }
1706
+ const requestPath = '/1/transformations/{transformationID}'.replace('{transformationID}', encodeURIComponent(transformationID));
1707
+ const headers = {};
1708
+ const queryParameters = {};
1709
+ const request = {
1710
+ method: 'GET',
1711
+ path: requestPath,
1712
+ queryParameters,
1713
+ headers,
1714
+ };
1715
+ return transporter.request(request, requestOptions);
1716
+ },
1717
+ /**
1718
+ * Retrieves a list of transformations.
1719
+ *
1720
+ * Required API Key ACLs:
1721
+ * - addObject
1722
+ * - deleteIndex
1723
+ * - editSettings.
1724
+ *
1725
+ * @param getTransformations - The getTransformations object.
1726
+ * @param getTransformations.sort - Property by which to sort the list.
1727
+ * @param getTransformations.order - Sort order of the response, ascending or descending.
1728
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1729
+ */
1730
+ getTransformations({ sort, order } = {}, requestOptions = undefined) {
1731
+ const requestPath = '/1/transformations';
1732
+ const headers = {};
1733
+ const queryParameters = {};
1734
+ if (sort !== undefined) {
1735
+ queryParameters.sort = sort.toString();
1736
+ }
1737
+ if (order !== undefined) {
1738
+ queryParameters.order = order.toString();
1739
+ }
1740
+ const request = {
1741
+ method: 'GET',
1742
+ path: requestPath,
1743
+ queryParameters,
1744
+ headers,
1745
+ };
1746
+ return transporter.request(request, requestOptions);
1747
+ },
1748
+ /**
1749
+ * Runs a task. You can check the status of task runs with the observability endpoints.
1750
+ *
1751
+ * Required API Key ACLs:
1752
+ * - addObject
1753
+ * - deleteIndex
1754
+ * - editSettings.
1755
+ *
1756
+ * @param runTask - The runTask object.
1757
+ * @param runTask.taskID - Unique identifier of a task.
1758
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1759
+ */
1760
+ runTask({ taskID }, requestOptions) {
1761
+ if (!taskID) {
1762
+ throw new Error('Parameter `taskID` is required when calling `runTask`.');
1763
+ }
1764
+ const requestPath = '/1/tasks/{taskID}/run'.replace('{taskID}', encodeURIComponent(taskID));
1765
+ const headers = {};
1766
+ const queryParameters = {};
1767
+ const request = {
1768
+ method: 'POST',
1769
+ path: requestPath,
1770
+ queryParameters,
1771
+ headers,
1772
+ };
1773
+ return transporter.request(request, requestOptions);
1774
+ },
1775
+ /**
1776
+ * Searches for authentication resources.
1777
+ *
1778
+ * Required API Key ACLs:
1779
+ * - addObject
1780
+ * - deleteIndex
1781
+ * - editSettings.
1782
+ *
1783
+ * @param authenticationSearch - The authenticationSearch object.
1784
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1785
+ */
1786
+ searchAuthentications(authenticationSearch, requestOptions) {
1787
+ if (!authenticationSearch) {
1788
+ throw new Error('Parameter `authenticationSearch` is required when calling `searchAuthentications`.');
1789
+ }
1790
+ if (!authenticationSearch.authenticationIDs) {
1791
+ throw new Error('Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.');
1792
+ }
1793
+ const requestPath = '/1/authentications/search';
1794
+ const headers = {};
1795
+ const queryParameters = {};
1796
+ const request = {
1797
+ method: 'POST',
1798
+ path: requestPath,
1799
+ queryParameters,
1800
+ headers,
1801
+ data: authenticationSearch,
1802
+ };
1803
+ return transporter.request(request, requestOptions);
1804
+ },
1805
+ /**
1806
+ * Searches for destinations.
1807
+ *
1808
+ * Required API Key ACLs:
1809
+ * - addObject
1810
+ * - deleteIndex
1811
+ * - editSettings.
1812
+ *
1813
+ * @param destinationSearch - The destinationSearch object.
1814
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1815
+ */
1816
+ searchDestinations(destinationSearch, requestOptions) {
1817
+ if (!destinationSearch) {
1818
+ throw new Error('Parameter `destinationSearch` is required when calling `searchDestinations`.');
1819
+ }
1820
+ if (!destinationSearch.destinationIDs) {
1821
+ throw new Error('Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.');
1822
+ }
1823
+ const requestPath = '/1/destinations/search';
1824
+ const headers = {};
1825
+ const queryParameters = {};
1826
+ const request = {
1827
+ method: 'POST',
1828
+ path: requestPath,
1829
+ queryParameters,
1830
+ headers,
1831
+ data: destinationSearch,
1832
+ };
1833
+ return transporter.request(request, requestOptions);
1834
+ },
1835
+ /**
1836
+ * Searches for sources.
1837
+ *
1838
+ * Required API Key ACLs:
1839
+ * - addObject
1840
+ * - deleteIndex
1841
+ * - editSettings.
1842
+ *
1843
+ * @param sourceSearch - The sourceSearch object.
1844
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1845
+ */
1846
+ searchSources(sourceSearch, requestOptions) {
1847
+ if (!sourceSearch) {
1848
+ throw new Error('Parameter `sourceSearch` is required when calling `searchSources`.');
1849
+ }
1850
+ if (!sourceSearch.sourceIDs) {
1851
+ throw new Error('Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.');
1852
+ }
1853
+ const requestPath = '/1/sources/search';
1854
+ const headers = {};
1855
+ const queryParameters = {};
1856
+ const request = {
1857
+ method: 'POST',
1858
+ path: requestPath,
1859
+ queryParameters,
1860
+ headers,
1861
+ data: sourceSearch,
1862
+ };
1863
+ return transporter.request(request, requestOptions);
1864
+ },
1865
+ /**
1866
+ * Searches for tasks.
1867
+ *
1868
+ * Required API Key ACLs:
1869
+ * - addObject
1870
+ * - deleteIndex
1871
+ * - editSettings.
1872
+ *
1873
+ * @param taskSearch - The taskSearch object.
1874
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1875
+ */
1876
+ searchTasks(taskSearch, requestOptions) {
1877
+ if (!taskSearch) {
1878
+ throw new Error('Parameter `taskSearch` is required when calling `searchTasks`.');
1879
+ }
1880
+ if (!taskSearch.taskIDs) {
1881
+ throw new Error('Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.');
1882
+ }
1883
+ const requestPath = '/1/tasks/search';
1884
+ const headers = {};
1885
+ const queryParameters = {};
1886
+ const request = {
1887
+ method: 'POST',
1888
+ path: requestPath,
1889
+ queryParameters,
1890
+ headers,
1891
+ data: taskSearch,
1892
+ };
1893
+ return transporter.request(request, requestOptions);
1894
+ },
1895
+ /**
1896
+ * Searches for transformations.
1897
+ *
1898
+ * Required API Key ACLs:
1899
+ * - addObject
1900
+ * - deleteIndex
1901
+ * - editSettings.
1902
+ *
1903
+ * @param transformationSearch - The transformationSearch object.
1904
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1905
+ */
1906
+ searchTransformations(transformationSearch, requestOptions) {
1907
+ if (!transformationSearch) {
1908
+ throw new Error('Parameter `transformationSearch` is required when calling `searchTransformations`.');
1909
+ }
1910
+ if (!transformationSearch.transformationsIDs) {
1911
+ throw new Error('Parameter `transformationSearch.transformationsIDs` is required when calling `searchTransformations`.');
1912
+ }
1913
+ const requestPath = '/1/transformations/search';
1914
+ const headers = {};
1915
+ const queryParameters = {};
1916
+ const request = {
1917
+ method: 'POST',
1918
+ path: requestPath,
1919
+ queryParameters,
1920
+ headers,
1921
+ data: transformationSearch,
1922
+ };
1923
+ return transporter.request(request, requestOptions);
1924
+ },
1925
+ /**
1926
+ * Triggers a stream-listing request for a source. Triggering stream-listing requests only works with sources with `type: docker` and `imageType: singer`.
1927
+ *
1928
+ * Required API Key ACLs:
1929
+ * - addObject
1930
+ * - deleteIndex
1931
+ * - editSettings.
1932
+ *
1933
+ * @param triggerDockerSourceDiscover - The triggerDockerSourceDiscover object.
1934
+ * @param triggerDockerSourceDiscover.sourceID - Unique identifier of a source.
1935
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1936
+ */
1937
+ triggerDockerSourceDiscover({ sourceID }, requestOptions) {
1938
+ if (!sourceID) {
1939
+ throw new Error('Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.');
1940
+ }
1941
+ const requestPath = '/1/sources/{sourceID}/discover'.replace('{sourceID}', encodeURIComponent(sourceID));
1942
+ const headers = {};
1943
+ const queryParameters = {};
1944
+ const request = {
1945
+ method: 'POST',
1946
+ path: requestPath,
1947
+ queryParameters,
1948
+ headers,
1949
+ };
1950
+ return transporter.request(request, requestOptions);
1951
+ },
1952
+ /**
1953
+ * Try a transformation.
1954
+ *
1955
+ * Required API Key ACLs:
1956
+ * - addObject
1957
+ * - deleteIndex
1958
+ * - editSettings.
1959
+ *
1960
+ * @param transformationTry - The transformationTry object.
1961
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1962
+ */
1963
+ tryTransformations(transformationTry, requestOptions) {
1964
+ if (!transformationTry) {
1965
+ throw new Error('Parameter `transformationTry` is required when calling `tryTransformations`.');
1966
+ }
1967
+ if (!transformationTry.code) {
1968
+ throw new Error('Parameter `transformationTry.code` is required when calling `tryTransformations`.');
1969
+ }
1970
+ if (!transformationTry.sampleRecord) {
1971
+ throw new Error('Parameter `transformationTry.sampleRecord` is required when calling `tryTransformations`.');
1972
+ }
1973
+ const requestPath = '/1/transformations/try';
1974
+ const headers = {};
1975
+ const queryParameters = {};
1976
+ const request = {
1977
+ method: 'POST',
1978
+ path: requestPath,
1979
+ queryParameters,
1980
+ headers,
1981
+ data: transformationTry,
1982
+ };
1983
+ return transporter.request(request, requestOptions);
1984
+ },
1985
+ /**
1986
+ * Updates an authentication resource.
1987
+ *
1988
+ * Required API Key ACLs:
1989
+ * - addObject
1990
+ * - deleteIndex
1991
+ * - editSettings.
1992
+ *
1993
+ * @param updateAuthentication - The updateAuthentication object.
1994
+ * @param updateAuthentication.authenticationID - Unique identifier of an authentication resource.
1995
+ * @param updateAuthentication.authenticationUpdate - The authenticationUpdate object.
1996
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1997
+ */
1998
+ updateAuthentication({ authenticationID, authenticationUpdate }, requestOptions) {
1999
+ if (!authenticationID) {
2000
+ throw new Error('Parameter `authenticationID` is required when calling `updateAuthentication`.');
2001
+ }
2002
+ if (!authenticationUpdate) {
2003
+ throw new Error('Parameter `authenticationUpdate` is required when calling `updateAuthentication`.');
2004
+ }
2005
+ const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
2006
+ const headers = {};
2007
+ const queryParameters = {};
2008
+ const request = {
2009
+ method: 'PATCH',
2010
+ path: requestPath,
2011
+ queryParameters,
2012
+ headers,
2013
+ data: authenticationUpdate,
2014
+ };
2015
+ return transporter.request(request, requestOptions);
2016
+ },
2017
+ /**
2018
+ * Updates the destination by its ID.
2019
+ *
2020
+ * Required API Key ACLs:
2021
+ * - addObject
2022
+ * - deleteIndex
2023
+ * - editSettings.
2024
+ *
2025
+ * @param updateDestination - The updateDestination object.
2026
+ * @param updateDestination.destinationID - Unique identifier of a destination.
2027
+ * @param updateDestination.destinationUpdate - The destinationUpdate object.
2028
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2029
+ */
2030
+ updateDestination({ destinationID, destinationUpdate }, requestOptions) {
2031
+ if (!destinationID) {
2032
+ throw new Error('Parameter `destinationID` is required when calling `updateDestination`.');
2033
+ }
2034
+ if (!destinationUpdate) {
2035
+ throw new Error('Parameter `destinationUpdate` is required when calling `updateDestination`.');
2036
+ }
2037
+ const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
2038
+ const headers = {};
2039
+ const queryParameters = {};
2040
+ const request = {
2041
+ method: 'PATCH',
2042
+ path: requestPath,
2043
+ queryParameters,
2044
+ headers,
2045
+ data: destinationUpdate,
2046
+ };
2047
+ return transporter.request(request, requestOptions);
2048
+ },
2049
+ /**
2050
+ * Updates a source by its ID.
2051
+ *
2052
+ * Required API Key ACLs:
2053
+ * - addObject
2054
+ * - deleteIndex
2055
+ * - editSettings.
2056
+ *
2057
+ * @param updateSource - The updateSource object.
2058
+ * @param updateSource.sourceID - Unique identifier of a source.
2059
+ * @param updateSource.sourceUpdate - The sourceUpdate object.
2060
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2061
+ */
2062
+ updateSource({ sourceID, sourceUpdate }, requestOptions) {
2063
+ if (!sourceID) {
2064
+ throw new Error('Parameter `sourceID` is required when calling `updateSource`.');
2065
+ }
2066
+ if (!sourceUpdate) {
2067
+ throw new Error('Parameter `sourceUpdate` is required when calling `updateSource`.');
2068
+ }
2069
+ const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
2070
+ const headers = {};
2071
+ const queryParameters = {};
2072
+ const request = {
2073
+ method: 'PATCH',
2074
+ path: requestPath,
2075
+ queryParameters,
2076
+ headers,
2077
+ data: sourceUpdate,
2078
+ };
2079
+ return transporter.request(request, requestOptions);
2080
+ },
2081
+ /**
2082
+ * Updates a task by its ID.
2083
+ *
2084
+ * @param updateTask - The updateTask object.
2085
+ * @param updateTask.taskID - Unique identifier of a task.
2086
+ * @param updateTask.taskUpdate - The taskUpdate object.
2087
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2088
+ */
2089
+ updateTask({ taskID, taskUpdate }, requestOptions) {
2090
+ if (!taskID) {
2091
+ throw new Error('Parameter `taskID` is required when calling `updateTask`.');
2092
+ }
2093
+ if (!taskUpdate) {
2094
+ throw new Error('Parameter `taskUpdate` is required when calling `updateTask`.');
2095
+ }
2096
+ const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
2097
+ const headers = {};
2098
+ const queryParameters = {};
2099
+ const request = {
2100
+ method: 'PATCH',
2101
+ path: requestPath,
2102
+ queryParameters,
2103
+ headers,
2104
+ data: taskUpdate,
2105
+ };
2106
+ return transporter.request(request, requestOptions);
2107
+ },
2108
+ /**
2109
+ * Updates a transformation by its ID.
2110
+ *
2111
+ * @param updateTransformation - The updateTransformation object.
2112
+ * @param updateTransformation.transformationID - Unique identifier of a transformation.
2113
+ * @param updateTransformation.transformationCreate - The transformationCreate object.
2114
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2115
+ */
2116
+ updateTransformation({ transformationID, transformationCreate }, requestOptions) {
2117
+ if (!transformationID) {
2118
+ throw new Error('Parameter `transformationID` is required when calling `updateTransformation`.');
2119
+ }
2120
+ if (!transformationCreate) {
2121
+ throw new Error('Parameter `transformationCreate` is required when calling `updateTransformation`.');
2122
+ }
2123
+ if (!transformationCreate.code) {
2124
+ throw new Error('Parameter `transformationCreate.code` is required when calling `updateTransformation`.');
2125
+ }
2126
+ if (!transformationCreate.name) {
2127
+ throw new Error('Parameter `transformationCreate.name` is required when calling `updateTransformation`.');
2128
+ }
2129
+ const requestPath = '/1/transformations/{transformationID}'.replace('{transformationID}', encodeURIComponent(transformationID));
2130
+ const headers = {};
2131
+ const queryParameters = {};
2132
+ const request = {
2133
+ method: 'PUT',
2134
+ path: requestPath,
2135
+ queryParameters,
2136
+ headers,
2137
+ data: transformationCreate,
2138
+ };
2139
+ return transporter.request(request, requestOptions);
2140
+ },
2141
+ /**
2142
+ * Validates a source payload to ensure it can be created and that the data source can be reached by Algolia.
2143
+ *
2144
+ * Required API Key ACLs:
2145
+ * - addObject
2146
+ * - deleteIndex
2147
+ * - editSettings.
2148
+ *
2149
+ * @param sourceCreate -.
2150
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2151
+ */
2152
+ validateSource(sourceCreate, requestOptions = undefined) {
2153
+ const requestPath = '/1/sources/validate';
2154
+ const headers = {};
2155
+ const queryParameters = {};
2156
+ const request = {
2157
+ method: 'POST',
2158
+ path: requestPath,
2159
+ queryParameters,
2160
+ headers,
2161
+ data: sourceCreate ? sourceCreate : {},
2162
+ };
2163
+ return transporter.request(request, requestOptions);
2164
+ },
2165
+ /**
2166
+ * Validates an update of a source payload to ensure it can be created and that the data source can be reached by Algolia.
2167
+ *
2168
+ * Required API Key ACLs:
2169
+ * - addObject
2170
+ * - deleteIndex
2171
+ * - editSettings.
2172
+ *
2173
+ * @param validateSourceBeforeUpdate - The validateSourceBeforeUpdate object.
2174
+ * @param validateSourceBeforeUpdate.sourceID - Unique identifier of a source.
2175
+ * @param validateSourceBeforeUpdate.sourceUpdate - The sourceUpdate object.
2176
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2177
+ */
2178
+ validateSourceBeforeUpdate({ sourceID, sourceUpdate }, requestOptions) {
2179
+ if (!sourceID) {
2180
+ throw new Error('Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.');
2181
+ }
2182
+ if (!sourceUpdate) {
2183
+ throw new Error('Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.');
2184
+ }
2185
+ const requestPath = '/1/sources/{sourceID}/validate'.replace('{sourceID}', encodeURIComponent(sourceID));
2186
+ const headers = {};
2187
+ const queryParameters = {};
2188
+ const request = {
2189
+ method: 'POST',
2190
+ path: requestPath,
2191
+ queryParameters,
2192
+ headers,
2193
+ data: sourceUpdate,
2194
+ };
2195
+ return transporter.request(request, requestOptions);
2196
+ },
2197
+ };
1454
2198
  }
1455
2199
 
1456
- // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
1457
- function ingestionClient(appId, apiKey, region, options) {
1458
- if (!appId || typeof appId !== 'string') {
1459
- throw new Error('`appId` is missing.');
1460
- }
1461
- if (!apiKey || typeof apiKey !== 'string') {
1462
- throw new Error('`apiKey` is missing.');
1463
- }
1464
- if (!region ||
1465
- (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {
1466
- throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(', ')}`);
1467
- }
1468
- return createIngestionClient({
1469
- appId,
1470
- apiKey,
1471
- region,
1472
- timeouts: {
1473
- connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,
1474
- read: DEFAULT_READ_TIMEOUT_BROWSER,
1475
- write: DEFAULT_WRITE_TIMEOUT_BROWSER,
1476
- },
1477
- requester: createXhrRequester(),
1478
- algoliaAgents: [{ segment: 'Browser' }],
1479
- authMode: 'WithinQueryParameters',
1480
- responsesCache: createMemoryCache(),
1481
- requestsCache: createMemoryCache({ serializable: false }),
1482
- hostsCache: createFallbackableCache({
1483
- caches: [
1484
- createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
1485
- createMemoryCache(),
1486
- ],
1487
- }),
1488
- ...options,
1489
- });
2200
+ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2201
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
2202
+ function ingestionClient(appId, apiKey, region, options) {
2203
+ if (!appId || typeof appId !== 'string') {
2204
+ throw new Error('`appId` is missing.');
2205
+ }
2206
+ if (!apiKey || typeof apiKey !== 'string') {
2207
+ throw new Error('`apiKey` is missing.');
2208
+ }
2209
+ if (!region ||
2210
+ (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {
2211
+ throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(', ')}`);
2212
+ }
2213
+ return createIngestionClient({
2214
+ appId,
2215
+ apiKey,
2216
+ region,
2217
+ timeouts: {
2218
+ connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,
2219
+ read: DEFAULT_READ_TIMEOUT_BROWSER,
2220
+ write: DEFAULT_WRITE_TIMEOUT_BROWSER,
2221
+ },
2222
+ requester: createXhrRequester(),
2223
+ algoliaAgents: [{ segment: 'Browser' }],
2224
+ authMode: 'WithinQueryParameters',
2225
+ responsesCache: createMemoryCache(),
2226
+ requestsCache: createMemoryCache({ serializable: false }),
2227
+ hostsCache: createFallbackableCache({
2228
+ caches: [
2229
+ createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
2230
+ createMemoryCache(),
2231
+ ],
2232
+ }),
2233
+ ...options,
2234
+ });
1490
2235
  }
1491
2236
 
1492
- export { apiClientVersion, ingestionClient };
2237
+ export { apiClientVersion, ingestionClient, isOnDemandTrigger, isScheduleTrigger, isSubscriptionTrigger };