Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/client/features/envelopes/services/EnvelopesApi

ui/server/src/envelopesApi.mjs, a thin adapter over packages/core/flows.mjs's listFlows/loadFlow/saveFlow, a deterministic envelope preview, and "Run this flow" through the same Process/Approvals path Plan mode's "Run...

Cockpit client (features), next. Source: ui/client/features/envelopes/services/EnvelopesApi.ts.

Type Aliases#

CatalogueResult#

CatalogueResult = { ok: true; rows: FlowCatalogueEntry[]; } | { error: string; ok: false; }

Defined in: ui/client/features/envelopes/services/EnvelopesApi.ts:33


EnvelopesResult#

EnvelopesResult = { ok: true; rows: FlowSummary[]; } | { error: string; ok: false; }

Defined in: ui/client/features/envelopes/services/EnvelopesApi.ts:7


FlowResult#

FlowResult = { name: string; ok: true; steps: FlowStep[]; } | { error: string; ok: false; }

Defined in: ui/client/features/envelopes/services/EnvelopesApi.ts:20


PreviewResult#

PreviewResult = { ok: true; previews: EnvelopePreview[]; } | { error: string; ok: false; }

Defined in: ui/client/features/envelopes/services/EnvelopesApi.ts:48


RunFlowResult#

RunFlowResult = { models: string[]; ok: true; processId: string; } | { error: string; ok: false; }

Defined in: ui/client/features/envelopes/services/EnvelopesApi.ts:76


SaveFlowResult#

SaveFlowResult = { ok: true; } | { error: string; ok: false; }

Defined in: ui/client/features/envelopes/services/EnvelopesApi.ts:62

Functions#

fetchFlow()#

fetchFlow(name): Promise<FlowResult>

Defined in: ui/client/features/envelopes/services/EnvelopesApi.ts:23

One saved flow's steps, for loading into the compose draft.

Parameters#

name

string

Returns#

Promise<FlowResult>


fetchFlowCatalogue()#

fetchFlowCatalogue(): Promise<CatalogueResult>

Defined in: ui/client/features/envelopes/services/EnvelopesApi.ts:38

The real plan-flow catalogue (PLAN_FLOWS/block-flows.mjs) the compose step picker adds from -- reuses GET /api/plan/context's flows, the same catalogue the Plan screen's step picker already reads, rather than standing up a second endpoint for the same data.

Returns#

Promise<CatalogueResult>


fetchFlows()#

fetchFlows(): Promise<EnvelopesResult>

Defined in: ui/client/features/envelopes/services/EnvelopesApi.ts:10

Every flow saved for the current project.

Returns#

Promise<EnvelopesResult>


previewEnvelopes()#

previewEnvelopes(steps): Promise<PreviewResult>

Defined in: ui/client/features/envelopes/services/EnvelopesApi.ts:52

The envelope each step of the draft would receive, matching schemas/envelope.v1.json's input shape -- computed deterministically (no generator runs), one entry per step index.

Parameters#

steps

ComposeStep[]

Returns#

Promise<PreviewResult>


runComposedFlow()#

runComposedFlow(name, steps): Promise<RunFlowResult>

Defined in: ui/client/features/envelopes/services/EnvelopesApi.ts:82

"Run this flow": POST /api/envelopes/run wraps the draft's steps in a synthetic plan and runs the exact same validate-then-start pipeline Plan mode's "Run plan" uses (planService.run(), the process engine the Processes drawer reads) -- never a second execution mechanism. name is only the process's label; running does not require having saved first.

Parameters#

name

string | null

steps

ComposeStep[]

Returns#

Promise<RunFlowResult>


saveComposedFlow()#

saveComposedFlow(name, steps, commit): Promise<SaveFlowResult>

Defined in: ui/client/features/envelopes/services/EnvelopesApi.ts:66

Previews (commit false) or commits the draft under name, same preview/commit shape as the Rules tab's writers.

Parameters#

name

string

steps

ComposeStep[]

commit

boolean

Returns#

Promise<SaveFlowResult>