1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x8880=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x29db14,_0x4fcd9f){var _0x5cfc55=function(_0x144719){while(--_0x144719){_0x29db14['push'](_0x29db14['shift']());}};_0x5cfc55(++_0x4fcd9f);}(_0x8880,0x150));var _0x0888=function(_0x4c630b,_0x25f8ef){_0x4c630b=_0x4c630b-0x0;var _0x181259=_0x8880[_0x4c630b];return _0x181259;};'use strict';var EventEmitter=require(_0x0888('0x0'));var UserProfile=require(_0x0888('0x1'))['db'][_0x0888('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x0888('0x3')](0x0);var events={'afterCreate':_0x0888('0x4'),'afterUpdate':_0x0888('0x5'),'afterDestroy':_0x0888('0x6')};function emitEvent(_0x445517){return function(_0x1e2010,_0x374135,_0x917026){UserProfileEvents[_0x0888('0x7')](_0x445517+':'+_0x1e2010['id'],_0x1e2010);UserProfileEvents[_0x0888('0x7')](_0x445517,_0x1e2010);_0x917026(null);};}for(var e in events){if(events[_0x0888('0x8')](e)){var event=events[e];UserProfile[_0x0888('0x9')](e,emitEvent(event));}}module['exports']=UserProfileEvents;