"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StateService = void 0;
const tslib_1 = require("tslib");
// container
require("reflect-metadata");
const tsyringe_1 = require("tsyringe");
const types_1 = require("../types");
const cliter_config_1 = require("../config/cliter.config");
const uuid_1 = require("uuid");
const crypto = require("crypto");
const fs = require("node:fs");
const path = require("node:path");
let StateService = class StateService {
    constructor() {
        this.config = cliter_config_1.cliterConfig;
        this.lockFiles = [];
        this.relationship = types_1.SqlRelationship;
        this.resolverType = types_1.ResolverType;
        this.sqlType = types_1.SqlType;
        this._originFiles = []; // origin files generated
    }
    get uuid() {
        return (0, uuid_1.v4)();
    }
    get appKey() {
        return crypto.randomBytes(24).toString('hex');
    }
    // originFiles
    get originFiles() {
        this._originFiles = this._originFiles.filter(file => fs.existsSync(path.join(process.cwd(), file)));
        return this._originFiles;
    }
    set originFiles(originFiles) {
        this._originFiles = originFiles;
    }
};
StateService = tslib_1.__decorate([
    (0, tsyringe_1.singleton)()
], StateService);
exports.StateService = StateService;
