tt-uploader 1.2.1 → 1.3.0-bata.0
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/imagex-encrypt.js +1 -0
- package/package.json +4 -23
- package/types/index.d.ts +15 -18
- package/README.md +0 -0
- package/dist/plugins/imagexEncrypt.js +0 -24
package/package.json
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tt-uploader",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0-bata.0",
|
|
4
4
|
"description": "upload component for veVod and veImageX",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "./types/index.d.ts",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"build": "rm -rf dist && npm run build-umd",
|
|
10
|
-
"demo": "NODE_ENV=development webpack --config webpack.config.js --watch --devtool eval-cheap-module-source-map",
|
|
11
|
-
"test": "jest --no-cache",
|
|
12
|
-
"prepublish": "npm run build",
|
|
13
|
-
"beta": "npm publish --tag beta"
|
|
7
|
+
"libd": {
|
|
8
|
+
"umdName": "TTUploader"
|
|
14
9
|
},
|
|
15
10
|
"files": [
|
|
16
11
|
"dist",
|
|
@@ -20,23 +15,9 @@
|
|
|
20
15
|
"registry": "https://registry.npmjs.org"
|
|
21
16
|
},
|
|
22
17
|
"license": "MIT",
|
|
23
|
-
"devDependencies": {
|
|
24
|
-
"@babel/core": "^7.6.4",
|
|
25
|
-
"@babel/plugin-proposal-class-properties": "^7.5.5",
|
|
26
|
-
"@babel/plugin-transform-object-assign": "^7.2.0",
|
|
27
|
-
"@babel/preset-env": "^7.6.3",
|
|
28
|
-
"babel-eslint": "^10.0.3",
|
|
29
|
-
"babel-loader": "^8.0.6",
|
|
30
|
-
"eslint": "^6.8.0",
|
|
31
|
-
"jest": "^24.9.0",
|
|
32
|
-
"uglifyjs-webpack-plugin": "^2.2.0",
|
|
33
|
-
"webpack": "^5.86.0",
|
|
34
|
-
"webpack-cli": "^5.1.4",
|
|
35
|
-
"worker-loader": "^2.0.0"
|
|
36
|
-
},
|
|
37
18
|
"dependencies": {
|
|
38
19
|
"crypto-js": "^4.1.1",
|
|
39
|
-
"
|
|
20
|
+
"eventemitter3": "^5.0.1",
|
|
40
21
|
"jsrsasign": "^10.8.6"
|
|
41
22
|
}
|
|
42
23
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -30,33 +30,30 @@ export interface ObjectConfig {
|
|
|
30
30
|
processAction?: Action[]
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export interface
|
|
33
|
+
export interface InitConfig {
|
|
34
34
|
userId: string
|
|
35
35
|
appId: number
|
|
36
|
-
region?: 'cn-north-1' | 'us-east-1' | 'ap-singapore-1'
|
|
37
36
|
videoConfig?: VideoConfig
|
|
38
37
|
imageConfig?: ImageConfig
|
|
39
38
|
useLocalStorage?: boolean
|
|
40
39
|
useFileExtension?: boolean
|
|
41
40
|
noLog?: boolean
|
|
42
41
|
useServerCurrentTime?: boolean
|
|
42
|
+
taskParallelLimit?: number
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
export interface UpdateOptions {
|
|
46
46
|
userId?: string
|
|
47
47
|
appId?: number
|
|
48
|
-
region?: 'cn-north-1' | 'us-east-1' | 'ap-singapore-1'
|
|
49
48
|
videoConfig?: VideoConfig
|
|
50
49
|
imageConfig?: ImageConfig
|
|
51
50
|
useFileExtension?: boolean
|
|
52
51
|
useLocalStorage?: boolean
|
|
53
52
|
}
|
|
54
|
-
|
|
55
|
-
export interface FileOption {
|
|
53
|
+
export interface VodFileOption {
|
|
56
54
|
file: Blob
|
|
57
55
|
stsToken: STSToken
|
|
58
|
-
|
|
59
|
-
type?: 'video' | 'image' | 'object' | 'media'
|
|
56
|
+
type: 'video' | 'image' | 'object' | 'media'
|
|
60
57
|
callbackArgs?: string
|
|
61
58
|
fileName?: string
|
|
62
59
|
fileExtension?: string
|
|
@@ -64,27 +61,26 @@ export interface FileOption {
|
|
|
64
61
|
processAction?: Action[]
|
|
65
62
|
}
|
|
66
63
|
|
|
67
|
-
export interface
|
|
64
|
+
export interface ImageXFileOption {
|
|
68
65
|
file: Blob | Blob[]
|
|
69
66
|
stsToken: STSToken
|
|
70
67
|
storeKey?: string | string[]
|
|
71
|
-
type?: 'image' | 'object'
|
|
72
68
|
prefix?: string
|
|
73
69
|
skipMeta?: boolean
|
|
74
70
|
skipCommit?: boolean
|
|
75
71
|
serviceId?: string
|
|
76
|
-
|
|
77
|
-
overwrite?: Boolean
|
|
72
|
+
overwrite?: boolean
|
|
78
73
|
}
|
|
79
74
|
|
|
80
75
|
|
|
81
76
|
|
|
82
77
|
export default class TTUploader {
|
|
83
|
-
constructor(options:
|
|
78
|
+
constructor(options: InitConfig)
|
|
84
79
|
setOption(options: UpdateOptions): void
|
|
85
|
-
addFile(
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
addFile(options: VodFileOption): string
|
|
81
|
+
addVodFile(option: VodFileOption): string
|
|
82
|
+
addImageFile(option: ImageXFileOption): string
|
|
83
|
+
addImageXFile(option: ImageXFileOption): string
|
|
88
84
|
setServiceId(serviceId: string): string
|
|
89
85
|
getServiceId(): string
|
|
90
86
|
start(key?: string): void
|
|
@@ -92,8 +88,9 @@ export default class TTUploader {
|
|
|
92
88
|
pause(key?: string): void
|
|
93
89
|
cancel(key?: string): void
|
|
94
90
|
removeFile(key?: string): void
|
|
95
|
-
on(eventName: 'complete' | 'error' | 'progress', callback: (info:
|
|
96
|
-
once(eventName: 'complete' | 'error' | 'progress', callback: (info:
|
|
97
|
-
removeListener(eventName: 'complete' | 'error' | 'progress', callback: (info:
|
|
91
|
+
on(eventName: 'complete' | 'error' | 'progress', callback: (info: Record<string, any>) => void): void
|
|
92
|
+
once(eventName: 'complete' | 'error' | 'progress', callback: (info: Record<string, any>) => void): void
|
|
93
|
+
removeListener(eventName: 'complete' | 'error' | 'progress', callback: (info: Record<string, any>) => void): void
|
|
98
94
|
removeAllListeners(eventName: 'complete' | 'error' | 'progress'): void
|
|
95
|
+
use(plugin: any): void
|
|
99
96
|
}
|
package/README.md
DELETED
|
File without changes
|