fix(core): update

This commit is contained in:
Philipp Kunz 2022-06-07 17:15:36 +02:00
parent 0430a35873
commit f3e2a8a4f2
7 changed files with 335 additions and 8654 deletions

8945
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -9,22 +9,21 @@
"license": "UNLICENSED", "license": "UNLICENSED",
"scripts": { "scripts": {
"test": "(tstest test/)", "test": "(tstest test/)",
"build": "(tsbuild --web)" "build": "(tsbuild --web --allowimplicitany)"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.61", "@gitzone/tsbuild": "^2.1.63",
"@gitzone/tstest": "^1.0.70", "@gitzone/tstest": "^1.0.71",
"@pushrocks/tapbundle": "^5.0.3", "@pushrocks/qenv": "^4.0.10",
"@pushrocks/qenv": "^4.0.10" "@pushrocks/tapbundle": "^5.0.3"
}, },
"dependencies": { "dependencies": {
"@pushrocks/smartpath": "^5.0.5", "@pushrocks/smartpath": "^5.0.5",
"@pushrocks/smartpromise": "^3.1.7", "@pushrocks/smartpromise": "^3.1.7",
"@pushrocks/smartrx": "^2.0.25", "@pushrocks/smartrx": "^2.0.25",
"@pushrocks/smartstream": "^2.0.1", "@pushrocks/smartstream": "^2.0.2",
"@pushrocks/streamfunction": "^3.0.4", "@types/minio": "^7.0.13",
"@types/minio": "^7.0.12", "minio": "^7.0.28"
"minio": "^7.0.26"
}, },
"private": false, "private": false,
"files": [ "files": [

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@pushrocks/smartbucket',
version: '2.0.2',
description: 'simple cloud independent object storage'
}

View File

@ -50,7 +50,7 @@ export class Bucket {
* store file * store file
*/ */
public async fastStore(pathArg: string, fileContent: string | Buffer): Promise<void> { public async fastStore(pathArg: string, fileContent: string | Buffer): Promise<void> {
const streamIntake = new plugins.streamfunction.Intake(); const streamIntake = new plugins.smartstream.StreamIntake();
const putPromise = this.smartbucketRef.minioClient const putPromise = this.smartbucketRef.minioClient
.putObject(this.name, pathArg, streamIntake.getReadable()) .putObject(this.name, pathArg, streamIntake.getReadable())
.catch((e) => console.log(e)); .catch((e) => console.log(e));
@ -91,7 +91,7 @@ export class Bucket {
.getObject(this.name, pathArg) .getObject(this.name, pathArg)
.catch((e) => console.log(e)); .catch((e) => console.log(e));
const replaySubject = new plugins.smartrx.rxjs.ReplaySubject<Buffer>(); const replaySubject = new plugins.smartrx.rxjs.ReplaySubject<Buffer>();
const duplexStream = plugins.streamfunction.createDuplexStream<Buffer, Buffer>( const duplexStream = plugins.smartstream.createDuplexStream<Buffer, Buffer>(
async (chunk) => { async (chunk) => {
replaySubject.next(chunk); replaySubject.next(chunk);
return chunk; return chunk;
@ -106,7 +106,7 @@ export class Bucket {
return null; return null;
} }
const smartstream = new plugins.smartstream.Smartstream([ const smartstream = new plugins.smartstream.StreamWrapper([
fileStream, fileStream,
duplexStream, duplexStream,
plugins.smartstream.cleanPipe(), plugins.smartstream.cleanPipe(),

View File

@ -70,7 +70,7 @@ export class Directory {
false false
); );
const fileArray: File[] = []; const fileArray: File[] = [];
const duplexStream = plugins.streamfunction.createDuplexStream<plugins.minio.BucketItem, void>( const duplexStream = plugins.smartstream.createDuplexStream<plugins.minio.BucketItem, void>(
async (bucketItem) => { async (bucketItem) => {
if (bucketItem.prefix) { if (bucketItem.prefix) {
return; return;
@ -107,7 +107,7 @@ export class Directory {
false false
); );
const directoryArray: Directory[] = []; const directoryArray: Directory[] = [];
const duplexStream = plugins.streamfunction.createDuplexStream<plugins.minio.BucketItem, void>( const duplexStream = plugins.smartstream.createDuplexStream<plugins.minio.BucketItem, void>(
async (bucketItem) => { async (bucketItem) => {
if (bucketItem.name) { if (bucketItem.name) {
return; return;

View File

@ -23,7 +23,7 @@ export class File {
fileContent: Buffer fileContent: Buffer
) { ) {
const filePath = plugins.path.join(directoryRef.getBasePath(), fileName); const filePath = plugins.path.join(directoryRef.getBasePath(), fileName);
const streamIntake = new plugins.streamfunction.Intake(); const streamIntake = new plugins.smartstream.StreamIntake();
const putPromise = directoryRef.bucketRef.smartbucketRef.minioClient const putPromise = directoryRef.bucketRef.smartbucketRef.minioClient
.putObject(this.name, filePath, streamIntake.getReadable()) .putObject(this.name, filePath, streamIntake.getReadable())
.catch((e) => console.log(e)); .catch((e) => console.log(e));
@ -54,8 +54,8 @@ export class File {
const fileStream = await this.parentDirectoryRef.bucketRef.smartbucketRef.minioClient const fileStream = await this.parentDirectoryRef.bucketRef.smartbucketRef.minioClient
.getObject(this.parentDirectoryRef.bucketRef.name, this.path) .getObject(this.parentDirectoryRef.bucketRef.name, this.path)
.catch((e) => console.log(e)); .catch((e) => console.log(e));
let completeFile = new Buffer(''); let completeFile = Buffer.from('');
const duplexStream = plugins.streamfunction.createDuplexStream<Buffer, Buffer>( const duplexStream = plugins.smartstream.createDuplexStream<Buffer, Buffer>(
async (chunk) => { async (chunk) => {
completeFile = Buffer.concat([chunk]); completeFile = Buffer.concat([chunk]);
return chunk; return chunk;

View File

@ -6,10 +6,9 @@ export { path };
import * as smartpath from '@pushrocks/smartpath'; import * as smartpath from '@pushrocks/smartpath';
import * as smartpromise from '@pushrocks/smartpromise'; import * as smartpromise from '@pushrocks/smartpromise';
import * as smartrx from '@pushrocks/smartrx'; import * as smartrx from '@pushrocks/smartrx';
import * as streamfunction from '@pushrocks/streamfunction';
import * as smartstream from '@pushrocks/smartstream'; import * as smartstream from '@pushrocks/smartstream';
export { smartpath, smartpromise, smartrx, streamfunction, smartstream }; export { smartpath, smartpromise, smartrx, smartstream };
// third party scope // third party scope
import * as minio from 'minio'; import * as minio from 'minio';