4260bd48c6be5c3206b0c1ab539a4915173e7f59
[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 _0x02d3=['hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x02d3,0x174));var _0x302d=function(_0x3070a5,_0xcf7f85){_0x3070a5=_0x3070a5-0x0;var _0x2ae47f=_0x02d3[_0x3070a5];return _0x2ae47f;};'use strict';var EventEmitter=require(_0x302d('0x0'));var UserVoiceQueueRt=require(_0x302d('0x1'))['db'][_0x302d('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x302d('0x3')](0x0);var events={'afterCreate':_0x302d('0x4'),'afterUpdate':_0x302d('0x5'),'afterDestroy':_0x302d('0x6')};function emitEvent(_0x3e0ba0){return function(_0x2028b4,_0x3afe3a,_0x351144){UserVoiceQueueRtEvents['emit'](_0x3e0ba0+':'+_0x2028b4['id'],_0x2028b4);UserVoiceQueueRtEvents['emit'](_0x3e0ba0,_0x2028b4);_0x351144(null);};}for(var e in events){if(events[_0x302d('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x302d('0x8')](e,emitEvent(event));}}module[_0x302d('0x9')]=UserVoiceQueueRtEvents;