@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
51 lines (48 loc) • 2.31 kB
JavaScript
var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs');
// src/resources/shipping_categories.ts
var ShippingCategories = class _ShippingCategories extends chunkU22VLCMN_cjs.ApiResource {
static TYPE = "shipping_categories";
async create(resource, params, options) {
return this.resources.create({ ...resource, type: _ShippingCategories.TYPE }, params, options);
}
async update(resource, params, options) {
return this.resources.update({ ...resource, type: _ShippingCategories.TYPE }, params, options);
}
async delete(id, options) {
await this.resources.delete(typeof id === "string" ? { id, type: _ShippingCategories.TYPE } : id, options);
}
async skus(shippingCategoryId, params, options) {
const _shippingCategoryId = shippingCategoryId.id || shippingCategoryId;
return this.resources.fetch({ type: "skus" }, `shipping_categories/${_shippingCategoryId}/skus`, params, options);
}
async attachments(shippingCategoryId, params, options) {
const _shippingCategoryId = shippingCategoryId.id || shippingCategoryId;
return this.resources.fetch({ type: "attachments" }, `shipping_categories/${_shippingCategoryId}/attachments`, params, options);
}
async versions(shippingCategoryId, params, options) {
const _shippingCategoryId = shippingCategoryId.id || shippingCategoryId;
return this.resources.fetch({ type: "versions" }, `shipping_categories/${_shippingCategoryId}/versions`, params, options);
}
async event_stores(shippingCategoryId, params, options) {
const _shippingCategoryId = shippingCategoryId.id || shippingCategoryId;
return this.resources.fetch({ type: "event_stores" }, `shipping_categories/${_shippingCategoryId}/event_stores`, params, options);
}
isShippingCategory(resource) {
return resource.type && resource.type === _ShippingCategories.TYPE;
}
relationship(id) {
return super.relationshipOneToOne(id);
}
relationshipToMany(...ids) {
return super.relationshipOneToMany(...ids);
}
type() {
return _ShippingCategories.TYPE;
}
};
var instance = new ShippingCategories();
var shipping_categories_default = instance;
exports.shipping_categories_default = shipping_categories_default;
//# sourceMappingURL=chunk-U7OGOZ5B.cjs.map
//# sourceMappingURL=chunk-U7OGOZ5B.cjs.map
;