UNPKG

@commercelayer/sdk

Version:
56 lines (53 loc) 2.14 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/voids.ts var Voids = class _Voids extends chunkU22VLCMN_cjs.ApiResource { static TYPE = "voids"; async update(resource, params, options) { return this.resources.update({ ...resource, type: _Voids.TYPE }, params, options); } async order(voidId, params, options) { const _voidId = voidId.id || voidId; return this.resources.fetch({ type: "orders" }, `voids/${_voidId}/order`, params, options); } async attachments(voidId, params, options) { const _voidId = voidId.id || voidId; return this.resources.fetch({ type: "attachments" }, `voids/${_voidId}/attachments`, params, options); } async events(voidId, params, options) { const _voidId = voidId.id || voidId; return this.resources.fetch({ type: "events" }, `voids/${_voidId}/events`, params, options); } async versions(voidId, params, options) { const _voidId = voidId.id || voidId; return this.resources.fetch({ type: "versions" }, `voids/${_voidId}/versions`, params, options); } async event_stores(voidId, params, options) { const _voidId = voidId.id || voidId; return this.resources.fetch({ type: "event_stores" }, `voids/${_voidId}/event_stores`, params, options); } async reference_authorization(voidId, params, options) { const _voidId = voidId.id || voidId; return this.resources.fetch({ type: "authorizations" }, `voids/${_voidId}/reference_authorization`, params, options); } async _forward(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _Voids.TYPE, _forward: true }, params, options); } isVoid(resource) { return resource.type && resource.type === _Voids.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _Voids.TYPE; } }; var instance = new Voids(); var voids_default = instance; exports.voids_default = voids_default; //# sourceMappingURL=chunk-3XJA5M3C.cjs.map //# sourceMappingURL=chunk-3XJA5M3C.cjs.map