Built motion from commit 85328c08.|2.5.50
[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 _0xfe33=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x31980d,_0x3615f6){var _0x372a55=function(_0x282df7){while(--_0x282df7){_0x31980d['push'](_0x31980d['shift']());}};_0x372a55(++_0x3615f6);}(_0xfe33,0x13e));var _0x3fe3=function(_0x508986,_0x43d040){_0x508986=_0x508986-0x0;var _0x25d13a=_0xfe33[_0x508986];return _0x25d13a;};'use strict';var EventEmitter=require(_0x3fe3('0x0'));var Dashboard=require(_0x3fe3('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x3fe3('0x2')](0x0);var events={'afterCreate':_0x3fe3('0x3'),'afterUpdate':_0x3fe3('0x4'),'afterDestroy':_0x3fe3('0x5')};function emitEvent(_0x2cef79){return function(_0x201cb7,_0xcceeeb,_0x239b97){DashboardEvents[_0x3fe3('0x6')](_0x2cef79+':'+_0x201cb7['id'],_0x201cb7);DashboardEvents['emit'](_0x2cef79,_0x201cb7);_0x239b97(null);};}for(var e in events){if(events[_0x3fe3('0x7')](e)){var event=events[e];Dashboard[_0x3fe3('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents;