13c74bc8fa79d3f24a081b86c2e5a0fbb1298ab5
[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 _0x5e92=['emit','hasOwnProperty','hook','exports','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove'];(function(_0x3f6460,_0x3bdb9b){var _0x5d9ac6=function(_0x1ebb5e){while(--_0x1ebb5e){_0x3f6460['push'](_0x3f6460['shift']());}};_0x5d9ac6(++_0x3bdb9b);}(_0x5e92,0x1d0));var _0x25e9=function(_0x32df79,_0x4a1a1a){_0x32df79=_0x32df79-0x0;var _0xe1953d=_0x5e92[_0x32df79];return _0xe1953d;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x25e9('0x0'))['db'][_0x25e9('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x25e9('0x2')](0x0);var events={'afterCreate':_0x25e9('0x3'),'afterUpdate':_0x25e9('0x4'),'afterDestroy':_0x25e9('0x5')};function emitEvent(_0x7c2bb8){return function(_0x53a3c5,_0x100ea1,_0x3eca02){DashboardItemEvents['emit'](_0x7c2bb8+':'+_0x53a3c5['id'],_0x53a3c5);DashboardItemEvents[_0x25e9('0x6')](_0x7c2bb8,_0x53a3c5);_0x3eca02(null);};}for(var e in events){if(events[_0x25e9('0x7')](e)){var event=events[e];DashboardItem[_0x25e9('0x8')](e,emitEvent(event));}}module[_0x25e9('0x9')]=DashboardItemEvents;