@aws-sdk/middleware-logger 3.287.0 → 3.288.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.
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getLoggerPlugin = exports.loggerMiddlewareOptions = exports.loggerMiddleware = void 0;
4
4
  const loggerMiddleware = () => (next, context) => async (args) => {
5
5
  var _a, _b;
6
- const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
7
- const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
8
- const inputFilterSensitiveLog = overrideInputFilterSensitiveLog !== null && overrideInputFilterSensitiveLog !== void 0 ? overrideInputFilterSensitiveLog : context.inputFilterSensitiveLog;
9
- const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog !== null && overrideOutputFilterSensitiveLog !== void 0 ? overrideOutputFilterSensitiveLog : context.outputFilterSensitiveLog;
10
6
  try {
11
7
  const response = await next(args);
8
+ const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
9
+ const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
10
+ const inputFilterSensitiveLog = overrideInputFilterSensitiveLog !== null && overrideInputFilterSensitiveLog !== void 0 ? overrideInputFilterSensitiveLog : context.inputFilterSensitiveLog;
11
+ const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog !== null && overrideOutputFilterSensitiveLog !== void 0 ? overrideOutputFilterSensitiveLog : context.outputFilterSensitiveLog;
12
12
  const { $metadata, ...outputWithoutMetadata } = response.output;
13
13
  (_a = logger === null || logger === void 0 ? void 0 : logger.info) === null || _a === void 0 ? void 0 : _a.call(logger, {
14
14
  clientName,
@@ -20,6 +20,9 @@ const loggerMiddleware = () => (next, context) => async (args) => {
20
20
  return response;
21
21
  }
22
22
  catch (error) {
23
+ const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
24
+ const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
25
+ const inputFilterSensitiveLog = overrideInputFilterSensitiveLog !== null && overrideInputFilterSensitiveLog !== void 0 ? overrideInputFilterSensitiveLog : context.inputFilterSensitiveLog;
23
26
  (_b = logger === null || logger === void 0 ? void 0 : logger.error) === null || _b === void 0 ? void 0 : _b.call(logger, {
24
27
  clientName,
25
28
  commandName,
@@ -1,10 +1,10 @@
1
1
  export const loggerMiddleware = () => (next, context) => async (args) => {
2
- const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
3
- const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
4
- const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
5
- const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
6
2
  try {
7
3
  const response = await next(args);
4
+ const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
5
+ const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
6
+ const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
7
+ const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
8
8
  const { $metadata, ...outputWithoutMetadata } = response.output;
9
9
  logger?.info?.({
10
10
  clientName,
@@ -16,6 +16,9 @@ export const loggerMiddleware = () => (next, context) => async (args) => {
16
16
  return response;
17
17
  }
18
18
  catch (error) {
19
+ const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
20
+ const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
21
+ const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
19
22
  logger?.error?.({
20
23
  clientName,
21
24
  commandName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-logger",
3
- "version": "3.287.0",
3
+ "version": "3.288.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",