repository-provider
Advanced tools
Comparing version 3.9.0 to 3.9.1
@@ -244,2 +244,33 @@ 'use strict'; | ||
class PullRequest { | ||
static get defaultOptions() { | ||
return { | ||
title: undefined, | ||
body: undefined, | ||
state: undefined | ||
}; | ||
} | ||
constructor(repository, name, options) { | ||
const properties = { | ||
name: { value: name }, | ||
repository: { value: repository } | ||
}; | ||
propertiesFromOptions(properties, options, this.constructor.defaultOptions); | ||
Object.defineProperties(this, properties); | ||
repository.addPullRequest(this); | ||
} | ||
get provider() { | ||
return this.repository.provider; | ||
} | ||
async delete() { | ||
return this.repository.deletePullRequest(this.name); | ||
} | ||
async merge() { | ||
return notImplementedError(); | ||
} | ||
async decline() { | ||
return notImplementedError(); | ||
} | ||
} | ||
const Owner = OneTimeInititalizerMixin( | ||
@@ -264,2 +295,5 @@ class Owner { | ||
} | ||
get pullRequestClass() { | ||
return PullRequest; | ||
} | ||
async deleteRepository(name) { | ||
@@ -303,33 +337,2 @@ await this.initialize(); | ||
class PullRequest { | ||
static get defaultOptions() { | ||
return { | ||
title: undefined, | ||
body: undefined, | ||
state: undefined | ||
}; | ||
} | ||
constructor(repository, name, options) { | ||
const properties = { | ||
name: { value: name }, | ||
repository: { value: repository } | ||
}; | ||
propertiesFromOptions(properties, options, this.constructor.defaultOptions); | ||
Object.defineProperties(this, properties); | ||
repository.addPullRequest(this); | ||
} | ||
get provider() { | ||
return this.repository.provider; | ||
} | ||
async delete() { | ||
return this.repository.deletePullRequest(this.name); | ||
} | ||
async merge() { | ||
return notImplementedError(); | ||
} | ||
async decline() { | ||
return notImplementedError(); | ||
} | ||
} | ||
class RepositoryGroup extends Owner { | ||
@@ -431,5 +434,2 @@ static get defaultOptions() { | ||
} | ||
get pullRequestClass() { | ||
return PullRequest; | ||
} | ||
get rateLimitReached() { | ||
@@ -436,0 +436,0 @@ return false; |
{ | ||
"name": "repository-provider", | ||
"version": "3.9.0", | ||
"version": "3.9.1", | ||
"publishConfig": { | ||
@@ -38,3 +38,3 @@ "access": "public" | ||
"markdown-doctest": "^0.9.1", | ||
"nyc": "^13.0.1", | ||
"nyc": "^13.1.0", | ||
"rollup": "^0.65.2", | ||
@@ -47,3 +47,3 @@ "rollup-plugin-cleanup": "^3.0.0", | ||
"rollup-plugin-node-resolve": "^3.4.0", | ||
"semantic-release": "^15.9.12", | ||
"semantic-release": "^15.9.14", | ||
"travis-deploy-once": "^5.0.7" | ||
@@ -50,0 +50,0 @@ }, |
@@ -58,3 +58,2 @@ [![npm](https://img.shields.io/npm/v/repository-provider.svg)](https://www.npmjs.com/package/repository-provider) | ||
- [repositoryGroupClass](#repositorygroupclass) | ||
- [pullRequestClass](#pullrequestclass) | ||
- [rateLimitReached](#ratelimitreached) | ||
@@ -100,3 +99,3 @@ - [name](#name) | ||
- [contentClass](#contentclass) | ||
- [pullRequestClass](#pullrequestclass-1) | ||
- [pullRequestClass](#pullrequestclass) | ||
- [Content](#content) | ||
@@ -171,6 +170,2 @@ - [Parameters](#parameters-11) | ||
### pullRequestClass | ||
Returns **Class** pull request class used by the Provider | ||
### rateLimitReached | ||
@@ -293,3 +288,3 @@ | ||
the description of the repository content. | ||
the description of the repository group. | ||
@@ -296,0 +291,0 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** |
@@ -11,3 +11,3 @@ import { Owner } from "./owner"; | ||
* @param {string} [options.id] internal id | ||
* | ||
* @property {Provider} provider | ||
@@ -20,3 +20,3 @@ * @property {string} name | ||
/** | ||
* the description of the repository content. | ||
* the description of the repository group. | ||
* @return {string} | ||
@@ -23,0 +23,0 @@ */ |
import { Repository } from "./repository"; | ||
import { Branch } from "./branch"; | ||
import { Content } from "./content"; | ||
import { PullRequest } from "./pull-request"; | ||
import { OneTimeInititalizerMixin } from "./one-time-initializer-mixin"; | ||
@@ -47,2 +48,9 @@ | ||
/** | ||
* @return {Class} pull request class used by the Provider | ||
*/ | ||
get pullRequestClass() { | ||
return PullRequest; | ||
} | ||
/** | ||
* Delete a repository | ||
@@ -49,0 +57,0 @@ * @param {string} name |
@@ -147,9 +147,2 @@ import { Branch } from "./branch"; | ||
/** | ||
* @return {Class} pull request class used by the Provider | ||
*/ | ||
get pullRequestClass() { | ||
return PullRequest; | ||
} | ||
/** | ||
* Is our rate limit reached. | ||
@@ -156,0 +149,0 @@ * By default we have no rate limit |
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
1357
55840
444