@graphcommerce/algolia-recommend 9.1.0-canary.49 → 9.1.0-canary.51

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,9 @@
1
1
  # @graphcommerce/algolia-recommend
2
2
 
3
+ ## 9.1.0-canary.51
4
+
5
+ ## 9.1.0-canary.50
6
+
3
7
  ## 9.1.0-canary.49
4
8
 
5
9
  ## 9.1.0-canary.48
package/mesh/resolvers.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  import type {
3
3
  AlgoliaLookingSimilarInput,
4
4
  AlgoliaRelatedProductsInput,
5
+ Maybe,
5
6
  MeshContext,
6
7
  ProductInterfaceResolvers,
7
8
  ResolverFn,
@@ -10,11 +11,7 @@ import type {
10
11
  ResolversTypes,
11
12
  } from '@graphcommerce/graphql-mesh'
12
13
  import fragments from '@graphcommerce/graphql/generated/fragments.json'
13
- import type {
14
- GraphCommerceAlgoliaRecommendationLocation,
15
- InputMaybe,
16
- Maybe,
17
- } from '@graphcommerce/next-config'
14
+ import type { GraphCommerceConfig } from '@graphcommerce/next-config'
18
15
  import { createProductMapper } from './createProductMapper'
19
16
  import { createFacetValueMapper } from './createValueFacetMapper'
20
17
  import { getRecommendationsArgs } from './getRecommendationArgs'
@@ -66,13 +63,11 @@ const resolvers: Resolvers = {
66
63
  },
67
64
  }
68
65
 
69
- function isEnabled(location: InputMaybe<GraphCommerceAlgoliaRecommendationLocation> | undefined) {
66
+ function isEnabled(location: GraphCommerceConfig['algolia']['lookingSimilar'] | undefined) {
70
67
  return location && location !== 'DISABLED'
71
68
  }
72
69
 
73
- function enumToLocation(
74
- location: InputMaybe<GraphCommerceAlgoliaRecommendationLocation> | undefined,
75
- ) {
70
+ function enumToLocation(location: GraphCommerceConfig['algolia']['lookingSimilar'] | undefined) {
76
71
  if (!isEnabled(location)) throw Error('Check for isEnabled before calling this function')
77
72
  if (location === 'CROSSSELL_PRODUCTS') return 'crosssell_products' as const
78
73
  if (location === 'UPSELL_PRODUCTS') return 'upsell_products' as const
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/algolia-recommend",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "9.1.0-canary.49",
5
+ "version": "9.1.0-canary.51",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -15,11 +15,11 @@
15
15
  "generate": "tsx scripts/generate-recommend-spec.mts"
16
16
  },
17
17
  "peerDependencies": {
18
- "@graphcommerce/algolia-products": "^9.1.0-canary.49",
19
- "@graphcommerce/graphql": "^9.1.0-canary.49",
20
- "@graphcommerce/graphql-mesh": "^9.1.0-canary.49",
21
- "@graphcommerce/next-config": "^9.1.0-canary.49",
22
- "@graphcommerce/next-ui": "^9.1.0-canary.49",
18
+ "@graphcommerce/algolia-products": "^9.1.0-canary.51",
19
+ "@graphcommerce/graphql": "^9.1.0-canary.51",
20
+ "@graphcommerce/graphql-mesh": "^9.1.0-canary.51",
21
+ "@graphcommerce/next-config": "^9.1.0-canary.51",
22
+ "@graphcommerce/next-ui": "^9.1.0-canary.51",
23
23
  "react": "^18.2.0"
24
24
  },
25
25
  "devDependencies": {