Built motion from commit 3c2ce842.|2.6.31
[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 _0xce2f=['../../mysqldb','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0xce2f,0x1ef));var _0xfce2=function(_0x8c5648,_0x6a34b){_0x8c5648=_0x8c5648-0x0;var _0x19a4d6=_0xce2f[_0x8c5648];return _0x19a4d6;};'use strict';var EventEmitter=require(_0xfce2('0x0'));var Dashboard=require(_0xfce2('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xfce2('0x2')](0x0);var events={'afterCreate':_0xfce2('0x3'),'afterUpdate':_0xfce2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4170fc){return function(_0x8e48f1,_0x5a6aac,_0x124616){DashboardEvents[_0xfce2('0x5')](_0x4170fc+':'+_0x8e48f1['id'],_0x8e48f1);DashboardEvents[_0xfce2('0x5')](_0x4170fc,_0x8e48f1);_0x124616(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xfce2('0x6')](e,emitEvent(event));}}module[_0xfce2('0x7')]=DashboardEvents;