repository-provider 28.3.1 → 28.3.2
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/README.md +7 -2
- package/package.json +1 -1
- package/src/hook.mjs +6 -15
package/README.md
CHANGED
|
@@ -198,6 +198,7 @@ console.log(await readme.getString());
|
|
|
198
198
|
* [Parameters](#parameters-47)
|
|
199
199
|
* [displayName](#displayname)
|
|
200
200
|
* [fullName](#fullname-1)
|
|
201
|
+
* [toString](#tostring)
|
|
201
202
|
* [toJSON](#tojson-2)
|
|
202
203
|
* [OwnedObject](#ownedobject)
|
|
203
204
|
* [Parameters](#parameters-48)
|
|
@@ -251,7 +252,7 @@ console.log(await readme.getString());
|
|
|
251
252
|
* [fullName](#fullname-3)
|
|
252
253
|
* [fullCondensedName](#fullcondensedname)
|
|
253
254
|
* [identifier](#identifier-1)
|
|
254
|
-
* [toString](#tostring)
|
|
255
|
+
* [toString](#tostring-1)
|
|
255
256
|
* [issuesURL](#issuesurl)
|
|
256
257
|
* [homePageURL](#homepageurl-1)
|
|
257
258
|
* [isLocked](#islocked)
|
|
@@ -330,7 +331,7 @@ console.log(await readme.getString());
|
|
|
330
331
|
* [type](#type-1)
|
|
331
332
|
* [refId](#refid-1)
|
|
332
333
|
* [Parameters](#parameters-82)
|
|
333
|
-
* [toString](#tostring-
|
|
334
|
+
* [toString](#tostring-2)
|
|
334
335
|
* [toJSON](#tojson-3)
|
|
335
336
|
* [attributes](#attributes-2)
|
|
336
337
|
* [defaultBranchName](#defaultbranchname)
|
|
@@ -1192,6 +1193,10 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
|
|
|
1192
1193
|
|
|
1193
1194
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name with owner name
|
|
1194
1195
|
|
|
1196
|
+
### toString
|
|
1197
|
+
|
|
1198
|
+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name
|
|
1199
|
+
|
|
1195
1200
|
### toJSON
|
|
1196
1201
|
|
|
1197
1202
|
Provide name and all defined attributes.
|
package/package.json
CHANGED
package/src/hook.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { optionJSON } from "./attribute.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { NamedObject } from "./named-object.mjs";
|
|
3
3
|
import { Repository } from "./repository.mjs";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -13,11 +13,11 @@ import { Repository } from "./repository.mjs";
|
|
|
13
13
|
* @property {URL} url
|
|
14
14
|
* @property {Set<string>} events
|
|
15
15
|
*/
|
|
16
|
-
export class Hook extends
|
|
16
|
+
export class Hook extends NamedObject {
|
|
17
17
|
static get attributes() {
|
|
18
18
|
return {
|
|
19
19
|
...super.attributes,
|
|
20
|
-
|
|
20
|
+
id: { type: "string", writable: true },
|
|
21
21
|
url: { type: "url", description: "target url", writable: true },
|
|
22
22
|
secret: { type: "string", private: true, writable: true },
|
|
23
23
|
content_type: { type: "string", default: "json", writable: true },
|
|
@@ -26,9 +26,8 @@ export class Hook extends BaseObject {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
constructor(repository,
|
|
30
|
-
super(options, {
|
|
31
|
-
id: { value: id },
|
|
29
|
+
constructor(repository, name, events = new Set(["*"]), options) {
|
|
30
|
+
super(name, options, {
|
|
32
31
|
repository: { value: repository },
|
|
33
32
|
events: { value: events }
|
|
34
33
|
});
|
|
@@ -41,14 +40,6 @@ export class Hook extends BaseObject {
|
|
|
41
40
|
return this.repository;
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
get fullName() {
|
|
45
|
-
return `${this.repository.fullName}/${this.id}`;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
get displayName() {
|
|
49
|
-
return this.id;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
43
|
/**
|
|
53
44
|
* Check for equality.
|
|
54
45
|
* @param {Hook} other
|
|
@@ -62,6 +53,6 @@ export class Hook extends BaseObject {
|
|
|
62
53
|
* Provide name, events and all defined attributes.
|
|
63
54
|
*/
|
|
64
55
|
toJSON() {
|
|
65
|
-
return optionJSON(this, { id: this.id, events: [...this.events] });
|
|
56
|
+
return optionJSON(this, { name: this.name, id: this.id, events: [...this.events] });
|
|
66
57
|
}
|
|
67
58
|
}
|