@moonset/util
Version:
30 lines (29 loc) • 963 B
TypeScript
import * as S3 from 'aws-sdk/clients/s3';
import { ISDK } from './sdk-utils';
/**
* A SDK based S3 Asset uploader.
*
* We don't use CDK way since CloudFormation stacks have limitations (200 by
* default) and not suitable for high throughput requests. More context can be
* found here: https://github.com/MoonsetJS/Moonset/issues/73
*/
export declare class S3AssetUploader {
private bucket;
private prefix;
private moonsetSession;
private moonsetId;
private sdk;
/**
* Setting the S3 bucket and Moonset related information.
* Every asset will be tagged with its Moonset session and Moonset id.
*/
constructor(bucket: string, prefix: string, moonsetSession: string, moonsetId: string, sdk: ISDK);
/**
* Upload local file to S3.
*/
uploadFile(file: string): Promise<string>;
/**
* Upload string type data to S3.
*/
uploadData(body: S3.Types.Body): Promise<string>;
}