e7c77ae3025ea402ddaf924af930a2f0312df66e
[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 _0x05a8=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','update','remove','emit'];(function(_0xa75c23,_0x5131c0){var _0x3a07c8=function(_0x252b43){while(--_0x252b43){_0xa75c23['push'](_0xa75c23['shift']());}};_0x3a07c8(++_0x5131c0);}(_0x05a8,0xb7));var _0x805a=function(_0x38b601,_0x1e4c48){_0x38b601=_0x38b601-0x0;var _0x55ff0d=_0x05a8[_0x38b601];return _0x55ff0d;};'use strict';var EventEmitter=require(_0x805a('0x0'));var VoiceQueue=require(_0x805a('0x1'))['db'][_0x805a('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x805a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x805a('0x4'),'afterDestroy':_0x805a('0x5')};function emitEvent(_0x1d418f){return function(_0x27b762,_0x26d857,_0x5e0255){VoiceQueueEvents['emit'](_0x1d418f+':'+_0x27b762['id'],_0x27b762);VoiceQueueEvents[_0x805a('0x6')](_0x1d418f,_0x27b762);_0x5e0255(null);};}for(var e in events){if(events[_0x805a('0x7')](e)){var event=events[e];VoiceQueue[_0x805a('0x8')](e,emitEvent(event));}}module[_0x805a('0x9')]=VoiceQueueEvents;