UNPKG

forest-cli

Version:

The Lumberjacks' toolbelt is the Forest CLI which makes easy to manage your back office application directly from the terminal.

55 lines 3 kB
import type { Config } from '@oclif/core'; import AbstractAuthenticatedCommand from '../../abstract-authenticated-command'; /** * `forest workflow apply` — create-or-update ONE workflow from a JSON `steps` * spec, without touching the rest of the layout. The spec is the source of * truth: editing a workflow (e.g. adding a step) means editing the JSON and * re-applying — the whole BPMN is recompiled and re-uploaded when it differs * (it is atomic; there is no per-step patch), and the shell metadata (name, * segments, position when pinned) is converged with `replace` patches. Upsert * is matched by explicit `id` (which must exist — a stale id is an error, not * a create), else by name + collection. * * Sequence: compile steps -> BPMN; show the plan and confirm; PATCH the shell * (add if new, metadata replaces otherwise); upload the BPMN to the env's S3 * (presigned) when it changed; PATCH the returned `bpmnAwsS3Identifier`. */ export default class WorkflowApplyCommand extends AbstractAuthenticatedCommand { private readonly env; private readonly inquirer; static args: { file: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>; }; static description: string; static flags: { 'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; env: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>; force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>; projectId: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>; team: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>; }; constructor(argv: string[], config: Config, plan?: any); protected runAuthenticated(): Promise<void>; private planAndExecute; private reportSpecError; /** M2 guards: no silent hang on a TTY, no interactive prompt when stdin carries the spec. */ private checkStdinUsage; /** Resolve everything the apply needs (match, metadata diff, BPMN diff) — read-only. */ private planApply; /** Say what is about to happen (or would, on --dry-run) before doing anything. */ private printPlan; /** Interactive confirmation — impossible when stdin carries the spec (require --force). */ private confirmOrBail; private executePlan; /** * Upload the compiled BPMN and link it to the workflow. If this fails right * after a new shell was created, roll the shell back so no unusable, * BPMN-less workflow is left behind (an existing workflow is left as is — * its previous BPMN stays linked and re-applying converges). A failed * rollback is warned about, never swallowed. */ private uploadAndLinkBpmn; /** Success message reflecting what actually changed. */ private printOutcome; } //# sourceMappingURL=apply.d.ts.map