Built motion from commit (unavailable).|2.5.4
[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 _0x9797=['../../mysqldb','Dashboard','save','remove','emit','hasOwnProperty','exports'];(function(_0xbc2d9e,_0x40ef4f){var _0x2e315c=function(_0x57fc55){while(--_0x57fc55){_0xbc2d9e['push'](_0xbc2d9e['shift']());}};_0x2e315c(++_0x40ef4f);}(_0x9797,0x149));var _0x7979=function(_0xf4129c,_0x44fcf1){_0xf4129c=_0xf4129c-0x0;var _0x426611=_0x9797[_0xf4129c];return _0x426611;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x7979('0x0'))['db'][_0x7979('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7979('0x2'),'afterUpdate':'update','afterDestroy':_0x7979('0x3')};function emitEvent(_0x190833){return function(_0x4c4898,_0x5ee8b8,_0x56f3cd){DashboardEvents[_0x7979('0x4')](_0x190833+':'+_0x4c4898['id'],_0x4c4898);DashboardEvents[_0x7979('0x4')](_0x190833,_0x4c4898);_0x56f3cd(null);};}for(var e in events){if(events[_0x7979('0x5')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x7979('0x6')]=DashboardEvents;