fix(devices): compile list() filters into df expression#50
Merged
Conversation
GET /v2/devices only honors df/pageSize/after — the named params the SDK sent (organizationId, status, nodeClass) were silently ignored by the API, so every filtered devices.list() returned the full unfiltered fleet. Compile organizationId/nodeClass/status into a df device-filter string (org=<id>, class=<NodeClass>, online|offline, status=PENDING), add an `after` param with `cursor` accepted as a string alias, and reject statuses with no df equivalent (UNKNOWN) instead of silently returning everything. The four unsupported passthrough fields (displayName, includeSystem/OS/NetworkInterfaces) are marked @deprecated and no longer sent. Refs: wyre-technology/ninjaone-mcp#56
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 5, 2026
## [2.0.1](v2.0.0...v2.0.1) (2026-07-05) ### Bug Fixes * **devices:** compile list() filters into df expression ([#50](#50)) ([6f2e661](6f2e661)), closes [wyre-technology/ninjaone-mcp#56](wyre-technology/ninjaone-mcp#56)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root-cause fix for the filter half of wyre-technology/ninjaone-mcp#56.
GET /v2/devicesonly acceptsdf(device filter),pageSize, andafter— butdevices.list()sentorganizationId/status/nodeClassas named query params, which the API silently ignores. Every filtered call therefore returned the full unfiltered fleet.Changes
dfexpression per the Ninja RMM Public API v2.0.5 Device Filter Syntax:organizationId→org=<id>nodeClass→class=<NodeClass>statusONLINE/OFFLINE → bareonline/offlinepredicates; APPROVAL_PENDING →status=PENDINGANDafterparam (numeric device-id pagination);cursorfromBaseListParamsis accepted as a string alias.dfequivalent (UNKNOWN) rather than silently returning everything — same principle as the deps-dev(deps-dev): bump the dev-dependencies group across 1 directory with 7 updates #54 board_id fix.displayName,includeSystem,includeOS,includeNetworkInterfaces)@deprecated; they're no longer sent.Testing
Four new integration tests (all verified failing before the change): multi-filter →
df=org=5 AND class=WINDOWS_WORKSTATION AND onlinewith named params absent; OFFLINE +cursoralias →df=offline&after=42; APPROVAL_PENDING →df=status=PENDING; UNKNOWN rejects. 90/90 pass,tsupbuild clean, no new lint warnings.Note on the MCP server
The companion
ninjaone_devices_listfix (forward the filters + surface a pagination cursor in the response so truncation is detectable) lands separately in ninjaone-mcp for #56.Refs wyre-technology/ninjaone-mcp#56