@algolia/ingestion 1.0.0-alpha.8 → 1.0.0-alpha.81

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