/** * Input type derivation for function binding mutations. * * Derives a protocol-agnostic field list from a function's payload metadata. * Priority: * 1. A JSON Schema on the binding config (`config.schema` or * `config.payloadSchema`) — object properties become input fields. * 2. The definition's `payload_args` ([{name, type}]) — each declared arg * becomes a nullable scalar field. * 3. Fallback: a single `payload: JSON` field. * * The derived shape is deliberately independent of graphql-js so it can be * reused for future REST payload validation. No runtime validation is * performed here — this is type derivation only. */ import type { FunctionBindingRow } from './types'; /** Named scalar kinds the plugin knows how to resolve against the schema. */ export type DerivedScalar = 'String' | 'Int' | 'Float' | 'Boolean' | 'UUID' | 'Datetime' | 'BigFloat' | 'JSON'; export interface DerivedField { name: string; scalar: DerivedScalar; required: boolean; list: boolean; description?: string; /** When set, the field is an enum of these string values. */ enumValues?: string[]; } export interface DerivedInput { /** 'schema' | 'payload-args' | 'fallback' */ source: 'schema' | 'payload-args' | 'fallback'; fields: DerivedField[]; } /** * Derive the input field list for a binding's mutation. */ export declare function deriveInputFields(binding: FunctionBindingRow): DerivedInput; /** * Assemble the invocation payload jsonb from the mutation input values. * Fallback inputs pass `payload` through verbatim; typed inputs build an * object keyed by field name, omitting undefined values. */ export declare function buildInvocationPayload(derived: DerivedInput, input: Record): unknown; /** Whether a binding's config enables GraphQL exposure (absent ⇒ enabled). */ export declare function isGraphqlEnabled(config: Record | null): boolean;