Built motion from commit da24aabd.|2.6.20
[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 _0xd991=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x499e97,_0x106a76){var _0x5b4f4d=function(_0x190701){while(--_0x190701){_0x499e97['push'](_0x499e97['shift']());}};_0x5b4f4d(++_0x106a76);}(_0xd991,0x1a8));var _0x1d99=function(_0x5ec25e,_0x3fff60){_0x5ec25e=_0x5ec25e-0x0;var _0x2f31d1=_0xd991[_0x5ec25e];return _0x2f31d1;};'use strict';var EventEmitter=require(_0x1d99('0x0'));var DashboardItem=require(_0x1d99('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1d99('0x2'),'afterUpdate':_0x1d99('0x3'),'afterDestroy':_0x1d99('0x4')};function emitEvent(_0x46ec21){return function(_0x1c603d,_0x8a598e,_0x51fd54){DashboardItemEvents[_0x1d99('0x5')](_0x46ec21+':'+_0x1c603d['id'],_0x1c603d);DashboardItemEvents[_0x1d99('0x5')](_0x46ec21,_0x1c603d);_0x51fd54(null);};}for(var e in events){if(events[_0x1d99('0x6')](e)){var event=events[e];DashboardItem[_0x1d99('0x7')](e,emitEvent(event));}}module[_0x1d99('0x8')]=DashboardItemEvents;