Skip to content

Commit 56fa294

Browse files
improv(parser): export all SQS schemas (#3782)
Co-authored-by: vForgeOne <[email protected]> Co-authored-by: Andrea Amorosi <[email protected]>
1 parent d45f054 commit 56fa294

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

packages/parser/src/schemas/index.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@ export {
6060
SnsSqsNotificationSchema,
6161
SnsNotificationSchema,
6262
} from './sns.js';
63-
export { SqsSchema, SqsRecordSchema } from './sqs.js';
63+
export {
64+
SqsSchema,
65+
SqsRecordSchema,
66+
SqsMsgAttributeSchema,
67+
SqsMsgAttributeDataTypeSchema,
68+
SqsAttributesSchema,
69+
} from './sqs.js';
6470
export { TransferFamilySchema } from './transfer-family.js';
6571
export { VpcLatticeSchema } from './vpc-lattice.js';
6672
export { VpcLatticeV2Schema } from './vpc-latticev2.js';

packages/parser/src/schemas/sqs.ts

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
import { z } from 'zod';
22

3+
const SqsMsgAttributeDataTypeSchema = z.union([
4+
z.literal('String'),
5+
z.literal('Number'),
6+
z.literal('Binary'),
7+
z.string(),
8+
]);
9+
310
const SqsMsgAttributeSchema = z.object({
411
stringValue: z.string().optional(),
512
binaryValue: z.string().optional(),
613
stringListValues: z.array(z.string()).optional(),
714
binaryListValues: z.array(z.string()).optional(),
8-
dataType: z.string(),
15+
dataType: SqsMsgAttributeDataTypeSchema,
916
});
1017

1118
const SqsAttributesSchema = z.object({
@@ -96,4 +103,10 @@ const SqsSchema = z.object({
96103
Records: z.array(SqsRecordSchema).min(1),
97104
});
98105

99-
export { SqsSchema, SqsRecordSchema };
106+
export {
107+
SqsSchema,
108+
SqsRecordSchema,
109+
SqsMsgAttributeSchema,
110+
SqsMsgAttributeDataTypeSchema,
111+
SqsAttributesSchema,
112+
};

0 commit comments

Comments
 (0)