@ebonydevcopy/framework
Version:
A module-based NodeJS chatbot framework.
39 lines • 1.14 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.userLoader = void 0;
class User {
constructor(data) {
this.doc = data;
const { firstName = '', lastName = '', gender = 'male', active = true, handovered = false, data: userData = null } = data;
this.id = data.id;
this.firstName = firstName;
this.lastName = lastName;
this.gender = gender;
this.active = active;
this.handovered = handovered;
this.data = userData;
this._context = data.context;
if (!data.active) {
this.active = true;
}
if (!data.handovered) {
this.handovered = false;
}
if (!data.context) {
// Initialize context
this._context = {};
}
}
get fullname() {
return `${this.firstName} ${this.lastName}`;
}
get context() {
return Object.assign({}, this._context);
}
}
exports.default = User;
async function userLoader() {
throw new Error('Not Implemented!');
}
exports.userLoader = userLoader;
//# sourceMappingURL=User.js.map