Built motion from commit bab6f49e.|2.6.17
[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 _0x2502=['hook','events','../../mysqldb','Dashboard','save','update','emit','hasOwnProperty'];(function(_0x53ea08,_0x2850bf){var _0x4f15c8=function(_0x1c0659){while(--_0x1c0659){_0x53ea08['push'](_0x53ea08['shift']());}};_0x4f15c8(++_0x2850bf);}(_0x2502,0x141));var _0x2250=function(_0x2f0ffc,_0x290c1c){_0x2f0ffc=_0x2f0ffc-0x0;var _0x5f5a4e=_0x2502[_0x2f0ffc];return _0x5f5a4e;};'use strict';var EventEmitter=require(_0x2250('0x0'));var Dashboard=require(_0x2250('0x1'))['db'][_0x2250('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2250('0x3'),'afterUpdate':_0x2250('0x4'),'afterDestroy':'remove'};function emitEvent(_0x20e020){return function(_0x52dfc8,_0x5f210a,_0x4f7609){DashboardEvents['emit'](_0x20e020+':'+_0x52dfc8['id'],_0x52dfc8);DashboardEvents[_0x2250('0x5')](_0x20e020,_0x52dfc8);_0x4f7609(null);};}for(var e in events){if(events[_0x2250('0x6')](e)){var event=events[e];Dashboard[_0x2250('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents;