/** * Trigger perform function types for server-side usage. * These are separate from the user-facing types in ../types to avoid circular dependencies. */ import type { ActionContext, ActionInputParameters, ConfigVarResultCollection, Inputs, TriggerPayload, TriggerResult } from "../types"; /** The result type after transforming a polling trigger result for the server. */ export type PollingTriggerServerResult = Omit>, "polledNoChanges"> & { resultType: string; }; /** The perform function type for CNI polling triggers that returns the server-expected format. */ export type CNIPollingPerformFunction = (context: ActionContext, payload: TPayload, params: ActionInputParameters) => Promise | undefined>; /** Server trigger result type - matches the non-generic TriggerResult from serverTypes/index.ts */ interface ServerTriggerBaseResult { payload: TriggerPayload; response?: { statusCode: number; contentType: string; headers?: Record; body?: string; }; instanceState?: Record; crossFlowState?: Record; executionState?: Record; integrationState?: Record; failed?: boolean; error?: Record; } interface ServerTriggerBranchingResult extends ServerTriggerBaseResult { branch: string; } type ServerTriggerResult = ServerTriggerBranchingResult | ServerTriggerBaseResult | undefined; /** Return type for component ref triggers - uses the server's TriggerResult since we delegate to invokeTrigger. */ export type ComponentRefTriggerPerformFunction = (context: ActionContext, payload: TriggerPayload, params: ActionInputParameters) => Promise; export {};