algoliasearch 5.0.0-alpha.90 → 5.0.0-alpha.97
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 +7 -7
- 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 +7 -7
- package/dist/algoliasearch/builds/node.d.ts.map +1 -1
- package/dist/algoliasearch.cjs +282 -282
- package/dist/algoliasearch.esm.browser.js +325 -301
- package/dist/algoliasearch.esm.node.js +282 -282
- 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/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 +49 -49
- 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/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 +40 -40
- 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 +14 -14
|
@@ -4,4 +4,14 @@ import type { FacetHits } from './facetHits';
|
|
|
4
4
|
|
|
5
5
|
export type SearchForFacetValuesResponse = {
|
|
6
6
|
facetHits: FacetHits[];
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* See the `facetsCount` field of the `exhaustive` object in the response.
|
|
10
|
+
*/
|
|
11
|
+
exhaustiveFacetsCount: boolean;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Time the server took to process the request, in milliseconds.
|
|
15
|
+
*/
|
|
16
|
+
processingTimeMS?: number;
|
|
7
17
|
};
|
|
@@ -3,4 +3,6 @@
|
|
|
3
3
|
import type { SearchForFacetValuesResponse } from './searchForFacetValuesResponse';
|
|
4
4
|
import type { SearchResponse } from './searchResponse';
|
|
5
5
|
|
|
6
|
-
export type SearchResult =
|
|
6
|
+
export type SearchResult<T = Record<string, any>> =
|
|
7
|
+
| SearchForFacetValuesResponse
|
|
8
|
+
| SearchResponse<T>;
|
package/lite/src/liteClient.ts
CHANGED
|
@@ -16,13 +16,13 @@ import type {
|
|
|
16
16
|
} from '@algolia/client-common';
|
|
17
17
|
|
|
18
18
|
import type {
|
|
19
|
-
|
|
19
|
+
CustomPostProps,
|
|
20
20
|
LegacySearchMethodProps,
|
|
21
21
|
} from '../model/clientMethodProps';
|
|
22
22
|
import type { SearchMethodParams } from '../model/searchMethodParams';
|
|
23
23
|
import type { SearchResponses } from '../model/searchResponses';
|
|
24
24
|
|
|
25
|
-
export const apiClientVersion = '5.0.0-alpha.
|
|
25
|
+
export const apiClientVersion = '5.0.0-alpha.97';
|
|
26
26
|
|
|
27
27
|
function getDefaultHosts(appId: string): Host[] {
|
|
28
28
|
return (
|
|
@@ -126,18 +126,20 @@ export function createLiteClient({
|
|
|
126
126
|
* This method allow you to send requests to the Algolia REST API.
|
|
127
127
|
*
|
|
128
128
|
* @summary Send requests to the Algolia REST API.
|
|
129
|
-
* @param
|
|
130
|
-
* @param
|
|
131
|
-
* @param
|
|
132
|
-
* @param
|
|
129
|
+
* @param customPost - The customPost object.
|
|
130
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
131
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
132
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
133
133
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
134
134
|
*/
|
|
135
|
-
|
|
136
|
-
{ path, parameters, body }:
|
|
135
|
+
customPost(
|
|
136
|
+
{ path, parameters, body }: CustomPostProps,
|
|
137
137
|
requestOptions?: RequestOptions
|
|
138
138
|
): Promise<Record<string, any>> {
|
|
139
139
|
if (!path) {
|
|
140
|
-
throw new Error(
|
|
140
|
+
throw new Error(
|
|
141
|
+
'Parameter `path` is required when calling `customPost`.'
|
|
142
|
+
);
|
|
141
143
|
}
|
|
142
144
|
|
|
143
145
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
@@ -162,10 +164,10 @@ export function createLiteClient({
|
|
|
162
164
|
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
|
|
163
165
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
164
166
|
*/
|
|
165
|
-
search(
|
|
167
|
+
search<T>(
|
|
166
168
|
searchMethodParams: LegacySearchMethodProps | SearchMethodParams,
|
|
167
169
|
requestOptions?: RequestOptions
|
|
168
|
-
): Promise<SearchResponses
|
|
170
|
+
): Promise<SearchResponses<T>> {
|
|
169
171
|
if (searchMethodParams && Array.isArray(searchMethodParams)) {
|
|
170
172
|
const newSignatureRequest: SearchMethodParams = {
|
|
171
173
|
requests: searchMethodParams.map(({ params, ...legacyRequest }) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "algoliasearch",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.97",
|
|
4
4
|
"description": "A fully-featured and blazing-fast JavaScript API client to interact with Algolia API.",
|
|
5
5
|
"repository": "algolia/algoliasearch-client-javascript",
|
|
6
6
|
"license": "MIT",
|
|
@@ -60,22 +60,22 @@
|
|
|
60
60
|
"test": "jest"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@algolia/client-abtesting": "5.0.0-alpha.
|
|
64
|
-
"@algolia/client-analytics": "5.0.0-alpha.
|
|
65
|
-
"@algolia/client-common": "5.0.0-alpha.
|
|
66
|
-
"@algolia/client-personalization": "5.0.0-alpha.
|
|
67
|
-
"@algolia/client-search": "5.0.0-alpha.
|
|
68
|
-
"@algolia/requester-browser-xhr": "5.0.0-alpha.
|
|
69
|
-
"@algolia/requester-node-http": "5.0.0-alpha.
|
|
63
|
+
"@algolia/client-abtesting": "5.0.0-alpha.97",
|
|
64
|
+
"@algolia/client-analytics": "5.0.0-alpha.97",
|
|
65
|
+
"@algolia/client-common": "5.0.0-alpha.98",
|
|
66
|
+
"@algolia/client-personalization": "5.0.0-alpha.97",
|
|
67
|
+
"@algolia/client-search": "5.0.0-alpha.97",
|
|
68
|
+
"@algolia/requester-browser-xhr": "5.0.0-alpha.98",
|
|
69
|
+
"@algolia/requester-node-http": "5.0.0-alpha.98"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@babel/preset-env": "7.23.
|
|
73
|
-
"@babel/preset-typescript": "7.23.
|
|
74
|
-
"@types/jest": "29.5.
|
|
75
|
-
"@types/node": "20.
|
|
72
|
+
"@babel/preset-env": "7.23.8",
|
|
73
|
+
"@babel/preset-typescript": "7.23.3",
|
|
74
|
+
"@types/jest": "29.5.11",
|
|
75
|
+
"@types/node": "20.11.1",
|
|
76
76
|
"jest": "29.7.0",
|
|
77
|
-
"rollup": "4.
|
|
78
|
-
"typescript": "5.
|
|
77
|
+
"rollup": "4.9.5",
|
|
78
|
+
"typescript": "5.3.3"
|
|
79
79
|
},
|
|
80
80
|
"engines": {
|
|
81
81
|
"node": ">= 14.0.0"
|