repository-provider 28.3.2 → 28.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/hook.mjs +8 -30
- package/src/owned-object.mjs +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repository-provider",
|
|
3
|
-
"version": "28.3.
|
|
3
|
+
"version": "28.3.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"ava": "^4.2.0",
|
|
37
37
|
"c8": "^7.11.2",
|
|
38
38
|
"documentation": "^13.2.5",
|
|
39
|
-
"repository-provider-test-support": "^2.1.
|
|
39
|
+
"repository-provider-test-support": "^2.1.8",
|
|
40
40
|
"semantic-release": "^19.0.2",
|
|
41
41
|
"typescript": "^4.6.3"
|
|
42
42
|
},
|
package/src/hook.mjs
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import { optionJSON } from "./attribute.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { Repository } from "./repository.mjs";
|
|
2
|
+
import { OwnedObject } from "./owned-object.mjs";
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* Repository hook.
|
|
7
|
-
* @param {Repository} repository
|
|
8
|
-
* @param {string} id
|
|
9
|
-
* @param {Set<string>} events
|
|
10
|
-
* @param {Object} options
|
|
11
|
-
*
|
|
12
|
-
* @property {Repository} repository
|
|
13
|
-
* @property {URL} url
|
|
14
|
-
* @property {Set<string>} events
|
|
15
6
|
*/
|
|
16
|
-
export class Hook extends
|
|
7
|
+
export class Hook extends OwnedObject {
|
|
17
8
|
static get attributes() {
|
|
18
9
|
return {
|
|
19
10
|
...super.attributes,
|
|
@@ -26,27 +17,14 @@ export class Hook extends NamedObject {
|
|
|
26
17
|
};
|
|
27
18
|
}
|
|
28
19
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
repository: { value: repository },
|
|
32
|
-
events: { value: events }
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
repository._addHook(this);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
get owner()
|
|
39
|
-
{
|
|
40
|
-
return this.repository;
|
|
20
|
+
static get registerInstanceMethodName() {
|
|
21
|
+
return "_addHook";
|
|
41
22
|
}
|
|
42
23
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
*/
|
|
48
|
-
equals(other) {
|
|
49
|
-
return super.equals(other) && this.repository.equals(other.repository);
|
|
24
|
+
constructor(owner, name, events = new Set(["*"]), options) {
|
|
25
|
+
super(owner, name, options, {
|
|
26
|
+
events: { value: events }
|
|
27
|
+
});
|
|
50
28
|
}
|
|
51
29
|
|
|
52
30
|
/**
|
package/src/owned-object.mjs
CHANGED
|
@@ -13,8 +13,9 @@ export class OwnedObject extends NamedObject {
|
|
|
13
13
|
return "_add" + this.name;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
constructor(owner, name, options) {
|
|
16
|
+
constructor(owner, name, options, additionalProperties) {
|
|
17
17
|
super(name, options, {
|
|
18
|
+
...additionalProperties,
|
|
18
19
|
owner: { value: owner }
|
|
19
20
|
});
|
|
20
21
|
|