Built motion from commit (unavailable).|2.5.25
[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 _0x3df6=['events','../../mysqldb','DashboardItem','save','emit','hasOwnProperty','hook','exports'];(function(_0x4eab4d,_0x52ae88){var _0x4fb1d0=function(_0x44ff73){while(--_0x44ff73){_0x4eab4d['push'](_0x4eab4d['shift']());}};_0x4fb1d0(++_0x52ae88);}(_0x3df6,0xa8));var _0x63df=function(_0x3ca657,_0x3fc0e4){_0x3ca657=_0x3ca657-0x0;var _0x35591f=_0x3df6[_0x3ca657];return _0x35591f;};'use strict';var EventEmitter=require(_0x63df('0x0'));var DashboardItem=require(_0x63df('0x1'))['db'][_0x63df('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x63df('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x9ba5){return function(_0x507c2c,_0x6c5d53,_0x3d33a9){DashboardItemEvents['emit'](_0x9ba5+':'+_0x507c2c['id'],_0x507c2c);DashboardItemEvents[_0x63df('0x4')](_0x9ba5,_0x507c2c);_0x3d33a9(null);};}for(var e in events){if(events[_0x63df('0x5')](e)){var event=events[e];DashboardItem[_0x63df('0x6')](e,emitEvent(event));}}module[_0x63df('0x7')]=DashboardItemEvents;