@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
49 lines (47 loc) • 2.05 kB
JavaScript
import { ApiResource } from './chunk-XKERR6OR.js';
// src/resources/tax_categories.ts
var TaxCategories = class _TaxCategories extends ApiResource {
static TYPE = "tax_categories";
async create(resource, params, options) {
return this.resources.create({ ...resource, type: _TaxCategories.TYPE }, params, options);
}
async update(resource, params, options) {
return this.resources.update({ ...resource, type: _TaxCategories.TYPE }, params, options);
}
async delete(id, options) {
await this.resources.delete(typeof id === "string" ? { id, type: _TaxCategories.TYPE } : id, options);
}
async sku(taxCategoryId, params, options) {
const _taxCategoryId = taxCategoryId.id || taxCategoryId;
return this.resources.fetch({ type: "skus" }, `tax_categories/${_taxCategoryId}/sku`, params, options);
}
async attachments(taxCategoryId, params, options) {
const _taxCategoryId = taxCategoryId.id || taxCategoryId;
return this.resources.fetch({ type: "attachments" }, `tax_categories/${_taxCategoryId}/attachments`, params, options);
}
async versions(taxCategoryId, params, options) {
const _taxCategoryId = taxCategoryId.id || taxCategoryId;
return this.resources.fetch({ type: "versions" }, `tax_categories/${_taxCategoryId}/versions`, params, options);
}
async event_stores(taxCategoryId, params, options) {
const _taxCategoryId = taxCategoryId.id || taxCategoryId;
return this.resources.fetch({ type: "event_stores" }, `tax_categories/${_taxCategoryId}/event_stores`, params, options);
}
isTaxCategory(resource) {
return resource.type && resource.type === _TaxCategories.TYPE;
}
relationship(id) {
return super.relationshipOneToOne(id);
}
relationshipToMany(...ids) {
return super.relationshipOneToMany(...ids);
}
type() {
return _TaxCategories.TYPE;
}
};
var instance = new TaxCategories();
var tax_categories_default = instance;
export { tax_categories_default };
//# sourceMappingURL=chunk-SXPZRQBF.js.map
//# sourceMappingURL=chunk-SXPZRQBF.js.map