75b00c9cc0d931651988bbd5c56d3bc87c21c331
[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 _0xf6f3=['events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x187499,_0x5e416a){var _0x2965fe=function(_0xc6645e){while(--_0xc6645e){_0x187499['push'](_0x187499['shift']());}};_0x2965fe(++_0x5e416a);}(_0xf6f3,0xb4));var _0x3f6f=function(_0x26bb3f,_0x25cd1f){_0x26bb3f=_0x26bb3f-0x0;var _0x2cbd3f=_0xf6f3[_0x26bb3f];return _0x2cbd3f;};'use strict';var EventEmitter=require(_0x3f6f('0x0'));var DashboardItem=require(_0x3f6f('0x1'))['db'][_0x3f6f('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x3f6f('0x3')](0x0);var events={'afterCreate':_0x3f6f('0x4'),'afterUpdate':_0x3f6f('0x5'),'afterDestroy':_0x3f6f('0x6')};function emitEvent(_0x642756){return function(_0x4cb554,_0x5c5dc3,_0x2af82f){DashboardItemEvents['emit'](_0x642756+':'+_0x4cb554['id'],_0x4cb554);DashboardItemEvents[_0x3f6f('0x7')](_0x642756,_0x4cb554);_0x2af82f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x3f6f('0x8')](e,emitEvent(event));}}module[_0x3f6f('0x9')]=DashboardItemEvents;