a1e2bca3e67d2234e777be5f3c79b0d70ea6d709
[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 _0x2ede=['emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove'];(function(_0x62e12b,_0x13b0fa){var _0x530388=function(_0x28259e){while(--_0x28259e){_0x62e12b['push'](_0x62e12b['shift']());}};_0x530388(++_0x13b0fa);}(_0x2ede,0xea));var _0xe2ed=function(_0x5c6580,_0x3b1270){_0x5c6580=_0x5c6580-0x0;var _0x39225c=_0x2ede[_0x5c6580];return _0x39225c;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xe2ed('0x0'))['db'][_0xe2ed('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xe2ed('0x2')](0x0);var events={'afterCreate':_0xe2ed('0x3'),'afterUpdate':_0xe2ed('0x4'),'afterDestroy':_0xe2ed('0x5')};function emitEvent(_0x4ae4cc){return function(_0x401755,_0x54eca4,_0xa3e50f){VoiceQueueEvents[_0xe2ed('0x6')](_0x4ae4cc+':'+_0x401755['id'],_0x401755);VoiceQueueEvents['emit'](_0x4ae4cc,_0x401755);_0xa3e50f(null);};}for(var e in events){if(events[_0xe2ed('0x7')](e)){var event=events[e];VoiceQueue[_0xe2ed('0x8')](e,emitEvent(event));}}module[_0xe2ed('0x9')]=VoiceQueueEvents;