Built motion from commit a8c4dd89.|2.6.33
[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 _0x48e6=['exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4e23d8,_0x1495d7){var _0x99d01b=function(_0x8be219){while(--_0x8be219){_0x4e23d8['push'](_0x4e23d8['shift']());}};_0x99d01b(++_0x1495d7);}(_0x48e6,0xdd));var _0x648e=function(_0x532556,_0x36817f){_0x532556=_0x532556-0x0;var _0x57815f=_0x48e6[_0x532556];return _0x57815f;};'use strict';var EventEmitter=require(_0x648e('0x0'));var VoiceQueue=require(_0x648e('0x1'))['db'][_0x648e('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x648e('0x3')](0x0);var events={'afterCreate':_0x648e('0x4'),'afterUpdate':_0x648e('0x5'),'afterDestroy':_0x648e('0x6')};function emitEvent(_0xcea1fc){return function(_0x23b1c4,_0x20a5f5,_0x1430fd){VoiceQueueEvents[_0x648e('0x7')](_0xcea1fc+':'+_0x23b1c4['id'],_0x23b1c4);VoiceQueueEvents[_0x648e('0x7')](_0xcea1fc,_0x23b1c4);_0x1430fd(null);};}for(var e in events){if(events[_0x648e('0x8')](e)){var event=events[e];VoiceQueue[_0x648e('0x9')](e,emitEvent(event));}}module[_0x648e('0xa')]=VoiceQueueEvents;