sfn-diagram 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/custom-elements.json +2 -2
- package/dist/aws.cjs +1 -1
- package/dist/cfn.d.cts +19 -3
- package/dist/cfn.d.ts +19 -3
- package/dist/ci.cjs +4177 -0
- package/dist/ci.d.cts +389 -0
- package/dist/ci.d.ts +389 -0
- package/dist/ci.js +4133 -0
- package/dist/cli.js +1725 -302
- package/dist/element-auto.cjs +832 -163
- package/dist/element-auto.js +832 -163
- package/dist/element.cjs +832 -163
- package/dist/element.d.cts +25 -5
- package/dist/element.d.ts +25 -5
- package/dist/element.js +832 -163
- package/dist/index.cjs +802 -160
- package/dist/index.d.cts +53 -33
- package/dist/index.d.ts +53 -33
- package/dist/index.js +802 -160
- package/dist/png.cjs +593 -123
- package/dist/png.d.cts +33 -5
- package/dist/png.d.ts +33 -5
- package/dist/png.js +593 -123
- package/package.json +33 -3
package/README.md
CHANGED
|
@@ -27,6 +27,8 @@ The core package pulls in **no browser engine** — SVG and Mermaid generation s
|
|
|
27
27
|
npm install sfn-diagram node-html-to-image
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
Not a Node project? The CLI also ships as standalone binaries for Linux, macOS, and Windows on every [release](https://github.com/yusufaf/sfn-diagram/releases), or via Homebrew (`brew install yusufaf/tap/sfn-diagram`), and as a [Docker image](https://sfn.yusufaf.dev/guides/cli/#docker). See [using sfn-diagram from other languages](https://sfn.yusufaf.dev/guides/other-languages/).
|
|
31
|
+
|
|
30
32
|
## Quick start
|
|
31
33
|
|
|
32
34
|
```ts
|
|
@@ -50,7 +52,7 @@ Mermaid instead of SVG? Swap in `generateMermaid`. Rendering a live state machin
|
|
|
50
52
|
Prefer the command line:
|
|
51
53
|
|
|
52
54
|
```bash
|
|
53
|
-
npx sfn-diagram
|
|
55
|
+
npx sfn-diagram my-workflow.asl.json --format svg -o diagram.svg
|
|
54
56
|
```
|
|
55
57
|
|
|
56
58
|
## Why sfn-diagram
|
|
@@ -61,7 +63,7 @@ There's no shortage of ways to look at a state machine — this is where sfn-dia
|
|
|
61
63
|
|---|---|---|---|
|
|
62
64
|
| Input | ASL, CloudFormation/SAM/CDK templates, live AWS state machines | Deployed state machine only | Manual Mermaid you write by hand |
|
|
63
65
|
| Output | SVG, Mermaid, PNG, interactive HTML | Static graph in-browser | Mermaid diagram only |
|
|
64
|
-
| CI / PR integration | [GitHub Action](https://sfn.yusufaf.dev/ecosystem/github-action/) posts a diff overlay on every PR that touches ASL | None | None |
|
|
66
|
+
| CI / PR integration | [GitHub Action](https://sfn.yusufaf.dev/ecosystem/github-action/) or [GitLab CI](https://sfn.yusufaf.dev/ecosystem/gitlab/) posts a diff overlay on every PR/MR that touches ASL | None | None |
|
|
65
67
|
| Execution overlays | Paints a real run's path/status/duration onto the diagram | Basic per-execution highlighting, console-only | Not applicable |
|
|
66
68
|
| Runs where | CLI, Node, browser, edge runtimes | AWS Console only | Web app only |
|
|
67
69
|
| Automation | Full programmatic API (`generateSvg`, `generateMermaid`, etc.) | None — UI only | None — UI only |
|
|
@@ -124,6 +126,7 @@ Working with an AI coding agent? The docs are published as [llms.txt](https://sf
|
|
|
124
126
|
| **[`<sfn-diagram>` web component](https://sfn.yusufaf.dev/ecosystem/web-component/)** | Framework-agnostic custom element — Vue, Svelte, Solid, Angular, Astro, Hono, vanilla HTML |
|
|
125
127
|
| **[React component](https://sfn.yusufaf.dev/ecosystem/react/)** | `sfn-diagram-react` — render diagrams in any React renderer |
|
|
126
128
|
| **[GitHub Action](https://sfn.yusufaf.dev/ecosystem/github-action/)** | Comment a diagram and diff on every PR that touches an ASL file |
|
|
129
|
+
| **[GitLab CI](https://sfn.yusufaf.dev/ecosystem/gitlab/)** | Same, via `sfn-diagram comment gitlab` from a plain CI job — no marketplace listing needed |
|
|
127
130
|
|
|
128
131
|
## Runtime support
|
|
129
132
|
|
package/custom-elements.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"declarations": [
|
|
9
9
|
{
|
|
10
10
|
"kind": "class",
|
|
11
|
-
"description": "`<sfn-diagram>` — a framework-agnostic custom element rendering an AWS Step\nFunctions ASL definition as an SVG or Mermaid diagram, with an optional\ninteractive viewer (pan/zoom, search, minimap,
|
|
11
|
+
"description": "`<sfn-diagram>` — a framework-agnostic custom element rendering an AWS Step\nFunctions ASL definition as an SVG or Mermaid diagram, with an optional\ninteractive viewer (pan/zoom, search, minimap, and a detail panel for a clicked\nstate or edge).\n\nRenders in light DOM (no shadow root), so page CSS reaches the SVG and the\nelement degrades to plain server-rendered markup: give it a pre-rendered\n`<svg>` child (from `generateSvg()` run at build/server time) and omit\n`definition` entirely for a zero-client-JS diagram; setting `interactive`\non top still upgrades that markup with pan/zoom/search.\n\nRegister it with defineSfnDiagram (imported from `sfn-diagram/element`),\nor import `sfn-diagram/element/auto` for its zero-config `<sfn-diagram>` side effect.",
|
|
12
12
|
"name": "SfnDiagramElement",
|
|
13
13
|
"members": [
|
|
14
14
|
{
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"type": {
|
|
106
106
|
"text": "boolean"
|
|
107
107
|
},
|
|
108
|
-
"description": "Enables pan/zoom, state search, the minimap, and the
|
|
108
|
+
"description": "Enables pan/zoom, state search, the minimap, and the detail panel for a clicked\nstate or edge."
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
111
|
"kind": "method",
|
package/dist/aws.cjs
CHANGED
package/dist/cfn.d.cts
CHANGED
|
@@ -34,6 +34,22 @@ interface ProcessorConfig {
|
|
|
34
34
|
Mode?: "DISTRIBUTED" | "INLINE";
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
+
* A Distributed Map's `ItemBatcher`, which groups items so each child execution
|
|
38
|
+
* receives an array rather than a single item. Either limit may be set; the first
|
|
39
|
+
* one reached closes the batch.
|
|
40
|
+
*/
|
|
41
|
+
interface ItemBatcher {
|
|
42
|
+
BatchInput?: Record<string, any>;
|
|
43
|
+
/** Maximum payload bytes handed to one child execution. */
|
|
44
|
+
MaxInputBytesPerBatch?: number;
|
|
45
|
+
/** Reference path resolving to `MaxInputBytesPerBatch`. */
|
|
46
|
+
MaxInputBytesPerBatchPath?: string;
|
|
47
|
+
/** Maximum items handed to one child execution. */
|
|
48
|
+
MaxItemsPerBatch?: number;
|
|
49
|
+
/** Reference path resolving to `MaxItemsPerBatch`. */
|
|
50
|
+
MaxItemsPerBatchPath?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
37
53
|
* A Distributed Map `ItemReader` (dataset source) or `ResultWriter` (result sink).
|
|
38
54
|
* Both point at an AWS resource — typically S3, or Athena for `ItemReader` — via
|
|
39
55
|
* the same `Resource` ARN shape used by Task states.
|
|
@@ -59,7 +75,7 @@ interface AslState {
|
|
|
59
75
|
Default?: string;
|
|
60
76
|
End?: boolean;
|
|
61
77
|
Error?: string;
|
|
62
|
-
ItemBatcher?:
|
|
78
|
+
ItemBatcher?: ItemBatcher;
|
|
63
79
|
ItemProcessor?: AslDefinition;
|
|
64
80
|
ItemReader?: ItemIo;
|
|
65
81
|
ItemSelector?: Record<string, any>;
|
|
@@ -79,8 +95,8 @@ interface AslState {
|
|
|
79
95
|
SecondsPath?: string;
|
|
80
96
|
Timestamp?: string;
|
|
81
97
|
TimestampPath?: string;
|
|
82
|
-
ToleratedFailureCount?: number;
|
|
83
|
-
ToleratedFailurePercentage?: number;
|
|
98
|
+
ToleratedFailureCount?: number | string;
|
|
99
|
+
ToleratedFailurePercentage?: number | string;
|
|
84
100
|
Type: StateType;
|
|
85
101
|
}
|
|
86
102
|
/** A complete Amazon States Language state machine definition. */
|
package/dist/cfn.d.ts
CHANGED
|
@@ -34,6 +34,22 @@ interface ProcessorConfig {
|
|
|
34
34
|
Mode?: "DISTRIBUTED" | "INLINE";
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
+
* A Distributed Map's `ItemBatcher`, which groups items so each child execution
|
|
38
|
+
* receives an array rather than a single item. Either limit may be set; the first
|
|
39
|
+
* one reached closes the batch.
|
|
40
|
+
*/
|
|
41
|
+
interface ItemBatcher {
|
|
42
|
+
BatchInput?: Record<string, any>;
|
|
43
|
+
/** Maximum payload bytes handed to one child execution. */
|
|
44
|
+
MaxInputBytesPerBatch?: number;
|
|
45
|
+
/** Reference path resolving to `MaxInputBytesPerBatch`. */
|
|
46
|
+
MaxInputBytesPerBatchPath?: string;
|
|
47
|
+
/** Maximum items handed to one child execution. */
|
|
48
|
+
MaxItemsPerBatch?: number;
|
|
49
|
+
/** Reference path resolving to `MaxItemsPerBatch`. */
|
|
50
|
+
MaxItemsPerBatchPath?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
37
53
|
* A Distributed Map `ItemReader` (dataset source) or `ResultWriter` (result sink).
|
|
38
54
|
* Both point at an AWS resource — typically S3, or Athena for `ItemReader` — via
|
|
39
55
|
* the same `Resource` ARN shape used by Task states.
|
|
@@ -59,7 +75,7 @@ interface AslState {
|
|
|
59
75
|
Default?: string;
|
|
60
76
|
End?: boolean;
|
|
61
77
|
Error?: string;
|
|
62
|
-
ItemBatcher?:
|
|
78
|
+
ItemBatcher?: ItemBatcher;
|
|
63
79
|
ItemProcessor?: AslDefinition;
|
|
64
80
|
ItemReader?: ItemIo;
|
|
65
81
|
ItemSelector?: Record<string, any>;
|
|
@@ -79,8 +95,8 @@ interface AslState {
|
|
|
79
95
|
SecondsPath?: string;
|
|
80
96
|
Timestamp?: string;
|
|
81
97
|
TimestampPath?: string;
|
|
82
|
-
ToleratedFailureCount?: number;
|
|
83
|
-
ToleratedFailurePercentage?: number;
|
|
98
|
+
ToleratedFailureCount?: number | string;
|
|
99
|
+
ToleratedFailurePercentage?: number | string;
|
|
84
100
|
Type: StateType;
|
|
85
101
|
}
|
|
86
102
|
/** A complete Amazon States Language state machine definition. */
|