@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
47 lines (44 loc) • 1.89 kB
JavaScript
var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs');
// src/resources/wire_transfers.ts
var WireTransfers = class _WireTransfers extends chunkU22VLCMN_cjs.ApiResource {
static TYPE = "wire_transfers";
async create(resource, params, options) {
return this.resources.create({ ...resource, type: _WireTransfers.TYPE }, params, options);
}
async update(resource, params, options) {
return this.resources.update({ ...resource, type: _WireTransfers.TYPE }, params, options);
}
async delete(id, options) {
await this.resources.delete(typeof id === "string" ? { id, type: _WireTransfers.TYPE } : id, options);
}
async order(wireTransferId, params, options) {
const _wireTransferId = wireTransferId.id || wireTransferId;
return this.resources.fetch({ type: "orders" }, `wire_transfers/${_wireTransferId}/order`, params, options);
}
async versions(wireTransferId, params, options) {
const _wireTransferId = wireTransferId.id || wireTransferId;
return this.resources.fetch({ type: "versions" }, `wire_transfers/${_wireTransferId}/versions`, params, options);
}
async event_stores(wireTransferId, params, options) {
const _wireTransferId = wireTransferId.id || wireTransferId;
return this.resources.fetch({ type: "event_stores" }, `wire_transfers/${_wireTransferId}/event_stores`, params, options);
}
isWireTransfer(resource) {
return resource.type && resource.type === _WireTransfers.TYPE;
}
relationship(id) {
return super.relationshipOneToOne(id);
}
relationshipToMany(...ids) {
return super.relationshipOneToMany(...ids);
}
type() {
return _WireTransfers.TYPE;
}
};
var instance = new WireTransfers();
var wire_transfers_default = instance;
exports.wire_transfers_default = wire_transfers_default;
//# sourceMappingURL=chunk-3WTRPII2.cjs.map
//# sourceMappingURL=chunk-3WTRPII2.cjs.map
;