Built motion from commit (unavailable).|2.5.30
[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 _0x6743=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6743,0x168));var _0x3674=function(_0x24d711,_0x3cdb28){_0x24d711=_0x24d711-0x0;var _0x3491b4=_0x6743[_0x24d711];return _0x3491b4;};'use strict';var EventEmitter=require(_0x3674('0x0'));var VoiceQueue=require(_0x3674('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x3674('0x2')](0x0);var events={'afterCreate':_0x3674('0x3'),'afterUpdate':'update','afterDestroy':_0x3674('0x4')};function emitEvent(_0x584a01){return function(_0x577bf7,_0x37699e,_0xa836ae){VoiceQueueEvents['emit'](_0x584a01+':'+_0x577bf7['id'],_0x577bf7);VoiceQueueEvents[_0x3674('0x5')](_0x584a01,_0x577bf7);_0xa836ae(null);};}for(var e in events){if(events[_0x3674('0x6')](e)){var event=events[e];VoiceQueue[_0x3674('0x7')](e,emitEvent(event));}}module[_0x3674('0x8')]=VoiceQueueEvents;