@adcp/sdk API Reference - v14.0.0-beta.6
    Preparing search index...

    Function toCanonicalOnlyResponse

    • Reduce every Product in a get_products response to the canonical-only shape — format_options[] present, format_ids[] dropped. Returns { response, diagnostics } so callers surface projection diagnostics alongside the response's existing errors[].

      Response-level counterpart to toCanonicalOnlyProduct; same fail-closed guarantee, aggregated across products. A wholly unmappable legacy product cannot be represented as a canonical Product because the protocol requires format_options to contain at least one declaration. It is therefore omitted from the canonical list and surfaced through the response's portable errors[] plus the SDK convenience diagnostics. A partially mappable product remains with its mapped options and advisories for the refs that could not be projected.

      Type Parameters

      • P extends V1ProductInput
      • R extends { products?: P[] }

      Parameters

      • response: R
      • Optionaloptions: V1ToV2ProjectionOptions

      Returns {
          response: Omit<R, "products"> & {
              products: CanonicalOnlyProduct<P>[];
              errors?: unknown[];
          };
          diagnostics: ProjectionDiagnostic[];
      }