refactor: retain workflow as optional editor
This commit is contained in:
@@ -136,10 +136,30 @@ export type WorkflowRevision = {
|
||||
view_id?: string | null;
|
||||
view_revision_id?: string | null;
|
||||
bpmn?: BpmnRevisionSummary | null;
|
||||
contribution_origin_module_version?: string | null;
|
||||
contribution_schema_version?: string | null;
|
||||
contribution_hash?: string | null;
|
||||
contribution_metadata: Record<string, unknown>;
|
||||
created_by?: string | null;
|
||||
created_at: string;
|
||||
};
|
||||
|
||||
export type WorkflowStandardProvenance = {
|
||||
kind: "baseline" | "override";
|
||||
origin_module_id: string;
|
||||
origin_module_version?: string | null;
|
||||
definition_key: string;
|
||||
contribution_schema_version?: string | null;
|
||||
contribution_hash?: string | null;
|
||||
baseline_definition_id: string;
|
||||
latest_baseline_revision: number;
|
||||
active_baseline_revision?: number | null;
|
||||
pinned_baseline_revision?: number | null;
|
||||
pinned_baseline_hash?: string | null;
|
||||
update_available: boolean;
|
||||
reset_available: boolean;
|
||||
};
|
||||
|
||||
export type WorkflowDefinition = {
|
||||
id: string;
|
||||
tenant_id: string | null;
|
||||
@@ -156,6 +176,7 @@ export type WorkflowDefinition = {
|
||||
updated_at: string;
|
||||
revision: WorkflowRevision;
|
||||
governance: WorkflowGovernance;
|
||||
standard?: WorkflowStandardProvenance | null;
|
||||
};
|
||||
|
||||
export type WorkflowActionDecision = {
|
||||
@@ -409,6 +430,33 @@ export function deriveWorkflowDefinition(
|
||||
);
|
||||
}
|
||||
|
||||
export function reconcileWorkflowStandards(
|
||||
settings: ApiSettings
|
||||
): Promise<{
|
||||
discovered: number;
|
||||
created: number;
|
||||
updated: number;
|
||||
unchanged: number;
|
||||
blocked: number;
|
||||
pending_tenant_scope: number;
|
||||
items: Array<Record<string, unknown>>;
|
||||
}> {
|
||||
return apiFetch(settings, "/api/v1/workflow/standards/reconcile", {
|
||||
method: "POST"
|
||||
});
|
||||
}
|
||||
|
||||
export function resetWorkflowDefinitionToStandard(
|
||||
settings: ApiSettings,
|
||||
definitionId: string
|
||||
): Promise<WorkflowDefinition> {
|
||||
return apiFetch(
|
||||
settings,
|
||||
`/api/v1/workflow/definitions/${encodeURIComponent(definitionId)}/reset-standard`,
|
||||
{ method: "POST" }
|
||||
);
|
||||
}
|
||||
|
||||
export async function listWorkflowRevisions(
|
||||
settings: ApiSettings,
|
||||
definitionId: string
|
||||
@@ -420,6 +468,17 @@ export async function listWorkflowRevisions(
|
||||
return response.revisions;
|
||||
}
|
||||
|
||||
export function getWorkflowRevision(
|
||||
settings: ApiSettings,
|
||||
definitionId: string,
|
||||
revision: number
|
||||
): Promise<WorkflowRevision> {
|
||||
return apiFetch(
|
||||
settings,
|
||||
`/api/v1/workflow/definitions/${encodeURIComponent(definitionId)}/revisions/${revision}`
|
||||
);
|
||||
}
|
||||
|
||||
export function getWorkflowRevisionBpmn(
|
||||
settings: ApiSettings,
|
||||
definitionId: string,
|
||||
|
||||
Reference in New Issue
Block a user