@adcp/sdk API Reference - v10.0.1
    Preparing search index...

    Function injectLegacyEnvelopeStatus

    • AdCP 3.1.0-beta.2 made envelope status REQUIRED. Pre-3.1 sellers may omit it. When the response declares itself as 3.0.x (or doesn't declare a version), inject a synthetic envelope status so strict validators don't reject otherwise-conformant 3.0 responses.

      Never overwrites an existing task-status. Legacy media-buy lifecycle statuses are moved to media_buy_status and replaced with the envelope status completed when options.toolName is create_media_buy or update_media_buy. Pure function; safe to call before validation.

      Type Parameters

      • T extends Record<string, unknown>

      Parameters

      • response: T

        The raw wire response object.

      • Optionaloptions: LegacyEnvelopeStatusOptions

        Optional task context. Pass toolName when normalizing a tool response so task-specific legacy body-status shims can run.

      Returns T

      A new object with status injected when the legacy-leniency rules apply; the same reference otherwise.