c8619a948fe91670423a370c7584291112d32b52
[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 _0xbbdd=['emit','exports','events','VoiceQueue','setMaxListeners','update'];(function(_0x17c5f7,_0x389980){var _0x57df8d=function(_0xd24535){while(--_0xd24535){_0x17c5f7['push'](_0x17c5f7['shift']());}};_0x57df8d(++_0x389980);}(_0xbbdd,0x194));var _0xdbbd=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xbbdd[_0x176329];return _0x31997c;};'use strict';var EventEmitter=require(_0xdbbd('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xdbbd('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xdbbd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdbbd('0x3'),'afterDestroy':'remove'};function emitEvent(_0x25f940){return function(_0x422439,_0x4b2e4c,_0x106e29){VoiceQueueEvents['emit'](_0x25f940+':'+_0x422439['id'],_0x422439);VoiceQueueEvents[_0xdbbd('0x4')](_0x25f940,_0x422439);_0x106e29(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xdbbd('0x5')]=VoiceQueueEvents;