Skip to content

Commit 9760570

Browse files
committedJan 13, 2025··
Fixed builders output type
- Fixed the builders output type - Added more samples Signed-off-by: Jean-Baptiste Bianchi <[email protected]>
1 parent fc5defd commit 9760570

File tree

177 files changed

+1912
-1090
lines changed

Some content is hidden

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

177 files changed

+1912
-1090
lines changed
 

‎README.md

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ The fluent builders wrap the core classes and provide a fluent API for construct
4949

5050
The fluent builders are directly exported as `*<desired-type>*Builder`, e.g., `workflowBuilder`.
5151

52+
By default, built objects are self-validated and self-normalized. `BuildOptions` can be passed to the `build()` method to disable validation or normalization.
53+
5254
### Validation Function
5355
The SDK includes a validation function to check if objects conform to the expected schema. This function ensures that your workflow objects are correctly structured and meet the required specifications.
5456

‎examples/browser/index.html renamed to ‎examples/browser/using-class.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
</head>
1010

1111
<body>
12-
<div id="output"></div>
12+
<pre id="output"></pre>
1313
<script src="../../dist/umd/index.umd.js"></script>
1414
<script type="text/javascript">
1515
(() => {
1616
const { Classes: { Workflow } } = serverWorkflowSdk;
1717
const workflow = new Workflow({
1818
document: {
1919
dsl: '1.0.0-alpha5',
20-
name: 'test',
20+
name: 'using-class',
2121
version: '1.0.0',
2222
namespace: 'default',
2323
},
@@ -33,7 +33,7 @@
3333
});
3434
try {
3535
workflow.validate();
36-
document.getElementById('output').innerHTML = workflow.serialize('json');
36+
document.getElementById('output').innerHTML = `--- YAML ---\n${workflow.serialize()}\n\n--- JSON ---\n${workflow.serialize('json')}`;
3737
} catch (ex) {
3838
console.error('Invalid workflow', ex);
3939
}

0 commit comments

Comments
 (0)
Please sign in to comment.