Built motion from commit 85328c08.|2.5.50
[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 _0x0c0f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueue'];(function(_0x479037,_0x35dd00){var _0x544fa7=function(_0x387660){while(--_0x387660){_0x479037['push'](_0x479037['shift']());}};_0x544fa7(++_0x35dd00);}(_0x0c0f,0xbb));var _0xf0c0=function(_0x341c82,_0x1047b8){_0x341c82=_0x341c82-0x0;var _0x131333=_0x0c0f[_0x341c82];return _0x131333;};'use strict';var EventEmitter=require(_0xf0c0('0x0'));var VoiceQueue=require(_0xf0c0('0x1'))['db'][_0xf0c0('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xf0c0('0x3')](0x0);var events={'afterCreate':_0xf0c0('0x4'),'afterUpdate':_0xf0c0('0x5'),'afterDestroy':_0xf0c0('0x6')};function emitEvent(_0x1d833b){return function(_0x2ae17f,_0x348e28,_0x18a11d){VoiceQueueEvents[_0xf0c0('0x7')](_0x1d833b+':'+_0x2ae17f['id'],_0x2ae17f);VoiceQueueEvents[_0xf0c0('0x7')](_0x1d833b,_0x2ae17f);_0x18a11d(null);};}for(var e in events){if(events[_0xf0c0('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xf0c0('0x9')]=VoiceQueueEvents;