Skip to content

Commit

Permalink
Merge pull request #131 from antmendoza/update_verions_07_3
Browse files Browse the repository at this point in the history
update to  v07 specification
  • Loading branch information
antmendoza authored Aug 18, 2021
2 parents 0d708de + c393ac8 commit e7893a8
Show file tree
Hide file tree
Showing 57 changed files with 2,515 additions and 548 deletions.
41 changes: 41 additions & 0 deletions src/lib/builders/authdef-builder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2021-Present The Serverless Workflow Specification Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { Builder, builder } from '../builder';
import { Specification } from '../definitions';
import { validate } from '../utils';

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

validate('Authdef', model);
return model;
};
}

/**
* A factory to create a builder proxy for the type `Specification.Authdef`
* @returns {Specification.Authdef} A builder for `Specification.Authdef`
*/
export function authdefBuilder(): Builder<Specification.Authdef> {
return builder<Specification.Authdef>(authdefBuildingFn);
}
41 changes: 41 additions & 0 deletions src/lib/builders/basicpropsdef-builder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2021-Present The Serverless Workflow Specification Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { Builder, builder } from '../builder';
import { Specification } from '../definitions';
import { validate } from '../utils';

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

validate('Basicpropsdef', model);
return model;
};
}

/**
* A factory to create a builder proxy for the type `Specification.Basicpropsdef`
* @returns {Specification.Basicpropsdef} A builder for `Specification.Basicpropsdef`
*/
export function basicpropsdefBuilder(): Builder<Specification.Basicpropsdef> {
return builder<Specification.Basicpropsdef>(basicpropsdefBuildingFn);
}
41 changes: 41 additions & 0 deletions src/lib/builders/bearerpropsdef-builder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2021-Present The Serverless Workflow Specification Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { Builder, builder } from '../builder';
import { Specification } from '../definitions';
import { validate } from '../utils';

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

validate('Bearerpropsdef', model);
return model;
};
}

/**
* A factory to create a builder proxy for the type `Specification.Bearerpropsdef`
* @returns {Specification.Bearerpropsdef} A builder for `Specification.Bearerpropsdef`
*/
export function bearerpropsdefBuilder(): Builder<Specification.Bearerpropsdef> {
return builder<Specification.Bearerpropsdef>(bearerpropsdefBuildingFn);
}
41 changes: 41 additions & 0 deletions src/lib/builders/continueasdef-builder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2021-Present The Serverless Workflow Specification Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { Builder, builder } from '../builder';
import { Specification } from '../definitions';
import { validate } from '../utils';

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

validate('Continueasdef', model);
return model;
};
}

/**
* A factory to create a builder proxy for the type `Specification.Continueasdef`
* @returns {Specification.Continueasdef} A builder for `Specification.Continueasdef`
*/
export function continueasdefBuilder(): Builder<Specification.Continueasdef> {
return builder<Specification.Continueasdef>(continueasdefBuildingFn);
}
41 changes: 41 additions & 0 deletions src/lib/builders/errordef-builder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2021-Present The Serverless Workflow Specification Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { Builder, builder } from '../builder';
import { Specification } from '../definitions';
import { validate } from '../utils';

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

validate('Errordef', model);
return model;
};
}

/**
* A factory to create a builder proxy for the type `Specification.Errordef`
* @returns {Specification.Errordef} A builder for `Specification.Errordef`
*/
export function errordefBuilder(): Builder<Specification.Errordef> {
return builder<Specification.Errordef>(errordefBuildingFn);
}
10 changes: 9 additions & 1 deletion src/lib/builders/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@
export * from './workflow-builder';
export * from './action-builder';
export * from './actiondatafilter-builder';
export * from './authdef-builder';
export * from './basicpropsdef-builder';
export * from './bearerpropsdef-builder';
export * from './branch-builder';
export * from './callbackstate-builder';
export * from './continueasdef-builder';
export * from './correlation-def-builder';
export * from './crondef-builder';
export * from './databasedswitch-builder';
export * from './defaultconditiondef-builder';
export * from './delaystate-builder';
export * from './end-builder';
export * from './enddatacondition-builder';
export * from './enddeventcondition-builder';
export * from './error-builder';
export * from './errordef-builder';
export * from './eventbasedswitch-builder';
export * from './eventdatafilter-builder';
export * from './eventdef-builder';
Expand All @@ -38,13 +42,17 @@ export * from './function-builder';
export * from './functionref-builder';
export * from './injectstate-builder';
export * from './metadata-builder';
export * from './oauth2propsdef-builder';
export * from './onevents-builder';
export * from './operationstate-builder';
export * from './parallelstate-builder';
export * from './produceeventdef-builder';
export * from './retrydef-builder';
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
41 changes: 41 additions & 0 deletions src/lib/builders/oauth2propsdef-builder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2021-Present The Serverless Workflow Specification Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { Builder, builder } from '../builder';
import { Specification } from '../definitions';
import { validate } from '../utils';

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

validate('Oauth2propsdef', model);
return model;
};
}

/**
* A factory to create a builder proxy for the type `Specification.Oauth2propsdef`
* @returns {Specification.Oauth2propsdef} A builder for `Specification.Oauth2propsdef`
*/
export function oauth2propsdefBuilder(): Builder<Specification.Oauth2propsdef> {
return builder<Specification.Oauth2propsdef>(oauth2propsdefBuildingFn);
}
41 changes: 41 additions & 0 deletions src/lib/builders/sleep-builder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2021-Present The Serverless Workflow Specification Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { Builder, builder } from '../builder';
import { Specification } from '../definitions';
import { validate } from '../utils';

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

validate('Sleep', model);
return model;
};
}

/**
* A factory to create a builder proxy for the type `Specification.Sleep`
* @returns {Specification.Sleep} A builder for `Specification.Sleep`
*/
export function sleepBuilder(): Builder<Specification.Sleep> {
return builder<Specification.Sleep>(sleepBuildingFn);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,25 @@
import { Builder, builder } from '../builder';
import { Specification } from '../definitions';
import { validate } from '../utils';
import { setEndValueIfNoTransition } from '../definitions/utils';

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

setEndValueIfNoTransition(model);

validate('Delaystate', model);
validate('Sleepstate', model);
return model;
};
}

/**
* A factory to create a builder proxy for the type `Specification.Delaystate`
* @returns {Specification.Delaystate} A builder for `Specification.Delaystate`
* A factory to create a builder proxy for the type `Specification.Sleepstate`
* @returns {Specification.Sleepstate} A builder for `Specification.Sleepstate`
*/
export function delaystateBuilder(): Builder<Specification.Delaystate> {
return builder<Specification.Delaystate>(delaystateBuildingFn);
export function sleepstateBuilder(): Builder<Specification.Sleepstate> {
return builder<Specification.Sleepstate>(sleepstateBuildingFn);
}
Loading

0 comments on commit e7893a8

Please sign in to comment.