7366d81e7282a43b4030304f5a54e134aa8c5cd3
[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 _0x51db=['exports','events','../../mysqldb','Dashboard','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x1f1596,_0x402318){var _0x24e1b1=function(_0xe64c9){while(--_0xe64c9){_0x1f1596['push'](_0x1f1596['shift']());}};_0x24e1b1(++_0x402318);}(_0x51db,0xb5));var _0xb51d=function(_0x1f69bc,_0xaffd71){_0x1f69bc=_0x1f69bc-0x0;var _0x1ac3c5=_0x51db[_0x1f69bc];return _0x1ac3c5;};'use strict';var EventEmitter=require(_0xb51d('0x0'));var Dashboard=require(_0xb51d('0x1'))['db'][_0xb51d('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xb51d('0x3')](0x0);var events={'afterCreate':_0xb51d('0x4'),'afterUpdate':_0xb51d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5621ca){return function(_0x2ec883,_0x1e541a,_0x3296b5){DashboardEvents[_0xb51d('0x6')](_0x5621ca+':'+_0x2ec883['id'],_0x2ec883);DashboardEvents[_0xb51d('0x6')](_0x5621ca,_0x2ec883);_0x3296b5(null);};}for(var e in events){if(events[_0xb51d('0x7')](e)){var event=events[e];Dashboard[_0xb51d('0x8')](e,emitEvent(event));}}module[_0xb51d('0x9')]=DashboardEvents;