bling-erp-api-with-rate-limit
Version:
Pacote de integração com a API do Bling ERP
84 lines • 3.2 kB
JavaScript
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.InMemoryBlingRepository = void 0;
class InMemoryBlingRepository {
constructor() {
this.indexResponse = null;
this.showResponse = null;
this.storeResponse = null;
this.updateResponse = null;
this.replaceResponse = null;
this.destroyResponse = null;
}
get axiosInstance() {
throw new Error('axiosInstance não está disponível na implementação in-memory. Use BlingRepository para acesso real ao axios.');
}
setResponse(response) {
this.response = response;
}
setIndexResponse(response) {
this.indexResponse = response;
}
setShowResponse(response) {
this.showResponse = response;
}
setStoreResponse(response) {
this.storeResponse = response;
}
setUpdateResponse(response) {
this.updateResponse = response;
}
setReplaceResponse(response) {
this.replaceResponse = response;
}
setDestroyResponse(response) {
this.destroyResponse = response;
}
index(options) {
return __awaiter(this, void 0, void 0, function* () {
var _a;
return (_a = this.indexResponse) !== null && _a !== void 0 ? _a : this.response;
});
}
show(options) {
return __awaiter(this, void 0, void 0, function* () {
var _a;
return (_a = this.showResponse) !== null && _a !== void 0 ? _a : this.response;
});
}
store(options) {
return __awaiter(this, void 0, void 0, function* () {
var _a;
return (_a = this.storeResponse) !== null && _a !== void 0 ? _a : this.response;
});
}
update(options) {
return __awaiter(this, void 0, void 0, function* () {
var _a;
return (_a = this.updateResponse) !== null && _a !== void 0 ? _a : this.response;
});
}
replace(options) {
return __awaiter(this, void 0, void 0, function* () {
var _a;
return (_a = this.replaceResponse) !== null && _a !== void 0 ? _a : this.response;
});
}
destroy(options) {
return __awaiter(this, void 0, void 0, function* () {
var _a;
return (_a = this.destroyResponse) !== null && _a !== void 0 ? _a : this.response;
});
}
}
exports.InMemoryBlingRepository = InMemoryBlingRepository;
//# sourceMappingURL=bling-in-memory.repository.js.map