fix(tickets): handle bare object response and enable pagination#2
Merged
fix(tickets): handle bare object response and enable pagination#2
Conversation
GET /Tickets/{id} and GET /Actions/{id} return the entity directly,
not wrapped in {tickets:[]}/{actions:[]} as the list endpoints do.
The SDK was unwrapping unconditionally, causing
"Cannot read properties of undefined (reading '0')" on every get call.
Also: HaloPSA silently ignores page_size/page_no unless `pageinate=true`
(their typo) is also sent. The SDK's list and pagination helpers now
include `pageinate=true` automatically when paging params are set,
so caller-supplied `pageSize` is honored instead of capping at 50.
3 tasks
github-actions Bot
pushed a commit
that referenced
this pull request
May 6, 2026
## [1.0.2](v1.0.1...v1.0.2) (2026-05-06) ### Bug Fixes * **tickets:** handle bare object response and enable pagination ([#2](#2)) ([c822233](c822233))
asachs01
added a commit
to wyre-technology/halopsa-mcp
that referenced
this pull request
May 6, 2026
Picks up the SDK fixes for halopsa_tickets_get (bare-object response) and halopsa_tickets_list pagination (`pageinate=true` requirement). Companion to wyre-technology/node-halopsa#2 — do not merge until that SDK release publishes to GHCR/npm.
3 tasks
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
tickets.get()andactions.get()no longer crash with Cannot read properties of undefined (reading '0'). HaloPSA'sGET /Tickets/{id}returns a bareTicketobject, not{ tickets: [...] }. We now accept either shape.tickets.list()andactions.list()now honor caller-suppliedpageSize/pageNo. HaloPSA silently ignores those params unlesspageinate=true(their typo) is also sent —buildListParamsand the paginated iterator now set it automatically.Why
Reported by an external user:
halopsa_tickets_listalways returned 50 results regardless oflimit, andhalopsa_tickets_getfailed on every call.Test plan
npm test(68 tests pass)tickets.gethandles bare-object response shape