• Normalizes a parsed AWS IoT shadow document into the canonical ESPNodeUpdateData envelope used by every subscription channel.

    The payload is reduced to the device→param map ({ <deviceName>: { <paramName>: value } }) by preferring state.reported.params and falling back to state.reported, so all channels agree on the same payload shape regardless of transport.

    The full parsed shadow is also attached as metadata.shadow so consumers that need fields outside the param map (e.g. online, ncfg_ver) can read them without changing the normalized payload contract.

    Parameters

    • nodeId: string

      The node the update belongs to.

    • parsedShadow: unknown

      The parsed shadow document (full live message or get/accepted document).

    • meta: Record<string, unknown> = {}

      Channel-specific metadata to merge into metadata (e.g. { shadowName, topic }).

    • source: string = SubscriptionChannelIds.MQTT

      The originating channel id (defaults to the MQTT channel).

    Returns ESPNodeUpdateData

    A normalized ESPNodeUpdateData.