@graphcommerce/algolia-personalization 9.0.0-canary.114 → 9.0.0-canary.116

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @graphcommerce/algolia-personalization
2
2
 
3
+ ## 9.0.0-canary.116
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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))
8
+
9
+ ## 9.0.0-canary.115
10
+
3
11
  ## 9.0.0-canary.114
4
12
 
5
13
  ## 9.0.0-canary.113
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.0-canary.114",
5
+ "version": "9.0.0-canary.116",
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.0-canary.114",
19
- "@graphcommerce/algolia-products": "^9.0.0-canary.114",
20
- "@graphcommerce/google-datalayer": "^9.0.0-canary.114",
21
- "@graphcommerce/graphql": "^9.0.0-canary.114",
22
- "@graphcommerce/graphql-mesh": "^9.0.0-canary.114",
23
- "@graphcommerce/magento-customer": "^9.0.0-canary.114",
24
- "@graphcommerce/magento-product": "^9.0.0-canary.114",
25
- "@graphcommerce/next-config": "^9.0.0-canary.114",
26
- "@graphcommerce/next-ui": "^9.0.0-canary.114",
18
+ "@graphcommerce/algolia-insights": "^9.0.0-canary.116",
19
+ "@graphcommerce/algolia-products": "^9.0.0-canary.116",
20
+ "@graphcommerce/google-datalayer": "^9.0.0-canary.116",
21
+ "@graphcommerce/graphql": "^9.0.0-canary.116",
22
+ "@graphcommerce/graphql-mesh": "^9.0.0-canary.116",
23
+ "@graphcommerce/magento-customer": "^9.0.0-canary.116",
24
+ "@graphcommerce/magento-product": "^9.0.0-canary.116",
25
+ "@graphcommerce/next-config": "^9.0.0-canary.116",
26
+ "@graphcommerce/next-ui": "^9.0.0-canary.116",
27
27
  "react": "^18.2.0"
28
28
  },
29
29
  "devDependencies": {
30
- "graphql": "^16.9.0",
31
- "tsx": "^4.19.1"
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 getInContextInput as getInContextInputType,
4
- type useInContextInput as useInContextInputType,
3
+ type getPrivateQueryContext as getPrivateQueryContextType,
4
+ type usePrivateQueryContext as usePrivateQueryContextType,
5
5
  } from '@graphcommerce/graphql'
6
- import type { InContextInput } from '@graphcommerce/graphql-mesh'
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 getInContextInput: FunctionPlugin<typeof getInContextInputType> = (
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 InContextInput
23
+ return { ...res, algoliaUserToken } satisfies PrivateContext
24
24
  }
25
25
 
26
- export const useInContextInput: FunctionPlugin<typeof useInContextInputType> = (prev, ...args) => {
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,3 +1,3 @@
1
- input InContextInput {
1
+ input PrivateContext {
2
2
  algoliaUserToken: String
3
3
  }