type Bitbucket = {
username: string;
password: string;
};
/**
* List effective default reviewers
* Returns the repository's effective default reviewers. This includes both default
reviewers defined at the repository level as well as those inherited from its project.
These are the users that are automatically added as reviewers on every
new pull request that is created.
*/
export async function main(
auth: Bitbucket,
repo_slug: string,
workspace: string
) {
const url = new URL(
`https://api.bitbucket.org/2.0/repositories/${workspace}/${repo_slug}/effective-default-reviewers`
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 418 days ago
type Bitbucket = {
username: string;
password: string;
};
/**
* List effective default reviewers
* Returns the repository's effective default reviewers.
*/
export async function main(
auth: Bitbucket,
repo_slug: string,
workspace: string
) {
const url = new URL(
`https://api.bitbucket.org/2.0/repositories/${workspace}/${repo_slug}/effective-default-reviewers`
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 424 days ago
type Bitbucket = {
username: string;
password: string;
};
/**
* List effective default reviewers
* Returns the repository's effective default reviewers. This includes both default
reviewers defined at the repository level as well as those inherited from its project.
These are the users that are automatically added as reviewers on every
new pull request that is created.
```
$ curl https://api.bitbucket.org/2.0/repositories/{workspace_slug}/{repo_slug}/effective-default-reviewers?page=1&pagelen=20
{
"pagelen": 20,
"values": [
{
"user": {
"display_name": "Patrick Wolf",
"uuid": "{9565301a-a3cf-4b5d-88f4-dd6af8078d7e}"
},
"reviewer_type": "project",
"type": "default_reviewer",
},
{
"user": {
"display_name": "Davis Lee",
"uuid": "{f0e0e8e9-66c1-4b85-a784-44a9eb9ef1a6}"
},
"reviewer_type": "repository",
"type": "default_reviewer",
}
],
"page": 1,
"size": 2
}
```
*/
export async function main(
auth: Bitbucket,
repo_slug: string,
workspace: string
) {
const url = new URL(
`https://api.bitbucket.org/2.0/repositories/${workspace}/${repo_slug}/effective-default-reviewers`
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 424 days ago