UNPKG

@commercelayer/sdk

Version:
47 lines (44 loc) 1.91 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/shipping_zones.ts var ShippingZones = class _ShippingZones extends chunkU22VLCMN_cjs.ApiResource { static TYPE = "shipping_zones"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _ShippingZones.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _ShippingZones.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _ShippingZones.TYPE } : id, options); } async attachments(shippingZoneId, params, options) { const _shippingZoneId = shippingZoneId.id || shippingZoneId; return this.resources.fetch({ type: "attachments" }, `shipping_zones/${_shippingZoneId}/attachments`, params, options); } async versions(shippingZoneId, params, options) { const _shippingZoneId = shippingZoneId.id || shippingZoneId; return this.resources.fetch({ type: "versions" }, `shipping_zones/${_shippingZoneId}/versions`, params, options); } async event_stores(shippingZoneId, params, options) { const _shippingZoneId = shippingZoneId.id || shippingZoneId; return this.resources.fetch({ type: "event_stores" }, `shipping_zones/${_shippingZoneId}/event_stores`, params, options); } isShippingZone(resource) { return resource.type && resource.type === _ShippingZones.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _ShippingZones.TYPE; } }; var instance = new ShippingZones(); var shipping_zones_default = instance; exports.shipping_zones_default = shipping_zones_default; //# sourceMappingURL=chunk-JUVEIRM4.cjs.map //# sourceMappingURL=chunk-JUVEIRM4.cjs.map