import * as plugins from '../plugins.js'; import * as paths from '../paths.js'; import type { Cloudly } from 'ts/classes.cloudly.js'; import type { ExternalRegistryManager } from './classes.externalregistrymanager.js'; export class ExternalRegistry extends plugins.smartdata.SmartDataDbDoc { // STATIC public static async getRegistryById(registryIdArg: string) { const externalRegistry = await this.getInstance({ id: registryIdArg, }); return externalRegistry; } public static async getRegistries() { const externalRegistries = await this.getInstances({}); return externalRegistries; } public static async createExternalRegistry(registryDataArg: Partial) { const externalRegistry = new ExternalRegistry(); externalRegistry.id = await ExternalRegistry.getNewId(); Object.assign(externalRegistry, registryDataArg); await externalRegistry.save(); return externalRegistry; } // INSTANCE @plugins.smartdata.svDb() public id: string; @plugins.smartdata.svDb() public data: plugins.servezoneInterfaces.data.IExternalRegistry['data']; constructor() { super(); } }