Built motion from commit 3d6333b4.|2.6.31
[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 _0x3dba=['../../mysqldb','VoiceQueue','setMaxListeners','save','update','emit','hook','events'];(function(_0x456114,_0x4de48d){var _0x1e79a9=function(_0x34c125){while(--_0x34c125){_0x456114['push'](_0x456114['shift']());}};_0x1e79a9(++_0x4de48d);}(_0x3dba,0xf7));var _0xa3db=function(_0x4d0ebd,_0x17ab0b){_0x4d0ebd=_0x4d0ebd-0x0;var _0x594e9c=_0x3dba[_0x4d0ebd];return _0x594e9c;};'use strict';var EventEmitter=require(_0xa3db('0x0'));var VoiceQueue=require(_0xa3db('0x1'))['db'][_0xa3db('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xa3db('0x3')](0x0);var events={'afterCreate':_0xa3db('0x4'),'afterUpdate':_0xa3db('0x5'),'afterDestroy':'remove'};function emitEvent(_0x51790f){return function(_0x41e753,_0x36bbda,_0x1df67b){VoiceQueueEvents[_0xa3db('0x6')](_0x51790f+':'+_0x41e753['id'],_0x41e753);VoiceQueueEvents[_0xa3db('0x6')](_0x51790f,_0x41e753);_0x1df67b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xa3db('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;