@runtypelabs/react-flow 0.1.3 → 0.1.4

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @runtypelabs/react-flow@0.1.3 build /home/runner/work/core/core/packages/react-flow
2
+ > @runtypelabs/react-flow@0.1.4 build /home/runner/work/core/core/packages/react-flow
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -10,9 +10,9 @@
10
10
  CLI Cleaning output folder
11
11
  CJS Build start
12
12
  ESM Build start
13
- ESM dist/index.mjs 100.52 KB
14
- ESM dist/index.mjs.map 224.24 KB
15
- ESM ⚡️ Build success in 2197ms
16
- CJS dist/index.js 104.57 KB
17
- CJS dist/index.js.map 224.56 KB
18
- CJS ⚡️ Build success in 2197ms
13
+ CJS dist/index.js 104.29 KB
14
+ CJS dist/index.js.map 224.04 KB
15
+ CJS ⚡️ Build success in 2183ms
16
+ ESM dist/index.mjs 100.24 KB
17
+ ESM dist/index.mjs.map 223.72 KB
18
+ ESM ⚡️ Build success in 2183ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @runtypelabs/react-flow
2
2
 
3
+ ## 0.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [9ec83bd]
8
+ - Updated dependencies [a63f268]
9
+ - @runtypelabs/sdk@0.3.0
10
+
3
11
  ## 0.1.3
4
12
 
5
13
  ### Patch Changes
package/dist/index.js CHANGED
@@ -644,8 +644,7 @@ function useRuntypeFlow(options) {
644
644
  setError(null);
645
645
  try {
646
646
  const flow = await client.flows.get(id);
647
- const stepsResponse = await client.flowSteps.getByFlow(id);
648
- const steps = Array.isArray(stepsResponse) ? stepsResponse : [];
647
+ const steps = Array.isArray(flow.flowSteps) ? flow.flowSteps : [];
649
648
  let newNodes = flowStepsToNodes(steps, {
650
649
  onChange: handleStepChange,
651
650
  onDelete: handleStepDelete
@@ -681,22 +680,15 @@ function useRuntypeFlow(options) {
681
680
  const steps = nodesToFlowSteps(nodes);
682
681
  await client.flows.update(flowId, {
683
682
  name: flowName,
684
- description: flowDescription
685
- });
686
- const existingSteps = await client.flowSteps.getByFlow(flowId);
687
- for (const step of existingSteps) {
688
- await client.flowSteps.delete(step.id);
689
- }
690
- for (const step of steps) {
691
- await client.flowSteps.create({
692
- flowId,
683
+ description: flowDescription,
684
+ flow_steps: steps.map((step) => ({
693
685
  type: step.type,
694
686
  name: step.name,
695
687
  order: step.order,
696
688
  enabled: step.enabled,
697
689
  config: step.config
698
- });
699
- }
690
+ }))
691
+ });
700
692
  setHasUnsavedChanges(false);
701
693
  lastSavedState.current = JSON.stringify(steps);
702
694
  return {