Built motion from commit (unavailable).|2.5.4
[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 _0x4e25=['Dashboard','save','update','remove','emit','events'];(function(_0x2288e9,_0x15e163){var _0x24bec9=function(_0xf4dd47){while(--_0xf4dd47){_0x2288e9['push'](_0x2288e9['shift']());}};_0x24bec9(++_0x15e163);}(_0x4e25,0xa1));var _0x54e2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4e25[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x54e2('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x54e2('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x54e2('0x2'),'afterUpdate':_0x54e2('0x3'),'afterDestroy':_0x54e2('0x4')};function emitEvent(_0x135040){return function(_0x1b7308,_0x431435,_0x59208e){DashboardEvents[_0x54e2('0x5')](_0x135040+':'+_0x1b7308['id'],_0x1b7308);DashboardEvents[_0x54e2('0x5')](_0x135040,_0x1b7308);_0x59208e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents;