Built motion from commit (unavailable).|2.5.3
[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 _0xa681=['hook','exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x52067d,_0x25ba55){var _0x278376=function(_0x5c6bd9){while(--_0x5c6bd9){_0x52067d['push'](_0x52067d['shift']());}};_0x278376(++_0x25ba55);}(_0xa681,0x1b2));var _0x1a68=function(_0x5d3b04,_0x452f3a){_0x5d3b04=_0x5d3b04-0x0;var _0x1910c9=_0xa681[_0x5d3b04];return _0x1910c9;};'use strict';var EventEmitter=require(_0x1a68('0x0'));var UserProfile=require(_0x1a68('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1a68('0x2'),'afterUpdate':_0x1a68('0x3'),'afterDestroy':_0x1a68('0x4')};function emitEvent(_0x2abd1a){return function(_0x2bc35c,_0x24b0a7,_0x4739c1){UserProfileEvents[_0x1a68('0x5')](_0x2abd1a+':'+_0x2bc35c['id'],_0x2bc35c);UserProfileEvents[_0x1a68('0x5')](_0x2abd1a,_0x2bc35c);_0x4739c1(null);};}for(var e in events){if(events[_0x1a68('0x6')](e)){var event=events[e];UserProfile[_0x1a68('0x7')](e,emitEvent(event));}}module[_0x1a68('0x8')]=UserProfileEvents;