Line

ui/server/src/workflowsViewer

Backend for epic #57.

Cockpit server, v0.9. Source: ui/server/src/workflowsViewer.mjs.

Functions#

editWorkflowFile()#

editWorkflowFile(root, feature, file, req, __namedParameters): { after: string; before: any; contentHash: any; ok: boolean; } | { after?: undefined; before?: undefined; contentHash: any; error: string; feature: any; file: any; machines: any[]; ok: boolean; path: string; savedPath: string; violations: any[]; }

Defined in: ui/server/src/workflowsViewer.mjs:93

#61 -- one visual edit, applied as an exact source-range edit (src/engine/workflowEditor.mjs). commit:false returns the patched source for the client's diff preview without touching disk; commit:true re-applies the SAME request server-side (the client never sends file content), checks the contentHash still matches (no clobbering a concurrent edit), runs the same architecture/SoC enforcement gate the pages editor uses, and only then writes. Nothing besides the source file is stored.

Parameters#

root

any

feature

any

file

any

req

any

__namedParameters
commit

any

contentHash

any

Returns#

{ after: string; before: any; contentHash: any; ok: boolean; } | { after?: undefined; before?: undefined; contentHash: any; error: string; feature: any; file: any; machines: any[]; ok: boolean; path: string; savedPath: string; violations: any[]; }


listWorkflowFeatures()#

listWorkflowFeatures(root): any

Defined in: ui/server/src/workflowsViewer.mjs:23

Features that actually have a workflows/ folder.

Parameters#

root

any

Returns#

any


listWorkflowFiles()#

listWorkflowFiles(root, feature): string[]

Defined in: ui/server/src/workflowsViewer.mjs:29

Every source file under features//workflows/**, relative to it.

Parameters#

root

any

feature

any

Returns#

string[]


readWorkflowMachines()#

readWorkflowMachines(root, feature, file): object

Defined in: ui/server/src/workflowsViewer.mjs:69

Machines defined in one workflow file, extracted from the live source.

Parameters#

root

any

feature

any

file

any

Returns#

object

contentHash

contentHash: any

error

error: string

feature

feature: any

file

file: any

machines

machines: any[]

path

path: string = relPath


readWorkflowNarrative()#

readWorkflowNarrative(root, feature, file): object

Defined in: ui/server/src/workflowsViewer.mjs:79

Epic #185 -- the machines of one workflow file explained in plain English (narrative, scenarios, health findings), derived fresh from the source on every request (src/engine/workflowExplain.mjs). Same scope guard as readWorkflowMachines; read-only, nothing stored.

Parameters#

root

any

feature

any

file

any

Returns#

object

contentHash

contentHash: any

error

error: string

feature

feature: any

file

file: any

machines

machines: any[]

path

path: string = relPath


resolveWorkflowFile()#

resolveWorkflowFile(root, feature, file): object

Defined in: ui/server/src/workflowsViewer.mjs:47

Resolve + validate a (feature, file) pair to an absolute path strictly inside that feature's workflows/ folder (or throw PagesEditorError).

Parameters#

root

any

feature

any

file

any

Returns#

object

absPath

absPath: any = real

relPath

relPath: string