@aws-sdk/middleware-logger
Advanced tools
Comparing version 3.15.0 to 3.18.0
@@ -6,2 +6,10 @@ # Change Log | ||
# [3.18.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.17.0...v3.18.0) (2021-06-04) | ||
**Note:** Version bump only for package @aws-sdk/middleware-logger | ||
# [3.15.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.14.0...v3.15.0) (2021-05-10) | ||
@@ -8,0 +16,0 @@ |
@@ -36,2 +36,2 @@ "use strict"; | ||
exports.getLoggerPlugin = getLoggerPlugin; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nZ2VyTWlkZGxld2FyZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sb2dnZXJNaWRkbGV3YXJlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQVlPLE1BQU0sZ0JBQWdCLEdBQUcsR0FBRyxFQUFFLENBQUMsQ0FDcEMsSUFBb0MsRUFDcEMsT0FBZ0MsRUFDQSxFQUFFLENBQUMsS0FBSyxFQUN4QyxJQUFxQyxFQUNLLEVBQUU7SUFDNUMsTUFBTSxFQUFFLFVBQVUsRUFBRSxXQUFXLEVBQUUsdUJBQXVCLEVBQUUsTUFBTSxFQUFFLHdCQUF3QixFQUFFLEdBQUcsT0FBTyxDQUFDO0lBRXZHLE1BQU0sUUFBUSxHQUFHLE1BQU0sSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO0lBRWxDLElBQUksQ0FBQyxNQUFNLEVBQUU7UUFDWCxPQUFPLFFBQVEsQ0FBQztLQUNqQjtJQUVELElBQUksT0FBTyxNQUFNLENBQUMsSUFBSSxLQUFLLFVBQVUsRUFBRTtRQUNyQyxNQUFNLEVBQUUsU0FBUyxFQUFFLEdBQUcscUJBQXFCLEVBQUUsR0FBRyxRQUFRLENBQUMsTUFBTSxDQUFDO1FBQ2hFLE1BQU0sQ0FBQ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ZXJQbHVnaW4gPSAob3B0aW9uczogYW55KTogUGx1Z2dhYmxlPGFueSwgYW55PiA9PiAoe1xuICBhcHBseVRvU3RhY2s6IChjbGllbnRTdGFjaykgPT4ge1xuICAgIGNsaWVudFN0YWNrLmFkZChsb2dnZXJNaWRkbGV3YXJlKCksIGxvZ2dlck1pZGRsZXdhcmVPcHRpb25zKTtcbiAgfSxcbn0pO1xuIl19 |
import { __awaiter, __generator, __rest } from "tslib"; | ||
export var loggerMiddleware = function () { return function (next, context) { return function (args) { return __awaiter(void 0, void 0, void 0, function () { | ||
var clientName, commandName, inputFilterSensitiveLog, logger, outputFilterSensitiveLog, response, _a, $metadata, outputWithoutMetadata; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
clientName = context.clientName, commandName = context.commandName, inputFilterSensitiveLog = context.inputFilterSensitiveLog, logger = context.logger, outputFilterSensitiveLog = context.outputFilterSensitiveLog; | ||
return [4 /*yield*/, next(args)]; | ||
case 1: | ||
response = _b.sent(); | ||
if (!logger) { | ||
return [2 /*return*/, response]; | ||
export var loggerMiddleware = function () { | ||
return function (next, context) { | ||
return function (args) { return __awaiter(void 0, void 0, void 0, function () { | ||
var clientName, commandName, inputFilterSensitiveLog, logger, outputFilterSensitiveLog, response, _a, $metadata, outputWithoutMetadata; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
clientName = context.clientName, commandName = context.commandName, inputFilterSensitiveLog = context.inputFilterSensitiveLog, logger = context.logger, outputFilterSensitiveLog = context.outputFilterSensitiveLog; | ||
return [4 /*yield*/, next(args)]; | ||
case 1: | ||
response = _b.sent(); | ||
if (!logger) { | ||
return [2 /*return*/, response]; | ||
} | ||
if (typeof logger.info === "function") { | ||
_a = response.output, $metadata = _a.$metadata, outputWithoutMetadata = __rest(_a, ["$metadata"]); | ||
logger.info({ | ||
clientName: clientName, | ||
commandName: commandName, | ||
input: inputFilterSensitiveLog(args.input), | ||
output: outputFilterSensitiveLog(outputWithoutMetadata), | ||
metadata: $metadata, | ||
}); | ||
} | ||
return [2 /*return*/, response]; | ||
} | ||
if (typeof logger.info === "function") { | ||
_a = response.output, $metadata = _a.$metadata, outputWithoutMetadata = __rest(_a, ["$metadata"]); | ||
logger.info({ | ||
clientName: clientName, | ||
commandName: commandName, | ||
input: inputFilterSensitiveLog(args.input), | ||
output: outputFilterSensitiveLog(outputWithoutMetadata), | ||
metadata: $metadata, | ||
}); | ||
} | ||
return [2 /*return*/, response]; | ||
} | ||
}); | ||
}); }; }; }; | ||
}); | ||
}); }; | ||
}; | ||
}; | ||
export var loggerMiddlewareOptions = { | ||
@@ -40,2 +44,2 @@ name: "loggerMiddleware", | ||
}); }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nZ2VyTWlkZGxld2FyZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sb2dnZXJNaWRkbGV3YXJlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFZQSxNQUFNLENBQUMsSUFBTSxnQkFBZ0IsR0FBRyxjQUFNLE9BQUEsVUFDcEMsSUFBb0MsRUFDcEMsT0FBZ0MsSUFDRyxPQUFBLFVBQ25DLElBQXFDOzs7OztnQkFFN0IsVUFBVSxHQUE2RSxPQUFPLFdBQXBGLEVBQUUsV0FBVyxHQUFnRSxPQUFPLFlBQXZFLEVBQUUsdUJBQXVCLEdBQXVDLE9BQU8sd0JBQTlDLEVBQUUsTUFBTSxHQUErQixPQUFPLE9BQXRDLEVBQUUsd0JBQXdCLEdBQUssT0FBTyx5QkFBWixDQUFhO2dCQUV0RixxQkFBTSxJQUFJLENBQUMsSUFBSSxDQUFDLEVBQUE7O2dCQUEzQixRQUFRLEdBQUcsU0FBZ0I7Z0JBRWpDLElBQUksQ0FBQyxNQUFNLEVBQUU7b0JBQ1gsc0JBQU8sUUFBUSxFQUFDO2lCQUNqQjtnQkFF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EluaXRpYWxpemVIYW5kbGVyT3B0aW9ucyAmIEFic29sdXRlTG9jYXRpb24gPSB7XG4gIG5hbWU6IFwibG9nZ2VyTWlkZGxld2FyZVwiLFxuICB0YWdzOiBbXCJMT0dHRVJcIl0sXG4gIHN0ZXA6IFwiaW5pdGlhbGl6ZVwiLFxuICBvdmVycmlkZTogdHJ1ZSxcbn07XG5cbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnNcbmV4cG9ydCBjb25zdCBnZXRMb2dnZXJQbHVnaW4gPSAob3B0aW9uczogYW55KTogUGx1Z2dhYmxlPGFueSwgYW55PiA9PiAoe1xuICBhcHBseVRvU3RhY2s6IChjbGllbnRTdGFjaykgPT4ge1xuICAgIGNsaWVudFN0YWNrLmFkZChsb2dnZXJNaWRkbGV3YXJlKCksIGxvZ2dlck1pZGRsZXdhcmVPcHRpb25zKTtcbiAgfSxcbn0pO1xuIl19 |
{ | ||
"name": "@aws-sdk/middleware-logger", | ||
"version": "3.15.0", | ||
"version": "3.18.0", | ||
"scripts": { | ||
@@ -21,11 +21,11 @@ "prepublishOnly": "yarn build && downlevel-dts dist/types dist/types/ts3.4", | ||
"dependencies": { | ||
"@aws-sdk/types": "3.15.0", | ||
"@aws-sdk/types": "3.18.0", | ||
"tslib": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@aws-sdk/protocol-http": "3.15.0", | ||
"@aws-sdk/protocol-http": "3.18.0", | ||
"@types/jest": "^26.0.4", | ||
"@types/node": "^10.0.0", | ||
"jest": "^26.1.0", | ||
"typescript": "~4.2.4" | ||
"typescript": "~4.3.2" | ||
}, | ||
@@ -32,0 +32,0 @@ "engines": { |
@@ -15,3 +15,3 @@ import { Logger, MiddlewareStack } from "@aws-sdk/types"; | ||
it("adds loggerMiddleware", () => { | ||
getLoggerPlugin({}).applyToStack((mockClientStack as unknown) as MiddlewareStack<any, any>); | ||
getLoggerPlugin({}).applyToStack(mockClientStack as unknown as MiddlewareStack<any, any>); | ||
expect(mockClientStack.add).toHaveBeenCalledTimes(1); | ||
@@ -80,3 +80,3 @@ expect(mockClientStack.add.mock.calls[0][1]).toEqual(loggerMiddlewareOptions); | ||
const logger = ({ info: jest.fn() } as unknown) as Logger; | ||
const logger = { info: jest.fn() } as unknown as Logger; | ||
const clientName = "mockClientName"; | ||
@@ -131,3 +131,3 @@ const commandName = "mockCommandName"; | ||
mockNext.mockResolvedValueOnce(customResponse); | ||
const logger = ({ info: jest.fn() } as unknown) as Logger; | ||
const logger = { info: jest.fn() } as unknown as Logger; | ||
const inputFilterSensitiveLog = jest.fn().mockImplementationOnce((input) => input); | ||
@@ -134,0 +134,0 @@ const outputFilterSensitiveLog = jest.fn().mockImplementationOnce((output) => output); |
@@ -13,29 +13,30 @@ import { HttpResponse } from "@aws-sdk/protocol-http"; | ||
export const loggerMiddleware = () => <Output extends MetadataBearer = MetadataBearer>( | ||
next: InitializeHandler<any, Output>, | ||
context: HandlerExecutionContext | ||
): InitializeHandler<any, Output> => async ( | ||
args: InitializeHandlerArguments<any> | ||
): Promise<InitializeHandlerOutput<Output>> => { | ||
const { clientName, commandName, inputFilterSensitiveLog, logger, outputFilterSensitiveLog } = context; | ||
export const loggerMiddleware = | ||
() => | ||
<Output extends MetadataBearer = MetadataBearer>( | ||
next: InitializeHandler<any, Output>, | ||
context: HandlerExecutionContext | ||
): InitializeHandler<any, Output> => | ||
async (args: InitializeHandlerArguments<any>): Promise<InitializeHandlerOutput<Output>> => { | ||
const { clientName, commandName, inputFilterSensitiveLog, logger, outputFilterSensitiveLog } = context; | ||
const response = await next(args); | ||
const response = await next(args); | ||
if (!logger) { | ||
return response; | ||
} | ||
if (!logger) { | ||
return response; | ||
} | ||
if (typeof logger.info === "function") { | ||
const { $metadata, ...outputWithoutMetadata } = response.output; | ||
logger.info({ | ||
clientName, | ||
commandName, | ||
input: inputFilterSensitiveLog(args.input), | ||
output: outputFilterSensitiveLog(outputWithoutMetadata), | ||
metadata: $metadata, | ||
}); | ||
} | ||
if (typeof logger.info === "function") { | ||
const { $metadata, ...outputWithoutMetadata } = response.output; | ||
logger.info({ | ||
clientName, | ||
commandName, | ||
input: inputFilterSensitiveLog(args.input), | ||
output: outputFilterSensitiveLog(outputWithoutMetadata), | ||
metadata: $metadata, | ||
}); | ||
} | ||
return response; | ||
}; | ||
return response; | ||
}; | ||
@@ -42,0 +43,0 @@ export const loggerMiddlewareOptions: InitializeHandlerOptions & AbsoluteLocation = { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
290
76561
+ Added@aws-sdk/types@3.18.0(transitive)
- Removed@aws-sdk/types@3.15.0(transitive)
Updated@aws-sdk/types@3.18.0