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:
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
/cc @VibhanshuPandey
Summary
The
phoneNumberId,assistantId, andsquadIdpropDefinitions incomponents/vapi/vapi.app.mjscurrently fetch only a single page of results usinglimit: 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 theasync options()functions should ideally support load-more pagination.Background
Raised during review of #21084 (comment: #21084 (comment)).
The existing
async *paginate()helper invapi.app.mjsconsumes a{ data, meta: { current_page, last_page } }response shape, but the VapiGET /phone-number,GET /assistant, andGET /squadlist endpoints return plain arrays, not that shape. Vapi usescreatedAtLtcursor pagination on these endpoints.Work needed
createdAtLt) pagination for the three propDefinitions:phoneNumberId—GET /phone-numberassistantId—GET /assistantsquadId—GET /squadpaginateCursor()helper to the app file, or replicate the cursor logic inline in eachasync options().prevContextto pass the cursor between load-more calls.References
/cc @VibhanshuPandey