Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

repository-provider

Package Overview
Dependencies
Maintainers
1
Versions
662
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

repository-provider

abstract interface to git repository providers like github bitbucket

  • 9.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
961
increased by9.95%
Maintainers
1
Weekly downloads
 
Created
Source

npm Greenkeeper semantic-release styled with prettier Build Status codecov.io Coverage Status Known Vulnerabilities GitHub Issues Stories in Ready Dependency Status devDependency Status docs XO code style downloads Commitizen friendly

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

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

toJSON

list all defined entries from defaultOptions

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

priority

in case there are several provider able to support a given source which one sould be used ? this defines the order

Branch

Abstract branch

Parameters

Properties

defaultOptions

options

defaultOptions

options

defaultOptions

options

OneTimeInititalizer

enshures that _initialize() will be called only once

Owner

Collection of repositories

Properties

logger

default logger

Parameters

  • arg ...any

Repository

Abstract repository

Parameters

  • owner Owner
  • name string (#branch) will be removed
  • options Object
    • options.description string? human readable description
    • options.id string? internal id

Properties

description

the description of the repository content.

Returns string

description

the description of the repository group.

Returns string

id

unique id within the provider.

Returns string

id

internal id.

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

locked

locked state of the pull request.

Returns boolean

merged

merged state of the pull request.

Returns boolean

RepositoryGroup

Extends Owner

Abstract repository 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

definePropertiesFromOptions

  • See: Object.definedProperties()

create properties from options and default options

Parameters

  • object Object target object
  • options Object as passed to object constructor
  • properties Object object properties (optional, default {})

install

With npm do:

npm install repository-provider

license

BSD-2-Clause

Keywords

FAQs

Package last updated on 26 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc