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 _0xa9f6=['events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x190d9d,_0x215c0e){var _0x870250=function(_0xb0fe95){while(--_0xb0fe95){_0x190d9d['push'](_0x190d9d['shift']());}};_0x870250(++_0x215c0e);}(_0xa9f6,0x88));var _0x6a9f=function(_0x212960,_0xf1ce21){_0x212960=_0x212960-0x0;var _0x20d78f=_0xa9f6[_0x212960];return _0x20d78f;};'use strict';var EventEmitter=require(_0x6a9f('0x0'));var Dashboard=require(_0x6a9f('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x6a9f('0x2')](0x0);var events={'afterCreate':_0x6a9f('0x3'),'afterUpdate':_0x6a9f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4f2a16){return function(_0x2a30cd,_0x33c3ca,_0x249dd5){DashboardEvents['emit'](_0x4f2a16+':'+_0x2a30cd['id'],_0x2a30cd);DashboardEvents[_0x6a9f('0x5')](_0x4f2a16,_0x2a30cd);_0x249dd5(null);};}for(var e in events){if(events[_0x6a9f('0x6')](e)){var event=events[e];Dashboard[_0x6a9f('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents;