UNPKG

@commercelayer/sdk

Version:
39 lines (36 loc) 1.24 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/tags.ts var Tags = class _Tags extends chunkU22VLCMN_cjs.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; exports.tags_default = tags_default; //# sourceMappingURL=chunk-6LHRWK5U.cjs.map //# sourceMappingURL=chunk-6LHRWK5U.cjs.map