Skip to content

ChainGraph API Documentation / @badaitech/chaingraph-trpc / server / flowProcedures

Variable: flowProcedures

const flowProcedures: BuiltRouter<{ ctx: AppContext; errorShape: { code: TRPC_ERROR_CODE_NUMBER; data: { code: "PARSE_ERROR" | "BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_SUPPORTED" | "TIMEOUT" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "UNPROCESSABLE_CONTENT" | "PRECONDITION_REQUIRED" | "TOO_MANY_REQUESTS" | "CLIENT_CLOSED_REQUEST"; httpStatus: number; path?: string; stack?: string; zodError: typeToFlattenedError<any, string> | null; }; message: string; }; meta: object; transformer: true; }, DecorateCreateRouterOptions<{ addFieldObjectPort: MutationProcedure<{ input: { config?: any; flowId: string; key: string; nodeId: string; portId: string; }; meta: object; output: { flowId: string; node: INode; nodeId: string; }; }>; addNode: MutationProcedure<{ input: { flowId: string; metadata?: { category?: string; description?: string; tags?: string[]; title?: string; }; nodeType: string; portsConfig?: Map<string, any>; position: { x: number; y: number; }; }; meta: object; output: INode; }>; appendElementArrayPort: MutationProcedure<{ input: { flowId: string; nodeId: string; portId: string; value?: any; }; meta: object; output: { flowId: string; node: INode; nodeId: string; }; }>; connectPorts: MutationProcedure<{ input: { flowId: string; metadata?: { description?: string; label?: string; }; sourceNodeId: string; sourcePortId: string; targetNodeId: string; targetPortId: string; }; meta: object; output: { edgeId: string; metadata: EdgeMetadata; sourceNodeId: string; sourcePortId: string; targetNodeId: string; targetPortId: string; }; }>; create: MutationProcedure<{ input: { description?: string; folderId?: string | null; name: string; tags?: string[]; }; meta: object; output: FlowMetadata; }>; delete: MutationProcedure<{ input: { flowId: string; }; meta: object; output: { success: boolean; }; }>; edit: MutationProcedure<{ input: { description?: string; flowId: string; name?: string; tags?: string[]; }; meta: object; output: Flow; }>; fork: MutationProcedure<{ input: { flowId: string; folderId?: string | null; name?: string; }; meta: object; output: FlowMetadata; }>; get: QueryProcedure<{ input: { flowId: string; }; meta: object; output: Flow; }>; getMeta: QueryProcedure<{ input: { flowId: string; }; meta: object; output: { canFork: boolean; createdAt: Date; description?: string; folderId?: string | null; forkRule?: Record<string, any>; id?: string; isPublic?: boolean; metadata?: Record<string, unknown>; name: string; order?: number; ownerID?: string; parentId?: string; schemaVersion?: string; tags?: string[]; updatedAt: Date; version?: number; }; }>; list: QueryProcedure<{ input: void; meta: object; output: object[]; }>; pasteNodes: MutationProcedure<{ input: { clipboardData: { edges: object[]; nodes: ({ id: string; metadata: ... & ...; schemaVersion: "v3"; status: NodeStatus; storage: { configs?: ...; rootValues?: ...; version?: ...; }; version?: ... | ...; } | { connections?: ... | ...; id: string; metadata: ... & ...; ports: ...[]; schemaVersion: "v2"; status: NodeStatus; systemPorts?: ... | ...; type: string; } | { id: string; metadata: ... & ...; ports?: ... | ...; ports_values?: ... | ...; status: NodeStatus; })[]; timestamp?: number; }; flowId: string; pastePosition: { x: number; y: number; }; virtualOrigin?: { x: number; y: number; }; }; meta: object; output: { createdEdges: object[]; createdNodes: object[]; edgeCount: number; nodeCount: number; nodeIdMapping: {[k: string]: string; }; skippedEdges: string[]; success: boolean; }; }>; removeEdge: MutationProcedure<{ input: { edgeId: string; flowId: string; }; meta: object; output: { removedEdgeId: string; success: boolean; }; }>; removeElementArrayPort: MutationProcedure<{ input: { flowId: string; index: number; nodeId: string; portId: string; }; meta: object; output: { flowId: string; node: INode; nodeId: string; }; }>; removeFieldObjectPort: MutationProcedure<{ input: { flowId: string; key: string; nodeId: string; portId: string; }; meta: object; output: { flowId: string; node: INode; nodeId: string; }; }>; removeNode: MutationProcedure<{ input: { flowId: string; nodeId: string; }; meta: object; output: { removedNodeId: string; success: boolean; }; }>; setForkRule: MutationProcedure<{ input: { flowId: string; forkRule?: Record<string, any>; }; meta: object; output: { forkRule: Record<string, any>; success: boolean; }; }>; setPublic: MutationProcedure<{ input: { flowId: string; isPublic: boolean; }; meta: object; output: { isPublic: boolean; success: boolean; }; }>; subscribeToEvents: SubscriptionProcedure<{ input: { eventTypes?: FlowEventType[]; flowId: string; lastEventId?: string | null; }; meta: object; output: AsyncIterable<TrackedData<FlowEvent<FlowEventType>>>; }>; updateItemConfigArrayPort: MutationProcedure<{ input: { flowId: string; itemConfig?: any; nodeId: string; portId: string; }; meta: object; output: { flowId: string; node: INode; nodeId: string; }; }>; updateNodeParent: MutationProcedure<{ input: { flowId: string; nodeId: string; parentNodeId?: string; position: { x: number; y: number; }; version: number; }; meta: object; output: { flowId: string; nodeId: string; parentNodeId: string | undefined; position: { x: number; y: number; }; version: number; }; }>; updateNodePosition: MutationProcedure<{ input: { flowId: string; nodeId: string; position: { x: number; y: number; }; version: number; }; meta: object; output: { flowId: string; nodeId: string; position: Position; requestedVersion?: undefined; version: number; } | { flowId: string; nodeId: string; position: { x: number; y: number; }; requestedVersion: number; version: number; }; }>; updateNodeTitle: MutationProcedure<{ input: { flowId: string; nodeId: string; title?: string; version: number; }; meta: object; output: { flowId: string; nodeId: string; title: string; version: number; }; }>; updateNodeUI: MutationProcedure<{ input: { flowId: string; nodeId: string; ui: { dimensions?: { height: number; width: number; }; position?: { x: number; y: number; }; state?: { isDisabled?: boolean; isErrorPortCollapsed?: boolean; isHidden?: boolean; isHighlighted?: boolean; isMovingDisabled?: boolean; isSelected?: boolean; }; style?: { backgroundColor?: string; borderColor?: string; }; title?: string; }; version: number; }; meta: object; output: { flowId: string; nodeId: string; ui: NodeUIMetadata | undefined; version: number; }; }>; updatePortUI: MutationProcedure<{ input: { flowId: string; nodeId: string; nodeVersion: number; portId: string; ui: Record<string, any>; }; meta: object; output: { flowId: string; nodeId: string; port: IPort<IPortConfig>; }; }>; updatePortValue: MutationProcedure<{ input: { flowId: string; nodeId: string; nodeVersion: number; portId: string; value?: any; }; meta: object; output: { flowId: string; nodeId: string; port: IPort<IPortConfig>; }; }>; }>>

Defined in: packages/chaingraph-trpc/server/procedures/flow/index.ts:39

Licensed under BUSL-1.1