repository-provider 35.5.4 → 35.5.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repository-provider",
3
- "version": "35.5.4",
3
+ "version": "35.5.5",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "content-entry": "^14.2.3",
41
41
  "matching-iterator": "^2.1.4",
42
- "pacc": "^3.13.2"
42
+ "pacc": "^4.0.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "ava": "^6.4.1",
@@ -7,8 +7,8 @@ import { setAttribute, getAttribute } from "pacc";
7
7
  * options and merged with the given set of properties.
8
8
  * ```js
9
9
  * class aClass {
10
- * static get attributes() {
11
- * return { with_default: { default: 77 }};
10
+ * static attributes = {
11
+ * with_default: { default: 77 }
12
12
  * }
13
13
  * }
14
14
  *
@@ -37,12 +37,10 @@ export class BaseObject {
37
37
  * Attributes definitions.
38
38
  * @return {Object}
39
39
  */
40
- static get attributes() {
41
- return {
42
- id: id_attribute,
43
- description: description_attribute
44
- };
45
- }
40
+ static attributes = {
41
+ id: id_attribute,
42
+ description: description_attribute
43
+ };
46
44
 
47
45
  /**
48
46
  * User modifyable attributes.
@@ -58,9 +56,7 @@ export class BaseObject {
58
56
  * Map attributes between external and internal representation.
59
57
  * @return {Object}
60
58
  */
61
- static get attributeMapping() {
62
- return {};
63
- }
59
+ static attributeMapping = {};
64
60
 
65
61
  /** @type {string} */ id;
66
62
  /** @type {string} */ description;
@@ -118,32 +118,30 @@ export class BaseProvider extends BaseObject {
118
118
  return true;
119
119
  }
120
120
 
121
- static get attributes() {
122
- return {
123
- /**
124
- * Name of the provider.
125
- */
126
- name: {
127
- ...name_attribute,
128
- env: "{{instanceIdentifier}}NAME"
129
- },
130
-
131
- url: url_attribute,
132
- description: description_attribute,
133
- priority: priority_attribute,
134
-
135
- /**
136
- * To forward info/warn and error messages to
137
- */
138
- messageDestination: {
139
- ...default_attribute,
140
- type: "object",
141
- default: console,
142
- writable: true,
143
- private: true
144
- }
145
- };
146
- }
121
+ static attributes = {
122
+ /**
123
+ * Name of the provider.
124
+ */
125
+ name: {
126
+ ...name_attribute,
127
+ env: "{{instanceIdentifier}}NAME"
128
+ },
129
+
130
+ url: url_attribute,
131
+ description: description_attribute,
132
+ priority: priority_attribute,
133
+
134
+ /**
135
+ * To forward info/warn and error messages to
136
+ */
137
+ messageDestination: {
138
+ ...default_attribute,
139
+ type: "object",
140
+ default: console,
141
+ writable: true,
142
+ private: true
143
+ }
144
+ };
147
145
 
148
146
  get priority() {
149
147
  return 0;
package/src/hook.mjs CHANGED
@@ -11,20 +11,17 @@ import { OwnedObject } from "./owned-object.mjs";
11
11
  * Repository hook.
12
12
  */
13
13
  export class Hook extends OwnedObject {
14
-
15
14
  static defaultEvents = new Set(["*"]);
16
15
 
17
- static get attributes() {
18
- return {
19
- ...super.attributes,
20
- active: active_attribute,
21
- secret: secret_attribute,
22
- url: { ...url_attribute, description: "target url", writable: true },
23
- content_type: { ...default_attribute, default: "json", writable: true },
24
- insecure_ssl: boolean_attribute,
25
- events: { type: "set", default: this.defaultEvents }
26
- };
27
- }
16
+ static attributes = {
17
+ ...super.attributes,
18
+ active: active_attribute,
19
+ secret: secret_attribute,
20
+ url: { ...url_attribute, description: "target url", writable: true },
21
+ content_type: { ...default_attribute, default: "json", writable: true },
22
+ insecure_ssl: boolean_attribute,
23
+ events: { type: "set", default: this.defaultEvents }
24
+ };
28
25
 
29
26
  static get addMethodName() {
30
27
  return "_addHook";
package/src/milestone.mjs CHANGED
@@ -4,12 +4,10 @@ import { OwnedObject } from "./owned-object.mjs";
4
4
  /**
5
5
  */
6
6
  export class Milestone extends OwnedObject {
7
- static get attributes() {
8
- return {
9
- ...super.attributes,
10
- state: state_attribute
11
- };
12
- }
7
+ static attributes = {
8
+ ...super.attributes,
9
+ state: state_attribute
10
+ };
13
11
 
14
12
  async *issues() {}
15
13
  }
@@ -1,8 +1,4 @@
1
- import {
2
- name_attribute,
3
- description_attribute,
4
- id_attribute
5
- } from "pacc";
1
+ import { name_attribute, description_attribute, id_attribute } from "pacc";
6
2
  import { optionJSON } from "./attribute-extras.mjs";
7
3
  import { BaseObject } from "./base-object.mjs";
8
4
 
@@ -18,13 +14,11 @@ import { BaseObject } from "./base-object.mjs";
18
14
  * @property {string} name
19
15
  */
20
16
  export class NamedObject extends BaseObject {
21
- static get attributes() {
22
- return {
23
- id: id_attribute,
24
- name: name_attribute,
25
- description: description_attribute
26
- };
27
- }
17
+ static attributes = {
18
+ id: id_attribute,
19
+ name: name_attribute,
20
+ description: description_attribute
21
+ };
28
22
 
29
23
  constructor(name, options, additionalProperties) {
30
24
  super(options, {
@@ -92,47 +92,45 @@ export class PullRequest extends OwnedObject {
92
92
  return new this(source, destination, "-1", options);
93
93
  }
94
94
 
95
- static get attributes() {
96
- return {
97
- ...super.attributes,
98
- body: body_attribute,
99
- title: title_attribute,
100
- url: url_attribute,
101
-
102
- /**
103
- * state of the pull request.
104
- * - OPEN
105
- * - MERGED
106
- * - CLOSED
107
- * @return {string}
108
- */
109
- state: {
110
- ...state_attribute,
111
- default: "OPEN",
112
- values: this.states
113
- },
114
-
115
- /**
116
- * Locked state of the pull request.
117
- * @return {boolean}
118
- */
119
- locked: boolean_attribute,
120
-
121
- /**
122
- * Merged state of the pull request.
123
- * @return {boolean}
124
- */
125
- merged: boolean_attribute,
126
-
127
- /**
128
- * Draft state of the pull request.
129
- * @return {boolean}
130
- */
131
- draft: boolean_attribute,
132
- dry: boolean_attribute,
133
- empty: empty_attribute
134
- };
135
- }
95
+ static attributes = {
96
+ ...super.attributes,
97
+ body: body_attribute,
98
+ title: title_attribute,
99
+ url: url_attribute,
100
+
101
+ /**
102
+ * state of the pull request.
103
+ * - OPEN
104
+ * - MERGED
105
+ * - CLOSED
106
+ * @return {string}
107
+ */
108
+ state: {
109
+ ...state_attribute,
110
+ default: "OPEN",
111
+ values: this.states
112
+ },
113
+
114
+ /**
115
+ * Locked state of the pull request.
116
+ * @return {boolean}
117
+ */
118
+ locked: boolean_attribute,
119
+
120
+ /**
121
+ * Merged state of the pull request.
122
+ * @return {boolean}
123
+ */
124
+ merged: boolean_attribute,
125
+
126
+ /**
127
+ * Draft state of the pull request.
128
+ * @return {boolean}
129
+ */
130
+ draft: boolean_attribute,
131
+ dry: boolean_attribute,
132
+ empty: empty_attribute
133
+ };
136
134
 
137
135
  /** @type {Branch} */ source;
138
136
 
package/src/ref.mjs CHANGED
@@ -2,9 +2,9 @@ import { name_attribute, boolean_attribute } from "pacc";
2
2
  import { ContentEntry } from "content-entry";
3
3
  import { OwnedObject } from "./owned-object.mjs";
4
4
 
5
- /**
6
- * @typedef {import('./repository.mjs').Repository} Repository
7
- */
5
+ /**
6
+ * @typedef {import('./repository.mjs').Repository} Repository
7
+ */
8
8
 
9
9
  /**
10
10
  * Base for Branch and Tag
@@ -15,23 +15,19 @@ export class Ref extends OwnedObject {
15
15
  * Attributes
16
16
  * @type {Object}
17
17
  */
18
- static get attributes() {
19
- return {
20
- name: name_attribute,
21
-
22
- /**
23
- * Can the ref be modified.
24
- * @return {boolean}
25
- */
26
- isProtected: boolean_attribute
27
- };
28
- }
29
-
30
- static get attributeMapping() {
31
- return {
32
- protected: "isProtected"
33
- };
34
- }
18
+ static attributes = {
19
+ name: name_attribute,
20
+
21
+ /**
22
+ * Can the ref be modified.
23
+ * @return {boolean}
24
+ */
25
+ isProtected: boolean_attribute
26
+ };
27
+
28
+ static attributeMapping = {
29
+ protected: "isProtected"
30
+ };
35
31
 
36
32
  get refType() {
37
33
  return "unknown";
@@ -1,8 +1,4 @@
1
- import {
2
- url_attribute,
3
- boolean_attribute,
4
- type_attribute
5
- } from "pacc";
1
+ import { url_attribute, boolean_attribute, type_attribute } from "pacc";
6
2
  import { RepositoryOwner } from "./repository-owner.mjs";
7
3
  import { OwnedObject } from "./owned-object.mjs";
8
4
  import { BaseProvider } from "./base-provider.mjs";
@@ -36,31 +32,27 @@ export class RepositoryGroup extends RepositoryOwner(OwnedObject) {
36
32
  return "repositoryGroups";
37
33
  }
38
34
 
39
- static get attributes() {
40
- return {
41
- ...super.attributes,
35
+ static attributes = {
36
+ ...super.attributes,
42
37
 
43
- /**
44
- * Type of the repository group either User or Organization.
45
- */
46
- type: type_attribute,
47
- url: url_attribute,
48
- avatarURL: url_attribute,
49
- isAdmin: boolean_attribute,
50
- /**
51
- * The url of home page.
52
- * @return {string}
53
- */
54
- homePageURL: { ...url_attribute, writable: true }
55
- };
56
- }
38
+ /**
39
+ * Type of the repository group either User or Organization.
40
+ */
41
+ type: type_attribute,
42
+ url: url_attribute,
43
+ avatarURL: url_attribute,
44
+ isAdmin: boolean_attribute,
45
+ /**
46
+ * The url of home page.
47
+ * @return {string}
48
+ */
49
+ homePageURL: { ...url_attribute, writable: true }
50
+ };
57
51
 
58
52
  /**
59
53
  * Map attributes between external and internal representation.
60
54
  */
61
- static get attributeMapping() {
62
- return {};
63
- }
55
+ static attributeMapping() {}
64
56
 
65
57
  get isAdmin() {
66
58
  return false;
@@ -1,8 +1,8 @@
1
1
  import {
2
+ default_attribute,
2
3
  url_attribute,
3
4
  boolean_attribute,
4
- boolean_read_only_attribute,
5
- default_attribute
5
+ boolean_attribute_false
6
6
  } from "pacc";
7
7
  import { matcher } from "matching-iterator";
8
8
  import { ContentEntry } from "content-entry";
@@ -47,29 +47,26 @@ export class Repository extends OwnedObject {
47
47
  /**
48
48
  * options
49
49
  */
50
- static get attributes() {
51
- return {
52
- ...super.attributes,
53
- url: url_attribute,
54
-
55
- /**
56
- * The name of the default branch
57
- * @return {string}
58
- */
59
- defaultBranchName: {
60
- ...default_attribute,
61
- default: Repository.defaultBranchName
62
- },
63
-
64
- cloneURL: url_attribute,
65
-
66
- isArchived: boolean_attribute,
67
- isLocked: boolean_attribute,
68
- isDisabled: boolean_attribute,
69
- isTemplate: boolean_attribute,
70
- isFork: boolean_read_only_attribute
71
- };
72
- }
50
+ static attributes = {
51
+ ...super.attributes,
52
+ url: url_attribute,
53
+
54
+ /**
55
+ * The name of the default branch
56
+ * @return {string}
57
+ */
58
+ defaultBranchName: {
59
+ ...default_attribute,
60
+ default: Repository.defaultBranchName
61
+ },
62
+
63
+ cloneURL: url_attribute,
64
+ isArchived: boolean_attribute,
65
+ isLocked: boolean_attribute,
66
+ isDisabled: boolean_attribute,
67
+ isTemplate: boolean_attribute,
68
+ isFork: boolean_attribute_false
69
+ };
73
70
 
74
71
  /** @type {Map<string,Branch>} */ #branches = new Map();
75
72
  /** @type {Map<string,Tag>} */ #tags = new Map();
@@ -91,7 +88,12 @@ export class Repository extends OwnedObject {
91
88
  * @param {Object} [additionalProperties]
92
89
  */
93
90
  constructor(owner, name, options, additionalProperties) {
94
- super(owner, owner.normalizeRepositoryName(name, false), options, additionalProperties);
91
+ super(
92
+ owner,
93
+ owner.normalizeRepositoryName(name, false),
94
+ options,
95
+ additionalProperties
96
+ );
95
97
  }
96
98
 
97
99
  /**
@@ -442,7 +444,7 @@ export class Repository extends OwnedObject {
442
444
  */
443
445
  async hook(id) {
444
446
  for await (const hook of this.hooks()) {
445
- // @ts-ignore
447
+ // @ts-ignore
446
448
  if (hook.id == id) {
447
449
  // string of number
448
450
  return hook;
@@ -502,7 +504,7 @@ export class Repository extends OwnedObject {
502
504
  * @param {string} ref
503
505
  * @return {Promise<string|undefined>} sha of the ref
504
506
  */
505
- async refId(ref) {
507
+ async refId(ref) {
506
508
  return undefined;
507
509
  }
508
510
 
@@ -521,8 +523,8 @@ export class Repository extends OwnedObject {
521
523
  }
522
524
 
523
525
  async initializePullRequests() {
524
- // @ts-ignore
525
- for await (const pr of this.pullRequestClass.list(this)) {
526
+ // @ts-ignore
527
+ for await (const pr of this.pullRequestClass.list(this)) {
526
528
  this.#pullRequests.set(pr.name, pr);
527
529
  }
528
530
  }
@@ -5,8 +5,8 @@
5
5
  * options and merged with the given set of properties.
6
6
  * ```js
7
7
  * class aClass {
8
- * static get attributes() {
9
- * return { with_default: { default: 77 }};
8
+ * static attributes = {
9
+ * with_default: { default: 77 }
10
10
  * }
11
11
  * }
12
12
  *
@@ -25,7 +25,10 @@ export class BaseObject {
25
25
  * Attributes definitions.
26
26
  * @return {Object}
27
27
  */
28
- static get attributes(): any;
28
+ static attributes: {
29
+ id: import("pacc").AttributeDefinition;
30
+ description: import("pacc").AttributeDefinition;
31
+ };
29
32
  /**
30
33
  * User modifyable attributes.
31
34
  * @return {Object} writable attributes
@@ -35,7 +38,7 @@ export class BaseObject {
35
38
  * Map attributes between external and internal representation.
36
39
  * @return {Object}
37
40
  */
38
- static get attributeMapping(): any;
41
+ static attributeMapping: {};
39
42
  /**
40
43
  * Creates an instance of BaseObject.
41
44
  * @param {Object} [options]
@@ -48,7 +48,7 @@ export class BaseProvider extends BaseObject {
48
48
  * @return {boolean} true if options ar sufficient to construct a provider
49
49
  */
50
50
  static areOptionsSufficcient(options: any): boolean;
51
- static get attributes(): {
51
+ static attributes: {
52
52
  /**
53
53
  * Name of the provider.
54
54
  */
package/types/hook.d.mts CHANGED
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export class Hook extends OwnedObject {
5
5
  static defaultEvents: Set<string>;
6
- static get attributes(): {
6
+ static attributes: {
7
7
  active: import("pacc").AttributeDefinition;
8
8
  secret: import("pacc").AttributeDefinition;
9
9
  url: {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  */
3
3
  export class Milestone extends OwnedObject {
4
- static get attributes(): {
4
+ static attributes: {
5
5
  state: import("pacc").AttributeDefinition;
6
6
  id: import("pacc").AttributeDefinition;
7
7
  name: import("pacc").AttributeDefinition;
@@ -10,7 +10,7 @@
10
10
  * @property {string} name
11
11
  */
12
12
  export class NamedObject extends BaseObject {
13
- static get attributes(): {
13
+ static attributes: {
14
14
  id: import("pacc").AttributeDefinition;
15
15
  name: import("pacc").AttributeDefinition;
16
16
  description: import("pacc").AttributeDefinition;
@@ -59,7 +59,7 @@ export class PullRequest extends OwnedObject {
59
59
  * @param {Object} [options]
60
60
  */
61
61
  static open(source: Branch, destination: Branch, options?: any): Promise<PullRequest>;
62
- static get attributes(): {
62
+ static attributes: {
63
63
  body: import("pacc").AttributeDefinition;
64
64
  title: import("pacc").AttributeDefinition;
65
65
  url: import("pacc").AttributeDefinition;
package/types/ref.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @typedef {import('./repository.mjs').Repository} Repository
3
- */
2
+ * @typedef {import('./repository.mjs').Repository} Repository
3
+ */
4
4
  /**
5
5
  * Base for Branch and Tag
6
6
  */
@@ -9,8 +9,8 @@ export class Ref extends OwnedObject {
9
9
  * Attributes
10
10
  * @type {Object}
11
11
  */
12
- static get attributes(): any;
13
- static get attributeMapping(): {
12
+ static attributes: any;
13
+ static attributeMapping: {
14
14
  protected: string;
15
15
  };
16
16
  get refType(): string;
@@ -46,11 +46,11 @@ export class RepositoryGroup extends RepositoryGroup_base {
46
46
  static get deleteMethodName(): string;
47
47
  static get type(): string;
48
48
  static get collectionName(): string;
49
- static get attributes(): any;
49
+ static attributes: any;
50
50
  /**
51
51
  * Map attributes between external and internal representation.
52
52
  */
53
- static get attributeMapping(): {};
53
+ static attributeMapping(): void;
54
54
  get isAdmin(): boolean;
55
55
  get areRepositoryNamesCaseSensitive(): any;
56
56
  get areRepositoryGroupNamesCaseSensitive(): any;
@@ -15,7 +15,7 @@ export class Repository extends OwnedObject {
15
15
  /**
16
16
  * options
17
17
  */
18
- static get attributes(): {
18
+ static attributes: {
19
19
  url: import("pacc").AttributeDefinition;
20
20
  /**
21
21
  * The name of the default branch