Built motion from commit da617fac.|2.6.6
[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 _0x1cce=['Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x274253,_0x259430){var _0x46179a=function(_0x5869cd){while(--_0x5869cd){_0x274253['push'](_0x274253['shift']());}};_0x46179a(++_0x259430);}(_0x1cce,0x80));var _0xe1cc=function(_0x53080e,_0x252127){_0x53080e=_0x53080e-0x0;var _0x1a0c14=_0x1cce[_0x53080e];return _0x1a0c14;};'use strict';var EventEmitter=require(_0xe1cc('0x0'));var Dashboard=require(_0xe1cc('0x1'))['db'][_0xe1cc('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xe1cc('0x3')](0x0);var events={'afterCreate':_0xe1cc('0x4'),'afterUpdate':_0xe1cc('0x5'),'afterDestroy':_0xe1cc('0x6')};function emitEvent(_0x5c168b){return function(_0x5720e8,_0x434241,_0x5de6a9){DashboardEvents[_0xe1cc('0x7')](_0x5c168b+':'+_0x5720e8['id'],_0x5720e8);DashboardEvents[_0xe1cc('0x7')](_0x5c168b,_0x5720e8);_0x5de6a9(null);};}for(var e in events){if(events[_0xe1cc('0x8')](e)){var event=events[e];Dashboard[_0xe1cc('0x9')](e,emitEvent(event));}}module['exports']=DashboardEvents;