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