DynamoDB Stream Envelope to extract data within NewImage/OldImage

Note: Values are the parsed models. Images' values can also be None, and length of the list is the record's amount in the original event.

Hierarchy

  • Envelope
    • DynamoDBStreamEnvelope

Constructors

Methods

Constructors

Methods

  • Internal

    Abstract function to parse the content of the envelope using provided schema. Both inputs are provided as unknown by the user. We expect the data to be either string that can be parsed to json or object.

    Type Parameters

    • T extends ZodType<any, ZodTypeDef, any>

    Parameters

    • data: unknown

      data to parse

    • schema: T

      schema

    Returns DynamoDBStreamEnvelopeResponse<TypeOf<T>>[]

  • Abstract function to safely parse the content of the envelope using provided schema. safeParse is used to avoid throwing errors, thus we catuch all errors and wrap them in the result.

    Type Parameters

    • T extends ZodType<any, ZodTypeDef, any>

    Parameters

    • data: unknown
    • schema: T

    Returns ParsedResult