algoliasearch 5.0.0-alpha.91 → 5.0.0-alpha.98
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 +3 -9
- package/builds/models.ts +11 -5
- package/builds/node.ts +3 -9
- package/dist/algoliasearch/builds/browser.d.ts +10 -10
- 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 +10 -10
- package/dist/algoliasearch/builds/node.d.ts.map +1 -1
- package/dist/algoliasearch.cjs +319 -327
- package/dist/algoliasearch.esm.browser.js +362 -346
- package/dist/algoliasearch.esm.node.js +319 -327
- package/dist/algoliasearch.umd.js +2 -2
- package/dist/client-abtesting/model/clientMethodProps.d.ts +42 -42
- package/dist/client-abtesting/model/clientMethodProps.d.ts.map +1 -1
- package/dist/client-abtesting/model/variant.d.ts +4 -0
- package/dist/client-abtesting/model/variant.d.ts.map +1 -1
- package/dist/client-abtesting/src/abtestingClient.d.ts +37 -37
- package/dist/client-abtesting/src/abtestingClient.d.ts.map +1 -1
- package/dist/client-analytics/model/clientMethodProps.d.ts +38 -38
- package/dist/client-analytics/model/clientMethodProps.d.ts.map +1 -1
- package/dist/client-analytics/src/analyticsClient.d.ts +32 -32
- package/dist/client-analytics/src/analyticsClient.d.ts.map +1 -1
- package/dist/client-personalization/model/clientMethodProps.d.ts +26 -26
- package/dist/client-personalization/model/clientMethodProps.d.ts.map +1 -1
- package/dist/client-personalization/src/personalizationClient.d.ts +37 -37
- package/dist/client-personalization/src/personalizationClient.d.ts.map +1 -1
- package/dist/client-search/model/clientMethodProps.d.ts +59 -72
- package/dist/client-search/model/clientMethodProps.d.ts.map +1 -1
- package/dist/client-search/model/highlightResult.d.ts +1 -1
- package/dist/client-search/model/highlightResult.d.ts.map +1 -1
- package/dist/client-search/model/searchForFacetValuesResponse.d.ts +8 -0
- package/dist/client-search/model/searchForFacetValuesResponse.d.ts.map +1 -1
- package/dist/client-search/model/searchResponses.d.ts +2 -2
- package/dist/client-search/model/searchResponses.d.ts.map +1 -1
- package/dist/client-search/model/searchResult.d.ts +1 -1
- package/dist/client-search/model/searchResult.d.ts.map +1 -1
- package/dist/client-search/model/searchSynonymsParams.d.ts +10 -0
- package/dist/client-search/model/searchSynonymsParams.d.ts.map +1 -1
- package/dist/client-search/model/snippetResult.d.ts +1 -1
- package/dist/client-search/model/snippetResult.d.ts.map +1 -1
- package/dist/client-search/model/userHighlightResult.d.ts +2 -8
- package/dist/client-search/model/userHighlightResult.d.ts.map +1 -1
- package/dist/client-search/src/searchClient.d.ts +53 -55
- package/dist/client-search/src/searchClient.d.ts.map +1 -1
- package/dist/lite/lite.cjs +7 -7
- package/dist/lite/lite.esm.browser.js +50 -26
- package/dist/lite/lite.esm.node.js +7 -7
- package/dist/lite/lite.umd.js +2 -2
- package/dist/lite/model/clientMethodProps.d.ts +2 -2
- package/dist/lite/model/clientMethodProps.d.ts.map +1 -1
- package/dist/lite/model/highlightResult.d.ts +1 -1
- package/dist/lite/model/highlightResult.d.ts.map +1 -1
- package/dist/lite/model/searchForFacetValuesResponse.d.ts +8 -0
- package/dist/lite/model/searchForFacetValuesResponse.d.ts.map +1 -1
- package/dist/lite/model/searchResponses.d.ts +2 -2
- package/dist/lite/model/searchResponses.d.ts.map +1 -1
- package/dist/lite/model/searchResult.d.ts +1 -1
- package/dist/lite/model/searchResult.d.ts.map +1 -1
- package/dist/lite/model/snippetResult.d.ts +1 -1
- package/dist/lite/model/snippetResult.d.ts.map +1 -1
- package/dist/lite/src/liteClient.d.ts +8 -8
- package/dist/lite/src/liteClient.d.ts.map +1 -1
- package/lite/model/clientMethodProps.ts +2 -2
- package/lite/model/highlightResult.ts +3 -1
- package/lite/model/searchForFacetValuesResponse.ts +10 -0
- package/lite/model/searchResponses.ts +2 -2
- package/lite/model/searchResult.ts +3 -1
- package/lite/model/snippetResult.ts +3 -1
- package/lite/src/liteClient.ts +13 -11
- package/package.json +13 -13
|
@@ -66,14 +66,35 @@ function createBrowserLocalStorageCache(options) {
|
|
|
66
66
|
function getNamespace() {
|
|
67
67
|
return JSON.parse(getStorage().getItem(namespaceKey) || '{}');
|
|
68
68
|
}
|
|
69
|
+
function setNamespace(namespace) {
|
|
70
|
+
getStorage().setItem(namespaceKey, JSON.stringify(namespace));
|
|
71
|
+
}
|
|
72
|
+
function removeOutdatedCacheItems() {
|
|
73
|
+
const timeToLive = options.timeToLive ? options.timeToLive * 1000 : null;
|
|
74
|
+
const namespace = getNamespace();
|
|
75
|
+
const filteredNamespaceWithoutOldFormattedCacheItems = Object.fromEntries(Object.entries(namespace).filter(([, cacheItem]) => {
|
|
76
|
+
return cacheItem.timestamp !== undefined;
|
|
77
|
+
}));
|
|
78
|
+
setNamespace(filteredNamespaceWithoutOldFormattedCacheItems);
|
|
79
|
+
if (!timeToLive) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const filteredNamespaceWithoutExpiredItems = Object.fromEntries(Object.entries(filteredNamespaceWithoutOldFormattedCacheItems).filter(([, cacheItem]) => {
|
|
83
|
+
const currentTimestamp = new Date().getTime();
|
|
84
|
+
const isExpired = cacheItem.timestamp + timeToLive < currentTimestamp;
|
|
85
|
+
return !isExpired;
|
|
86
|
+
}));
|
|
87
|
+
setNamespace(filteredNamespaceWithoutExpiredItems);
|
|
88
|
+
}
|
|
69
89
|
return {
|
|
70
90
|
get(key, defaultValue, events = {
|
|
71
91
|
miss: () => Promise.resolve()
|
|
72
92
|
}) {
|
|
73
93
|
return Promise.resolve().then(() => {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
94
|
+
removeOutdatedCacheItems();
|
|
95
|
+
return getNamespace()[JSON.stringify(key)];
|
|
96
|
+
}).then(value => {
|
|
97
|
+
return Promise.all([value ? value.value : defaultValue(), value !== undefined]);
|
|
77
98
|
}).then(([value, exists]) => {
|
|
78
99
|
return Promise.all([value, exists || events.miss(value)]);
|
|
79
100
|
}).then(([value]) => value);
|
|
@@ -81,7 +102,10 @@ function createBrowserLocalStorageCache(options) {
|
|
|
81
102
|
set(key, value) {
|
|
82
103
|
return Promise.resolve().then(() => {
|
|
83
104
|
const namespace = getNamespace();
|
|
84
|
-
namespace[JSON.stringify(key)] =
|
|
105
|
+
namespace[JSON.stringify(key)] = {
|
|
106
|
+
timestamp: new Date().getTime(),
|
|
107
|
+
value
|
|
108
|
+
};
|
|
85
109
|
getStorage().setItem(namespaceKey, JSON.stringify(namespace));
|
|
86
110
|
return value;
|
|
87
111
|
});
|
|
@@ -211,6 +235,20 @@ function createStatefulHost(host, status = 'up') {
|
|
|
211
235
|
};
|
|
212
236
|
}
|
|
213
237
|
|
|
238
|
+
function _toPrimitive(t, r) {
|
|
239
|
+
if ("object" != typeof t || !t) return t;
|
|
240
|
+
var e = t[Symbol.toPrimitive];
|
|
241
|
+
if (void 0 !== e) {
|
|
242
|
+
var i = e.call(t, r || "default");
|
|
243
|
+
if ("object" != typeof i) return i;
|
|
244
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
245
|
+
}
|
|
246
|
+
return ("string" === r ? String : Number)(t);
|
|
247
|
+
}
|
|
248
|
+
function _toPropertyKey(t) {
|
|
249
|
+
var i = _toPrimitive(t, "string");
|
|
250
|
+
return "symbol" == typeof i ? i : String(i);
|
|
251
|
+
}
|
|
214
252
|
function _defineProperty(obj, key, value) {
|
|
215
253
|
key = _toPropertyKey(key);
|
|
216
254
|
if (key in obj) {
|
|
@@ -225,20 +263,6 @@ function _defineProperty(obj, key, value) {
|
|
|
225
263
|
}
|
|
226
264
|
return obj;
|
|
227
265
|
}
|
|
228
|
-
function _toPrimitive(input, hint) {
|
|
229
|
-
if (typeof input !== "object" || input === null) return input;
|
|
230
|
-
var prim = input[Symbol.toPrimitive];
|
|
231
|
-
if (prim !== undefined) {
|
|
232
|
-
var res = prim.call(input, hint || "default");
|
|
233
|
-
if (typeof res !== "object") return res;
|
|
234
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
235
|
-
}
|
|
236
|
-
return (hint === "string" ? String : Number)(input);
|
|
237
|
-
}
|
|
238
|
-
function _toPropertyKey(arg) {
|
|
239
|
-
var key = _toPrimitive(arg, "string");
|
|
240
|
-
return typeof key === "symbol" ? key : String(key);
|
|
241
|
-
}
|
|
242
266
|
|
|
243
267
|
class AlgoliaError extends Error {
|
|
244
268
|
constructor(message, name) {
|
|
@@ -259,7 +283,7 @@ class ErrorWithStackTrace extends AlgoliaError {
|
|
|
259
283
|
}
|
|
260
284
|
class RetryError extends ErrorWithStackTrace {
|
|
261
285
|
constructor(stackTrace) {
|
|
262
|
-
super('Unreachable hosts - your application id may be incorrect. If the error persists,
|
|
286
|
+
super('Unreachable hosts - your application id may be incorrect. If the error persists, please create a ticket at https://support.algolia.com/ sharing steps we can use to reproduce the issue.', stackTrace, 'RetryError');
|
|
263
287
|
}
|
|
264
288
|
}
|
|
265
289
|
class ApiError extends ErrorWithStackTrace {
|
|
@@ -661,7 +685,7 @@ const DEFAULT_READ_TIMEOUT_BROWSER = 2000;
|
|
|
661
685
|
const DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;
|
|
662
686
|
|
|
663
687
|
// 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.
|
|
664
|
-
const apiClientVersion$4 = '5.0.0-alpha.
|
|
688
|
+
const apiClientVersion$4 = '5.0.0-alpha.98';
|
|
665
689
|
const REGIONS$2 = ['de', 'us'];
|
|
666
690
|
function getDefaultHosts$3(region) {
|
|
667
691
|
const url = !region
|
|
@@ -756,14 +780,14 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
756
780
|
* This method allow you to send requests to the Algolia REST API.
|
|
757
781
|
*
|
|
758
782
|
* @summary Send requests to the Algolia REST API.
|
|
759
|
-
* @param
|
|
760
|
-
* @param
|
|
761
|
-
* @param
|
|
783
|
+
* @param customDelete - The customDelete object.
|
|
784
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
785
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
762
786
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
763
787
|
*/
|
|
764
|
-
|
|
788
|
+
customDelete({ path, parameters }, requestOptions) {
|
|
765
789
|
if (!path) {
|
|
766
|
-
throw new Error('Parameter `path` is required when calling `
|
|
790
|
+
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
767
791
|
}
|
|
768
792
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
769
793
|
const headers = {};
|
|
@@ -777,22 +801,23 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
777
801
|
return transporter.request(request, requestOptions);
|
|
778
802
|
},
|
|
779
803
|
/**
|
|
780
|
-
*
|
|
804
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
781
805
|
*
|
|
782
|
-
* @summary
|
|
783
|
-
* @param
|
|
784
|
-
* @param
|
|
806
|
+
* @summary Send requests to the Algolia REST API.
|
|
807
|
+
* @param customGet - The customGet object.
|
|
808
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
809
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
785
810
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
786
811
|
*/
|
|
787
|
-
|
|
788
|
-
if (!
|
|
789
|
-
throw new Error('Parameter `
|
|
812
|
+
customGet({ path, parameters }, requestOptions) {
|
|
813
|
+
if (!path) {
|
|
814
|
+
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
790
815
|
}
|
|
791
|
-
const requestPath = '/
|
|
816
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
792
817
|
const headers = {};
|
|
793
|
-
const queryParameters = {};
|
|
818
|
+
const queryParameters = parameters ? parameters : {};
|
|
794
819
|
const request = {
|
|
795
|
-
method: '
|
|
820
|
+
method: 'GET',
|
|
796
821
|
path: requestPath,
|
|
797
822
|
queryParameters,
|
|
798
823
|
headers,
|
|
@@ -803,20 +828,71 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
803
828
|
* This method allow you to send requests to the Algolia REST API.
|
|
804
829
|
*
|
|
805
830
|
* @summary Send requests to the Algolia REST API.
|
|
806
|
-
* @param
|
|
807
|
-
* @param
|
|
808
|
-
* @param
|
|
831
|
+
* @param customPost - The customPost object.
|
|
832
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
833
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
834
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
809
835
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
810
836
|
*/
|
|
811
|
-
|
|
837
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
812
838
|
if (!path) {
|
|
813
|
-
throw new Error('Parameter `path` is required when calling `
|
|
839
|
+
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
814
840
|
}
|
|
815
841
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
816
842
|
const headers = {};
|
|
817
843
|
const queryParameters = parameters ? parameters : {};
|
|
818
844
|
const request = {
|
|
819
|
-
method: '
|
|
845
|
+
method: 'POST',
|
|
846
|
+
path: requestPath,
|
|
847
|
+
queryParameters,
|
|
848
|
+
headers,
|
|
849
|
+
data: body ? body : {},
|
|
850
|
+
};
|
|
851
|
+
return transporter.request(request, requestOptions);
|
|
852
|
+
},
|
|
853
|
+
/**
|
|
854
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
855
|
+
*
|
|
856
|
+
* @summary Send requests to the Algolia REST API.
|
|
857
|
+
* @param customPut - The customPut object.
|
|
858
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
859
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
860
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
861
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
862
|
+
*/
|
|
863
|
+
customPut({ path, parameters, body }, requestOptions) {
|
|
864
|
+
if (!path) {
|
|
865
|
+
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
866
|
+
}
|
|
867
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
868
|
+
const headers = {};
|
|
869
|
+
const queryParameters = parameters ? parameters : {};
|
|
870
|
+
const request = {
|
|
871
|
+
method: 'PUT',
|
|
872
|
+
path: requestPath,
|
|
873
|
+
queryParameters,
|
|
874
|
+
headers,
|
|
875
|
+
data: body ? body : {},
|
|
876
|
+
};
|
|
877
|
+
return transporter.request(request, requestOptions);
|
|
878
|
+
},
|
|
879
|
+
/**
|
|
880
|
+
* Delete an A/B test. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
|
|
881
|
+
*
|
|
882
|
+
* @summary Delete an A/B test.
|
|
883
|
+
* @param deleteABTest - The deleteABTest object.
|
|
884
|
+
* @param deleteABTest.id - Unique A/B test ID.
|
|
885
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
886
|
+
*/
|
|
887
|
+
deleteABTest({ id }, requestOptions) {
|
|
888
|
+
if (!id) {
|
|
889
|
+
throw new Error('Parameter `id` is required when calling `deleteABTest`.');
|
|
890
|
+
}
|
|
891
|
+
const requestPath = '/2/abtests/{id}'.replace('{id}', encodeURIComponent(id));
|
|
892
|
+
const headers = {};
|
|
893
|
+
const queryParameters = {};
|
|
894
|
+
const request = {
|
|
895
|
+
method: 'DELETE',
|
|
820
896
|
path: requestPath,
|
|
821
897
|
queryParameters,
|
|
822
898
|
headers,
|
|
@@ -881,58 +957,6 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
881
957
|
};
|
|
882
958
|
return transporter.request(request, requestOptions);
|
|
883
959
|
},
|
|
884
|
-
/**
|
|
885
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
886
|
-
*
|
|
887
|
-
* @summary Send requests to the Algolia REST API.
|
|
888
|
-
* @param post - The post object.
|
|
889
|
-
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
890
|
-
* @param post.parameters - Query parameters to apply to the current query.
|
|
891
|
-
* @param post.body - Parameters to send with the custom request.
|
|
892
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
893
|
-
*/
|
|
894
|
-
post({ path, parameters, body }, requestOptions) {
|
|
895
|
-
if (!path) {
|
|
896
|
-
throw new Error('Parameter `path` is required when calling `post`.');
|
|
897
|
-
}
|
|
898
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
899
|
-
const headers = {};
|
|
900
|
-
const queryParameters = parameters ? parameters : {};
|
|
901
|
-
const request = {
|
|
902
|
-
method: 'POST',
|
|
903
|
-
path: requestPath,
|
|
904
|
-
queryParameters,
|
|
905
|
-
headers,
|
|
906
|
-
data: body ? body : {},
|
|
907
|
-
};
|
|
908
|
-
return transporter.request(request, requestOptions);
|
|
909
|
-
},
|
|
910
|
-
/**
|
|
911
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
912
|
-
*
|
|
913
|
-
* @summary Send requests to the Algolia REST API.
|
|
914
|
-
* @param put - The put object.
|
|
915
|
-
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
916
|
-
* @param put.parameters - Query parameters to apply to the current query.
|
|
917
|
-
* @param put.body - Parameters to send with the custom request.
|
|
918
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
919
|
-
*/
|
|
920
|
-
put({ path, parameters, body }, requestOptions) {
|
|
921
|
-
if (!path) {
|
|
922
|
-
throw new Error('Parameter `path` is required when calling `put`.');
|
|
923
|
-
}
|
|
924
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
925
|
-
const headers = {};
|
|
926
|
-
const queryParameters = parameters ? parameters : {};
|
|
927
|
-
const request = {
|
|
928
|
-
method: 'PUT',
|
|
929
|
-
path: requestPath,
|
|
930
|
-
queryParameters,
|
|
931
|
-
headers,
|
|
932
|
-
data: body ? body : {},
|
|
933
|
-
};
|
|
934
|
-
return transporter.request(request, requestOptions);
|
|
935
|
-
},
|
|
936
960
|
/**
|
|
937
961
|
* If stopped, the test is over and can\'t be restarted. There is now only one index, receiving 100% of all search requests. The data gathered for stopped A/B tests is retained. To determine the `id` for an A/B test, use the [`listABTests` operation](#tag/abtest/operation/listABTests).
|
|
938
962
|
*
|
|
@@ -960,7 +984,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
960
984
|
}
|
|
961
985
|
|
|
962
986
|
// 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.
|
|
963
|
-
const apiClientVersion$3 = '5.0.0-alpha.
|
|
987
|
+
const apiClientVersion$3 = '5.0.0-alpha.98';
|
|
964
988
|
const REGIONS$1 = ['de', 'us'];
|
|
965
989
|
function getDefaultHosts$2(region) {
|
|
966
990
|
const url = !region
|
|
@@ -1023,14 +1047,14 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1023
1047
|
* This method allow you to send requests to the Algolia REST API.
|
|
1024
1048
|
*
|
|
1025
1049
|
* @summary Send requests to the Algolia REST API.
|
|
1026
|
-
* @param
|
|
1027
|
-
* @param
|
|
1028
|
-
* @param
|
|
1050
|
+
* @param customDelete - The customDelete object.
|
|
1051
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1052
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
1029
1053
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1030
1054
|
*/
|
|
1031
|
-
|
|
1055
|
+
customDelete({ path, parameters }, requestOptions) {
|
|
1032
1056
|
if (!path) {
|
|
1033
|
-
throw new Error('Parameter `path` is required when calling `
|
|
1057
|
+
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
1034
1058
|
}
|
|
1035
1059
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
1036
1060
|
const headers = {};
|
|
@@ -1047,14 +1071,14 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1047
1071
|
* This method allow you to send requests to the Algolia REST API.
|
|
1048
1072
|
*
|
|
1049
1073
|
* @summary Send requests to the Algolia REST API.
|
|
1050
|
-
* @param
|
|
1051
|
-
* @param
|
|
1052
|
-
* @param
|
|
1074
|
+
* @param customGet - The customGet object.
|
|
1075
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1076
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
1053
1077
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1054
1078
|
*/
|
|
1055
|
-
|
|
1079
|
+
customGet({ path, parameters }, requestOptions) {
|
|
1056
1080
|
if (!path) {
|
|
1057
|
-
throw new Error('Parameter `path` is required when calling `
|
|
1081
|
+
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
1058
1082
|
}
|
|
1059
1083
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
1060
1084
|
const headers = {};
|
|
@@ -1067,6 +1091,58 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1067
1091
|
};
|
|
1068
1092
|
return transporter.request(request, requestOptions);
|
|
1069
1093
|
},
|
|
1094
|
+
/**
|
|
1095
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
1096
|
+
*
|
|
1097
|
+
* @summary Send requests to the Algolia REST API.
|
|
1098
|
+
* @param customPost - The customPost object.
|
|
1099
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1100
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
1101
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
1102
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1103
|
+
*/
|
|
1104
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
1105
|
+
if (!path) {
|
|
1106
|
+
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
1107
|
+
}
|
|
1108
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
1109
|
+
const headers = {};
|
|
1110
|
+
const queryParameters = parameters ? parameters : {};
|
|
1111
|
+
const request = {
|
|
1112
|
+
method: 'POST',
|
|
1113
|
+
path: requestPath,
|
|
1114
|
+
queryParameters,
|
|
1115
|
+
headers,
|
|
1116
|
+
data: body ? body : {},
|
|
1117
|
+
};
|
|
1118
|
+
return transporter.request(request, requestOptions);
|
|
1119
|
+
},
|
|
1120
|
+
/**
|
|
1121
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
1122
|
+
*
|
|
1123
|
+
* @summary Send requests to the Algolia REST API.
|
|
1124
|
+
* @param customPut - The customPut object.
|
|
1125
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1126
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
1127
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
1128
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1129
|
+
*/
|
|
1130
|
+
customPut({ path, parameters, body }, requestOptions) {
|
|
1131
|
+
if (!path) {
|
|
1132
|
+
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
1133
|
+
}
|
|
1134
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
1135
|
+
const headers = {};
|
|
1136
|
+
const queryParameters = parameters ? parameters : {};
|
|
1137
|
+
const request = {
|
|
1138
|
+
method: 'PUT',
|
|
1139
|
+
path: requestPath,
|
|
1140
|
+
queryParameters,
|
|
1141
|
+
headers,
|
|
1142
|
+
data: body ? body : {},
|
|
1143
|
+
};
|
|
1144
|
+
return transporter.request(request, requestOptions);
|
|
1145
|
+
},
|
|
1070
1146
|
/**
|
|
1071
1147
|
* Return the average click position for the complete time range and for individual days. > **Note**: If all `positions` have a `clickCount` of `0` or `null`, it means Algolia didn\'t receive any click events for tracked searches. A _tracked_ search is a search request where the `clickAnalytics` parameter is `true`.
|
|
1072
1148
|
*
|
|
@@ -1801,63 +1877,11 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1801
1877
|
};
|
|
1802
1878
|
return transporter.request(request, requestOptions);
|
|
1803
1879
|
},
|
|
1804
|
-
/**
|
|
1805
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
1806
|
-
*
|
|
1807
|
-
* @summary Send requests to the Algolia REST API.
|
|
1808
|
-
* @param post - The post object.
|
|
1809
|
-
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1810
|
-
* @param post.parameters - Query parameters to apply to the current query.
|
|
1811
|
-
* @param post.body - Parameters to send with the custom request.
|
|
1812
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1813
|
-
*/
|
|
1814
|
-
post({ path, parameters, body }, requestOptions) {
|
|
1815
|
-
if (!path) {
|
|
1816
|
-
throw new Error('Parameter `path` is required when calling `post`.');
|
|
1817
|
-
}
|
|
1818
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
1819
|
-
const headers = {};
|
|
1820
|
-
const queryParameters = parameters ? parameters : {};
|
|
1821
|
-
const request = {
|
|
1822
|
-
method: 'POST',
|
|
1823
|
-
path: requestPath,
|
|
1824
|
-
queryParameters,
|
|
1825
|
-
headers,
|
|
1826
|
-
data: body ? body : {},
|
|
1827
|
-
};
|
|
1828
|
-
return transporter.request(request, requestOptions);
|
|
1829
|
-
},
|
|
1830
|
-
/**
|
|
1831
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
1832
|
-
*
|
|
1833
|
-
* @summary Send requests to the Algolia REST API.
|
|
1834
|
-
* @param put - The put object.
|
|
1835
|
-
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1836
|
-
* @param put.parameters - Query parameters to apply to the current query.
|
|
1837
|
-
* @param put.body - Parameters to send with the custom request.
|
|
1838
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1839
|
-
*/
|
|
1840
|
-
put({ path, parameters, body }, requestOptions) {
|
|
1841
|
-
if (!path) {
|
|
1842
|
-
throw new Error('Parameter `path` is required when calling `put`.');
|
|
1843
|
-
}
|
|
1844
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
1845
|
-
const headers = {};
|
|
1846
|
-
const queryParameters = parameters ? parameters : {};
|
|
1847
|
-
const request = {
|
|
1848
|
-
method: 'PUT',
|
|
1849
|
-
path: requestPath,
|
|
1850
|
-
queryParameters,
|
|
1851
|
-
headers,
|
|
1852
|
-
data: body ? body : {},
|
|
1853
|
-
};
|
|
1854
|
-
return transporter.request(request, requestOptions);
|
|
1855
|
-
},
|
|
1856
1880
|
};
|
|
1857
1881
|
}
|
|
1858
1882
|
|
|
1859
1883
|
// 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.
|
|
1860
|
-
const apiClientVersion$2 = '5.0.0-alpha.
|
|
1884
|
+
const apiClientVersion$2 = '5.0.0-alpha.98';
|
|
1861
1885
|
const REGIONS = ['eu', 'us'];
|
|
1862
1886
|
function getDefaultHosts$1(region) {
|
|
1863
1887
|
const url = 'personalization.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -1918,14 +1942,14 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
1918
1942
|
* This method allow you to send requests to the Algolia REST API.
|
|
1919
1943
|
*
|
|
1920
1944
|
* @summary Send requests to the Algolia REST API.
|
|
1921
|
-
* @param
|
|
1922
|
-
* @param
|
|
1923
|
-
* @param
|
|
1945
|
+
* @param customDelete - The customDelete object.
|
|
1946
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1947
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
1924
1948
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1925
1949
|
*/
|
|
1926
|
-
|
|
1950
|
+
customDelete({ path, parameters }, requestOptions) {
|
|
1927
1951
|
if (!path) {
|
|
1928
|
-
throw new Error('Parameter `path` is required when calling `
|
|
1952
|
+
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
1929
1953
|
}
|
|
1930
1954
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
1931
1955
|
const headers = {};
|
|
@@ -1939,22 +1963,23 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
1939
1963
|
return transporter.request(request, requestOptions);
|
|
1940
1964
|
},
|
|
1941
1965
|
/**
|
|
1942
|
-
*
|
|
1966
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
1943
1967
|
*
|
|
1944
|
-
* @summary
|
|
1945
|
-
* @param
|
|
1946
|
-
* @param
|
|
1968
|
+
* @summary Send requests to the Algolia REST API.
|
|
1969
|
+
* @param customGet - The customGet object.
|
|
1970
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1971
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
1947
1972
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1948
1973
|
*/
|
|
1949
|
-
|
|
1950
|
-
if (!
|
|
1951
|
-
throw new Error('Parameter `
|
|
1974
|
+
customGet({ path, parameters }, requestOptions) {
|
|
1975
|
+
if (!path) {
|
|
1976
|
+
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
1952
1977
|
}
|
|
1953
|
-
const requestPath = '/1
|
|
1978
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
1954
1979
|
const headers = {};
|
|
1955
|
-
const queryParameters = {};
|
|
1980
|
+
const queryParameters = parameters ? parameters : {};
|
|
1956
1981
|
const request = {
|
|
1957
|
-
method: '
|
|
1982
|
+
method: 'GET',
|
|
1958
1983
|
path: requestPath,
|
|
1959
1984
|
queryParameters,
|
|
1960
1985
|
headers,
|
|
@@ -1965,61 +1990,71 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
1965
1990
|
* This method allow you to send requests to the Algolia REST API.
|
|
1966
1991
|
*
|
|
1967
1992
|
* @summary Send requests to the Algolia REST API.
|
|
1968
|
-
* @param
|
|
1969
|
-
* @param
|
|
1970
|
-
* @param
|
|
1993
|
+
* @param customPost - The customPost object.
|
|
1994
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
1995
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
1996
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
1971
1997
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1972
1998
|
*/
|
|
1973
|
-
|
|
1999
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
1974
2000
|
if (!path) {
|
|
1975
|
-
throw new Error('Parameter `path` is required when calling `
|
|
2001
|
+
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
1976
2002
|
}
|
|
1977
2003
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
1978
2004
|
const headers = {};
|
|
1979
2005
|
const queryParameters = parameters ? parameters : {};
|
|
1980
2006
|
const request = {
|
|
1981
|
-
method: '
|
|
2007
|
+
method: 'POST',
|
|
1982
2008
|
path: requestPath,
|
|
1983
2009
|
queryParameters,
|
|
1984
2010
|
headers,
|
|
2011
|
+
data: body ? body : {},
|
|
1985
2012
|
};
|
|
1986
2013
|
return transporter.request(request, requestOptions);
|
|
1987
2014
|
},
|
|
1988
2015
|
/**
|
|
1989
|
-
*
|
|
2016
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
1990
2017
|
*
|
|
1991
|
-
* @summary
|
|
2018
|
+
* @summary Send requests to the Algolia REST API.
|
|
2019
|
+
* @param customPut - The customPut object.
|
|
2020
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
2021
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
2022
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
1992
2023
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1993
2024
|
*/
|
|
1994
|
-
|
|
1995
|
-
|
|
2025
|
+
customPut({ path, parameters, body }, requestOptions) {
|
|
2026
|
+
if (!path) {
|
|
2027
|
+
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
2028
|
+
}
|
|
2029
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
1996
2030
|
const headers = {};
|
|
1997
|
-
const queryParameters = {};
|
|
2031
|
+
const queryParameters = parameters ? parameters : {};
|
|
1998
2032
|
const request = {
|
|
1999
|
-
method: '
|
|
2033
|
+
method: 'PUT',
|
|
2000
2034
|
path: requestPath,
|
|
2001
2035
|
queryParameters,
|
|
2002
2036
|
headers,
|
|
2037
|
+
data: body ? body : {},
|
|
2003
2038
|
};
|
|
2004
2039
|
return transporter.request(request, requestOptions);
|
|
2005
2040
|
},
|
|
2006
2041
|
/**
|
|
2007
|
-
*
|
|
2042
|
+
* Delete the user profile and all its associated data. Returns, as part of the response, a date until which the data can safely be considered as deleted for the given user. This means if you send events for the given user before this date, they will be ignored. Any data received after the deletedUntil date will start building a new user profile. It might take a couple hours for the deletion request to be fully processed.
|
|
2008
2043
|
*
|
|
2009
|
-
* @summary
|
|
2010
|
-
* @param
|
|
2011
|
-
* @param
|
|
2044
|
+
* @summary Delete a user profile.
|
|
2045
|
+
* @param deleteUserProfile - The deleteUserProfile object.
|
|
2046
|
+
* @param deleteUserProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
|
|
2012
2047
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2013
2048
|
*/
|
|
2014
|
-
|
|
2049
|
+
deleteUserProfile({ userToken }, requestOptions) {
|
|
2015
2050
|
if (!userToken) {
|
|
2016
|
-
throw new Error('Parameter `userToken` is required when calling `
|
|
2051
|
+
throw new Error('Parameter `userToken` is required when calling `deleteUserProfile`.');
|
|
2017
2052
|
}
|
|
2018
|
-
const requestPath = '/1/profiles/
|
|
2053
|
+
const requestPath = '/1/profiles/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));
|
|
2019
2054
|
const headers = {};
|
|
2020
2055
|
const queryParameters = {};
|
|
2021
2056
|
const request = {
|
|
2022
|
-
method: '
|
|
2057
|
+
method: 'DELETE',
|
|
2023
2058
|
path: requestPath,
|
|
2024
2059
|
queryParameters,
|
|
2025
2060
|
headers,
|
|
@@ -2027,54 +2062,43 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
2027
2062
|
return transporter.request(request, requestOptions);
|
|
2028
2063
|
},
|
|
2029
2064
|
/**
|
|
2030
|
-
*
|
|
2065
|
+
* The strategy contains information on the events and facets that impact user profiles and personalized search results.
|
|
2031
2066
|
*
|
|
2032
|
-
* @summary
|
|
2033
|
-
* @param post - The post object.
|
|
2034
|
-
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
2035
|
-
* @param post.parameters - Query parameters to apply to the current query.
|
|
2036
|
-
* @param post.body - Parameters to send with the custom request.
|
|
2067
|
+
* @summary Get the current strategy.
|
|
2037
2068
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2038
2069
|
*/
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
throw new Error('Parameter `path` is required when calling `post`.');
|
|
2042
|
-
}
|
|
2043
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
2070
|
+
getPersonalizationStrategy(requestOptions) {
|
|
2071
|
+
const requestPath = '/1/strategies/personalization';
|
|
2044
2072
|
const headers = {};
|
|
2045
|
-
const queryParameters =
|
|
2073
|
+
const queryParameters = {};
|
|
2046
2074
|
const request = {
|
|
2047
|
-
method: '
|
|
2075
|
+
method: 'GET',
|
|
2048
2076
|
path: requestPath,
|
|
2049
2077
|
queryParameters,
|
|
2050
2078
|
headers,
|
|
2051
|
-
data: body ? body : {},
|
|
2052
2079
|
};
|
|
2053
2080
|
return transporter.request(request, requestOptions);
|
|
2054
2081
|
},
|
|
2055
2082
|
/**
|
|
2056
|
-
*
|
|
2083
|
+
* Get the user profile built from Personalization strategy. The profile is structured by facet name used in the strategy. Each facet value is mapped to its score. Each score represents the user affinity for a specific facet value given the userToken past events and the Personalization strategy defined. Scores are bounded to 20. The last processed event timestamp is provided using the ISO 8601 format for debugging purposes.
|
|
2057
2084
|
*
|
|
2058
|
-
* @summary
|
|
2059
|
-
* @param
|
|
2060
|
-
* @param
|
|
2061
|
-
* @param put.parameters - Query parameters to apply to the current query.
|
|
2062
|
-
* @param put.body - Parameters to send with the custom request.
|
|
2085
|
+
* @summary Get a user profile.
|
|
2086
|
+
* @param getUserTokenProfile - The getUserTokenProfile object.
|
|
2087
|
+
* @param getUserTokenProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
|
|
2063
2088
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2064
2089
|
*/
|
|
2065
|
-
|
|
2066
|
-
if (!
|
|
2067
|
-
throw new Error('Parameter `
|
|
2090
|
+
getUserTokenProfile({ userToken }, requestOptions) {
|
|
2091
|
+
if (!userToken) {
|
|
2092
|
+
throw new Error('Parameter `userToken` is required when calling `getUserTokenProfile`.');
|
|
2068
2093
|
}
|
|
2069
|
-
const requestPath = '/1{
|
|
2094
|
+
const requestPath = '/1/profiles/personalization/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));
|
|
2070
2095
|
const headers = {};
|
|
2071
|
-
const queryParameters =
|
|
2096
|
+
const queryParameters = {};
|
|
2072
2097
|
const request = {
|
|
2073
|
-
method: '
|
|
2098
|
+
method: 'GET',
|
|
2074
2099
|
path: requestPath,
|
|
2075
2100
|
queryParameters,
|
|
2076
2101
|
headers,
|
|
2077
|
-
data: body ? body : {},
|
|
2078
2102
|
};
|
|
2079
2103
|
return transporter.request(request, requestOptions);
|
|
2080
2104
|
},
|
|
@@ -2114,7 +2138,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
2114
2138
|
}
|
|
2115
2139
|
|
|
2116
2140
|
// 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.
|
|
2117
|
-
const apiClientVersion$1 = '5.0.0-alpha.
|
|
2141
|
+
const apiClientVersion$1 = '5.0.0-alpha.98';
|
|
2118
2142
|
function getDefaultHosts(appId) {
|
|
2119
2143
|
return [
|
|
2120
2144
|
{
|
|
@@ -2339,21 +2363,25 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2339
2363
|
* @param browseObjects.indexName - The index in which to perform the request.
|
|
2340
2364
|
* @param browseObjects.validate - The validator function. It receive the resolved return of the API call. By default, stops when there is less hits returned than the number of maximum hits (1000).
|
|
2341
2365
|
* @param browseObjects.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.
|
|
2366
|
+
* @param browseObjects.searchSynonymsParams - The `searchSynonyms` method parameters.
|
|
2342
2367
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `searchSynonyms` method and merged with the transporter requestOptions.
|
|
2343
2368
|
*/
|
|
2344
|
-
browseSynonyms({ indexName,
|
|
2369
|
+
browseSynonyms({ indexName, searchSynonymsParams, ...browseSynonymsOptions }, requestOptions) {
|
|
2345
2370
|
const params = {
|
|
2371
|
+
page: 0,
|
|
2372
|
+
...searchSynonymsParams,
|
|
2346
2373
|
hitsPerPage: 1000,
|
|
2347
|
-
...browseSynonymsOptions,
|
|
2348
2374
|
};
|
|
2349
2375
|
return createIterablePromise({
|
|
2350
2376
|
func: (previousResponse) => {
|
|
2351
2377
|
return this.searchSynonyms({
|
|
2352
|
-
...params,
|
|
2353
2378
|
indexName,
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
:
|
|
2379
|
+
searchSynonymsParams: {
|
|
2380
|
+
...params,
|
|
2381
|
+
page: previousResponse
|
|
2382
|
+
? previousResponse.page + 1
|
|
2383
|
+
: params.page,
|
|
2384
|
+
},
|
|
2357
2385
|
}, requestOptions);
|
|
2358
2386
|
},
|
|
2359
2387
|
validate: (response) => response.nbHits < params.hitsPerPage,
|
|
@@ -2627,24 +2655,20 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2627
2655
|
return transporter.request(request, requestOptions);
|
|
2628
2656
|
},
|
|
2629
2657
|
/**
|
|
2630
|
-
* Delete
|
|
2658
|
+
* Delete the records but leave settings and index-specific API keys untouched.
|
|
2631
2659
|
*
|
|
2632
|
-
* @summary Delete all
|
|
2633
|
-
* @param
|
|
2634
|
-
* @param
|
|
2635
|
-
* @param clearAllSynonyms.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
|
|
2660
|
+
* @summary Delete all records from an index.
|
|
2661
|
+
* @param clearObjects - The clearObjects object.
|
|
2662
|
+
* @param clearObjects.indexName - Index on which to perform the request.
|
|
2636
2663
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2637
2664
|
*/
|
|
2638
|
-
|
|
2665
|
+
clearObjects({ indexName }, requestOptions) {
|
|
2639
2666
|
if (!indexName) {
|
|
2640
|
-
throw new Error('Parameter `indexName` is required when calling `
|
|
2667
|
+
throw new Error('Parameter `indexName` is required when calling `clearObjects`.');
|
|
2641
2668
|
}
|
|
2642
|
-
const requestPath = '/1/indexes/{indexName}/
|
|
2669
|
+
const requestPath = '/1/indexes/{indexName}/clear'.replace('{indexName}', encodeURIComponent(indexName));
|
|
2643
2670
|
const headers = {};
|
|
2644
2671
|
const queryParameters = {};
|
|
2645
|
-
if (forwardToReplicas !== undefined) {
|
|
2646
|
-
queryParameters.forwardToReplicas = forwardToReplicas.toString();
|
|
2647
|
-
}
|
|
2648
2672
|
const request = {
|
|
2649
2673
|
method: 'POST',
|
|
2650
2674
|
path: requestPath,
|
|
@@ -2654,20 +2678,24 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2654
2678
|
return transporter.request(request, requestOptions);
|
|
2655
2679
|
},
|
|
2656
2680
|
/**
|
|
2657
|
-
* Delete
|
|
2681
|
+
* Delete all rules in the index.
|
|
2658
2682
|
*
|
|
2659
|
-
* @summary Delete all
|
|
2660
|
-
* @param
|
|
2661
|
-
* @param
|
|
2683
|
+
* @summary Delete all rules.
|
|
2684
|
+
* @param clearRules - The clearRules object.
|
|
2685
|
+
* @param clearRules.indexName - Index on which to perform the request.
|
|
2686
|
+
* @param clearRules.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
|
|
2662
2687
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2663
2688
|
*/
|
|
2664
|
-
|
|
2689
|
+
clearRules({ indexName, forwardToReplicas }, requestOptions) {
|
|
2665
2690
|
if (!indexName) {
|
|
2666
|
-
throw new Error('Parameter `indexName` is required when calling `
|
|
2691
|
+
throw new Error('Parameter `indexName` is required when calling `clearRules`.');
|
|
2667
2692
|
}
|
|
2668
|
-
const requestPath = '/1/indexes/{indexName}/clear'.replace('{indexName}', encodeURIComponent(indexName));
|
|
2693
|
+
const requestPath = '/1/indexes/{indexName}/rules/clear'.replace('{indexName}', encodeURIComponent(indexName));
|
|
2669
2694
|
const headers = {};
|
|
2670
2695
|
const queryParameters = {};
|
|
2696
|
+
if (forwardToReplicas !== undefined) {
|
|
2697
|
+
queryParameters.forwardToReplicas = forwardToReplicas.toString();
|
|
2698
|
+
}
|
|
2671
2699
|
const request = {
|
|
2672
2700
|
method: 'POST',
|
|
2673
2701
|
path: requestPath,
|
|
@@ -2677,19 +2705,19 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2677
2705
|
return transporter.request(request, requestOptions);
|
|
2678
2706
|
},
|
|
2679
2707
|
/**
|
|
2680
|
-
* Delete all
|
|
2708
|
+
* Delete all synonyms in the index.
|
|
2681
2709
|
*
|
|
2682
|
-
* @summary Delete all
|
|
2683
|
-
* @param
|
|
2684
|
-
* @param
|
|
2685
|
-
* @param
|
|
2710
|
+
* @summary Delete all synonyms.
|
|
2711
|
+
* @param clearSynonyms - The clearSynonyms object.
|
|
2712
|
+
* @param clearSynonyms.indexName - Index on which to perform the request.
|
|
2713
|
+
* @param clearSynonyms.forwardToReplicas - Indicates whether changed index settings are forwarded to the replica indices.
|
|
2686
2714
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2687
2715
|
*/
|
|
2688
|
-
|
|
2716
|
+
clearSynonyms({ indexName, forwardToReplicas }, requestOptions) {
|
|
2689
2717
|
if (!indexName) {
|
|
2690
|
-
throw new Error('Parameter `indexName` is required when calling `
|
|
2718
|
+
throw new Error('Parameter `indexName` is required when calling `clearSynonyms`.');
|
|
2691
2719
|
}
|
|
2692
|
-
const requestPath = '/1/indexes/{indexName}/
|
|
2720
|
+
const requestPath = '/1/indexes/{indexName}/synonyms/clear'.replace('{indexName}', encodeURIComponent(indexName));
|
|
2693
2721
|
const headers = {};
|
|
2694
2722
|
const queryParameters = {};
|
|
2695
2723
|
if (forwardToReplicas !== undefined) {
|
|
@@ -2707,14 +2735,14 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2707
2735
|
* This method allow you to send requests to the Algolia REST API.
|
|
2708
2736
|
*
|
|
2709
2737
|
* @summary Send requests to the Algolia REST API.
|
|
2710
|
-
* @param
|
|
2711
|
-
* @param
|
|
2712
|
-
* @param
|
|
2738
|
+
* @param customDelete - The customDelete object.
|
|
2739
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
2740
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
2713
2741
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2714
2742
|
*/
|
|
2715
|
-
|
|
2743
|
+
customDelete({ path, parameters }, requestOptions) {
|
|
2716
2744
|
if (!path) {
|
|
2717
|
-
throw new Error('Parameter `path` is required when calling `
|
|
2745
|
+
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
2718
2746
|
}
|
|
2719
2747
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
2720
2748
|
const headers = {};
|
|
@@ -2727,6 +2755,82 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2727
2755
|
};
|
|
2728
2756
|
return transporter.request(request, requestOptions);
|
|
2729
2757
|
},
|
|
2758
|
+
/**
|
|
2759
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
2760
|
+
*
|
|
2761
|
+
* @summary Send requests to the Algolia REST API.
|
|
2762
|
+
* @param customGet - The customGet object.
|
|
2763
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
2764
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
2765
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2766
|
+
*/
|
|
2767
|
+
customGet({ path, parameters }, requestOptions) {
|
|
2768
|
+
if (!path) {
|
|
2769
|
+
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
2770
|
+
}
|
|
2771
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
2772
|
+
const headers = {};
|
|
2773
|
+
const queryParameters = parameters ? parameters : {};
|
|
2774
|
+
const request = {
|
|
2775
|
+
method: 'GET',
|
|
2776
|
+
path: requestPath,
|
|
2777
|
+
queryParameters,
|
|
2778
|
+
headers,
|
|
2779
|
+
};
|
|
2780
|
+
return transporter.request(request, requestOptions);
|
|
2781
|
+
},
|
|
2782
|
+
/**
|
|
2783
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
2784
|
+
*
|
|
2785
|
+
* @summary Send requests to the Algolia REST API.
|
|
2786
|
+
* @param customPost - The customPost object.
|
|
2787
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
2788
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
2789
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
2790
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2791
|
+
*/
|
|
2792
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
2793
|
+
if (!path) {
|
|
2794
|
+
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
2795
|
+
}
|
|
2796
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
2797
|
+
const headers = {};
|
|
2798
|
+
const queryParameters = parameters ? parameters : {};
|
|
2799
|
+
const request = {
|
|
2800
|
+
method: 'POST',
|
|
2801
|
+
path: requestPath,
|
|
2802
|
+
queryParameters,
|
|
2803
|
+
headers,
|
|
2804
|
+
data: body ? body : {},
|
|
2805
|
+
};
|
|
2806
|
+
return transporter.request(request, requestOptions);
|
|
2807
|
+
},
|
|
2808
|
+
/**
|
|
2809
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
2810
|
+
*
|
|
2811
|
+
* @summary Send requests to the Algolia REST API.
|
|
2812
|
+
* @param customPut - The customPut object.
|
|
2813
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
2814
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
2815
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
2816
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2817
|
+
*/
|
|
2818
|
+
customPut({ path, parameters, body }, requestOptions) {
|
|
2819
|
+
if (!path) {
|
|
2820
|
+
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
2821
|
+
}
|
|
2822
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
2823
|
+
const headers = {};
|
|
2824
|
+
const queryParameters = parameters ? parameters : {};
|
|
2825
|
+
const request = {
|
|
2826
|
+
method: 'PUT',
|
|
2827
|
+
path: requestPath,
|
|
2828
|
+
queryParameters,
|
|
2829
|
+
headers,
|
|
2830
|
+
data: body ? body : {},
|
|
2831
|
+
};
|
|
2832
|
+
return transporter.request(request, requestOptions);
|
|
2833
|
+
},
|
|
2730
2834
|
/**
|
|
2731
2835
|
* Delete an existing API key. The request must be authenticated with the admin API key.
|
|
2732
2836
|
*
|
|
@@ -2919,30 +3023,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2919
3023
|
};
|
|
2920
3024
|
return transporter.request(request, requestOptions);
|
|
2921
3025
|
},
|
|
2922
|
-
/**
|
|
2923
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
2924
|
-
*
|
|
2925
|
-
* @summary Send requests to the Algolia REST API.
|
|
2926
|
-
* @param get - The get object.
|
|
2927
|
-
* @param get.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
2928
|
-
* @param get.parameters - Query parameters to apply to the current query.
|
|
2929
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2930
|
-
*/
|
|
2931
|
-
get({ path, parameters }, requestOptions) {
|
|
2932
|
-
if (!path) {
|
|
2933
|
-
throw new Error('Parameter `path` is required when calling `get`.');
|
|
2934
|
-
}
|
|
2935
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
2936
|
-
const headers = {};
|
|
2937
|
-
const queryParameters = parameters ? parameters : {};
|
|
2938
|
-
const request = {
|
|
2939
|
-
method: 'GET',
|
|
2940
|
-
path: requestPath,
|
|
2941
|
-
queryParameters,
|
|
2942
|
-
headers,
|
|
2943
|
-
};
|
|
2944
|
-
return transporter.request(request, requestOptions);
|
|
2945
|
-
},
|
|
2946
3026
|
/**
|
|
2947
3027
|
* Get the permissions and restrictions of a specific API key. When authenticating with the admin API key, you can request information for any of your application\'s keys. When authenticating with other API keys, you can only retrieve information for that key.
|
|
2948
3028
|
*
|
|
@@ -3478,58 +3558,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3478
3558
|
};
|
|
3479
3559
|
return transporter.request(request, requestOptions);
|
|
3480
3560
|
},
|
|
3481
|
-
/**
|
|
3482
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
3483
|
-
*
|
|
3484
|
-
* @summary Send requests to the Algolia REST API.
|
|
3485
|
-
* @param post - The post object.
|
|
3486
|
-
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
3487
|
-
* @param post.parameters - Query parameters to apply to the current query.
|
|
3488
|
-
* @param post.body - Parameters to send with the custom request.
|
|
3489
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3490
|
-
*/
|
|
3491
|
-
post({ path, parameters, body }, requestOptions) {
|
|
3492
|
-
if (!path) {
|
|
3493
|
-
throw new Error('Parameter `path` is required when calling `post`.');
|
|
3494
|
-
}
|
|
3495
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
3496
|
-
const headers = {};
|
|
3497
|
-
const queryParameters = parameters ? parameters : {};
|
|
3498
|
-
const request = {
|
|
3499
|
-
method: 'POST',
|
|
3500
|
-
path: requestPath,
|
|
3501
|
-
queryParameters,
|
|
3502
|
-
headers,
|
|
3503
|
-
data: body ? body : {},
|
|
3504
|
-
};
|
|
3505
|
-
return transporter.request(request, requestOptions);
|
|
3506
|
-
},
|
|
3507
|
-
/**
|
|
3508
|
-
* This method allow you to send requests to the Algolia REST API.
|
|
3509
|
-
*
|
|
3510
|
-
* @summary Send requests to the Algolia REST API.
|
|
3511
|
-
* @param put - The put object.
|
|
3512
|
-
* @param put.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
3513
|
-
* @param put.parameters - Query parameters to apply to the current query.
|
|
3514
|
-
* @param put.body - Parameters to send with the custom request.
|
|
3515
|
-
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3516
|
-
*/
|
|
3517
|
-
put({ path, parameters, body }, requestOptions) {
|
|
3518
|
-
if (!path) {
|
|
3519
|
-
throw new Error('Parameter `path` is required when calling `put`.');
|
|
3520
|
-
}
|
|
3521
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
3522
|
-
const headers = {};
|
|
3523
|
-
const queryParameters = parameters ? parameters : {};
|
|
3524
|
-
const request = {
|
|
3525
|
-
method: 'PUT',
|
|
3526
|
-
path: requestPath,
|
|
3527
|
-
queryParameters,
|
|
3528
|
-
headers,
|
|
3529
|
-
data: body ? body : {},
|
|
3530
|
-
};
|
|
3531
|
-
return transporter.request(request, requestOptions);
|
|
3532
|
-
},
|
|
3533
3561
|
/**
|
|
3534
3562
|
* Remove a userID and its associated data from the multi-clusters.
|
|
3535
3563
|
*
|
|
@@ -3962,28 +3990,16 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3962
3990
|
* @summary Search for synonyms.
|
|
3963
3991
|
* @param searchSynonyms - The searchSynonyms object.
|
|
3964
3992
|
* @param searchSynonyms.indexName - Index on which to perform the request.
|
|
3965
|
-
* @param searchSynonyms.type - Search for specific [types of synonyms](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/#the-different-types-of-synonyms).
|
|
3966
|
-
* @param searchSynonyms.page - Returns the requested page number (the first page is 0). Page size is set by `hitsPerPage`. When null, there\'s no pagination.
|
|
3967
|
-
* @param searchSynonyms.hitsPerPage - Maximum number of hits per page.
|
|
3968
3993
|
* @param searchSynonyms.searchSynonymsParams - Body of the `searchSynonyms` operation.
|
|
3969
3994
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3970
3995
|
*/
|
|
3971
|
-
searchSynonyms({ indexName,
|
|
3996
|
+
searchSynonyms({ indexName, searchSynonymsParams }, requestOptions) {
|
|
3972
3997
|
if (!indexName) {
|
|
3973
3998
|
throw new Error('Parameter `indexName` is required when calling `searchSynonyms`.');
|
|
3974
3999
|
}
|
|
3975
4000
|
const requestPath = '/1/indexes/{indexName}/synonyms/search'.replace('{indexName}', encodeURIComponent(indexName));
|
|
3976
4001
|
const headers = {};
|
|
3977
4002
|
const queryParameters = {};
|
|
3978
|
-
if (type !== undefined) {
|
|
3979
|
-
queryParameters.type = type.toString();
|
|
3980
|
-
}
|
|
3981
|
-
if (page !== undefined) {
|
|
3982
|
-
queryParameters.page = page.toString();
|
|
3983
|
-
}
|
|
3984
|
-
if (hitsPerPage !== undefined) {
|
|
3985
|
-
queryParameters.hitsPerPage = hitsPerPage.toString();
|
|
3986
|
-
}
|
|
3987
4003
|
const request = {
|
|
3988
4004
|
method: 'POST',
|
|
3989
4005
|
path: requestPath,
|