584f71b82504ccf1378d971a675db0e2ece4e849
[motion2.git] / server / api / dashboardItem / dashboardItem.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 _0x3bf9=['DashboardItem','setMaxListeners','update','remove','emit','hook','../../mysqldb'];(function(_0x45add7,_0x1e1659){var _0x46d36c=function(_0x51dfa7){while(--_0x51dfa7){_0x45add7['push'](_0x45add7['shift']());}};_0x46d36c(++_0x1e1659);}(_0x3bf9,0x8b));var _0x93bf=function(_0x5ea326,_0x3d52fa){_0x5ea326=_0x5ea326-0x0;var _0x48cf87=_0x3bf9[_0x5ea326];return _0x48cf87;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x93bf('0x0'))['db'][_0x93bf('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x93bf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x93bf('0x3'),'afterDestroy':_0x93bf('0x4')};function emitEvent(_0x3965d7){return function(_0x90aeb9,_0x15287b,_0x3d2253){DashboardItemEvents[_0x93bf('0x5')](_0x3965d7+':'+_0x90aeb9['id'],_0x90aeb9);DashboardItemEvents['emit'](_0x3965d7,_0x90aeb9);_0x3d2253(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x93bf('0x6')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;