From 8b28ec10eb6e9795809e82e4d0cd48b119cb97b2 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sat, 11 Feb 2023 02:21:30 +0200 Subject: [PATCH] TuitioAuthenticationResult type --- src/client.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index 6657375..c883a97 100644 --- a/src/client.ts +++ b/src/client.ts @@ -22,6 +22,9 @@ async function request(url: string, method: string) { } } +export type TuitioToken = { raw: string; validFrom: Date; validUntil: Date }; +export type TuitioAuthenticationResult = { token: TuitioToken; status: string }; + class TuitioClient { baseUrl: string; @@ -29,7 +32,7 @@ class TuitioClient { this.baseUrl = baseUrl; } - async authenticate(userName: string, password: string) { + async authenticate(userName: string, password: string): Promise { const templates = getUrlTemplates(this.baseUrl); const url = templates.authentication.replace("{username}", userName).replace("{password}", password);