feat(core): add provider defaults, strengthen WebDAV validation, and modernize tests and package metadata
This commit is contained in:
@@ -2,8 +2,8 @@ import * as plugins from './plugins.js';
|
||||
|
||||
/**
|
||||
* An expose provider provides a standardized interface for exposing data
|
||||
* Note: SmartExpose comes with some default implmentations of ExposeProvider
|
||||
*
|
||||
* Note: SmartExpose comes with some default implementations of ExposeProvider
|
||||
*
|
||||
* notably:
|
||||
* - WebDavExposeProvider
|
||||
*/
|
||||
@@ -13,15 +13,15 @@ export abstract class ExposeProvider {
|
||||
* Should take care of any housekeeping required to keep things in a healthy state.
|
||||
*/
|
||||
public abstract houseKeeping(): Promise<void>;
|
||||
|
||||
|
||||
/**
|
||||
* should return a url with info about how to access the file
|
||||
* @param optionsArg
|
||||
* @param optionsArg
|
||||
*/
|
||||
public abstract exposeFile(optionsArg: {
|
||||
smartFile: plugins.smartfile.SmartFile,
|
||||
deleteAfterMillis?: number,
|
||||
privateUrl?: boolean, // wether the returned url should be private by design
|
||||
smartFile: plugins.smartfile.SmartFile;
|
||||
deleteAfterMillis?: number;
|
||||
privateUrl?: boolean; // whether the returned url should be private by design
|
||||
}): Promise<{
|
||||
url: string;
|
||||
id: string;
|
||||
@@ -29,9 +29,9 @@ export abstract class ExposeProvider {
|
||||
}>;
|
||||
|
||||
public abstract exposeFileArray(optionsArg: {
|
||||
smartFiles: plugins.smartfile.SmartFile[],
|
||||
deleteAfterMillis?: number,
|
||||
privateUrl?: boolean,
|
||||
smartFiles: plugins.smartfile.SmartFile[];
|
||||
deleteAfterMillis?: number;
|
||||
privateUrl?: boolean;
|
||||
}): Promise<{
|
||||
url: string;
|
||||
id: string;
|
||||
@@ -45,9 +45,10 @@ export abstract class ExposeProvider {
|
||||
public abstract wipeAll(): Promise<{
|
||||
id: string;
|
||||
status: 'deleted' | 'failed' | 'notfound';
|
||||
}[]>
|
||||
}[]>;
|
||||
|
||||
public abstract deleteFileById(idArg: string): Promise<{
|
||||
id: string;
|
||||
status: 'deleted' | 'failed' | 'notfound';
|
||||
}>
|
||||
}
|
||||
}>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user