diff --git a/plugins/scaffolder-node/report-alpha.api.md b/plugins/scaffolder-node/report-alpha.api.md index c3e8c7f71b..09541fbc56 100644 --- a/plugins/scaffolder-node/report-alpha.api.md +++ b/plugins/scaffolder-node/report-alpha.api.md @@ -33,31 +33,25 @@ export type CheckpointContext = { fn: () => Promise | T; }; -// @alpha -export type CheckpointFailedState = { - status: 'failed'; - reason: string; -}; - // @alpha export type CheckpointState = { [key: string]: CheckpointStateValue; }; // @alpha -export type CheckpointStateValue = - | CheckpointSuccessState - | CheckpointFailedState; +export type CheckpointStateValue = + | { + status: 'failed'; + reason: string; + } + | { + status: 'success'; + value: T; + }; // @alpha export type CheckpointStatus = 'failed' | 'success'; -// @alpha -export type CheckpointSuccessState = { - status: 'success'; - value: T; -}; - // @alpha (undocumented) export type CreatedTemplateFilter< TFunctionArgs extends [z.ZodTypeAny, ...z.ZodTypeAny[]], diff --git a/plugins/scaffolder-node/src/alpha/checkpoints/types.ts b/plugins/scaffolder-node/src/alpha/checkpoints/types.ts index 45f1c03430..5bd1eb5cd3 100644 --- a/plugins/scaffolder-node/src/alpha/checkpoints/types.ts +++ b/plugins/scaffolder-node/src/alpha/checkpoints/types.ts @@ -22,34 +22,14 @@ import { JsonValue } from '@backstage/types'; */ export type CheckpointStatus = 'failed' | 'success'; -/** - * Represents a successful checkpoint state with a value. - * - * @alpha - */ -export type CheckpointSuccessState = { - status: 'success'; - value: T; -}; - -/** - * Represents a failed checkpoint state with a reason for failure. - * - * @alpha - */ -export type CheckpointFailedState = { - status: 'failed'; - reason: string; -}; - /** * Represents the union of all possible checkpoint state values. * * @alpha */ -export type CheckpointStateValue = - | CheckpointSuccessState - | CheckpointFailedState; +export type CheckpointStateValue = + | { status: 'failed'; reason: string } + | { status: 'success'; value: T }; /** * A map of checkpoint keys to their states. diff --git a/plugins/scaffolder-node/src/tasks/index.ts b/plugins/scaffolder-node/src/tasks/index.ts index 2ff31857f5..930de95237 100644 --- a/plugins/scaffolder-node/src/tasks/index.ts +++ b/plugins/scaffolder-node/src/tasks/index.ts @@ -25,5 +25,4 @@ export type { TaskContext, TaskEventType, TaskStatus, - // UpdateTaskCheckpointOptions, } from './types';