"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);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserManagementConfig = exports.TemplateConfig = void 0;
const zod_1 = require("zod");
const decorators_1 = require("../decorators");
let SmtpAuth = class SmtpAuth {
    constructor() {
        this.user = '';
        this.pass = '';
        this.serviceClient = '';
        this.privateKey = '';
    }
};
__decorate([
    (0, decorators_1.Env)('N8N_SMTP_USER'),
    __metadata("design:type", String)
], SmtpAuth.prototype, "user", void 0);
__decorate([
    (0, decorators_1.Env)('N8N_SMTP_PASS'),
    __metadata("design:type", String)
], SmtpAuth.prototype, "pass", void 0);
__decorate([
    (0, decorators_1.Env)('N8N_SMTP_OAUTH_SERVICE_CLIENT'),
    __metadata("design:type", String)
], SmtpAuth.prototype, "serviceClient", void 0);
__decorate([
    (0, decorators_1.Env)('N8N_SMTP_OAUTH_PRIVATE_KEY'),
    __metadata("design:type", String)
], SmtpAuth.prototype, "privateKey", void 0);
SmtpAuth = __decorate([
    decorators_1.Config
], SmtpAuth);
let SmtpConfig = class SmtpConfig {
    constructor() {
        this.host = '';
        this.port = 465;
        this.secure = true;
        this.startTLS = true;
        this.sender = '';
    }
};
__decorate([
    (0, decorators_1.Env)('N8N_SMTP_HOST'),
    __metadata("design:type", String)
], SmtpConfig.prototype, "host", void 0);
__decorate([
    (0, decorators_1.Env)('N8N_SMTP_PORT'),
    __metadata("design:type", Number)
], SmtpConfig.prototype, "port", void 0);
__decorate([
    (0, decorators_1.Env)('N8N_SMTP_SSL'),
    __metadata("design:type", Boolean)
], SmtpConfig.prototype, "secure", void 0);
__decorate([
    (0, decorators_1.Env)('N8N_SMTP_STARTTLS'),
    __metadata("design:type", Boolean)
], SmtpConfig.prototype, "startTLS", void 0);
__decorate([
    (0, decorators_1.Env)('N8N_SMTP_SENDER'),
    __metadata("design:type", String)
], SmtpConfig.prototype, "sender", void 0);
__decorate([
    decorators_1.Nested,
    __metadata("design:type", SmtpAuth)
], SmtpConfig.prototype, "auth", void 0);
SmtpConfig = __decorate([
    decorators_1.Config
], SmtpConfig);
let TemplateConfig = class TemplateConfig {
    constructor() {
        this['user-invited'] = '';
        this['password-reset-requested'] = '';
        this['workflow-shared'] = '';
        this['credentials-shared'] = '';
    }
};
exports.TemplateConfig = TemplateConfig;
__decorate([
    (0, decorators_1.Env)('N8N_UM_EMAIL_TEMPLATES_INVITE'),
    __metadata("design:type", String)
], TemplateConfig.prototype, "user-invited", void 0);
__decorate([
    (0, decorators_1.Env)('N8N_UM_EMAIL_TEMPLATES_PWRESET'),
    __metadata("design:type", String)
], TemplateConfig.prototype, "password-reset-requested", void 0);
__decorate([
    (0, decorators_1.Env)('N8N_UM_EMAIL_TEMPLATES_WORKFLOW_SHARED'),
    __metadata("design:type", String)
], TemplateConfig.prototype, "workflow-shared", void 0);
__decorate([
    (0, decorators_1.Env)('N8N_UM_EMAIL_TEMPLATES_CREDENTIALS_SHARED'),
    __metadata("design:type", String)
], TemplateConfig.prototype, "credentials-shared", void 0);
exports.TemplateConfig = TemplateConfig = __decorate([
    decorators_1.Config
], TemplateConfig);
const emailModeSchema = zod_1.z.enum(['', 'smtp']);
let EmailConfig = class EmailConfig {
    constructor() {
        this.mode = 'smtp';
    }
};
__decorate([
    (0, decorators_1.Env)('N8N_EMAIL_MODE', emailModeSchema),
    __metadata("design:type", String)
], EmailConfig.prototype, "mode", void 0);
__decorate([
    decorators_1.Nested,
    __metadata("design:type", SmtpConfig)
], EmailConfig.prototype, "smtp", void 0);
__decorate([
    decorators_1.Nested,
    __metadata("design:type", TemplateConfig)
], EmailConfig.prototype, "template", void 0);
EmailConfig = __decorate([
    decorators_1.Config
], EmailConfig);
let UserManagementConfig = class UserManagementConfig {
};
exports.UserManagementConfig = UserManagementConfig;
__decorate([
    decorators_1.Nested,
    __metadata("design:type", EmailConfig)
], UserManagementConfig.prototype, "emails", void 0);
exports.UserManagementConfig = UserManagementConfig = __decorate([
    decorators_1.Config
], UserManagementConfig);
//# sourceMappingURL=user-management.config.js.map