pd-api
Version:
57 lines (56 loc) • 1.24 kB
TypeScript
import { ApiService } from '../api.service';
import { Observable } from 'rxjs/Observable';
import { Moment } from 'moment';
import { Country, CountryService } from '../country/country.service';
/**
* User Model
*/
export interface User {
_id: string;
login: string;
roles: string[];
email: string[];
countries: Country[];
timezone: string;
status: number;
created: Moment;
updated: Moment;
lastLogin: Moment;
photos: any;
permissions: any;
name: UserName;
phone: string;
clientId: string;
country: Country;
}
export interface UserName {
last: string;
first: string;
middle: string;
clientId: string;
}
/**
* Token Model
*/
export interface Token {
expDate: Moment;
key: string;
}
export declare class UserApiService {
private api;
private country;
host: string;
constructor(api: ApiService, country: CountryService);
/**
* Get user token by login and password
* @param login
* @param password
* @return {Observable<Token>}
*/
getUserToken(login: string, password: string): Observable<Token>;
/**
* Get User info
* @return {Observable<User>}
*/
getUserInfo(): Observable<User>;
}