import type { StepUser } from '../types/execution-context'; import type { CollectionSchema, RecordData } from '../types/validated/collection'; export type Id = string | number; export type Limit = { limit: number; } | { limit: null; }; export type GetRecordQuery = { collection: string; id: Id[]; fields?: string[]; }; export type UpdateRecordQuery = { collection: string; id: Id[]; values: Record; }; export type GetRelatedDataQuery = { collection: string; id: Id[]; relation: string; relatedSchema: CollectionSchema; fields?: string[]; filters?: unknown; } & Limit; export type GetSingleRelatedDataQuery = { collection: string; id: Id[]; relation: string; relatedSchema: CollectionSchema; fields?: string[]; }; export type ExecuteActionQuery = { collection: string; action: string; id?: Id[]; values?: Record; approvalMessage?: string; }; export type GetActionFormQuery = { collection: string; action: string; id?: Id[]; values?: Record; }; export type ActionFormField = { name: string; /** Verbatim from the agent, so a list type is `['String']` rather than `'StringList'`. */ type: string | [string]; value?: unknown; isRequired: boolean; enumValues?: string[]; allowedValues?: { value: string | number | null; label: string; }[]; description?: string; }; export type ActionForm = { fields: ActionFormField[]; canExecute: boolean; requiredFields: string[]; skippedFields: string[]; }; export type GetActionFormInfoQuery = { collection: string; action: string; id: Id[]; }; export type ResolvePolymorphicTypeQuery = { collection: string; id: Id[]; relation: string; }; export type ExecuteActionResult = { approvalRequested: true; approvalRequest?: { id: string; }; } | { result: unknown; }; export type ActionCaller = { user: StepUser; forestServerToken?: string; }; export interface AgentPort { getRecord(query: GetRecordQuery, user: StepUser): Promise; updateRecord(query: UpdateRecordQuery, user: StepUser): Promise; getRelatedData(query: GetRelatedDataQuery, user: StepUser): Promise; getSingleRelatedData(query: GetSingleRelatedDataQuery, user: StepUser): Promise; resolvePolymorphicType(query: ResolvePolymorphicTypeQuery, user: StepUser): Promise<{ type: string; id: string; } | null>; executeAction(query: ExecuteActionQuery, caller: ActionCaller): Promise; getActionFormInfo(query: GetActionFormInfoQuery, user: StepUser): Promise<{ hasForm: boolean; }>; getActionForm(query: GetActionFormQuery, user: StepUser): Promise; probe(): Promise; } //# sourceMappingURL=agent-port.d.ts.map