Skip to content

Commit 06e5a4a

Browse files
authored
Merge pull request #189 from neuroglia-io/v1.0.0
Updated for spec v1.0.0
2 parents 0fa8f89 + 72c1a6f commit 06e5a4a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2700
-697
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The npm [`@serverlessworkflow/sdk`](https://www.npmjs.com/package/@serverlesswor
1414

1515
| Latest Releases | Conformance to Spec Version |
1616
| :---: | :---: |
17-
| [v1.0.0-alpha5.\*](https://github.com/serverlessworkflow/sdk-typescript/releases/) | [v1.0.0-alpha5](https://github.com/serverlessworkflow/specification) |
17+
| [v1.0.0.\*](https://github.com/serverlessworkflow/sdk-typescript/releases/) | [v1.0.0](https://github.com/serverlessworkflow/specification) |
1818

1919
> [!WARNING]
2020
> Previous versions of the SDK were published with a typo in the scope:
@@ -60,7 +60,7 @@ The `validate` function is directly exported and can be used as `validate('Workf
6060

6161
### Installation
6262
> [!NOTE]
63-
> Version v1.0.0-alpha5.\* has not been released yet.
63+
> Version v1.0.0.\* has not been released yet.
6464
6565
```sh
6666
npm install @serverlessworkflow/sdk
@@ -77,7 +77,7 @@ import { Classes } from '@serverlessworkflow/sdk';
7777
// const text = await fetch('https://myserver.com/my-workflow-definition.json');
7878
const text = `
7979
document:
80-
dsl: 1.0.0-alpha5
80+
dsl: 1.0.0
8181
name: test
8282
version: 1.0.0
8383
namespace: default
@@ -98,7 +98,7 @@ import { Classes, Specification, validate } from '@serverlessworkflow/sdk';
9898
// Simply cast an object:
9999
const workflowDefinition = {
100100
document: {
101-
dsl: '1.0.0-alpha5',
101+
dsl: '1.0.0',
102102
name: 'test',
103103
version: '1.0.0',
104104
namespace: 'default',
@@ -134,7 +134,7 @@ import { Classes, validate } from '@serverlessworkflow/sdk';
134134
// Simply use the constructor
135135
const workflowDefinition = new Classes.Workflow({
136136
document: {
137-
dsl: '1.0.0-alpha5',
137+
dsl: '1.0.0',
138138
name: 'test',
139139
version: '1.0.0',
140140
namespace: 'default',
@@ -177,7 +177,7 @@ import { documentBuilder, setTaskBuilder, taskListBuilder, workflowBuilder } fro
177177
const workflowDefinition = workflowBuilder(/*workflowDefinitionObject*/)
178178
.document(
179179
documentBuilder()
180-
.dsl('1.0.0-alpha5')
180+
.dsl('1.0.0')
181181
.name('test')
182182
.version('1.0.0')
183183
.namespace('default')

examples/browser/using-class.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
const { Classes: { Workflow } } = serverWorkflowSdk;
1717
const workflow = new Workflow({
1818
document: {
19-
dsl: '1.0.0-alpha5',
19+
dsl: '1.0.0',
2020
name: 'using-class',
2121
version: '1.0.0',
2222
namespace: 'default',

examples/browser/using-fluent-api.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
const { workflowBuilder, documentBuilder, taskListBuilder, setTaskBuilder } = serverWorkflowSdk;
1717
try {
1818
const workflow = workflowBuilder()
19-
.document(documentBuilder().dsl('1.0.0-alpha5').name('using-fluent-api').version('1.0.0').namespace('default').build())
19+
.document(documentBuilder().dsl('1.0.0').name('using-fluent-api').version('1.0.0').namespace('default').build())
2020
.do(
2121
taskListBuilder()
2222
.push({

examples/browser/using-json.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
const { Classes: { Workflow } } = serverWorkflowSdk;
1717
const myJsonWorkflow = `{
1818
"document": {
19-
"dsl": "1.0.0-alpha5",
19+
"dsl": "1.0.0",
2020
"name": "using-json",
2121
"version": "1.0.0",
2222
"namespace": "default"

examples/browser/using-plain-object.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
const { Classes, Specification, validate } = serverWorkflowSdk;
1717
const workflowDefinition = {
1818
document: {
19-
dsl: '1.0.0-alpha5',
19+
dsl: '1.0.0',
2020
name: 'using-plain-object',
2121
version: '1.0.0',
2222
namespace: 'default',

examples/node/using-class.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const { Workflow } = Classes;
1818

1919
const workflow = new Workflow({
2020
document: {
21-
dsl: '1.0.0-alpha5',
21+
dsl: '1.0.0',
2222
name: 'using-class',
2323
version: '1.0.0',
2424
namespace: 'default',

examples/node/using-fluent-api.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ import {
2222

2323
try {
2424
const workflow = workflowBuilder()
25-
.document(
26-
documentBuilder().dsl('1.0.0-alpha5').name('using-fluent-api').version('1.0.0').namespace('default').build(),
27-
)
25+
.document(documentBuilder().dsl('1.0.0').name('using-fluent-api').version('1.0.0').namespace('default').build())
2826
.do(
2927
taskListBuilder()
3028
.push({

examples/node/using-json.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Classes } from /*'@serverlessworkflow/sdk';*/ '../../dist';
33
const myJsonWorkflow = `
44
{
55
"document": {
6-
"dsl": "1.0.0-alpha5",
6+
"dsl": "1.0.0",
77
"name": "using-json",
88
"version": "1.0.0",
99
"namespace": "default"

examples/node/using-plain-object.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Classes, Specification, validate } from /*'@serverlessworkflow/sdk';*/
22

33
const workflowDefinition = {
44
document: {
5-
dsl: '1.0.0-alpha5',
5+
dsl: '1.0.0',
66
name: 'using-plain-object',
77
version: '1.0.0',
88
namespace: 'default',

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@serverlessworkflow/sdk",
3-
"version": "1.0.0-alpha5.0",
4-
"schemaVersion": "1.0.0-alpha5",
3+
"version": "1.0.0",
4+
"schemaVersion": "1.0.0",
55
"description": "Typescript SDK for Serverless Workflow Specification",
66
"main": "umd/index.umd.min.js",
77
"browser": "umd/index.umd.min.js",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Copyright 2021-Present The Serverless Workflow Specification Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/*****************************************************************************************
18+
*
19+
* /!\ This file is computer generated. Any manual modification can and will be lost. /!\
20+
*
21+
*****************************************************************************************/
22+
23+
import { builder, Builder, BuildOptions } from '../../builder';
24+
import { Classes } from '../classes';
25+
import { AnyEventConsumptionStrategyUntilIntersection } from '../classes/any-event-consumption-strategy-until';
26+
import { Specification } from '../definitions';
27+
28+
/**
29+
* The internal function used by the builder proxy to validate and return its underlying object
30+
* @param {Specification.AnyEventConsumptionStrategyUntil} model The proxied object
31+
* @param {BuildOptions} options The build options to use
32+
* @returns {AnyEventConsumptionStrategyUntilIntersection} The built object
33+
*/
34+
function buildingFn(
35+
model: Specification.AnyEventConsumptionStrategyUntil,
36+
options: BuildOptions,
37+
): AnyEventConsumptionStrategyUntilIntersection {
38+
const instance = new Classes.AnyEventConsumptionStrategyUntil(model);
39+
if (options.validate) instance.validate();
40+
return (options.normalize ? instance.normalize() : instance) as AnyEventConsumptionStrategyUntilIntersection;
41+
}
42+
43+
/**
44+
* A factory to create a builder proxy for the type `AnyEventConsumptionStrategyUntilIntersection`
45+
* @returns {Builder<AnyEventConsumptionStrategyUntilIntersection, AnyEventConsumptionStrategyUntilIntersection>} A builder for `AnyEventConsumptionStrategyUntilIntersection`
46+
*/
47+
export const anyEventConsumptionStrategyUntilBuilder = (
48+
model?: Partial<Specification.AnyEventConsumptionStrategyUntil>,
49+
): Builder<Partial<Specification.AnyEventConsumptionStrategyUntil>, AnyEventConsumptionStrategyUntilIntersection> =>
50+
builder<Specification.AnyEventConsumptionStrategyUntil, AnyEventConsumptionStrategyUntilIntersection>(
51+
model,
52+
buildingFn,
53+
);

src/lib/generated/builders/with-async-api-payload-builder.ts src/lib/generated/builders/any-event-until-consumed-builder.ts

+15-12
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,29 @@
2222

2323
import { builder, Builder, BuildOptions } from '../../builder';
2424
import { Classes } from '../classes';
25-
import { WithAsyncAPIPayloadIntersection } from '../classes/with-async-api-payload';
25+
import { AnyEventUntilConsumedIntersection } from '../classes/any-event-until-consumed';
2626
import { Specification } from '../definitions';
2727

2828
/**
2929
* The internal function used by the builder proxy to validate and return its underlying object
30-
* @param {Specification.WithAsyncAPIPayload} model The proxied object
30+
* @param {Specification.AnyEventUntilConsumed} model The proxied object
3131
* @param {BuildOptions} options The build options to use
32-
* @returns {WithAsyncAPIPayloadIntersection} The built object
32+
* @returns {AnyEventUntilConsumedIntersection} The built object
3333
*/
34-
function buildingFn(model: Specification.WithAsyncAPIPayload, options: BuildOptions): WithAsyncAPIPayloadIntersection {
35-
const instance = new Classes.WithAsyncAPIPayload(model);
34+
function buildingFn(
35+
model: Specification.AnyEventUntilConsumed,
36+
options: BuildOptions,
37+
): AnyEventUntilConsumedIntersection {
38+
const instance = new Classes.AnyEventUntilConsumed(model);
3639
if (options.validate) instance.validate();
37-
return (options.normalize ? instance.normalize() : instance) as WithAsyncAPIPayloadIntersection;
40+
return (options.normalize ? instance.normalize() : instance) as AnyEventUntilConsumedIntersection;
3841
}
3942

4043
/**
41-
* A factory to create a builder proxy for the type `WithAsyncAPIPayloadIntersection`
42-
* @returns {Builder<WithAsyncAPIPayloadIntersection, WithAsyncAPIPayloadIntersection>} A builder for `WithAsyncAPIPayloadIntersection`
44+
* A factory to create a builder proxy for the type `AnyEventUntilConsumedIntersection`
45+
* @returns {Builder<AnyEventUntilConsumedIntersection, AnyEventUntilConsumedIntersection>} A builder for `AnyEventUntilConsumedIntersection`
4346
*/
44-
export const withAsyncAPIPayloadBuilder = (
45-
model?: Partial<Specification.WithAsyncAPIPayload>,
46-
): Builder<Partial<Specification.WithAsyncAPIPayload>, WithAsyncAPIPayloadIntersection> =>
47-
builder<Specification.WithAsyncAPIPayload, WithAsyncAPIPayloadIntersection>(model, buildingFn);
47+
export const anyEventUntilConsumedBuilder = (
48+
model?: Partial<Specification.AnyEventUntilConsumed>,
49+
): Builder<Partial<Specification.AnyEventUntilConsumed>, AnyEventUntilConsumedIntersection> =>
50+
builder<Specification.AnyEventUntilConsumed, AnyEventUntilConsumedIntersection>(model, buildingFn);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright 2021-Present The Serverless Workflow Specification Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/*****************************************************************************************
18+
*
19+
* /!\ This file is computer generated. Any manual modification can and will be lost. /!\
20+
*
21+
*****************************************************************************************/
22+
23+
import { builder, Builder, BuildOptions } from '../../builder';
24+
import { Classes } from '../classes';
25+
import { ContainerLifetimeIntersection } from '../classes/container-lifetime';
26+
import { Specification } from '../definitions';
27+
28+
/**
29+
* The internal function used by the builder proxy to validate and return its underlying object
30+
* @param {Specification.ContainerLifetime} model The proxied object
31+
* @param {BuildOptions} options The build options to use
32+
* @returns {ContainerLifetimeIntersection} The built object
33+
*/
34+
function buildingFn(model: Specification.ContainerLifetime, options: BuildOptions): ContainerLifetimeIntersection {
35+
const instance = new Classes.ContainerLifetime(model);
36+
if (options.validate) instance.validate();
37+
return (options.normalize ? instance.normalize() : instance) as ContainerLifetimeIntersection;
38+
}
39+
40+
/**
41+
* A factory to create a builder proxy for the type `ContainerLifetimeIntersection`
42+
* @returns {Builder<ContainerLifetimeIntersection, ContainerLifetimeIntersection>} A builder for `ContainerLifetimeIntersection`
43+
*/
44+
export const containerLifetimeBuilder = (
45+
model?: Partial<Specification.ContainerLifetime>,
46+
): Builder<Partial<Specification.ContainerLifetime>, ContainerLifetimeIntersection> =>
47+
builder<Specification.ContainerLifetime, ContainerLifetimeIntersection>(model, buildingFn);

src/lib/generated/builders/with-http-body-builder.ts src/lib/generated/builders/error-filter-builder.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,26 @@
2222

2323
import { builder, Builder, BuildOptions } from '../../builder';
2424
import { Classes } from '../classes';
25-
import { WithHTTPBodyIntersection } from '../classes/with-http-body';
25+
import { ErrorFilterIntersection } from '../classes/error-filter';
2626
import { Specification } from '../definitions';
2727

2828
/**
2929
* The internal function used by the builder proxy to validate and return its underlying object
30-
* @param {Specification.WithHTTPBody} model The proxied object
30+
* @param {Specification.ErrorFilter} model The proxied object
3131
* @param {BuildOptions} options The build options to use
32-
* @returns {WithHTTPBodyIntersection} The built object
32+
* @returns {ErrorFilterIntersection} The built object
3333
*/
34-
function buildingFn(model: Specification.WithHTTPBody, options: BuildOptions): WithHTTPBodyIntersection {
35-
const instance = new Classes.WithHTTPBody(model);
34+
function buildingFn(model: Specification.ErrorFilter, options: BuildOptions): ErrorFilterIntersection {
35+
const instance = new Classes.ErrorFilter(model);
3636
if (options.validate) instance.validate();
37-
return (options.normalize ? instance.normalize() : instance) as WithHTTPBodyIntersection;
37+
return (options.normalize ? instance.normalize() : instance) as ErrorFilterIntersection;
3838
}
3939

4040
/**
41-
* A factory to create a builder proxy for the type `WithHTTPBodyIntersection`
42-
* @returns {Builder<WithHTTPBodyIntersection, WithHTTPBodyIntersection>} A builder for `WithHTTPBodyIntersection`
41+
* A factory to create a builder proxy for the type `ErrorFilterIntersection`
42+
* @returns {Builder<ErrorFilterIntersection, ErrorFilterIntersection>} A builder for `ErrorFilterIntersection`
4343
*/
44-
export const withHTTPBodyBuilder = (
45-
model?: Partial<Specification.WithHTTPBody>,
46-
): Builder<Partial<Specification.WithHTTPBody>, WithHTTPBodyIntersection> =>
47-
builder<Specification.WithHTTPBody, WithHTTPBodyIntersection>(model, buildingFn);
44+
export const errorFilterBuilder = (
45+
model?: Partial<Specification.ErrorFilter>,
46+
): Builder<Partial<Specification.ErrorFilter>, ErrorFilterIntersection> =>
47+
builder<Specification.ErrorFilter, ErrorFilterIntersection>(model, buildingFn);

src/lib/generated/builders/with-http-query-builder.ts src/lib/generated/builders/event-data-builder.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,26 @@
2222

2323
import { builder, Builder, BuildOptions } from '../../builder';
2424
import { Classes } from '../classes';
25-
import { WithHTTPQueryIntersection } from '../classes/with-http-query';
25+
import { EventDataIntersection } from '../classes/event-data';
2626
import { Specification } from '../definitions';
2727

2828
/**
2929
* The internal function used by the builder proxy to validate and return its underlying object
30-
* @param {Specification.WithHTTPQuery} model The proxied object
30+
* @param {Specification.EventData} model The proxied object
3131
* @param {BuildOptions} options The build options to use
32-
* @returns {WithHTTPQueryIntersection} The built object
32+
* @returns {EventDataIntersection} The built object
3333
*/
34-
function buildingFn(model: Specification.WithHTTPQuery, options: BuildOptions): WithHTTPQueryIntersection {
35-
const instance = new Classes.WithHTTPQuery(model);
34+
function buildingFn(model: Specification.EventData, options: BuildOptions): EventDataIntersection {
35+
const instance = new Classes.EventData(model);
3636
if (options.validate) instance.validate();
37-
return (options.normalize ? instance.normalize() : instance) as WithHTTPQueryIntersection;
37+
return (options.normalize ? instance.normalize() : instance) as EventDataIntersection;
3838
}
3939

4040
/**
41-
* A factory to create a builder proxy for the type `WithHTTPQueryIntersection`
42-
* @returns {Builder<WithHTTPQueryIntersection, WithHTTPQueryIntersection>} A builder for `WithHTTPQueryIntersection`
41+
* A factory to create a builder proxy for the type `EventDataIntersection`
42+
* @returns {Builder<EventDataIntersection, EventDataIntersection>} A builder for `EventDataIntersection`
4343
*/
44-
export const withHTTPQueryBuilder = (
45-
model?: Partial<Specification.WithHTTPQuery>,
46-
): Builder<Partial<Specification.WithHTTPQuery>, WithHTTPQueryIntersection> =>
47-
builder<Specification.WithHTTPQuery, WithHTTPQueryIntersection>(model, buildingFn);
44+
export const eventDataBuilder = (
45+
model?: Partial<Specification.EventData>,
46+
): Builder<Partial<Specification.EventData>, EventDataIntersection> =>
47+
builder<Specification.EventData, EventDataIntersection>(model, buildingFn);

0 commit comments

Comments
 (0)