@dotcom-tool-kit/upload-assets-to-s3 4.3.1 → 4.3.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"upload-assets-to-s3.d.ts","sourceRoot":"","sources":["../../src/tasks/upload-assets-to-s3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE5D,OAAO,EAAE,QAAQ,EAAoB,MAAM,oBAAoB,CAAA;AAM/D,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDa,CAAA;AAChD,OAAO,EAAE,sBAAsB,IAAI,MAAM,EAAE,CAAA;AAE3C,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,IAAI,CAAC;IAAE,IAAI,EAAE,OAAO,sBAAsB,CAAA;CAAE,CAAC;IACnF,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAkDrD,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAyClD"}
1
+ {"version":3,"file":"upload-assets-to-s3.d.ts","sourceRoot":"","sources":["../../src/tasks/upload-assets-to-s3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE5D,OAAO,EAAE,QAAQ,EAAgD,MAAM,oBAAoB,CAAA;AAM3F,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDa,CAAA;AAChD,OAAO,EAAE,sBAAsB,IAAI,MAAM,EAAE,CAAA;AAE3C,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,IAAI,CAAC;IAAE,IAAI,EAAE,OAAO,sBAAsB,CAAA;CAAE,CAAC;IACnF,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAmCrD,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAyClD"}
@@ -64,9 +64,9 @@ class UploadAssetsToS3 extends base_1.Task {
64
64
  const bucketByEnv = process.env.NODE_ENV === 'branch' ? this.options.reviewBucket : this.options.prodBucket;
65
65
  let currentBucket = '';
66
66
  try {
67
- if (typeof bucketByEnv === 'string') {
67
+ for (const bucket of bucketByEnv) {
68
68
  const params = {
69
- Bucket: bucketByEnv,
69
+ Bucket: bucket,
70
70
  Key: key,
71
71
  Body: body,
72
72
  ACL: 'public-read',
@@ -78,22 +78,6 @@ class UploadAssetsToS3 extends base_1.Task {
78
78
  await s3.send(new client_s3_1.PutObjectCommand(params));
79
79
  this.logger.info(`Uploaded ${logger_1.styles.filepath(filepath)} to ${logger_1.styles.URL(currentBucket)}`);
80
80
  }
81
- else {
82
- for (const bucket of bucketByEnv) {
83
- const params = {
84
- Bucket: bucket,
85
- Key: key,
86
- Body: body,
87
- ACL: 'public-read',
88
- ContentType: `${type}; charset=utf-8`,
89
- ContentEncoding: encoding,
90
- CacheControl: this.options.cacheControl
91
- };
92
- currentBucket = params.Bucket;
93
- await s3.send(new client_s3_1.PutObjectCommand(params));
94
- this.logger.info(`Uploaded ${logger_1.styles.filepath(filepath)} to ${logger_1.styles.URL(currentBucket)}`);
95
- }
96
- }
97
81
  }
98
82
  catch (err) {
99
83
  const error = new error_1.ToolKitError(`Upload of ${filepath} to ${currentBucket} failed`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotcom-tool-kit/upload-assets-to-s3",
3
- "version": "4.3.1",
3
+ "version": "4.3.3",
4
4
  "description": "",
5
5
  "main": "lib",
6
6
  "scripts": {
@@ -10,10 +10,10 @@
10
10
  "author": "FT.com Platforms Team <platforms-team.customer-products@ft.com>",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@aws-sdk/client-s3": "^3.256.0",
14
- "@dotcom-tool-kit/base": "^1.2.0",
13
+ "@aws-sdk/client-s3": "^3.782.0",
14
+ "@dotcom-tool-kit/base": "^1.2.1",
15
15
  "@dotcom-tool-kit/error": "^4.1.0",
16
- "@dotcom-tool-kit/logger": "^4.1.1",
16
+ "@dotcom-tool-kit/logger": "^4.2.0",
17
17
  "glob": "^7.1.6",
18
18
  "mime": "^2.5.2",
19
19
  "tslib": "^2.3.1",
@@ -27,7 +27,6 @@
27
27
  "bugs": "https://github.com/financial-times/dotcom-tool-kit/issues",
28
28
  "homepage": "https://github.com/financial-times/dotcom-tool-kit/tree/main/plugins/upload-assets-to-s3",
29
29
  "devDependencies": {
30
- "@aws-sdk/types": "^3.13.1",
31
30
  "@jest/globals": "^27.4.6",
32
31
  "@types/glob": "^7.1.3",
33
32
  "@types/jest": "^27.4.0",