@aws-sdk/signature-v4-multi-region 3.178.0 → 3.183.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,22 @@
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.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/signature-v4-multi-region
9
+
10
+
11
+
12
+
13
+
14
+ # [3.180.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.179.0...v3.180.0) (2022-09-27)
15
+
16
+ **Note:** Version bump only for package @aws-sdk/signature-v4-multi-region
17
+
18
+
19
+
20
+
21
+
6
22
  # [3.178.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.177.0...v3.178.0) (2022-09-23)
7
23
 
8
24
  **Note:** Version bump only for package @aws-sdk/signature-v4-multi-region
@@ -1,55 +1,45 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { SignatureV4 } from "@aws-sdk/signature-v4";
3
- var SignatureV4MultiRegion = (function () {
4
- function SignatureV4MultiRegion(options) {
2
+ export class SignatureV4MultiRegion {
3
+ constructor(options) {
5
4
  this.sigv4Signer = new SignatureV4(options);
6
5
  this.signerOptions = options;
7
6
  }
8
- SignatureV4MultiRegion.prototype.sign = function (requestToSign, options) {
9
- if (options === void 0) { options = {}; }
10
- return __awaiter(this, void 0, void 0, function () {
11
- return __generator(this, function (_a) {
12
- if (options.signingRegion === "*") {
13
- if (this.signerOptions.runtime !== "node")
14
- throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
15
- return [2, this.getSigv4aSigner().sign(requestToSign, options)];
16
- }
17
- return [2, this.sigv4Signer.sign(requestToSign, options)];
18
- });
19
- });
20
- };
21
- SignatureV4MultiRegion.prototype.presign = function (originalRequest, options) {
22
- if (options === void 0) { options = {}; }
23
- return __awaiter(this, void 0, void 0, function () {
24
- return __generator(this, function (_a) {
25
- if (options.signingRegion === "*") {
26
- if (this.signerOptions.runtime !== "node")
27
- throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
28
- return [2, this.getSigv4aSigner().presign(originalRequest, options)];
29
- }
30
- return [2, this.sigv4Signer.presign(originalRequest, options)];
31
- });
32
- });
33
- };
34
- SignatureV4MultiRegion.prototype.getSigv4aSigner = function () {
7
+ async sign(requestToSign, options = {}) {
8
+ if (options.signingRegion === "*") {
9
+ if (this.signerOptions.runtime !== "node")
10
+ throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
11
+ return this.getSigv4aSigner().sign(requestToSign, options);
12
+ }
13
+ return this.sigv4Signer.sign(requestToSign, options);
14
+ }
15
+ async presign(originalRequest, options = {}) {
16
+ if (options.signingRegion === "*") {
17
+ if (this.signerOptions.runtime !== "node")
18
+ throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
19
+ return this.getSigv4aSigner().presign(originalRequest, options);
20
+ }
21
+ return this.sigv4Signer.presign(originalRequest, options);
22
+ }
23
+ getSigv4aSigner() {
35
24
  if (!this.sigv4aSigner) {
36
- var CrtSignerV4_1;
25
+ let CrtSignerV4;
37
26
  try {
38
- CrtSignerV4_1 = typeof require === "function" && require("@aws-sdk/signature-v4-crt").CrtSignerV4;
39
- if (typeof CrtSignerV4_1 !== "function")
27
+ CrtSignerV4 = typeof require === "function" && require("@aws-sdk/signature-v4-crt").CrtSignerV4;
28
+ if (typeof CrtSignerV4 !== "function")
40
29
  throw new Error();
41
30
  }
42
31
  catch (e) {
43
32
  e.message =
44
- "".concat(e.message, "\nPlease check if you have installed \"@aws-sdk/signature-v4-crt\" package explicitly. \n") +
33
+ `${e.message}\nPlease check if you have installed "@aws-sdk/signature-v4-crt" package explicitly. \n` +
45
34
  "For more information please go to " +
46
35
  "https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt";
47
36
  throw e;
48
37
  }
49
- this.sigv4aSigner = new CrtSignerV4_1(__assign(__assign({}, this.signerOptions), { signingAlgorithm: 1 }));
38
+ this.sigv4aSigner = new CrtSignerV4({
39
+ ...this.signerOptions,
40
+ signingAlgorithm: 1,
41
+ });
50
42
  }
51
43
  return this.sigv4aSigner;
52
- };
53
- return SignatureV4MultiRegion;
54
- }());
55
- export { SignatureV4MultiRegion };
44
+ }
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/signature-v4-multi-region",
3
- "version": "3.178.0",
3
+ "version": "3.183.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",
@@ -26,14 +26,14 @@
26
26
  },
27
27
  "license": "Apache-2.0",
28
28
  "dependencies": {
29
- "@aws-sdk/protocol-http": "3.178.0",
30
- "@aws-sdk/signature-v4": "3.178.0",
31
- "@aws-sdk/types": "3.178.0",
32
- "@aws-sdk/util-arn-parser": "3.170.0",
29
+ "@aws-sdk/protocol-http": "3.183.0",
30
+ "@aws-sdk/signature-v4": "3.183.0",
31
+ "@aws-sdk/types": "3.183.0",
32
+ "@aws-sdk/util-arn-parser": "3.183.0",
33
33
  "tslib": "^2.3.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@aws-sdk/signature-v4-crt": "3.178.0",
36
+ "@aws-sdk/signature-v4-crt": "3.183.0",
37
37
  "@tsconfig/recommended": "1.0.1",
38
38
  "concurrently": "7.0.0",
39
39
  "downlevel-dts": "0.10.1",