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);