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 _0x1222=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5408a8,_0xf2bb55){var _0x54667e=function(_0x5cc0bf){while(--_0x5cc0bf){_0x5408a8['push'](_0x5408a8['shift']());}};_0x54667e(++_0xf2bb55);}(_0x1222,0x165));var _0x2122=function(_0xe7a864,_0x4a24a9){_0xe7a864=_0xe7a864-0x0;var _0x3ef6b5=_0x1222[_0xe7a864];return _0x3ef6b5;};'use strict';var EventEmitter=require(_0x2122('0x0'));var Team=require(_0x2122('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x2122('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2122('0x3')};function emitEvent(_0x36693e){return function(_0xdb84c5,_0x3a74ed,_0x246dad){TeamEvents[_0x2122('0x4')](_0x36693e+':'+_0xdb84c5['id'],_0xdb84c5);TeamEvents[_0x2122('0x4')](_0x36693e,_0xdb84c5);_0x246dad(null);};}for(var e in events){if(events[_0x2122('0x5')](e)){var event=events[e];Team[_0x2122('0x6')](e,emitEvent(event));}}module[_0x2122('0x7')]=TeamEvents;