fix(core): update
This commit is contained in:
		| @@ -3,6 +3,6 @@ | ||||
|  */ | ||||
| export const commitinfo = { | ||||
|   name: '@push.rocks/smartbucket', | ||||
|   version: '3.0.13', | ||||
|   version: '3.0.14', | ||||
|   description: 'A TypeScript library offering simple and cloud-agnostic object storage with advanced features like bucket creation, file and directory management, and data streaming.' | ||||
| } | ||||
|   | ||||
| @@ -79,7 +79,10 @@ export class Directory { | ||||
|     }); | ||||
|     if (!exists && optionsArg.getFromTrash) { | ||||
|       const trash = await this.bucketRef.getTrash(); | ||||
|       const trashKey = await trash.getTrashKeyByOriginalBasePath() | ||||
|       const trashedFile = await trash.getTrashedFileByOriginalName( | ||||
|         pathDescriptor | ||||
|       ) | ||||
|       return trashedFile; | ||||
|     } | ||||
|     if (!exists && !optionsArg.createWithContents) { | ||||
|       return null; | ||||
| @@ -94,7 +97,7 @@ export class Directory { | ||||
|     return new File({ | ||||
|       directoryRefArg: this, | ||||
|       fileName: optionsArg.name, | ||||
|     }) | ||||
|     }); | ||||
|   } | ||||
|  | ||||
|   /** | ||||
| @@ -132,7 +135,7 @@ export class Directory { | ||||
|       }, | ||||
|       finalFunction: async (tools) => { | ||||
|         done.resolve(); | ||||
|       } | ||||
|       }, | ||||
|     }); | ||||
|     fileNameStream.pipe(duplexStream); | ||||
|     await done.promise; | ||||
| @@ -171,7 +174,7 @@ export class Directory { | ||||
|       }, | ||||
|       finalFunction: async (tools) => { | ||||
|         done.resolve(); | ||||
|       } | ||||
|       }, | ||||
|     }); | ||||
|     completeDirStream.pipe(duplexStream); | ||||
|     await done.promise; | ||||
| @@ -246,23 +249,35 @@ export class Directory { | ||||
|     return result; | ||||
|   } | ||||
|  | ||||
|   public fastGetStream(optionsArg: { | ||||
|     path: string; | ||||
|   }, typeArg: 'webstream'): Promise<ReadableStream> | ||||
|   public async fastGetStream(optionsArg: { | ||||
|     path: string; | ||||
|   }, typeArg: 'nodestream'): Promise<plugins.stream.Readable> | ||||
|   public fastGetStream( | ||||
|     optionsArg: { | ||||
|       path: string; | ||||
|     }, | ||||
|     typeArg: 'webstream' | ||||
|   ): Promise<ReadableStream>; | ||||
|   public async fastGetStream( | ||||
|     optionsArg: { | ||||
|       path: string; | ||||
|     }, | ||||
|     typeArg: 'nodestream' | ||||
|   ): Promise<plugins.stream.Readable>; | ||||
|  | ||||
|   /** | ||||
|    * fastGetStream | ||||
|    * @param optionsArg | ||||
|    * @returns  | ||||
|    * @returns | ||||
|    */ | ||||
|   public async fastGetStream(optionsArg: { path: string; }, typeArg: 'webstream' | 'nodestream'): Promise<ReadableStream | plugins.stream.Readable>{ | ||||
|   public async fastGetStream( | ||||
|     optionsArg: { path: string }, | ||||
|     typeArg: 'webstream' | 'nodestream' | ||||
|   ): Promise<ReadableStream | plugins.stream.Readable> { | ||||
|     const path = plugins.path.join(this.getBasePath(), optionsArg.path); | ||||
|     const result = await this.bucketRef.fastGetStream({ | ||||
|       path | ||||
|     }, typeArg as any); | ||||
|     const result = await this.bucketRef.fastGetStream( | ||||
|       { | ||||
|         path, | ||||
|       }, | ||||
|       typeArg as any | ||||
|     ); | ||||
|     return result; | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -18,7 +18,10 @@ export class Trash { | ||||
|   } | ||||
|  | ||||
|   public async getTrashedFileByOriginalName(pathDescriptor: interfaces.IPathDecriptor): Promise<File> { | ||||
|      | ||||
|     const trashDir = await this.getTrashDir(); | ||||
|     const originalPath = await helpers.reducePathDescriptorToPath(pathDescriptor); | ||||
|     const trashKey = await this.getTrashKeyByOriginalBasePath(originalPath); | ||||
|     return trashDir.getFile({ name: trashKey }); | ||||
|   } | ||||
|  | ||||
|   public async getTrashKeyByOriginalBasePath (originalPath: string): Promise<string> { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user