ember-cli-deploy-s3-index 4.0.1 → 4.0.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.
- package/.eslintrc.js +1 -1
- package/CHANGELOG.md +18 -0
- package/lib/s3.js +14 -19
- package/package.json +1 -1
package/.eslintrc.js
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## 4.0.3 (2024-05-02)
|
|
8
|
+
|
|
9
|
+
#### :bug: Bug Fix
|
|
10
|
+
* [#143](https://github.com/ember-cli-deploy/ember-cli-deploy-s3-index/pull/143) Handle NotFound S3 Response ([@jrjohnson](https://github.com/jrjohnson))
|
|
11
|
+
|
|
12
|
+
#### Committers: 1
|
|
13
|
+
- Jon Johnson ([@jrjohnson](https://github.com/jrjohnson))
|
|
14
|
+
|
|
15
|
+
## 4.0.2 (2024-04-05)
|
|
16
|
+
|
|
17
|
+
#### :bug: Bug Fix
|
|
18
|
+
* [#142](https://github.com/ember-cli-deploy/ember-cli-deploy-s3-index/pull/142) Handle empty s3 response ([@jrjohnson](https://github.com/jrjohnson))
|
|
19
|
+
|
|
20
|
+
#### Committers: 1
|
|
21
|
+
- Jon Johnson ([@jrjohnson](https://github.com/jrjohnson))
|
|
22
|
+
|
|
5
23
|
## 4.0.1 (2024-04-03)
|
|
6
24
|
|
|
7
25
|
#### :rocket: Enhancement
|
package/lib/s3.js
CHANGED
|
@@ -9,20 +9,15 @@ var readFile = RSVP.denodeify(fs.readFile);
|
|
|
9
9
|
var mime = require('mime-types');
|
|
10
10
|
var joinUriSegments = require('./util/join-uri-segments');
|
|
11
11
|
|
|
12
|
-
function headObject(client, params) {
|
|
13
|
-
|
|
14
|
-
client.headObject(params
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
else {
|
|
22
|
-
return resolve(data);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
});
|
|
12
|
+
async function headObject(client, params) {
|
|
13
|
+
try {
|
|
14
|
+
return await client.headObject(params);
|
|
15
|
+
} catch (err) {
|
|
16
|
+
if (err.name === 'NotFound') {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
throw err;
|
|
20
|
+
}
|
|
26
21
|
}
|
|
27
22
|
|
|
28
23
|
module.exports = CoreObject.extend({
|
|
@@ -37,7 +32,7 @@ module.exports = CoreObject.extend({
|
|
|
37
32
|
this._plugin = plugin;
|
|
38
33
|
|
|
39
34
|
var providedS3Client = plugin.readConfig("s3Client");
|
|
40
|
-
|
|
35
|
+
|
|
41
36
|
|
|
42
37
|
if (profile && !providedS3Client) {
|
|
43
38
|
this._plugin.log("Using AWS profile from config", { verbose: true });
|
|
@@ -45,18 +40,18 @@ module.exports = CoreObject.extend({
|
|
|
45
40
|
}
|
|
46
41
|
|
|
47
42
|
if (endpoint) {
|
|
48
|
-
this._plugin.log('Using endpoint from config', { verbose: true });
|
|
43
|
+
this._plugin.log('Using endpoint from config', { verbose: true });
|
|
49
44
|
}
|
|
50
45
|
|
|
51
46
|
this._client = providedS3Client || new S3(config);
|
|
52
|
-
|
|
47
|
+
|
|
53
48
|
if (endpoint) {
|
|
54
49
|
this._client.config.endpoint = endpoint;
|
|
55
50
|
}
|
|
56
51
|
if (credentials) {
|
|
57
52
|
this._client.config.credentials = credentials;
|
|
58
53
|
}
|
|
59
|
-
|
|
54
|
+
|
|
60
55
|
},
|
|
61
56
|
|
|
62
57
|
upload: function(options) {
|
|
@@ -166,7 +161,7 @@ module.exports = CoreObject.extend({
|
|
|
166
161
|
var revisionPrefix = joinUriSegments(prefix, options.filePattern + ":" + options.revisionKey);
|
|
167
162
|
|
|
168
163
|
return listObjects({ Bucket: bucket, Prefix: revisionPrefix })
|
|
169
|
-
.then((response) => response.Contents
|
|
164
|
+
.then((response) => response.Contents?.find((element) => element.Key === revisionPrefix));
|
|
170
165
|
},
|
|
171
166
|
|
|
172
167
|
fetchRevisions: function(options) {
|