stash-connector
Version:
Module to handle and work with Atlassian Stash projects and repositories throug REST API. Admin your repositories and projects in Stash easy. This project is not an Atlassian official project but use the Atlassian Stash REST API
1,127 lines • 65.8 kB
TypeScript
import { Basic, EndpointService, Page, PageOptions, ProjectInput, Project, CreateRepoInput, Repository, ForkRepoInput, UpdateRepoInput, ListBranchesOptions, Branch, RepoBrowseOptions, RepoChangesOptions, RepoChangesOutput, CommitOptions, Commit, CommitChangesOptions, CommentInput, Comment, CommentOptions, CommitDiffOptions, CommitDiffOutput, CompareChangesOptions, CompareCommitsOptions, CompareDiffOptions, RepoDiffOptions, RepoFileOptions, PermissionUserOutput, Group, PermissionUsersOutput, RepoPullRequestOptions, PullRequest, PullRequestInput, PullRequestActivityOptions, PullRequestActivity, Participant, PullRequestDiffOptions, Task, TaskCountOutput, HookOutput, HookInput, TagsOptions, TagOutput, PermissionGroups, PermittedOutput, Line, PullRequestUpdateInput, ParticipantInput } from "../types";
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/settings'
*/
export declare class ProjectRepoSettingsEndpoint extends EndpointService {
/**
* Contains all operations related with project repository settings hooks
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks'.
* @param {number} pullRequestId Pull Request Id
* @returns {ProjectRepoSettingsHooksEndpoint} Get all operations about the project repository settings hooks
*/
hooks: () => ProjectRepoSettingsHooksEndpoint;
constructor(auth: Basic, slug: string);
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/settings/hooks'
*/
export declare class ProjectRepoSettingsHooksEndpoint extends EndpointService {
/**
* Contains all operations related with project repository settings hooks configurations
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/settings'
* @param {string} hookKey Hook Key
* @returns {ProjectRepoSettingsHooksSettingsEndpoint} Get all operations about the project repository settings hooks configurations
*/
settings: (hookKey: string) => ProjectRepoSettingsHooksSettingsEndpoint;
constructor(auth: Basic);
/**
* Retrieve a page of repository hooks for this repository
* @param {string} [type] The optional type to filter by. Valid values are PRE_RECEIVE or POST_RECEIVE
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<HookOutput>>} Promise with the requested page data.
*/
list(type?: 'PRE_RECEIVE' | 'POST_RECEIVE', pageOptions?: PageOptions): Promise<Page<HookOutput>>;
/**
* Retrieve a repository hook for this repositories.
* @param hookKey The key of the hook to retrieve
* @returns {Promise<HookOutput>} Promise with the requested hook data
*/
get(hookKey: string): Promise<HookOutput>;
/**
* Enable a repository hook for this repositories and optionally applying new configuration.
* @param hookKey The key of the hook to enable
* @returns {Promise<HookOutput>} Promise with the requested hook data
*/
enable(hookKey: string): Promise<HookOutput>;
/**
* Disable a repository hook for this repositories.
* @param hookKey The key of the hook to disable
* @returns {Promise<HookOutput>} Promise with the requested hook data
*/
disable(hookKey: string): Promise<HookOutput>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/settings'
*/
export declare class ProjectRepoSettingsHooksSettingsEndpoint extends EndpointService {
constructor(auth: Basic, hookKey: string);
/**
* Retrieve the settings for a repository hook for this repositories
* @returns {Promise<HookOutput>} Promise with the requested hook settings
*/
get(): Promise<HookOutput>;
/**
* Modify the settings for a repository hook for this repositories
* @returns {Promise<HookOutput>} Promise with the requested hook settings
*/
update(hookSettings: HookInput): Promise<HookOutput>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/pull-requests'
*/
export declare class ProjectRepoPullRequestsEndpoint extends EndpointService {
/**
* Contains all operations related with project repository pull request activities
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/activities'.
* @param {number} pullRequestId Pull Request Id
* @returns {ProjectRepoPullRequestsActivitiesEndpoint} Get all operations about the project repositories pull request activities
*/
activities: (pullRequestId: number) => ProjectRepoPullRequestsActivitiesEndpoint;
/**
* Contains all operations related with project repository pull request declination
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/decline'.
* @param {number} pullRequestId Pull Request Id
* @returns {ProjectRepoPullRequestsDeclineEndpoint} Get all operations about the project repositories pull request declination
*/
decline: (pullRequestId: number) => ProjectRepoPullRequestsDeclineEndpoint;
/**
* Contains all operations related with project repository pull request merge
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge'.
* @param {number} pullRequestId Pull Request Id
* @returns {ProjectRepoPullRequestsMergeEndpoint} Get all operations about the project repositories pull request merge
*/
merge: (pullRequestId: number) => ProjectRepoPullRequestsMergeEndpoint;
/**
* Contains all operations related with project repository pull request re-open
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reopen'.
* @param {number} pullRequestId Pull Request Id
* @returns {ProjectRepoPullRequestsReopenEndpoint} Get all operations about the project repositories pull request re-open
*/
reopen: (pullRequestId: number) => ProjectRepoPullRequestsReopenEndpoint;
/**
* Contains all operations related with project repository pull request approval
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/approve'.
* @param {number} pullRequestId Pull Request Id
* @returns {ProjectRepoPullRequestsApproveEndpoint} Get all operations about the project repositories pull request approval
*/
approval: (pullRequestId: number) => ProjectRepoPullRequestsApproveEndpoint;
/**
* Contains all operations related with project repository pull request changes
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/changes'.
* @param {number} pullRequestId Pull Request Id
* @returns {ProjectRepoPullRequestsChangesEndpoint} Get all operations about the project repositories pull request changes
*/
changes: (pullRequestId: number) => ProjectRepoPullRequestsChangesEndpoint;
/**
* Contains all operations related with project repository pull request comments
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments'.
* @param {number} pullRequestId Pull Request Id
* @returns {ProjectRepoPullRequestsCommentsEndpoint} Get all operations about the project repositories pull request comments
*/
comments: (pullRequestId: number) => ProjectRepoPullRequestsCommentsEndpoint;
/**
* Contains all operations related with project repository pull request commits
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commits'.
* @param {number} pullRequestId Pull Request Id
* @returns {ProjectRepoPullRequestsCommitsEndpoint} Get all operations about the project repositories pull request commits
*/
commits: (pullRequestId: number) => ProjectRepoPullRequestsCommitsEndpoint;
/**
* Contains all operations related with project repository pull request diff
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff'.
* @param {number} pullRequestId Pull Request Id
* @returns {ProjectRepoPullRequestDiffEndpoint} Get all operations about the project repositories pull request diff
*/
diff: (pullRequestId: number) => ProjectRepoPullRequestDiffEndpoint;
/**
* Contains all operations related with project repository pull request participants
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants'.
* @param {number} pullRequestId Pull Request Id
* @returns {ProjectRepoPullRequestParticipantEndpoint} Get all operations about the project repositories pull request participants
*/
participants: (pullRequestId: number) => ProjectRepoPullRequestParticipantEndpoint;
/**
* Contains all operations related with project repository pull request tasks
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/tasks'.
* @param {number} pullRequestId Pull Request Id
* @returns {ProjectRepoPullRequestTasksEndpoint} Get all operations about the project repositories pull request tasks
*/
tasks: (pullRequestId: number) => ProjectRepoPullRequestTasksEndpoint;
/**
* Contains all operations related with project repository pull request watch
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch'.
* @param {number} pullRequestId Pull Request Id
* @returns {ProjectRepoPullRequestWatchEndpoint} Get all operations about the project repositories pull request watch
*/
watch: (pullRequestId: number) => ProjectRepoPullRequestWatchEndpoint;
constructor(auth: Basic, slug: string);
/**
* Retrieve a page of pull requests to or from the specified repository.
* @param {RepoPullRequestOptions} [pullRequestOptions] Pull Request options include the pagination options. - pageOptions: Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<PullRequest>>} Promise with the requested page data.
*/
list(pullRequestOptions?: RepoPullRequestOptions): Promise<Page<PullRequest>>;
/**
* Create a new pull request between two branches. The branches may be in the same repository, or different ones. When using different repositories, they must still be in the same hierarchy
* @param {PullRequestInput} [pullRequestInput] Pull Request data to create it
* @returns {Promise<PullRequest>} Promise with the created pull request data.
*/
create(pullRequestInput: PullRequestInput): Promise<PullRequest>;
/**
* Retrieve a pull request
* @param {number} [pullRequestId] Pull Request id to get it
* @returns {Promise<PullRequest>} Promise with the requested pull request data.
*/
get(pullRequestId: number): Promise<PullRequest>;
/**
* Update the title, description, reviewers or destination branch of an existing pull request
* @param {number} [pullRequestId] Pull Request id to update it
* @param {PullRequestInput} [pullRequestInput] Pull Request data to update it
* @returns {Promise<PullRequest>} Promise with the updated pull request data.
*/
update(pullRequestId: number, pullRequestInput: PullRequestUpdateInput): Promise<PullRequest>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/activities'
*/
export declare class ProjectRepoPullRequestsActivitiesEndpoint extends EndpointService {
constructor(auth: Basic, pullRequestId: number);
/**
* Retrieve a page of activity associated with a pull request. Activity items include comments, approvals, rescopes (i.e. adding and removing of commits), merges and more
* @param {PullRequestActivityOptions} activitiesOptions Pull Request Activities options include the pagination options. - pageOptions: Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<PullRequestActivity>>} Promise with the requested page data.
*/
list(activitiesOptions: PullRequestActivityOptions): Promise<Page<PullRequestActivity>>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/decline'
*/
export declare class ProjectRepoPullRequestsDeclineEndpoint extends EndpointService {
constructor(auth: Basic, pullRequestId: number);
/**
* Decline a pull request
* @param {number} [version] The current version of the pull request. If the server's version isn't the same as the specified version the operation will fail. To determine the current version of the pull request it should be fetched from the server prior to this operation
* @returns {Promise<void>} If not throw errors, operation finishs succesfully.
*/
execute(version?: number): Promise<void>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge'
*/
export declare class ProjectRepoPullRequestsMergeEndpoint extends EndpointService {
constructor(auth: Basic, pullRequestId: number);
/**
* Test whether a pull request can be merged
* @returns {Promise<PullRequest>} Return the pull request data and mergin status.
*/
test(): Promise<PullRequest>;
/**
* Merge the specified pull request
* @param {number} [version] The current version of the pull request. If the server's version isn't the same as the specified version the operation will fail. To determine the current version of the pull request it should be fetched from the server prior to this operation. Look for the 'version' attribute in the returned JSON structure.
* @returns {Promise<PullRequest>} Return the merged pull request data.
*/
execute(version?: number): Promise<PullRequest>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reopen'
*/
export declare class ProjectRepoPullRequestsReopenEndpoint extends EndpointService {
constructor(auth: Basic, pullRequestId: number);
/**
* Re-open a declined pull request
* @param {number} [version] The current version of the pull request. If the server's version isn't the same as the specified version the operation will fail. To determine the current version of the pull request it should be fetched from the server prior to this operation
* @returns {Promise<void>} If not throw errors, operation finishs succesfully.
*/
execute(version?: number): Promise<void>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/approve'
*/
export declare class ProjectRepoPullRequestsApproveEndpoint extends EndpointService {
constructor(auth: Basic, pullRequestId: number);
/**
* Approve a pull request as the current user. Implicitly adds the user as a participant if they are not already
* @returns {Promise<Participant>} Return the participant data.
*/
execute(): Promise<Participant>;
/**
* Remove approval from a pull request as the current user. This does not remove the user as a participant
* @returns {Promise<Participant>} Return the participant data.
*/
delete(): Promise<Participant>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/changes'
*/
export declare class ProjectRepoPullRequestsChangesEndpoint extends EndpointService {
constructor(auth: Basic, pullRequestId: number);
/**
* Gets changes for the specified PullRequest.
* @param {boolean} [withComments] true to apply comment counts in the changes (the default); otherwise, false to stream changes without comment counts
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<RepoChangesOutput>>} Promise with the requested page data.
*/
list(withComments?: boolean, pageOptions?: PageOptions): Promise<Page<RepoChangesOutput>>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments'
*/
export declare class ProjectRepoPullRequestsCommentsEndpoint extends EndpointService {
constructor(auth: Basic, pullRequestId: number);
/**
* Retrieve a page of comments made in a specified pull request
* @param {string} [filePath] File path
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<Comment>>} Promise with the requested page data.
*/
list(filePath?: string, pageOptions?: PageOptions): Promise<Page<Comment>>;
/**
* Add a new comment
* @param {CommentInput} commentInput Comment input data to create new comment
* @returns {Promise<Comment>} Promise with the created comment data.
*/
create(commentInput: CommentInput): Promise<Comment>;
/**
* Get specific comment
* @param {number} commentId Comment Id get comment data
* @returns {Promise<Comment>} Promise with the requested comment data.
*/
get(commentId: number): Promise<Comment>;
/**
* Update specific comment
* @param {number} commentId Comment Id get comment data
* @param {string} text The comment text to update
* @param {string} version The version of the comment to update. A version that must match the server's version of the comment or the update will fail
* @returns {Promise<Comment>} Promise with the requested comment data.
*/
update(commentId: number, text: string, version: number): Promise<Comment>;
/**
* Delete specific comment and version
* @param {number} commentId Comment Id delete
* @param {number} [version] Comment version to delete
* @returns {Promise<void>} If finish without errors, operation finish succesfully
*/
delete(commentId: number, version?: number): Promise<void>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commits'
*/
export declare class ProjectRepoPullRequestsCommitsEndpoint extends EndpointService {
constructor(auth: Basic, pullRequestId: number);
/**
* Retrieve changesets for the specified pull request
* @param {boolean} [withComments] if set to true, the service will add "authorCount" and "totalCount" at the end of the page. "authorCount" is the number of different authors and "totalCount" is the total number of changesets
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<Commit>>} Promise with the requested page data.
*/
list(withComments?: boolean, pageOptions?: PageOptions): Promise<Page<Commit>>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff'
*/
export declare class ProjectRepoPullRequestDiffEndpoint extends EndpointService {
constructor(auth: Basic, pullRequestId: number);
/**
* Retrieve the diff between two provided revisions
* @param {PullRequestDiffOptions} [diffOptions] Pull Request Diff options include the pagination options. - pageOptions: Page options to paginate results (or obtain more results per page)
* @returns {Promise<CommitDiffOutput>} Promise with the requested page data.
*/
list(diffOptions?: PullRequestDiffOptions, filePath?: string): Promise<CommitDiffOutput>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants'
*/
export declare class ProjectRepoPullRequestParticipantEndpoint extends EndpointService {
constructor(auth: Basic, pullRequestId: number);
/**
* Retrieves a page of the participants for a given pull request
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<Participant>>} Promise with the requested page data.
*/
list(pageOptions?: PageOptions): Promise<Page<Participant>>;
/**
* Assigns a participant to an explicit role in pull request. Currently only the REVIEWER role may be assigned.
* @param {ParticipantInput} participantInput The participant data to assign
* @returns {Promise<Participant>} Promise with the requested page data.
*/
assign(participantInput: ParticipantInput): Promise<Participant>;
/**
* Unassigns a participant from the REVIEWER role they may have been given in a pull request.
* @param {string} [username] The participant's user name
* @returns {Promise<void>} If not throw errors, operation finish succesfully.
*/
unassign(username: string): Promise<void>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/tasks'
*/
export declare class ProjectRepoPullRequestTasksEndpoint extends EndpointService {
constructor(auth: Basic, pullRequestId: number);
/**
* Retrieve the tasks associated with a pull request
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<Task>>} Promise with the requested page data.
*/
list(pageOptions?: PageOptions): Promise<Page<Task>>;
/**
* Retrieve the total number of open and resolved tasks associated with a pull request
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<TaskCountOutput>} Promise with the requested page data.
*/
count(): Promise<TaskCountOutput>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch'
*/
export declare class ProjectRepoPullRequestWatchEndpoint extends EndpointService {
constructor(auth: Basic, pullRequestId: number);
/**
* Start to watching pull request
* @returns {Promise<void>} If return without errors, operations finish succesfully.
*/
start(): Promise<void>;
/**
* Stop to watching pull request
* @returns {Promise<void>} If return without errors, operations finish succesfully.
*/
stop(): Promise<void>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/commits'
*/
export declare class ProjectRepoCommitsEndpoint extends EndpointService {
/**
* Contains all operations related with project repository commit changes
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/changes'.
* @param {string} commitId Commit Id
* @returns {ProjectRepoCommitChangesEndpoint} Get all operations about the project repository commit changes
*/
changes: (commitId: string) => ProjectRepoCommitChangesEndpoint;
/**
* Contains all operations related with project repository commit comments
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments'.
* @param {string} commitId Commit Id
* @returns {ProjectRepoCommitCommentsEndpoint} Get all operations about the project repository commit comments
*/
comments: (commitId: string) => ProjectRepoCommitCommentsEndpoint;
/**
* Contains all operations related with project repository commit diffs
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diffs'.
* @param {string} commitId Commit Id
* @returns {ProjectRepoCommitDiffEndpoint} Get all operations about the project repository commit diffs
*/
diffs: (commitId: string) => ProjectRepoCommitDiffEndpoint;
/**
* Contains all operations related with project repository commit watch
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/watch'.
* @param {string} commitId Commit Id
* @returns {ProjectRepoCommitWatchEndpoint} Get all operations about the project repository commit watch
*/
watch: (commitId: string) => ProjectRepoCommitWatchEndpoint;
constructor(auth: Basic, slug: string);
/**
* Retrieve a page of commits from a given starting commit or "between" two commits.
* If no explicit commit is specified, the tip of the repository's default branch is assumed.
* Commits may be identified by branch or tag name or by ID.
* A path may be supplied to restrict the returned commits to only those which affect that path
* @param {CommitOptions} [commitOptions] Commits options include the pagination options. - pageOptions: Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<Commit>>} Promise with the requested page data.
*/
list(commitOptions?: CommitOptions): Promise<Page<Commit>>;
/**
* Retrieve a single commit identified by its ID>. In general, that ID is a SHA1.
* From 2.11, ref names like "refs/heads/master" are no longer accepted by this resource.
* @param {string} commitId Commit Id to retrieve data from
* @param {string} [path] an optional path to filter the commit by. If supplied the details returned may not be for the specified commit. Instead, starting from the specified commit, they will be the details for the first commit affecting the specified path.
* @returns {Promise<Commit>} Promise with the requested commit data
*/
get(commitId: string, path?: string): Promise<Commit>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/commits/{commitId}/changes'
*/
export declare class ProjectRepoCommitChangesEndpoint extends EndpointService {
constructor(auth: Basic, commitId: string);
/**
* Retrieve a page of changes made in a specified commit
* @param {CommitChangesOptions} [commitOptions] Commit Changes options include the pagination options. - pageOptions: Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<RepoChangesOutput>>} Promise with the requested page data.
*/
list(commitChangesOptions?: CommitChangesOptions): Promise<Page<RepoChangesOutput>>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/commits/{commitId}/comments'
*/
export declare class ProjectRepoCommitCommentsEndpoint extends EndpointService {
constructor(auth: Basic, commitId: string);
/**
* Retrieve a page of comments made in a specified commit
* @param {CommentOptions} [commentOptions] Commit Comment options include the pagination options. - pageOptions: Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<Comment>>} Promise with the requested page data.
*/
list(commentOptions?: CommentOptions): Promise<Page<Comment>>;
/**
* Add a new comment
* @param {CommentInput} commentInput Comment input data to create new comment
* @returns {Promise<Comment>} Promise with the created comment data.
*/
create(commentInput: CommentInput): Promise<Comment>;
/**
* Get specific comment
* @param {number} commentId Comment Id get comment data
* @returns {Promise<Comment>} Promise with the requested comment data.
*/
get(commentId: number): Promise<Comment>;
/**
* Update specific comment
* @param {number} commentId Comment Id get comment data
* @param {string} text The comment text to update
* @param {string} version The version of the comment to update. A version that must match the server's version of the comment or the update will fail
* @returns {Promise<Comment>} Promise with the requested comment data.
*/
update(commentId: number, text: string, version: number): Promise<Comment>;
/**
* Delete specific comment and version
* @param {number} commentId Comment Id delete
* @param {number} [version] Comment version to delete
* @returns {Promise<void>} If finish without errors, operation finish succesfully
*/
delete(commentId: number, version?: number): Promise<void>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/commits/{commitId}/diff'
*/
export declare class ProjectRepoCommitDiffEndpoint extends EndpointService {
constructor(auth: Basic, commitId: string);
/**
* Retrieve the diff between two provided revisions
* @param {CommitDiffOptions} [diffOptions] Commit Diff options include the pagination options. - pageOptions: Page options to paginate results (or obtain more results per page)
* @returns {Promise<CommitDiffOutput>} Promise with the requested page data.
*/
list(diffOptions?: CommitDiffOptions, filePath?: string): Promise<CommitDiffOutput>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/commits/{commitId}/watch'
*/
export declare class ProjectRepoCommitWatchEndpoint extends EndpointService {
constructor(auth: Basic, commitId: string);
/**
* Start to watching commit
* @returns {Promise<void>} If return without errors, operations finish succesfully.
*/
start(): Promise<void>;
/**
* Stop to watching commit
* @returns {Promise<void>} If return without errors, operations finish succesfully.
*/
stop(): Promise<void>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/compare'
*/
export declare class ProjectRepoCompareEndpoint extends EndpointService {
/**
* Contains all operations related with project repository compare changes
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/compare/changes'.
* @returns {ProjectRepoCompareChangesEndpoint} Get all operations about the project repository compare changes
*/
changes: () => ProjectRepoCompareChangesEndpoint;
/**
* Contains all operations related with project repository compare commits
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/compare/commits'.
* @returns {ProjectRepoCompareCommitsEndpoint} Get all operations about the project repository compare commits
*/
commits: () => ProjectRepoCompareCommitsEndpoint;
/**
* Contains all operations related with project repository compare diff
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/compare/diff'.
* @returns {ProjectRepoCompareDiffEndpoint} Get all operations about the project repository compare diff
*/
diff: () => ProjectRepoCompareDiffEndpoint;
constructor(auth: Basic, slug: string);
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/compare/changes'
*/
export declare class ProjectRepoCompareChangesEndpoint extends EndpointService {
constructor(auth: Basic);
/**
* Gets the file changes available in the "from" changeset but not in the "to" changeset. .
* @param {CompareChangesOptions} [compareChangesOptions] Compare Changes options include the pagination options. - pageOptions: Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<RepoChangesOutput>>} Promise with the requested page data.
*/
list(compareChangesOptions?: CompareChangesOptions): Promise<Page<RepoChangesOutput>>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/compare/commits'
*/
export declare class ProjectRepoCompareCommitsEndpoint extends EndpointService {
constructor(auth: Basic);
/**
* Gets the commits accessible from the "from" changeset but not in the "to" changeset. .
* @param {CompareCommitsOptions} [compareCommitsOptions] Compare Commits options include the pagination options. - pageOptions: Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<Commit>>} Promise with the requested page data.
*/
list(compareCommitsOptions?: CompareCommitsOptions): Promise<Page<Commit>>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/compare/diff'
*/
export declare class ProjectRepoCompareDiffEndpoint extends EndpointService {
constructor(auth: Basic);
/**
* Retrieve the diff for a specified file path between two provided revisions.
* @param {CompareDiffOptions} [compareDiffOptions] Compare Commits options include the pagination options. - pageOptions: Page options to paginate results (or obtain more results per page)
* @returns {Promise<CommitDiffOutput>} Promise with the requested diff changes.
*/
list(compareDiffOptions?: CompareDiffOptions, filePath?: string): Promise<CommitDiffOutput>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/permissions'
*/
export declare class ProjectRepoPermissionsEndpoint extends EndpointService {
/**
* Contains all operations related with project repository users permissions
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/users'.
* @returns {ProjectRepoPermissionsUsersEndpoint} Get all operations about the project repository users permissions
*/
users: () => ProjectRepoPermissionsUsersEndpoint;
/**
* Contains all operations related with project repository groups permissions
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/groups'.
* @returns {ProjectRepoPermissionsGroupsEndpoint} Get all operations about the project repository groups permissions
*/
groups: () => ProjectRepoPermissionsGroupsEndpoint;
constructor(auth: Basic, slug: string);
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/permissions/users'
*/
export declare class ProjectRepoPermissionsUsersEndpoint extends EndpointService {
constructor(auth: Basic);
/**
* Retrieve a page of licensed users that have no granted permissions for the specified repository.
* @param {string} [filter] If specified only group names containing the supplied string will be returned
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<PermissionUserOutput>>} Promise with the requested page data.
*/
none(filter?: string, pageOptions?: PageOptions): Promise<Page<PermissionUserOutput>>;
/**
* Retrieve a page of users that have been granted at least one permission for the specified repository
* @param {string} [filter] If specified only group names containing the supplied string will be returned
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<PermissionUsersOutput>>} Promise with the requested page data.
*/
list(filter?: string, pageOptions?: PageOptions): Promise<Page<PermissionUsersOutput>>;
/**
* Promote or demote a user's permission level for the specified repository.
* @param {string} name The name of the user
* @param {string} permission The permission to grant
* @returns {Promise<void>} If not throw errors, operation finish succesfully.
*/
update(name: string, permission: 'REPO_READ' | 'REPO_WRITE' | 'REPO_ADMIN'): Promise<void>;
/**
* Revoke all permissions for the specified repository for a user
* @param {string} name The name of the user
* @returns {Promise<void>} If not throw errors, operation finish succesfully.
*/
revoke(name: string): Promise<void>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/permissions/users'
*/
export declare class ProjectRepoPermissionsGroupsEndpoint extends EndpointService {
constructor(auth: Basic);
/**
* Retrieve a page of groups that have no granted permissions for the specified repository.
* @param {string} [filter] If specified only group names containing the supplied string will be returned
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<Group>>} Promise with the requested page data.
*/
none(filter?: string, pageOptions?: PageOptions): Promise<Page<Group>>;
/**
* Retrieve a page of groups that have been granted at least one permission for the specified repository
* @param {string} [filter] If specified only group names containing the supplied string will be returned
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<PermissionGroups>>} Promise with the requested page data.
*/
list(filter?: string, pageOptions?: PageOptions): Promise<Page<PermissionGroups>>;
/**
* Promote or demote a group's permission level for the specified repository
* @param {string} name The name of the group
* @param {string} permission The permission to grant
* @returns {Promise<void>} If not throw errors, operation finish succesfully.
*/
update(name: string, permission: 'REPO_READ' | 'REPO_WRITE' | 'REPO_ADMIN'): Promise<void>;
/**
* Revoke all permissions for the specified repository for a group
* @param {string} name The name of the group
* @returns {Promise<void>} If not throw errors, operation finish succesfully.
*/
revoke(name: string): Promise<void>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/tags'
*/
export declare class ProjectRepoTagsEndpoint extends EndpointService {
constructor(auth: Basic, slug: string);
/**
* Retrieve the tags matching the supplied filterText param..
* @param {RepoChangesOptions} [tagsOptions] Tags Options include the pagination options. - pageOptions: Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<TagOutput>>} Promise with the requested page data.
*/
list(tagsOptions?: TagsOptions): Promise<Page<TagOutput>>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/changes'
*/
export declare class ProjectRepoChangesEndpoint extends EndpointService {
constructor(auth: Basic, slug: string);
/**
* Retrieve a page of changes made in a specified commit.
* @param {RepoChangesOptions} [changesOptions] Changes options include the pagination options. - pageOptions: Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<RepoChangesOutput>>} Promise with the requested page data.
*/
list(changesOptions?: RepoChangesOptions): Promise<Page<RepoChangesOutput>>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/compare/diff'
*/
export declare class ProjectRepoDiffEndpoint extends EndpointService {
constructor(auth: Basic, slug: string);
/**
* Retrieve the diff for a specified file path between two provided revisions
* @param {RepoDiffOptions} [repoDiffOptions] Repository Diff options include the pagination options. - pageOptions: Page options to paginate results (or obtain more results per page)
* @param {string} [filePath] The path to the file which should be diffed
* @returns {Promise<CommitDiffOutput>} Promise with the requested diff changes.
*/
list(compareDiffOptions?: RepoDiffOptions, filePath?: string): Promise<CommitDiffOutput>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/compare/files'
*/
export declare class ProjectRepoFilesEndpoint extends EndpointService {
constructor(auth: Basic, slug: string);
/**
* Retrieve a page of files from particular directory of a repository. The search is done recursively, so all files from any sub-directory of the specified directory will be returned.
* @param {RepoFileOptions} [fileOptions] Repository File options include the pagination options. - pageOptions: Page options to paginate results (or obtain more results per page)
* @param {string} [folderPath] The directory to list files for
* @returns {Promise<Page<string>>} Promise with the requested diff changes.
*/
list(fileOptions?: RepoFileOptions, folderPath?: string): Promise<Page<string>>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/forks'
*/
export declare class ProjectRepoBrowseEndpoint extends EndpointService {
constructor(auth: Basic, slug: string);
/**
* Retrieve a page of content for a file path at a specified revision.
* @param {RepoBrowseOptions} [browseOptions] Browse options include the pagination options. - pageOptions: Page options to paginate results (or obtain more results per page)
* @param {string} [filePath] File path to retrieve content from
* @returns {Promise<Page<Line>>} Promise with the requested page data with found lines.
*/
list(browseOptions?: RepoBrowseOptions, filePath?: string): Promise<Page<Line>>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/forks'
*/
export declare class ProjectRepoForksEndpoint extends EndpointService {
constructor(auth: Basic, slug: string);
/**
* List all forks from a specific repository. The results are paginated. You can use the pagination options you need to get the desired results.
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<Repository>>} Promise with the requested page data.
*/
list(pageOptions?: PageOptions): Promise<Page<Repository>>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/recreate'
*/
export declare class ProjectRepoRecreateEndpoint extends EndpointService {
constructor(auth: Basic, slug: string);
/**
* If a create or fork operation fails, calling this method will clean up the broken repository and try again.
* The repository must be in an INITIALISATION_FAILED state.
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Repository>} Promise with the recreated Reposiitory data.
*/
rebuild(): Promise<Repository>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/recreate'
*/
export declare class ProjectRepoRelatedEndpoint extends EndpointService {
constructor(auth: Basic, slug: string);
/**
* Retrieve repositories which are related to this one.
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<Repository>>} Promise with the requested page data.
*/
list(pageOptions?: PageOptions): Promise<Page<Repository>>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/branches'
*/
export declare class ProjectRepoBranchesEndpoint extends EndpointService {
/**
* Contains all operations related with project repository default branches
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/branches/default'.
* @param {string} slug Repository slug
* @returns {ProjectRepoBranchesDefaultEndpoint} Get all operations about the project repository default branches
*/
default: () => ProjectRepoBranchesDefaultEndpoint;
constructor(auth: Basic, slug: string);
/**
* Retrieve the branches matching the supplied filterText param.
* @param {ListBranchesOptions} [listOptions] List Branches options including the paginations options. - pageOptions: Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<Branch>>} Promise with the requested page data.
*/
list(listOptions?: ListBranchesOptions): Promise<Page<Branch>>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/{repositorySlug}/branches/default'
*/
export declare class ProjectRepoBranchesDefaultEndpoint extends EndpointService {
constructor(auth: Basic);
/**
* Get the default branch of the repository.
* @returns {Branch} Promise with the default branch data.
*/
get(): Promise<Branch>;
/**
* Update the default branch of a repository.
* @param {string} id Id branch to update (ex: refs/heads/master)
* @returns {void} If return without errors means all its ok.
*/
update(id: string): Promise<void>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/repos/*'
*/
export declare class ProjectReposEndpoint extends EndpointService {
/**
* Contains all operations related with project repository forks
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/forks'.
* @param {string} slug Repository slug
* @returns {ProjectRepoForksEndpoint} Get all operations about the project repositories forks
*/
forks: (slug: string) => ProjectRepoForksEndpoint;
/**
* Contains all operations related with project repository recreation when fail
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/recreate'.
* @param {string} slug Repository slug
* @returns {ProjectRepoRecreateEndpoint} Get all operations about the project repositories forks
*/
recreate: (slug: string) => ProjectRepoRecreateEndpoint;
/**
* Contains all operations related with project repository related repos
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/related'.
* @param {string} slug Repository slug
* @returns {ProjectRepoRelatedEndpoint} Get all operations about the project repositories related repos
*/
related: (slug: string) => ProjectRepoRelatedEndpoint;
/**
* Contains all operations related with project repository branches
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/branches'.
* @param {string} slug Repository slug
* @returns {ProjectRepoBranchesEndpoint} Get all operations about the project repositories branches
*/
branches: (slug: string) => ProjectRepoBranchesEndpoint;
/**
* Contains all operations related with project repository browse
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/branches'.
* @param {string} slug Repository slug
* @returns {ProjectRepoBrowseEndpoint} Get all operations about the project repository browse
*/
browse: (slug: string) => ProjectRepoBrowseEndpoint;
/**
* Contains all operations related with project repository changes
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/changes'.
* @param {string} slug Repository slug
* @returns {ProjectRepoChangesEndpoint} Get all operations about the project repository changes
*/
changes: (slug: string) => ProjectRepoChangesEndpoint;
/**
* Contains all operations related with project repository commits
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits'.
* @param {string} slug Repository slug
* @returns {ProjectRepoCommitsEndpoint} Get all operations about the project repository commits
*/
commits: (slug: string) => ProjectRepoCommitsEndpoint;
/**
* Contains all operations related with project repository compare
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/compare'.
* @param {string} slug Repository slug
* @returns {ProjectRepoCompareEndpoint} Get all operations about the project repository compare
*/
compare: (slug: string) => ProjectRepoCompareEndpoint;
/**
* Contains all operations related with project repository diff
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/diff'.
* @param {string} slug Repository slug
* @returns {ProjectRepoDiffEndpoint} Get all operations about the project repository diff
*/
diff: (slug: string) => ProjectRepoDiffEndpoint;
/**
* Contains all operations related with project repository files
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/files'.
* @param {string} slug Repository slug
* @returns {ProjectRepoFilesEndpoint} Get all operations about the project repository files
*/
files: (slug: string) => ProjectRepoFilesEndpoint;
/**
* Contains all operations related with project repository permissions
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions'.
* @param {string} slug Repository slug
* @returns {ProjectRepoPermissionsEndpoint} Get all operations about the project repository permissions
*/
permissions: (slug: string) => ProjectRepoPermissionsEndpoint;
/**
* Contains all operations related with project repository pull requests
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests'.
* @param {string} slug Repository slug
* @returns {ProjectRepoPullRequestsEndpoint} Get all operations about the project repository pull requests
*/
pullRequests: (slug: string) => ProjectRepoPullRequestsEndpoint;
/**
* Contains all operations related with project repository settings
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings'.
* @param {string} slug Repository slug
* @returns {ProjectRepoSettingsEndpoint} Get all operations about the project repository settings
*/
settings: (slug: string) => ProjectRepoSettingsEndpoint;
/**
* Contains all operations related with project repository tags
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags'.
* @param {string} slug Repository slug
* @returns {ProjectRepoTagsEndpoint} Get all operations about the project repository tags
*/
tags: (slug: string) => ProjectRepoTagsEndpoint;
constructor(auth: Basic, projectKey?: string, userSlug?: string);
/**
* List all repositories from a specific project. The results are paginated. You can use the pagination options you need to get the desired results.
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<Repository>>} Promise with the requested page data.
*/
list(pageOptions?: PageOptions): Promise<Page<Repository>>;
/**
* Create new repository to a specific project.
* @param {CreateRepoInput} repoOptions Repository data to create it
* @returns {Promise<Repository>} Promise with the created Repository data
*/
create(repoOptions: CreateRepoInput): Promise<Repository>;
/**
* Get data from specific project repository.
* @param {string} slug Repository slug
* @returns {Promise<Repository>} Promise with the requested Repository data
*/
get(slug: string): Promise<Repository>;
/**
* Fork a specific repository from the project to another project.
* @param {string} fromSlug Origin Repository slug
* @param {ForkRepoInput} repoOptions Repository Data to fork it
* @returns {Promise<Repository>} Promise with the created Repository data
*/
fork(fromSlug: string, repoOptions: ForkRepoInput): Promise<Repository>;
/**
* Update specific repository from the project
* @param {string} slug Repository slug to update
* @param {UpdateRepoInput} repoOptions Repository Data to update
* @returns {Promise<Repository>} Promise with the updated Repository data
*/
update(slug: string, repoOptions: UpdateRepoInput): Promise<Repository>;
/**
* Delete specific repository from the project
* @param {string} slug Repository slug to delete
* @returns {Promise<void>} Promise with the deleted repository slug
*/
delete(slug: string): Promise<void>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/permissions'
*/
export declare class ProjectPermissionsEndpoint extends EndpointService {
/**
* Contains all operations related with project user permissions
* All paths and operations from '/rest/api/1.0/projects/{prokectKey}/permissions/users'.
* @returns {ProjectPermissionsUsersEndpoint} Get all operations about the project user permissions
*/
users: () => ProjectPermissionsUsersEndpoint;
/**
* Contains all operations related with project groups permissions
* All paths and operations from '/rest/api/1.0/projects/{prokectKey}/permissions/groups'.
* @returns {ProjectPermissionsGroupsEndpoint} Get all operations about the project groups permissions
*/
groups: () => ProjectPermissionsGroupsEndpoint;
/**
* Contains all operations related with project specific permissions
* All paths and operations from '/rest/api/1.0/projects/{prokectKey}/permissions/{permission}/all'.
* @returns {ProjectPermissionsAllEndpoint} Get all operations about the project specific permissions
*/
all: (permission: string) => ProjectPermissionsAllEndpoint;
constructor(auth: Basic, projectKey: string);
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/permissions/users'
*/
export declare class ProjectPermissionsUsersEndpoint extends EndpointService {
constructor(auth: Basic);
/**
* Retrieve a page of licensed users that have no granted permissions for the specified project.
* @param {string} [filter] If specified only group names containing the supplied string will be returned
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<PermissionUserOutput>>} Promise with the requested page data.
*/
none(filter?: string, pageOptions?: PageOptions): Promise<Page<PermissionUserOutput>>;
/**
* Retrieve a page of users that have been granted at least one permission for the specified project.
* @param {string} [filter] If specified only group names containing the supplied string will be returned
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<PermissionUsersOutput>>} Promise with the requested page data.
*/
list(filter?: string, pageOptions?: PageOptions): Promise<Page<PermissionUsersOutput>>;
/**
* Promote or demote a user's permission level for the specified project.
* @param {string} name The name of the user
* @param {string} permission The permission to grant
* @returns {Promise<void>} If not throw errors, operation finish succesfully.
*/
update(name: string, permission: 'PROJECT_READ' | 'PROJECT_WRITE' | 'PROJECT_ADMIN'): Promise<void>;
/**
* Revoke all permissions for the specified project for a user
* @param {string} name The name of the user
* @returns {Promise<void>} If not throw errors, operation finish succesfully.
*/
revoke(name: string): Promise<void>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/permissions/groups'
*/
export declare class ProjectPermissionsGroupsEndpoint extends EndpointService {
constructor(auth: Basic);
/**
* Retrieve a page of groups that have no granted permissions for the specified project
* @param {string} [filter] If specified only group names containing the supplied string will be returned
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<Group>>} Promise with the requested page data.
*/
none(filter?: string, pageOptions?: PageOptions): Promise<Page<Group>>;
/**
* Retrieve a page of groups that have been granted at least one permission for the specified project.
* @param {string} [filter] If specified only group names containing the supplied string will be returned
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<PermissionGroups>>} Promise with the requested page data.
*/
list(filter?: string, pageOptions?: PageOptions): Promise<Page<PermissionGroups>>;
/**
* Promote or demote a group's permission level for the specified project
* @param {string} name The name of the group
* @param {string} permission The permission to grant
* @returns {Promise<void>} If not throw errors, operation finish succesfully.
*/
update(name: string, permission: 'PROJECT_READ' | 'PROJECT_WRITE' | 'PROJECT_ADMIN'): Promise<void>;
/**
* Revoke all permissions for the specified project for a group
* @param {string} name The name of the group
* @returns {Promise<void>} If not throw errors, operation finish succesfully.
*/
revoke(name: string): Promise<void>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/permissions/{permission}/all'
*/
export declare class ProjectPermissionsAllEndpoint extends EndpointService {
constructor(auth: Basic, permission: string);
/**
* Check whether the specified permission is the default permission (granted to all users) for a project.
* @returns {Promise<PermittedOutput>} Promise with the permited result.
*/
check(): Promise<PermittedOutput>;
update(allow: boolean): Promise<PermittedOutput>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/{prokectKey}/avatar.png'
*/
export declare class ProjectAvatarEndpoint extends EndpointService {
constructor(auth: Basic, projectKey: string);
/**
* Get the project avatar image
* @param {number} [size] The desired size of the image
* @returns {Promise<any>} Promise with the image data
*/
get(size?: number): Promise<any>;
/**
* Get the project avatar image
* @param {number} fileName The filename to upload
* @returns {Promise<void>} If not throw errors, operation finish successfuly
*/
update(fileName: string): Promise<void>;
}
/**
* Class to manage and expose all endpoits and operations below '/rest/api/1.0/projects/*'
* /rest/api/1.0/projects/{projectKey}
* /rest/api/1.0/projects/{projectKey}/avatar.png
* /rest/api/1.0/projects/{projectKey}/repos
* /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/forks
* ...
*/
export declare class ProjectsEndpoint extends EndpointService {
/**
* Contains all operations related with project avatar
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/avatar.png'.
* @param {string} projectKey Project key to work with avatar
* @returns {ProjectAvatarEndpoint} Get all operations about the project avatar
*/
avatar: (projectKey: string) => ProjectAvatarEndpoint;
/**
* Contains all operations related with project repositories
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/repos'.
* @param {string} [projectKey] Project key to work with repos (/rest/api/1.0/projects/{projectKey}/repos)
* @param {string} [userSlug] User Slug to work with personal repositories. (/rest/api/1.0/projects/~userslug/repos)
* @returns {ProjectReposEndpoint} Get all operations about the project avatar
*/
repos: (projectKey?: string | undefined, userSlug?: string | undefined) => ProjectReposEndpoint;
/**
* Contains all operations related with project permissions
* All paths and operations from '/rest/api/1.0/projects/{projectKey}/permissions'
* @param {string} projectKey Project key to work with repos
* @returns {ProjectPermissionsEndpoint} Get all operations about the project permissions
*/
permissions: (projectKey: string) => ProjectPermissionsEndpoint;
constructor(auth: Basic);
/**
* List all projets from Stash. The results are paginated. You can use the pagination options you need to get the desired results.
* @param {string} [name] Search projects by name
* @param {string} [permissiom] Search projects by permission
* @param {PageOptions} [pageOptions] Page options to paginate results (or obtain more results per page)
* @returns {Promise<Page<Project>>} Promise with the requested page data.
*/
list(name?: string, permission?: string, pageOptions?: PageOptions): Promise<Page<Project>>;
/**
* Create new projects into Stash.
* @param {ProjectInput} projectOptions Project data to create it
* @returns {Promise<Project>} Promise with the Created project data
*/
create(projectOptions: ProjectInput): Promise<Project>;
/**
* Get a specific project from Stash.
* @param {string} projectKey Project key to get it
* @returns {Promise<Project>} Promise with the requested project data
*/
get(projectKey: string): Promise<Project>;
/**
* Update a specific project from Stash.
* @param {string} projectKey Project key to update
* @param {ProjectInput} projectOptions Project data to update
* @returns {Promise<Project>} Promise with the updated project data
*/
update(projectKey: string, projectOptions: ProjectInput): Promise<Project>;
/**
* Delete a specific project from Stash.
* @param {string} projectKey Project key to delete
* @returns {Promise<string>} Promise with the deleted project key
*/
delete(projectKey: string): Promise<string>;
}