UNPKG

@commercelayer/sdk

Version:
37 lines (35 loc) 1.18 kB
import { ApiResource } from './chunk-XKERR6OR.js'; // src/resources/tags.ts var Tags = class _Tags extends ApiResource { static TYPE = "tags"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _Tags.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _Tags.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _Tags.TYPE } : id, options); } async event_stores(tagId, params, options) { const _tagId = tagId.id || tagId; return this.resources.fetch({ type: "event_stores" }, `tags/${_tagId}/event_stores`, params, options); } isTag(resource) { return resource.type && resource.type === _Tags.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _Tags.TYPE; } }; var instance = new Tags(); var tags_default = instance; export { tags_default }; //# sourceMappingURL=chunk-N4COQM5Q.js.map //# sourceMappingURL=chunk-N4COQM5Q.js.map