@faststore/api 1.10.33 → 1.11.4
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 +32 -0
- package/dist/__generated__/schema.d.ts +96 -0
- package/dist/api.cjs.development.js +254 -27
- 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 +254 -27
- package/dist/api.esm.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/platforms/vtex/clients/search/types/ProductSearchResult.d.ts +1 -0
- package/dist/platforms/vtex/index.d.ts +5 -0
- package/dist/platforms/vtex/resolvers/skuVariations.d.ts +6 -0
- package/dist/platforms/vtex/utils/skuVariants.d.ts +15 -0
- package/package.json +3 -3
- package/src/__generated__/schema.ts +99 -0
- package/src/platforms/vtex/clients/search/types/ProductSearchResult.ts +1 -0
- package/src/platforms/vtex/index.ts +2 -0
- package/src/platforms/vtex/resolvers/product.ts +1 -0
- package/src/platforms/vtex/resolvers/productGroup.ts +4 -3
- package/src/platforms/vtex/resolvers/skuVariations.ts +47 -0
- package/src/platforms/vtex/resolvers/validateCart.ts +97 -40
- package/src/platforms/vtex/utils/skuVariants.ts +206 -0
- package/src/typeDefs/index.ts +3 -1
- package/src/typeDefs/product.graphql +4 -0
- package/src/typeDefs/productGroup.graphql +6 -0
- package/src/typeDefs/skuVariants.graphql +87 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,38 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.11.4](https://github.com/vtex/faststore/compare/v1.11.3...v1.11.4) (2022-08-15)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Product releaseDate ([#1438](https://github.com/vtex/faststore/issues/1438)) ([255b236](https://github.com/vtex/faststore/commit/255b236b8573f88768a0ba0ec0ead001e36daa7d))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [1.11.3](https://github.com/vtex/faststore/compare/v1.11.2...v1.11.3) (2022-08-10)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* Join cart items ([#1434](https://github.com/vtex/faststore/issues/1434)) ([990b6a9](https://github.com/vtex/faststore/commit/990b6a920703f9004f7e0d6be6c2a316610db5c6))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## 1.10.34 (2022-08-04)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* Add skuSelector-related properties to ProductGroup type ([#1407](https://github.com/vtex/faststore/issues/1407)) ([3f9f33f](https://github.com/vtex/faststore/commit/3f9f33f05b47d266465f349edb7645ad06ff7b27))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Chores
|
|
33
|
+
|
|
34
|
+
* Update generated types from `@faststore/api` ([#1431](https://github.com/vtex/faststore/issues/1431)) ([516068a](https://github.com/vtex/faststore/commit/516068a4cb67a9029693c967db34b133aac81403))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
6
38
|
## [1.10.33](https://github.com/vtex/faststore/compare/v1.10.32...v1.10.33) (2022-08-03)
|
|
7
39
|
|
|
8
40
|
**Note:** Version bump only for package @faststore/api
|
|
@@ -17,7 +17,69 @@ export declare type Scalars = {
|
|
|
17
17
|
Boolean: boolean;
|
|
18
18
|
Int: number;
|
|
19
19
|
Float: number;
|
|
20
|
+
/**
|
|
21
|
+
* Example:
|
|
22
|
+
*
|
|
23
|
+
* ```json
|
|
24
|
+
* {
|
|
25
|
+
* Color: 'Red', Size: '42'
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
ActiveVariations: any;
|
|
30
|
+
/**
|
|
31
|
+
* Example:
|
|
32
|
+
*
|
|
33
|
+
* ```json
|
|
34
|
+
* {
|
|
35
|
+
* Color: [
|
|
36
|
+
* {
|
|
37
|
+
* src: "https://storecomponents.vtexassets.com/...",
|
|
38
|
+
* alt: "...",
|
|
39
|
+
* label: "...",
|
|
40
|
+
* value: "..."
|
|
41
|
+
* },
|
|
42
|
+
* {
|
|
43
|
+
* src: "https://storecomponents.vtexassets.com/...",
|
|
44
|
+
* alt: "...",
|
|
45
|
+
* label: "...",
|
|
46
|
+
* value: "..."
|
|
47
|
+
* }
|
|
48
|
+
* ],
|
|
49
|
+
* Size: [
|
|
50
|
+
* {
|
|
51
|
+
* src: "https://storecomponents.vtexassets.com/...",
|
|
52
|
+
* alt: "...",
|
|
53
|
+
* label: "...",
|
|
54
|
+
* value: "..."
|
|
55
|
+
* }
|
|
56
|
+
* ]
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
FormattedVariants: any;
|
|
20
61
|
ObjectOrString: any;
|
|
62
|
+
/**
|
|
63
|
+
* Example:
|
|
64
|
+
*
|
|
65
|
+
* ```json
|
|
66
|
+
* {
|
|
67
|
+
* 'Color-Red-Size-40': 'classic-shoes-37'
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
SlugsMap: any;
|
|
72
|
+
/**
|
|
73
|
+
* Example:
|
|
74
|
+
*
|
|
75
|
+
* ```json
|
|
76
|
+
* {
|
|
77
|
+
* Color: [ "Red", "Blue", "Green" ],
|
|
78
|
+
* Size: [ "40", "41" ]
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
VariantsByName: any;
|
|
21
83
|
};
|
|
22
84
|
/** Person data input to the newsletter. */
|
|
23
85
|
export declare type IPersonNewsletter = {
|
|
@@ -182,6 +244,32 @@ export declare type QuerySearchArgs = {
|
|
|
182
244
|
sort?: Maybe<StoreSort>;
|
|
183
245
|
term?: Maybe<Scalars['String']>;
|
|
184
246
|
};
|
|
247
|
+
export declare type SkuVariants = {
|
|
248
|
+
__typename?: 'SkuVariants';
|
|
249
|
+
/** SKU property values for the current SKU. */
|
|
250
|
+
activeVariations?: Maybe<Scalars['ActiveVariations']>;
|
|
251
|
+
/** All available options for each SKU variant property, indexed by their name. */
|
|
252
|
+
allVariantsByName?: Maybe<Scalars['VariantsByName']>;
|
|
253
|
+
/**
|
|
254
|
+
* Available options for each varying SKU property, taking into account the
|
|
255
|
+
* `dominantVariantName` property. Returns all available options for the
|
|
256
|
+
* dominant property, and only options that can be combined with its current
|
|
257
|
+
* value for other properties.
|
|
258
|
+
*/
|
|
259
|
+
availableVariations?: Maybe<Scalars['FormattedVariants']>;
|
|
260
|
+
/**
|
|
261
|
+
* Maps property value combinations to their respective SKU's slug. Enables
|
|
262
|
+
* us to retrieve the slug for the SKU that matches the currently selected
|
|
263
|
+
* variations in O(1) time.
|
|
264
|
+
*/
|
|
265
|
+
slugsMap?: Maybe<Scalars['SlugsMap']>;
|
|
266
|
+
};
|
|
267
|
+
export declare type SkuVariantsAvailableVariationsArgs = {
|
|
268
|
+
dominantVariantName: Scalars['String'];
|
|
269
|
+
};
|
|
270
|
+
export declare type SkuVariantsSlugsMapArgs = {
|
|
271
|
+
dominantVariantName: Scalars['String'];
|
|
272
|
+
};
|
|
185
273
|
/** Aggregate offer information, for a given SKU that is available to be fulfilled by multiple sellers. */
|
|
186
274
|
export declare type StoreAggregateOffer = {
|
|
187
275
|
__typename?: 'StoreAggregateOffer';
|
|
@@ -466,6 +554,8 @@ export declare type StoreProduct = {
|
|
|
466
554
|
offers: StoreAggregateOffer;
|
|
467
555
|
/** Product ID, such as [ISBN](https://www.isbn-international.org/content/what-isbn) or similar global IDs. */
|
|
468
556
|
productID: Scalars['String'];
|
|
557
|
+
/** The product's release date. Formatted using https://en.wikipedia.org/wiki/ISO_8601 */
|
|
558
|
+
releaseDate: Scalars['String'];
|
|
469
559
|
/** Array with review information. */
|
|
470
560
|
review: Array<StoreReview>;
|
|
471
561
|
/** Meta tag data. */
|
|
@@ -502,6 +592,12 @@ export declare type StoreProductGroup = {
|
|
|
502
592
|
name: Scalars['String'];
|
|
503
593
|
/** Product group ID. */
|
|
504
594
|
productGroupID: Scalars['String'];
|
|
595
|
+
/**
|
|
596
|
+
* Object containing data structures to facilitate handling different SKU
|
|
597
|
+
* variant properties. Specially useful for implementing SKU selection
|
|
598
|
+
* components.
|
|
599
|
+
*/
|
|
600
|
+
skuVariants?: Maybe<SkuVariants>;
|
|
505
601
|
};
|
|
506
602
|
/** Properties that can be associated with products and products groups. */
|
|
507
603
|
export declare type StorePropertyValue = {
|