The index of the first element in the currently fetched page.
Number of items per page.
The raw data of the last retrieved page, including metadata.
The full API response for the most recently fetched page, or undefined
if no request has been made yet.
The index of the last element in the currently fetched page.
The total number of items in the dataset.
The total number of pages.
Enables asynchronous iteration over all available pages.
HttpError if the response status code is not within the 200-299
range.
UnregisteredUserError if the user is not registered in the authentication provider.
MissingScopeError if the access token does not include the required scope.
Fetches all pages and aggregates the results into a single array.
A combined array of all mapped data objects from all pages.
This method resets the paginator at the start and end of the operation. It sequentially requests each page and concatenates the results.
This method may take longer to execute, especially for users with a large volume of donations. For better performance with large datasets, consider using the getNext method to fetch data in chunks.
HttpError if the response status code is not within the 200-299
range.
UnregisteredUserError if the user is not registered in the authentication provider.
MissingScopeError if the access token does not include the required scope.
Fetches the next page of data, or the first page if no pages have been loaded yet.
An array of mapped data objects for the next page, or an empty array if the last page is reached.
This method automatically increments the page counter and checks the total number of pages to stop requests when the end is reached.
HttpError if the response status code is not within the 200-299
range.
UnregisteredUserError if the user is not registered in the authentication provider.
MissingScopeError if the access token does not include the required scope.
Fetches and returns data from a specific page.
The page number to fetch. Defaults to 1
.
An array of mapped data objects for the requested page.
If the requested page number exceeds the total number of pages, the method returns an empty array.
HttpError if the response status code is not within the 200-299
range.
UnregisteredUserError if the user is not registered in the authentication provider.
MissingScopeError if the access token does not include the required scope.
Fetches the previous page of data.
An array of mapped data objects for the previous page.
HttpError if the response status code is not within the 200-299
range.
UnregisteredUserError if the user is not registered in the authentication provider.
MissingScopeError if the access token does not include the required scope.
Donation Alerts API paginator.
Remarks
A utility class for managing paginated responses from the Donation Alerts API. This paginator supports navigating through paginated data by individual pages or fetching all data at once. It internally keeps track of the current page, total pages, and other metadata to simplify navigation.