Built motion from commit (unavailable).|2.5.22
[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 _0xdf3e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Dashboard'];(function(_0x5d6270,_0x83b57a){var _0x168f26=function(_0x258a27){while(--_0x258a27){_0x5d6270['push'](_0x5d6270['shift']());}};_0x168f26(++_0x83b57a);}(_0xdf3e,0xc6));var _0xedf3=function(_0x3cbbe7,_0x14df5e){_0x3cbbe7=_0x3cbbe7-0x0;var _0x11503d=_0xdf3e[_0x3cbbe7];return _0x11503d;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xedf3('0x0'))['db'][_0xedf3('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xedf3('0x2')](0x0);var events={'afterCreate':_0xedf3('0x3'),'afterUpdate':_0xedf3('0x4'),'afterDestroy':_0xedf3('0x5')};function emitEvent(_0x2c7a53){return function(_0xe93239,_0x4de006,_0x3e0fd0){DashboardEvents[_0xedf3('0x6')](_0x2c7a53+':'+_0xe93239['id'],_0xe93239);DashboardEvents[_0xedf3('0x6')](_0x2c7a53,_0xe93239);_0x3e0fd0(null);};}for(var e in events){if(events[_0xedf3('0x7')](e)){var event=events[e];Dashboard[_0xedf3('0x8')](e,emitEvent(event));}}module[_0xedf3('0x9')]=DashboardEvents;