chore: update dashboard functions (#9504)

* Updates the package dependencies of the Dashboard dependencies. There seem to be errors with the old `node-github` API, but updating to the latest version (`@octokit/rest`) seems to work locally.
This commit is contained in:
Paul Gschwendtner
2018-01-22 21:50:50 +01:00
committed by Jeremy Elbourn
parent 5d77d908d4
commit 7024dc49f8
6 changed files with 22 additions and 85 deletions
+1 -12
View File
@@ -1,22 +1,11 @@
import {GraphQLClient} from 'graphql-request';
import {config} from 'firebase-functions';
import * as GithubApi from 'github';
import * as GithubApi from '@octokit/rest';
/** API token for the Github repository. Required to set the github status on commits and PRs. */
const githubAccessToken = config().secret.github;
/** API Endpoint for the Github API v4 using GraphQL. */
const githubApiV4Endpoint = 'https://api.github.com/graphql';
/** Export the GitHub V3 API instance that is authenticated. */
export const githubApiV3 = new GithubApi();
/** Export the GraphQL client that can be used to query the Github API v4. */
export const githubApiV4 = new GraphQLClient(githubApiV4Endpoint, {
headers: {
Authorization: `Bearer ${githubAccessToken}`,
}
});
// Authenticate the Github API package with the user token.
githubApiV3.authenticate({type: 'token', token: githubAccessToken});