bitbucket-repository-provider 6.2.2 → 6.2.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitbucket-repository-provider",
3
- "version": "6.2.2",
3
+ "version": "6.2.4",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -39,14 +39,14 @@
39
39
  "fetch-rate-limit-util": "^4.5.3",
40
40
  "matching-iterator": "^2.1.4",
41
41
  "one-time-execution-method": "^3.1.3",
42
- "repository-provider": "^35.5.2"
42
+ "repository-provider": "^35.5.7"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/node": "^24.1.0",
46
46
  "ava": "^6.4.1",
47
47
  "c8": "^10.1.3",
48
48
  "documentation": "^14.0.3",
49
- "repository-provider-test-support": "^3.1.48",
49
+ "repository-provider-test-support": "^3.1.49",
50
50
  "semantic-release": "^24.2.7",
51
51
  "typescript": "^5.8.3"
52
52
  },
@@ -14,16 +14,14 @@ export class BitbucketBranch extends Branch {
14
14
  /**
15
15
  * options
16
16
  */
17
- static get attributes() {
18
- return {
19
- ...super.attributes,
20
- /**
21
- *
22
- * @return {string}
23
- */
24
- hash: default_attribute
25
- };
26
- }
17
+ static attributes = {
18
+ ...super.attributes,
19
+ /**
20
+ *
21
+ * @return {string}
22
+ */
23
+ hash: default_attribute
24
+ };
27
25
 
28
26
  // TODO isInitialized ?
29
27
 
@@ -4,9 +4,7 @@ import { Hook } from "repository-provider";
4
4
  *
5
5
  */
6
6
  export class BitbucketHook extends Hook {
7
- static get attributeMapping() {
8
- return {
9
- uuid: "id"
10
- };
11
- }
7
+ static attributeMapping = {
8
+ uuid: "id"
9
+ };
12
10
  }
@@ -1,6 +1,11 @@
1
1
  import { replaceWithOneTimeExecutionMethod } from "one-time-execution-method";
2
2
  import { stateActionHandler } from "fetch-rate-limit-util";
3
- import { url_attribute, token_attribute, username_attribute, password_attribute } from "pacc";
3
+ import {
4
+ url_attribute,
5
+ token_attribute,
6
+ username_attribute,
7
+ password_attribute
8
+ } from "pacc";
4
9
  import { MultiGroupProvider } from "repository-provider";
5
10
  import { BitbucketBranch } from "./bitbucket-branch.mjs";
6
11
  import { BitbucketRepositoryGroup } from "./bitbucket-repository-group.mjs";
@@ -60,43 +65,41 @@ export class BitbucketProvider extends MultiGroupProvider {
60
65
  * Default configuration as given for the cloud privider.
61
66
  * @return {Object}
62
67
  */
63
- static get attributes() {
64
- return {
65
- ...super.attributes,
66
- url: {
67
- ...url_attribute,
68
- default: `https://${domain}/`
69
- },
70
- api: {
71
- ...url_attribute,
72
- description: "URL of the provider api",
73
- env: "{{instanceIdentifier}}API",
74
- set: value => (value.endsWith("/") ? value : value + "/"),
75
- default: `https://api.${domain}/2.0/`
76
- },
77
- "authentication.token": {
78
- ...token_attribute,
79
- description: "API token",
80
- env: "{{instanceIdentifier}}TOKEN",
81
- additionalAttributes: { "authentication.type": "token" }
82
- },
83
- "authentication.password": {
84
- ...password_attribute,
85
- description: "Password for plain authentification",
86
- env: [
87
- "{{instanceIdentifier}}APP_PASSWORD",
88
- "{{instanceIdentifier}}PASSWORD"
89
- ],
90
- additionalAttributes: { "authentication.type": "basic" }
91
- },
92
- "authentication.username": {
93
- ...username_attribute,
94
- description: "Username for plain authentification",
95
- env: "{{instanceIdentifier}}USERNAME",
96
- additionalAttributes: { "authentication.type": "basic" }
97
- }
98
- };
99
- }
68
+ static attributes = {
69
+ ...super.attributes,
70
+ url: {
71
+ ...url_attribute,
72
+ default: `https://${domain}/`
73
+ },
74
+ api: {
75
+ ...url_attribute,
76
+ description: "URL of the provider api",
77
+ env: "{{instanceIdentifier}}API",
78
+ set: value => (value.endsWith("/") ? value : value + "/"),
79
+ default: `https://api.${domain}/2.0/`
80
+ },
81
+ "authentication.token": {
82
+ ...token_attribute,
83
+ description: "API token",
84
+ env: "{{instanceIdentifier}}TOKEN",
85
+ additionalAttributes: { "authentication.type": "token" }
86
+ },
87
+ "authentication.password": {
88
+ ...password_attribute,
89
+ description: "Password for plain authentification",
90
+ env: [
91
+ "{{instanceIdentifier}}APP_PASSWORD",
92
+ "{{instanceIdentifier}}PASSWORD"
93
+ ],
94
+ additionalAttributes: { "authentication.type": "basic" }
95
+ },
96
+ "authentication.username": {
97
+ ...username_attribute,
98
+ description: "Username for plain authentification",
99
+ env: "{{instanceIdentifier}}USERNAME",
100
+ additionalAttributes: { "authentication.type": "basic" }
101
+ }
102
+ };
100
103
 
101
104
  /**
102
105
  * @param {Object} options
@@ -8,18 +8,16 @@ export class BitbucketPullRequest extends PullRequest {
8
8
  static states = new Set(["OPEN", "MERGED", "SUPERSEDED", "DECLINED"]);
9
9
  static mergeStrategies = new Set(["fast_forward", "squash", "merge_commit"]);
10
10
 
11
- static get attributes() {
12
- return {
13
- ...super.attributes,
14
- state: {
15
- ...default_attribute,
16
- values: this.states,
17
- writeable: true
18
- },
19
- close_source_branch: boolean_attribute,
20
- task_count: count_attribute
21
- };
22
- }
11
+ static attributes = {
12
+ ...super.attributes,
13
+ state: {
14
+ ...default_attribute,
15
+ values: this.states,
16
+ writeable: true
17
+ },
18
+ close_source_branch: boolean_attribute,
19
+ task_count: count_attribute
20
+ };
23
21
 
24
22
  /**
25
23
  * List all pull request for a given repo.
@@ -5,21 +5,17 @@ import { Repository, RepositoryGroup } from "repository-provider";
5
5
  *
6
6
  */
7
7
  export class BitbucketRepositoryGroup extends RepositoryGroup {
8
- static get attributes() {
9
- return {
10
- ...super.attributes,
11
- uuid: uuid_attribute
12
- };
13
- }
8
+ static attributes = {
9
+ ...super.attributes,
10
+ uuid: uuid_attribute
11
+ };
14
12
 
15
- static get attributeMapping() {
16
- return {
17
- ...super.attributeMapping,
18
- display_name: "displayName",
19
- "links.avatar.href": "avatarURL",
20
- website: "homePageURL"
21
- };
22
- }
13
+ static attributeMapping = {
14
+ ...super.attributeMapping,
15
+ display_name: "displayName",
16
+ "links.avatar.href": "avatarURL",
17
+ website: "homePageURL"
18
+ };
23
19
 
24
20
  /**
25
21
  * {@link https://community.atlassian.com/t5/Bitbucket-articles/Create-and-configure-a-Bitbucket-Server-repository-using-the/ba-p/828364}
@@ -21,23 +21,19 @@ import { BitbucketBranch } from "./bitbucket-branch.mjs";
21
21
  * @property {string} user
22
22
  */
23
23
  export class BitbucketRepository extends Repository {
24
- static get attributes() {
25
- return {
26
- ...super.attributes,
27
- uuid: uuid_attribute,
28
- size: size_attribute,
29
- language: language_attribute,
30
- fork_policy: { ...default_attribute, default: "allow_forks" }
31
- };
32
- }
33
-
34
- static get attributMapping() {
35
- return {
36
- ...super.attributeMapping,
37
- is_private: "isPrivate",
38
- website: "homePageURL"
39
- };
40
- }
24
+ static attributes = {
25
+ ...super.attributes,
26
+ uuid: uuid_attribute,
27
+ size: size_attribute,
28
+ language: language_attribute,
29
+ fork_policy: { ...default_attribute, default: "allow_forks" }
30
+ };
31
+
32
+ static attributMapping = {
33
+ ...super.attributeMapping,
34
+ is_private: "isPrivate",
35
+ website: "homePageURL"
36
+ };
41
37
 
42
38
  get user() {
43
39
  return this.name.split(/\//)[0];
@@ -2,7 +2,7 @@
2
2
  *
3
3
  */
4
4
  export class BitbucketHook extends Hook {
5
- static get attributeMapping(): {
5
+ static attributeMapping: {
6
6
  uuid: string;
7
7
  };
8
8
  }
@@ -25,7 +25,118 @@ export class BitbucketProvider extends MultiGroupProvider {
25
25
  * Default configuration as given for the cloud privider.
26
26
  * @return {Object}
27
27
  */
28
- static get attributes(): any;
28
+ static attributes: {
29
+ url: {
30
+ default: string;
31
+ type: string;
32
+ isKey: boolean;
33
+ writable: boolean;
34
+ mandatory: boolean;
35
+ collection: boolean;
36
+ private?: boolean;
37
+ depends?: string;
38
+ description?: string;
39
+ set?: Function;
40
+ get?: Function;
41
+ env?: string[] | string;
42
+ };
43
+ api: {
44
+ description: string;
45
+ env: string;
46
+ set: (value: any) => any;
47
+ default: string;
48
+ type: string;
49
+ isKey: boolean;
50
+ writable: boolean;
51
+ mandatory: boolean;
52
+ collection: boolean;
53
+ private?: boolean;
54
+ depends?: string;
55
+ get?: Function;
56
+ };
57
+ "authentication.token": {
58
+ description: string;
59
+ env: string;
60
+ additionalAttributes: {
61
+ "authentication.type": string;
62
+ };
63
+ type: string;
64
+ isKey: boolean;
65
+ writable: boolean;
66
+ mandatory: boolean;
67
+ collection: boolean;
68
+ private?: boolean;
69
+ depends?: string;
70
+ default?: any;
71
+ set?: Function;
72
+ get?: Function;
73
+ };
74
+ "authentication.password": {
75
+ description: string;
76
+ env: string[];
77
+ additionalAttributes: {
78
+ "authentication.type": string;
79
+ };
80
+ type: string;
81
+ isKey: boolean;
82
+ writable: boolean;
83
+ mandatory: boolean;
84
+ collection: boolean;
85
+ private?: boolean;
86
+ depends?: string;
87
+ default?: any;
88
+ set?: Function;
89
+ get?: Function;
90
+ };
91
+ "authentication.username": {
92
+ description: string;
93
+ env: string;
94
+ additionalAttributes: {
95
+ "authentication.type": string;
96
+ };
97
+ type: string;
98
+ isKey: boolean;
99
+ writable: boolean;
100
+ mandatory: boolean;
101
+ collection: boolean;
102
+ private?: boolean;
103
+ depends?: string;
104
+ default?: any;
105
+ set?: Function;
106
+ get?: Function;
107
+ };
108
+ name: {
109
+ env: string;
110
+ type: string;
111
+ isKey: boolean;
112
+ writable: boolean;
113
+ mandatory: boolean;
114
+ collection: boolean;
115
+ private?: boolean;
116
+ depends?: string;
117
+ description?: string;
118
+ default?: any;
119
+ set?: Function;
120
+ get?: Function;
121
+ };
122
+ priority: import("pacc").AttributeDefinition;
123
+ messageDestination: {
124
+ type: string;
125
+ default: Console;
126
+ writable: boolean;
127
+ private: boolean;
128
+ isKey: boolean;
129
+ mandatory: boolean;
130
+ collection: boolean;
131
+ depends?: string;
132
+ description?: string;
133
+ set?: Function;
134
+ get?: Function;
135
+ env?: string[] | string;
136
+ };
137
+ id: import("pacc").AttributeDefinition;
138
+ description: import("pacc").AttributeDefinition;
139
+ };
29
140
  get repositoryGroupClass(): typeof BitbucketRepositoryGroup;
30
141
  get repositoryClass(): typeof BitbucketRepository;
31
142
  get branchClass(): typeof BitbucketBranch;
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export class BitbucketPullRequest extends PullRequest {
5
5
  static mergeStrategies: Set<string>;
6
- static get attributes(): {
6
+ static attributes: {
7
7
  state: {
8
8
  values: Set<string>;
9
9
  writeable: boolean;
@@ -11,9 +11,9 @@ export class BitbucketPullRequest extends PullRequest {
11
11
  isKey: boolean;
12
12
  writable: boolean;
13
13
  mandatory: boolean;
14
+ collection: boolean;
14
15
  private?: boolean;
15
16
  depends?: string;
16
- additionalAttributes: string[];
17
17
  description?: string;
18
18
  default?: any;
19
19
  set?: Function;
@@ -30,8 +30,8 @@ export class BitbucketPullRequest extends PullRequest {
30
30
  draft: import("pacc").AttributeDefinition;
31
31
  dry: import("pacc").AttributeDefinition;
32
32
  empty: import("pacc").AttributeDefinition;
33
- id: import("pacc").AttributeDefinition;
34
33
  name: import("pacc").AttributeDefinition;
34
+ id: import("pacc").AttributeDefinition;
35
35
  description: import("pacc").AttributeDefinition;
36
36
  };
37
37
  /**
@@ -2,7 +2,7 @@
2
2
  *
3
3
  */
4
4
  export class BitbucketRepositoryGroup extends RepositoryGroup {
5
- static get attributeMapping(): {
5
+ static attributeMapping: {
6
6
  display_name: string;
7
7
  "links.avatar.href": string;
8
8
  website: string;
@@ -11,7 +11,7 @@
11
11
  * @property {string} user
12
12
  */
13
13
  export class BitbucketRepository extends Repository {
14
- static get attributes(): {
14
+ static attributes: {
15
15
  uuid: import("pacc").AttributeDefinition;
16
16
  size: import("pacc").AttributeDefinition;
17
17
  language: import("pacc").AttributeDefinition;
@@ -21,9 +21,9 @@ export class BitbucketRepository extends Repository {
21
21
  isKey: boolean;
22
22
  writable: boolean;
23
23
  mandatory: boolean;
24
+ collection: boolean;
24
25
  private?: boolean;
25
26
  depends?: string;
26
- additionalAttributes: string[];
27
27
  description?: string;
28
28
  set?: Function;
29
29
  get?: Function;
@@ -36,12 +36,15 @@ export class BitbucketRepository extends Repository {
36
36
  isKey: boolean;
37
37
  writable: boolean;
38
38
  mandatory: boolean;
39
+ collection: boolean;
39
40
  private?: boolean;
40
41
  depends?: string;
41
- additionalAttributes: string[];
42
42
  description?: string;
43
43
  set?: Function;
44
- get?: Function;
44
+ get? /**
45
+ * Deliver the url of home page.
46
+ * @return {string} '.../overwiew'
47
+ */: Function;
45
48
  env?: string[] | string;
46
49
  };
47
50
  cloneURL: import("pacc").AttributeDefinition;
@@ -50,11 +53,14 @@ export class BitbucketRepository extends Repository {
50
53
  isDisabled: import("pacc").AttributeDefinition;
51
54
  isTemplate: import("pacc").AttributeDefinition;
52
55
  isFork: import("pacc").AttributeDefinition;
53
- id: import("pacc").AttributeDefinition;
54
56
  name: import("pacc").AttributeDefinition;
57
+ id: import("pacc").AttributeDefinition;
55
58
  description: import("pacc").AttributeDefinition;
56
59
  };
57
- static get attributMapping(): any;
60
+ static attributMapping: {
61
+ is_private: string;
62
+ website: string;
63
+ };
58
64
  get user(): string;
59
65
  /**
60
66
  * @see https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-put