Built motion from commit eddce310.|2.6.12
[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 _0xd38e=['emit','hasOwnProperty','hook','events','Dashboard','setMaxListeners','save','update','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd38e,0x17d));var _0xed38=function(_0x492061,_0x571d68){_0x492061=_0x492061-0x0;var _0x46f22a=_0xd38e[_0x492061];return _0x46f22a;};'use strict';var EventEmitter=require(_0xed38('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xed38('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xed38('0x2')](0x0);var events={'afterCreate':_0xed38('0x3'),'afterUpdate':_0xed38('0x4'),'afterDestroy':_0xed38('0x5')};function emitEvent(_0x5b48d4){return function(_0x17e1e5,_0x45062f,_0x273ae1){DashboardEvents['emit'](_0x5b48d4+':'+_0x17e1e5['id'],_0x17e1e5);DashboardEvents[_0xed38('0x6')](_0x5b48d4,_0x17e1e5);_0x273ae1(null);};}for(var e in events){if(events[_0xed38('0x7')](e)){var event=events[e];Dashboard[_0xed38('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents;