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
|
@@ -365,7 +365,7 @@ function deserializeFailure({
|
|
|
365
365
|
return new DetailedApiError(parsed.message, status, parsed.error, stackFrame);
|
|
366
366
|
}
|
|
367
367
|
return new ApiError(parsed.message, status, stackFrame);
|
|
368
|
-
} catch
|
|
368
|
+
} catch {
|
|
369
369
|
// ..
|
|
370
370
|
}
|
|
371
371
|
return new ApiError(content, status, stackFrame);
|
|
@@ -493,14 +493,17 @@ function createTransporter({
|
|
|
493
493
|
if (host === undefined) {
|
|
494
494
|
throw new RetryError(stackTraceWithoutCredentials(stackTrace));
|
|
495
495
|
}
|
|
496
|
-
|
|
496
|
+
const timeout = {
|
|
497
|
+
...timeouts,
|
|
498
|
+
...requestOptions.timeouts
|
|
499
|
+
};
|
|
497
500
|
const payload = {
|
|
498
501
|
data,
|
|
499
502
|
headers,
|
|
500
503
|
method: request.method,
|
|
501
504
|
url: serializeUrl(host, request.path, queryParameters),
|
|
502
|
-
connectTimeout: getTimeout(timeoutsCount,
|
|
503
|
-
responseTimeout: getTimeout(timeoutsCount,
|
|
505
|
+
connectTimeout: getTimeout(timeoutsCount, timeout.connect),
|
|
506
|
+
responseTimeout: getTimeout(timeoutsCount, isRead ? timeout.read : timeout.write)
|
|
504
507
|
};
|
|
505
508
|
/**
|
|
506
509
|
* The stackFrame is pushed to the stackTrace so we
|
|
@@ -675,12 +678,10 @@ const DEFAULT_READ_TIMEOUT_BROWSER = 2000;
|
|
|
675
678
|
const DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;
|
|
676
679
|
|
|
677
680
|
// 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.
|
|
678
|
-
const apiClientVersion$5 = '5.1
|
|
681
|
+
const apiClientVersion$5 = '5.2.1';
|
|
679
682
|
const REGIONS$2 = ['de', 'us'];
|
|
680
683
|
function getDefaultHosts$4(region) {
|
|
681
|
-
const url = !region
|
|
682
|
-
? 'analytics.algolia.com'
|
|
683
|
-
: 'analytics.{region}.algolia.com'.replace('{region}', region);
|
|
684
|
+
const url = !region ? 'analytics.algolia.com' : 'analytics.{region}.algolia.com'.replace('{region}', region);
|
|
684
685
|
return [{ url, accept: 'readWrite', protocol: 'https' }];
|
|
685
686
|
}
|
|
686
687
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
@@ -714,10 +715,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
714
715
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
715
716
|
*/
|
|
716
717
|
clearCache() {
|
|
717
|
-
return Promise.all([
|
|
718
|
-
transporter.requestsCache.clear(),
|
|
719
|
-
transporter.responsesCache.clear(),
|
|
720
|
-
]).then(() => undefined);
|
|
718
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
721
719
|
},
|
|
722
720
|
/**
|
|
723
721
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -1017,12 +1015,10 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1017
1015
|
}
|
|
1018
1016
|
|
|
1019
1017
|
// 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.
|
|
1020
|
-
const apiClientVersion$4 = '5.1
|
|
1018
|
+
const apiClientVersion$4 = '5.2.1';
|
|
1021
1019
|
const REGIONS$1 = ['de', 'us'];
|
|
1022
1020
|
function getDefaultHosts$3(region) {
|
|
1023
|
-
const url = !region
|
|
1024
|
-
? 'analytics.algolia.com'
|
|
1025
|
-
: 'analytics.{region}.algolia.com'.replace('{region}', region);
|
|
1021
|
+
const url = !region ? 'analytics.algolia.com' : 'analytics.{region}.algolia.com'.replace('{region}', region);
|
|
1026
1022
|
return [{ url, accept: 'readWrite', protocol: 'https' }];
|
|
1027
1023
|
}
|
|
1028
1024
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
@@ -1056,10 +1052,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1056
1052
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
1057
1053
|
*/
|
|
1058
1054
|
clearCache() {
|
|
1059
|
-
return Promise.all([
|
|
1060
|
-
transporter.requestsCache.clear(),
|
|
1061
|
-
transporter.responsesCache.clear(),
|
|
1062
|
-
]).then(() => undefined);
|
|
1055
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
1063
1056
|
},
|
|
1064
1057
|
/**
|
|
1065
1058
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -1587,7 +1580,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1587
1580
|
* @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/).
|
|
1588
1581
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1589
1582
|
*/
|
|
1590
|
-
getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags
|
|
1583
|
+
getSearchesNoClicks({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
1591
1584
|
if (!index) {
|
|
1592
1585
|
throw new Error('Parameter `index` is required when calling `getSearchesNoClicks`.');
|
|
1593
1586
|
}
|
|
@@ -1635,7 +1628,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1635
1628
|
* @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/).
|
|
1636
1629
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1637
1630
|
*/
|
|
1638
|
-
getSearchesNoResults({ index, startDate, endDate, limit, offset, tags
|
|
1631
|
+
getSearchesNoResults({ index, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
1639
1632
|
if (!index) {
|
|
1640
1633
|
throw new Error('Parameter `index` is required when calling `getSearchesNoResults`.');
|
|
1641
1634
|
}
|
|
@@ -1760,7 +1753,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1760
1753
|
* @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/).
|
|
1761
1754
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1762
1755
|
*/
|
|
1763
|
-
getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags
|
|
1756
|
+
getTopFilterAttributes({ index, search, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
1764
1757
|
if (!index) {
|
|
1765
1758
|
throw new Error('Parameter `index` is required when calling `getTopFilterAttributes`.');
|
|
1766
1759
|
}
|
|
@@ -1813,7 +1806,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1813
1806
|
* @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/).
|
|
1814
1807
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1815
1808
|
*/
|
|
1816
|
-
getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags
|
|
1809
|
+
getTopFilterForAttribute({ attribute, index, search, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
1817
1810
|
if (!attribute) {
|
|
1818
1811
|
throw new Error('Parameter `attribute` is required when calling `getTopFilterForAttribute`.');
|
|
1819
1812
|
}
|
|
@@ -1868,7 +1861,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1868
1861
|
* @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/).
|
|
1869
1862
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1870
1863
|
*/
|
|
1871
|
-
getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags
|
|
1864
|
+
getTopFiltersNoResults({ index, search, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
1872
1865
|
if (!index) {
|
|
1873
1866
|
throw new Error('Parameter `index` is required when calling `getTopFiltersNoResults`.');
|
|
1874
1867
|
}
|
|
@@ -1922,7 +1915,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1922
1915
|
* @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/).
|
|
1923
1916
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1924
1917
|
*/
|
|
1925
|
-
getTopHits({ index, search, clickAnalytics, revenueAnalytics, startDate, endDate, limit, offset, tags
|
|
1918
|
+
getTopHits({ index, search, clickAnalytics, revenueAnalytics, startDate, endDate, limit, offset, tags }, requestOptions) {
|
|
1926
1919
|
if (!index) {
|
|
1927
1920
|
throw new Error('Parameter `index` is required when calling `getTopHits`.');
|
|
1928
1921
|
}
|
|
@@ -2072,7 +2065,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
2072
2065
|
}
|
|
2073
2066
|
|
|
2074
2067
|
// 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.
|
|
2075
|
-
const apiClientVersion$3 = '5.1
|
|
2068
|
+
const apiClientVersion$3 = '5.2.1';
|
|
2076
2069
|
const REGIONS = ['eu', 'us'];
|
|
2077
2070
|
function getDefaultHosts$2(region) {
|
|
2078
2071
|
const url = 'personalization.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -2109,10 +2102,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
2109
2102
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
2110
2103
|
*/
|
|
2111
2104
|
clearCache() {
|
|
2112
|
-
return Promise.all([
|
|
2113
|
-
transporter.requestsCache.clear(),
|
|
2114
|
-
transporter.responsesCache.clear(),
|
|
2115
|
-
]).then(() => undefined);
|
|
2105
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
2116
2106
|
},
|
|
2117
2107
|
/**
|
|
2118
2108
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -2333,7 +2323,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
2333
2323
|
}
|
|
2334
2324
|
|
|
2335
2325
|
// 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.
|
|
2336
|
-
const apiClientVersion$2 = '5.1
|
|
2326
|
+
const apiClientVersion$2 = '5.2.1';
|
|
2337
2327
|
function getDefaultHosts$1(appId) {
|
|
2338
2328
|
return [
|
|
2339
2329
|
{
|
|
@@ -2395,10 +2385,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2395
2385
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
2396
2386
|
*/
|
|
2397
2387
|
clearCache() {
|
|
2398
|
-
return Promise.all([
|
|
2399
|
-
transporter.requestsCache.clear(),
|
|
2400
|
-
transporter.responsesCache.clear(),
|
|
2401
|
-
]).then(() => undefined);
|
|
2388
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
2402
2389
|
},
|
|
2403
2390
|
/**
|
|
2404
2391
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -2496,8 +2483,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2496
2483
|
const value = apiKey[field];
|
|
2497
2484
|
const resValue = response[field];
|
|
2498
2485
|
if (Array.isArray(value) && Array.isArray(resValue)) {
|
|
2499
|
-
if (value.length !== resValue.length ||
|
|
2500
|
-
value.some((v, index) => v !== resValue[index])) {
|
|
2486
|
+
if (value.length !== resValue.length || value.some((v, index) => v !== resValue[index])) {
|
|
2501
2487
|
return false;
|
|
2502
2488
|
}
|
|
2503
2489
|
}
|
|
@@ -2517,7 +2503,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2517
2503
|
}
|
|
2518
2504
|
throw error;
|
|
2519
2505
|
}),
|
|
2520
|
-
validate: (response) => operation === 'add' ? response !== undefined : response === undefined,
|
|
2506
|
+
validate: (response) => (operation === 'add' ? response !== undefined : response === undefined),
|
|
2521
2507
|
});
|
|
2522
2508
|
},
|
|
2523
2509
|
/**
|
|
@@ -2568,9 +2554,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2568
2554
|
indexName,
|
|
2569
2555
|
searchRulesParams: {
|
|
2570
2556
|
...params,
|
|
2571
|
-
page: previousResponse
|
|
2572
|
-
? previousResponse.page + 1
|
|
2573
|
-
: params.page || 0,
|
|
2557
|
+
page: previousResponse ? previousResponse.page + 1 : params.page || 0,
|
|
2574
2558
|
},
|
|
2575
2559
|
}, requestOptions);
|
|
2576
2560
|
},
|
|
@@ -2623,7 +2607,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2623
2607
|
* @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.
|
|
2624
2608
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
2625
2609
|
*/
|
|
2626
|
-
async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000
|
|
2610
|
+
async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000 }, requestOptions) {
|
|
2627
2611
|
let requests = [];
|
|
2628
2612
|
const responses = [];
|
|
2629
2613
|
const objectEntries = objects.entries();
|
|
@@ -2683,9 +2667,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2683
2667
|
return await this.chunkedBatch({
|
|
2684
2668
|
indexName,
|
|
2685
2669
|
objects,
|
|
2686
|
-
action: createIfNotExists
|
|
2687
|
-
? 'partialUpdateObject'
|
|
2688
|
-
: 'partialUpdateObjectNoCreate',
|
|
2670
|
+
action: createIfNotExists ? 'partialUpdateObject' : 'partialUpdateObjectNoCreate',
|
|
2689
2671
|
}, requestOptions);
|
|
2690
2672
|
},
|
|
2691
2673
|
/**
|
|
@@ -2967,7 +2949,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2967
2949
|
* @param batchDictionaryEntries.batchDictionaryEntriesParams - The batchDictionaryEntriesParams object.
|
|
2968
2950
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2969
2951
|
*/
|
|
2970
|
-
batchDictionaryEntries({ dictionaryName, batchDictionaryEntriesParams
|
|
2952
|
+
batchDictionaryEntries({ dictionaryName, batchDictionaryEntriesParams }, requestOptions) {
|
|
2971
2953
|
if (!dictionaryName) {
|
|
2972
2954
|
throw new Error('Parameter `dictionaryName` is required when calling `batchDictionaryEntries`.');
|
|
2973
2955
|
}
|
|
@@ -3221,7 +3203,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3221
3203
|
return transporter.request(request, requestOptions);
|
|
3222
3204
|
},
|
|
3223
3205
|
/**
|
|
3224
|
-
* 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).
|
|
3206
|
+
* 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).
|
|
3225
3207
|
*
|
|
3226
3208
|
* Required API Key ACLs:
|
|
3227
3209
|
* - deleteIndex.
|
|
@@ -3958,7 +3940,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3958
3940
|
return transporter.request(request, requestOptions);
|
|
3959
3941
|
},
|
|
3960
3942
|
/**
|
|
3961
|
-
* 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.
|
|
3943
|
+
* 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.
|
|
3962
3944
|
*
|
|
3963
3945
|
* Required API Key ACLs:
|
|
3964
3946
|
* - addObject.
|
|
@@ -3970,7 +3952,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3970
3952
|
* @param partialUpdateObject.createIfNotExists - Whether to create a new record if it doesn\'t exist.
|
|
3971
3953
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3972
3954
|
*/
|
|
3973
|
-
partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists
|
|
3955
|
+
partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists }, requestOptions) {
|
|
3974
3956
|
if (!indexName) {
|
|
3975
3957
|
throw new Error('Parameter `indexName` is required when calling `partialUpdateObject`.');
|
|
3976
3958
|
}
|
|
@@ -4074,7 +4056,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
4074
4056
|
return transporter.request(request, requestOptions);
|
|
4075
4057
|
},
|
|
4076
4058
|
/**
|
|
4077
|
-
* 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/
|
|
4059
|
+
* 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).
|
|
4078
4060
|
*
|
|
4079
4061
|
* Required API Key ACLs:
|
|
4080
4062
|
* - addObject.
|
|
@@ -4159,7 +4141,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
4159
4141
|
* @param saveRules.clearExistingRules - Whether existing rules should be deleted before adding this batch.
|
|
4160
4142
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4161
4143
|
*/
|
|
4162
|
-
saveRules({ indexName, rules, forwardToReplicas, clearExistingRules
|
|
4144
|
+
saveRules({ indexName, rules, forwardToReplicas, clearExistingRules }, requestOptions) {
|
|
4163
4145
|
if (!indexName) {
|
|
4164
4146
|
throw new Error('Parameter `indexName` is required when calling `saveRules`.');
|
|
4165
4147
|
}
|
|
@@ -4243,7 +4225,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
4243
4225
|
* @param saveSynonyms.replaceExistingSynonyms - Whether to replace all synonyms in the index with the ones sent with this request.
|
|
4244
4226
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4245
4227
|
*/
|
|
4246
|
-
saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms
|
|
4228
|
+
saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms }, requestOptions) {
|
|
4247
4229
|
if (!indexName) {
|
|
4248
4230
|
throw new Error('Parameter `indexName` is required when calling `saveSynonyms`.');
|
|
4249
4231
|
}
|
|
@@ -4257,8 +4239,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
4257
4239
|
queryParameters.forwardToReplicas = forwardToReplicas.toString();
|
|
4258
4240
|
}
|
|
4259
4241
|
if (replaceExistingSynonyms !== undefined) {
|
|
4260
|
-
queryParameters.replaceExistingSynonyms =
|
|
4261
|
-
replaceExistingSynonyms.toString();
|
|
4242
|
+
queryParameters.replaceExistingSynonyms = replaceExistingSynonyms.toString();
|
|
4262
4243
|
}
|
|
4263
4244
|
const request = {
|
|
4264
4245
|
method: 'POST',
|
|
@@ -4332,7 +4313,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
4332
4313
|
* @param searchDictionaryEntries.searchDictionaryEntriesParams - The searchDictionaryEntriesParams object.
|
|
4333
4314
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4334
4315
|
*/
|
|
4335
|
-
searchDictionaryEntries({ dictionaryName, searchDictionaryEntriesParams
|
|
4316
|
+
searchDictionaryEntries({ dictionaryName, searchDictionaryEntriesParams }, requestOptions) {
|
|
4336
4317
|
if (!dictionaryName) {
|
|
4337
4318
|
throw new Error('Parameter `dictionaryName` is required when calling `searchDictionaryEntries`.');
|
|
4338
4319
|
}
|
|
@@ -4368,7 +4349,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
4368
4349
|
* @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.
|
|
4369
4350
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4370
4351
|
*/
|
|
4371
|
-
searchForFacetValues({ indexName, facetName, searchForFacetValuesRequest
|
|
4352
|
+
searchForFacetValues({ indexName, facetName, searchForFacetValuesRequest }, requestOptions) {
|
|
4372
4353
|
if (!indexName) {
|
|
4373
4354
|
throw new Error('Parameter `indexName` is required when calling `searchForFacetValues`.');
|
|
4374
4355
|
}
|
|
@@ -4607,7 +4588,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
4607
4588
|
}
|
|
4608
4589
|
|
|
4609
4590
|
// 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.
|
|
4610
|
-
const apiClientVersion$1 = '5.1
|
|
4591
|
+
const apiClientVersion$1 = '5.2.1';
|
|
4611
4592
|
function getDefaultHosts(appId) {
|
|
4612
4593
|
return [
|
|
4613
4594
|
{
|
|
@@ -4669,10 +4650,7 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
4669
4650
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
4670
4651
|
*/
|
|
4671
4652
|
clearCache() {
|
|
4672
|
-
return Promise.all([
|
|
4673
|
-
transporter.requestsCache.clear(),
|
|
4674
|
-
transporter.responsesCache.clear(),
|
|
4675
|
-
]).then(() => undefined);
|
|
4653
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
4676
4654
|
},
|
|
4677
4655
|
/**
|
|
4678
4656
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -4942,7 +4920,7 @@ function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
4942
4920
|
* @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
|
|
4943
4921
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
4944
4922
|
*/
|
|
4945
|
-
searchRecommendRules({ indexName, model, searchRecommendRulesParams
|
|
4923
|
+
searchRecommendRules({ indexName, model, searchRecommendRulesParams }, requestOptions) {
|
|
4946
4924
|
if (!indexName) {
|
|
4947
4925
|
throw new Error('Parameter `indexName` is required when calling `searchRecommendRules`.');
|
|
4948
4926
|
}
|
|
@@ -4987,8 +4965,7 @@ function createXhrRequester() {
|
|
|
4987
4965
|
const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');
|
|
4988
4966
|
let responseTimeout;
|
|
4989
4967
|
baseRequester.onreadystatechange = () => {
|
|
4990
|
-
if (baseRequester.readyState > baseRequester.OPENED &&
|
|
4991
|
-
responseTimeout === undefined) {
|
|
4968
|
+
if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) {
|
|
4992
4969
|
clearTimeout(connectTimeout);
|
|
4993
4970
|
responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');
|
|
4994
4971
|
}
|
|
@@ -5044,10 +5021,7 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
5044
5021
|
responsesCache: createMemoryCache(),
|
|
5045
5022
|
requestsCache: createMemoryCache({ serializable: false }),
|
|
5046
5023
|
hostsCache: createFallbackableCache({
|
|
5047
|
-
caches: [
|
|
5048
|
-
createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
|
|
5049
|
-
createMemoryCache(),
|
|
5050
|
-
],
|
|
5024
|
+
caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],
|
|
5051
5025
|
}),
|
|
5052
5026
|
...options,
|
|
5053
5027
|
};
|
|
@@ -5060,8 +5034,7 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
5060
5034
|
}
|
|
5061
5035
|
function initAnalytics(initOptions = {}) {
|
|
5062
5036
|
if (initOptions.region &&
|
|
5063
|
-
(typeof initOptions.region !== 'string' ||
|
|
5064
|
-
!REGIONS$1.includes(initOptions.region))) {
|
|
5037
|
+
(typeof initOptions.region !== 'string' || !REGIONS$1.includes(initOptions.region))) {
|
|
5065
5038
|
throw new Error(`\`region\` must be one of the following: ${REGIONS$1.join(', ')}`);
|
|
5066
5039
|
}
|
|
5067
5040
|
return createAnalyticsClient({
|
|
@@ -5072,8 +5045,7 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
5072
5045
|
}
|
|
5073
5046
|
function initAbtesting(initOptions = {}) {
|
|
5074
5047
|
if (initOptions.region &&
|
|
5075
|
-
(typeof initOptions.region !== 'string' ||
|
|
5076
|
-
!REGIONS$2.includes(initOptions.region))) {
|
|
5048
|
+
(typeof initOptions.region !== 'string' || !REGIONS$2.includes(initOptions.region))) {
|
|
5077
5049
|
throw new Error(`\`region\` must be one of the following: ${REGIONS$2.join(', ')}`);
|
|
5078
5050
|
}
|
|
5079
5051
|
return createAbtestingClient({
|
|
@@ -5085,8 +5057,7 @@ function algoliasearch(appId, apiKey, options) {
|
|
|
5085
5057
|
function initPersonalization(initOptions) {
|
|
5086
5058
|
if (!initOptions.region ||
|
|
5087
5059
|
(initOptions.region &&
|
|
5088
|
-
(typeof initOptions.region !== 'string' ||
|
|
5089
|
-
!REGIONS.includes(initOptions.region)))) {
|
|
5060
|
+
(typeof initOptions.region !== 'string' || !REGIONS.includes(initOptions.region)))) {
|
|
5090
5061
|
throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(', ')}`);
|
|
5091
5062
|
}
|
|
5092
5063
|
return createPersonalizationClient({
|