Built motion from commit d5e4af8c.|2.6.23
[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 _0xf431=['hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','remove','emit'];(function(_0x1eb21a,_0x40a3a7){var _0x58f8f8=function(_0x3c0e9a){while(--_0x3c0e9a){_0x1eb21a['push'](_0x1eb21a['shift']());}};_0x58f8f8(++_0x40a3a7);}(_0xf431,0x1b2));var _0x1f43=function(_0x18e875,_0x54fff7){_0x18e875=_0x18e875-0x0;var _0x1643c6=_0xf431[_0x18e875];return _0x1643c6;};'use strict';var EventEmitter=require(_0x1f43('0x0'));var VoiceQueue=require(_0x1f43('0x1'))['db'][_0x1f43('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1f43('0x3')](0x0);var events={'afterCreate':_0x1f43('0x4'),'afterUpdate':'update','afterDestroy':_0x1f43('0x5')};function emitEvent(_0x84f11d){return function(_0x13ce10,_0x37ebb7,_0x376339){VoiceQueueEvents['emit'](_0x84f11d+':'+_0x13ce10['id'],_0x13ce10);VoiceQueueEvents[_0x1f43('0x6')](_0x84f11d,_0x13ce10);_0x376339(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x1f43('0x7')](e,emitEvent(event));}}module[_0x1f43('0x8')]=VoiceQueueEvents;