Skip to content

Code formatting #160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 31 additions & 31 deletions examples/browser/index.html
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
<!doctype html>
<html lang="en">
<head>
<head>
<meta charset="utf-8">
<title>Serveless Workflow JS SDK</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<!--
Run http-server from the project root then navigate to http://localhost:8080/examples/browser/index.html
-->
<div id="output"></div>
<script src="../../dist/umd/index.umd.js"></script>
<script type="text/javascript">
(() => {
const { workflowBuilder, injectstateBuilder } = serverWorkflowSdk;
<meta content="width=device-width, initial-scale=1" name="viewport">
</head>
<body>
<!--
Run http-server from the project root then navigate to http://localhost:8080/examples/browser/index.html
-->
<div id="output"></div>
<script src="../../dist/umd/index.umd.js"></script>
<script type="text/javascript">
(() => {
const {workflowBuilder, injectstateBuilder} = serverWorkflowSdk;
const outputDiv = document.getElementById('output');
const workflow = workflowBuilder()
.id("helloworld")
.version("1.0")
.specVersion("0.8")
.name("Hello World Workflow")
.description("Inject Hello World")
.start("Hello State")
.states([
injectstateBuilder()
.name("Hello State")
.data({
"result": "Hello World!"
})
.end(true)
.build()
])
.build();
.id("helloworld")
.version("1.0")
.specVersion("0.8")
.name("Hello World Workflow")
.description("Inject Hello World")
.start("Hello State")
.states([
injectstateBuilder()
.name("Hello State")
.data({
"result": "Hello World!"
})
.end(true)
.build()
])
.build();
outputDiv.innerHTML = workflow.id;
})();
</script>
</body>
})();
</script>
</body>
</html>
9 changes: 4 additions & 5 deletions examples/browser/mermaid.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
<meta charset="utf-8">
<title>Serveless Workflow JS SDK</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="width=device-width, initial-scale=1" name="viewport">
</head>
<body>
<!--
Run http-server from the project root then navigate to http://localhost:8080/examples/browser/mermaid.html
-->
<div id="mermaid" class="mermaid"></div>
<div class="mermaid" id="mermaid"></div>
<script src="../../dist/umd/index.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>mermaid.initialize({startOnLoad:true});</script>
<script>mermaid.initialize({startOnLoad: true});</script>
<script type="text/javascript">
(() => {
const { workflowBuilder, injectstateBuilder, MermaidDiagram } = serverWorkflowSdk;
const {workflowBuilder, injectstateBuilder, MermaidDiagram} = serverWorkflowSdk;
const mermaidDiv = document.getElementById('mermaid');
const workflow = workflowBuilder()
.id("helloworld")
Expand All @@ -42,6 +42,5 @@
</script>



</body>
</html>
3 changes: 2 additions & 1 deletion examples/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { workflowBuilder, injectstateBuilder, Specification } from '../../dist';
import { injectstateBuilder, Specification, workflowBuilder } from '../../dist';

const workflow: Specification.Workflow = workflowBuilder()
.id('helloworld')
.version('1.0')
Expand Down
1 change: 1 addition & 0 deletions src/lib/builders/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Auto generated notice

This directory and its content has been generated automatically. Do not modify its content, it WILL be lost.
25 changes: 12 additions & 13 deletions src/lib/definitions/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,6 @@ import { Sleep } from './sleep';

export class Action {
sourceModel?: Action;

constructor(model: any) {
this.sourceModel = Object.assign({}, model);

Object.assign(this, model);

overwriteFunctionRef(this);
overwriteEventRef(this);
overwriteSubFlowRef(this);
overwriteSleep(this);
overwriteActionDataFilter(this);
}

/**
* Unique action identifier
*/
Expand Down Expand Up @@ -75,6 +62,18 @@ export class Action {
*/
condition?: string;

constructor(model: any) {
this.sourceModel = Object.assign({}, model);

Object.assign(this, model);

overwriteFunctionRef(this);
overwriteEventRef(this);
overwriteSubFlowRef(this);
overwriteSleep(this);
overwriteActionDataFilter(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.Action} without deleted properties.
Expand Down
8 changes: 4 additions & 4 deletions src/lib/definitions/actiondatafilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
*/

export class Actiondatafilter {
constructor(model: any) {
Object.assign(this, model);
}

/**
* Workflow expression that selects state data that the state action can use
*/
Expand All @@ -35,4 +31,8 @@ export class Actiondatafilter {
* Workflow expression that selects a state data element to which the action results should be added/merged into. If not specified, denote, the top-level state data element
*/
toStateData?: string;

constructor(model: any) {
Object.assign(this, model);
}
}
18 changes: 9 additions & 9 deletions src/lib/definitions/authdef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ import { Properties } from './types';

export class Authdef {
sourceModel?: Authdef;

constructor(model: any) {
this.sourceModel = Object.assign({}, model);

const defaultModel = { scheme: 'basic' };
Object.assign(this, defaultModel, model);

overwriteProperties(this);
}
/**
* Unique auth definition name
*/
Expand All @@ -38,6 +29,15 @@ export class Authdef {
scheme?: 'basic' | 'bearer' | 'oauth2';
properties: string | Properties;

constructor(model: any) {
this.sourceModel = Object.assign({}, model);

const defaultModel = { scheme: 'basic' };
Object.assign(this, defaultModel, model);

overwriteProperties(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.Authdef} without deleted properties.
Expand Down
13 changes: 7 additions & 6 deletions src/lib/definitions/basicpropsdef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@

import { Metadata } from './metadata';
import { overwriteMetadata } from './utils';
export class Basicpropsdef {
constructor(model: any) {
Object.assign(this, model);

overwriteMetadata(this);
}

export class Basicpropsdef {
/**
* String or a workflow expression. Contains the user name
*/
Expand All @@ -32,4 +27,10 @@ export class Basicpropsdef {
*/
password: string;
metadata?: /* Metadata information */ Metadata;

constructor(model: any) {
Object.assign(this, model);

overwriteMetadata(this);
}
}
11 changes: 6 additions & 5 deletions src/lib/definitions/bearerpropsdef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@

import { Metadata } from './metadata';
import { overwriteMetadata } from './utils';
export class Bearerpropsdef {
constructor(model: any) {
Object.assign(this, model);
overwriteMetadata(this);
}

export class Bearerpropsdef {
/**
* String or a workflow expression. Contains the token
*/
token: string;
metadata?: /* Metadata information */ Metadata;

constructor(model: any) {
Object.assign(this, model);
overwriteMetadata(this);
}
}
17 changes: 8 additions & 9 deletions src/lib/definitions/branch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ import { ActionExecTimeout, BranchExecTimeout } from './types';

export class Branch /* Branch Definition */ {
sourceModel?: Branch;

constructor(model: any) {
this.sourceModel = Object.assign({}, model);

Object.assign(this, model);
overwriteActions(this);
overwritePropertyAsPlainType('timeouts', this);
}

/**
* Branch name
*/
Expand All @@ -45,6 +36,14 @@ export class Branch /* Branch Definition */ {
*/
actions: Action[];

constructor(model: any) {
this.sourceModel = Object.assign({}, model);

Object.assign(this, model);
overwriteActions(this);
overwritePropertyAsPlainType('timeouts', 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.Branch} without deleted properties.
Expand Down
42 changes: 21 additions & 21 deletions src/lib/definitions/callbackstate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,6 @@ import { StateExecTimeout } from './stateExecTimeout';

export class Callbackstate {
sourceModel?: Callbackstate;

constructor(model: any) {
this.sourceModel = Object.assign({}, model);

const defaultModel = {
id: undefined,
name: undefined,
type: 'callback',
usedForCompensation: false,
};
Object.assign(this, defaultModel, model);

overwriteAction(this);
overwriteTimeoutWithStateExecTimeout(this);
overwriteEventDataFilter(this);
overwriteStateDataFilter(this);
overwriteOnErrors(this);
overwriteTransition(this);
overwriteEnd(this);
overwriteMetadata(this);
}
/**
* Unique state id
*/
Expand Down Expand Up @@ -122,6 +101,27 @@ export class Callbackstate {
usedForCompensation?: boolean;
metadata?: /* Metadata information */ Metadata;

constructor(model: any) {
this.sourceModel = Object.assign({}, model);

const defaultModel = {
id: undefined,
name: undefined,
type: 'callback',
usedForCompensation: false,
};
Object.assign(this, defaultModel, model);

overwriteAction(this);
overwriteTimeoutWithStateExecTimeout(this);
overwriteEventDataFilter(this);
overwriteStateDataFilter(this);
overwriteOnErrors(this);
overwriteTransition(this);
overwriteEnd(this);
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.Callbackstate} without deleted properties.
Expand Down
17 changes: 8 additions & 9 deletions src/lib/definitions/continueasdef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ import {

export class Continueasdef {
sourceModel?: Continueasdef;

constructor(model: any) {
this.sourceModel = Object.assign({}, model);

Object.assign(this, model);
overwriteWorkflowExecTimeout(this);
overwritePropertyAsPlainType('data', this);
}

/**
* Unique id of the workflow to continue execution as
*/
Expand All @@ -55,6 +46,14 @@ export class Continueasdef {
*/
workflowExecTimeout?: WorkflowExecTimeout;

constructor(model: any) {
this.sourceModel = Object.assign({}, model);

Object.assign(this, model);
overwriteWorkflowExecTimeout(this);
overwritePropertyAsPlainType('data', 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.Exectimeout} without deleted properties.
Expand Down
8 changes: 4 additions & 4 deletions src/lib/definitions/correlationDef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
*/

export class CorrelationDef {
constructor(model: any) {
Object.assign(this, model);
}

/**
* CloudEvent Extension Context Attribute name
*/
Expand All @@ -27,4 +23,8 @@ export class CorrelationDef {
* CloudEvent Extension Context Attribute value
*/
contextAttributeValue?: string;

constructor(model: any) {
Object.assign(this, model);
}
}
Loading