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 _0x42bb=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList','setMaxListeners','update'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x42bb,0xeb));var _0xb42b=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x42bb[_0x580576];return _0x3f55a0;};'use strict';var EventEmitter=require(_0xb42b('0x0'));var CmList=require(_0xb42b('0x1'))['db'][_0xb42b('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb42b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb42b('0x4'),'afterDestroy':_0xb42b('0x5')};function emitEvent(_0x34f0c6){return function(_0x2aa0ec,_0x2eb950,_0x4e4943){CmListEvents[_0xb42b('0x6')](_0x34f0c6+':'+_0x2aa0ec['id'],_0x2aa0ec);CmListEvents[_0xb42b('0x6')](_0x34f0c6,_0x2aa0ec);_0x4e4943(null);};}for(var e in events){if(events[_0xb42b('0x7')](e)){var event=events[e];CmList[_0xb42b('0x8')](e,emitEvent(event));}}module[_0xb42b('0x9')]=CmListEvents;