@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
55 lines (52 loc) • 2.29 kB
JavaScript
var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs');
// src/resources/price_lists.ts
var PriceLists = class _PriceLists extends chunkU22VLCMN_cjs.ApiResource {
static TYPE = "price_lists";
async create(resource, params, options) {
return this.resources.create({ ...resource, type: _PriceLists.TYPE }, params, options);
}
async update(resource, params, options) {
return this.resources.update({ ...resource, type: _PriceLists.TYPE }, params, options);
}
async delete(id, options) {
await this.resources.delete(typeof id === "string" ? { id, type: _PriceLists.TYPE } : id, options);
}
async prices(priceListId, params, options) {
const _priceListId = priceListId.id || priceListId;
return this.resources.fetch({ type: "prices" }, `price_lists/${_priceListId}/prices`, params, options);
}
async price_list_schedulers(priceListId, params, options) {
const _priceListId = priceListId.id || priceListId;
return this.resources.fetch({ type: "price_list_schedulers" }, `price_lists/${_priceListId}/price_list_schedulers`, params, options);
}
async attachments(priceListId, params, options) {
const _priceListId = priceListId.id || priceListId;
return this.resources.fetch({ type: "attachments" }, `price_lists/${_priceListId}/attachments`, params, options);
}
async versions(priceListId, params, options) {
const _priceListId = priceListId.id || priceListId;
return this.resources.fetch({ type: "versions" }, `price_lists/${_priceListId}/versions`, params, options);
}
async event_stores(priceListId, params, options) {
const _priceListId = priceListId.id || priceListId;
return this.resources.fetch({ type: "event_stores" }, `price_lists/${_priceListId}/event_stores`, params, options);
}
isPriceList(resource) {
return resource.type && resource.type === _PriceLists.TYPE;
}
relationship(id) {
return super.relationshipOneToOne(id);
}
relationshipToMany(...ids) {
return super.relationshipOneToMany(...ids);
}
type() {
return _PriceLists.TYPE;
}
};
var instance = new PriceLists();
var price_lists_default = instance;
exports.price_lists_default = price_lists_default;
//# sourceMappingURL=chunk-K3BSXSHS.cjs.map
//# sourceMappingURL=chunk-K3BSXSHS.cjs.map
;