repository-provider 28.3.3 → 28.3.4
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 +1 -1
- package/src/hook.mjs +4 -30
- package/src/owned-object.mjs +2 -1
package/package.json
CHANGED
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,10 @@ export class Hook extends NamedObject {
|
|
|
26
17
|
};
|
|
27
18
|
}
|
|
28
19
|
|
|
29
|
-
constructor(
|
|
30
|
-
super(name, options, {
|
|
31
|
-
repository: { value: repository },
|
|
20
|
+
constructor(owner, name, events = new Set(["*"]), options) {
|
|
21
|
+
super(owner, name, options, {
|
|
32
22
|
events: { value: events }
|
|
33
23
|
});
|
|
34
|
-
|
|
35
|
-
repository._addHook(this);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
get owner()
|
|
39
|
-
{
|
|
40
|
-
return this.repository;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Check for equality.
|
|
45
|
-
* @param {Hook} other
|
|
46
|
-
* @return {boolean} true if name and repository are equal
|
|
47
|
-
*/
|
|
48
|
-
equals(other) {
|
|
49
|
-
return super.equals(other) && this.repository.equals(other.repository);
|
|
50
24
|
}
|
|
51
25
|
|
|
52
26
|
/**
|
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
|
|