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();
Derived Providers
list by repository-provider keyword
API
Table of Contents
Provider
Extends Owner
Base repository provider acts as a source of repositories
Parameters
Properties
repositoryGroup
Lookup a repository group
Parameters
Returns Promise<RepositoryGroup>
createRepositoryGroup
Create a new repository group
Parameters
Returns Promise<RepositoryGroup>
repository
Lookup a repository in the provider and all of its repository groups
Parameters
Returns Promise<Repository>
branch
Lookup a branch in the provider and all of its repository groups
Parameters
Returns Promise<Branch>
repositoryGroupClass
Returns Class repository group class used by the Provider
pullRequestClass
Returns Class pull request class used by the Provider
rateLimitReached
Is our rate limit reached.
By default we have no rate limit
Returns boolean always false
name
Deliver the provider name
Returns string class name by default
provider
we are our own provider
Returns Provider this
defaultOptions
Default configuration options
Returns Object
optionsFromEnvironment
Extract options suitable for the constructor
form the given set of environment variables
Parameters
Returns Object undefined if no suitable environment variables have been found
options
Pepare configuration by mixing together defaultOptions with actual options
Parameters
Returns Object combined options
Branch
Abstract branch
Parameters
Properties
defaultOptions
options
defaultOptions
options
defaultOptions
options
OneTimeInititalizer
enshures tha _initialize() will be called only once
Owner
Collection of repositories
Properties
Repository
Abstract repository
Parameters
owner
Ownername
string (#branch) will be removedoptions
Object
options.description
string? human readable descriptionoptions.id
string? internal id
Properties
description
the description of the repository content.
Returns string
description
the description of the repository content.
Returns string
id
unique id within the provider.
Returns string
id
unique id within the provider.
Returns string
PullRequest
Abstract pull request
Repository#addPullRequest
Parameters
Properties
provider
Returns Provider
delete
Delete the pull request from the Repository.
Returns Promise
merge
Merge the pull request
decline
Decline the pull request
title
the one line description of the pull request.
Returns string
body
the description of the pull request.
Returns string
state
state of the pull request.
Returns string
RepositoryGroup
Extends Owner
Abstract repository as a collection
Parameters
Properties
repositoryClass
By default we use the providers implementation.
Returns Class as defined in the provider
branchClass
By default we use the providers implementation.
Returns Class as defined in the provider
contentClass
By default we use the providers implementation.
Returns Class as defined in the provider
pullRequestClass
By default we use the providers implementation.
Returns Class as defined in the provider
Content
Representation of one file or directory entry
Parameters
path
string file name inside of the repositorycontent
(string | Buffer | Stream) (optional, default undefined
)type
string type of the content (optional, default "blob"
)mode
string file permissions (optional, default "100644"
)
Properties
propertiesFromOptions
- See: Object.definedProperties()
create properties from options and default options
Parameters
install
With npm do:
npm install repository-provider
license
BSD-2-Clause