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 _0xeaa2=['exports','../../mysqldb','CmList','update','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeaa2,0xa9));var _0x2eaa=function(_0x381cd5,_0x1f66dd){_0x381cd5=_0x381cd5-0x0;var _0x14b162=_0xeaa2[_0x381cd5];return _0x14b162;};'use strict';var EventEmitter=require('events');var CmList=require(_0x2eaa('0x0'))['db'][_0x2eaa('0x1')];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2eaa('0x2'),'afterDestroy':_0x2eaa('0x3')};function emitEvent(_0x11333c){return function(_0x523e33,_0x364038,_0x3c13c4){CmListEvents[_0x2eaa('0x4')](_0x11333c+':'+_0x523e33['id'],_0x523e33);CmListEvents[_0x2eaa('0x4')](_0x11333c,_0x523e33);_0x3c13c4(null);};}for(var e in events){if(events[_0x2eaa('0x5')](e)){var event=events[e];CmList[_0x2eaa('0x6')](e,emitEvent(event));}}module[_0x2eaa('0x7')]=CmListEvents;