pipedream icon indicating copy to clipboard operation
pipedream copied to clipboard

vapi: add cursor-based pagination to phoneNumberId, assistantId, and squadId propDefinitions

Open coderabbitai[bot] opened this issue 5 months ago • 1 comments

Summary

The phoneNumberId, assistantId, and squadId propDefinitions in components/vapi/vapi.app.mjs currently fetch only a single page of results using limit: LIMIT (1000 records — the documented per-request maximum). Truncation is therefore only an issue for accounts with more than 1000 records per resource type, but the async options() functions should ideally support load-more pagination.

Background

Raised during review of #21084 (comment: https://github.com/PipedreamHQ/pipedream/pull/21084#discussion_r3367045633).

The existing async *paginate() helper in vapi.app.mjs consumes a { data, meta: { current_page, last_page } } response shape, but the Vapi GET /phone-number, GET /assistant, and GET /squad list endpoints return plain arrays, not that shape. Vapi uses createdAtLt cursor pagination on these endpoints.

Work needed

  • Implement cursor-based (createdAtLt) pagination for the three propDefinitions:
    • phoneNumberId — GET /phone-number
    • assistantId — GET /assistant
    • squadId — GET /squad
  • Either add a new paginateCursor() helper to the app file, or replicate the cursor logic inline in each async options().
  • Wire up prevContext to pass the cursor between load-more calls.
  • Bump the app package version accordingly.

References

  • PR where this was deferred: #21084
  • Vapi phone-number list docs: https://docs.vapi.ai/api-reference/phone-numbers/list

/cc @VibhanshuPandey

coderabbitai[bot] avatar Jun 06 '26 10:06 coderabbitai[bot]

Duplicate of #21085 (the bot double-fired when creating the tracking issue).

VibhanshuPandey avatar Jun 06 '26 12:06 VibhanshuPandey