UNPKG

@mbc-cqrs-serverless/import

Version:
26 lines (25 loc) 1.09 kB
import { IEventHandler, S3Service, StepFunctionService } from '@mbc-cqrs-serverless/core'; import { ConfigService } from '@nestjs/config'; import { ImportService } from '../import.service'; import { ImportQueueEvent } from './import.queue.event'; export declare class ZipImportQueueEventHandler implements IEventHandler<ImportQueueEvent> { private readonly configService; private readonly sfnService; private readonly importService; private readonly s3Service; private readonly logger; private readonly zipOrchestratorArn; constructor(configService: ConfigService, sfnService: StepFunctionService, importService: ImportService, s3Service: S3Service); execute(event: ImportQueueEvent): Promise<any>; private getS3Stream; /** * Helper function to convert a Readable stream into a Buffer. * Required for yauzl, which operates on a complete data source. */ private streamToBuffer; /** * Re-implemented using the `jszip` library, which is more tolerant * of malformed ZIP archives. */ private unzipAndUpload; }