Skip to content

Commit 2ee8b61

Browse files
committed
Added support for workflow (de)serialization
Signed-off-by: Jean-Baptiste Bianchi <jb.bianchi@neuroglia.io>
1 parent 84901ef commit 2ee8b61

File tree

108 files changed

+4409
-1628
lines changed

Some content is hidden

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

108 files changed

+4409
-1628
lines changed

README.md

Lines changed: 188 additions & 155 deletions
Large diffs are not rendered by default.

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './serverless-workflow-sdk';

src/lib/generated/builders/index.ts

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -14,93 +14,93 @@
1414
* limitations under the License.
1515
*/
1616

17-
export * from './schema-builder';
18-
export * from './external-resource-builder';
19-
export * from './external-resource-authentication-builder';
2017
export * from './authentication-policy-builder';
21-
export * from './task-builder';
22-
export * from './call-task-builder';
18+
export * from './authentication-policy-basic-builder';
19+
export * from './authentication-policy-bearer-builder';
20+
export * from './authentication-policy-oauth2-builder';
21+
export * from './authentication-policy-oauth2-client-builder';
2322
export * from './call-async-api-builder';
24-
export * from './flow-directive-builder';
23+
export * from './call-async-api-with-builder';
2524
export * from './call-async-api-with-authentication-builder';
25+
export * from './call-function-builder';
26+
export * from './call-function-with-builder';
2627
export * from './call-grpc-builder';
28+
export * from './call-grpc-with-builder';
29+
export * from './call-grpc-with-arguments-builder';
30+
export * from './call-grpc-with-service-builder';
2731
export * from './call-grpc-with-service-authentication-builder';
2832
export * from './call-http-builder';
33+
export * from './call-http-with-builder';
2934
export * from './call-http-with-endpoint-builder';
30-
export * from './endpoint-authentication-builder';
3135
export * from './call-open-api-builder';
36+
export * from './call-open-api-with-builder';
3237
export * from './call-open-api-with-authentication-builder';
33-
export * from './call-function-builder';
38+
export * from './call-open-api-with-parameters-builder';
39+
export * from './call-task-builder';
40+
export * from './document-builder';
41+
export * from './document-tags-builder';
3442
export * from './do-task-builder';
35-
export * from './fork-task-builder';
43+
export * from './duration-builder';
3644
export * from './emit-task-builder';
37-
export * from './for-task-builder';
38-
export * from './listen-task-builder';
45+
export * from './emit-task-emit-builder';
46+
export * from './emit-task-emit-event-builder';
47+
export * from './endpoint-builder';
48+
export * from './endpoint-authentication-builder';
49+
export * from './error-builder';
3950
export * from './event-consumption-strategy-builder';
4051
export * from './event-consumption-strategy-all-builder';
4152
export * from './event-consumption-strategy-any-builder';
42-
export * from './raise-task-builder';
43-
export * from './run-task-builder';
44-
export * from './run-task-run-builder';
45-
export * from './run-task-run-script-builder';
46-
export * from './set-task-builder';
47-
export * from './switch-task-builder';
48-
export * from './switch-task-switch-builder';
49-
export * from './try-task-builder';
50-
export * from './retry-policy-backoff-builder';
51-
export * from './wait-task-builder';
52-
export * from './task-list-builder';
53-
export * from './use-extensions-builder';
54-
export * from './workflow-builder';
55-
export * from './document-builder';
56-
export * from './document-tags-builder';
57-
export * from './input-builder';
58-
export * from './authentication-policy-basic-builder';
59-
export * from './authentication-policy-bearer-builder';
60-
export * from './authentication-policy-oauth2-builder';
61-
export * from './authentication-policy-oauth2-client-builder';
62-
export * from './oauth2-token-builder';
63-
export * from './use-builder';
64-
export * from './use-authentications-builder';
65-
export * from './use-errors-builder';
66-
export * from './error-builder';
67-
export * from './extension-builder';
68-
export * from './task-base-builder';
69-
export * from './output-builder';
53+
export * from './event-filter-builder';
54+
export * from './event-filter-correlate-builder';
55+
export * from './event-filter-with-builder';
7056
export * from './export-builder';
71-
export * from './timeout-builder';
72-
export * from './duration-builder';
73-
export * from './call-async-api-with-builder';
74-
export * from './call-grpc-with-builder';
75-
export * from './call-grpc-with-service-builder';
76-
export * from './call-grpc-with-arguments-builder';
77-
export * from './call-http-with-builder';
78-
export * from './endpoint-builder';
79-
export * from './call-open-api-with-builder';
80-
export * from './call-open-api-with-parameters-builder';
81-
export * from './call-function-with-builder';
57+
export * from './extension-builder';
58+
export * from './external-resource-builder';
59+
export * from './external-resource-authentication-builder';
60+
export * from './flow-directive-builder';
61+
export * from './fork-task-builder';
8262
export * from './fork-task-fork-builder';
83-
export * from './emit-task-emit-builder';
84-
export * from './emit-task-emit-event-builder';
63+
export * from './for-task-builder';
8564
export * from './for-task-for-builder';
65+
export * from './input-builder';
66+
export * from './listen-task-builder';
8667
export * from './listen-task-listen-builder';
87-
export * from './event-filter-builder';
88-
export * from './event-filter-with-builder';
89-
export * from './event-filter-correlate-builder';
68+
export * from './oauth2-token-builder';
69+
export * from './output-builder';
70+
export * from './raise-task-builder';
9071
export * from './raise-task-raise-builder';
72+
export * from './retry-policy-builder';
73+
export * from './retry-policy-backoff-builder';
74+
export * from './retry-policy-jitter-builder';
75+
export * from './retry-policy-limit-builder';
76+
export * from './retry-policy-limit-attempt-builder';
77+
export * from './run-task-builder';
78+
export * from './run-task-run-builder';
9179
export * from './run-task-run-container-builder';
80+
export * from './run-task-run-script-builder';
9281
export * from './run-task-run-shell-builder';
9382
export * from './run-task-run-shell-arguments-builder';
9483
export * from './run-task-run-shell-environment-builder';
9584
export * from './run-task-run-workflow-builder';
9685
export * from './run-task-run-workflow-input-builder';
86+
export * from './schedule-builder';
87+
export * from './schema-builder';
88+
export * from './set-task-builder';
9789
export * from './set-task-set-builder';
90+
export * from './switch-task-builder';
91+
export * from './switch-task-switch-builder';
9892
export * from './switch-task-switch-case-builder';
93+
export * from './task-builder';
94+
export * from './task-base-builder';
95+
export * from './task-list-builder';
96+
export * from './timeout-builder';
97+
export * from './try-task-builder';
9998
export * from './try-task-catch-builder';
100-
export * from './retry-policy-builder';
101-
export * from './retry-policy-limit-builder';
102-
export * from './retry-policy-limit-attempt-builder';
103-
export * from './retry-policy-jitter-builder';
99+
export * from './use-builder';
100+
export * from './use-authentications-builder';
101+
export * from './use-errors-builder';
102+
export * from './use-extensions-builder';
104103
export * from './use-functions-builder';
105104
export * from './use-retries-builder';
106-
export * from './schedule-builder';
105+
export * from './wait-task-builder';
106+
export * from './workflow-builder';

src/lib/generated/classes/authentication-policy-basic.ts

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,57 @@
2222

2323
import { ObjectHydrator } from '../../hydrator';
2424
import { Specification } from '../definitions';
25-
import { getLifecycleHook } from '../../lifecycle-hooks';
25+
import { getLifecycleHooks } from '../../lifecycle-hooks';
2626
import { validate } from '../../validation';
27-
import { deepCopy } from '../../utils';
2827

29-
class AuthenticationPolicyBasic extends ObjectHydrator<Specification.AuthenticationPolicyBasic> {
28+
/**
29+
* Represents the intersection between the AuthenticationPolicyBasic class and type
30+
*/
31+
export type AuthenticationPolicyBasicIntersection = AuthenticationPolicyBasic & Specification.AuthenticationPolicyBasic;
32+
33+
/**
34+
* Represents a constructor for the intersection of the AuthenticationPolicyBasic class and type
35+
*/
36+
export interface AuthenticationPolicyBasicConstructor {
37+
new (model?: Partial<Specification.AuthenticationPolicyBasic>): AuthenticationPolicyBasicIntersection;
38+
}
39+
40+
/**
41+
* Represents a AuthenticationPolicyBasic with methods for validation and normalization.
42+
* Inherits from ObjectHydrator which provides functionality for hydrating the state based on a model.
43+
*/
44+
export class AuthenticationPolicyBasic extends ObjectHydrator<Specification.AuthenticationPolicyBasic> {
45+
/**
46+
* Instanciates a new instance of the AuthenticationPolicyBasic class.
47+
* Initializes properties based on the provided model if it is an object.
48+
*
49+
* @param model - Optional partial model object to initialize the AuthenticationPolicyBasic.
50+
*/
3051
constructor(model?: Partial<Specification.AuthenticationPolicyBasic>) {
3152
super(model);
3253

33-
getLifecycleHook('AuthenticationPolicyBasic')?.constructor?.(this);
54+
getLifecycleHooks('AuthenticationPolicyBasic')?.constructor?.(this);
3455
}
3556

57+
/**
58+
* Validates the current instance of the AuthenticationPolicyBasic.
59+
* Throws if invalid.
60+
*/
3661
validate() {
37-
const copy = new AuthenticationPolicyBasic(this as any) as AuthenticationPolicyBasic &
38-
Specification.AuthenticationPolicyBasic;
39-
getLifecycleHook('AuthenticationPolicyBasic')?.preValidation?.(copy);
40-
validate('AuthenticationPolicyBasic', deepCopy(copy)); // deepCopy prevents potential additional properties error for constructor, validate, normalize
41-
getLifecycleHook('AuthenticationPolicyBasic')?.postValidation?.(copy);
62+
const copy = new AuthenticationPolicyBasic(this as any) as AuthenticationPolicyBasicIntersection;
63+
validate('AuthenticationPolicyBasic', copy);
4264
}
4365

66+
/**
67+
* Normalizes the current instance of the AuthenticationPolicyBasic.
68+
* Creates a copy of the AuthenticationPolicyBasic, invokes normalization hooks if available, and returns the normalized copy.
69+
*
70+
* @returns A normalized version of the AuthenticationPolicyBasic instance.
71+
*/
4472
normalize(): AuthenticationPolicyBasic & Specification.AuthenticationPolicyBasic {
45-
const copy = new AuthenticationPolicyBasic(this as any) as AuthenticationPolicyBasic &
46-
Specification.AuthenticationPolicyBasic;
47-
return getLifecycleHook('AuthenticationPolicyBasic')?.normalize?.(copy) || copy;
73+
const copy = new AuthenticationPolicyBasic(this as any) as AuthenticationPolicyBasicIntersection;
74+
return getLifecycleHooks('AuthenticationPolicyBasic')?.normalize?.(copy) || copy;
4875
}
4976
}
5077

51-
export const _AuthenticationPolicyBasic = AuthenticationPolicyBasic as {
52-
new (
53-
model?: Partial<Specification.AuthenticationPolicyBasic>,
54-
): AuthenticationPolicyBasic & Specification.AuthenticationPolicyBasic;
55-
};
78+
export const _AuthenticationPolicyBasic = AuthenticationPolicyBasic as AuthenticationPolicyBasicConstructor;

src/lib/generated/classes/authentication-policy-bearer.ts

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,58 @@
2222

2323
import { ObjectHydrator } from '../../hydrator';
2424
import { Specification } from '../definitions';
25-
import { getLifecycleHook } from '../../lifecycle-hooks';
25+
import { getLifecycleHooks } from '../../lifecycle-hooks';
2626
import { validate } from '../../validation';
27-
import { deepCopy } from '../../utils';
2827

29-
class AuthenticationPolicyBearer extends ObjectHydrator<Specification.AuthenticationPolicyBearer> {
28+
/**
29+
* Represents the intersection between the AuthenticationPolicyBearer class and type
30+
*/
31+
export type AuthenticationPolicyBearerIntersection = AuthenticationPolicyBearer &
32+
Specification.AuthenticationPolicyBearer;
33+
34+
/**
35+
* Represents a constructor for the intersection of the AuthenticationPolicyBearer class and type
36+
*/
37+
export interface AuthenticationPolicyBearerConstructor {
38+
new (model?: Partial<Specification.AuthenticationPolicyBearer>): AuthenticationPolicyBearerIntersection;
39+
}
40+
41+
/**
42+
* Represents a AuthenticationPolicyBearer with methods for validation and normalization.
43+
* Inherits from ObjectHydrator which provides functionality for hydrating the state based on a model.
44+
*/
45+
export class AuthenticationPolicyBearer extends ObjectHydrator<Specification.AuthenticationPolicyBearer> {
46+
/**
47+
* Instanciates a new instance of the AuthenticationPolicyBearer class.
48+
* Initializes properties based on the provided model if it is an object.
49+
*
50+
* @param model - Optional partial model object to initialize the AuthenticationPolicyBearer.
51+
*/
3052
constructor(model?: Partial<Specification.AuthenticationPolicyBearer>) {
3153
super(model);
3254

33-
getLifecycleHook('AuthenticationPolicyBearer')?.constructor?.(this);
55+
getLifecycleHooks('AuthenticationPolicyBearer')?.constructor?.(this);
3456
}
3557

58+
/**
59+
* Validates the current instance of the AuthenticationPolicyBearer.
60+
* Throws if invalid.
61+
*/
3662
validate() {
37-
const copy = new AuthenticationPolicyBearer(this as any) as AuthenticationPolicyBearer &
38-
Specification.AuthenticationPolicyBearer;
39-
getLifecycleHook('AuthenticationPolicyBearer')?.preValidation?.(copy);
40-
validate('AuthenticationPolicyBearer', deepCopy(copy)); // deepCopy prevents potential additional properties error for constructor, validate, normalize
41-
getLifecycleHook('AuthenticationPolicyBearer')?.postValidation?.(copy);
63+
const copy = new AuthenticationPolicyBearer(this as any) as AuthenticationPolicyBearerIntersection;
64+
validate('AuthenticationPolicyBearer', copy);
4265
}
4366

67+
/**
68+
* Normalizes the current instance of the AuthenticationPolicyBearer.
69+
* Creates a copy of the AuthenticationPolicyBearer, invokes normalization hooks if available, and returns the normalized copy.
70+
*
71+
* @returns A normalized version of the AuthenticationPolicyBearer instance.
72+
*/
4473
normalize(): AuthenticationPolicyBearer & Specification.AuthenticationPolicyBearer {
45-
const copy = new AuthenticationPolicyBearer(this as any) as AuthenticationPolicyBearer &
46-
Specification.AuthenticationPolicyBearer;
47-
return getLifecycleHook('AuthenticationPolicyBearer')?.normalize?.(copy) || copy;
74+
const copy = new AuthenticationPolicyBearer(this as any) as AuthenticationPolicyBearerIntersection;
75+
return getLifecycleHooks('AuthenticationPolicyBearer')?.normalize?.(copy) || copy;
4876
}
4977
}
5078

51-
export const _AuthenticationPolicyBearer = AuthenticationPolicyBearer as {
52-
new (
53-
model?: Partial<Specification.AuthenticationPolicyBearer>,
54-
): AuthenticationPolicyBearer & Specification.AuthenticationPolicyBearer;
55-
};
79+
export const _AuthenticationPolicyBearer = AuthenticationPolicyBearer as AuthenticationPolicyBearerConstructor;

src/lib/generated/classes/authentication-policy-oauth2-client.ts

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,59 @@
2222

2323
import { ObjectHydrator } from '../../hydrator';
2424
import { Specification } from '../definitions';
25-
import { getLifecycleHook } from '../../lifecycle-hooks';
25+
import { getLifecycleHooks } from '../../lifecycle-hooks';
2626
import { validate } from '../../validation';
27-
import { deepCopy } from '../../utils';
2827

29-
class AuthenticationPolicyOauth2Client extends ObjectHydrator<Specification.AuthenticationPolicyOauth2Client> {
28+
/**
29+
* Represents the intersection between the AuthenticationPolicyOauth2Client class and type
30+
*/
31+
export type AuthenticationPolicyOauth2ClientIntersection = AuthenticationPolicyOauth2Client &
32+
Specification.AuthenticationPolicyOauth2Client;
33+
34+
/**
35+
* Represents a constructor for the intersection of the AuthenticationPolicyOauth2Client class and type
36+
*/
37+
export interface AuthenticationPolicyOauth2ClientConstructor {
38+
new (model?: Partial<Specification.AuthenticationPolicyOauth2Client>): AuthenticationPolicyOauth2ClientIntersection;
39+
}
40+
41+
/**
42+
* Represents a AuthenticationPolicyOauth2Client with methods for validation and normalization.
43+
* Inherits from ObjectHydrator which provides functionality for hydrating the state based on a model.
44+
*/
45+
export class AuthenticationPolicyOauth2Client extends ObjectHydrator<Specification.AuthenticationPolicyOauth2Client> {
46+
/**
47+
* Instanciates a new instance of the AuthenticationPolicyOauth2Client class.
48+
* Initializes properties based on the provided model if it is an object.
49+
*
50+
* @param model - Optional partial model object to initialize the AuthenticationPolicyOauth2Client.
51+
*/
3052
constructor(model?: Partial<Specification.AuthenticationPolicyOauth2Client>) {
3153
super(model);
3254

33-
getLifecycleHook('AuthenticationPolicyOauth2Client')?.constructor?.(this);
55+
getLifecycleHooks('AuthenticationPolicyOauth2Client')?.constructor?.(this);
3456
}
3557

58+
/**
59+
* Validates the current instance of the AuthenticationPolicyOauth2Client.
60+
* Throws if invalid.
61+
*/
3662
validate() {
37-
const copy = new AuthenticationPolicyOauth2Client(this as any) as AuthenticationPolicyOauth2Client &
38-
Specification.AuthenticationPolicyOauth2Client;
39-
getLifecycleHook('AuthenticationPolicyOauth2Client')?.preValidation?.(copy);
40-
validate('AuthenticationPolicyOauth2Client', deepCopy(copy)); // deepCopy prevents potential additional properties error for constructor, validate, normalize
41-
getLifecycleHook('AuthenticationPolicyOauth2Client')?.postValidation?.(copy);
63+
const copy = new AuthenticationPolicyOauth2Client(this as any) as AuthenticationPolicyOauth2ClientIntersection;
64+
validate('AuthenticationPolicyOauth2Client', copy);
4265
}
4366

67+
/**
68+
* Normalizes the current instance of the AuthenticationPolicyOauth2Client.
69+
* Creates a copy of the AuthenticationPolicyOauth2Client, invokes normalization hooks if available, and returns the normalized copy.
70+
*
71+
* @returns A normalized version of the AuthenticationPolicyOauth2Client instance.
72+
*/
4473
normalize(): AuthenticationPolicyOauth2Client & Specification.AuthenticationPolicyOauth2Client {
45-
const copy = new AuthenticationPolicyOauth2Client(this as any) as AuthenticationPolicyOauth2Client &
46-
Specification.AuthenticationPolicyOauth2Client;
47-
return getLifecycleHook('AuthenticationPolicyOauth2Client')?.normalize?.(copy) || copy;
74+
const copy = new AuthenticationPolicyOauth2Client(this as any) as AuthenticationPolicyOauth2ClientIntersection;
75+
return getLifecycleHooks('AuthenticationPolicyOauth2Client')?.normalize?.(copy) || copy;
4876
}
4977
}
5078

51-
export const _AuthenticationPolicyOauth2Client = AuthenticationPolicyOauth2Client as {
52-
new (
53-
model?: Partial<Specification.AuthenticationPolicyOauth2Client>,
54-
): AuthenticationPolicyOauth2Client & Specification.AuthenticationPolicyOauth2Client;
55-
};
79+
export const _AuthenticationPolicyOauth2Client =
80+
AuthenticationPolicyOauth2Client as AuthenticationPolicyOauth2ClientConstructor;

0 commit comments

Comments
 (0)