c3446d809eedde9ef2024eb85582224f64ca35a3
[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 _0x518c=['events','../../mysqldb','Dashboard','save','update','emit','hasOwnProperty','hook'];(function(_0x374922,_0x45b6d5){var _0x59b712=function(_0x54cc6a){while(--_0x54cc6a){_0x374922['push'](_0x374922['shift']());}};_0x59b712(++_0x45b6d5);}(_0x518c,0xd8));var _0xc518=function(_0xdfc862,_0x1f4dbe){_0xdfc862=_0xdfc862-0x0;var _0x1378da=_0x518c[_0xdfc862];return _0x1378da;};'use strict';var EventEmitter=require(_0xc518('0x0'));var Dashboard=require(_0xc518('0x1'))['db'][_0xc518('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc518('0x3'),'afterUpdate':_0xc518('0x4'),'afterDestroy':'remove'};function emitEvent(_0x488783){return function(_0x1ebed2,_0x251530,_0x2d0d7f){DashboardEvents[_0xc518('0x5')](_0x488783+':'+_0x1ebed2['id'],_0x1ebed2);DashboardEvents['emit'](_0x488783,_0x1ebed2);_0x2d0d7f(null);};}for(var e in events){if(events[_0xc518('0x6')](e)){var event=events[e];Dashboard[_0xc518('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents;