Built motion from commit (unavailable).|2.4.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 _0xb7f2=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x177179,_0x2580aa){var _0xe94765=function(_0x17b8a9){while(--_0x17b8a9){_0x177179['push'](_0x177179['shift']());}};_0xe94765(++_0x2580aa);}(_0xb7f2,0x198));var _0x2b7f=function(_0x4bbbfe,_0xf1d98a){_0x4bbbfe=_0x4bbbfe-0x0;var _0x1d9e07=_0xb7f2[_0x4bbbfe];return _0x1d9e07;};'use strict';var EventEmitter=require(_0x2b7f('0x0'));var Dashboard=require(_0x2b7f('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x2b7f('0x2')](0x0);var events={'afterCreate':_0x2b7f('0x3'),'afterUpdate':'update','afterDestroy':_0x2b7f('0x4')};function emitEvent(_0x13113a){return function(_0x1b53df,_0x5404a2,_0x3df4b6){DashboardEvents['emit'](_0x13113a+':'+_0x1b53df['id'],_0x1b53df);DashboardEvents[_0x2b7f('0x5')](_0x13113a,_0x1b53df);_0x3df4b6(null);};}for(var e in events){if(events[_0x2b7f('0x6')](e)){var event=events[e];Dashboard[_0x2b7f('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents;