@sentzunhat/zacatl
Version:
A modular, high-performance TypeScript microservice framework for Node.js, featuring layered architecture, dependency injection, and robust validation for building scalable APIs and distributed systems.
36 lines • 1.05 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AbstractSequelizeRepository = void 0;
const adapter_loader_1 = require("../../orm/sequelize/adapter-loader");
class AbstractSequelizeRepository {
adapter;
constructor(config) {
this.adapter = (0, adapter_loader_1.createSequelizeAdapter)(config);
}
get model() {
return this.adapter.model;
}
toLean(input) {
return this.adapter.toLean(input);
}
async findById(id) {
return this.adapter.findById(id);
}
async findMany(filter = {}) {
return this.adapter.findMany(filter);
}
async create(entity) {
return this.adapter.create(entity);
}
async update(id, update) {
return this.adapter.update(id, update);
}
async delete(id) {
return this.adapter.delete(id);
}
async exists(id) {
return this.adapter.exists(id);
}
}
exports.AbstractSequelizeRepository = AbstractSequelizeRepository;
//# sourceMappingURL=repository.js.map