@runtypelabs/react-flow 0.3.17 → 0.3.18

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.3.17 build /home/runner/_work/core/core/packages/react-flow
2
+ > @runtypelabs/react-flow@0.3.18 build /home/runner/_work/core/core/packages/react-flow
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -10,7 +10,7 @@
10
10
  CLI Cleaning output folder
11
11
  CJS Build start
12
12
  ESM Build start
13
- CJS dist/index.js 105.58 KB
14
- CJS ⚡️ Build success in 252ms
15
- ESM dist/index.mjs 101.53 KB
16
- ESM ⚡️ Build success in 253ms
13
+ CJS dist/index.js 105.55 KB
14
+ CJS ⚡️ Build success in 197ms
15
+ ESM dist/index.mjs 101.50 KB
16
+ ESM ⚡️ Build success in 196ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @runtypelabs/react-flow
2
2
 
3
+ ## 0.3.18
4
+
5
+ ### Patch Changes
6
+
7
+ - 89b107f: feat(sdk): alias Flow/FlowStep/Tool from the OpenAPI spec; fix flow + tool response-schema drift
8
+
9
+ Continues the OpenAPI codegen swap (after #3645/#3665). Three coupled changes that all touch `entities.ts` + the regenerated spec + SDK `types.ts`:
10
+ - **Flow phantom fix (API spec accuracy):** the flow `GET`/`LIST`/`POST` response schemas advertised a `status` field the handlers stopped returning (removed in #3404), and the shared detail schema carried a `draftVersionId` that only the `PUT` handler returns. Removed `status` everywhere and split a dedicated `UpdatedFlowResponseSchema` (`FlowDetailSchema.extend({ draftVersionId })`) for the update route so `GET`/`POST` no longer promise it.
11
+ - **Tool schema split:** `GET /v1/tools/{id}` never attaches `validation` (only create/update/convert do, when custom-tool code produces warnings). Split `ToolDetailSchema` (base, GET) from `ToolWithValidationSchema` (create/update/convert).
12
+ - **SDK aliases:** `Flow`, `FlowStep`, and `Tool` are now `paths[...]`-derived from the generated spec instead of hand-written interfaces. Added a `FlowListItem` alias for the lighter `GET /v1/flows` list item and retyped `flows.list()` to `PaginationResponse<FlowListItem>` (it was incorrectly typed as the detail shape). `FlowListItem` is named to avoid colliding with the flow-execution `FlowSummary` already exported by `flow-builder.ts`.
13
+
14
+ This is a **major** bump for `@runtypelabs/sdk` because the generated shapes are looser/more accurate than the old interfaces: the GET flow detail no longer carries `status`/`description`, flow steps have optional `name`/`order`/`enabled`/`config`, the tool GET shape drops `validation`, and tool `config`/`parametersSchema` are typed as the JSONB records the API actually returns. Dashboard and CLI consumers are updated in lockstep.
15
+
16
+ - Updated dependencies [c3536a2]
17
+ - Updated dependencies [8fefe6f]
18
+ - Updated dependencies [a0b30f3]
19
+ - Updated dependencies [aa97266]
20
+ - Updated dependencies [42979fc]
21
+ - Updated dependencies [55d5817]
22
+ - Updated dependencies [89b107f]
23
+ - Updated dependencies [e1a4368]
24
+ - Updated dependencies [af80a8a]
25
+ - @runtypelabs/sdk@4.0.0
26
+
3
27
  ## 0.3.17
4
28
 
5
29
  ### Patch Changes
package/dist/index.js CHANGED
@@ -664,10 +664,10 @@ function useRuntypeFlow(options) {
664
664
  const steps = Array.isArray(flow.flowSteps) ? flow.flowSteps.map((s) => ({
665
665
  id: s.id,
666
666
  type: s.type,
667
- name: s.name,
668
- order: s.order,
669
- enabled: s.enabled,
670
- config: s.config
667
+ name: s.name ?? "",
668
+ order: s.order ?? 0,
669
+ enabled: s.enabled ?? true,
670
+ config: s.config ?? {}
671
671
  })) : [];
672
672
  let newNodes = flowStepsToNodes(steps, {
673
673
  onChange: handleStepChange,
@@ -680,7 +680,7 @@ function useRuntypeFlow(options) {
680
680
  const newEdges = createEdgesFromNodes(newNodes);
681
681
  setFlowId(id);
682
682
  setFlowName(flow.name || "");
683
- setFlowDescription(flow.description || "");
683
+ setFlowDescription("");
684
684
  setNodes(newNodes);
685
685
  setEdges(newEdges);
686
686
  setHasUnsavedChanges(false);
@@ -704,7 +704,6 @@ function useRuntypeFlow(options) {
704
704
  const steps = nodesToFlowSteps(nodes);
705
705
  await client.flows.update(flowId, {
706
706
  name: flowName,
707
- description: flowDescription,
708
707
  flowSteps: steps.map((step) => ({
709
708
  type: step.type,
710
709
  name: step.name,
package/dist/index.mjs CHANGED
@@ -662,10 +662,10 @@ function useRuntypeFlow(options) {
662
662
  const steps = Array.isArray(flow.flowSteps) ? flow.flowSteps.map((s) => ({
663
663
  id: s.id,
664
664
  type: s.type,
665
- name: s.name,
666
- order: s.order,
667
- enabled: s.enabled,
668
- config: s.config
665
+ name: s.name ?? "",
666
+ order: s.order ?? 0,
667
+ enabled: s.enabled ?? true,
668
+ config: s.config ?? {}
669
669
  })) : [];
670
670
  let newNodes = flowStepsToNodes(steps, {
671
671
  onChange: handleStepChange,
@@ -678,7 +678,7 @@ function useRuntypeFlow(options) {
678
678
  const newEdges = createEdgesFromNodes(newNodes);
679
679
  setFlowId(id);
680
680
  setFlowName(flow.name || "");
681
- setFlowDescription(flow.description || "");
681
+ setFlowDescription("");
682
682
  setNodes(newNodes);
683
683
  setEdges(newEdges);
684
684
  setHasUnsavedChanges(false);
@@ -702,7 +702,6 @@ function useRuntypeFlow(options) {
702
702
  const steps = nodesToFlowSteps(nodes);
703
703
  await client.flows.update(flowId, {
704
704
  name: flowName,
705
- description: flowDescription,
706
705
  flowSteps: steps.map((step) => ({
707
706
  type: step.type,
708
707
  name: step.name,
@@ -1,5 +1,21 @@
1
1
  # @runtypelabs/react-flow-example
2
2
 
3
+ ## 0.0.66
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [c3536a2]
8
+ - Updated dependencies [8fefe6f]
9
+ - Updated dependencies [a0b30f3]
10
+ - Updated dependencies [aa97266]
11
+ - Updated dependencies [42979fc]
12
+ - Updated dependencies [55d5817]
13
+ - Updated dependencies [89b107f]
14
+ - Updated dependencies [e1a4368]
15
+ - Updated dependencies [af80a8a]
16
+ - @runtypelabs/sdk@4.0.0
17
+ - @runtypelabs/react-flow@0.3.18
18
+
3
19
  ## 0.0.65
4
20
 
5
21
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/react-flow-example",
3
- "version": "0.0.65",
3
+ "version": "0.0.66",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/react-flow",
3
- "version": "0.3.17",
3
+ "version": "0.3.18",
4
4
  "description": "React Flow adapter for building visual flow editors with Runtype",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -16,7 +16,7 @@
16
16
  "*.css"
17
17
  ],
18
18
  "dependencies": {
19
- "@runtypelabs/sdk": "3.0.0"
19
+ "@runtypelabs/sdk": "4.0.0"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "@xyflow/react": "^12.0.0",
@@ -138,10 +138,10 @@ export function useRuntypeFlow(options: UseRuntypeFlowOptions): UseRuntypeFlowRe
138
138
  ? flow.flowSteps.map((s) => ({
139
139
  id: s.id,
140
140
  type: s.type as FlowStep['type'],
141
- name: s.name,
142
- order: s.order,
143
- enabled: s.enabled,
144
- config: s.config as FlowStep['config'],
141
+ name: s.name ?? '',
142
+ order: s.order ?? 0,
143
+ enabled: s.enabled ?? true,
144
+ config: (s.config ?? {}) as FlowStep['config'],
145
145
  }))
146
146
  : []
147
147
 
@@ -161,7 +161,9 @@ export function useRuntypeFlow(options: UseRuntypeFlowOptions): UseRuntypeFlowRe
161
161
 
162
162
  setFlowId(id)
163
163
  setFlowName(flow.name || '')
164
- setFlowDescription(flow.description || '')
164
+ // The flow GET response carries no `description` (the handler never
165
+ // selects it), so there is nothing to load into the editor here.
166
+ setFlowDescription('')
165
167
  setNodes(newNodes)
166
168
  setEdges(newEdges)
167
169
  setHasUnsavedChanges(false)
@@ -192,10 +194,13 @@ export function useRuntypeFlow(options: UseRuntypeFlowOptions): UseRuntypeFlowRe
192
194
  try {
193
195
  const steps = nodesToFlowSteps(nodes)
194
196
 
195
- // Update flow with metadata and steps in one atomic operation
197
+ // Update flow with metadata and steps in one atomic operation.
198
+ // `description` is intentionally omitted: the flow update endpoint does
199
+ // not persist it (the GET response carries no description either), so
200
+ // sending the local value here would be a no-op at best and could
201
+ // overwrite a description with an empty string if the schema ever changes.
196
202
  await client.flows.update(flowId, {
197
203
  name: flowName,
198
- description: flowDescription,
199
204
  flowSteps: steps.map((step) => ({
200
205
  type: step.type as NonNullable<CreateFlowRequest['flowSteps']>[number]['type'],
201
206
  name: step.name,