repository-provider 32.3.10 → 32.3.11

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repository-provider",
3
- "version": "32.3.10",
3
+ "version": "32.3.11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1 +1,35 @@
1
1
  export const url = { description: "home of the object", type: "url" };
2
+
3
+
4
+ /**
5
+ * The description of the object content.
6
+ * @return {string}
7
+ */
8
+ export const description = {
9
+ type: "string",
10
+ description: "human readable description",
11
+ writable: true
12
+ };
13
+
14
+ export const name = {
15
+ type: "string",
16
+ isKey: true
17
+ };
18
+
19
+ /**
20
+ * Unique id within the provider.
21
+ * @return {string}
22
+ */
23
+ export const id = { isKey: true, type: "string" };
24
+
25
+ /**
26
+ * Unique id.
27
+ * @return {string}
28
+ */
29
+ export const uuid = { isKey: true, type: "string" };
30
+
31
+
32
+ export const state = { type: "string" };
33
+
34
+ export const secret = { type: "string", private: true, writable: true };
35
+
@@ -1,4 +1,5 @@
1
1
  import { definePropertiesFromOptions, mapAttributes } from "./attribute.mjs";
2
+ import { description, id, uuid } from "./attributes.mjs";
2
3
 
3
4
  /**
4
5
  * @param {Object} options
@@ -29,27 +30,9 @@ export class BaseObject {
29
30
  */
30
31
  static get attributes() {
31
32
  return {
32
- /**
33
- * The description of the repository content.
34
- * @return {string}
35
- */
36
- description: {
37
- type: "string",
38
- description: "human readable description",
39
- writable: true
40
- },
41
-
42
- /**
43
- * Unique id within the provider.
44
- * @return {string}
45
- */
46
- id: { isKey: true, type: "string" },
47
-
48
- /**
49
- * Unique id.
50
- * @return {string}
51
- */
52
- uuid: { isKey: true, type: "string" }
33
+ description,
34
+ id,
35
+ uuid
53
36
  };
54
37
  }
55
38
 
@@ -8,7 +8,7 @@ import { Hook } from "./hook.mjs";
8
8
  import { Project } from "./project.mjs";
9
9
  import { Milestone } from "./milestone.mjs";
10
10
  import { BaseObject } from "./base-object.mjs";
11
- import { url } from "./attributes.mjs";
11
+ import { url, name } from "./attributes.mjs";
12
12
 
13
13
  /**
14
14
  * @typedef {Object} MessageDestination
@@ -112,7 +112,7 @@ export class BaseProvider extends BaseObject {
112
112
  * Name of the provider.
113
113
  */
114
114
  name: {
115
- type: "string",
115
+ ...name,
116
116
  env: ["{{instanceIdentifier}}NAME"]
117
117
  },
118
118
 
package/src/hook.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { OwnedObject } from "./owned-object.mjs";
2
+ import { secret, url } from "./attributes.mjs";
2
3
 
3
4
  /**
4
5
  * Repository hook.
@@ -7,8 +8,8 @@ export class Hook extends OwnedObject {
7
8
  static get attributes() {
8
9
  return {
9
10
  ...super.attributes,
10
- url: { type: "url", description: "target url", writable: true },
11
- secret: { type: "string", private: true, writable: true },
11
+ url: { ...url, description: "target url", writable: true },
12
+ secret,
12
13
  content_type: { type: "string", default: "json", writable: true },
13
14
  insecure_ssl: { type: "boolean", default: false },
14
15
  active: { type: "boolean", default: true, writable: true },
package/src/milestone.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { OwnedObject } from "./owned-object.mjs";
2
+ import { state } from "./attributes.mjs";
2
3
 
3
4
  /**
4
5
  */
@@ -6,7 +7,7 @@ export class Milestone extends OwnedObject {
6
7
  static get attributes() {
7
8
  return {
8
9
  ...super.attributes,
9
- state: { type: "string" }
10
+ state
10
11
  };
11
12
  }
12
13
 
@@ -1,5 +1,6 @@
1
1
  import { optionJSON } from "./attribute.mjs";
2
2
  import { BaseObject } from "./base-object.mjs";
3
+ import { name } from "./attributes.mjs";
3
4
 
4
5
  /**
5
6
  * Object with a name.
@@ -16,10 +17,7 @@ export class NamedObject extends BaseObject {
16
17
  static get attributes() {
17
18
  return {
18
19
  ...super.attributes,
19
- name: {
20
- type: "string",
21
- isKey: true
22
- },
20
+ name,
23
21
 
24
22
  /**
25
23
  * The url of home page.
@@ -3,7 +3,7 @@ import { OwnedObject } from "./owned-object.mjs";
3
3
  import { Branch } from "./branch.mjs";
4
4
  import { Repository } from "./repository.mjs";
5
5
  import { Review } from "./review.mjs";
6
- import { url } from "./attributes.mjs";
6
+ import { url, state } from "./attributes.mjs";
7
7
 
8
8
  /**
9
9
  * Abstract pull request.
@@ -109,8 +109,8 @@ export class PullRequest extends OwnedObject {
109
109
  * @return {string}
110
110
  */
111
111
  state: {
112
+ ...state,
112
113
  default: "OPEN",
113
- type: "string",
114
114
  writable: true
115
115
  },
116
116
 
@@ -41,16 +41,13 @@ export class RepositoryGroup extends RepositoryOwner(OwnedObject) {
41
41
  */
42
42
  type: { type: "string" },
43
43
 
44
- /**
45
- * api url
46
- */
47
44
  url,
48
45
 
49
46
  /**
50
47
  * Avatar.
51
48
  * @return {string}
52
49
  */
53
- avatarURL: { type: "url" },
50
+ avatarURL: { ...url },
54
51
 
55
52
  isAdmin: { type: "boolean", default: false }
56
53
  };
@@ -52,13 +52,13 @@ export class Repository extends OwnedObject {
52
52
  */
53
53
  url,
54
54
 
55
- cloneURL: { type: "url" },
55
+ cloneURL: { ...url },
56
56
 
57
57
  /**
58
58
  * The url of issue tracking system.
59
59
  * @return {string}
60
60
  */
61
- issuesURL: { type: "url" },
61
+ issuesURL: { ...url },
62
62
  size: { type: "integer" },
63
63
  language: { type: "string" },
64
64
  isArchived: { type: "boolean", default: false, writable: true },