Add workflow standard comparison controls
This commit is contained in:
@@ -160,6 +160,29 @@ export type WorkflowStandardProvenance = {
|
||||
reset_available: boolean;
|
||||
};
|
||||
|
||||
export type WorkflowStandardDiffItem = {
|
||||
resource_type: "graph" | "node" | "edge";
|
||||
resource_id: string;
|
||||
state: "unchanged" | "local_only" | "upstream_only" | "same_change" | "conflict";
|
||||
recommended_action: "none" | "keep_local" | "adopt_upstream" | "either" | "manual_resolution";
|
||||
changed_fields: string[];
|
||||
baseline?: Record<string, unknown> | null;
|
||||
local?: Record<string, unknown> | null;
|
||||
latest?: Record<string, unknown> | null;
|
||||
};
|
||||
|
||||
export type WorkflowStandardDiff = {
|
||||
override_definition_id: string;
|
||||
baseline_definition_id: string;
|
||||
pinned_baseline_revision: number;
|
||||
local_revision: number;
|
||||
latest_baseline_revision: number;
|
||||
counts: Record<string, number>;
|
||||
conflict_count: number;
|
||||
auto_mergeable: boolean;
|
||||
items: WorkflowStandardDiffItem[];
|
||||
};
|
||||
|
||||
export type WorkflowDefinition = {
|
||||
id: string;
|
||||
tenant_id: string | null;
|
||||
@@ -457,6 +480,16 @@ export function resetWorkflowDefinitionToStandard(
|
||||
);
|
||||
}
|
||||
|
||||
export function compareWorkflowDefinitionToStandard(
|
||||
settings: ApiSettings,
|
||||
definitionId: string
|
||||
): Promise<WorkflowStandardDiff> {
|
||||
return apiFetch(
|
||||
settings,
|
||||
`/api/v1/workflow/definitions/${encodeURIComponent(definitionId)}/standard-diff`
|
||||
);
|
||||
}
|
||||
|
||||
export async function listWorkflowRevisions(
|
||||
settings: ApiSettings,
|
||||
definitionId: string
|
||||
|
||||
Reference in New Issue
Block a user