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 _0x7f81=['../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x129c3c,_0x49f558){var _0x26d66c=function(_0x4bdb3d){while(--_0x4bdb3d){_0x129c3c['push'](_0x129c3c['shift']());}};_0x26d66c(++_0x49f558);}(_0x7f81,0x185));var _0x17f8=function(_0x3333a0,_0x411efa){_0x3333a0=_0x3333a0-0x0;var _0x383426=_0x7f81[_0x3333a0];return _0x383426;};'use strict';var EventEmitter=require(_0x17f8('0x0'));var DashboardItem=require(_0x17f8('0x1'))['db'][_0x17f8('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x17f8('0x3')](0x0);var events={'afterCreate':_0x17f8('0x4'),'afterUpdate':_0x17f8('0x5'),'afterDestroy':_0x17f8('0x6')};function emitEvent(_0x1e2e35){return function(_0x531c72,_0x13545f,_0x13937c){DashboardItemEvents[_0x17f8('0x7')](_0x1e2e35+':'+_0x531c72['id'],_0x531c72);DashboardItemEvents[_0x17f8('0x7')](_0x1e2e35,_0x531c72);_0x13937c(null);};}for(var e in events){if(events[_0x17f8('0x8')](e)){var event=events[e];DashboardItem[_0x17f8('0x9')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;