@nu-art/github-backend 0.401.2 → 0.401.4
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.
|
@@ -18,7 +18,7 @@ export declare class GithubModule_Class extends Module<Config> {
|
|
|
18
18
|
getReleaseBranches(product: string): Promise<string[]>;
|
|
19
19
|
listBranches(repo: string): Promise<RestEndpointMethodTypes['repos']['listBranches']['response']['data']>;
|
|
20
20
|
getArchiveUrl(repo: string, branch: string): Promise<string>;
|
|
21
|
-
downloadArchive(url: string, branch: string): Promise<
|
|
21
|
+
downloadArchive(url: string, branch: string): Promise<Buffer<ArrayBuffer>>;
|
|
22
22
|
/**
|
|
23
23
|
*
|
|
24
24
|
* @param repo The name of the repo.
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
import { BadImplementationException, currentTimeMillis, Exception, JwtTools, Minute, Module } from '@nu-art/ts-common';
|
|
19
19
|
import { Octokit } from '@octokit/rest';
|
|
20
20
|
import * as path from 'path';
|
|
21
|
-
import { promisifyRequest } from '@nu-art/thunderstorm-backend';
|
|
22
21
|
export class GithubModule_Class extends Module {
|
|
23
22
|
createClient(token, prefix) {
|
|
24
23
|
const auth = `${prefix || 'token'} ${token}`;
|
|
@@ -213,13 +212,15 @@ export class GithubModule_Class extends Module {
|
|
|
213
212
|
return response.url;
|
|
214
213
|
}
|
|
215
214
|
async downloadArchive(url, branch) {
|
|
216
|
-
const response = await
|
|
217
|
-
if (!response
|
|
215
|
+
const response = await fetch(url);
|
|
216
|
+
if (!response.ok) {
|
|
218
217
|
throw new Exception(`Failed to download archive for branch ${branch} of product ${url}`);
|
|
219
218
|
}
|
|
219
|
+
const arrayBuffer = await response.arrayBuffer();
|
|
220
|
+
const buffer = Buffer.from(arrayBuffer);
|
|
220
221
|
this.logDebug(`Got archive in zip format.`);
|
|
221
222
|
// Returns a buffer.
|
|
222
|
-
return
|
|
223
|
+
return buffer;
|
|
223
224
|
}
|
|
224
225
|
/**
|
|
225
226
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nu-art/github-backend",
|
|
3
|
-
"version": "0.401.
|
|
3
|
+
"version": "0.401.4",
|
|
4
4
|
"description": "Github api Module Backend",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"TacB0sS",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"license": "Apache-2.0",
|
|
21
21
|
"author": "TacB0sS",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@nu-art/thunderstorm-backend": "0.401.
|
|
24
|
-
"@nu-art/thunderstorm-shared": "0.401.
|
|
25
|
-
"@nu-art/ts-common": "0.401.
|
|
23
|
+
"@nu-art/thunderstorm-backend": "0.401.4",
|
|
24
|
+
"@nu-art/thunderstorm-shared": "0.401.4",
|
|
25
|
+
"@nu-art/ts-common": "0.401.4",
|
|
26
26
|
"@octokit/plugin-paginate-rest": "2.2.1",
|
|
27
27
|
"@octokit/rest": "18.0.9",
|
|
28
28
|
"@octokit/types": "^5.5.0",
|