Skip to content

Variable: ContentSourceSchema

Makaio Framework


Makaio Framework / contracts/shared / ContentSourceSchema

const ContentSourceSchema: ZodDiscriminatedUnion<[ZodObject<{ data: ZodString; mimeType: ZodString; type: ZodLiteral<"base64">; }, $strip>, ZodObject<{ mimeType: ZodOptional<ZodString>; type: ZodLiteral<"url">; url: ZodString; }, $strip>], "type">

Defined in: ../../../packages/contracts/src/shared/index.ts:14

Content source for binary data or external resources. Supports either base64-encoded data or URL-based content.

Invariant: the base64 branch requires a known MIME type. Staging utilities always populate mimeType before a source reaches the message bus, so callers that construct a base64 source must always provide it. The url branch leaves mimeType optional because remote URLs may not have a known content type upfront.