cdk-lambda-subminute 2.0.360 → 2.0.361

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.
@@ -20,7 +20,7 @@ AWS.util.update(AWS, {
20
20
  /**
21
21
  * @constant
22
22
  */
23
- VERSION: '2.1542.0',
23
+ VERSION: '2.1543.0',
24
24
 
25
25
  /**
26
26
  * @api private
@@ -119,6 +119,7 @@ AWS.util.update(AWS.S3.prototype, {
119
119
  * @api private
120
120
  */
121
121
  setupRequestListeners: function setupRequestListeners(request) {
122
+ request.addListener('validateResponse', this.setExpiresString);
122
123
  var prependListener = true;
123
124
  request.addListener('validate', this.validateScheme);
124
125
  request.addListener('validate', this.validateBucketName, prependListener);
@@ -1284,6 +1285,30 @@ AWS.util.update(AWS.S3.prototype, {
1284
1285
  var uploader = new AWS.S3.ManagedUpload(options);
1285
1286
  if (typeof callback === 'function') uploader.send(callback);
1286
1287
  return uploader;
1288
+ },
1289
+
1290
+ /**
1291
+ * @api private
1292
+ */
1293
+ setExpiresString: function setExpiresString(response) {
1294
+ // Check if response contains Expires value, and populate ExpiresString.
1295
+ if (response && response.httpResponse && response.httpResponse.headers) {
1296
+ if ('expires' in response.httpResponse.headers) {
1297
+ response.httpResponse.headers.expiresstring = response.httpResponse.headers.expires;
1298
+ }
1299
+ }
1300
+
1301
+ // Check if value in Expires is not a Date using parseTimestamp.
1302
+ try {
1303
+ if (response && response.httpResponse && response.httpResponse.headers) {
1304
+ if ('expires' in response.httpResponse.headers) {
1305
+ AWS.util.date.parseTimestamp(response.httpResponse.headers.expires);
1306
+ }
1307
+ }
1308
+ } catch (e) {
1309
+ console.log('AWS SDK', '(warning)', e);
1310
+ delete response.httpResponse.headers.expires;
1311
+ }
1287
1312
  }
1288
1313
  });
1289
1314
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aws-sdk",
3
3
  "description": "AWS SDK for JavaScript",
4
- "version": "2.1542.0",
4
+ "version": "2.1543.0",
5
5
  "author": {
6
6
  "name": "Amazon Web Services",
7
7
  "email": "",
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Sets model overrides for S3 ExpiresString.
3
+ */
4
+ module.exports = function setS3ExpiresString(model) {
5
+ if (model.metadata.serviceId === 'S3') {
6
+ var newShapes = {};
7
+ for (var shapeId in model.shapes) {
8
+ newShapes[shapeId] = model.shapes[shapeId];
9
+ if (shapeId === 'Expires') {
10
+ // preserve timestamp type for Expires.
11
+ newShapes[shapeId] = {};
12
+ newShapes[shapeId].type = 'timestamp';
13
+
14
+ // add ExpiresString
15
+ newShapes['ExpiresString'] = {
16
+ type: 'string'
17
+ };
18
+ }
19
+ }
20
+ model.shapes = newShapes;
21
+
22
+ for (var operationKey in model.operations) {
23
+ var op = model.operations[operationKey];
24
+ if (!op.output || !op.output.shape) {
25
+ continue;
26
+ }
27
+ var output = model.shapes[op.output.shape];
28
+ if (!output || !output.members) {
29
+ continue;
30
+ }
31
+ if ('Expires' in output.members) {
32
+ var newMembers = {};
33
+ for (var memberKey in output.members) {
34
+ newMembers[memberKey] = output.members[memberKey];
35
+ if (memberKey === 'Expires') {
36
+ newMembers['ExpiresString'] = Object.assign({}, newMembers[memberKey], {
37
+ 'shape': 'ExpiresString',
38
+ 'location': 'header',
39
+ 'locationName': 'ExpiresString'
40
+ });
41
+
42
+ newMembers[memberKey].deprecated = true;
43
+ newMembers[memberKey].documentation = 'Deprecated in favor of ExpiresString.';
44
+ }
45
+ }
46
+ output.members = newMembers;
47
+ }
48
+ }
49
+
50
+ return true;
51
+ }
52
+ return false;
53
+ };
@@ -40,17 +40,17 @@ var allowlist = {
40
40
  '/services/s3.js': [
41
41
  87,
42
42
  88,
43
- 260,
44
- 262,
45
- 275,
46
- 281,
47
- 641,
48
- 643,
49
- 762,
50
- 773,
43
+ 261,
44
+ 263,
45
+ 276,
46
+ 282,
47
+ 642,
48
+ 644,
49
+ 763,
51
50
  774,
52
51
  775,
53
- 780
52
+ 776,
53
+ 781
54
54
  ],
55
55
  '/token/sso_token_provider.js': [
56
56
  60
@@ -3,6 +3,7 @@
3
3
  var fs = require('fs');
4
4
  var Translator = require('./lib/translator');
5
5
  var removeEventStreamOperations = require('./lib/remove-event-stream-ops').removeEventStreamOperations;
6
+ var setS3ExpiresString = require('./lib/set-s3-expires-string');
6
7
  var util = require('util');
7
8
  var path = require('path');
8
9
 
@@ -24,7 +25,7 @@ function ApiTranslator(basePath) {
24
25
  ApiTranslator.prototype.minimizeFile = function minimizeFile(filepath) {
25
26
  var opath = filepath.replace(/\.normal\.json$/, '.min.json');
26
27
  var data = JSON.parse(fs.readFileSync(path.join(this._apisPath, filepath)).toString());
27
- var didModify = removeEventStreamOperations(data);
28
+ var didModify = removeEventStreamOperations(data) || setS3ExpiresString(data);
28
29
  if (didModify) {
29
30
  // original model modified, replace existing normal.json so docs/ts definitions are accurate
30
31
  fs.writeFileSync(path.join(this._apisPath, filepath), JSON.stringify(data, null, ' '));
package/package.json CHANGED
@@ -67,7 +67,7 @@
67
67
  },
68
68
  "dependencies": {
69
69
  "aws-cdk-lib": "^2.95.0",
70
- "aws-sdk": "^2.1542.0",
70
+ "aws-sdk": "^2.1543.0",
71
71
  "constructs": "^10.0.5"
72
72
  },
73
73
  "bundledDependencies": [
@@ -89,7 +89,7 @@
89
89
  ],
90
90
  "main": "lib/index.js",
91
91
  "license": "Apache-2.0",
92
- "version": "2.0.360",
92
+ "version": "2.0.361",
93
93
  "jest": {
94
94
  "testMatch": [
95
95
  "<rootDir>/src/**/__tests__/**/*.ts?(x)",