@algolia/ingestion 1.0.0-beta.1 → 1.0.0-beta.11

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 (116) hide show
  1. package/LICENSE +21 -0
  2. package/dist/builds/browser.d.ts +41 -33
  3. package/dist/builds/browser.d.ts.map +1 -1
  4. package/dist/builds/node.d.ts +41 -33
  5. package/dist/builds/node.d.ts.map +1 -1
  6. package/dist/ingestion.cjs +265 -32
  7. package/dist/ingestion.esm.browser.js +275 -49
  8. package/dist/ingestion.esm.node.js +265 -32
  9. package/dist/ingestion.umd.js +2 -2
  10. package/dist/model/authentication.d.ts +2 -2
  11. package/dist/model/authenticationCreateResponse.d.ts +1 -1
  12. package/dist/model/authenticationUpdateResponse.d.ts +1 -1
  13. package/dist/model/clientMethodProps.d.ts +57 -13
  14. package/dist/model/clientMethodProps.d.ts.map +1 -1
  15. package/dist/model/deleteResponse.d.ts +1 -1
  16. package/dist/model/destination.d.ts +2 -2
  17. package/dist/model/destinationCreateResponse.d.ts +1 -1
  18. package/dist/model/destinationUpdateResponse.d.ts +1 -1
  19. package/dist/model/dockerStreamsInput.d.ts +4 -0
  20. package/dist/model/dockerStreamsInput.d.ts.map +1 -0
  21. package/dist/model/event.d.ts +1 -1
  22. package/dist/model/index.d.ts +13 -5
  23. package/dist/model/index.d.ts.map +1 -1
  24. package/dist/model/listTransformationsResponse.d.ts +10 -0
  25. package/dist/model/listTransformationsResponse.d.ts.map +1 -0
  26. package/dist/model/onDemandTrigger.d.ts +1 -1
  27. package/dist/model/run.d.ts +3 -3
  28. package/dist/model/runResponse.d.ts +1 -1
  29. package/dist/model/scheduleTrigger.d.ts +2 -2
  30. package/dist/model/sortKeys.d.ts +5 -0
  31. package/dist/model/sortKeys.d.ts.map +1 -0
  32. package/dist/model/source.d.ts +2 -2
  33. package/dist/model/sourceCreateResponse.d.ts +1 -1
  34. package/dist/model/sourceUpdateResponse.d.ts +1 -1
  35. package/dist/model/sourceUpdateShopify.d.ts +2 -26
  36. package/dist/model/sourceUpdateShopify.d.ts.map +1 -1
  37. package/dist/model/sourceWatchResponse.d.ts +20 -0
  38. package/dist/model/sourceWatchResponse.d.ts.map +1 -0
  39. package/dist/model/{streamingUtilsInput.d.ts → streamingInput.d.ts} +2 -2
  40. package/dist/model/streamingInput.d.ts.map +1 -0
  41. package/dist/model/task.d.ts +6 -2
  42. package/dist/model/task.d.ts.map +1 -1
  43. package/dist/model/taskCreate.d.ts +4 -0
  44. package/dist/model/taskCreate.d.ts.map +1 -1
  45. package/dist/model/taskCreateResponse.d.ts +1 -1
  46. package/dist/model/taskInput.d.ts +3 -4
  47. package/dist/model/taskInput.d.ts.map +1 -1
  48. package/dist/model/taskUpdateResponse.d.ts +1 -1
  49. package/dist/model/transformation.d.ts +27 -0
  50. package/dist/model/transformation.d.ts.map +1 -0
  51. package/dist/model/transformationCreate.d.ts +18 -0
  52. package/dist/model/transformationCreate.d.ts.map +1 -0
  53. package/dist/model/transformationCreateResponse.d.ts +14 -0
  54. package/dist/model/transformationCreateResponse.d.ts.map +1 -0
  55. package/dist/model/transformationSearch.d.ts +4 -0
  56. package/dist/model/transformationSearch.d.ts.map +1 -0
  57. package/dist/model/transformationTry.d.ts +11 -0
  58. package/dist/model/transformationTry.d.ts.map +1 -0
  59. package/dist/model/transformationTryResponse.d.ts +9 -0
  60. package/dist/model/transformationTryResponse.d.ts.map +1 -0
  61. package/dist/model/transformationTryResponseError.d.ts +14 -0
  62. package/dist/model/transformationTryResponseError.d.ts.map +1 -0
  63. package/dist/model/transformationUpdateResponse.d.ts +14 -0
  64. package/dist/model/transformationUpdateResponse.d.ts.map +1 -0
  65. package/dist/model/window.d.ts +2 -2
  66. package/dist/src/ingestionClient.d.ts +117 -22
  67. package/dist/src/ingestionClient.d.ts.map +1 -1
  68. package/model/authentication.ts +2 -2
  69. package/model/authenticationCreateResponse.ts +1 -1
  70. package/model/authenticationUpdateResponse.ts +1 -1
  71. package/model/clientMethodProps.ts +62 -14
  72. package/model/deleteResponse.ts +1 -1
  73. package/model/destination.ts +2 -2
  74. package/model/destinationCreateResponse.ts +1 -1
  75. package/model/destinationUpdateResponse.ts +1 -1
  76. package/model/{dockerSourceStreams.ts → dockerStreamsInput.ts} +2 -2
  77. package/model/event.ts +1 -1
  78. package/model/index.ts +13 -5
  79. package/model/listTransformationsResponse.ts +13 -0
  80. package/model/onDemandTrigger.ts +1 -1
  81. package/model/run.ts +3 -3
  82. package/model/runResponse.ts +1 -1
  83. package/model/scheduleTrigger.ts +2 -2
  84. package/model/sortKeys.ts +6 -0
  85. package/model/source.ts +2 -2
  86. package/model/sourceCreateResponse.ts +1 -1
  87. package/model/sourceUpdateResponse.ts +1 -1
  88. package/model/sourceUpdateShopify.ts +2 -32
  89. package/model/sourceWatchResponse.ts +25 -0
  90. package/model/{streamingUtilsInput.ts → streamingInput.ts} +1 -1
  91. package/model/task.ts +7 -2
  92. package/model/taskCreate.ts +5 -0
  93. package/model/taskCreateResponse.ts +1 -1
  94. package/model/taskInput.ts +3 -8
  95. package/model/taskUpdateResponse.ts +1 -1
  96. package/model/transformation.ts +33 -0
  97. package/model/transformationCreate.ts +21 -0
  98. package/model/transformationCreateResponse.ts +16 -0
  99. package/model/transformationSearch.ts +5 -0
  100. package/model/{dockerSourceDiscover.ts → transformationTry.ts} +5 -5
  101. package/model/transformationTryResponse.ts +12 -0
  102. package/model/transformationTryResponseError.ts +16 -0
  103. package/model/transformationUpdateResponse.ts +16 -0
  104. package/model/window.ts +2 -2
  105. package/package.json +11 -8
  106. package/dist/model/dockerSourceDiscover.d.ts +0 -11
  107. package/dist/model/dockerSourceDiscover.d.ts.map +0 -1
  108. package/dist/model/dockerSourceStreams.d.ts +0 -4
  109. package/dist/model/dockerSourceStreams.d.ts.map +0 -1
  110. package/dist/model/onDemandDateUtilsInput.d.ts +0 -16
  111. package/dist/model/onDemandDateUtilsInput.d.ts.map +0 -1
  112. package/dist/model/scheduleDateUtilsInput.d.ts +0 -12
  113. package/dist/model/scheduleDateUtilsInput.d.ts.map +0 -1
  114. package/dist/model/streamingUtilsInput.d.ts.map +0 -1
  115. package/model/onDemandDateUtilsInput.ts +0 -20
  116. package/model/scheduleDateUtilsInput.ts +0 -15
@@ -195,6 +195,14 @@ function createStatefulHost(host, status = 'up') {
195
195
  };
196
196
  }
197
197
 
198
+ function _defineProperty(e, r, t) {
199
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
200
+ value: t,
201
+ enumerable: !0,
202
+ configurable: !0,
203
+ writable: !0
204
+ }) : e[r] = t, e;
205
+ }
198
206
  function _toPrimitive(t, r) {
199
207
  if ("object" != typeof t || !t) return t;
200
208
  var e = t[Symbol.toPrimitive];
@@ -209,20 +217,6 @@ function _toPropertyKey(t) {
209
217
  var i = _toPrimitive(t, "string");
210
218
  return "symbol" == typeof i ? i : i + "";
211
219
  }
212
- function _defineProperty(obj, key, value) {
213
- key = _toPropertyKey(key);
214
- if (key in obj) {
215
- Object.defineProperty(obj, key, {
216
- value: value,
217
- enumerable: true,
218
- configurable: true,
219
- writable: true
220
- });
221
- } else {
222
- obj[key] = value;
223
- }
224
- return obj;
225
- }
226
220
 
227
221
  class AlgoliaError extends Error {
228
222
  constructor(message, name) {
@@ -243,7 +237,7 @@ class ErrorWithStackTrace extends AlgoliaError {
243
237
  }
244
238
  class RetryError extends ErrorWithStackTrace {
245
239
  constructor(stackTrace) {
246
- super('Unreachable hosts - your application id may be incorrect. If the error persists, please create a ticket at https://support.algolia.com/ sharing steps we can use to reproduce the issue.', stackTrace, 'RetryError');
240
+ super('Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.', stackTrace, 'RetryError');
247
241
  }
248
242
  }
249
243
  class ApiError extends ErrorWithStackTrace {
@@ -277,8 +271,7 @@ function serializeUrl(host, path, queryParameters) {
277
271
  return url;
278
272
  }
279
273
  function serializeQueryParameters(parameters) {
280
- const isObjectOrArray = value => Object.prototype.toString.call(value) === '[object Object]' || Object.prototype.toString.call(value) === '[object Array]';
281
- return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]).replaceAll('+', '%20')}`).join('&');
274
+ return Object.keys(parameters).filter(key => parameters[key] !== undefined).sort().map(key => `${key}=${encodeURIComponent(Object.prototype.toString.call(parameters[key]) === '[object Array]' ? parameters[key].join(',') : parameters[key]).replaceAll('+', '%20')}`).join('&');
282
275
  }
283
276
  function serializeData(request, requestOptions) {
284
277
  if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {
@@ -683,7 +676,7 @@ function createXhrRequester() {
683
676
  }
684
677
 
685
678
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
686
- const apiClientVersion = '1.0.0-beta.1';
679
+ const apiClientVersion = '1.0.0-beta.11';
687
680
  const REGIONS = ['eu', 'us'];
688
681
  function getDefaultHosts(region) {
689
682
  const url = 'data.{region}.algolia.com'.replace('{region}', region);
@@ -909,6 +902,34 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
909
902
  };
910
903
  return transporter.request(request, requestOptions);
911
904
  },
905
+ /**
906
+ * Creates a new transformation.
907
+ *
908
+ * @param transformationCreate - Request body for creating a transformation.
909
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
910
+ */
911
+ createTransformation(transformationCreate, requestOptions) {
912
+ if (!transformationCreate) {
913
+ throw new Error('Parameter `transformationCreate` is required when calling `createTransformation`.');
914
+ }
915
+ if (!transformationCreate.code) {
916
+ throw new Error('Parameter `transformationCreate.code` is required when calling `createTransformation`.');
917
+ }
918
+ if (!transformationCreate.name) {
919
+ throw new Error('Parameter `transformationCreate.name` is required when calling `createTransformation`.');
920
+ }
921
+ const requestPath = '/1/transformations';
922
+ const headers = {};
923
+ const queryParameters = {};
924
+ const request = {
925
+ method: 'POST',
926
+ path: requestPath,
927
+ queryParameters,
928
+ headers,
929
+ data: transformationCreate,
930
+ };
931
+ return transporter.request(request, requestOptions);
932
+ },
912
933
  /**
913
934
  * This method allow you to send requests to the Algolia REST API.
914
935
  *
@@ -1108,6 +1129,28 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1108
1129
  };
1109
1130
  return transporter.request(request, requestOptions);
1110
1131
  },
1132
+ /**
1133
+ * Deletes a transformation by its ID.
1134
+ *
1135
+ * @param deleteTransformation - The deleteTransformation object.
1136
+ * @param deleteTransformation.transformationID - Unique identifier of a transformation.
1137
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1138
+ */
1139
+ deleteTransformation({ transformationID }, requestOptions) {
1140
+ if (!transformationID) {
1141
+ throw new Error('Parameter `transformationID` is required when calling `deleteTransformation`.');
1142
+ }
1143
+ const requestPath = '/1/transformations/{transformationID}'.replace('{transformationID}', encodeURIComponent(transformationID));
1144
+ const headers = {};
1145
+ const queryParameters = {};
1146
+ const request = {
1147
+ method: 'DELETE',
1148
+ path: requestPath,
1149
+ queryParameters,
1150
+ headers,
1151
+ };
1152
+ return transporter.request(request, requestOptions);
1153
+ },
1111
1154
  /**
1112
1155
  * Disables a task.
1113
1156
  *
@@ -1310,33 +1353,6 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1310
1353
  };
1311
1354
  return transporter.request(request, requestOptions);
1312
1355
  },
1313
- /**
1314
- * Retrieves a stream listing for a source. Listing streams only works with sources with `type: docker` and `imageType: singer`.
1315
- *
1316
- * Required API Key ACLs:
1317
- * - addObject
1318
- * - deleteIndex
1319
- * - editSettings.
1320
- *
1321
- * @param getDockerSourceStreams - The getDockerSourceStreams object.
1322
- * @param getDockerSourceStreams.sourceID - Unique identifier of a source.
1323
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1324
- */
1325
- getDockerSourceStreams({ sourceID }, requestOptions) {
1326
- if (!sourceID) {
1327
- throw new Error('Parameter `sourceID` is required when calling `getDockerSourceStreams`.');
1328
- }
1329
- const requestPath = '/1/sources/{sourceID}/discover'.replace('{sourceID}', encodeURIComponent(sourceID));
1330
- const headers = {};
1331
- const queryParameters = {};
1332
- const request = {
1333
- method: 'GET',
1334
- path: requestPath,
1335
- queryParameters,
1336
- headers,
1337
- };
1338
- return transporter.request(request, requestOptions);
1339
- },
1340
1356
  /**
1341
1357
  * Retrieves a single task run event by its ID.
1342
1358
  *
@@ -1386,8 +1402,8 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1386
1402
  * @param getEvents.type - Event type for filtering the list of task runs.
1387
1403
  * @param getEvents.sort - Property by which to sort the list of task run events.
1388
1404
  * @param getEvents.order - Sort order of the response, ascending or descending.
1389
- * @param getEvents.startDate - Date and time in RFC3339 format for the earliest events to retrieve. By default, the current time minus three hours is used.
1390
- * @param getEvents.endDate - Date and time in RFC3339 format for the latest events to retrieve. By default, the current time is used.
1405
+ * @param getEvents.startDate - Date and time in RFC 3339 format for the earliest events to retrieve. By default, the current time minus three hours is used.
1406
+ * @param getEvents.endDate - Date and time in RFC 3339 format for the latest events to retrieve. By default, the current time is used.
1391
1407
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1392
1408
  */
1393
1409
  getEvents({ runID, itemsPerPage, page, status, type, sort, order, startDate, endDate, }, requestOptions) {
@@ -1471,8 +1487,8 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1471
1487
  * @param getRuns.taskID - Task ID for filtering the list of task runs.
1472
1488
  * @param getRuns.sort - Property by which to sort the list of task runs.
1473
1489
  * @param getRuns.order - Sort order of the response, ascending or descending.
1474
- * @param getRuns.startDate - Date in RFC3339 format for the earliest run to retrieve. By default, the current day minus seven days is used.
1475
- * @param getRuns.endDate - Date in RFC3339 format for the latest run to retrieve. By default, the current day is used.
1490
+ * @param getRuns.startDate - Date in RFC 3339 format for the earliest run to retrieve. By default, the current day minus seven days is used.
1491
+ * @param getRuns.endDate - Date in RFC 3339 format for the latest run to retrieve. By default, the current day is used.
1476
1492
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1477
1493
  */
1478
1494
  getRuns({ itemsPerPage, page, status, taskID, sort, order, startDate, endDate, } = {}, requestOptions = undefined) {
@@ -1671,6 +1687,64 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1671
1687
  };
1672
1688
  return transporter.request(request, requestOptions);
1673
1689
  },
1690
+ /**
1691
+ * Retrieves a transformation by its ID.
1692
+ *
1693
+ * Required API Key ACLs:
1694
+ * - addObject
1695
+ * - deleteIndex
1696
+ * - editSettings.
1697
+ *
1698
+ * @param getTransformation - The getTransformation object.
1699
+ * @param getTransformation.transformationID - Unique identifier of a transformation.
1700
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1701
+ */
1702
+ getTransformation({ transformationID }, requestOptions) {
1703
+ if (!transformationID) {
1704
+ throw new Error('Parameter `transformationID` is required when calling `getTransformation`.');
1705
+ }
1706
+ const requestPath = '/1/transformations/{transformationID}'.replace('{transformationID}', encodeURIComponent(transformationID));
1707
+ const headers = {};
1708
+ const queryParameters = {};
1709
+ const request = {
1710
+ method: 'GET',
1711
+ path: requestPath,
1712
+ queryParameters,
1713
+ headers,
1714
+ };
1715
+ return transporter.request(request, requestOptions);
1716
+ },
1717
+ /**
1718
+ * Retrieves a list of transformations.
1719
+ *
1720
+ * Required API Key ACLs:
1721
+ * - addObject
1722
+ * - deleteIndex
1723
+ * - editSettings.
1724
+ *
1725
+ * @param getTransformations - The getTransformations object.
1726
+ * @param getTransformations.sort - Property by which to sort the list.
1727
+ * @param getTransformations.order - Sort order of the response, ascending or descending.
1728
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1729
+ */
1730
+ getTransformations({ sort, order } = {}, requestOptions = undefined) {
1731
+ const requestPath = '/1/transformations';
1732
+ const headers = {};
1733
+ const queryParameters = {};
1734
+ if (sort !== undefined) {
1735
+ queryParameters.sort = sort.toString();
1736
+ }
1737
+ if (order !== undefined) {
1738
+ queryParameters.order = order.toString();
1739
+ }
1740
+ const request = {
1741
+ method: 'GET',
1742
+ path: requestPath,
1743
+ queryParameters,
1744
+ headers,
1745
+ };
1746
+ return transporter.request(request, requestOptions);
1747
+ },
1674
1748
  /**
1675
1749
  * Runs a task. You can check the status of task runs with the observability endpoints.
1676
1750
  *
@@ -1818,6 +1892,36 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1818
1892
  };
1819
1893
  return transporter.request(request, requestOptions);
1820
1894
  },
1895
+ /**
1896
+ * Searches for transformations.
1897
+ *
1898
+ * Required API Key ACLs:
1899
+ * - addObject
1900
+ * - deleteIndex
1901
+ * - editSettings.
1902
+ *
1903
+ * @param transformationSearch - The transformationSearch object.
1904
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1905
+ */
1906
+ searchTransformations(transformationSearch, requestOptions) {
1907
+ if (!transformationSearch) {
1908
+ throw new Error('Parameter `transformationSearch` is required when calling `searchTransformations`.');
1909
+ }
1910
+ if (!transformationSearch.transformationsIDs) {
1911
+ throw new Error('Parameter `transformationSearch.transformationsIDs` is required when calling `searchTransformations`.');
1912
+ }
1913
+ const requestPath = '/1/transformations/search';
1914
+ const headers = {};
1915
+ const queryParameters = {};
1916
+ const request = {
1917
+ method: 'POST',
1918
+ path: requestPath,
1919
+ queryParameters,
1920
+ headers,
1921
+ data: transformationSearch,
1922
+ };
1923
+ return transporter.request(request, requestOptions);
1924
+ },
1821
1925
  /**
1822
1926
  * Triggers a stream-listing request for a source. Triggering stream-listing requests only works with sources with `type: docker` and `imageType: singer`.
1823
1927
  *
@@ -1845,6 +1949,39 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1845
1949
  };
1846
1950
  return transporter.request(request, requestOptions);
1847
1951
  },
1952
+ /**
1953
+ * Try a transformation.
1954
+ *
1955
+ * Required API Key ACLs:
1956
+ * - addObject
1957
+ * - deleteIndex
1958
+ * - editSettings.
1959
+ *
1960
+ * @param transformationTry - The transformationTry object.
1961
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1962
+ */
1963
+ tryTransformations(transformationTry, requestOptions) {
1964
+ if (!transformationTry) {
1965
+ throw new Error('Parameter `transformationTry` is required when calling `tryTransformations`.');
1966
+ }
1967
+ if (!transformationTry.code) {
1968
+ throw new Error('Parameter `transformationTry.code` is required when calling `tryTransformations`.');
1969
+ }
1970
+ if (!transformationTry.sampleRecord) {
1971
+ throw new Error('Parameter `transformationTry.sampleRecord` is required when calling `tryTransformations`.');
1972
+ }
1973
+ const requestPath = '/1/transformations/try';
1974
+ const headers = {};
1975
+ const queryParameters = {};
1976
+ const request = {
1977
+ method: 'POST',
1978
+ path: requestPath,
1979
+ queryParameters,
1980
+ headers,
1981
+ data: transformationTry,
1982
+ };
1983
+ return transporter.request(request, requestOptions);
1984
+ },
1848
1985
  /**
1849
1986
  * Updates an authentication resource.
1850
1987
  *
@@ -1968,6 +2105,95 @@ function createIngestionClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1968
2105
  };
1969
2106
  return transporter.request(request, requestOptions);
1970
2107
  },
2108
+ /**
2109
+ * Updates a transformation by its ID.
2110
+ *
2111
+ * @param updateTransformation - The updateTransformation object.
2112
+ * @param updateTransformation.transformationID - Unique identifier of a transformation.
2113
+ * @param updateTransformation.transformationCreate - The transformationCreate object.
2114
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2115
+ */
2116
+ updateTransformation({ transformationID, transformationCreate }, requestOptions) {
2117
+ if (!transformationID) {
2118
+ throw new Error('Parameter `transformationID` is required when calling `updateTransformation`.');
2119
+ }
2120
+ if (!transformationCreate) {
2121
+ throw new Error('Parameter `transformationCreate` is required when calling `updateTransformation`.');
2122
+ }
2123
+ if (!transformationCreate.code) {
2124
+ throw new Error('Parameter `transformationCreate.code` is required when calling `updateTransformation`.');
2125
+ }
2126
+ if (!transformationCreate.name) {
2127
+ throw new Error('Parameter `transformationCreate.name` is required when calling `updateTransformation`.');
2128
+ }
2129
+ const requestPath = '/1/transformations/{transformationID}'.replace('{transformationID}', encodeURIComponent(transformationID));
2130
+ const headers = {};
2131
+ const queryParameters = {};
2132
+ const request = {
2133
+ method: 'PUT',
2134
+ path: requestPath,
2135
+ queryParameters,
2136
+ headers,
2137
+ data: transformationCreate,
2138
+ };
2139
+ return transporter.request(request, requestOptions);
2140
+ },
2141
+ /**
2142
+ * Validates a source payload to ensure it can be created and that the data source can be reached by Algolia.
2143
+ *
2144
+ * Required API Key ACLs:
2145
+ * - addObject
2146
+ * - deleteIndex
2147
+ * - editSettings.
2148
+ *
2149
+ * @param sourceCreate -.
2150
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2151
+ */
2152
+ validateSource(sourceCreate, requestOptions = undefined) {
2153
+ const requestPath = '/1/sources/validate';
2154
+ const headers = {};
2155
+ const queryParameters = {};
2156
+ const request = {
2157
+ method: 'POST',
2158
+ path: requestPath,
2159
+ queryParameters,
2160
+ headers,
2161
+ data: sourceCreate ? sourceCreate : {},
2162
+ };
2163
+ return transporter.request(request, requestOptions);
2164
+ },
2165
+ /**
2166
+ * Validates an update of a source payload to ensure it can be created and that the data source can be reached by Algolia.
2167
+ *
2168
+ * Required API Key ACLs:
2169
+ * - addObject
2170
+ * - deleteIndex
2171
+ * - editSettings.
2172
+ *
2173
+ * @param validateSourceBeforeUpdate - The validateSourceBeforeUpdate object.
2174
+ * @param validateSourceBeforeUpdate.sourceID - Unique identifier of a source.
2175
+ * @param validateSourceBeforeUpdate.sourceUpdate - The sourceUpdate object.
2176
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2177
+ */
2178
+ validateSourceBeforeUpdate({ sourceID, sourceUpdate }, requestOptions) {
2179
+ if (!sourceID) {
2180
+ throw new Error('Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.');
2181
+ }
2182
+ if (!sourceUpdate) {
2183
+ throw new Error('Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.');
2184
+ }
2185
+ const requestPath = '/1/sources/{sourceID}/validate'.replace('{sourceID}', encodeURIComponent(sourceID));
2186
+ const headers = {};
2187
+ const queryParameters = {};
2188
+ const request = {
2189
+ method: 'POST',
2190
+ path: requestPath,
2191
+ queryParameters,
2192
+ headers,
2193
+ data: sourceUpdate,
2194
+ };
2195
+ return transporter.request(request, requestOptions);
2196
+ },
1971
2197
  };
1972
2198
  }
1973
2199