Compare commits

..

6 Commits

Author SHA1 Message Date
ab39809c2a 1.0.20 2019-10-19 22:57:37 +02:00
cede6c7539 fix(core): update 2019-10-19 22:57:36 +02:00
547692ac62 1.0.19 2019-10-18 18:44:55 +02:00
5410df0011 fix(core): update 2019-10-18 18:44:54 +02:00
5b8a55d6d2 1.0.18 2019-10-18 18:37:43 +02:00
61145d5e80 fix(core): update 2019-10-18 18:37:43 +02:00
3 changed files with 25 additions and 5 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartbucket",
"version": "1.0.17",
"version": "1.0.20",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartbucket",
"version": "1.0.17",
"version": "1.0.20",
"description": "simple cloud independent object storage",
"main": "dist/index.js",
"typings": "dist/index.d.ts",

View File

@ -123,9 +123,12 @@ export class Directory {
/**
* gets a sub directory
*/
public async getSubDirectory(): Promise<Directory> {
return this;
// TODO
public async getSubDirectoryByName(dirNameArg: string): Promise<Directory> {
// TODO: make this recursive
const directories = await this.listDirectories();
return directories.find(directory => {
return directory.name === dirNameArg;
});
}
/**
@ -142,4 +145,21 @@ export class Directory {
public async createFile(relativePathArg) {
let completeFilePath: string = '';
}
// file operations
public async fastStore(pathArg: string, contentArg: string) {
const path = plugins.path.join(this.getBasePath(), pathArg);
await this.bucketRef.fastStore(path, contentArg);
}
public async fastGet(pathArg: string) {
const path = plugins.path.join(this.getBasePath(), pathArg);
const result = await this.bucketRef.fastGet(path);
return result;
}
public async fastRemove(pathArg: string) {
const path = plugins.path.join(this.getBasePath(), pathArg);
await this.bucketRef.fastRemove(path);
}
}