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 _0x988f=['update','remove','emit','../../mysqldb','setMaxListeners'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x988f,0xb7));var _0xf988=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x988f[_0x5e3b04];return _0x1fc44d;};'use strict';var EventEmitter=require('events');var CmList=require(_0xf988('0x0'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf988('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf988('0x2'),'afterDestroy':_0xf988('0x3')};function emitEvent(_0x41829d){return function(_0x17c30c,_0x6bf9ab,_0xacd2fd){CmListEvents[_0xf988('0x4')](_0x41829d+':'+_0x17c30c['id'],_0x17c30c);CmListEvents[_0xf988('0x4')](_0x41829d,_0x17c30c);_0xacd2fd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module['exports']=CmListEvents;