update
This commit is contained in:
@ -1,3 +1 @@
|
||||
import * as plugins from './smartbucket.plugins';
|
||||
|
||||
export let standardExport = 'Hi there! :) This is an exported string';
|
||||
|
31
ts/smartbucket.classes.smartbucket.ts
Normal file
31
ts/smartbucket.classes.smartbucket.ts
Normal 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, () => {})
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,7 @@
|
||||
const removeme = {};
|
||||
import * as googleCloudStorage from '@google-cloud/storage';
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
|
||||
export {
|
||||
removeme
|
||||
googleCloudStorage,
|
||||
smartpromise
|
||||
}
|
||||
|
Reference in New Issue
Block a user