4ad062bb071110e6b6f6359ae28cc75f3ba69ada
[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 _0x6362=['../../mysqldb','setMaxListeners','update','emit','hook','exports','events'];(function(_0x8572ff,_0x5ad666){var _0x13738e=function(_0x57246e){while(--_0x57246e){_0x8572ff['push'](_0x8572ff['shift']());}};_0x13738e(++_0x5ad666);}(_0x6362,0xfb));var _0x2636=function(_0x38a8b,_0x51c7b2){_0x38a8b=_0x38a8b-0x0;var _0x2294f6=_0x6362[_0x38a8b];return _0x2294f6;};'use strict';var EventEmitter=require(_0x2636('0x0'));var VoiceQueue=require(_0x2636('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x2636('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2636('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4936f9){return function(_0x4a9a7a,_0x338fcb,_0x296098){VoiceQueueEvents[_0x2636('0x4')](_0x4936f9+':'+_0x4a9a7a['id'],_0x4a9a7a);VoiceQueueEvents[_0x2636('0x4')](_0x4936f9,_0x4a9a7a);_0x296098(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x2636('0x5')](e,emitEvent(event));}}module[_0x2636('0x6')]=VoiceQueueEvents;