@faststore/api 1.8.2 → 1.8.3

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/api.cjs.development.js +151 -130
  3. package/dist/api.cjs.development.js.map +1 -1
  4. package/dist/api.cjs.production.min.js +1 -1
  5. package/dist/api.cjs.production.min.js.map +1 -1
  6. package/dist/api.esm.js +151 -125
  7. package/dist/api.esm.js.map +1 -1
  8. package/dist/index.d.ts +4 -17
  9. package/dist/local/server.d.ts +1 -0
  10. package/dist/platforms/vtex/clients/search/types/ProductSearchResult.d.ts +1 -1
  11. package/dist/platforms/vtex/index.d.ts +4 -17
  12. package/dist/platforms/vtex/resolvers/aggregateOffer.d.ts +2 -5
  13. package/dist/platforms/vtex/resolvers/product.d.ts +2 -6
  14. package/dist/platforms/vtex/utils/enhanceCommercialOffer.d.ts +7 -0
  15. package/dist/platforms/vtex/utils/productStock.d.ts +7 -6
  16. package/package.json +2 -2
  17. package/src/platforms/vtex/clients/search/types/ProductSearchResult.ts +1 -1
  18. package/src/platforms/vtex/resolvers/aggregateOffer.ts +15 -13
  19. package/src/platforms/vtex/resolvers/offer.ts +44 -49
  20. package/src/platforms/vtex/resolvers/product.ts +14 -10
  21. package/src/platforms/vtex/utils/enhanceCommercialOffer.ts +24 -0
  22. package/src/platforms/vtex/utils/productStock.ts +22 -25
  23. package/src/typeDefs/aggregateOffer.graphql +18 -3
  24. package/src/typeDefs/aggregateRating.graphql +9 -0
  25. package/src/typeDefs/author.graphql +6 -0
  26. package/src/typeDefs/brand.graphql +6 -0
  27. package/src/typeDefs/breadcrumb.graphql +21 -0
  28. package/src/typeDefs/cart.graphql +24 -0
  29. package/src/typeDefs/collection.graphql +39 -2
  30. package/src/typeDefs/facet.graphql +30 -1
  31. package/src/typeDefs/image.graphql +18 -0
  32. package/src/typeDefs/mutation.graphql +30 -2
  33. package/src/typeDefs/offer.graphql +51 -1
  34. package/src/typeDefs/order.graphql +18 -0
  35. package/src/typeDefs/organization.graphql +12 -0
  36. package/src/typeDefs/pageInfo.graphql +18 -1
  37. package/src/typeDefs/person.graphql +15 -0
  38. package/src/typeDefs/product.graphql +60 -3
  39. package/src/typeDefs/productGroup.graphql +15 -0
  40. package/src/typeDefs/propertyValue.graphql +9 -0
  41. package/src/typeDefs/query.graphql +66 -0
@@ -1,9 +1,27 @@
1
+ """
2
+ Image.
3
+ """
1
4
  type StoreImage {
5
+ """
6
+ Image URL.
7
+ """
2
8
  url: String!
9
+ """
10
+ Alias for the image.
11
+ """
3
12
  alternateName: String!
4
13
  }
5
14
 
15
+ """
16
+ Image input.
17
+ """
6
18
  input IStoreImage {
19
+ """
20
+ Image input URL.
21
+ """
7
22
  url: String!
23
+ """
24
+ Alias for the input image.
25
+ """
8
26
  alternateName: String!
9
27
  }
@@ -1,18 +1,46 @@
1
+ """
2
+ Session information.
3
+ """
1
4
  type StoreSession {
5
+ """
6
+ Session channel.
7
+ """
2
8
  channel: String
9
+ """
10
+ Session country.
11
+ """
3
12
  country: String
13
+ """
14
+ Session postal code.
15
+ """
4
16
  postalCode: String
5
17
  }
6
18
 
19
+ """
20
+ Session input.
21
+ """
7
22
  input IStoreSession {
23
+ """
24
+ Session input channel.
25
+ """
8
26
  channel: String
27
+ """
28
+ Session input country.
29
+ """
9
30
  country: String
31
+ """
32
+ Session input postal code.
33
+ """
10
34
  postalCode: String
11
35
  }
12
36
 
13
37
  type Mutation {
14
- # Returns the order if anything changed with the order. Null if the order is valid
38
+ """
39
+ Returns the order if anything has changed in it, or `null` if the order is valid.
40
+ """
15
41
  validateCart(cart: IStoreCart!): StoreCart
16
-
42
+ """
43
+ Update session information.
44
+ """
17
45
  updateSession(session: IStoreSession!): StoreSession!
18
46
  }
@@ -1,21 +1,71 @@
1
+ """
2
+ Offer information.
3
+ """
1
4
  type StoreOffer {
5
+ """
6
+ This is displayed as the "from" price in the context of promotions' price comparison. This may change before it reaches the shelf.
7
+ """
2
8
  listPrice: Float!
9
+ """
10
+ Computed price before applying coupons, taxes or benefits. This may change before it reaches the shelf.
11
+ """
3
12
  sellingPrice: Float!
13
+ """
14
+ ISO code of the currency used for the offer prices.
15
+ """
4
16
  priceCurrency: String!
5
- # Also known as spotPrice
17
+ """
18
+ Also known as spot price.
19
+ """
6
20
  price: Float!
21
+ """
22
+ Next date in which price is scheduled to change. If there is no scheduled change, this will be set a year in the future from current time.
23
+ """
7
24
  priceValidUntil: String!
25
+ """
26
+ Offer item condition.
27
+ """
8
28
  itemCondition: String!
29
+ """
30
+ Offer item availability.
31
+ """
9
32
  availability: String!
33
+ """
34
+ Seller responsible for the offer.
35
+ """
10
36
  seller: StoreOrganization!
37
+ """
38
+ Information on the item being offered.
39
+ """
11
40
  itemOffered: StoreProduct!
41
+ """
42
+ Number of items offered.
43
+ """
12
44
  quantity: Int!
13
45
  }
14
46
 
47
+ """
48
+ Offer input.
49
+ """
15
50
  input IStoreOffer {
51
+ """
52
+ Also known as spot price.
53
+ """
16
54
  price: Float!
55
+ """
56
+ This is displayed as the "from" price in the context of promotions' price comparison. This may change before it reaches the shelf.
57
+ """
17
58
  listPrice: Float!
59
+ """
60
+ Seller responsible for the offer.
61
+ """
18
62
  seller: IStoreOrganization!
63
+ """
64
+ Information on the item being offered.
65
+ """
19
66
  itemOffered: IStoreProduct!
67
+ """
68
+ Number of items offered.
69
+ """
20
70
  quantity: Int!
21
71
  }
@@ -1,9 +1,27 @@
1
+ """
2
+ Information of a specific order.
3
+ """
1
4
  type StoreOrder {
5
+ """
6
+ Order shopping cart ID, also known as `orderFormId`.
7
+ """
2
8
  orderNumber: String!
9
+ """
10
+ Array with information on each accepted offer.
11
+ """
3
12
  acceptedOffer: [StoreOffer!]!
4
13
  }
5
14
 
15
+ """
16
+ Offer input.
17
+ """
6
18
  input IStoreOrder {
19
+ """
20
+ Order shopping cart ID, also known as `orderFormId`.
21
+ """
7
22
  orderNumber: String!
23
+ """
24
+ Array with information on each accepted offer.
25
+ """
8
26
  acceptedOffer: [IStoreOffer!]!
9
27
  }
@@ -1,7 +1,19 @@
1
+ """
2
+ Organization.
3
+ """
1
4
  type StoreOrganization {
5
+ """
6
+ Organization ID.
7
+ """
2
8
  identifier: String!
3
9
  }
4
10
 
11
+ """
12
+ Organization input.
13
+ """
5
14
  input IStoreOrganization {
15
+ """
16
+ Organization ID.
17
+ """
6
18
  identifier: String!
7
19
  }
@@ -1,8 +1,25 @@
1
+ """
2
+ Page information.
3
+ """
1
4
  type StorePageInfo {
5
+ """
6
+ Indicates whether next page exists.
7
+ """
2
8
  hasNextPage: Boolean!
9
+ """
10
+ Indicates whether previous page exists.
11
+ """
3
12
  hasPreviousPage: Boolean!
13
+ """
14
+ Page cursor start.
15
+ """
4
16
  startCursor: String!
17
+ """
18
+ Page cursor end.
19
+ """
5
20
  endCursor: String!
6
- # Total number of items(products/collections), not pages
21
+ """
22
+ Total number of items (products or collections), not pages.
23
+ """
7
24
  totalCount: Int!
8
25
  }
@@ -1,6 +1,21 @@
1
+ """
2
+ Client profile data.
3
+ """
1
4
  type StorePerson {
5
+ """
6
+ Client ID.
7
+ """
2
8
  id: String!
9
+ """
10
+ Client email.
11
+ """
3
12
  email: String!
13
+ """
14
+ Client first name.
15
+ """
4
16
  givenName: String!
17
+ """
18
+ Client last name.
19
+ """
5
20
  familyName: String!
6
21
  }
@@ -1,26 +1,83 @@
1
+ """
2
+ Product information.
3
+ """
1
4
  type StoreProduct {
2
- # Meta tag data
5
+ """
6
+ Meta tag data.
7
+ """
3
8
  seo: StoreSeo!
4
- # Location for structured data
9
+ """
10
+ List of items consisting of chain linked web pages, ending with the current page.
11
+ """
5
12
  breadcrumbList: StoreBreadcrumbList!
6
- # Where to retrieve this entity
13
+ """
14
+ Corresponding collection URL slug, with which to retrieve this entity.
15
+ """
7
16
  slug: String!
17
+ """
18
+ Product name.
19
+ """
8
20
  name: String!
21
+ """
22
+ Product ID.
23
+ """
9
24
  productID: String!
25
+ """
26
+ Product brand.
27
+ """
10
28
  brand: StoreBrand!
29
+ """
30
+ Product description.
31
+ """
11
32
  description: String!
33
+ """
34
+ Array of images.
35
+ """
12
36
  image: [StoreImage!]!
37
+ """
38
+ Aggregate offer information.
39
+ """
13
40
  offers: StoreAggregateOffer!
41
+ """
42
+ Stock Keeping Unit ID.
43
+ """
14
44
  sku: String!
45
+ """
46
+ Global Trade Item Number.
47
+ """
15
48
  gtin: String!
49
+ """
50
+ Array with review information.
51
+ """
16
52
  review: [StoreReview!]!
53
+ """
54
+ Aggregate ratings data.
55
+ """
17
56
  aggregateRating: StoreAggregateRating!
57
+ """
58
+ Indicates product group related to this product.
59
+ """
18
60
  isVariantOf: StoreProductGroup!
61
+ """
62
+ Array of additional properties.
63
+ """
19
64
  additionalProperty: [StorePropertyValue!]!
20
65
  }
21
66
 
67
+ """
68
+ Product input.
69
+ """
22
70
  input IStoreProduct {
71
+ """
72
+ Stock Keeping Unit ID.
73
+ """
23
74
  sku: String!
75
+ """
76
+ Product name.
77
+ """
24
78
  name: String!
79
+ """
80
+ Array of product images.
81
+ """
25
82
  image: [IStoreImage!]!
26
83
  }
@@ -1,6 +1,21 @@
1
+ """
2
+ Product group information.
3
+ """
1
4
  type StoreProductGroup {
5
+ """
6
+ Array of variants related to product group.
7
+ """
2
8
  hasVariant: [StoreProduct!]!
9
+ """
10
+ Product group ID.
11
+ """
3
12
  productGroupID: String!
13
+ """
14
+ Product group name.
15
+ """
4
16
  name: String!
17
+ """
18
+ Array of additional properties.
19
+ """
5
20
  additionalProperty: [StorePropertyValue!]!
6
21
  }
@@ -1,4 +1,13 @@
1
+ """
2
+ Properties that can be associated with products and products groups.
3
+ """
1
4
  type StorePropertyValue {
5
+ """
6
+ Property value.
7
+ """
2
8
  value: String!
9
+ """
10
+ Property name.
11
+ """
3
12
  name: String!
4
13
  }
@@ -1,23 +1,62 @@
1
+ """
2
+ Product pagination edge.
3
+ """
1
4
  type StoreProductEdge {
5
+ """
6
+ Product pagination node.
7
+ """
2
8
  node: StoreProduct!
9
+ """
10
+ Product pagination cursor.
11
+ """
3
12
  cursor: String!
4
13
  }
5
14
 
15
+ """
16
+ Product connection pagination information.
17
+ """
6
18
  type StoreProductConnection {
19
+ """
20
+ Product connection page information.
21
+ """
7
22
  pageInfo: StorePageInfo!
23
+ """
24
+ Array with product connection page edges.
25
+ """
8
26
  edges: [StoreProductEdge!]!
9
27
  }
10
28
 
29
+ """
30
+ Collection pagination edge.
31
+ """
11
32
  type StoreCollectionEdge {
33
+ """
34
+ Collection pagination node.
35
+ """
12
36
  node: StoreCollection!
37
+ """
38
+ Collection pagination cursor.
39
+ """
13
40
  cursor: String!
14
41
  }
15
42
 
43
+ """
44
+ Collection connection pagination information.
45
+ """
16
46
  type StoreCollectionConnection {
47
+ """
48
+ Collection connection page information.
49
+ """
17
50
  pageInfo: StorePageInfo!
51
+ """
52
+ Array with collection connection page edges.
53
+ """
18
54
  edges: [StoreCollectionEdge!]!
19
55
  }
20
56
 
57
+ """
58
+ Product sorting options used in search.
59
+ """
21
60
  enum StoreSort {
22
61
  price_desc
23
62
  price_asc
@@ -29,24 +68,51 @@ enum StoreSort {
29
68
  score_desc
30
69
  }
31
70
 
71
+ """
72
+ Selected facet input.
73
+ """
32
74
  input IStoreSelectedFacet {
33
75
  key: String!
34
76
  value: String!
35
77
  }
36
78
 
79
+ """
80
+ Search facet type.
81
+ """
37
82
  enum StoreFacetType {
38
83
  BOOLEAN
39
84
  RANGE
40
85
  }
41
86
 
87
+ """
88
+ Suggestions information.
89
+ """
42
90
  type StoreSuggestions {
91
+ """
92
+ Array with suggestion terms.
93
+ """
43
94
  terms: [String!]
95
+ """
96
+ Array with suggestion products' information.
97
+ """
44
98
  products: [StoreProduct!]
45
99
  }
46
100
 
101
+ """
102
+ Search result.
103
+ """
47
104
  type StoreSearchResult {
105
+ """
106
+ Search result products.
107
+ """
48
108
  products: StoreProductConnection!
109
+ """
110
+ Array of search result facets.
111
+ """
49
112
  facets: [StoreFacet!]!
113
+ """
114
+ Search result suggestions.
115
+ """
50
116
  suggestions: StoreSuggestions!
51
117
  }
52
118