@adminforth/upload 1.0.30 → 1.0.31-next.1
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 +3 -0
- package/index.ts +11 -7
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -45,6 +45,9 @@ export default class UploadPlugin extends AdminForthPlugin {
|
|
|
45
45
|
}
|
|
46
46
|
catch (e) {
|
|
47
47
|
if (e.name !== 'NoSuchLifecycleConfiguration') {
|
|
48
|
+
console.error(`
|
|
49
|
+
⛔ Error getting lifecycle configuration, please check keys have permissions to
|
|
50
|
+
getBucketLifecycleConfiguration on bucket ${this.options.s3Bucket} in region ${this.options.s3Region}. Exception:`, e);
|
|
48
51
|
throw e;
|
|
49
52
|
}
|
|
50
53
|
else {
|
package/index.ts
CHANGED
|
@@ -25,14 +25,15 @@ export default class UploadPlugin extends AdminForthPlugin {
|
|
|
25
25
|
async setupLifecycleRule() {
|
|
26
26
|
// check that lifecyle rule "adminforth-unused-cleaner" exists
|
|
27
27
|
const CLEANUP_RULE_ID = 'adminforth-unused-cleaner';
|
|
28
|
-
const s3 = new S3({
|
|
29
|
-
credentials: {
|
|
30
|
-
accessKeyId: this.options.s3AccessKeyId,
|
|
31
|
-
secretAccessKey: this.options.s3SecretAccessKey,
|
|
32
|
-
},
|
|
33
28
|
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
const s3 = new S3({
|
|
30
|
+
credentials: {
|
|
31
|
+
accessKeyId: this.options.s3AccessKeyId,
|
|
32
|
+
secretAccessKey: this.options.s3SecretAccessKey,
|
|
33
|
+
},
|
|
34
|
+
region: this.options.s3Region,
|
|
35
|
+
});
|
|
36
|
+
|
|
36
37
|
// check bucket exists
|
|
37
38
|
const bucketExists = s3.headBucket({ Bucket: this.options.s3Bucket })
|
|
38
39
|
if (!bucketExists) {
|
|
@@ -47,6 +48,9 @@ export default class UploadPlugin extends AdminForthPlugin {
|
|
|
47
48
|
ruleExists = lifecycleConfig.Rules.some((rule: any) => rule.ID === CLEANUP_RULE_ID);
|
|
48
49
|
} catch (e: any) {
|
|
49
50
|
if (e.name !== 'NoSuchLifecycleConfiguration') {
|
|
51
|
+
console.error(`
|
|
52
|
+
⛔ Error getting lifecycle configuration, please check keys have permissions to
|
|
53
|
+
getBucketLifecycleConfiguration on bucket ${this.options.s3Bucket} in region ${this.options.s3Region}. Exception:`, e);
|
|
50
54
|
throw e;
|
|
51
55
|
} else {
|
|
52
56
|
ruleExists = false;
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminforth/upload",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.31-next.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"rollout": "tsc && rsync -av --exclude 'node_modules' custom dist/ && npm version patch && npm publish --access public",
|
|
9
9
|
"prepare": "npm link adminforth",
|
|
10
|
+
"rollout-next": "npm run build && npm version prerelease --preid=next && npm publish --tag next",
|
|
10
11
|
"build": "tsc"
|
|
11
12
|
},
|
|
12
13
|
"type": "module",
|