"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var IngestCommand_1;
Object.defineProperty(exports, "__esModule", { value: true });
exports.IngestCommand = void 0;
const common_1 = require("@nestjs/common");
const nest_commander_1 = require("nest-commander");
const solid_registry_1 = require("../helpers/solid-registry");
const ingest_metadata_service_1 = require("../services/genai/ingest-metadata.service");
let IngestCommand = IngestCommand_1 = class IngestCommand extends nest_commander_1.CommandRunner {
    constructor(solidRegistry, ingestMetadataService) {
        super();
        this.solidRegistry = solidRegistry;
        this.ingestMetadataService = ingestMetadataService;
        this.logger = new common_1.Logger(IngestCommand_1.name);
    }
    async run(passedParam, options) {
        this.logger.log(`Running the solid ingest for module ${options.module} at ${new Date()}`);
        await this.ingestMetadataService.ingest();
    }
    parseString(val) {
        return val;
    }
};
exports.IngestCommand = IngestCommand;
__decorate([
    (0, nest_commander_1.Option)({
        flags: '-m, --module [module name]',
        description: 'The seeder to run.',
        required: false,
        defaultValue: ''
    }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String]),
    __metadata("design:returntype", String)
], IngestCommand.prototype, "parseString", null);
exports.IngestCommand = IngestCommand = IngestCommand_1 = __decorate([
    (0, nest_commander_1.Command)({ name: 'ingest', description: 'Ingests solid metadata json for all modules deployed in the consuming project' }),
    __metadata("design:paramtypes", [solid_registry_1.SolidRegistry,
        ingest_metadata_service_1.IngestMetadataService])
], IngestCommand);
//# sourceMappingURL=ingest.command.js.map