Built motion from commit 3e059bc2.|2.5.32
[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 _0xccc0=['VoiceQueue','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x137c34,_0x2ebd98){var _0x145d9b=function(_0x1b7701){while(--_0x1b7701){_0x137c34['push'](_0x137c34['shift']());}};_0x145d9b(++_0x2ebd98);}(_0xccc0,0x1a2));var _0x0ccc=function(_0xf68c69,_0x5b6a37){_0xf68c69=_0xf68c69-0x0;var _0x26dba9=_0xccc0[_0xf68c69];return _0x26dba9;};'use strict';var EventEmitter=require(_0x0ccc('0x0'));var VoiceQueue=require(_0x0ccc('0x1'))['db'][_0x0ccc('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0ccc('0x3'),'afterUpdate':_0x0ccc('0x4'),'afterDestroy':_0x0ccc('0x5')};function emitEvent(_0x557581){return function(_0x281a0c,_0x190e0e,_0x10bfc2){VoiceQueueEvents['emit'](_0x557581+':'+_0x281a0c['id'],_0x281a0c);VoiceQueueEvents[_0x0ccc('0x6')](_0x557581,_0x281a0c);_0x10bfc2(null);};}for(var e in events){if(events[_0x0ccc('0x7')](e)){var event=events[e];VoiceQueue[_0x0ccc('0x8')](e,emitEvent(event));}}module[_0x0ccc('0x9')]=VoiceQueueEvents;