"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "Settings", {
    enumerable: true,
    get: function() {
        return Settings;
    }
});
const _mongoose = require("mongoose");
const _serversettingsconstants = require("../constants/server-settings.constants");
const SettingsSchema = new _mongoose.Schema({
    [_serversettingsconstants.wizardSettingKey]: {
        wizardCompleted: {
            type: Boolean,
            default: false,
            required: true
        },
        wizardCompletedAt: {
            type: Date,
            default: null,
            required: false
        },
        wizardVersion: {
            type: Number,
            default: 0,
            required: true
        }
    },
    [_serversettingsconstants.printerFileCleanSettingKey]: {
        autoRemoveOldFilesBeforeUpload: {
            type: Boolean,
            default: false,
            required: true
        },
        autoRemoveOldFilesAtBoot: {
            type: Boolean,
            default: false,
            required: true
        },
        autoRemoveOldFilesCriteriumDays: {
            type: Number,
            default: 14,
            required: true
        }
    },
    [_serversettingsconstants.credentialSettingsKey]: {
        type: {
            jwtSecret: {
                type: String,
                minlength: 10,
                trim: true,
                required: true
            },
            jwtExpiresIn: {
                type: Number,
                required: true
            },
            refreshTokenAttempts: {
                type: Number,
                required: true
            },
            refreshTokenExpiry: {
                type: Number,
                required: true
            },
            createdAt: {
                type: Date,
                default: Date.now,
                required: true
            },
            updatedAt: {
                type: Date,
                default: Date.now,
                required: true
            }
        },
        required: true
    },
    [_serversettingsconstants.serverSettingsKey]: {
        sentryDiagnosticsEnabled: {
            type: Boolean,
            default: false,
            required: true
        },
        debugSettings: {
            debugSocketIoEvents: {
                type: Boolean,
                default: false,
                required: true
            },
            debugSocketReconnect: {
                type: Boolean,
                default: false,
                required: true
            },
            debugSocketRetries: {
                type: Boolean,
                default: false,
                required: true
            },
            debugSocketSetup: {
                type: Boolean,
                default: false,
                required: true
            },
            debugSocketMessages: {
                type: Boolean,
                default: false,
                required: true
            },
            debugSocketIoBandwidth: {
                type: Boolean,
                default: false,
                required: true
            }
        },
        loginRequired: {
            type: Boolean,
            default: true,
            required: true
        },
        registration: {
            type: Boolean,
            default: false,
            required: true
        },
        experimentalMoonrakerSupport: {
            type: Boolean,
            default: false,
            required: true
        },
        experimentalClientSupport: {
            type: Boolean,
            default: false,
            required: true
        }
    },
    [_serversettingsconstants.frontendSettingKey]: {
        gridCols: {
            type: Number,
            default: 8,
            required: false
        },
        gridRows: {
            type: Number,
            default: 8,
            required: false
        },
        largeTiles: {
            type: Boolean,
            default: false,
            required: false
        }
    },
    [_serversettingsconstants.timeoutSettingKey]: {
        apiTimeout: {
            type: Number,
            default: 1000,
            required: true
        }
    }
});
const Settings = (0, _mongoose.model)("ServerSettings", SettingsSchema);

//# sourceMappingURL=Settings.js.map