File tree 7 files changed +8
-12
lines changed
packages/parser/src/envelopes
7 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export class CloudWatchEnvelope extends Envelope {
17
17
public static parse < T extends ZodSchema > (
18
18
data : unknown ,
19
19
schema : T
20
- ) : z . infer < T > {
20
+ ) : z . infer < T > [ ] {
21
21
const parsedEnvelope = CloudWatchLogsSchema . parse ( data ) ;
22
22
23
23
return parsedEnvelope . awslogs . data . logEvents . map ( ( record ) => {
Original file line number Diff line number Diff line change @@ -3,11 +3,7 @@ import { DynamoDBStreamSchema } from '../schemas/index.js';
3
3
import type { ParsedResult , ParsedResultError } from '../types/index.js' ;
4
4
import { Envelope } from './envelope.js' ;
5
5
import { ParseError } from '../errors.js' ;
6
-
7
- type DynamoDBStreamEnvelopeResponse < T extends ZodSchema > = {
8
- NewImage : z . infer < T > ;
9
- OldImage : z . infer < T > ;
10
- } ;
6
+ import type { DynamoDBStreamEnvelopeResponse } from '../types/envelope.js' ;
11
7
12
8
/**
13
9
* DynamoDB Stream Envelope to extract data within NewImage/OldImage
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export class KafkaEnvelope extends Envelope {
20
20
public static parse < T extends ZodSchema > (
21
21
data : unknown ,
22
22
schema : T
23
- ) : z . infer < T > {
23
+ ) : z . infer < T > [ ] {
24
24
// manually fetch event source to deside between Msk or SelfManaged
25
25
const eventSource = ( data as KafkaMskEvent ) [ 'eventSource' ] ;
26
26
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export class KinesisFirehoseEnvelope extends Envelope {
20
20
public static parse < T extends ZodSchema > (
21
21
data : unknown ,
22
22
schema : T
23
- ) : z . infer < T > {
23
+ ) : z . infer < T > [ ] {
24
24
const parsedEnvelope = KinesisFirehoseSchema . parse ( data ) ;
25
25
26
26
return parsedEnvelope . records . map ( ( record ) => {
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ export class KinesisEnvelope extends Envelope {
18
18
public static parse < T extends ZodSchema > (
19
19
data : unknown ,
20
20
schema : T
21
- ) : z . infer < T > {
21
+ ) : z . infer < T > [ ] {
22
22
const parsedEnvelope = KinesisDataStreamSchema . parse ( data ) ;
23
23
24
24
return parsedEnvelope . Records . map ( ( record ) => {
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ export class SnsEnvelope extends Envelope {
18
18
public static parse < T extends ZodSchema > (
19
19
data : unknown ,
20
20
schema : T
21
- ) : z . infer < T > {
21
+ ) : z . infer < T > [ ] {
22
22
const parsedEnvelope = SnsSchema . parse ( data ) ;
23
23
24
24
return parsedEnvelope . Records . map ( ( record ) => {
Original file line number Diff line number Diff line change @@ -9,15 +9,15 @@ import { ParseError } from '../errors.js';
9
9
*
10
10
* The record's body parameter is a string, though it can also be a JSON encoded string.
11
11
* Regardless of its type it'll be parsed into a BaseModel object.
12
- *
12
+ *w
13
13
* Note: Records will be parsed the same way so if model is str,
14
14
* all items in the list will be parsed as str and npt as JSON (and vice versa)
15
15
*/
16
16
export class SqsEnvelope extends Envelope {
17
17
public static parse < T extends ZodSchema > (
18
18
data : unknown ,
19
19
schema : T
20
- ) : z . infer < T > {
20
+ ) : z . infer < T > [ ] {
21
21
const parsedEnvelope = SqsSchema . parse ( data ) ;
22
22
23
23
return parsedEnvelope . Records . map ( ( record ) => {
You can’t perform that action at this time.
0 commit comments