// 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> = { modifiedOn: "modified_on", }; export class Forbidden extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("Forbidden", { code: S.Number, message: S.String, }), [{ status: 403 }], ) {} export class InvalidSettingValue extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("InvalidSettingValue", { code: S.Number, message: S.String, }), [{ code: 1146, message: { includes: "origin_post_quantum_encryption" } }], ) {} export class InvalidZoneIdentifier extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "InvalidZoneIdentifier", { code: S.Number, message: S.String, }, ), [{ code: 7003 }], ) {} export interface GetOriginPostQuantumEncryptionRequest { /** Identifier. */ zoneId: string; } export const GetOriginPostQuantumEncryptionRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), }) .pipe( T.Http({ method: "GET", uri: "/zones/{zone_id}/cache/origin_post_quantum_encryption", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetOriginPostQuantumEncryptionRequest", }) as any as S.Schema; export type GetResponseId = "origin_pqe"; export const GetResponseId = /*@__PURE__*/ S.String; export type GetResponseValue = "preferred" | "supported" | "off"; export const GetResponseValue = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetOriginPostQuantumEncryptionResponse { /** The identifier of the caching setting. */ id: GetResponseId; /** Whether the setting is editable. */ editable: boolean; /** Value of the Origin Post Quantum Encryption Setting. */ value: GetResponseValue; /** Last time this setting was modified. */ modifiedOn?: string | null; } export const GetOriginPostQuantumEncryptionResponse = /*@__PURE__*/ S.suspend( () => S.Struct({ id: GetResponseId, editable: S.Boolean, value: GetResponseValue, modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetOriginPostQuantumEncryptionResponse", }) as any as S.Schema; export type UpdateRequestValue = "preferred" | "supported" | "off"; export const UpdateRequestValue = /*@__PURE__*/ S.String; export interface PutOriginPostQuantumEncryptionRequest { /** Identifier. */ zoneId: string; /** Value of the Origin Post Quantum Encryption Setting. */ value: UpdateRequestValue | (string & {}); } export const PutOriginPostQuantumEncryptionRequest = /*@__PURE__*/ S.suspend( () => S.Struct({ zoneId: S.String.pipe(T.Label("zone_id")), value: UpdateRequestValue, }) .pipe( T.Http({ method: "PUT", uri: "/zones/{zone_id}/cache/origin_post_quantum_encryption", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PutOriginPostQuantumEncryptionRequest", }) as any as S.Schema; export type UpdateResponseId = "origin_pqe"; export const UpdateResponseId = /*@__PURE__*/ S.String; export type UpdateResponseValue = "preferred" | "supported" | "off"; export const UpdateResponseValue = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface PutOriginPostQuantumEncryptionResponse { /** The identifier of the caching setting. */ id: UpdateResponseId; /** Whether the setting is editable. */ editable: boolean; /** Value of the Origin Post Quantum Encryption Setting. */ value: UpdateResponseValue; /** Last time this setting was modified. */ modifiedOn?: string | null; } export const PutOriginPostQuantumEncryptionResponse = /*@__PURE__*/ S.suspend( () => S.Struct({ id: UpdateResponseId, editable: S.Boolean, value: UpdateResponseValue, modifiedOn: S.optional(S.NullOr(S.String).pipe(T.Body("modified_on"))), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PutOriginPostQuantumEncryptionResponse", }) as any as S.Schema; export type GetOriginPostQuantumEncryptionError = | InvalidZoneIdentifier | Forbidden | CloudflareOpError; /** Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically send a Post-Quantum keyshare in the first message to the origin (for fastest connections when the origin supports and prefers PQ), supported means that PQ algorithms are advertised but only used when requested by the origin, and off means that PQ algorithms are not advertised. */ export const getOriginPostQuantumEncryption: API.OperationMethod< GetOriginPostQuantumEncryptionRequest, GetOriginPostQuantumEncryptionResponse, GetOriginPostQuantumEncryptionError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetOriginPostQuantumEncryptionRequest, output: GetOriginPostQuantumEncryptionResponse, errors: [ InvalidZoneIdentifier, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type PutOriginPostQuantumEncryptionError = | InvalidZoneIdentifier | InvalidSettingValue | Forbidden | CloudflareOpError; /** Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically send a Post-Quantum keyshare in the first message to the origin (for fastest connections when the origin supports and prefers PQ), supported means that PQ algorithms are advertised but only used when requested by the origin, and off means that PQ algorithms are not advertised. */ export const putOriginPostQuantumEncryption: API.OperationMethod< PutOriginPostQuantumEncryptionRequest, PutOriginPostQuantumEncryptionResponse, PutOriginPostQuantumEncryptionError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PutOriginPostQuantumEncryptionRequest, output: PutOriginPostQuantumEncryptionResponse, errors: [ InvalidZoneIdentifier, InvalidSettingValue, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, }));