import { join } from 'path' ; import { VFS } from '@kui-shell/plugin-bash-like/fs' ; export const S3_TAG = 's3' ; export const baseMountPath = '/s3' ; export function mountPathFor ( mountName ) { return join ( baseMountPath , mountName ) ; } export type VFSWithError = VFS & { error : Error ; publicOnly : boolean ; } ; abstract class S3VFS { public readonly mountPath : string ; public readonly isLocal = false ; public readonly isVirtual = false ; public readonly tags = [ S3_TAG ] ; protected readonly s3Prefix : RegExp ; public constructor ( mountName , private _error = undefined , public readonly publicOnly = false ) { this . mountPath = mountPathFor ( mountName ) ; this . s3Prefix = new RegExp ( `^${ this . mountPath }\\/?` ) ; } public get error ( ) { return this . _error ; } public set error ( error ) { this . _error = error ; } } export default S3VFS ;