Built motion from commit d5e4af8c.|2.6.23
[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 _0xbeba=['events','../../mysqldb','DashboardItem','save','update','emit','hasOwnProperty'];(function(_0x266bf2,_0x4ed0fe){var _0x1a4c6c=function(_0x377d59){while(--_0x377d59){_0x266bf2['push'](_0x266bf2['shift']());}};_0x1a4c6c(++_0x4ed0fe);}(_0xbeba,0xb6));var _0xabeb=function(_0x520ea4,_0x1b0891){_0x520ea4=_0x520ea4-0x0;var _0x4362c2=_0xbeba[_0x520ea4];return _0x4362c2;};'use strict';var EventEmitter=require(_0xabeb('0x0'));var DashboardItem=require(_0xabeb('0x1'))['db'][_0xabeb('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xabeb('0x3'),'afterUpdate':_0xabeb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1297fd){return function(_0x5d061e,_0x521fc6,_0x279cc1){DashboardItemEvents[_0xabeb('0x5')](_0x1297fd+':'+_0x5d061e['id'],_0x5d061e);DashboardItemEvents['emit'](_0x1297fd,_0x5d061e);_0x279cc1(null);};}for(var e in events){if(events[_0xabeb('0x6')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module['exports']=DashboardItemEvents;