"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.stepSchema = exports.matchSchemaArguments = exports.argumentSchema = exports.argumentsRowsSchema = exports.argumentsRowsSchemaRow = exports.stepResultsOverviewSchema = exports.rowSchema = exports.locationsSchema = exports.embeddingSchema = exports.mediaSchema = exports.sttachmentSchema = void 0;
const CommonSchemas = __importStar(require("./mongoose-common-schemas"));
const mongoose_1 = require("mongoose");
exports.sttachmentSchema = new mongoose_1.Schema({
    data: { required: false, type: String },
    type: { required: false, type: String },
}, {
    _id: false,
    id: false,
});
exports.mediaSchema = new mongoose_1.Schema({
    type: { required: true, type: String },
}, {
    _id: false,
    id: false,
});
exports.embeddingSchema = new mongoose_1.Schema({
    data: { required: false, type: String },
    media: { required: false, type: exports.mediaSchema },
    mime_type: { required: false, type: String },
}, {
    _id: false,
    id: false,
});
exports.locationsSchema = new mongoose_1.Schema({
    column: { required: false, type: Number },
    line: { required: false, type: Number }
}, {
    _id: false,
    id: false,
});
exports.rowSchema = new mongoose_1.Schema({
    cells: [{ required: false, type: String }],
    line: { required: false, type: Number },
    locations: [{ required: false, type: exports.locationsSchema }]
}, {
    _id: false,
    id: false,
});
exports.stepResultsOverviewSchema = new mongoose_1.Schema({
    color: { required: false, type: String },
    duration: { required: false, type: Number },
    durationHHMMSS: { required: false, type: String },
    error_message: { required: false, type: String },
    icon: { required: false, type: String },
    status: { enum: Object.values(CommonSchemas.statusSchema), required: false, type: String },
    title: { required: false, type: String }
}, {
    _id: false,
    id: false,
});
exports.argumentsRowsSchemaRow = new mongoose_1.Schema({
    cells: [{ required: false, type: String }]
}, {
    _id: false,
    id: false,
});
exports.argumentsRowsSchema = new mongoose_1.Schema({
    rows: [{ required: false, type: exports.rowSchema }],
}, {
    _id: false,
    id: false,
});
exports.argumentSchema = new mongoose_1.Schema({
    offset: { required: false, type: Number },
    val: { required: false, type: String },
}, {
    _id: false,
    id: false,
});
exports.matchSchemaArguments = new mongoose_1.Schema({
    arguments: [{ required: false, type: exports.argumentSchema }],
    location: { required: false, type: String }
}, {
    _id: false,
    id: false,
});
exports.stepSchema = new mongoose_1.Schema({
    // Index: { required: false, type: Number },
    // _id: { required: false, type: mongoose.Schema.Types.ObjectId },
    argument: exports.argumentSchema,
    arguments: [{ required: false, type: exports.argumentsRowsSchema }],
    argumentsCells: { required: false, type: String },
    attachments: [{ required: false, type: exports.sttachmentSchema }],
    audio: [{ required: false, type: String }],
    embeddings: [{ required: false, type: exports.embeddingSchema }],
    examples: [[{ required: true, type: String }]],
    hidden: { required: false, type: Boolean },
    html: [{ required: true, type: String }],
    id: { required: false, type: String },
    image: [{ required: true, type: String }],
    index: { required: false, type: Number },
    json: [{ required: false, type: String }],
    keyword: { required: true, type: String },
    line: { required: false, type: Number },
    match: { required: false, type: exports.matchSchemaArguments },
    name: { required: false, type: String },
    output: [{ required: false, type: String }],
    result: { required: false, type: exports.stepResultsOverviewSchema },
    rows: [{ required: false, type: exports.rowSchema }, { _id: false, id: false }],
    rowsCells: { required: false, type: String },
    scenarioId: { ref: 'Scenario', type: mongoose_1.Schema.Types.ObjectId },
    text: { required: false, type: mongoose_1.Schema.Types.Mixed },
    video: [{ required: false, type: String }]
}, {
    // _id: false,
    // id: false,
    toJSON: {
        transform: (ret) => {
            delete ret._id;
        },
        versionKey: false,
        virtuals: true
    },
    toObject: {
        versionKey: false,
        virtuals: true
    }
});
//# sourceMappingURL=mongoose-step-schemas.js.map