Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
d9e80caa6f | |||
e44b7875e6 | |||
52bad357fe | |||
3ffc38dac5 |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@pushrocks/smarts3",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.5",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@pushrocks/smarts3",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.5",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pushrocks/smartfile": "^9.0.3",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smarts3",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.5",
|
||||
"private": false,
|
||||
"description": "create an s3 endpoint that maps to a local directory",
|
||||
"main": "dist_ts/index.js",
|
||||
@ -15,7 +15,6 @@
|
||||
"@gitzone/tsbuild": "^2.1.25",
|
||||
"@gitzone/tsbundle": "^1.0.78",
|
||||
"@gitzone/tstest": "^1.0.44",
|
||||
"@pushrocks/smartbucket": "^1.0.44",
|
||||
"@pushrocks/tapbundle": "^3.2.9",
|
||||
"@types/node": "^17.0.0",
|
||||
"tslint": "^6.1.3",
|
||||
@ -37,6 +36,7 @@
|
||||
"readme.md"
|
||||
],
|
||||
"dependencies": {
|
||||
"@pushrocks/smartbucket": "^1.0.44",
|
||||
"@pushrocks/smartfile": "^9.0.3",
|
||||
"@types/s3rver": "^3.7.0",
|
||||
"s3rver": "^3.7.1"
|
||||
|
20
ts/index.ts
20
ts/index.ts
@ -8,10 +8,20 @@ export interface ISmarts3ContructorOptions {
|
||||
|
||||
export class Smarts3 {
|
||||
public options: ISmarts3ContructorOptions;
|
||||
public dataForClient = {
|
||||
s3AccessKey: 'S3RVER',
|
||||
s3AccessSecret: 'S3RVER',
|
||||
port: 3000,
|
||||
useSsl: false
|
||||
}
|
||||
public s3Instance: plugins.s3rver;
|
||||
|
||||
constructor(optionsArg: ISmarts3ContructorOptions) {
|
||||
this.options = optionsArg;
|
||||
this.options = {
|
||||
...this.options,
|
||||
...optionsArg
|
||||
}
|
||||
}
|
||||
|
||||
public async start() {
|
||||
@ -30,6 +40,16 @@ export class Smarts3 {
|
||||
console.log('s3 server is running');
|
||||
}
|
||||
|
||||
public async getLocalS3Descriptor(): Promise<plugins.smartbucket.ISmartBucketConfig> {
|
||||
return {
|
||||
accessKey: this.dataForClient.s3AccessKey,
|
||||
accessSecret: this.dataForClient.s3AccessSecret,
|
||||
endpoint: 'localhost',
|
||||
port: this.dataForClient.port,
|
||||
useSsl: this.dataForClient.useSsl,
|
||||
}
|
||||
}
|
||||
|
||||
public async stop() {
|
||||
await this.s3Instance.close();
|
||||
}
|
||||
|
@ -6,10 +6,12 @@ export {
|
||||
}
|
||||
|
||||
// pushrocks scope
|
||||
import * as samrtfile from '@pushrocks/smartfile';
|
||||
import * as smartbucket from '@pushrocks/smartbucket';
|
||||
import * as smartfile from '@pushrocks/smartfile';
|
||||
|
||||
export {
|
||||
samrtfile as smartfile
|
||||
smartbucket,
|
||||
smartfile,
|
||||
}
|
||||
|
||||
// thirdparty scope
|
||||
|
Reference in New Issue
Block a user