"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 __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var TestController_1;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestController = exports.SeedData = void 0;
const openapi = require("@nestjs/swagger");
const common_1 = require("@nestjs/common");
const platform_express_1 = require("@nestjs/platform-express");
const swagger_1 = require("@nestjs/swagger");
const solid_registry_1 = require("../helpers/solid-registry");
const auth_decorator_1 = require("../decorators/auth.decorator");
const auth_type_enum_1 = require("../enums/auth-type.enum");
const ingest_metadata_service_1 = require("../services/genai/ingest-metadata.service");
class SeedData {
}
exports.SeedData = SeedData;
let TestController = TestController_1 = class TestController {
    constructor(solidRegistry, ingestMetadataService) {
        this.solidRegistry = solidRegistry;
        this.ingestMetadataService = ingestMetadataService;
        this.logger = new common_1.Logger(TestController_1.name);
    }
    uploadData(files, body) {
        return { message: 'file uploaded', fileNames: files.map(f => f.originalname), formData: body };
    }
    uploadFile(file, body) {
        this.logger.debug(file);
        this.logger.debug(body);
        return { filename: file.originalname };
    }
    async mcpIngest(file, body) {
        await this.ingestMetadataService.ingest();
        return { ok: true };
    }
};
exports.TestController = TestController;
__decorate([
    (0, auth_decorator_1.Auth)(auth_type_enum_1.AuthType.None),
    (0, common_1.UseInterceptors)((0, platform_express_1.AnyFilesInterceptor)()),
    (0, common_1.Post)('uploads'),
    openapi.ApiResponse({ status: 201 }),
    __param(0, (0, common_1.UploadedFiles)()),
    __param(1, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Array, Object]),
    __metadata("design:returntype", void 0)
], TestController.prototype, "uploadData", null);
__decorate([
    (0, auth_decorator_1.Auth)(auth_type_enum_1.AuthType.None),
    (0, common_1.Post)('upload'),
    (0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)('file')),
    openapi.ApiResponse({ status: 201 }),
    __param(0, (0, common_1.UploadedFile)()),
    __param(1, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", void 0)
], TestController.prototype, "uploadFile", null);
__decorate([
    (0, swagger_1.ApiBearerAuth)("jwt"),
    (0, common_1.Post)('mcp/ingest'),
    (0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)('file')),
    openapi.ApiResponse({ status: 201 }),
    __param(0, (0, common_1.UploadedFile)()),
    __param(1, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", Promise)
], TestController.prototype, "mcpIngest", null);
exports.TestController = TestController = TestController_1 = __decorate([
    (0, common_1.Controller)('test'),
    (0, swagger_1.ApiTags)("Solid Core"),
    __metadata("design:paramtypes", [solid_registry_1.SolidRegistry,
        ingest_metadata_service_1.IngestMetadataService])
], TestController);
//# sourceMappingURL=test.controller.js.map