@algolia/client-search 5.1.1 → 5.2.2
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 +1 -1
- package/dist/builds/browser.d.ts +12 -12
- package/dist/builds/browser.d.ts.map +1 -1
- package/dist/builds/node.d.ts +14 -14
- package/dist/builds/node.d.ts.map +1 -1
- package/dist/client-search.cjs +19 -30
- package/dist/client-search.esm.browser.js +24 -34
- package/dist/client-search.esm.node.js +19 -30
- package/dist/client-search.umd.js +2 -2
- package/dist/model/alternativesAsExact.d.ts.map +1 -1
- package/dist/model/baseIndexSettings.d.ts +2 -2
- package/dist/model/baseIndexSettings.d.ts.map +1 -1
- package/dist/model/baseSearchResponse.d.ts +4 -4
- package/dist/model/baseSearchResponse.d.ts.map +1 -1
- package/dist/model/batchRequest.d.ts +1 -1
- package/dist/model/batchRequest.d.ts.map +1 -1
- package/dist/model/browseResponse.d.ts.map +1 -1
- package/dist/model/clientMethodProps.d.ts +5 -6
- package/dist/model/clientMethodProps.d.ts.map +1 -1
- package/dist/model/consequenceParams.d.ts.map +1 -1
- package/dist/model/{facetsStats.d.ts → facetStats.d.ts} +2 -2
- package/dist/model/facetStats.d.ts.map +1 -0
- package/dist/model/index.d.ts +1 -1
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/multipleBatchRequest.d.ts +1 -1
- package/dist/model/multipleBatchRequest.d.ts.map +1 -1
- package/dist/model/removeWordsIfNoResults.d.ts.map +1 -1
- package/dist/model/searchResponse.d.ts.map +1 -1
- package/dist/model/searchResult.d.ts.map +1 -1
- package/dist/model/synonymType.d.ts.map +1 -1
- package/dist/src/searchClient.d.ts +14 -14
- package/dist/src/searchClient.d.ts.map +1 -1
- package/model/alternativesAsExact.ts +1 -4
- package/model/baseIndexSettings.ts +2 -2
- package/model/baseSearchResponse.ts +4 -4
- package/model/batchRequest.ts +1 -1
- package/model/browseResponse.ts +1 -4
- package/model/clientMethodProps.ts +8 -17
- package/model/consequenceParams.ts +1 -3
- package/model/{facetsStats.ts → facetStats.ts} +1 -1
- package/model/index.ts +1 -1
- package/model/multipleBatchRequest.ts +1 -1
- package/model/removeWordsIfNoResults.ts +1 -5
- package/model/searchResponse.ts +1 -3
- package/model/searchResult.ts +1 -3
- package/model/synonymType.ts +1 -6
- package/package.json +7 -7
- package/dist/model/facetsStats.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<a href="https://npmjs.org/package/@algolia/client-search"><img src="https://img.shields.io/npm/v/@algolia/client-search.svg?style=flat-square" alt="NPM version"></img></a>
|
|
10
10
|
<a href="http://npm-stat.com/charts.html?package=@algolia/client-search"><img src="https://img.shields.io/npm/dm/@algolia/client-search.svg?style=flat-square" alt="NPM downloads"></a>
|
|
11
11
|
<a href="https://www.jsdelivr.com/package/npm/@algolia/client-search"><img src="https://data.jsdelivr.com/v1/package/npm/@algolia/client-search/badge" alt="jsDelivr Downloads"></img></a>
|
|
12
|
-
<a href="LICENSE
|
|
12
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat-square" alt="License"></a>
|
|
13
13
|
</p>
|
|
14
14
|
</p>
|
|
15
15
|
|
package/dist/builds/browser.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare function searchClient(appId: string, apiKey: string, options?: Cl
|
|
|
17
17
|
browseObjects<T>({ indexName, browseParams, ...browseObjectsOptions }: import("../model").BrowseOptions<import("../model").BrowseResponse<T>> & import("../model").BrowseProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BrowseResponse<T>>;
|
|
18
18
|
browseRules({ indexName, searchRulesParams, ...browseRulesOptions }: import("../model").BrowseOptions<import("../model").SearchRulesResponse> & import("../model").SearchRulesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchRulesResponse>;
|
|
19
19
|
browseSynonyms({ indexName, searchSynonymsParams, ...browseSynonymsOptions }: import("../model").BrowseOptions<import("../model").SearchSynonymsResponse> & import("../model").SearchSynonymsProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchSynonymsResponse>;
|
|
20
|
-
chunkedBatch({ indexName, objects, action, waitForTasks, batchSize
|
|
20
|
+
chunkedBatch({ indexName, objects, action, waitForTasks, batchSize }: import("../model").ChunkedBatchOptions, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BatchResponse[]>;
|
|
21
21
|
saveObjects({ indexName, objects }: import("../model").SaveObjectsOptions, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BatchResponse[]>;
|
|
22
22
|
deleteObjects({ indexName, objectIDs }: import("../model").DeleteObjectsOptions, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BatchResponse[]>;
|
|
23
23
|
partialUpdateObjects({ indexName, objects, createIfNotExists }: import("../model").PartialUpdateObjectsOptions, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BatchResponse[]>;
|
|
@@ -34,15 +34,15 @@ export declare function searchClient(appId: string, apiKey: string, options?: Cl
|
|
|
34
34
|
assignUserId({ xAlgoliaUserID, assignUserIdParams }: import("../model").AssignUserIdProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").CreatedAtResponse>;
|
|
35
35
|
batch({ indexName, batchWriteParams }: import("../model").BatchProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BatchResponse>;
|
|
36
36
|
batchAssignUserIds({ xAlgoliaUserID, batchAssignUserIdsParams }: import("../model").BatchAssignUserIdsProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").CreatedAtResponse>;
|
|
37
|
-
batchDictionaryEntries({ dictionaryName, batchDictionaryEntriesParams
|
|
37
|
+
batchDictionaryEntries({ dictionaryName, batchDictionaryEntriesParams }: import("../model").BatchDictionaryEntriesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedAtResponse>;
|
|
38
38
|
browse<T>({ indexName, browseParams }: import("../model").BrowseProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BrowseResponse<T>>;
|
|
39
39
|
clearObjects({ indexName }: import("../model").ClearObjectsProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedAtResponse>;
|
|
40
40
|
clearRules({ indexName, forwardToReplicas }: import("../model").ClearRulesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedAtResponse>;
|
|
41
41
|
clearSynonyms({ indexName, forwardToReplicas }: import("../model").ClearSynonymsProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedAtResponse>;
|
|
42
|
-
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string,
|
|
43
|
-
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string,
|
|
44
|
-
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string,
|
|
45
|
-
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string,
|
|
42
|
+
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
43
|
+
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
44
|
+
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
45
|
+
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
46
46
|
deleteApiKey({ key }: import("../model").DeleteApiKeyProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").DeleteApiKeyResponse>;
|
|
47
47
|
deleteBy({ indexName, deleteByParams }: import("../model").DeleteByProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").DeletedAtResponse>;
|
|
48
48
|
deleteIndex({ indexName }: import("../model").DeleteIndexProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").DeletedAtResponse>;
|
|
@@ -55,7 +55,7 @@ export declare function searchClient(appId: string, apiKey: string, options?: Cl
|
|
|
55
55
|
getDictionaryLanguages(requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, import("../model").Languages>>;
|
|
56
56
|
getDictionarySettings(requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").GetDictionarySettingsResponse>;
|
|
57
57
|
getLogs({ offset, length, indexName, type }?: import("../model").GetLogsProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").GetLogsResponse>;
|
|
58
|
-
getObject({ indexName, objectID, attributesToRetrieve }: import("../model").GetObjectProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string,
|
|
58
|
+
getObject({ indexName, objectID, attributesToRetrieve }: import("../model").GetObjectProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
59
59
|
getObjects<T>(getObjectsParams: import("../model").GetObjectsParams, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").GetObjectsResponse<T>>;
|
|
60
60
|
getRule({ indexName, objectID }: import("../model").GetRuleProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").Rule>;
|
|
61
61
|
getSettings({ indexName }: import("../model").GetSettingsProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SettingsResponse>;
|
|
@@ -71,18 +71,18 @@ export declare function searchClient(appId: string, apiKey: string, options?: Cl
|
|
|
71
71
|
listUserIds({ page, hitsPerPage }?: import("../model").ListUserIdsProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").ListUserIdsResponse>;
|
|
72
72
|
multipleBatch(batchParams: import("../model").BatchParams, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").MultipleBatchResponse>;
|
|
73
73
|
operationIndex({ indexName, operationIndexParams }: import("../model").OperationIndexProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedAtResponse>;
|
|
74
|
-
partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists
|
|
74
|
+
partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists }: import("../model").PartialUpdateObjectProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedAtWithObjectIdResponse>;
|
|
75
75
|
removeUserId({ userID }: import("../model").RemoveUserIdProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").RemoveUserIdResponse>;
|
|
76
76
|
replaceSources({ source }: import("../model").ReplaceSourcesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ReplaceSourceResponse>;
|
|
77
77
|
restoreApiKey({ key }: import("../model").RestoreApiKeyProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").AddApiKeyResponse>;
|
|
78
78
|
saveObject({ indexName, body }: import("../model").SaveObjectProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SaveObjectResponse>;
|
|
79
79
|
saveRule({ indexName, objectID, rule, forwardToReplicas }: import("../model").SaveRuleProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedRuleResponse>;
|
|
80
|
-
saveRules({ indexName, rules, forwardToReplicas, clearExistingRules
|
|
80
|
+
saveRules({ indexName, rules, forwardToReplicas, clearExistingRules }: import("../model").SaveRulesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedAtResponse>;
|
|
81
81
|
saveSynonym({ indexName, objectID, synonymHit, forwardToReplicas }: import("../model").SaveSynonymProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SaveSynonymResponse>;
|
|
82
|
-
saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms
|
|
82
|
+
saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms }: import("../model").SaveSynonymsProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedAtResponse>;
|
|
83
83
|
search<T>(searchMethodParams: import("../model").LegacySearchMethodProps | import("../model").SearchMethodParams, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchResponses<T>>;
|
|
84
|
-
searchDictionaryEntries({ dictionaryName, searchDictionaryEntriesParams
|
|
85
|
-
searchForFacetValues({ indexName, facetName, searchForFacetValuesRequest
|
|
84
|
+
searchDictionaryEntries({ dictionaryName, searchDictionaryEntriesParams }: import("../model").SearchDictionaryEntriesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchDictionaryEntriesResponse>;
|
|
85
|
+
searchForFacetValues({ indexName, facetName, searchForFacetValuesRequest }: import("../model").SearchForFacetValuesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchForFacetValuesResponse>;
|
|
86
86
|
searchRules({ indexName, searchRulesParams }: import("../model").SearchRulesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchRulesResponse>;
|
|
87
87
|
searchSingleIndex<T>({ indexName, searchParams }: import("../model").SearchSingleIndexProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchResponse<T>>;
|
|
88
88
|
searchSynonyms({ indexName, searchSynonymsParams }: import("../model").SearchSynonymsProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchSynonymsResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../builds/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAa5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAG3D,wBAAgB,YAAY,
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../builds/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAa5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAG3D,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BlF"}
|
package/dist/builds/node.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare function searchClient(appId: string, apiKey: string, options?: Cl
|
|
|
15
15
|
* @param generateSecuredApiKey.parentApiKey - The base API key from which to generate the new secured one.
|
|
16
16
|
* @param generateSecuredApiKey.restrictions - A set of properties defining the restrictions of the secured API key.
|
|
17
17
|
*/
|
|
18
|
-
generateSecuredApiKey({ parentApiKey, restrictions
|
|
18
|
+
generateSecuredApiKey({ parentApiKey, restrictions }: GenerateSecuredApiKeyOptions): string;
|
|
19
19
|
/**
|
|
20
20
|
* Helper: Retrieves the remaining validity of the previous generated `securedApiKey`, the `ValidUntil` parameter must have been provided.
|
|
21
21
|
*
|
|
@@ -23,7 +23,7 @@ export declare function searchClient(appId: string, apiKey: string, options?: Cl
|
|
|
23
23
|
* @param getSecuredApiKeyRemainingValidity - The `getSecuredApiKeyRemainingValidity` object.
|
|
24
24
|
* @param getSecuredApiKeyRemainingValidity.securedApiKey - The secured API key generated with the `generateSecuredApiKey` method.
|
|
25
25
|
*/
|
|
26
|
-
getSecuredApiKeyRemainingValidity({ securedApiKey
|
|
26
|
+
getSecuredApiKeyRemainingValidity({ securedApiKey }: GetSecuredApiKeyRemainingValidityOptions): number;
|
|
27
27
|
transporter: import("@algolia/client-common").Transporter;
|
|
28
28
|
appId: string;
|
|
29
29
|
clearCache(): Promise<void>;
|
|
@@ -35,7 +35,7 @@ export declare function searchClient(appId: string, apiKey: string, options?: Cl
|
|
|
35
35
|
browseObjects<T>({ indexName, browseParams, ...browseObjectsOptions }: import("../model").BrowseOptions<import("../model").BrowseResponse<T>> & import("../model").BrowseProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BrowseResponse<T>>;
|
|
36
36
|
browseRules({ indexName, searchRulesParams, ...browseRulesOptions }: import("../model").BrowseOptions<import("../model").SearchRulesResponse> & import("../model").SearchRulesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchRulesResponse>;
|
|
37
37
|
browseSynonyms({ indexName, searchSynonymsParams, ...browseSynonymsOptions }: import("../model").BrowseOptions<import("../model").SearchSynonymsResponse> & import("../model").SearchSynonymsProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchSynonymsResponse>;
|
|
38
|
-
chunkedBatch({ indexName, objects, action, waitForTasks, batchSize
|
|
38
|
+
chunkedBatch({ indexName, objects, action, waitForTasks, batchSize }: import("../model").ChunkedBatchOptions, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BatchResponse[]>;
|
|
39
39
|
saveObjects({ indexName, objects }: import("../model").SaveObjectsOptions, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BatchResponse[]>;
|
|
40
40
|
deleteObjects({ indexName, objectIDs }: import("../model").DeleteObjectsOptions, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BatchResponse[]>;
|
|
41
41
|
partialUpdateObjects({ indexName, objects, createIfNotExists }: import("../model").PartialUpdateObjectsOptions, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BatchResponse[]>;
|
|
@@ -52,15 +52,15 @@ export declare function searchClient(appId: string, apiKey: string, options?: Cl
|
|
|
52
52
|
assignUserId({ xAlgoliaUserID, assignUserIdParams }: import("../model").AssignUserIdProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").CreatedAtResponse>;
|
|
53
53
|
batch({ indexName, batchWriteParams }: import("../model").BatchProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BatchResponse>;
|
|
54
54
|
batchAssignUserIds({ xAlgoliaUserID, batchAssignUserIdsParams }: import("../model").BatchAssignUserIdsProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").CreatedAtResponse>;
|
|
55
|
-
batchDictionaryEntries({ dictionaryName, batchDictionaryEntriesParams
|
|
55
|
+
batchDictionaryEntries({ dictionaryName, batchDictionaryEntriesParams }: import("../model").BatchDictionaryEntriesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedAtResponse>;
|
|
56
56
|
browse<T>({ indexName, browseParams }: import("../model").BrowseProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").BrowseResponse<T>>;
|
|
57
57
|
clearObjects({ indexName }: import("../model").ClearObjectsProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedAtResponse>;
|
|
58
58
|
clearRules({ indexName, forwardToReplicas }: import("../model").ClearRulesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedAtResponse>;
|
|
59
59
|
clearSynonyms({ indexName, forwardToReplicas }: import("../model").ClearSynonymsProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedAtResponse>;
|
|
60
|
-
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string,
|
|
61
|
-
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string,
|
|
62
|
-
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string,
|
|
63
|
-
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string,
|
|
60
|
+
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
61
|
+
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
62
|
+
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
63
|
+
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
64
64
|
deleteApiKey({ key }: import("../model").DeleteApiKeyProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").DeleteApiKeyResponse>;
|
|
65
65
|
deleteBy({ indexName, deleteByParams }: import("../model").DeleteByProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").DeletedAtResponse>;
|
|
66
66
|
deleteIndex({ indexName }: import("../model").DeleteIndexProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").DeletedAtResponse>;
|
|
@@ -73,7 +73,7 @@ export declare function searchClient(appId: string, apiKey: string, options?: Cl
|
|
|
73
73
|
getDictionaryLanguages(requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, import("../model").Languages>>;
|
|
74
74
|
getDictionarySettings(requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").GetDictionarySettingsResponse>;
|
|
75
75
|
getLogs({ offset, length, indexName, type }?: import("../model").GetLogsProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").GetLogsResponse>;
|
|
76
|
-
getObject({ indexName, objectID, attributesToRetrieve }: import("../model").GetObjectProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string,
|
|
76
|
+
getObject({ indexName, objectID, attributesToRetrieve }: import("../model").GetObjectProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, unknown>>;
|
|
77
77
|
getObjects<T>(getObjectsParams: import("../model").GetObjectsParams, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").GetObjectsResponse<T>>;
|
|
78
78
|
getRule({ indexName, objectID }: import("../model").GetRuleProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").Rule>;
|
|
79
79
|
getSettings({ indexName }: import("../model").GetSettingsProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SettingsResponse>;
|
|
@@ -89,18 +89,18 @@ export declare function searchClient(appId: string, apiKey: string, options?: Cl
|
|
|
89
89
|
listUserIds({ page, hitsPerPage }?: import("../model").ListUserIdsProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").ListUserIdsResponse>;
|
|
90
90
|
multipleBatch(batchParams: import("../model").BatchParams, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").MultipleBatchResponse>;
|
|
91
91
|
operationIndex({ indexName, operationIndexParams }: import("../model").OperationIndexProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedAtResponse>;
|
|
92
|
-
partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists
|
|
92
|
+
partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists }: import("../model").PartialUpdateObjectProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedAtWithObjectIdResponse>;
|
|
93
93
|
removeUserId({ userID }: import("../model").RemoveUserIdProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").RemoveUserIdResponse>;
|
|
94
94
|
replaceSources({ source }: import("../model").ReplaceSourcesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").ReplaceSourceResponse>;
|
|
95
95
|
restoreApiKey({ key }: import("../model").RestoreApiKeyProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").AddApiKeyResponse>;
|
|
96
96
|
saveObject({ indexName, body }: import("../model").SaveObjectProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SaveObjectResponse>;
|
|
97
97
|
saveRule({ indexName, objectID, rule, forwardToReplicas }: import("../model").SaveRuleProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedRuleResponse>;
|
|
98
|
-
saveRules({ indexName, rules, forwardToReplicas, clearExistingRules
|
|
98
|
+
saveRules({ indexName, rules, forwardToReplicas, clearExistingRules }: import("../model").SaveRulesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedAtResponse>;
|
|
99
99
|
saveSynonym({ indexName, objectID, synonymHit, forwardToReplicas }: import("../model").SaveSynonymProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SaveSynonymResponse>;
|
|
100
|
-
saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms
|
|
100
|
+
saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms }: import("../model").SaveSynonymsProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").UpdatedAtResponse>;
|
|
101
101
|
search<T>(searchMethodParams: import("../model").LegacySearchMethodProps | import("../model").SearchMethodParams, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchResponses<T>>;
|
|
102
|
-
searchDictionaryEntries({ dictionaryName, searchDictionaryEntriesParams
|
|
103
|
-
searchForFacetValues({ indexName, facetName, searchForFacetValuesRequest
|
|
102
|
+
searchDictionaryEntries({ dictionaryName, searchDictionaryEntriesParams }: import("../model").SearchDictionaryEntriesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchDictionaryEntriesResponse>;
|
|
103
|
+
searchForFacetValues({ indexName, facetName, searchForFacetValuesRequest }: import("../model").SearchForFacetValuesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchForFacetValuesResponse>;
|
|
104
104
|
searchRules({ indexName, searchRulesParams }: import("../model").SearchRulesProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchRulesResponse>;
|
|
105
105
|
searchSingleIndex<T>({ indexName, searchParams }: import("../model").SearchSingleIndexProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchResponse<T>>;
|
|
106
106
|
searchSynonyms({ indexName, searchSynonymsParams }: import("../model").SearchSynonymsProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").SearchSynonymsResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../builds/node.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAW5D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../builds/node.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAW5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,wCAAwC,EAAE,MAAM,UAAU,CAAC;AAGvG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAG3D,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;IA0B/E;;;;;;;OAOG;0DACwD,4BAA4B,GAAG,MAAM;IA6BhG;;;;;;OAMG;yDACkD,wCAAwC,GAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYzG"}
|
package/dist/client-search.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var node_crypto = require('node:crypto');
|
|
4
4
|
var clientCommon = require('@algolia/client-common');
|
|
5
5
|
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
6
6
|
|
|
7
7
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
|
|
8
|
-
const apiClientVersion = '5.
|
|
8
|
+
const apiClientVersion = '5.2.2';
|
|
9
9
|
function getDefaultHosts(appId) {
|
|
10
10
|
return [
|
|
11
11
|
{
|
|
@@ -67,10 +67,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
67
67
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
68
68
|
*/
|
|
69
69
|
clearCache() {
|
|
70
|
-
return Promise.all([
|
|
71
|
-
transporter.requestsCache.clear(),
|
|
72
|
-
transporter.responsesCache.clear(),
|
|
73
|
-
]).then(() => undefined);
|
|
70
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
74
71
|
},
|
|
75
72
|
/**
|
|
76
73
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -168,8 +165,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
168
165
|
const value = apiKey[field];
|
|
169
166
|
const resValue = response[field];
|
|
170
167
|
if (Array.isArray(value) && Array.isArray(resValue)) {
|
|
171
|
-
if (value.length !== resValue.length ||
|
|
172
|
-
value.some((v, index) => v !== resValue[index])) {
|
|
168
|
+
if (value.length !== resValue.length || value.some((v, index) => v !== resValue[index])) {
|
|
173
169
|
return false;
|
|
174
170
|
}
|
|
175
171
|
}
|
|
@@ -189,7 +185,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
189
185
|
}
|
|
190
186
|
throw error;
|
|
191
187
|
}),
|
|
192
|
-
validate: (response) => operation === 'add' ? response !== undefined : response === undefined,
|
|
188
|
+
validate: (response) => (operation === 'add' ? response !== undefined : response === undefined),
|
|
193
189
|
});
|
|
194
190
|
},
|
|
195
191
|
/**
|
|
@@ -240,9 +236,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
240
236
|
indexName,
|
|
241
237
|
searchRulesParams: {
|
|
242
238
|
...params,
|
|
243
|
-
page: previousResponse
|
|
244
|
-
? previousResponse.page + 1
|
|
245
|
-
: params.page || 0,
|
|
239
|
+
page: previousResponse ? previousResponse.page + 1 : params.page || 0,
|
|
246
240
|
},
|
|
247
241
|
}, requestOptions);
|
|
248
242
|
},
|
|
@@ -295,7 +289,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
295
289
|
* @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.
|
|
296
290
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
297
291
|
*/
|
|
298
|
-
async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000
|
|
292
|
+
async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000 }, requestOptions) {
|
|
299
293
|
let requests = [];
|
|
300
294
|
const responses = [];
|
|
301
295
|
const objectEntries = objects.entries();
|
|
@@ -355,9 +349,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
355
349
|
return await this.chunkedBatch({
|
|
356
350
|
indexName,
|
|
357
351
|
objects,
|
|
358
|
-
action: createIfNotExists
|
|
359
|
-
? 'partialUpdateObject'
|
|
360
|
-
: 'partialUpdateObjectNoCreate',
|
|
352
|
+
action: createIfNotExists ? 'partialUpdateObject' : 'partialUpdateObjectNoCreate',
|
|
361
353
|
}, requestOptions);
|
|
362
354
|
},
|
|
363
355
|
/**
|
|
@@ -639,7 +631,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
639
631
|
* @param batchDictionaryEntries.batchDictionaryEntriesParams - The batchDictionaryEntriesParams object.
|
|
640
632
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
641
633
|
*/
|
|
642
|
-
batchDictionaryEntries({ dictionaryName, batchDictionaryEntriesParams
|
|
634
|
+
batchDictionaryEntries({ dictionaryName, batchDictionaryEntriesParams }, requestOptions) {
|
|
643
635
|
if (!dictionaryName) {
|
|
644
636
|
throw new Error('Parameter `dictionaryName` is required when calling `batchDictionaryEntries`.');
|
|
645
637
|
}
|
|
@@ -1630,7 +1622,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1630
1622
|
return transporter.request(request, requestOptions);
|
|
1631
1623
|
},
|
|
1632
1624
|
/**
|
|
1633
|
-
* 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.
|
|
1625
|
+
* 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.
|
|
1634
1626
|
*
|
|
1635
1627
|
* Required API Key ACLs:
|
|
1636
1628
|
* - addObject.
|
|
@@ -1642,7 +1634,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1642
1634
|
* @param partialUpdateObject.createIfNotExists - Whether to create a new record if it doesn\'t exist.
|
|
1643
1635
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1644
1636
|
*/
|
|
1645
|
-
partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists
|
|
1637
|
+
partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists }, requestOptions) {
|
|
1646
1638
|
if (!indexName) {
|
|
1647
1639
|
throw new Error('Parameter `indexName` is required when calling `partialUpdateObject`.');
|
|
1648
1640
|
}
|
|
@@ -1831,7 +1823,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1831
1823
|
* @param saveRules.clearExistingRules - Whether existing rules should be deleted before adding this batch.
|
|
1832
1824
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1833
1825
|
*/
|
|
1834
|
-
saveRules({ indexName, rules, forwardToReplicas, clearExistingRules
|
|
1826
|
+
saveRules({ indexName, rules, forwardToReplicas, clearExistingRules }, requestOptions) {
|
|
1835
1827
|
if (!indexName) {
|
|
1836
1828
|
throw new Error('Parameter `indexName` is required when calling `saveRules`.');
|
|
1837
1829
|
}
|
|
@@ -1915,7 +1907,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1915
1907
|
* @param saveSynonyms.replaceExistingSynonyms - Whether to replace all synonyms in the index with the ones sent with this request.
|
|
1916
1908
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1917
1909
|
*/
|
|
1918
|
-
saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms
|
|
1910
|
+
saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms }, requestOptions) {
|
|
1919
1911
|
if (!indexName) {
|
|
1920
1912
|
throw new Error('Parameter `indexName` is required when calling `saveSynonyms`.');
|
|
1921
1913
|
}
|
|
@@ -1929,8 +1921,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1929
1921
|
queryParameters.forwardToReplicas = forwardToReplicas.toString();
|
|
1930
1922
|
}
|
|
1931
1923
|
if (replaceExistingSynonyms !== undefined) {
|
|
1932
|
-
queryParameters.replaceExistingSynonyms =
|
|
1933
|
-
replaceExistingSynonyms.toString();
|
|
1924
|
+
queryParameters.replaceExistingSynonyms = replaceExistingSynonyms.toString();
|
|
1934
1925
|
}
|
|
1935
1926
|
const request = {
|
|
1936
1927
|
method: 'POST',
|
|
@@ -2004,7 +1995,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2004
1995
|
* @param searchDictionaryEntries.searchDictionaryEntriesParams - The searchDictionaryEntriesParams object.
|
|
2005
1996
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2006
1997
|
*/
|
|
2007
|
-
searchDictionaryEntries({ dictionaryName, searchDictionaryEntriesParams
|
|
1998
|
+
searchDictionaryEntries({ dictionaryName, searchDictionaryEntriesParams }, requestOptions) {
|
|
2008
1999
|
if (!dictionaryName) {
|
|
2009
2000
|
throw new Error('Parameter `dictionaryName` is required when calling `searchDictionaryEntries`.');
|
|
2010
2001
|
}
|
|
@@ -2040,7 +2031,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2040
2031
|
* @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.
|
|
2041
2032
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2042
2033
|
*/
|
|
2043
|
-
searchForFacetValues({ indexName, facetName, searchForFacetValuesRequest
|
|
2034
|
+
searchForFacetValues({ indexName, facetName, searchForFacetValuesRequest }, requestOptions) {
|
|
2044
2035
|
if (!indexName) {
|
|
2045
2036
|
throw new Error('Parameter `indexName` is required when calling `searchForFacetValues`.');
|
|
2046
2037
|
}
|
|
@@ -2311,7 +2302,7 @@ function searchClient(appId, apiKey, options) {
|
|
|
2311
2302
|
* @param generateSecuredApiKey.parentApiKey - The base API key from which to generate the new secured one.
|
|
2312
2303
|
* @param generateSecuredApiKey.restrictions - A set of properties defining the restrictions of the secured API key.
|
|
2313
2304
|
*/
|
|
2314
|
-
generateSecuredApiKey({ parentApiKey, restrictions = {}
|
|
2305
|
+
generateSecuredApiKey({ parentApiKey, restrictions = {} }) {
|
|
2315
2306
|
let mergedRestrictions = restrictions;
|
|
2316
2307
|
if (restrictions.searchParams) {
|
|
2317
2308
|
// merge searchParams with the root restrictions
|
|
@@ -2329,9 +2320,7 @@ function searchClient(appId, apiKey, options) {
|
|
|
2329
2320
|
return acc;
|
|
2330
2321
|
}, {});
|
|
2331
2322
|
const queryParameters = clientCommon.serializeQueryParameters(mergedRestrictions);
|
|
2332
|
-
return Buffer.from(
|
|
2333
|
-
.update(queryParameters)
|
|
2334
|
-
.digest('hex') + queryParameters).toString('base64');
|
|
2323
|
+
return Buffer.from(node_crypto.createHmac('sha256', parentApiKey).update(queryParameters).digest('hex') + queryParameters).toString('base64');
|
|
2335
2324
|
},
|
|
2336
2325
|
/**
|
|
2337
2326
|
* Helper: Retrieves the remaining validity of the previous generated `securedApiKey`, the `ValidUntil` parameter must have been provided.
|
|
@@ -2340,7 +2329,7 @@ function searchClient(appId, apiKey, options) {
|
|
|
2340
2329
|
* @param getSecuredApiKeyRemainingValidity - The `getSecuredApiKeyRemainingValidity` object.
|
|
2341
2330
|
* @param getSecuredApiKeyRemainingValidity.securedApiKey - The secured API key generated with the `generateSecuredApiKey` method.
|
|
2342
2331
|
*/
|
|
2343
|
-
getSecuredApiKeyRemainingValidity({ securedApiKey
|
|
2332
|
+
getSecuredApiKeyRemainingValidity({ securedApiKey }) {
|
|
2344
2333
|
const decodedString = Buffer.from(securedApiKey, 'base64').toString('ascii');
|
|
2345
2334
|
const regex = /validUntil=(\d+)/;
|
|
2346
2335
|
const match = decodedString.match(regex);
|
|
@@ -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
|
|
@@ -693,8 +696,7 @@ function createXhrRequester() {
|
|
|
693
696
|
const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');
|
|
694
697
|
let responseTimeout;
|
|
695
698
|
baseRequester.onreadystatechange = () => {
|
|
696
|
-
if (baseRequester.readyState > baseRequester.OPENED &&
|
|
697
|
-
responseTimeout === undefined) {
|
|
699
|
+
if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) {
|
|
698
700
|
clearTimeout(connectTimeout);
|
|
699
701
|
responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');
|
|
700
702
|
}
|
|
@@ -727,7 +729,7 @@ function createXhrRequester() {
|
|
|
727
729
|
}
|
|
728
730
|
|
|
729
731
|
// 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.
|
|
730
|
-
const apiClientVersion = '5.
|
|
732
|
+
const apiClientVersion = '5.2.2';
|
|
731
733
|
function getDefaultHosts(appId) {
|
|
732
734
|
return [
|
|
733
735
|
{
|
|
@@ -789,10 +791,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
789
791
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
790
792
|
*/
|
|
791
793
|
clearCache() {
|
|
792
|
-
return Promise.all([
|
|
793
|
-
transporter.requestsCache.clear(),
|
|
794
|
-
transporter.responsesCache.clear(),
|
|
795
|
-
]).then(() => undefined);
|
|
794
|
+
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);
|
|
796
795
|
},
|
|
797
796
|
/**
|
|
798
797
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
@@ -890,8 +889,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
890
889
|
const value = apiKey[field];
|
|
891
890
|
const resValue = response[field];
|
|
892
891
|
if (Array.isArray(value) && Array.isArray(resValue)) {
|
|
893
|
-
if (value.length !== resValue.length ||
|
|
894
|
-
value.some((v, index) => v !== resValue[index])) {
|
|
892
|
+
if (value.length !== resValue.length || value.some((v, index) => v !== resValue[index])) {
|
|
895
893
|
return false;
|
|
896
894
|
}
|
|
897
895
|
}
|
|
@@ -911,7 +909,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
911
909
|
}
|
|
912
910
|
throw error;
|
|
913
911
|
}),
|
|
914
|
-
validate: (response) => operation === 'add' ? response !== undefined : response === undefined,
|
|
912
|
+
validate: (response) => (operation === 'add' ? response !== undefined : response === undefined),
|
|
915
913
|
});
|
|
916
914
|
},
|
|
917
915
|
/**
|
|
@@ -962,9 +960,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
962
960
|
indexName,
|
|
963
961
|
searchRulesParams: {
|
|
964
962
|
...params,
|
|
965
|
-
page: previousResponse
|
|
966
|
-
? previousResponse.page + 1
|
|
967
|
-
: params.page || 0,
|
|
963
|
+
page: previousResponse ? previousResponse.page + 1 : params.page || 0,
|
|
968
964
|
},
|
|
969
965
|
}, requestOptions);
|
|
970
966
|
},
|
|
@@ -1017,7 +1013,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1017
1013
|
* @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.
|
|
1018
1014
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
1019
1015
|
*/
|
|
1020
|
-
async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000
|
|
1016
|
+
async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000 }, requestOptions) {
|
|
1021
1017
|
let requests = [];
|
|
1022
1018
|
const responses = [];
|
|
1023
1019
|
const objectEntries = objects.entries();
|
|
@@ -1077,9 +1073,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1077
1073
|
return await this.chunkedBatch({
|
|
1078
1074
|
indexName,
|
|
1079
1075
|
objects,
|
|
1080
|
-
action: createIfNotExists
|
|
1081
|
-
? 'partialUpdateObject'
|
|
1082
|
-
: 'partialUpdateObjectNoCreate',
|
|
1076
|
+
action: createIfNotExists ? 'partialUpdateObject' : 'partialUpdateObjectNoCreate',
|
|
1083
1077
|
}, requestOptions);
|
|
1084
1078
|
},
|
|
1085
1079
|
/**
|
|
@@ -1361,7 +1355,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
1361
1355
|
* @param batchDictionaryEntries.batchDictionaryEntriesParams - The batchDictionaryEntriesParams object.
|
|
1362
1356
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
1363
1357
|
*/
|
|
1364
|
-
batchDictionaryEntries({ dictionaryName, batchDictionaryEntriesParams
|
|
1358
|
+
batchDictionaryEntries({ dictionaryName, batchDictionaryEntriesParams }, requestOptions) {
|
|
1365
1359
|
if (!dictionaryName) {
|
|
1366
1360
|
throw new Error('Parameter `dictionaryName` is required when calling `batchDictionaryEntries`.');
|
|
1367
1361
|
}
|
|
@@ -2352,7 +2346,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2352
2346
|
return transporter.request(request, requestOptions);
|
|
2353
2347
|
},
|
|
2354
2348
|
/**
|
|
2355
|
-
* 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.
|
|
2349
|
+
* 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.
|
|
2356
2350
|
*
|
|
2357
2351
|
* Required API Key ACLs:
|
|
2358
2352
|
* - addObject.
|
|
@@ -2364,7 +2358,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2364
2358
|
* @param partialUpdateObject.createIfNotExists - Whether to create a new record if it doesn\'t exist.
|
|
2365
2359
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2366
2360
|
*/
|
|
2367
|
-
partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists
|
|
2361
|
+
partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists }, requestOptions) {
|
|
2368
2362
|
if (!indexName) {
|
|
2369
2363
|
throw new Error('Parameter `indexName` is required when calling `partialUpdateObject`.');
|
|
2370
2364
|
}
|
|
@@ -2553,7 +2547,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2553
2547
|
* @param saveRules.clearExistingRules - Whether existing rules should be deleted before adding this batch.
|
|
2554
2548
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2555
2549
|
*/
|
|
2556
|
-
saveRules({ indexName, rules, forwardToReplicas, clearExistingRules
|
|
2550
|
+
saveRules({ indexName, rules, forwardToReplicas, clearExistingRules }, requestOptions) {
|
|
2557
2551
|
if (!indexName) {
|
|
2558
2552
|
throw new Error('Parameter `indexName` is required when calling `saveRules`.');
|
|
2559
2553
|
}
|
|
@@ -2637,7 +2631,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2637
2631
|
* @param saveSynonyms.replaceExistingSynonyms - Whether to replace all synonyms in the index with the ones sent with this request.
|
|
2638
2632
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2639
2633
|
*/
|
|
2640
|
-
saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms
|
|
2634
|
+
saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms }, requestOptions) {
|
|
2641
2635
|
if (!indexName) {
|
|
2642
2636
|
throw new Error('Parameter `indexName` is required when calling `saveSynonyms`.');
|
|
2643
2637
|
}
|
|
@@ -2651,8 +2645,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2651
2645
|
queryParameters.forwardToReplicas = forwardToReplicas.toString();
|
|
2652
2646
|
}
|
|
2653
2647
|
if (replaceExistingSynonyms !== undefined) {
|
|
2654
|
-
queryParameters.replaceExistingSynonyms =
|
|
2655
|
-
replaceExistingSynonyms.toString();
|
|
2648
|
+
queryParameters.replaceExistingSynonyms = replaceExistingSynonyms.toString();
|
|
2656
2649
|
}
|
|
2657
2650
|
const request = {
|
|
2658
2651
|
method: 'POST',
|
|
@@ -2726,7 +2719,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2726
2719
|
* @param searchDictionaryEntries.searchDictionaryEntriesParams - The searchDictionaryEntriesParams object.
|
|
2727
2720
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2728
2721
|
*/
|
|
2729
|
-
searchDictionaryEntries({ dictionaryName, searchDictionaryEntriesParams
|
|
2722
|
+
searchDictionaryEntries({ dictionaryName, searchDictionaryEntriesParams }, requestOptions) {
|
|
2730
2723
|
if (!dictionaryName) {
|
|
2731
2724
|
throw new Error('Parameter `dictionaryName` is required when calling `searchDictionaryEntries`.');
|
|
2732
2725
|
}
|
|
@@ -2762,7 +2755,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2762
2755
|
* @param searchForFacetValues.searchForFacetValuesRequest - The searchForFacetValuesRequest object.
|
|
2763
2756
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
2764
2757
|
*/
|
|
2765
|
-
searchForFacetValues({ indexName, facetName, searchForFacetValuesRequest
|
|
2758
|
+
searchForFacetValues({ indexName, facetName, searchForFacetValuesRequest }, requestOptions) {
|
|
2766
2759
|
if (!indexName) {
|
|
2767
2760
|
throw new Error('Parameter `indexName` is required when calling `searchForFacetValues`.');
|
|
2768
2761
|
}
|
|
@@ -3023,10 +3016,7 @@ function searchClient(appId, apiKey, options) {
|
|
|
3023
3016
|
responsesCache: createMemoryCache(),
|
|
3024
3017
|
requestsCache: createMemoryCache({ serializable: false }),
|
|
3025
3018
|
hostsCache: createFallbackableCache({
|
|
3026
|
-
caches: [
|
|
3027
|
-
createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }),
|
|
3028
|
-
createMemoryCache(),
|
|
3029
|
-
],
|
|
3019
|
+
caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],
|
|
3030
3020
|
}),
|
|
3031
3021
|
...options,
|
|
3032
3022
|
});
|