move APIToken to different file
This commit is contained in:
parent
1f417fdf12
commit
81c1cc57ad
|
@ -0,0 +1,30 @@
|
|||
import { IAPIObject } from "./IAPIObject";
|
||||
|
||||
class APIToken extends IAPIObject {
|
||||
|
||||
static storage_key = 'pairent_api_key';
|
||||
|
||||
constructor(data) {
|
||||
super();
|
||||
this.user = data.user;
|
||||
this.key = data.key;
|
||||
this.expires = data.expires;
|
||||
this.ip = data.ip;
|
||||
}
|
||||
|
||||
/** @type {number} */
|
||||
user;
|
||||
|
||||
/** @type {string} */
|
||||
key;
|
||||
|
||||
/** A Unix timestamp (when the token will expire)
|
||||
* @type {number}
|
||||
*/
|
||||
expires;
|
||||
|
||||
/** @type {string} */
|
||||
ip;
|
||||
}
|
||||
|
||||
export { APIToken };
|
|
@ -16,33 +16,6 @@ class UserLoginResponse {
|
|||
id;
|
||||
}
|
||||
|
||||
class APIToken extends IAPIObject {
|
||||
|
||||
static storage_key = 'pairent_api_key';
|
||||
|
||||
constructor(data) {
|
||||
super();
|
||||
this.user = data.user;
|
||||
this.key = data.key;
|
||||
this.expires = data.expires;
|
||||
this.ip = data.ip;
|
||||
}
|
||||
|
||||
/** @type {number} */
|
||||
user;
|
||||
|
||||
/** @type {string} */
|
||||
key;
|
||||
|
||||
/** A Unix timestamp (when the token will expire)
|
||||
* @type {number}
|
||||
*/
|
||||
expires;
|
||||
|
||||
/** @type {string} */
|
||||
ip;
|
||||
}
|
||||
|
||||
class User extends IAPIObject {
|
||||
|
||||
isLoggedIn() {
|
||||
|
|
Loading…
Reference in New Issue