diff --git a/index.ts b/index.ts index 5e54803b..743763e3 100755 --- a/index.ts +++ b/index.ts @@ -24,6 +24,7 @@ import 'connect'; import * as del from 'del'; import * as fs from 'fs'; import { google } from 'googleapis'; +import { Drive } from 'googleapis/build/src/apis/drive/v3'; import * as mkdirp from 'mkdirp'; const open = require('open'); const path = require('path'); @@ -329,7 +330,7 @@ commander .action(async (scriptId: string, versionNumber?: number) => { if (!scriptId) { getAPICredentials(async () => { - const drive = google.drive({version: 'v3', auth: oauth2Client}); + const drive = google.drive({version: 'v3', auth: oauth2Client}) as Drive; const { data } = await drive.files.list({ pageSize: 10, fields: 'files(id, name)', @@ -406,7 +407,7 @@ commander script.projects.updateContent({ scriptId, resource: { files }, - }, {}, (error: any, res: Function) => { + }, {}, (error: any) => { spinner.stop(true); if (error) { console.error(LOG.PUSH_FAILURE); @@ -705,7 +706,7 @@ commander await checkIfOnline(); spinner.setSpinnerTitle(LOG.FINDING_SCRIPTS).start(); getAPICredentials(async () => { - const drive = google.drive({version: 'v3', auth: oauth2Client}); + const drive = google.drive({version: 'v3', auth: oauth2Client}) as Drive; const res = await drive.files.list({ pageSize: 50, fields: 'nextPageToken, files(id, name)', diff --git a/tsconfig.json b/tsconfig.json index 1a23f008..626c2401 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,7 @@ "es2015", "es5", "es6", + "es2017" ] }, "moduleResolution": "node",