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

    Function toAdditiveCanonicalProduct

    • Project a Product to an additive, URL-free canonical surface.

      Unlike augmentProductWithFormatOptions, this always returns fresh format_options[] declarations with v1_format_ref concealed. Unlike toCanonicalOnlyProduct, it preserves the Product's top-level format_ids[]. Exact canonical-to-legacy downgrade identity is returned separately as JSON-safe CanonicalFormatLegacyRoute sidecars.

      Extract routes before any JSON round-trip — WeakMap metadata is gone after deserialization. This helper enforces that ordering internally; persist its returned routes whenever a canonical selection may cross a process boundary before being forwarded to a legacy seller. Rebuild the write-side resolver with canonicalFormatLegacyResolverFromRoutes(restoredRoutes).

      Type Parameters

      • P extends V1Product

      Parameters

      • product: P
      • Optionaloptions: V1ToV2ProjectionOptions

      Returns {
          product: AdditiveCanonicalProduct<P>;
          diagnostics: ProjectionDiagnostic[];
          routes: CanonicalFormatLegacyRoute[];
      }

      TypeError when a canonical declaration uses a direct legacy identity alias such as agent_url or agentUrl instead of v1_format_ref.