cad6690c97fa15857a472417912f934c89c589ef
[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 _0xf9cd=['hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit'];(function(_0x1ec3ba,_0x8686df){var _0x2029c7=function(_0x48c5e1){while(--_0x48c5e1){_0x1ec3ba['push'](_0x1ec3ba['shift']());}};_0x2029c7(++_0x8686df);}(_0xf9cd,0x106));var _0xdf9c=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xf9cd[_0x51020b];return _0x371e47;};'use strict';var EventEmitter=require(_0xdf9c('0x0'));var VoiceQueue=require(_0xdf9c('0x1'))['db'][_0xdf9c('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xdf9c('0x3')](0x0);var events={'afterCreate':_0xdf9c('0x4'),'afterUpdate':_0xdf9c('0x5'),'afterDestroy':_0xdf9c('0x6')};function emitEvent(_0x52e873){return function(_0x15b930,_0x207ba5,_0x1e716d){VoiceQueueEvents[_0xdf9c('0x7')](_0x52e873+':'+_0x15b930['id'],_0x15b930);VoiceQueueEvents[_0xdf9c('0x7')](_0x52e873,_0x15b930);_0x1e716d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xdf9c('0x8')](e,emitEvent(event));}}module[_0xdf9c('0x9')]=VoiceQueueEvents;