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 _0xc357=['exports','../../mysqldb','setMaxListeners','save','update','remove','hook'];(function(_0x4d5cfd,_0x5b5c6c){var _0x442f17=function(_0x32a375){while(--_0x32a375){_0x4d5cfd['push'](_0x4d5cfd['shift']());}};_0x442f17(++_0x5b5c6c);}(_0xc357,0x86));var _0x7c35=function(_0x3228cb,_0x42a4a2){_0x3228cb=_0x3228cb-0x0;var _0x64c4d9=_0xc357[_0x3228cb];return _0x64c4d9;};'use strict';var EventEmitter=require('events');var Team=require(_0x7c35('0x0'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x7c35('0x1')](0x0);var events={'afterCreate':_0x7c35('0x2'),'afterUpdate':_0x7c35('0x3'),'afterDestroy':_0x7c35('0x4')};function emitEvent(_0x30ed8b){return function(_0x2a4e35,_0x4b7326,_0x14953c){TeamEvents['emit'](_0x30ed8b+':'+_0x2a4e35['id'],_0x2a4e35);TeamEvents['emit'](_0x30ed8b,_0x2a4e35);_0x14953c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x7c35('0x5')](e,emitEvent(event));}}module[_0x7c35('0x6')]=TeamEvents;