@aws-sdk/signature-v4-multi-region 3.183.0 → 3.186.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.186.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.185.0...v3.186.0) (2022-10-06)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/signature-v4-multi-region
9
+
10
+
11
+
12
+
13
+
6
14
  # [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03)
7
15
 
8
16
  **Note:** Version bump only for package @aws-sdk/signature-v4-multi-region
@@ -1,45 +1,55 @@
1
+ import { __assign, __awaiter, __generator } from "tslib";
1
2
  import { SignatureV4 } from "@aws-sdk/signature-v4";
2
- export class SignatureV4MultiRegion {
3
- constructor(options) {
3
+ var SignatureV4MultiRegion = (function () {
4
+ function SignatureV4MultiRegion(options) {
4
5
  this.sigv4Signer = new SignatureV4(options);
5
6
  this.signerOptions = options;
6
7
  }
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() {
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 () {
24
35
  if (!this.sigv4aSigner) {
25
- let CrtSignerV4;
36
+ var CrtSignerV4_1;
26
37
  try {
27
- CrtSignerV4 = typeof require === "function" && require("@aws-sdk/signature-v4-crt").CrtSignerV4;
28
- if (typeof CrtSignerV4 !== "function")
38
+ CrtSignerV4_1 = typeof require === "function" && require("@aws-sdk/signature-v4-crt").CrtSignerV4;
39
+ if (typeof CrtSignerV4_1 !== "function")
29
40
  throw new Error();
30
41
  }
31
42
  catch (e) {
32
43
  e.message =
33
- `${e.message}\nPlease check if you have installed "@aws-sdk/signature-v4-crt" package explicitly. \n` +
44
+ "".concat(e.message, "\nPlease check if you have installed \"@aws-sdk/signature-v4-crt\" package explicitly. \n") +
34
45
  "For more information please go to " +
35
46
  "https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt";
36
47
  throw e;
37
48
  }
38
- this.sigv4aSigner = new CrtSignerV4({
39
- ...this.signerOptions,
40
- signingAlgorithm: 1,
41
- });
49
+ this.sigv4aSigner = new CrtSignerV4_1(__assign(__assign({}, this.signerOptions), { signingAlgorithm: 1 }));
42
50
  }
43
51
  return this.sigv4aSigner;
44
- }
45
- }
52
+ };
53
+ return SignatureV4MultiRegion;
54
+ }());
55
+ export { SignatureV4MultiRegion };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/signature-v4-multi-region",
3
- "version": "3.183.0",
3
+ "version": "3.186.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.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",
29
+ "@aws-sdk/protocol-http": "3.186.0",
30
+ "@aws-sdk/signature-v4": "3.186.0",
31
+ "@aws-sdk/types": "3.186.0",
32
+ "@aws-sdk/util-arn-parser": "3.186.0",
33
33
  "tslib": "^2.3.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@aws-sdk/signature-v4-crt": "3.183.0",
36
+ "@aws-sdk/signature-v4-crt": "3.186.0",
37
37
  "@tsconfig/recommended": "1.0.1",
38
38
  "concurrently": "7.0.0",
39
39
  "downlevel-dts": "0.10.1",