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 _0x1feb=['hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x37320c,_0x11386e){var _0x59b2de=function(_0x18cfe4){while(--_0x18cfe4){_0x37320c['push'](_0x37320c['shift']());}};_0x59b2de(++_0x11386e);}(_0x1feb,0x157));var _0xb1fe=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1feb[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0xb1fe('0x0'));var Dashboard=require(_0xb1fe('0x1'))['db'][_0xb1fe('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xb1fe('0x3')](0x0);var events={'afterCreate':_0xb1fe('0x4'),'afterUpdate':_0xb1fe('0x5'),'afterDestroy':_0xb1fe('0x6')};function emitEvent(_0x1d85b4){return function(_0x398a8c,_0x2a065b,_0x4027b0){DashboardEvents[_0xb1fe('0x7')](_0x1d85b4+':'+_0x398a8c['id'],_0x398a8c);DashboardEvents[_0xb1fe('0x7')](_0x1d85b4,_0x398a8c);_0x4027b0(null);};}for(var e in events){if(events[_0xb1fe('0x8')](e)){var event=events[e];Dashboard[_0xb1fe('0x9')](e,emitEvent(event));}}module[_0xb1fe('0xa')]=DashboardEvents;