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

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