Built motion from commit (unavailable).|2.5.21
[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 _0x4fb1=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x4fb1,0x188));var _0x14fb=function(_0xdd634b,_0x3d5b3b){_0xdd634b=_0xdd634b-0x0;var _0x1f810b=_0x4fb1[_0xdd634b];return _0x1f810b;};'use strict';var EventEmitter=require(_0x14fb('0x0'));var Dashboard=require(_0x14fb('0x1'))['db'][_0x14fb('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x14fb('0x3')](0x0);var events={'afterCreate':_0x14fb('0x4'),'afterUpdate':_0x14fb('0x5'),'afterDestroy':_0x14fb('0x6')};function emitEvent(_0x3781dc){return function(_0x4198c1,_0x485f78,_0x114638){DashboardEvents[_0x14fb('0x7')](_0x3781dc+':'+_0x4198c1['id'],_0x4198c1);DashboardEvents['emit'](_0x3781dc,_0x4198c1);_0x114638(null);};}for(var e in events){if(events[_0x14fb('0x8')](e)){var event=events[e];Dashboard[_0x14fb('0x9')](e,emitEvent(event));}}module[_0x14fb('0xa')]=DashboardEvents;