Built motion from commit (unavailable).|2.5.16
[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 _0x33a7=['save','update','emit','hook','exports','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0x49b246,_0x2f6303){var _0x1f627d=function(_0x2b03a3){while(--_0x2b03a3){_0x49b246['push'](_0x49b246['shift']());}};_0x1f627d(++_0x2f6303);}(_0x33a7,0xfd));var _0x733a=function(_0x4a1e96,_0x143e6b){_0x4a1e96=_0x4a1e96-0x0;var _0x5acea9=_0x33a7[_0x4a1e96];return _0x5acea9;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x733a('0x0'))['db'][_0x733a('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x733a('0x2')](0x0);var events={'afterCreate':_0x733a('0x3'),'afterUpdate':_0x733a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x503877){return function(_0x493fe0,_0x429fbb,_0x269004){DashboardItemEvents['emit'](_0x503877+':'+_0x493fe0['id'],_0x493fe0);DashboardItemEvents[_0x733a('0x5')](_0x503877,_0x493fe0);_0x269004(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x733a('0x6')](e,emitEvent(event));}}module[_0x733a('0x7')]=DashboardItemEvents;