@faststore/api 2.1.36 → 2.1.53

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.
@@ -6,6 +6,7 @@ export interface Namespaces {
6
6
  profile?: Profile;
7
7
  store?: Store;
8
8
  checkout?: Checkout;
9
+ public?: Public;
9
10
  }
10
11
  export interface Value {
11
12
  value: string;
@@ -26,3 +27,7 @@ export interface Profile {
26
27
  export interface Checkout {
27
28
  orderFormId?: Value;
28
29
  }
30
+ export interface Public {
31
+ orderFormId?: Value;
32
+ items?: Value;
33
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/api",
3
- "version": "2.1.36",
3
+ "version": "2.1.53",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -36,8 +36,8 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@envelop/core": "^2.6.0",
39
- "@faststore/eslint-config": "^2.1.33",
40
- "@faststore/shared": "^2.1.33",
39
+ "@faststore/eslint-config": "^2.1.53",
40
+ "@faststore/shared": "^2.1.53",
41
41
  "@graphql-codegen/cli": "2.2.0",
42
42
  "@graphql-codegen/typescript": "2.2.2",
43
43
  "@types/express": "^4.17.16",
@@ -56,5 +56,5 @@
56
56
  "@envelop/core": "^1 || ^2",
57
57
  "graphql": "^15.6.0"
58
58
  },
59
- "gitHead": "2bb75febbcbdc8c114d3f0912db8502840851440"
59
+ "gitHead": "8a8ae487ebb12a99a5410a00ab9850a2a3eee031"
60
60
  }
@@ -7,6 +7,7 @@ export interface Namespaces {
7
7
  profile?: Profile
8
8
  store?: Store
9
9
  checkout?: Checkout
10
+ public?: Public
10
11
  }
11
12
 
12
13
  export interface Value {
@@ -31,3 +32,8 @@ export interface Profile {
31
32
  export interface Checkout {
32
33
  orderFormId?: Value
33
34
  }
35
+
36
+ export interface Public {
37
+ orderFormId?: Value
38
+ items?: Value
39
+ }
@@ -83,7 +83,7 @@ export const IntelligentSearch = (
83
83
  }
84
84
 
85
85
  const addDefaultFacets = (facets: SelectedFacet[]) => {
86
- const withDefaltFacets = facets.filter(({ key }) => !CHANNEL_KEYS.has(key))
86
+ const withDefaultFacets = facets.filter(({ key }) => !CHANNEL_KEYS.has(key))
87
87
 
88
88
  const policyFacet =
89
89
  facets.find(({ key }) => key === POLICY_KEY) ?? getPolicyFacet()
@@ -92,14 +92,14 @@ export const IntelligentSearch = (
92
92
  facets.find(({ key }) => key === REGION_KEY) ?? getRegionFacet()
93
93
 
94
94
  if (policyFacet !== null) {
95
- withDefaltFacets.push(policyFacet)
95
+ withDefaultFacets.push(policyFacet)
96
96
  }
97
97
 
98
98
  if (regionFacet !== null) {
99
- withDefaltFacets.push(regionFacet)
99
+ withDefaultFacets.push(regionFacet)
100
100
  }
101
101
 
102
- return withDefaltFacets
102
+ return withDefaultFacets
103
103
  }
104
104
 
105
105
  const search = <T>({
@@ -213,7 +213,7 @@ async function getOrderNumberFromSession(
213
213
 
214
214
  if (cookieSession) {
215
215
  const { namespaces } = await commerce.getSessionOrder()
216
- return namespaces.checkout?.orderFormId?.value
216
+ return namespaces.public?.orderFormId?.value ?? undefined
217
217
  }
218
218
  return
219
219
  }
@@ -325,7 +325,6 @@ export const validateCart = async (
325
325
  headers,
326
326
  commerce
327
327
  )
328
-
329
328
  const orderNumber = orderNumberFromSession ?? orderNumberFromCart ?? ''
330
329
 
331
330
  // Step1: Get OrderForm from VTEX Commerce