From 863f8fcd1cce5b59bc44498944b89310b97b068d Mon Sep 17 00:00:00 2001 From: vForgeOne Date: Wed, 26 Mar 2025 00:02:01 -0400 Subject: [PATCH] improv(parser): export SqsAttributesSchema and SqsMsgAttributeSchema --- packages/parser/src/schemas/index.ts | 8 +++++++- packages/parser/src/schemas/sqs.ts | 17 +++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/packages/parser/src/schemas/index.ts b/packages/parser/src/schemas/index.ts index eedaaeb800..ed70209a5a 100644 --- a/packages/parser/src/schemas/index.ts +++ b/packages/parser/src/schemas/index.ts @@ -60,7 +60,13 @@ export { SnsSqsNotificationSchema, SnsNotificationSchema, } from './sns.js'; -export { SqsSchema, SqsRecordSchema } from './sqs.js'; +export { + SqsSchema, + SqsRecordSchema, + SqsMsgAttributeSchema, + SqsMsgAttributeDataTypeSchema, + SqsAttributesSchema, +} from './sqs.js'; export { TransferFamilySchema } from './transfer-family.js'; export { VpcLatticeSchema } from './vpc-lattice.js'; export { VpcLatticeV2Schema } from './vpc-latticev2.js'; diff --git a/packages/parser/src/schemas/sqs.ts b/packages/parser/src/schemas/sqs.ts index f3c8ecd11b..83fde66e6c 100644 --- a/packages/parser/src/schemas/sqs.ts +++ b/packages/parser/src/schemas/sqs.ts @@ -1,11 +1,18 @@ import { z } from 'zod'; +const SqsMsgAttributeDataTypeSchema = z.union([ + z.literal('String'), + z.literal('Number'), + z.literal('Binary'), + z.string(), +]); + const SqsMsgAttributeSchema = z.object({ stringValue: z.string().optional(), binaryValue: z.string().optional(), stringListValues: z.array(z.string()).optional(), binaryListValues: z.array(z.string()).optional(), - dataType: z.string(), + dataType: SqsMsgAttributeDataTypeSchema, }); const SqsAttributesSchema = z.object({ @@ -96,4 +103,10 @@ const SqsSchema = z.object({ Records: z.array(SqsRecordSchema).min(1), }); -export { SqsSchema, SqsRecordSchema }; +export { + SqsSchema, + SqsRecordSchema, + SqsMsgAttributeSchema, + SqsMsgAttributeDataTypeSchema, + SqsAttributesSchema, +};