@faststore/api 1.12.43 → 1.12.44
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/dist/api.cjs.development.js +12 -4
- 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 +12 -4
- package/dist/api.esm.js.map +1 -1
- package/dist/platforms/vtex/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/platforms/vtex/index.ts +2 -1
- package/src/platforms/vtex/resolvers/searchResult.ts +14 -5
package/dist/api.esm.js
CHANGED
|
@@ -18,7 +18,7 @@ import { trace, context, SpanKind } from '@opentelemetry/api';
|
|
|
18
18
|
import { SeverityNumber } from '@opentelemetry/api-logs';
|
|
19
19
|
|
|
20
20
|
var name = "@faststore/api";
|
|
21
|
-
var version = "1.12.
|
|
21
|
+
var version = "1.12.43";
|
|
22
22
|
var license = "MIT";
|
|
23
23
|
var main = "dist/index.js";
|
|
24
24
|
var typings = "dist/index.d.ts";
|
|
@@ -54,7 +54,7 @@ var dependencies = {
|
|
|
54
54
|
};
|
|
55
55
|
var devDependencies = {
|
|
56
56
|
"@envelop/core": "^2.6.0",
|
|
57
|
-
"@faststore/shared": "^1.12.
|
|
57
|
+
"@faststore/shared": "^1.12.43",
|
|
58
58
|
"@graphql-codegen/cli": "2.2.0",
|
|
59
59
|
"@graphql-codegen/typescript": "2.2.2",
|
|
60
60
|
concurrently: "^6.2.1",
|
|
@@ -2166,7 +2166,7 @@ const StoreSearchResult = {
|
|
|
2166
2166
|
},
|
|
2167
2167
|
products: async ({
|
|
2168
2168
|
productSearchPromise
|
|
2169
|
-
}) => {
|
|
2169
|
+
}, _, ctx) => {
|
|
2170
2170
|
const productSearchResult = await productSearchPromise;
|
|
2171
2171
|
const skus = productSearchResult.products.map(product => {
|
|
2172
2172
|
const [maybeSku] = product.items;
|
|
@@ -2180,7 +2180,14 @@ const StoreSearchResult = {
|
|
|
2180
2180
|
endCursor: productSearchResult.recordsFiltered.toString(),
|
|
2181
2181
|
totalCount: productSearchResult.recordsFiltered
|
|
2182
2182
|
},
|
|
2183
|
-
edges: skus.
|
|
2183
|
+
edges: skus.filter(sku => {
|
|
2184
|
+
if (ctx.hideUnavailableItems) {
|
|
2185
|
+
return sku.sellers.some(item => inStock(item.commertialOffer));
|
|
2186
|
+
} else {
|
|
2187
|
+
return true;
|
|
2188
|
+
}
|
|
2189
|
+
}) // TODO: remove this filter when the IS returns correctly with hideUnavailableItems
|
|
2190
|
+
.map((sku, index) => ({
|
|
2184
2191
|
node: sku,
|
|
2185
2192
|
cursor: index.toString()
|
|
2186
2193
|
}))
|
|
@@ -2502,6 +2509,7 @@ const getContextFactory = options => ctx => {
|
|
|
2502
2509
|
};
|
|
2503
2510
|
ctx.clients = getClients(options, ctx);
|
|
2504
2511
|
ctx.loaders = getLoaders(options, ctx);
|
|
2512
|
+
ctx.hideUnavailableItems = options.hideUnavailableItems;
|
|
2505
2513
|
return ctx;
|
|
2506
2514
|
};
|
|
2507
2515
|
const getResolvers = _ => Resolvers;
|