(
path: ServerGetRequestPath,
get: (url: ServerGetRequestPath, start?: number) => Promise<ServerPaginatedResponse<T>>
)
| 440 | } |
| 441 | |
| 442 | const getPaginatedServer = async <T>( |
| 443 | path: ServerGetRequestPath, |
| 444 | get: (url: ServerGetRequestPath, start?: number) => Promise<ServerPaginatedResponse<T>> |
| 445 | ): Promise<T[]> => { |
| 446 | const results: T[] = []; |
| 447 | let nextStart: number | undefined; |
| 448 | |
| 449 | while (true) { |
| 450 | const response = await get(path, nextStart); |
| 451 | |
| 452 | if (!response.values || response.values.length === 0) { |
| 453 | break; |
| 454 | } |
| 455 | |
| 456 | results.push(...response.values); |
| 457 | |
| 458 | if (response.isLastPage) { |
| 459 | break; |
| 460 | } |
| 461 | |
| 462 | nextStart = response.nextPageStart; |
| 463 | } |
| 464 | return results; |
| 465 | } |
| 466 | |
| 467 | async function serverGetReposForWorkspace(client: BitbucketClient, workspaces: string[]): Promise<{repos: ServerRepository[], warnings: string[]}> { |
| 468 | const warnings = workspaces.map(workspace => `Workspaces are not supported in Bitbucket Server: ${workspace}`); |
no outgoing calls
no test coverage detected