Built motion from commit (unavailable).|2.5.7
[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 _0xfca8=['hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','save','update','remove','emit'];(function(_0x4b3d5b,_0x4d91eb){var _0x5d41e5=function(_0x3d2bd9){while(--_0x3d2bd9){_0x4b3d5b['push'](_0x4b3d5b['shift']());}};_0x5d41e5(++_0x4d91eb);}(_0xfca8,0x1c5));var _0x8fca=function(_0x195690,_0x18d59c){_0x195690=_0x195690-0x0;var _0x3f91ae=_0xfca8[_0x195690];return _0x3f91ae;};'use strict';var EventEmitter=require(_0x8fca('0x0'));var DashboardItem=require(_0x8fca('0x1'))['db'][_0x8fca('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8fca('0x3'),'afterUpdate':_0x8fca('0x4'),'afterDestroy':_0x8fca('0x5')};function emitEvent(_0x14c4dc){return function(_0x5614eb,_0x319901,_0x499ae8){DashboardItemEvents[_0x8fca('0x6')](_0x14c4dc+':'+_0x5614eb['id'],_0x5614eb);DashboardItemEvents[_0x8fca('0x6')](_0x14c4dc,_0x5614eb);_0x499ae8(null);};}for(var e in events){if(events[_0x8fca('0x7')](e)){var event=events[e];DashboardItem[_0x8fca('0x8')](e,emitEvent(event));}}module[_0x8fca('0x9')]=DashboardItemEvents;