Skip to content

Commit c13ca72

Browse files
committed
improved stability when generating types declarations
Signed-off-by: Jean-Baptiste Bianchi <jb.bianchi@neuroglia.io>
1 parent 071794e commit c13ca72

File tree

185 files changed

+3282
-3286
lines changed

Some content is hidden

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

185 files changed

+3282
-3286
lines changed

src/lib/builders/README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/lib/generated/builders/all-event-consumption-strategy-builder.ts

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/lib/generated/builders/any-event-consumption-strategy-builder.ts

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/lib/generated/builders/basic-authentication-policy-builder.ts renamed to src/lib/generated/builders/authentication-policy-basic-builder.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ import { Specification } from '../definitions';
2121

2222
/**
2323
* The internal function used by the builder proxy to validate and return its underlying object
24-
* @param {Specification.BasicAuthenticationPolicy} data The underlying object
25-
* @returns {Specification.BasicAuthenticationPolicy} The validated underlying object
24+
* @param {Specification.AuthenticationPolicyBasic} data The underlying object
25+
* @returns {Specification.AuthenticationPolicyBasic} The validated underlying object
2626
*/
27-
function buildingFn(data: Specification.BasicAuthenticationPolicy): () => Specification.BasicAuthenticationPolicy {
27+
function buildingFn(data: Specification.AuthenticationPolicyBasic): () => Specification.AuthenticationPolicyBasic {
2828
return () => {
29-
const model = new Classes.BasicAuthenticationPolicy();
29+
const model = new Classes.AuthenticationPolicyBasic();
3030
Object.assign(model, data);
3131

32-
validate('BasicAuthenticationPolicy', model);
33-
return model as Specification.BasicAuthenticationPolicy;
32+
validate('AuthenticationPolicyBasic', model);
33+
return model as Specification.AuthenticationPolicyBasic;
3434
};
3535
}
3636

3737
/**
38-
* A factory to create a builder proxy for the type `Specification.BasicAuthenticationPolicy`
39-
* @returns {Specification.BasicAuthenticationPolicy} A builder for `Specification.BasicAuthenticationPolicy`
38+
* A factory to create a builder proxy for the type `Specification.AuthenticationPolicyBasic`
39+
* @returns {Specification.AuthenticationPolicyBasic} A builder for `Specification.AuthenticationPolicyBasic`
4040
*/
41-
export function basicAuthenticationPolicyBuilder(): Builder<Specification.BasicAuthenticationPolicy> {
42-
return builder<Specification.BasicAuthenticationPolicy>(buildingFn);
41+
export function authenticationPolicyBasicBuilder(): Builder<Specification.AuthenticationPolicyBasic> {
42+
return builder<Specification.AuthenticationPolicyBasic>(buildingFn);
4343
}

src/lib/generated/builders/o-auth2-authentication-policy-builder.ts renamed to src/lib/generated/builders/authentication-policy-bearer-builder.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ import { Specification } from '../definitions';
2121

2222
/**
2323
* The internal function used by the builder proxy to validate and return its underlying object
24-
* @param {Specification.OAuth2AuthenticationPolicy} data The underlying object
25-
* @returns {Specification.OAuth2AuthenticationPolicy} The validated underlying object
24+
* @param {Specification.AuthenticationPolicyBearer} data The underlying object
25+
* @returns {Specification.AuthenticationPolicyBearer} The validated underlying object
2626
*/
27-
function buildingFn(data: Specification.OAuth2AuthenticationPolicy): () => Specification.OAuth2AuthenticationPolicy {
27+
function buildingFn(data: Specification.AuthenticationPolicyBearer): () => Specification.AuthenticationPolicyBearer {
2828
return () => {
29-
const model = new Classes.OAuth2AuthenticationPolicy();
29+
const model = new Classes.AuthenticationPolicyBearer();
3030
Object.assign(model, data);
3131

32-
validate('OAuth2AuthenticationPolicy', model);
33-
return model as Specification.OAuth2AuthenticationPolicy;
32+
validate('AuthenticationPolicyBearer', model);
33+
return model as Specification.AuthenticationPolicyBearer;
3434
};
3535
}
3636

3737
/**
38-
* A factory to create a builder proxy for the type `Specification.OAuth2AuthenticationPolicy`
39-
* @returns {Specification.OAuth2AuthenticationPolicy} A builder for `Specification.OAuth2AuthenticationPolicy`
38+
* A factory to create a builder proxy for the type `Specification.AuthenticationPolicyBearer`
39+
* @returns {Specification.AuthenticationPolicyBearer} A builder for `Specification.AuthenticationPolicyBearer`
4040
*/
41-
export function oAuth2AuthenticationPolicyBuilder(): Builder<Specification.OAuth2AuthenticationPolicy> {
42-
return builder<Specification.OAuth2AuthenticationPolicy>(buildingFn);
41+
export function authenticationPolicyBearerBuilder(): Builder<Specification.AuthenticationPolicyBearer> {
42+
return builder<Specification.AuthenticationPolicyBearer>(buildingFn);
4343
}

src/lib/generated/builders/run-builder.ts renamed to src/lib/generated/builders/authentication-policy-oauth2-builder.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ import { Specification } from '../definitions';
2121

2222
/**
2323
* The internal function used by the builder proxy to validate and return its underlying object
24-
* @param {Specification.Run} data The underlying object
25-
* @returns {Specification.Run} The validated underlying object
24+
* @param {Specification.AuthenticationPolicyOauth2} data The underlying object
25+
* @returns {Specification.AuthenticationPolicyOauth2} The validated underlying object
2626
*/
27-
function buildingFn(data: Specification.Run): () => Specification.Run {
27+
function buildingFn(data: Specification.AuthenticationPolicyOauth2): () => Specification.AuthenticationPolicyOauth2 {
2828
return () => {
29-
const model = new Classes.Run();
29+
const model = new Classes.AuthenticationPolicyOauth2();
3030
Object.assign(model, data);
3131

32-
validate('Run', model);
33-
return model as Specification.Run;
32+
validate('AuthenticationPolicyOauth2', model);
33+
return model as Specification.AuthenticationPolicyOauth2;
3434
};
3535
}
3636

3737
/**
38-
* A factory to create a builder proxy for the type `Specification.Run`
39-
* @returns {Specification.Run} A builder for `Specification.Run`
38+
* A factory to create a builder proxy for the type `Specification.AuthenticationPolicyOauth2`
39+
* @returns {Specification.AuthenticationPolicyOauth2} A builder for `Specification.AuthenticationPolicyOauth2`
4040
*/
41-
export function runBuilder(): Builder<Specification.Run> {
42-
return builder<Specification.Run>(buildingFn);
41+
export function authenticationPolicyOauth2Builder(): Builder<Specification.AuthenticationPolicyOauth2> {
42+
return builder<Specification.AuthenticationPolicyOauth2>(buildingFn);
4343
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright 2021-Present The Serverless Workflow Specification Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { builder, Builder } from '../../builder';
18+
import { validate } from '../../validation';
19+
import { Classes } from '../classes';
20+
import { Specification } from '../definitions';
21+
22+
/**
23+
* The internal function used by the builder proxy to validate and return its underlying object
24+
* @param {Specification.AuthenticationPolicyOauth2Client} data The underlying object
25+
* @returns {Specification.AuthenticationPolicyOauth2Client} The validated underlying object
26+
*/
27+
function buildingFn(
28+
data: Specification.AuthenticationPolicyOauth2Client,
29+
): () => Specification.AuthenticationPolicyOauth2Client {
30+
return () => {
31+
const model = new Classes.AuthenticationPolicyOauth2Client();
32+
Object.assign(model, data);
33+
34+
validate('AuthenticationPolicyOauth2Client', model);
35+
return model as Specification.AuthenticationPolicyOauth2Client;
36+
};
37+
}
38+
39+
/**
40+
* A factory to create a builder proxy for the type `Specification.AuthenticationPolicyOauth2Client`
41+
* @returns {Specification.AuthenticationPolicyOauth2Client} A builder for `Specification.AuthenticationPolicyOauth2Client`
42+
*/
43+
export function authenticationPolicyOauth2ClientBuilder(): Builder<Specification.AuthenticationPolicyOauth2Client> {
44+
return builder<Specification.AuthenticationPolicyOauth2Client>(buildingFn);
45+
}

src/lib/generated/builders/referenced-authentication-policy-builder.ts renamed to src/lib/generated/builders/call-async-api-with-authentication-builder.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,25 @@ import { Specification } from '../definitions';
2121

2222
/**
2323
* The internal function used by the builder proxy to validate and return its underlying object
24-
* @param {Specification.ReferencedAuthenticationPolicy} data The underlying object
25-
* @returns {Specification.ReferencedAuthenticationPolicy} The validated underlying object
24+
* @param {Specification.CallAsyncAPIWithAuthentication} data The underlying object
25+
* @returns {Specification.CallAsyncAPIWithAuthentication} The validated underlying object
2626
*/
2727
function buildingFn(
28-
data: Specification.ReferencedAuthenticationPolicy,
29-
): () => Specification.ReferencedAuthenticationPolicy {
28+
data: Specification.CallAsyncAPIWithAuthentication,
29+
): () => Specification.CallAsyncAPIWithAuthentication {
3030
return () => {
31-
const model = new Classes.ReferencedAuthenticationPolicy();
31+
const model = new Classes.CallAsyncAPIWithAuthentication();
3232
Object.assign(model, data);
3333

34-
validate('ReferencedAuthenticationPolicy', model);
35-
return model as Specification.ReferencedAuthenticationPolicy;
34+
validate('CallAsyncAPIWithAuthentication', model);
35+
return model as Specification.CallAsyncAPIWithAuthentication;
3636
};
3737
}
3838

3939
/**
40-
* A factory to create a builder proxy for the type `Specification.ReferencedAuthenticationPolicy`
41-
* @returns {Specification.ReferencedAuthenticationPolicy} A builder for `Specification.ReferencedAuthenticationPolicy`
40+
* A factory to create a builder proxy for the type `Specification.CallAsyncAPIWithAuthentication`
41+
* @returns {Specification.CallAsyncAPIWithAuthentication} A builder for `Specification.CallAsyncAPIWithAuthentication`
4242
*/
43-
export function referencedAuthenticationPolicyBuilder(): Builder<Specification.ReferencedAuthenticationPolicy> {
44-
return builder<Specification.ReferencedAuthenticationPolicy>(buildingFn);
43+
export function callAsyncAPIWithAuthenticationBuilder(): Builder<Specification.CallAsyncAPIWithAuthentication> {
44+
return builder<Specification.CallAsyncAPIWithAuthentication>(buildingFn);
4545
}

src/lib/generated/builders/explicit-basic-authentication-policy-builder.ts renamed to src/lib/generated/builders/call-grpc-with-service-authentication-builder.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,25 @@ import { Specification } from '../definitions';
2121

2222
/**
2323
* The internal function used by the builder proxy to validate and return its underlying object
24-
* @param {Specification.ExplicitBasicAuthenticationPolicy} data The underlying object
25-
* @returns {Specification.ExplicitBasicAuthenticationPolicy} The validated underlying object
24+
* @param {Specification.CallGRPCWithServiceAuthentication} data The underlying object
25+
* @returns {Specification.CallGRPCWithServiceAuthentication} The validated underlying object
2626
*/
2727
function buildingFn(
28-
data: Specification.ExplicitBasicAuthenticationPolicy,
29-
): () => Specification.ExplicitBasicAuthenticationPolicy {
28+
data: Specification.CallGRPCWithServiceAuthentication,
29+
): () => Specification.CallGRPCWithServiceAuthentication {
3030
return () => {
31-
const model = new Classes.ExplicitBasicAuthenticationPolicy();
31+
const model = new Classes.CallGRPCWithServiceAuthentication();
3232
Object.assign(model, data);
3333

34-
validate('ExplicitBasicAuthenticationPolicy', model);
35-
return model as Specification.ExplicitBasicAuthenticationPolicy;
34+
validate('CallGRPCWithServiceAuthentication', model);
35+
return model as Specification.CallGRPCWithServiceAuthentication;
3636
};
3737
}
3838

3939
/**
40-
* A factory to create a builder proxy for the type `Specification.ExplicitBasicAuthenticationPolicy`
41-
* @returns {Specification.ExplicitBasicAuthenticationPolicy} A builder for `Specification.ExplicitBasicAuthenticationPolicy`
40+
* A factory to create a builder proxy for the type `Specification.CallGRPCWithServiceAuthentication`
41+
* @returns {Specification.CallGRPCWithServiceAuthentication} A builder for `Specification.CallGRPCWithServiceAuthentication`
4242
*/
43-
export function explicitBasicAuthenticationPolicyBuilder(): Builder<Specification.ExplicitBasicAuthenticationPolicy> {
44-
return builder<Specification.ExplicitBasicAuthenticationPolicy>(buildingFn);
43+
export function callGRPCWithServiceAuthenticationBuilder(): Builder<Specification.CallGRPCWithServiceAuthentication> {
44+
return builder<Specification.CallGRPCWithServiceAuthentication>(buildingFn);
4545
}

src/lib/generated/builders/authentication-policy-reference-builder.ts renamed to src/lib/generated/builders/call-open-api-with-authentication-builder.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,25 @@ import { Specification } from '../definitions';
2121

2222
/**
2323
* The internal function used by the builder proxy to validate and return its underlying object
24-
* @param {Specification.AuthenticationPolicyReference} data The underlying object
25-
* @returns {Specification.AuthenticationPolicyReference} The validated underlying object
24+
* @param {Specification.CallOpenAPIWithAuthentication} data The underlying object
25+
* @returns {Specification.CallOpenAPIWithAuthentication} The validated underlying object
2626
*/
2727
function buildingFn(
28-
data: Specification.AuthenticationPolicyReference,
29-
): () => Specification.AuthenticationPolicyReference {
28+
data: Specification.CallOpenAPIWithAuthentication,
29+
): () => Specification.CallOpenAPIWithAuthentication {
3030
return () => {
31-
const model = new Classes.AuthenticationPolicyReference();
31+
const model = new Classes.CallOpenAPIWithAuthentication();
3232
Object.assign(model, data);
3333

34-
validate('AuthenticationPolicyReference', model);
35-
return model as Specification.AuthenticationPolicyReference;
34+
validate('CallOpenAPIWithAuthentication', model);
35+
return model as Specification.CallOpenAPIWithAuthentication;
3636
};
3737
}
3838

3939
/**
40-
* A factory to create a builder proxy for the type `Specification.AuthenticationPolicyReference`
41-
* @returns {Specification.AuthenticationPolicyReference} A builder for `Specification.AuthenticationPolicyReference`
40+
* A factory to create a builder proxy for the type `Specification.CallOpenAPIWithAuthentication`
41+
* @returns {Specification.CallOpenAPIWithAuthentication} A builder for `Specification.CallOpenAPIWithAuthentication`
4242
*/
43-
export function authenticationPolicyReferenceBuilder(): Builder<Specification.AuthenticationPolicyReference> {
44-
return builder<Specification.AuthenticationPolicyReference>(buildingFn);
43+
export function callOpenAPIWithAuthenticationBuilder(): Builder<Specification.CallOpenAPIWithAuthentication> {
44+
return builder<Specification.CallOpenAPIWithAuthentication>(buildingFn);
4545
}

0 commit comments

Comments
 (0)