/* eslint-disable */
/**
* Generated `api` utility.
*
* THIS CODE IS AUTOMATICALLY GENERATED.
*
* To regenerate, run `npx convex dev`.
* @module
*/
import type * as action from "../action.js";
import type * as auth from "../auth.js";
import type * as chat from "../chat.js";
import type * as http from "../http.js";
import type * as nodeAction from "../nodeAction.js";
import type * as workflow from "../workflow.js";
import type {
ApiFromModules,
FilterApi,
FunctionReference,
} from "convex/server";
declare const fullApi: ApiFromModules<{
action: typeof action;
auth: typeof auth;
chat: typeof chat;
http: typeof http;
nodeAction: typeof nodeAction;
workflow: typeof workflow;
}>;
/**
* A utility for referencing Convex functions in your app's public API.
*
* Usage:
* ```js
* const myFunctionReference = api.myModule.myFunction;
* ```
*/
export declare const api: FilterApi<
typeof fullApi,
FunctionReference<any, "public">
>;
/**
* A utility for referencing Convex functions in your app's internal API.
*
* Usage:
* ```js
* const myFunctionReference = internal.myModule.myFunction;
* ```
*/
export declare const internal: FilterApi<
typeof fullApi,
FunctionReference<any, "internal">
>;
export declare const components: {
workflow: {
event: {
create: FunctionReference<
"mutation",
"internal",
{ name: string; workflowId: string },
string
>;
send: FunctionReference<
"mutation",
"internal",
{
eventId?: string;
name?: string;
result:
| { kind: "success"; returnValue: any }
| { error: string; kind: "failed" }
| { kind: "canceled" };
workflowId?: string;
workpoolOptions?: {
defaultRetryBehavior?: {
base: number;
initialBackoffMs: number;
maxAttempts: number;
};
logLevel?: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
maxParallelism?: number;
retryActionsByDefault?: boolean;
};
},
string
>;
};
journal: {
load: FunctionReference<
"query",
"internal",
{ shortCircuit?: boolean; workflowId: string },
{
blocked?: boolean;
journalEntries: Array<{
_creationTime: number;
_id: string;
step:
| {
args: any;
argsSize: number;
completedAt?: number;
functionType: "query" | "mutation" | "action";
handle: string;
inProgress: boolean;
kind?: "function";
name: string;
runResult?:
| { kind: "success"; returnValue: any }
| { error: string; kind: "failed" }
| { kind: "canceled" };
startedAt: number;
workId?: string;
}
| {
args: any;
argsSize: number;
completedAt?: number;
handle: string;
inProgress: boolean;
kind: "workflow";
name: string;
runResult?:
| { kind: "success"; returnValue: any }
| { error: string; kind: "failed" }
| { kind: "canceled" };
startedAt: number;
workflowId?: string;
}
| {
args: { eventId?: string };
argsSize: number;
completedAt?: number;
eventId?: string;
inProgress: boolean;
kind: "event";
name: string;
runResult?:
| { kind: "success"; returnValue: any }
| { error: string; kind: "failed" }
| { kind: "canceled" };
startedAt: number;
};
stepNumber: number;
workflowId: string;
}>;
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
ok: boolean;
workflow: {
_creationTime: number;
_id: string;
args: any;
generationNumber: number;
logLevel?: any;
name?: string;
onComplete?: { context?: any; fnHandle: string };
runResult?:
| { kind: "success"; returnValue: any }
| { error: string; kind: "failed" }
| { kind: "canceled" };
startedAt?: any;
state?: any;
workflowHandle: string;
};
}
>;
startSteps: FunctionReference<
"mutation",
"internal",
{
generationNumber: number;
steps: Array<{
retry?:
| boolean
| { base: number; initialBackoffMs: number; maxAttempts: number };
schedulerOptions?: { runAt?: number } | { runAfter?: number };
step:
| {
args: any;
argsSize: number;
completedAt?: number;
functionType: "query" | "mutation" | "action";
handle: string;
inProgress: boolean;
kind?: "function";
name: string;
runResult?:
| { kind: "success"; returnValue: any }
| { error: string; kind: "failed" }
| { kind: "canceled" };
startedAt: number;
workId?: string;
}
| {
args: any;
argsSize: number;
completedAt?: number;
handle: string;
inProgress: boolean;
kind: "workflow";
name: string;
runResult?:
| { kind: "success"; returnValue: any }
| { error: string; kind: "failed" }
| { kind: "canceled" };
startedAt: number;
workflowId?: string;
}
| {
args: { eventId?: string };
argsSize: number;
completedAt?: number;
eventId?: string;
inProgress: boolean;
kind: "event";
name: string;
runResult?:
| { kind: "success"; returnValue: any }
| { error: string; kind: "failed" }
| { kind: "canceled" };
startedAt: number;
};
}>;
workflowId: string;
workpoolOptions?: {
defaultRetryBehavior?: {
base: number;
initialBackoffMs: number;
maxAttempts: number;
};
logLevel?: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
maxParallelism?: number;
retryActionsByDefault?: boolean;
};
},
Array<{
_creationTime: number;
_id: string;
step:
| {
args: any;
argsSize: number;
completedAt?: number;
functionType: "query" | "mutation" | "action";
handle: string;
inProgress: boolean;
kind?: "function";
name: string;
runResult?:
| { kind: "success"; returnValue: any }
| { error: string; kind: "failed" }
| { kind: "canceled" };
startedAt: number;
workId?: string;
}
| {
args: any;
argsSize: number;
completedAt?: number;
handle: string;
inProgress: boolean;
kind: "workflow";
name: string;
runResult?:
| { kind: "success"; returnValue: any }
| { error: string; kind: "failed" }
| { kind: "canceled" };
startedAt: number;
workflowId?: string;
}
| {
args: { eventId?: string };
argsSize: number;
completedAt?: number;
eventId?: string;
inProgress: boolean;
kind: "event";
name: string;
runResult?:
| { kind: "success"; returnValue: any }
| { error: string; kind: "failed" }
| { kind: "canceled" };
startedAt: number;
};
stepNumber: number;
workflowId: string;
}>
>;
};
workflow: {
cancel: FunctionReference<
"mutation",
"internal",
{ workflowId: string },
null
>;
cleanup: FunctionReference<
"mutation",
"internal",
{ workflowId: string },
boolean
>;
complete: FunctionReference<
"mutation",
"internal",
{
generationNumber: number;
runResult:
| { kind: "success"; returnValue: any }
| { error: string; kind: "failed" }
| { kind: "canceled" };
workflowId: string;
},
null
>;
create: FunctionReference<
"mutation",
"internal",
{
maxParallelism?: number;
onComplete?: { context?: any; fnHandle: string };
startAsync?: boolean;
workflowArgs: any;
workflowHandle: string;
workflowName: string;
},
string
>;
getStatus: FunctionReference<
"query",
"internal",
{ workflowId: string },
{
inProgress: Array<{
_creationTime: number;
_id: string;
step:
| {
args: any;
argsSize: number;
completedAt?: number;
functionType: "query" | "mutation" | "action";
handle: string;
inProgress: boolean;
kind?: "function";
name: string;
runResult?:
| { kind: "success"; returnValue: any }
| { error: string; kind: "failed" }
| { kind: "canceled" };
startedAt: number;
workId?: string;
}
| {
args: any;
argsSize: number;
completedAt?: number;
handle: string;
inProgress: boolean;
kind: "workflow";
name: string;
runResult?:
| { kind: "success"; returnValue: any }
| { error: string; kind: "failed" }
| { kind: "canceled" };
startedAt: number;
workflowId?: string;
}
| {
args: { eventId?: string };
argsSize: number;
completedAt?: number;
eventId?: string;
inProgress: boolean;
kind: "event";
name: string;
runResult?:
| { kind: "success"; returnValue: any }
| { error: string; kind: "failed" }
| { kind: "canceled" };
startedAt: number;
};
stepNumber: number;
workflowId: string;
}>;
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
workflow: {
_creationTime: number;
_id: string;
args: any;
generationNumber: number;
logLevel?: any;
name?: string;
onComplete?: { context?: any; fnHandle: string };
runResult?:
| { kind: "success"; returnValue: any }
| { error: string; kind: "failed" }
| { kind: "canceled" };
startedAt?: any;
state?: any;
workflowHandle: string;
};
}
>;
listSteps: FunctionReference<
"query",
"internal",
{
order: "asc" | "desc";
paginationOpts: {
cursor: string | null;
endCursor?: string | null;
id?: number;
maximumBytesRead?: number;
maximumRowsRead?: number;
numItems: number;
};
workflowId: string;
},
{
continueCursor: string;
isDone: boolean;
page: Array<{
args: any;
completedAt?: number;
eventId?: string;
kind: "function" | "workflow" | "event";
name: string;
nestedWorkflowId?: string;
runResult?:
| { kind: "success"; returnValue: any }
| { error: string; kind: "failed" }
| { kind: "canceled" };
startedAt: number;
stepId: string;
stepNumber: number;
workId?: string;
workflowId: string;
}>;
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
splitCursor?: string | null;
}
>;
};
};
};