UNPKG

@commercelayer/sdk

Version:
43 lines (40 loc) 1.6 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/adjustments.ts var Adjustments = class _Adjustments extends chunkU22VLCMN_cjs.ApiResource { static TYPE = "adjustments"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _Adjustments.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _Adjustments.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _Adjustments.TYPE } : id, options); } async versions(adjustmentId, params, options) { const _adjustmentId = adjustmentId.id || adjustmentId; return this.resources.fetch({ type: "versions" }, `adjustments/${_adjustmentId}/versions`, params, options); } async event_stores(adjustmentId, params, options) { const _adjustmentId = adjustmentId.id || adjustmentId; return this.resources.fetch({ type: "event_stores" }, `adjustments/${_adjustmentId}/event_stores`, params, options); } isAdjustment(resource) { return resource.type && resource.type === _Adjustments.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _Adjustments.TYPE; } }; var instance = new Adjustments(); var adjustments_default = instance; exports.adjustments_default = adjustments_default; //# sourceMappingURL=chunk-KGZ3FTYR.cjs.map //# sourceMappingURL=chunk-KGZ3FTYR.cjs.map