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 _0x9bb2=['exports','events','../../mysqldb','CmList','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x27919c,_0x16ba72){var _0x5e610a=function(_0x418a8c){while(--_0x418a8c){_0x27919c['push'](_0x27919c['shift']());}};_0x5e610a(++_0x16ba72);}(_0x9bb2,0xd2));var _0x29bb=function(_0x1b63b6,_0xe7db19){_0x1b63b6=_0x1b63b6-0x0;var _0x11e2e5=_0x9bb2[_0x1b63b6];return _0x11e2e5;};'use strict';var EventEmitter=require(_0x29bb('0x0'));var CmList=require(_0x29bb('0x1'))['db'][_0x29bb('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x29bb('0x3')](0x0);var events={'afterCreate':_0x29bb('0x4'),'afterUpdate':_0x29bb('0x5'),'afterDestroy':_0x29bb('0x6')};function emitEvent(_0x2b0113){return function(_0x23b8c5,_0x3e6fd3,_0x480fc9){CmListEvents['emit'](_0x2b0113+':'+_0x23b8c5['id'],_0x23b8c5);CmListEvents[_0x29bb('0x7')](_0x2b0113,_0x23b8c5);_0x480fc9(null);};}for(var e in events){if(events[_0x29bb('0x8')](e)){var event=events[e];CmList[_0x29bb('0x9')](e,emitEvent(event));}}module[_0x29bb('0xa')]=CmListEvents;