repository-provider
Advanced tools
Comparing version 2.23.1 to 2.24.0
@@ -285,2 +285,16 @@ 'use strict'; | ||
} | ||
async project(name) { | ||
if (name === undefined) { | ||
return undefined; | ||
} | ||
await this._initialize(); | ||
return this.projects.get(name); | ||
} | ||
async createProject(name, options) { | ||
await this._initialize(); | ||
const project = new this.projectClass(this, name, options); | ||
await project.initialize(); | ||
this.projects.set(name, project); | ||
return project; | ||
} | ||
get branchClass() { | ||
@@ -287,0 +301,0 @@ return Branch; |
{ | ||
"name": "repository-provider", | ||
"version": "2.23.1", | ||
"version": "2.24.0", | ||
"publishConfig": { | ||
@@ -46,3 +46,3 @@ "access": "public" | ||
"rollup-plugin-node-resolve": "^3.3.0", | ||
"semantic-release": "^15.9.3", | ||
"semantic-release": "^15.9.5", | ||
"travis-deploy-once": "^5.0.2" | ||
@@ -49,0 +49,0 @@ }, |
@@ -49,2 +49,6 @@ [![npm](https://img.shields.io/npm/v/repository-provider.svg)](https://www.npmjs.com/package/repository-provider) | ||
- [Properties](#properties) | ||
- [project](#project) | ||
- [Parameters](#parameters-1) | ||
- [createProject](#createproject) | ||
- [Parameters](#parameters-2) | ||
- [branchClass](#branchclass) | ||
@@ -58,7 +62,7 @@ - [projectClass](#projectclass) | ||
- [optionsFromEnvironment](#optionsfromenvironment) | ||
- [Parameters](#parameters-1) | ||
- [Parameters](#parameters-3) | ||
- [options](#options) | ||
- [Parameters](#parameters-2) | ||
- [Parameters](#parameters-4) | ||
- [Branch](#branch) | ||
- [Parameters](#parameters-3) | ||
- [Parameters](#parameters-5) | ||
- [Properties](#properties-1) | ||
@@ -68,3 +72,3 @@ - [initialize](#initialize) | ||
- [owner](#owner) | ||
- [project](#project) | ||
- [project](#project-1) | ||
- [fullName](#fullname) | ||
@@ -78,29 +82,30 @@ - [fullCondensedName](#fullcondensedname) | ||
- [content](#content) | ||
- [Parameters](#parameters-4) | ||
- [Parameters](#parameters-6) | ||
- [commit](#commit) | ||
- [Parameters](#parameters-5) | ||
- [Parameters](#parameters-7) | ||
- [createPullRequest](#createpullrequest) | ||
- [Parameters](#parameters-6) | ||
- [Parameters](#parameters-8) | ||
- [list](#list) | ||
- [rateLimitReached](#ratelimitreached-1) | ||
- [rateLimitReached](#ratelimitreached-2) | ||
- [Parameters](#parameters-7) | ||
- [Parameters](#parameters-9) | ||
- [Owner](#owner-1) | ||
- [Properties](#properties-2) | ||
- [repositoryClass](#repositoryclass) | ||
- [deleteRepository](#deleterepository) | ||
- [Parameters](#parameters-8) | ||
- [Parameters](#parameters-10) | ||
- [repository](#repository) | ||
- [Parameters](#parameters-9) | ||
- [Parameters](#parameters-11) | ||
- [createRepository](#createrepository) | ||
- [Parameters](#parameters-10) | ||
- [Parameters](#parameters-12) | ||
- [branch](#branch-1) | ||
- [Parameters](#parameters-11) | ||
- [Parameters](#parameters-13) | ||
- [initialize](#initialize-1) | ||
- [type](#type) | ||
- [Repository](#repository-1) | ||
- [Parameters](#parameters-12) | ||
- [Properties](#properties-2) | ||
- [Parameters](#parameters-14) | ||
- [Properties](#properties-3) | ||
- [initialize](#initialize-2) | ||
- [content](#content-1) | ||
- [Parameters](#parameters-13) | ||
- [Parameters](#parameters-15) | ||
- [urls](#urls) | ||
@@ -111,29 +116,29 @@ - [url](#url-1) | ||
- [owner](#owner-2) | ||
- [project](#project-1) | ||
- [project](#project-2) | ||
- [condensedName](#condensedname) | ||
- [branch](#branch-2) | ||
- [Parameters](#parameters-14) | ||
- [Parameters](#parameters-16) | ||
- [defaultBranch](#defaultbranch) | ||
- [branches](#branches) | ||
- [createBranch](#createbranch) | ||
- [Parameters](#parameters-15) | ||
- [Parameters](#parameters-17) | ||
- [deleteBranch](#deletebranch) | ||
- [Parameters](#parameters-16) | ||
- [Parameters](#parameters-18) | ||
- [addBranch](#addbranch) | ||
- [Parameters](#parameters-17) | ||
- [Parameters](#parameters-19) | ||
- [delete](#delete-1) | ||
- [pullRequests](#pullrequests) | ||
- [pullRequest](#pullrequest) | ||
- [Parameters](#parameters-18) | ||
- [Parameters](#parameters-20) | ||
- [addPullRequest](#addpullrequest) | ||
- [Parameters](#parameters-19) | ||
- [Parameters](#parameters-21) | ||
- [deletePullRequest](#deletepullrequest) | ||
- [Parameters](#parameters-20) | ||
- [Parameters](#parameters-22) | ||
- [type](#type-1) | ||
- [rateLimitReached](#ratelimitreached-3) | ||
- [rateLimitReached](#ratelimitreached-4) | ||
- [Parameters](#parameters-21) | ||
- [Parameters](#parameters-23) | ||
- [PullRequest](#pullrequest-1) | ||
- [Parameters](#parameters-22) | ||
- [Properties](#properties-3) | ||
- [Parameters](#parameters-24) | ||
- [Properties](#properties-4) | ||
- [provider](#provider-2) | ||
@@ -143,8 +148,8 @@ - [delete](#delete-2) | ||
- [decline](#decline) | ||
- [Project](#project-2) | ||
- [Parameters](#parameters-23) | ||
- [Properties](#properties-4) | ||
- [Project](#project-3) | ||
- [Parameters](#parameters-25) | ||
- [Properties](#properties-5) | ||
- [Content](#content-2) | ||
- [Parameters](#parameters-24) | ||
- [Properties](#properties-5) | ||
- [Parameters](#parameters-26) | ||
- [Properties](#properties-6) | ||
@@ -163,5 +168,26 @@ ## Provider | ||
- `repositories` **[Map](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)** | ||
- `projects` **[Map](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [Project](#project)>** | ||
- `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** | ||
### project | ||
Lookup a project | ||
#### Parameters | ||
- `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** of the project | ||
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Project](#project)>** | ||
### createProject | ||
Create a new project | ||
#### Parameters | ||
- `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** | ||
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Project](#project)>** | ||
### branchClass | ||
@@ -376,2 +402,6 @@ | ||
### Properties | ||
- `repositories` **[Map](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [Repository](#repository)>** | ||
### repositoryClass | ||
@@ -378,0 +408,0 @@ |
import { Repository } from './repository'; | ||
/** | ||
* | ||
* @property {Map<string,Repository>} repositories | ||
*/ | ||
@@ -6,0 +6,0 @@ export class Owner { |
@@ -14,3 +14,3 @@ import { Branch } from './branch'; | ||
* @param {Object} options | ||
* @property {Map} repositories | ||
* @property {Map<string,Project>} projects | ||
* @property {Object} config | ||
@@ -58,2 +58,29 @@ */ | ||
/** | ||
* Lookup a project | ||
* @param {string} name of the project | ||
* @return {Promise<Project>} | ||
*/ | ||
async project(name) { | ||
if (name === undefined) { | ||
return undefined; | ||
} | ||
await this._initialize(); | ||
return this.projects.get(name); | ||
} | ||
/** | ||
* Create a new project | ||
* @param {string} name | ||
* @param {Object} options | ||
* @return {Promise<Project>} | ||
*/ | ||
async createProject(name, options) { | ||
await this._initialize(); | ||
const project = new this.projectClass(this, name, options); | ||
await project.initialize(); | ||
this.projects.set(name, project); | ||
return project; | ||
} | ||
/** | ||
* @return {Class} branch class used by the Provider | ||
@@ -60,0 +87,0 @@ */ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52822
982
742