Built motion from commit f7863d46.|2.5.41
[motion2.git] / server / api / dashboard / dashboard.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 _0x0355=['hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x65d9e3,_0x963ca9){var _0x548218=function(_0x45d890){while(--_0x45d890){_0x65d9e3['push'](_0x65d9e3['shift']());}};_0x548218(++_0x963ca9);}(_0x0355,0xb6));var _0x5035=function(_0x5d57e3,_0x3f853a){_0x5d57e3=_0x5d57e3-0x0;var _0x1566ef=_0x0355[_0x5d57e3];return _0x1566ef;};'use strict';var EventEmitter=require(_0x5035('0x0'));var Dashboard=require(_0x5035('0x1'))['db'][_0x5035('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5035('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5035('0x4'),'afterDestroy':_0x5035('0x5')};function emitEvent(_0x300789){return function(_0xcef2a,_0x48765b,_0x48a7f5){DashboardEvents['emit'](_0x300789+':'+_0xcef2a['id'],_0xcef2a);DashboardEvents[_0x5035('0x6')](_0x300789,_0xcef2a);_0x48a7f5(null);};}for(var e in events){if(events[_0x5035('0x7')](e)){var event=events[e];Dashboard[_0x5035('0x8')](e,emitEvent(event));}}module[_0x5035('0x9')]=DashboardEvents;