@faststore/api 1.7.50 → 1.7.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.
- package/CHANGELOG.md +30 -0
- package/dist/api.cjs.development.js +26 -25
- 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 +26 -25
- package/dist/api.esm.js.map +1 -1
- package/dist/platforms/vtex/clients/index.d.ts +1 -1
- package/dist/platforms/vtex/clients/search/index.d.ts +2 -2
- package/dist/platforms/vtex/clients/search/types/ProductSearchResult.d.ts +7 -14
- package/package.json +2 -2
- package/src/platforms/vtex/clients/search/index.ts +8 -4
- package/src/platforms/vtex/clients/search/types/ProductSearchResult.ts +10 -14
- package/src/platforms/vtex/resolvers/product.ts +5 -6
- package/src/platforms/vtex/resolvers/productGroup.ts +14 -14
- package/src/platforms/vtex/resolvers/searchResult.ts +1 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,36 @@
|
|
|
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.7.53 (2022-05-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* suggestions api url ([#1273](https://github.com/vtex/faststore/issues/1273)) ([6f8a961](https://github.com/vtex/faststore/commit/6f8a9613e4627f91815e669a007ec4ff4c54ffe5))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 1.7.52 (2022-05-06)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* Release workflow ([#1271](https://github.com/vtex/faststore/issues/1271)) ([3b995a8](https://github.com/vtex/faststore/commit/3b995a82c956c13c4d6f9453ac4f44195c5ef543))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## 1.7.51 (2022-05-03)
|
|
29
|
+
|
|
30
|
+
**Note:** Version bump only for package @faststore/api
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
6
36
|
## 1.7.50 (2022-05-03)
|
|
7
37
|
|
|
8
38
|
**Note:** Version bump only for package @faststore/api
|
|
@@ -162,9 +162,9 @@ const IntelligentSearch = ({
|
|
|
162
162
|
type: 'product_search'
|
|
163
163
|
});
|
|
164
164
|
|
|
165
|
-
const suggestedProducts = args => fetchAPI(`${base}/api/
|
|
165
|
+
const suggestedProducts = args => fetchAPI(`${base}/_v/api/intelligent-search/product_search?query=${args.query}`);
|
|
166
166
|
|
|
167
|
-
const suggestedTerms = args => fetchAPI(`${base}/api/
|
|
167
|
+
const suggestedTerms = args => fetchAPI(`${base}/_v/api/intelligent-search/search_suggestions?query=${args.query}`);
|
|
168
168
|
|
|
169
169
|
const facets = args => search({ ...args,
|
|
170
170
|
type: 'facets'
|
|
@@ -977,18 +977,20 @@ const StoreProduct = {
|
|
|
977
977
|
};
|
|
978
978
|
},
|
|
979
979
|
isVariantOf: root => root,
|
|
980
|
-
// TODO: get this value. Fix any type
|
|
981
980
|
additionalProperty: ({
|
|
982
|
-
|
|
983
|
-
}) =>
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
981
|
+
variations = []
|
|
982
|
+
}) => {
|
|
983
|
+
return variations.flatMap(({
|
|
984
|
+
name,
|
|
985
|
+
values
|
|
986
|
+
}) => values.map(value => ({
|
|
987
|
+
name,
|
|
988
|
+
value
|
|
989
|
+
})));
|
|
990
|
+
}
|
|
987
991
|
};
|
|
988
992
|
|
|
989
|
-
const
|
|
990
|
-
sellerId: true
|
|
991
|
-
};
|
|
993
|
+
const BLOCKED_SPECIFICATIONS = /*#__PURE__*/new Set(['allSpecifications']);
|
|
992
994
|
const StoreProductGroup = {
|
|
993
995
|
hasVariant: root => root.isVariantOf.items.map(item => enhanceSku(item, root.isVariantOf)),
|
|
994
996
|
productGroupID: ({
|
|
@@ -999,18 +1001,19 @@ const StoreProductGroup = {
|
|
|
999
1001
|
}) => isVariantOf.productName,
|
|
1000
1002
|
additionalProperty: ({
|
|
1001
1003
|
isVariantOf: {
|
|
1002
|
-
|
|
1004
|
+
specificationGroups
|
|
1003
1005
|
}
|
|
1004
|
-
}) =>
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1006
|
+
}) => specificationGroups // filter sku specifications so we dont mess sku with product specs
|
|
1007
|
+
.filter(specificationGroup => !BLOCKED_SPECIFICATIONS.has(specificationGroup.name)) // Transform specs back into product specs
|
|
1008
|
+
.flatMap(({
|
|
1009
|
+
specifications
|
|
1010
|
+
}) => specifications.flatMap(({
|
|
1011
|
+
name,
|
|
1012
|
+
values
|
|
1013
|
+
}) => values.map(value => ({
|
|
1014
|
+
name,
|
|
1015
|
+
value
|
|
1016
|
+
}))))
|
|
1014
1017
|
};
|
|
1015
1018
|
|
|
1016
1019
|
/**
|
|
@@ -1239,9 +1242,7 @@ const StoreSearchResult = {
|
|
|
1239
1242
|
return maybeSku && enhanceSku(maybeSku, product);
|
|
1240
1243
|
}).filter(sku => !!sku);
|
|
1241
1244
|
const {
|
|
1242
|
-
|
|
1243
|
-
searches
|
|
1244
|
-
}
|
|
1245
|
+
searches
|
|
1245
1246
|
} = terms;
|
|
1246
1247
|
return {
|
|
1247
1248
|
terms: searches.map(item => item.term),
|