"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TypeIsQueryFixValue = exports.TypeIsQueryToSequelize = exports.TypeIsQueryToSwagger = void 0;
const core_1 = require("@asapjs/core");
const toSwaggerGenerator_1 = require("./generators/toSwaggerGenerator");
const typeGenerator_1 = require("./generators/typeGenerator");
exports.TypeIsQueryToSwagger = (0, toSwaggerGenerator_1.toSwaggerGenerator)((options) => {
    var _a, _b;
    if (!options) {
        core_1.logger.error(`@asapjs/sequelize :: @TypeIs.QUERY - options가 전달되지 않았습니다..`);
        process.exit(1);
    }
    return (_b = (_a = options.type()).toSwagger) === null || _b === void 0 ? void 0 : _b.call(_a);
});
const TypeIsQueryToSequelize = (options) => ({
    query: (props) => options === null || options === void 0 ? void 0 : options.query(props),
    type: options === null || options === void 0 ? void 0 : options.type,
});
exports.TypeIsQueryToSequelize = TypeIsQueryToSequelize;
const TypeIsQueryFixValue = (options) => (o) => {
    var _a, _b;
    return (_b = (_a = options.type()).fixValue) === null || _b === void 0 ? void 0 : _b.call(_a, o);
};
exports.TypeIsQueryFixValue = TypeIsQueryFixValue;
const TypeIsQuery = (0, typeGenerator_1.typeGenerator)((options) => ({
    __name: 'query',
    toSequelize: () => (0, exports.TypeIsQueryToSequelize)(options),
    toSwagger: () => (0, exports.TypeIsQueryToSwagger)(options),
    fixValue: (0, exports.TypeIsQueryFixValue)(options),
}));
exports.default = TypeIsQuery;
//# sourceMappingURL=query.js.map