Socket
Socket
Sign inDemoInstall

pinelab-storefront-client

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pinelab-storefront-client - npm Package Compare versions

Comparing version 0.47.2 to 0.47.3

4

lib/gridsome/gridsome.queries.js

@@ -35,7 +35,7 @@ 'use strict';

'\n ',
'\n {\n Vendure {\n products {\n items {\n ...ProductFields\n }\n }\n }\n }\n',
'\n query products($options: Vendure_ProductListOptions) {\n Vendure {\n products(options: $options) {\n totalItems\n items {\n ...ProductFields\n }\n }\n }\n }\n',
],
[
'\n ',
'\n {\n Vendure {\n products {\n items {\n ...ProductFields\n }\n }\n }\n }\n',
'\n query products($options: Vendure_ProductListOptions) {\n Vendure {\n products(options: $options) {\n totalItems\n items {\n ...ProductFields\n }\n }\n }\n }\n',
]

@@ -42,0 +42,0 @@ )),

@@ -8,3 +8,2 @@ import { CalculatedProduct } from '../';

Product,
ProductList,
} from '../generated/graphql';

@@ -32,3 +31,6 @@ interface SortableCollection {

getAllCollections(): Promise<CollectionList>;
getAllProducts(): Promise<ProductList>;
/**
* Get products in batches of 100
*/
getAllProducts(): Promise<Product[]>;
getAvailableCountries(): Promise<Country[]>;

@@ -35,0 +37,0 @@ /**

@@ -165,3 +165,3 @@ 'use strict';

collectionList,
productList,
allProducts,
availableCountries,

@@ -186,5 +186,5 @@ products,

(collectionList = _a[0]),
(productList = _a[1]),
(allProducts = _a[1]),
(availableCountries = _a[2]);
products = productList.items.map(function (p) {
products = allProducts.map(function (p) {
return __1.setCalculatedFields(p);

@@ -200,3 +200,3 @@ });

collection,
productList.items
allProducts
);

@@ -264,14 +264,38 @@ return {

};
/**
* Get products in batches of 100
*/
GridsomeService.prototype.getAllProducts = function () {
return __awaiter(this, void 0, void 0, function () {
var products;
var products, hasMore, page, skip, take, productList;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
products = [];
hasMore = true;
page = 1;
skip = 0;
take = 500;
_a.label = 1;
case 1:
if (!hasMore) return [3 /*break*/, 3];
return [
4 /*yield*/,
this.graphqlFn(gridsome_queries_1.GET_PRODUCTS),
this.graphqlFn(gridsome_queries_1.GET_PRODUCTS, {
options: { skip: skip, take: take },
}),
];
case 1:
products = _a.sent().data.Vendure.products;
case 2:
productList = _a.sent().data.Vendure.products;
products.push.apply(products, productList.items);
console.log(
productList.items.map(function (p) {
return p.slug;
})
);
skip = page * take;
page++;
hasMore = productList.totalItems > products.length;
return [3 /*break*/, 1];
case 3:
return [2 /*return*/, products];

@@ -278,0 +302,0 @@ }

{
"name": "pinelab-storefront-client",
"version": "0.47.2",
"version": "0.47.3",
"description": "Generates static html pages with Gridsome and suplied Vue components",

@@ -50,3 +50,3 @@ "author": "Martijn van de Brug <martijn@pinelab.studio>",

},
"gitHead": "f35f5a5d8653d997125124e6bc081bb7e38bb4fa"
"gitHead": "2f219081d7051c2a708c6585b77d9db64f95baf6"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc