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 _0xf209=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners','update'];(function(_0x42aa10,_0x334b06){var _0xebae1c=function(_0x34eed9){while(--_0x34eed9){_0x42aa10['push'](_0x42aa10['shift']());}};_0xebae1c(++_0x334b06);}(_0xf209,0x9b));var _0x9f20=function(_0x241eb9,_0x5ccc3f){_0x241eb9=_0x241eb9-0x0;var _0x4f916b=_0xf209[_0x241eb9];return _0x4f916b;};'use strict';var EventEmitter=require(_0x9f20('0x0'));var Team=require(_0x9f20('0x1'))['db'][_0x9f20('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x9f20('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9f20('0x4'),'afterDestroy':_0x9f20('0x5')};function emitEvent(_0x1ac43c){return function(_0x19eaed,_0x3f78da,_0x63e332){TeamEvents[_0x9f20('0x6')](_0x1ac43c+':'+_0x19eaed['id'],_0x19eaed);TeamEvents[_0x9f20('0x6')](_0x1ac43c,_0x19eaed);_0x63e332(null);};}for(var e in events){if(events[_0x9f20('0x7')](e)){var event=events[e];Team[_0x9f20('0x8')](e,emitEvent(event));}}module[_0x9f20('0x9')]=TeamEvents;