5fffc9e6d26d0b31166a20cfab1f131f399b4209
[motion2.git] / server / api / userProfile / userProfile.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x27e2=['emit','hook','exports','events','../../mysqldb','UserProfile','save','update'];(function(_0x52c7d1,_0x52de12){var _0x38c4a4=function(_0x3775f5){while(--_0x3775f5){_0x52c7d1['push'](_0x52c7d1['shift']());}};_0x38c4a4(++_0x52de12);}(_0x27e2,0x17b));var _0x227e=function(_0x5ee379,_0x3bc2fb){_0x5ee379=_0x5ee379-0x0;var _0x366e30=_0x27e2[_0x5ee379];return _0x366e30;};'use strict';var EventEmitter=require(_0x227e('0x0'));var UserProfile=require(_0x227e('0x1'))['db'][_0x227e('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x227e('0x3'),'afterUpdate':_0x227e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e724a){return function(_0x3d5aa8,_0x33e037,_0x105ccb){UserProfileEvents[_0x227e('0x5')](_0x2e724a+':'+_0x3d5aa8['id'],_0x3d5aa8);UserProfileEvents[_0x227e('0x5')](_0x2e724a,_0x3d5aa8);_0x105ccb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x227e('0x6')](e,emitEvent(event));}}module[_0x227e('0x7')]=UserProfileEvents;