@faststore/api 1.8.23 → 1.8.24
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 +11 -0
- package/dist/__generated__/schema.d.ts +10 -10
- package/dist/api.cjs.development.js +13 -11
- package/dist/api.cjs.development.js.map +1 -1
- package/dist/api.cjs.production.min.js +1 -1
- package/dist/api.cjs.production.min.js.map +1 -1
- package/dist/api.esm.js +13 -11
- package/dist/api.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/__generated__/schema.ts +10 -10
- package/src/platforms/vtex/resolvers/product.ts +6 -3
- package/src/typeDefs/cart.graphql +1 -1
- package/src/typeDefs/order.graphql +2 -2
- package/src/typeDefs/product.graphql +5 -5
- package/src/typeDefs/productGroup.graphql +2 -2
|
@@ -11,7 +11,7 @@ export type Scalars = {
|
|
|
11
11
|
Float: number;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
/** Shopping cart
|
|
14
|
+
/** Shopping cart input. */
|
|
15
15
|
export type IStoreCart = {
|
|
16
16
|
/** Order information, including `orderNumber` and `acceptedOffer`. */
|
|
17
17
|
order: IStoreOrder;
|
|
@@ -43,7 +43,7 @@ export type IStoreOffer = {
|
|
|
43
43
|
export type IStoreOrder = {
|
|
44
44
|
/** Array with information on each accepted offer. */
|
|
45
45
|
acceptedOffer: Array<IStoreOffer>;
|
|
46
|
-
/**
|
|
46
|
+
/** ID of the order in [VTEX order management](https://help.vtex.com/en/tutorial/license-manager-resources-oms--60QcBsvWeum02cFi3GjBzg#). */
|
|
47
47
|
orderNumber: Scalars['String'];
|
|
48
48
|
};
|
|
49
49
|
|
|
@@ -53,13 +53,13 @@ export type IStoreOrganization = {
|
|
|
53
53
|
identifier: Scalars['String'];
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
/** Product input. */
|
|
56
|
+
/** Product input. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on. */
|
|
57
57
|
export type IStoreProduct = {
|
|
58
58
|
/** Array of product images. */
|
|
59
59
|
image: Array<IStoreImage>;
|
|
60
60
|
/** Product name. */
|
|
61
61
|
name: Scalars['String'];
|
|
62
|
-
/** Stock Keeping Unit ID. */
|
|
62
|
+
/** Stock Keeping Unit. Merchant-specific ID for the product. */
|
|
63
63
|
sku: Scalars['String'];
|
|
64
64
|
};
|
|
65
65
|
|
|
@@ -350,7 +350,7 @@ export type StoreOrder = {
|
|
|
350
350
|
__typename?: 'StoreOrder';
|
|
351
351
|
/** Array with information on each accepted offer. */
|
|
352
352
|
acceptedOffer: Array<StoreOffer>;
|
|
353
|
-
/**
|
|
353
|
+
/** ID of the order in [VTEX order management](https://help.vtex.com/en/tutorial/license-manager-resources-oms--60QcBsvWeum02cFi3GjBzg#). */
|
|
354
354
|
orderNumber: Scalars['String'];
|
|
355
355
|
};
|
|
356
356
|
|
|
@@ -389,7 +389,7 @@ export type StorePerson = {
|
|
|
389
389
|
id: Scalars['String'];
|
|
390
390
|
};
|
|
391
391
|
|
|
392
|
-
/** Product information. */
|
|
392
|
+
/** Product information. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on. */
|
|
393
393
|
export type StoreProduct = {
|
|
394
394
|
__typename?: 'StoreProduct';
|
|
395
395
|
/** Array of additional properties. */
|
|
@@ -412,13 +412,13 @@ export type StoreProduct = {
|
|
|
412
412
|
name: Scalars['String'];
|
|
413
413
|
/** Aggregate offer information. */
|
|
414
414
|
offers: StoreAggregateOffer;
|
|
415
|
-
/** Product ID. */
|
|
415
|
+
/** Product ID, such as [ISBN](https://www.isbn-international.org/content/what-isbn) or similar global IDs. */
|
|
416
416
|
productID: Scalars['String'];
|
|
417
417
|
/** Array with review information. */
|
|
418
418
|
review: Array<StoreReview>;
|
|
419
419
|
/** Meta tag data. */
|
|
420
420
|
seo: StoreSeo;
|
|
421
|
-
/** Stock Keeping Unit ID. */
|
|
421
|
+
/** Stock Keeping Unit. Merchant-specific ID for the product. */
|
|
422
422
|
sku: Scalars['String'];
|
|
423
423
|
/** Corresponding collection URL slug, with which to retrieve this entity. */
|
|
424
424
|
slug: Scalars['String'];
|
|
@@ -442,12 +442,12 @@ export type StoreProductEdge = {
|
|
|
442
442
|
node: StoreProduct;
|
|
443
443
|
};
|
|
444
444
|
|
|
445
|
-
/** Product group information. */
|
|
445
|
+
/** Product group information. Product groups are catalog entities that may contain variants. They are equivalent to VTEX [Products](https://help.vtex.com/en/tutorial/what-is-a-product--2zrB2gFCHyQokCKKE8kuAw#), whereas each variant is equivalent to a VTEX [SKU](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on. */
|
|
446
446
|
export type StoreProductGroup = {
|
|
447
447
|
__typename?: 'StoreProductGroup';
|
|
448
448
|
/** Array of additional properties. */
|
|
449
449
|
additionalProperty: Array<StorePropertyValue>;
|
|
450
|
-
/** Array of variants related to product group. */
|
|
450
|
+
/** Array of variants related to product group. Variants are equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). */
|
|
451
451
|
hasVariant: Array<StoreProduct>;
|
|
452
452
|
/** Product group name. */
|
|
453
453
|
name: Scalars['String'];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { enhanceCommercialOffer } from '../utils/enhanceCommercialOffer'
|
|
2
2
|
import { bestOfferFirst } from '../utils/productStock'
|
|
3
|
+
import { slugify } from '../utils/slugify'
|
|
3
4
|
import type { EnhancedCommercialOffer } from '../utils/enhanceCommercialOffer'
|
|
4
5
|
import type { Resolver } from '..'
|
|
5
6
|
import type { PromiseType } from '../../../typings'
|
|
@@ -38,11 +39,13 @@ export const StoreProduct: Record<string, Resolver<Root>> & {
|
|
|
38
39
|
return {
|
|
39
40
|
itemListElement: [
|
|
40
41
|
...categories.reverse().map((categoryPath, index) => {
|
|
41
|
-
const
|
|
42
|
+
const splitted = categoryPath.split('/')
|
|
43
|
+
const name = splitted[splitted.length - 2]
|
|
44
|
+
const item = splitted.map(slugify).join('/')
|
|
42
45
|
|
|
43
46
|
return {
|
|
44
|
-
name
|
|
45
|
-
item
|
|
47
|
+
name,
|
|
48
|
+
item,
|
|
46
49
|
position: index + 1,
|
|
47
50
|
}
|
|
48
51
|
}),
|
|
@@ -3,7 +3,7 @@ Information of a specific order.
|
|
|
3
3
|
"""
|
|
4
4
|
type StoreOrder {
|
|
5
5
|
"""
|
|
6
|
-
|
|
6
|
+
ID of the order in [VTEX order management](https://help.vtex.com/en/tutorial/license-manager-resources-oms--60QcBsvWeum02cFi3GjBzg#).
|
|
7
7
|
"""
|
|
8
8
|
orderNumber: String!
|
|
9
9
|
"""
|
|
@@ -17,7 +17,7 @@ Offer input.
|
|
|
17
17
|
"""
|
|
18
18
|
input IStoreOrder {
|
|
19
19
|
"""
|
|
20
|
-
|
|
20
|
+
ID of the order in [VTEX order management](https://help.vtex.com/en/tutorial/license-manager-resources-oms--60QcBsvWeum02cFi3GjBzg#).
|
|
21
21
|
"""
|
|
22
22
|
orderNumber: String!
|
|
23
23
|
"""
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Product information.
|
|
2
|
+
Product information. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.
|
|
3
3
|
"""
|
|
4
4
|
type StoreProduct {
|
|
5
5
|
"""
|
|
@@ -19,7 +19,7 @@ type StoreProduct {
|
|
|
19
19
|
"""
|
|
20
20
|
name: String!
|
|
21
21
|
"""
|
|
22
|
-
Product ID.
|
|
22
|
+
Product ID, such as [ISBN](https://www.isbn-international.org/content/what-isbn) or similar global IDs.
|
|
23
23
|
"""
|
|
24
24
|
productID: String!
|
|
25
25
|
"""
|
|
@@ -39,7 +39,7 @@ type StoreProduct {
|
|
|
39
39
|
"""
|
|
40
40
|
offers: StoreAggregateOffer!
|
|
41
41
|
"""
|
|
42
|
-
Stock Keeping Unit ID.
|
|
42
|
+
Stock Keeping Unit. Merchant-specific ID for the product.
|
|
43
43
|
"""
|
|
44
44
|
sku: String!
|
|
45
45
|
"""
|
|
@@ -65,11 +65,11 @@ type StoreProduct {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
"""
|
|
68
|
-
Product input.
|
|
68
|
+
Product input. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.
|
|
69
69
|
"""
|
|
70
70
|
input IStoreProduct {
|
|
71
71
|
"""
|
|
72
|
-
Stock Keeping Unit ID.
|
|
72
|
+
Stock Keeping Unit. Merchant-specific ID for the product.
|
|
73
73
|
"""
|
|
74
74
|
sku: String!
|
|
75
75
|
"""
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Product group information.
|
|
2
|
+
Product group information. Product groups are catalog entities that may contain variants. They are equivalent to VTEX [Products](https://help.vtex.com/en/tutorial/what-is-a-product--2zrB2gFCHyQokCKKE8kuAw#), whereas each variant is equivalent to a VTEX [SKU](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.
|
|
3
3
|
"""
|
|
4
4
|
type StoreProductGroup {
|
|
5
5
|
"""
|
|
6
|
-
Array of variants related to product group.
|
|
6
|
+
Array of variants related to product group. Variants are equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#).
|
|
7
7
|
"""
|
|
8
8
|
hasVariant: [StoreProduct!]!
|
|
9
9
|
"""
|