github-repository-provider 7.25.18 → 7.25.22
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 +1 -1
- package/package.json +8 -8
- package/src/github-branch.mjs +6 -8
- package/src/github-provider.mjs +20 -12
package/README.md
CHANGED
|
@@ -139,7 +139,7 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
|
139
139
|
|
|
140
140
|
#### Parameters
|
|
141
141
|
|
|
142
|
-
* `
|
|
142
|
+
* `sha` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
143
143
|
|
|
144
144
|
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>**
|
|
145
145
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "github-repository-provider",
|
|
3
|
-
"version": "7.25.
|
|
3
|
+
"version": "7.25.22",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -30,19 +30,19 @@
|
|
|
30
30
|
"lint:docs": "documentation lint ./src/**/*.mjs"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"content-entry": "^4.1.
|
|
34
|
-
"fetch-link-util": "^1.0.
|
|
35
|
-
"fetch-rate-limit-util": "^2.4.
|
|
36
|
-
"matching-iterator": "^2.0.
|
|
33
|
+
"content-entry": "^4.1.3",
|
|
34
|
+
"fetch-link-util": "^1.0.5",
|
|
35
|
+
"fetch-rate-limit-util": "^2.4.8",
|
|
36
|
+
"matching-iterator": "^2.0.2",
|
|
37
37
|
"node-fetch": "3.2.0",
|
|
38
|
-
"one-time-execution-method": "^2.0.
|
|
39
|
-
"repository-provider": "^26.4.
|
|
38
|
+
"one-time-execution-method": "^2.0.10",
|
|
39
|
+
"repository-provider": "^26.4.3"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"ava": "^4.0.1",
|
|
43
43
|
"c8": "^7.11.0",
|
|
44
44
|
"documentation": "^13.2.5",
|
|
45
|
-
"repository-provider-test-support": "^1.
|
|
45
|
+
"repository-provider-test-support": "^1.11.1",
|
|
46
46
|
"semantic-release": "^19.0.2"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
package/src/github-branch.mjs
CHANGED
|
@@ -137,12 +137,12 @@ export class GithubBranch extends Branch {
|
|
|
137
137
|
|
|
138
138
|
/**
|
|
139
139
|
* @see https://developer.github.com/v3/git/trees/
|
|
140
|
-
* @param {string
|
|
140
|
+
* @param {string} sha
|
|
141
141
|
* @return {Object[]}
|
|
142
142
|
*/
|
|
143
|
-
async tree(
|
|
143
|
+
async tree(sha) {
|
|
144
144
|
const { json } = await this.provider.fetchJSON(
|
|
145
|
-
`repos/${this.slug}/git/trees/${
|
|
145
|
+
`repos/${this.slug}/git/trees/${sha}?recursive=1`
|
|
146
146
|
);
|
|
147
147
|
return json.tree;
|
|
148
148
|
}
|
|
@@ -155,7 +155,7 @@ export class GithubBranch extends Branch {
|
|
|
155
155
|
})) {
|
|
156
156
|
yield entry.type === "tree"
|
|
157
157
|
? new BaseCollectionEntry(entry.path)
|
|
158
|
-
: new LazyBufferContentEntry(entry.path, this);
|
|
158
|
+
: new LazyBufferContentEntry(entry.path, parseInt(entry.mode, 8), this);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
|
|
@@ -172,14 +172,12 @@ export class GithubBranch extends Branch {
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
get entryClass() {
|
|
176
|
-
return BufferContentEntry;
|
|
177
|
-
}
|
|
178
175
|
}
|
|
179
176
|
|
|
180
177
|
class LazyBufferContentEntry extends BufferContentEntryMixin(ContentEntry) {
|
|
181
|
-
constructor(name, branch) {
|
|
178
|
+
constructor(name, mode, branch) {
|
|
182
179
|
super(name);
|
|
180
|
+
Object.defineProperty(this, "mode", { value: mode });
|
|
183
181
|
this.branch = branch;
|
|
184
182
|
}
|
|
185
183
|
|
package/src/github-provider.mjs
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import fetch from "node-fetch";
|
|
2
2
|
import { replaceWithOneTimeExecutionMethod } from "one-time-execution-method";
|
|
3
3
|
import { stateActionHandler } from "fetch-rate-limit-util";
|
|
4
|
+
import {
|
|
5
|
+
BufferContentEntry,
|
|
6
|
+
} from "content-entry";
|
|
4
7
|
|
|
5
8
|
import { MultiGroupProvider } from "repository-provider";
|
|
6
9
|
import { GithubRepository } from "./github-repository.mjs";
|
|
@@ -85,18 +88,6 @@ export class GithubProvider extends MultiGroupProvider {
|
|
|
85
88
|
};
|
|
86
89
|
}
|
|
87
90
|
|
|
88
|
-
get repositoryClass() {
|
|
89
|
-
return GithubRepository;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
get branchClass() {
|
|
93
|
-
return GithubBranch;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
get repositoryGroupClass() {
|
|
97
|
-
return GithubOwner;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
91
|
fetch(url, options = {}, responseHandler) {
|
|
101
92
|
return stateActionHandler(
|
|
102
93
|
fetch,
|
|
@@ -179,6 +170,23 @@ export class GithubProvider extends MultiGroupProvider {
|
|
|
179
170
|
get pullRequestClass() {
|
|
180
171
|
return GithubPullRequest;
|
|
181
172
|
}
|
|
173
|
+
|
|
174
|
+
get repositoryClass() {
|
|
175
|
+
return GithubRepository;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
get branchClass() {
|
|
179
|
+
return GithubBranch;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
get repositoryGroupClass() {
|
|
183
|
+
return GithubOwner;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
get entryClass() {
|
|
187
|
+
return BufferContentEntry;
|
|
188
|
+
}
|
|
189
|
+
|
|
182
190
|
}
|
|
183
191
|
|
|
184
192
|
replaceWithOneTimeExecutionMethod(
|