From 1f35683b466e8979f1f02abc4734eba617601290 Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Tue, 29 Jan 2019 00:21:50 -0500 Subject: [PATCH] More updates --- index.ts | 5 +++-- lib/get-signed-json-web-token.ts | 2 +- package-lock.json | 15 +++++++++++++++ package.json | 2 ++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/index.ts b/index.ts index c9fbb27d3..067c5f9f6 100644 --- a/index.ts +++ b/index.ts @@ -1,10 +1,11 @@ -const request = require('@octokit/request') +import request = require('@octokit/request') import getCache = require('./lib/get-cache') import getInstallationAccessToken = require('./lib/get-installation-access-token') import getSignedJsonWebToken = require('./lib/get-signed-json-web-token') +import lru from 'lru-cache'; -export = function App ({ id, privateKey, baseUrl, cache }) { +export = function App ({ id, privateKey, baseUrl, cache }: { id: string, privateKey: string, baseUrl: string, cache: lru.Cache }) { const state = { id, privateKey, diff --git a/lib/get-signed-json-web-token.ts b/lib/get-signed-json-web-token.ts index 932edf881..8e4be876a 100644 --- a/lib/get-signed-json-web-token.ts +++ b/lib/get-signed-json-web-token.ts @@ -1,6 +1,6 @@ import jsonwebtoken = require('jsonwebtoken') -export = function getSignedJsonWebToken ({ id, privateKey }) { +export = function getSignedJsonWebToken ({ id, privateKey }: { id: string, privateKey: string }) { const now = Math.floor(Date.now() / 1000) const payload = { iat: now, // Issued at time diff --git a/package-lock.json b/package-lock.json index e3e3edfb9..7fa9ca66e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -397,11 +397,26 @@ } } }, + "@types/jsonwebtoken": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.3.0.tgz", + "integrity": "sha512-YKnUTR4VxwljbPORPrRon9E3uel1aD8nUdvzqArCCdMTWPvo0gnI2UZkwIHN2QATdj6HYXV/Iq3/KcecAO42Ww==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/lru-cache": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.0.tgz", "integrity": "sha512-RaE0B+14ToE4l6UqdarKPnXwVDuigfFv+5j9Dze/Nqr23yyuqdNvzcZi3xB+3Agvi5R4EOgAksfv3lXX4vBt9w==" }, + "@types/node": { + "version": "10.12.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", + "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==", + "dev": true + }, "JSONStream": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", diff --git a/package.json b/package.json index 5325ca1c3..2a84ab664 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,8 @@ "lru-cache": "^5.1.1" }, "devDependencies": { + "@types/jsonwebtoken": "^8.3.0", + "@types/lru-cache": "^4.1.1", "chai": "^4.1.2", "coveralls": "^3.0.2", "lolex": "^4.0.1",