chore: renaming some types that are exported and moving across

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2022-02-18 13:13:31 +01:00
parent 0988c86166
commit 3cdd27b4c7
4 changed files with 27 additions and 9 deletions
@@ -22,7 +22,7 @@ import { v4 as uuid } from 'uuid';
import {
SerializedTaskEvent,
SerializedTask,
Status,
TaskStatus,
TaskEventType,
TaskSecrets,
TaskSpec,
@@ -40,7 +40,7 @@ const migrationsDir = resolvePackagePath(
export type RawDbTaskRow = {
id: string;
spec: string;
status: Status;
status: TaskStatus;
last_heartbeat_at?: string;
created_at: string;
secrets?: string | null;
@@ -202,7 +202,7 @@ export class DatabaseTaskStore implements TaskStore {
eventBody,
}: {
taskId: string;
status: Status;
status: TaskStatus;
eventBody: JsonObject;
}): Promise<void> {
let oldStatus: string;
@@ -17,7 +17,7 @@ import { JsonObject } from '@backstage/types';
import { assertError } from '@backstage/errors';
import { Logger } from 'winston';
import {
CompletedTaskState,
TaskCompletionState,
TaskContext,
TaskSecrets,
TaskSpec,
@@ -75,7 +75,7 @@ export class TaskManager implements TaskContext {
}
async complete(
result: CompletedTaskState,
result: TaskCompletionState,
metadata?: JsonObject,
): Promise<void> {
await this.storage.completeTask({
@@ -21,6 +21,7 @@ export type { CreateWorkerOptions } from './TaskWorker';
export type {
TaskSecrets,
TaskSpec,
TaskCompletionState,
CompletedTaskState,
TaskStoreEmitOptions,
TaskStoreListEventsOptions,
@@ -29,6 +30,7 @@ export type {
TaskSpecV1beta2,
TaskSpecV1beta3,
Status,
TaskStatus,
TaskEventType,
TaskBroker,
TaskContext,
@@ -32,11 +32,11 @@ export type {
};
/**
* Status
* The status of each step of the Task
*
* @public
*/
export type Status =
export type TaskStatus =
| 'open'
| 'processing'
| 'failed'
@@ -44,11 +44,27 @@ export type Status =
| 'completed';
/**
* CompletedTaskState
* The status of each step of the Task
*
* @public
* @deprecated use TaskStatus instead
*/
export type Status = TaskStatus;
/**
* The state of a completed task.
*
* @public
*/
export type CompletedTaskState = 'failed' | 'completed';
export type TaskCompletionState = 'failed' | 'completed';
/**
* The state of a completed task.
*
* @public
* @deprecated use TaskCompletionState instead
*/
export type CompletedTaskState = TaskCompletionState;
/**
* SerializedTask