9bf79aa7b7cfabb06340b73d6bb8ca03047cd239
[motion2.git] / server / api / voiceQueue / voiceQueue.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 _0x5328=['hook','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x1789c2,_0x2a99c1){var _0x4dfe76=function(_0x3a4e5c){while(--_0x3a4e5c){_0x1789c2['push'](_0x1789c2['shift']());}};_0x4dfe76(++_0x2a99c1);}(_0x5328,0x121));var _0x8532=function(_0x3f3117,_0x9074ba){_0x3f3117=_0x3f3117-0x0;var _0x5cdf22=_0x5328[_0x3f3117];return _0x5cdf22;};'use strict';var EventEmitter=require(_0x8532('0x0'));var VoiceQueue=require(_0x8532('0x1'))['db'][_0x8532('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x8532('0x3')](0x0);var events={'afterCreate':_0x8532('0x4'),'afterUpdate':_0x8532('0x5'),'afterDestroy':'remove'};function emitEvent(_0x21336c){return function(_0x220ca1,_0x460bf0,_0x3941cf){VoiceQueueEvents[_0x8532('0x6')](_0x21336c+':'+_0x220ca1['id'],_0x220ca1);VoiceQueueEvents['emit'](_0x21336c,_0x220ca1);_0x3941cf(null);};}for(var e in events){if(events[_0x8532('0x7')](e)){var event=events[e];VoiceQueue[_0x8532('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;