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 _0xa9e4=['hasOwnProperty','hook','events','../../mysqldb','Dashboard','setMaxListeners','save','update','emit'];(function(_0x10825c,_0x353331){var _0x36e70f=function(_0x288e77){while(--_0x288e77){_0x10825c['push'](_0x10825c['shift']());}};_0x36e70f(++_0x353331);}(_0xa9e4,0x89));var _0x4a9e=function(_0x21b728,_0x2ab834){_0x21b728=_0x21b728-0x0;var _0x2d95ad=_0xa9e4[_0x21b728];return _0x2d95ad;};'use strict';var EventEmitter=require(_0x4a9e('0x0'));var Dashboard=require(_0x4a9e('0x1'))['db'][_0x4a9e('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x4a9e('0x3')](0x0);var events={'afterCreate':_0x4a9e('0x4'),'afterUpdate':_0x4a9e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x409ad1){return function(_0x8bf81c,_0x3e037f,_0x5bf331){DashboardEvents[_0x4a9e('0x6')](_0x409ad1+':'+_0x8bf81c['id'],_0x8bf81c);DashboardEvents[_0x4a9e('0x6')](_0x409ad1,_0x8bf81c);_0x5bf331(null);};}for(var e in events){if(events[_0x4a9e('0x7')](e)){var event=events[e];Dashboard[_0x4a9e('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents;