Skip to content

Commit

Permalink
fix-155 (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
antmendoza authored Jan 28, 2023
1 parent 30fc59c commit 641a329
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,25 @@ npm install && npm run build && npm run test

#### Install

For the latest stable version:

##### Version >= 4.0.0
Note: Version 4.0.0 has not been released yet.
```sh
npm i @serverlessworkflow/sdk-typescript
```


##### Version < 4.0.0
```sh
npm i @severlessworkflow/sdk-typescript
```



#### Create Workflow using builder API

```typescript
import { workflowBuilder, injectstateBuilder, Specification } from '@severlessworkflow/sdk-typescript';
import { workflowBuilder, injectstateBuilder, Specification } from '@serverlessworkflow/sdk-typescript';

const workflow: Specification.Workflow = workflowBuilder()
.id("helloworld")
Expand All @@ -69,7 +78,7 @@ const workflow: Specification.Workflow = workflowBuilder()
#### Create Workflow from JSON/YAML source

```typescript
import { Specification, Workflow } from '@severlessworkflow/sdk-typescript';
import { Specification, Workflow } from '@serverlessworkflow/sdk-typescript';

const source = `id: helloworld
version: '1.0'
Expand All @@ -93,7 +102,7 @@ Where `source` can be in both JSON or YAML format.
Having the following workflow instance:

```typescript
import { workflowBuilder, injectstateBuilder, Specification } from '@severlessworkflow/sdk-typescript';
import { workflowBuilder, injectstateBuilder, Specification } from '@serverlessworkflow/sdk-typescript';

const workflow: Specification.Workflow = workflowBuilder()
.id("helloworld")
Expand Down Expand Up @@ -147,7 +156,7 @@ The sdk provides a way to validate if a workflow object is compliant with the se
- `validate(): boolean`

```typescript
import {WorkflowValidator, Specification} from '@severlessworkflow/sdk-typescript';
import {WorkflowValidator, Specification} from '@serverlessworkflow/sdk-typescript';
import {Workflow} from "./workflow";

const workflow = {
Expand Down Expand Up @@ -179,7 +188,7 @@ You can also validate parts of a workflow using `validators`:

```typescript
import { ValidateFunction } from 'ajv';
import { validators, Specification } from '@severlessworkflow/sdk-typescript';
import { validators, Specification } from '@serverlessworkflow/sdk-typescript';

const injectionState: Specification.Injectstate = workflow.states[0];
const injectionStateValidator: ValidateFunction<Specification.Injectstate> = validators.get('Injectstate');
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@severlessworkflow/sdk-typescript",
"name": "@serverlessworkflow/sdk-typescript",
"version": "4.0.0",
"schemaVersion": "0.8",
"description": "Typescript SDK for Serverless Workflow Specification",
Expand Down

0 comments on commit 641a329

Please sign in to comment.