@faststore/api 2.1.38 → 2.1.66

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.38",
3
+ "version": "2.1.66",
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": "cd01b62a902d6458d6d27e7e622b4a5465dd8c91"
59
+ "gitHead": "a88fa12d654e7145278b839345efbf75e43e0228"
60
60
  }
@@ -128,6 +128,10 @@ export const VtexCommerce = (
128
128
  {
129
129
  ...BASE_INIT,
130
130
  body: JSON.stringify(mappedBody),
131
+ headers: {
132
+ 'content-type': 'application/json',
133
+ cookie: ctx.headers.cookie,
134
+ }
131
135
  }
132
136
  )
133
137
  },
@@ -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
+ }
@@ -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