Options
All
  • Public
  • Public/Protected
  • All
Menu

External module common/lib/paginators

Type aliases

Request

Request: hasPage | hasStart

Functions

findNextPageToken

  • findNextPageToken(res: any): string

findResult

  • findResult(res: any): any

findSetPageToken

  • findSetPageToken(req: any, nextPageToken: string): void

genericPaginate

  • genericPaginate<ListRequest, ListResponse, TResult>(request: ListRequest, listCall: function, getNextPageToken: function, setNextPageToken: function, getResults: function, limitedRecord?: undefined | number): AsyncIterableIterator<TResult>
  • Type parameters

    • ListRequest: hasLimit

    • ListResponse

    • TResult: object

    Parameters

    • request: ListRequest
    • listCall: function
        • (request: ListRequest): Promise<ListResponse>
        • Parameters

          • request: ListRequest

          Returns Promise<ListResponse>

    • getNextPageToken: function
        • (response: ListResponse): string | undefined
        • Parameters

          • response: ListResponse

          Returns string | undefined

    • setNextPageToken: function
        • (request: ListRequest, nextPageToken: string): void
        • Parameters

          • request: ListRequest
          • nextPageToken: string

          Returns void

    • getResults: function
        • (response: ListResponse): TResult[]
        • Parameters

          • response: ListResponse

          Returns TResult[]

    • Optional limitedRecord: undefined | number

    Returns AsyncIterableIterator<TResult>

genericPaginateRecords

  • genericPaginateRecords<ListRequest, ListResponse, ItemSummary>(request: ListRequest, listCall: function, getNextPageToken: function, setNextPageToken: function, getItems: function, limitedRecord?: undefined | number): AsyncIterableIterator<ItemSummary>
  • Type parameters

    • ListRequest

    • ListResponse

    • ItemSummary

    Parameters

    • request: ListRequest
    • listCall: function
        • (request: ListRequest): Promise<ListResponse>
        • Parameters

          • request: ListRequest

          Returns Promise<ListResponse>

    • getNextPageToken: function
        • (response: ListResponse): string | undefined
        • Parameters

          • response: ListResponse

          Returns string | undefined

    • setNextPageToken: function
        • (request: ListRequest, nextPageToken: string): void
        • Parameters

          • request: ListRequest
          • nextPageToken: string

          Returns void

    • getItems: function
        • (response: ListResponse): ItemSummary[]
        • Parameters

          • response: ListResponse

          Returns ItemSummary[]

    • Optional limitedRecord: undefined | number

    Returns AsyncIterableIterator<ItemSummary>

genericPaginateResponses

  • genericPaginateResponses<ListRequest, ListResponse>(request: ListRequest, listCall: function, getNextPageToken: function, setNextPageToken: function, limitedRecord?: undefined | number): AsyncIterableIterator<ListResponse>
  • Type parameters

    • ListRequest

    • ListResponse

    Parameters

    • request: ListRequest
    • listCall: function
        • (request: ListRequest): Promise<ListResponse>
        • Parameters

          • request: ListRequest

          Returns Promise<ListResponse>

    • getNextPageToken: function
        • (response: ListResponse): string | undefined
        • Parameters

          • response: ListResponse

          Returns string | undefined

    • setNextPageToken: function
        • (request: ListRequest, nextPageToken: string): void
        • Parameters

          • request: ListRequest
          • nextPageToken: string

          Returns void

    • Optional limitedRecord: undefined | number

    Returns AsyncIterableIterator<ListResponse>

paginateRecords

  • paginateRecords<ListRequest, ListResponse, ItemSummary>(request: ListRequest, listCall: function, limitedRecord?: undefined | number): AsyncIterableIterator<ItemSummary>
  • Type parameters

    • ListRequest: Request

    • ListResponse

    • ItemSummary

    Parameters

    • request: ListRequest
    • listCall: function
        • (request: ListRequest): Promise<ListResponse>
        • Parameters

          • request: ListRequest

          Returns Promise<ListResponse>

    • Optional limitedRecord: undefined | number

    Returns AsyncIterableIterator<ItemSummary>

paginateResponses

  • paginateResponses<ListRequest, ListResponse>(request: ListRequest, listCall: function, limitedRecord?: undefined | number): AsyncIterableIterator<ListResponse>
  • Type parameters

    • ListRequest: Request

    • ListResponse

    Parameters

    • request: ListRequest
    • listCall: function
        • (request: ListRequest): Promise<ListResponse>
        • Parameters

          • request: ListRequest

          Returns Promise<ListResponse>

    • Optional limitedRecord: undefined | number

    Returns AsyncIterableIterator<ListResponse>

paginatedRecordsWithLimit

  • paginatedRecordsWithLimit<ListRequest, ListResponse>(request: ListRequest, listCall: function, limitedRecord?: undefined | number): Promise<IteratorYieldResult<any>[]>
  • Type parameters

    • ListRequest: Request

    • ListResponse

    Parameters

    • request: ListRequest
    • listCall: function
        • (request: ListRequest): Promise<ListResponse>
        • Parameters

          • request: ListRequest

          Returns Promise<ListResponse>

    • Optional limitedRecord: undefined | number

    Returns Promise<IteratorYieldResult<any>[]>

paginatedResponsesWithLimit

  • paginatedResponsesWithLimit<ListRequest, ListResponse>(request: ListRequest, listCall: function, limitedRecord?: undefined | number): Promise<any>
  • Type parameters

    • ListRequest: Request

    • ListResponse

    Parameters

    • request: ListRequest
    • listCall: function
        • (request: ListRequest): Promise<ListResponse>
        • Parameters

          • request: ListRequest

          Returns Promise<ListResponse>

    • Optional limitedRecord: undefined | number

    Returns Promise<any>