import RoleScopeType from '../enums/RoleScopeType'; export default class Authenticator { private _username: string; private _password: string; private _scope: Array = []; get username(): string { return this._username; } set username(value: string) { this._username = value; } get password(): string { return this._password; } set password(value: string) { this._password = value; } get scope(): Array { return this._scope; } set scope(value: Array) { this._scope = value; } addScope(scope: RoleScopeType) { this._scope.push(scope); } static getNew(username: string, password: string, scope: Array): Authenticator { let auth = new this(); auth.username = username; auth.password = password; auth.scope = scope; return auth; } }