diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 7fe57b3..214ccbe 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - node-version: [10.x, 12.x, 14.x, 15.x] + node-version: [20.x, 21.x, 22.x] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/npmjs-release.yml b/.github/workflows/npmjs-release.yml index 2adee8a..6fbf07c 100644 --- a/.github/workflows/npmjs-release.yml +++ b/.github/workflows/npmjs-release.yml @@ -11,7 +11,7 @@ jobs: # Setup .npmrc file to publish to npm - uses: actions/setup-node@v2 with: - node-version: '15.x' + node-version: '20.x' registry-url: 'https://registry.npmjs.org' - run: npm ci - run: npm test diff --git a/src/lib/generated/classes/authentication-policy-basic.ts b/src/lib/generated/classes/authentication-policy-basic.ts index 3e641db..748dd1b 100644 --- a/src/lib/generated/classes/authentication-policy-basic.ts +++ b/src/lib/generated/classes/authentication-policy-basic.ts @@ -23,14 +23,14 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _AuthenticationPolicyBasic extends Hydrator { +class AuthenticationPolicyBasic extends Hydrator { constructor(model?: Partial) { super(model); } } -export const AuthenticationPolicyBasic = _AuthenticationPolicyBasic as { +export const _AuthenticationPolicyBasic = AuthenticationPolicyBasic as { new ( model?: Partial, - ): _AuthenticationPolicyBasic & Specification.AuthenticationPolicyBasic; + ): AuthenticationPolicyBasic & Specification.AuthenticationPolicyBasic; }; diff --git a/src/lib/generated/classes/authentication-policy-bearer.ts b/src/lib/generated/classes/authentication-policy-bearer.ts index fc710b6..720c806 100644 --- a/src/lib/generated/classes/authentication-policy-bearer.ts +++ b/src/lib/generated/classes/authentication-policy-bearer.ts @@ -23,14 +23,14 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _AuthenticationPolicyBearer extends Hydrator { +class AuthenticationPolicyBearer extends Hydrator { constructor(model?: Partial) { super(model); } } -export const AuthenticationPolicyBearer = _AuthenticationPolicyBearer as { +export const _AuthenticationPolicyBearer = AuthenticationPolicyBearer as { new ( model?: Partial, - ): _AuthenticationPolicyBearer & Specification.AuthenticationPolicyBearer; + ): AuthenticationPolicyBearer & Specification.AuthenticationPolicyBearer; }; diff --git a/src/lib/generated/classes/authentication-policy-oauth2-client.ts b/src/lib/generated/classes/authentication-policy-oauth2-client.ts index 5d65b2d..5020940 100644 --- a/src/lib/generated/classes/authentication-policy-oauth2-client.ts +++ b/src/lib/generated/classes/authentication-policy-oauth2-client.ts @@ -23,14 +23,14 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _AuthenticationPolicyOauth2Client extends Hydrator { +class AuthenticationPolicyOauth2Client extends Hydrator { constructor(model?: Partial) { super(model); } } -export const AuthenticationPolicyOauth2Client = _AuthenticationPolicyOauth2Client as { +export const _AuthenticationPolicyOauth2Client = AuthenticationPolicyOauth2Client as { new ( model?: Partial, - ): _AuthenticationPolicyOauth2Client & Specification.AuthenticationPolicyOauth2Client; + ): AuthenticationPolicyOauth2Client & Specification.AuthenticationPolicyOauth2Client; }; diff --git a/src/lib/generated/classes/authentication-policy-oauth2.ts b/src/lib/generated/classes/authentication-policy-oauth2.ts index 4390d74..430db7f 100644 --- a/src/lib/generated/classes/authentication-policy-oauth2.ts +++ b/src/lib/generated/classes/authentication-policy-oauth2.ts @@ -23,14 +23,14 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _AuthenticationPolicyOauth2 extends Hydrator { +class AuthenticationPolicyOauth2 extends Hydrator { constructor(model?: Partial) { super(model); } } -export const AuthenticationPolicyOauth2 = _AuthenticationPolicyOauth2 as { +export const _AuthenticationPolicyOauth2 = AuthenticationPolicyOauth2 as { new ( model?: Partial, - ): _AuthenticationPolicyOauth2 & Specification.AuthenticationPolicyOauth2; + ): AuthenticationPolicyOauth2 & Specification.AuthenticationPolicyOauth2; }; diff --git a/src/lib/generated/classes/authentication-policy.ts b/src/lib/generated/classes/authentication-policy.ts index 2deefe9..05dbc2a 100644 --- a/src/lib/generated/classes/authentication-policy.ts +++ b/src/lib/generated/classes/authentication-policy.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _AuthenticationPolicy extends Hydrator { +class AuthenticationPolicy extends Hydrator { constructor(model?: Partial) { super(model); } } -export const AuthenticationPolicy = _AuthenticationPolicy as { - new (model?: Partial): _AuthenticationPolicy & Specification.AuthenticationPolicy; +export const _AuthenticationPolicy = AuthenticationPolicy as { + new (model?: Partial): AuthenticationPolicy & Specification.AuthenticationPolicy; }; diff --git a/src/lib/generated/classes/call-async-api-with-authentication.ts b/src/lib/generated/classes/call-async-api-with-authentication.ts index 0cb6b16..33fa6ba 100644 --- a/src/lib/generated/classes/call-async-api-with-authentication.ts +++ b/src/lib/generated/classes/call-async-api-with-authentication.ts @@ -23,14 +23,14 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _CallAsyncAPIWithAuthentication extends Hydrator { +class CallAsyncAPIWithAuthentication extends Hydrator { constructor(model?: Partial) { super(model); } } -export const CallAsyncAPIWithAuthentication = _CallAsyncAPIWithAuthentication as { +export const _CallAsyncAPIWithAuthentication = CallAsyncAPIWithAuthentication as { new ( model?: Partial, - ): _CallAsyncAPIWithAuthentication & Specification.CallAsyncAPIWithAuthentication; + ): CallAsyncAPIWithAuthentication & Specification.CallAsyncAPIWithAuthentication; }; diff --git a/src/lib/generated/classes/call-async-api-with.ts b/src/lib/generated/classes/call-async-api-with.ts index 90b3817..f8b7996 100644 --- a/src/lib/generated/classes/call-async-api-with.ts +++ b/src/lib/generated/classes/call-async-api-with.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _CallAsyncAPIWith extends Hydrator { +class CallAsyncAPIWith extends Hydrator { constructor(model?: Partial) { super(model); } } -export const CallAsyncAPIWith = _CallAsyncAPIWith as { - new (model?: Partial): _CallAsyncAPIWith & Specification.CallAsyncAPIWith; +export const _CallAsyncAPIWith = CallAsyncAPIWith as { + new (model?: Partial): CallAsyncAPIWith & Specification.CallAsyncAPIWith; }; diff --git a/src/lib/generated/classes/call-async-api.ts b/src/lib/generated/classes/call-async-api.ts index 2a0d57b..d434398 100644 --- a/src/lib/generated/classes/call-async-api.ts +++ b/src/lib/generated/classes/call-async-api.ts @@ -20,15 +20,15 @@ * *****************************************************************************************/ -import { TaskBase } from './task-base'; +import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; -class _CallAsyncAPI extends TaskBase { +class CallAsyncAPI extends _TaskBase { constructor(model?: Partial) { super(model); } } -export const CallAsyncAPI = _CallAsyncAPI as { - new (model?: Partial): _CallAsyncAPI & Specification.CallAsyncAPI; +export const _CallAsyncAPI = CallAsyncAPI as { + new (model?: Partial): CallAsyncAPI & Specification.CallAsyncAPI; }; diff --git a/src/lib/generated/classes/call-function-with.ts b/src/lib/generated/classes/call-function-with.ts index 0d4c1c9..375de9f 100644 --- a/src/lib/generated/classes/call-function-with.ts +++ b/src/lib/generated/classes/call-function-with.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _CallFunctionWith extends Hydrator { +class CallFunctionWith extends Hydrator { constructor(model?: Partial) { super(model); } } -export const CallFunctionWith = _CallFunctionWith as { - new (model?: Partial): _CallFunctionWith & Specification.CallFunctionWith; +export const _CallFunctionWith = CallFunctionWith as { + new (model?: Partial): CallFunctionWith & Specification.CallFunctionWith; }; diff --git a/src/lib/generated/classes/call-function.ts b/src/lib/generated/classes/call-function.ts index 8073e13..2c64c46 100644 --- a/src/lib/generated/classes/call-function.ts +++ b/src/lib/generated/classes/call-function.ts @@ -20,15 +20,15 @@ * *****************************************************************************************/ -import { TaskBase } from './task-base'; +import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; -class _CallFunction extends TaskBase { +class CallFunction extends _TaskBase { constructor(model?: Partial) { super(model); } } -export const CallFunction = _CallFunction as { - new (model?: Partial): _CallFunction & Specification.CallFunction; +export const _CallFunction = CallFunction as { + new (model?: Partial): CallFunction & Specification.CallFunction; }; diff --git a/src/lib/generated/classes/call-grpc-with-arguments.ts b/src/lib/generated/classes/call-grpc-with-arguments.ts index 30eb483..ef21f42 100644 --- a/src/lib/generated/classes/call-grpc-with-arguments.ts +++ b/src/lib/generated/classes/call-grpc-with-arguments.ts @@ -23,14 +23,14 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _CallGRPCWithArguments extends Hydrator { +class CallGRPCWithArguments extends Hydrator { constructor(model?: Partial) { super(model); } } -export const CallGRPCWithArguments = _CallGRPCWithArguments as { +export const _CallGRPCWithArguments = CallGRPCWithArguments as { new ( model?: Partial, - ): _CallGRPCWithArguments & Specification.CallGRPCWithArguments; + ): CallGRPCWithArguments & Specification.CallGRPCWithArguments; }; diff --git a/src/lib/generated/classes/call-grpc-with-service-authentication.ts b/src/lib/generated/classes/call-grpc-with-service-authentication.ts index 4ac98da..aa8c78a 100644 --- a/src/lib/generated/classes/call-grpc-with-service-authentication.ts +++ b/src/lib/generated/classes/call-grpc-with-service-authentication.ts @@ -23,14 +23,14 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _CallGRPCWithServiceAuthentication extends Hydrator { +class CallGRPCWithServiceAuthentication extends Hydrator { constructor(model?: Partial) { super(model); } } -export const CallGRPCWithServiceAuthentication = _CallGRPCWithServiceAuthentication as { +export const _CallGRPCWithServiceAuthentication = CallGRPCWithServiceAuthentication as { new ( model?: Partial, - ): _CallGRPCWithServiceAuthentication & Specification.CallGRPCWithServiceAuthentication; + ): CallGRPCWithServiceAuthentication & Specification.CallGRPCWithServiceAuthentication; }; diff --git a/src/lib/generated/classes/call-grpc-with-service.ts b/src/lib/generated/classes/call-grpc-with-service.ts index c52bb6d..23b7aed 100644 --- a/src/lib/generated/classes/call-grpc-with-service.ts +++ b/src/lib/generated/classes/call-grpc-with-service.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _CallGRPCWithService extends Hydrator { +class CallGRPCWithService extends Hydrator { constructor(model?: Partial) { super(model); } } -export const CallGRPCWithService = _CallGRPCWithService as { - new (model?: Partial): _CallGRPCWithService & Specification.CallGRPCWithService; +export const _CallGRPCWithService = CallGRPCWithService as { + new (model?: Partial): CallGRPCWithService & Specification.CallGRPCWithService; }; diff --git a/src/lib/generated/classes/call-grpc-with.ts b/src/lib/generated/classes/call-grpc-with.ts index 32195e5..0e72dac 100644 --- a/src/lib/generated/classes/call-grpc-with.ts +++ b/src/lib/generated/classes/call-grpc-with.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _CallGRPCWith extends Hydrator { +class CallGRPCWith extends Hydrator { constructor(model?: Partial) { super(model); } } -export const CallGRPCWith = _CallGRPCWith as { - new (model?: Partial): _CallGRPCWith & Specification.CallGRPCWith; +export const _CallGRPCWith = CallGRPCWith as { + new (model?: Partial): CallGRPCWith & Specification.CallGRPCWith; }; diff --git a/src/lib/generated/classes/call-grpc.ts b/src/lib/generated/classes/call-grpc.ts index e70617c..294a42b 100644 --- a/src/lib/generated/classes/call-grpc.ts +++ b/src/lib/generated/classes/call-grpc.ts @@ -20,15 +20,15 @@ * *****************************************************************************************/ -import { TaskBase } from './task-base'; +import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; -class _CallGRPC extends TaskBase { +class CallGRPC extends _TaskBase { constructor(model?: Partial) { super(model); } } -export const CallGRPC = _CallGRPC as { - new (model?: Partial): _CallGRPC & Specification.CallGRPC; +export const _CallGRPC = CallGRPC as { + new (model?: Partial): CallGRPC & Specification.CallGRPC; }; diff --git a/src/lib/generated/classes/call-http-with-endpoint.ts b/src/lib/generated/classes/call-http-with-endpoint.ts index 6a45751..571e796 100644 --- a/src/lib/generated/classes/call-http-with-endpoint.ts +++ b/src/lib/generated/classes/call-http-with-endpoint.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _CallHTTPWithEndpoint extends Hydrator { +class CallHTTPWithEndpoint extends Hydrator { constructor(model?: Partial) { super(model); } } -export const CallHTTPWithEndpoint = _CallHTTPWithEndpoint as { - new (model?: Partial): _CallHTTPWithEndpoint & Specification.CallHTTPWithEndpoint; +export const _CallHTTPWithEndpoint = CallHTTPWithEndpoint as { + new (model?: Partial): CallHTTPWithEndpoint & Specification.CallHTTPWithEndpoint; }; diff --git a/src/lib/generated/classes/call-http-with.ts b/src/lib/generated/classes/call-http-with.ts index 5bf3d47..9eb307b 100644 --- a/src/lib/generated/classes/call-http-with.ts +++ b/src/lib/generated/classes/call-http-with.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _CallHTTPWith extends Hydrator { +class CallHTTPWith extends Hydrator { constructor(model?: Partial) { super(model); } } -export const CallHTTPWith = _CallHTTPWith as { - new (model?: Partial): _CallHTTPWith & Specification.CallHTTPWith; +export const _CallHTTPWith = CallHTTPWith as { + new (model?: Partial): CallHTTPWith & Specification.CallHTTPWith; }; diff --git a/src/lib/generated/classes/call-http.ts b/src/lib/generated/classes/call-http.ts index 8a4b9e2..38d9359 100644 --- a/src/lib/generated/classes/call-http.ts +++ b/src/lib/generated/classes/call-http.ts @@ -20,15 +20,15 @@ * *****************************************************************************************/ -import { TaskBase } from './task-base'; +import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; -class _CallHTTP extends TaskBase { +class CallHTTP extends _TaskBase { constructor(model?: Partial) { super(model); } } -export const CallHTTP = _CallHTTP as { - new (model?: Partial): _CallHTTP & Specification.CallHTTP; +export const _CallHTTP = CallHTTP as { + new (model?: Partial): CallHTTP & Specification.CallHTTP; }; diff --git a/src/lib/generated/classes/call-open-api-with-authentication.ts b/src/lib/generated/classes/call-open-api-with-authentication.ts index 01c3a2e..bf7d2d6 100644 --- a/src/lib/generated/classes/call-open-api-with-authentication.ts +++ b/src/lib/generated/classes/call-open-api-with-authentication.ts @@ -23,14 +23,14 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _CallOpenAPIWithAuthentication extends Hydrator { +class CallOpenAPIWithAuthentication extends Hydrator { constructor(model?: Partial) { super(model); } } -export const CallOpenAPIWithAuthentication = _CallOpenAPIWithAuthentication as { +export const _CallOpenAPIWithAuthentication = CallOpenAPIWithAuthentication as { new ( model?: Partial, - ): _CallOpenAPIWithAuthentication & Specification.CallOpenAPIWithAuthentication; + ): CallOpenAPIWithAuthentication & Specification.CallOpenAPIWithAuthentication; }; diff --git a/src/lib/generated/classes/call-open-api-with-parameters.ts b/src/lib/generated/classes/call-open-api-with-parameters.ts index bcf4d59..c28a8b3 100644 --- a/src/lib/generated/classes/call-open-api-with-parameters.ts +++ b/src/lib/generated/classes/call-open-api-with-parameters.ts @@ -23,14 +23,14 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _CallOpenAPIWithParameters extends Hydrator { +class CallOpenAPIWithParameters extends Hydrator { constructor(model?: Partial) { super(model); } } -export const CallOpenAPIWithParameters = _CallOpenAPIWithParameters as { +export const _CallOpenAPIWithParameters = CallOpenAPIWithParameters as { new ( model?: Partial, - ): _CallOpenAPIWithParameters & Specification.CallOpenAPIWithParameters; + ): CallOpenAPIWithParameters & Specification.CallOpenAPIWithParameters; }; diff --git a/src/lib/generated/classes/call-open-api-with.ts b/src/lib/generated/classes/call-open-api-with.ts index 2dbc3bc..890cbd5 100644 --- a/src/lib/generated/classes/call-open-api-with.ts +++ b/src/lib/generated/classes/call-open-api-with.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _CallOpenAPIWith extends Hydrator { +class CallOpenAPIWith extends Hydrator { constructor(model?: Partial) { super(model); } } -export const CallOpenAPIWith = _CallOpenAPIWith as { - new (model?: Partial): _CallOpenAPIWith & Specification.CallOpenAPIWith; +export const _CallOpenAPIWith = CallOpenAPIWith as { + new (model?: Partial): CallOpenAPIWith & Specification.CallOpenAPIWith; }; diff --git a/src/lib/generated/classes/call-open-api.ts b/src/lib/generated/classes/call-open-api.ts index 8b87cd5..9adf5be 100644 --- a/src/lib/generated/classes/call-open-api.ts +++ b/src/lib/generated/classes/call-open-api.ts @@ -20,15 +20,15 @@ * *****************************************************************************************/ -import { TaskBase } from './task-base'; +import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; -class _CallOpenAPI extends TaskBase { +class CallOpenAPI extends _TaskBase { constructor(model?: Partial) { super(model); } } -export const CallOpenAPI = _CallOpenAPI as { - new (model?: Partial): _CallOpenAPI & Specification.CallOpenAPI; +export const _CallOpenAPI = CallOpenAPI as { + new (model?: Partial): CallOpenAPI & Specification.CallOpenAPI; }; diff --git a/src/lib/generated/classes/call-task.ts b/src/lib/generated/classes/call-task.ts index 335f5bf..fbe39f4 100644 --- a/src/lib/generated/classes/call-task.ts +++ b/src/lib/generated/classes/call-task.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _CallTask extends Hydrator { +class CallTask extends Hydrator { constructor(model?: Partial) { super(model); } } -export const CallTask = _CallTask as { - new (model?: Partial): _CallTask & Specification.CallTask; +export const _CallTask = CallTask as { + new (model?: Partial): CallTask & Specification.CallTask; }; diff --git a/src/lib/generated/classes/do-task.ts b/src/lib/generated/classes/do-task.ts index a5a7aee..dd5406f 100644 --- a/src/lib/generated/classes/do-task.ts +++ b/src/lib/generated/classes/do-task.ts @@ -20,15 +20,15 @@ * *****************************************************************************************/ -import { TaskBase } from './task-base'; +import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; -class _DoTask extends TaskBase { +class DoTask extends _TaskBase { constructor(model?: Partial) { super(model); } } -export const DoTask = _DoTask as { - new (model?: Partial): _DoTask & Specification.DoTask; +export const _DoTask = DoTask as { + new (model?: Partial): DoTask & Specification.DoTask; }; diff --git a/src/lib/generated/classes/document-tags.ts b/src/lib/generated/classes/document-tags.ts index fad8b7d..323a1df 100644 --- a/src/lib/generated/classes/document-tags.ts +++ b/src/lib/generated/classes/document-tags.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _DocumentTags extends Hydrator { +class DocumentTags extends Hydrator { constructor(model?: Partial) { super(model); } } -export const DocumentTags = _DocumentTags as { - new (model?: Partial): _DocumentTags & Specification.DocumentTags; +export const _DocumentTags = DocumentTags as { + new (model?: Partial): DocumentTags & Specification.DocumentTags; }; diff --git a/src/lib/generated/classes/document.ts b/src/lib/generated/classes/document.ts index 6d21022..189f9e7 100644 --- a/src/lib/generated/classes/document.ts +++ b/src/lib/generated/classes/document.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _Document extends Hydrator { +class Document extends Hydrator { constructor(model?: Partial) { super(model); } } -export const Document = _Document as { - new (model?: Partial): _Document & Specification.Document; +export const _Document = Document as { + new (model?: Partial): Document & Specification.Document; }; diff --git a/src/lib/generated/classes/duration.ts b/src/lib/generated/classes/duration.ts index 4b91a2b..a8aef95 100644 --- a/src/lib/generated/classes/duration.ts +++ b/src/lib/generated/classes/duration.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _Duration extends Hydrator { +class Duration extends Hydrator { constructor(model?: Partial) { super(model); } } -export const Duration = _Duration as { - new (model?: Partial): _Duration & Specification.Duration; +export const _Duration = Duration as { + new (model?: Partial): Duration & Specification.Duration; }; diff --git a/src/lib/generated/classes/emit-task-emit-event.ts b/src/lib/generated/classes/emit-task-emit-event.ts index a925b6d..c39489c 100644 --- a/src/lib/generated/classes/emit-task-emit-event.ts +++ b/src/lib/generated/classes/emit-task-emit-event.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _EmitTaskEmitEvent extends Hydrator { +class EmitTaskEmitEvent extends Hydrator { constructor(model?: Partial) { super(model); } } -export const EmitTaskEmitEvent = _EmitTaskEmitEvent as { - new (model?: Partial): _EmitTaskEmitEvent & Specification.EmitTaskEmitEvent; +export const _EmitTaskEmitEvent = EmitTaskEmitEvent as { + new (model?: Partial): EmitTaskEmitEvent & Specification.EmitTaskEmitEvent; }; diff --git a/src/lib/generated/classes/emit-task-emit.ts b/src/lib/generated/classes/emit-task-emit.ts index f4fe09a..894ceab 100644 --- a/src/lib/generated/classes/emit-task-emit.ts +++ b/src/lib/generated/classes/emit-task-emit.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _EmitTaskEmit extends Hydrator { +class EmitTaskEmit extends Hydrator { constructor(model?: Partial) { super(model); } } -export const EmitTaskEmit = _EmitTaskEmit as { - new (model?: Partial): _EmitTaskEmit & Specification.EmitTaskEmit; +export const _EmitTaskEmit = EmitTaskEmit as { + new (model?: Partial): EmitTaskEmit & Specification.EmitTaskEmit; }; diff --git a/src/lib/generated/classes/emit-task.ts b/src/lib/generated/classes/emit-task.ts index 6deec45..36c5078 100644 --- a/src/lib/generated/classes/emit-task.ts +++ b/src/lib/generated/classes/emit-task.ts @@ -20,15 +20,15 @@ * *****************************************************************************************/ -import { TaskBase } from './task-base'; +import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; -class _EmitTask extends TaskBase { +class EmitTask extends _TaskBase { constructor(model?: Partial) { super(model); } } -export const EmitTask = _EmitTask as { - new (model?: Partial): _EmitTask & Specification.EmitTask; +export const _EmitTask = EmitTask as { + new (model?: Partial): EmitTask & Specification.EmitTask; }; diff --git a/src/lib/generated/classes/endpoint-authentication.ts b/src/lib/generated/classes/endpoint-authentication.ts index a185d24..44b53ec 100644 --- a/src/lib/generated/classes/endpoint-authentication.ts +++ b/src/lib/generated/classes/endpoint-authentication.ts @@ -23,14 +23,14 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _EndpointAuthentication extends Hydrator { +class EndpointAuthentication extends Hydrator { constructor(model?: Partial) { super(model); } } -export const EndpointAuthentication = _EndpointAuthentication as { +export const _EndpointAuthentication = EndpointAuthentication as { new ( model?: Partial, - ): _EndpointAuthentication & Specification.EndpointAuthentication; + ): EndpointAuthentication & Specification.EndpointAuthentication; }; diff --git a/src/lib/generated/classes/endpoint.ts b/src/lib/generated/classes/endpoint.ts index 6af8edc..1d8a738 100644 --- a/src/lib/generated/classes/endpoint.ts +++ b/src/lib/generated/classes/endpoint.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _Endpoint extends Hydrator { +class Endpoint extends Hydrator { constructor(model?: Partial) { super(model); } } -export const Endpoint = _Endpoint as { - new (model?: Partial): _Endpoint & Specification.Endpoint; +export const _Endpoint = Endpoint as { + new (model?: Partial): Endpoint & Specification.Endpoint; }; diff --git a/src/lib/generated/classes/error.ts b/src/lib/generated/classes/error.ts index 5863807..fa46759 100644 --- a/src/lib/generated/classes/error.ts +++ b/src/lib/generated/classes/error.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _Error extends Hydrator { +class Error extends Hydrator { constructor(model?: Partial) { super(model); } } -export const Error = _Error as { - new (model?: Partial): _Error & Specification.Error; +export const _Error = Error as { + new (model?: Partial): Error & Specification.Error; }; diff --git a/src/lib/generated/classes/event-consumption-strategy-all.ts b/src/lib/generated/classes/event-consumption-strategy-all.ts index 1758381..bd56a74 100644 --- a/src/lib/generated/classes/event-consumption-strategy-all.ts +++ b/src/lib/generated/classes/event-consumption-strategy-all.ts @@ -22,7 +22,7 @@ import { Specification } from '../definitions'; -export class EventConsumptionStrategyAll extends Array { +class EventConsumptionStrategyAll extends Array { constructor(model?: Array) { super(...(model || [])); if (model != null && !Array.isArray(model)) { @@ -31,3 +31,5 @@ export class EventConsumptionStrategyAll extends Array { +class EventConsumptionStrategyAny extends Array { constructor(model?: Array) { super(...(model || [])); if (model != null && !Array.isArray(model)) { @@ -31,3 +31,5 @@ export class EventConsumptionStrategyAny extends Array { +class EventConsumptionStrategy extends Hydrator { constructor(model?: Partial) { super(model); } } -export const EventConsumptionStrategy = _EventConsumptionStrategy as { +export const _EventConsumptionStrategy = EventConsumptionStrategy as { new ( model?: Partial, - ): _EventConsumptionStrategy & Specification.EventConsumptionStrategy; + ): EventConsumptionStrategy & Specification.EventConsumptionStrategy; }; diff --git a/src/lib/generated/classes/event-filter-correlate.ts b/src/lib/generated/classes/event-filter-correlate.ts index d415b78..b12dc9a 100644 --- a/src/lib/generated/classes/event-filter-correlate.ts +++ b/src/lib/generated/classes/event-filter-correlate.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _EventFilterCorrelate extends Hydrator { +class EventFilterCorrelate extends Hydrator { constructor(model?: Partial) { super(model); } } -export const EventFilterCorrelate = _EventFilterCorrelate as { - new (model?: Partial): _EventFilterCorrelate & Specification.EventFilterCorrelate; +export const _EventFilterCorrelate = EventFilterCorrelate as { + new (model?: Partial): EventFilterCorrelate & Specification.EventFilterCorrelate; }; diff --git a/src/lib/generated/classes/event-filter-with.ts b/src/lib/generated/classes/event-filter-with.ts index 05a60e7..be04506 100644 --- a/src/lib/generated/classes/event-filter-with.ts +++ b/src/lib/generated/classes/event-filter-with.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _EventFilterWith extends Hydrator { +class EventFilterWith extends Hydrator { constructor(model?: Partial) { super(model); } } -export const EventFilterWith = _EventFilterWith as { - new (model?: Partial): _EventFilterWith & Specification.EventFilterWith; +export const _EventFilterWith = EventFilterWith as { + new (model?: Partial): EventFilterWith & Specification.EventFilterWith; }; diff --git a/src/lib/generated/classes/event-filter.ts b/src/lib/generated/classes/event-filter.ts index fa04372..47b1795 100644 --- a/src/lib/generated/classes/event-filter.ts +++ b/src/lib/generated/classes/event-filter.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _EventFilter extends Hydrator { +class EventFilter extends Hydrator { constructor(model?: Partial) { super(model); } } -export const EventFilter = _EventFilter as { - new (model?: Partial): _EventFilter & Specification.EventFilter; +export const _EventFilter = EventFilter as { + new (model?: Partial): EventFilter & Specification.EventFilter; }; diff --git a/src/lib/generated/classes/export.ts b/src/lib/generated/classes/export.ts index 8bdd04d..86d7659 100644 --- a/src/lib/generated/classes/export.ts +++ b/src/lib/generated/classes/export.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _Export extends Hydrator { +class Export extends Hydrator { constructor(model?: Partial) { super(model); } } -export const Export = _Export as { - new (model?: Partial): _Export & Specification.Export; +export const _Export = Export as { + new (model?: Partial): Export & Specification.Export; }; diff --git a/src/lib/generated/classes/extension.ts b/src/lib/generated/classes/extension.ts index 7a45fad..1d0d89c 100644 --- a/src/lib/generated/classes/extension.ts +++ b/src/lib/generated/classes/extension.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _Extension extends Hydrator { +class Extension extends Hydrator { constructor(model?: Partial) { super(model); } } -export const Extension = _Extension as { - new (model?: Partial): _Extension & Specification.Extension; +export const _Extension = Extension as { + new (model?: Partial): Extension & Specification.Extension; }; diff --git a/src/lib/generated/classes/external-resource-authentication.ts b/src/lib/generated/classes/external-resource-authentication.ts index 0dacfbd..0268e14 100644 --- a/src/lib/generated/classes/external-resource-authentication.ts +++ b/src/lib/generated/classes/external-resource-authentication.ts @@ -23,14 +23,14 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _ExternalResourceAuthentication extends Hydrator { +class ExternalResourceAuthentication extends Hydrator { constructor(model?: Partial) { super(model); } } -export const ExternalResourceAuthentication = _ExternalResourceAuthentication as { +export const _ExternalResourceAuthentication = ExternalResourceAuthentication as { new ( model?: Partial, - ): _ExternalResourceAuthentication & Specification.ExternalResourceAuthentication; + ): ExternalResourceAuthentication & Specification.ExternalResourceAuthentication; }; diff --git a/src/lib/generated/classes/external-resource.ts b/src/lib/generated/classes/external-resource.ts index 926aa15..a4fc64d 100644 --- a/src/lib/generated/classes/external-resource.ts +++ b/src/lib/generated/classes/external-resource.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _ExternalResource extends Hydrator { +class ExternalResource extends Hydrator { constructor(model?: Partial) { super(model); } } -export const ExternalResource = _ExternalResource as { - new (model?: Partial): _ExternalResource & Specification.ExternalResource; +export const _ExternalResource = ExternalResource as { + new (model?: Partial): ExternalResource & Specification.ExternalResource; }; diff --git a/src/lib/generated/classes/flow-directive.ts b/src/lib/generated/classes/flow-directive.ts index e1e3886..f56c63a 100644 --- a/src/lib/generated/classes/flow-directive.ts +++ b/src/lib/generated/classes/flow-directive.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _FlowDirective extends Hydrator { +class FlowDirective extends Hydrator { constructor(model?: Partial) { super(model); } } -export const FlowDirective = _FlowDirective as { - new (model?: Partial): _FlowDirective & Specification.FlowDirective; +export const _FlowDirective = FlowDirective as { + new (model?: Partial): FlowDirective & Specification.FlowDirective; }; diff --git a/src/lib/generated/classes/for-task-for.ts b/src/lib/generated/classes/for-task-for.ts index 48807dd..0fa58d4 100644 --- a/src/lib/generated/classes/for-task-for.ts +++ b/src/lib/generated/classes/for-task-for.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _ForTaskFor extends Hydrator { +class ForTaskFor extends Hydrator { constructor(model?: Partial) { super(model); } } -export const ForTaskFor = _ForTaskFor as { - new (model?: Partial): _ForTaskFor & Specification.ForTaskFor; +export const _ForTaskFor = ForTaskFor as { + new (model?: Partial): ForTaskFor & Specification.ForTaskFor; }; diff --git a/src/lib/generated/classes/for-task.ts b/src/lib/generated/classes/for-task.ts index b7023ae..625f728 100644 --- a/src/lib/generated/classes/for-task.ts +++ b/src/lib/generated/classes/for-task.ts @@ -20,15 +20,15 @@ * *****************************************************************************************/ -import { TaskBase } from './task-base'; +import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; -class _ForTask extends TaskBase { +class ForTask extends _TaskBase { constructor(model?: Partial) { super(model); } } -export const ForTask = _ForTask as { - new (model?: Partial): _ForTask & Specification.ForTask; +export const _ForTask = ForTask as { + new (model?: Partial): ForTask & Specification.ForTask; }; diff --git a/src/lib/generated/classes/fork-task-fork.ts b/src/lib/generated/classes/fork-task-fork.ts index bd12f53..c28a05d 100644 --- a/src/lib/generated/classes/fork-task-fork.ts +++ b/src/lib/generated/classes/fork-task-fork.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _ForkTaskFork extends Hydrator { +class ForkTaskFork extends Hydrator { constructor(model?: Partial) { super(model); } } -export const ForkTaskFork = _ForkTaskFork as { - new (model?: Partial): _ForkTaskFork & Specification.ForkTaskFork; +export const _ForkTaskFork = ForkTaskFork as { + new (model?: Partial): ForkTaskFork & Specification.ForkTaskFork; }; diff --git a/src/lib/generated/classes/fork-task.ts b/src/lib/generated/classes/fork-task.ts index b0cd0a7..89d3ff1 100644 --- a/src/lib/generated/classes/fork-task.ts +++ b/src/lib/generated/classes/fork-task.ts @@ -20,15 +20,15 @@ * *****************************************************************************************/ -import { TaskBase } from './task-base'; +import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; -class _ForkTask extends TaskBase { +class ForkTask extends _TaskBase { constructor(model?: Partial) { super(model); } } -export const ForkTask = _ForkTask as { - new (model?: Partial): _ForkTask & Specification.ForkTask; +export const _ForkTask = ForkTask as { + new (model?: Partial): ForkTask & Specification.ForkTask; }; diff --git a/src/lib/generated/classes/index.ts b/src/lib/generated/classes/index.ts index 3516cc4..a2e79ea 100644 --- a/src/lib/generated/classes/index.ts +++ b/src/lib/generated/classes/index.ts @@ -14,186 +14,186 @@ * limitations under the License. */ -import { Schema } from './schema'; -import { ExternalResource } from './external-resource'; -import { ExternalResourceAuthentication } from './external-resource-authentication'; -import { AuthenticationPolicy } from './authentication-policy'; -import { Task } from './task'; -import { CallTask } from './call-task'; -import { CallAsyncAPI } from './call-async-api'; -import { FlowDirective } from './flow-directive'; -import { CallAsyncAPIWithAuthentication } from './call-async-api-with-authentication'; -import { CallGRPC } from './call-grpc'; -import { CallGRPCWithServiceAuthentication } from './call-grpc-with-service-authentication'; -import { CallHTTP } from './call-http'; -import { CallHTTPWithEndpoint } from './call-http-with-endpoint'; -import { EndpointAuthentication } from './endpoint-authentication'; -import { CallOpenAPI } from './call-open-api'; -import { CallOpenAPIWithAuthentication } from './call-open-api-with-authentication'; -import { CallFunction } from './call-function'; -import { DoTask } from './do-task'; -import { ForkTask } from './fork-task'; -import { EmitTask } from './emit-task'; -import { ForTask } from './for-task'; -import { ListenTask } from './listen-task'; -import { EventConsumptionStrategy } from './event-consumption-strategy'; -import { EventConsumptionStrategyAll } from './event-consumption-strategy-all'; -import { EventConsumptionStrategyAny } from './event-consumption-strategy-any'; -import { RaiseTask } from './raise-task'; -import { RunTask } from './run-task'; -import { RunTaskRun } from './run-task-run'; -import { RunTaskRunScript } from './run-task-run-script'; -import { SetTask } from './set-task'; -import { SwitchTask } from './switch-task'; -import { SwitchTaskSwitch } from './switch-task-switch'; -import { TryTask } from './try-task'; -import { RetryPolicyBackoff } from './retry-policy-backoff'; -import { WaitTask } from './wait-task'; -import { TaskList } from './task-list'; -import { UseExtensions } from './use-extensions'; -import { Workflow } from './workflow'; -import { Document } from './document'; -import { DocumentTags } from './document-tags'; -import { Input } from './input'; -import { AuthenticationPolicyBasic } from './authentication-policy-basic'; -import { AuthenticationPolicyBearer } from './authentication-policy-bearer'; -import { AuthenticationPolicyOauth2 } from './authentication-policy-oauth2'; -import { AuthenticationPolicyOauth2Client } from './authentication-policy-oauth2-client'; -import { Oauth2Token } from './oauth2-token'; -import { Use } from './use'; -import { UseAuthentications } from './use-authentications'; -import { UseErrors } from './use-errors'; -import { Error } from './error'; -import { Extension } from './extension'; -import { TaskBase } from './task-base'; -import { Output } from './output'; -import { Export } from './export'; -import { Timeout } from './timeout'; -import { Duration } from './duration'; -import { CallAsyncAPIWith } from './call-async-api-with'; -import { CallGRPCWith } from './call-grpc-with'; -import { CallGRPCWithService } from './call-grpc-with-service'; -import { CallGRPCWithArguments } from './call-grpc-with-arguments'; -import { CallHTTPWith } from './call-http-with'; -import { Endpoint } from './endpoint'; -import { CallOpenAPIWith } from './call-open-api-with'; -import { CallOpenAPIWithParameters } from './call-open-api-with-parameters'; -import { CallFunctionWith } from './call-function-with'; -import { ForkTaskFork } from './fork-task-fork'; -import { EmitTaskEmit } from './emit-task-emit'; -import { EmitTaskEmitEvent } from './emit-task-emit-event'; -import { ForTaskFor } from './for-task-for'; -import { ListenTaskListen } from './listen-task-listen'; -import { EventFilter } from './event-filter'; -import { EventFilterWith } from './event-filter-with'; -import { EventFilterCorrelate } from './event-filter-correlate'; -import { RaiseTaskRaise } from './raise-task-raise'; -import { RunTaskRunContainer } from './run-task-run-container'; -import { RunTaskRunShell } from './run-task-run-shell'; -import { RunTaskRunShellArguments } from './run-task-run-shell-arguments'; -import { RunTaskRunShellEnvironment } from './run-task-run-shell-environment'; -import { RunTaskRunWorkflow } from './run-task-run-workflow'; -import { RunTaskRunWorkflowInput } from './run-task-run-workflow-input'; -import { SetTaskSet } from './set-task-set'; -import { SwitchTaskSwitchCase } from './switch-task-switch-case'; -import { TryTaskCatch } from './try-task-catch'; -import { RetryPolicy } from './retry-policy'; -import { RetryPolicyLimit } from './retry-policy-limit'; -import { RetryPolicyLimitAttempt } from './retry-policy-limit-attempt'; -import { RetryPolicyJitter } from './retry-policy-jitter'; -import { UseFunctions } from './use-functions'; -import { UseRetries } from './use-retries'; -import { Schedule } from './schedule'; +import { _Schema } from './schema'; +import { _ExternalResource } from './external-resource'; +import { _ExternalResourceAuthentication } from './external-resource-authentication'; +import { _AuthenticationPolicy } from './authentication-policy'; +import { _Task } from './task'; +import { _CallTask } from './call-task'; +import { _CallAsyncAPI } from './call-async-api'; +import { _FlowDirective } from './flow-directive'; +import { _CallAsyncAPIWithAuthentication } from './call-async-api-with-authentication'; +import { _CallGRPC } from './call-grpc'; +import { _CallGRPCWithServiceAuthentication } from './call-grpc-with-service-authentication'; +import { _CallHTTP } from './call-http'; +import { _CallHTTPWithEndpoint } from './call-http-with-endpoint'; +import { _EndpointAuthentication } from './endpoint-authentication'; +import { _CallOpenAPI } from './call-open-api'; +import { _CallOpenAPIWithAuthentication } from './call-open-api-with-authentication'; +import { _CallFunction } from './call-function'; +import { _DoTask } from './do-task'; +import { _ForkTask } from './fork-task'; +import { _EmitTask } from './emit-task'; +import { _ForTask } from './for-task'; +import { _ListenTask } from './listen-task'; +import { _EventConsumptionStrategy } from './event-consumption-strategy'; +import { _EventConsumptionStrategyAll } from './event-consumption-strategy-all'; +import { _EventConsumptionStrategyAny } from './event-consumption-strategy-any'; +import { _RaiseTask } from './raise-task'; +import { _RunTask } from './run-task'; +import { _RunTaskRun } from './run-task-run'; +import { _RunTaskRunScript } from './run-task-run-script'; +import { _SetTask } from './set-task'; +import { _SwitchTask } from './switch-task'; +import { _SwitchTaskSwitch } from './switch-task-switch'; +import { _TryTask } from './try-task'; +import { _RetryPolicyBackoff } from './retry-policy-backoff'; +import { _WaitTask } from './wait-task'; +import { _TaskList } from './task-list'; +import { _UseExtensions } from './use-extensions'; +import { _Workflow } from './workflow'; +import { _Document } from './document'; +import { _DocumentTags } from './document-tags'; +import { _Input } from './input'; +import { _AuthenticationPolicyBasic } from './authentication-policy-basic'; +import { _AuthenticationPolicyBearer } from './authentication-policy-bearer'; +import { _AuthenticationPolicyOauth2 } from './authentication-policy-oauth2'; +import { _AuthenticationPolicyOauth2Client } from './authentication-policy-oauth2-client'; +import { _Oauth2Token } from './oauth2-token'; +import { _Use } from './use'; +import { _UseAuthentications } from './use-authentications'; +import { _UseErrors } from './use-errors'; +import { _Error } from './error'; +import { _Extension } from './extension'; +import { _TaskBase } from './task-base'; +import { _Output } from './output'; +import { _Export } from './export'; +import { _Timeout } from './timeout'; +import { _Duration } from './duration'; +import { _CallAsyncAPIWith } from './call-async-api-with'; +import { _CallGRPCWith } from './call-grpc-with'; +import { _CallGRPCWithService } from './call-grpc-with-service'; +import { _CallGRPCWithArguments } from './call-grpc-with-arguments'; +import { _CallHTTPWith } from './call-http-with'; +import { _Endpoint } from './endpoint'; +import { _CallOpenAPIWith } from './call-open-api-with'; +import { _CallOpenAPIWithParameters } from './call-open-api-with-parameters'; +import { _CallFunctionWith } from './call-function-with'; +import { _ForkTaskFork } from './fork-task-fork'; +import { _EmitTaskEmit } from './emit-task-emit'; +import { _EmitTaskEmitEvent } from './emit-task-emit-event'; +import { _ForTaskFor } from './for-task-for'; +import { _ListenTaskListen } from './listen-task-listen'; +import { _EventFilter } from './event-filter'; +import { _EventFilterWith } from './event-filter-with'; +import { _EventFilterCorrelate } from './event-filter-correlate'; +import { _RaiseTaskRaise } from './raise-task-raise'; +import { _RunTaskRunContainer } from './run-task-run-container'; +import { _RunTaskRunShell } from './run-task-run-shell'; +import { _RunTaskRunShellArguments } from './run-task-run-shell-arguments'; +import { _RunTaskRunShellEnvironment } from './run-task-run-shell-environment'; +import { _RunTaskRunWorkflow } from './run-task-run-workflow'; +import { _RunTaskRunWorkflowInput } from './run-task-run-workflow-input'; +import { _SetTaskSet } from './set-task-set'; +import { _SwitchTaskSwitchCase } from './switch-task-switch-case'; +import { _TryTaskCatch } from './try-task-catch'; +import { _RetryPolicy } from './retry-policy'; +import { _RetryPolicyLimit } from './retry-policy-limit'; +import { _RetryPolicyLimitAttempt } from './retry-policy-limit-attempt'; +import { _RetryPolicyJitter } from './retry-policy-jitter'; +import { _UseFunctions } from './use-functions'; +import { _UseRetries } from './use-retries'; +import { _Schedule } from './schedule'; export const Classes = { - Schema, - ExternalResource, - ExternalResourceAuthentication, - AuthenticationPolicy, - Task, - CallTask, - CallAsyncAPI, - FlowDirective, - CallAsyncAPIWithAuthentication, - CallGRPC, - CallGRPCWithServiceAuthentication, - CallHTTP, - CallHTTPWithEndpoint, - EndpointAuthentication, - CallOpenAPI, - CallOpenAPIWithAuthentication, - CallFunction, - DoTask, - ForkTask, - EmitTask, - ForTask, - ListenTask, - EventConsumptionStrategy, - EventConsumptionStrategyAll, - EventConsumptionStrategyAny, - RaiseTask, - RunTask, - RunTaskRun, - RunTaskRunScript, - SetTask, - SwitchTask, - SwitchTaskSwitch, - TryTask, - RetryPolicyBackoff, - WaitTask, - TaskList, - UseExtensions, - Workflow, - Document, - DocumentTags, - Input, - AuthenticationPolicyBasic, - AuthenticationPolicyBearer, - AuthenticationPolicyOauth2, - AuthenticationPolicyOauth2Client, - Oauth2Token, - Use, - UseAuthentications, - UseErrors, - Error, - Extension, - TaskBase, - Output, - Export, - Timeout, - Duration, - CallAsyncAPIWith, - CallGRPCWith, - CallGRPCWithService, - CallGRPCWithArguments, - CallHTTPWith, - Endpoint, - CallOpenAPIWith, - CallOpenAPIWithParameters, - CallFunctionWith, - ForkTaskFork, - EmitTaskEmit, - EmitTaskEmitEvent, - ForTaskFor, - ListenTaskListen, - EventFilter, - EventFilterWith, - EventFilterCorrelate, - RaiseTaskRaise, - RunTaskRunContainer, - RunTaskRunShell, - RunTaskRunShellArguments, - RunTaskRunShellEnvironment, - RunTaskRunWorkflow, - RunTaskRunWorkflowInput, - SetTaskSet, - SwitchTaskSwitchCase, - TryTaskCatch, - RetryPolicy, - RetryPolicyLimit, - RetryPolicyLimitAttempt, - RetryPolicyJitter, - UseFunctions, - UseRetries, - Schedule, + Schema: _Schema, + ExternalResource: _ExternalResource, + ExternalResourceAuthentication: _ExternalResourceAuthentication, + AuthenticationPolicy: _AuthenticationPolicy, + Task: _Task, + CallTask: _CallTask, + CallAsyncAPI: _CallAsyncAPI, + FlowDirective: _FlowDirective, + CallAsyncAPIWithAuthentication: _CallAsyncAPIWithAuthentication, + CallGRPC: _CallGRPC, + CallGRPCWithServiceAuthentication: _CallGRPCWithServiceAuthentication, + CallHTTP: _CallHTTP, + CallHTTPWithEndpoint: _CallHTTPWithEndpoint, + EndpointAuthentication: _EndpointAuthentication, + CallOpenAPI: _CallOpenAPI, + CallOpenAPIWithAuthentication: _CallOpenAPIWithAuthentication, + CallFunction: _CallFunction, + DoTask: _DoTask, + ForkTask: _ForkTask, + EmitTask: _EmitTask, + ForTask: _ForTask, + ListenTask: _ListenTask, + EventConsumptionStrategy: _EventConsumptionStrategy, + EventConsumptionStrategyAll: _EventConsumptionStrategyAll, + EventConsumptionStrategyAny: _EventConsumptionStrategyAny, + RaiseTask: _RaiseTask, + RunTask: _RunTask, + RunTaskRun: _RunTaskRun, + RunTaskRunScript: _RunTaskRunScript, + SetTask: _SetTask, + SwitchTask: _SwitchTask, + SwitchTaskSwitch: _SwitchTaskSwitch, + TryTask: _TryTask, + RetryPolicyBackoff: _RetryPolicyBackoff, + WaitTask: _WaitTask, + TaskList: _TaskList, + UseExtensions: _UseExtensions, + Workflow: _Workflow, + Document: _Document, + DocumentTags: _DocumentTags, + Input: _Input, + AuthenticationPolicyBasic: _AuthenticationPolicyBasic, + AuthenticationPolicyBearer: _AuthenticationPolicyBearer, + AuthenticationPolicyOauth2: _AuthenticationPolicyOauth2, + AuthenticationPolicyOauth2Client: _AuthenticationPolicyOauth2Client, + Oauth2Token: _Oauth2Token, + Use: _Use, + UseAuthentications: _UseAuthentications, + UseErrors: _UseErrors, + Error: _Error, + Extension: _Extension, + TaskBase: _TaskBase, + Output: _Output, + Export: _Export, + Timeout: _Timeout, + Duration: _Duration, + CallAsyncAPIWith: _CallAsyncAPIWith, + CallGRPCWith: _CallGRPCWith, + CallGRPCWithService: _CallGRPCWithService, + CallGRPCWithArguments: _CallGRPCWithArguments, + CallHTTPWith: _CallHTTPWith, + Endpoint: _Endpoint, + CallOpenAPIWith: _CallOpenAPIWith, + CallOpenAPIWithParameters: _CallOpenAPIWithParameters, + CallFunctionWith: _CallFunctionWith, + ForkTaskFork: _ForkTaskFork, + EmitTaskEmit: _EmitTaskEmit, + EmitTaskEmitEvent: _EmitTaskEmitEvent, + ForTaskFor: _ForTaskFor, + ListenTaskListen: _ListenTaskListen, + EventFilter: _EventFilter, + EventFilterWith: _EventFilterWith, + EventFilterCorrelate: _EventFilterCorrelate, + RaiseTaskRaise: _RaiseTaskRaise, + RunTaskRunContainer: _RunTaskRunContainer, + RunTaskRunShell: _RunTaskRunShell, + RunTaskRunShellArguments: _RunTaskRunShellArguments, + RunTaskRunShellEnvironment: _RunTaskRunShellEnvironment, + RunTaskRunWorkflow: _RunTaskRunWorkflow, + RunTaskRunWorkflowInput: _RunTaskRunWorkflowInput, + SetTaskSet: _SetTaskSet, + SwitchTaskSwitchCase: _SwitchTaskSwitchCase, + TryTaskCatch: _TryTaskCatch, + RetryPolicy: _RetryPolicy, + RetryPolicyLimit: _RetryPolicyLimit, + RetryPolicyLimitAttempt: _RetryPolicyLimitAttempt, + RetryPolicyJitter: _RetryPolicyJitter, + UseFunctions: _UseFunctions, + UseRetries: _UseRetries, + Schedule: _Schedule, }; diff --git a/src/lib/generated/classes/input.ts b/src/lib/generated/classes/input.ts index f84d300..21ad9b2 100644 --- a/src/lib/generated/classes/input.ts +++ b/src/lib/generated/classes/input.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _Input extends Hydrator { +class Input extends Hydrator { constructor(model?: Partial) { super(model); } } -export const Input = _Input as { - new (model?: Partial): _Input & Specification.Input; +export const _Input = Input as { + new (model?: Partial): Input & Specification.Input; }; diff --git a/src/lib/generated/classes/listen-task-listen.ts b/src/lib/generated/classes/listen-task-listen.ts index 8acfcc0..ab71ad3 100644 --- a/src/lib/generated/classes/listen-task-listen.ts +++ b/src/lib/generated/classes/listen-task-listen.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _ListenTaskListen extends Hydrator { +class ListenTaskListen extends Hydrator { constructor(model?: Partial) { super(model); } } -export const ListenTaskListen = _ListenTaskListen as { - new (model?: Partial): _ListenTaskListen & Specification.ListenTaskListen; +export const _ListenTaskListen = ListenTaskListen as { + new (model?: Partial): ListenTaskListen & Specification.ListenTaskListen; }; diff --git a/src/lib/generated/classes/listen-task.ts b/src/lib/generated/classes/listen-task.ts index 06a5b5e..59ff1f9 100644 --- a/src/lib/generated/classes/listen-task.ts +++ b/src/lib/generated/classes/listen-task.ts @@ -20,15 +20,15 @@ * *****************************************************************************************/ -import { TaskBase } from './task-base'; +import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; -class _ListenTask extends TaskBase { +class ListenTask extends _TaskBase { constructor(model?: Partial) { super(model); } } -export const ListenTask = _ListenTask as { - new (model?: Partial): _ListenTask & Specification.ListenTask; +export const _ListenTask = ListenTask as { + new (model?: Partial): ListenTask & Specification.ListenTask; }; diff --git a/src/lib/generated/classes/oauth2-token.ts b/src/lib/generated/classes/oauth2-token.ts index 64110cc..7044e54 100644 --- a/src/lib/generated/classes/oauth2-token.ts +++ b/src/lib/generated/classes/oauth2-token.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _Oauth2Token extends Hydrator { +class Oauth2Token extends Hydrator { constructor(model?: Partial) { super(model); } } -export const Oauth2Token = _Oauth2Token as { - new (model?: Partial): _Oauth2Token & Specification.Oauth2Token; +export const _Oauth2Token = Oauth2Token as { + new (model?: Partial): Oauth2Token & Specification.Oauth2Token; }; diff --git a/src/lib/generated/classes/output.ts b/src/lib/generated/classes/output.ts index 5540910..ac72b76 100644 --- a/src/lib/generated/classes/output.ts +++ b/src/lib/generated/classes/output.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _Output extends Hydrator { +class Output extends Hydrator { constructor(model?: Partial) { super(model); } } -export const Output = _Output as { - new (model?: Partial): _Output & Specification.Output; +export const _Output = Output as { + new (model?: Partial): Output & Specification.Output; }; diff --git a/src/lib/generated/classes/raise-task-raise.ts b/src/lib/generated/classes/raise-task-raise.ts index a06f204..4d1e62c 100644 --- a/src/lib/generated/classes/raise-task-raise.ts +++ b/src/lib/generated/classes/raise-task-raise.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _RaiseTaskRaise extends Hydrator { +class RaiseTaskRaise extends Hydrator { constructor(model?: Partial) { super(model); } } -export const RaiseTaskRaise = _RaiseTaskRaise as { - new (model?: Partial): _RaiseTaskRaise & Specification.RaiseTaskRaise; +export const _RaiseTaskRaise = RaiseTaskRaise as { + new (model?: Partial): RaiseTaskRaise & Specification.RaiseTaskRaise; }; diff --git a/src/lib/generated/classes/raise-task.ts b/src/lib/generated/classes/raise-task.ts index 84a8f17..46fa3e2 100644 --- a/src/lib/generated/classes/raise-task.ts +++ b/src/lib/generated/classes/raise-task.ts @@ -20,15 +20,15 @@ * *****************************************************************************************/ -import { TaskBase } from './task-base'; +import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; -class _RaiseTask extends TaskBase { +class RaiseTask extends _TaskBase { constructor(model?: Partial) { super(model); } } -export const RaiseTask = _RaiseTask as { - new (model?: Partial): _RaiseTask & Specification.RaiseTask; +export const _RaiseTask = RaiseTask as { + new (model?: Partial): RaiseTask & Specification.RaiseTask; }; diff --git a/src/lib/generated/classes/retry-policy-backoff.ts b/src/lib/generated/classes/retry-policy-backoff.ts index cf30c77..961e3df 100644 --- a/src/lib/generated/classes/retry-policy-backoff.ts +++ b/src/lib/generated/classes/retry-policy-backoff.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _RetryPolicyBackoff extends Hydrator { +class RetryPolicyBackoff extends Hydrator { constructor(model?: Partial) { super(model); } } -export const RetryPolicyBackoff = _RetryPolicyBackoff as { - new (model?: Partial): _RetryPolicyBackoff & Specification.RetryPolicyBackoff; +export const _RetryPolicyBackoff = RetryPolicyBackoff as { + new (model?: Partial): RetryPolicyBackoff & Specification.RetryPolicyBackoff; }; diff --git a/src/lib/generated/classes/retry-policy-jitter.ts b/src/lib/generated/classes/retry-policy-jitter.ts index c58e367..0ad8626 100644 --- a/src/lib/generated/classes/retry-policy-jitter.ts +++ b/src/lib/generated/classes/retry-policy-jitter.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _RetryPolicyJitter extends Hydrator { +class RetryPolicyJitter extends Hydrator { constructor(model?: Partial) { super(model); } } -export const RetryPolicyJitter = _RetryPolicyJitter as { - new (model?: Partial): _RetryPolicyJitter & Specification.RetryPolicyJitter; +export const _RetryPolicyJitter = RetryPolicyJitter as { + new (model?: Partial): RetryPolicyJitter & Specification.RetryPolicyJitter; }; diff --git a/src/lib/generated/classes/retry-policy-limit-attempt.ts b/src/lib/generated/classes/retry-policy-limit-attempt.ts index 1cd7b76..2384e47 100644 --- a/src/lib/generated/classes/retry-policy-limit-attempt.ts +++ b/src/lib/generated/classes/retry-policy-limit-attempt.ts @@ -23,14 +23,14 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _RetryPolicyLimitAttempt extends Hydrator { +class RetryPolicyLimitAttempt extends Hydrator { constructor(model?: Partial) { super(model); } } -export const RetryPolicyLimitAttempt = _RetryPolicyLimitAttempt as { +export const _RetryPolicyLimitAttempt = RetryPolicyLimitAttempt as { new ( model?: Partial, - ): _RetryPolicyLimitAttempt & Specification.RetryPolicyLimitAttempt; + ): RetryPolicyLimitAttempt & Specification.RetryPolicyLimitAttempt; }; diff --git a/src/lib/generated/classes/retry-policy-limit.ts b/src/lib/generated/classes/retry-policy-limit.ts index 79b16aa..a24dea6 100644 --- a/src/lib/generated/classes/retry-policy-limit.ts +++ b/src/lib/generated/classes/retry-policy-limit.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _RetryPolicyLimit extends Hydrator { +class RetryPolicyLimit extends Hydrator { constructor(model?: Partial) { super(model); } } -export const RetryPolicyLimit = _RetryPolicyLimit as { - new (model?: Partial): _RetryPolicyLimit & Specification.RetryPolicyLimit; +export const _RetryPolicyLimit = RetryPolicyLimit as { + new (model?: Partial): RetryPolicyLimit & Specification.RetryPolicyLimit; }; diff --git a/src/lib/generated/classes/retry-policy.ts b/src/lib/generated/classes/retry-policy.ts index 0373ccd..5cd5e81 100644 --- a/src/lib/generated/classes/retry-policy.ts +++ b/src/lib/generated/classes/retry-policy.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _RetryPolicy extends Hydrator { +class RetryPolicy extends Hydrator { constructor(model?: Partial) { super(model); } } -export const RetryPolicy = _RetryPolicy as { - new (model?: Partial): _RetryPolicy & Specification.RetryPolicy; +export const _RetryPolicy = RetryPolicy as { + new (model?: Partial): RetryPolicy & Specification.RetryPolicy; }; diff --git a/src/lib/generated/classes/run-task-run-container.ts b/src/lib/generated/classes/run-task-run-container.ts index 6d58e66..1285326 100644 --- a/src/lib/generated/classes/run-task-run-container.ts +++ b/src/lib/generated/classes/run-task-run-container.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _RunTaskRunContainer extends Hydrator { +class RunTaskRunContainer extends Hydrator { constructor(model?: Partial) { super(model); } } -export const RunTaskRunContainer = _RunTaskRunContainer as { - new (model?: Partial): _RunTaskRunContainer & Specification.RunTaskRunContainer; +export const _RunTaskRunContainer = RunTaskRunContainer as { + new (model?: Partial): RunTaskRunContainer & Specification.RunTaskRunContainer; }; diff --git a/src/lib/generated/classes/run-task-run-script.ts b/src/lib/generated/classes/run-task-run-script.ts index 881f954..154352c 100644 --- a/src/lib/generated/classes/run-task-run-script.ts +++ b/src/lib/generated/classes/run-task-run-script.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _RunTaskRunScript extends Hydrator { +class RunTaskRunScript extends Hydrator { constructor(model?: Partial) { super(model); } } -export const RunTaskRunScript = _RunTaskRunScript as { - new (model?: Partial): _RunTaskRunScript & Specification.RunTaskRunScript; +export const _RunTaskRunScript = RunTaskRunScript as { + new (model?: Partial): RunTaskRunScript & Specification.RunTaskRunScript; }; diff --git a/src/lib/generated/classes/run-task-run-shell-arguments.ts b/src/lib/generated/classes/run-task-run-shell-arguments.ts index 9458a58..6c76e7e 100644 --- a/src/lib/generated/classes/run-task-run-shell-arguments.ts +++ b/src/lib/generated/classes/run-task-run-shell-arguments.ts @@ -23,14 +23,14 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _RunTaskRunShellArguments extends Hydrator { +class RunTaskRunShellArguments extends Hydrator { constructor(model?: Partial) { super(model); } } -export const RunTaskRunShellArguments = _RunTaskRunShellArguments as { +export const _RunTaskRunShellArguments = RunTaskRunShellArguments as { new ( model?: Partial, - ): _RunTaskRunShellArguments & Specification.RunTaskRunShellArguments; + ): RunTaskRunShellArguments & Specification.RunTaskRunShellArguments; }; diff --git a/src/lib/generated/classes/run-task-run-shell-environment.ts b/src/lib/generated/classes/run-task-run-shell-environment.ts index 887f77b..fb215c5 100644 --- a/src/lib/generated/classes/run-task-run-shell-environment.ts +++ b/src/lib/generated/classes/run-task-run-shell-environment.ts @@ -23,14 +23,14 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _RunTaskRunShellEnvironment extends Hydrator { +class RunTaskRunShellEnvironment extends Hydrator { constructor(model?: Partial) { super(model); } } -export const RunTaskRunShellEnvironment = _RunTaskRunShellEnvironment as { +export const _RunTaskRunShellEnvironment = RunTaskRunShellEnvironment as { new ( model?: Partial, - ): _RunTaskRunShellEnvironment & Specification.RunTaskRunShellEnvironment; + ): RunTaskRunShellEnvironment & Specification.RunTaskRunShellEnvironment; }; diff --git a/src/lib/generated/classes/run-task-run-shell.ts b/src/lib/generated/classes/run-task-run-shell.ts index 34adc96..f4780c2 100644 --- a/src/lib/generated/classes/run-task-run-shell.ts +++ b/src/lib/generated/classes/run-task-run-shell.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _RunTaskRunShell extends Hydrator { +class RunTaskRunShell extends Hydrator { constructor(model?: Partial) { super(model); } } -export const RunTaskRunShell = _RunTaskRunShell as { - new (model?: Partial): _RunTaskRunShell & Specification.RunTaskRunShell; +export const _RunTaskRunShell = RunTaskRunShell as { + new (model?: Partial): RunTaskRunShell & Specification.RunTaskRunShell; }; diff --git a/src/lib/generated/classes/run-task-run-workflow-input.ts b/src/lib/generated/classes/run-task-run-workflow-input.ts index 5af31ae..7dec4ec 100644 --- a/src/lib/generated/classes/run-task-run-workflow-input.ts +++ b/src/lib/generated/classes/run-task-run-workflow-input.ts @@ -23,14 +23,14 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _RunTaskRunWorkflowInput extends Hydrator { +class RunTaskRunWorkflowInput extends Hydrator { constructor(model?: Partial) { super(model); } } -export const RunTaskRunWorkflowInput = _RunTaskRunWorkflowInput as { +export const _RunTaskRunWorkflowInput = RunTaskRunWorkflowInput as { new ( model?: Partial, - ): _RunTaskRunWorkflowInput & Specification.RunTaskRunWorkflowInput; + ): RunTaskRunWorkflowInput & Specification.RunTaskRunWorkflowInput; }; diff --git a/src/lib/generated/classes/run-task-run-workflow.ts b/src/lib/generated/classes/run-task-run-workflow.ts index 9e0b987..e844b9f 100644 --- a/src/lib/generated/classes/run-task-run-workflow.ts +++ b/src/lib/generated/classes/run-task-run-workflow.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _RunTaskRunWorkflow extends Hydrator { +class RunTaskRunWorkflow extends Hydrator { constructor(model?: Partial) { super(model); } } -export const RunTaskRunWorkflow = _RunTaskRunWorkflow as { - new (model?: Partial): _RunTaskRunWorkflow & Specification.RunTaskRunWorkflow; +export const _RunTaskRunWorkflow = RunTaskRunWorkflow as { + new (model?: Partial): RunTaskRunWorkflow & Specification.RunTaskRunWorkflow; }; diff --git a/src/lib/generated/classes/run-task-run.ts b/src/lib/generated/classes/run-task-run.ts index 8b1ff7a..8c407b5 100644 --- a/src/lib/generated/classes/run-task-run.ts +++ b/src/lib/generated/classes/run-task-run.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _RunTaskRun extends Hydrator { +class RunTaskRun extends Hydrator { constructor(model?: Partial) { super(model); } } -export const RunTaskRun = _RunTaskRun as { - new (model?: Partial): _RunTaskRun & Specification.RunTaskRun; +export const _RunTaskRun = RunTaskRun as { + new (model?: Partial): RunTaskRun & Specification.RunTaskRun; }; diff --git a/src/lib/generated/classes/run-task.ts b/src/lib/generated/classes/run-task.ts index eb0e0ef..3f80b43 100644 --- a/src/lib/generated/classes/run-task.ts +++ b/src/lib/generated/classes/run-task.ts @@ -20,15 +20,15 @@ * *****************************************************************************************/ -import { TaskBase } from './task-base'; +import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; -class _RunTask extends TaskBase { +class RunTask extends _TaskBase { constructor(model?: Partial) { super(model); } } -export const RunTask = _RunTask as { - new (model?: Partial): _RunTask & Specification.RunTask; +export const _RunTask = RunTask as { + new (model?: Partial): RunTask & Specification.RunTask; }; diff --git a/src/lib/generated/classes/schedule.ts b/src/lib/generated/classes/schedule.ts index fe40e07..924257e 100644 --- a/src/lib/generated/classes/schedule.ts +++ b/src/lib/generated/classes/schedule.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _Schedule extends Hydrator { +class Schedule extends Hydrator { constructor(model?: Partial) { super(model); } } -export const Schedule = _Schedule as { - new (model?: Partial): _Schedule & Specification.Schedule; +export const _Schedule = Schedule as { + new (model?: Partial): Schedule & Specification.Schedule; }; diff --git a/src/lib/generated/classes/schema.ts b/src/lib/generated/classes/schema.ts index 526fdda..a7f4837 100644 --- a/src/lib/generated/classes/schema.ts +++ b/src/lib/generated/classes/schema.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _Schema extends Hydrator { +class Schema extends Hydrator { constructor(model?: Partial) { super(model); } } -export const Schema = _Schema as { - new (model?: Partial): _Schema & Specification.Schema; +export const _Schema = Schema as { + new (model?: Partial): Schema & Specification.Schema; }; diff --git a/src/lib/generated/classes/set-task-set.ts b/src/lib/generated/classes/set-task-set.ts index f5571c8..b5ad234 100644 --- a/src/lib/generated/classes/set-task-set.ts +++ b/src/lib/generated/classes/set-task-set.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _SetTaskSet extends Hydrator { +class SetTaskSet extends Hydrator { constructor(model?: Partial) { super(model); } } -export const SetTaskSet = _SetTaskSet as { - new (model?: Partial): _SetTaskSet & Specification.SetTaskSet; +export const _SetTaskSet = SetTaskSet as { + new (model?: Partial): SetTaskSet & Specification.SetTaskSet; }; diff --git a/src/lib/generated/classes/set-task.ts b/src/lib/generated/classes/set-task.ts index f99350a..fa60e49 100644 --- a/src/lib/generated/classes/set-task.ts +++ b/src/lib/generated/classes/set-task.ts @@ -20,15 +20,15 @@ * *****************************************************************************************/ -import { TaskBase } from './task-base'; +import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; -class _SetTask extends TaskBase { +class SetTask extends _TaskBase { constructor(model?: Partial) { super(model); } } -export const SetTask = _SetTask as { - new (model?: Partial): _SetTask & Specification.SetTask; +export const _SetTask = SetTask as { + new (model?: Partial): SetTask & Specification.SetTask; }; diff --git a/src/lib/generated/classes/switch-task-switch-case.ts b/src/lib/generated/classes/switch-task-switch-case.ts index 6392a21..4c40fa4 100644 --- a/src/lib/generated/classes/switch-task-switch-case.ts +++ b/src/lib/generated/classes/switch-task-switch-case.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _SwitchTaskSwitchCase extends Hydrator { +class SwitchTaskSwitchCase extends Hydrator { constructor(model?: Partial) { super(model); } } -export const SwitchTaskSwitchCase = _SwitchTaskSwitchCase as { - new (model?: Partial): _SwitchTaskSwitchCase & Specification.SwitchTaskSwitchCase; +export const _SwitchTaskSwitchCase = SwitchTaskSwitchCase as { + new (model?: Partial): SwitchTaskSwitchCase & Specification.SwitchTaskSwitchCase; }; diff --git a/src/lib/generated/classes/switch-task-switch.ts b/src/lib/generated/classes/switch-task-switch.ts index 3aa5b6a..29645a5 100644 --- a/src/lib/generated/classes/switch-task-switch.ts +++ b/src/lib/generated/classes/switch-task-switch.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _SwitchTaskSwitch extends Hydrator { +class SwitchTaskSwitch extends Hydrator { constructor(model?: Partial) { super(model); } } -export const SwitchTaskSwitch = _SwitchTaskSwitch as { - new (model?: Partial): _SwitchTaskSwitch & Specification.SwitchTaskSwitch; +export const _SwitchTaskSwitch = SwitchTaskSwitch as { + new (model?: Partial): SwitchTaskSwitch & Specification.SwitchTaskSwitch; }; diff --git a/src/lib/generated/classes/switch-task.ts b/src/lib/generated/classes/switch-task.ts index 07da04e..0a576fa 100644 --- a/src/lib/generated/classes/switch-task.ts +++ b/src/lib/generated/classes/switch-task.ts @@ -20,15 +20,15 @@ * *****************************************************************************************/ -import { TaskBase } from './task-base'; +import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; -class _SwitchTask extends TaskBase { +class SwitchTask extends _TaskBase { constructor(model?: Partial) { super(model); } } -export const SwitchTask = _SwitchTask as { - new (model?: Partial): _SwitchTask & Specification.SwitchTask; +export const _SwitchTask = SwitchTask as { + new (model?: Partial): SwitchTask & Specification.SwitchTask; }; diff --git a/src/lib/generated/classes/task-base.ts b/src/lib/generated/classes/task-base.ts index 23c7d90..4a08b78 100644 --- a/src/lib/generated/classes/task-base.ts +++ b/src/lib/generated/classes/task-base.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _TaskBase extends Hydrator { +class TaskBase extends Hydrator { constructor(model?: Partial) { super(model); } } -export const TaskBase = _TaskBase as { - new (model?: Partial): _TaskBase & Specification.TaskBase; +export const _TaskBase = TaskBase as { + new (model?: Partial): TaskBase & Specification.TaskBase; }; diff --git a/src/lib/generated/classes/task-list.ts b/src/lib/generated/classes/task-list.ts index 509a5a1..b02d39d 100644 --- a/src/lib/generated/classes/task-list.ts +++ b/src/lib/generated/classes/task-list.ts @@ -22,7 +22,7 @@ import { Specification } from '../definitions'; -export class TaskList extends Array<{ [k: string]: Specification.Task }> { +class TaskList extends Array<{ [k: string]: Specification.Task }> { constructor(model?: Array<{ [k: string]: Specification.Task }>) { super(...(model || [])); if (model != null && !Array.isArray(model)) { @@ -31,3 +31,5 @@ export class TaskList extends Array<{ [k: string]: Specification.Task }> { Object.setPrototypeOf(this, Object.create(TaskList.prototype)); } } + +export const _TaskList = TaskList; // could be exported directly, but it makes the job of building the index more straightforward as it's consistant with "object" classes diff --git a/src/lib/generated/classes/task.ts b/src/lib/generated/classes/task.ts index 8ddf885..0c0383a 100644 --- a/src/lib/generated/classes/task.ts +++ b/src/lib/generated/classes/task.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _Task extends Hydrator { +class Task extends Hydrator { constructor(model?: Partial) { super(model); } } -export const Task = _Task as { - new (model?: Partial): _Task & Specification.Task; +export const _Task = Task as { + new (model?: Partial): Task & Specification.Task; }; diff --git a/src/lib/generated/classes/timeout.ts b/src/lib/generated/classes/timeout.ts index e221cf8..bdbe4ed 100644 --- a/src/lib/generated/classes/timeout.ts +++ b/src/lib/generated/classes/timeout.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _Timeout extends Hydrator { +class Timeout extends Hydrator { constructor(model?: Partial) { super(model); } } -export const Timeout = _Timeout as { - new (model?: Partial): _Timeout & Specification.Timeout; +export const _Timeout = Timeout as { + new (model?: Partial): Timeout & Specification.Timeout; }; diff --git a/src/lib/generated/classes/try-task-catch.ts b/src/lib/generated/classes/try-task-catch.ts index 9b2fe81..6a74eb7 100644 --- a/src/lib/generated/classes/try-task-catch.ts +++ b/src/lib/generated/classes/try-task-catch.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _TryTaskCatch extends Hydrator { +class TryTaskCatch extends Hydrator { constructor(model?: Partial) { super(model); } } -export const TryTaskCatch = _TryTaskCatch as { - new (model?: Partial): _TryTaskCatch & Specification.TryTaskCatch; +export const _TryTaskCatch = TryTaskCatch as { + new (model?: Partial): TryTaskCatch & Specification.TryTaskCatch; }; diff --git a/src/lib/generated/classes/try-task.ts b/src/lib/generated/classes/try-task.ts index 7d89658..968cb7a 100644 --- a/src/lib/generated/classes/try-task.ts +++ b/src/lib/generated/classes/try-task.ts @@ -20,15 +20,15 @@ * *****************************************************************************************/ -import { TaskBase } from './task-base'; +import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; -class _TryTask extends TaskBase { +class TryTask extends _TaskBase { constructor(model?: Partial) { super(model); } } -export const TryTask = _TryTask as { - new (model?: Partial): _TryTask & Specification.TryTask; +export const _TryTask = TryTask as { + new (model?: Partial): TryTask & Specification.TryTask; }; diff --git a/src/lib/generated/classes/use-authentications.ts b/src/lib/generated/classes/use-authentications.ts index a7f7a81..7e7bc61 100644 --- a/src/lib/generated/classes/use-authentications.ts +++ b/src/lib/generated/classes/use-authentications.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _UseAuthentications extends Hydrator { +class UseAuthentications extends Hydrator { constructor(model?: Partial) { super(model); } } -export const UseAuthentications = _UseAuthentications as { - new (model?: Partial): _UseAuthentications & Specification.UseAuthentications; +export const _UseAuthentications = UseAuthentications as { + new (model?: Partial): UseAuthentications & Specification.UseAuthentications; }; diff --git a/src/lib/generated/classes/use-errors.ts b/src/lib/generated/classes/use-errors.ts index c68c055..28b6b0c 100644 --- a/src/lib/generated/classes/use-errors.ts +++ b/src/lib/generated/classes/use-errors.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _UseErrors extends Hydrator { +class UseErrors extends Hydrator { constructor(model?: Partial) { super(model); } } -export const UseErrors = _UseErrors as { - new (model?: Partial): _UseErrors & Specification.UseErrors; +export const _UseErrors = UseErrors as { + new (model?: Partial): UseErrors & Specification.UseErrors; }; diff --git a/src/lib/generated/classes/use-extensions.ts b/src/lib/generated/classes/use-extensions.ts index 0365361..6e7f021 100644 --- a/src/lib/generated/classes/use-extensions.ts +++ b/src/lib/generated/classes/use-extensions.ts @@ -22,7 +22,7 @@ import { Specification } from '../definitions'; -export class UseExtensions extends Array<{ [k: string]: Specification.Extension }> { +class UseExtensions extends Array<{ [k: string]: Specification.Extension }> { constructor(model?: Array<{ [k: string]: Specification.Extension }>) { super(...(model || [])); if (model != null && !Array.isArray(model)) { @@ -31,3 +31,5 @@ export class UseExtensions extends Array<{ [k: string]: Specification.Extension Object.setPrototypeOf(this, Object.create(UseExtensions.prototype)); } } + +export const _UseExtensions = UseExtensions; // could be exported directly, but it makes the job of building the index more straightforward as it's consistant with "object" classes diff --git a/src/lib/generated/classes/use-functions.ts b/src/lib/generated/classes/use-functions.ts index 15377f2..e8ec823 100644 --- a/src/lib/generated/classes/use-functions.ts +++ b/src/lib/generated/classes/use-functions.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _UseFunctions extends Hydrator { +class UseFunctions extends Hydrator { constructor(model?: Partial) { super(model); } } -export const UseFunctions = _UseFunctions as { - new (model?: Partial): _UseFunctions & Specification.UseFunctions; +export const _UseFunctions = UseFunctions as { + new (model?: Partial): UseFunctions & Specification.UseFunctions; }; diff --git a/src/lib/generated/classes/use-retries.ts b/src/lib/generated/classes/use-retries.ts index c01efc8..2c8773a 100644 --- a/src/lib/generated/classes/use-retries.ts +++ b/src/lib/generated/classes/use-retries.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _UseRetries extends Hydrator { +class UseRetries extends Hydrator { constructor(model?: Partial) { super(model); } } -export const UseRetries = _UseRetries as { - new (model?: Partial): _UseRetries & Specification.UseRetries; +export const _UseRetries = UseRetries as { + new (model?: Partial): UseRetries & Specification.UseRetries; }; diff --git a/src/lib/generated/classes/use.ts b/src/lib/generated/classes/use.ts index 2ad2dea..532649a 100644 --- a/src/lib/generated/classes/use.ts +++ b/src/lib/generated/classes/use.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _Use extends Hydrator { +class Use extends Hydrator { constructor(model?: Partial) { super(model); } } -export const Use = _Use as { - new (model?: Partial): _Use & Specification.Use; +export const _Use = Use as { + new (model?: Partial): Use & Specification.Use; }; diff --git a/src/lib/generated/classes/wait-task.ts b/src/lib/generated/classes/wait-task.ts index cacee4d..2644f07 100644 --- a/src/lib/generated/classes/wait-task.ts +++ b/src/lib/generated/classes/wait-task.ts @@ -20,15 +20,15 @@ * *****************************************************************************************/ -import { TaskBase } from './task-base'; +import { _TaskBase } from './task-base'; import { Specification } from '../definitions'; -class _WaitTask extends TaskBase { +class WaitTask extends _TaskBase { constructor(model?: Partial) { super(model); } } -export const WaitTask = _WaitTask as { - new (model?: Partial): _WaitTask & Specification.WaitTask; +export const _WaitTask = WaitTask as { + new (model?: Partial): WaitTask & Specification.WaitTask; }; diff --git a/src/lib/generated/classes/workflow.ts b/src/lib/generated/classes/workflow.ts index 3bbe7e3..6b912be 100644 --- a/src/lib/generated/classes/workflow.ts +++ b/src/lib/generated/classes/workflow.ts @@ -23,12 +23,12 @@ import { Hydrator } from '../../hydrator'; import { Specification } from '../definitions'; -class _Workflow extends Hydrator { +class Workflow extends Hydrator { constructor(model?: Partial) { super(model); } } -export const Workflow = _Workflow as { - new (model?: Partial): _Workflow & Specification.Workflow; +export const _Workflow = Workflow as { + new (model?: Partial): Workflow & Specification.Workflow; }; diff --git a/tests/builders/call-http-builder.spec.ts b/tests/builders/call-http-builder.spec.ts index 19a0b68..a1bbb3e 100644 --- a/tests/builders/call-http-builder.spec.ts +++ b/tests/builders/call-http-builder.spec.ts @@ -24,7 +24,7 @@ describe('CallHTTP builder', () => { const endpoint = 'https://serverlessworkflow.io'; const method = 'get'; const data = { - call: 'http' as 'http', + call: 'http' as const, with: { endpoint, method, diff --git a/tests/builders/use-extensions-builder.spec.ts b/tests/builders/use-extensions-builder.spec.ts index 127f98c..7065b66 100644 --- a/tests/builders/use-extensions-builder.spec.ts +++ b/tests/builders/use-extensions-builder.spec.ts @@ -5,7 +5,7 @@ describe('UseExtensions builder', () => { it('should build with fluent api', () => { const extension = { myExtension: { - extend: 'call' as 'call', + extend: 'call' as const, }, }; const useExtensions = useExtensionsBuilder().push(extension).build(); @@ -18,7 +18,7 @@ describe('UseExtensions builder', () => { it('should build with input', () => { const extension = { myExtension: { - extend: 'call' as 'call', + extend: 'call' as const, }, }; const useExtensions = useExtensionsBuilder([extension]).build(); @@ -35,4 +35,19 @@ describe('UseExtensions builder', () => { expect(test).toThrow(Error); expect(test).toThrow('The provided model should be an array'); }); + + it('should validate', () => { + const test = () => { + useExtensionsBuilder([1, 2, 3] as any).build(); + }; + expect(test).toThrow(Error); + expect(test).toThrow(/'UseExtensions' is invalid/); + }); + + it('should not validate', () => { + const test = () => { + useExtensionsBuilder([1, 2, 3] as any).build(false); + }; + expect(test).not.toThrow(); + }); }); diff --git a/tools/2_generate-definitions.ts b/tools/2_generate-definitions.ts index f51cabd..0bdc8d6 100644 --- a/tools/2_generate-definitions.ts +++ b/tools/2_generate-definitions.ts @@ -95,7 +95,7 @@ function prepareSchema(schema: any, path: string[] = ['#'], parentTitle: string schemaKeys.filter((key) => !metadataProperties.includes(key)).length // if it's just a plain object, with nothing but a type an some description ) { if (parentTitle.trim()) { - let title = !isItemWithAdditionalProperties ? parent : path.includes('switch') ? 'case' : 'item'; + const title = !isItemWithAdditionalProperties ? parent : path.includes('switch') ? 'case' : 'item'; newSchema.title = toPascalCase(`${parentTitle} ${title}`); } else { newSchema.title = toPascalCase( diff --git a/tools/4_generate-classes.ts b/tools/4_generate-classes.ts index 68844b5..079ab78 100644 --- a/tools/4_generate-classes.ts +++ b/tools/4_generate-classes.ts @@ -38,17 +38,17 @@ const getObjectClassDeclaration = (name: string, baseClass?: string): string => `${fileHeader} ${inFileDisclaimer} -${baseClass ? `import { ${baseClass} } from './${toKebabCase(normalizeKnownAllCaps(baseClass))}';` : 'import { Hydrator } from "../../hydrator";'} +${baseClass ? `import { _${baseClass} } from './${toKebabCase(normalizeKnownAllCaps(baseClass))}';` : 'import { Hydrator } from "../../hydrator";'} import { Specification } from "../definitions"; -class _${name} extends ${baseClass ? baseClass : `Hydrator`} { +class ${name} extends ${baseClass ? '_' + baseClass : `Hydrator`} { constructor(model?: Partial) { super(model); } } -export const ${name} = _${name} as ({ - new (model?: Partial): _${name} & Specification.${name} +export const _${name} = ${name} as ({ + new (model?: Partial): ${name} & Specification.${name} });`; /** @@ -63,7 +63,7 @@ ${inFileDisclaimer} import { Specification } from "../definitions"; -export class ${name} extends Array<${arrayType}> { +class ${name} extends Array<${arrayType}> { constructor(model?: Array<${arrayType}>) { super(...(model||[])); if (model != null && !Array.isArray(model)) { @@ -72,6 +72,8 @@ export class ${name} extends Array<${arrayType}> { Object.setPrototypeOf(this, Object.create(${name}.prototype)); } } + +export const _${name} = ${name}; // could be exported directly, but it makes the job of building the index more straightforward as it's consistant with "object" classes `; /** @@ -84,8 +86,8 @@ async function generate(definitionFile: string, destDir: string): Promise const exportedDeclarations = getExportedDeclarations(definitions); const aliases = Array.from(exportedDeclarations.keys()); await reset(destDir); - for (const [alias, exported] of exportedDeclarations) { - const exportedType = exported![0].getType(); + for (const [alias, node] of exportedDeclarations) { + const exportedType = node![0].getType(); let classDeclaration: string = ''; if (!exportedType.isArray()) { const baseClass = exportedType.getIntersectionTypes()?.[0]?.getText().replace('import("/declarations").', ''); @@ -101,9 +103,9 @@ async function generate(definitionFile: string, destDir: string): Promise await writeFile(destFile, classDeclaration); } const indexSrc = `${fileHeader} -${aliases.reduce((imports, alias) => `${imports}import { ${alias} } from './${toKebabCase(normalizeKnownAllCaps(alias))}';\n`, '')} +${aliases.reduce((imports, alias) => `${imports}import { _${alias} } from './${toKebabCase(normalizeKnownAllCaps(alias))}';\n`, '')} export const Classes = { - ${aliases.reduce((exports, alias) => `${exports} ${alias},\n`, '')} +${aliases.reduce((exports, alias) => `${exports} ${alias}: _${alias},\n`, '')} };`; const destFile = path.resolve(destDir, 'index.ts'); await writeFile(destFile, indexSrc); diff --git a/tools/5_generate-builders.ts b/tools/5_generate-builders.ts index f401128..c5fe62d 100644 --- a/tools/5_generate-builders.ts +++ b/tools/5_generate-builders.ts @@ -135,8 +135,8 @@ async function generate(definitionFile: string, destDir: string): Promise const definitions = await readFile(definitionFile, { encoding: 'utf-8' }); const exportedDeclarations = getExportedDeclarations(definitions); const aliases = Array.from(exportedDeclarations.keys()); - for (const [alias, exported] of exportedDeclarations) { - const exportedType = exported![0].getType(); + for (const [alias, node] of exportedDeclarations) { + const exportedType = node![0].getType(); let builderDeclaration: string = ''; if (!exportedType.isArray()) { builderDeclaration = getObjectBuilderDeclaration(alias); diff --git a/tools/tmp.ts b/tools/tmp.ts new file mode 100644 index 0000000..aa5bc12 --- /dev/null +++ b/tools/tmp.ts @@ -0,0 +1,207 @@ +/* eslint-disable */ +import { definitionsDir } from './utils'; +import * as path from 'path'; +import { promises as fsPromises } from 'fs'; +import { Project, QuoteKind, Type, Node, TypeNode } from 'ts-morph'; + +const { readFile, writeFile } = fsPromises; + +const definitionFile = path.resolve(definitionsDir, 'specification.ts'); + +const getUnderlyingTypes = (type: Type): Type[] => [ + type, + ...type.getUnionTypes().flatMap((t) => getUnderlyingTypes(t)), + ...type.getIntersectionTypes().flatMap((t) => getUnderlyingTypes(t)), +]; //.filter(t => !t.isArray()); + +type PropertyInfo = { + name: string; + type: string; + originalType: Type; + originalDeclaration: string; + isArray: boolean; + isAnonymous: boolean; + isLiteral: boolean; + hasIndexedSignature: boolean; +}; + +const hasStringIndexedSignature = (type: Type): boolean => !!type.getStringIndexType(); + +const getProperties = (node: any, type: Type): PropertyInfo[] => + getUnderlyingTypes(type) + .filter((t) => t.isObject()) + .flatMap((t) => t.getProperties()) + .filter((p, i, arr) => { + const originalType = p.getTypeAtLocation(node).getNonNullableType(); + // originalType.isObject() doesn't return the expected result + const isObject = !( + ( + originalType.isString() || + originalType.isNumber() || + originalType.isBoolean() || + originalType.isBigInt() || + originalType.isEnum() || + originalType.isAny() || + originalType.isUnknown() + ) + //|| originalType.isLiteral() + ); + const isAnonymous = originalType.isAnonymous(); + const isAny = originalType.isAny(); + const isArray = originalType.isArray(); + const isBoolean = originalType.isBoolean(); + const isBooleanLiteral = originalType.isBooleanLiteral(); + const isClass = originalType.isClass(); + const isClassOrInterface = originalType.isClassOrInterface(); + const isEnum = originalType.isEnum(); + const isEnumLiteral = originalType.isEnumLiteral(); + const isInterface = originalType.isInterface(); + const isIntersection = originalType.isIntersection(); + const isLiteral = originalType.isLiteral(); + const isNull = originalType.isNull(); + const isNumber = originalType.isNumber(); + const isNumberLiteral = originalType.isNumberLiteral(); + //const isObject = originalType.isObject(); + const isString = originalType.isString(); + const isStringLiteral = originalType.isStringLiteral(); + const isTemplateLiteral = originalType.isTemplateLiteral(); + const isTuple = originalType.isTuple(); + const isUndefined = originalType.isUndefined(); + const isUnion = originalType.isUnion(); + const isUnionOrIntersection = originalType.isUnionOrIntersection(); + const isUnknown = originalType.isUnknown(); + return arr.indexOf(p) === i && isObject; + //arr.findIndex(pp => pp.getName() === p.getName()) === i // removes duplicates based on names, but creates unwanted behavior + // e.g. with Task, `with` can be of type `CallAsyncAPIWith`,`CallGRPCWith`... + }) + .map((p) => { + const name = p.getName(); + const originalType = p.getTypeAtLocation(node).getNonNullableType(); + const originalDeclaration = originalType.getText(); + const isArray = originalType.isArray(); + const isAnonymous = originalType.isAnonymous(); + const isLiteral = originalType.isLiteral(); + const hasIndexedSignature = hasStringIndexedSignature(originalType); + let typeTxt = ''; + if (/*!isArray && */ !isAnonymous || !hasIndexedSignature) { + typeTxt = originalType.getText(); + } else if (hasIndexedSignature) { + typeTxt = originalType.getStringIndexType()!.getText(); + } + /*else { + const arrayType = originalType.getArrayElementType()!; + if (!hasStringIndexedSignature(arrayType)) { + typeTxt = arrayType.getText(); + } + else { + typeTxt = arrayType.getStringIndexType()!.getText(); + } + }*/ + typeTxt = typeTxt.replace('import("/declarations").', ''); + return { + name, + originalType, + originalDeclaration, + isArray, + isAnonymous, + isLiteral, + hasIndexedSignature, + type: typeTxt, + }; + }) + .concat( + hasStringIndexedSignature(type) + ? [ + { + name: '', + originalType: type.getStringIndexType()!, + originalDeclaration: type.getStringIndexType()!.getText(), + isArray: type.getStringIndexType()!.isArray(), + isAnonymous: type.getStringIndexType()!.isAnonymous(), + isLiteral: type.getStringIndexType()!.isLiteral(), + hasIndexedSignature: true, + type: type.getStringIndexType()!.getText(), + }, + ] + : [], + ); + +async function test() { + const source = await readFile(definitionFile, { encoding: 'utf-8' }); + const project = new Project({ + useInMemoryFileSystem: true, + manipulationSettings: { + quoteKind: QuoteKind.Single, + }, + compilerOptions: { + strictNullChecks: true, + }, + }); + const sourceFile = project.createSourceFile('declarations.ts', source); + const exportedDeclarations = sourceFile.getExportedDeclarations(); + // var node = exportedDeclarations.get('ExternalResource')![0]; + // var target = node.getType(); + // var props = getProperties(node, target); + var node = exportedDeclarations.get('SwitchTaskSwitch')![0]; + var target = node.getType(); + var it = target.getIntersectionTypes(); + var props = getProperties(node, target); + var declarations = !target.isArray() ? getObjectHydration(node, target) : 'IS ARRAY'; + /* + Strange union + - SwitchTaskSwitch + + Strange union (literal?) + - CallHTTPWith / CallOpenAPIWith . output + + Array with object key-type + - TaskList + - UseExtensions + */ + console.log(declarations); +} + +function getObjectHydration(node: Node, type: Type): string { + const properties = getProperties(node, type); + const namedProperties = properties.filter((p, i, arr) => p.name && arr.findIndex((pp) => pp.name === p.name) === i); + const lines: string[] = namedProperties + .filter((p) => p.type !== 'unknown') + .map((prop) => { + if (prop.isLiteral) { + return `self.${prop.name} = ${prop.type};`; + } else if (/*!prop.isArray && */ !prop.isAnonymous) { + return `if (model.${prop.name}) self.${prop.name} = new ${prop.type}(model.${prop.name});`; + } /*if (prop.isAnonymous)*/ else { + return `if (model.${prop.name}) self.${prop.name} = Object.fromEntries( + Object.entries(model.${prop.name}).map(([key, value]) => [key, new ${prop.type}(value)] ) + );`; + } + /* Array should support their own constructor, like any object + else { + if (!prop.isAnonymous) { + return `if (model.${prop.name}?.length) self.${prop.name} = model.${prop.name}.map(value => new ${prop.type}(value));`; + } + else { // assumes an array of { id: Type } + return `if (model.${prop.name}?.length) self.${prop.name} = model.${prop.name}.map(obj => + Object.fromEntries( + Object.entries(obj).map(([key, value]) => [key, new ${prop.type}(value)]) + ) + );`; + } + } + */ + }); + const indexedProperty = properties.find((p) => !p.name); + if (indexedProperty && indexedProperty.type !== 'unknown' && !indexedProperty.isAnonymous) { + lines.push(`const knownProperties = [${namedProperties.map((p) => `'${p.name}'`).join(',')}];`); + lines.push(`Object.entries(model).filter(([key]) => !knownProperties.includes(key)).forEach(([key, value]) => { + self[key] = new ${indexedProperty.type}(value); + });`); + } + return lines.join('\n'); +} + +test() + .then(() => console.log('done')) + .catch((err) => console.error(err)); +/* eslint-enable */