import { Schema, model } from 'mongoose';
const discriminatorKey = { discriminatorKey: 'type' };
const connectionSchema = new Schema({}, {
    timestamps: true,
    ...discriminatorKey,
});
export const ConnectionModel = model('Connection', connectionSchema);
const azurePATConnectionSchema = new Schema({
    host: { type: String, required: true },
    token: { type: String, required: true },
    verifySsl: { type: Boolean, default: true },
}, { ...discriminatorKey });
export const AzurePATConnectionModel = ConnectionModel.discriminator('azure-pat', azurePATConnectionSchema);
const sonarConnectionSchema = new Schema({
    url: { type: String, required: true },
    token: { type: String },
    verifySsl: { type: Boolean, default: true },
}, { ...discriminatorKey });
export const SonarConnectionModel = ConnectionModel.discriminator('sonar', sonarConnectionSchema);
