Built motion from commit (unavailable).|2.5.29
[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 _0xa9da=['exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xa9da,0x1d7));var _0xaa9d=function(_0x431268,_0x487981){_0x431268=_0x431268-0x0;var _0x1c1c9c=_0xa9da[_0x431268];return _0x1c1c9c;};'use strict';var EventEmitter=require(_0xaa9d('0x0'));var UserProfile=require(_0xaa9d('0x1'))['db'][_0xaa9d('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xaa9d('0x3')](0x0);var events={'afterCreate':_0xaa9d('0x4'),'afterUpdate':_0xaa9d('0x5'),'afterDestroy':_0xaa9d('0x6')};function emitEvent(_0x3be423){return function(_0x5e4a4e,_0xbc4ff4,_0x43e558){UserProfileEvents[_0xaa9d('0x7')](_0x3be423+':'+_0x5e4a4e['id'],_0x5e4a4e);UserProfileEvents[_0xaa9d('0x7')](_0x3be423,_0x5e4a4e);_0x43e558(null);};}for(var e in events){if(events[_0xaa9d('0x8')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xaa9d('0x9')]=UserProfileEvents;