Skip to content

Commit 635ef27

Browse files
Merge pull request #42 from ServerlessLife/41-dynamodb-remove-event-error
fix: #41 DynamoDB remove event error
2 parents 1cedd26 + 205f213 commit 635ef27

File tree

7 files changed

+13
-14
lines changed

7 files changed

+13
-14
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/upgrade-main.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/SpyEventSender.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ export class SpyEventSender {
163163
const data: DynamoDBSpyEvent = {
164164
spyEventType: 'DynamoDB',
165165
eventName: record.eventName,
166-
newImage: unmarshall(record.dynamodb?.NewImage as any),
166+
newImage: record.dynamodb?.NewImage
167+
? unmarshall(record.dynamodb?.NewImage as any)
168+
: undefined,
167169
keys: unmarshall(record.dynamodb?.Keys as any),
168170
oldImage: record.dynamodb?.OldImage
169171
? unmarshall(record.dynamodb?.OldImage as any)

common/spyEvents/DynamoDBSpyEvent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { SpyEvent } from './SpyEvent';
66
export interface DynamoDBSpyEvent<TData = any> extends SpyEvent {
77
spyEventType: 'DynamoDB';
88
eventName: DynamoDBRecord['eventName'];
9-
newImage: TData;
9+
newImage?: TData;
1010
keys: Record<string, NativeAttributeValue>;
1111
oldImage?: TData;
1212
}

extension/aws/UserFunction.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
/**
22
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
4-
* This code was copied from:
5-
* https://github.com/aws/aws-lambda-nodejs-runtime-interface-client
6-
*
74
* This module defines the functions for loading the user's code as specified
85
* in a handler string.
96
*/

test/cdk/.github/workflows/upgrade.yml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)