e6ef7e8e419ea126090bbe8b6be26ff772a181d4
[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 _0x0d21=['exports','events','../../mysqldb','VoiceQueue','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0d21,0x1c3));var _0x10d2=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x0d21[_0x4c7fb5];return _0x2e10ac;};'use strict';var EventEmitter=require(_0x10d2('0x0'));var VoiceQueue=require(_0x10d2('0x1'))['db'][_0x10d2('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x10d2('0x3'),'afterUpdate':_0x10d2('0x4'),'afterDestroy':_0x10d2('0x5')};function emitEvent(_0x241451){return function(_0x10384f,_0x3084c9,_0x257d74){VoiceQueueEvents[_0x10d2('0x6')](_0x241451+':'+_0x10384f['id'],_0x10384f);VoiceQueueEvents['emit'](_0x241451,_0x10384f);_0x257d74(null);};}for(var e in events){if(events[_0x10d2('0x7')](e)){var event=events[e];VoiceQueue[_0x10d2('0x8')](e,emitEvent(event));}}module[_0x10d2('0x9')]=VoiceQueueEvents;