577511ef044f3f554436f3b4af3af7e925cbb117
[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 _0x76ff=['hasOwnProperty','hook','exports','events','UserVoiceQueueRt','setMaxListeners','update','remove','emit'];(function(_0x210c66,_0x1acf96){var _0x2f66c3=function(_0x2f1b9f){while(--_0x2f1b9f){_0x210c66['push'](_0x210c66['shift']());}};_0x2f66c3(++_0x1acf96);}(_0x76ff,0x1f2));var _0xf76f=function(_0x78775,_0xf2c1b2){_0x78775=_0x78775-0x0;var _0x4d6552=_0x76ff[_0x78775];return _0x4d6552;};'use strict';var EventEmitter=require(_0xf76f('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xf76f('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xf76f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf76f('0x3'),'afterDestroy':_0xf76f('0x4')};function emitEvent(_0x1e68ad){return function(_0x5ab5ea,_0x5ef4a5,_0x5d0bfa){UserVoiceQueueRtEvents[_0xf76f('0x5')](_0x1e68ad+':'+_0x5ab5ea['id'],_0x5ab5ea);UserVoiceQueueRtEvents['emit'](_0x1e68ad,_0x5ab5ea);_0x5d0bfa(null);};}for(var e in events){if(events[_0xf76f('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xf76f('0x7')](e,emitEvent(event));}}module[_0xf76f('0x8')]=UserVoiceQueueRtEvents;