// AUTO-GENERATED by scripts/generate.ts from .generated-specs. Do not edit. import * as S from "@distilled.cloud/core/schema"; import * as API from "@distilled.cloud/core/api"; import * as T from "../traits.ts"; import { CloudflareProtocol, type CloudflareOpError, type CloudflareOpContext, } from "../protocol.ts"; import { CloudflareError, CloudflareRateLimited } from "../errors.ts"; import * as Retry from "../retry.ts"; export type { CloudflareOpError, CloudflareOpContext }; /** Fallback camelCase→wire mapping for opaque content (mined from the distilled SDK). */ const KEY_DICTIONARY: Record> = { continuationToken: "continuation_token", perPage: "per_page", resultInfo: "result_info", totalCount: "total_count", }; export class ImageAlreadyExists extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("ImageAlreadyExists", { code: S.Number, message: S.String, }), [{ code: 5409 }], ) {} export class ImageNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("ImageNotFound", { code: S.Number, message: S.String, }), [{ code: 5404 }], ) {} export class ImagesAccessNotEnabled extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "ImagesAccessNotEnabled", { code: S.Number, message: S.String, }, ), [{ code: 5403 }], ) {} export class InvalidUploadFormat extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("InvalidUploadFormat", { code: S.Number, message: S.String, }), [{ code: 5415 }], ) {} export class KeyNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("KeyNotFound", { code: S.Number, message: S.String, }), [{ code: 5404 }], ) {} export class VariantAlreadyExists extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "VariantAlreadyExists", { code: S.Number, message: S.String, }, ), [{ code: 5409 }], ) {} export class VariantNameNotAllowed extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "VariantNameNotAllowed", { code: S.Number, message: S.String, }, ), [{ code: 5400 }], ) {} export class VariantNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("VariantNotFound", { code: S.Number, message: S.String, }), [{ code: 5401 }, { status: 404, message: { includes: "not found" } }], ) {} export interface CreateV1Request { /** Account identifier tag. */ accountId: string; } export const CreateV1Request = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/images/v1", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateV1Request", }) as any as S.Schema; export type V1CreateResponseVariantsList = Array; export const V1CreateResponseVariantsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateV1Response { /** Image unique identifier. */ id?: string | null; /** Can set the creator field with an internal user ID. */ creator?: string | null; /** Image file name. */ filename?: string | null; /** User modifiable key-value store. Can be used for keeping references to another system of record for managing images. Metadata must not exceed 1024 bytes. */ meta?: unknown | null; /** Indicates whether the image can be a accessed only using it's UID. If set to true, a signed token needs to be generated with a signing key to view the image. */ requireSignedURLs?: boolean | null; /** When the media item was uploaded. */ uploaded?: string | null; /** Object specifying available variants for an image. */ variants?: V1CreateResponseVariantsList | null; } export const CreateV1Response = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), creator: S.optional(S.NullOr(S.String)), filename: S.optional(S.NullOr(S.String)), meta: S.optional(S.NullOr(S.Unknown)), requireSignedURLs: S.optional(S.NullOr(S.Boolean)), uploaded: S.optional(S.NullOr(S.String)), variants: S.optional(S.NullOr(V1CreateResponseVariantsList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateV1Response", }) as any as S.Schema; export type V1VariantsCreateRequestOptionsFit = | "scale-down" | "contain" | "cover" | "crop" | "pad"; export const V1VariantsCreateRequestOptionsFit = /*@__PURE__*/ S.String; export type V1VariantsCreateRequestOptionsMetadata = | "keep" | "copyright" | "none"; export const V1VariantsCreateRequestOptionsMetadata = /*@__PURE__*/ S.String; export interface V1VariantsCreateRequestOptions { /** The fit property describes how the width and height dimensions should be interpreted. */ fit: V1VariantsCreateRequestOptionsFit | (string & {}); /** Maximum height in image pixels. */ height: number; /** What EXIF data should be preserved in the output image. */ metadata: V1VariantsCreateRequestOptionsMetadata | (string & {}); /** Maximum width in image pixels. */ width: number; } export const V1VariantsCreateRequestOptions = /*@__PURE__*/ S.suspend(() => S.Struct({ fit: V1VariantsCreateRequestOptionsFit, height: S.Number, metadata: V1VariantsCreateRequestOptionsMetadata, width: S.Number, }), ).annotate({ identifier: "V1VariantsCreateRequestOptions", }) as any as S.Schema; export interface CreateV1VariantRequest { /** Account identifier tag. */ accountId: string; id: string; /** Allows you to define image resizing sizes for different use cases. */ options: V1VariantsCreateRequestOptions; /** Indicates whether the variant can access an image without a signature, regardless of image access control. */ neverRequireSignedURLs?: boolean; } export const CreateV1VariantRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), id: S.String, options: V1VariantsCreateRequestOptions, neverRequireSignedURLs: S.optional(S.Boolean), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/images/v1/variants", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateV1VariantRequest", }) as any as S.Schema; export type V1VariantsCreateResponseVariantOptionsFit = | "scale-down" | "contain" | "cover" | "crop" | "pad"; export const V1VariantsCreateResponseVariantOptionsFit = /*@__PURE__*/ S.String; export type V1VariantsCreateResponseVariantOptionsMetadata = | "keep" | "copyright" | "none"; export const V1VariantsCreateResponseVariantOptionsMetadata = /*@__PURE__*/ S.String; export interface V1VariantsCreateResponseVariantOptions { /** The fit property describes how the width and height dimensions should be interpreted. */ fit: V1VariantsCreateResponseVariantOptionsFit; /** Maximum height in image pixels. */ height: number; /** What EXIF data should be preserved in the output image. */ metadata: V1VariantsCreateResponseVariantOptionsMetadata; /** Maximum width in image pixels. */ width: number; } export const V1VariantsCreateResponseVariantOptions = /*@__PURE__*/ S.suspend( () => S.Struct({ fit: V1VariantsCreateResponseVariantOptionsFit, height: S.Number, metadata: V1VariantsCreateResponseVariantOptionsMetadata, width: S.Number, }), ).annotate({ identifier: "V1VariantsCreateResponseVariantOptions", }) as any as S.Schema; export interface V1VariantsCreateResponseVariant { id: string; /** Allows you to define image resizing sizes for different use cases. */ options: V1VariantsCreateResponseVariantOptions; /** Indicates whether the variant can access an image without a signature, regardless of image access control. */ neverRequireSignedURLs?: boolean | null; } export const V1VariantsCreateResponseVariant = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, options: V1VariantsCreateResponseVariantOptions, neverRequireSignedURLs: S.optional(S.NullOr(S.Boolean)), }), ).annotate({ identifier: "V1VariantsCreateResponseVariant", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateV1VariantResponse { variant?: V1VariantsCreateResponseVariant | null; } export const CreateV1VariantResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ variant: S.optional(S.NullOr(V1VariantsCreateResponseVariant)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateV1VariantResponse", }) as any as S.Schema; export interface CreateV2DirectUploadRequest { /** Account identifier tag. */ accountId: string; } export const CreateV2DirectUploadRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/images/v2/direct_upload", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateV2DirectUploadRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateV2DirectUploadResponse { /** Image unique identifier. */ id?: string | null; /** The URL the unauthenticated upload can be performed to using a single HTTP POST (multipart/form-data) request. */ uploadURL?: string | null; } export const CreateV2DirectUploadResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), uploadURL: S.optional(S.NullOr(S.String)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateV2DirectUploadResponse", }) as any as S.Schema; export interface DeleteV1Request { /** Account identifier tag. */ accountId: string; /** Image unique identifier. */ imageId: string; } export const DeleteV1Request = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), imageId: S.String.pipe(T.Label("image_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/images/v1/{image_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteV1Request", }) as any as S.Schema; export type DeleteV1Response = unknown; export const DeleteV1Response = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteV1Response", }) as any as S.Schema; export interface DeleteV1KeyRequest { /** Account identifier tag. */ accountId: string; signingKeyName: string; } export const DeleteV1KeyRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), signingKeyName: S.String.pipe(T.Label("signing_key_name")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/images/v1/keys/{signing_key_name}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteV1KeyRequest", }) as any as S.Schema; export interface V1KeysDeleteResponseKeysItem { /** Key name. */ name?: string | null; /** Key value. */ value?: string | null; } export const V1KeysDeleteResponseKeysItem = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.optional(S.NullOr(S.String)), value: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "V1KeysDeleteResponseKeysItem", }) as any as S.Schema; export type V1KeysDeleteResponseKeysList = Array; export const V1KeysDeleteResponseKeysList = /*@__PURE__*/ S.Array( V1KeysDeleteResponseKeysItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteV1KeyResponse { keys?: V1KeysDeleteResponseKeysList | null; } export const DeleteV1KeyResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ keys: S.optional(S.NullOr(V1KeysDeleteResponseKeysList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteV1KeyResponse", }) as any as S.Schema; export interface DeleteV1VariantRequest { /** Account identifier tag. */ accountId: string; variantId: string; } export const DeleteV1VariantRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), variantId: S.String.pipe(T.Label("variant_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/images/v1/variants/{variant_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteV1VariantRequest", }) as any as S.Schema; export type DeleteV1VariantResponse = unknown; export const DeleteV1VariantResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteV1VariantResponse", }) as any as S.Schema; export interface GetV1Request { /** Account identifier tag. */ accountId: string; /** Image unique identifier. */ imageId: string; } export const GetV1Request = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), imageId: S.String.pipe(T.Label("image_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/images/v1/{image_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetV1Request" }) as any as S.Schema; export type V1GetResponseVariantsList = Array; export const V1GetResponseVariantsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetV1Response { /** Image unique identifier. */ id?: string | null; /** Can set the creator field with an internal user ID. */ creator?: string | null; /** Image file name. */ filename?: string | null; /** User modifiable key-value store. Can be used for keeping references to another system of record for managing images. Metadata must not exceed 1024 bytes. */ meta?: unknown | null; /** Indicates whether the image can be a accessed only using it's UID. If set to true, a signed token needs to be generated with a signing key to view the image. */ requireSignedURLs?: boolean | null; /** When the media item was uploaded. */ uploaded?: string | null; /** Object specifying available variants for an image. */ variants?: V1GetResponseVariantsList | null; } export const GetV1Response = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), creator: S.optional(S.NullOr(S.String)), filename: S.optional(S.NullOr(S.String)), meta: S.optional(S.NullOr(S.Unknown)), requireSignedURLs: S.optional(S.NullOr(S.Boolean)), uploaded: S.optional(S.NullOr(S.String)), variants: S.optional(S.NullOr(V1GetResponseVariantsList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetV1Response" }) as any as S.Schema; export interface GetV1BlobRequest { /** Account identifier tag. */ accountId: string; /** Image unique identifier. */ imageId: string; } export const GetV1BlobRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), imageId: S.String.pipe(T.Label("image_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/images/v1/{image_id}/blob", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetV1BlobRequest", }) as any as S.Schema; export interface GetV1BlobResponse {} export const GetV1BlobResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetV1BlobResponse", }) as any as S.Schema; export interface GetV1StatRequest { /** Account identifier tag. */ accountId: string; } export const GetV1StatRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/images/v1/stats", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetV1StatRequest", }) as any as S.Schema; export interface V1StatsGetResponseCount { /** Cloudflare Images allowed usage. */ allowed?: number | null; /** Cloudflare Images current usage. */ current?: number | null; } export const V1StatsGetResponseCount = /*@__PURE__*/ S.suspend(() => S.Struct({ allowed: S.optional(S.NullOr(S.Number)), current: S.optional(S.NullOr(S.Number)), }), ).annotate({ identifier: "V1StatsGetResponseCount", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetV1StatResponse { count?: V1StatsGetResponseCount | null; } export const GetV1StatResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ count: S.optional(S.NullOr(V1StatsGetResponseCount)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetV1StatResponse", }) as any as S.Schema; export interface GetV1VariantRequest { /** Account identifier tag. */ accountId: string; variantId: string; } export const GetV1VariantRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), variantId: S.String.pipe(T.Label("variant_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/images/v1/variants/{variant_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetV1VariantRequest", }) as any as S.Schema; export type V1VariantsGetResponseVariantOptionsFit = | "scale-down" | "contain" | "cover" | "crop" | "pad"; export const V1VariantsGetResponseVariantOptionsFit = /*@__PURE__*/ S.String; export type V1VariantsGetResponseVariantOptionsMetadata = | "keep" | "copyright" | "none"; export const V1VariantsGetResponseVariantOptionsMetadata = /*@__PURE__*/ S.String; export interface V1VariantsGetResponseVariantOptions { /** The fit property describes how the width and height dimensions should be interpreted. */ fit: V1VariantsGetResponseVariantOptionsFit; /** Maximum height in image pixels. */ height: number; /** What EXIF data should be preserved in the output image. */ metadata: V1VariantsGetResponseVariantOptionsMetadata; /** Maximum width in image pixels. */ width: number; } export const V1VariantsGetResponseVariantOptions = /*@__PURE__*/ S.suspend(() => S.Struct({ fit: V1VariantsGetResponseVariantOptionsFit, height: S.Number, metadata: V1VariantsGetResponseVariantOptionsMetadata, width: S.Number, }), ).annotate({ identifier: "V1VariantsGetResponseVariantOptions", }) as any as S.Schema; export interface V1VariantsGetResponseVariant { id: string; /** Allows you to define image resizing sizes for different use cases. */ options: V1VariantsGetResponseVariantOptions; /** Indicates whether the variant can access an image without a signature, regardless of image access control. */ neverRequireSignedURLs?: boolean | null; } export const V1VariantsGetResponseVariant = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, options: V1VariantsGetResponseVariantOptions, neverRequireSignedURLs: S.optional(S.NullOr(S.Boolean)), }), ).annotate({ identifier: "V1VariantsGetResponseVariant", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetV1VariantResponse { variant?: V1VariantsGetResponseVariant | null; } export const GetV1VariantResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ variant: S.optional(S.NullOr(V1VariantsGetResponseVariant)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetV1VariantResponse", }) as any as S.Schema; export interface ListV1KeysRequest { /** Account identifier tag. */ accountId: string; } export const ListV1KeysRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/images/v1/keys", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListV1KeysRequest", }) as any as S.Schema; export type V1KeysListResponseKeysItem = V1KeysDeleteResponseKeysItem; export const V1KeysListResponseKeysItem = V1KeysDeleteResponseKeysItem; export type V1KeysListResponseKeysList = Array; export const V1KeysListResponseKeysList = /*@__PURE__*/ S.Array( V1KeysDeleteResponseKeysItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface ListV1KeysResponse { keys?: V1KeysListResponseKeysList | null; } export const ListV1KeysResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ keys: S.optional(S.NullOr(V1KeysListResponseKeysList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListV1KeysResponse", }) as any as S.Schema; export interface ListV1sRequest { /** Account identifier tag. */ accountId: string; /** Internal user ID set within the creator field. Setting to empty string "" will return images where creator field is not set */ creator?: string; /** Page number of paginated results. */ page?: number; /** Number of items per page. */ perPage?: number; } export const ListV1sRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), creator: S.optional(S.String.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/images/v1", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListV1sRequest" }) as any as S.Schema; export type V1ListResponseImagesItemVariantsList = Array; export const V1ListResponseImagesItemVariantsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface V1ListResponseImagesItem { /** Image unique identifier. */ id?: string | null; /** Can set the creator field with an internal user ID. */ creator?: string | null; /** Image file name. */ filename?: string | null; /** User modifiable key-value store. Can be used for keeping references to another system of record for managing images. Metadata must not exceed 1024 bytes. */ meta?: unknown | null; /** Indicates whether the image can be a accessed only using it's UID. If set to true, a signed token needs to be generated with a signing key to view the image. */ requireSignedURLs?: boolean | null; /** When the media item was uploaded. */ uploaded?: string | null; /** Object specifying available variants for an image. */ variants?: V1ListResponseImagesItemVariantsList | null; } export const V1ListResponseImagesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), creator: S.optional(S.NullOr(S.String)), filename: S.optional(S.NullOr(S.String)), meta: S.optional(S.NullOr(S.Unknown)), requireSignedURLs: S.optional(S.NullOr(S.Boolean)), uploaded: S.optional(S.NullOr(S.String)), variants: S.optional(S.NullOr(V1ListResponseImagesItemVariantsList)), }), ).annotate({ identifier: "V1ListResponseImagesItem", }) as any as S.Schema; export type V1ListResponseImagesList = Array; export const V1ListResponseImagesList = /*@__PURE__*/ S.Array( V1ListResponseImagesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface ListV1sResponse { images?: V1ListResponseImagesList | null; } export const ListV1sResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ images: S.optional(S.NullOr(V1ListResponseImagesList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListV1sResponse", }) as any as S.Schema; export interface ListV1VariantsRequest { /** Account identifier tag. */ accountId: string; } export const ListV1VariantsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/images/v1/variants", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListV1VariantsRequest", }) as any as S.Schema; export type V1VariantsListResponseVariantsHeroOptionsFit = | "scale-down" | "contain" | "cover" | "crop" | "pad"; export const V1VariantsListResponseVariantsHeroOptionsFit = /*@__PURE__*/ S.String; export type V1VariantsListResponseVariantsHeroOptionsMetadata = | "keep" | "copyright" | "none"; export const V1VariantsListResponseVariantsHeroOptionsMetadata = /*@__PURE__*/ S.String; export interface V1VariantsListResponseVariantsHeroOptions { /** The fit property describes how the width and height dimensions should be interpreted. */ fit: V1VariantsListResponseVariantsHeroOptionsFit; /** Maximum height in image pixels. */ height: number; /** What EXIF data should be preserved in the output image. */ metadata: V1VariantsListResponseVariantsHeroOptionsMetadata; /** Maximum width in image pixels. */ width: number; } export const V1VariantsListResponseVariantsHeroOptions = /*@__PURE__*/ S.suspend(() => S.Struct({ fit: V1VariantsListResponseVariantsHeroOptionsFit, height: S.Number, metadata: V1VariantsListResponseVariantsHeroOptionsMetadata, width: S.Number, }), ).annotate({ identifier: "V1VariantsListResponseVariantsHeroOptions", }) as any as S.Schema; export interface V1VariantsListResponseVariantsHero { id: string; /** Allows you to define image resizing sizes for different use cases. */ options: V1VariantsListResponseVariantsHeroOptions; /** Indicates whether the variant can access an image without a signature, regardless of image access control. */ neverRequireSignedURLs?: boolean | null; } export const V1VariantsListResponseVariantsHero = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, options: V1VariantsListResponseVariantsHeroOptions, neverRequireSignedURLs: S.optional(S.NullOr(S.Boolean)), }), ).annotate({ identifier: "V1VariantsListResponseVariantsHero", }) as any as S.Schema; export interface V1VariantsListResponseVariants { hero?: V1VariantsListResponseVariantsHero | null; } export const V1VariantsListResponseVariants = /*@__PURE__*/ S.suspend(() => S.Struct({ hero: S.optional(S.NullOr(V1VariantsListResponseVariantsHero)), }), ).annotate({ identifier: "V1VariantsListResponseVariants", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface ListV1VariantsResponse { variants?: V1VariantsListResponseVariants | null; } export const ListV1VariantsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ variants: S.optional(S.NullOr(V1VariantsListResponseVariants)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListV1VariantsResponse", }) as any as S.Schema; export interface V2ListRequestMeta { /** Optional metadata filter(s). Multiple filters can be combined with AND logic. */ fieldOperator__?: unknown; } export const V2ListRequestMeta = /*@__PURE__*/ S.suspend(() => S.Struct({ fieldOperator__: S.optional(S.Unknown.pipe(T.Body("[]"))), }), ).annotate({ identifier: "V2ListRequestMeta", }) as any as S.Schema; export type V2ListRequestSortOrder = "asc" | "desc"; export const V2ListRequestSortOrder = /*@__PURE__*/ S.String; export interface ListV2sRequest { /** Account identifier tag. */ accountId: string; /** Continuation token to fetch next page. Passed as a query param when requesting List V2 api endpoint. */ continuationToken?: string; /** Internal user ID set within the creator field. Setting to empty string "" will return images where creator field is not set */ creator?: string; meta?: V2ListRequestMeta; /** Number of items per page */ perPage?: number; /** Sorting order by upload time */ sortOrder?: V2ListRequestSortOrder | (string & {}); } export const ListV2sRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), continuationToken: S.optional(S.String.pipe(T.Query("continuation_token"))), creator: S.optional(S.String.pipe(T.Query())), meta: S.optional(V2ListRequestMeta.pipe(T.DeepQuery("meta"))), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), sortOrder: S.optional(V2ListRequestSortOrder.pipe(T.Query("sort_order"))), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/images/v2", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListV2sRequest" }) as any as S.Schema; export type V2ListResponseImagesItemVariantsList = Array; export const V2ListResponseImagesItemVariantsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface V2ListResponseImagesItem { /** Image unique identifier. */ id?: string | null; /** Can set the creator field with an internal user ID. */ creator?: string | null; /** Image file name. */ filename?: string | null; /** User modifiable key-value store. Can be used for keeping references to another system of record for managing images. Metadata must not exceed 1024 bytes. */ meta?: unknown | null; /** Indicates whether the image can be a accessed only using it's UID. If set to true, a signed token needs to be generated with a signing key to view the image. */ requireSignedURLs?: boolean | null; /** When the media item was uploaded. */ uploaded?: string | null; /** Object specifying available variants for an image. */ variants?: V2ListResponseImagesItemVariantsList | null; } export const V2ListResponseImagesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), creator: S.optional(S.NullOr(S.String)), filename: S.optional(S.NullOr(S.String)), meta: S.optional(S.NullOr(S.Unknown)), requireSignedURLs: S.optional(S.NullOr(S.Boolean)), uploaded: S.optional(S.NullOr(S.String)), variants: S.optional(S.NullOr(V2ListResponseImagesItemVariantsList)), }), ).annotate({ identifier: "V2ListResponseImagesItem", }) as any as S.Schema; export type V2ListResponseImagesList = Array; export const V2ListResponseImagesList = /*@__PURE__*/ S.Array( V2ListResponseImagesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface ListV2sResponse { /** Continuation token to fetch next page. Passed as a query param when requesting List V2 api endpoint. */ continuationToken?: string | null; images?: V2ListResponseImagesList | null; } export const ListV2sResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ continuationToken: S.optional( S.NullOr(S.String).pipe(T.Body("continuation_token")), ), images: S.optional(S.NullOr(V2ListResponseImagesList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListV2sResponse", }) as any as S.Schema; export interface PatchV1Request { /** Account identifier tag. */ accountId: string; /** Image unique identifier. */ imageId: string; /** Can set the creator field with an internal user ID. */ creator?: string; /** User modifiable key-value store. Can be used for keeping references to another system of record for managing images. No change if not specified. */ metadata?: unknown; /** Indicates whether the image can be accessed using only its UID. If set to `true`, a signed token needs to be generated with a signing key to view the image. Returns a new UID on a change. No change if not specified. */ requireSignedURLs?: boolean; } export const PatchV1Request = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), imageId: S.String.pipe(T.Label("image_id")), creator: S.optional(S.String), metadata: S.optional(S.Unknown), requireSignedURLs: S.optional(S.Boolean), }) .pipe( T.Http({ method: "PATCH", uri: "/accounts/{account_id}/images/v1/{image_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchV1Request" }) as any as S.Schema; export type V1EditResponseVariantsList = Array; export const V1EditResponseVariantsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PatchV1Response { /** Image unique identifier. */ id?: string | null; /** Can set the creator field with an internal user ID. */ creator?: string | null; /** Image file name. */ filename?: string | null; /** User modifiable key-value store. Can be used for keeping references to another system of record for managing images. Metadata must not exceed 1024 bytes. */ meta?: unknown | null; /** Indicates whether the image can be a accessed only using it's UID. If set to true, a signed token needs to be generated with a signing key to view the image. */ requireSignedURLs?: boolean | null; /** When the media item was uploaded. */ uploaded?: string | null; /** Object specifying available variants for an image. */ variants?: V1EditResponseVariantsList | null; } export const PatchV1Response = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), creator: S.optional(S.NullOr(S.String)), filename: S.optional(S.NullOr(S.String)), meta: S.optional(S.NullOr(S.Unknown)), requireSignedURLs: S.optional(S.NullOr(S.Boolean)), uploaded: S.optional(S.NullOr(S.String)), variants: S.optional(S.NullOr(V1EditResponseVariantsList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchV1Response", }) as any as S.Schema; export type V1VariantsEditRequestOptionsFit = | "scale-down" | "contain" | "cover" | "crop" | "pad"; export const V1VariantsEditRequestOptionsFit = /*@__PURE__*/ S.String; export type V1VariantsEditRequestOptionsMetadata = | "keep" | "copyright" | "none"; export const V1VariantsEditRequestOptionsMetadata = /*@__PURE__*/ S.String; export interface V1VariantsEditRequestOptions { /** The fit property describes how the width and height dimensions should be interpreted. */ fit: V1VariantsEditRequestOptionsFit | (string & {}); /** Maximum height in image pixels. */ height: number; /** What EXIF data should be preserved in the output image. */ metadata: V1VariantsEditRequestOptionsMetadata | (string & {}); /** Maximum width in image pixels. */ width: number; } export const V1VariantsEditRequestOptions = /*@__PURE__*/ S.suspend(() => S.Struct({ fit: V1VariantsEditRequestOptionsFit, height: S.Number, metadata: V1VariantsEditRequestOptionsMetadata, width: S.Number, }), ).annotate({ identifier: "V1VariantsEditRequestOptions", }) as any as S.Schema; export interface PatchV1VariantRequest { /** Account identifier tag. */ accountId: string; variantId: string; /** Allows you to define image resizing sizes for different use cases. */ options: V1VariantsEditRequestOptions; /** Indicates whether the variant can access an image without a signature, regardless of image access control. */ neverRequireSignedURLs?: boolean; } export const PatchV1VariantRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), variantId: S.String.pipe(T.Label("variant_id")), options: V1VariantsEditRequestOptions, neverRequireSignedURLs: S.optional(S.Boolean), }) .pipe( T.Http({ method: "PATCH", uri: "/accounts/{account_id}/images/v1/variants/{variant_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchV1VariantRequest", }) as any as S.Schema; export type V1VariantsEditResponseVariantOptionsFit = | "scale-down" | "contain" | "cover" | "crop" | "pad"; export const V1VariantsEditResponseVariantOptionsFit = /*@__PURE__*/ S.String; export type V1VariantsEditResponseVariantOptionsMetadata = | "keep" | "copyright" | "none"; export const V1VariantsEditResponseVariantOptionsMetadata = /*@__PURE__*/ S.String; export interface V1VariantsEditResponseVariantOptions { /** The fit property describes how the width and height dimensions should be interpreted. */ fit: V1VariantsEditResponseVariantOptionsFit; /** Maximum height in image pixels. */ height: number; /** What EXIF data should be preserved in the output image. */ metadata: V1VariantsEditResponseVariantOptionsMetadata; /** Maximum width in image pixels. */ width: number; } export const V1VariantsEditResponseVariantOptions = /*@__PURE__*/ S.suspend( () => S.Struct({ fit: V1VariantsEditResponseVariantOptionsFit, height: S.Number, metadata: V1VariantsEditResponseVariantOptionsMetadata, width: S.Number, }), ).annotate({ identifier: "V1VariantsEditResponseVariantOptions", }) as any as S.Schema; export interface V1VariantsEditResponseVariant { id: string; /** Allows you to define image resizing sizes for different use cases. */ options: V1VariantsEditResponseVariantOptions; /** Indicates whether the variant can access an image without a signature, regardless of image access control. */ neverRequireSignedURLs?: boolean | null; } export const V1VariantsEditResponseVariant = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, options: V1VariantsEditResponseVariantOptions, neverRequireSignedURLs: S.optional(S.NullOr(S.Boolean)), }), ).annotate({ identifier: "V1VariantsEditResponseVariant", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PatchV1VariantResponse { variant?: V1VariantsEditResponseVariant | null; } export const PatchV1VariantResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ variant: S.optional(S.NullOr(V1VariantsEditResponseVariant)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PatchV1VariantResponse", }) as any as S.Schema; export interface PutV1KeyRequest { /** Account identifier tag. */ accountId: string; signingKeyName: string; } export const PutV1KeyRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), signingKeyName: S.String.pipe(T.Label("signing_key_name")), }) .pipe( T.Http({ method: "PUT", uri: "/accounts/{account_id}/images/v1/keys/{signing_key_name}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PutV1KeyRequest", }) as any as S.Schema; export type V1KeysUpdateResponseKeysItem = V1KeysDeleteResponseKeysItem; export const V1KeysUpdateResponseKeysItem = V1KeysDeleteResponseKeysItem; export type V1KeysUpdateResponseKeysList = Array; export const V1KeysUpdateResponseKeysList = /*@__PURE__*/ S.Array( V1KeysDeleteResponseKeysItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PutV1KeyResponse { keys?: V1KeysUpdateResponseKeysList | null; } export const PutV1KeyResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ keys: S.optional(S.NullOr(V1KeysUpdateResponseKeysList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PutV1KeyResponse", }) as any as S.Schema; export type CreateV1Error = ImagesAccessNotEnabled | CloudflareOpError; /** Upload an image to CF Images. Images up to 10 Megabytes can be uploaded using a single HTTP POST (multipart/form-data) request by sending an image file or passing a URL accessible to the API. */ export const createV1: API.OperationMethod< CreateV1Request, CreateV1Response, CreateV1Error, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateV1Request, output: CreateV1Response, errors: [ImagesAccessNotEnabled, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateV1VariantError = | ImagesAccessNotEnabled | VariantNameNotAllowed | VariantAlreadyExists | CloudflareOpError; /** Create a CF Images variant that allows you to resize images for different use cases. */ export const createV1Variant: API.OperationMethod< CreateV1VariantRequest, CreateV1VariantResponse, CreateV1VariantError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateV1VariantRequest, output: CreateV1VariantResponse, errors: [ ImagesAccessNotEnabled, VariantNameNotAllowed, VariantAlreadyExists, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateV2DirectUploadError = | ImagesAccessNotEnabled | ImageAlreadyExists | InvalidUploadFormat | CloudflareOpError; /** Direct uploads allow users to upload images without API keys. A common use case are web apps, client-side applications, or mobile devices where users upload content directly to Cloudflare Images. This method creates a draft record for a future image. It returns an upload URL and an image identifier. To verify if the image itself has been uploaded, send an image details request (accounts/:account_identifier/images/v1/:identifier), and check that the `draft: true` property is not present. */ export const createV2DirectUpload: API.OperationMethod< CreateV2DirectUploadRequest, CreateV2DirectUploadResponse, CreateV2DirectUploadError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateV2DirectUploadRequest, output: CreateV2DirectUploadResponse, errors: [ ImagesAccessNotEnabled, ImageAlreadyExists, InvalidUploadFormat, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteV1Error = | ImagesAccessNotEnabled | ImageNotFound | CloudflareOpError; /** Delete an image on Cloudflare Images. On success, all copies of the image are deleted and purged from cache. */ export const deleteV1: API.OperationMethod< DeleteV1Request, DeleteV1Response, DeleteV1Error, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteV1Request, output: DeleteV1Response, errors: [ ImagesAccessNotEnabled, ImageNotFound, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteV1KeyError = | ImagesAccessNotEnabled | KeyNotFound | CloudflareOpError; /** Delete a CF Images signing key with specified name. Returns all keys available. When the last key is removed, a new default signing key will be generated. */ export const deleteV1Key: API.OperationMethod< DeleteV1KeyRequest, DeleteV1KeyResponse, DeleteV1KeyError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteV1KeyRequest, output: DeleteV1KeyResponse, errors: [ ImagesAccessNotEnabled, KeyNotFound, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteV1VariantError = | ImagesAccessNotEnabled | VariantNameNotAllowed | VariantNotFound | CloudflareOpError; /** Delete a CF Images variant. This will purge the cache for all images associated with the variant. */ export const deleteV1Variant: API.OperationMethod< DeleteV1VariantRequest, DeleteV1VariantResponse, DeleteV1VariantError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteV1VariantRequest, output: DeleteV1VariantResponse, errors: [ ImagesAccessNotEnabled, VariantNameNotAllowed, VariantNotFound, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetV1Error = | ImagesAccessNotEnabled | ImageNotFound | CloudflareOpError; /** Fetch details for a CF Images image. */ export const getV1: API.OperationMethod< GetV1Request, GetV1Response, GetV1Error, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetV1Request, output: GetV1Response, errors: [ ImagesAccessNotEnabled, ImageNotFound, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetV1BlobError = | ImagesAccessNotEnabled | ImageNotFound | CloudflareOpError; /** Download an image from CF Images. For most images this will be the originally uploaded file. For larger images it can be a near-lossless version of the original. */ export const getV1Blob: API.OperationMethod< GetV1BlobRequest, GetV1BlobResponse, GetV1BlobError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetV1BlobRequest, output: GetV1BlobResponse, errors: [ ImagesAccessNotEnabled, ImageNotFound, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetV1StatError = ImagesAccessNotEnabled | CloudflareOpError; /** Fetch image statistics details for Cloudflare Images. The returned statistics detail storage usage, including the current image count vs this account's allowance. */ export const getV1Stat: API.OperationMethod< GetV1StatRequest, GetV1StatResponse, GetV1StatError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetV1StatRequest, output: GetV1StatResponse, errors: [ImagesAccessNotEnabled, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetV1VariantError = | ImagesAccessNotEnabled | VariantNameNotAllowed | VariantNotFound | CloudflareOpError; /** Fetch details for a CF Images variant. */ export const getV1Variant: API.OperationMethod< GetV1VariantRequest, GetV1VariantResponse, GetV1VariantError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetV1VariantRequest, output: GetV1VariantResponse, errors: [ ImagesAccessNotEnabled, VariantNameNotAllowed, VariantNotFound, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListV1KeysError = ImagesAccessNotEnabled | CloudflareOpError; /** List your CF Images signing keys. */ export const listV1Keys: API.OperationMethod< ListV1KeysRequest, ListV1KeysResponse, ListV1KeysError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListV1KeysRequest, output: ListV1KeysResponse, errors: [ImagesAccessNotEnabled, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListV1sError = ImagesAccessNotEnabled | CloudflareOpError; /** List up to 100 images with one request. Use the optional parameters below to get a specific range of images. */ export const listV1s: API.OperationMethod< ListV1sRequest, ListV1sResponse, ListV1sError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListV1sRequest, output: ListV1sResponse, errors: [ImagesAccessNotEnabled, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListV1VariantsError = ImagesAccessNotEnabled | CloudflareOpError; /** List existing CF Images variants. */ export const listV1Variants: API.OperationMethod< ListV1VariantsRequest, ListV1VariantsResponse, ListV1VariantsError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListV1VariantsRequest, output: ListV1VariantsResponse, errors: [ImagesAccessNotEnabled, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListV2sError = ImagesAccessNotEnabled | CloudflareOpError; /** List up to 10000 images from CF Images, with up to 1000 results per page. Use the optional parameters below to get a specific range of images. Pagination is supported via continuation_token. **Metadata Filtering (Optional):** You can optionally filter images by custom metadata fields using the `meta.[]=` syntax. **Supported Operators:** - `eq` / `eq:string` / `eq:number` / `eq:boolean` - Exact match - `gt` / `gt:number` - Greater than (number only) - `gte` / `gte:number` - Greater than or equal (number only) - `lt` / `lt:number` - Less than (number only) - `lte` / `lte:number` - Less than or equal (number only) - `in` / `in:string` / `in:number` - Match any value in list (pipe-separated) **Metadata Filter Constraints:** - Maximum 5 metadata filters per request - Maximum 5 levels of nesting (e.g., `meta.first.second.third.fourth.fifth`) - Maximum 10 elements for list operators (`in`) - Supports string, number, and boolean value types - Range operators (`gt`, `gte`, `lt`, `lte`) only accept numeric values **Filter Consistency:** Filters are combined with AND logic. The system does not validate whether filter combinations are logically consistent. For example, `meta.priority[eq:number]=5&meta.priority[lte:number]=3` will return zero results because no value can satisfy both conditions simultaneously. It is the caller's responsibility to ensure filter combinations make sense. **Examples:** ``` # List all images /images/v2 # Filter by metadata [eq] /images/v2?meta.status[eq:string]=active # Filter by metadata [in] /images/v2?meta.status[in]=pending|deleted|flagged # Filter by metadata [in:number] /images/v2?meta.ratings[in:number]=4|5 # Filter by metadata range [gte:number] /images/v2?meta.priority[gte:number]=1 # Filter by bounded range /images/v2?meta.priority[gte:number]=1&meta.priority[lte:number]=5 # Filter by nested metadata /images/v2?meta.region.name[eq]=eu-west # Combine metadata filters with creator /images/v2?meta.status[eq]=active&creator=user123 # Multiple metadata filters (AND logic) /images/v2?meta.status[eq]=active&meta.priority[eq:number]=5 ``` */ export const listV2s: API.OperationMethod< ListV2sRequest, ListV2sResponse, ListV2sError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListV2sRequest, output: ListV2sResponse, errors: [ImagesAccessNotEnabled, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PatchV1Error = | ImagesAccessNotEnabled | ImageNotFound | CloudflareOpError; /** Update a CF Images image's metadata, creator, or access control. On access control change, all copies of the image are purged from cache. */ export const patchV1: API.OperationMethod< PatchV1Request, PatchV1Response, PatchV1Error, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchV1Request, output: PatchV1Response, errors: [ ImagesAccessNotEnabled, ImageNotFound, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PatchV1VariantError = | ImagesAccessNotEnabled | VariantNameNotAllowed | VariantNotFound | CloudflareOpError; /** Update a CF Images variant. This will purge the cache for all images associated with the variant. */ export const patchV1Variant: API.OperationMethod< PatchV1VariantRequest, PatchV1VariantResponse, PatchV1VariantError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PatchV1VariantRequest, output: PatchV1VariantResponse, errors: [ ImagesAccessNotEnabled, VariantNameNotAllowed, VariantNotFound, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PutV1KeyError = ImagesAccessNotEnabled | CloudflareOpError; /** Create a new CF Images signing key with specified name. Returns all keys available. */ export const putV1Key: API.OperationMethod< PutV1KeyRequest, PutV1KeyResponse, PutV1KeyError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PutV1KeyRequest, output: PutV1KeyResponse, errors: [ImagesAccessNotEnabled, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, }));