003046c6a3d362c2e8ad51f8c770eaacaf423bb4
[motion2.git] / server / api / dashboard / dashboard.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x2e41=['../../mysqldb','Dashboard','setMaxListeners','update','remove','emit','hook','exports','events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2e41,0x15e));var _0x12e4=function(_0x2f31d0,_0x4fce9a){_0x2f31d0=_0x2f31d0-0x0;var _0x1d0256=_0x2e41[_0x2f31d0];return _0x1d0256;};'use strict';var EventEmitter=require(_0x12e4('0x0'));var Dashboard=require(_0x12e4('0x1'))['db'][_0x12e4('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x12e4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x12e4('0x4'),'afterDestroy':_0x12e4('0x5')};function emitEvent(_0x24f685){return function(_0x1e70b1,_0x40230e,_0x4245d8){DashboardEvents[_0x12e4('0x6')](_0x24f685+':'+_0x1e70b1['id'],_0x1e70b1);DashboardEvents[_0x12e4('0x6')](_0x24f685,_0x1e70b1);_0x4245d8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x12e4('0x7')](e,emitEvent(event));}}module[_0x12e4('0x8')]=DashboardEvents;