ChainGraph API Documentation / @badaitech/chaingraph-executor / client / createTRPCClient
Function: createTRPCClient()
createTRPCClient(
opts):TRPCClient<BuiltRouter<{ctx:ExecutorContext;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<{create:MutationProcedure<{input: {events?:object[];flowId:string;integration?:objectInputType<{archai:ZodOptional<...>;external:ZodOptional<...>;wallet:ZodOptional<...>; },ZodAny,"strip">;options?: {breakpoints?: ...[];debug?:boolean;execution?: {flowTimeoutMs?: ...;maxConcurrency?: ...;nodeTimeoutMs?: ...; }; }; };meta:object;output: {executionId:string; }; }>;getExecutionDetails:QueryProcedure<{input: {executionId:string; };meta:object;output: {completedAt:Date|null;createdAt:Date;errorMessage:string|null;errorNodeId:string|null;executionDepth:number;externalEvents:object[] |null;failureCount:number;flowId:string;id:string;integration:object&object|null;lastFailureAt:Date|null;lastFailureReason:string|null;options: {breakpoints?: ...[];debug?:boolean;execution?: {flowTimeoutMs?: ...;maxConcurrency?: ...;nodeTimeoutMs?: ...; }; } |null;ownerId:string;parentExecutionId:string|null;processingStartedAt:Date|null;processingWorkerId:string|null;rootExecutionId:string|null;startedAt:Date|null;status:ExecutionStatus;updatedAt:Date; }; }>;getExecutionsTree:QueryProcedure<{input: {executionId:string; };meta:object;output:ExecutionTreeNode[]; }>;getRootExecutions:QueryProcedure<{input: {after?:Date;flowId:string;limit?:number; };meta:object;output:RootExecution[]; }>;pause:MutationProcedure<{input: {executionId:string;reason?:string; };meta:object;output: {success:boolean; }; }>;resume:MutationProcedure<{input: {executionId:string; };meta:object;output: {success:boolean; }; }>;start:MutationProcedure<{input: {executionId:string; };meta:object;output: {success:boolean; }; }>;stop:MutationProcedure<{input: {executionId:string;reason?:string; };meta:object;output: {success:boolean; }; }>;subscribeToExecutionEvents:SubscriptionProcedure<{input: {batchSize?:number;batchTimeoutMs?:number;eventTypes?:string[];executionId:string;fromIndex?:number; };meta:object;output:AsyncIterable<ExecutionEventImpl<ExecutionEventEnum>[]>; }>; }>>>
Defined in: packages/chaingraph-executor/client/trpc.ts:59
Parameters
opts
auth?
AuthOptions
superjsonCustom?
typeof default
url
string
wsClientCallbacks?
{ onClose?: (cause?) => void; onError?: (err?) => void; onOpen?: () => void; }
wsClientCallbacks.onClose?
(cause?) => void
wsClientCallbacks.onError?
(err?) => void
wsClientCallbacks.onOpen?
() => void
Returns
TRPCClient<BuiltRouter<{ ctx: ExecutorContext; 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<{ create: MutationProcedure<{ input: { events?: object[]; flowId: string; integration?: objectInputType<{ archai: ZodOptional<...>; external: ZodOptional<...>; wallet: ZodOptional<...>; }, ZodAny, "strip">; options?: { breakpoints?: ...[]; debug?: boolean; execution?: { flowTimeoutMs?: ...; maxConcurrency?: ...; nodeTimeoutMs?: ...; }; }; }; meta: object; output: { executionId: string; }; }>; getExecutionDetails: QueryProcedure<{ input: { executionId: string; }; meta: object; output: { completedAt: Date | null; createdAt: Date; errorMessage: string | null; errorNodeId: string | null; executionDepth: number; externalEvents: object[] | null; failureCount: number; flowId: string; id: string; integration: object & object | null; lastFailureAt: Date | null; lastFailureReason: string | null; options: { breakpoints?: ...[]; debug?: boolean; execution?: { flowTimeoutMs?: ...; maxConcurrency?: ...; nodeTimeoutMs?: ...; }; } | null; ownerId: string; parentExecutionId: string | null; processingStartedAt: Date | null; processingWorkerId: string | null; rootExecutionId: string | null; startedAt: Date | null; status: ExecutionStatus; updatedAt: Date; }; }>; getExecutionsTree: QueryProcedure<{ input: { executionId: string; }; meta: object; output: ExecutionTreeNode[]; }>; getRootExecutions: QueryProcedure<{ input: { after?: Date; flowId: string; limit?: number; }; meta: object; output: RootExecution[]; }>; pause: MutationProcedure<{ input: { executionId: string; reason?: string; }; meta: object; output: { success: boolean; }; }>; resume: MutationProcedure<{ input: { executionId: string; }; meta: object; output: { success: boolean; }; }>; start: MutationProcedure<{ input: { executionId: string; }; meta: object; output: { success: boolean; }; }>; stop: MutationProcedure<{ input: { executionId: string; reason?: string; }; meta: object; output: { success: boolean; }; }>; subscribeToExecutionEvents: SubscriptionProcedure<{ input: { batchSize?: number; batchTimeoutMs?: number; eventTypes?: string[]; executionId: string; fromIndex?: number; }; meta: object; output: AsyncIterable<ExecutionEventImpl<ExecutionEventEnum>[]>; }>; }>>>