@intuitionrobotics/github 0.47.59 → 1.0.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/LICENSE +3 -0
- package/dist/app-backend/core/module-pack.d.ts +2 -0
- package/dist/app-backend/core/module-pack.d.ts.map +1 -0
- package/dist/app-backend/core/module-pack.js +5 -0
- package/{app-backend → dist/app-backend}/core/module-pack.js.map +1 -1
- package/{app-backend → dist/app-backend}/modules/GithubModule.d.ts +6 -5
- package/dist/app-backend/modules/GithubModule.d.ts.map +1 -0
- package/dist/app-backend/modules/GithubModule.js +265 -0
- package/dist/app-backend/modules/GithubModule.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +26 -13
- package/app-backend/core/module-pack.d.ts +0 -1
- package/app-backend/core/module-pack.js +0 -8
- package/app-backend/modules/GithubModule.js +0 -300
- package/app-backend/modules/GithubModule.js.map +0 -1
- package/index.d.ts +0 -2
- package/index.js +0 -19
- package/index.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-pack.d.ts","sourceRoot":"","sources":["../../../src/main/app-backend/core/module-pack.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,yBAAyB,2DAErC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-pack.js","sourceRoot":"","sources":["../../../src/main/app-backend/core/module-pack.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module-pack.js","sourceRoot":"","sources":["../../../src/main/app-backend/core/module-pack.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAExD,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACxC,YAAY;CACZ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Module } from "@intuitionrobotics/ts-common";
|
|
2
|
-
import { RestEndpointMethodTypes } from '@octokit/rest';
|
|
3
|
-
import { ReposGetContentResponseData } from "@octokit/types";
|
|
4
|
-
import { ExpressRequest } from "@intuitionrobotics/thunderstorm/backend";
|
|
2
|
+
import { type RestEndpointMethodTypes } from '@octokit/rest';
|
|
3
|
+
import { type ReposGetContentResponseData } from "@octokit/types";
|
|
4
|
+
import { type ExpressRequest } from "@intuitionrobotics/thunderstorm/backend";
|
|
5
5
|
type Config = {
|
|
6
6
|
appId: string;
|
|
7
7
|
privateKey: string;
|
|
@@ -14,13 +14,13 @@ export declare class GithubModule_Class extends Module<Config> {
|
|
|
14
14
|
private createClientWithJWT;
|
|
15
15
|
private getInstallationTokenFromClient;
|
|
16
16
|
getGithubInstallationToken(): Promise<string>;
|
|
17
|
-
getFile(repo: string, filePath: string, branch: string,
|
|
17
|
+
getFile(repo: string, filePath: string, branch: string, _request: ExpressRequest): Promise<string>;
|
|
18
18
|
private getLargeFile;
|
|
19
19
|
private getFileBySha;
|
|
20
20
|
getReleaseBranches(product: string): Promise<string[]>;
|
|
21
21
|
listBranches(repo: string): Promise<RestEndpointMethodTypes["repos"]["listBranches"]["response"]["data"]>;
|
|
22
22
|
getArchiveUrl(repo: string, branch: string): Promise<string>;
|
|
23
|
-
downloadArchive(url: string, branch: string,
|
|
23
|
+
downloadArchive(url: string, branch: string, _request: ExpressRequest): Promise<any>;
|
|
24
24
|
/**
|
|
25
25
|
*
|
|
26
26
|
* @param repo The name of the repo.
|
|
@@ -32,3 +32,4 @@ export declare class GithubModule_Class extends Module<Config> {
|
|
|
32
32
|
}
|
|
33
33
|
export declare const GithubModule: GithubModule_Class;
|
|
34
34
|
export {};
|
|
35
|
+
//# sourceMappingURL=GithubModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GithubModule.d.ts","sourceRoot":"","sources":["../../../src/main/app-backend/modules/GithubModule.ts"],"names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|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A backend boilerplate with example apis
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2018 Intuition Robotics
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { __stringify, BadImplementationException, Exception, Module } from "@intuitionrobotics/ts-common";
|
|
19
|
+
import * as jws from "jws";
|
|
20
|
+
import { Octokit } from '@octokit/rest';
|
|
21
|
+
import {} from "@octokit/types";
|
|
22
|
+
import * as path from "path";
|
|
23
|
+
import { ApiException, promisifyRequest } from "@intuitionrobotics/thunderstorm/backend";
|
|
24
|
+
export class GithubModule_Class extends Module {
|
|
25
|
+
constructor() {
|
|
26
|
+
super("GithubModule");
|
|
27
|
+
}
|
|
28
|
+
createClient(token, prefix) {
|
|
29
|
+
const auth = `${prefix || "token"} ${token}`;
|
|
30
|
+
const client = new Octokit({
|
|
31
|
+
userAgent: this.config.userAgent,
|
|
32
|
+
log: {
|
|
33
|
+
debug: this.logDebug.bind(this),
|
|
34
|
+
info: this.logInfo.bind(this),
|
|
35
|
+
warn: this.logWarning.bind(this),
|
|
36
|
+
error: this.logError.bind(this)
|
|
37
|
+
},
|
|
38
|
+
auth: auth
|
|
39
|
+
});
|
|
40
|
+
return client;
|
|
41
|
+
}
|
|
42
|
+
;
|
|
43
|
+
async createClientWithJWT() {
|
|
44
|
+
const ts = Math.floor(Date.now() / 1000.0);
|
|
45
|
+
const payload = {
|
|
46
|
+
// issued at time
|
|
47
|
+
iat: ts,
|
|
48
|
+
// JWT expiration time (10 minute maximum)
|
|
49
|
+
exp: ts + (10 * 60),
|
|
50
|
+
// GitHub App's identifier
|
|
51
|
+
iss: parseInt(this.config.appId)
|
|
52
|
+
};
|
|
53
|
+
const signedToken = jws.sign({
|
|
54
|
+
header: { alg: "RS256" },
|
|
55
|
+
payload,
|
|
56
|
+
privateKey: this.config.privateKey
|
|
57
|
+
});
|
|
58
|
+
return this.createClient(signedToken, 'Bearer');
|
|
59
|
+
}
|
|
60
|
+
async getInstallationTokenFromClient(client) {
|
|
61
|
+
const installations = await client.apps.listInstallations();
|
|
62
|
+
// Get installations that match GIT_OWNER.
|
|
63
|
+
const filteredInstallations = installations.data.filter((installation) => {
|
|
64
|
+
return installation.account.login === this.config.gitOwner;
|
|
65
|
+
});
|
|
66
|
+
// Handle/log cases where the number of matching installations of the Github App is different than one.
|
|
67
|
+
if (filteredInstallations.length > 1) {
|
|
68
|
+
let message = `Warning: more than one installations of the Github app with owner ${this.config.gitOwner} found.`;
|
|
69
|
+
message += ` Picking the first one...`;
|
|
70
|
+
this.logInfo(message);
|
|
71
|
+
}
|
|
72
|
+
else if (!filteredInstallations.length) {
|
|
73
|
+
this.logError('Could not create installation access token for the Github App.');
|
|
74
|
+
this.logError(`Error: No installation matches owner "${this.config.gitOwner}."`);
|
|
75
|
+
this.logError(`Installations were: ${JSON.stringify(installations, null, 2)}`);
|
|
76
|
+
throw new BadImplementationException(`No installations for owner ${this.config.gitOwner}`);
|
|
77
|
+
}
|
|
78
|
+
// Create an "Installation access token". Expires in one hour. Identifies actions
|
|
79
|
+
// as performed by the Github App.
|
|
80
|
+
const installationToken = await client.apps.createInstallationAccessToken({ installation_id: filteredInstallations[0].id });
|
|
81
|
+
if (!installationToken.data || !installationToken.data.token) {
|
|
82
|
+
this.logError(`Invalid structure of installation token object.`);
|
|
83
|
+
throw new Exception(`Invalid structure of installation token object.`);
|
|
84
|
+
}
|
|
85
|
+
return installationToken.data.token;
|
|
86
|
+
}
|
|
87
|
+
async getGithubInstallationToken() {
|
|
88
|
+
const client = await this.createClientWithJWT();
|
|
89
|
+
const token = await this.getInstallationTokenFromClient(client);
|
|
90
|
+
this.logInfo('Got github installation token successfully.');
|
|
91
|
+
return token;
|
|
92
|
+
}
|
|
93
|
+
async getFile(repo, filePath, branch, _request) {
|
|
94
|
+
const token = await this.getGithubInstallationToken();
|
|
95
|
+
const client = this.createClient(token);
|
|
96
|
+
let contents;
|
|
97
|
+
try {
|
|
98
|
+
contents = await client.repos.getContent({
|
|
99
|
+
owner: this.config.gitOwner,
|
|
100
|
+
repo,
|
|
101
|
+
path: filePath,
|
|
102
|
+
ref: branch
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
catch (e) {
|
|
106
|
+
this.logError(e);
|
|
107
|
+
if (!(e instanceof Error))
|
|
108
|
+
throw new Exception("Failed to get file from Github \n" + JSON.stringify(e));
|
|
109
|
+
const error = e;
|
|
110
|
+
if (error.status === 403 && error.errors && error.errors.length === 1 &&
|
|
111
|
+
error.errors[0].code === 'too_large') {
|
|
112
|
+
this.logWarning(`File ${filePath} is too large, will attempt to get as Blob.`);
|
|
113
|
+
return this.getLargeFile(client, repo, filePath, branch);
|
|
114
|
+
}
|
|
115
|
+
else if (error.status === 404) {
|
|
116
|
+
this.logError(`File ${filePath} was not found.`);
|
|
117
|
+
throw new Exception(`File ${filePath} was not found`);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
throw new Exception('Failed to get file from Github');
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// Check that if contents.data is not an array.
|
|
124
|
+
if (Array.isArray(contents.data)) {
|
|
125
|
+
throw new BadImplementationException('Invalid response of method repos.getContent');
|
|
126
|
+
}
|
|
127
|
+
if (!contents || !contents.data || !contents.data.content) {
|
|
128
|
+
throw new Exception('Failed to get file contents from Github');
|
|
129
|
+
}
|
|
130
|
+
const buffer = Buffer.from(contents.data.content, 'base64');
|
|
131
|
+
return buffer.toString('utf8');
|
|
132
|
+
}
|
|
133
|
+
async getLargeFile(client, repo, filePath, branch) {
|
|
134
|
+
const fileSha = await this.getFileBySha(client, repo, filePath, branch);
|
|
135
|
+
const request = {
|
|
136
|
+
owner: this.config.gitOwner,
|
|
137
|
+
repo,
|
|
138
|
+
file_sha: fileSha
|
|
139
|
+
};
|
|
140
|
+
const response = await client.git.getBlob(request);
|
|
141
|
+
if (!response || !response.data || !response.data.content)
|
|
142
|
+
throw new Exception('Failed to get file contents from Github');
|
|
143
|
+
const buffer = Buffer.from(response.data.content, 'base64');
|
|
144
|
+
return buffer.toString('utf8');
|
|
145
|
+
}
|
|
146
|
+
async getFileBySha(client, repo, filePath, branch) {
|
|
147
|
+
const parentPath = path.dirname(filePath);
|
|
148
|
+
let parentDirectoryResponse;
|
|
149
|
+
try {
|
|
150
|
+
const request = {
|
|
151
|
+
owner: this.config.gitOwner,
|
|
152
|
+
repo,
|
|
153
|
+
path: parentPath,
|
|
154
|
+
ref: branch
|
|
155
|
+
};
|
|
156
|
+
parentDirectoryResponse = await client.repos.getContent(request);
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
throw new Exception(`Failed to fetch parent directory contents of file ${filePath}` + "\n" + JSON.stringify(error));
|
|
160
|
+
}
|
|
161
|
+
if (!parentDirectoryResponse || !parentDirectoryResponse.data)
|
|
162
|
+
throw new Exception(`Failed to fetch parent directory contents of file ${filePath}`);
|
|
163
|
+
// Check that if parentDirectoryResponse.data is an array.
|
|
164
|
+
if (!Array.isArray(parentDirectoryResponse.data))
|
|
165
|
+
throw new BadImplementationException("File's parent directory is not an array");
|
|
166
|
+
let fileSha = '';
|
|
167
|
+
for (const responseEntry of parentDirectoryResponse.data) {
|
|
168
|
+
if (responseEntry.path === filePath) {
|
|
169
|
+
fileSha = responseEntry.sha;
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (!fileSha)
|
|
174
|
+
throw new Exception(`File ${filePath} was not found`);
|
|
175
|
+
return fileSha;
|
|
176
|
+
}
|
|
177
|
+
async getReleaseBranches(product) {
|
|
178
|
+
const branches = await this.listBranches(product);
|
|
179
|
+
if (!branches || !branches.length) {
|
|
180
|
+
return [];
|
|
181
|
+
}
|
|
182
|
+
// Response includes (besides branch name) extra information about the branch.
|
|
183
|
+
const releaseBranches = branches.map(branch => branch.name).filter(name => {
|
|
184
|
+
return name.startsWith(`release/`);
|
|
185
|
+
}).reverse();
|
|
186
|
+
// Return master with the release branches.
|
|
187
|
+
releaseBranches.unshift('master');
|
|
188
|
+
return releaseBranches;
|
|
189
|
+
}
|
|
190
|
+
async listBranches(repo) {
|
|
191
|
+
const token = await this.getGithubInstallationToken();
|
|
192
|
+
const client = this.createClient(token);
|
|
193
|
+
let branches;
|
|
194
|
+
try {
|
|
195
|
+
// Returns all the branches using the paginate method.
|
|
196
|
+
// Maximum allowed page size is 100.
|
|
197
|
+
branches = await client.paginate(
|
|
198
|
+
// Equivalent to 'GET /repos/:owner/:repo/branches?per_page=100'
|
|
199
|
+
client.repos.listBranches, {
|
|
200
|
+
owner: this.config.gitOwner,
|
|
201
|
+
repo,
|
|
202
|
+
per_page: 100
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
this.logError(error);
|
|
207
|
+
throw new Exception(`Failed to list ${repo} branches`);
|
|
208
|
+
}
|
|
209
|
+
// Response includes (besides branch name) extra information about the branch.
|
|
210
|
+
return branches;
|
|
211
|
+
}
|
|
212
|
+
;
|
|
213
|
+
async getArchiveUrl(repo, branch) {
|
|
214
|
+
const token = await this.getGithubInstallationToken();
|
|
215
|
+
const client = this.createClient(token);
|
|
216
|
+
const response = await client.repos.downloadArchive({
|
|
217
|
+
owner: this.config.gitOwner,
|
|
218
|
+
repo,
|
|
219
|
+
ref: branch,
|
|
220
|
+
archive_format: "zipball"
|
|
221
|
+
});
|
|
222
|
+
if (!response || !response.url) {
|
|
223
|
+
throw new Exception(`Invalid response while getting archive url for branch ${branch} of repo ${repo}`);
|
|
224
|
+
}
|
|
225
|
+
this.logInfo(`Got archive url: ${response.url}.`);
|
|
226
|
+
return response.url;
|
|
227
|
+
}
|
|
228
|
+
async downloadArchive(url, branch, _request) {
|
|
229
|
+
const response = await promisifyRequest({ url: url, responseType: 'arraybuffer' });
|
|
230
|
+
if (!response || !response.data)
|
|
231
|
+
throw new Exception(`Failed to download archive for branch ${branch} of product ${url}`);
|
|
232
|
+
const statusCode = response.status;
|
|
233
|
+
// TODO: need to handle 1XX and 3XX
|
|
234
|
+
if (statusCode < 200 || statusCode >= 300)
|
|
235
|
+
throw new ApiException(statusCode, `Failed to download archive for branch ${branch} of product ${url}. Error: ${__stringify(response.data)}`);
|
|
236
|
+
this.logDebug(`Got archive in zip format.`);
|
|
237
|
+
// Returns a buffer.
|
|
238
|
+
return response.data;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
*
|
|
242
|
+
* @param repo The name of the repo.
|
|
243
|
+
* @param branch The name of the branch.
|
|
244
|
+
*
|
|
245
|
+
* This API has an upper limit of 1,000 files for a directory.
|
|
246
|
+
*/
|
|
247
|
+
async listDirectoryContents(repo, branch, _path) {
|
|
248
|
+
const token = await this.getGithubInstallationToken();
|
|
249
|
+
const client = this.createClient(token);
|
|
250
|
+
const response = await client.repos.getContent({
|
|
251
|
+
owner: this.config.gitOwner,
|
|
252
|
+
repo,
|
|
253
|
+
path: _path,
|
|
254
|
+
ref: branch
|
|
255
|
+
});
|
|
256
|
+
if (!response || !response.data)
|
|
257
|
+
return;
|
|
258
|
+
if (!Array.isArray(response.data)) {
|
|
259
|
+
throw new Exception(`Invalid response from octokit's repos.getContent`);
|
|
260
|
+
}
|
|
261
|
+
return response.data;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
export const GithubModule = new GithubModule_Class();
|
|
265
|
+
//# sourceMappingURL=GithubModule.js.map
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E,MAAc,EAAE,KAAa;QACnE,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,0BAA0B,EAAE,CAAC;QACtD,MAAM,MAAM,GAAY,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAEjD,MAAM,QAAQ,GAA+D,MAAM,MAAM,CAAC,KAAK,CAAC,UAAU,CACtG;YACI,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;YAC3B,IAAI;YACJ,IAAI,EAAE,KAAK;YACX,GAAG,EAAE,MAAM;SACd,CAAC,CAAC;QAEP,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,IAAI;YAC3B,OAAO;QAEX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,SAAS,CAAC,kDAAkD,CAAC,CAAC;QAC5E,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;CAEJ;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,kBAAkB,EAAE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/main/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/main/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC"}
|