80cd47caeec09228bc1d86afffcf251b748408a5
[motion2.git] / server / api / userVoiceQueueRt / userVoiceQueueRt.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 _0x09cb=['hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','remove','emit'];(function(_0x48dbcf,_0x737191){var _0x5a4184=function(_0x131774){while(--_0x131774){_0x48dbcf['push'](_0x48dbcf['shift']());}};_0x5a4184(++_0x737191);}(_0x09cb,0x162));var _0xb09c=function(_0x532e92,_0x408a68){_0x532e92=_0x532e92-0x0;var _0x3ac2ce=_0x09cb[_0x532e92];return _0x3ac2ce;};'use strict';var EventEmitter=require(_0xb09c('0x0'));var UserVoiceQueueRt=require(_0xb09c('0x1'))['db'][_0xb09c('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xb09c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb09c('0x4')};function emitEvent(_0x4ac6e5){return function(_0xe3bc78,_0x5e4f56,_0x206bc5){UserVoiceQueueRtEvents[_0xb09c('0x5')](_0x4ac6e5+':'+_0xe3bc78['id'],_0xe3bc78);UserVoiceQueueRtEvents[_0xb09c('0x5')](_0x4ac6e5,_0xe3bc78);_0x206bc5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xb09c('0x6')](e,emitEvent(event));}}module[_0xb09c('0x7')]=UserVoiceQueueRtEvents;