@ccci/micro-server 1.0.134 → 1.0.136
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +30799 -87
- package/dist/utils/uploader-s3.d.ts +58 -0
- package/package.json +2 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ApplicationOptionType } from "@/types/ApplicationOptionType";
|
|
3
|
+
import { S3 } from "@aws-sdk/client-s3";
|
|
4
|
+
export default class UploaderS3 {
|
|
5
|
+
static client: S3;
|
|
6
|
+
static uploadSessions: Record<string, string>;
|
|
7
|
+
/**
|
|
8
|
+
* Initializes the S3 client instance
|
|
9
|
+
*/
|
|
10
|
+
static init(options: ApplicationOptionType): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Validates configuration options
|
|
13
|
+
*/
|
|
14
|
+
static hasValidConfig(options: ApplicationOptionType): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Lists all available S3 buckets
|
|
17
|
+
*/
|
|
18
|
+
static listBuckets(): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Starts a new multipart upload session
|
|
21
|
+
* @param bucketName S3 bucket name
|
|
22
|
+
* @param key Key for the object in S3
|
|
23
|
+
*/
|
|
24
|
+
static startMultipartUpload(bucketName: string, key: string): Promise<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Uploads a file part to S3
|
|
27
|
+
* @param bucketName S3 bucket name
|
|
28
|
+
* @param key Key for the object in S3
|
|
29
|
+
* @param uploadId Multipart upload session ID
|
|
30
|
+
* @param partNumber Part number for the upload
|
|
31
|
+
* @param chunk Chunk of the file to upload
|
|
32
|
+
*/
|
|
33
|
+
static uploadPart(bucketName: string, key: string, uploadId: string, partNumber: number, chunk: Buffer): Promise<string | null>;
|
|
34
|
+
/**
|
|
35
|
+
* Completes a multipart upload
|
|
36
|
+
* @param bucketName S3 bucket name
|
|
37
|
+
* @param key Key for the object in S3
|
|
38
|
+
* @param uploadId Multipart upload session ID
|
|
39
|
+
* @param parts List of uploaded parts
|
|
40
|
+
*/
|
|
41
|
+
static completeMultipartUpload(bucketName: string, key: string, uploadId: string, parts: {
|
|
42
|
+
PartNumber: number;
|
|
43
|
+
ETag: string;
|
|
44
|
+
}[]): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Aborts a multipart upload
|
|
47
|
+
* @param bucketName S3 bucket name
|
|
48
|
+
* @param key Key for the object in S3
|
|
49
|
+
* @param uploadId Multipart upload session ID
|
|
50
|
+
*/
|
|
51
|
+
static abortMultipartUpload(bucketName: string, key: string, uploadId: string): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Deletes all incomplete multipart uploads in the specified bucket
|
|
54
|
+
* @param bucketName S3 bucket name
|
|
55
|
+
*/
|
|
56
|
+
static deleteIncompleteUploads(bucketName: string): Promise<void>;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=uploader-s3.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ccci/micro-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.136",
|
|
4
4
|
"module": "index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"helmet": "^7.1.0",
|
|
45
45
|
"jsonwebtoken": "^9.0.2",
|
|
46
46
|
"minio": "^8.0.0",
|
|
47
|
+
"@aws-sdk/client-s3": "^3.699.0",
|
|
47
48
|
"nodemailer": "^6.9.13",
|
|
48
49
|
"pg": "^8.11.5",
|
|
49
50
|
"pg-hstore": "^2.3.4",
|