Built motion from commit c738b9ac.|2.6.25
[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 _0x018c=['hook','exports','events','../../mysqldb','Dashboard','update','emit','hasOwnProperty'];(function(_0x118cce,_0x302cef){var _0x1a1990=function(_0x6fef23){while(--_0x6fef23){_0x118cce['push'](_0x118cce['shift']());}};_0x1a1990(++_0x302cef);}(_0x018c,0xda));var _0xc018=function(_0x2ae5e9,_0x5708d3){_0x2ae5e9=_0x2ae5e9-0x0;var _0x26f39f=_0x018c[_0x2ae5e9];return _0x26f39f;};'use strict';var EventEmitter=require(_0xc018('0x0'));var Dashboard=require(_0xc018('0x1'))['db'][_0xc018('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc018('0x3'),'afterDestroy':'remove'};function emitEvent(_0x197c30){return function(_0x263935,_0x455c37,_0x210679){DashboardEvents['emit'](_0x197c30+':'+_0x263935['id'],_0x263935);DashboardEvents[_0xc018('0x4')](_0x197c30,_0x263935);_0x210679(null);};}for(var e in events){if(events[_0xc018('0x5')](e)){var event=events[e];Dashboard[_0xc018('0x6')](e,emitEvent(event));}}module[_0xc018('0x7')]=DashboardEvents;