feat: add auto-completion to workspaces and repositories

Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
This commit is contained in:
Benjamin Janssens
2024-06-07 13:15:14 +02:00
parent fbbf152f50
commit 0aaf020359
6 changed files with 124 additions and 58 deletions
@@ -85,6 +85,16 @@ export class BitbucketCloudClient {
);
}
listWorkspaces(
options?: FilterAndSortOptions & PartialResponseOptions,
): WithPagination<Models.PaginatedWorkspaces, Models.Workspace> {
return new WithPagination(
paginationOptions =>
this.createUrl('/workspaces', { ...paginationOptions, ...options }),
url => this.getTypeMapped(url),
);
}
private createUrl(endpoint: string, options?: RequestOptions): URL {
const request = new URL(this.config.apiBaseUrl + endpoint);
for (const key in options) {
@@ -264,6 +264,17 @@ export namespace Models {
values?: Set<Project>;
}
/**
* A paginated list of workspaces.
* @public
*/
export interface PaginatedWorkspaces extends Paginated<Workspace> {
/**
* The values of the current page.
*/
values?: Set<Workspace>;
}
/**
* Object describing a user's role on resources like commits or pull requests.
* @public