* Parse the url into a path and query parameters to be used with the api client (openapi-fetch)
(url: string)
| 202 | * Parse the url into a path and query parameters to be used with the api client (openapi-fetch) |
| 203 | */ |
| 204 | function parseUrl(url: string): { path: string; query: Record<string, string>; } { |
| 205 | const fullUrl = new URL(url); |
| 206 | const path = fullUrl.pathname.replace(/^\/\d+(\.\d+)*/, ''); // remove version number in the beginning of the path |
| 207 | const query = Object.fromEntries(fullUrl.searchParams); |
| 208 | logger.debug(`Parsed url ${url} into path ${path} and query ${JSON.stringify(query)}`); |
| 209 | return { path, query }; |
| 210 | } |
| 211 | |
| 212 | |
| 213 | async function cloudGetReposForWorkspace(client: BitbucketClient, workspaces: string[]): Promise<{repos: CloudRepository[], warnings: string[]}> { |