Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/packages / core / auth / user / container.register.js
Size: Mime:
import * as tslib_1 from "tslib";
import { observable, action } from 'xmobx/mobx';
import { containerRegistry } from '@skava/packages/libraries/observable-container';
class RegisterUserContainer {
    constructor() {
        this.store = new Map();
        containerRegistry.set(RegisterUserContainer.debugName, this);
    }
    setShouldNotify(shouldNotify) {
        this.store.set('shouldNotify', shouldNotify);
        return this;
    }
    setEmail(email) {
        this.store.set('email', email);
        this.setUserName(email);
        return this;
    }
    setUserName(userName) {
        this.store.set('userName', userName);
        return;
    }
    setPassword(password) {
        this.store.set('password', password);
        return this;
    }
    setTelephone(telephone) {
        this.store.set('telephone', telephone);
        return this;
    }
    setFirstName(name) {
        this.store.set('firstName', name);
        this.store.set('nickName', name);
        return this;
    }
    setLastName(name) {
        this.store.set('lastName', name);
        return this;
    }
    // @see widgets/Authentication/RegisterFlow/wr/FormView.tsx
    // @todo unused
    setSecurityQuestions(arg) {
        this.store.set('securityQuestions', arg);
        return this;
    }
    toSerialized() {
        const userName = this.store.get('userName');
        const password = this.store.get('password');
        const telephone = this.store.get('telephone');
        const firstName = this.store.get('firstName');
        const lastName = this.store.get('lastName');
        const shouldNotify = this.store.get('shouldNotify');
        return {
            userName,
            password,
            telephone,
            firstName,
            lastName,
        };
    }
    toJSON() {
        const serialized = this.toSerialized();
        return JSON.stringify(serialized);
    }
}
RegisterUserContainer.debugName = 'RegisterUser';
tslib_1.__decorate([
    observable
], RegisterUserContainer.prototype, "store", void 0);
tslib_1.__decorate([
    action
], RegisterUserContainer.prototype, "setShouldNotify", null);
tslib_1.__decorate([
    action
], RegisterUserContainer.prototype, "setEmail", null);
tslib_1.__decorate([
    action
], RegisterUserContainer.prototype, "setUserName", null);
tslib_1.__decorate([
    action
], RegisterUserContainer.prototype, "setPassword", null);
tslib_1.__decorate([
    action
], RegisterUserContainer.prototype, "setTelephone", null);
tslib_1.__decorate([
    action
], RegisterUserContainer.prototype, "setFirstName", null);
tslib_1.__decorate([
    action
], RegisterUserContainer.prototype, "setLastName", null);
tslib_1.__decorate([
    action
], RegisterUserContainer.prototype, "setSecurityQuestions", null);
const registerUserContainer = new RegisterUserContainer();
/**
 * @todo convert & export same as generated
 */
export { RegisterUserContainer, registerUserContainer };
export default registerUserContainer;
//# sourceMappingURL=container.register.js.map