ab201a86445ce91f3904e99e3cbcbdd3d3cef533
[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 _0xa899=['exports','events','../../mysqldb','UserProfile','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2ee7f4,_0x5c4449){var _0x975bb4=function(_0x3638e7){while(--_0x3638e7){_0x2ee7f4['push'](_0x2ee7f4['shift']());}};_0x975bb4(++_0x5c4449);}(_0xa899,0x155));var _0x9a89=function(_0x43026b,_0x928d8c){_0x43026b=_0x43026b-0x0;var _0x4a96cd=_0xa899[_0x43026b];return _0x4a96cd;};'use strict';var EventEmitter=require(_0x9a89('0x0'));var UserProfile=require(_0x9a89('0x1'))['db'][_0x9a89('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9a89('0x3'),'afterUpdate':_0x9a89('0x4'),'afterDestroy':_0x9a89('0x5')};function emitEvent(_0x45233c){return function(_0x405c47,_0x15c431,_0x105758){UserProfileEvents[_0x9a89('0x6')](_0x45233c+':'+_0x405c47['id'],_0x405c47);UserProfileEvents[_0x9a89('0x6')](_0x45233c,_0x405c47);_0x105758(null);};}for(var e in events){if(events[_0x9a89('0x7')](e)){var event=events[e];UserProfile[_0x9a89('0x8')](e,emitEvent(event));}}module[_0x9a89('0x9')]=UserProfileEvents;