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 _0xc5f5=['emit','hasOwnProperty','exports','events','../../mysqldb','remove'];(function(_0x3132be,_0x55f095){var _0x346b46=function(_0x1c7ccf){while(--_0x1c7ccf){_0x3132be['push'](_0x3132be['shift']());}};_0x346b46(++_0x55f095);}(_0xc5f5,0xab));var _0x5c5f=function(_0x5754c1,_0x564a97){_0x5754c1=_0x5754c1-0x0;var _0x242cef=_0xc5f5[_0x5754c1];return _0x242cef;};'use strict';var EventEmitter=require(_0x5c5f('0x0'));var Team=require(_0x5c5f('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5c5f('0x2')};function emitEvent(_0x3e43ed){return function(_0x461eba,_0x4e9748,_0x40f7ab){TeamEvents[_0x5c5f('0x3')](_0x3e43ed+':'+_0x461eba['id'],_0x461eba);TeamEvents[_0x5c5f('0x3')](_0x3e43ed,_0x461eba);_0x40f7ab(null);};}for(var e in events){if(events[_0x5c5f('0x4')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x5c5f('0x5')]=TeamEvents;