@wireapp/api-client
Advanced tools
Comparing version 0.0.28 to 0.0.29
@@ -40,2 +40,3 @@ /// <reference types="node" /> | ||
login(data: LoginData): Promise<Context>; | ||
logout(): Promise<void>; | ||
refreshAccessToken(): Promise<AccessTokenData>; | ||
@@ -42,0 +43,0 @@ connect(clientId: string): Promise<void>; |
@@ -64,2 +64,12 @@ "use strict"; | ||
}; | ||
Client.prototype.logout = function () { | ||
var _this = this; | ||
return this.auth.api | ||
.postLogout() | ||
.then(function () { return _this.disconnect(); }) | ||
.then(function () { | ||
_this.client.http.accessToken = undefined; | ||
_this.client.ws.accessToken = undefined; | ||
}); | ||
}; | ||
Client.prototype.refreshAccessToken = function () { | ||
@@ -66,0 +76,0 @@ var _this = this; |
@@ -56,3 +56,3 @@ { | ||
"types": "./dist/commonjs/Client.d.ts", | ||
"version": "0.0.28" | ||
"version": "0.0.29" | ||
} |
@@ -67,2 +67,12 @@ import * as WebSocket from 'ws'; | ||
public logout(): Promise<void> { | ||
return this.auth.api | ||
.postLogout() | ||
.then(() => this.disconnect()) | ||
.then(() => { | ||
this.client.http.accessToken = undefined; | ||
this.client.ws.accessToken = undefined; | ||
}) | ||
} | ||
public refreshAccessToken(): Promise<AccessTokenData> { | ||
@@ -69,0 +79,0 @@ return this.auth.api.postAccess() |
92298
1502