import { MongooseModule, } from "../../helpers"; import { EncryptedDataType } from "../../types/common"; import { FireMapperAuthV2Type, } from "../../types/firemapper-auth"; export function FireMapperAuthV2Schema(mongoose: MongooseModule) { const { Schema } = mongoose; const EncryptedData = new Schema({ iv: { type: String, default: "", }, encryptedData: { type: String, default: "", }, }, { _id: false, id: false, }); const FireMapperAuth = new Schema({ account: { type: String, default: "", }, // Set empty, it will be populated from external uuid: { type: String, default: "", }, // unused yet, to be migrated from parent.host to this place host: { type: String, default: "", }, apiKeyReadOnly: { type: EncryptedData, default: null, }, apiKeyManagement: { type: EncryptedData, default: null, }, licenseCode: { type: EncryptedData, default: null, }, }, { _id: false, id: false, }); return FireMapperAuth; }