1 | import { Nest } from "./nest";
|
2 | import { FileJob } from "./../job/fileJob";
|
3 | import { Environment } from "../environment/environment";
|
4 | export declare class S3Nest extends Nest {
|
5 | protected client: any;
|
6 | protected s3: any;
|
7 | protected bucket: string;
|
8 | protected keyPrefix: string;
|
9 | protected checkEvery: number;
|
10 | protected checkEveryMs: number;
|
11 | protected allowCreation: boolean;
|
12 | |
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | constructor(e: Environment, bucket: string, keyPrefix?: string, checkEvery?: number, allowCreation?: boolean);
|
21 | /**
|
22 | * Set hard-coded AWS credentials.
|
23 | * @param accessKeyId
|
24 | * @param secretAccessKey
|
25 | */
|
26 | setCredentials(accessKeyId: string, secretAccessKey: string): void;
|
27 | /**
|
28 | * Verify bucket and handle creation of bucket if need be.
|
29 | */
|
30 | protected verifyBucket(): void;
|
31 | /**
|
32 | * Verify that the bucket is available and exists
|
33 | * @param callback
|
34 | */
|
35 | protected headBucket(callback: any): void;
|
36 | protected createBucket(callback: any): void;
|
37 | load(): void;
|
38 | /**
|
39 | * Removes an object from an S3 bucket.
|
40 | * @param key
|
41 | */
|
42 | protected deleteObject(key: any): void;
|
43 | /**
|
44 | * Watch an S3 bucket.
|
45 | */
|
46 | watch(): void;
|
47 | /**
|
48 | * Nest arrival
|
49 | * @param job
|
50 | */
|
51 | arrive(job: FileJob): void;
|
52 | /**
|
53 | * Upload a file to an S3 bucket.
|
54 | */
|
55 | take(job: FileJob, callback?: any): void;
|
56 | /**
|
57 | * Calculate the percent remaining from the httpUploadProgress event values.
|
58 | * @param total
|
59 | * @param loaded
|
60 | * @param part
|
61 | * @returns {number}
|
62 | */
|
63 | private calculateRemaining(total, loaded, part?);
|
64 | |
65 |
|
66 |
|
67 |
|
68 |
|
69 | protected uploadFile(job: FileJob, callback: any): void;
|
70 | }
|