@dotcom-tool-kit/upload-assets-to-s3 3.1.4 → 3.1.6
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,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,QAAQ,EAAoB,MAAM,oBAAoB,CAAA;AAM/D,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,uDAAuD,CAAA;AAE9D,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,IAAI,CAAC,OAAO,sBAAsB,CAAC;IAC/E,MAAM,CAAC,WAAW,SAAK;IAEjB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAGpB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,EAAE,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAiDvF,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
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,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,QAAQ,EAAoB,MAAM,oBAAoB,CAAA;AAM/D,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,uDAAuD,CAAA;AAE9D,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,IAAI,CAAC,OAAO,sBAAsB,CAAC;IAC/E,MAAM,CAAC,WAAW,SAAK;IAEjB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAGpB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,EAAE,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAiDvF,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;CAiCxE"}
|
|
@@ -69,16 +69,24 @@ class UploadAssetsToS3 extends types_1.Task {
|
|
|
69
69
|
if (files.length === 0) {
|
|
70
70
|
throw new error_1.ToolKitError(`no files found at the provided directory: ${options.directory}`);
|
|
71
71
|
}
|
|
72
|
+
// HACK:20231006:IM Doppler doesn't support secrets with lowercase
|
|
73
|
+
// characters so let's check if the provided AWS environment variable name
|
|
74
|
+
// is available in all caps as will be the case when running our migration
|
|
75
|
+
// script.
|
|
76
|
+
const checkUppercaseName = (envName) => {
|
|
77
|
+
return process.env[envName] ?? process.env[envName.toUpperCase()];
|
|
78
|
+
};
|
|
72
79
|
const s3 = new client_s3_1.S3Client({
|
|
73
80
|
region: options.region,
|
|
74
|
-
// fallback to default value for accessKeyId if neither
|
|
81
|
+
// will fallback to default value for accessKeyId if neither
|
|
82
|
+
// accessKeyIdEnvVar nor accessKeyId have been provided as options
|
|
75
83
|
credentials: {
|
|
76
84
|
accessKeyId:
|
|
77
|
-
|
|
78
|
-
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
86
|
+
checkUppercaseName(options.accessKeyIdEnvVar ?? options.accessKeyId),
|
|
79
87
|
secretAccessKey:
|
|
80
|
-
|
|
81
|
-
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
89
|
+
checkUppercaseName(options.secretAccessKeyEnvVar ?? options.secretAccessKey)
|
|
82
90
|
}
|
|
83
91
|
});
|
|
84
92
|
await Promise.all(files.map((file) => this.uploadFile(file, options, s3)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotcom-tool-kit/upload-assets-to-s3",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib",
|
|
6
6
|
"scripts": {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@aws-sdk/client-s3": "^3.256.0",
|
|
14
14
|
"@dotcom-tool-kit/error": "^3.1.0",
|
|
15
|
-
"@dotcom-tool-kit/logger": "^3.
|
|
16
|
-
"@dotcom-tool-kit/types": "^3.4.
|
|
15
|
+
"@dotcom-tool-kit/logger": "^3.3.0",
|
|
16
|
+
"@dotcom-tool-kit/types": "^3.4.1",
|
|
17
17
|
"glob": "^7.1.6",
|
|
18
18
|
"mime": "^2.5.2",
|
|
19
19
|
"tslib": "^2.3.1"
|