algoliasearch 5.1.0 → 5.2.1
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.
- package/README.md +2 -2
- package/builds/browser.ts +15 -48
- package/builds/models.ts +2 -2
- package/builds/node.ts +19 -58
- package/dist/algoliasearch/builds/browser.d.ts +13 -13
- package/dist/algoliasearch/builds/browser.d.ts.map +1 -1
- package/dist/algoliasearch/builds/models.d.ts +2 -2
- package/dist/algoliasearch/builds/models.d.ts.map +1 -1
- package/dist/algoliasearch/builds/node.d.ts +15 -15
- package/dist/algoliasearch/builds/node.d.ts.map +1 -1
- package/dist/algoliasearch.cjs +40 -70
- package/dist/algoliasearch.esm.browser.js +46 -75
- package/dist/algoliasearch.esm.node.js +40 -70
- package/dist/algoliasearch.umd.js +2 -2
- package/dist/client-abtesting/model/aBTest.d.ts +5 -5
- package/dist/client-abtesting/model/aBTest.d.ts.map +1 -1
- package/dist/client-abtesting/model/clientMethodProps.d.ts +2 -2
- package/dist/client-abtesting/model/clientMethodProps.d.ts.map +1 -1
- package/dist/client-abtesting/model/customSearchParams.d.ts +1 -1
- package/dist/client-abtesting/model/customSearchParams.d.ts.map +1 -1
- package/dist/client-abtesting/model/effect.d.ts.map +1 -1
- package/dist/client-abtesting/model/variant.d.ts +5 -5
- package/dist/client-abtesting/model/variant.d.ts.map +1 -1
- package/dist/client-abtesting/src/abtestingClient.d.ts +5 -5
- package/dist/client-abtesting/src/abtestingClient.d.ts.map +1 -1
- package/dist/client-analytics/model/clientMethodProps.d.ts +2 -2
- package/dist/client-analytics/model/clientMethodProps.d.ts.map +1 -1
- package/dist/client-analytics/model/{currenciesValue.d.ts → currencyCode.d.ts} +2 -2
- package/dist/client-analytics/model/currencyCode.d.ts.map +1 -0
- package/dist/client-analytics/model/dailyRevenue.d.ts +2 -2
- package/dist/client-analytics/model/dailyRevenue.d.ts.map +1 -1
- package/dist/client-analytics/model/getRevenue.d.ts +2 -2
- package/dist/client-analytics/model/getRevenue.d.ts.map +1 -1
- package/dist/client-analytics/model/getTopHitsResponse.d.ts.map +1 -1
- package/dist/client-analytics/model/index.d.ts +1 -1
- package/dist/client-analytics/model/index.d.ts.map +1 -1
- package/dist/client-analytics/model/orderBy.d.ts.map +1 -1
- package/dist/client-analytics/model/topHitWithRevenueAnalytics.d.ts +2 -2
- package/dist/client-analytics/model/topHitWithRevenueAnalytics.d.ts.map +1 -1
- package/dist/client-analytics/model/topSearchWithRevenueAnalytics.d.ts +2 -2
- package/dist/client-analytics/model/topSearchWithRevenueAnalytics.d.ts.map +1 -1
- package/dist/client-analytics/src/analyticsClient.d.ts +11 -11
- package/dist/client-analytics/src/analyticsClient.d.ts.map +1 -1
- package/dist/client-personalization/model/clientMethodProps.d.ts +2 -2
- package/dist/client-personalization/model/clientMethodProps.d.ts.map +1 -1
- package/dist/client-personalization/model/getUserTokenResponse.d.ts +1 -1
- package/dist/client-personalization/model/getUserTokenResponse.d.ts.map +1 -1
- package/dist/client-personalization/src/personalizationClient.d.ts +5 -5
- package/dist/client-personalization/src/personalizationClient.d.ts.map +1 -1
- package/dist/client-search/model/alternativesAsExact.d.ts.map +1 -1
- package/dist/client-search/model/baseIndexSettings.d.ts +2 -2
- package/dist/client-search/model/baseIndexSettings.d.ts.map +1 -1
- package/dist/client-search/model/baseSearchResponse.d.ts +4 -4
- package/dist/client-search/model/baseSearchResponse.d.ts.map +1 -1
- package/dist/client-search/model/batchRequest.d.ts +1 -1
- package/dist/client-search/model/batchRequest.d.ts.map +1 -1
- package/dist/client-search/model/browseResponse.d.ts.map +1 -1
- package/dist/client-search/model/clientMethodProps.d.ts +5 -6
- package/dist/client-search/model/clientMethodProps.d.ts.map +1 -1
- package/dist/client-search/model/consequenceParams.d.ts.map +1 -1
- package/dist/{lite/model/facetsStats.d.ts → client-search/model/facetStats.d.ts} +2 -2
- package/dist/client-search/model/facetStats.d.ts.map +1 -0
- package/dist/client-search/model/index.d.ts +1 -1
- package/dist/client-search/model/index.d.ts.map +1 -1
- package/dist/client-search/model/multipleBatchRequest.d.ts +1 -1
- package/dist/client-search/model/multipleBatchRequest.d.ts.map +1 -1
- package/dist/client-search/model/removeWordsIfNoResults.d.ts.map +1 -1
- package/dist/client-search/model/searchResponse.d.ts.map +1 -1
- package/dist/client-search/model/searchResult.d.ts.map +1 -1
- package/dist/client-search/model/synonymType.d.ts.map +1 -1
- package/dist/client-search/src/searchClient.d.ts +16 -16
- package/dist/client-search/src/searchClient.d.ts.map +1 -1
- package/dist/lite/builds/browser.d.ts +1 -1
- package/dist/lite/builds/browser.d.ts.map +1 -1
- package/dist/lite/builds/node.d.ts +1 -1
- package/dist/lite/builds/node.d.ts.map +1 -1
- package/dist/lite/lite.cjs +2 -5
- package/dist/lite/lite.esm.browser.js +11 -15
- package/dist/lite/lite.esm.node.js +2 -5
- package/dist/lite/lite.umd.js +2 -2
- package/dist/lite/model/alternativesAsExact.d.ts.map +1 -1
- package/dist/lite/model/baseIndexSettings.d.ts +2 -2
- package/dist/lite/model/baseIndexSettings.d.ts.map +1 -1
- package/dist/lite/model/baseSearchResponse.d.ts +4 -4
- package/dist/lite/model/baseSearchResponse.d.ts.map +1 -1
- package/dist/lite/model/boughtTogetherQuery.d.ts.map +1 -1
- package/dist/lite/model/browseResponse.d.ts.map +1 -1
- package/dist/lite/model/clientMethodProps.d.ts +1 -1
- package/dist/lite/model/clientMethodProps.d.ts.map +1 -1
- package/dist/lite/model/consequenceParams.d.ts.map +1 -1
- package/dist/{client-search/model/facetsStats.d.ts → lite/model/facetStats.d.ts} +2 -2
- package/dist/lite/model/facetStats.d.ts.map +1 -0
- package/dist/lite/model/fallbackParams.d.ts +1 -1
- package/dist/lite/model/fallbackParams.d.ts.map +1 -1
- package/dist/lite/model/index.d.ts +1 -1
- package/dist/lite/model/index.d.ts.map +1 -1
- package/dist/lite/model/recommendationsResults.d.ts.map +1 -1
- package/dist/lite/model/removeWordsIfNoResults.d.ts.map +1 -1
- package/dist/lite/model/searchParams.d.ts +1 -1
- package/dist/lite/model/searchParams.d.ts.map +1 -1
- package/dist/lite/model/searchResponse.d.ts.map +1 -1
- package/dist/lite/model/searchResult.d.ts.map +1 -1
- package/dist/lite/src/liteClient.d.ts +2 -2
- package/dist/lite/src/liteClient.d.ts.map +1 -1
- package/dist/recommend/model/alternativesAsExact.d.ts.map +1 -1
- package/dist/recommend/model/baseSearchResponse.d.ts +4 -4
- package/dist/recommend/model/baseSearchResponse.d.ts.map +1 -1
- package/dist/recommend/model/boughtTogetherQuery.d.ts.map +1 -1
- package/dist/recommend/model/clientMethodProps.d.ts +2 -2
- package/dist/recommend/model/clientMethodProps.d.ts.map +1 -1
- package/dist/recommend/model/{facetsStats.d.ts → facetStats.d.ts} +2 -2
- package/dist/recommend/model/facetStats.d.ts.map +1 -0
- package/dist/recommend/model/fallbackParams.d.ts +1 -1
- package/dist/recommend/model/fallbackParams.d.ts.map +1 -1
- package/dist/recommend/model/index.d.ts +1 -1
- package/dist/recommend/model/index.d.ts.map +1 -1
- package/dist/recommend/model/recommendModels.d.ts.map +1 -1
- package/dist/recommend/model/recommendationsResults.d.ts.map +1 -1
- package/dist/recommend/model/removeWordsIfNoResults.d.ts.map +1 -1
- package/dist/recommend/model/searchParams.d.ts +1 -1
- package/dist/recommend/model/searchParams.d.ts.map +1 -1
- package/dist/recommend/src/recommendClient.d.ts +6 -6
- package/dist/recommend/src/recommendClient.d.ts.map +1 -1
- package/lite/builds/browser.ts +2 -9
- package/lite/builds/node.ts +1 -5
- package/lite/model/alternativesAsExact.ts +1 -4
- package/lite/model/baseIndexSettings.ts +2 -2
- package/lite/model/baseSearchResponse.ts +4 -4
- package/lite/model/boughtTogetherQuery.ts +1 -2
- package/lite/model/browseResponse.ts +1 -4
- package/lite/model/clientMethodProps.ts +1 -1
- package/lite/model/consequenceParams.ts +1 -3
- package/lite/model/{facetsStats.ts → facetStats.ts} +1 -1
- package/lite/model/fallbackParams.ts +1 -1
- package/lite/model/index.ts +1 -1
- package/lite/model/recommendationsResults.ts +1 -3
- package/lite/model/removeWordsIfNoResults.ts +1 -5
- package/lite/model/searchParams.ts +1 -1
- package/lite/model/searchResponse.ts +1 -3
- package/lite/model/searchResult.ts +1 -3
- package/lite/src/liteClient.ts +17 -40
- package/package.json +20 -16
- package/dist/client-analytics/model/currenciesValue.d.ts.map +0 -1
- package/dist/client-search/model/facetsStats.d.ts.map +0 -1
- package/dist/lite/model/facetsStats.d.ts.map +0 -1
- package/dist/recommend/model/facetsStats.d.ts.map +0 -1
|
@@ -3,12 +3,10 @@ import { createAuth, createTransporter, getAlgoliaAgent, createIterablePromise,
|
|
|
3
3
|
import { createHttpRequester } from '@algolia/requester-node-http';
|
|
4
4
|
|
|
5
5
|
// 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.
|
|
6
|
-
const apiClientVersion$5 = '5.1
|
|
6
|
+
const apiClientVersion$5 = '5.2.1';
|
|
7
7
|
const REGIONS$2 = ['de', 'us'];
|
|
8
8
|
function getDefaultHosts$4(region) {
|
|
9
|
-
const url = !region
|
|
10
|
-
? 'analytics.algolia.com'
|
|
11
|
-
: 'analytics.{region}.algolia.com'.replace('{region}', region);
|
|
9
|
+
const url = !region ? 'analytics.algolia.com' : 'analytics.{region}.algolia.com'.replace('{region}', region);
|
|
12
10
|
return [{ url, accept: 'readWrite', protocol: 'https' }];
|
|
13
11
|
}
|
|
14
12
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
@@ -42,10 +40,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
42
40
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
43
41
|
*/
|
|
44
42
|
clearCache() {
|
|
45
|
-
return Promise.all([
|
|
46
|
-
transporter.requestsCache.clear(),
|
|
47
|
-
transporter.responsesCache.clear(),
|
|
48
|
-
]).then(() => undefined);
|
|
43
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
49
44
|
},
|
|
50
45
|
/**
|
|
51
46
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -345,12 +340,10 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
345
340
|
}
|
|
346
341
|
|
|
347
342
|
// 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.
|
|
348
|
-
const apiClientVersion$4 = '5.1
|
|
343
|
+
const apiClientVersion$4 = '5.2.1';
|
|
349
344
|
const REGIONS$1 = ['de', 'us'];
|
|
350
345
|
function getDefaultHosts$3(region) {
|
|
351
|
-
const url = !region
|
|
352
|
-
? 'analytics.algolia.com'
|
|
353
|
-
: 'analytics.{region}.algolia.com'.replace('{region}', region);
|
|
346
|
+
const url = !region ? 'analytics.algolia.com' : 'analytics.{region}.algolia.com'.replace('{region}', region);
|
|
354
347
|
return [{ url, accept: 'readWrite', protocol: 'https' }];
|
|
355
348
|
}
|
|
356
349
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
@@ -384,10 +377,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
384
377
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
385
378
|
*/
|
|
386
379
|
clearCache() {
|
|
387
|
-
return Promise.all([
|
|
388
|
-
transporter.requestsCache.clear(),
|
|
389
|
-
transporter.responsesCache.clear(),
|
|
390
|
-
]).then(() => undefined);
|
|
380
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
391
381
|
},
|
|
392
382
|
/**
|
|
393
383
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -915,7 +905,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
915
905
|
* @param getSearchesNoClicks.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
|
|
916
906
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
917
907
|
*/
|
|
918
|
-
getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags
|
|
908
|
+
getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
919
909
|
if (!index) {
|
|
920
910
|
throw new Error('Parameter `index` is required when calling `getSearchesNoClicks`.');
|
|
921
911
|
}
|
|
@@ -963,7 +953,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
963
953
|
* @param getSearchesNoResults.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
|
|
964
954
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
965
955
|
*/
|
|
966
|
-
getSearchesNoResults({ index, startDate, endDate, limit, offset, tags
|
|
956
|
+
getSearchesNoResults({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
967
957
|
if (!index) {
|
|
968
958
|
throw new Error('Parameter `index` is required when calling `getSearchesNoResults`.');
|
|
969
959
|
}
|
|
@@ -1088,7 +1078,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1088
1078
|
* @param getTopFilterAttributes.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
|
|
1089
1079
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1090
1080
|
*/
|
|
1091
|
-
getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags
|
|
1081
|
+
getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
1092
1082
|
if (!index) {
|
|
1093
1083
|
throw new Error('Parameter `index` is required when calling `getTopFilterAttributes`.');
|
|
1094
1084
|
}
|
|
@@ -1141,7 +1131,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1141
1131
|
* @param getTopFilterForAttribute.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
|
|
1142
1132
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1143
1133
|
*/
|
|
1144
|
-
getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags
|
|
1134
|
+
getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
1145
1135
|
if (!attribute) {
|
|
1146
1136
|
throw new Error('Parameter `attribute` is required when calling `getTopFilterForAttribute`.');
|
|
1147
1137
|
}
|
|
@@ -1196,7 +1186,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1196
1186
|
* @param getTopFiltersNoResults.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
|
|
1197
1187
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1198
1188
|
*/
|
|
1199
|
-
getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags
|
|
1189
|
+
getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
1200
1190
|
if (!index) {
|
|
1201
1191
|
throw new Error('Parameter `index` is required when calling `getTopFiltersNoResults`.');
|
|
1202
1192
|
}
|
|
@@ -1250,7 +1240,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1250
1240
|
* @param getTopHits.tags - Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/).
|
|
1251
1241
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1252
1242
|
*/
|
|
1253
|
-
getTopHits({ index, search, clickAnalytics, revenueAnalytics, startDate, endDate, limit, offset, tags
|
|
1243
|
+
getTopHits({ index, search, clickAnalytics, revenueAnalytics, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
1254
1244
|
if (!index) {
|
|
1255
1245
|
throw new Error('Parameter `index` is required when calling `getTopHits`.');
|
|
1256
1246
|
}
|
|
@@ -1400,7 +1390,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1400
1390
|
}
|
|
1401
1391
|
|
|
1402
1392
|
// 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.
|
|
1403
|
-
const apiClientVersion$3 = '5.1
|
|
1393
|
+
const apiClientVersion$3 = '5.2.1';
|
|
1404
1394
|
const REGIONS = ['eu', 'us'];
|
|
1405
1395
|
function getDefaultHosts$2(region) {
|
|
1406
1396
|
const url = 'personalization.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -1437,10 +1427,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
1437
1427
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
1438
1428
|
*/
|
|
1439
1429
|
clearCache() {
|
|
1440
|
-
return Promise.all([
|
|
1441
|
-
transporter.requestsCache.clear(),
|
|
1442
|
-
transporter.responsesCache.clear(),
|
|
1443
|
-
]).then(() => undefined);
|
|
1430
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
1444
1431
|
},
|
|
1445
1432
|
/**
|
|
1446
1433
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -1661,7 +1648,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
1661
1648
|
}
|
|
1662
1649
|
|
|
1663
1650
|
// 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.
|
|
1664
|
-
const apiClientVersion$2 = '5.1
|
|
1651
|
+
const apiClientVersion$2 = '5.2.1';
|
|
1665
1652
|
function getDefaultHosts$1(appId) {
|
|
1666
1653
|
return [
|
|
1667
1654
|
{
|
|
@@ -1723,10 +1710,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1723
1710
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
1724
1711
|
*/
|
|
1725
1712
|
clearCache() {
|
|
1726
|
-
return Promise.all([
|
|
1727
|
-
transporter.requestsCache.clear(),
|
|
1728
|
-
transporter.responsesCache.clear(),
|
|
1729
|
-
]).then(() => undefined);
|
|
1713
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
1730
1714
|
},
|
|
1731
1715
|
/**
|
|
1732
1716
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -1824,8 +1808,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1824
1808
|
const value = apiKey[field];
|
|
1825
1809
|
const resValue = response[field];
|
|
1826
1810
|
if (Array.isArray(value) && Array.isArray(resValue)) {
|
|
1827
|
-
if (value.length !== resValue.length ||
|
|
1828
|
-
value.some((v, index) => v !== resValue[index])) {
|
|
1811
|
+
if (value.length !== resValue.length || value.some((v, index) => v !== resValue[index])) {
|
|
1829
1812
|
return false;
|
|
1830
1813
|
}
|
|
1831
1814
|
}
|
|
@@ -1845,7 +1828,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1845
1828
|
}
|
|
1846
1829
|
throw error;
|
|
1847
1830
|
}),
|
|
1848
|
-
validate: (response) => operation === 'add' ? response !== undefined : response === undefined,
|
|
1831
|
+
validate: (response) => (operation === 'add' ? response !== undefined : response === undefined),
|
|
1849
1832
|
});
|
|
1850
1833
|
},
|
|
1851
1834
|
/**
|
|
@@ -1896,9 +1879,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1896
1879
|
indexName,
|
|
1897
1880
|
searchRulesParams: {
|
|
1898
1881
|
...params,
|
|
1899
|
-
page: previousResponse
|
|
1900
|
-
? previousResponse.page + 1
|
|
1901
|
-
: params.page || 0,
|
|
1882
|
+
page: previousResponse ? previousResponse.page + 1 : params.page || 0,
|
|
1902
1883
|
},
|
|
1903
1884
|
}, requestOptions);
|
|
1904
1885
|
},
|
|
@@ -1951,7 +1932,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1951
1932
|
* @param chunkedBatch.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
|
|
1952
1933
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
1953
1934
|
*/
|
|
1954
|
-
async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000
|
|
1935
|
+
async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000 }, requestOptions) {
|
|
1955
1936
|
let requests = [];
|
|
1956
1937
|
const responses = [];
|
|
1957
1938
|
const objectEntries = objects.entries();
|
|
@@ -2011,9 +1992,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2011
1992
|
return await this.chunkedBatch({
|
|
2012
1993
|
indexName,
|
|
2013
1994
|
objects,
|
|
2014
|
-
action: createIfNotExists
|
|
2015
|
-
? 'partialUpdateObject'
|
|
2016
|
-
: 'partialUpdateObjectNoCreate',
|
|
1995
|
+
action: createIfNotExists ? 'partialUpdateObject' : 'partialUpdateObjectNoCreate',
|
|
2017
1996
|
}, requestOptions);
|
|
2018
1997
|
},
|
|
2019
1998
|
/**
|
|
@@ -2295,7 +2274,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2295
2274
|
* @param batchDictionaryEntries.batchDictionaryEntriesParams - The batchDictionaryEntriesParams object.
|
|
2296
2275
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2297
2276
|
*/
|
|
2298
|
-
batchDictionaryEntries({ dictionaryName, batchDictionaryEntriesParams
|
|
2277
|
+
batchDictionaryEntries({ dictionaryName, batchDictionaryEntriesParams }, requestOptions) {
|
|
2299
2278
|
if (!dictionaryName) {
|
|
2300
2279
|
throw new Error('Parameter `dictionaryName` is required when calling `batchDictionaryEntries`.');
|
|
2301
2280
|
}
|
|
@@ -2549,7 +2528,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2549
2528
|
return transporter.request(request, requestOptions);
|
|
2550
2529
|
},
|
|
2551
2530
|
/**
|
|
2552
|
-
* This operation doesn\'t accept empty queries or filters. It\'s more efficient to get a list of object IDs with the [`browse` operation](#tag/Search/operation/browse), and then delete the records using the [`batch` operation](tag/Records/operation/batch).
|
|
2531
|
+
* This operation doesn\'t accept empty queries or filters. It\'s more efficient to get a list of object IDs with the [`browse` operation](#tag/Search/operation/browse), and then delete the records using the [`batch` operation](#tag/Records/operation/batch).
|
|
2553
2532
|
*
|
|
2554
2533
|
* Required API Key ACLs:
|
|
2555
2534
|
* - deleteIndex.
|
|
@@ -3286,7 +3265,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3286
3265
|
return transporter.request(request, requestOptions);
|
|
3287
3266
|
},
|
|
3288
3267
|
/**
|
|
3289
|
-
* Adds new attributes to a record, or update existing ones. - If a record with the specified object ID doesn\'t exist, a new record is added to the index **if** `createIfNotExists` is true. - If the index doesn\'t exist yet, this method creates a new index. - You can use any first-level attribute but not nested attributes. If you specify a nested attribute, the engine treats it as a replacement for its first-level ancestor.
|
|
3268
|
+
* Adds new attributes to a record, or update existing ones. - If a record with the specified object ID doesn\'t exist, a new record is added to the index **if** `createIfNotExists` is true. - If the index doesn\'t exist yet, this method creates a new index. - You can use any first-level attribute but not nested attributes. If you specify a nested attribute, the engine treats it as a replacement for its first-level ancestor. To update an attribute without pushing the entire record, you can use these built-in operations. These operations can be helpful if you don\'t have access to your initial data. - Increment: increment a numeric attribute - Decrement: decrement a numeric attribute - Add: append a number or string element to an array attribute - Remove: remove all matching number or string elements from an array attribute made of numbers or strings - AddUnique: add a number or string element to an array attribute made of numbers or strings only if it\'s not already present - IncrementFrom: increment a numeric integer attribute only if the provided value matches the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementFrom value of 2 for the version attribute, but the current value of the attribute is 1, the engine ignores the update. If the object doesn\'t exist, the engine only creates it if you pass an IncrementFrom value of 0. - IncrementSet: increment a numeric integer attribute only if the provided value is greater than the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementSet value of 2 for the version attribute, and the current value of the attribute is 1, the engine updates the object. If the object doesn\'t exist yet, the engine only creates it if you pass an IncrementSet value that\'s greater than 0. You can specify an operation by providing an object with the attribute to update as the key and its value being an object with the following properties: - _operation: the operation to apply on the attribute - value: the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove.
|
|
3290
3269
|
*
|
|
3291
3270
|
* Required API Key ACLs:
|
|
3292
3271
|
* - addObject.
|
|
@@ -3298,7 +3277,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3298
3277
|
* @param partialUpdateObject.createIfNotExists - Whether to create a new record if it doesn\'t exist.
|
|
3299
3278
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3300
3279
|
*/
|
|
3301
|
-
partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists
|
|
3280
|
+
partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists }, requestOptions) {
|
|
3302
3281
|
if (!indexName) {
|
|
3303
3282
|
throw new Error('Parameter `indexName` is required when calling `partialUpdateObject`.');
|
|
3304
3283
|
}
|
|
@@ -3402,7 +3381,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3402
3381
|
return transporter.request(request, requestOptions);
|
|
3403
3382
|
},
|
|
3404
3383
|
/**
|
|
3405
|
-
* Adds a record to an index or replace it. - If the record doesn\'t have an object ID, a new record with an auto-generated object ID is added to your index. - If a record with the specified object ID exists, the existing record is replaced. - If a record with the specified object ID doesn\'t exist, a new record is added to your index. - If you add a record to an index that doesn\'t exist yet, a new index is created. To update _some_ attributes of a record, use the [`partial` operation](#tag/Records/operation/
|
|
3384
|
+
* Adds a record to an index or replace it. - If the record doesn\'t have an object ID, a new record with an auto-generated object ID is added to your index. - If a record with the specified object ID exists, the existing record is replaced. - If a record with the specified object ID doesn\'t exist, a new record is added to your index. - If you add a record to an index that doesn\'t exist yet, a new index is created. To update _some_ attributes of a record, use the [`partial` operation](#tag/Records/operation/partialUpdateObject). To add, update, or replace multiple records, use the [`batch` operation](#tag/Records/operation/batch).
|
|
3406
3385
|
*
|
|
3407
3386
|
* Required API Key ACLs:
|
|
3408
3387
|
* - addObject.
|
|
@@ -3487,7 +3466,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3487
3466
|
* @param saveRules.clearExistingRules - Whether existing rules should be deleted before adding this batch.
|
|
3488
3467
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3489
3468
|
*/
|
|
3490
|
-
saveRules({ indexName, rules, forwardToReplicas, clearExistingRules
|
|
3469
|
+
saveRules({ indexName, rules, forwardToReplicas, clearExistingRules }, requestOptions) {
|
|
3491
3470
|
if (!indexName) {
|
|
3492
3471
|
throw new Error('Parameter `indexName` is required when calling `saveRules`.');
|
|
3493
3472
|
}
|
|
@@ -3571,7 +3550,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3571
3550
|
* @param saveSynonyms.replaceExistingSynonyms - Whether to replace all synonyms in the index with the ones sent with this request.
|
|
3572
3551
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3573
3552
|
*/
|
|
3574
|
-
saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms
|
|
3553
|
+
saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms }, requestOptions) {
|
|
3575
3554
|
if (!indexName) {
|
|
3576
3555
|
throw new Error('Parameter `indexName` is required when calling `saveSynonyms`.');
|
|
3577
3556
|
}
|
|
@@ -3585,8 +3564,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3585
3564
|
queryParameters.forwardToReplicas = forwardToReplicas.toString();
|
|
3586
3565
|
}
|
|
3587
3566
|
if (replaceExistingSynonyms !== undefined) {
|
|
3588
|
-
queryParameters.replaceExistingSynonyms =
|
|
3589
|
-
replaceExistingSynonyms.toString();
|
|
3567
|
+
queryParameters.replaceExistingSynonyms = replaceExistingSynonyms.toString();
|
|
3590
3568
|
}
|
|
3591
3569
|
const request = {
|
|
3592
3570
|
method: 'POST',
|
|
@@ -3660,7 +3638,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3660
3638
|
* @param searchDictionaryEntries.searchDictionaryEntriesParams - The searchDictionaryEntriesParams object.
|
|
3661
3639
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3662
3640
|
*/
|
|
3663
|
-
searchDictionaryEntries({ dictionaryName, searchDictionaryEntriesParams
|
|
3641
|
+
searchDictionaryEntries({ dictionaryName, searchDictionaryEntriesParams }, requestOptions) {
|
|
3664
3642
|
if (!dictionaryName) {
|
|
3665
3643
|
throw new Error('Parameter `dictionaryName` is required when calling `searchDictionaryEntries`.');
|
|
3666
3644
|
}
|
|
@@ -3696,7 +3674,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3696
3674
|
* @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.
|
|
3697
3675
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3698
3676
|
*/
|
|
3699
|
-
searchForFacetValues({ indexName, facetName, searchForFacetValuesRequest
|
|
3677
|
+
searchForFacetValues({ indexName, facetName, searchForFacetValuesRequest }, requestOptions) {
|
|
3700
3678
|
if (!indexName) {
|
|
3701
3679
|
throw new Error('Parameter `indexName` is required when calling `searchForFacetValues`.');
|
|
3702
3680
|
}
|
|
@@ -3935,7 +3913,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3935
3913
|
}
|
|
3936
3914
|
|
|
3937
3915
|
// 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.
|
|
3938
|
-
const apiClientVersion$1 = '5.1
|
|
3916
|
+
const apiClientVersion$1 = '5.2.1';
|
|
3939
3917
|
function getDefaultHosts(appId) {
|
|
3940
3918
|
return [
|
|
3941
3919
|
{
|
|
@@ -3997,10 +3975,7 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
3997
3975
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
3998
3976
|
*/
|
|
3999
3977
|
clearCache() {
|
|
4000
|
-
return Promise.all([
|
|
4001
|
-
transporter.requestsCache.clear(),
|
|
4002
|
-
transporter.responsesCache.clear(),
|
|
4003
|
-
]).then(() => undefined);
|
|
3978
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
4004
3979
|
},
|
|
4005
3980
|
/**
|
|
4006
3981
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -4270,7 +4245,7 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
4270
4245
|
* @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
|
|
4271
4246
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4272
4247
|
*/
|
|
4273
|
-
searchRecommendRules({ indexName, model, searchRecommendRulesParams
|
|
4248
|
+
searchRecommendRules({ indexName, model, searchRecommendRulesParams }, requestOptions) {
|
|
4274
4249
|
if (!indexName) {
|
|
4275
4250
|
throw new Error('Parameter `indexName` is required when calling `searchRecommendRules`.');
|
|
4276
4251
|
}
|
|
@@ -4330,8 +4305,7 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
4330
4305
|
}
|
|
4331
4306
|
function initAnalytics(initOptions = {}) {
|
|
4332
4307
|
if (initOptions.region &&
|
|
4333
|
-
(typeof initOptions.region !== 'string' ||
|
|
4334
|
-
!REGIONS$1.includes(initOptions.region))) {
|
|
4308
|
+
(typeof initOptions.region !== 'string' || !REGIONS$1.includes(initOptions.region))) {
|
|
4335
4309
|
throw new Error(`\`region\` must be one of the following: ${REGIONS$1.join(', ')}`);
|
|
4336
4310
|
}
|
|
4337
4311
|
return createAnalyticsClient({
|
|
@@ -4342,8 +4316,7 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
4342
4316
|
}
|
|
4343
4317
|
function initAbtesting(initOptions = {}) {
|
|
4344
4318
|
if (initOptions.region &&
|
|
4345
|
-
(typeof initOptions.region !== 'string' ||
|
|
4346
|
-
!REGIONS$2.includes(initOptions.region))) {
|
|
4319
|
+
(typeof initOptions.region !== 'string' || !REGIONS$2.includes(initOptions.region))) {
|
|
4347
4320
|
throw new Error(`\`region\` must be one of the following: ${REGIONS$2.join(', ')}`);
|
|
4348
4321
|
}
|
|
4349
4322
|
return createAbtestingClient({
|
|
@@ -4355,8 +4328,7 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
4355
4328
|
function initPersonalization(initOptions) {
|
|
4356
4329
|
if (!initOptions.region ||
|
|
4357
4330
|
(initOptions.region &&
|
|
4358
|
-
(typeof initOptions.region !== 'string' ||
|
|
4359
|
-
!REGIONS.includes(initOptions.region)))) {
|
|
4331
|
+
(typeof initOptions.region !== 'string' || !REGIONS.includes(initOptions.region)))) {
|
|
4360
4332
|
throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(', ')}`);
|
|
4361
4333
|
}
|
|
4362
4334
|
return createPersonalizationClient({
|
|
@@ -4385,7 +4357,7 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
4385
4357
|
* @param generateSecuredApiKey.parentApiKey - The base API key from which to generate the new secured one.
|
|
4386
4358
|
* @param generateSecuredApiKey.restrictions - A set of properties defining the restrictions of the secured API key.
|
|
4387
4359
|
*/
|
|
4388
|
-
generateSecuredApiKey({ parentApiKey, restrictions = {}
|
|
4360
|
+
generateSecuredApiKey({ parentApiKey, restrictions = {} }) {
|
|
4389
4361
|
let mergedRestrictions = restrictions;
|
|
4390
4362
|
if (restrictions.searchParams) {
|
|
4391
4363
|
// merge searchParams with the root restrictions
|
|
@@ -4403,9 +4375,7 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
4403
4375
|
return acc;
|
|
4404
4376
|
}, {});
|
|
4405
4377
|
const queryParameters = serializeQueryParameters(mergedRestrictions);
|
|
4406
|
-
return Buffer.from(createHmac('sha256', parentApiKey)
|
|
4407
|
-
.update(queryParameters)
|
|
4408
|
-
.digest('hex') + queryParameters).toString('base64');
|
|
4378
|
+
return Buffer.from(createHmac('sha256', parentApiKey).update(queryParameters).digest('hex') + queryParameters).toString('base64');
|
|
4409
4379
|
},
|
|
4410
4380
|
/**
|
|
4411
4381
|
* Helper: Retrieves the remaining validity of the previous generated `securedApiKey`, the `ValidUntil` parameter must have been provided.
|
|
@@ -4414,7 +4384,7 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
4414
4384
|
* @param getSecuredApiKeyRemainingValidity - The `getSecuredApiKeyRemainingValidity` object.
|
|
4415
4385
|
* @param getSecuredApiKeyRemainingValidity.securedApiKey - The secured API key generated with the `generateSecuredApiKey` method.
|
|
4416
4386
|
*/
|
|
4417
|
-
getSecuredApiKeyRemainingValidity({ securedApiKey
|
|
4387
|
+
getSecuredApiKeyRemainingValidity({ securedApiKey }) {
|
|
4418
4388
|
const decodedString = Buffer.from(securedApiKey, 'base64').toString('ascii');
|
|
4419
4389
|
const regex = /validUntil=(\d+)/;
|
|
4420
4390
|
const match = decodedString.match(regex);
|