76c79eb2081e386351a027ed590153a5d465ff61
[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 _0xf14f=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue','setMaxListeners','update'];(function(_0x5eb780,_0x29ee53){var _0x479a83=function(_0x1a4e70){while(--_0x1a4e70){_0x5eb780['push'](_0x5eb780['shift']());}};_0x479a83(++_0x29ee53);}(_0xf14f,0x1e2));var _0xff14=function(_0xaaf2e2,_0x19d28a){_0xaaf2e2=_0xaaf2e2-0x0;var _0x28bc36=_0xf14f[_0xaaf2e2];return _0x28bc36;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xff14('0x0'))['db'][_0xff14('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xff14('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xff14('0x3'),'afterDestroy':_0xff14('0x4')};function emitEvent(_0x51c81e){return function(_0x2e3788,_0x242de6,_0x19a020){VoiceQueueEvents[_0xff14('0x5')](_0x51c81e+':'+_0x2e3788['id'],_0x2e3788);VoiceQueueEvents[_0xff14('0x5')](_0x51c81e,_0x2e3788);_0x19a020(null);};}for(var e in events){if(events[_0xff14('0x6')](e)){var event=events[e];VoiceQueue[_0xff14('0x7')](e,emitEvent(event));}}module[_0xff14('0x8')]=VoiceQueueEvents;