@lgriffin/esi.ts - EVE Online ESI API Client - v12.3.0
    Preparing search index...
    • Fetch all pages of a cursor-paginated endpoint.

      ESI returns cursor tokens in the response body. This helper follows after tokens until the dataset is exhausted (empty items array).

      Usage with body-based cursors (ESI's actual format): const allJobs = await fetchAllCursorPages( (before, after) => client.freelanceJobs.getFreelanceJobs(before, after), (response) => response.freelance_jobs, (response) => response.cursor, );

      Usage with CursorResult shape: const all = await fetchAllCursorPages( (before, after) => fetcher({ before, after }), (r) => r.data, (r) => r.cursors, );

      Type Parameters

      • TResponse
      • TItem = unknown

      Parameters

      • fetcher: (before?: string, after?: string) => Promise<TResponse>
      • getItems: (response: TResponse) => TItem[]
      • getCursor: (response: TResponse) => { before?: string | null; after?: string | null }

      Returns Promise<TItem[]>