bitbucket-repository-provider 4.1.4 → 4.1.7
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 +5 -0
- package/package.json +4 -4
- package/src/bitbucket-hook.mjs +12 -0
- package/src/bitbucket-provider.mjs +10 -1
- package/src/bitbucket-repository.mjs +4 -1
package/README.md
CHANGED
|
@@ -58,6 +58,7 @@ repository provider for bitbucket
|
|
|
58
58
|
* [homePageURL](#homepageurl)
|
|
59
59
|
* [issuesURL](#issuesurl)
|
|
60
60
|
* [update](#update)
|
|
61
|
+
* [initializeBranches](#initializebranches)
|
|
61
62
|
* [createBranch](#createbranch)
|
|
62
63
|
* [Parameters](#parameters-10)
|
|
63
64
|
* [deleteBranch](#deletebranch)
|
|
@@ -284,6 +285,10 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
|
|
|
284
285
|
|
|
285
286
|
<https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-put>
|
|
286
287
|
|
|
288
|
+
### initializeBranches
|
|
289
|
+
|
|
290
|
+
<https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-group-refs>
|
|
291
|
+
|
|
287
292
|
### createBranch
|
|
288
293
|
|
|
289
294
|
Create a new branch
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bitbucket-repository-provider",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"content-entry": "^5.0.0",
|
|
34
34
|
"fetch-rate-limit-util": "^2.9.5",
|
|
35
35
|
"matching-iterator": "^2.0.4",
|
|
36
|
-
"node-fetch": "^3.2.
|
|
36
|
+
"node-fetch": "^3.2.4",
|
|
37
37
|
"one-time-execution-method": "^2.0.13",
|
|
38
|
-
"repository-provider": "^28.3.
|
|
38
|
+
"repository-provider": "^28.3.5"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"ava": "^4.2.0",
|
|
42
42
|
"c8": "^7.11.2",
|
|
43
43
|
"documentation": "^13.2.5",
|
|
44
|
-
"repository-provider-test-support": "^2.1.
|
|
44
|
+
"repository-provider-test-support": "^2.1.8",
|
|
45
45
|
"semantic-release": "^19.0.2"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
@@ -6,12 +6,14 @@ import { BitbucketBranch } from "./bitbucket-branch.mjs";
|
|
|
6
6
|
import { BitbucketRepositoryGroup } from "./bitbucket-repository-group.mjs";
|
|
7
7
|
import { BitbucketRepository } from "./bitbucket-repository.mjs";
|
|
8
8
|
import { BitbucketPullRequest } from "./bitbucket-pull-request.mjs";
|
|
9
|
+
import { BitbucketHook } from "./bitbucket-hook.mjs";
|
|
9
10
|
|
|
10
11
|
export {
|
|
11
12
|
BitbucketBranch,
|
|
12
13
|
BitbucketRepository,
|
|
13
14
|
BitbucketPullRequest,
|
|
14
|
-
BitbucketRepositoryGroup
|
|
15
|
+
BitbucketRepositoryGroup,
|
|
16
|
+
BitbucketHook
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
const domain = "bitbucket.org";
|
|
@@ -134,6 +136,13 @@ export class BitbucketProvider extends MultiGroupProvider {
|
|
|
134
136
|
return BitbucketPullRequest;
|
|
135
137
|
}
|
|
136
138
|
|
|
139
|
+
/**
|
|
140
|
+
* @return {Class} hook class used by the Provider
|
|
141
|
+
*/
|
|
142
|
+
get hookClass() {
|
|
143
|
+
return BitbucketHook;
|
|
144
|
+
}
|
|
145
|
+
|
|
137
146
|
/**
|
|
138
147
|
* All possible base urls.
|
|
139
148
|
* @return {string[]} common base urls of all repositories
|
|
@@ -64,13 +64,16 @@ export class BitbucketRepository extends Repository {
|
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/**
|
|
68
|
+
* @{link https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-hooks-get}
|
|
69
|
+
*/
|
|
67
70
|
async initializeHooks() {
|
|
68
71
|
let url = `repositories/${this.slug}/hooks`;
|
|
69
72
|
|
|
70
73
|
do {
|
|
71
74
|
const { json } = await this.provider.fetchJSON(url);
|
|
72
75
|
json.values.forEach(h =>
|
|
73
|
-
this.addHook(new this.hookClass(this, h.
|
|
76
|
+
this.addHook(new this.hookClass(this, h.uuid, new Set(h.events), h))
|
|
74
77
|
);
|
|
75
78
|
url = json.next;
|
|
76
79
|
} while (url);
|