@@ -19,7 +19,7 @@ To build the project and run tests locally:
19
19
``` sh
20
20
git clone https://github.com/serverlessworkflow/sdk-typescript.git
21
21
cd sdk-typescript
22
- npm install && npm run update-code-base && npm run test
22
+ npm install && npm run test
23
23
```
24
24
25
25
@@ -66,7 +66,6 @@ const workflow: Specification.Workflow = workflowBuilder()
66
66
.data ({
67
67
" result" : " Hello World!"
68
68
})
69
- .end (true )
70
69
.build ()
71
70
])
72
71
.build ();
@@ -76,9 +75,9 @@ const workflow: Specification.Workflow = workflowBuilder()
76
75
#### Load a file JSON/YAML to a Workflow instance
77
76
78
77
``` typescript
79
- import { Specification , WorkflowConverter } from ' @severlessworkflow/sdk-typescript' ;
78
+ import { Specification , Workflow } from ' @severlessworkflow/sdk-typescript' ;
80
79
81
- const workflow: Specification .Workflow = WorkflowConverter . fromString (source );
80
+ const workflow: Specification .Workflow = Workflow . fromSource (source );
82
81
```
83
82
Where ` source ` is a JSON or a YAML string.
84
83
@@ -109,18 +108,18 @@ const workflow: Specification.Workflow = workflowBuilder()
109
108
```
110
109
111
110
You can convert it to its string representation in JSON or YAML format
112
- by using the static methods ` toJson ` or ` toYaml ` respectively:
111
+ by using the static methods ` Workflow. toJson` or ` Workflow. toYaml` respectively:
113
112
114
113
``` typescript
115
- import { WorkflowConverter } from ' @severlessworkflow/sdk-typescript ' ;
114
+ import { Workflow } from ' ../src/lib/definitions/workflow ' ;
116
115
117
- const workflowAsJson: string = WorkflowConverter .toJson (workflow );
116
+ const workflowAsJson: string = Workflow .toJson (workflow );
118
117
```
119
118
120
119
``` typescript
121
- import { WorkflowConverter } from ' @severlessworkflow/sdk-typescript ' ;
120
+ import { Workflow } from ' ../src/lib/definitions/workflow ' ;
122
121
123
- const workflowAsYaml: string = WorkflowConverter .toYaml (workflow );
122
+ const workflowAsYaml: string = Workflow .toYaml (workflow );
124
123
```
125
124
126
125
@@ -169,4 +168,4 @@ const injectionStateValidator: ValidateFunction<Specification.Injectstate> = val
169
168
if (! injectionStateValidator (injectionState )) {
170
169
injectionStateValidator .errors .forEach (error => console .error (error .message ));
171
170
}
172
- ```
171
+ ```
0 commit comments