@@ -26,4 +26,5 @@ export type {
|
||||
TaskEventType,
|
||||
TaskState,
|
||||
TaskStatus,
|
||||
UpdateCheckpointOptions,
|
||||
} from './types';
|
||||
|
||||
@@ -31,7 +31,14 @@ export type TaskSecrets = Record<string, string> & {
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type TaskState = Record<string, JsonObject>;
|
||||
export type TaskState = {
|
||||
[key: string]:
|
||||
| { status: 'failed'; reason: string }
|
||||
| {
|
||||
status: 'success';
|
||||
value: JsonObject;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* The status of each step of the Task
|
||||
@@ -108,6 +115,24 @@ export type TaskBrokerDispatchOptions = {
|
||||
createdBy?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* The options passed to {@link TaskBroker.updateCheckpoint}
|
||||
* Parameters to store the result of the executed checkpoint
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type UpdateCheckpointOptions =
|
||||
| {
|
||||
key: string;
|
||||
status: 'success';
|
||||
value: JsonObject;
|
||||
}
|
||||
| {
|
||||
key: string;
|
||||
status: 'failed';
|
||||
reason: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Task
|
||||
*
|
||||
@@ -126,7 +151,7 @@ export interface TaskContext {
|
||||
|
||||
emitLog(message: string, logMetadata?: JsonObject): Promise<void>;
|
||||
|
||||
updateCheckpoint?(key: string, value: JsonObject): Promise<void>;
|
||||
updateCheckpoint?(options: UpdateCheckpointOptions): Promise<void>;
|
||||
|
||||
getWorkspaceName(): Promise<string>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user