@aws-sdk/middleware-logger 3.186.0 → 3.188.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.188.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.187.0...v3.188.0) (2022-10-13)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/middleware-logger
9
+
10
+
11
+
12
+
13
+
6
14
  # [3.186.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.185.0...v3.186.0) (2022-10-06)
7
15
 
8
16
  **Note:** Version bump only for package @aws-sdk/middleware-logger
@@ -1,42 +1,29 @@
1
- import { __awaiter, __generator, __rest } from "tslib";
2
- export var loggerMiddleware = function () {
3
- return function (next, context) {
4
- return function (args) { return __awaiter(void 0, void 0, void 0, function () {
5
- var clientName, commandName, inputFilterSensitiveLog, logger, outputFilterSensitiveLog, response, _a, $metadata, outputWithoutMetadata;
6
- return __generator(this, function (_b) {
7
- switch (_b.label) {
8
- case 0:
9
- clientName = context.clientName, commandName = context.commandName, inputFilterSensitiveLog = context.inputFilterSensitiveLog, logger = context.logger, outputFilterSensitiveLog = context.outputFilterSensitiveLog;
10
- return [4, next(args)];
11
- case 1:
12
- response = _b.sent();
13
- if (!logger) {
14
- return [2, response];
15
- }
16
- if (typeof logger.info === "function") {
17
- _a = response.output, $metadata = _a.$metadata, outputWithoutMetadata = __rest(_a, ["$metadata"]);
18
- logger.info({
19
- clientName: clientName,
20
- commandName: commandName,
21
- input: inputFilterSensitiveLog(args.input),
22
- output: outputFilterSensitiveLog(outputWithoutMetadata),
23
- metadata: $metadata,
24
- });
25
- }
26
- return [2, response];
27
- }
28
- });
29
- }); };
30
- };
1
+ export const loggerMiddleware = () => (next, context) => async (args) => {
2
+ const { clientName, commandName, inputFilterSensitiveLog, logger, outputFilterSensitiveLog } = context;
3
+ const response = await next(args);
4
+ if (!logger) {
5
+ return response;
6
+ }
7
+ if (typeof logger.info === "function") {
8
+ const { $metadata, ...outputWithoutMetadata } = response.output;
9
+ logger.info({
10
+ clientName,
11
+ commandName,
12
+ input: inputFilterSensitiveLog(args.input),
13
+ output: outputFilterSensitiveLog(outputWithoutMetadata),
14
+ metadata: $metadata,
15
+ });
16
+ }
17
+ return response;
31
18
  };
32
- export var loggerMiddlewareOptions = {
19
+ export const loggerMiddlewareOptions = {
33
20
  name: "loggerMiddleware",
34
21
  tags: ["LOGGER"],
35
22
  step: "initialize",
36
23
  override: true,
37
24
  };
38
- export var getLoggerPlugin = function (options) { return ({
39
- applyToStack: function (clientStack) {
25
+ export const getLoggerPlugin = (options) => ({
26
+ applyToStack: (clientStack) => {
40
27
  clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);
41
28
  },
42
- }); };
29
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-logger",
3
- "version": "3.186.0",
3
+ "version": "3.188.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",
@@ -21,7 +21,7 @@
21
21
  "module": "./dist-es/index.js",
22
22
  "types": "./dist-types/index.d.ts",
23
23
  "dependencies": {
24
- "@aws-sdk/types": "3.186.0",
24
+ "@aws-sdk/types": "3.188.0",
25
25
  "tslib": "^2.3.1"
26
26
  },
27
27
  "devDependencies": {