Built motion from commit (unavailable).|2.0.83
[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 _0x393f=['emit','hook','exports','events','Dashboard','setMaxListeners','save'];(function(_0x11a11b,_0x389ed9){var _0x44580e=function(_0x19ffca){while(--_0x19ffca){_0x11a11b['push'](_0x11a11b['shift']());}};_0x44580e(++_0x389ed9);}(_0x393f,0x18b));var _0xf393=function(_0x2a7467,_0x44f2f7){_0x2a7467=_0x2a7467-0x0;var _0x238a31=_0x393f[_0x2a7467];return _0x238a31;};'use strict';var EventEmitter=require(_0xf393('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xf393('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xf393('0x2')](0x0);var events={'afterCreate':_0xf393('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x378bfd){return function(_0x370b08,_0x5266df,_0x25d43e){DashboardEvents[_0xf393('0x4')](_0x378bfd+':'+_0x370b08['id'],_0x370b08);DashboardEvents['emit'](_0x378bfd,_0x370b08);_0x25d43e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xf393('0x5')](e,emitEvent(event));}}module[_0xf393('0x6')]=DashboardEvents;