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 _0xb67a=['update','remove','emit','hook','events','../../mysqldb'];(function(_0x5a42a8,_0x10784a){var _0x251a5b=function(_0x2655ec){while(--_0x2655ec){_0x5a42a8['push'](_0x5a42a8['shift']());}};_0x251a5b(++_0x10784a);}(_0xb67a,0x19c));var _0xab67=function(_0x5335ea,_0x2a612d){_0x5335ea=_0x5335ea-0x0;var _0x40a7da=_0xb67a[_0x5335ea];return _0x40a7da;};'use strict';var EventEmitter=require(_0xab67('0x0'));var CmList=require(_0xab67('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xab67('0x2'),'afterDestroy':_0xab67('0x3')};function emitEvent(_0x2f4526){return function(_0x233cd4,_0x3fdb5b,_0x4a5265){CmListEvents['emit'](_0x2f4526+':'+_0x233cd4['id'],_0x233cd4);CmListEvents[_0xab67('0x4')](_0x2f4526,_0x233cd4);_0x4a5265(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xab67('0x5')](e,emitEvent(event));}}module['exports']=CmListEvents;