Built motion from commit (unavailable).|2.5.28
[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 _0xe290=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4ad364,_0x3ff8d7){var _0x4ac3c3=function(_0x213721){while(--_0x213721){_0x4ad364['push'](_0x4ad364['shift']());}};_0x4ac3c3(++_0x3ff8d7);}(_0xe290,0x10f));var _0x0e29=function(_0x51057a,_0x2c8c27){_0x51057a=_0x51057a-0x0;var _0x3cbdaa=_0xe290[_0x51057a];return _0x3cbdaa;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x0e29('0x0'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x0e29('0x1')](0x0);var events={'afterCreate':_0x0e29('0x2'),'afterUpdate':_0x0e29('0x3'),'afterDestroy':_0x0e29('0x4')};function emitEvent(_0x167c2c){return function(_0x1ea8dd,_0x2b4713,_0x2e28e5){DashboardItemEvents[_0x0e29('0x5')](_0x167c2c+':'+_0x1ea8dd['id'],_0x1ea8dd);DashboardItemEvents[_0x0e29('0x5')](_0x167c2c,_0x1ea8dd);_0x2e28e5(null);};}for(var e in events){if(events[_0x0e29('0x6')](e)){var event=events[e];DashboardItem[_0x0e29('0x7')](e,emitEvent(event));}}module[_0x0e29('0x8')]=DashboardItemEvents;