@orion-js/file-manager 2.6.16 → 2.7.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.
|
@@ -9,7 +9,9 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _app = require("@orion-js/app");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _clientS = require("@aws-sdk/client-s3");
|
|
13
|
+
|
|
14
|
+
var _s3PresignedPost = require("@aws-sdk/s3-presigned-post");
|
|
13
15
|
|
|
14
16
|
var _credentials = require("../credentials");
|
|
15
17
|
|
|
@@ -55,10 +57,12 @@ var _default = (0, _app.resolver)({
|
|
|
55
57
|
canUpload,
|
|
56
58
|
basePath
|
|
57
59
|
} = (0, _credentials.getAWSCredentials)();
|
|
58
|
-
const s3 = new
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
const s3 = new _clientS.S3Client({
|
|
61
|
+
region,
|
|
62
|
+
credentials: {
|
|
63
|
+
accessKeyId,
|
|
64
|
+
secretAccessKey
|
|
65
|
+
}
|
|
62
66
|
});
|
|
63
67
|
|
|
64
68
|
if (canUpload) {
|
|
@@ -76,21 +80,17 @@ var _default = (0, _app.resolver)({
|
|
|
76
80
|
createdBy: viewer.userId,
|
|
77
81
|
createdAt: new Date()
|
|
78
82
|
});
|
|
79
|
-
const result = await
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
}, function (error, data) {
|
|
92
|
-
if (error) reject(error);else resolve(data);
|
|
93
|
-
});
|
|
83
|
+
const result = await (0, _s3PresignedPost.createPresignedPost)(s3, {
|
|
84
|
+
Bucket: bucket,
|
|
85
|
+
Conditions: [['content-length-range', params.size, params.size], {
|
|
86
|
+
'Content-Type': params.type
|
|
87
|
+
}, {
|
|
88
|
+
Key: key
|
|
89
|
+
}],
|
|
90
|
+
Fields: {
|
|
91
|
+
key: key,
|
|
92
|
+
'Content-Type': params.type
|
|
93
|
+
}
|
|
94
94
|
});
|
|
95
95
|
return {
|
|
96
96
|
fileId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orion-js/file-manager",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"author": "nicolaslopezj",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"test": "exit 0"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"aws-sdk": "^
|
|
14
|
+
"@aws-sdk/client-s3": "^3.682.0",
|
|
15
|
+
"@aws-sdk/s3-presigned-post": "^3.682.0",
|
|
15
16
|
"lodash": "^4.17.10",
|
|
16
17
|
"luxon": "^1.2.0"
|
|
17
18
|
},
|
|
@@ -21,7 +22,7 @@
|
|
|
21
22
|
"@babel/plugin-transform-runtime": "^7.5.5",
|
|
22
23
|
"@babel/preset-env": "^7.5.5",
|
|
23
24
|
"@babel/runtime": "^7.5.5",
|
|
24
|
-
"@orion-js/app": "^2.
|
|
25
|
+
"@orion-js/app": "^2.7.0",
|
|
25
26
|
"babel-jest": "^22.4.3",
|
|
26
27
|
"jest": "^22.4.3"
|
|
27
28
|
},
|
|
@@ -31,5 +32,5 @@
|
|
|
31
32
|
"publishConfig": {
|
|
32
33
|
"access": "public"
|
|
33
34
|
},
|
|
34
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "b6a9c4ad6b924ab3bf71b8dcd8bd7d7b9f274e4a"
|
|
35
36
|
}
|