3ac11f611344d9b017dec1765f777c88cc53966d
[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 _0x5046=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue'];(function(_0x65c903,_0x41e920){var _0x23e1d7=function(_0x4279cd){while(--_0x4279cd){_0x65c903['push'](_0x65c903['shift']());}};_0x23e1d7(++_0x41e920);}(_0x5046,0xb1));var _0x6504=function(_0x4288bd,_0x7382f8){_0x4288bd=_0x4288bd-0x0;var _0x2f740f=_0x5046[_0x4288bd];return _0x2f740f;};'use strict';var EventEmitter=require(_0x6504('0x0'));var VoiceQueue=require(_0x6504('0x1'))['db'][_0x6504('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x6504('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6504('0x4'),'afterDestroy':_0x6504('0x5')};function emitEvent(_0x1560f2){return function(_0x2872ed,_0x109aca,_0x968d30){VoiceQueueEvents[_0x6504('0x6')](_0x1560f2+':'+_0x2872ed['id'],_0x2872ed);VoiceQueueEvents[_0x6504('0x6')](_0x1560f2,_0x2872ed);_0x968d30(null);};}for(var e in events){if(events[_0x6504('0x7')](e)){var event=events[e];VoiceQueue[_0x6504('0x8')](e,emitEvent(event));}}module[_0x6504('0x9')]=VoiceQueueEvents;