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 _0x187f=['../../mysqldb','Team','save','update','hook','exports'];(function(_0x3050b5,_0x182c6a){var _0x37cceb=function(_0x49b797){while(--_0x49b797){_0x3050b5['push'](_0x3050b5['shift']());}};_0x37cceb(++_0x182c6a);}(_0x187f,0x6c));var _0xf187=function(_0x2eb10c,_0xb71992){_0x2eb10c=_0x2eb10c-0x0;var _0xf3fa60=_0x187f[_0x2eb10c];return _0xf3fa60;};'use strict';var EventEmitter=require('events');var Team=require(_0xf187('0x0'))['db'][_0xf187('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf187('0x2'),'afterUpdate':_0xf187('0x3'),'afterDestroy':'remove'};function emitEvent(_0x532a80){return function(_0x1d12a6,_0x1a0859,_0x1f9d1d){TeamEvents['emit'](_0x532a80+':'+_0x1d12a6['id'],_0x1d12a6);TeamEvents['emit'](_0x532a80,_0x1d12a6);_0x1f9d1d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xf187('0x4')](e,emitEvent(event));}}module[_0xf187('0x5')]=TeamEvents;