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 _0x5f83=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x37cecb,_0x19ff88){var _0x2afff8=function(_0x5d76d9){while(--_0x5d76d9){_0x37cecb['push'](_0x37cecb['shift']());}};_0x2afff8(++_0x19ff88);}(_0x5f83,0x8f));var _0x35f8=function(_0x29757d,_0x5a099f){_0x29757d=_0x29757d-0x0;var _0x2f126d=_0x5f83[_0x29757d];return _0x2f126d;};'use strict';var EventEmitter=require(_0x35f8('0x0'));var Dashboard=require(_0x35f8('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x35f8('0x2')](0x0);var events={'afterCreate':_0x35f8('0x3'),'afterUpdate':_0x35f8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1943e2){return function(_0x1d2ecf,_0x452604,_0x5296da){DashboardEvents[_0x35f8('0x5')](_0x1943e2+':'+_0x1d2ecf['id'],_0x1d2ecf);DashboardEvents['emit'](_0x1943e2,_0x1d2ecf);_0x5296da(null);};}for(var e in events){if(events[_0x35f8('0x6')](e)){var event=events[e];Dashboard[_0x35f8('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents;