Built motion from commit 994c64e1.|2.6.1
[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 _0xce2a=['exports','../../mysqldb','Dashboard','setMaxListeners','update','remove','emit'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xce2a,0xd3));var _0xace2=function(_0x220f34,_0x25a797){_0x220f34=_0x220f34-0x0;var _0xee358f=_0xce2a[_0x220f34];return _0xee358f;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xace2('0x0'))['db'][_0xace2('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xace2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xace2('0x3'),'afterDestroy':_0xace2('0x4')};function emitEvent(_0x2c09ae){return function(_0x5eb117,_0x362167,_0x5b569f){DashboardEvents[_0xace2('0x5')](_0x2c09ae+':'+_0x5eb117['id'],_0x5eb117);DashboardEvents[_0xace2('0x5')](_0x2c09ae,_0x5eb117);_0x5b569f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xace2('0x6')]=DashboardEvents;