UNPKG

@commercelayer/sdk

Version:
54 lines (51 loc) 2.5 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/external_gateways.ts var ExternalGateways = class _ExternalGateways extends chunkU22VLCMN_cjs.ApiResource { static TYPE = "external_gateways"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _ExternalGateways.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _ExternalGateways.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _ExternalGateways.TYPE } : id, options); } async payment_methods(externalGatewayId, params, options) { const _externalGatewayId = externalGatewayId.id || externalGatewayId; return this.resources.fetch({ type: "payment_methods" }, `external_gateways/${_externalGatewayId}/payment_methods`, params, options); } async versions(externalGatewayId, params, options) { const _externalGatewayId = externalGatewayId.id || externalGatewayId; return this.resources.fetch({ type: "versions" }, `external_gateways/${_externalGatewayId}/versions`, params, options); } async event_stores(externalGatewayId, params, options) { const _externalGatewayId = externalGatewayId.id || externalGatewayId; return this.resources.fetch({ type: "event_stores" }, `external_gateways/${_externalGatewayId}/event_stores`, params, options); } async external_payments(externalGatewayId, params, options) { const _externalGatewayId = externalGatewayId.id || externalGatewayId; return this.resources.fetch({ type: "external_payments" }, `external_gateways/${_externalGatewayId}/external_payments`, params, options); } async _reset_circuit(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _ExternalGateways.TYPE, _reset_circuit: true }, params, options); } isExternalGateway(resource) { return resource.type && resource.type === _ExternalGateways.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _ExternalGateways.TYPE; } }; var instance = new ExternalGateways(); var external_gateways_default = instance; exports.external_gateways_default = external_gateways_default; //# sourceMappingURL=chunk-7OLCOMGV.cjs.map //# sourceMappingURL=chunk-7OLCOMGV.cjs.map