SIGN IN SIGN UP

feat: add client-scoped filtering to node input params (#6107)

* feat: add client-scoped filtering to node input params

Adds a `client` field to `INodeParams` and `INodeOptionsValue` so node
authors can restrict params or dropdown options to specific clients
(agentflowv2 canvas or agentflowsdk). The server filters params before
responding based on a `?client=` query param passed by each client.

- Add `ClientType = 'agentflowv2' | 'agentflowsdk'` to Interface.ts
- Add `client?: Array<ClientType>` to INodeParams and INodeOptionsValue
- Server nodes service: add filterNodeByClient() applied to all node fetch paths
- Server nodes controller: read and forward ?client= query param
- packages/agentflow API: pass ?client=agentflowsdk on all node fetches
- packages/ui API: pass ?client=agentflowv2 on all node fetches
- Add tests for filterNodeByClient and update agentflow node API tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Made-with: Cursor

* refactor: move filterNodeByClient to bottom of nodes service

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: address PR review comments on client-scoped node filtering

- Validate ?client= query param against allowlist before casting to ClientType
- Extract VALID_CLIENT_TYPES const to flowise-components Interface.ts as single source of truth
- Make filterNodeByClient pure by returning a new object instead of mutating node.inputs
- Add immutability test to nodes.test.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
J
jchui-wd committed
8985c5ec557cc9a341b1a81a30846d0fb1117b62
Parent: 2aeb9ff
Committed by GitHub <noreply@github.com> on 4/6/2026, 4:41:21 PM