tt-uploader 1.0.26 → 1.0.28
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.js +1 -1
- package/dist/plugins/imagexEncrypt.js +24 -0
- package/package.json +8 -7
- package/types/index.d.ts +15 -12
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tt-uploader",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"description": "a upload component",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "./types/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build-umd": "webpack --config webpack.config.js --progress --color
|
|
8
|
+
"build-umd": "webpack --config webpack.config.js --progress --color",
|
|
9
9
|
"build": "rm -rf dist && npm run build-umd",
|
|
10
|
-
"demo": "NODE_ENV=development DEMO_TYPE=single webpack --config webpack.config.js --watch --devtool cheap-module-
|
|
10
|
+
"demo": "NODE_ENV=development DEMO_TYPE=single webpack --config webpack.config.js --watch --devtool eval-cheap-module-source-map",
|
|
11
11
|
"demo-multi": "NODE_ENV=development DEMO_TYPE=multi webpack --config webpack.config.js --watch --devtool cheap-module-eval-source-map",
|
|
12
12
|
"test": "jest --no-cache",
|
|
13
13
|
"prepublish": "npm run build",
|
|
@@ -31,13 +31,14 @@
|
|
|
31
31
|
"eslint": "^6.8.0",
|
|
32
32
|
"jest": "^24.9.0",
|
|
33
33
|
"uglifyjs-webpack-plugin": "^2.2.0",
|
|
34
|
-
"webpack": "^
|
|
35
|
-
"webpack-cli": "^
|
|
34
|
+
"webpack": "^5.86.0",
|
|
35
|
+
"webpack-cli": "^5.1.4",
|
|
36
36
|
"worker-loader": "^2.0.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"crypto-js": "^
|
|
40
|
-
"events": "^1.1.1"
|
|
39
|
+
"crypto-js": "^4.1.1",
|
|
40
|
+
"events": "^1.1.1",
|
|
41
|
+
"jsrsasign": "^10.8.6"
|
|
41
42
|
},
|
|
42
43
|
"jest": {
|
|
43
44
|
"testEnvironment": "node"
|
package/types/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface STSToken {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export interface Action {
|
|
10
|
-
name: 'GetMeta' | 'StartWorkflow' | 'Snapshot' | 'Encryption' | 'AddOptionInfo'
|
|
10
|
+
name: 'GetMeta' | 'StartWorkflow' | 'Snapshot' | 'Encryption' | 'AddOptionInfo'
|
|
11
11
|
input?: any
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -18,6 +18,11 @@ export interface VideoConfig {
|
|
|
18
18
|
|
|
19
19
|
export interface ImageConfig {
|
|
20
20
|
serviceId: string
|
|
21
|
+
imagexEnableEncrypt?: boolean,
|
|
22
|
+
// 数据加密密钥(256位)
|
|
23
|
+
imagexEncryptKey?: string,
|
|
24
|
+
// rsa公钥(pem格式规范)
|
|
25
|
+
imagexPublicKey?: string,
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
export interface ObjectConfig {
|
|
@@ -31,7 +36,7 @@ export interface Options {
|
|
|
31
36
|
region?: 'cn-north-1' | 'us-east-1' | 'ap-singapore-1'
|
|
32
37
|
videoConfig?: VideoConfig
|
|
33
38
|
imageConfig?: ImageConfig
|
|
34
|
-
|
|
39
|
+
useLocalStorage?: boolean
|
|
35
40
|
useFileExtension?: boolean
|
|
36
41
|
noLog?: boolean
|
|
37
42
|
}
|
|
@@ -42,7 +47,6 @@ export interface UpdateOptions {
|
|
|
42
47
|
region?: 'cn-north-1' | 'us-east-1' | 'ap-singapore-1'
|
|
43
48
|
videoConfig?: VideoConfig
|
|
44
49
|
imageConfig?: ImageConfig
|
|
45
|
-
|
|
46
50
|
useFileExtension?: boolean
|
|
47
51
|
useLocalStorage?: boolean
|
|
48
52
|
}
|
|
@@ -64,28 +68,27 @@ export interface ImageFileOption {
|
|
|
64
68
|
stsToken: STSToken
|
|
65
69
|
storeKey?: string | string[]
|
|
66
70
|
type?: 'image'
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
export interface ImageXMaterialOption {
|
|
71
|
-
file: Blob
|
|
72
|
-
stsToken: STSToken
|
|
73
|
-
storeKey?: string
|
|
71
|
+
prefix?: string
|
|
72
|
+
skipMeta?: boolean
|
|
73
|
+
skipCommit?: boolean
|
|
74
74
|
serviceId?: string
|
|
75
|
+
processAction?: Action[]
|
|
75
76
|
}
|
|
76
77
|
|
|
78
|
+
|
|
79
|
+
|
|
77
80
|
export default class TTUploader {
|
|
78
81
|
constructor(options: Options)
|
|
79
|
-
|
|
80
82
|
setOption(options: UpdateOptions): void
|
|
81
83
|
addFile(fileOption: FileOption): string
|
|
82
84
|
addImageFile(imageFileOption: ImageFileOption): string
|
|
83
|
-
addImageXMaterial(ImageXMaterialOption: ImageXMaterialOption): string
|
|
84
85
|
setServiceId(serviceId: string): string
|
|
85
86
|
getServiceId(): string
|
|
86
87
|
start(key?: string): void
|
|
88
|
+
restart(key?: string): void
|
|
87
89
|
pause(key?: string): void
|
|
88
90
|
cancel(key?: string): void
|
|
91
|
+
removeFile(key?: string): void
|
|
89
92
|
on(eventName: 'complete' | 'error' | 'progress', callback: (info: object) => void): void
|
|
90
93
|
once(eventName: 'complete' | 'error' | 'progress', callback: (info: object) => void): void
|
|
91
94
|
removeListener(eventName: 'complete' | 'error' | 'progress', callback: (info: object) => void): void
|