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 _0x3bf4=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x12b505,_0xdb5cd3){var _0x27b32c=function(_0x29ad0f){while(--_0x29ad0f){_0x12b505['push'](_0x12b505['shift']());}};_0x27b32c(++_0xdb5cd3);}(_0x3bf4,0x1e1));var _0x43bf=function(_0x116e8a,_0x19fa56){_0x116e8a=_0x116e8a-0x0;var _0x49d947=_0x3bf4[_0x116e8a];return _0x49d947;};'use strict';var EventEmitter=require('events');var CmList=require(_0x43bf('0x0'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x43bf('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x43bf('0x2')};function emitEvent(_0x12675a){return function(_0x17c5ab,_0x5a4350,_0x1462f5){CmListEvents[_0x43bf('0x3')](_0x12675a+':'+_0x17c5ab['id'],_0x17c5ab);CmListEvents[_0x43bf('0x3')](_0x12675a,_0x17c5ab);_0x1462f5(null);};}for(var e in events){if(events[_0x43bf('0x4')](e)){var event=events[e];CmList[_0x43bf('0x5')](e,emitEvent(event));}}module[_0x43bf('0x6')]=CmListEvents;