src/models/UserModel.ts
constructor(data: { user: string; pass: string; authenticated: boolean; businessId: number; rememberMe: boolean; tw...)
|
Defined in src/models/UserModel.ts:2
|
Static setTime |
setTime()
|
Defined in src/models/UserModel.ts:24
|
Returns :
void
|
Static getTime |
getTime()
|
Defined in src/models/UserModel.ts:28
|
Returns :
void
|
setAuthenticated |
setAuthenticated(value: boolean)
|
Defined in src/models/UserModel.ts:32
|
Returns :
void
|
setComponents |
setComponents(value: any)
|
Defined in src/models/UserModel.ts:36
|
Returns :
void
|
getAuthenticated |
getAuthenticated()
|
Defined in src/models/UserModel.ts:40
|
Returns :
boolean
|
setUser |
setUser(value: string)
|
Defined in src/models/UserModel.ts:44
|
Returns :
void
|
getUser |
getUser()
|
Defined in src/models/UserModel.ts:48
|
Returns :
void
|
user |
user()
|
Defined in src/models/UserModel.ts:56
|
Returns :
void
|
setPass |
setPass(value: string)
|
Defined in src/models/UserModel.ts:60
|
Returns :
void
|
getPass |
getPass()
|
Defined in src/models/UserModel.ts:64
|
Returns :
void
|
pass |
pass()
|
Defined in src/models/UserModel.ts:68
|
Returns :
void
|
getDomain |
getDomain()
|
Defined in src/models/UserModel.ts:72
|
Returns :
void
|
getPartialDomain |
getPartialDomain()
|
Defined in src/models/UserModel.ts:76
|
Returns :
void
|
setDomain |
setDomain(value: string)
|
Defined in src/models/UserModel.ts:80
|
Returns :
void
|
setAccountType |
setAccountType(value: number)
|
Defined in src/models/UserModel.ts:84
|
Returns :
void
|
setResellerInfo |
setResellerInfo(value: XMLDocument)
|
Defined in src/models/UserModel.ts:88
|
Returns :
void
|
setResellerId |
setResellerId(value: number)
|
Defined in src/models/UserModel.ts:92
|
Returns :
void
|
setResellerName |
setResellerName(value: string)
|
Defined in src/models/UserModel.ts:96
|
Returns :
void
|
setEri |
setEri(value: string)
|
Defined in src/models/UserModel.ts:100
|
Returns :
void
|
setResellerWhiteLabel |
setResellerWhiteLabel(value: { [key: string]: string; })
|
Defined in src/models/UserModel.ts:104
|
Returns :
void
|
getAccountType |
getAccountType()
|
Defined in src/models/UserModel.ts:112
|
Returns :
void
|
setTwoFactorRequired |
setTwoFactorRequired(value: boolean)
|
Defined in src/models/UserModel.ts:116
|
Returns :
void
|
getTwoFactorRequired |
getTwoFactorRequired()
|
Defined in src/models/UserModel.ts:120
|
Returns :
boolean
|
setBusinessId |
setBusinessId(value: number)
|
Defined in src/models/UserModel.ts:124
|
Returns :
void
|
getBusinessId |
getBusinessId()
|
Defined in src/models/UserModel.ts:128
|
Returns :
number
|
businessId |
businessId()
|
Defined in src/models/UserModel.ts:132
|
Returns :
void
|
setRememberMe |
setRememberMe(value: boolean)
|
Defined in src/models/UserModel.ts:136
|
Returns :
void
|
getRememberMe |
getRememberMe()
|
Defined in src/models/UserModel.ts:140
|
Returns :
void
|
rememberMe |
rememberMe()
|
Defined in src/models/UserModel.ts:144
|
Returns :
void
|
resellerId |
resellerId: |
Defined in src/models/UserModel.ts:52
|
resellerWhiteLabel |
resellerWhiteLabel: |
Defined in src/models/UserModel.ts:108
|
import {StoreModel} from "../models/StoreModel";
export class UserModel extends StoreModel {
constructor(data: {user: string, pass: string, authenticated: boolean, businessId: number, rememberMe: boolean, twoFactorRequired:boolean, accountType: number, authTime?: Date}) {
super(data);
}
// setKey2 = <T extends new (...args: any[]) => UserModel, K extends keyof UserModel>
// (c: T, key: K, value: UserModel[K]) => {
// c.prototype[key] = value;
// };
// getKey2 = (key: string) => {
// return key as any;
// };
//
// set authenticated2(value: boolean) {
// this.setKey2(UserModel, 'authenticated2', value);
// }
//
// get authenticated2(): boolean {
// return this.getKey2('authenticated');
// }
public setTime() {
return this.setKey<UserModel>(UserModel, 'authTime', new Date());
}
public getTime() {
return this.getKey('authTime');
}
setAuthenticated(value:boolean) {
return this.setKey<UserModel>(UserModel, 'authenticated', value);
}
setComponents(value) {
return this.setKey<UserModel>(UserModel, 'components', value);
}
getAuthenticated(): boolean {
return this.getKey('authenticated');
}
setUser(value:string) {
return this.setKey<UserModel>(UserModel, 'user', value);
}
getUser() {
return this.user();
}
get resellerId(){
return this.getKey('resellerId');
}
user() {
return this.getKey('user');
}
setPass(value:string) {
return this.setKey<UserModel>(UserModel, 'pass', value);
}
getPass() {
return this.pass();
}
pass() {
return this.getKey('pass');
}
getDomain() {
return this.getKey('domain');
}
getPartialDomain() {
return this.getKey('domain').split('.')[0];
}
setDomain(value:string) {
return this.setKey<UserModel>(UserModel, 'domain', value);
}
setAccountType(value:number) {
return this.setKey<UserModel>(UserModel, 'accountType', value);
}
setResellerInfo(value:XMLDocument) {
return this.setKey<UserModel>(UserModel, 'resellerInfo', value);
}
setResellerId(value:number) {
return this.setKey<UserModel>(UserModel, 'resellerId', value);
}
setResellerName(value:string) {
return this.setKey<UserModel>(UserModel, 'resellerName', value);
}
setEri(value:string) {
return this.setKey<UserModel>(UserModel, 'eri', value);
}
setResellerWhiteLabel(value:{[key: string]: string}) {
return this.setKey<UserModel>(UserModel, 'resellerWhiteLabelJson', value);
}
get resellerWhiteLabel() {
return this.getKey('resellerWhiteLabelJson');
}
getAccountType() {
return this.getKey('accountType');
}
setTwoFactorRequired(value:boolean) {
return this.setKey<UserModel>(UserModel, 'twoFactorRequired', value);
}
getTwoFactorRequired(): boolean {
return this.getKey('twoFactorRequired');
}
setBusinessId(value:number) {
return this.setKey<UserModel>(UserModel, 'businessId', value);
}
getBusinessId(): number {
return this.getKey('businessId');
}
businessId() {
return this.getKey('businessId');
}
setRememberMe(value:boolean) {
return this.setKey<UserModel>(UserModel, 'rememberMe', value);
}
getRememberMe() {
return this.rememberMe()
}
rememberMe() {
return this.getKey('rememberMe');
}
// public setField(i_field, i_value) {
// var value = this.getKey('Value');
// value[i_field] = i_value;
// return this.setKey<AdnetRateModel>(AdnetRateModel, 'Value', value);
// }
}