@seamapi/http - v2.4.1
    Preparing search index...

    Class SeamPaginator<TResponse, TResponseKey>

    Iterates over paginated results from Seam API list endpoints.

    Create a SeamPaginator with the client's createPaginator method. Fetch pages manually with firstPage and nextPage, iterate over pages with for await, iterate over items across all pages with flatten, or collect every item into a single array with flattenToArray.

    Type Parameters

    • const TResponse
    • const TResponseKey extends keyof TResponse

    Implements

    Index
    • Yields each page of items, fetching the next page as needed.

      Returns AsyncGenerator<EnsureReadonlyArray<TResponse[TResponseKey]>>

    • Fetches the first page of results along with the pagination state.

      Returns Promise<[EnsureReadonlyArray<TResponse[TResponseKey]>, Pagination]>

    • Yields each item across all pages, fetching the next page as needed.

      Returns AsyncGenerator<EnsureReadonlyArray<TResponse[TResponseKey]>>

    • Fetches every page and returns all items in a single array.

      Returns Promise<EnsureReadonlyArray<TResponse[TResponseKey]>>

    • Fetches the next page of results using the nextPageCursor returned with a previous page.

      Parameters

      Returns Promise<[EnsureReadonlyArray<TResponse[TResponseKey]>, Pagination]>