@aws-sdk/s3-presigned-post 3.54.1 → 3.55.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.55.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.1...v3.55.0) (2022-03-21)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/s3-presigned-post
9
+
10
+
11
+
12
+
13
+
6
14
  ## [3.54.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.0...v3.54.1) (2022-03-15)
7
15
 
8
16
  **Note:** Version bump only for package @aws-sdk/s3-presigned-post
@@ -11,7 +11,7 @@ const createPresignedPost = async (client, { Bucket, Key, Conditions = [], Field
11
11
  const signingDate = iso8601(now).replace(/[\-:]/g, "");
12
12
  const shortDate = signingDate.substr(0, 8);
13
13
  const clientRegion = await client.config.region();
14
- const credentialScope = signature_v4_1.createScope(shortDate, clientRegion, "s3");
14
+ const credentialScope = (0, signature_v4_1.createScope)(shortDate, clientRegion, "s3");
15
15
  const clientCredentials = await client.config.credentials();
16
16
  const credential = `${clientCredentials.accessKeyId}/${credentialScope}`;
17
17
  const fields = {
@@ -34,19 +34,19 @@ const createPresignedPost = async (client, { Bucket, Key, Conditions = [], Field
34
34
  expiration: iso8601(expiration),
35
35
  conditions,
36
36
  })));
37
- const signingKey = await signature_v4_1.getSigningKey(sha256, clientCredentials, shortDate, clientRegion, "s3");
37
+ const signingKey = await (0, signature_v4_1.getSigningKey)(sha256, clientCredentials, shortDate, clientRegion, "s3");
38
38
  const signature = await hmac(sha256, signingKey, encodedPolicy);
39
39
  const endpoint = await client.config.endpoint();
40
40
  if (!client.config.bucketEndpoint) {
41
41
  endpoint.path = `/${Bucket}`;
42
42
  }
43
43
  return {
44
- url: util_format_url_1.formatUrl(endpoint),
44
+ url: (0, util_format_url_1.formatUrl)(endpoint),
45
45
  fields: {
46
46
  ...fields,
47
47
  key: Key,
48
48
  Policy: encodedPolicy,
49
- [constants_1.SIGNATURE_QUERY_PARAM]: util_hex_encoding_1.toHex(signature),
49
+ [constants_1.SIGNATURE_QUERY_PARAM]: (0, util_hex_encoding_1.toHex)(signature),
50
50
  },
51
51
  };
52
52
  };
@@ -22,18 +22,18 @@ export var createPresignedPost = function (client, _a) {
22
22
  return [4, client.config.credentials()];
23
23
  case 2:
24
24
  clientCredentials = _j.sent();
25
- credential = clientCredentials.accessKeyId + "/" + credentialScope;
25
+ credential = "".concat(clientCredentials.accessKeyId, "/").concat(credentialScope);
26
26
  fields = __assign(__assign(__assign({}, Fields), (_f = { bucket: Bucket }, _f[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER, _f[CREDENTIAL_QUERY_PARAM] = credential, _f[AMZ_DATE_QUERY_PARAM] = signingDate, _f)), (clientCredentials.sessionToken ? (_g = {}, _g[TOKEN_QUERY_PARAM] = clientCredentials.sessionToken, _g) : {}));
27
27
  expiration = new Date(now.valueOf() + Expires * 1000);
28
- conditions = __spreadArray(__spreadArray(__spreadArray([], __read(Conditions)), __read(Object.entries(fields).map(function (_a) {
28
+ conditions = __spreadArray(__spreadArray(__spreadArray([], __read(Conditions), false), __read(Object.entries(fields).map(function (_a) {
29
29
  var _b;
30
30
  var _c = __read(_a, 2), k = _c[0], v = _c[1];
31
31
  return (_b = {}, _b[k] = v, _b);
32
- }))), [
32
+ })), false), [
33
33
  Key.endsWith("${filename}")
34
34
  ? ["starts-with", "$key", Key.substring(0, Key.lastIndexOf("${filename}"))]
35
35
  : { key: Key },
36
- ]);
36
+ ], false);
37
37
  encodedPolicy = base64Encoder(utf8Decoder(JSON.stringify({
38
38
  expiration: iso8601(expiration),
39
39
  conditions: conditions,
@@ -48,7 +48,7 @@ export var createPresignedPost = function (client, _a) {
48
48
  case 5:
49
49
  endpoint = _j.sent();
50
50
  if (!client.config.bucketEndpoint) {
51
- endpoint.path = "/" + Bucket;
51
+ endpoint.path = "/".concat(Bucket);
52
52
  }
53
53
  return [2, {
54
54
  url: formatUrl(endpoint),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/s3-presigned-post",
3
- "version": "3.54.1",
3
+ "version": "3.55.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
6
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -19,23 +19,23 @@
19
19
  },
20
20
  "license": "Apache-2.0",
21
21
  "dependencies": {
22
- "@aws-sdk/signature-v4": "3.54.1",
23
- "@aws-sdk/types": "3.54.1",
24
- "@aws-sdk/util-format-url": "3.54.1",
25
- "@aws-sdk/util-hex-encoding": "3.52.0",
26
- "tslib": "^2.3.0"
22
+ "@aws-sdk/signature-v4": "3.55.0",
23
+ "@aws-sdk/types": "3.55.0",
24
+ "@aws-sdk/util-format-url": "3.55.0",
25
+ "@aws-sdk/util-hex-encoding": "3.55.0",
26
+ "tslib": "^2.3.1"
27
27
  },
28
28
  "devDependencies": {
29
- "@aws-sdk/client-s3": "3.54.1",
30
- "@aws-sdk/hash-node": "3.54.1",
31
- "@aws-sdk/protocol-http": "3.54.1",
29
+ "@aws-sdk/client-s3": "3.55.0",
30
+ "@aws-sdk/hash-node": "3.55.0",
31
+ "@aws-sdk/protocol-http": "3.55.0",
32
32
  "@tsconfig/recommended": "1.0.1",
33
33
  "@types/node": "^12.0.2",
34
34
  "concurrently": "7.0.0",
35
35
  "downlevel-dts": "0.7.0",
36
36
  "rimraf": "3.0.2",
37
37
  "typedoc": "0.19.2",
38
- "typescript": "~4.3.5"
38
+ "typescript": "~4.6.2"
39
39
  },
40
40
  "engines": {
41
41
  "node": ">= 12.0.0"