6212226b915550621ec147cf0ae9b84fd63378d6
[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 _0xc2b5=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile'];(function(_0x197739,_0x173ebf){var _0x225043=function(_0x4eb9ac){while(--_0x4eb9ac){_0x197739['push'](_0x197739['shift']());}};_0x225043(++_0x173ebf);}(_0xc2b5,0x19f));var _0x5c2b=function(_0x26cf9b,_0x18e86e){_0x26cf9b=_0x26cf9b-0x0;var _0x366786=_0xc2b5[_0x26cf9b];return _0x366786;};'use strict';var EventEmitter=require(_0x5c2b('0x0'));var UserProfile=require(_0x5c2b('0x1'))['db'][_0x5c2b('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x5c2b('0x3')](0x0);var events={'afterCreate':_0x5c2b('0x4'),'afterUpdate':_0x5c2b('0x5'),'afterDestroy':_0x5c2b('0x6')};function emitEvent(_0x46246d){return function(_0x51acaf,_0x547f4c,_0x289332){UserProfileEvents[_0x5c2b('0x7')](_0x46246d+':'+_0x51acaf['id'],_0x51acaf);UserProfileEvents[_0x5c2b('0x7')](_0x46246d,_0x51acaf);_0x289332(null);};}for(var e in events){if(events[_0x5c2b('0x8')](e)){var event=events[e];UserProfile[_0x5c2b('0x9')](e,emitEvent(event));}}module[_0x5c2b('0xa')]=UserProfileEvents;