UNPKG

@commercelayer/sdk

Version:
56 lines (54 loc) 2.55 kB
import { ApiResource } from './chunk-XKERR6OR.js'; // src/resources/vertex_accounts.ts var VertexAccounts = class _VertexAccounts extends ApiResource { static TYPE = "vertex_accounts"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _VertexAccounts.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _VertexAccounts.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _VertexAccounts.TYPE } : id, options); } async markets(vertexAccountId, params, options) { const _vertexAccountId = vertexAccountId.id || vertexAccountId; return this.resources.fetch({ type: "markets" }, `vertex_accounts/${_vertexAccountId}/markets`, params, options); } async attachments(vertexAccountId, params, options) { const _vertexAccountId = vertexAccountId.id || vertexAccountId; return this.resources.fetch({ type: "attachments" }, `vertex_accounts/${_vertexAccountId}/attachments`, params, options); } async events(vertexAccountId, params, options) { const _vertexAccountId = vertexAccountId.id || vertexAccountId; return this.resources.fetch({ type: "events" }, `vertex_accounts/${_vertexAccountId}/events`, params, options); } async versions(vertexAccountId, params, options) { const _vertexAccountId = vertexAccountId.id || vertexAccountId; return this.resources.fetch({ type: "versions" }, `vertex_accounts/${_vertexAccountId}/versions`, params, options); } async event_stores(vertexAccountId, params, options) { const _vertexAccountId = vertexAccountId.id || vertexAccountId; return this.resources.fetch({ type: "event_stores" }, `vertex_accounts/${_vertexAccountId}/event_stores`, params, options); } async _refresh_token(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _VertexAccounts.TYPE, _refresh_token: true }, params, options); } isVertexAccount(resource) { return resource.type && resource.type === _VertexAccounts.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _VertexAccounts.TYPE; } }; var instance = new VertexAccounts(); var vertex_accounts_default = instance; export { vertex_accounts_default }; //# sourceMappingURL=chunk-MHCLPVOI.js.map //# sourceMappingURL=chunk-MHCLPVOI.js.map