github-repository-provider 7.25.63 → 7.26.1
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 +14 -2
- package/package.json +5 -5
- package/src/github-branch.mjs +17 -9
- package/src/github-repository.mjs +23 -0
package/README.md
CHANGED
|
@@ -68,6 +68,8 @@ console.log(entry.name);
|
|
|
68
68
|
* [open](#open)
|
|
69
69
|
* [Parameters](#parameters-10)
|
|
70
70
|
* [GithubRepository](#githubrepository)
|
|
71
|
+
* [commits](#commits)
|
|
72
|
+
* [Parameters](#parameters-11)
|
|
71
73
|
* [initializeBranches](#initializebranches)
|
|
72
74
|
* [initializeTags](#initializetags)
|
|
73
75
|
* [urls](#urls)
|
|
@@ -75,9 +77,9 @@ console.log(entry.name);
|
|
|
75
77
|
* [homePageURL](#homepageurl)
|
|
76
78
|
* [update](#update)
|
|
77
79
|
* [refId](#refid)
|
|
78
|
-
* [Parameters](#parameters-11)
|
|
79
|
-
* [deletePullRequest](#deletepullrequest)
|
|
80
80
|
* [Parameters](#parameters-12)
|
|
81
|
+
* [deletePullRequest](#deletepullrequest)
|
|
82
|
+
* [Parameters](#parameters-13)
|
|
81
83
|
* [initializeHooks](#initializehooks)
|
|
82
84
|
|
|
83
85
|
## GithubBranch
|
|
@@ -278,6 +280,16 @@ Returns **[Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Glob
|
|
|
278
280
|
|
|
279
281
|
Repository on GitHub.
|
|
280
282
|
|
|
283
|
+
### commits
|
|
284
|
+
|
|
285
|
+
<https://docs.github.com/en/rest/reference/commits#list-commits>
|
|
286
|
+
|
|
287
|
+
#### Parameters
|
|
288
|
+
|
|
289
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
290
|
+
|
|
291
|
+
Returns **AsyncIterator\<Commit>**
|
|
292
|
+
|
|
281
293
|
### initializeBranches
|
|
282
294
|
|
|
283
295
|
<https://developer.github.com/v3/repos/branches/#list-branches>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "github-repository-provider",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.26.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,20 +33,20 @@
|
|
|
33
33
|
"content-entry": "^4.1.9",
|
|
34
34
|
"fetch-link-util": "^1.0.7",
|
|
35
35
|
"fetch-rate-limit-util": "^2.5.1",
|
|
36
|
-
"matching-iterator": "^2.0.
|
|
36
|
+
"matching-iterator": "^2.0.4",
|
|
37
37
|
"node-fetch": "^3.2.3",
|
|
38
38
|
"one-time-execution-method": "^2.0.13",
|
|
39
|
-
"repository-provider": "^
|
|
39
|
+
"repository-provider": "^28.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"ava": "^4.1.0",
|
|
43
43
|
"c8": "^7.11.0",
|
|
44
44
|
"documentation": "^13.2.5",
|
|
45
|
-
"repository-provider-test-support": "^
|
|
45
|
+
"repository-provider-test-support": "^2.0.0",
|
|
46
46
|
"semantic-release": "^19.0.2"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
|
-
"node": ">=14.
|
|
49
|
+
"node": ">=16.14.2"
|
|
50
50
|
},
|
|
51
51
|
"repository": {
|
|
52
52
|
"type": "git",
|
package/src/github-branch.mjs
CHANGED
|
@@ -109,17 +109,25 @@ export class GithubBranch extends Branch {
|
|
|
109
109
|
this._entries = new Map();
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
const f = async () => {
|
|
113
|
+
const { json } = await this.provider.fetchJSON(
|
|
114
|
+
`repos/${this.slug}/contents/${name}?ref=${this.ref}`
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
const entry = new this.entryClass(
|
|
118
|
+
name,
|
|
119
|
+
Buffer.from(json.content, "base64")
|
|
120
|
+
);
|
|
115
121
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
);
|
|
122
|
+
this._entries.set(name, entry);
|
|
123
|
+
return entry;
|
|
124
|
+
};
|
|
120
125
|
|
|
121
|
-
|
|
122
|
-
|
|
126
|
+
const p = f();
|
|
127
|
+
|
|
128
|
+
this._entries.set(name, p);
|
|
129
|
+
|
|
130
|
+
return p;
|
|
123
131
|
}
|
|
124
132
|
|
|
125
133
|
/**
|
|
@@ -37,6 +37,29 @@ export class GithubRepository extends Repository {
|
|
|
37
37
|
return "main";
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* {@link https://docs.github.com/en/rest/reference/commits#list-commits}
|
|
42
|
+
* @param {Object} options
|
|
43
|
+
* @returns {AsyncIterator<Commit>}
|
|
44
|
+
*/
|
|
45
|
+
async *commits(options) {
|
|
46
|
+
let next = `repos/${this.slug}/commits`;
|
|
47
|
+
|
|
48
|
+
do {
|
|
49
|
+
const { response, json } = await this.provider.fetchJSON(next);
|
|
50
|
+
|
|
51
|
+
for(const c of json) {
|
|
52
|
+
yield {
|
|
53
|
+
sha: c.sha,
|
|
54
|
+
message: c.message,
|
|
55
|
+
author: c.author,
|
|
56
|
+
committer: c.committer,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
next = getHeaderLink(response.headers);
|
|
60
|
+
} while (next);
|
|
61
|
+
}
|
|
62
|
+
|
|
40
63
|
async _initializeSlot(typeName, addMethodName) {
|
|
41
64
|
let next = `repos/${this.slug}/${typeName}`;
|
|
42
65
|
|