algoliasearch 5.1.1 → 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/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 +38 -68
- package/dist/algoliasearch.esm.browser.js +44 -73
- package/dist/algoliasearch.esm.node.js +38 -68
- package/dist/algoliasearch.umd.js +2 -2
- 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/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 +14 -14
- 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 +12 -12
- 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
package/dist/algoliasearch.cjs
CHANGED
|
@@ -5,12 +5,10 @@ var clientCommon = require('@algolia/client-common');
|
|
|
5
5
|
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
6
6
|
|
|
7
7
|
// 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.
|
|
8
|
-
const apiClientVersion$5 = '5.
|
|
8
|
+
const apiClientVersion$5 = '5.2.1';
|
|
9
9
|
const REGIONS$2 = ['de', 'us'];
|
|
10
10
|
function getDefaultHosts$4(region) {
|
|
11
|
-
const url = !region
|
|
12
|
-
? 'analytics.algolia.com'
|
|
13
|
-
: 'analytics.{region}.algolia.com'.replace('{region}', region);
|
|
11
|
+
const url = !region ? 'analytics.algolia.com' : 'analytics.{region}.algolia.com'.replace('{region}', region);
|
|
14
12
|
return [{ url, accept: 'readWrite', protocol: 'https' }];
|
|
15
13
|
}
|
|
16
14
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
@@ -44,10 +42,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
44
42
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
45
43
|
*/
|
|
46
44
|
clearCache() {
|
|
47
|
-
return Promise.all([
|
|
48
|
-
transporter.requestsCache.clear(),
|
|
49
|
-
transporter.responsesCache.clear(),
|
|
50
|
-
]).then(() => undefined);
|
|
45
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
51
46
|
},
|
|
52
47
|
/**
|
|
53
48
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -347,12 +342,10 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
347
342
|
}
|
|
348
343
|
|
|
349
344
|
// 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.
|
|
350
|
-
const apiClientVersion$4 = '5.
|
|
345
|
+
const apiClientVersion$4 = '5.2.1';
|
|
351
346
|
const REGIONS$1 = ['de', 'us'];
|
|
352
347
|
function getDefaultHosts$3(region) {
|
|
353
|
-
const url = !region
|
|
354
|
-
? 'analytics.algolia.com'
|
|
355
|
-
: 'analytics.{region}.algolia.com'.replace('{region}', region);
|
|
348
|
+
const url = !region ? 'analytics.algolia.com' : 'analytics.{region}.algolia.com'.replace('{region}', region);
|
|
356
349
|
return [{ url, accept: 'readWrite', protocol: 'https' }];
|
|
357
350
|
}
|
|
358
351
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
@@ -386,10 +379,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
386
379
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
387
380
|
*/
|
|
388
381
|
clearCache() {
|
|
389
|
-
return Promise.all([
|
|
390
|
-
transporter.requestsCache.clear(),
|
|
391
|
-
transporter.responsesCache.clear(),
|
|
392
|
-
]).then(() => undefined);
|
|
382
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
393
383
|
},
|
|
394
384
|
/**
|
|
395
385
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -917,7 +907,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
917
907
|
* @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/).
|
|
918
908
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
919
909
|
*/
|
|
920
|
-
getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags
|
|
910
|
+
getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
921
911
|
if (!index) {
|
|
922
912
|
throw new Error('Parameter `index` is required when calling `getSearchesNoClicks`.');
|
|
923
913
|
}
|
|
@@ -965,7 +955,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
965
955
|
* @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/).
|
|
966
956
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
967
957
|
*/
|
|
968
|
-
getSearchesNoResults({ index, startDate, endDate, limit, offset, tags
|
|
958
|
+
getSearchesNoResults({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
969
959
|
if (!index) {
|
|
970
960
|
throw new Error('Parameter `index` is required when calling `getSearchesNoResults`.');
|
|
971
961
|
}
|
|
@@ -1090,7 +1080,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1090
1080
|
* @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/).
|
|
1091
1081
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1092
1082
|
*/
|
|
1093
|
-
getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags
|
|
1083
|
+
getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
1094
1084
|
if (!index) {
|
|
1095
1085
|
throw new Error('Parameter `index` is required when calling `getTopFilterAttributes`.');
|
|
1096
1086
|
}
|
|
@@ -1143,7 +1133,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1143
1133
|
* @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/).
|
|
1144
1134
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1145
1135
|
*/
|
|
1146
|
-
getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags
|
|
1136
|
+
getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
1147
1137
|
if (!attribute) {
|
|
1148
1138
|
throw new Error('Parameter `attribute` is required when calling `getTopFilterForAttribute`.');
|
|
1149
1139
|
}
|
|
@@ -1198,7 +1188,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1198
1188
|
* @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/).
|
|
1199
1189
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1200
1190
|
*/
|
|
1201
|
-
getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags
|
|
1191
|
+
getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
1202
1192
|
if (!index) {
|
|
1203
1193
|
throw new Error('Parameter `index` is required when calling `getTopFiltersNoResults`.');
|
|
1204
1194
|
}
|
|
@@ -1252,7 +1242,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1252
1242
|
* @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/).
|
|
1253
1243
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1254
1244
|
*/
|
|
1255
|
-
getTopHits({ index, search, clickAnalytics, revenueAnalytics, startDate, endDate, limit, offset, tags
|
|
1245
|
+
getTopHits({ index, search, clickAnalytics, revenueAnalytics, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
1256
1246
|
if (!index) {
|
|
1257
1247
|
throw new Error('Parameter `index` is required when calling `getTopHits`.');
|
|
1258
1248
|
}
|
|
@@ -1402,7 +1392,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1402
1392
|
}
|
|
1403
1393
|
|
|
1404
1394
|
// 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.
|
|
1405
|
-
const apiClientVersion$3 = '5.
|
|
1395
|
+
const apiClientVersion$3 = '5.2.1';
|
|
1406
1396
|
const REGIONS = ['eu', 'us'];
|
|
1407
1397
|
function getDefaultHosts$2(region) {
|
|
1408
1398
|
const url = 'personalization.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -1439,10 +1429,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
1439
1429
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
1440
1430
|
*/
|
|
1441
1431
|
clearCache() {
|
|
1442
|
-
return Promise.all([
|
|
1443
|
-
transporter.requestsCache.clear(),
|
|
1444
|
-
transporter.responsesCache.clear(),
|
|
1445
|
-
]).then(() => undefined);
|
|
1432
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
1446
1433
|
},
|
|
1447
1434
|
/**
|
|
1448
1435
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -1663,7 +1650,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
1663
1650
|
}
|
|
1664
1651
|
|
|
1665
1652
|
// 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.
|
|
1666
|
-
const apiClientVersion$2 = '5.
|
|
1653
|
+
const apiClientVersion$2 = '5.2.1';
|
|
1667
1654
|
function getDefaultHosts$1(appId) {
|
|
1668
1655
|
return [
|
|
1669
1656
|
{
|
|
@@ -1725,10 +1712,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1725
1712
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
1726
1713
|
*/
|
|
1727
1714
|
clearCache() {
|
|
1728
|
-
return Promise.all([
|
|
1729
|
-
transporter.requestsCache.clear(),
|
|
1730
|
-
transporter.responsesCache.clear(),
|
|
1731
|
-
]).then(() => undefined);
|
|
1715
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
1732
1716
|
},
|
|
1733
1717
|
/**
|
|
1734
1718
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -1826,8 +1810,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1826
1810
|
const value = apiKey[field];
|
|
1827
1811
|
const resValue = response[field];
|
|
1828
1812
|
if (Array.isArray(value) && Array.isArray(resValue)) {
|
|
1829
|
-
if (value.length !== resValue.length ||
|
|
1830
|
-
value.some((v, index) => v !== resValue[index])) {
|
|
1813
|
+
if (value.length !== resValue.length || value.some((v, index) => v !== resValue[index])) {
|
|
1831
1814
|
return false;
|
|
1832
1815
|
}
|
|
1833
1816
|
}
|
|
@@ -1847,7 +1830,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1847
1830
|
}
|
|
1848
1831
|
throw error;
|
|
1849
1832
|
}),
|
|
1850
|
-
validate: (response) => operation === 'add' ? response !== undefined : response === undefined,
|
|
1833
|
+
validate: (response) => (operation === 'add' ? response !== undefined : response === undefined),
|
|
1851
1834
|
});
|
|
1852
1835
|
},
|
|
1853
1836
|
/**
|
|
@@ -1898,9 +1881,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1898
1881
|
indexName,
|
|
1899
1882
|
searchRulesParams: {
|
|
1900
1883
|
...params,
|
|
1901
|
-
page: previousResponse
|
|
1902
|
-
? previousResponse.page + 1
|
|
1903
|
-
: params.page || 0,
|
|
1884
|
+
page: previousResponse ? previousResponse.page + 1 : params.page || 0,
|
|
1904
1885
|
},
|
|
1905
1886
|
}, requestOptions);
|
|
1906
1887
|
},
|
|
@@ -1953,7 +1934,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1953
1934
|
* @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.
|
|
1954
1935
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
1955
1936
|
*/
|
|
1956
|
-
async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000
|
|
1937
|
+
async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000 }, requestOptions) {
|
|
1957
1938
|
let requests = [];
|
|
1958
1939
|
const responses = [];
|
|
1959
1940
|
const objectEntries = objects.entries();
|
|
@@ -2013,9 +1994,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2013
1994
|
return await this.chunkedBatch({
|
|
2014
1995
|
indexName,
|
|
2015
1996
|
objects,
|
|
2016
|
-
action: createIfNotExists
|
|
2017
|
-
? 'partialUpdateObject'
|
|
2018
|
-
: 'partialUpdateObjectNoCreate',
|
|
1997
|
+
action: createIfNotExists ? 'partialUpdateObject' : 'partialUpdateObjectNoCreate',
|
|
2019
1998
|
}, requestOptions);
|
|
2020
1999
|
},
|
|
2021
2000
|
/**
|
|
@@ -2297,7 +2276,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2297
2276
|
* @param batchDictionaryEntries.batchDictionaryEntriesParams - The batchDictionaryEntriesParams object.
|
|
2298
2277
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2299
2278
|
*/
|
|
2300
|
-
batchDictionaryEntries({ dictionaryName, batchDictionaryEntriesParams
|
|
2279
|
+
batchDictionaryEntries({ dictionaryName, batchDictionaryEntriesParams }, requestOptions) {
|
|
2301
2280
|
if (!dictionaryName) {
|
|
2302
2281
|
throw new Error('Parameter `dictionaryName` is required when calling `batchDictionaryEntries`.');
|
|
2303
2282
|
}
|
|
@@ -3288,7 +3267,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3288
3267
|
return transporter.request(request, requestOptions);
|
|
3289
3268
|
},
|
|
3290
3269
|
/**
|
|
3291
|
-
* 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.
|
|
3270
|
+
* 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.
|
|
3292
3271
|
*
|
|
3293
3272
|
* Required API Key ACLs:
|
|
3294
3273
|
* - addObject.
|
|
@@ -3300,7 +3279,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3300
3279
|
* @param partialUpdateObject.createIfNotExists - Whether to create a new record if it doesn\'t exist.
|
|
3301
3280
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3302
3281
|
*/
|
|
3303
|
-
partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists
|
|
3282
|
+
partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists }, requestOptions) {
|
|
3304
3283
|
if (!indexName) {
|
|
3305
3284
|
throw new Error('Parameter `indexName` is required when calling `partialUpdateObject`.');
|
|
3306
3285
|
}
|
|
@@ -3489,7 +3468,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3489
3468
|
* @param saveRules.clearExistingRules - Whether existing rules should be deleted before adding this batch.
|
|
3490
3469
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3491
3470
|
*/
|
|
3492
|
-
saveRules({ indexName, rules, forwardToReplicas, clearExistingRules
|
|
3471
|
+
saveRules({ indexName, rules, forwardToReplicas, clearExistingRules }, requestOptions) {
|
|
3493
3472
|
if (!indexName) {
|
|
3494
3473
|
throw new Error('Parameter `indexName` is required when calling `saveRules`.');
|
|
3495
3474
|
}
|
|
@@ -3573,7 +3552,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3573
3552
|
* @param saveSynonyms.replaceExistingSynonyms - Whether to replace all synonyms in the index with the ones sent with this request.
|
|
3574
3553
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3575
3554
|
*/
|
|
3576
|
-
saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms
|
|
3555
|
+
saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms }, requestOptions) {
|
|
3577
3556
|
if (!indexName) {
|
|
3578
3557
|
throw new Error('Parameter `indexName` is required when calling `saveSynonyms`.');
|
|
3579
3558
|
}
|
|
@@ -3587,8 +3566,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3587
3566
|
queryParameters.forwardToReplicas = forwardToReplicas.toString();
|
|
3588
3567
|
}
|
|
3589
3568
|
if (replaceExistingSynonyms !== undefined) {
|
|
3590
|
-
queryParameters.replaceExistingSynonyms =
|
|
3591
|
-
replaceExistingSynonyms.toString();
|
|
3569
|
+
queryParameters.replaceExistingSynonyms = replaceExistingSynonyms.toString();
|
|
3592
3570
|
}
|
|
3593
3571
|
const request = {
|
|
3594
3572
|
method: 'POST',
|
|
@@ -3662,7 +3640,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3662
3640
|
* @param searchDictionaryEntries.searchDictionaryEntriesParams - The searchDictionaryEntriesParams object.
|
|
3663
3641
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3664
3642
|
*/
|
|
3665
|
-
searchDictionaryEntries({ dictionaryName, searchDictionaryEntriesParams
|
|
3643
|
+
searchDictionaryEntries({ dictionaryName, searchDictionaryEntriesParams }, requestOptions) {
|
|
3666
3644
|
if (!dictionaryName) {
|
|
3667
3645
|
throw new Error('Parameter `dictionaryName` is required when calling `searchDictionaryEntries`.');
|
|
3668
3646
|
}
|
|
@@ -3698,7 +3676,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3698
3676
|
* @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.
|
|
3699
3677
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3700
3678
|
*/
|
|
3701
|
-
searchForFacetValues({ indexName, facetName, searchForFacetValuesRequest
|
|
3679
|
+
searchForFacetValues({ indexName, facetName, searchForFacetValuesRequest }, requestOptions) {
|
|
3702
3680
|
if (!indexName) {
|
|
3703
3681
|
throw new Error('Parameter `indexName` is required when calling `searchForFacetValues`.');
|
|
3704
3682
|
}
|
|
@@ -3937,7 +3915,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3937
3915
|
}
|
|
3938
3916
|
|
|
3939
3917
|
// 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.
|
|
3940
|
-
const apiClientVersion$1 = '5.
|
|
3918
|
+
const apiClientVersion$1 = '5.2.1';
|
|
3941
3919
|
function getDefaultHosts(appId) {
|
|
3942
3920
|
return [
|
|
3943
3921
|
{
|
|
@@ -3999,10 +3977,7 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
3999
3977
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
4000
3978
|
*/
|
|
4001
3979
|
clearCache() {
|
|
4002
|
-
return Promise.all([
|
|
4003
|
-
transporter.requestsCache.clear(),
|
|
4004
|
-
transporter.responsesCache.clear(),
|
|
4005
|
-
]).then(() => undefined);
|
|
3980
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
4006
3981
|
},
|
|
4007
3982
|
/**
|
|
4008
3983
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -4272,7 +4247,7 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
4272
4247
|
* @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
|
|
4273
4248
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4274
4249
|
*/
|
|
4275
|
-
searchRecommendRules({ indexName, model, searchRecommendRulesParams
|
|
4250
|
+
searchRecommendRules({ indexName, model, searchRecommendRulesParams }, requestOptions) {
|
|
4276
4251
|
if (!indexName) {
|
|
4277
4252
|
throw new Error('Parameter `indexName` is required when calling `searchRecommendRules`.');
|
|
4278
4253
|
}
|
|
@@ -4332,8 +4307,7 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
4332
4307
|
}
|
|
4333
4308
|
function initAnalytics(initOptions = {}) {
|
|
4334
4309
|
if (initOptions.region &&
|
|
4335
|
-
(typeof initOptions.region !== 'string' ||
|
|
4336
|
-
!REGIONS$1.includes(initOptions.region))) {
|
|
4310
|
+
(typeof initOptions.region !== 'string' || !REGIONS$1.includes(initOptions.region))) {
|
|
4337
4311
|
throw new Error(`\`region\` must be one of the following: ${REGIONS$1.join(', ')}`);
|
|
4338
4312
|
}
|
|
4339
4313
|
return createAnalyticsClient({
|
|
@@ -4344,8 +4318,7 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
4344
4318
|
}
|
|
4345
4319
|
function initAbtesting(initOptions = {}) {
|
|
4346
4320
|
if (initOptions.region &&
|
|
4347
|
-
(typeof initOptions.region !== 'string' ||
|
|
4348
|
-
!REGIONS$2.includes(initOptions.region))) {
|
|
4321
|
+
(typeof initOptions.region !== 'string' || !REGIONS$2.includes(initOptions.region))) {
|
|
4349
4322
|
throw new Error(`\`region\` must be one of the following: ${REGIONS$2.join(', ')}`);
|
|
4350
4323
|
}
|
|
4351
4324
|
return createAbtestingClient({
|
|
@@ -4357,8 +4330,7 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
4357
4330
|
function initPersonalization(initOptions) {
|
|
4358
4331
|
if (!initOptions.region ||
|
|
4359
4332
|
(initOptions.region &&
|
|
4360
|
-
(typeof initOptions.region !== 'string' ||
|
|
4361
|
-
!REGIONS.includes(initOptions.region)))) {
|
|
4333
|
+
(typeof initOptions.region !== 'string' || !REGIONS.includes(initOptions.region)))) {
|
|
4362
4334
|
throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(', ')}`);
|
|
4363
4335
|
}
|
|
4364
4336
|
return createPersonalizationClient({
|
|
@@ -4387,7 +4359,7 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
4387
4359
|
* @param generateSecuredApiKey.parentApiKey - The base API key from which to generate the new secured one.
|
|
4388
4360
|
* @param generateSecuredApiKey.restrictions - A set of properties defining the restrictions of the secured API key.
|
|
4389
4361
|
*/
|
|
4390
|
-
generateSecuredApiKey({ parentApiKey, restrictions = {}
|
|
4362
|
+
generateSecuredApiKey({ parentApiKey, restrictions = {} }) {
|
|
4391
4363
|
let mergedRestrictions = restrictions;
|
|
4392
4364
|
if (restrictions.searchParams) {
|
|
4393
4365
|
// merge searchParams with the root restrictions
|
|
@@ -4405,9 +4377,7 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
4405
4377
|
return acc;
|
|
4406
4378
|
}, {});
|
|
4407
4379
|
const queryParameters = clientCommon.serializeQueryParameters(mergedRestrictions);
|
|
4408
|
-
return Buffer.from(crypto.createHmac('sha256', parentApiKey)
|
|
4409
|
-
.update(queryParameters)
|
|
4410
|
-
.digest('hex') + queryParameters).toString('base64');
|
|
4380
|
+
return Buffer.from(crypto.createHmac('sha256', parentApiKey).update(queryParameters).digest('hex') + queryParameters).toString('base64');
|
|
4411
4381
|
},
|
|
4412
4382
|
/**
|
|
4413
4383
|
* Helper: Retrieves the remaining validity of the previous generated `securedApiKey`, the `ValidUntil` parameter must have been provided.
|
|
@@ -4416,7 +4386,7 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
4416
4386
|
* @param getSecuredApiKeyRemainingValidity - The `getSecuredApiKeyRemainingValidity` object.
|
|
4417
4387
|
* @param getSecuredApiKeyRemainingValidity.securedApiKey - The secured API key generated with the `generateSecuredApiKey` method.
|
|
4418
4388
|
*/
|
|
4419
|
-
getSecuredApiKeyRemainingValidity({ securedApiKey
|
|
4389
|
+
getSecuredApiKeyRemainingValidity({ securedApiKey }) {
|
|
4420
4390
|
const decodedString = Buffer.from(securedApiKey, 'base64').toString('ascii');
|
|
4421
4391
|
const regex = /validUntil=(\d+)/;
|
|
4422
4392
|
const match = decodedString.match(regex);
|