This commit is contained in:
2018-09-14 18:07:20 +02:00
parent fa1e10be54
commit 5a02e92397
8 changed files with 1084 additions and 218 deletions

View File

@ -1,3 +1 @@
import * as plugins from './smartbucket.plugins';
export let standardExport = 'Hi there! :) This is an exported string';

View File

@ -0,0 +1,31 @@
import * as plugins from './smartbucket.plugins';
export interface ISmartBucketConfig {
provider: 'google';
projectId: string;
bucketName: string;
};
export class SmartBucket {
config: ISmartBucketConfig;
private _googleBucket
/**
* the constructor of SmartBucket
*/
constructor(configArg: ISmartBucketConfig) {
this.config = configArg;
}
/**
* initializes the Smartbucket
*/
async init() {
if(this.config.provider === 'google') {
const storage = new plugins.googleCloudStorage.Storage({
projectId: this.config.projectId,
})
storage.createBucket(this.config.bucketName, () => {})
}
}
}

View File

@ -1,4 +1,7 @@
const removeme = {};
import * as googleCloudStorage from '@google-cloud/storage';
import * as smartpromise from '@pushrocks/smartpromise';
export {
removeme
googleCloudStorage,
smartpromise
}