Built motion from commit 9e1399f3.|2.5.37
[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 _0xbc48=['events','../../mysqldb','UserProfile','setMaxListeners','update','remove','hook'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbc48,0x111));var _0x8bc4=function(_0x61eeb4,_0x32115c){_0x61eeb4=_0x61eeb4-0x0;var _0x2ce907=_0xbc48[_0x61eeb4];return _0x2ce907;};'use strict';var EventEmitter=require(_0x8bc4('0x0'));var UserProfile=require(_0x8bc4('0x1'))['db'][_0x8bc4('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x8bc4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8bc4('0x4'),'afterDestroy':_0x8bc4('0x5')};function emitEvent(_0x3efe3a){return function(_0x5971fb,_0x5468ea,_0x2f83e9){UserProfileEvents['emit'](_0x3efe3a+':'+_0x5971fb['id'],_0x5971fb);UserProfileEvents['emit'](_0x3efe3a,_0x5971fb);_0x2f83e9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x8bc4('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents;