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.
Files changed (67) hide show
  1. package/builds/browser.ts +3 -9
  2. package/builds/models.ts +11 -5
  3. package/builds/node.ts +3 -9
  4. package/dist/algoliasearch/builds/browser.d.ts +7 -7
  5. package/dist/algoliasearch/builds/browser.d.ts.map +1 -1
  6. package/dist/algoliasearch/builds/models.d.ts +2 -2
  7. package/dist/algoliasearch/builds/models.d.ts.map +1 -1
  8. package/dist/algoliasearch/builds/node.d.ts +7 -7
  9. package/dist/algoliasearch/builds/node.d.ts.map +1 -1
  10. package/dist/algoliasearch.cjs +282 -282
  11. package/dist/algoliasearch.esm.browser.js +325 -301
  12. package/dist/algoliasearch.esm.node.js +282 -282
  13. package/dist/algoliasearch.umd.js +2 -2
  14. package/dist/client-abtesting/model/clientMethodProps.d.ts +42 -42
  15. package/dist/client-abtesting/model/clientMethodProps.d.ts.map +1 -1
  16. package/dist/client-abtesting/src/abtestingClient.d.ts +37 -37
  17. package/dist/client-abtesting/src/abtestingClient.d.ts.map +1 -1
  18. package/dist/client-analytics/model/clientMethodProps.d.ts +38 -38
  19. package/dist/client-analytics/model/clientMethodProps.d.ts.map +1 -1
  20. package/dist/client-analytics/src/analyticsClient.d.ts +32 -32
  21. package/dist/client-analytics/src/analyticsClient.d.ts.map +1 -1
  22. package/dist/client-personalization/model/clientMethodProps.d.ts +26 -26
  23. package/dist/client-personalization/model/clientMethodProps.d.ts.map +1 -1
  24. package/dist/client-personalization/src/personalizationClient.d.ts +37 -37
  25. package/dist/client-personalization/src/personalizationClient.d.ts.map +1 -1
  26. package/dist/client-search/model/clientMethodProps.d.ts +49 -49
  27. package/dist/client-search/model/clientMethodProps.d.ts.map +1 -1
  28. package/dist/client-search/model/highlightResult.d.ts +1 -1
  29. package/dist/client-search/model/highlightResult.d.ts.map +1 -1
  30. package/dist/client-search/model/searchForFacetValuesResponse.d.ts +8 -0
  31. package/dist/client-search/model/searchForFacetValuesResponse.d.ts.map +1 -1
  32. package/dist/client-search/model/searchResponses.d.ts +2 -2
  33. package/dist/client-search/model/searchResponses.d.ts.map +1 -1
  34. package/dist/client-search/model/searchResult.d.ts +1 -1
  35. package/dist/client-search/model/searchResult.d.ts.map +1 -1
  36. package/dist/client-search/model/snippetResult.d.ts +1 -1
  37. package/dist/client-search/model/snippetResult.d.ts.map +1 -1
  38. package/dist/client-search/model/userHighlightResult.d.ts +2 -8
  39. package/dist/client-search/model/userHighlightResult.d.ts.map +1 -1
  40. package/dist/client-search/src/searchClient.d.ts +40 -40
  41. package/dist/client-search/src/searchClient.d.ts.map +1 -1
  42. package/dist/lite/lite.cjs +7 -7
  43. package/dist/lite/lite.esm.browser.js +50 -26
  44. package/dist/lite/lite.esm.node.js +7 -7
  45. package/dist/lite/lite.umd.js +2 -2
  46. package/dist/lite/model/clientMethodProps.d.ts +2 -2
  47. package/dist/lite/model/clientMethodProps.d.ts.map +1 -1
  48. package/dist/lite/model/highlightResult.d.ts +1 -1
  49. package/dist/lite/model/highlightResult.d.ts.map +1 -1
  50. package/dist/lite/model/searchForFacetValuesResponse.d.ts +8 -0
  51. package/dist/lite/model/searchForFacetValuesResponse.d.ts.map +1 -1
  52. package/dist/lite/model/searchResponses.d.ts +2 -2
  53. package/dist/lite/model/searchResponses.d.ts.map +1 -1
  54. package/dist/lite/model/searchResult.d.ts +1 -1
  55. package/dist/lite/model/searchResult.d.ts.map +1 -1
  56. package/dist/lite/model/snippetResult.d.ts +1 -1
  57. package/dist/lite/model/snippetResult.d.ts.map +1 -1
  58. package/dist/lite/src/liteClient.d.ts +8 -8
  59. package/dist/lite/src/liteClient.d.ts.map +1 -1
  60. package/lite/model/clientMethodProps.ts +2 -2
  61. package/lite/model/highlightResult.ts +3 -1
  62. package/lite/model/searchForFacetValuesResponse.ts +10 -0
  63. package/lite/model/searchResponses.ts +2 -2
  64. package/lite/model/searchResult.ts +3 -1
  65. package/lite/model/snippetResult.ts +3 -1
  66. package/lite/src/liteClient.ts +13 -11
  67. package/package.json +14 -14
@@ -2,4 +2,6 @@
2
2
 
3
3
  import type { HighlightResultOption } from './highlightResultOption';
4
4
 
5
- export type HighlightResult = HighlightResultOption | HighlightResultOption[];
5
+ export type HighlightResult =
6
+ | HighlightResultOption
7
+ | Record<string, HighlightResultOption>;
@@ -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
  };
@@ -2,6 +2,6 @@
2
2
 
3
3
  import type { SearchResult } from './searchResult';
4
4
 
5
- export type SearchResponses = {
6
- results: SearchResult[];
5
+ export type SearchResponses<T = Record<string, any>> = {
6
+ results: Array<SearchResult<T>>;
7
7
  };
@@ -3,4 +3,6 @@
3
3
  import type { SearchForFacetValuesResponse } from './searchForFacetValuesResponse';
4
4
  import type { SearchResponse } from './searchResponse';
5
5
 
6
- export type SearchResult = SearchForFacetValuesResponse | SearchResponse;
6
+ export type SearchResult<T = Record<string, any>> =
7
+ | SearchForFacetValuesResponse
8
+ | SearchResponse<T>;
@@ -2,4 +2,6 @@
2
2
 
3
3
  import type { SnippetResultOption } from './snippetResultOption';
4
4
 
5
- export type SnippetResult = SnippetResultOption | SnippetResultOption[];
5
+ export type SnippetResult =
6
+ | Record<string, SnippetResultOption>
7
+ | SnippetResultOption;
@@ -16,13 +16,13 @@ import type {
16
16
  } from '@algolia/client-common';
17
17
 
18
18
  import type {
19
- PostProps,
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.90';
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 post - The post object.
130
- * @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
131
- * @param post.parameters - Query parameters to apply to the current query.
132
- * @param post.body - Parameters to send with the custom request.
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
- post(
136
- { path, parameters, body }: PostProps,
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('Parameter `path` is required when calling `post`.');
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.90",
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.90",
64
- "@algolia/client-analytics": "5.0.0-alpha.90",
65
- "@algolia/client-common": "5.0.0-alpha.91",
66
- "@algolia/client-personalization": "5.0.0-alpha.90",
67
- "@algolia/client-search": "5.0.0-alpha.90",
68
- "@algolia/requester-browser-xhr": "5.0.0-alpha.91",
69
- "@algolia/requester-node-http": "5.0.0-alpha.91"
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.2",
73
- "@babel/preset-typescript": "7.23.2",
74
- "@types/jest": "29.5.7",
75
- "@types/node": "20.8.10",
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.3.0",
78
- "typescript": "5.2.2"
77
+ "rollup": "4.9.5",
78
+ "typescript": "5.3.3"
79
79
  },
80
80
  "engines": {
81
81
  "node": ">= 14.0.0"