import { z } from "zod"; import { ExecutionStatus, type Execution, type ExecutionID } from "../execution.js"; import type { Command } from "../http/command.js"; import type { ExecuteTransactionResponse } from "../service-client.js"; import type { Transaction } from "../transaction.js"; import type { HistoryStateEvent, WorkflowEvent } from "./workflow-events.js"; export declare const EVENTUAL_SYSTEM_COMMAND_NAMESPACE = "_system"; export declare const sortOrderSchema: z.ZodEnum<["ASC", "DESC"]>; export declare const emitEventsRequestSchema: z.ZodObject<{ events: z.ZodArray; }, "strip", z.ZodTypeAny, { name: string; event: Record; }, { name: string; event: Record; }>, "many">; }, "strip", z.ZodTypeAny, { events: { name: string; event: Record; }[]; }, { events: { name: string; event: Record; }[]; }>; export type EmitEventsRequest = z.infer; export interface WorkflowReference { name: string; } export interface ListWorkflowsResponse { workflows: WorkflowReference[]; } export declare const sendSignalRequestSchema: z.ZodObject<{ executionId: z.ZodString; signalId: z.ZodString; payload: z.ZodAny; id: z.ZodOptional; }, "strip", z.ZodTypeAny, { signalId: string; executionId: string; payload?: any; id?: string | undefined; }, { signalId: string; executionId: string; payload?: any; id?: string | undefined; }>; export type SendSignalRequestSchema = z.infer; export declare const startExecutionRequestSchema: z.ZodObject<{ timeout: z.ZodOptional; isoDate: z.ZodString; }, "strip", z.ZodTypeAny, { type: "Time"; isoDate: string; }, { type: "Time"; isoDate: string; }>, z.ZodObject<{ type: z.ZodLiteral<"Duration">; dur: z.ZodNumber; unit: z.ZodEnum<["second", "seconds", "minute", "minutes", "hour", "hours", "day", "days", "year", "years"]>; }, "strip", z.ZodTypeAny, { type: "Duration"; dur: number; unit: "second" | "seconds" | "minute" | "minutes" | "hour" | "hours" | "day" | "days" | "year" | "years"; }, { type: "Duration"; dur: number; unit: "second" | "seconds" | "minute" | "minutes" | "hour" | "hours" | "day" | "days" | "year" | "years"; }>]>>; executionName: z.ZodOptional; workflow: z.ZodString; input: z.ZodOptional; }, "strip", z.ZodTypeAny, { workflow: string; timeout?: { type: "Duration"; dur: number; unit: "second" | "seconds" | "minute" | "minutes" | "hour" | "hours" | "day" | "days" | "year" | "years"; } | { type: "Time"; isoDate: string; } | undefined; executionName?: string | undefined; input?: any; }, { workflow: string; timeout?: { type: "Duration"; dur: number; unit: "second" | "seconds" | "minute" | "minutes" | "hour" | "hours" | "day" | "days" | "year" | "years"; } | { type: "Time"; isoDate: string; } | undefined; executionName?: string | undefined; input?: any; }>; export type StartExecutionRequest = z.infer; export interface StartExecutionResponse { /** * ID of the started workflow execution. */ executionId: ExecutionID; /** * @returns true when the execution name with the same input * was already started. Use `getExecution` to check the status. */ alreadyRunning: boolean; } export declare const listExecutionsRequestSchema: z.ZodObject<{ statuses: z.ZodOptional, "many">>; workflowName: z.ZodOptional; nextToken: z.ZodOptional; sortDirection: z.ZodOptional>>; maxResults: z.ZodOptional>; }, "strip", z.ZodTypeAny, { statuses?: ExecutionStatus[] | undefined; workflowName?: string | undefined; nextToken?: string | undefined; sortDirection?: "ASC" | "DESC" | undefined; maxResults?: number | undefined; }, { statuses?: ExecutionStatus[] | undefined; workflowName?: string | undefined; nextToken?: string | undefined; sortDirection?: "ASC" | "DESC" | undefined; maxResults?: number | undefined; }>; export type ListExecutionsRequest = z.infer; export type GetExecutionLogsRequest = z.infer; export declare const getExecutionLogsRequest: z.ZodObject<{ executionId: z.ZodOptional; workflowName: z.ZodOptional; nextToken: z.ZodOptional; startTime: z.ZodOptional; maxResults: z.ZodOptional>; }, "strip", z.ZodTypeAny, { executionId?: string | undefined; workflowName?: string | undefined; nextToken?: string | undefined; startTime?: string | undefined; maxResults?: number | undefined; }, { executionId?: string | undefined; workflowName?: string | undefined; nextToken?: string | undefined; startTime?: string | undefined; maxResults?: number | undefined; }>; export interface LogEntry { time?: number; message: string; } export interface LogEvent extends LogEntry { source: string; } export interface GetExecutionLogsResponse { events: LogEvent[]; nextToken?: string; } export interface ListExecutionsResponse { executions: Execution[]; /** * A token returned when there may be more executions to retrieve. */ nextToken?: string; } export declare const listExecutionEventsRequestSchema: z.ZodObject<{ executionId: z.ZodString; sortDirection: z.ZodOptional>>; nextToken: z.ZodOptional; maxResults: z.ZodOptional>; after: z.ZodOptional; }, "strip", z.ZodTypeAny, { executionId: string; sortDirection?: "ASC" | "DESC" | undefined; nextToken?: string | undefined; maxResults?: number | undefined; after?: string | undefined; }, { executionId: string; sortDirection?: "ASC" | "DESC" | undefined; nextToken?: string | undefined; maxResults?: number | undefined; after?: string | undefined; }>; export type ListExecutionEventsRequest = z.infer; export interface ListExecutionEventsResponse { events: WorkflowEvent[]; nextToken?: string; } export interface ExecutionHistoryResponse { events: HistoryStateEvent[]; } export declare const sendTaskSuccessRequestSchema: z.ZodObject<{ type: z.ZodLiteral<"Success">; taskToken: z.ZodString; result: z.ZodAny; }, "strip", z.ZodTypeAny, { type: "Success"; taskToken: string; result?: any; }, { type: "Success"; taskToken: string; result?: any; }>; export declare const sendTaskFailureRequestSchema: z.ZodObject<{ type: z.ZodLiteral<"Failure">; taskToken: z.ZodString; error: z.ZodString; message: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "Failure"; error: string; taskToken: string; message?: string | undefined; }, { type: "Failure"; error: string; taskToken: string; message?: string | undefined; }>; export declare const sendTaskHeartbeatRequestSchema: z.ZodObject<{ type: z.ZodLiteral<"Heartbeat">; taskToken: z.ZodString; }, "strip", z.ZodTypeAny, { type: "Heartbeat"; taskToken: string; }, { type: "Heartbeat"; taskToken: string; }>; export declare const sendTaskUpdateSchema: z.ZodUnion<[z.ZodObject<{ type: z.ZodLiteral<"Success">; taskToken: z.ZodString; result: z.ZodAny; }, "strip", z.ZodTypeAny, { type: "Success"; taskToken: string; result?: any; }, { type: "Success"; taskToken: string; result?: any; }>, z.ZodObject<{ type: z.ZodLiteral<"Failure">; taskToken: z.ZodString; error: z.ZodString; message: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "Failure"; error: string; taskToken: string; message?: string | undefined; }, { type: "Failure"; error: string; taskToken: string; message?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"Heartbeat">; taskToken: z.ZodString; }, "strip", z.ZodTypeAny, { type: "Heartbeat"; taskToken: string; }, { type: "Heartbeat"; taskToken: string; }>]>; export type SendTaskUpdate = z.infer; export interface SendTaskSuccessRequest extends Omit, "result" | "type"> { result?: T; } export type SendTaskFailureRequest = Omit, "type">; export type SendTaskHeartbeatRequest = Omit, "type">; export declare function isSendTaskSuccessRequest(request: SendTaskUpdate): request is SendTaskSuccessRequest & { type: "Success"; }; export declare function isSendTaskFailureRequest(request: SendTaskUpdate): request is SendTaskFailureRequest & { type: "Failure"; }; export declare function isSendTaskHeartbeatRequest(request: SendTaskUpdate): request is SendTaskHeartbeatRequest & { type: "Heartbeat"; }; export declare const executeTransactionRequestSchema: z.ZodObject<{ transactionName: z.ZodString; input: z.ZodOptional; }, "strip", z.ZodTypeAny, { transactionName: string; input?: any; }, { transactionName: string; input?: any; }>; export type ExecuteTransactionRequest = z.infer; export interface SendTaskHeartbeatResponse { /** * True when the task has been cancelled. * * This is the only way for a long running task to know it was cancelled. */ cancelled: boolean; } export interface EventualService { listWorkflows: Command<"listWorkflows", void, ListWorkflowsResponse>; emitEvents: Command<"emitEvents", EmitEventsRequest, void>; getExecution: Command<"getExecution", string, Execution | undefined>; startExecution: Command<"startExecution", StartExecutionRequest, StartExecutionResponse>; listExecutions: Command<"listExecutions", ListExecutionsRequest, ListExecutionsResponse>; sendSignal: Command<"sendSignal", SendSignalRequestSchema, void>; getExecutionLogs: Command<"getExecutionLogs", GetExecutionLogsRequest, GetExecutionLogsResponse>; getExecutionHistory: Command<"getExecutionHistory", ListExecutionEventsRequest, ListExecutionEventsResponse>; getExecutionWorkflowHistory: Command<"getExecutionWorkflowHistory", string, ExecutionHistoryResponse>; updateTask: Command<"updateTask", SendTaskUpdate, void | SendTaskHeartbeatResponse>; executeTransaction: Command<"executeTransaction", ExecuteTransactionRequest, ExecuteTransactionResponse>; } //# sourceMappingURL=eventual-service.d.ts.map