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