Skip to content

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

@coderabbitai

Description

@coderabbitai

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: #21084 (comment)).

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:
    • phoneNumberIdGET /phone-number
    • assistantIdGET /assistant
    • squadIdGET /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

/cc @VibhanshuPandey

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions