repository-provider
abstract interface to git repository providers like github bitbucket
Example
import { GithubProvider } from 'repository-provider';
const provider = new GithubProvider({ token: 'xxx' });
const repository = await provider.repository('myuser/myrepo');
const branch = await repository.branch('master');
const files = await branch.list();
API
Table of Contents
Provider
Base repository provider acts as a source of repositories
Parameters
Properties
repository
Parameters
Returns Repository
rateLimitReached
Is our rate limit reached.
By default we have no rate limit
Returns boolean always false
repositoryClass
Returns Class repository class used by the Provider
branchClass
Returns Class branch class used by the Provider
pullRequestClass
Returns Class pull request class used by the Provider
defaultOptions
Default configuration options
Returns Object
options
Pepare configuration by mixing together defaultOptions with actual options
Parameters
Returns Object combined options
Content
Type: Object
Properties
Branch
Abstract git branch
Parameters
Properties
provider
Returns Provider
delete
Delete the branch from the Repository.
Returns Promise
content
Deliver file content
Parameters
Returns Promise<Content> content of a given file
commit
Commit files
Parameters
Returns Promise
createPullRequest
Create a pull request
Parameters
Returns Promise
rateLimitReached
Value delivered from the provider
Returns boolean providers rateLimitReached
rateLimitReached
forward to the Provider
Parameters
Repository
Abstract repository
Parameters
Properties
branch
Lookup branch by name
Parameters
Returns Promise<Branch>
branches
Returns Promise<Map> of all branches
createBranch
Create a new Branch.
Parameters
deleteBranch
Delete a Branch
Parameters
Returns Promise
addBranch
Add a branch
Parameters
Returns Promise
pullRequests
Deliver all @{link PullRequest}s
Returns Promise<Map> of all pull requests
pullRequest
Deliver @{link PullRequest} for a given name
Parameters
Returns Promise<PullRequest>
addPullRequest
Add a pull request
Parameters
Returns Promise
deletePullRequest
Delete a PullRequest
Parameters
Returns Promise
rateLimitReached
Value delivered from the provider
Returns boolean providers rateLimitReached
rateLimitReached
forward to the Provider
Parameters
PullRequest
Abstract pull request
Parameters
repository
Repositoyname
stringoptions
Object (optional, default {}
)
Properties
provider
Returns Provider
delete
Delete the pull request from the Repository.
Returns Promise
install
With npm do:
npm install repository-provider
license
BSD-2-Clause