Built motion from commit 9d7072cc.|2.5.39
[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 _0x5e2c=['setMaxListeners','save','remove','emit','exports','../../mysqldb','Dashboard'];(function(_0x184aaa,_0x4b4b18){var _0xd574fb=function(_0x22ba54){while(--_0x22ba54){_0x184aaa['push'](_0x184aaa['shift']());}};_0xd574fb(++_0x4b4b18);}(_0x5e2c,0x155));var _0xc5e2=function(_0x18e52b,_0x1fae35){_0x18e52b=_0x18e52b-0x0;var _0x3d3062=_0x5e2c[_0x18e52b];return _0x3d3062;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xc5e2('0x0'))['db'][_0xc5e2('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xc5e2('0x2')](0x0);var events={'afterCreate':_0xc5e2('0x3'),'afterUpdate':'update','afterDestroy':_0xc5e2('0x4')};function emitEvent(_0x5d231b){return function(_0x5a312b,_0x34f1f9,_0x3321ee){DashboardEvents[_0xc5e2('0x5')](_0x5d231b+':'+_0x5a312b['id'],_0x5a312b);DashboardEvents[_0xc5e2('0x5')](_0x5d231b,_0x5a312b);_0x3321ee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xc5e2('0x6')]=DashboardEvents;