File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -218,15 +218,12 @@ class BatchProcessor extends BasePartialBatchProcessor {
218
218
record : EventSourceDataClassTypes ,
219
219
eventType : keyof typeof EventType ,
220
220
schema : StandardSchemaV1
221
- ) : Promise < SQSRecord | KinesisStreamRecord | DynamoDBRecord > {
221
+ ) : Promise < EventSourceDataClassTypes > {
222
222
const { parse } = await import ( '@aws-lambda-powertools/parser' ) ;
223
223
// Try parsing with the original schema first
224
224
const extendedSchemaParsing = parse ( record , undefined , schema , true ) ;
225
225
if ( extendedSchemaParsing . success ) {
226
- return extendedSchemaParsing . data as
227
- | SQSRecord
228
- | KinesisStreamRecord
229
- | DynamoDBRecord ;
226
+ return extendedSchemaParsing . data as EventSourceDataClassTypes ;
230
227
}
231
228
// Only proceed with schema extension if it's a Zod schema
232
229
if ( schema [ '~standard' ] . vendor !== SchemaType . Zod ) {
@@ -237,10 +234,11 @@ class BatchProcessor extends BasePartialBatchProcessor {
237
234
}
238
235
// Handle schema extension based on event type
239
236
const extendedSchema = await this . createExtendedSchema ( eventType , schema ) ;
240
- return parse ( record , undefined , extendedSchema ) as
241
- | SQSRecord
242
- | KinesisStreamRecord
243
- | DynamoDBRecord ;
237
+ return parse (
238
+ record ,
239
+ undefined ,
240
+ extendedSchema
241
+ ) as EventSourceDataClassTypes ;
244
242
}
245
243
}
246
244
You can’t perform that action at this time.
0 commit comments