diff --git a/README.md b/README.md index 530e79a..d12dad2 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ The npm [`@serverlessworkflow/sdk`](https://www.npmjs.com/package/@serverlesswor | Latest Releases | Conformance to Spec Version | | :---: | :---: | -| [v1.0.0-alpha5.\*](https://github.com/serverlessworkflow/sdk-typescript/releases/) | [v1.0.0-alpha5](https://github.com/serverlessworkflow/specification) | +| [v1.0.0.\*](https://github.com/serverlessworkflow/sdk-typescript/releases/) | [v1.0.0](https://github.com/serverlessworkflow/specification) | > [!WARNING] > 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 ### Installation > [!NOTE] -> Version v1.0.0-alpha5.\* has not been released yet. +> Version v1.0.0.\* has not been released yet. ```sh npm install @serverlessworkflow/sdk @@ -77,7 +77,7 @@ import { Classes } from '@serverlessworkflow/sdk'; // const text = await fetch('https://myserver.com/my-workflow-definition.json'); const text = ` document: - dsl: 1.0.0-alpha5 + dsl: 1.0.0 name: test version: 1.0.0 namespace: default @@ -98,7 +98,7 @@ import { Classes, Specification, validate } from '@serverlessworkflow/sdk'; // Simply cast an object: const workflowDefinition = { document: { - dsl: '1.0.0-alpha5', + dsl: '1.0.0', name: 'test', version: '1.0.0', namespace: 'default', @@ -134,7 +134,7 @@ import { Classes, validate } from '@serverlessworkflow/sdk'; // Simply use the constructor const workflowDefinition = new Classes.Workflow({ document: { - dsl: '1.0.0-alpha5', + dsl: '1.0.0', name: 'test', version: '1.0.0', namespace: 'default', @@ -177,7 +177,7 @@ import { documentBuilder, setTaskBuilder, taskListBuilder, workflowBuilder } fro const workflowDefinition = workflowBuilder(/*workflowDefinitionObject*/) .document( documentBuilder() - .dsl('1.0.0-alpha5') + .dsl('1.0.0') .name('test') .version('1.0.0') .namespace('default') diff --git a/examples/browser/using-class.html b/examples/browser/using-class.html index ba0ee64..6f2f5ee 100644 --- a/examples/browser/using-class.html +++ b/examples/browser/using-class.html @@ -16,7 +16,7 @@ const { Classes: { Workflow } } = serverWorkflowSdk; const workflow = new Workflow({ document: { - dsl: '1.0.0-alpha5', + dsl: '1.0.0', name: 'using-class', version: '1.0.0', namespace: 'default', diff --git a/examples/browser/using-fluent-api.html b/examples/browser/using-fluent-api.html index 89ac64f..5f82098 100644 --- a/examples/browser/using-fluent-api.html +++ b/examples/browser/using-fluent-api.html @@ -16,7 +16,7 @@ const { workflowBuilder, documentBuilder, taskListBuilder, setTaskBuilder } = serverWorkflowSdk; try { const workflow = workflowBuilder() - .document(documentBuilder().dsl('1.0.0-alpha5').name('using-fluent-api').version('1.0.0').namespace('default').build()) + .document(documentBuilder().dsl('1.0.0').name('using-fluent-api').version('1.0.0').namespace('default').build()) .do( taskListBuilder() .push({ diff --git a/examples/browser/using-json.html b/examples/browser/using-json.html index c5aebca..f5e744e 100644 --- a/examples/browser/using-json.html +++ b/examples/browser/using-json.html @@ -16,7 +16,7 @@ const { Classes: { Workflow } } = serverWorkflowSdk; const myJsonWorkflow = `{ "document": { - "dsl": "1.0.0-alpha5", + "dsl": "1.0.0", "name": "using-json", "version": "1.0.0", "namespace": "default" diff --git a/examples/browser/using-plain-object.html b/examples/browser/using-plain-object.html index f22b62c..76ffe68 100644 --- a/examples/browser/using-plain-object.html +++ b/examples/browser/using-plain-object.html @@ -16,7 +16,7 @@ const { Classes, Specification, validate } = serverWorkflowSdk; const workflowDefinition = { document: { - dsl: '1.0.0-alpha5', + dsl: '1.0.0', name: 'using-plain-object', version: '1.0.0', namespace: 'default', diff --git a/examples/node/using-class.ts b/examples/node/using-class.ts index 8537eaa..bdf2546 100644 --- a/examples/node/using-class.ts +++ b/examples/node/using-class.ts @@ -18,7 +18,7 @@ const { Workflow } = Classes; const workflow = new Workflow({ document: { - dsl: '1.0.0-alpha5', + dsl: '1.0.0', name: 'using-class', version: '1.0.0', namespace: 'default', diff --git a/examples/node/using-fluent-api.ts b/examples/node/using-fluent-api.ts index 7020897..93ea946 100644 --- a/examples/node/using-fluent-api.ts +++ b/examples/node/using-fluent-api.ts @@ -22,9 +22,7 @@ import { try { const workflow = workflowBuilder() - .document( - documentBuilder().dsl('1.0.0-alpha5').name('using-fluent-api').version('1.0.0').namespace('default').build(), - ) + .document(documentBuilder().dsl('1.0.0').name('using-fluent-api').version('1.0.0').namespace('default').build()) .do( taskListBuilder() .push({ diff --git a/examples/node/using-json.ts b/examples/node/using-json.ts index cad31c3..70ab96d 100644 --- a/examples/node/using-json.ts +++ b/examples/node/using-json.ts @@ -3,7 +3,7 @@ import { Classes } from /*'@serverlessworkflow/sdk';*/ '../../dist'; const myJsonWorkflow = ` { "document": { - "dsl": "1.0.0-alpha5", + "dsl": "1.0.0", "name": "using-json", "version": "1.0.0", "namespace": "default" diff --git a/examples/node/using-plain-object.ts b/examples/node/using-plain-object.ts index 449171c..c1d704a 100644 --- a/examples/node/using-plain-object.ts +++ b/examples/node/using-plain-object.ts @@ -2,7 +2,7 @@ import { Classes, Specification, validate } from /*'@serverlessworkflow/sdk';*/ const workflowDefinition = { document: { - dsl: '1.0.0-alpha5', + dsl: '1.0.0', name: 'using-plain-object', version: '1.0.0', namespace: 'default', diff --git a/package-lock.json b/package-lock.json index 325da6b..7e40552 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@serverlessworkflow/sdk", - "version": "1.0.0-alpha5.0", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@serverlessworkflow/sdk", - "version": "1.0.0-alpha5.0", + "version": "1.0.0", "license": "http://www.apache.org/licenses/LICENSE-2.0.txt", "dependencies": { "ajv": "^8.17.1", diff --git a/package.json b/package.json index d85e53d..591ffaf 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@serverlessworkflow/sdk", - "version": "1.0.0-alpha5.0", - "schemaVersion": "1.0.0-alpha5", + "version": "1.0.0", + "schemaVersion": "1.0.0", "description": "Typescript SDK for Serverless Workflow Specification", "main": "umd/index.umd.min.js", "browser": "umd/index.umd.min.js", diff --git a/src/lib/generated/builders/any-event-consumption-strategy-until-builder.ts b/src/lib/generated/builders/any-event-consumption-strategy-until-builder.ts new file mode 100644 index 0000000..dbdf9e5 --- /dev/null +++ b/src/lib/generated/builders/any-event-consumption-strategy-until-builder.ts @@ -0,0 +1,53 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/***************************************************************************************** + * + * /!\ This file is computer generated. Any manual modification can and will be lost. /!\ + * + *****************************************************************************************/ + +import { builder, Builder, BuildOptions } from '../../builder'; +import { Classes } from '../classes'; +import { AnyEventConsumptionStrategyUntilIntersection } from '../classes/any-event-consumption-strategy-until'; +import { Specification } from '../definitions'; + +/** + * The internal function used by the builder proxy to validate and return its underlying object + * @param {Specification.AnyEventConsumptionStrategyUntil} model The proxied object + * @param {BuildOptions} options The build options to use + * @returns {AnyEventConsumptionStrategyUntilIntersection} The built object + */ +function buildingFn( + model: Specification.AnyEventConsumptionStrategyUntil, + options: BuildOptions, +): AnyEventConsumptionStrategyUntilIntersection { + const instance = new Classes.AnyEventConsumptionStrategyUntil(model); + if (options.validate) instance.validate(); + return (options.normalize ? instance.normalize() : instance) as AnyEventConsumptionStrategyUntilIntersection; +} + +/** + * A factory to create a builder proxy for the type `AnyEventConsumptionStrategyUntilIntersection` + * @returns {Builder} A builder for `AnyEventConsumptionStrategyUntilIntersection` + */ +export const anyEventConsumptionStrategyUntilBuilder = ( + model?: Partial, +): Builder, AnyEventConsumptionStrategyUntilIntersection> => + builder( + model, + buildingFn, + ); diff --git a/src/lib/generated/builders/with-async-api-payload-builder.ts b/src/lib/generated/builders/any-event-until-consumed-builder.ts similarity index 57% rename from src/lib/generated/builders/with-async-api-payload-builder.ts rename to src/lib/generated/builders/any-event-until-consumed-builder.ts index 3cacabf..1af840d 100644 --- a/src/lib/generated/builders/with-async-api-payload-builder.ts +++ b/src/lib/generated/builders/any-event-until-consumed-builder.ts @@ -22,26 +22,29 @@ import { builder, Builder, BuildOptions } from '../../builder'; import { Classes } from '../classes'; -import { WithAsyncAPIPayloadIntersection } from '../classes/with-async-api-payload'; +import { AnyEventUntilConsumedIntersection } from '../classes/any-event-until-consumed'; import { Specification } from '../definitions'; /** * The internal function used by the builder proxy to validate and return its underlying object - * @param {Specification.WithAsyncAPIPayload} model The proxied object + * @param {Specification.AnyEventUntilConsumed} model The proxied object * @param {BuildOptions} options The build options to use - * @returns {WithAsyncAPIPayloadIntersection} The built object + * @returns {AnyEventUntilConsumedIntersection} The built object */ -function buildingFn(model: Specification.WithAsyncAPIPayload, options: BuildOptions): WithAsyncAPIPayloadIntersection { - const instance = new Classes.WithAsyncAPIPayload(model); +function buildingFn( + model: Specification.AnyEventUntilConsumed, + options: BuildOptions, +): AnyEventUntilConsumedIntersection { + const instance = new Classes.AnyEventUntilConsumed(model); if (options.validate) instance.validate(); - return (options.normalize ? instance.normalize() : instance) as WithAsyncAPIPayloadIntersection; + return (options.normalize ? instance.normalize() : instance) as AnyEventUntilConsumedIntersection; } /** - * A factory to create a builder proxy for the type `WithAsyncAPIPayloadIntersection` - * @returns {Builder} A builder for `WithAsyncAPIPayloadIntersection` + * A factory to create a builder proxy for the type `AnyEventUntilConsumedIntersection` + * @returns {Builder} A builder for `AnyEventUntilConsumedIntersection` */ -export const withAsyncAPIPayloadBuilder = ( - model?: Partial, -): Builder, WithAsyncAPIPayloadIntersection> => - builder(model, buildingFn); +export const anyEventUntilConsumedBuilder = ( + model?: Partial, +): Builder, AnyEventUntilConsumedIntersection> => + builder(model, buildingFn); diff --git a/src/lib/generated/builders/container-lifetime-builder.ts b/src/lib/generated/builders/container-lifetime-builder.ts new file mode 100644 index 0000000..b1bf0f8 --- /dev/null +++ b/src/lib/generated/builders/container-lifetime-builder.ts @@ -0,0 +1,47 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/***************************************************************************************** + * + * /!\ This file is computer generated. Any manual modification can and will be lost. /!\ + * + *****************************************************************************************/ + +import { builder, Builder, BuildOptions } from '../../builder'; +import { Classes } from '../classes'; +import { ContainerLifetimeIntersection } from '../classes/container-lifetime'; +import { Specification } from '../definitions'; + +/** + * The internal function used by the builder proxy to validate and return its underlying object + * @param {Specification.ContainerLifetime} model The proxied object + * @param {BuildOptions} options The build options to use + * @returns {ContainerLifetimeIntersection} The built object + */ +function buildingFn(model: Specification.ContainerLifetime, options: BuildOptions): ContainerLifetimeIntersection { + const instance = new Classes.ContainerLifetime(model); + if (options.validate) instance.validate(); + return (options.normalize ? instance.normalize() : instance) as ContainerLifetimeIntersection; +} + +/** + * A factory to create a builder proxy for the type `ContainerLifetimeIntersection` + * @returns {Builder} A builder for `ContainerLifetimeIntersection` + */ +export const containerLifetimeBuilder = ( + model?: Partial, +): Builder, ContainerLifetimeIntersection> => + builder(model, buildingFn); diff --git a/src/lib/generated/builders/with-http-body-builder.ts b/src/lib/generated/builders/error-filter-builder.ts similarity index 62% rename from src/lib/generated/builders/with-http-body-builder.ts rename to src/lib/generated/builders/error-filter-builder.ts index 4eea7cf..a8c0558 100644 --- a/src/lib/generated/builders/with-http-body-builder.ts +++ b/src/lib/generated/builders/error-filter-builder.ts @@ -22,26 +22,26 @@ import { builder, Builder, BuildOptions } from '../../builder'; import { Classes } from '../classes'; -import { WithHTTPBodyIntersection } from '../classes/with-http-body'; +import { ErrorFilterIntersection } from '../classes/error-filter'; import { Specification } from '../definitions'; /** * The internal function used by the builder proxy to validate and return its underlying object - * @param {Specification.WithHTTPBody} model The proxied object + * @param {Specification.ErrorFilter} model The proxied object * @param {BuildOptions} options The build options to use - * @returns {WithHTTPBodyIntersection} The built object + * @returns {ErrorFilterIntersection} The built object */ -function buildingFn(model: Specification.WithHTTPBody, options: BuildOptions): WithHTTPBodyIntersection { - const instance = new Classes.WithHTTPBody(model); +function buildingFn(model: Specification.ErrorFilter, options: BuildOptions): ErrorFilterIntersection { + const instance = new Classes.ErrorFilter(model); if (options.validate) instance.validate(); - return (options.normalize ? instance.normalize() : instance) as WithHTTPBodyIntersection; + return (options.normalize ? instance.normalize() : instance) as ErrorFilterIntersection; } /** - * A factory to create a builder proxy for the type `WithHTTPBodyIntersection` - * @returns {Builder} A builder for `WithHTTPBodyIntersection` + * A factory to create a builder proxy for the type `ErrorFilterIntersection` + * @returns {Builder} A builder for `ErrorFilterIntersection` */ -export const withHTTPBodyBuilder = ( - model?: Partial, -): Builder, WithHTTPBodyIntersection> => - builder(model, buildingFn); +export const errorFilterBuilder = ( + model?: Partial, +): Builder, ErrorFilterIntersection> => + builder(model, buildingFn); diff --git a/src/lib/generated/builders/with-http-query-builder.ts b/src/lib/generated/builders/event-data-builder.ts similarity index 61% rename from src/lib/generated/builders/with-http-query-builder.ts rename to src/lib/generated/builders/event-data-builder.ts index 7a58dda..92a8c96 100644 --- a/src/lib/generated/builders/with-http-query-builder.ts +++ b/src/lib/generated/builders/event-data-builder.ts @@ -22,26 +22,26 @@ import { builder, Builder, BuildOptions } from '../../builder'; import { Classes } from '../classes'; -import { WithHTTPQueryIntersection } from '../classes/with-http-query'; +import { EventDataIntersection } from '../classes/event-data'; import { Specification } from '../definitions'; /** * The internal function used by the builder proxy to validate and return its underlying object - * @param {Specification.WithHTTPQuery} model The proxied object + * @param {Specification.EventData} model The proxied object * @param {BuildOptions} options The build options to use - * @returns {WithHTTPQueryIntersection} The built object + * @returns {EventDataIntersection} The built object */ -function buildingFn(model: Specification.WithHTTPQuery, options: BuildOptions): WithHTTPQueryIntersection { - const instance = new Classes.WithHTTPQuery(model); +function buildingFn(model: Specification.EventData, options: BuildOptions): EventDataIntersection { + const instance = new Classes.EventData(model); if (options.validate) instance.validate(); - return (options.normalize ? instance.normalize() : instance) as WithHTTPQueryIntersection; + return (options.normalize ? instance.normalize() : instance) as EventDataIntersection; } /** - * A factory to create a builder proxy for the type `WithHTTPQueryIntersection` - * @returns {Builder} A builder for `WithHTTPQueryIntersection` + * A factory to create a builder proxy for the type `EventDataIntersection` + * @returns {Builder} A builder for `EventDataIntersection` */ -export const withHTTPQueryBuilder = ( - model?: Partial, -): Builder, WithHTTPQueryIntersection> => - builder(model, buildingFn); +export const eventDataBuilder = ( + model?: Partial, +): Builder, EventDataIntersection> => + builder(model, buildingFn); diff --git a/src/lib/generated/builders/with-http-headers-builder.ts b/src/lib/generated/builders/http-body-builder.ts similarity index 60% rename from src/lib/generated/builders/with-http-headers-builder.ts rename to src/lib/generated/builders/http-body-builder.ts index 8af5c76..0e15495 100644 --- a/src/lib/generated/builders/with-http-headers-builder.ts +++ b/src/lib/generated/builders/http-body-builder.ts @@ -22,26 +22,26 @@ import { builder, Builder, BuildOptions } from '../../builder'; import { Classes } from '../classes'; -import { WithHTTPHeadersIntersection } from '../classes/with-http-headers'; +import { HTTPBodyIntersection } from '../classes/http-body'; import { Specification } from '../definitions'; /** * The internal function used by the builder proxy to validate and return its underlying object - * @param {Specification.WithHTTPHeaders} model The proxied object + * @param {Specification.HTTPBody} model The proxied object * @param {BuildOptions} options The build options to use - * @returns {WithHTTPHeadersIntersection} The built object + * @returns {HTTPBodyIntersection} The built object */ -function buildingFn(model: Specification.WithHTTPHeaders, options: BuildOptions): WithHTTPHeadersIntersection { - const instance = new Classes.WithHTTPHeaders(model); +function buildingFn(model: Specification.HTTPBody, options: BuildOptions): HTTPBodyIntersection { + const instance = new Classes.HTTPBody(model); if (options.validate) instance.validate(); - return (options.normalize ? instance.normalize() : instance) as WithHTTPHeadersIntersection; + return (options.normalize ? instance.normalize() : instance) as HTTPBodyIntersection; } /** - * A factory to create a builder proxy for the type `WithHTTPHeadersIntersection` - * @returns {Builder} A builder for `WithHTTPHeadersIntersection` + * A factory to create a builder proxy for the type `HTTPBodyIntersection` + * @returns {Builder} A builder for `HTTPBodyIntersection` */ -export const withHTTPHeadersBuilder = ( - model?: Partial, -): Builder, WithHTTPHeadersIntersection> => - builder(model, buildingFn); +export const hTTPBodyBuilder = ( + model?: Partial, +): Builder, HTTPBodyIntersection> => + builder(model, buildingFn); diff --git a/src/lib/generated/builders/task-base-timeout-builder.ts b/src/lib/generated/builders/http-headers-builder.ts similarity index 60% rename from src/lib/generated/builders/task-base-timeout-builder.ts rename to src/lib/generated/builders/http-headers-builder.ts index 991119a..ff00e6c 100644 --- a/src/lib/generated/builders/task-base-timeout-builder.ts +++ b/src/lib/generated/builders/http-headers-builder.ts @@ -22,26 +22,26 @@ import { builder, Builder, BuildOptions } from '../../builder'; import { Classes } from '../classes'; -import { TaskBaseTimeoutIntersection } from '../classes/task-base-timeout'; +import { HTTPHeadersIntersection } from '../classes/http-headers'; import { Specification } from '../definitions'; /** * The internal function used by the builder proxy to validate and return its underlying object - * @param {Specification.TaskBaseTimeout} model The proxied object + * @param {Specification.HTTPHeaders} model The proxied object * @param {BuildOptions} options The build options to use - * @returns {TaskBaseTimeoutIntersection} The built object + * @returns {HTTPHeadersIntersection} The built object */ -function buildingFn(model: Specification.TaskBaseTimeout, options: BuildOptions): TaskBaseTimeoutIntersection { - const instance = new Classes.TaskBaseTimeout(model); +function buildingFn(model: Specification.HTTPHeaders, options: BuildOptions): HTTPHeadersIntersection { + const instance = new Classes.HTTPHeaders(model); if (options.validate) instance.validate(); - return (options.normalize ? instance.normalize() : instance) as TaskBaseTimeoutIntersection; + return (options.normalize ? instance.normalize() : instance) as HTTPHeadersIntersection; } /** - * A factory to create a builder proxy for the type `TaskBaseTimeoutIntersection` - * @returns {Builder} A builder for `TaskBaseTimeoutIntersection` + * A factory to create a builder proxy for the type `HTTPHeadersIntersection` + * @returns {Builder} A builder for `HTTPHeadersIntersection` */ -export const taskBaseTimeoutBuilder = ( - model?: Partial, -): Builder, TaskBaseTimeoutIntersection> => - builder(model, buildingFn); +export const hTTPHeadersBuilder = ( + model?: Partial, +): Builder, HTTPHeadersIntersection> => + builder(model, buildingFn); diff --git a/src/lib/generated/builders/http-query-builder.ts b/src/lib/generated/builders/http-query-builder.ts new file mode 100644 index 0000000..a185169 --- /dev/null +++ b/src/lib/generated/builders/http-query-builder.ts @@ -0,0 +1,47 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/***************************************************************************************** + * + * /!\ This file is computer generated. Any manual modification can and will be lost. /!\ + * + *****************************************************************************************/ + +import { builder, Builder, BuildOptions } from '../../builder'; +import { Classes } from '../classes'; +import { HTTPQueryIntersection } from '../classes/http-query'; +import { Specification } from '../definitions'; + +/** + * The internal function used by the builder proxy to validate and return its underlying object + * @param {Specification.HTTPQuery} model The proxied object + * @param {BuildOptions} options The build options to use + * @returns {HTTPQueryIntersection} The built object + */ +function buildingFn(model: Specification.HTTPQuery, options: BuildOptions): HTTPQueryIntersection { + const instance = new Classes.HTTPQuery(model); + if (options.validate) instance.validate(); + return (options.normalize ? instance.normalize() : instance) as HTTPQueryIntersection; +} + +/** + * A factory to create a builder proxy for the type `HTTPQueryIntersection` + * @returns {Builder} A builder for `HTTPQueryIntersection` + */ +export const hTTPQueryBuilder = ( + model?: Partial, +): Builder, HTTPQueryIntersection> => + builder(model, buildingFn); diff --git a/src/lib/generated/builders/index.ts b/src/lib/generated/builders/index.ts index cf5ec03..027ec6a 100644 --- a/src/lib/generated/builders/index.ts +++ b/src/lib/generated/builders/index.ts @@ -18,6 +18,8 @@ export * from './all-event-consumption-strategy-builder'; export * from './all-event-consumption-strategy-configuration-builder'; export * from './any-event-consumption-strategy-builder'; export * from './any-event-consumption-strategy-configuration-builder'; +export * from './any-event-consumption-strategy-until-builder'; +export * from './any-event-until-consumed-builder'; export * from './async-api-arguments-builder'; export * from './authentication-policy-builder'; export * from './authentication-policy-reference-builder'; @@ -38,6 +40,7 @@ export * from './catch-errors-builder'; export * from './constant-backoff-builder'; export * from './container-builder'; export * from './container-environment-builder'; +export * from './container-lifetime-builder'; export * from './container-ports-builder'; export * from './container-volumes-builder'; export * from './digest-authentication-policy-builder'; @@ -55,9 +58,11 @@ export * from './endpoint-builder'; export * from './endpoint-configuration-builder'; export * from './endpoint-uri-builder'; export * from './error-builder'; +export * from './error-filter-builder'; export * from './error-instance-builder'; export * from './error-type-builder'; export * from './event-consumption-strategy-builder'; +export * from './event-data-builder'; export * from './event-dataschema-builder'; export * from './event-filter-builder'; export * from './event-filter-correlate-builder'; @@ -78,6 +83,9 @@ export * from './for-task-configuration-builder'; export * from './function-arguments-builder'; export * from './grpc-arguments-builder'; export * from './http-arguments-builder'; +export * from './http-body-builder'; +export * from './http-headers-builder'; +export * from './http-query-builder'; export * from './inline-script-builder'; export * from './input-builder'; export * from './input-from-builder'; @@ -104,7 +112,7 @@ export * from './output-builder'; export * from './output-as-builder'; export * from './raise-task-builder'; export * from './raise-task-configuration-builder'; -export * from './raise-task-raise-error-builder'; +export * from './raise-task-error-builder'; export * from './referenceable-authentication-policy-builder'; export * from './retry-backoff-builder'; export * from './retry-limit-builder'; @@ -131,6 +139,7 @@ export * from './shell-arguments-builder'; export * from './shell-environment-builder'; export * from './subflow-configuration-builder'; export * from './subflow-input-builder'; +export * from './subscription-iterator-builder'; export * from './switch-case-builder'; export * from './switch-item-builder'; export * from './switch-task-builder'; @@ -138,10 +147,10 @@ export * from './switch-task-configuration-builder'; export * from './task-builder'; export * from './task-base-builder'; export * from './task-base-if-builder'; -export * from './task-base-timeout-builder'; export * from './task-item-builder'; export * from './task-list-builder'; export * from './task-metadata-builder'; +export * from './task-timeout-builder'; export * from './timeout-builder'; export * from './try-task-builder'; export * from './try-task-catch-builder'; @@ -157,13 +166,9 @@ export * from './use-retries-builder'; export * from './use-secrets-builder'; export * from './use-timeouts-builder'; export * from './wait-task-builder'; -export * from './with-async-api-payload-builder'; export * from './with-event-builder'; export * from './with-grpc-arguments-builder'; export * from './with-grpc-service-builder'; -export * from './with-http-body-builder'; -export * from './with-http-headers-builder'; -export * from './with-http-query-builder'; export * from './with-open-api-parameters-builder'; export * from './workflow-builder'; export * from './workflow-metadata-builder'; diff --git a/src/lib/generated/builders/raise-task-error-builder.ts b/src/lib/generated/builders/raise-task-error-builder.ts new file mode 100644 index 0000000..2eda315 --- /dev/null +++ b/src/lib/generated/builders/raise-task-error-builder.ts @@ -0,0 +1,47 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/***************************************************************************************** + * + * /!\ This file is computer generated. Any manual modification can and will be lost. /!\ + * + *****************************************************************************************/ + +import { builder, Builder, BuildOptions } from '../../builder'; +import { Classes } from '../classes'; +import { RaiseTaskErrorIntersection } from '../classes/raise-task-error'; +import { Specification } from '../definitions'; + +/** + * The internal function used by the builder proxy to validate and return its underlying object + * @param {Specification.RaiseTaskError} model The proxied object + * @param {BuildOptions} options The build options to use + * @returns {RaiseTaskErrorIntersection} The built object + */ +function buildingFn(model: Specification.RaiseTaskError, options: BuildOptions): RaiseTaskErrorIntersection { + const instance = new Classes.RaiseTaskError(model); + if (options.validate) instance.validate(); + return (options.normalize ? instance.normalize() : instance) as RaiseTaskErrorIntersection; +} + +/** + * A factory to create a builder proxy for the type `RaiseTaskErrorIntersection` + * @returns {Builder} A builder for `RaiseTaskErrorIntersection` + */ +export const raiseTaskErrorBuilder = ( + model?: Partial, +): Builder, RaiseTaskErrorIntersection> => + builder(model, buildingFn); diff --git a/src/lib/generated/builders/raise-task-raise-error-builder.ts b/src/lib/generated/builders/subscription-iterator-builder.ts similarity index 58% rename from src/lib/generated/builders/raise-task-raise-error-builder.ts rename to src/lib/generated/builders/subscription-iterator-builder.ts index 802ffde..ae138f9 100644 --- a/src/lib/generated/builders/raise-task-raise-error-builder.ts +++ b/src/lib/generated/builders/subscription-iterator-builder.ts @@ -22,26 +22,29 @@ import { builder, Builder, BuildOptions } from '../../builder'; import { Classes } from '../classes'; -import { RaiseTaskRaiseErrorIntersection } from '../classes/raise-task-raise-error'; +import { SubscriptionIteratorIntersection } from '../classes/subscription-iterator'; import { Specification } from '../definitions'; /** * The internal function used by the builder proxy to validate and return its underlying object - * @param {Specification.RaiseTaskRaiseError} model The proxied object + * @param {Specification.SubscriptionIterator} model The proxied object * @param {BuildOptions} options The build options to use - * @returns {RaiseTaskRaiseErrorIntersection} The built object + * @returns {SubscriptionIteratorIntersection} The built object */ -function buildingFn(model: Specification.RaiseTaskRaiseError, options: BuildOptions): RaiseTaskRaiseErrorIntersection { - const instance = new Classes.RaiseTaskRaiseError(model); +function buildingFn( + model: Specification.SubscriptionIterator, + options: BuildOptions, +): SubscriptionIteratorIntersection { + const instance = new Classes.SubscriptionIterator(model); if (options.validate) instance.validate(); - return (options.normalize ? instance.normalize() : instance) as RaiseTaskRaiseErrorIntersection; + return (options.normalize ? instance.normalize() : instance) as SubscriptionIteratorIntersection; } /** - * A factory to create a builder proxy for the type `RaiseTaskRaiseErrorIntersection` - * @returns {Builder} A builder for `RaiseTaskRaiseErrorIntersection` + * A factory to create a builder proxy for the type `SubscriptionIteratorIntersection` + * @returns {Builder} A builder for `SubscriptionIteratorIntersection` */ -export const raiseTaskRaiseErrorBuilder = ( - model?: Partial, -): Builder, RaiseTaskRaiseErrorIntersection> => - builder(model, buildingFn); +export const subscriptionIteratorBuilder = ( + model?: Partial, +): Builder, SubscriptionIteratorIntersection> => + builder(model, buildingFn); diff --git a/src/lib/generated/builders/task-timeout-builder.ts b/src/lib/generated/builders/task-timeout-builder.ts new file mode 100644 index 0000000..4240118 --- /dev/null +++ b/src/lib/generated/builders/task-timeout-builder.ts @@ -0,0 +1,47 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/***************************************************************************************** + * + * /!\ This file is computer generated. Any manual modification can and will be lost. /!\ + * + *****************************************************************************************/ + +import { builder, Builder, BuildOptions } from '../../builder'; +import { Classes } from '../classes'; +import { TaskTimeoutIntersection } from '../classes/task-timeout'; +import { Specification } from '../definitions'; + +/** + * The internal function used by the builder proxy to validate and return its underlying object + * @param {Specification.TaskTimeout} model The proxied object + * @param {BuildOptions} options The build options to use + * @returns {TaskTimeoutIntersection} The built object + */ +function buildingFn(model: Specification.TaskTimeout, options: BuildOptions): TaskTimeoutIntersection { + const instance = new Classes.TaskTimeout(model); + if (options.validate) instance.validate(); + return (options.normalize ? instance.normalize() : instance) as TaskTimeoutIntersection; +} + +/** + * A factory to create a builder proxy for the type `TaskTimeoutIntersection` + * @returns {Builder} A builder for `TaskTimeoutIntersection` + */ +export const taskTimeoutBuilder = ( + model?: Partial, +): Builder, TaskTimeoutIntersection> => + builder(model, buildingFn); diff --git a/src/lib/generated/classes/any-event-consumption-strategy-until.ts b/src/lib/generated/classes/any-event-consumption-strategy-until.ts new file mode 100644 index 0000000..7174b31 --- /dev/null +++ b/src/lib/generated/classes/any-event-consumption-strategy-until.ts @@ -0,0 +1,100 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/***************************************************************************************** + * + * /!\ This file is computer generated. Any manual modification can and will be lost. /!\ + * + *****************************************************************************************/ + +import { _AllEventConsumptionStrategyConfiguration } from './all-event-consumption-strategy-configuration'; +import { _AnyEventConsumptionStrategyConfiguration } from './any-event-consumption-strategy-configuration'; +import { _EventFilter } from './event-filter'; +import { ObjectHydrator } from '../../hydrator'; +import { Specification } from '../definitions'; +import { getLifecycleHooks } from '../../lifecycle-hooks'; +import { validate } from '../../validation'; +import { isObject } from '../../utils'; + +/** + * Represents the intersection between the AnyEventConsumptionStrategyUntil class and type + */ +export type AnyEventConsumptionStrategyUntilIntersection = AnyEventConsumptionStrategyUntil & + Specification.AnyEventConsumptionStrategyUntil; + +/** + * Represents a constructor for the intersection of the AnyEventConsumptionStrategyUntil class and type + */ +export interface AnyEventConsumptionStrategyUntilConstructor { + new (model?: Partial): AnyEventConsumptionStrategyUntilIntersection; +} + +/** + * Represents a AnyEventConsumptionStrategyUntil with methods for validation and normalization. + * Inherits from ObjectHydrator which provides functionality for hydrating the state based on a model. + */ +export class AnyEventConsumptionStrategyUntil extends ObjectHydrator { + /** + * Instanciates a new instance of the AnyEventConsumptionStrategyUntil class. + * Initializes properties based on the provided model if it is an object. + * + * @param model - Optional partial model object to initialize the AnyEventConsumptionStrategyUntil. + */ + constructor(model?: Partial) { + super(model); + const self = this as unknown as Specification.AnyEventConsumptionStrategyUntil & object; + if (isObject(model)) { + if (typeof (model as Specification.AllEventConsumptionStrategy).all === 'object') + (self as Specification.AllEventConsumptionStrategy).all = new _AllEventConsumptionStrategyConfiguration( + (model as Specification.AllEventConsumptionStrategy) + .all as Specification.AllEventConsumptionStrategyConfiguration, + ); + if (typeof (model as Specification.AnyEventConsumptionStrategy).any === 'object') + (self as Specification.AnyEventConsumptionStrategy).any = new _AnyEventConsumptionStrategyConfiguration( + (model as Specification.AnyEventConsumptionStrategy) + .any as Specification.AnyEventConsumptionStrategyConfiguration, + ); + if (typeof (model as Specification.OneEventConsumptionStrategy).one === 'object') + (self as Specification.OneEventConsumptionStrategy).one = new _EventFilter( + (model as Specification.OneEventConsumptionStrategy).one as Specification.EventFilter, + ); + } + getLifecycleHooks('AnyEventConsumptionStrategyUntil')?.constructor?.(this); + } + + /** + * Validates the current instance of the AnyEventConsumptionStrategyUntil. + * Throws if invalid. + */ + validate(workflow?: Partial) { + const copy = new AnyEventConsumptionStrategyUntil(this as any) as AnyEventConsumptionStrategyUntilIntersection; + validate('AnyEventConsumptionStrategyUntil', copy, workflow); + } + + /** + * Normalizes the current instance of the AnyEventConsumptionStrategyUntil. + * Creates a copy of the AnyEventConsumptionStrategyUntil, invokes normalization hooks if available, and returns the normalized copy. + * + * @returns A normalized version of the AnyEventConsumptionStrategyUntil instance. + */ + normalize(): AnyEventConsumptionStrategyUntil & Specification.AnyEventConsumptionStrategyUntil { + const copy = new AnyEventConsumptionStrategyUntil(this as any) as AnyEventConsumptionStrategyUntilIntersection; + return getLifecycleHooks('AnyEventConsumptionStrategyUntil')?.normalize?.(copy) || copy; + } +} + +export const _AnyEventConsumptionStrategyUntil = + AnyEventConsumptionStrategyUntil as AnyEventConsumptionStrategyUntilConstructor; diff --git a/src/lib/generated/classes/any-event-consumption-strategy.ts b/src/lib/generated/classes/any-event-consumption-strategy.ts index 827f4b9..4ac4c40 100644 --- a/src/lib/generated/classes/any-event-consumption-strategy.ts +++ b/src/lib/generated/classes/any-event-consumption-strategy.ts @@ -21,6 +21,7 @@ *****************************************************************************************/ import { _AnyEventConsumptionStrategyConfiguration } from './any-event-consumption-strategy-configuration'; +import { _AnyEventConsumptionStrategyUntil } from './any-event-consumption-strategy-until'; import { ObjectHydrator } from '../../hydrator'; import { Specification } from '../definitions'; import { getLifecycleHooks } from '../../lifecycle-hooks'; @@ -56,6 +57,7 @@ export class AnyEventConsumptionStrategy extends ObjectHydrator): AnyEventUntilConsumedIntersection; +} + +/** + * Represents a AnyEventUntilConsumed with methods for validation and normalization. + * Inherits from ObjectHydrator which provides functionality for hydrating the state based on a model. + */ +export class AnyEventUntilConsumed extends ObjectHydrator { + /** + * Instanciates a new instance of the AnyEventUntilConsumed class. + * Initializes properties based on the provided model if it is an object. + * + * @param model - Optional partial model object to initialize the AnyEventUntilConsumed. + */ + constructor(model?: Partial) { + super(model); + const self = this as unknown as Specification.AnyEventUntilConsumed & object; + if (isObject(model)) { + if (typeof (model as Specification.AllEventConsumptionStrategy).all === 'object') + (self as Specification.AllEventConsumptionStrategy).all = new _AllEventConsumptionStrategyConfiguration( + (model as Specification.AllEventConsumptionStrategy) + .all as Specification.AllEventConsumptionStrategyConfiguration, + ); + if (typeof (model as Specification.AnyEventConsumptionStrategy).any === 'object') + (self as Specification.AnyEventConsumptionStrategy).any = new _AnyEventConsumptionStrategyConfiguration( + (model as Specification.AnyEventConsumptionStrategy) + .any as Specification.AnyEventConsumptionStrategyConfiguration, + ); + if (typeof (model as Specification.OneEventConsumptionStrategy).one === 'object') + (self as Specification.OneEventConsumptionStrategy).one = new _EventFilter( + (model as Specification.OneEventConsumptionStrategy).one as Specification.EventFilter, + ); + } + getLifecycleHooks('AnyEventUntilConsumed')?.constructor?.(this); + } + + /** + * Validates the current instance of the AnyEventUntilConsumed. + * Throws if invalid. + */ + validate(workflow?: Partial) { + const copy = new AnyEventUntilConsumed(this as any) as AnyEventUntilConsumedIntersection; + validate('AnyEventUntilConsumed', copy, workflow); + } + + /** + * Normalizes the current instance of the AnyEventUntilConsumed. + * Creates a copy of the AnyEventUntilConsumed, invokes normalization hooks if available, and returns the normalized copy. + * + * @returns A normalized version of the AnyEventUntilConsumed instance. + */ + normalize(): AnyEventUntilConsumed & Specification.AnyEventUntilConsumed { + const copy = new AnyEventUntilConsumed(this as any) as AnyEventUntilConsumedIntersection; + return getLifecycleHooks('AnyEventUntilConsumed')?.normalize?.(copy) || copy; + } +} + +export const _AnyEventUntilConsumed = AnyEventUntilConsumed as AnyEventUntilConsumedConstructor; diff --git a/src/lib/generated/classes/async-api-arguments.ts b/src/lib/generated/classes/async-api-arguments.ts index bb6f514..e2e8104 100644 --- a/src/lib/generated/classes/async-api-arguments.ts +++ b/src/lib/generated/classes/async-api-arguments.ts @@ -20,14 +20,10 @@ * *****************************************************************************************/ -import { _ExternalResource } from './external-resource'; -import { _WithAsyncAPIPayload } from './with-async-api-payload'; -import { _ReferenceableAuthenticationPolicy } from './referenceable-authentication-policy'; import { ObjectHydrator } from '../../hydrator'; import { Specification } from '../definitions'; import { getLifecycleHooks } from '../../lifecycle-hooks'; import { validate } from '../../validation'; -import { isObject } from '../../utils'; /** * Represents the intersection between the AsyncApiArguments class and type @@ -54,13 +50,7 @@ export class AsyncApiArguments extends ObjectHydrator) { super(model); - const self = this as unknown as Specification.AsyncApiArguments & object; - if (isObject(model)) { - if (typeof model.document === 'object') self.document = new _ExternalResource(model.document); - if (typeof model.payload === 'object') self.payload = new _WithAsyncAPIPayload(model.payload); - if (typeof model.authentication === 'object') - self.authentication = new _ReferenceableAuthenticationPolicy(model.authentication); - } + getLifecycleHooks('AsyncApiArguments')?.constructor?.(this); } diff --git a/src/lib/generated/classes/call-async-api.ts b/src/lib/generated/classes/call-async-api.ts index d0105d3..ddb1f00 100644 --- a/src/lib/generated/classes/call-async-api.ts +++ b/src/lib/generated/classes/call-async-api.ts @@ -23,9 +23,8 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; -import { _AsyncApiArguments } from './async-api-arguments'; import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; import { getLifecycleHooks } from '../../lifecycle-hooks'; @@ -63,9 +62,8 @@ export class CallAsyncAPI extends _TaskBase { if (typeof model.input === 'object') self.input = new _Input(model.input); if (typeof model.output === 'object') self.output = new _Output(model.output); if (typeof model.export === 'object') self.export = new _Export(model.export); - if (typeof model.timeout === 'object') self.timeout = new _TaskBaseTimeout(model.timeout); + if (typeof model.timeout === 'object') self.timeout = new _TaskTimeout(model.timeout); if (typeof model.metadata === 'object') self.metadata = new _TaskMetadata(model.metadata); - if (typeof model.with === 'object') self.with = new _AsyncApiArguments(model.with); } getLifecycleHooks('CallAsyncAPI')?.constructor?.(this); } diff --git a/src/lib/generated/classes/call-function.ts b/src/lib/generated/classes/call-function.ts index 802bd49..df6583e 100644 --- a/src/lib/generated/classes/call-function.ts +++ b/src/lib/generated/classes/call-function.ts @@ -23,7 +23,7 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { _FunctionArguments } from './function-arguments'; import { _TaskBase } from './task-base'; @@ -62,7 +62,7 @@ export class CallFunction extends _TaskBase { if (typeof model.input === 'object') self.input = new _Input(model.input); if (typeof model.output === 'object') self.output = new _Output(model.output); if (typeof model.export === 'object') self.export = new _Export(model.export); - if (typeof model.timeout === 'object') self.timeout = new _TaskBaseTimeout(model.timeout); + if (typeof model.timeout === 'object') self.timeout = new _TaskTimeout(model.timeout); if (typeof model.metadata === 'object') self.metadata = new _TaskMetadata(model.metadata); if (typeof model.with === 'object') self.with = new _FunctionArguments(model.with); } diff --git a/src/lib/generated/classes/call-grpc.ts b/src/lib/generated/classes/call-grpc.ts index 8bbaa13..904d5fb 100644 --- a/src/lib/generated/classes/call-grpc.ts +++ b/src/lib/generated/classes/call-grpc.ts @@ -23,7 +23,7 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { _GRPCArguments } from './grpc-arguments'; import { _TaskBase } from './task-base'; @@ -63,7 +63,7 @@ export class CallGRPC extends _TaskBase { if (typeof model.input === 'object') self.input = new _Input(model.input); if (typeof model.output === 'object') self.output = new _Output(model.output); if (typeof model.export === 'object') self.export = new _Export(model.export); - if (typeof model.timeout === 'object') self.timeout = new _TaskBaseTimeout(model.timeout); + if (typeof model.timeout === 'object') self.timeout = new _TaskTimeout(model.timeout); if (typeof model.metadata === 'object') self.metadata = new _TaskMetadata(model.metadata); if (typeof model.with === 'object') self.with = new _GRPCArguments(model.with); } diff --git a/src/lib/generated/classes/call-http.ts b/src/lib/generated/classes/call-http.ts index 1c11b37..4556981 100644 --- a/src/lib/generated/classes/call-http.ts +++ b/src/lib/generated/classes/call-http.ts @@ -23,7 +23,7 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { _HTTPArguments } from './http-arguments'; import { _TaskBase } from './task-base'; @@ -63,7 +63,7 @@ export class CallHTTP extends _TaskBase { if (typeof model.input === 'object') self.input = new _Input(model.input); if (typeof model.output === 'object') self.output = new _Output(model.output); if (typeof model.export === 'object') self.export = new _Export(model.export); - if (typeof model.timeout === 'object') self.timeout = new _TaskBaseTimeout(model.timeout); + if (typeof model.timeout === 'object') self.timeout = new _TaskTimeout(model.timeout); if (typeof model.metadata === 'object') self.metadata = new _TaskMetadata(model.metadata); if (typeof model.with === 'object') self.with = new _HTTPArguments(model.with); } diff --git a/src/lib/generated/classes/call-open-api.ts b/src/lib/generated/classes/call-open-api.ts index 2c89f67..fd9cf09 100644 --- a/src/lib/generated/classes/call-open-api.ts +++ b/src/lib/generated/classes/call-open-api.ts @@ -23,7 +23,7 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { _OpenAPIArguments } from './open-api-arguments'; import { _TaskBase } from './task-base'; @@ -63,7 +63,7 @@ export class CallOpenAPI extends _TaskBase { if (typeof model.input === 'object') self.input = new _Input(model.input); if (typeof model.output === 'object') self.output = new _Output(model.output); if (typeof model.export === 'object') self.export = new _Export(model.export); - if (typeof model.timeout === 'object') self.timeout = new _TaskBaseTimeout(model.timeout); + if (typeof model.timeout === 'object') self.timeout = new _TaskTimeout(model.timeout); if (typeof model.metadata === 'object') self.metadata = new _TaskMetadata(model.metadata); if (typeof model.with === 'object') self.with = new _OpenAPIArguments(model.with); } diff --git a/src/lib/generated/classes/call-task.ts b/src/lib/generated/classes/call-task.ts index cc1cc3c..1de2c77 100644 --- a/src/lib/generated/classes/call-task.ts +++ b/src/lib/generated/classes/call-task.ts @@ -23,7 +23,7 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { ObjectHydrator } from '../../hydrator'; import { Specification } from '../definitions'; @@ -71,8 +71,8 @@ export class CallTask extends ObjectHydrator { (model as Specification.TaskBase).export as Specification.Export, ); if (typeof (model as Specification.TaskBase).timeout === 'object') - (self as Specification.TaskBase).timeout = new _TaskBaseTimeout( - (model as Specification.TaskBase).timeout as Specification.TaskBaseTimeout, + (self as Specification.TaskBase).timeout = new _TaskTimeout( + (model as Specification.TaskBase).timeout as Specification.TaskTimeout, ); if (typeof (model as Specification.TaskBase).metadata === 'object') (self as Specification.TaskBase).metadata = new _TaskMetadata( diff --git a/src/lib/generated/classes/catch-errors.ts b/src/lib/generated/classes/catch-errors.ts index 2d43eaa..b36306c 100644 --- a/src/lib/generated/classes/catch-errors.ts +++ b/src/lib/generated/classes/catch-errors.ts @@ -20,10 +20,12 @@ * *****************************************************************************************/ +import { _ErrorFilter } from './error-filter'; import { ObjectHydrator } from '../../hydrator'; import { Specification } from '../definitions'; import { getLifecycleHooks } from '../../lifecycle-hooks'; import { validate } from '../../validation'; +import { isObject } from '../../utils'; /** * Represents the intersection between the CatchErrors class and type @@ -50,7 +52,10 @@ export class CatchErrors extends ObjectHydrator { */ constructor(model?: Partial) { super(model); - + const self = this as unknown as Specification.CatchErrors & object; + if (isObject(model)) { + if (typeof model.with === 'object') self.with = new _ErrorFilter(model.with); + } getLifecycleHooks('CatchErrors')?.constructor?.(this); } diff --git a/src/lib/generated/classes/container-lifetime.ts b/src/lib/generated/classes/container-lifetime.ts new file mode 100644 index 0000000..c2ff200 --- /dev/null +++ b/src/lib/generated/classes/container-lifetime.ts @@ -0,0 +1,83 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/***************************************************************************************** + * + * /!\ This file is computer generated. Any manual modification can and will be lost. /!\ + * + *****************************************************************************************/ + +import { _Duration } from './duration'; +import { ObjectHydrator } from '../../hydrator'; +import { Specification } from '../definitions'; +import { getLifecycleHooks } from '../../lifecycle-hooks'; +import { validate } from '../../validation'; +import { isObject } from '../../utils'; + +/** + * Represents the intersection between the ContainerLifetime class and type + */ +export type ContainerLifetimeIntersection = ContainerLifetime & Specification.ContainerLifetime; + +/** + * Represents a constructor for the intersection of the ContainerLifetime class and type + */ +export interface ContainerLifetimeConstructor { + new (model?: Partial): ContainerLifetimeIntersection; +} + +/** + * Represents a ContainerLifetime with methods for validation and normalization. + * Inherits from ObjectHydrator which provides functionality for hydrating the state based on a model. + */ +export class ContainerLifetime extends ObjectHydrator { + /** + * Instanciates a new instance of the ContainerLifetime class. + * Initializes properties based on the provided model if it is an object. + * + * @param model - Optional partial model object to initialize the ContainerLifetime. + */ + constructor(model?: Partial) { + super(model); + const self = this as unknown as Specification.ContainerLifetime & object; + if (isObject(model)) { + if (typeof model.after === 'object') self.after = new _Duration(model.after); + } + getLifecycleHooks('ContainerLifetime')?.constructor?.(this); + } + + /** + * Validates the current instance of the ContainerLifetime. + * Throws if invalid. + */ + validate(workflow?: Partial) { + const copy = new ContainerLifetime(this as any) as ContainerLifetimeIntersection; + validate('ContainerLifetime', copy, workflow); + } + + /** + * Normalizes the current instance of the ContainerLifetime. + * Creates a copy of the ContainerLifetime, invokes normalization hooks if available, and returns the normalized copy. + * + * @returns A normalized version of the ContainerLifetime instance. + */ + normalize(): ContainerLifetime & Specification.ContainerLifetime { + const copy = new ContainerLifetime(this as any) as ContainerLifetimeIntersection; + return getLifecycleHooks('ContainerLifetime')?.normalize?.(copy) || copy; + } +} + +export const _ContainerLifetime = ContainerLifetime as ContainerLifetimeConstructor; diff --git a/src/lib/generated/classes/container.ts b/src/lib/generated/classes/container.ts index 000b05d..d65f23b 100644 --- a/src/lib/generated/classes/container.ts +++ b/src/lib/generated/classes/container.ts @@ -23,6 +23,7 @@ import { _ContainerPorts } from './container-ports'; import { _ContainerVolumes } from './container-volumes'; import { _ContainerEnvironment } from './container-environment'; +import { _ContainerLifetime } from './container-lifetime'; import { ObjectHydrator } from '../../hydrator'; import { Specification } from '../definitions'; import { getLifecycleHooks } from '../../lifecycle-hooks'; @@ -59,6 +60,7 @@ export class Container extends ObjectHydrator { if (typeof model.ports === 'object') self.ports = new _ContainerPorts(model.ports); if (typeof model.volumes === 'object') self.volumes = new _ContainerVolumes(model.volumes); if (typeof model.environment === 'object') self.environment = new _ContainerEnvironment(model.environment); + if (typeof model.lifetime === 'object') self.lifetime = new _ContainerLifetime(model.lifetime); } getLifecycleHooks('Container')?.constructor?.(this); } diff --git a/src/lib/generated/classes/do-task.ts b/src/lib/generated/classes/do-task.ts index 2568b0e..0b843c6 100644 --- a/src/lib/generated/classes/do-task.ts +++ b/src/lib/generated/classes/do-task.ts @@ -23,7 +23,7 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { _TaskList } from './task-list'; import { _TaskBase } from './task-base'; @@ -62,7 +62,7 @@ export class DoTask extends _TaskBase { if (typeof model.input === 'object') self.input = new _Input(model.input); if (typeof model.output === 'object') self.output = new _Output(model.output); if (typeof model.export === 'object') self.export = new _Export(model.export); - if (typeof model.timeout === 'object') self.timeout = new _TaskBaseTimeout(model.timeout); + if (typeof model.timeout === 'object') self.timeout = new _TaskTimeout(model.timeout); if (typeof model.metadata === 'object') self.metadata = new _TaskMetadata(model.metadata); if (typeof model.do === 'object') self.do = new _TaskList(model.do); } diff --git a/src/lib/generated/classes/emit-task.ts b/src/lib/generated/classes/emit-task.ts index 4890334..b3609aa 100644 --- a/src/lib/generated/classes/emit-task.ts +++ b/src/lib/generated/classes/emit-task.ts @@ -23,7 +23,7 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { _EmitTaskConfiguration } from './emit-task-configuration'; import { _TaskBase } from './task-base'; @@ -62,7 +62,7 @@ export class EmitTask extends _TaskBase { if (typeof model.input === 'object') self.input = new _Input(model.input); if (typeof model.output === 'object') self.output = new _Output(model.output); if (typeof model.export === 'object') self.export = new _Export(model.export); - if (typeof model.timeout === 'object') self.timeout = new _TaskBaseTimeout(model.timeout); + if (typeof model.timeout === 'object') self.timeout = new _TaskTimeout(model.timeout); if (typeof model.metadata === 'object') self.metadata = new _TaskMetadata(model.metadata); if (typeof model.emit === 'object') self.emit = new _EmitTaskConfiguration(model.emit); } diff --git a/src/lib/generated/classes/with-http-body.ts b/src/lib/generated/classes/error-filter.ts similarity index 52% rename from src/lib/generated/classes/with-http-body.ts rename to src/lib/generated/classes/error-filter.ts index 761837b..76a9e36 100644 --- a/src/lib/generated/classes/with-http-body.ts +++ b/src/lib/generated/classes/error-filter.ts @@ -26,53 +26,53 @@ import { getLifecycleHooks } from '../../lifecycle-hooks'; import { validate } from '../../validation'; /** - * Represents the intersection between the WithHTTPBody class and type + * Represents the intersection between the ErrorFilter class and type */ -export type WithHTTPBodyIntersection = WithHTTPBody & Specification.WithHTTPBody; +export type ErrorFilterIntersection = ErrorFilter & Specification.ErrorFilter; /** - * Represents a constructor for the intersection of the WithHTTPBody class and type + * Represents a constructor for the intersection of the ErrorFilter class and type */ -export interface WithHTTPBodyConstructor { - new (model?: Partial): WithHTTPBodyIntersection; +export interface ErrorFilterConstructor { + new (model?: Partial): ErrorFilterIntersection; } /** - * Represents a WithHTTPBody with methods for validation and normalization. + * Represents a ErrorFilter with methods for validation and normalization. * Inherits from ObjectHydrator which provides functionality for hydrating the state based on a model. */ -export class WithHTTPBody extends ObjectHydrator { +export class ErrorFilter extends ObjectHydrator { /** - * Instanciates a new instance of the WithHTTPBody class. + * Instanciates a new instance of the ErrorFilter class. * Initializes properties based on the provided model if it is an object. * - * @param model - Optional partial model object to initialize the WithHTTPBody. + * @param model - Optional partial model object to initialize the ErrorFilter. */ - constructor(model?: Partial) { + constructor(model?: Partial) { super(model); - getLifecycleHooks('WithHTTPBody')?.constructor?.(this); + getLifecycleHooks('ErrorFilter')?.constructor?.(this); } /** - * Validates the current instance of the WithHTTPBody. + * Validates the current instance of the ErrorFilter. * Throws if invalid. */ validate(workflow?: Partial) { - const copy = new WithHTTPBody(this as any) as WithHTTPBodyIntersection; - validate('WithHTTPBody', copy, workflow); + const copy = new ErrorFilter(this as any) as ErrorFilterIntersection; + validate('ErrorFilter', copy, workflow); } /** - * Normalizes the current instance of the WithHTTPBody. - * Creates a copy of the WithHTTPBody, invokes normalization hooks if available, and returns the normalized copy. + * Normalizes the current instance of the ErrorFilter. + * Creates a copy of the ErrorFilter, invokes normalization hooks if available, and returns the normalized copy. * - * @returns A normalized version of the WithHTTPBody instance. + * @returns A normalized version of the ErrorFilter instance. */ - normalize(): WithHTTPBody & Specification.WithHTTPBody { - const copy = new WithHTTPBody(this as any) as WithHTTPBodyIntersection; - return getLifecycleHooks('WithHTTPBody')?.normalize?.(copy) || copy; + normalize(): ErrorFilter & Specification.ErrorFilter { + const copy = new ErrorFilter(this as any) as ErrorFilterIntersection; + return getLifecycleHooks('ErrorFilter')?.normalize?.(copy) || copy; } } -export const _WithHTTPBody = WithHTTPBody as WithHTTPBodyConstructor; +export const _ErrorFilter = ErrorFilter as ErrorFilterConstructor; diff --git a/src/lib/generated/classes/event-consumption-strategy.ts b/src/lib/generated/classes/event-consumption-strategy.ts index 798e328..769c9ff 100644 --- a/src/lib/generated/classes/event-consumption-strategy.ts +++ b/src/lib/generated/classes/event-consumption-strategy.ts @@ -22,6 +22,7 @@ import { _AllEventConsumptionStrategyConfiguration } from './all-event-consumption-strategy-configuration'; import { _AnyEventConsumptionStrategyConfiguration } from './any-event-consumption-strategy-configuration'; +import { _AnyEventConsumptionStrategyUntil } from './any-event-consumption-strategy-until'; import { _EventFilter } from './event-filter'; import { ObjectHydrator } from '../../hydrator'; import { Specification } from '../definitions'; @@ -66,6 +67,10 @@ export class EventConsumptionStrategy extends ObjectHydrator): WithHTTPQueryIntersection; +export interface EventDataConstructor { + new (model?: Partial): EventDataIntersection; } /** - * Represents a WithHTTPQuery with methods for validation and normalization. + * Represents a EventData with methods for validation and normalization. * Inherits from ObjectHydrator which provides functionality for hydrating the state based on a model. */ -export class WithHTTPQuery extends ObjectHydrator { +export class EventData extends ObjectHydrator { /** - * Instanciates a new instance of the WithHTTPQuery class. + * Instanciates a new instance of the EventData class. * Initializes properties based on the provided model if it is an object. * - * @param model - Optional partial model object to initialize the WithHTTPQuery. + * @param model - Optional partial model object to initialize the EventData. */ - constructor(model?: Partial) { + constructor(model?: Partial) { super(model); - getLifecycleHooks('WithHTTPQuery')?.constructor?.(this); + getLifecycleHooks('EventData')?.constructor?.(this); } /** - * Validates the current instance of the WithHTTPQuery. + * Validates the current instance of the EventData. * Throws if invalid. */ validate(workflow?: Partial) { - const copy = new WithHTTPQuery(this as any) as WithHTTPQueryIntersection; - validate('WithHTTPQuery', copy, workflow); + const copy = new EventData(this as any) as EventDataIntersection; + validate('EventData', copy, workflow); } /** - * Normalizes the current instance of the WithHTTPQuery. - * Creates a copy of the WithHTTPQuery, invokes normalization hooks if available, and returns the normalized copy. + * Normalizes the current instance of the EventData. + * Creates a copy of the EventData, invokes normalization hooks if available, and returns the normalized copy. * - * @returns A normalized version of the WithHTTPQuery instance. + * @returns A normalized version of the EventData instance. */ - normalize(): WithHTTPQuery & Specification.WithHTTPQuery { - const copy = new WithHTTPQuery(this as any) as WithHTTPQueryIntersection; - return getLifecycleHooks('WithHTTPQuery')?.normalize?.(copy) || copy; + normalize(): EventData & Specification.EventData { + const copy = new EventData(this as any) as EventDataIntersection; + return getLifecycleHooks('EventData')?.normalize?.(copy) || copy; } } -export const _WithHTTPQuery = WithHTTPQuery as WithHTTPQueryConstructor; +export const _EventData = EventData as EventDataConstructor; diff --git a/src/lib/generated/classes/for-task.ts b/src/lib/generated/classes/for-task.ts index d86ac77..c36eb12 100644 --- a/src/lib/generated/classes/for-task.ts +++ b/src/lib/generated/classes/for-task.ts @@ -23,7 +23,7 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { _ForTaskConfiguration } from './for-task-configuration'; import { _TaskList } from './task-list'; @@ -63,7 +63,7 @@ export class ForTask extends _TaskBase { if (typeof model.input === 'object') self.input = new _Input(model.input); if (typeof model.output === 'object') self.output = new _Output(model.output); if (typeof model.export === 'object') self.export = new _Export(model.export); - if (typeof model.timeout === 'object') self.timeout = new _TaskBaseTimeout(model.timeout); + if (typeof model.timeout === 'object') self.timeout = new _TaskTimeout(model.timeout); if (typeof model.metadata === 'object') self.metadata = new _TaskMetadata(model.metadata); if (typeof model.for === 'object') self.for = new _ForTaskConfiguration(model.for); if (typeof model.do === 'object') self.do = new _TaskList(model.do); diff --git a/src/lib/generated/classes/fork-task.ts b/src/lib/generated/classes/fork-task.ts index 652ba64..1228a67 100644 --- a/src/lib/generated/classes/fork-task.ts +++ b/src/lib/generated/classes/fork-task.ts @@ -23,7 +23,7 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { _ForkTaskConfiguration } from './fork-task-configuration'; import { _TaskBase } from './task-base'; @@ -62,7 +62,7 @@ export class ForkTask extends _TaskBase { if (typeof model.input === 'object') self.input = new _Input(model.input); if (typeof model.output === 'object') self.output = new _Output(model.output); if (typeof model.export === 'object') self.export = new _Export(model.export); - if (typeof model.timeout === 'object') self.timeout = new _TaskBaseTimeout(model.timeout); + if (typeof model.timeout === 'object') self.timeout = new _TaskTimeout(model.timeout); if (typeof model.metadata === 'object') self.metadata = new _TaskMetadata(model.metadata); if (typeof model.fork === 'object') self.fork = new _ForkTaskConfiguration(model.fork); } diff --git a/src/lib/generated/classes/http-arguments.ts b/src/lib/generated/classes/http-arguments.ts index 1b87348..858c6b6 100644 --- a/src/lib/generated/classes/http-arguments.ts +++ b/src/lib/generated/classes/http-arguments.ts @@ -21,9 +21,9 @@ *****************************************************************************************/ import { _Endpoint } from './endpoint'; -import { _WithHTTPHeaders } from './with-http-headers'; -import { _WithHTTPBody } from './with-http-body'; -import { _WithHTTPQuery } from './with-http-query'; +import { _HTTPHeaders } from './http-headers'; +import { _HTTPBody } from './http-body'; +import { _HTTPQuery } from './http-query'; import { ObjectHydrator } from '../../hydrator'; import { Specification } from '../definitions'; import { getLifecycleHooks } from '../../lifecycle-hooks'; @@ -58,9 +58,9 @@ export class HTTPArguments extends ObjectHydrator { const self = this as unknown as Specification.HTTPArguments & object; if (isObject(model)) { if (typeof model.endpoint === 'object') self.endpoint = new _Endpoint(model.endpoint); - if (typeof model.headers === 'object') self.headers = new _WithHTTPHeaders(model.headers); - if (typeof model.body === 'object') self.body = new _WithHTTPBody(model.body); - if (typeof model.query === 'object') self.query = new _WithHTTPQuery(model.query); + if (typeof model.headers === 'object') self.headers = new _HTTPHeaders(model.headers); + if (typeof model.body === 'object') self.body = new _HTTPBody(model.body); + if (typeof model.query === 'object') self.query = new _HTTPQuery(model.query); } getLifecycleHooks('HTTPArguments')?.constructor?.(this); } diff --git a/src/lib/generated/classes/with-http-headers.ts b/src/lib/generated/classes/http-body.ts similarity index 50% rename from src/lib/generated/classes/with-http-headers.ts rename to src/lib/generated/classes/http-body.ts index df03ce2..641baad 100644 --- a/src/lib/generated/classes/with-http-headers.ts +++ b/src/lib/generated/classes/http-body.ts @@ -26,53 +26,53 @@ import { getLifecycleHooks } from '../../lifecycle-hooks'; import { validate } from '../../validation'; /** - * Represents the intersection between the WithHTTPHeaders class and type + * Represents the intersection between the HTTPBody class and type */ -export type WithHTTPHeadersIntersection = WithHTTPHeaders & Specification.WithHTTPHeaders; +export type HTTPBodyIntersection = HTTPBody & Specification.HTTPBody; /** - * Represents a constructor for the intersection of the WithHTTPHeaders class and type + * Represents a constructor for the intersection of the HTTPBody class and type */ -export interface WithHTTPHeadersConstructor { - new (model?: Partial): WithHTTPHeadersIntersection; +export interface HTTPBodyConstructor { + new (model?: Partial): HTTPBodyIntersection; } /** - * Represents a WithHTTPHeaders with methods for validation and normalization. + * Represents a HTTPBody with methods for validation and normalization. * Inherits from ObjectHydrator which provides functionality for hydrating the state based on a model. */ -export class WithHTTPHeaders extends ObjectHydrator { +export class HTTPBody extends ObjectHydrator { /** - * Instanciates a new instance of the WithHTTPHeaders class. + * Instanciates a new instance of the HTTPBody class. * Initializes properties based on the provided model if it is an object. * - * @param model - Optional partial model object to initialize the WithHTTPHeaders. + * @param model - Optional partial model object to initialize the HTTPBody. */ - constructor(model?: Partial) { + constructor(model?: Partial) { super(model); - getLifecycleHooks('WithHTTPHeaders')?.constructor?.(this); + getLifecycleHooks('HTTPBody')?.constructor?.(this); } /** - * Validates the current instance of the WithHTTPHeaders. + * Validates the current instance of the HTTPBody. * Throws if invalid. */ validate(workflow?: Partial) { - const copy = new WithHTTPHeaders(this as any) as WithHTTPHeadersIntersection; - validate('WithHTTPHeaders', copy, workflow); + const copy = new HTTPBody(this as any) as HTTPBodyIntersection; + validate('HTTPBody', copy, workflow); } /** - * Normalizes the current instance of the WithHTTPHeaders. - * Creates a copy of the WithHTTPHeaders, invokes normalization hooks if available, and returns the normalized copy. + * Normalizes the current instance of the HTTPBody. + * Creates a copy of the HTTPBody, invokes normalization hooks if available, and returns the normalized copy. * - * @returns A normalized version of the WithHTTPHeaders instance. + * @returns A normalized version of the HTTPBody instance. */ - normalize(): WithHTTPHeaders & Specification.WithHTTPHeaders { - const copy = new WithHTTPHeaders(this as any) as WithHTTPHeadersIntersection; - return getLifecycleHooks('WithHTTPHeaders')?.normalize?.(copy) || copy; + normalize(): HTTPBody & Specification.HTTPBody { + const copy = new HTTPBody(this as any) as HTTPBodyIntersection; + return getLifecycleHooks('HTTPBody')?.normalize?.(copy) || copy; } } -export const _WithHTTPHeaders = WithHTTPHeaders as WithHTTPHeadersConstructor; +export const _HTTPBody = HTTPBody as HTTPBodyConstructor; diff --git a/src/lib/generated/classes/http-headers.ts b/src/lib/generated/classes/http-headers.ts new file mode 100644 index 0000000..002f5f8 --- /dev/null +++ b/src/lib/generated/classes/http-headers.ts @@ -0,0 +1,78 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/***************************************************************************************** + * + * /!\ This file is computer generated. Any manual modification can and will be lost. /!\ + * + *****************************************************************************************/ + +import { ObjectHydrator } from '../../hydrator'; +import { Specification } from '../definitions'; +import { getLifecycleHooks } from '../../lifecycle-hooks'; +import { validate } from '../../validation'; + +/** + * Represents the intersection between the HTTPHeaders class and type + */ +export type HTTPHeadersIntersection = HTTPHeaders & Specification.HTTPHeaders; + +/** + * Represents a constructor for the intersection of the HTTPHeaders class and type + */ +export interface HTTPHeadersConstructor { + new (model?: Partial): HTTPHeadersIntersection; +} + +/** + * Represents a HTTPHeaders with methods for validation and normalization. + * Inherits from ObjectHydrator which provides functionality for hydrating the state based on a model. + */ +export class HTTPHeaders extends ObjectHydrator { + /** + * Instanciates a new instance of the HTTPHeaders class. + * Initializes properties based on the provided model if it is an object. + * + * @param model - Optional partial model object to initialize the HTTPHeaders. + */ + constructor(model?: Partial) { + super(model); + + getLifecycleHooks('HTTPHeaders')?.constructor?.(this); + } + + /** + * Validates the current instance of the HTTPHeaders. + * Throws if invalid. + */ + validate(workflow?: Partial) { + const copy = new HTTPHeaders(this as any) as HTTPHeadersIntersection; + validate('HTTPHeaders', copy, workflow); + } + + /** + * Normalizes the current instance of the HTTPHeaders. + * Creates a copy of the HTTPHeaders, invokes normalization hooks if available, and returns the normalized copy. + * + * @returns A normalized version of the HTTPHeaders instance. + */ + normalize(): HTTPHeaders & Specification.HTTPHeaders { + const copy = new HTTPHeaders(this as any) as HTTPHeadersIntersection; + return getLifecycleHooks('HTTPHeaders')?.normalize?.(copy) || copy; + } +} + +export const _HTTPHeaders = HTTPHeaders as HTTPHeadersConstructor; diff --git a/src/lib/generated/classes/http-query.ts b/src/lib/generated/classes/http-query.ts new file mode 100644 index 0000000..2591832 --- /dev/null +++ b/src/lib/generated/classes/http-query.ts @@ -0,0 +1,78 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/***************************************************************************************** + * + * /!\ This file is computer generated. Any manual modification can and will be lost. /!\ + * + *****************************************************************************************/ + +import { ObjectHydrator } from '../../hydrator'; +import { Specification } from '../definitions'; +import { getLifecycleHooks } from '../../lifecycle-hooks'; +import { validate } from '../../validation'; + +/** + * Represents the intersection between the HTTPQuery class and type + */ +export type HTTPQueryIntersection = HTTPQuery & Specification.HTTPQuery; + +/** + * Represents a constructor for the intersection of the HTTPQuery class and type + */ +export interface HTTPQueryConstructor { + new (model?: Partial): HTTPQueryIntersection; +} + +/** + * Represents a HTTPQuery with methods for validation and normalization. + * Inherits from ObjectHydrator which provides functionality for hydrating the state based on a model. + */ +export class HTTPQuery extends ObjectHydrator { + /** + * Instanciates a new instance of the HTTPQuery class. + * Initializes properties based on the provided model if it is an object. + * + * @param model - Optional partial model object to initialize the HTTPQuery. + */ + constructor(model?: Partial) { + super(model); + + getLifecycleHooks('HTTPQuery')?.constructor?.(this); + } + + /** + * Validates the current instance of the HTTPQuery. + * Throws if invalid. + */ + validate(workflow?: Partial) { + const copy = new HTTPQuery(this as any) as HTTPQueryIntersection; + validate('HTTPQuery', copy, workflow); + } + + /** + * Normalizes the current instance of the HTTPQuery. + * Creates a copy of the HTTPQuery, invokes normalization hooks if available, and returns the normalized copy. + * + * @returns A normalized version of the HTTPQuery instance. + */ + normalize(): HTTPQuery & Specification.HTTPQuery { + const copy = new HTTPQuery(this as any) as HTTPQueryIntersection; + return getLifecycleHooks('HTTPQuery')?.normalize?.(copy) || copy; + } +} + +export const _HTTPQuery = HTTPQuery as HTTPQueryConstructor; diff --git a/src/lib/generated/classes/index.ts b/src/lib/generated/classes/index.ts index 955ab02..66dbf74 100644 --- a/src/lib/generated/classes/index.ts +++ b/src/lib/generated/classes/index.ts @@ -18,6 +18,8 @@ import { _AllEventConsumptionStrategy } from './all-event-consumption-strategy'; import { _AllEventConsumptionStrategyConfiguration } from './all-event-consumption-strategy-configuration'; import { _AnyEventConsumptionStrategy } from './any-event-consumption-strategy'; import { _AnyEventConsumptionStrategyConfiguration } from './any-event-consumption-strategy-configuration'; +import { _AnyEventConsumptionStrategyUntil } from './any-event-consumption-strategy-until'; +import { _AnyEventUntilConsumed } from './any-event-until-consumed'; import { _AsyncApiArguments } from './async-api-arguments'; import { _AuthenticationPolicy } from './authentication-policy'; import { _AuthenticationPolicyReference } from './authentication-policy-reference'; @@ -38,6 +40,7 @@ import { _CatchErrors } from './catch-errors'; import { _ConstantBackoff } from './constant-backoff'; import { _Container } from './container'; import { _ContainerEnvironment } from './container-environment'; +import { _ContainerLifetime } from './container-lifetime'; import { _ContainerPorts } from './container-ports'; import { _ContainerVolumes } from './container-volumes'; import { _DigestAuthenticationPolicy } from './digest-authentication-policy'; @@ -55,9 +58,11 @@ import { _Endpoint } from './endpoint'; import { _EndpointConfiguration } from './endpoint-configuration'; import { _EndpointUri } from './endpoint-uri'; import { _Error } from './error'; +import { _ErrorFilter } from './error-filter'; import { _ErrorInstance } from './error-instance'; import { _ErrorType } from './error-type'; import { _EventConsumptionStrategy } from './event-consumption-strategy'; +import { _EventData } from './event-data'; import { _EventDataschema } from './event-dataschema'; import { _EventFilter } from './event-filter'; import { _EventFilterCorrelate } from './event-filter-correlate'; @@ -78,6 +83,9 @@ import { _ForTaskConfiguration } from './for-task-configuration'; import { _FunctionArguments } from './function-arguments'; import { _GRPCArguments } from './grpc-arguments'; import { _HTTPArguments } from './http-arguments'; +import { _HTTPBody } from './http-body'; +import { _HTTPHeaders } from './http-headers'; +import { _HTTPQuery } from './http-query'; import { _InlineScript } from './inline-script'; import { _Input } from './input'; import { _InputFrom } from './input-from'; @@ -104,7 +112,7 @@ import { _Output } from './output'; import { _OutputAs } from './output-as'; import { _RaiseTask } from './raise-task'; import { _RaiseTaskConfiguration } from './raise-task-configuration'; -import { _RaiseTaskRaiseError } from './raise-task-raise-error'; +import { _RaiseTaskError } from './raise-task-error'; import { _ReferenceableAuthenticationPolicy } from './referenceable-authentication-policy'; import { _RetryBackoff } from './retry-backoff'; import { _RetryLimit } from './retry-limit'; @@ -131,6 +139,7 @@ import { _ShellArguments } from './shell-arguments'; import { _ShellEnvironment } from './shell-environment'; import { _SubflowConfiguration } from './subflow-configuration'; import { _SubflowInput } from './subflow-input'; +import { _SubscriptionIterator } from './subscription-iterator'; import { _SwitchCase } from './switch-case'; import { _SwitchItem } from './switch-item'; import { _SwitchTask } from './switch-task'; @@ -138,10 +147,10 @@ import { _SwitchTaskConfiguration } from './switch-task-configuration'; import { _Task } from './task'; import { _TaskBase } from './task-base'; import { _TaskBaseIf } from './task-base-if'; -import { _TaskBaseTimeout } from './task-base-timeout'; import { _TaskItem } from './task-item'; import { _TaskList } from './task-list'; import { _TaskMetadata } from './task-metadata'; +import { _TaskTimeout } from './task-timeout'; import { _Timeout } from './timeout'; import { _TryTask } from './try-task'; import { _TryTaskCatch } from './try-task-catch'; @@ -157,13 +166,9 @@ import { _UseRetries } from './use-retries'; import { _UseSecrets } from './use-secrets'; import { _UseTimeouts } from './use-timeouts'; import { _WaitTask } from './wait-task'; -import { _WithAsyncAPIPayload } from './with-async-api-payload'; import { _WithEvent } from './with-event'; import { _WithGRPCArguments } from './with-grpc-arguments'; import { _WithGRPCService } from './with-grpc-service'; -import { _WithHTTPBody } from './with-http-body'; -import { _WithHTTPHeaders } from './with-http-headers'; -import { _WithHTTPQuery } from './with-http-query'; import { _WithOpenAPIParameters } from './with-open-api-parameters'; import { _Workflow } from './workflow'; import { _WorkflowMetadata } from './workflow-metadata'; @@ -175,6 +180,8 @@ export const Classes = { AllEventConsumptionStrategyConfiguration: _AllEventConsumptionStrategyConfiguration, AnyEventConsumptionStrategy: _AnyEventConsumptionStrategy, AnyEventConsumptionStrategyConfiguration: _AnyEventConsumptionStrategyConfiguration, + AnyEventConsumptionStrategyUntil: _AnyEventConsumptionStrategyUntil, + AnyEventUntilConsumed: _AnyEventUntilConsumed, AsyncApiArguments: _AsyncApiArguments, AuthenticationPolicy: _AuthenticationPolicy, AuthenticationPolicyReference: _AuthenticationPolicyReference, @@ -195,6 +202,7 @@ export const Classes = { ConstantBackoff: _ConstantBackoff, Container: _Container, ContainerEnvironment: _ContainerEnvironment, + ContainerLifetime: _ContainerLifetime, ContainerPorts: _ContainerPorts, ContainerVolumes: _ContainerVolumes, DigestAuthenticationPolicy: _DigestAuthenticationPolicy, @@ -212,9 +220,11 @@ export const Classes = { EndpointConfiguration: _EndpointConfiguration, EndpointUri: _EndpointUri, Error: _Error, + ErrorFilter: _ErrorFilter, ErrorInstance: _ErrorInstance, ErrorType: _ErrorType, EventConsumptionStrategy: _EventConsumptionStrategy, + EventData: _EventData, EventDataschema: _EventDataschema, EventFilter: _EventFilter, EventFilterCorrelate: _EventFilterCorrelate, @@ -235,6 +245,9 @@ export const Classes = { FunctionArguments: _FunctionArguments, GRPCArguments: _GRPCArguments, HTTPArguments: _HTTPArguments, + HTTPBody: _HTTPBody, + HTTPHeaders: _HTTPHeaders, + HTTPQuery: _HTTPQuery, InlineScript: _InlineScript, Input: _Input, InputFrom: _InputFrom, @@ -261,7 +274,7 @@ export const Classes = { OutputAs: _OutputAs, RaiseTask: _RaiseTask, RaiseTaskConfiguration: _RaiseTaskConfiguration, - RaiseTaskRaiseError: _RaiseTaskRaiseError, + RaiseTaskError: _RaiseTaskError, ReferenceableAuthenticationPolicy: _ReferenceableAuthenticationPolicy, RetryBackoff: _RetryBackoff, RetryLimit: _RetryLimit, @@ -288,6 +301,7 @@ export const Classes = { ShellEnvironment: _ShellEnvironment, SubflowConfiguration: _SubflowConfiguration, SubflowInput: _SubflowInput, + SubscriptionIterator: _SubscriptionIterator, SwitchCase: _SwitchCase, SwitchItem: _SwitchItem, SwitchTask: _SwitchTask, @@ -295,10 +309,10 @@ export const Classes = { Task: _Task, TaskBase: _TaskBase, TaskBaseIf: _TaskBaseIf, - TaskBaseTimeout: _TaskBaseTimeout, TaskItem: _TaskItem, TaskList: _TaskList, TaskMetadata: _TaskMetadata, + TaskTimeout: _TaskTimeout, Timeout: _Timeout, TryTask: _TryTask, TryTaskCatch: _TryTaskCatch, @@ -314,13 +328,9 @@ export const Classes = { UseSecrets: _UseSecrets, UseTimeouts: _UseTimeouts, WaitTask: _WaitTask, - WithAsyncAPIPayload: _WithAsyncAPIPayload, WithEvent: _WithEvent, WithGRPCArguments: _WithGRPCArguments, WithGRPCService: _WithGRPCService, - WithHTTPBody: _WithHTTPBody, - WithHTTPHeaders: _WithHTTPHeaders, - WithHTTPQuery: _WithHTTPQuery, WithOpenAPIParameters: _WithOpenAPIParameters, Workflow: _Workflow, WorkflowMetadata: _WorkflowMetadata, diff --git a/src/lib/generated/classes/listen-task.ts b/src/lib/generated/classes/listen-task.ts index 4dd62e0..ae1fe54 100644 --- a/src/lib/generated/classes/listen-task.ts +++ b/src/lib/generated/classes/listen-task.ts @@ -23,9 +23,10 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { _ListenTaskConfiguration } from './listen-task-configuration'; +import { _SubscriptionIterator } from './subscription-iterator'; import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; import { getLifecycleHooks } from '../../lifecycle-hooks'; @@ -62,9 +63,10 @@ export class ListenTask extends _TaskBase { if (typeof model.input === 'object') self.input = new _Input(model.input); if (typeof model.output === 'object') self.output = new _Output(model.output); if (typeof model.export === 'object') self.export = new _Export(model.export); - if (typeof model.timeout === 'object') self.timeout = new _TaskBaseTimeout(model.timeout); + if (typeof model.timeout === 'object') self.timeout = new _TaskTimeout(model.timeout); if (typeof model.metadata === 'object') self.metadata = new _TaskMetadata(model.metadata); if (typeof model.listen === 'object') self.listen = new _ListenTaskConfiguration(model.listen); + if (typeof model.foreach === 'object') self.foreach = new _SubscriptionIterator(model.foreach); } getLifecycleHooks('ListenTask')?.constructor?.(this); } diff --git a/src/lib/generated/classes/raise-task-configuration.ts b/src/lib/generated/classes/raise-task-configuration.ts index 65d6897..505fabd 100644 --- a/src/lib/generated/classes/raise-task-configuration.ts +++ b/src/lib/generated/classes/raise-task-configuration.ts @@ -20,7 +20,7 @@ * *****************************************************************************************/ -import { _RaiseTaskRaiseError } from './raise-task-raise-error'; +import { _RaiseTaskError } from './raise-task-error'; import { ObjectHydrator } from '../../hydrator'; import { Specification } from '../definitions'; import { getLifecycleHooks } from '../../lifecycle-hooks'; @@ -54,7 +54,7 @@ export class RaiseTaskConfiguration extends ObjectHydrator): RaiseTaskRaiseErrorIntersection; +export interface RaiseTaskErrorConstructor { + new (model?: Partial): RaiseTaskErrorIntersection; } /** - * Represents a RaiseTaskRaiseError with methods for validation and normalization. + * Represents a RaiseTaskError with methods for validation and normalization. * Inherits from ObjectHydrator which provides functionality for hydrating the state based on a model. */ -export class RaiseTaskRaiseError extends ObjectHydrator { +export class RaiseTaskError extends ObjectHydrator { /** - * Instanciates a new instance of the RaiseTaskRaiseError class. + * Instanciates a new instance of the RaiseTaskError class. * Initializes properties based on the provided model if it is an object. * - * @param model - Optional partial model object to initialize the RaiseTaskRaiseError. + * @param model - Optional partial model object to initialize the RaiseTaskError. */ - constructor(model?: Partial) { + constructor(model?: Partial) { super(model); - getLifecycleHooks('RaiseTaskRaiseError')?.constructor?.(this); + getLifecycleHooks('RaiseTaskError')?.constructor?.(this); } /** - * Validates the current instance of the RaiseTaskRaiseError. + * Validates the current instance of the RaiseTaskError. * Throws if invalid. */ validate(workflow?: Partial) { - const copy = new RaiseTaskRaiseError(this as any) as RaiseTaskRaiseErrorIntersection; - validate('RaiseTaskRaiseError', copy, workflow); + const copy = new RaiseTaskError(this as any) as RaiseTaskErrorIntersection; + validate('RaiseTaskError', copy, workflow); } /** - * Normalizes the current instance of the RaiseTaskRaiseError. - * Creates a copy of the RaiseTaskRaiseError, invokes normalization hooks if available, and returns the normalized copy. + * Normalizes the current instance of the RaiseTaskError. + * Creates a copy of the RaiseTaskError, invokes normalization hooks if available, and returns the normalized copy. * - * @returns A normalized version of the RaiseTaskRaiseError instance. + * @returns A normalized version of the RaiseTaskError instance. */ - normalize(): RaiseTaskRaiseError & Specification.RaiseTaskRaiseError { - const copy = new RaiseTaskRaiseError(this as any) as RaiseTaskRaiseErrorIntersection; - return getLifecycleHooks('RaiseTaskRaiseError')?.normalize?.(copy) || copy; + normalize(): RaiseTaskError & Specification.RaiseTaskError { + const copy = new RaiseTaskError(this as any) as RaiseTaskErrorIntersection; + return getLifecycleHooks('RaiseTaskError')?.normalize?.(copy) || copy; } } -export const _RaiseTaskRaiseError = RaiseTaskRaiseError as RaiseTaskRaiseErrorConstructor; +export const _RaiseTaskError = RaiseTaskError as RaiseTaskErrorConstructor; diff --git a/src/lib/generated/classes/raise-task.ts b/src/lib/generated/classes/raise-task.ts index f7b062f..3dc84ae 100644 --- a/src/lib/generated/classes/raise-task.ts +++ b/src/lib/generated/classes/raise-task.ts @@ -23,7 +23,7 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { _RaiseTaskConfiguration } from './raise-task-configuration'; import { _TaskBase } from './task-base'; @@ -62,7 +62,7 @@ export class RaiseTask extends _TaskBase { if (typeof model.input === 'object') self.input = new _Input(model.input); if (typeof model.output === 'object') self.output = new _Output(model.output); if (typeof model.export === 'object') self.export = new _Export(model.export); - if (typeof model.timeout === 'object') self.timeout = new _TaskBaseTimeout(model.timeout); + if (typeof model.timeout === 'object') self.timeout = new _TaskTimeout(model.timeout); if (typeof model.metadata === 'object') self.metadata = new _TaskMetadata(model.metadata); if (typeof model.raise === 'object') self.raise = new _RaiseTaskConfiguration(model.raise); } diff --git a/src/lib/generated/classes/run-task.ts b/src/lib/generated/classes/run-task.ts index 986e239..271d4f5 100644 --- a/src/lib/generated/classes/run-task.ts +++ b/src/lib/generated/classes/run-task.ts @@ -23,7 +23,7 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { _RunTaskConfiguration } from './run-task-configuration'; import { _TaskBase } from './task-base'; @@ -62,7 +62,7 @@ export class RunTask extends _TaskBase { if (typeof model.input === 'object') self.input = new _Input(model.input); if (typeof model.output === 'object') self.output = new _Output(model.output); if (typeof model.export === 'object') self.export = new _Export(model.export); - if (typeof model.timeout === 'object') self.timeout = new _TaskBaseTimeout(model.timeout); + if (typeof model.timeout === 'object') self.timeout = new _TaskTimeout(model.timeout); if (typeof model.metadata === 'object') self.metadata = new _TaskMetadata(model.metadata); if (typeof model.run === 'object') self.run = new _RunTaskConfiguration(model.run); } diff --git a/src/lib/generated/classes/set-task.ts b/src/lib/generated/classes/set-task.ts index c1bb182..114a619 100644 --- a/src/lib/generated/classes/set-task.ts +++ b/src/lib/generated/classes/set-task.ts @@ -23,7 +23,7 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { _SetTaskConfiguration } from './set-task-configuration'; import { _TaskBase } from './task-base'; @@ -62,7 +62,7 @@ export class SetTask extends _TaskBase { if (typeof model.input === 'object') self.input = new _Input(model.input); if (typeof model.output === 'object') self.output = new _Output(model.output); if (typeof model.export === 'object') self.export = new _Export(model.export); - if (typeof model.timeout === 'object') self.timeout = new _TaskBaseTimeout(model.timeout); + if (typeof model.timeout === 'object') self.timeout = new _TaskTimeout(model.timeout); if (typeof model.metadata === 'object') self.metadata = new _TaskMetadata(model.metadata); if (typeof model.set === 'object') self.set = new _SetTaskConfiguration(model.set); } diff --git a/src/lib/generated/classes/subscription-iterator.ts b/src/lib/generated/classes/subscription-iterator.ts new file mode 100644 index 0000000..87162f5 --- /dev/null +++ b/src/lib/generated/classes/subscription-iterator.ts @@ -0,0 +1,87 @@ +/* + * Copyright 2021-Present The Serverless Workflow Specification Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/***************************************************************************************** + * + * /!\ This file is computer generated. Any manual modification can and will be lost. /!\ + * + *****************************************************************************************/ + +import { _TaskList } from './task-list'; +import { _Output } from './output'; +import { _Export } from './export'; +import { ObjectHydrator } from '../../hydrator'; +import { Specification } from '../definitions'; +import { getLifecycleHooks } from '../../lifecycle-hooks'; +import { validate } from '../../validation'; +import { isObject } from '../../utils'; + +/** + * Represents the intersection between the SubscriptionIterator class and type + */ +export type SubscriptionIteratorIntersection = SubscriptionIterator & Specification.SubscriptionIterator; + +/** + * Represents a constructor for the intersection of the SubscriptionIterator class and type + */ +export interface SubscriptionIteratorConstructor { + new (model?: Partial): SubscriptionIteratorIntersection; +} + +/** + * Represents a SubscriptionIterator with methods for validation and normalization. + * Inherits from ObjectHydrator which provides functionality for hydrating the state based on a model. + */ +export class SubscriptionIterator extends ObjectHydrator { + /** + * Instanciates a new instance of the SubscriptionIterator class. + * Initializes properties based on the provided model if it is an object. + * + * @param model - Optional partial model object to initialize the SubscriptionIterator. + */ + constructor(model?: Partial) { + super(model); + const self = this as unknown as Specification.SubscriptionIterator & object; + if (isObject(model)) { + if (typeof model.do === 'object') self.do = new _TaskList(model.do); + if (typeof model.output === 'object') self.output = new _Output(model.output); + if (typeof model.export === 'object') self.export = new _Export(model.export); + } + getLifecycleHooks('SubscriptionIterator')?.constructor?.(this); + } + + /** + * Validates the current instance of the SubscriptionIterator. + * Throws if invalid. + */ + validate(workflow?: Partial) { + const copy = new SubscriptionIterator(this as any) as SubscriptionIteratorIntersection; + validate('SubscriptionIterator', copy, workflow); + } + + /** + * Normalizes the current instance of the SubscriptionIterator. + * Creates a copy of the SubscriptionIterator, invokes normalization hooks if available, and returns the normalized copy. + * + * @returns A normalized version of the SubscriptionIterator instance. + */ + normalize(): SubscriptionIterator & Specification.SubscriptionIterator { + const copy = new SubscriptionIterator(this as any) as SubscriptionIteratorIntersection; + return getLifecycleHooks('SubscriptionIterator')?.normalize?.(copy) || copy; + } +} + +export const _SubscriptionIterator = SubscriptionIterator as SubscriptionIteratorConstructor; diff --git a/src/lib/generated/classes/switch-task.ts b/src/lib/generated/classes/switch-task.ts index cf3a21a..71bf5e8 100644 --- a/src/lib/generated/classes/switch-task.ts +++ b/src/lib/generated/classes/switch-task.ts @@ -23,7 +23,7 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { _SwitchTaskConfiguration } from './switch-task-configuration'; import { _TaskBase } from './task-base'; @@ -62,7 +62,7 @@ export class SwitchTask extends _TaskBase { if (typeof model.input === 'object') self.input = new _Input(model.input); if (typeof model.output === 'object') self.output = new _Output(model.output); if (typeof model.export === 'object') self.export = new _Export(model.export); - if (typeof model.timeout === 'object') self.timeout = new _TaskBaseTimeout(model.timeout); + if (typeof model.timeout === 'object') self.timeout = new _TaskTimeout(model.timeout); if (typeof model.metadata === 'object') self.metadata = new _TaskMetadata(model.metadata); if (typeof model.switch === 'object') self.switch = new _SwitchTaskConfiguration(model.switch) as unknown as Specification.SwitchTaskConfiguration; diff --git a/src/lib/generated/classes/task-base.ts b/src/lib/generated/classes/task-base.ts index 3078df3..03510f0 100644 --- a/src/lib/generated/classes/task-base.ts +++ b/src/lib/generated/classes/task-base.ts @@ -23,7 +23,7 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { ObjectHydrator } from '../../hydrator'; import { Specification } from '../definitions'; @@ -61,7 +61,7 @@ export class TaskBase extends ObjectHydrator { if (typeof model.input === 'object') self.input = new _Input(model.input); if (typeof model.output === 'object') self.output = new _Output(model.output); if (typeof model.export === 'object') self.export = new _Export(model.export); - if (typeof model.timeout === 'object') self.timeout = new _TaskBaseTimeout(model.timeout); + if (typeof model.timeout === 'object') self.timeout = new _TaskTimeout(model.timeout); if (typeof model.metadata === 'object') self.metadata = new _TaskMetadata(model.metadata); } getLifecycleHooks('TaskBase')?.constructor?.(this); diff --git a/src/lib/generated/classes/task-base-timeout.ts b/src/lib/generated/classes/task-timeout.ts similarity index 54% rename from src/lib/generated/classes/task-base-timeout.ts rename to src/lib/generated/classes/task-timeout.ts index aa59a83..762f8f2 100644 --- a/src/lib/generated/classes/task-base-timeout.ts +++ b/src/lib/generated/classes/task-timeout.ts @@ -28,59 +28,59 @@ import { validate } from '../../validation'; import { isObject } from '../../utils'; /** - * Represents the intersection between the TaskBaseTimeout class and type + * Represents the intersection between the TaskTimeout class and type */ -export type TaskBaseTimeoutIntersection = TaskBaseTimeout & Specification.TaskBaseTimeout; +export type TaskTimeoutIntersection = TaskTimeout & Specification.TaskTimeout; /** - * Represents a constructor for the intersection of the TaskBaseTimeout class and type + * Represents a constructor for the intersection of the TaskTimeout class and type */ -export interface TaskBaseTimeoutConstructor { - new (model?: Partial): TaskBaseTimeoutIntersection; +export interface TaskTimeoutConstructor { + new (model?: Partial): TaskTimeoutIntersection; } /** - * Represents a TaskBaseTimeout with methods for validation and normalization. + * Represents a TaskTimeout with methods for validation and normalization. * Inherits from ObjectHydrator which provides functionality for hydrating the state based on a model. */ -export class TaskBaseTimeout extends ObjectHydrator { +export class TaskTimeout extends ObjectHydrator { /** - * Instanciates a new instance of the TaskBaseTimeout class. + * Instanciates a new instance of the TaskTimeout class. * Initializes properties based on the provided model if it is an object. * - * @param model - Optional partial model object to initialize the TaskBaseTimeout. + * @param model - Optional partial model object to initialize the TaskTimeout. */ - constructor(model?: Partial) { + constructor(model?: Partial) { super(model); - const self = this as unknown as Specification.TaskBaseTimeout & object; + const self = this as unknown as Specification.TaskTimeout & object; if (isObject(model)) { if (typeof (model as Specification.Timeout).after === 'object') (self as Specification.Timeout).after = new _Duration( (model as Specification.Timeout).after as Specification.Duration, ); } - getLifecycleHooks('TaskBaseTimeout')?.constructor?.(this); + getLifecycleHooks('TaskTimeout')?.constructor?.(this); } /** - * Validates the current instance of the TaskBaseTimeout. + * Validates the current instance of the TaskTimeout. * Throws if invalid. */ validate(workflow?: Partial) { - const copy = new TaskBaseTimeout(this as any) as TaskBaseTimeoutIntersection; - validate('TaskBaseTimeout', copy, workflow); + const copy = new TaskTimeout(this as any) as TaskTimeoutIntersection; + validate('TaskTimeout', copy, workflow); } /** - * Normalizes the current instance of the TaskBaseTimeout. - * Creates a copy of the TaskBaseTimeout, invokes normalization hooks if available, and returns the normalized copy. + * Normalizes the current instance of the TaskTimeout. + * Creates a copy of the TaskTimeout, invokes normalization hooks if available, and returns the normalized copy. * - * @returns A normalized version of the TaskBaseTimeout instance. + * @returns A normalized version of the TaskTimeout instance. */ - normalize(): TaskBaseTimeout & Specification.TaskBaseTimeout { - const copy = new TaskBaseTimeout(this as any) as TaskBaseTimeoutIntersection; - return getLifecycleHooks('TaskBaseTimeout')?.normalize?.(copy) || copy; + normalize(): TaskTimeout & Specification.TaskTimeout { + const copy = new TaskTimeout(this as any) as TaskTimeoutIntersection; + return getLifecycleHooks('TaskTimeout')?.normalize?.(copy) || copy; } } -export const _TaskBaseTimeout = TaskBaseTimeout as TaskBaseTimeoutConstructor; +export const _TaskTimeout = TaskTimeout as TaskTimeoutConstructor; diff --git a/src/lib/generated/classes/task.ts b/src/lib/generated/classes/task.ts index 036274b..c2ce7a9 100644 --- a/src/lib/generated/classes/task.ts +++ b/src/lib/generated/classes/task.ts @@ -23,12 +23,13 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { _ForkTaskConfiguration } from './fork-task-configuration'; import { _EmitTaskConfiguration } from './emit-task-configuration'; import { _ForTaskConfiguration } from './for-task-configuration'; import { _ListenTaskConfiguration } from './listen-task-configuration'; +import { _SubscriptionIterator } from './subscription-iterator'; import { _RaiseTaskConfiguration } from './raise-task-configuration'; import { _RunTaskConfiguration } from './run-task-configuration'; import { _SetTaskConfiguration } from './set-task-configuration'; @@ -82,8 +83,8 @@ export class Task extends ObjectHydrator { (model as Specification.TaskBase).export as Specification.Export, ); if (typeof (model as Specification.TaskBase).timeout === 'object') - (self as Specification.TaskBase).timeout = new _TaskBaseTimeout( - (model as Specification.TaskBase).timeout as Specification.TaskBaseTimeout, + (self as Specification.TaskBase).timeout = new _TaskTimeout( + (model as Specification.TaskBase).timeout as Specification.TaskTimeout, ); if (typeof (model as Specification.TaskBase).metadata === 'object') (self as Specification.TaskBase).metadata = new _TaskMetadata( @@ -129,13 +130,53 @@ export class Task extends ObjectHydrator { ).for as Specification.ForTaskConfiguration, ); if ( - typeof (model as { [k: string]: unknown; listen?: Specification.ListenTaskConfiguration }).listen === 'object' + typeof ( + model as { + [k: string]: unknown; + listen?: Specification.ListenTaskConfiguration; + foreach?: Specification.SubscriptionIterator; + } + ).listen === 'object' ) - (self as { [k: string]: unknown; listen?: Specification.ListenTaskConfiguration }).listen = - new _ListenTaskConfiguration( - (model as { [k: string]: unknown; listen?: Specification.ListenTaskConfiguration }) - .listen as Specification.ListenTaskConfiguration, - ); + ( + self as { + [k: string]: unknown; + listen?: Specification.ListenTaskConfiguration; + foreach?: Specification.SubscriptionIterator; + } + ).listen = new _ListenTaskConfiguration( + ( + model as { + [k: string]: unknown; + listen?: Specification.ListenTaskConfiguration; + foreach?: Specification.SubscriptionIterator; + } + ).listen as Specification.ListenTaskConfiguration, + ); + if ( + typeof ( + model as { + [k: string]: unknown; + listen?: Specification.ListenTaskConfiguration; + foreach?: Specification.SubscriptionIterator; + } + ).foreach === 'object' + ) + ( + self as { + [k: string]: unknown; + listen?: Specification.ListenTaskConfiguration; + foreach?: Specification.SubscriptionIterator; + } + ).foreach = new _SubscriptionIterator( + ( + model as { + [k: string]: unknown; + listen?: Specification.ListenTaskConfiguration; + foreach?: Specification.SubscriptionIterator; + } + ).foreach as Specification.SubscriptionIterator, + ); if (typeof (model as { [k: string]: unknown; raise?: Specification.RaiseTaskConfiguration }).raise === 'object') (self as { [k: string]: unknown; raise?: Specification.RaiseTaskConfiguration }).raise = new _RaiseTaskConfiguration( diff --git a/src/lib/generated/classes/try-task.ts b/src/lib/generated/classes/try-task.ts index 3786201..58cf331 100644 --- a/src/lib/generated/classes/try-task.ts +++ b/src/lib/generated/classes/try-task.ts @@ -23,7 +23,7 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { _TaskList } from './task-list'; import { _TryTaskCatch } from './try-task-catch'; @@ -63,7 +63,7 @@ export class TryTask extends _TaskBase { if (typeof model.input === 'object') self.input = new _Input(model.input); if (typeof model.output === 'object') self.output = new _Output(model.output); if (typeof model.export === 'object') self.export = new _Export(model.export); - if (typeof model.timeout === 'object') self.timeout = new _TaskBaseTimeout(model.timeout); + if (typeof model.timeout === 'object') self.timeout = new _TaskTimeout(model.timeout); if (typeof model.metadata === 'object') self.metadata = new _TaskMetadata(model.metadata); if (typeof model.try === 'object') self.try = new _TaskList(model.try); if (typeof model.catch === 'object') self.catch = new _TryTaskCatch(model.catch); diff --git a/src/lib/generated/classes/wait-task.ts b/src/lib/generated/classes/wait-task.ts index eba13a8..ed80c01 100644 --- a/src/lib/generated/classes/wait-task.ts +++ b/src/lib/generated/classes/wait-task.ts @@ -23,7 +23,7 @@ import { _Input } from './input'; import { _Output } from './output'; import { _Export } from './export'; -import { _TaskBaseTimeout } from './task-base-timeout'; +import { _TaskTimeout } from './task-timeout'; import { _TaskMetadata } from './task-metadata'; import { _Duration } from './duration'; import { _TaskBase } from './task-base'; @@ -62,7 +62,7 @@ export class WaitTask extends _TaskBase { if (typeof model.input === 'object') self.input = new _Input(model.input); if (typeof model.output === 'object') self.output = new _Output(model.output); if (typeof model.export === 'object') self.export = new _Export(model.export); - if (typeof model.timeout === 'object') self.timeout = new _TaskBaseTimeout(model.timeout); + if (typeof model.timeout === 'object') self.timeout = new _TaskTimeout(model.timeout); if (typeof model.metadata === 'object') self.metadata = new _TaskMetadata(model.metadata); if (typeof model.wait === 'object') self.wait = new _Duration(model.wait); } diff --git a/src/lib/generated/classes/with-async-api-payload.ts b/src/lib/generated/classes/with-async-api-payload.ts deleted file mode 100644 index 25f8213..0000000 --- a/src/lib/generated/classes/with-async-api-payload.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2021-Present The Serverless Workflow Specification Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/***************************************************************************************** - * - * /!\ This file is computer generated. Any manual modification can and will be lost. /!\ - * - *****************************************************************************************/ - -import { ObjectHydrator } from '../../hydrator'; -import { Specification } from '../definitions'; -import { getLifecycleHooks } from '../../lifecycle-hooks'; -import { validate } from '../../validation'; - -/** - * Represents the intersection between the WithAsyncAPIPayload class and type - */ -export type WithAsyncAPIPayloadIntersection = WithAsyncAPIPayload & Specification.WithAsyncAPIPayload; - -/** - * Represents a constructor for the intersection of the WithAsyncAPIPayload class and type - */ -export interface WithAsyncAPIPayloadConstructor { - new (model?: Partial): WithAsyncAPIPayloadIntersection; -} - -/** - * Represents a WithAsyncAPIPayload with methods for validation and normalization. - * Inherits from ObjectHydrator which provides functionality for hydrating the state based on a model. - */ -export class WithAsyncAPIPayload extends ObjectHydrator { - /** - * Instanciates a new instance of the WithAsyncAPIPayload class. - * Initializes properties based on the provided model if it is an object. - * - * @param model - Optional partial model object to initialize the WithAsyncAPIPayload. - */ - constructor(model?: Partial) { - super(model); - - getLifecycleHooks('WithAsyncAPIPayload')?.constructor?.(this); - } - - /** - * Validates the current instance of the WithAsyncAPIPayload. - * Throws if invalid. - */ - validate(workflow?: Partial) { - const copy = new WithAsyncAPIPayload(this as any) as WithAsyncAPIPayloadIntersection; - validate('WithAsyncAPIPayload', copy, workflow); - } - - /** - * Normalizes the current instance of the WithAsyncAPIPayload. - * Creates a copy of the WithAsyncAPIPayload, invokes normalization hooks if available, and returns the normalized copy. - * - * @returns A normalized version of the WithAsyncAPIPayload instance. - */ - normalize(): WithAsyncAPIPayload & Specification.WithAsyncAPIPayload { - const copy = new WithAsyncAPIPayload(this as any) as WithAsyncAPIPayloadIntersection; - return getLifecycleHooks('WithAsyncAPIPayload')?.normalize?.(copy) || copy; - } -} - -export const _WithAsyncAPIPayload = WithAsyncAPIPayload as WithAsyncAPIPayloadConstructor; diff --git a/src/lib/generated/definitions/specification.ts b/src/lib/generated/definitions/specification.ts index fd1b22b..bd7407a 100644 --- a/src/lib/generated/definitions/specification.ts +++ b/src/lib/generated/definitions/specification.ts @@ -157,12 +157,18 @@ export type ExportAs = | { [k: string]: unknown; }; -export type TaskBaseTimeout = Timeout | string; +export type TaskTimeout = Timeout | string; export type Duration = DurationInline | string; /** * Represents different transition options for a workflow. */ export type FlowDirective = ('continue' | 'exit' | 'end') | string; +/** + * The Async API call arguments. + */ +export type AsyncApiArguments = { + [k: string]: unknown; +}; /** * Defines the GRPC call to perform. */ @@ -231,6 +237,14 @@ export type EventTime = RuntimeExpression; * The schema describing the event format. */ export type EventDataschema = UriTemplate | RuntimeExpression; +/** + * The event's payload data + */ +export type EventData = + | RuntimeExpression + | { + [k: string]: unknown; + }; /** * Allows workflows to iterate over a collection of items, executing a defined set of subtasks for each item in the collection. This task type is instrumental in handling scenarios such as batch processing, data transformation, and repetitive operations across datasets. */ @@ -248,6 +262,7 @@ export type ForTask = TaskBase & { */ export type ListenTask = TaskBase & { listen?: ListenTaskConfiguration; + foreach?: SubscriptionIterator; [k: string]: unknown; }; /** @@ -265,6 +280,11 @@ export type AllEventConsumptionStrategyConfiguration = EventFilter[]; * A list containing any of the events to consume. */ export type AnyEventConsumptionStrategyConfiguration = EventFilter[]; +export type AnyEventConsumptionStrategyUntil = string | AnyEventUntilConsumed; +export type AnyEventUntilConsumed = EventConsumptionStrategy & { + until?: never; + [k: string]: unknown; +}; /** * Intentionally triggers and propagates errors. */ @@ -272,7 +292,7 @@ export type RaiseTask = TaskBase & { raise?: RaiseTaskConfiguration; [k: string]: unknown; }; -export type RaiseTaskRaiseError = Error | string; +export type RaiseTaskError = Error | string; /** * Provides the capability to execute external containers, shell commands, scripts, or workflows. */ @@ -729,7 +749,7 @@ export interface TaskBase { input?: Input; output?: Output; export?: Export; - timeout?: TaskBaseTimeout; + timeout?: TaskTimeout; then?: FlowDirective; metadata?: TaskMetadata; [k: string]: unknown; @@ -785,36 +805,6 @@ export interface DurationInline { export interface TaskMetadata { [k: string]: unknown; } -/** - * The Async API call arguments. - */ -export interface AsyncApiArguments { - document: ExternalResource; - /** - * A reference to the AsyncAPI operation to call. - */ - operationRef: string; - /** - * A a reference to the server to call the specified AsyncAPI operation on. If not set, default to the first server matching the operation's channel. - */ - server?: string; - /** - * The name of the message to use. If not set, defaults to the first message defined by the operation. - */ - message?: string; - /** - * The name of the binding to use. If not set, defaults to the first binding defined by the operation. - */ - binding?: string; - payload?: WithAsyncAPIPayload; - authentication?: ReferenceableAuthenticationPolicy; -} -/** - * The payload to call the AsyncAPI operation with, if any. - */ -export interface WithAsyncAPIPayload { - [k: string]: unknown; -} /** * The GRPC call arguments. */ @@ -857,30 +847,34 @@ export interface HTTPArguments { */ method: string; endpoint: Endpoint; - headers?: WithHTTPHeaders; - body?: WithHTTPBody; - query?: WithHTTPQuery; + headers?: HTTPHeaders; + body?: HTTPBody; + query?: HTTPQuery; /** * The http call output format. Defaults to 'content'. */ output?: 'raw' | 'content' | 'response'; + /** + * Specifies whether redirection status codes (`300–399`) should be treated as errors. + */ + redirect?: boolean; } /** * A name/value mapping of the headers, if any, of the HTTP request to perform. */ -export interface WithHTTPHeaders { +export interface HTTPHeaders { [k: string]: unknown; } /** * The body, if any, of the HTTP request to perform. */ -export interface WithHTTPBody { +export interface HTTPBody { [k: string]: unknown; } /** * A name/value mapping of the query parameters, if any, of the HTTP request to perform. */ -export interface WithHTTPQuery { +export interface HTTPQuery { [k: string]: unknown; } /** @@ -898,6 +892,10 @@ export interface OpenAPIArguments { * The http call output format. Defaults to 'content'. */ output?: 'raw' | 'content' | 'response'; + /** + * Specifies whether redirection status codes (`300–399`) should be treated as errors. + */ + redirect?: boolean; } /** * A name/value mapping of the parameters of the OpenAPI operation to call. @@ -957,6 +955,7 @@ export interface EmitEventWith { */ datacontenttype?: string; dataschema?: EventDataschema; + data?: EventData; [k: string]: unknown; } /** @@ -981,6 +980,10 @@ export interface ForTaskConfiguration { */ export interface ListenTaskConfiguration { to: EventConsumptionStrategy; + /** + * Specifies how events are read during the listen operation. + */ + read?: 'data' | 'envelope' | 'raw'; } export interface AllEventConsumptionStrategy { all: AllEventConsumptionStrategyConfiguration; @@ -1016,6 +1019,7 @@ export interface WithEvent { */ datacontenttype?: string; dataschema?: EventDataschema; + data?: EventData; [k: string]: unknown; } /** @@ -1036,17 +1040,34 @@ export interface EventFilterCorrelate { } export interface AnyEventConsumptionStrategy { any: AnyEventConsumptionStrategyConfiguration; + until?: AnyEventConsumptionStrategyUntil; [k: string]: unknown; } export interface OneEventConsumptionStrategy { one: EventFilter; [k: string]: unknown; } +/** + * Configures the iteration over each item (event or message) consumed by a subscription. + */ +export interface SubscriptionIterator { + /** + * The name of the variable used to store the current item being enumerated. + */ + item?: string; + /** + * The name of the variable used to store the index of the current item being enumerated. + */ + at?: string; + do?: TaskList; + output?: Output; + export?: Export; +} /** * The definition of the error to raise. */ export interface RaiseTaskConfiguration { - error: RaiseTaskRaiseError; + error: RaiseTaskError; } /** * Enables the execution of external processes encapsulated within a containerized environment. @@ -1063,6 +1084,10 @@ export interface Container { * The name of the container image to run. */ image: string; + /** + * A runtime expression, if any, used to give specific name to the container. + */ + name?: string; /** * The command, if any, to execute on the container. */ @@ -1070,6 +1095,7 @@ export interface Container { ports?: ContainerPorts; volumes?: ContainerVolumes; environment?: ContainerEnvironment; + lifetime?: ContainerLifetime; } /** * The container's port mappings, if any. @@ -1089,6 +1115,16 @@ export interface ContainerVolumes { export interface ContainerEnvironment { [k: string]: unknown; } +/** + * The configuration of a container's lifetime + */ +export interface ContainerLifetime { + /** + * The container cleanup policy to use + */ + cleanup: 'always' | 'never' | 'eventually'; + after?: Duration; +} /** * Enables the execution of custom scripts or code within a workflow, empowering workflows to perform specialized logic, data processing, or integration tasks by executing user-defined scripts written in various programming languages. */ @@ -1201,20 +1237,47 @@ export interface TryTaskCatch { */ as?: string; /** - * A runtime expression used to determine whether or not to catch the filtered error. + * A runtime expression used to determine whether to catch the filtered error. */ when?: string; /** - * A runtime expression used to determine whether or not to catch the filtered error. + * A runtime expression used to determine whether not to catch the filtered error. */ exceptWhen?: string; retry?: TryTaskCatchRetry; do?: TaskList; } /** - * The configuration of a concept used to catch errors. + * static error filter */ export interface CatchErrors { + with?: ErrorFilter; + [k: string]: unknown; +} +/** + * Error filtering base on static values. For error filtering on dynamic values, use catch.when property + */ +export interface ErrorFilter { + /** + * if present, means this value should be used for filtering + */ + type?: string; + /** + * if present, means this value should be used for filtering + */ + status?: number; + /** + * if present, means this value should be used for filtering + */ + instance?: string; + /** + * if present, means this value should be used for filtering + */ + title?: string; + /** + * if present, means this value should be used for filtering + */ + details?: string; [k: string]: unknown; } /** @@ -1307,7 +1370,7 @@ export interface UseCatalogs { [k: string]: Catalog; } /** - * The definition of a resource catalog + * The definition of a resource catalog. */ export interface Catalog { endpoint: Endpoint; diff --git a/src/lib/generated/schema/__internal_workflow.json b/src/lib/generated/schema/__internal_workflow.json index d33df4b..81272f1 100644 --- a/src/lib/generated/schema/__internal_workflow.json +++ b/src/lib/generated/schema/__internal_workflow.json @@ -1,5 +1,5 @@ { - "$id": "https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json", + "$id": "https://serverlessworkflow.io/schemas/1.0.0/workflow.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Serverless Workflow DSL - Workflow Schema.", "type": "object", @@ -154,6 +154,7 @@ "type": "object" }, "timeout": { + "title": "WorkflowTimeout", "oneOf": [ { "$ref": "#/$defs/timeout", @@ -165,8 +166,7 @@ "type": "string", "description": "The name of the workflow's timeout, if any." } - ], - "title": "WorkflowTimeout" + ] }, "output": { "$ref": "#/$defs/output", @@ -249,6 +249,7 @@ "type": "object" }, "timeout": { + "title": "TaskTimeout", "oneOf": [ { "$ref": "#/$defs/timeout", @@ -260,8 +261,7 @@ "type": "string", "description": "The name of the task's timeout, if any." } - ], - "title": "TaskBaseTimeout" + ] }, "then": { "$ref": "#/$defs/flowDirective", @@ -358,41 +358,101 @@ "properties": { "document": { "$ref": "#/$defs/externalResource", - "title": "WithAsyncAPIDocument", + "title": "AsyncAPIDocument", "description": "The document that defines the AsyncAPI operation to call.", "type": "object" }, - "operationRef": { + "channel": { + "type": "string", + "description": "The name of the channel on which to perform the operation. Used only in case the referenced document uses AsyncAPI v2.6.0." + }, + "operation": { "type": "string", "description": "A reference to the AsyncAPI operation to call." }, "server": { - "type": "string", - "description": "A a reference to the server to call the specified AsyncAPI operation on. If not set, default to the first server matching the operation's channel." + "$ref": "#/$defs/asyncApiServer", + "title": "AsyncAPIServer", + "description": "An object used to configure to the server to call the specified AsyncAPI operation on.", + "type": "object" }, - "message": { + "protocol": { "type": "string", - "description": "The name of the message to use. If not set, defaults to the first message defined by the operation." + "description": "The protocol to use to select the target server.", + "enum": [ + "amqp", + "amqp1", + "anypointmq", + "googlepubsub", + "http", + "ibmmq", + "jms", + "kafka", + "mercure", + "mqtt", + "mqtt5", + "nats", + "pulsar", + "redis", + "sns", + "solace", + "sqs", + "stomp", + "ws" + ] }, - "binding": { - "type": "string", - "description": "The name of the binding to use. If not set, defaults to the first binding defined by the operation." + "message": { + "$ref": "#/$defs/asyncApiOutboundMessage", + "title": "AsyncApiMessage", + "description": "An object used to configure the message to publish using the target operation.", + "type": "object" }, - "payload": { - "type": "object", - "title": "WithAsyncAPIPayload", - "description": "The payload to call the AsyncAPI operation with, if any." + "subscription": { + "$ref": "#/$defs/asyncApiSubscription", + "title": "AsyncApiSubscription", + "description": "An object used to configure the subscription to messages consumed using the target operation.", + "type": "object" }, "authentication": { "$ref": "#/$defs/referenceableAuthenticationPolicy", - "title": "WithAsyncAPIAuthentication", + "title": "AsyncAPIAuthentication", "description": "The authentication policy, if any, to use when calling the AsyncAPI operation.", "type": "object" } }, - "required": [ - "document", - "operationRef" + "oneOf": [ + { + "required": [ + "document", + "operation", + "message" + ], + "type": "object" + }, + { + "required": [ + "document", + "operation", + "subscription" + ], + "type": "object" + }, + { + "required": [ + "document", + "channel", + "message" + ], + "type": "object" + }, + { + "required": [ + "document", + "channel", + "subscription" + ], + "type": "object" + } ], "unevaluatedProperties": false } @@ -501,24 +561,24 @@ "description": "The HTTP method of the HTTP request to perform." }, "endpoint": { - "title": "WithHTTPEndpoint", + "title": "HTTPEndpoint", "description": "The HTTP endpoint to send the request to.", "$ref": "#/$defs/endpoint", "type": "object" }, "headers": { "type": "object", - "title": "WithHTTPHeaders", + "title": "HTTPHeaders", "description": "A name/value mapping of the headers, if any, of the HTTP request to perform." }, "body": { - "title": "WithHTTPBody", + "title": "HTTPBody", "description": "The body, if any, of the HTTP request to perform.", "type": "object" }, "query": { "type": "object", - "title": "WithHTTPQuery", + "title": "HTTPQuery", "description": "A name/value mapping of the query parameters, if any, of the HTTP request to perform.", "additionalProperties": true }, @@ -530,6 +590,10 @@ "content", "response" ] + }, + "redirect": { + "type": "boolean", + "description": "Specifies whether redirection status codes (`300–399`) should be treated as errors." } }, "required": [ @@ -590,6 +654,10 @@ "response" ], "description": "The http call output format. Defaults to 'content'." + }, + "redirect": { + "type": "boolean", + "description": "Specifies whether redirection status codes (`300–399`) should be treated as errors." } }, "required": [ @@ -792,11 +860,27 @@ "title": "ListenTo", "description": "Defines the event(s) to listen to.", "type": "object" + }, + "read": { + "type": "string", + "enum": [ + "data", + "envelope", + "raw" + ], + "default": "data", + "description": "Specifies how events are read during the listen operation." } }, "required": [ "to" ] + }, + "foreach": { + "$ref": "#/$defs/subscriptionIterator", + "title": "ListenIterator", + "description": "Configures the iterator, if any, for processing consumed event(s).", + "type": "object" } } }, @@ -817,6 +901,7 @@ "unevaluatedProperties": false, "properties": { "error": { + "title": "RaiseTaskError", "oneOf": [ { "$ref": "#/$defs/error", @@ -828,8 +913,7 @@ "type": "string", "description": "The name of the error to raise" } - ], - "title": "RaiseTaskRaiseError" + ] } }, "required": [ @@ -858,6 +942,18 @@ "type": "boolean", "default": true, "description": "Whether to await the process completion before continuing." + }, + "return": { + "type": "string", + "description": "Configures the output of the process.", + "enum": [ + "stdout", + "stderr", + "code", + "all", + "none" + ], + "default": "stdout" } }, "oneOf": [ @@ -875,6 +971,10 @@ "type": "string", "description": "The name of the container image to run." }, + "name": { + "type": "string", + "description": "A runtime expression, if any, used to give specific name to the container." + }, "command": { "type": "string", "description": "The command, if any, to execute on the container." @@ -893,6 +993,12 @@ "type": "object", "title": "ContainerEnvironment", "description": "A key/value mapping of the environment variables, if any, to use when running the configured process." + }, + "lifetime": { + "$ref": "#/$defs/containerLifetime", + "title": "ContainerLifetime", + "description": "An object, if any, used to configure the container's lifetime", + "type": "object" } }, "required": [ @@ -1145,7 +1251,14 @@ "errors": { "type": "object", "title": "CatchErrors", - "description": "The configuration of a concept used to catch errors." + "properties": { + "with": { + "$ref": "#/$defs/errorFilter", + "type": "object", + "title": "CatchErrorsWith" + } + }, + "description": "static error filter" }, "as": { "type": "string", @@ -1153,11 +1266,11 @@ }, "when": { "type": "string", - "description": "A runtime expression used to determine whether or not to catch the filtered error." + "description": "A runtime expression used to determine whether to catch the filtered error." }, "exceptWhen": { "type": "string", - "description": "A runtime expression used to determine whether or not to catch the filtered error." + "description": "A runtime expression used to determine whether not to catch the filtered error." }, "retry": { "oneOf": [ @@ -1725,6 +1838,34 @@ "status" ] }, + "errorFilter": { + "type": "object", + "title": "ErrorFilter", + "description": "Error filtering base on static values. For error filtering on dynamic values, use catch.when property", + "minProperties": 1, + "properties": { + "type": { + "type": "string", + "description": "if present, means this value should be used for filtering" + }, + "status": { + "type": "integer", + "description": "if present, means this value should be used for filtering" + }, + "instance": { + "type": "string", + "description": "if present, means this value should be used for filtering" + }, + "title": { + "type": "string", + "description": "if present, means this value should be used for filtering" + }, + "details": { + "type": "string", + "description": "if present, means this value should be used for filtering" + } + } + }, "uriTemplate": { "title": "UriTemplate", "anyOf": [ @@ -1854,6 +1995,19 @@ "type": "object" } ] + }, + "data": { + "title": "EventData", + "description": "The event's payload data", + "anyOf": [ + { + "$ref": "#/$defs/runtimeExpression", + "type": "object" + }, + { + "type": "object" + } + ] } }, "additionalProperties": true @@ -1891,6 +2045,31 @@ "items": { "$ref": "#/$defs/eventFilter" } + }, + "until": { + "oneOf": [ + { + "type": "string", + "description": "A runtime expression condition evaluated after consuming an event and which determines whether or not to continue listening." + }, + { + "allOf": [ + { + "$ref": "#/$defs/eventConsumptionStrategy", + "description": "The strategy that defines the event(s) to consume to stop listening.", + "type": "object" + }, + { + "properties": { + "until": false + }, + "type": "object" + } + ], + "title": "AnyEventUntilConsumed" + } + ], + "title": "AnyEventConsumptionStrategyUntil" } }, "required": [ @@ -2285,13 +2464,13 @@ "catalog": { "type": "object", "title": "Catalog", - "description": "The definition of a resource catalog", + "description": "The definition of a resource catalog.", "unevaluatedProperties": false, "properties": { "endpoint": { "$ref": "#/$defs/endpoint", "title": "CatalogEndpoint", - "description": "The root URL where the catalog is hosted", + "description": "The root URL where the catalog is hosted.", "type": "object" } }, @@ -2304,6 +2483,262 @@ "title": "RuntimeExpression", "description": "A runtime expression.", "pattern": "^\\s*\\$\\{.+\\}\\s*$" + }, + "containerLifetime": { + "type": "object", + "title": "ContainerLifetime", + "description": "The configuration of a container's lifetime", + "unevaluatedProperties": false, + "properties": { + "cleanup": { + "type": "string", + "description": "The container cleanup policy to use", + "enum": [ + "always", + "never", + "eventually" + ], + "default": "never" + }, + "after": { + "$ref": "#/$defs/duration", + "title": "ContainerLifetimeDuration", + "description": "The duration after which to cleanup the container, in case the cleanup policy has been set to 'eventually'", + "type": "object" + } + }, + "required": [ + "cleanup" + ], + "if": { + "properties": { + "cleanup": { + "const": "eventually", + "type": "object", + "title": "ContainerLifetimeCleanup" + } + } + }, + "then": { + "required": [ + "after" + ], + "type": "object", + "title": "ContainerLifetimeThen" + }, + "else": { + "not": { + "required": [ + "after" + ] + } + } + }, + "processResult": { + "type": "object", + "title": "ProcessResult", + "description": "The object returned by a run task when its return type has been set 'all'.", + "unevaluatedProperties": false, + "properties": { + "code": { + "type": "integer", + "description": "The process's exit code." + }, + "stdout": { + "type": "string", + "description": "The content of the process's STDOUT." + }, + "stderr": { + "type": "string", + "description": "The content of the process's STDERR." + } + }, + "required": [ + "code", + "stdout", + "stderr" + ] + }, + "asyncApiServer": { + "type": "object", + "title": "AsyncApiServer", + "description": "Configures the target server of an AsyncAPI operation.", + "unevaluatedProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The target server's name." + }, + "variables": { + "type": "object", + "title": "AsyncApiServerVariables", + "description": "The target server's variables, if any." + } + }, + "required": [ + "name" + ] + }, + "asyncApiOutboundMessage": { + "type": "object", + "title": "AsyncApiOutboundMessage", + "description": "An object used to configure the message to publish using the target operation.", + "unevaluatedProperties": false, + "properties": { + "payload": { + "type": "object", + "title": "AsyncApiMessagePayload", + "description": "The message's payload, if any.", + "additionalProperties": true + }, + "headers": { + "type": "object", + "title": "AsyncApiMessageHeaders", + "description": "The message's headers, if any.", + "additionalProperties": true + } + } + }, + "asyncApiInboundMessage": { + "type": "object", + "title": "AsyncApiInboundMessage", + "description": "Represents a message counsumed by an AsyncAPI subscription.", + "allOf": [ + { + "$ref": "#/$defs/asyncApiOutboundMessage", + "type": "object" + } + ], + "properties": { + "correlationId": { + "type": "string", + "description": "The message's correlation id, if any." + } + } + }, + "asyncApiSubscription": { + "type": "object", + "title": "AsyncApiSubscription", + "description": "An object used to configure the subscription to messages consumed using the target operation.", + "unevaluatedProperties": false, + "properties": { + "filter": { + "$ref": "#/$defs/runtimeExpression", + "title": "AsyncApiSubscriptionCorrelation", + "description": "A runtime expression, if any, used to filter consumed messages.", + "type": "object" + }, + "consume": { + "$ref": "#/$defs/asyncApiMessageConsumptionPolicy", + "title": "AsyncApiMessageConsumptionPolicy", + "description": "An object used to configure the subscription's message consumption policy.", + "type": "object" + }, + "foreach": { + "$ref": "#/$defs/subscriptionIterator", + "title": "AsyncApiSubscriptionIterator", + "description": "Configures the iterator, if any, for processing consumed messages(s).", + "type": "object" + } + }, + "required": [ + "consume" + ] + }, + "asyncApiMessageConsumptionPolicy": { + "type": "object", + "title": "AsyncApiMessageConsumptionPolicy", + "description": "An object used to configure a subscription's message consumption policy.", + "unevaluatedProperties": false, + "properties": { + "for": { + "$ref": "#/$defs/duration", + "title": "AsyncApiMessageConsumptionPolicyFor", + "description": "Specifies the time period over which messages will be consumed.", + "type": "object" + } + }, + "oneOf": [ + { + "properties": { + "amount": { + "type": "integer", + "description": "The amount of (filtered) messages to consume before disposing of the subscription." + } + }, + "title": "AsyncApiMessageConsumptionPolicyAmount", + "required": [ + "amount" + ], + "type": "object" + }, + { + "properties": { + "while": { + "$ref": "#/$defs/runtimeExpression", + "description": "A runtime expression evaluated after each consumed (filtered) message to decide if message consumption should continue.", + "type": "object", + "title": "AsyncApiMessageConsumptionPolicyWhileWhile" + } + }, + "title": "AsyncApiMessageConsumptionPolicyWhile", + "required": [ + "while" + ], + "type": "object" + }, + { + "properties": { + "until": { + "$ref": "#/$defs/runtimeExpression", + "description": "A runtime expression evaluated before each consumed (filtered) message to decide if message consumption should continue.", + "type": "object", + "title": "AsyncApiMessageConsumptionPolicyUntilUntil" + } + }, + "title": "AsyncApiMessageConsumptionPolicyUntil", + "required": [ + "until" + ], + "type": "object" + } + ] + }, + "subscriptionIterator": { + "type": "object", + "title": "SubscriptionIterator", + "description": "Configures the iteration over each item (event or message) consumed by a subscription.", + "unevaluatedProperties": false, + "properties": { + "item": { + "type": "string", + "description": "The name of the variable used to store the current item being enumerated.", + "default": "item" + }, + "at": { + "type": "string", + "description": "The name of the variable used to store the index of the current item being enumerated.", + "default": "index" + }, + "do": { + "$ref": "#/$defs/taskList", + "title": "SubscriptionIteratorTasks", + "description": "The tasks to perform for each consumed item.", + "type": "object" + }, + "output": { + "$ref": "#/$defs/output", + "title": "SubscriptionIteratorOutput", + "description": "An object, if any, used to customize the item's output and to document its schema.", + "type": "object" + }, + "export": { + "$ref": "#/$defs/export", + "title": "SubscriptionIteratorExport", + "description": "An object, if any, used to customize the content of the workflow context.", + "type": "object" + } + } } }, "title": "" diff --git a/src/lib/generated/schema/workflow.json b/src/lib/generated/schema/workflow.json index 59616c2..8fc3565 100644 --- a/src/lib/generated/schema/workflow.json +++ b/src/lib/generated/schema/workflow.json @@ -1,5 +1,5 @@ { - "$id": "https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json", + "$id": "https://serverlessworkflow.io/schemas/1.0.0/workflow.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Serverless Workflow DSL - Workflow Schema.", "type": "object", @@ -158,6 +158,7 @@ "description": "Defines the task(s) the workflow must perform." }, "timeout": { + "title": "DoTimeout", "oneOf": [ { "$ref": "#/$defs/timeout", @@ -246,6 +247,7 @@ "description": "Export task output to context." }, "timeout": { + "title": "TaskTimeout", "oneOf": [ { "$ref": "#/$defs/timeout", @@ -341,43 +343,95 @@ "properties": { "document": { "$ref": "#/$defs/externalResource", - "title": "WithAsyncAPIDocument", + "title": "AsyncAPIDocument", "description": "The document that defines the AsyncAPI operation to call." }, - "operationRef": { + "channel": { "type": "string", - "title": "WithAsyncAPIOperation", + "title": "With", + "description": "The name of the channel on which to perform the operation. Used only in case the referenced document uses AsyncAPI v2.6.0." + }, + "operation": { + "type": "string", + "title": "AsyncAPIOperation", "description": "A reference to the AsyncAPI operation to call." }, "server": { - "type": "string", - "title": "WithAsyncAPIServer", - "description": "A a reference to the server to call the specified AsyncAPI operation on. If not set, default to the first server matching the operation's channel." + "$ref": "#/$defs/asyncApiServer", + "title": "AsyncAPIServer", + "description": "An object used to configure to the server to call the specified AsyncAPI operation on." }, - "message": { + "protocol": { "type": "string", - "title": "WithAsyncAPIMessage", - "description": "The name of the message to use. If not set, defaults to the first message defined by the operation." + "title": "AsyncApiProtocol", + "description": "The protocol to use to select the target server.", + "enum": [ + "amqp", + "amqp1", + "anypointmq", + "googlepubsub", + "http", + "ibmmq", + "jms", + "kafka", + "mercure", + "mqtt", + "mqtt5", + "nats", + "pulsar", + "redis", + "sns", + "solace", + "sqs", + "stomp", + "ws" + ] }, - "binding": { - "type": "string", - "title": "WithAsyncAPIBinding", - "description": "The name of the binding to use. If not set, defaults to the first binding defined by the operation." + "message": { + "$ref": "#/$defs/asyncApiOutboundMessage", + "title": "AsyncApiMessage", + "description": "An object used to configure the message to publish using the target operation." }, - "payload": { - "type": "object", - "title": "WithAsyncAPIPayload", - "description": "The payload to call the AsyncAPI operation with, if any." + "subscription": { + "$ref": "#/$defs/asyncApiSubscription", + "title": "AsyncApiSubscription", + "description": "An object used to configure the subscription to messages consumed using the target operation." }, "authentication": { "$ref": "#/$defs/referenceableAuthenticationPolicy", - "title": "WithAsyncAPIAuthentication", + "title": "AsyncAPIAuthentication", "description": "The authentication policy, if any, to use when calling the AsyncAPI operation." } }, - "required": [ - "document", - "operationRef" + "oneOf": [ + { + "required": [ + "document", + "operation", + "message" + ] + }, + { + "required": [ + "document", + "operation", + "subscription" + ] + }, + { + "required": [ + "document", + "channel", + "message" + ] + }, + { + "required": [ + "document", + "channel", + "subscription" + ] + } ], "unevaluatedProperties": false } @@ -485,38 +539,43 @@ "properties": { "method": { "type": "string", - "title": "WithHTTPMethod", + "title": "HTTPMethod", "description": "The HTTP method of the HTTP request to perform." }, "endpoint": { - "title": "WithHTTPEndpoint", + "title": "HTTPEndpoint", "description": "The HTTP endpoint to send the request to.", "$ref": "#/$defs/endpoint" }, "headers": { "type": "object", - "title": "WithHTTPHeaders", + "title": "HTTPHeaders", "description": "A name/value mapping of the headers, if any, of the HTTP request to perform." }, "body": { - "title": "WithHTTPBody", + "title": "HTTPBody", "description": "The body, if any, of the HTTP request to perform." }, "query": { "type": "object", - "title": "WithHTTPQuery", + "title": "HTTPQuery", "description": "A name/value mapping of the query parameters, if any, of the HTTP request to perform.", "additionalProperties": true }, "output": { "type": "string", - "title": "WithHTTPOutput", + "title": "HTTPOutput", "description": "The http call output format. Defaults to 'content'.", "enum": [ "raw", "content", "response" ] + }, + "redirect": { + "type": "boolean", + "title": "HttpRedirect", + "description": "Specifies whether redirection status codes (`300–399`) should be treated as errors." } }, "required": [ @@ -577,6 +636,11 @@ ], "title": "WithOpenAPIOutput", "description": "The http call output format. Defaults to 'content'." + }, + "redirect": { + "type": "boolean", + "title": "HttpRedirect", + "description": "Specifies whether redirection status codes (`300–399`) should be treated as errors." } }, "required": [ @@ -779,11 +843,27 @@ "$ref": "#/$defs/eventConsumptionStrategy", "title": "ListenTo", "description": "Defines the event(s) to listen to." + }, + "read": { + "type": "string", + "enum": [ + "data", + "envelope", + "raw" + ], + "default": "data", + "title": "ListenAndReadAs", + "description": "Specifies how events are read during the listen operation." } }, "required": [ "to" ] + }, + "foreach": { + "$ref": "#/$defs/subscriptionIterator", + "title": "ListenIterator", + "description": "Configures the iterator, if any, for processing consumed event(s)." } } }, @@ -804,6 +884,7 @@ "unevaluatedProperties": false, "properties": { "error": { + "title": "RaiseTaskError", "oneOf": [ { "$ref": "#/$defs/error", @@ -845,6 +926,19 @@ "default": true, "title": "AwaitProcessCompletion", "description": "Whether to await the process completion before continuing." + }, + "return": { + "type": "string", + "title": "ProcessReturnType", + "description": "Configures the output of the process.", + "enum": [ + "stdout", + "stderr", + "code", + "all", + "none" + ], + "default": "stdout" } }, "oneOf": [ @@ -863,6 +957,11 @@ "title": "ContainerImage", "description": "The name of the container image to run." }, + "name": { + "type": "string", + "title": "ContainerName", + "description": "A runtime expression, if any, used to give specific name to the container." + }, "command": { "type": "string", "title": "ContainerCommand", @@ -882,6 +981,11 @@ "type": "object", "title": "ContainerEnvironment", "description": "A key/value mapping of the environment variables, if any, to use when running the configured process." + }, + "lifetime": { + "$ref": "#/$defs/containerLifetime", + "title": "ContainerLifetime", + "description": "An object, if any, used to configure the container's lifetime" } }, "required": [ @@ -1134,7 +1238,12 @@ "errors": { "type": "object", "title": "CatchErrors", - "description": "The configuration of a concept used to catch errors." + "properties": { + "with": { + "$ref": "#/$defs/errorFilter" + } + }, + "description": "static error filter" }, "as": { "type": "string", @@ -1144,12 +1253,12 @@ "when": { "type": "string", "title": "CatchWhen", - "description": "A runtime expression used to determine whether or not to catch the filtered error." + "description": "A runtime expression used to determine whether to catch the filtered error." }, "exceptWhen": { "type": "string", "title": "CatchExceptWhen", - "description": "A runtime expression used to determine whether or not to catch the filtered error." + "description": "A runtime expression used to determine whether not to catch the filtered error." }, "retry": { "oneOf": [ @@ -1196,6 +1305,7 @@ "description": "Represents different transition options for a workflow.", "anyOf": [ { + "title": "FlowDirectiveEnum", "type": "string", "enum": [ "continue", @@ -1714,6 +1824,34 @@ "status" ] }, + "errorFilter": { + "type": "object", + "title": "ErrorFilter", + "description": "Error filtering base on static values. For error filtering on dynamic values, use catch.when property", + "minProperties": 1, + "properties": { + "type": { + "type": "string", + "description": "if present, means this value should be used for filtering" + }, + "status": { + "type": "integer", + "description": "if present, means this value should be used for filtering" + }, + "instance": { + "type": "string", + "description": "if present, means this value should be used for filtering" + }, + "title": { + "type": "string", + "description": "if present, means this value should be used for filtering" + }, + "details": { + "type": "string", + "description": "if present, means this value should be used for filtering" + } + } + }, "uriTemplate": { "title": "UriTemplate", "anyOf": [ @@ -1840,6 +1978,16 @@ "description": "An expression based event data schema." } ] + }, + "data": { + "title": "EventData", + "description": "The event's payload data", + "anyOf": [ + { + "$ref": "#/$defs/runtimeExpression" + }, + {} + ] } }, "additionalProperties": true @@ -1876,6 +2024,29 @@ "items": { "$ref": "#/$defs/eventFilter" } + }, + "until": { + "oneOf": [ + { + "type": "string", + "title": "AnyEventUntilCondition", + "description": "A runtime expression condition evaluated after consuming an event and which determines whether or not to continue listening." + }, + { + "allOf": [ + { + "$ref": "#/$defs/eventConsumptionStrategy", + "description": "The strategy that defines the event(s) to consume to stop listening." + }, + { + "properties": { + "until": false + } + } + ], + "title": "AnyEventUntilConsumed" + } + ] } }, "required": [ @@ -2256,13 +2427,13 @@ "catalog": { "type": "object", "title": "Catalog", - "description": "The definition of a resource catalog", + "description": "The definition of a resource catalog.", "unevaluatedProperties": false, "properties": { "endpoint": { "$ref": "#/$defs/endpoint", "title": "CatalogEndpoint", - "description": "The root URL where the catalog is hosted" + "description": "The root URL where the catalog is hosted." } }, "required": [ @@ -2274,6 +2445,250 @@ "title": "RuntimeExpression", "description": "A runtime expression.", "pattern": "^\\s*\\$\\{.+\\}\\s*$" + }, + "containerLifetime": { + "type": "object", + "title": "ContainerLifetime", + "description": "The configuration of a container's lifetime", + "unevaluatedProperties": false, + "properties": { + "cleanup": { + "type": "string", + "title": "ContainerCleanupPolicy", + "description": "The container cleanup policy to use", + "enum": [ + "always", + "never", + "eventually" + ], + "default": "never" + }, + "after": { + "$ref": "#/$defs/duration", + "title": "ContainerLifetimeDuration", + "description": "The duration after which to cleanup the container, in case the cleanup policy has been set to 'eventually'" + } + }, + "required": [ + "cleanup" + ], + "if": { + "properties": { + "cleanup": { + "const": "eventually" + } + } + }, + "then": { + "required": [ + "after" + ] + }, + "else": { + "not": { + "required": [ + "after" + ] + } + } + }, + "processResult": { + "type": "object", + "title": "ProcessResult", + "description": "The object returned by a run task when its return type has been set 'all'.", + "unevaluatedProperties": false, + "properties": { + "code": { + "type": "integer", + "title": "ProcessExitCode", + "description": "The process's exit code." + }, + "stdout": { + "type": "string", + "title": "ProcessStandardOutput", + "description": "The content of the process's STDOUT." + }, + "stderr": { + "type": "string", + "title": "ProcessStandardError", + "description": "The content of the process's STDERR." + } + }, + "required": [ + "code", + "stdout", + "stderr" + ] + }, + "asyncApiServer": { + "type": "object", + "title": "AsyncApiServer", + "description": "Configures the target server of an AsyncAPI operation.", + "unevaluatedProperties": false, + "properties": { + "name": { + "type": "string", + "title": "AsyncApiServerName", + "description": "The target server's name." + }, + "variables": { + "type": "object", + "title": "AsyncApiServerVariables", + "description": "The target server's variables, if any." + } + }, + "required": [ + "name" + ] + }, + "asyncApiOutboundMessage": { + "type": "object", + "title": "AsyncApiOutboundMessage", + "description": "An object used to configure the message to publish using the target operation.", + "unevaluatedProperties": false, + "properties": { + "payload": { + "type": "object", + "title": "AsyncApiMessagePayload", + "description": "The message's payload, if any.", + "additionalProperties": true + }, + "headers": { + "type": "object", + "title": "AsyncApiMessageHeaders", + "description": "The message's headers, if any.", + "additionalProperties": true + } + } + }, + "asyncApiInboundMessage": { + "type": "object", + "title": "AsyncApiInboundMessage", + "description": "Represents a message counsumed by an AsyncAPI subscription.", + "allOf": [ + { + "$ref": "#/$defs/asyncApiOutboundMessage" + } + ], + "properties": { + "correlationId": { + "type": "string", + "title": "AsyncApiMessageCorrelationId", + "description": "The message's correlation id, if any." + } + } + }, + "asyncApiSubscription": { + "type": "object", + "title": "AsyncApiSubscription", + "description": "An object used to configure the subscription to messages consumed using the target operation.", + "unevaluatedProperties": false, + "properties": { + "filter": { + "$ref": "#/$defs/runtimeExpression", + "title": "AsyncApiSubscriptionCorrelation", + "description": "A runtime expression, if any, used to filter consumed messages." + }, + "consume": { + "$ref": "#/$defs/asyncApiMessageConsumptionPolicy", + "title": "AsyncApiMessageConsumptionPolicy", + "description": "An object used to configure the subscription's message consumption policy." + }, + "foreach": { + "$ref": "#/$defs/subscriptionIterator", + "title": "AsyncApiSubscriptionIterator", + "description": "Configures the iterator, if any, for processing consumed messages(s)." + } + }, + "required": [ + "consume" + ] + }, + "asyncApiMessageConsumptionPolicy": { + "type": "object", + "title": "AsyncApiMessageConsumptionPolicy", + "description": "An object used to configure a subscription's message consumption policy.", + "unevaluatedProperties": false, + "properties": { + "for": { + "$ref": "#/$defs/duration", + "title": "AsyncApiMessageConsumptionPolicyFor", + "description": "Specifies the time period over which messages will be consumed." + } + }, + "oneOf": [ + { + "properties": { + "amount": { + "type": "integer", + "description": "The amount of (filtered) messages to consume before disposing of the subscription." + } + }, + "title": "AsyncApiMessageConsumptionPolicyAmount", + "required": [ + "amount" + ] + }, + { + "properties": { + "while": { + "$ref": "#/$defs/runtimeExpression", + "description": "A runtime expression evaluated after each consumed (filtered) message to decide if message consumption should continue." + } + }, + "title": "AsyncApiMessageConsumptionPolicyWhile", + "required": [ + "while" + ] + }, + { + "properties": { + "until": { + "$ref": "#/$defs/runtimeExpression", + "description": "A runtime expression evaluated before each consumed (filtered) message to decide if message consumption should continue." + } + }, + "title": "AsyncApiMessageConsumptionPolicyUntil", + "required": [ + "until" + ] + } + ] + }, + "subscriptionIterator": { + "type": "object", + "title": "SubscriptionIterator", + "description": "Configures the iteration over each item (event or message) consumed by a subscription.", + "unevaluatedProperties": false, + "properties": { + "item": { + "type": "string", + "title": "SubscriptionIteratorItem", + "description": "The name of the variable used to store the current item being enumerated.", + "default": "item" + }, + "at": { + "type": "string", + "title": "SubscriptionIteratorIndex", + "description": "The name of the variable used to store the index of the current item being enumerated.", + "default": "index" + }, + "do": { + "$ref": "#/$defs/taskList", + "title": "SubscriptionIteratorTasks", + "description": "The tasks to perform for each consumed item." + }, + "output": { + "$ref": "#/$defs/output", + "title": "SubscriptionIteratorOutput", + "description": "An object, if any, used to customize the item's output and to document its schema." + }, + "export": { + "$ref": "#/$defs/export", + "title": "SubscriptionIteratorExport", + "description": "An object, if any, used to customize the content of the workflow context." + } + } } } } \ No newline at end of file diff --git a/src/lib/generated/schema/workflow.yaml b/src/lib/generated/schema/workflow.yaml index 7c53f7b..70cab19 100644 --- a/src/lib/generated/schema/workflow.yaml +++ b/src/lib/generated/schema/workflow.yaml @@ -1,4 +1,4 @@ -$id: https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.yaml +$id: https://serverlessworkflow.io/schemas/1.0.0/workflow.yaml $schema: https://json-schema.org/draft/2020-12/schema description: Serverless Workflow DSL - Workflow Schema. type: object @@ -126,6 +126,7 @@ properties: title: Do description: Defines the task(s) the workflow must perform. timeout: + title: DoTimeout oneOf: - $ref: '#/$defs/timeout' title: TimeoutDefinition @@ -201,6 +202,7 @@ $defs: title: TaskBaseExport description: Export task output to context. timeout: + title: TaskTimeout oneOf: - $ref: '#/$defs/timeout' title: TaskTimeoutDefinition @@ -259,44 +261,84 @@ $defs: properties: document: $ref: '#/$defs/externalResource' - title: WithAsyncAPIDocument + title: AsyncAPIDocument description: The document that defines the AsyncAPI operation to call. - operationRef: + channel: type: string - title: WithAsyncAPIOperation + title: With + description: >- + The name of the channel on which to perform the operation. + Used only in case the referenced document uses AsyncAPI + v2.6.0. + operation: + type: string + title: AsyncAPIOperation description: A reference to the AsyncAPI operation to call. server: - type: string - title: WithAsyncAPIServer + $ref: '#/$defs/asyncApiServer' + title: AsyncAPIServer description: >- - A a reference to the server to call the specified AsyncAPI - operation on. If not set, default to the first server matching - the operation's channel. - message: + An object used to configure to the server to call the + specified AsyncAPI operation on. + protocol: type: string - title: WithAsyncAPIMessage + title: AsyncApiProtocol + description: The protocol to use to select the target server. + enum: + - amqp + - amqp1 + - anypointmq + - googlepubsub + - http + - ibmmq + - jms + - kafka + - mercure + - mqtt + - mqtt5 + - nats + - pulsar + - redis + - sns + - solace + - sqs + - stomp + - ws + message: + $ref: '#/$defs/asyncApiOutboundMessage' + title: AsyncApiMessage description: >- - The name of the message to use. If not set, defaults to the - first message defined by the operation. - binding: - type: string - title: WithAsyncAPIBinding + An object used to configure the message to publish using the + target operation. + subscription: + $ref: '#/$defs/asyncApiSubscription' + title: AsyncApiSubscription description: >- - The name of the binding to use. If not set, defaults to the - first binding defined by the operation. - payload: - type: object - title: WithAsyncAPIPayload - description: The payload to call the AsyncAPI operation with, if any. + An object used to configure the subscription to messages + consumed using the target operation. authentication: $ref: '#/$defs/referenceableAuthenticationPolicy' - title: WithAsyncAPIAuthentication + title: AsyncAPIAuthentication description: >- The authentication policy, if any, to use when calling the AsyncAPI operation. - required: - - document - - operationRef + oneOf: + - required: + - document + - operation + - message + - required: + - document + - operation + - subscription + - required: + - document + - channel + - message + - required: + - document + - channel + - subscription unevaluatedProperties: false - title: CallGRPC description: Defines the GRPC call to perform. @@ -379,36 +421,42 @@ $defs: properties: method: type: string - title: WithHTTPMethod + title: HTTPMethod description: The HTTP method of the HTTP request to perform. endpoint: - title: WithHTTPEndpoint + title: HTTPEndpoint description: The HTTP endpoint to send the request to. $ref: '#/$defs/endpoint' headers: type: object - title: WithHTTPHeaders + title: HTTPHeaders description: >- A name/value mapping of the headers, if any, of the HTTP request to perform. body: - title: WithHTTPBody + title: HTTPBody description: The body, if any, of the HTTP request to perform. query: type: object - title: WithHTTPQuery + title: HTTPQuery description: >- A name/value mapping of the query parameters, if any, of the HTTP request to perform. additionalProperties: true output: type: string - title: WithHTTPOutput + title: HTTPOutput description: The http call output format. Defaults to 'content'. enum: - raw - content - response + redirect: + type: boolean + title: HttpRedirect + description: >- + Specifies whether redirection status codes (`300–399`) should + be treated as errors. required: - method - endpoint @@ -459,6 +507,12 @@ $defs: - response title: WithOpenAPIOutput description: The http call output format. Defaults to 'content'. + redirect: + type: boolean + title: HttpRedirect + description: >- + Specifies whether redirection status codes (`300–399`) should + be treated as errors. required: - document - operationId @@ -634,8 +688,21 @@ $defs: $ref: '#/$defs/eventConsumptionStrategy' title: ListenTo description: Defines the event(s) to listen to. + read: + type: string + enum: + - data + - envelope + - raw + default: data + title: ListenAndReadAs + description: Specifies how events are read during the listen operation. required: - to + foreach: + $ref: '#/$defs/subscriptionIterator' + title: ListenIterator + description: Configures the iterator, if any, for processing consumed event(s). raiseTask: type: object $ref: '#/$defs/taskBase' @@ -652,6 +719,7 @@ $defs: unevaluatedProperties: false properties: error: + title: RaiseTaskError oneOf: - $ref: '#/$defs/error' title: RaiseErrorDefinition @@ -683,6 +751,17 @@ $defs: default: true title: AwaitProcessCompletion description: Whether to await the process completion before continuing. + return: + type: string + title: ProcessReturnType + description: Configures the output of the process. + enum: + - stdout + - stderr + - code + - all + - none + default: stdout oneOf: - title: RunContainer description: >- @@ -699,6 +778,12 @@ $defs: type: string title: ContainerImage description: The name of the container image to run. + name: + type: string + title: ContainerName + description: >- + A runtime expression, if any, used to give specific name + to the container. command: type: string title: ContainerCommand @@ -717,6 +802,12 @@ $defs: description: >- A key/value mapping of the environment variables, if any, to use when running the configured process. + lifetime: + $ref: '#/$defs/containerLifetime' + title: ContainerLifetime + description: >- + An object, if any, used to configure the container's + lifetime required: - image required: @@ -932,7 +1023,10 @@ $defs: errors: type: object title: CatchErrors - description: The configuration of a concept used to catch errors. + properties: + with: + $ref: '#/$defs/errorFilter' + description: static error filter as: type: string title: CatchAs @@ -943,13 +1037,13 @@ $defs: type: string title: CatchWhen description: >- - A runtime expression used to determine whether or not to catch the + A runtime expression used to determine whether to catch the filtered error. exceptWhen: type: string title: CatchExceptWhen description: >- - A runtime expression used to determine whether or not to catch the + A runtime expression used to determine whether not to catch the filtered error. retry: oneOf: @@ -984,7 +1078,8 @@ $defs: title: FlowDirective description: Represents different transition options for a workflow. anyOf: - - type: string + - title: FlowDirectiveEnum + type: string enum: - continue - exit @@ -1375,6 +1470,29 @@ $defs: required: - type - status + errorFilter: + type: object + title: ErrorFilter + description: >- + Error filtering base on static values. For error filtering on dynamic + values, use catch.when property + minProperties: 1 + properties: + type: + type: string + description: if present, means this value should be used for filtering + status: + type: integer + description: if present, means this value should be used for filtering + instance: + type: string + description: if present, means this value should be used for filtering + title: + type: string + description: if present, means this value should be used for filtering + details: + type: string + description: if present, means this value should be used for filtering uriTemplate: title: UriTemplate anyOf: @@ -1462,6 +1580,12 @@ $defs: - title: ExpressionDataSchema $ref: '#/$defs/runtimeExpression' description: An expression based event data schema. + data: + title: EventData + description: The event's payload data + anyOf: + - $ref: '#/$defs/runtimeExpression' + - {} additionalProperties: true eventConsumptionStrategy: type: object @@ -1487,6 +1611,22 @@ $defs: description: A list containing any of the events to consume. items: $ref: '#/$defs/eventFilter' + until: + oneOf: + - type: string + title: AnyEventUntilCondition + description: >- + A runtime expression condition evaluated after consuming an + event and which determines whether or not to continue + listening. + - allOf: + - $ref: '#/$defs/eventConsumptionStrategy' + description: >- + The strategy that defines the event(s) to consume to stop + listening. + - properties: + until: false + title: AnyEventUntilConsumed required: - any - title: OneEventConsumptionStrategy @@ -1789,13 +1929,13 @@ $defs: catalog: type: object title: Catalog - description: The definition of a resource catalog + description: The definition of a resource catalog. unevaluatedProperties: false properties: endpoint: $ref: '#/$defs/endpoint' title: CatalogEndpoint - description: The root URL where the catalog is hosted + description: The root URL where the catalog is hosted. required: - endpoint runtimeExpression: @@ -1803,3 +1943,204 @@ $defs: title: RuntimeExpression description: A runtime expression. pattern: ^\s*\$\{.+\}\s*$ + containerLifetime: + type: object + title: ContainerLifetime + description: The configuration of a container's lifetime + unevaluatedProperties: false + properties: + cleanup: + type: string + title: ContainerCleanupPolicy + description: The container cleanup policy to use + enum: + - always + - never + - eventually + default: never + after: + $ref: '#/$defs/duration' + title: ContainerLifetimeDuration + description: >- + The duration after which to cleanup the container, in case the cleanup + policy has been set to 'eventually' + required: + - cleanup + if: + properties: + cleanup: + const: eventually + then: + required: + - after + else: + not: + required: + - after + processResult: + type: object + title: ProcessResult + description: The object returned by a run task when its return type has been set 'all'. + unevaluatedProperties: false + properties: + code: + type: integer + title: ProcessExitCode + description: The process's exit code. + stdout: + type: string + title: ProcessStandardOutput + description: The content of the process's STDOUT. + stderr: + type: string + title: ProcessStandardError + description: The content of the process's STDERR. + required: + - code + - stdout + - stderr + asyncApiServer: + type: object + title: AsyncApiServer + description: Configures the target server of an AsyncAPI operation. + unevaluatedProperties: false + properties: + name: + type: string + title: AsyncApiServerName + description: The target server's name. + variables: + type: object + title: AsyncApiServerVariables + description: The target server's variables, if any. + required: + - name + asyncApiOutboundMessage: + type: object + title: AsyncApiOutboundMessage + description: >- + An object used to configure the message to publish using the target + operation. + unevaluatedProperties: false + properties: + payload: + type: object + title: AsyncApiMessagePayload + description: The message's payload, if any. + additionalProperties: true + headers: + type: object + title: AsyncApiMessageHeaders + description: The message's headers, if any. + additionalProperties: true + asyncApiInboundMessage: + type: object + title: AsyncApiInboundMessage + description: Represents a message counsumed by an AsyncAPI subscription. + allOf: + - $ref: '#/$defs/asyncApiOutboundMessage' + properties: + correlationId: + type: string + title: AsyncApiMessageCorrelationId + description: The message's correlation id, if any. + asyncApiSubscription: + type: object + title: AsyncApiSubscription + description: >- + An object used to configure the subscription to messages consumed using + the target operation. + unevaluatedProperties: false + properties: + filter: + $ref: '#/$defs/runtimeExpression' + title: AsyncApiSubscriptionCorrelation + description: A runtime expression, if any, used to filter consumed messages. + consume: + $ref: '#/$defs/asyncApiMessageConsumptionPolicy' + title: AsyncApiMessageConsumptionPolicy + description: >- + An object used to configure the subscription's message consumption + policy. + foreach: + $ref: '#/$defs/subscriptionIterator' + title: AsyncApiSubscriptionIterator + description: Configures the iterator, if any, for processing consumed messages(s). + required: + - consume + asyncApiMessageConsumptionPolicy: + type: object + title: AsyncApiMessageConsumptionPolicy + description: An object used to configure a subscription's message consumption policy. + unevaluatedProperties: false + properties: + for: + $ref: '#/$defs/duration' + title: AsyncApiMessageConsumptionPolicyFor + description: Specifies the time period over which messages will be consumed. + oneOf: + - properties: + amount: + type: integer + description: >- + The amount of (filtered) messages to consume before disposing of + the subscription. + title: AsyncApiMessageConsumptionPolicyAmount + required: + - amount + - properties: + while: + $ref: '#/$defs/runtimeExpression' + description: >- + A runtime expression evaluated after each consumed (filtered) + message to decide if message consumption should continue. + title: AsyncApiMessageConsumptionPolicyWhile + required: + - while + - properties: + until: + $ref: '#/$defs/runtimeExpression' + description: >- + A runtime expression evaluated before each consumed (filtered) + message to decide if message consumption should continue. + title: AsyncApiMessageConsumptionPolicyUntil + required: + - until + subscriptionIterator: + type: object + title: SubscriptionIterator + description: >- + Configures the iteration over each item (event or message) consumed by a + subscription. + unevaluatedProperties: false + properties: + item: + type: string + title: SubscriptionIteratorItem + description: >- + The name of the variable used to store the current item being + enumerated. + default: item + at: + type: string + title: SubscriptionIteratorIndex + description: >- + The name of the variable used to store the index of the current item + being enumerated. + default: index + do: + $ref: '#/$defs/taskList' + title: SubscriptionIteratorTasks + description: The tasks to perform for each consumed item. + output: + $ref: '#/$defs/output' + title: SubscriptionIteratorOutput + description: >- + An object, if any, used to customize the item's output and to document + its schema. + export: + $ref: '#/$defs/export' + title: SubscriptionIteratorExport + description: >- + An object, if any, used to customize the content of the workflow + context. diff --git a/src/lib/generated/validation/validation-pointers.ts b/src/lib/generated/validation/validation-pointers.ts index 003b67f..e6ed926 100644 --- a/src/lib/generated/validation/validation-pointers.ts +++ b/src/lib/generated/validation/validation-pointers.ts @@ -24,245 +24,234 @@ * A map of type names and their corresponding schema */ export const validationPointers = { - Workflow: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#', + Workflow: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#', AllEventConsumptionStrategy: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/eventConsumptionStrategy/oneOf/0', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/eventConsumptionStrategy/oneOf/0', AllEventConsumptionStrategyConfiguration: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/eventConsumptionStrategy/oneOf/0/properties/all', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/eventConsumptionStrategy/oneOf/0/properties/all', AnyEventConsumptionStrategy: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/eventConsumptionStrategy/oneOf/1', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/eventConsumptionStrategy/oneOf/1', AnyEventConsumptionStrategyConfiguration: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/eventConsumptionStrategy/oneOf/1/properties/any', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/eventConsumptionStrategy/oneOf/1/properties/any', + AnyEventConsumptionStrategyUntil: + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/eventConsumptionStrategy/oneOf/1/properties/until', + AnyEventUntilConsumed: + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/eventConsumptionStrategy/oneOf/1/properties/until/oneOf/1', AsyncApiArguments: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask/oneOf/0/properties/with', - AuthenticationPolicy: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/authenticationPolicy', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/callTask/oneOf/0/properties/with', + AuthenticationPolicy: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/authenticationPolicy', AuthenticationPolicyReference: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/referenceableAuthenticationPolicy/oneOf/0', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/referenceableAuthenticationPolicy/oneOf/0', BasicAuthenticationPolicy: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/authenticationPolicy/oneOf/0', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/authenticationPolicy/oneOf/0', BasicAuthenticationPolicyConfiguration: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/authenticationPolicy/oneOf/0/properties/basic', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/authenticationPolicy/oneOf/0/properties/basic', BasicAuthenticationProperties: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/authenticationPolicy/oneOf/0/properties/basic/oneOf/0', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/authenticationPolicy/oneOf/0/properties/basic/oneOf/0', BearerAuthenticationPolicy: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/authenticationPolicy/oneOf/1', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/authenticationPolicy/oneOf/1', BearerAuthenticationPolicyConfiguration: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/authenticationPolicy/oneOf/1/properties/bearer', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/authenticationPolicy/oneOf/1/properties/bearer', BearerAuthenticationProperties: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/authenticationPolicy/oneOf/1/properties/bearer/oneOf/0', - CallAsyncAPI: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask/oneOf/0', - CallFunction: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask/oneOf/4', - CallGRPC: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask/oneOf/1', - CallHTTP: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask/oneOf/2', - CallOpenAPI: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask/oneOf/3', - CallTask: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask', - Catalog: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/catalog', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/authenticationPolicy/oneOf/1/properties/bearer/oneOf/0', + CallAsyncAPI: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/callTask/oneOf/0', + CallFunction: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/callTask/oneOf/4', + CallGRPC: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/callTask/oneOf/1', + CallHTTP: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/callTask/oneOf/2', + CallOpenAPI: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/callTask/oneOf/3', + CallTask: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/callTask', + Catalog: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/catalog', CatchErrors: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/tryTask/properties/catch/properties/errors', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/tryTask/properties/catch/properties/errors', ConstantBackoff: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/retryPolicy/properties/backoff/oneOf/0', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/retryPolicy/properties/backoff/oneOf/0', Container: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask/properties/run/oneOf/0/properties/container', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run/oneOf/0/properties/container', ContainerEnvironment: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask/properties/run/oneOf/0/properties/container/properties/environment', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run/oneOf/0/properties/container/properties/environment', + ContainerLifetime: + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run/oneOf/0/properties/container/properties/lifetime', ContainerPorts: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask/properties/run/oneOf/0/properties/container/properties/ports', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run/oneOf/0/properties/container/properties/ports', ContainerVolumes: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask/properties/run/oneOf/0/properties/container/properties/volumes', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run/oneOf/0/properties/container/properties/volumes', DigestAuthenticationPolicy: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/authenticationPolicy/oneOf/2', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/authenticationPolicy/oneOf/2', DigestAuthenticationPolicyConfiguration: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/authenticationPolicy/oneOf/2/properties/digest', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/authenticationPolicy/oneOf/2/properties/digest', DigestAuthenticationProperties: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/authenticationPolicy/oneOf/2/properties/digest/oneOf/0', - Document: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/properties/document', - DoTask: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/doTask', - Duration: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/duration', - DurationInline: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/duration/oneOf/0', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/authenticationPolicy/oneOf/2/properties/digest/oneOf/0', + Document: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/properties/document', + DoTask: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/doTask', + Duration: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/duration', + DurationInline: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/duration/oneOf/0', EmitEventDefinition: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/emitTask/properties/emit/properties/event', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/emitTask/properties/emit/properties/event', EmitEventWith: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/emitTask/properties/emit/properties/event/properties/with', - EmitTask: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/emitTask', - EmitTaskConfiguration: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/emitTask/properties/emit', - Endpoint: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/endpoint', - EndpointConfiguration: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/endpoint/oneOf/2', - EndpointUri: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/endpoint/oneOf/2/properties/uri', - Error: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/error', - ErrorInstance: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/error/properties/instance', - ErrorType: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/error/properties/type', - EventConsumptionStrategy: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/eventConsumptionStrategy', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/emitTask/properties/emit/properties/event/properties/with', + EmitTask: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/emitTask', + EmitTaskConfiguration: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/emitTask/properties/emit', + Endpoint: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/endpoint', + EndpointConfiguration: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/endpoint/oneOf/2', + EndpointUri: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/endpoint/oneOf/2/properties/uri', + Error: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/error', + ErrorFilter: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/errorFilter', + ErrorInstance: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/error/properties/instance', + ErrorType: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/error/properties/type', + EventConsumptionStrategy: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/eventConsumptionStrategy', + EventData: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/eventProperties/properties/data', EventDataschema: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/eventProperties/properties/dataschema', - EventFilter: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/eventFilter', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/eventProperties/properties/dataschema', + EventFilter: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/eventFilter', EventFilterCorrelate: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/eventFilter/properties/correlate', - EventSource: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/eventProperties/properties/source', - EventTime: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/eventProperties/properties/time', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/eventFilter/properties/correlate', + EventSource: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/eventProperties/properties/source', + EventTime: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/eventProperties/properties/time', ExponentialBackOff: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/retryPolicy/properties/backoff/oneOf/1', - Export: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/export', - ExportAs: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/export/properties/as', - Extension: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/extension', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/retryPolicy/properties/backoff/oneOf/1', + Export: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/export', + ExportAs: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/export/properties/as', + Extension: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/extension', ExtensionItem: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/properties/use/properties/extensions/items', - ExternalResource: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/externalResource', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/properties/use/properties/extensions/items', + ExternalResource: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/externalResource', ExternalScript: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask/properties/run/oneOf/1/properties/script/oneOf/1', - FlowDirective: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/flowDirective', - ForkTask: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/forkTask', - ForkTaskConfiguration: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/forkTask/properties/fork', - ForTask: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/forTask', - ForTaskConfiguration: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/forTask/properties/for', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run/oneOf/1/properties/script/oneOf/1', + FlowDirective: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/flowDirective', + ForkTask: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/forkTask', + ForkTaskConfiguration: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/forkTask/properties/fork', + ForTask: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/forTask', + ForTaskConfiguration: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/forTask/properties/for', FunctionArguments: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask/oneOf/4/properties/with', - GRPCArguments: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask/oneOf/1/properties/with', - HTTPArguments: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask/oneOf/2/properties/with', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/callTask/oneOf/4/properties/with', + GRPCArguments: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/callTask/oneOf/1/properties/with', + HTTPArguments: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/callTask/oneOf/2/properties/with', + HTTPBody: + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/callTask/oneOf/2/properties/with/properties/body', + HTTPHeaders: + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/callTask/oneOf/2/properties/with/properties/headers', + HTTPQuery: + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/callTask/oneOf/2/properties/with/properties/query', InlineScript: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask/properties/run/oneOf/1/properties/script/oneOf/0', - Input: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/properties/input', - InputFrom: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/input/properties/from', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run/oneOf/1/properties/script/oneOf/0', + Input: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/properties/input', + InputFrom: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/input/properties/from', LinearBackoff: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/retryPolicy/properties/backoff/oneOf/2', - ListenTask: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/listenTask', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/retryPolicy/properties/backoff/oneOf/2', + ListenTask: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/listenTask', ListenTaskConfiguration: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/listenTask/properties/listen', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/listenTask/properties/listen', OAuth2AutenthicationData: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/oauth2AuthenticationProperties', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/oauth2AuthenticationProperties', OAuth2AutenthicationDataAudiences: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/oauth2AuthenticationProperties/properties/audiences', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/oauth2AuthenticationProperties/properties/audiences', OAuth2AutenthicationDataClient: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/oauth2AuthenticationProperties/properties/client', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/oauth2AuthenticationProperties/properties/client', OAuth2AutenthicationDataScopes: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/oauth2AuthenticationProperties/properties/scopes', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/oauth2AuthenticationProperties/properties/scopes', OAuth2AuthenticationPolicy: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/authenticationPolicy/oneOf/3', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/authenticationPolicy/oneOf/3', OAuth2AuthenticationPolicyConfiguration: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/authenticationPolicy/oneOf/3/properties/oauth2', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/authenticationPolicy/oneOf/3/properties/oauth2', OAuth2AuthenticationPropertiesEndpoints: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/authenticationPolicy/oneOf/3/properties/oauth2/oneOf/0/allOf/1/properties/endpoints', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/authenticationPolicy/oneOf/3/properties/oauth2/oneOf/0/allOf/1/properties/endpoints', OAuth2ConnectAuthenticationProperties: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/authenticationPolicy/oneOf/3/properties/oauth2/oneOf/0', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/authenticationPolicy/oneOf/3/properties/oauth2/oneOf/0', OAuth2Issuers: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/oauth2AuthenticationProperties/properties/issuers', - OAuth2TokenDefinition: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/oauth2Token', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/oauth2AuthenticationProperties/properties/issuers', + OAuth2TokenDefinition: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/oauth2Token', OAuth2TokenRequest: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/oauth2AuthenticationProperties/properties/request', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/oauth2AuthenticationProperties/properties/request', OneEventConsumptionStrategy: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/eventConsumptionStrategy/oneOf/2', - OpenAPIArguments: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask/oneOf/3/properties/with', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/eventConsumptionStrategy/oneOf/2', + OpenAPIArguments: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/callTask/oneOf/3/properties/with', OpenIdConnectAuthenticationPolicy: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/authenticationPolicy/oneOf/4', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/authenticationPolicy/oneOf/4', OpenIdConnectAuthenticationPolicyConfiguration: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/authenticationPolicy/oneOf/4/properties/oidc', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/authenticationPolicy/oneOf/4/properties/oidc', OpenIdConnectAuthenticationProperties: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/authenticationPolicy/oneOf/4/properties/oidc/oneOf/0', - Output: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/properties/output', - OutputAs: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/output/properties/as', - RaiseTask: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/raiseTask', - RaiseTaskConfiguration: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/raiseTask/properties/raise', - RaiseTaskRaiseError: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/raiseTask/properties/raise/properties/error', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/authenticationPolicy/oneOf/4/properties/oidc/oneOf/0', + Output: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/properties/output', + OutputAs: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/output/properties/as', + RaiseTask: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/raiseTask', + RaiseTaskConfiguration: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/raiseTask/properties/raise', + RaiseTaskError: + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/raiseTask/properties/raise/properties/error', ReferenceableAuthenticationPolicy: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/referenceableAuthenticationPolicy', - RetryBackoff: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/retryPolicy/properties/backoff', - RetryLimit: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/retryPolicy/properties/limit', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/referenceableAuthenticationPolicy', + RetryBackoff: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/retryPolicy/properties/backoff', + RetryLimit: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/retryPolicy/properties/limit', RetryLimitAttempt: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/retryPolicy/properties/limit/properties/attempt', - RetryPolicy: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/retryPolicy', - RetryPolicyJitter: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/retryPolicy/properties/jitter', - RunContainer: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask/properties/run/oneOf/0', - RunScript: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask/properties/run/oneOf/1', - RunShell: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask/properties/run/oneOf/2', - RunTask: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask', - RunTaskConfiguration: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask/properties/run', - RuntimeExpression: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runtimeExpression', - RunWorkflow: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask/properties/run/oneOf/3', - Schedule: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/properties/schedule', - Schema: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/schema', - SchemaExternal: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/schema/oneOf/1', - SchemaInline: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/schema/oneOf/0', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/retryPolicy/properties/limit/properties/attempt', + RetryPolicy: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/retryPolicy', + RetryPolicyJitter: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/retryPolicy/properties/jitter', + RunContainer: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run/oneOf/0', + RunScript: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run/oneOf/1', + RunShell: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run/oneOf/2', + RunTask: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask', + RunTaskConfiguration: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run', + RuntimeExpression: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runtimeExpression', + RunWorkflow: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run/oneOf/3', + Schedule: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/properties/schedule', + Schema: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/schema', + SchemaExternal: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/schema/oneOf/1', + SchemaInline: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/schema/oneOf/0', Script: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask/properties/run/oneOf/1/properties/script', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run/oneOf/1/properties/script', SecretBasedAuthenticationPolicy: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/secretBasedAuthenticationPolicy', - SetTask: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/setTask', - SetTaskConfiguration: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/setTask/properties/set', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/secretBasedAuthenticationPolicy', + SetTask: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/setTask', + SetTaskConfiguration: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/setTask/properties/set', Shell: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask/properties/run/oneOf/2/properties/shell', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run/oneOf/2/properties/shell', ShellArguments: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask/properties/run/oneOf/2/properties/shell/properties/arguments', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run/oneOf/2/properties/shell/properties/arguments', ShellEnvironment: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask/properties/run/oneOf/2/properties/shell/properties/environment', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run/oneOf/2/properties/shell/properties/environment', SubflowConfiguration: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask/properties/run/oneOf/3/properties/workflow', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run/oneOf/3/properties/workflow', SubflowInput: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/runTask/properties/run/oneOf/3/properties/workflow/properties/input', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/runTask/properties/run/oneOf/3/properties/workflow/properties/input', + SubscriptionIterator: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/subscriptionIterator', SwitchCase: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/switchTask/properties/switch/items/additionalProperties', - SwitchItem: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/switchTask/properties/switch/items', - SwitchTask: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/switchTask', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/switchTask/properties/switch/items/additionalProperties', + SwitchItem: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/switchTask/properties/switch/items', + SwitchTask: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/switchTask', SwitchTaskConfiguration: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/switchTask/properties/switch', - Task: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/task', - TaskBase: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/taskBase', - TaskBaseIf: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/taskBase/properties/if', - TaskBaseTimeout: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/taskBase/properties/timeout', - TaskItem: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/taskList/items', - TaskList: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/taskList', - TaskMetadata: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/taskBase/properties/metadata', - Timeout: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/timeout', - TryTask: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/tryTask', - TryTaskCatch: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/tryTask/properties/catch', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/switchTask/properties/switch', + Task: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/task', + TaskBase: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/taskBase', + TaskBaseIf: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/taskBase/properties/if', + TaskItem: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/taskList/items', + TaskList: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/taskList', + TaskMetadata: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/taskBase/properties/metadata', + TaskTimeout: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/taskBase/properties/timeout', + Timeout: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/timeout', + TryTask: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/tryTask', + TryTaskCatch: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/tryTask/properties/catch', TryTaskCatchRetry: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/tryTask/properties/catch/properties/retry', - UriTemplate: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/uriTemplate', - Use: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/properties/use', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/tryTask/properties/catch/properties/retry', + UriTemplate: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/uriTemplate', + Use: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/properties/use', UseAuthentications: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/properties/use/properties/authentications', - UseCatalogs: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/properties/use/properties/catalogs', - UseErrors: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/properties/use/properties/errors', - UseExtensions: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/properties/use/properties/extensions', - UseFunctions: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/properties/use/properties/functions', - UseRetries: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/properties/use/properties/retries', - UseSecrets: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/properties/use/properties/secrets', - UseTimeouts: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/properties/use/properties/timeouts', - WaitTask: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/waitTask', - WithAsyncAPIPayload: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask/oneOf/0/properties/with/properties/payload', - WithEvent: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/eventFilter/properties/with', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/properties/use/properties/authentications', + UseCatalogs: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/properties/use/properties/catalogs', + UseErrors: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/properties/use/properties/errors', + UseExtensions: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/properties/use/properties/extensions', + UseFunctions: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/properties/use/properties/functions', + UseRetries: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/properties/use/properties/retries', + UseSecrets: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/properties/use/properties/secrets', + UseTimeouts: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/properties/use/properties/timeouts', + WaitTask: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/waitTask', + WithEvent: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/eventFilter/properties/with', WithGRPCArguments: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask/oneOf/1/properties/with/properties/arguments', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/callTask/oneOf/1/properties/with/properties/arguments', WithGRPCService: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask/oneOf/1/properties/with/properties/service', - WithHTTPBody: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask/oneOf/2/properties/with/properties/body', - WithHTTPHeaders: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask/oneOf/2/properties/with/properties/headers', - WithHTTPQuery: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask/oneOf/2/properties/with/properties/query', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/callTask/oneOf/1/properties/with/properties/service', WithOpenAPIParameters: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/$defs/callTask/oneOf/3/properties/with/properties/parameters', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/$defs/callTask/oneOf/3/properties/with/properties/parameters', WorkflowMetadata: - 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/properties/document/properties/metadata', - WorkflowTags: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/properties/document/properties/tags', - WorkflowTimeout: 'https://serverlessworkflow.io/schemas/1.0.0-alpha5/workflow.json#/properties/timeout', + 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/properties/document/properties/metadata', + WorkflowTags: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/properties/document/properties/tags', + WorkflowTimeout: 'https://serverlessworkflow.io/schemas/1.0.0/workflow.json#/properties/timeout', }; diff --git a/tests/builders/call-async-api-builder.spec.ts b/tests/builders/call-async-api-builder.spec.ts index 6792767..a8aac66 100644 --- a/tests/builders/call-async-api-builder.spec.ts +++ b/tests/builders/call-async-api-builder.spec.ts @@ -19,14 +19,20 @@ import { callAsyncAPIBuilder } from '../../src/lib/generated/builders'; import { Classes } from '../../src/lib/generated/classes'; const document = { endpoint: 'https://example.com', name: 'example' }; -const operationRef = 'operationRef'; +const operation = 'operationRef'; +const subscription = { + consume: { + until: '${ .condition }', + }, +}; describe('CallAsyncAPI builder', () => { it('should build with fluent api', () => { const callAsyncAPI = callAsyncAPIBuilder() .with({ document, - operationRef, + operation, + subscription, }) .build(); expect(callAsyncAPI).toBeDefined(); @@ -34,14 +40,16 @@ describe('CallAsyncAPI builder', () => { expect(callAsyncAPI.call).toBe('asyncapi'); expect(callAsyncAPI.with).toBeDefined(); expect(callAsyncAPI.with!.document).toEqual(document); - expect(callAsyncAPI.with!.operationRef).toBe(operationRef); + expect(callAsyncAPI.with!.operation).toBe(operation); + expect(callAsyncAPI.with!.subscription).toEqual(subscription); }); it('should build with input', () => { const data = { with: { document, - operationRef, + operation, + subscription, }, }; const callAsyncAPI = callAsyncAPIBuilder(data).build(); @@ -50,7 +58,8 @@ describe('CallAsyncAPI builder', () => { expect(callAsyncAPI.call).toBe('asyncapi'); expect(callAsyncAPI.with).toBeDefined(); expect(callAsyncAPI.with!.document).toEqual(document); - expect(callAsyncAPI.with!.operationRef).toBe(operationRef); + expect(callAsyncAPI.with!.operation).toBe(operation); + expect(callAsyncAPI.with!.subscription).toEqual(subscription); }); it('should throw when invalid', () => { diff --git a/tests/serialization/workflow-serialization.spec.ts b/tests/serialization/workflow-serialization.spec.ts index 903968f..38b3098 100644 --- a/tests/serialization/workflow-serialization.spec.ts +++ b/tests/serialization/workflow-serialization.spec.ts @@ -95,7 +95,7 @@ describe('Workflow (de)serialization', () => { it('should serialize as JSON from from static method from fluently built workflow', () => { const workflow = workflowBuilder() - .document(documentBuilder().dsl('1.0.0-alpha5').name('test').version('1.0.0').namespace('default').build()) + .document(documentBuilder().dsl('1.0.0').name('test').version('1.0.0').namespace('default').build()) .do( taskListBuilder() .push({ diff --git a/tools/2_generate-definitions.ts b/tools/2_generate-definitions.ts index d237cce..6e88219 100644 --- a/tools/2_generate-definitions.ts +++ b/tools/2_generate-definitions.ts @@ -98,6 +98,9 @@ function prepareSchema(schema: any, path: string[] = ['#'], parentTitle: string delete newSchema.title; schemaKeys = schemaKeys.filter((key) => key === 'title'); } + if (path.join('/') == '#/properties/timeout') { + newSchema.title = 'WorkflowTimeout'; + } if ( !newSchema.title && (!newSchema.type || newSchema.type === 'object' || newSchema.type === 'array') && // only naming object or array types @@ -109,9 +112,6 @@ function prepareSchema(schema: any, path: string[] = ['#'], parentTitle: string if (parentTitle.trim()) { const title = !isItemWithAdditionalProperties ? parent : path.includes('switch') ? 'case' : 'item'; newSchema.title = toPascalCase(`${parentTitle} ${title}`); - } - if (path.join('/') == '#/properties/timeout') { - newSchema.title = 'WorkflowTimeout'; } else { newSchema.title = toPascalCase( path