UNPKG

@commercelayer/sdk

Version:
46 lines (43 loc) 1.67 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/imports.ts var Imports = class _Imports extends chunkU22VLCMN_cjs.ApiResource { static TYPE = "imports"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _Imports.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _Imports.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _Imports.TYPE } : id, options); } async events(importId, params, options) { const _importId = importId.id || importId; return this.resources.fetch({ type: "events" }, `imports/${_importId}/events`, params, options); } async event_stores(importId, params, options) { const _importId = importId.id || importId; return this.resources.fetch({ type: "event_stores" }, `imports/${_importId}/event_stores`, params, options); } async _interrupt(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _Imports.TYPE, _interrupt: true }, params, options); } isImport(resource) { return resource.type && resource.type === _Imports.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _Imports.TYPE; } }; var instance = new Imports(); var imports_default = instance; exports.imports_default = imports_default; //# sourceMappingURL=chunk-ZW4CB7J7.cjs.map //# sourceMappingURL=chunk-ZW4CB7J7.cjs.map