github-repository-provider 9.0.21 → 9.1.0
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/LICENSE +12 -23
- package/README.md +1 -1
- package/package.json +20 -20
- package/src/github-branch.mjs +12 -10
- package/src/github-repository.mjs +10 -11
- package/types/github-repository.d.mts +1 -5
package/LICENSE
CHANGED
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
Copyright (
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
15
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
16
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
17
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
18
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
19
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
20
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
21
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
22
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
23
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1
|
+
Copyright (C) 2017-2025 by arlac77
|
|
2
|
+
|
|
3
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
4
|
+
purpose with or without fee is hereby granted.
|
|
5
|
+
|
|
6
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
7
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
8
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
9
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
10
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
11
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
12
|
+
PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[](https://www.npmjs.com/package/github-repository-provider)
|
|
2
|
-
[](https://spdx.org/licenses/0BSD.html)
|
|
3
3
|
[](https://typescriptlang.org)
|
|
4
4
|
[](https://bundlejs.com/?q=github-repository-provider)
|
|
5
5
|
[](https://npmjs.org/package/github-repository-provider)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "github-repository-provider",
|
|
3
|
-
"version": "9.0
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -22,40 +22,40 @@
|
|
|
22
22
|
"email": "markus.felten@gmx.de"
|
|
23
23
|
}
|
|
24
24
|
],
|
|
25
|
-
"license": "
|
|
25
|
+
"license": "0BSD",
|
|
26
26
|
"scripts": {
|
|
27
|
-
"prepare": "
|
|
28
|
-
"prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule
|
|
29
|
-
"test": "
|
|
27
|
+
"prepare": "node --run prepare:typescript",
|
|
28
|
+
"prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
|
|
29
|
+
"test": "node --run test:ava",
|
|
30
30
|
"test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
|
|
31
31
|
"cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
|
|
32
|
-
"docs": "documentation readme --section=API ./src
|
|
33
|
-
"lint": "
|
|
34
|
-
"lint:docs": "documentation lint ./src
|
|
35
|
-
"lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule
|
|
32
|
+
"docs": "documentation readme --section=API ./src**/*.mjs",
|
|
33
|
+
"lint": "node --run lint:docs && node --run lint:typescript",
|
|
34
|
+
"lint:docs": "documentation lint ./src**/*.mjs",
|
|
35
|
+
"lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"content-entry": "^
|
|
38
|
+
"content-entry": "^13.0.4",
|
|
39
39
|
"fetch-link-util": "^1.1.1",
|
|
40
|
-
"fetch-rate-limit-util": "^4.4.
|
|
40
|
+
"fetch-rate-limit-util": "^4.4.1",
|
|
41
41
|
"matching-iterator": "^2.1.3",
|
|
42
42
|
"one-time-execution-method": "^3.1.1",
|
|
43
|
-
"repository-provider": "^35.
|
|
43
|
+
"repository-provider": "^35.3.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@types/node": "^22.
|
|
47
|
-
"ava": "^6.
|
|
48
|
-
"c8": "^10.1.
|
|
46
|
+
"@types/node": "^22.15.3",
|
|
47
|
+
"ava": "^6.3.0",
|
|
48
|
+
"c8": "^10.1.3",
|
|
49
49
|
"documentation": "^14.0.3",
|
|
50
|
-
"etag-cache-leveldb": "^2.1.
|
|
50
|
+
"etag-cache-leveldb": "^2.1.8",
|
|
51
51
|
"leveldown": "^6.1.1",
|
|
52
52
|
"levelup": "^5.1.1",
|
|
53
|
-
"repository-provider-test-support": "^3.1.
|
|
54
|
-
"semantic-release": "^24.
|
|
55
|
-
"typescript": "^5.
|
|
53
|
+
"repository-provider-test-support": "^3.1.11",
|
|
54
|
+
"semantic-release": "^24.2.3",
|
|
55
|
+
"typescript": "^5.8.3"
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|
|
58
|
-
"node": ">=
|
|
58
|
+
"node": ">=22.15.0"
|
|
59
59
|
},
|
|
60
60
|
"repository": {
|
|
61
61
|
"type": "git",
|
package/src/github-branch.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { matcher } from "matching-iterator";
|
|
|
2
2
|
import { Branch } from "repository-provider";
|
|
3
3
|
import {
|
|
4
4
|
CollectionEntry,
|
|
5
|
-
|
|
5
|
+
BufferContentEntry,
|
|
6
6
|
ContentEntry
|
|
7
7
|
} from "content-entry";
|
|
8
8
|
|
|
@@ -103,7 +103,7 @@ export class GithubBranch extends Branch {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
|
-
*
|
|
106
|
+
*
|
|
107
107
|
* @param {string[]|string} patterns
|
|
108
108
|
* @return {AsyncGenerator<ContentEntry>} all matching entries in the branch
|
|
109
109
|
*/
|
|
@@ -158,7 +158,7 @@ export class GithubBranch extends Branch {
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
class LazyBufferContentEntry extends
|
|
161
|
+
class LazyBufferContentEntry extends BufferContentEntry {
|
|
162
162
|
constructor(name, mode, branch) {
|
|
163
163
|
super(name);
|
|
164
164
|
Object.defineProperty(this, "mode", { value: mode });
|
|
@@ -169,11 +169,13 @@ class LazyBufferContentEntry extends BufferContentEntryMixin(ContentEntry) {
|
|
|
169
169
|
return this.getBuffer();
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
|
|
172
|
+
set buffer(value) {
|
|
173
|
+
this._buffer = value;
|
|
174
|
+
}
|
|
173
175
|
|
|
174
176
|
async getBuffer() {
|
|
175
|
-
if (this
|
|
176
|
-
return this
|
|
177
|
+
if (this._buffer) {
|
|
178
|
+
return this._buffer;
|
|
177
179
|
}
|
|
178
180
|
|
|
179
181
|
const branch = this.branch;
|
|
@@ -183,11 +185,11 @@ class LazyBufferContentEntry extends BufferContentEntryMixin(ContentEntry) {
|
|
|
183
185
|
`${branch.api}/contents/${this.name}?ref=${branch.ref}`
|
|
184
186
|
);
|
|
185
187
|
|
|
186
|
-
this
|
|
187
|
-
return this
|
|
188
|
+
this._buffer = Buffer.from(json.content, "base64");
|
|
189
|
+
return this._buffer;
|
|
188
190
|
};
|
|
189
191
|
|
|
190
|
-
this
|
|
191
|
-
return this
|
|
192
|
+
this._buffer = f();
|
|
193
|
+
return this._buffer;
|
|
192
194
|
}
|
|
193
195
|
}
|
|
@@ -80,14 +80,11 @@ export class GithubRepository extends Repository {
|
|
|
80
80
|
const { response, json } = await this.provider.fetchJSON(next);
|
|
81
81
|
|
|
82
82
|
for (const c of json) {
|
|
83
|
-
this
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
author: c.author,
|
|
89
|
-
committer: c.committer
|
|
90
|
-
};
|
|
83
|
+
const commit = new Commit(this, c);
|
|
84
|
+
|
|
85
|
+
this.#commits.set(commit.sha, commit);
|
|
86
|
+
|
|
87
|
+
yield commit;
|
|
91
88
|
}
|
|
92
89
|
next = getHeaderLink(response.headers);
|
|
93
90
|
} while (next);
|
|
@@ -113,7 +110,7 @@ export class GithubRepository extends Repository {
|
|
|
113
110
|
* @return {Promise<Object>} response
|
|
114
111
|
*/
|
|
115
112
|
async commitForSha(sha) {
|
|
116
|
-
|
|
113
|
+
let commit = this.#commits.get(sha);
|
|
117
114
|
if (commit) {
|
|
118
115
|
return commit;
|
|
119
116
|
}
|
|
@@ -122,9 +119,11 @@ export class GithubRepository extends Repository {
|
|
|
122
119
|
`${this.api}/git/commits/${sha}`
|
|
123
120
|
);
|
|
124
121
|
|
|
125
|
-
this
|
|
122
|
+
commit = new Commit(this, json);
|
|
126
123
|
|
|
127
|
-
|
|
124
|
+
this.#commits.set(commit.sha, commit);
|
|
125
|
+
|
|
126
|
+
return commit;
|
|
128
127
|
}
|
|
129
128
|
|
|
130
129
|
/**
|
|
@@ -39,11 +39,7 @@ export class GithubRepository extends Repository {
|
|
|
39
39
|
isDisabled: import("pacc").AttributeDefinition;
|
|
40
40
|
isTemplate: import("pacc").AttributeDefinition;
|
|
41
41
|
isFork: import("pacc").AttributeDefinition;
|
|
42
|
-
id: import(
|
|
43
|
-
/**
|
|
44
|
-
* @return {string} "main"
|
|
45
|
-
*/
|
|
46
|
-
"pacc").AttributeDefinition;
|
|
42
|
+
id: import("pacc").AttributeDefinition;
|
|
47
43
|
name: import("pacc").AttributeDefinition;
|
|
48
44
|
description: import("pacc").AttributeDefinition;
|
|
49
45
|
};
|