Skip to content

Commit

Permalink
Update SDK to the latest spec status. (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
antmendoza authored Jun 25, 2023
1 parent 0e40bef commit 204113a
Show file tree
Hide file tree
Showing 105 changed files with 1,513 additions and 1,337 deletions.
1 change: 0 additions & 1 deletion src/lib/builders/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# Auto generated notice

This directory and its content has been generated automatically. Do not modify its content, it WILL be lost.
2 changes: 1 addition & 1 deletion src/lib/builders/actiondatafilter-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function actiondatafilterBuildingFn(data: Specification.Actiondatafilter): () =>
return () => {
const model = new Specification.Actiondatafilter(data);

validate('Actiondatafilter', model);
validate('Actiondatafilter', model.normalize());
return model;
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/builders/basicpropsdef-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function basicpropsdefBuildingFn(data: Specification.Basicpropsdef): () => Speci
return () => {
const model = new Specification.Basicpropsdef(data);

validate('Basicpropsdef', model);
validate('Basicpropsdef', model.normalize());
return model;
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/builders/bearerpropsdef-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function bearerpropsdefBuildingFn(data: Specification.Bearerpropsdef): () => Spe
return () => {
const model = new Specification.Bearerpropsdef(data);

validate('Bearerpropsdef', model);
validate('Bearerpropsdef', model.normalize());
return model;
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/builders/correlation-def-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function correlationDefBuildingFn(data: Specification.CorrelationDef): () => Spe
return () => {
const model = new Specification.CorrelationDef(data);

validate('CorrelationDef', model);
validate('CorrelationDef', model.normalize());
return model;
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/builders/crondef-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function crondefBuildingFn(data: Specification.Crondef): () => Specification.Cro
return () => {
const model = new Specification.Crondef(data);

validate('Crondef', model);
validate('Crondef', model.normalize());
return model;
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ import { validate } from '../utils';

/**
* The internal function used by the builder proxy to validate and return its underlying object
* @param {Specification.Enddeventcondition} data The underlying object
* @returns {Specification.Enddeventcondition} The validated underlying object
* @param {Specification.Endeventcondition} data The underlying object
* @returns {Specification.Endeventcondition} The validated underlying object
*/
function enddeventconditionBuildingFn(data: Specification.Enddeventcondition): () => Specification.Enddeventcondition {
function endeventconditionBuildingFn(data: Specification.Endeventcondition): () => Specification.Endeventcondition {
return () => {
const model = new Specification.Enddeventcondition(data);
const model = new Specification.Endeventcondition(data);

validate('Enddeventcondition', model.normalize());
validate('Endeventcondition', model.normalize());
return model;
};
}

/**
* A factory to create a builder proxy for the type `Specification.Enddeventcondition`
* @returns {Specification.Enddeventcondition} A builder for `Specification.Enddeventcondition`
* A factory to create a builder proxy for the type `Specification.Endeventcondition`
* @returns {Specification.Endeventcondition} A builder for `Specification.Endeventcondition`
*/
export function enddeventconditionBuilder(): Builder<Specification.Enddeventcondition> {
return builder<Specification.Enddeventcondition>(enddeventconditionBuildingFn);
export function endeventconditionBuilder(): Builder<Specification.Endeventcondition> {
return builder<Specification.Endeventcondition>(endeventconditionBuildingFn);
}
2 changes: 1 addition & 1 deletion src/lib/builders/errordef-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function errordefBuildingFn(data: Specification.Errordef): () => Specification.E
return () => {
const model = new Specification.Errordef(data);

validate('Errordef', model);
validate('Errordef', model.normalize());
return model;
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/builders/eventdatafilter-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function eventdatafilterBuildingFn(data: Specification.Eventdatafilter): () => S
return () => {
const model = new Specification.Eventdatafilter(data);

validate('Eventdatafilter', model);
validate('Eventdatafilter', model.normalize());
return model;
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ import { validate } from '../utils';

/**
* The internal function used by the builder proxy to validate and return its underlying object
* @param {Specification.StateExecTimeout} data The underlying object
* @returns {Specification.StateExecTimeout} The validated underlying object
* @param {Specification.Extension} data The underlying object
* @returns {Specification.Extension} The validated underlying object
*/
function stateExecTimeoutBuildingFn(data: Specification.StateExecTimeout): () => Specification.StateExecTimeout {
function extensionBuildingFn(data: Specification.Extension): () => Specification.Extension {
return () => {
const model = new Specification.StateExecTimeout(data);
const model = new Specification.Extension(data);

validate('StateExecTimeout', model);
validate('Extension', model.normalize());
return model;
};
}

/**
* A factory to create a builder proxy for the type `Specification.StateExecTimeout`
* @returns {Specification.StateExecTimeout} A builder for `Specification.StateExecTimeout`
* A factory to create a builder proxy for the type `Specification.Extension`
* @returns {Specification.Extension} A builder for `Specification.Extension`
*/
export function stateExecTimeoutBuilder(): Builder<Specification.StateExecTimeout> {
return builder<Specification.StateExecTimeout>(stateExecTimeoutBuildingFn);
export function extensionBuilder(): Builder<Specification.Extension> {
return builder<Specification.Extension>(extensionBuildingFn);
}
4 changes: 2 additions & 2 deletions src/lib/builders/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ export * from './databasedswitchstate-builder';
export * from './defaultconditiondef-builder';
export * from './end-builder';
export * from './enddatacondition-builder';
export * from './enddeventcondition-builder';
export * from './endeventcondition-builder';
export * from './error-builder';
export * from './errordef-builder';
export * from './eventbasedswitchstate-builder';
export * from './eventdatafilter-builder';
export * from './eventdef-builder';
export * from './eventref-builder';
export * from './eventstate-builder';
export * from './extension-builder';
export * from './foreachstate-builder';
export * from './function-builder';
export * from './functionref-builder';
Expand All @@ -52,7 +53,6 @@ export * from './schedule-builder';
export * from './sleep-builder';
export * from './sleepstate-builder';
export * from './startdef-builder';
export * from './state-exec-timeout-builder';
export * from './statedatafilter-builder';
export * from './subflowref-builder';
export * from './timeouts-builder';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/builders/oauth2propsdef-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function oauth2propsdefBuildingFn(data: Specification.Oauth2propsdef): () => Spe
return () => {
const model = new Specification.Oauth2propsdef(data);

validate('Oauth2propsdef', model);
validate('Oauth2propsdef', model.normalize());
return model;
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/builders/produceeventdef-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function produceeventdefBuildingFn(data: Specification.Produceeventdef): () => S
return () => {
const model = new Specification.Produceeventdef(data);

validate('Produceeventdef', model);
validate('Produceeventdef', model.normalize());
return model;
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/builders/retrydef-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function retrydefBuildingFn(data: Specification.Retrydef): () => Specification.R
return () => {
const model = new Specification.Retrydef(data);

validate('Retrydef', model);
validate('Retrydef', model.normalize());
return model;
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/builders/schedule-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function scheduleBuildingFn(data: Specification.Schedule): () => Specification.S
return () => {
const model = new Specification.Schedule(data);

validate('Schedule', model);
validate('Schedule', model.normalize());
return model;
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/builders/sleep-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function sleepBuildingFn(data: Specification.Sleep): () => Specification.Sleep {
return () => {
const model = new Specification.Sleep(data);

validate('Sleep', model);
validate('Sleep', model.normalize());
return model;
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/builders/startdef-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function startdefBuildingFn(data: Specification.Startdef): () => Specification.S
return () => {
const model = new Specification.Startdef(data);

validate('Startdef', model);
validate('Startdef', model.normalize());
return model;
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/builders/statedatafilter-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function statedatafilterBuildingFn(data: Specification.Statedatafilter): () => S
return () => {
const model = new Specification.Statedatafilter(data);

validate('Statedatafilter', model);
validate('Statedatafilter', model.normalize());
return model;
};
}
Expand Down
4 changes: 0 additions & 4 deletions src/lib/definitions/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ import { Sleep } from './sleep';

export class Action {
sourceModel?: Action;
/**
* Unique action identifier
*/
id?: string;
/**
* Unique action definition name
*/
Expand Down
8 changes: 8 additions & 0 deletions src/lib/definitions/actiondatafilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,12 @@ export class Actiondatafilter {
constructor(model: any) {
Object.assign(this, model);
}
/**
* Normalize the value of each property by recursively deleting properties whose value is equal to its default value. Does not modify the object state.
* @returns {Specification.Actiondatafilter} without deleted properties.
*/
normalize = (): Actiondatafilter => {
const clone = new Actiondatafilter(this);
return clone;
};
}
8 changes: 8 additions & 0 deletions src/lib/definitions/basicpropsdef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,12 @@ export class Basicpropsdef {

overwriteMetadata(this);
}
/**
* Normalize the value of each property by recursively deleting properties whose value is equal to its default value. Does not modify the object state.
* @returns {Specification.Basicpropsdef} without deleted properties.
*/
normalize = (): Basicpropsdef => {
const clone = new Basicpropsdef(this);
return clone;
};
}
8 changes: 8 additions & 0 deletions src/lib/definitions/bearerpropsdef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,12 @@ export class Bearerpropsdef {
Object.assign(this, model);
overwriteMetadata(this);
}
/**
* Normalize the value of each property by recursively deleting properties whose value is equal to its default value. Does not modify the object state.
* @returns {Specification.Bearerpropsdef} without deleted properties.
*/
normalize = (): Bearerpropsdef => {
const clone = new Bearerpropsdef(this);
return clone;
};
}
4 changes: 2 additions & 2 deletions src/lib/definitions/branch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export class Branch /* Branch Definition */ {
* State specific timeouts
*/
timeouts?: {
actionExecTimeout?: /* Single actions definition execution timeout duration (ISO 8601 duration format) */ ActionExecTimeout;
branchExecTimeout?: /* Single branch execution timeout duration (ISO 8601 duration format) */ BranchExecTimeout;
actionExecTimeout?: /* Action execution timeout duration (ISO 8601 duration format) */ ActionExecTimeout;
branchExecTimeout?: /* Branch execution timeout duration (ISO 8601 duration format) */ BranchExecTimeout;
};
/**
* Actions to be executed in this branch
Expand Down
11 changes: 5 additions & 6 deletions src/lib/definitions/callbackstate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@ import {
overwriteEventDataFilter,
overwriteMetadata,
overwriteOnErrors,
overwritePropertyAsPlainType,
overwriteStateDataFilter,
overwriteTimeoutWithStateExecTimeout,
overwriteTransition,
setEndValueIfNoTransition,
} from './utils';
import { ActionExecTimeout, EventTimeout } from './types';
import { StateExecTimeout } from './stateExecTimeout';
import { ActionExecTimeout, EventTimeout, StateExecTimeout } from './types';

export class Callbackstate {
sourceModel?: Callbackstate;
Expand Down Expand Up @@ -67,8 +66,8 @@ export class Callbackstate {
* State specific timeouts
*/
timeouts?: {
stateExecTimeout?: StateExecTimeout;
actionExecTimeout?: /* Single actions definition execution timeout duration (ISO 8601 duration format) */ ActionExecTimeout;
stateExecTimeout?: /* Workflow state execution timeout duration (ISO 8601 duration format) */ StateExecTimeout;
actionExecTimeout?: /* Action execution timeout duration (ISO 8601 duration format) */ ActionExecTimeout;
eventTimeout?: /* Timeout duration to wait for consuming defined events (ISO 8601 duration format) */ EventTimeout;
};
/**
Expand Down Expand Up @@ -113,7 +112,7 @@ export class Callbackstate {
Object.assign(this, defaultModel, model);

overwriteAction(this);
overwriteTimeoutWithStateExecTimeout(this);
overwritePropertyAsPlainType('timeouts', this);
overwriteEventDataFilter(this);
overwriteStateDataFilter(this);
overwriteOnErrors(this);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/definitions/continueasdef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class Continueasdef {
/**
* Version of the workflow to continue execution as
*/
version?: string;
version?: string; // ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
/**
* If string type, an expression which selects parts of the states data output to become the workflow data input of continued execution. If object type, a custom object to become the workflow data input of the continued execution
*/
Expand Down
8 changes: 8 additions & 0 deletions src/lib/definitions/correlationDef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,12 @@ export class CorrelationDef {
constructor(model: any) {
Object.assign(this, model);
}
/**
* Normalize the value of each property by recursively deleting properties whose value is equal to its default value. Does not modify the object state.
* @returns {Specification.CorrelationDef} without deleted properties.
*/
normalize = (): CorrelationDef => {
const clone = new CorrelationDef(this);
return clone;
};
}
8 changes: 8 additions & 0 deletions src/lib/definitions/crondef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,12 @@ export class Crondef {
constructor(model: any) {
Object.assign(this, model);
}
/**
* Normalize the value of each property by recursively deleting properties whose value is equal to its default value. Does not modify the object state.
* @returns {Specification.Crondef} without deleted properties.
*/
normalize = (): Crondef => {
const clone = new Crondef(this);
return clone;
};
}
13 changes: 4 additions & 9 deletions src/lib/definitions/databasedswitchstate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,12 @@ import {
overwriteMetadata,
overwriteOnErrors,
overwriteStateDataFilter,
overwriteTimeoutWithStateExecTimeout,
overwritePropertyAsPlainType,
} from './utils';
import { Datacondition } from './types';
import { StateExecTimeout } from './stateExecTimeout';
import { Datacondition, StateExecTimeout } from './types';

export class Databasedswitchstate {
sourceModel?: Databasedswitchstate;
/**
* Unique State id
*/
id?: string;
/**
* State name
*/
Expand All @@ -56,7 +51,7 @@ export class Databasedswitchstate {
* State specific timeouts
*/
timeouts?: {
stateExecTimeout?: StateExecTimeout;
stateExecTimeout?: /* Workflow state execution timeout duration (ISO 8601 duration format) */ StateExecTimeout;
};
/**
* Defines conditions evaluated against state data
Expand Down Expand Up @@ -87,7 +82,7 @@ export class Databasedswitchstate {
Object.assign(this, defaultModel, model);

overwriteStateDataFilter(this);
overwriteTimeoutWithStateExecTimeout(this);
overwritePropertyAsPlainType('timeouts', this);
overwriteDataConditions(this);
overwriteOnErrors(this);
overwriteDefaultCondition(this);
Expand Down
Loading

0 comments on commit 204113a

Please sign in to comment.