import { mkdirs } from 'fs-extra' import { Distribution } from '../spec/distribution' import { ModelStructure } from './model.struct' import { ServerStructure } from './server.struct' export class DistributionStructure implements ModelStructure { private serverStruct: ServerStructure constructor( private absoluteRoot: string, private baseUrl: string ) { this.serverStruct = new ServerStructure(this.absoluteRoot, this.baseUrl) } public async init() { await mkdirs(this.absoluteRoot) await this.serverStruct.init() } public async getSpecModel() { return new Promise(async (resolve) => { resolve({ version: '1.0.0', rss: '', servers: await this.serverStruct.getSpecModel() }) }) as Promise } }