LedeWire SDK API Reference
    Preparing search index...

    Type Alias Content

    Content:
        | Pick<
            components["schemas"]["Content"],
            "title"
            | "price_cents"
            | "visibility"
            | "metadata",
        > & { content_body: string; content_type: "markdown"; teaser?: string }
        | Pick<
            components["schemas"]["Content"],
            | "title"
            | "price_cents"
            | "visibility"
            | "metadata"
            | "external_identifier",
        > & Required<Pick<components["schemas"]["Content"], "content_uri">> & {
            content_type: "external_ref";
            teaser?: string;
        }
        | Pick<
            components["schemas"]["Content"],
            "title"
            | "price_cents"
            | "visibility"
            | "metadata",
        > & {
            content_body: string;
            content_type: "html";
            content_uri?: never;
            teaser?: string;
        }
        | Pick<
            components["schemas"]["Content"],
            | "title"
            | "price_cents"
            | "visibility"
            | "metadata"
            | "external_identifier",
        > & Required<Pick<components["schemas"]["Content"], "content_uri">> & {
            content_body?: never;
            content_type: "html";
            teaser?: string;
        }
        | Pick<
            components["schemas"]["Content"],
            | "title"
            | "price_cents"
            | "visibility"
            | "metadata"
            | "external_identifier",
        > & Required<Pick<components["schemas"]["Content"], "content_uri">> & {
            content_body?: never;
            content_type: "pdf" | "image" | "video";
            teaser?: string;
        }

    Content creation request body — a discriminated union on content_type.

    • 'markdown' requires content_body (plain text markdown — the SDK encodes it to base64 before transmission).
    • 'external_ref' requires content_uri (the external resource URL) and optionally external_identifier (namespaced platform ID, e.g. vimeo:123).
    • 'html' is either inline (content_body, plain HTML — the SDK base64-encodes it before sending) or remote (content_uri) — exactly one of the two, never both. The two shapes are modelled as separate union members, each disallowing the other's field via ?: never, so passing both is a compile-time error.
    • 'pdf', 'image', and 'video' all require content_uri (the SDK never accepts content_body for these types).

    Type Declaration

    • Pick<
          components["schemas"]["Content"],
          "title"
          | "price_cents"
          | "visibility"
          | "metadata",
      > & { content_body: string; content_type: "markdown"; teaser?: string }
      • content_body: string

        Full article body in plain text markdown. The SDK base64-encodes this before sending.

      • content_type: "markdown"
      • Optionalteaser?: string

        Optional article teaser in plain text markdown. The SDK base64-encodes this before sending.

    • Pick<
          components["schemas"]["Content"],
          "title"
          | "price_cents"
          | "visibility"
          | "metadata"
          | "external_identifier",
      > & Required<Pick<components["schemas"]["Content"], "content_uri">> & {
          content_type: "external_ref";
          teaser?: string;
      }
      • content_type: "external_ref"
      • Optionalteaser?: string

        Optional article teaser in plain text markdown. The SDK base64-encodes this before sending.

    • Pick<
          components["schemas"]["Content"],
          "title"
          | "price_cents"
          | "visibility"
          | "metadata",
      > & {
          content_body: string;
          content_type: "html";
          content_uri?: never;
          teaser?: string;
      }
      • content_body: string

        Full HTML body. The SDK base64-encodes this before sending. Mutually exclusive with content_uri.

      • content_type: "html"
      • Optionalcontent_uri?: never

        Not accepted alongside inline content_body — submitting both is rejected with 400.

      • Optionalteaser?: string

        Optional article teaser in plain text markdown. The SDK base64-encodes this before sending.

    • Pick<
          components["schemas"]["Content"],
          "title"
          | "price_cents"
          | "visibility"
          | "metadata"
          | "external_identifier",
      > & Required<Pick<components["schemas"]["Content"], "content_uri">> & {
          content_body?: never;
          content_type: "html";
          teaser?: string;
      }
      • Optionalcontent_body?: never

        Not accepted alongside remote content_uri — submitting both is rejected with 400.

      • content_type: "html"
      • Optionalteaser?: string

        Optional article teaser in plain text markdown. The SDK base64-encodes this before sending.

    • Pick<
          components["schemas"]["Content"],
          "title"
          | "price_cents"
          | "visibility"
          | "metadata"
          | "external_identifier",
      > & Required<Pick<components["schemas"]["Content"], "content_uri">> & {
          content_body?: never;
          content_type: "pdf" | "image" | "video";
          teaser?: string;
      }
      • Optionalcontent_body?: never

        Not accepted for pdf/image/video content.

      • content_type: "pdf" | "image" | "video"
      • Optionalteaser?: string

        Optional article teaser in plain text markdown. The SDK base64-encodes this before sending.

    The union is assembled here rather than aliased from components['schemas']['Content']. The OpenAPI spec defines Content as a flat object (no oneOf/discriminator), so openapi-typescript cannot generate the discriminated union that callers need for type-narrowing.

    Every field except content_body and teaser is picked from the generated schema, so it cannot drift. Those two stay hand-typed because the generated ones document a base64 string the caller encodes, and the SDK takes plain text and encodes it itself. A compile-time assignability guard below (_ContentDriftGuard) errors if the union stops fitting the generated schema.

    TODO: remove the hand-written union and alias the generated type once ledewire.yml uses oneOf + discriminator for the Content schema.