From c1e791bad0b079af67398f6407221e6dcbb573dd Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Wed, 25 Jul 2018 22:01:25 +0200 Subject: expliciting type checks and predicates (server only) --- server/tools/get-access-token.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'server/tools') diff --git a/server/tools/get-access-token.ts b/server/tools/get-access-token.ts index 66fa70814..d86c84c8d 100644 --- a/server/tools/get-access-token.ts +++ b/server/tools/get-access-token.ts @@ -2,7 +2,10 @@ import * as program from 'commander' import { getClient, - serverLogin + serverLogin, + Server, + Client, + User } from '../tests/utils/index' program @@ -19,22 +22,19 @@ if ( throw new Error('All arguments are required.') } -const server = { - url: program['url'], - user: { - username: program['username'], - password: program['password'] - }, - client: { - id: null, - secret: null - } -} - getClient(program.url) .then(res => { - server.client.id = res.body.client_id - server.client.secret = res.body.client_secret + const server = { + url: program['url'], + user: { + username: program['username'], + password: program['password'] + } as User, + client: { + id: res.body.client_id as string, + secret: res.body.client_secret as string + } as Client + } as Server return serverLogin(server) }) -- cgit v1.2.3