8dc1c9412c46e54b1c3abebafbd520e0611f0582
[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 _0x3d6d=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue'];(function(_0x3a671e,_0x488c49){var _0x272b58=function(_0x4a1fa0){while(--_0x4a1fa0){_0x3a671e['push'](_0x3a671e['shift']());}};_0x272b58(++_0x488c49);}(_0x3d6d,0x105));var _0xd3d6=function(_0x1ec7b0,_0x2eb52a){_0x1ec7b0=_0x1ec7b0-0x0;var _0x5aff54=_0x3d6d[_0x1ec7b0];return _0x5aff54;};'use strict';var EventEmitter=require(_0xd3d6('0x0'));var VoiceQueue=require(_0xd3d6('0x1'))['db'][_0xd3d6('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xd3d6('0x3')](0x0);var events={'afterCreate':_0xd3d6('0x4'),'afterUpdate':_0xd3d6('0x5'),'afterDestroy':_0xd3d6('0x6')};function emitEvent(_0x4f3de2){return function(_0x2a25a7,_0x40be57,_0x130e44){VoiceQueueEvents['emit'](_0x4f3de2+':'+_0x2a25a7['id'],_0x2a25a7);VoiceQueueEvents[_0xd3d6('0x7')](_0x4f3de2,_0x2a25a7);_0x130e44(null);};}for(var e in events){if(events[_0xd3d6('0x8')](e)){var event=events[e];VoiceQueue[_0xd3d6('0x9')](e,emitEvent(event));}}module[_0xd3d6('0xa')]=VoiceQueueEvents;