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 _0xc774=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','Dashboard'];(function(_0x35f4ac,_0x468f03){var _0x5b8bbd=function(_0x37469f){while(--_0x37469f){_0x35f4ac['push'](_0x35f4ac['shift']());}};_0x5b8bbd(++_0x468f03);}(_0xc774,0x129));var _0x4c77=function(_0x275ae5,_0xcfedc3){_0x275ae5=_0x275ae5-0x0;var _0x2c221d=_0xc774[_0x275ae5];return _0x2c221d;};'use strict';var EventEmitter=require(_0x4c77('0x0'));var Dashboard=require(_0x4c77('0x1'))['db'][_0x4c77('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x4c77('0x3')](0x0);var events={'afterCreate':_0x4c77('0x4'),'afterUpdate':_0x4c77('0x5'),'afterDestroy':_0x4c77('0x6')};function emitEvent(_0x52c02d){return function(_0x2887fd,_0xb14d2d,_0x3c9238){DashboardEvents[_0x4c77('0x7')](_0x52c02d+':'+_0x2887fd['id'],_0x2887fd);DashboardEvents[_0x4c77('0x7')](_0x52c02d,_0x2887fd);_0x3c9238(null);};}for(var e in events){if(events[_0x4c77('0x8')](e)){var event=events[e];Dashboard[_0x4c77('0x9')](e,emitEvent(event));}}module['exports']=DashboardEvents;