File

src/models/UserModel.ts

Extends

StoreModel

Constructor

constructor(data: { user: string; pass: string; authenticated: boolean; businessId: number; rememberMe: boolean; tw...)

Methods

Static setTime
setTime()
Returns : void
Static getTime
getTime()
Returns : void
setAuthenticated
setAuthenticated(value: boolean)
Returns : void
setComponents
setComponents(value: any)
Returns : void
getAuthenticated
getAuthenticated()
Returns : boolean
setUser
setUser(value: string)
Returns : void
getUser
getUser()
Returns : void
user
user()
Returns : void
setPass
setPass(value: string)
Returns : void
getPass
getPass()
Returns : void
pass
pass()
Returns : void
getDomain
getDomain()
Returns : void
getPartialDomain
getPartialDomain()
Returns : void
setDomain
setDomain(value: string)
Returns : void
setAccountType
setAccountType(value: number)
Returns : void
setResellerInfo
setResellerInfo(value: XMLDocument)
Returns : void
setResellerId
setResellerId(value: number)
Returns : void
setResellerName
setResellerName(value: string)
Returns : void
setEri
setEri(value: string)
Returns : void
setResellerWhiteLabel
setResellerWhiteLabel(value: { [key: string]: string; })
Returns : void
getAccountType
getAccountType()
Returns : void
setTwoFactorRequired
setTwoFactorRequired(value: boolean)
Returns : void
getTwoFactorRequired
getTwoFactorRequired()
Returns : boolean
setBusinessId
setBusinessId(value: number)
Returns : void
getBusinessId
getBusinessId()
Returns : number
businessId
businessId()
Returns : void
setRememberMe
setRememberMe(value: boolean)
Returns : void
getRememberMe
getRememberMe()
Returns : void
rememberMe
rememberMe()
Returns : void

Properties

resellerId
resellerId: any
resellerWhiteLabel
resellerWhiteLabel: any
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);
    // }

}

results matching ""

    No results matching ""