SnsSqsEnvelope: {
    parse<T extends ZodType>(data: unknown, schema: T): TypeOf<T>[];
    safeParse<T extends ZodType>(
        data: unknown,
        schema: T,
    ): ParsedResult<unknown, TypeOf<T>[]>;
} = ...

SNS plus SQS Envelope to extract array of Records

Published messages from SNS to SQS has a slightly different payload. Since SNS payload is marshalled into Record key in SQS, we have to:

  1. Parse SQS schema with incoming data
  2. Unmarshall SNS payload and parse against SNS Notification schema not SNS/SNS Record
  3. Finally, parse provided model against payload extracted

Type declaration