Built motion from commit (unavailable).|2.5.30
[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 _0xac71=['update','remove','emit','hook','events','../../mysqldb','Dashboard','setMaxListeners','save'];(function(_0x5c57a0,_0x17455b){var _0x1a4a86=function(_0x25ad4d){while(--_0x25ad4d){_0x5c57a0['push'](_0x5c57a0['shift']());}};_0x1a4a86(++_0x17455b);}(_0xac71,0x79));var _0x1ac7=function(_0x2dea58,_0x59d6f0){_0x2dea58=_0x2dea58-0x0;var _0x2b23c2=_0xac71[_0x2dea58];return _0x2b23c2;};'use strict';var EventEmitter=require(_0x1ac7('0x0'));var Dashboard=require(_0x1ac7('0x1'))['db'][_0x1ac7('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x1ac7('0x3')](0x0);var events={'afterCreate':_0x1ac7('0x4'),'afterUpdate':_0x1ac7('0x5'),'afterDestroy':_0x1ac7('0x6')};function emitEvent(_0x244044){return function(_0x4786af,_0x42424d,_0x5163ee){DashboardEvents[_0x1ac7('0x7')](_0x244044+':'+_0x4786af['id'],_0x4786af);DashboardEvents['emit'](_0x244044,_0x4786af);_0x5163ee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x1ac7('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents;