otomato-sdk 2.0.26 → 2.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -192,19 +192,6 @@ export class Workflow {
|
|
|
192
192
|
return this.notes.map(note => note.toJSON());
|
|
193
193
|
}
|
|
194
194
|
toJSON() {
|
|
195
|
-
// 1. Create a new Workflow instance, copying only the nodes, edges, and notes
|
|
196
|
-
const clonedWorkflow = new Workflow(this.name, // same name
|
|
197
|
-
[...this.nodes], // shallow copy of nodes
|
|
198
|
-
[...this.edges] // shallow copy of edges
|
|
199
|
-
);
|
|
200
|
-
clonedWorkflow.notes = [...this.notes]; // shallow copy of notes array
|
|
201
|
-
// 2. Identify any empty nodes (blockId === 0), then delete them from the clone
|
|
202
|
-
const emptyNodes = clonedWorkflow.nodes.filter(node => node.blockId === 0);
|
|
203
|
-
for (const emptyNode of emptyNodes) {
|
|
204
|
-
clonedWorkflow.deleteNode(emptyNode);
|
|
205
|
-
}
|
|
206
|
-
// 3. Return JSON using 'this' for top-level info (id, state, etc.),
|
|
207
|
-
// but using the clonedWorkflow's nodes, edges, and notes
|
|
208
195
|
return {
|
|
209
196
|
id: this.id,
|
|
210
197
|
name: this.name,
|
|
@@ -212,9 +199,9 @@ export class Workflow {
|
|
|
212
199
|
dateCreated: this.dateCreated,
|
|
213
200
|
dateModified: this.dateModified,
|
|
214
201
|
executionId: this.executionId,
|
|
215
|
-
nodes:
|
|
216
|
-
edges:
|
|
217
|
-
notes:
|
|
202
|
+
nodes: this.nodes.map(node => node.toJSON()),
|
|
203
|
+
edges: this.edges.map(edge => edge.toJSON()),
|
|
204
|
+
notes: this.getNotes(),
|
|
218
205
|
};
|
|
219
206
|
}
|
|
220
207
|
create() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.28";
|
|
2
2
|
export declare function compareVersions(v1: string, v2: string): number;
|