@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
@@ -1,826 +1,1326 @@
1
1
  import { createAuth, createTransporter, getAlgoliaAgent, DEFAULT_CONNECT_TIMEOUT_NODE, DEFAULT_READ_TIMEOUT_NODE, DEFAULT_WRITE_TIMEOUT_NODE, createNullCache, createMemoryCache } from '@algolia/client-common';
2
2
  import { createHttpRequester } from '@algolia/requester-node-http';
3
3
 
4
- // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
5
- const apiClientVersion = '1.0.0-alpha.9';
6
- const REGIONS = ['us'];
7
- function getDefaultHosts(region) {
8
- const url = 'data.{region}.algolia.com'.replace('{region}', region);
9
- return [{ url, accept: 'readWrite', protocol: 'https' }];
10
- }
11
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
12
- function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
13
- const auth = createAuth(appIdOption, apiKeyOption, authMode);
14
- const transporter = createTransporter({
15
- hosts: getDefaultHosts(regionOption),
16
- ...options,
17
- algoliaAgent: {
18
- ...getAlgoliaAgent({
19
- algoliaAgents,
20
- client: 'Ingestion',
21
- version: apiClientVersion,
22
- }),
23
- value: '',
24
- },
25
- baseHeaders: {
26
- 'content-type': 'text/plain',
27
- ...auth.headers(),
28
- ...options.baseHeaders,
29
- },
30
- baseQueryParameters: {
31
- ...auth.queryParameters(),
32
- ...options.baseQueryParameters,
33
- },
34
- });
35
- return {
36
- transporter,
37
- /**
38
- * The `appId` currently in use.
39
- */
40
- appId: appIdOption,
41
- /**
42
- * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
43
- */
44
- clearCache() {
45
- return Promise.all([
46
- transporter.requestsCache.clear(),
47
- transporter.responsesCache.clear(),
48
- ]).then(() => undefined);
49
- },
50
- /**
51
- * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
52
- */
53
- get _ua() {
54
- return transporter.algoliaAgent.value;
55
- },
56
- /**
57
- * Adds a `segment` to the `x-algolia-agent` sent with every requests.
58
- *
59
- * @param segment - The algolia agent (user-agent) segment to add.
60
- * @param version - The version of the agent.
61
- */
62
- addAlgoliaAgent(segment, version) {
63
- transporter.algoliaAgent.add({ segment, version });
64
- },
65
- /**
66
- * Create a authentication.
67
- *
68
- * @summary Create a authentication.
69
- * @param authenticationCreate -.
70
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
71
- */
72
- createAuthentication(authenticationCreate, requestOptions) {
73
- if (!authenticationCreate) {
74
- throw new Error('Parameter `authenticationCreate` is required when calling `createAuthentication`.');
75
- }
76
- const requestPath = '/1/authentications';
77
- const headers = {};
78
- const queryParameters = {};
79
- const request = {
80
- method: 'POST',
81
- path: requestPath,
82
- queryParameters,
83
- headers,
84
- data: authenticationCreate,
85
- };
86
- return transporter.request(request, requestOptions);
87
- },
88
- /**
89
- * Create a destination.
90
- *
91
- * @summary Create a destination.
92
- * @param destinationCreate -.
93
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
94
- */
95
- createDestination(destinationCreate, requestOptions) {
96
- if (!destinationCreate) {
97
- throw new Error('Parameter `destinationCreate` is required when calling `createDestination`.');
98
- }
99
- const requestPath = '/1/destinations';
100
- const headers = {};
101
- const queryParameters = {};
102
- const request = {
103
- method: 'POST',
104
- path: requestPath,
105
- queryParameters,
106
- headers,
107
- data: destinationCreate,
108
- };
109
- return transporter.request(request, requestOptions);
110
- },
111
- /**
112
- * Create a source.
113
- *
114
- * @summary Create a source.
115
- * @param sourceCreate -.
116
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
117
- */
118
- createSource(sourceCreate, requestOptions) {
119
- if (!sourceCreate) {
120
- throw new Error('Parameter `sourceCreate` is required when calling `createSource`.');
121
- }
122
- const requestPath = '/1/sources';
123
- const headers = {};
124
- const queryParameters = {};
125
- const request = {
126
- method: 'POST',
127
- path: requestPath,
128
- queryParameters,
129
- headers,
130
- data: sourceCreate,
131
- };
132
- return transporter.request(request, requestOptions);
133
- },
134
- /**
135
- * Create a task.
136
- *
137
- * @summary Create a task.
138
- * @param taskCreate -.
139
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
140
- */
141
- createTask(taskCreate, requestOptions) {
142
- if (!taskCreate) {
143
- throw new Error('Parameter `taskCreate` is required when calling `createTask`.');
144
- }
145
- if (!taskCreate.sourceID) {
146
- throw new Error('Parameter `taskCreate.sourceID` is required when calling `createTask`.');
147
- }
148
- if (!taskCreate.action) {
149
- throw new Error('Parameter `taskCreate.action` is required when calling `createTask`.');
150
- }
151
- const requestPath = '/1/tasks';
152
- const headers = {};
153
- const queryParameters = {};
154
- const request = {
155
- method: 'POST',
156
- path: requestPath,
157
- queryParameters,
158
- headers,
159
- data: taskCreate,
160
- };
161
- return transporter.request(request, requestOptions);
162
- },
163
- /**
164
- * Soft delete a authentication.
165
- *
166
- * @summary Delete a authentication.
167
- * @param deleteAuthentication - The deleteAuthentication object.
168
- * @param deleteAuthentication.authenticationID - The authentication uuid.
169
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
170
- */
171
- deleteAuthentication({ authenticationID }, requestOptions) {
172
- if (!authenticationID) {
173
- throw new Error('Parameter `authenticationID` is required when calling `deleteAuthentication`.');
174
- }
175
- const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
176
- const headers = {};
177
- const queryParameters = {};
178
- const request = {
179
- method: 'DELETE',
180
- path: requestPath,
181
- queryParameters,
182
- headers,
183
- };
184
- return transporter.request(request, requestOptions);
185
- },
186
- /**
187
- * Soft delete a destination.
188
- *
189
- * @summary Delete a destination.
190
- * @param deleteDestination - The deleteDestination object.
191
- * @param deleteDestination.destinationID - The destination uuid.
192
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
193
- */
194
- deleteDestination({ destinationID }, requestOptions) {
195
- if (!destinationID) {
196
- throw new Error('Parameter `destinationID` is required when calling `deleteDestination`.');
197
- }
198
- const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
199
- const headers = {};
200
- const queryParameters = {};
201
- const request = {
202
- method: 'DELETE',
203
- path: requestPath,
204
- queryParameters,
205
- headers,
206
- };
207
- return transporter.request(request, requestOptions);
208
- },
209
- /**
210
- * Soft delete a source.
211
- *
212
- * @summary Delete a source.
213
- * @param deleteSource - The deleteSource object.
214
- * @param deleteSource.sourceID - The source uuid.
215
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
216
- */
217
- deleteSource({ sourceID }, requestOptions) {
218
- if (!sourceID) {
219
- throw new Error('Parameter `sourceID` is required when calling `deleteSource`.');
220
- }
221
- const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
222
- const headers = {};
223
- const queryParameters = {};
224
- const request = {
225
- method: 'DELETE',
226
- path: requestPath,
227
- queryParameters,
228
- headers,
229
- };
230
- return transporter.request(request, requestOptions);
231
- },
232
- /**
233
- * Soft delete a task.
234
- *
235
- * @summary Delete a task.
236
- * @param deleteTask - The deleteTask object.
237
- * @param deleteTask.taskID - The task uuid.
238
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
239
- */
240
- deleteTask({ taskID }, requestOptions) {
241
- if (!taskID) {
242
- throw new Error('Parameter `taskID` is required when calling `deleteTask`.');
243
- }
244
- const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
245
- const headers = {};
246
- const queryParameters = {};
247
- const request = {
248
- method: 'DELETE',
249
- path: requestPath,
250
- queryParameters,
251
- headers,
252
- };
253
- return transporter.request(request, requestOptions);
254
- },
255
- /**
256
- * Disable a task.
257
- *
258
- * @summary Disable a task.
259
- * @param disableTask - The disableTask object.
260
- * @param disableTask.taskID - The task uuid.
261
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
262
- */
263
- disableTask({ taskID }, requestOptions) {
264
- if (!taskID) {
265
- throw new Error('Parameter `taskID` is required when calling `disableTask`.');
266
- }
267
- const requestPath = '/1/tasks/{taskID}/disable'.replace('{taskID}', encodeURIComponent(taskID));
268
- const headers = {};
269
- const queryParameters = {};
270
- const request = {
271
- method: 'PUT',
272
- path: requestPath,
273
- queryParameters,
274
- headers,
275
- };
276
- return transporter.request(request, requestOptions);
277
- },
278
- /**
279
- * Enable a task.
280
- *
281
- * @summary Enable a task.
282
- * @param enableTask - The enableTask object.
283
- * @param enableTask.taskID - The task uuid.
284
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
285
- */
286
- enableTask({ taskID }, requestOptions) {
287
- if (!taskID) {
288
- throw new Error('Parameter `taskID` is required when calling `enableTask`.');
289
- }
290
- const requestPath = '/1/tasks/{taskID}/enable'.replace('{taskID}', encodeURIComponent(taskID));
291
- const headers = {};
292
- const queryParameters = {};
293
- const request = {
294
- method: 'PUT',
295
- path: requestPath,
296
- queryParameters,
297
- headers,
298
- };
299
- return transporter.request(request, requestOptions);
300
- },
301
- /**
302
- * Get a authentication.
303
- *
304
- * @summary Get a authentication.
305
- * @param getAuthentication - The getAuthentication object.
306
- * @param getAuthentication.authenticationID - The authentication uuid.
307
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
308
- */
309
- getAuthentication({ authenticationID }, requestOptions) {
310
- if (!authenticationID) {
311
- throw new Error('Parameter `authenticationID` is required when calling `getAuthentication`.');
312
- }
313
- const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
314
- const headers = {};
315
- const queryParameters = {};
316
- const request = {
317
- method: 'GET',
318
- path: requestPath,
319
- queryParameters,
320
- headers,
321
- };
322
- return transporter.request(request, requestOptions);
323
- },
324
- /**
325
- * Get a list of authentications.
326
- *
327
- * @summary Get a list of authentications.
328
- * @param getAuthentications - The getAuthentications object.
329
- * @param getAuthentications.itemsPerPage - The number of items per page to return.
330
- * @param getAuthentications.page - The page number to fetch, starting at 1.
331
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
332
- */
333
- getAuthentications({ itemsPerPage, page } = {}, requestOptions = undefined) {
334
- const requestPath = '/1/authentications';
335
- const headers = {};
336
- const queryParameters = {};
337
- if (itemsPerPage !== undefined) {
338
- queryParameters.itemsPerPage = itemsPerPage.toString();
339
- }
340
- if (page !== undefined) {
341
- queryParameters.page = page.toString();
342
- }
343
- const request = {
344
- method: 'GET',
345
- path: requestPath,
346
- queryParameters,
347
- headers,
348
- };
349
- return transporter.request(request, requestOptions);
350
- },
351
- /**
352
- * Get a destination.
353
- *
354
- * @summary Get a destination.
355
- * @param getDestination - The getDestination object.
356
- * @param getDestination.destinationID - The destination uuid.
357
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
358
- */
359
- getDestination({ destinationID }, requestOptions) {
360
- if (!destinationID) {
361
- throw new Error('Parameter `destinationID` is required when calling `getDestination`.');
362
- }
363
- const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
364
- const headers = {};
365
- const queryParameters = {};
366
- const request = {
367
- method: 'GET',
368
- path: requestPath,
369
- queryParameters,
370
- headers,
371
- };
372
- return transporter.request(request, requestOptions);
373
- },
374
- /**
375
- * Get a list of destinations.
376
- *
377
- * @summary Get a list of destinations.
378
- * @param getDestinations - The getDestinations object.
379
- * @param getDestinations.itemsPerPage - The number of items per page to return.
380
- * @param getDestinations.page - The page number to fetch, starting at 1.
381
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
382
- */
383
- getDestinations({ itemsPerPage, page } = {}, requestOptions = undefined) {
384
- const requestPath = '/1/destinations';
385
- const headers = {};
386
- const queryParameters = {};
387
- if (itemsPerPage !== undefined) {
388
- queryParameters.itemsPerPage = itemsPerPage.toString();
389
- }
390
- if (page !== undefined) {
391
- queryParameters.page = page.toString();
392
- }
393
- const request = {
394
- method: 'GET',
395
- path: requestPath,
396
- queryParameters,
397
- headers,
398
- };
399
- return transporter.request(request, requestOptions);
400
- },
401
- /**
402
- * Get an event in a specific run.
403
- *
404
- * @summary Get an event in a specific run.
405
- * @param getEvent - The getEvent object.
406
- * @param getEvent.runID - The run uuid.
407
- * @param getEvent.eventID - The event uuid.
408
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
409
- */
410
- getEvent({ runID, eventID }, requestOptions) {
411
- if (!runID) {
412
- throw new Error('Parameter `runID` is required when calling `getEvent`.');
413
- }
414
- if (!eventID) {
415
- throw new Error('Parameter `eventID` is required when calling `getEvent`.');
416
- }
417
- const requestPath = '/1/runs/{runID}/events/{eventID}'
418
- .replace('{runID}', encodeURIComponent(runID))
419
- .replace('{eventID}', encodeURIComponent(eventID));
420
- const headers = {};
421
- const queryParameters = {};
422
- const request = {
423
- method: 'GET',
424
- path: requestPath,
425
- queryParameters,
426
- headers,
427
- };
428
- return transporter.request(request, requestOptions);
429
- },
430
- /**
431
- * Get a list of events for a specific run.
432
- *
433
- * @summary Get a list of events for a specific run.
434
- * @param getEvents - The getEvents object.
435
- * @param getEvents.runID - The run uuid.
436
- * @param getEvents.itemsPerPage - The number of items per page to return.
437
- * @param getEvents.page - The page number to fetch, starting at 1.
438
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
439
- */
440
- getEvents({ runID, itemsPerPage, page }, requestOptions) {
441
- if (!runID) {
442
- throw new Error('Parameter `runID` is required when calling `getEvents`.');
443
- }
444
- const requestPath = '/1/runs/{runID}/events'.replace('{runID}', encodeURIComponent(runID));
445
- const headers = {};
446
- const queryParameters = {};
447
- if (itemsPerPage !== undefined) {
448
- queryParameters.itemsPerPage = itemsPerPage.toString();
449
- }
450
- if (page !== undefined) {
451
- queryParameters.page = page.toString();
452
- }
453
- const request = {
454
- method: 'GET',
455
- path: requestPath,
456
- queryParameters,
457
- headers,
458
- };
459
- return transporter.request(request, requestOptions);
460
- },
461
- /**
462
- * Get a run.
463
- *
464
- * @summary Get a run.
465
- * @param getRun - The getRun object.
466
- * @param getRun.runID - The run uuid.
467
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
468
- */
469
- getRun({ runID }, requestOptions) {
470
- if (!runID) {
471
- throw new Error('Parameter `runID` is required when calling `getRun`.');
472
- }
473
- const requestPath = '/1/runs/{runID}'.replace('{runID}', encodeURIComponent(runID));
474
- const headers = {};
475
- const queryParameters = {};
476
- const request = {
477
- method: 'GET',
478
- path: requestPath,
479
- queryParameters,
480
- headers,
481
- };
482
- return transporter.request(request, requestOptions);
483
- },
484
- /**
485
- * Get a list of runs.
486
- *
487
- * @summary Get a list of runs.
488
- * @param getRuns - The getRuns object.
489
- * @param getRuns.itemsPerPage - The number of items per page to return.
490
- * @param getRuns.page - The page number to fetch, starting at 1.
491
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
492
- */
493
- getRuns({ itemsPerPage, page } = {}, requestOptions = undefined) {
494
- const requestPath = '/1/runs';
495
- const headers = {};
496
- const queryParameters = {};
497
- if (itemsPerPage !== undefined) {
498
- queryParameters.itemsPerPage = itemsPerPage.toString();
499
- }
500
- if (page !== undefined) {
501
- queryParameters.page = page.toString();
502
- }
503
- const request = {
504
- method: 'GET',
505
- path: requestPath,
506
- queryParameters,
507
- headers,
508
- };
509
- return transporter.request(request, requestOptions);
510
- },
511
- /**
512
- * Get a list of runs associated with a taskID.
513
- *
514
- * @summary Get a list of runs associated with a taskID.
515
- * @param getRunsByTaskID - The getRunsByTaskID object.
516
- * @param getRunsByTaskID.taskID - The task uuid.
517
- * @param getRunsByTaskID.itemsPerPage - The number of items per page to return.
518
- * @param getRunsByTaskID.page - The page number to fetch, starting at 1.
519
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
520
- */
521
- getRunsByTaskID({ taskID, itemsPerPage, page }, requestOptions) {
522
- if (!taskID) {
523
- throw new Error('Parameter `taskID` is required when calling `getRunsByTaskID`.');
524
- }
525
- const requestPath = '/1/runs/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
526
- const headers = {};
527
- const queryParameters = {};
528
- if (itemsPerPage !== undefined) {
529
- queryParameters.itemsPerPage = itemsPerPage.toString();
530
- }
531
- if (page !== undefined) {
532
- queryParameters.page = page.toString();
533
- }
534
- const request = {
535
- method: 'GET',
536
- path: requestPath,
537
- queryParameters,
538
- headers,
539
- };
540
- return transporter.request(request, requestOptions);
541
- },
542
- /**
543
- * Get a source.
544
- *
545
- * @summary Get a source.
546
- * @param getSource - The getSource object.
547
- * @param getSource.sourceID - The source uuid.
548
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
549
- */
550
- getSource({ sourceID }, requestOptions) {
551
- if (!sourceID) {
552
- throw new Error('Parameter `sourceID` is required when calling `getSource`.');
553
- }
554
- const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
555
- const headers = {};
556
- const queryParameters = {};
557
- const request = {
558
- method: 'GET',
559
- path: requestPath,
560
- queryParameters,
561
- headers,
562
- };
563
- return transporter.request(request, requestOptions);
564
- },
565
- /**
566
- * Get a list of sources.
567
- *
568
- * @summary Get a list of sources.
569
- * @param getSources - The getSources object.
570
- * @param getSources.itemsPerPage - The number of items per page to return.
571
- * @param getSources.page - The page number to fetch, starting at 1.
572
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
573
- */
574
- getSources({ itemsPerPage, page } = {}, requestOptions = undefined) {
575
- const requestPath = '/1/sources';
576
- const headers = {};
577
- const queryParameters = {};
578
- if (itemsPerPage !== undefined) {
579
- queryParameters.itemsPerPage = itemsPerPage.toString();
580
- }
581
- if (page !== undefined) {
582
- queryParameters.page = page.toString();
583
- }
584
- const request = {
585
- method: 'GET',
586
- path: requestPath,
587
- queryParameters,
588
- headers,
589
- };
590
- return transporter.request(request, requestOptions);
591
- },
592
- /**
593
- * Get a task.
594
- *
595
- * @summary Get a task.
596
- * @param getTask - The getTask object.
597
- * @param getTask.taskID - The task uuid.
598
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
599
- */
600
- getTask({ taskID }, requestOptions) {
601
- if (!taskID) {
602
- throw new Error('Parameter `taskID` is required when calling `getTask`.');
603
- }
604
- const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
605
- const headers = {};
606
- const queryParameters = {};
607
- const request = {
608
- method: 'GET',
609
- path: requestPath,
610
- queryParameters,
611
- headers,
612
- };
613
- return transporter.request(request, requestOptions);
614
- },
615
- /**
616
- * Get a list of tasks.
617
- *
618
- * @summary Get a list of tasks.
619
- * @param getTasks - The getTasks object.
620
- * @param getTasks.itemsPerPage - The number of items per page to return.
621
- * @param getTasks.page - The page number to fetch, starting at 1.
622
- * @param getTasks.action - Which action the returned task should have. Can be a list of string separated with commas.
623
- * @param getTasks.enabled - If the returned task should have its \'enabled\' property set to true.
624
- * @param getTasks.destinationID - Which destinationID the returned task should have. Can be a list of string separated with commas.
625
- * @param getTasks.triggerType - Which trigger type the returned task should have. Can be a list of string separated with commas.
626
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
627
- */
628
- getTasks({ itemsPerPage, page, action, enabled, destinationID, triggerType, } = {}, requestOptions = undefined) {
629
- const requestPath = '/1/tasks';
630
- const headers = {};
631
- const queryParameters = {};
632
- if (itemsPerPage !== undefined) {
633
- queryParameters.itemsPerPage = itemsPerPage.toString();
634
- }
635
- if (page !== undefined) {
636
- queryParameters.page = page.toString();
637
- }
638
- if (action !== undefined) {
639
- queryParameters.action = action.toString();
640
- }
641
- if (enabled !== undefined) {
642
- queryParameters.enabled = enabled.toString();
643
- }
644
- if (destinationID !== undefined) {
645
- queryParameters.destinationID = destinationID.toString();
646
- }
647
- if (triggerType !== undefined) {
648
- queryParameters.triggerType = triggerType.toString();
649
- }
650
- const request = {
651
- method: 'GET',
652
- path: requestPath,
653
- queryParameters,
654
- headers,
655
- };
656
- return transporter.request(request, requestOptions);
657
- },
658
- /**
659
- * Run a task.
660
- *
661
- * @summary Run a task.
662
- * @param runTask - The runTask object.
663
- * @param runTask.taskID - The task uuid.
664
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
665
- */
666
- runTask({ taskID }, requestOptions) {
667
- if (!taskID) {
668
- throw new Error('Parameter `taskID` is required when calling `runTask`.');
669
- }
670
- const requestPath = '/1/tasks/{taskID}/run'.replace('{taskID}', encodeURIComponent(taskID));
671
- const headers = {};
672
- const queryParameters = {};
673
- const request = {
674
- method: 'POST',
675
- path: requestPath,
676
- queryParameters,
677
- headers,
678
- };
679
- return transporter.request(request, requestOptions);
680
- },
681
- /**
682
- * Update a authentication.
683
- *
684
- * @summary Update a authentication.
685
- * @param updateAuthentication - The updateAuthentication object.
686
- * @param updateAuthentication.authenticationID - The authentication uuid.
687
- * @param updateAuthentication.authenticationUpdate - The authenticationUpdate object.
688
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
689
- */
690
- updateAuthentication({ authenticationID, authenticationUpdate }, requestOptions) {
691
- if (!authenticationID) {
692
- throw new Error('Parameter `authenticationID` is required when calling `updateAuthentication`.');
693
- }
694
- if (!authenticationUpdate) {
695
- throw new Error('Parameter `authenticationUpdate` is required when calling `updateAuthentication`.');
696
- }
697
- const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
698
- const headers = {};
699
- const queryParameters = {};
700
- const request = {
701
- method: 'PUT',
702
- path: requestPath,
703
- queryParameters,
704
- headers,
705
- data: authenticationUpdate,
706
- };
707
- return transporter.request(request, requestOptions);
708
- },
709
- /**
710
- * Update a destination.
711
- *
712
- * @summary Update a destination.
713
- * @param updateDestination - The updateDestination object.
714
- * @param updateDestination.destinationID - The destination uuid.
715
- * @param updateDestination.destinationUpdate - The destinationUpdate object.
716
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
717
- */
718
- updateDestination({ destinationID, destinationUpdate }, requestOptions) {
719
- if (!destinationID) {
720
- throw new Error('Parameter `destinationID` is required when calling `updateDestination`.');
721
- }
722
- if (!destinationUpdate) {
723
- throw new Error('Parameter `destinationUpdate` is required when calling `updateDestination`.');
724
- }
725
- const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
726
- const headers = {};
727
- const queryParameters = {};
728
- const request = {
729
- method: 'PUT',
730
- path: requestPath,
731
- queryParameters,
732
- headers,
733
- data: destinationUpdate,
734
- };
735
- return transporter.request(request, requestOptions);
736
- },
737
- /**
738
- * Update a source.
739
- *
740
- * @summary Update a source.
741
- * @param updateSource - The updateSource object.
742
- * @param updateSource.sourceID - The source uuid.
743
- * @param updateSource.sourceUpdate - The sourceUpdate object.
744
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
745
- */
746
- updateSource({ sourceID, sourceUpdate }, requestOptions) {
747
- if (!sourceID) {
748
- throw new Error('Parameter `sourceID` is required when calling `updateSource`.');
749
- }
750
- if (!sourceUpdate) {
751
- throw new Error('Parameter `sourceUpdate` is required when calling `updateSource`.');
752
- }
753
- const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
754
- const headers = {};
755
- const queryParameters = {};
756
- const request = {
757
- method: 'POST',
758
- path: requestPath,
759
- queryParameters,
760
- headers,
761
- data: sourceUpdate,
762
- };
763
- return transporter.request(request, requestOptions);
764
- },
765
- /**
766
- * Update a task.
767
- *
768
- * @summary Update a task.
769
- * @param updateTask - The updateTask object.
770
- * @param updateTask.taskID - The task uuid.
771
- * @param updateTask.taskUpdate - The taskUpdate object.
772
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
773
- */
774
- updateTask({ taskID, taskUpdate }, requestOptions) {
775
- if (!taskID) {
776
- throw new Error('Parameter `taskID` is required when calling `updateTask`.');
777
- }
778
- if (!taskUpdate) {
779
- throw new Error('Parameter `taskUpdate` is required when calling `updateTask`.');
780
- }
781
- const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
782
- const headers = {};
783
- const queryParameters = {};
784
- const request = {
785
- method: 'PUT',
786
- path: requestPath,
787
- queryParameters,
788
- headers,
789
- data: taskUpdate,
790
- };
791
- return transporter.request(request, requestOptions);
792
- },
793
- };
4
+ // 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.
5
+ const apiClientVersion = '1.0.0-beta.2';
6
+ const REGIONS = ['eu', 'us'];
7
+ function getDefaultHosts(region) {
8
+ const url = 'data.{region}.algolia.com'.replace('{region}', region);
9
+ return [{ url, accept: 'readWrite', protocol: 'https' }];
10
+ }
11
+ /**
12
+ * Guard: Return strongly typed specific OnDemandTrigger for a given Trigger.
13
+ *
14
+ * @summary Guard method that returns a strongly typed specific OnDemandTrigger for a given Trigger.
15
+ * @param trigger - The given Task Trigger.
16
+ */
17
+ function isOnDemandTrigger(trigger) {
18
+ return trigger.type === 'onDemand';
19
+ }
20
+ /**
21
+ * Guard: Return strongly typed specific ScheduleTrigger for a given Trigger.
22
+ *
23
+ * @summary Guard method that returns a strongly typed specific ScheduleTrigger for a given Trigger.
24
+ * @param trigger - The given Task Trigger.
25
+ */
26
+ function isScheduleTrigger(trigger) {
27
+ return trigger.type === 'schedule';
28
+ }
29
+ /**
30
+ * Guard: Return strongly typed specific SubscriptionTrigger for a given Trigger.
31
+ *
32
+ * @summary Guard method that returns a strongly typed specific SubscriptionTrigger for a given Trigger.
33
+ * @param trigger - The given Task Trigger.
34
+ */
35
+ function isSubscriptionTrigger(trigger) {
36
+ return trigger.type === 'subscription';
37
+ }
38
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
39
+ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }) {
40
+ const auth = createAuth(appIdOption, apiKeyOption, authMode);
41
+ const transporter = createTransporter({
42
+ hosts: getDefaultHosts(regionOption),
43
+ ...options,
44
+ algoliaAgent: getAlgoliaAgent({
45
+ algoliaAgents,
46
+ client: 'Ingestion',
47
+ version: apiClientVersion,
48
+ }),
49
+ baseHeaders: {
50
+ 'content-type': 'text/plain',
51
+ ...auth.headers(),
52
+ ...options.baseHeaders,
53
+ },
54
+ baseQueryParameters: {
55
+ ...auth.queryParameters(),
56
+ ...options.baseQueryParameters,
57
+ },
58
+ });
59
+ return {
60
+ transporter,
61
+ /**
62
+ * The `appId` currently in use.
63
+ */
64
+ appId: appIdOption,
65
+ /**
66
+ * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
67
+ */
68
+ clearCache() {
69
+ return Promise.all([
70
+ transporter.requestsCache.clear(),
71
+ transporter.responsesCache.clear(),
72
+ ]).then(() => undefined);
73
+ },
74
+ /**
75
+ * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
76
+ */
77
+ get _ua() {
78
+ return transporter.algoliaAgent.value;
79
+ },
80
+ /**
81
+ * Adds a `segment` to the `x-algolia-agent` sent with every requests.
82
+ *
83
+ * @param segment - The algolia agent (user-agent) segment to add.
84
+ * @param version - The version of the agent.
85
+ */
86
+ addAlgoliaAgent(segment, version) {
87
+ transporter.algoliaAgent.add({ segment, version });
88
+ },
89
+ /**
90
+ * Creates a new authentication resource.
91
+ *
92
+ * Required API Key ACLs:
93
+ * - addObject
94
+ * - deleteIndex
95
+ * - editSettings.
96
+ *
97
+ * @param authenticationCreate -.
98
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
99
+ */
100
+ createAuthentication(authenticationCreate, requestOptions) {
101
+ if (!authenticationCreate) {
102
+ throw new Error('Parameter `authenticationCreate` is required when calling `createAuthentication`.');
103
+ }
104
+ if (!authenticationCreate.type) {
105
+ throw new Error('Parameter `authenticationCreate.type` is required when calling `createAuthentication`.');
106
+ }
107
+ if (!authenticationCreate.name) {
108
+ throw new Error('Parameter `authenticationCreate.name` is required when calling `createAuthentication`.');
109
+ }
110
+ if (!authenticationCreate.input) {
111
+ throw new Error('Parameter `authenticationCreate.input` is required when calling `createAuthentication`.');
112
+ }
113
+ const requestPath = '/1/authentications';
114
+ const headers = {};
115
+ const queryParameters = {};
116
+ const request = {
117
+ method: 'POST',
118
+ path: requestPath,
119
+ queryParameters,
120
+ headers,
121
+ data: authenticationCreate,
122
+ };
123
+ return transporter.request(request, requestOptions);
124
+ },
125
+ /**
126
+ * Creates a new destination.
127
+ *
128
+ * Required API Key ACLs:
129
+ * - addObject
130
+ * - deleteIndex
131
+ * - editSettings.
132
+ *
133
+ * @param destinationCreate -.
134
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
135
+ */
136
+ createDestination(destinationCreate, requestOptions) {
137
+ if (!destinationCreate) {
138
+ throw new Error('Parameter `destinationCreate` is required when calling `createDestination`.');
139
+ }
140
+ if (!destinationCreate.type) {
141
+ throw new Error('Parameter `destinationCreate.type` is required when calling `createDestination`.');
142
+ }
143
+ if (!destinationCreate.name) {
144
+ throw new Error('Parameter `destinationCreate.name` is required when calling `createDestination`.');
145
+ }
146
+ if (!destinationCreate.input) {
147
+ throw new Error('Parameter `destinationCreate.input` is required when calling `createDestination`.');
148
+ }
149
+ const requestPath = '/1/destinations';
150
+ const headers = {};
151
+ const queryParameters = {};
152
+ const request = {
153
+ method: 'POST',
154
+ path: requestPath,
155
+ queryParameters,
156
+ headers,
157
+ data: destinationCreate,
158
+ };
159
+ return transporter.request(request, requestOptions);
160
+ },
161
+ /**
162
+ * Creates a new source.
163
+ *
164
+ * Required API Key ACLs:
165
+ * - addObject
166
+ * - deleteIndex
167
+ * - editSettings.
168
+ *
169
+ * @param sourceCreate -.
170
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
171
+ */
172
+ createSource(sourceCreate, requestOptions) {
173
+ if (!sourceCreate) {
174
+ throw new Error('Parameter `sourceCreate` is required when calling `createSource`.');
175
+ }
176
+ if (!sourceCreate.type) {
177
+ throw new Error('Parameter `sourceCreate.type` is required when calling `createSource`.');
178
+ }
179
+ if (!sourceCreate.name) {
180
+ throw new Error('Parameter `sourceCreate.name` is required when calling `createSource`.');
181
+ }
182
+ if (!sourceCreate.input) {
183
+ throw new Error('Parameter `sourceCreate.input` is required when calling `createSource`.');
184
+ }
185
+ const requestPath = '/1/sources';
186
+ const headers = {};
187
+ const queryParameters = {};
188
+ const request = {
189
+ method: 'POST',
190
+ path: requestPath,
191
+ queryParameters,
192
+ headers,
193
+ data: sourceCreate,
194
+ };
195
+ return transporter.request(request, requestOptions);
196
+ },
197
+ /**
198
+ * Creates a new task.
199
+ *
200
+ * @param taskCreate - Request body for creating a task.
201
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
202
+ */
203
+ createTask(taskCreate, requestOptions) {
204
+ if (!taskCreate) {
205
+ throw new Error('Parameter `taskCreate` is required when calling `createTask`.');
206
+ }
207
+ if (!taskCreate.sourceID) {
208
+ throw new Error('Parameter `taskCreate.sourceID` is required when calling `createTask`.');
209
+ }
210
+ if (!taskCreate.destinationID) {
211
+ throw new Error('Parameter `taskCreate.destinationID` is required when calling `createTask`.');
212
+ }
213
+ if (!taskCreate.trigger) {
214
+ throw new Error('Parameter `taskCreate.trigger` is required when calling `createTask`.');
215
+ }
216
+ if (!taskCreate.action) {
217
+ throw new Error('Parameter `taskCreate.action` is required when calling `createTask`.');
218
+ }
219
+ const requestPath = '/1/tasks';
220
+ const headers = {};
221
+ const queryParameters = {};
222
+ const request = {
223
+ method: 'POST',
224
+ path: requestPath,
225
+ queryParameters,
226
+ headers,
227
+ data: taskCreate,
228
+ };
229
+ return transporter.request(request, requestOptions);
230
+ },
231
+ /**
232
+ * This method allow you to send requests to the Algolia REST API.
233
+ *
234
+ * @param customDelete - The customDelete object.
235
+ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
236
+ * @param customDelete.parameters - Query parameters to apply to the current query.
237
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
238
+ */
239
+ customDelete({ path, parameters }, requestOptions) {
240
+ if (!path) {
241
+ throw new Error('Parameter `path` is required when calling `customDelete`.');
242
+ }
243
+ const requestPath = '/{path}'.replace('{path}', path);
244
+ const headers = {};
245
+ const queryParameters = parameters ? parameters : {};
246
+ const request = {
247
+ method: 'DELETE',
248
+ path: requestPath,
249
+ queryParameters,
250
+ headers,
251
+ };
252
+ return transporter.request(request, requestOptions);
253
+ },
254
+ /**
255
+ * This method allow you to send requests to the Algolia REST API.
256
+ *
257
+ * @param customGet - The customGet object.
258
+ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
259
+ * @param customGet.parameters - Query parameters to apply to the current query.
260
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
261
+ */
262
+ customGet({ path, parameters }, requestOptions) {
263
+ if (!path) {
264
+ throw new Error('Parameter `path` is required when calling `customGet`.');
265
+ }
266
+ const requestPath = '/{path}'.replace('{path}', path);
267
+ const headers = {};
268
+ const queryParameters = parameters ? parameters : {};
269
+ const request = {
270
+ method: 'GET',
271
+ path: requestPath,
272
+ queryParameters,
273
+ headers,
274
+ };
275
+ return transporter.request(request, requestOptions);
276
+ },
277
+ /**
278
+ * This method allow you to send requests to the Algolia REST API.
279
+ *
280
+ * @param customPost - The customPost object.
281
+ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
282
+ * @param customPost.parameters - Query parameters to apply to the current query.
283
+ * @param customPost.body - Parameters to send with the custom request.
284
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
285
+ */
286
+ customPost({ path, parameters, body }, requestOptions) {
287
+ if (!path) {
288
+ throw new Error('Parameter `path` is required when calling `customPost`.');
289
+ }
290
+ const requestPath = '/{path}'.replace('{path}', path);
291
+ const headers = {};
292
+ const queryParameters = parameters ? parameters : {};
293
+ const request = {
294
+ method: 'POST',
295
+ path: requestPath,
296
+ queryParameters,
297
+ headers,
298
+ data: body ? body : {},
299
+ };
300
+ return transporter.request(request, requestOptions);
301
+ },
302
+ /**
303
+ * This method allow you to send requests to the Algolia REST API.
304
+ *
305
+ * @param customPut - The customPut object.
306
+ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
307
+ * @param customPut.parameters - Query parameters to apply to the current query.
308
+ * @param customPut.body - Parameters to send with the custom request.
309
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
310
+ */
311
+ customPut({ path, parameters, body }, requestOptions) {
312
+ if (!path) {
313
+ throw new Error('Parameter `path` is required when calling `customPut`.');
314
+ }
315
+ const requestPath = '/{path}'.replace('{path}', path);
316
+ const headers = {};
317
+ const queryParameters = parameters ? parameters : {};
318
+ const request = {
319
+ method: 'PUT',
320
+ path: requestPath,
321
+ queryParameters,
322
+ headers,
323
+ data: body ? body : {},
324
+ };
325
+ return transporter.request(request, requestOptions);
326
+ },
327
+ /**
328
+ * Deletes an authentication resource. You can\'t delete authentication resources that are used by a source or a destination.
329
+ *
330
+ * Required API Key ACLs:
331
+ * - addObject
332
+ * - deleteIndex
333
+ * - editSettings.
334
+ *
335
+ * @param deleteAuthentication - The deleteAuthentication object.
336
+ * @param deleteAuthentication.authenticationID - Unique identifier of an authentication resource.
337
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
338
+ */
339
+ deleteAuthentication({ authenticationID }, requestOptions) {
340
+ if (!authenticationID) {
341
+ throw new Error('Parameter `authenticationID` is required when calling `deleteAuthentication`.');
342
+ }
343
+ const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
344
+ const headers = {};
345
+ const queryParameters = {};
346
+ const request = {
347
+ method: 'DELETE',
348
+ path: requestPath,
349
+ queryParameters,
350
+ headers,
351
+ };
352
+ return transporter.request(request, requestOptions);
353
+ },
354
+ /**
355
+ * Deletes a destination by its ID. You can\'t delete destinations that are referenced in tasks.
356
+ *
357
+ * Required API Key ACLs:
358
+ * - addObject
359
+ * - deleteIndex
360
+ * - editSettings.
361
+ *
362
+ * @param deleteDestination - The deleteDestination object.
363
+ * @param deleteDestination.destinationID - Unique identifier of a destination.
364
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
365
+ */
366
+ deleteDestination({ destinationID }, requestOptions) {
367
+ if (!destinationID) {
368
+ throw new Error('Parameter `destinationID` is required when calling `deleteDestination`.');
369
+ }
370
+ const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
371
+ const headers = {};
372
+ const queryParameters = {};
373
+ const request = {
374
+ method: 'DELETE',
375
+ path: requestPath,
376
+ queryParameters,
377
+ headers,
378
+ };
379
+ return transporter.request(request, requestOptions);
380
+ },
381
+ /**
382
+ * Deletes a source by its ID. You can\'t delete sources that are referenced in tasks.
383
+ *
384
+ * Required API Key ACLs:
385
+ * - addObject
386
+ * - deleteIndex
387
+ * - editSettings.
388
+ *
389
+ * @param deleteSource - The deleteSource object.
390
+ * @param deleteSource.sourceID - Unique identifier of a source.
391
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
392
+ */
393
+ deleteSource({ sourceID }, requestOptions) {
394
+ if (!sourceID) {
395
+ throw new Error('Parameter `sourceID` is required when calling `deleteSource`.');
396
+ }
397
+ const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
398
+ const headers = {};
399
+ const queryParameters = {};
400
+ const request = {
401
+ method: 'DELETE',
402
+ path: requestPath,
403
+ queryParameters,
404
+ headers,
405
+ };
406
+ return transporter.request(request, requestOptions);
407
+ },
408
+ /**
409
+ * Deletes a task by its ID.
410
+ *
411
+ * @param deleteTask - The deleteTask object.
412
+ * @param deleteTask.taskID - Unique identifier of a task.
413
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
414
+ */
415
+ deleteTask({ taskID }, requestOptions) {
416
+ if (!taskID) {
417
+ throw new Error('Parameter `taskID` is required when calling `deleteTask`.');
418
+ }
419
+ const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
420
+ const headers = {};
421
+ const queryParameters = {};
422
+ const request = {
423
+ method: 'DELETE',
424
+ path: requestPath,
425
+ queryParameters,
426
+ headers,
427
+ };
428
+ return transporter.request(request, requestOptions);
429
+ },
430
+ /**
431
+ * Disables a task.
432
+ *
433
+ * Required API Key ACLs:
434
+ * - addObject
435
+ * - deleteIndex
436
+ * - editSettings.
437
+ *
438
+ * @param disableTask - The disableTask object.
439
+ * @param disableTask.taskID - Unique identifier of a task.
440
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
441
+ */
442
+ disableTask({ taskID }, requestOptions) {
443
+ if (!taskID) {
444
+ throw new Error('Parameter `taskID` is required when calling `disableTask`.');
445
+ }
446
+ const requestPath = '/1/tasks/{taskID}/disable'.replace('{taskID}', encodeURIComponent(taskID));
447
+ const headers = {};
448
+ const queryParameters = {};
449
+ const request = {
450
+ method: 'PUT',
451
+ path: requestPath,
452
+ queryParameters,
453
+ headers,
454
+ };
455
+ return transporter.request(request, requestOptions);
456
+ },
457
+ /**
458
+ * Enables a task.
459
+ *
460
+ * Required API Key ACLs:
461
+ * - addObject
462
+ * - deleteIndex
463
+ * - editSettings.
464
+ *
465
+ * @param enableTask - The enableTask object.
466
+ * @param enableTask.taskID - Unique identifier of a task.
467
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
468
+ */
469
+ enableTask({ taskID }, requestOptions) {
470
+ if (!taskID) {
471
+ throw new Error('Parameter `taskID` is required when calling `enableTask`.');
472
+ }
473
+ const requestPath = '/1/tasks/{taskID}/enable'.replace('{taskID}', encodeURIComponent(taskID));
474
+ const headers = {};
475
+ const queryParameters = {};
476
+ const request = {
477
+ method: 'PUT',
478
+ path: requestPath,
479
+ queryParameters,
480
+ headers,
481
+ };
482
+ return transporter.request(request, requestOptions);
483
+ },
484
+ /**
485
+ * Retrieves an authentication resource by its ID.
486
+ *
487
+ * Required API Key ACLs:
488
+ * - addObject
489
+ * - deleteIndex
490
+ * - editSettings.
491
+ *
492
+ * @param getAuthentication - The getAuthentication object.
493
+ * @param getAuthentication.authenticationID - Unique identifier of an authentication resource.
494
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
495
+ */
496
+ getAuthentication({ authenticationID }, requestOptions) {
497
+ if (!authenticationID) {
498
+ throw new Error('Parameter `authenticationID` is required when calling `getAuthentication`.');
499
+ }
500
+ const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
501
+ const headers = {};
502
+ const queryParameters = {};
503
+ const request = {
504
+ method: 'GET',
505
+ path: requestPath,
506
+ queryParameters,
507
+ headers,
508
+ };
509
+ return transporter.request(request, requestOptions);
510
+ },
511
+ /**
512
+ * Retrieves a list of all authentication resources.
513
+ *
514
+ * Required API Key ACLs:
515
+ * - addObject
516
+ * - deleteIndex
517
+ * - editSettings.
518
+ *
519
+ * @param getAuthentications - The getAuthentications object.
520
+ * @param getAuthentications.itemsPerPage - Number of items per page.
521
+ * @param getAuthentications.page - Page number of the paginated API response.
522
+ * @param getAuthentications.type - Type of authentication resource to retrieve.
523
+ * @param getAuthentications.platform - Ecommerce platform for which to retrieve authentication resources.
524
+ * @param getAuthentications.sort - Property by which to sort the list of authentication resources.
525
+ * @param getAuthentications.order - Sort order of the response, ascending or descending.
526
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
527
+ */
528
+ getAuthentications({ itemsPerPage, page, type, platform, sort, order, } = {}, requestOptions = undefined) {
529
+ const requestPath = '/1/authentications';
530
+ const headers = {};
531
+ const queryParameters = {};
532
+ if (itemsPerPage !== undefined) {
533
+ queryParameters.itemsPerPage = itemsPerPage.toString();
534
+ }
535
+ if (page !== undefined) {
536
+ queryParameters.page = page.toString();
537
+ }
538
+ if (type !== undefined) {
539
+ queryParameters.type = type.toString();
540
+ }
541
+ if (platform !== undefined) {
542
+ queryParameters.platform = platform.toString();
543
+ }
544
+ if (sort !== undefined) {
545
+ queryParameters.sort = sort.toString();
546
+ }
547
+ if (order !== undefined) {
548
+ queryParameters.order = order.toString();
549
+ }
550
+ const request = {
551
+ method: 'GET',
552
+ path: requestPath,
553
+ queryParameters,
554
+ headers,
555
+ };
556
+ return transporter.request(request, requestOptions);
557
+ },
558
+ /**
559
+ * Retrieves a destination by its ID.
560
+ *
561
+ * Required API Key ACLs:
562
+ * - addObject
563
+ * - deleteIndex
564
+ * - editSettings.
565
+ *
566
+ * @param getDestination - The getDestination object.
567
+ * @param getDestination.destinationID - Unique identifier of a destination.
568
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
569
+ */
570
+ getDestination({ destinationID }, requestOptions) {
571
+ if (!destinationID) {
572
+ throw new Error('Parameter `destinationID` is required when calling `getDestination`.');
573
+ }
574
+ const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
575
+ const headers = {};
576
+ const queryParameters = {};
577
+ const request = {
578
+ method: 'GET',
579
+ path: requestPath,
580
+ queryParameters,
581
+ headers,
582
+ };
583
+ return transporter.request(request, requestOptions);
584
+ },
585
+ /**
586
+ * Retrieves a list of destinations.
587
+ *
588
+ * Required API Key ACLs:
589
+ * - addObject
590
+ * - deleteIndex
591
+ * - editSettings.
592
+ *
593
+ * @param getDestinations - The getDestinations object.
594
+ * @param getDestinations.itemsPerPage - Number of items per page.
595
+ * @param getDestinations.page - Page number of the paginated API response.
596
+ * @param getDestinations.type - Destination type.
597
+ * @param getDestinations.authenticationID - Authentication ID used by destinations.
598
+ * @param getDestinations.sort - Property by which to sort the destinations.
599
+ * @param getDestinations.order - Sort order of the response, ascending or descending.
600
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
601
+ */
602
+ getDestinations({ itemsPerPage, page, type, authenticationID, sort, order, } = {}, requestOptions = undefined) {
603
+ const requestPath = '/1/destinations';
604
+ const headers = {};
605
+ const queryParameters = {};
606
+ if (itemsPerPage !== undefined) {
607
+ queryParameters.itemsPerPage = itemsPerPage.toString();
608
+ }
609
+ if (page !== undefined) {
610
+ queryParameters.page = page.toString();
611
+ }
612
+ if (type !== undefined) {
613
+ queryParameters.type = type.toString();
614
+ }
615
+ if (authenticationID !== undefined) {
616
+ queryParameters.authenticationID = authenticationID.toString();
617
+ }
618
+ if (sort !== undefined) {
619
+ queryParameters.sort = sort.toString();
620
+ }
621
+ if (order !== undefined) {
622
+ queryParameters.order = order.toString();
623
+ }
624
+ const request = {
625
+ method: 'GET',
626
+ path: requestPath,
627
+ queryParameters,
628
+ headers,
629
+ };
630
+ return transporter.request(request, requestOptions);
631
+ },
632
+ /**
633
+ * Retrieves a stream listing for a source. Listing streams only works with sources with `type: docker` and `imageType: singer`.
634
+ *
635
+ * Required API Key ACLs:
636
+ * - addObject
637
+ * - deleteIndex
638
+ * - editSettings.
639
+ *
640
+ * @param getDockerSourceStreams - The getDockerSourceStreams object.
641
+ * @param getDockerSourceStreams.sourceID - Unique identifier of a source.
642
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
643
+ */
644
+ getDockerSourceStreams({ sourceID }, requestOptions) {
645
+ if (!sourceID) {
646
+ throw new Error('Parameter `sourceID` is required when calling `getDockerSourceStreams`.');
647
+ }
648
+ const requestPath = '/1/sources/{sourceID}/discover'.replace('{sourceID}', encodeURIComponent(sourceID));
649
+ const headers = {};
650
+ const queryParameters = {};
651
+ const request = {
652
+ method: 'GET',
653
+ path: requestPath,
654
+ queryParameters,
655
+ headers,
656
+ };
657
+ return transporter.request(request, requestOptions);
658
+ },
659
+ /**
660
+ * Retrieves a single task run event by its ID.
661
+ *
662
+ * Required API Key ACLs:
663
+ * - addObject
664
+ * - deleteIndex
665
+ * - editSettings.
666
+ *
667
+ * @param getEvent - The getEvent object.
668
+ * @param getEvent.runID - Unique identifier of a task run.
669
+ * @param getEvent.eventID - Unique identifier of an event.
670
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
671
+ */
672
+ getEvent({ runID, eventID }, requestOptions) {
673
+ if (!runID) {
674
+ throw new Error('Parameter `runID` is required when calling `getEvent`.');
675
+ }
676
+ if (!eventID) {
677
+ throw new Error('Parameter `eventID` is required when calling `getEvent`.');
678
+ }
679
+ const requestPath = '/1/runs/{runID}/events/{eventID}'
680
+ .replace('{runID}', encodeURIComponent(runID))
681
+ .replace('{eventID}', encodeURIComponent(eventID));
682
+ const headers = {};
683
+ const queryParameters = {};
684
+ const request = {
685
+ method: 'GET',
686
+ path: requestPath,
687
+ queryParameters,
688
+ headers,
689
+ };
690
+ return transporter.request(request, requestOptions);
691
+ },
692
+ /**
693
+ * Retrieves a list of events for a task run, identified by it\'s ID.
694
+ *
695
+ * Required API Key ACLs:
696
+ * - addObject
697
+ * - deleteIndex
698
+ * - editSettings.
699
+ *
700
+ * @param getEvents - The getEvents object.
701
+ * @param getEvents.runID - Unique identifier of a task run.
702
+ * @param getEvents.itemsPerPage - Number of items per page.
703
+ * @param getEvents.page - Page number of the paginated API response.
704
+ * @param getEvents.status - Event status for filtering the list of task runs.
705
+ * @param getEvents.type - Event type for filtering the list of task runs.
706
+ * @param getEvents.sort - Property by which to sort the list of task run events.
707
+ * @param getEvents.order - Sort order of the response, ascending or descending.
708
+ * @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.
709
+ * @param getEvents.endDate - Date and time in RFC3339 format for the latest events to retrieve. By default, the current time is used.
710
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
711
+ */
712
+ getEvents({ runID, itemsPerPage, page, status, type, sort, order, startDate, endDate, }, requestOptions) {
713
+ if (!runID) {
714
+ throw new Error('Parameter `runID` is required when calling `getEvents`.');
715
+ }
716
+ const requestPath = '/1/runs/{runID}/events'.replace('{runID}', encodeURIComponent(runID));
717
+ const headers = {};
718
+ const queryParameters = {};
719
+ if (itemsPerPage !== undefined) {
720
+ queryParameters.itemsPerPage = itemsPerPage.toString();
721
+ }
722
+ if (page !== undefined) {
723
+ queryParameters.page = page.toString();
724
+ }
725
+ if (status !== undefined) {
726
+ queryParameters.status = status.toString();
727
+ }
728
+ if (type !== undefined) {
729
+ queryParameters.type = type.toString();
730
+ }
731
+ if (sort !== undefined) {
732
+ queryParameters.sort = sort.toString();
733
+ }
734
+ if (order !== undefined) {
735
+ queryParameters.order = order.toString();
736
+ }
737
+ if (startDate !== undefined) {
738
+ queryParameters.startDate = startDate.toString();
739
+ }
740
+ if (endDate !== undefined) {
741
+ queryParameters.endDate = endDate.toString();
742
+ }
743
+ const request = {
744
+ method: 'GET',
745
+ path: requestPath,
746
+ queryParameters,
747
+ headers,
748
+ };
749
+ return transporter.request(request, requestOptions);
750
+ },
751
+ /**
752
+ * Retrieve a single task run by its ID.
753
+ *
754
+ * Required API Key ACLs:
755
+ * - addObject
756
+ * - deleteIndex
757
+ * - editSettings.
758
+ *
759
+ * @param getRun - The getRun object.
760
+ * @param getRun.runID - Unique identifier of a task run.
761
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
762
+ */
763
+ getRun({ runID }, requestOptions) {
764
+ if (!runID) {
765
+ throw new Error('Parameter `runID` is required when calling `getRun`.');
766
+ }
767
+ const requestPath = '/1/runs/{runID}'.replace('{runID}', encodeURIComponent(runID));
768
+ const headers = {};
769
+ const queryParameters = {};
770
+ const request = {
771
+ method: 'GET',
772
+ path: requestPath,
773
+ queryParameters,
774
+ headers,
775
+ };
776
+ return transporter.request(request, requestOptions);
777
+ },
778
+ /**
779
+ * Retrieve a list of task runs.
780
+ *
781
+ * Required API Key ACLs:
782
+ * - addObject
783
+ * - deleteIndex
784
+ * - editSettings.
785
+ *
786
+ * @param getRuns - The getRuns object.
787
+ * @param getRuns.itemsPerPage - Number of items per page.
788
+ * @param getRuns.page - Page number of the paginated API response.
789
+ * @param getRuns.status - Run status for filtering the list of task runs.
790
+ * @param getRuns.taskID - Task ID for filtering the list of task runs.
791
+ * @param getRuns.sort - Property by which to sort the list of task runs.
792
+ * @param getRuns.order - Sort order of the response, ascending or descending.
793
+ * @param getRuns.startDate - Date in RFC3339 format for the earliest run to retrieve. By default, the current day minus seven days is used.
794
+ * @param getRuns.endDate - Date in RFC3339 format for the latest run to retrieve. By default, the current day is used.
795
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
796
+ */
797
+ getRuns({ itemsPerPage, page, status, taskID, sort, order, startDate, endDate, } = {}, requestOptions = undefined) {
798
+ const requestPath = '/1/runs';
799
+ const headers = {};
800
+ const queryParameters = {};
801
+ if (itemsPerPage !== undefined) {
802
+ queryParameters.itemsPerPage = itemsPerPage.toString();
803
+ }
804
+ if (page !== undefined) {
805
+ queryParameters.page = page.toString();
806
+ }
807
+ if (status !== undefined) {
808
+ queryParameters.status = status.toString();
809
+ }
810
+ if (taskID !== undefined) {
811
+ queryParameters.taskID = taskID.toString();
812
+ }
813
+ if (sort !== undefined) {
814
+ queryParameters.sort = sort.toString();
815
+ }
816
+ if (order !== undefined) {
817
+ queryParameters.order = order.toString();
818
+ }
819
+ if (startDate !== undefined) {
820
+ queryParameters.startDate = startDate.toString();
821
+ }
822
+ if (endDate !== undefined) {
823
+ queryParameters.endDate = endDate.toString();
824
+ }
825
+ const request = {
826
+ method: 'GET',
827
+ path: requestPath,
828
+ queryParameters,
829
+ headers,
830
+ };
831
+ return transporter.request(request, requestOptions);
832
+ },
833
+ /**
834
+ * Retrieve a source by its ID.
835
+ *
836
+ * Required API Key ACLs:
837
+ * - addObject
838
+ * - deleteIndex
839
+ * - editSettings.
840
+ *
841
+ * @param getSource - The getSource object.
842
+ * @param getSource.sourceID - Unique identifier of a source.
843
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
844
+ */
845
+ getSource({ sourceID }, requestOptions) {
846
+ if (!sourceID) {
847
+ throw new Error('Parameter `sourceID` is required when calling `getSource`.');
848
+ }
849
+ const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
850
+ const headers = {};
851
+ const queryParameters = {};
852
+ const request = {
853
+ method: 'GET',
854
+ path: requestPath,
855
+ queryParameters,
856
+ headers,
857
+ };
858
+ return transporter.request(request, requestOptions);
859
+ },
860
+ /**
861
+ * Retrieves a list of sources.
862
+ *
863
+ * Required API Key ACLs:
864
+ * - addObject
865
+ * - deleteIndex
866
+ * - editSettings.
867
+ *
868
+ * @param getSources - The getSources object.
869
+ * @param getSources.itemsPerPage - Number of items per page.
870
+ * @param getSources.page - Page number of the paginated API response.
871
+ * @param getSources.type - Source type. Some sources require authentication.
872
+ * @param getSources.authenticationID - Authentication IDs of the sources to retrieve. \'none\' returns sources that doesn\'t have an authentication resource.
873
+ * @param getSources.sort - Property by which to sort the list of sources.
874
+ * @param getSources.order - Sort order of the response, ascending or descending.
875
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
876
+ */
877
+ getSources({ itemsPerPage, page, type, authenticationID, sort, order, } = {}, requestOptions = undefined) {
878
+ const requestPath = '/1/sources';
879
+ const headers = {};
880
+ const queryParameters = {};
881
+ if (itemsPerPage !== undefined) {
882
+ queryParameters.itemsPerPage = itemsPerPage.toString();
883
+ }
884
+ if (page !== undefined) {
885
+ queryParameters.page = page.toString();
886
+ }
887
+ if (type !== undefined) {
888
+ queryParameters.type = type.toString();
889
+ }
890
+ if (authenticationID !== undefined) {
891
+ queryParameters.authenticationID = authenticationID.toString();
892
+ }
893
+ if (sort !== undefined) {
894
+ queryParameters.sort = sort.toString();
895
+ }
896
+ if (order !== undefined) {
897
+ queryParameters.order = order.toString();
898
+ }
899
+ const request = {
900
+ method: 'GET',
901
+ path: requestPath,
902
+ queryParameters,
903
+ headers,
904
+ };
905
+ return transporter.request(request, requestOptions);
906
+ },
907
+ /**
908
+ * Retrieves a task by its ID.
909
+ *
910
+ * Required API Key ACLs:
911
+ * - addObject
912
+ * - deleteIndex
913
+ * - editSettings.
914
+ *
915
+ * @param getTask - The getTask object.
916
+ * @param getTask.taskID - Unique identifier of a task.
917
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
918
+ */
919
+ getTask({ taskID }, requestOptions) {
920
+ if (!taskID) {
921
+ throw new Error('Parameter `taskID` is required when calling `getTask`.');
922
+ }
923
+ const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
924
+ const headers = {};
925
+ const queryParameters = {};
926
+ const request = {
927
+ method: 'GET',
928
+ path: requestPath,
929
+ queryParameters,
930
+ headers,
931
+ };
932
+ return transporter.request(request, requestOptions);
933
+ },
934
+ /**
935
+ * Retrieves a list of tasks.
936
+ *
937
+ * Required API Key ACLs:
938
+ * - addObject
939
+ * - deleteIndex
940
+ * - editSettings.
941
+ *
942
+ * @param getTasks - The getTasks object.
943
+ * @param getTasks.itemsPerPage - Number of items per page.
944
+ * @param getTasks.page - Page number of the paginated API response.
945
+ * @param getTasks.action - Actions for filtering the list of tasks.
946
+ * @param getTasks.enabled - Whether to filter the list of tasks by the `enabled` status.
947
+ * @param getTasks.sourceID - Source IDs for filtering the list of tasks.
948
+ * @param getTasks.destinationID - Destination IDs for filtering the list of tasks.
949
+ * @param getTasks.triggerType - Type of task trigger for filtering the list of tasks.
950
+ * @param getTasks.sort - Property by which to sort the list of tasks.
951
+ * @param getTasks.order - Sort order of the response, ascending or descending.
952
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
953
+ */
954
+ getTasks({ itemsPerPage, page, action, enabled, sourceID, destinationID, triggerType, sort, order, } = {}, requestOptions = undefined) {
955
+ const requestPath = '/1/tasks';
956
+ const headers = {};
957
+ const queryParameters = {};
958
+ if (itemsPerPage !== undefined) {
959
+ queryParameters.itemsPerPage = itemsPerPage.toString();
960
+ }
961
+ if (page !== undefined) {
962
+ queryParameters.page = page.toString();
963
+ }
964
+ if (action !== undefined) {
965
+ queryParameters.action = action.toString();
966
+ }
967
+ if (enabled !== undefined) {
968
+ queryParameters.enabled = enabled.toString();
969
+ }
970
+ if (sourceID !== undefined) {
971
+ queryParameters.sourceID = sourceID.toString();
972
+ }
973
+ if (destinationID !== undefined) {
974
+ queryParameters.destinationID = destinationID.toString();
975
+ }
976
+ if (triggerType !== undefined) {
977
+ queryParameters.triggerType = triggerType.toString();
978
+ }
979
+ if (sort !== undefined) {
980
+ queryParameters.sort = sort.toString();
981
+ }
982
+ if (order !== undefined) {
983
+ queryParameters.order = order.toString();
984
+ }
985
+ const request = {
986
+ method: 'GET',
987
+ path: requestPath,
988
+ queryParameters,
989
+ headers,
990
+ };
991
+ return transporter.request(request, requestOptions);
992
+ },
993
+ /**
994
+ * Runs a task. You can check the status of task runs with the observability endpoints.
995
+ *
996
+ * Required API Key ACLs:
997
+ * - addObject
998
+ * - deleteIndex
999
+ * - editSettings.
1000
+ *
1001
+ * @param runTask - The runTask object.
1002
+ * @param runTask.taskID - Unique identifier of a task.
1003
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1004
+ */
1005
+ runTask({ taskID }, requestOptions) {
1006
+ if (!taskID) {
1007
+ throw new Error('Parameter `taskID` is required when calling `runTask`.');
1008
+ }
1009
+ const requestPath = '/1/tasks/{taskID}/run'.replace('{taskID}', encodeURIComponent(taskID));
1010
+ const headers = {};
1011
+ const queryParameters = {};
1012
+ const request = {
1013
+ method: 'POST',
1014
+ path: requestPath,
1015
+ queryParameters,
1016
+ headers,
1017
+ };
1018
+ return transporter.request(request, requestOptions);
1019
+ },
1020
+ /**
1021
+ * Searches for authentication resources.
1022
+ *
1023
+ * Required API Key ACLs:
1024
+ * - addObject
1025
+ * - deleteIndex
1026
+ * - editSettings.
1027
+ *
1028
+ * @param authenticationSearch - The authenticationSearch object.
1029
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1030
+ */
1031
+ searchAuthentications(authenticationSearch, requestOptions) {
1032
+ if (!authenticationSearch) {
1033
+ throw new Error('Parameter `authenticationSearch` is required when calling `searchAuthentications`.');
1034
+ }
1035
+ if (!authenticationSearch.authenticationIDs) {
1036
+ throw new Error('Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.');
1037
+ }
1038
+ const requestPath = '/1/authentications/search';
1039
+ const headers = {};
1040
+ const queryParameters = {};
1041
+ const request = {
1042
+ method: 'POST',
1043
+ path: requestPath,
1044
+ queryParameters,
1045
+ headers,
1046
+ data: authenticationSearch,
1047
+ };
1048
+ return transporter.request(request, requestOptions);
1049
+ },
1050
+ /**
1051
+ * Searches for destinations.
1052
+ *
1053
+ * Required API Key ACLs:
1054
+ * - addObject
1055
+ * - deleteIndex
1056
+ * - editSettings.
1057
+ *
1058
+ * @param destinationSearch - The destinationSearch object.
1059
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1060
+ */
1061
+ searchDestinations(destinationSearch, requestOptions) {
1062
+ if (!destinationSearch) {
1063
+ throw new Error('Parameter `destinationSearch` is required when calling `searchDestinations`.');
1064
+ }
1065
+ if (!destinationSearch.destinationIDs) {
1066
+ throw new Error('Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.');
1067
+ }
1068
+ const requestPath = '/1/destinations/search';
1069
+ const headers = {};
1070
+ const queryParameters = {};
1071
+ const request = {
1072
+ method: 'POST',
1073
+ path: requestPath,
1074
+ queryParameters,
1075
+ headers,
1076
+ data: destinationSearch,
1077
+ };
1078
+ return transporter.request(request, requestOptions);
1079
+ },
1080
+ /**
1081
+ * Searches for sources.
1082
+ *
1083
+ * Required API Key ACLs:
1084
+ * - addObject
1085
+ * - deleteIndex
1086
+ * - editSettings.
1087
+ *
1088
+ * @param sourceSearch - The sourceSearch object.
1089
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1090
+ */
1091
+ searchSources(sourceSearch, requestOptions) {
1092
+ if (!sourceSearch) {
1093
+ throw new Error('Parameter `sourceSearch` is required when calling `searchSources`.');
1094
+ }
1095
+ if (!sourceSearch.sourceIDs) {
1096
+ throw new Error('Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.');
1097
+ }
1098
+ const requestPath = '/1/sources/search';
1099
+ const headers = {};
1100
+ const queryParameters = {};
1101
+ const request = {
1102
+ method: 'POST',
1103
+ path: requestPath,
1104
+ queryParameters,
1105
+ headers,
1106
+ data: sourceSearch,
1107
+ };
1108
+ return transporter.request(request, requestOptions);
1109
+ },
1110
+ /**
1111
+ * Searches for tasks.
1112
+ *
1113
+ * Required API Key ACLs:
1114
+ * - addObject
1115
+ * - deleteIndex
1116
+ * - editSettings.
1117
+ *
1118
+ * @param taskSearch - The taskSearch object.
1119
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1120
+ */
1121
+ searchTasks(taskSearch, requestOptions) {
1122
+ if (!taskSearch) {
1123
+ throw new Error('Parameter `taskSearch` is required when calling `searchTasks`.');
1124
+ }
1125
+ if (!taskSearch.taskIDs) {
1126
+ throw new Error('Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.');
1127
+ }
1128
+ const requestPath = '/1/tasks/search';
1129
+ const headers = {};
1130
+ const queryParameters = {};
1131
+ const request = {
1132
+ method: 'POST',
1133
+ path: requestPath,
1134
+ queryParameters,
1135
+ headers,
1136
+ data: taskSearch,
1137
+ };
1138
+ return transporter.request(request, requestOptions);
1139
+ },
1140
+ /**
1141
+ * Triggers a stream-listing request for a source. Triggering stream-listing requests only works with sources with `type: docker` and `imageType: singer`.
1142
+ *
1143
+ * Required API Key ACLs:
1144
+ * - addObject
1145
+ * - deleteIndex
1146
+ * - editSettings.
1147
+ *
1148
+ * @param triggerDockerSourceDiscover - The triggerDockerSourceDiscover object.
1149
+ * @param triggerDockerSourceDiscover.sourceID - Unique identifier of a source.
1150
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1151
+ */
1152
+ triggerDockerSourceDiscover({ sourceID }, requestOptions) {
1153
+ if (!sourceID) {
1154
+ throw new Error('Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.');
1155
+ }
1156
+ const requestPath = '/1/sources/{sourceID}/discover'.replace('{sourceID}', encodeURIComponent(sourceID));
1157
+ const headers = {};
1158
+ const queryParameters = {};
1159
+ const request = {
1160
+ method: 'POST',
1161
+ path: requestPath,
1162
+ queryParameters,
1163
+ headers,
1164
+ };
1165
+ return transporter.request(request, requestOptions);
1166
+ },
1167
+ /**
1168
+ * Updates an authentication resource.
1169
+ *
1170
+ * Required API Key ACLs:
1171
+ * - addObject
1172
+ * - deleteIndex
1173
+ * - editSettings.
1174
+ *
1175
+ * @param updateAuthentication - The updateAuthentication object.
1176
+ * @param updateAuthentication.authenticationID - Unique identifier of an authentication resource.
1177
+ * @param updateAuthentication.authenticationUpdate - The authenticationUpdate object.
1178
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1179
+ */
1180
+ updateAuthentication({ authenticationID, authenticationUpdate }, requestOptions) {
1181
+ if (!authenticationID) {
1182
+ throw new Error('Parameter `authenticationID` is required when calling `updateAuthentication`.');
1183
+ }
1184
+ if (!authenticationUpdate) {
1185
+ throw new Error('Parameter `authenticationUpdate` is required when calling `updateAuthentication`.');
1186
+ }
1187
+ const requestPath = '/1/authentications/{authenticationID}'.replace('{authenticationID}', encodeURIComponent(authenticationID));
1188
+ const headers = {};
1189
+ const queryParameters = {};
1190
+ const request = {
1191
+ method: 'PATCH',
1192
+ path: requestPath,
1193
+ queryParameters,
1194
+ headers,
1195
+ data: authenticationUpdate,
1196
+ };
1197
+ return transporter.request(request, requestOptions);
1198
+ },
1199
+ /**
1200
+ * Updates the destination by its ID.
1201
+ *
1202
+ * Required API Key ACLs:
1203
+ * - addObject
1204
+ * - deleteIndex
1205
+ * - editSettings.
1206
+ *
1207
+ * @param updateDestination - The updateDestination object.
1208
+ * @param updateDestination.destinationID - Unique identifier of a destination.
1209
+ * @param updateDestination.destinationUpdate - The destinationUpdate object.
1210
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1211
+ */
1212
+ updateDestination({ destinationID, destinationUpdate }, requestOptions) {
1213
+ if (!destinationID) {
1214
+ throw new Error('Parameter `destinationID` is required when calling `updateDestination`.');
1215
+ }
1216
+ if (!destinationUpdate) {
1217
+ throw new Error('Parameter `destinationUpdate` is required when calling `updateDestination`.');
1218
+ }
1219
+ const requestPath = '/1/destinations/{destinationID}'.replace('{destinationID}', encodeURIComponent(destinationID));
1220
+ const headers = {};
1221
+ const queryParameters = {};
1222
+ const request = {
1223
+ method: 'PATCH',
1224
+ path: requestPath,
1225
+ queryParameters,
1226
+ headers,
1227
+ data: destinationUpdate,
1228
+ };
1229
+ return transporter.request(request, requestOptions);
1230
+ },
1231
+ /**
1232
+ * Updates a source by its ID.
1233
+ *
1234
+ * Required API Key ACLs:
1235
+ * - addObject
1236
+ * - deleteIndex
1237
+ * - editSettings.
1238
+ *
1239
+ * @param updateSource - The updateSource object.
1240
+ * @param updateSource.sourceID - Unique identifier of a source.
1241
+ * @param updateSource.sourceUpdate - The sourceUpdate object.
1242
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1243
+ */
1244
+ updateSource({ sourceID, sourceUpdate }, requestOptions) {
1245
+ if (!sourceID) {
1246
+ throw new Error('Parameter `sourceID` is required when calling `updateSource`.');
1247
+ }
1248
+ if (!sourceUpdate) {
1249
+ throw new Error('Parameter `sourceUpdate` is required when calling `updateSource`.');
1250
+ }
1251
+ const requestPath = '/1/sources/{sourceID}'.replace('{sourceID}', encodeURIComponent(sourceID));
1252
+ const headers = {};
1253
+ const queryParameters = {};
1254
+ const request = {
1255
+ method: 'PATCH',
1256
+ path: requestPath,
1257
+ queryParameters,
1258
+ headers,
1259
+ data: sourceUpdate,
1260
+ };
1261
+ return transporter.request(request, requestOptions);
1262
+ },
1263
+ /**
1264
+ * Updates a task by its ID.
1265
+ *
1266
+ * @param updateTask - The updateTask object.
1267
+ * @param updateTask.taskID - Unique identifier of a task.
1268
+ * @param updateTask.taskUpdate - The taskUpdate object.
1269
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1270
+ */
1271
+ updateTask({ taskID, taskUpdate }, requestOptions) {
1272
+ if (!taskID) {
1273
+ throw new Error('Parameter `taskID` is required when calling `updateTask`.');
1274
+ }
1275
+ if (!taskUpdate) {
1276
+ throw new Error('Parameter `taskUpdate` is required when calling `updateTask`.');
1277
+ }
1278
+ const requestPath = '/1/tasks/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
1279
+ const headers = {};
1280
+ const queryParameters = {};
1281
+ const request = {
1282
+ method: 'PATCH',
1283
+ path: requestPath,
1284
+ queryParameters,
1285
+ headers,
1286
+ data: taskUpdate,
1287
+ };
1288
+ return transporter.request(request, requestOptions);
1289
+ },
1290
+ };
794
1291
  }
795
1292
 
796
- // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
797
- function ingestionClient(appId, apiKey, region, options) {
798
- if (!appId || typeof appId !== 'string') {
799
- throw new Error('`appId` is missing.');
800
- }
801
- if (!apiKey || typeof apiKey !== 'string') {
802
- throw new Error('`apiKey` is missing.');
803
- }
804
- if (!region ||
805
- (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {
806
- throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(', ')}`);
807
- }
808
- return createIngestionClient({
809
- appId,
810
- apiKey,
811
- region,
812
- timeouts: {
813
- connect: DEFAULT_CONNECT_TIMEOUT_NODE,
814
- read: DEFAULT_READ_TIMEOUT_NODE,
815
- write: DEFAULT_WRITE_TIMEOUT_NODE,
816
- },
817
- requester: createHttpRequester(),
818
- algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
819
- responsesCache: createNullCache(),
820
- requestsCache: createNullCache(),
821
- hostsCache: createMemoryCache(),
822
- ...options,
823
- });
1293
+ // 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.
1294
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
1295
+ function ingestionClient(appId, apiKey, region, options) {
1296
+ if (!appId || typeof appId !== 'string') {
1297
+ throw new Error('`appId` is missing.');
1298
+ }
1299
+ if (!apiKey || typeof apiKey !== 'string') {
1300
+ throw new Error('`apiKey` is missing.');
1301
+ }
1302
+ if (!region ||
1303
+ (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {
1304
+ throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(', ')}`);
1305
+ }
1306
+ return {
1307
+ ...createIngestionClient({
1308
+ appId,
1309
+ apiKey,
1310
+ region,
1311
+ timeouts: {
1312
+ connect: DEFAULT_CONNECT_TIMEOUT_NODE,
1313
+ read: DEFAULT_READ_TIMEOUT_NODE,
1314
+ write: DEFAULT_WRITE_TIMEOUT_NODE,
1315
+ },
1316
+ requester: createHttpRequester(),
1317
+ algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
1318
+ responsesCache: createNullCache(),
1319
+ requestsCache: createNullCache(),
1320
+ hostsCache: createMemoryCache(),
1321
+ ...options,
1322
+ }),
1323
+ };
824
1324
  }
825
1325
 
826
- export { apiClientVersion, ingestionClient };
1326
+ export { apiClientVersion, ingestionClient, isOnDemandTrigger, isScheduleTrigger, isSubscriptionTrigger };