Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: algolia/algoliasearch-client-javascript
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.20.0
Choose a base ref
...
head repository: algolia/algoliasearch-client-javascript
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4.21.0
Choose a head ref
  • 4 commits
  • 36 files changed
  • 4 contributors

Commits on Sep 18, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    db9953c View commit details

Commits on Dec 7, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    94b46b5 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    004f033 View commit details

Commits on Dec 11, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ccead52 View commit details
Showing with 165 additions and 78 deletions.
  1. +8 −0 CHANGELOG.md
  2. +1 −1 README.md
  3. +1 −1 lerna.json
  4. +2 −2 package.json
  5. +15 −15 packages/algoliasearch/package.json
  6. +2 −2 packages/cache-browser-local-storage/package.json
  7. +1 −1 packages/cache-common/package.json
  8. +2 −2 packages/cache-in-memory/package.json
  9. +4 −4 packages/client-account/package.json
  10. +5 −5 packages/client-analytics/package.json
  11. +3 −3 packages/client-common/package.json
  12. +1 −1 packages/client-common/src/version.ts
  13. +4 −4 packages/client-personalization/package.json
  14. +4 −4 packages/client-recommendation/package.json
  15. +4 −4 packages/client-search/package.json
  16. +1 −1 packages/logger-common/package.json
  17. +2 −2 packages/logger-console/package.json
  18. +12 −12 packages/recommend/package.json
  19. +2 −0 packages/recommend/src/builds/browser.ts
  20. +2 −0 packages/recommend/src/builds/node.ts
  21. +9 −2 packages/recommend/src/methods/getRecommendations.ts
  22. +29 −0 packages/recommend/src/methods/getRecommendedForYou.ts
  23. +1 −0 packages/recommend/src/methods/index.ts
  24. +1 −0 packages/recommend/src/types/RecommendModel.ts
  25. +3 −0 packages/recommend/src/types/RecommendedForYouQuery.ts
  26. +5 −0 packages/recommend/src/types/TrendingFacetHit.ts
  27. +7 −0 packages/recommend/src/types/TrendingFacetsResponse.ts
  28. +18 −1 packages/recommend/src/types/WithRecommendMethods.ts
  29. +3 −0 packages/recommend/src/types/index.ts
  30. +2 −2 packages/requester-browser-xhr/package.json
  31. +1 −1 packages/requester-common/package.json
  32. +2 −2 packages/requester-fetch/package.json
  33. +2 −2 packages/requester-node-http/package.json
  34. +4 −4 packages/transporter/package.json
  35. +1 −0 playground/browser/index.html
  36. +1 −0 scripts/prepare-playground.sh
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [v4.21.0](https://github.com/algolia/algoliasearch-client-javascript/compare/4.20.0...4.21.0)

* feat(recommend): add recommended-for-you model (#1490) ([004f033](https://github.com/algolia/algoliasearch-client-javascript/commit/004f033)), closes [#1490](https://github.com/algolia/algoliasearch-client-javascript/issues/1490)
* fix(recommend): getTrendingFacets typing (#1494) ([94b46b5](https://github.com/algolia/algoliasearch-client-javascript/commit/94b46b5)), closes [#1494](https://github.com/algolia/algoliasearch-client-javascript/issues/1494)
* docs(readme): fix typo (#1486) ([db9953c](https://github.com/algolia/algoliasearch-client-javascript/commit/db9953c)), closes [#1486](https://github.com/algolia/algoliasearch-client-javascript/issues/1486)



## [v4.20.0](https://github.com/algolia/algoliasearch-client-javascript/compare/4.19.1...4.20.0)

* feat(search): add inference ACL to API key object (#1479) ([3a95126](https://github.com/algolia/algoliasearch-client-javascript/commit/3a95126)), closes [#1479](https://github.com/algolia/algoliasearch-client-javascript/issues/1479)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ index
});
```

For full documentation, visit the **[online documentation](https://www.algolia.com/doc/api-client/getting-started/install/javascript/)**.
For the full documentation, visit the **[online documentation](https://www.algolia.com/doc/api-client/getting-started/install/javascript/)**.

## ❓ Troubleshooting

2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"version": "4.20.0"
"version": "4.21.0"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "4.20.0",
"version": "4.21.0",
"private": true,
"license": "MIT",
"workspaces": [
@@ -106,7 +106,7 @@
},
{
"path": "packages/recommend/dist/recommend.umd.js",
"maxSize": "4.3KB"
"maxSize": "4.4KB"
}
]
}
30 changes: 15 additions & 15 deletions packages/algoliasearch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "algoliasearch",
"version": "4.20.0",
"version": "4.21.0",
"private": false,
"description": "A fully-featured and blazing-fast JavaScript API client to interact with Algolia API.",
"repository": {
@@ -25,19 +25,19 @@
"lite.d.ts"
],
"dependencies": {
"@algolia/cache-browser-local-storage": "4.20.0",
"@algolia/cache-common": "4.20.0",
"@algolia/cache-in-memory": "4.20.0",
"@algolia/client-account": "4.20.0",
"@algolia/client-analytics": "4.20.0",
"@algolia/client-common": "4.20.0",
"@algolia/client-personalization": "4.20.0",
"@algolia/client-search": "4.20.0",
"@algolia/logger-common": "4.20.0",
"@algolia/logger-console": "4.20.0",
"@algolia/requester-browser-xhr": "4.20.0",
"@algolia/requester-common": "4.20.0",
"@algolia/requester-node-http": "4.20.0",
"@algolia/transporter": "4.20.0"
"@algolia/cache-browser-local-storage": "4.21.0",
"@algolia/cache-common": "4.21.0",
"@algolia/cache-in-memory": "4.21.0",
"@algolia/client-account": "4.21.0",
"@algolia/client-analytics": "4.21.0",
"@algolia/client-common": "4.21.0",
"@algolia/client-personalization": "4.21.0",
"@algolia/client-search": "4.21.0",
"@algolia/logger-common": "4.21.0",
"@algolia/logger-console": "4.21.0",
"@algolia/requester-browser-xhr": "4.21.0",
"@algolia/requester-common": "4.21.0",
"@algolia/requester-node-http": "4.21.0",
"@algolia/transporter": "4.21.0"
}
}
4 changes: 2 additions & 2 deletions packages/cache-browser-local-storage/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/cache-browser-local-storage",
"version": "4.20.0",
"version": "4.21.0",
"private": false,
"description": "Promise-based cache library for browser using local storage.",
"repository": {
@@ -17,6 +17,6 @@
"dist"
],
"dependencies": {
"@algolia/cache-common": "4.20.0"
"@algolia/cache-common": "4.21.0"
}
}
2 changes: 1 addition & 1 deletion packages/cache-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/cache-common",
"version": "4.20.0",
"version": "4.21.0",
"private": false,
"description": "Common interfaces for promise-based caching libraries",
"repository": {
4 changes: 2 additions & 2 deletions packages/cache-in-memory/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/cache-in-memory",
"version": "4.20.0",
"version": "4.21.0",
"private": false,
"description": "Promise-based cache library using memory.",
"repository": {
@@ -17,6 +17,6 @@
"dist"
],
"dependencies": {
"@algolia/cache-common": "4.20.0"
"@algolia/cache-common": "4.21.0"
}
}
8 changes: 4 additions & 4 deletions packages/client-account/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/client-account",
"version": "4.20.0",
"version": "4.21.0",
"private": false,
"repository": {
"type": "git",
@@ -16,8 +16,8 @@
"dist"
],
"dependencies": {
"@algolia/client-common": "4.20.0",
"@algolia/client-search": "4.20.0",
"@algolia/transporter": "4.20.0"
"@algolia/client-common": "4.21.0",
"@algolia/client-search": "4.21.0",
"@algolia/transporter": "4.21.0"
}
}
10 changes: 5 additions & 5 deletions packages/client-analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/client-analytics",
"version": "4.20.0",
"version": "4.21.0",
"private": false,
"repository": {
"type": "git",
@@ -16,9 +16,9 @@
"dist"
],
"dependencies": {
"@algolia/client-common": "4.20.0",
"@algolia/client-search": "4.20.0",
"@algolia/requester-common": "4.20.0",
"@algolia/transporter": "4.20.0"
"@algolia/client-common": "4.21.0",
"@algolia/client-search": "4.21.0",
"@algolia/requester-common": "4.21.0",
"@algolia/transporter": "4.21.0"
}
}
6 changes: 3 additions & 3 deletions packages/client-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/client-common",
"version": "4.20.0",
"version": "4.21.0",
"private": false,
"repository": {
"type": "git",
@@ -16,7 +16,7 @@
"dist"
],
"dependencies": {
"@algolia/requester-common": "4.20.0",
"@algolia/transporter": "4.20.0"
"@algolia/requester-common": "4.21.0",
"@algolia/transporter": "4.21.0"
}
}
2 changes: 1 addition & 1 deletion packages/client-common/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = '4.20.0';
export const version = '4.21.0';
8 changes: 4 additions & 4 deletions packages/client-personalization/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/client-personalization",
"version": "4.20.0",
"version": "4.21.0",
"private": false,
"repository": {
"type": "git",
@@ -16,8 +16,8 @@
"dist"
],
"dependencies": {
"@algolia/client-common": "4.20.0",
"@algolia/requester-common": "4.20.0",
"@algolia/transporter": "4.20.0"
"@algolia/client-common": "4.21.0",
"@algolia/requester-common": "4.21.0",
"@algolia/transporter": "4.21.0"
}
}
8 changes: 4 additions & 4 deletions packages/client-recommendation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/client-recommendation",
"version": "4.20.0",
"version": "4.21.0",
"private": false,
"repository": {
"type": "git",
@@ -16,8 +16,8 @@
"dist"
],
"dependencies": {
"@algolia/client-common": "4.20.0",
"@algolia/client-personalization": "4.20.0",
"@algolia/requester-common": "4.20.0"
"@algolia/client-common": "4.21.0",
"@algolia/client-personalization": "4.21.0",
"@algolia/requester-common": "4.21.0"
}
}
8 changes: 4 additions & 4 deletions packages/client-search/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/client-search",
"version": "4.20.0",
"version": "4.21.0",
"private": false,
"repository": {
"type": "git",
@@ -16,8 +16,8 @@
"dist"
],
"dependencies": {
"@algolia/client-common": "4.20.0",
"@algolia/requester-common": "4.20.0",
"@algolia/transporter": "4.20.0"
"@algolia/client-common": "4.21.0",
"@algolia/requester-common": "4.21.0",
"@algolia/transporter": "4.21.0"
}
}
2 changes: 1 addition & 1 deletion packages/logger-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/logger-common",
"version": "4.20.0",
"version": "4.21.0",
"private": false,
"description": "Common interfaces for promise-based log libraries",
"repository": {
4 changes: 2 additions & 2 deletions packages/logger-console/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/logger-console",
"version": "4.20.0",
"version": "4.21.0",
"private": false,
"description": "Promise-based log library using console log.",
"repository": {
@@ -17,6 +17,6 @@
"dist"
],
"dependencies": {
"@algolia/logger-common": "4.20.0"
"@algolia/logger-common": "4.21.0"
}
}
24 changes: 12 additions & 12 deletions packages/recommend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/recommend",
"version": "4.20.0",
"version": "4.21.0",
"private": false,
"description": "The perfect starting point to integrate Algolia Recommend within your JavaScript project.",
"repository": {
@@ -22,16 +22,16 @@
"index.d.ts"
],
"dependencies": {
"@algolia/cache-browser-local-storage": "4.20.0",
"@algolia/cache-common": "4.20.0",
"@algolia/cache-in-memory": "4.20.0",
"@algolia/client-common": "4.20.0",
"@algolia/client-search": "4.20.0",
"@algolia/logger-common": "4.20.0",
"@algolia/logger-console": "4.20.0",
"@algolia/requester-browser-xhr": "4.20.0",
"@algolia/requester-common": "4.20.0",
"@algolia/requester-node-http": "4.20.0",
"@algolia/transporter": "4.20.0"
"@algolia/cache-browser-local-storage": "4.21.0",
"@algolia/cache-common": "4.21.0",
"@algolia/cache-in-memory": "4.21.0",
"@algolia/client-common": "4.21.0",
"@algolia/client-search": "4.21.0",
"@algolia/logger-common": "4.21.0",
"@algolia/logger-console": "4.21.0",
"@algolia/requester-browser-xhr": "4.21.0",
"@algolia/requester-common": "4.21.0",
"@algolia/requester-node-http": "4.21.0",
"@algolia/transporter": "4.21.0"
}
}
2 changes: 2 additions & 0 deletions packages/recommend/src/builds/browser.ts
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ import {
getFrequentlyBoughtTogether,
getLookingSimilar,
getRecommendations,
getRecommendedForYou,
getRelatedProducts,
getTrendingFacets,
getTrendingItems,
@@ -57,6 +58,7 @@ export default function recommend(
getTrendingFacets,
getTrendingItems,
getLookingSimilar,
getRecommendedForYou,
},
});
}
2 changes: 2 additions & 0 deletions packages/recommend/src/builds/node.ts
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ import {
getFrequentlyBoughtTogether,
getLookingSimilar,
getRecommendations,
getRecommendedForYou,
getRelatedProducts,
getTrendingFacets,
getTrendingItems,
@@ -51,6 +52,7 @@ export default function recommend(
getTrendingFacets,
getTrendingItems,
getLookingSimilar,
getRecommendedForYou,
},
});
}
11 changes: 9 additions & 2 deletions packages/recommend/src/methods/getRecommendations.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { MethodEnum } from '@algolia/requester-common';

import { BaseRecommendClient, RecommendationsQuery, WithRecommendMethods } from '../types';
import {
BaseRecommendClient,
RecommendationsQuery,
RecommendedForYouQuery,
WithRecommendMethods,
} from '../types';
import { TrendingQuery } from '../types/TrendingQuery';

type GetRecommendations = (
@@ -9,7 +14,9 @@ type GetRecommendations = (

export const getRecommendations: GetRecommendations = base => {
return (queries: ReadonlyArray<RecommendationsQuery | TrendingQuery>, requestOptions) => {
const requests: ReadonlyArray<RecommendationsQuery | TrendingQuery> = queries.map(query => ({
const requests: ReadonlyArray<
RecommendationsQuery | TrendingQuery | RecommendedForYouQuery
> = queries.map(query => ({
...query,
// The `threshold` param is required by the endpoint to make it easier
// to provide a default value later, so we default it in the client
29 changes: 29 additions & 0 deletions packages/recommend/src/methods/getRecommendedForYou.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { MethodEnum } from '@algolia/requester-common';

import { BaseRecommendClient, RecommendedForYouQuery, WithRecommendMethods } from '../types';

type GetRecommendedForYou = (
base: BaseRecommendClient
) => WithRecommendMethods<BaseRecommendClient>['getRecommendedForYou'];

export const getRecommendedForYou: GetRecommendedForYou = base => {
return (queries: readonly RecommendedForYouQuery[], requestOptions) => {
const requests: readonly RecommendedForYouQuery[] = queries.map(query => ({
...query,
model: 'recommended-for-you',
threshold: query.threshold || 0,
}));

return base.transporter.read(
{
method: MethodEnum.Post,
path: '1/indexes/*/recommendations',
data: {
requests,
},
cacheable: true,
},
requestOptions
);
};
};
1 change: 1 addition & 0 deletions packages/recommend/src/methods/index.ts
Original file line number Diff line number Diff line change
@@ -8,3 +8,4 @@ export * from './getRelatedProducts';
export * from './getTrendingFacets';
export * from './getTrendingItems';
export * from './getLookingSimilar';
export * from './getRecommendedForYou';
Loading