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);
};
import GlobalConfigModel from "../../Models/DatabaseModels/DatabaseBaseModel/GlobalConfig";
import Hostname from "../../Types/API/Hostname";
import Route from "../../Types/API/Route";
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
import ColumnLength from "../../Types/Database/ColumnLength";
import ColumnType from "../../Types/Database/ColumnType";
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
import TableColumn from "../../Types/Database/TableColumn";
import TableColumnType from "../../Types/Database/TableColumnType";
import TableMetadata from "../../Types/Database/TableMetadata";
import Email from "../../Types/Email";
import MailTransportType from "../../Types/Email/MailTransportType";
import OAuthProviderType from "../../Types/Email/OAuthProviderType";
import SMTPAuthenticationType from "../../Types/Email/SMTPAuthenticationType";
import IconProp from "../../Types/Icon/IconProp";
import ObjectID from "../../Types/ObjectID";
import Phone from "../../Types/Phone";
import Port from "../../Types/Port";
import { Column, Entity } from "typeorm";
export var EmailServerType;
(function (EmailServerType) {
    EmailServerType["Sendgrid"] = "Sendgrid";
    EmailServerType["CustomSMTP"] = "Custom SMTP";
})(EmailServerType || (EmailServerType = {}));
let GlobalConfig = class GlobalConfig extends GlobalConfigModel {
    constructor() {
        super(...arguments);
        this.disableSignup = undefined;
        this.disableUserProjectCreation = undefined;
        // SMTP Settings.
        this.isSMTPSecure = undefined;
        this.smtpUsername = undefined;
        this.smtpPassword = undefined;
        this.smtpPort = undefined;
        this.smtpHost = undefined;
        this.smtpFromEmail = undefined;
        this.smtpFromName = undefined;
        /*
         * Transport selection for the global SMTP. Defaults to SMTP for backwards
         * compatibility. 'Microsoft Graph' bypasses SMTP entirely and posts to
         * https://graph.microsoft.com/v1.0/users/{from}/sendMail — useful for tenants
         * that have SMTP AUTH disabled.
         */
        this.smtpTransportType = undefined;
        // SMTP OAuth 2.0 Settings.
        this.smtpAuthType = undefined;
        this.smtpClientId = undefined;
        this.smtpClientSecret = undefined;
        this.smtpTokenUrl = undefined;
        this.smtpScope = undefined;
        this.smtpOAuthProviderType = undefined;
        // Twilio config.
        this.twilioAccountSID = undefined;
        this.twilioAuthToken = undefined;
        this.twilioPrimaryPhoneNumber = undefined;
        this.twilioSecondaryPhoneNumbers = undefined; // phone numbers separated by comma
        this.metaWhatsAppAccessToken = undefined;
        this.metaWhatsAppPhoneNumberId = undefined;
        this.metaWhatsAppBusinessAccountId = undefined;
        this.metaWhatsAppAppId = undefined;
        this.metaWhatsAppAppSecret = undefined;
        this.metaWhatsAppWebhookVerifyToken = undefined;
        this.telegramBotToken = undefined;
        this.telegramBotUsername = undefined;
        this.telegramWebhookSecretToken = undefined;
        this.emailServerType = undefined;
        this.sendgridApiKey = undefined;
        this.sendgridFromEmail = undefined;
        this.sendgridFromName = undefined;
        this.isMasterApiKeyEnabled = undefined;
        this.masterApiKey = undefined;
        this.adminNotificationEmail = undefined;
        this.enterpriseCompanyName = undefined;
        this.enterpriseLicenseKey = undefined;
        this.enterpriseLicenseExpiresAt = undefined;
        this.enterpriseLicenseToken = undefined;
        this.enterpriseLicenseUserLimit = undefined;
        this.enterpriseLicenseCurrentUserCount = undefined;
        this.enterpriseLicenseUserCountUpdatedAt = undefined;
        this.monitorLogRetentionInDays = undefined;
        this.monitorMetricRetentionInDays = undefined;
    }
};
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.Boolean,
        title: "Disable Signup",
        description: "Should we disable new user sign up to this server?",
        defaultValue: false,
    }),
    Column({
        type: ColumnType.Boolean,
        nullable: true,
        default: false,
        unique: true,
    }),
    __metadata("design:type", Boolean)
], GlobalConfig.prototype, "disableSignup", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.Boolean,
        title: "Disable User Project Creation",
        description: "Only master admins can create projects when enabled.",
        defaultValue: false,
    }),
    Column({
        type: ColumnType.Boolean,
        nullable: true,
        default: false,
        unique: true,
    }),
    __metadata("design:type", Boolean)
], GlobalConfig.prototype, "disableUserProjectCreation", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.Boolean,
        title: "Is SMTP Secure",
        description: "Is this SMTP server hosted with SSL/TLS?",
    }),
    Column({
        type: ColumnType.Boolean,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", Boolean)
], GlobalConfig.prototype, "isSMTPSecure", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.LongText,
        title: "SMTP Username",
        description: "Username for your SMTP Server",
    }),
    Column({
        type: ColumnType.LongText,
        length: ColumnLength.LongText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "smtpUsername", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "SMTP Password",
        description: "Password for your SMTP Server",
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "smtpPassword", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.Number,
        title: "SMTP Port",
        description: "Port for your SMTP Server",
    }),
    Column({
        type: ColumnType.Number,
        nullable: true,
        unique: true,
        transformer: Port.getDatabaseTransformer(),
    }),
    __metadata("design:type", Port)
], GlobalConfig.prototype, "smtpPort", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "SMTP Host",
        description: "Host for your SMTP Server",
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
        unique: true,
        transformer: Hostname.getDatabaseTransformer(),
    }),
    __metadata("design:type", Hostname)
], GlobalConfig.prototype, "smtpHost", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.Email,
        title: "SMTP From Email",
        description: "Which email should we send mail from?",
    }),
    Column({
        type: ColumnType.Email,
        length: ColumnLength.Email,
        nullable: true,
        unique: true,
        transformer: Email.getDatabaseTransformer(),
    }),
    __metadata("design:type", Email)
], GlobalConfig.prototype, "smtpFromEmail", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "SMTP From Name",
        description: "Which name should we send emails from?",
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "smtpFromName", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "SMTP Transport",
        description: "How OneUptime delivers mail using the global SMTP config. 'SMTP' uses the host/port. 'Microsoft Graph' sends via the Microsoft Graph REST API.",
        defaultValue: MailTransportType.SMTP,
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
        default: MailTransportType.SMTP,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "smtpTransportType", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "SMTP Authentication Type",
        description: "The type of authentication to use for this SMTP server. Options: Username and Password, OAuth, or None.",
        defaultValue: SMTPAuthenticationType.UsernamePassword,
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
        default: SMTPAuthenticationType.UsernamePassword,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "smtpAuthType", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "SMTP OAuth Client ID",
        description: "The Client ID from your OAuth application registration. Required for OAuth authentication.",
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "smtpClientId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.VeryLongText,
        title: "SMTP OAuth Client Secret",
        description: "The Client Secret from your OAuth application registration. Required for OAuth authentication. For Google service accounts, this is the private key from the JSON key file.",
    }),
    Column({
        type: ColumnType.VeryLongText,
        nullable: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "smtpClientSecret", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.LongURL,
        title: "SMTP OAuth Token URL",
        description: "The OAuth token endpoint URL. For Microsoft 365: https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/token. For Google: https://oauth2.googleapis.com/token",
    }),
    Column({
        type: ColumnType.LongURL,
        nullable: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "smtpTokenUrl", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.LongText,
        title: "SMTP OAuth Scope",
        description: "The OAuth scope(s) required for SMTP access. For Microsoft 365: https://outlook.office365.com/.default. For Google: https://mail.google.com/",
    }),
    Column({
        type: ColumnType.LongText,
        length: ColumnLength.LongText,
        nullable: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "smtpScope", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "SMTP OAuth Provider Type",
        description: "The OAuth grant type to use. 'Client Credentials' for Microsoft 365 and most providers. 'JWT Bearer' for Google Workspace service accounts.",
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "smtpOAuthProviderType", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "Twilio Account SID",
        description: "Account SID for your Twilio Account",
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "twilioAccountSID", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "Twilio Auth Token",
        description: "Auth Token for your Twilio Account",
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "twilioAuthToken", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.Phone,
        title: "Twilio Primary Phone Number",
        description: "Secondary Phone Number for your Twilio account",
    }),
    Column({
        type: ColumnType.Phone,
        length: ColumnLength.Phone,
        nullable: true,
        unique: false,
        transformer: Phone.getDatabaseTransformer(),
    }),
    __metadata("design:type", Phone)
], GlobalConfig.prototype, "twilioPrimaryPhoneNumber", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.LongText,
        title: "Twilio Secondary Phone Numbers",
        description: "Secondary Phone Number for your Twilio account",
    }),
    Column({
        type: ColumnType.LongText,
        length: ColumnLength.LongText,
        nullable: true,
        unique: false,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "twilioSecondaryPhoneNumbers", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.VeryLongText,
        title: "Meta WhatsApp Access Token",
        description: "Access token generated from Meta for sending WhatsApp messages.",
    }),
    Column({
        type: ColumnType.VeryLongText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "metaWhatsAppAccessToken", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "Meta WhatsApp Phone Number ID",
        description: "The WhatsApp Business phone number ID from Meta.",
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "metaWhatsAppPhoneNumberId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "Meta WhatsApp Business Account ID",
        description: "Business account ID associated with your WhatsApp setup.",
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "metaWhatsAppBusinessAccountId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "Meta WhatsApp App ID",
        description: "Facebook App ID used for the WhatsApp Business Platform integration.",
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "metaWhatsAppAppId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.VeryLongText,
        title: "Meta WhatsApp App Secret",
        description: "Facebook App Secret for the WhatsApp Business Platform.",
    }),
    Column({
        type: ColumnType.VeryLongText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "metaWhatsAppAppSecret", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "Meta WhatsApp Webhook Verify Token",
        description: "Verify token configured in Meta to validate webhook subscriptions.",
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "metaWhatsAppWebhookVerifyToken", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.VeryLongText,
        title: "Telegram Bot Token",
        description: "Bot token issued by @BotFather for sending Telegram messages.",
    }),
    Column({
        type: ColumnType.VeryLongText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "telegramBotToken", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "Telegram Bot Username",
        description: "Username of your OneUptime Telegram bot (without the leading @). Used to build verification deep links.",
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "telegramBotUsername", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "Telegram Webhook Secret Token",
        description: "Secret token passed to Telegram setWebhook. Telegram sends it back in the X-Telegram-Bot-Api-Secret-Token header.",
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "telegramWebhookSecretToken", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "Email Server Type",
        description: "Email Server Type",
    }),
    Column({
        type: ColumnType.ShortText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "emailServerType", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "Sendgrid API Key",
        description: "Sendgrid API Key",
    }),
    Column({
        type: ColumnType.ShortText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "sendgridApiKey", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.Email,
        title: "Sendgrid From Email",
        description: "Sendgrid From Email",
    }),
    Column({
        type: ColumnType.Email,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", Email)
], GlobalConfig.prototype, "sendgridFromEmail", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "Sendgrid From Name",
        description: "Sendgrid From Name",
    }),
    Column({
        type: ColumnType.ShortText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "sendgridFromName", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.Boolean,
        title: "Is Master API Key Enabled",
        description: "Is Master API Key Enabled?",
        defaultValue: false,
    }),
    Column({
        type: ColumnType.Boolean,
        nullable: true,
        unique: true,
        default: false,
    }),
    __metadata("design:type", Boolean)
], GlobalConfig.prototype, "isMasterApiKeyEnabled", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ObjectID,
        computed: true,
        title: "Master API Key",
        description: "This API key has root access to all the resources in all the projects on OneUptime.",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        unique: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], GlobalConfig.prototype, "masterApiKey", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.Email,
        title: "Admin Notification Email",
        description: "Email to send admin notifications to (when probes are offline, etc.)",
    }),
    Column({
        type: ColumnType.Email,
        length: ColumnLength.Email,
        nullable: true,
        unique: true,
        transformer: Email.getDatabaseTransformer(),
    }),
    __metadata("design:type", Email)
], GlobalConfig.prototype, "adminNotificationEmail", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "Enterprise Company Name",
        description: "Company name associated with the validated enterprise license.",
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "enterpriseCompanyName", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ShortText,
        title: "Enterprise License Key",
        description: "Enterprise license key stored after successful validation.",
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "enterpriseLicenseKey", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.Date,
        title: "Enterprise License Expires At",
        description: "Expiration date of the validated enterprise license.",
    }),
    Column({
        type: ColumnType.Date,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", Date)
], GlobalConfig.prototype, "enterpriseLicenseExpiresAt", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.VeryLongText,
        title: "Enterprise License Token",
        description: "Signed JWT returned from license validation.",
    }),
    Column({
        type: ColumnType.VeryLongText,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", String)
], GlobalConfig.prototype, "enterpriseLicenseToken", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.Number,
        title: "Enterprise License User Limit",
        description: "Maximum number of users permitted under the validated enterprise license.",
    }),
    Column({
        type: ColumnType.Number,
        nullable: true,
    }),
    __metadata("design:type", Number)
], GlobalConfig.prototype, "enterpriseLicenseUserLimit", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.Number,
        title: "Enterprise License Current User Count",
        description: "User count last reported to OneUptime for the validated enterprise license.",
    }),
    Column({
        type: ColumnType.Number,
        nullable: true,
    }),
    __metadata("design:type", Number)
], GlobalConfig.prototype, "enterpriseLicenseCurrentUserCount", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.Date,
        title: "Enterprise License User Count Updated At",
        description: "Timestamp of the most recent user count report sent to OneUptime for the validated enterprise license.",
    }),
    Column({
        type: ColumnType.Date,
        nullable: true,
    }),
    __metadata("design:type", Date)
], GlobalConfig.prototype, "enterpriseLicenseUserCountUpdatedAt", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.Number,
        title: "Monitor Log Retention Days",
        description: "Number of days to retain monitor logs. Monitor logs older than this will be automatically deleted. Default is 1 day.",
    }),
    Column({
        type: ColumnType.Number,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", Number)
], GlobalConfig.prototype, "monitorLogRetentionInDays", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.Number,
        title: "Monitor Metric Retention Days",
        description: "Number of days to retain monitor metrics. Monitor metrics older than this will be automatically deleted. Default is 1 day.",
    }),
    Column({
        type: ColumnType.Number,
        nullable: true,
        unique: true,
    }),
    __metadata("design:type", Number)
], GlobalConfig.prototype, "monitorMetricRetentionInDays", void 0);
GlobalConfig = __decorate([
    TableMetadata({
        tableName: "GlobalConfig",
        singularName: "Global Config",
        pluralName: "Global Configs",
        icon: IconProp.Settings,
        tableDescription: "Settings for OneUptime Server",
    }),
    Entity({
        name: "GlobalConfig",
    }),
    CrudApiEndpoint(new Route("/global-config")),
    TableAccessControl({
        create: [],
        read: [],
        delete: [],
        update: [],
    })
], GlobalConfig);
export default GlobalConfig;
//# sourceMappingURL=GlobalConfig.js.map