"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HealthcheckService = void 0;
const __ΩHealthcheckFn = ['', 'HealthcheckFn', 'P$`/!w"y'];
class HealthcheckService {
    constructor() {
        this.checks = [];
    }
    register(name, fn) {
        this.checks.push({ name, fn });
    }
    async check() {
        for (const check of this.checks) {
            await check.fn();
        }
    }
    async checkIndividual() {
        const results = [];
        for (const check of this.checks) {
            try {
                await check.fn();
                results.push({ name: check.name, status: 'ok' });
            }
            catch (err) {
                results.push({ name: check.name, status: 'error', error: err instanceof Error ? err.message : String(err) });
            }
        }
        return results;
    }
}
exports.HealthcheckService = HealthcheckService;
HealthcheckService.__type = ['name', () => __ΩHealthcheckFn, 'fn', 'checks', function () { return []; }, () => __ΩHealthcheckFn, 'register', 'check', "ok", "error", 'status', 'error', 'checkIndividual', 'HealthcheckService', 'P&4!n"4#MF3$;>%P&2!n&2#"0\'P"0(PP&4!P.).*J4+&4,8MF`0-5w.'];
//# sourceMappingURL=healthcheck.service.js.map