fix(core): update
This commit is contained in:
@@ -6,36 +6,30 @@ export interface ISmartExposeOptions {
|
||||
deleteAfterMillis?: number,
|
||||
privateUrl?: boolean,
|
||||
exposedBaseUrl: string,
|
||||
webdav?: {
|
||||
webdavCredentials: plugins.smartwebdav.IWebdavClientOptions,
|
||||
webdavSubPath: string,
|
||||
}
|
||||
}
|
||||
|
||||
export class SmartExpose {
|
||||
// STATIC
|
||||
public static createWithWebdav(optionsArg: {
|
||||
webdavCredentials: plugins.smartwebdav.IWebdavClientOptions,
|
||||
webdavSubPath: string,
|
||||
exposeOptions: ISmartExposeOptions,
|
||||
}) {
|
||||
const provider = new WebDavExposeProvider({
|
||||
webdavCredentials: optionsArg.webdavCredentials,
|
||||
webdavSubPath: optionsArg.webdavSubPath,
|
||||
});
|
||||
const smartexposeInstance = new SmartExpose(provider, optionsArg.exposeOptions);
|
||||
provider.smartExposeRef = smartexposeInstance;
|
||||
return smartexposeInstance;
|
||||
}
|
||||
|
||||
// INSTANCE
|
||||
public taskmanager: plugins.taskbuffer.TaskManager;
|
||||
public provider: ExposeProvider;
|
||||
public options: ISmartExposeOptions;
|
||||
|
||||
constructor(provider: ExposeProvider, optionsArg: ISmartExposeOptions) {
|
||||
this.provider = provider;
|
||||
constructor(optionsArg: ISmartExposeOptions) {
|
||||
this.options = optionsArg;
|
||||
}
|
||||
|
||||
public async start() {
|
||||
this.taskmanager = new plugins.taskbuffer.TaskManager();
|
||||
if (this.options.webdav) {
|
||||
this.provider = new WebDavExposeProvider(this, {
|
||||
webdavCredentials: this.options.webdav.webdavCredentials,
|
||||
webdavSubPath: this.options.webdav.webdavSubPath,
|
||||
});
|
||||
}
|
||||
await this.provider.start();
|
||||
this.taskmanager.start();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user