bitbucket-repository-provider 6.1.1 → 6.1.3
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 +5 -5
- package/src/bitbucket-branch.mjs +12 -28
- package/types/bitbucket-branch.d.mts +2 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bitbucket-repository-provider",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -35,18 +35,18 @@
|
|
|
35
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": "^13.
|
|
38
|
+
"content-entry": "^13.5.0",
|
|
39
39
|
"fetch-rate-limit-util": "^4.5.2",
|
|
40
40
|
"matching-iterator": "^2.1.3",
|
|
41
41
|
"one-time-execution-method": "^3.1.3",
|
|
42
|
-
"repository-provider": "^35.4.
|
|
42
|
+
"repository-provider": "^35.4.5"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@types/node": "^22.15.
|
|
45
|
+
"@types/node": "^22.15.17",
|
|
46
46
|
"ava": "^6.3.0",
|
|
47
47
|
"c8": "^10.1.3",
|
|
48
48
|
"documentation": "^14.0.3",
|
|
49
|
-
"repository-provider-test-support": "^3.1.
|
|
49
|
+
"repository-provider-test-support": "^3.1.28",
|
|
50
50
|
"semantic-release": "^24.2.3",
|
|
51
51
|
"typescript": "^5.8.3"
|
|
52
52
|
},
|
package/src/bitbucket-branch.mjs
CHANGED
|
@@ -55,7 +55,11 @@ export class BitbucketBranch extends Branch {
|
|
|
55
55
|
`repositories/${this.slug}/src/${this.hash}/${name}`
|
|
56
56
|
);
|
|
57
57
|
if (res.ok) {
|
|
58
|
-
return new BufferContentEntry(
|
|
58
|
+
return new BufferContentEntry(
|
|
59
|
+
name,
|
|
60
|
+
undefined,
|
|
61
|
+
new Uint8Array(await res.arrayBuffer())
|
|
62
|
+
);
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
|
|
@@ -73,7 +77,13 @@ export class BitbucketBranch extends Branch {
|
|
|
73
77
|
for (const entry of matcher(json.values, patterns, { name: "path" })) {
|
|
74
78
|
yield entry.type === "commit_directory"
|
|
75
79
|
? new CollectionEntry(entry.path)
|
|
76
|
-
: new
|
|
80
|
+
: new BufferContentEntry(entry.path, undefined, async entry => {
|
|
81
|
+
const res = await this.provider.fetch(
|
|
82
|
+
`repositories/${this.slug}/src/${this.hash}/${entry.name}`
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
return new Uint8Array(await res.arrayBuffer());
|
|
86
|
+
});
|
|
77
87
|
}
|
|
78
88
|
}
|
|
79
89
|
|
|
@@ -103,29 +113,3 @@ export class BitbucketBranch extends Branch {
|
|
|
103
113
|
});
|
|
104
114
|
}
|
|
105
115
|
}
|
|
106
|
-
|
|
107
|
-
class LazyBufferContentEntry extends BufferContentEntry {
|
|
108
|
-
constructor(name, options, branch) {
|
|
109
|
-
super(name, options);
|
|
110
|
-
this.branch = branch;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
get buffer() {
|
|
114
|
-
return this.getBuffer();
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
set buffer(value) {
|
|
118
|
-
this._buffer = value;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
async getBuffer() {
|
|
122
|
-
const branch = this.branch;
|
|
123
|
-
|
|
124
|
-
const res = await branch.provider.fetch(
|
|
125
|
-
`repositories/${branch.slug}/src/${branch.hash}/${this.name}`
|
|
126
|
-
);
|
|
127
|
-
|
|
128
|
-
//return new Uint8Array(await res.arrayBuffer());
|
|
129
|
-
return Buffer.from(await res.arrayBuffer());
|
|
130
|
-
}
|
|
131
|
-
}
|
|
@@ -8,7 +8,7 @@ export class BitbucketBranch extends Branch {
|
|
|
8
8
|
*
|
|
9
9
|
* @param {string[]|string} patterns
|
|
10
10
|
*/
|
|
11
|
-
entries(patterns: string[] | string): AsyncGenerator<CollectionEntry |
|
|
11
|
+
entries(patterns: string[] | string): AsyncGenerator<CollectionEntry | BufferContentEntry, void, unknown>;
|
|
12
12
|
/**
|
|
13
13
|
* Commit entries
|
|
14
14
|
* @param {string} message commit message
|
|
@@ -20,13 +20,5 @@ export class BitbucketBranch extends Branch {
|
|
|
20
20
|
}
|
|
21
21
|
import { Branch } from "repository-provider";
|
|
22
22
|
import { CollectionEntry } from "content-entry";
|
|
23
|
-
declare class LazyBufferContentEntry extends BufferContentEntry {
|
|
24
|
-
constructor(name: any, options: any, branch: any);
|
|
25
|
-
branch: any;
|
|
26
|
-
set buffer(value: Promise<Buffer<any>>);
|
|
27
|
-
get buffer(): Promise<Buffer<any>>;
|
|
28
|
-
getBuffer(): Promise<Buffer<any>>;
|
|
29
|
-
}
|
|
30
|
-
import { ContentEntry } from "content-entry";
|
|
31
23
|
import { BufferContentEntry } from "content-entry";
|
|
32
|
-
|
|
24
|
+
import { ContentEntry } from "content-entry";
|