6cad5e995f33587ed7f74703e3c27aa3f614c298
[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 _0xe641=['update','remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','save'];(function(_0x28432f,_0x399b15){var _0x17bf26=function(_0x1890ed){while(--_0x1890ed){_0x28432f['push'](_0x28432f['shift']());}};_0x17bf26(++_0x399b15);}(_0xe641,0x1ec));var _0x1e64=function(_0xbfac21,_0x1e161d){_0xbfac21=_0xbfac21-0x0;var _0x2e676c=_0xe641[_0xbfac21];return _0x2e676c;};'use strict';var EventEmitter=require(_0x1e64('0x0'));var Dashboard=require(_0x1e64('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x1e64('0x2')](0x0);var events={'afterCreate':_0x1e64('0x3'),'afterUpdate':_0x1e64('0x4'),'afterDestroy':_0x1e64('0x5')};function emitEvent(_0x2cbc48){return function(_0x18dd32,_0x36ab98,_0x402c70){DashboardEvents[_0x1e64('0x6')](_0x2cbc48+':'+_0x18dd32['id'],_0x18dd32);DashboardEvents[_0x1e64('0x6')](_0x2cbc48,_0x18dd32);_0x402c70(null);};}for(var e in events){if(events[_0x1e64('0x7')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents;