Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLSCMN-17 remove @middy/event-normalizer #17

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"@aws-sdk/client-sqs": "^3.474.0",
"@aws-sdk/lib-dynamodb": "^3.474.0",
"@middy/core": "^4.7.0",
"@middy/event-normalizer": "^4.7.0",
"@middy/http-event-normalizer": "^4.7.0",
"@middy/http-json-body-parser": "^4.7.0",
"@rollup/plugin-commonjs": "^25.0.4",
Expand Down Expand Up @@ -67,7 +66,6 @@
"@aws-sdk/client-sqs": "^3.474.0",
"@aws-sdk/lib-dynamodb": "^3.474.0",
"@middy/core": "^4.7.0",
"@middy/event-normalizer": "^4.7.0",
"@middy/http-event-normalizer": "^4.7.0",
"@middy/http-json-body-parser": "^4.7.0",
"http-status": "^1.7.3",
Expand Down
1 change: 0 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export {
LambdaMiddyfyOptions,
ScheduledHandlerFn,
ScheduledMiddyfyOptions,
SNSHandlerFn,
SNSMiddyfyOptions,
SQSMiddyfyOptions,
} from './middyfy';
Expand Down
12 changes: 2 additions & 10 deletions src/utils/middyfy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import middy from '@middy/core';
import eventNormalizer from '@middy/event-normalizer';
import httpEventNormalizer from '@middy/http-event-normalizer';
import jsonBodyParser from '@middy/http-json-body-parser';
import {
Expand All @@ -8,7 +7,7 @@ import {
Context,
ScheduledEvent,
SQSHandler,
SNSEvent,
SNSHandler,
} from 'aws-lambda';
import { ObjectSchema } from 'joi';

Expand All @@ -30,11 +29,6 @@ export type APIGatewayHandlerFn = (
*/
export type ScheduledHandlerFn = (event: ScheduledEvent, context: Context) => Promise<void>;

/**
* The AWS Lambda handler function signature for SNS events.
*/
export type SNSHandlerFn = (event: SNSEvent, context: Context) => Promise<void>;

/**
* A Lambda function for invocation by another Lambda function.
*/
Expand Down Expand Up @@ -86,7 +80,7 @@ export type ScheduledMiddyfyOptions = MiddyfyOptions<ScheduledHandlerFn> & {
/**
* Options for middyfied SNS event handler functions.
*/
export type SNSMiddyfyOptions = MiddyfyOptions<SNSHandlerFn> & {
export type SNSMiddyfyOptions = MiddyfyOptions<SNSHandler> & {
eventSchema?: ObjectSchema;
};

Expand Down Expand Up @@ -147,7 +141,6 @@ export const middyfyScheduled = (options: ScheduledMiddyfyOptions) => {
export const middyfySNS = (options: SNSMiddyfyOptions) => {
return middy(options.handler)
.use(loggerInitializer())
.use(eventNormalizer())
.use(validator({ eventSchema: options.eventSchema }));
};

Expand All @@ -160,7 +153,6 @@ export const middyfySNS = (options: SNSMiddyfyOptions) => {
export const middyfySQS = (options: SQSMiddyfyOptions) => {
return middy(options.handler)
.use(loggerInitializer())
.use(eventNormalizer())
.use(validator({ eventSchema: options.eventSchema }));
};

Expand Down