@graphcommerce/algolia-personalization 9.0.0-canary.99 → 9.0.1-canary.0
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/CHANGELOG.md +33 -15
- package/mesh/getUserToken.ts +1 -1
- package/package.json +12 -12
- package/plugins/InContextInputAlgoliaUserToken.ts +9 -6
- package/plugins/getSearchResultsInputPersonalization.ts +1 -1
- package/plugins/getSearchSuggestionsInputPersonalization.ts +1 -1
- package/schema/InContext_algoliaUserToken.graphqls +1 -1
- package/tsconfig.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,34 +1,52 @@
|
|
|
1
1
|
# @graphcommerce/algolia-personalization
|
|
2
2
|
|
|
3
|
-
## 9.0.
|
|
3
|
+
## 9.0.1-canary.0
|
|
4
4
|
|
|
5
|
-
## 9.0.0
|
|
5
|
+
## 9.0.0
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### Minor Changes
|
|
8
|
+
|
|
9
|
+
- [#2377](https://github.com/graphcommerce-org/graphcommerce/pull/2377) [`56fcc45`](https://github.com/graphcommerce-org/graphcommerce/commit/56fcc45b60e43574c64fcdd7b02f8062d677e250) - Integrated algolia personalisation and algolia analytics into GraphQL Mesh. Built user profiles and gives user personalised results. Keep track of the user data and view in algolia analytics dashboard. ([@Renzovh](https://github.com/Renzovh))
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#2452](https://github.com/graphcommerce-org/graphcommerce/pull/2452) [`5dfd3b2`](https://github.com/graphcommerce-org/graphcommerce/commit/5dfd3b201255ef35263485d04153d37bb7e4fe67) - Renamed useInContextQuery to usePrivateQuery ([@paales](https://github.com/paales))
|
|
14
|
+
|
|
15
|
+
## 9.0.0-canary.118
|
|
16
|
+
|
|
17
|
+
## 9.0.0-canary.117
|
|
18
|
+
|
|
19
|
+
## 9.0.0-canary.116
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- [#2452](https://github.com/graphcommerce-org/graphcommerce/pull/2452) [`5dfd3b2`](https://github.com/graphcommerce-org/graphcommerce/commit/5dfd3b201255ef35263485d04153d37bb7e4fe67) - Renamed useInContextQuery to usePrivateQuery ([@paales](https://github.com/paales))
|
|
24
|
+
|
|
25
|
+
## 9.0.0-canary.115
|
|
8
26
|
|
|
9
|
-
## 9.0.0-canary.
|
|
27
|
+
## 9.0.0-canary.114
|
|
10
28
|
|
|
11
|
-
## 9.0.0-canary.
|
|
29
|
+
## 9.0.0-canary.113
|
|
12
30
|
|
|
13
|
-
## 9.0.0-canary.
|
|
31
|
+
## 9.0.0-canary.112
|
|
14
32
|
|
|
15
|
-
## 9.0.0-canary.
|
|
33
|
+
## 9.0.0-canary.111
|
|
16
34
|
|
|
17
|
-
## 9.0.0-canary.
|
|
35
|
+
## 9.0.0-canary.110
|
|
18
36
|
|
|
19
|
-
## 9.0.0-canary.
|
|
37
|
+
## 9.0.0-canary.109
|
|
20
38
|
|
|
21
|
-
## 9.0.0-canary.
|
|
39
|
+
## 9.0.0-canary.108
|
|
22
40
|
|
|
23
|
-
## 9.0.0-canary.
|
|
41
|
+
## 9.0.0-canary.107
|
|
24
42
|
|
|
25
|
-
## 9.0.0-canary.
|
|
43
|
+
## 9.0.0-canary.106
|
|
26
44
|
|
|
27
|
-
## 9.0.0-canary.
|
|
45
|
+
## 9.0.0-canary.105
|
|
28
46
|
|
|
29
|
-
## 9.0.0-canary.
|
|
47
|
+
## 9.0.0-canary.104
|
|
30
48
|
|
|
31
|
-
## 9.0.0-canary.
|
|
49
|
+
## 9.0.0-canary.103
|
|
32
50
|
|
|
33
51
|
## 9.0.0-canary.84
|
|
34
52
|
|
package/mesh/getUserToken.ts
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/algolia-personalization",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "9.0.
|
|
5
|
+
"version": "9.0.1-canary.0",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
"generate": "tsx scripts/generate-insights-spec.mts"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@graphcommerce/algolia-insights": "^9.0.
|
|
19
|
-
"@graphcommerce/algolia-products": "^9.0.
|
|
20
|
-
"@graphcommerce/google-datalayer": "^9.0.
|
|
21
|
-
"@graphcommerce/graphql": "^9.0.
|
|
22
|
-
"@graphcommerce/graphql-mesh": "^9.0.
|
|
23
|
-
"@graphcommerce/magento-customer": "^9.0.
|
|
24
|
-
"@graphcommerce/magento-product": "^9.0.
|
|
25
|
-
"@graphcommerce/next-config": "^9.0.
|
|
26
|
-
"@graphcommerce/next-ui": "^9.0.
|
|
18
|
+
"@graphcommerce/algolia-insights": "^9.0.1-canary.0",
|
|
19
|
+
"@graphcommerce/algolia-products": "^9.0.1-canary.0",
|
|
20
|
+
"@graphcommerce/google-datalayer": "^9.0.1-canary.0",
|
|
21
|
+
"@graphcommerce/graphql": "^9.0.1-canary.0",
|
|
22
|
+
"@graphcommerce/graphql-mesh": "^9.0.1-canary.0",
|
|
23
|
+
"@graphcommerce/magento-customer": "^9.0.1-canary.0",
|
|
24
|
+
"@graphcommerce/magento-product": "^9.0.1-canary.0",
|
|
25
|
+
"@graphcommerce/next-config": "^9.0.1-canary.0",
|
|
26
|
+
"@graphcommerce/next-ui": "^9.0.1-canary.0",
|
|
27
27
|
"react": "^18.2.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"graphql": "^16.
|
|
31
|
-
"tsx": "^4.
|
|
30
|
+
"graphql": "^16.10.0",
|
|
31
|
+
"tsx": "^4.19.2"
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ALGOLIA_USER_TOKEN_COOKIE_NAME } from '@graphcommerce/algolia-insights'
|
|
2
2
|
import {
|
|
3
|
-
type
|
|
4
|
-
type
|
|
3
|
+
type getPrivateQueryContext as getPrivateQueryContextType,
|
|
4
|
+
type usePrivateQueryContext as usePrivateQueryContextType,
|
|
5
5
|
} from '@graphcommerce/graphql'
|
|
6
|
-
import type {
|
|
6
|
+
import type { PrivateContext } from '@graphcommerce/graphql-mesh'
|
|
7
7
|
import type { FunctionPlugin, PluginConfig } from '@graphcommerce/next-config'
|
|
8
8
|
import { cookie } from '@graphcommerce/next-ui'
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ export const config: PluginConfig = {
|
|
|
12
12
|
module: '@graphcommerce/graphql',
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export const
|
|
15
|
+
export const getPrivateQueryContext: FunctionPlugin<typeof getPrivateQueryContextType> = (
|
|
16
16
|
prev,
|
|
17
17
|
client,
|
|
18
18
|
...args
|
|
@@ -20,10 +20,13 @@ export const getInContextInput: FunctionPlugin<typeof getInContextInputType> = (
|
|
|
20
20
|
const algoliaUserToken = cookie(ALGOLIA_USER_TOKEN_COOKIE_NAME)
|
|
21
21
|
const res = prev(client, ...args)
|
|
22
22
|
if (!algoliaUserToken) return res
|
|
23
|
-
return { ...res, algoliaUserToken } satisfies
|
|
23
|
+
return { ...res, algoliaUserToken } satisfies PrivateContext
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export const
|
|
26
|
+
export const usePrivateQueryContext: FunctionPlugin<typeof usePrivateQueryContextType> = (
|
|
27
|
+
prev,
|
|
28
|
+
...args
|
|
29
|
+
) => {
|
|
27
30
|
const algoliaUserToken = cookie(ALGOLIA_USER_TOKEN_COOKIE_NAME)
|
|
28
31
|
const res = prev(...args)
|
|
29
32
|
if (!algoliaUserToken) return res
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { getSearchResultsInput as getSearchResultsInputType } from '@graphcommerce/algolia-products'
|
|
2
|
-
import { FunctionPlugin, PluginConfig } from '@graphcommerce/next-config'
|
|
2
|
+
import type { FunctionPlugin, PluginConfig } from '@graphcommerce/next-config'
|
|
3
3
|
import { getUserToken } from '../mesh/getUserToken'
|
|
4
4
|
|
|
5
5
|
export const config: PluginConfig = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { getSearchSuggestionsInput as getSearchSuggestionsInputType } from '@graphcommerce/algolia-products'
|
|
2
|
-
import { FunctionPlugin, PluginConfig } from '@graphcommerce/next-config'
|
|
2
|
+
import type { FunctionPlugin, PluginConfig } from '@graphcommerce/next-config'
|
|
3
3
|
import { getUserToken } from '../mesh/getUserToken'
|
|
4
4
|
|
|
5
5
|
export const config: PluginConfig = {
|
package/tsconfig.json
CHANGED