Built motion from commit e6806ed6.|2.6.0
[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 _0xc9a8=['exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0xc9a8,0x1eb));var _0x8c9a=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0xc9a8[_0x39c734];return _0xb2a2f9;};'use strict';var EventEmitter=require(_0x8c9a('0x0'));var VoiceQueue=require(_0x8c9a('0x1'))['db'][_0x8c9a('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x8c9a('0x3')](0x0);var events={'afterCreate':_0x8c9a('0x4'),'afterUpdate':'update','afterDestroy':_0x8c9a('0x5')};function emitEvent(_0x1abccf){return function(_0x3baebf,_0x4d51fb,_0x7d24b0){VoiceQueueEvents[_0x8c9a('0x6')](_0x1abccf+':'+_0x3baebf['id'],_0x3baebf);VoiceQueueEvents[_0x8c9a('0x6')](_0x1abccf,_0x3baebf);_0x7d24b0(null);};}for(var e in events){if(events[_0x8c9a('0x7')](e)){var event=events[e];VoiceQueue[_0x8c9a('0x8')](e,emitEvent(event));}}module[_0x8c9a('0x9')]=VoiceQueueEvents;