usimple-saleor-sdk
Version:
This package contains all queries and mutations that are used in our sample storefront. It can be used for semi-custom or fully-custom (with ability to extend existing queries) storefront solutions.
40 lines • 2 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CollectionsAPI = void 0;
const CollectionList_1 = require("./CollectionList");
const CollectionDetails_1 = require("./CollectionDetails");
class CollectionsAPI {
constructor(client, config) {
/**
* Method returning collection details
* @param variables Details parameters
*/
this.getDetails = (variables) => __awaiter(this, void 0, void 0, function* () {
const details = new CollectionDetails_1.CollectionDetails(this.client);
yield details.init(Object.assign({ channel: this.config.channel }, variables));
return details;
});
/**
* Method returning list of collections with ability to request next page
* @param params List parameters
*/
this.getList = (variables) => __awaiter(this, void 0, void 0, function* () {
const list = new CollectionList_1.CollectionList(this.client);
yield list.init(Object.assign({ channel: this.config.channel }, variables));
return list;
});
this.client = client;
this.config = config;
}
}
exports.CollectionsAPI = CollectionsAPI;
//# sourceMappingURL=collections.js.map