Built motion from commit 449495f6.|2.6.27
[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 _0xdb5c=['events','../../mysqldb','VoiceQueue','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x6ac0f1,_0x3ea2be){var _0x50c158=function(_0x2005b2){while(--_0x2005b2){_0x6ac0f1['push'](_0x6ac0f1['shift']());}};_0x50c158(++_0x3ea2be);}(_0xdb5c,0x183));var _0xcdb5=function(_0x2664f5,_0x525781){_0x2664f5=_0x2664f5-0x0;var _0x2acd10=_0xdb5c[_0x2664f5];return _0x2acd10;};'use strict';var EventEmitter=require(_0xcdb5('0x0'));var VoiceQueue=require(_0xcdb5('0x1'))['db'][_0xcdb5('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcdb5('0x3'),'afterUpdate':_0xcdb5('0x4'),'afterDestroy':_0xcdb5('0x5')};function emitEvent(_0x39c405){return function(_0x26661a,_0x2017d5,_0x839c7c){VoiceQueueEvents[_0xcdb5('0x6')](_0x39c405+':'+_0x26661a['id'],_0x26661a);VoiceQueueEvents['emit'](_0x39c405,_0x26661a);_0x839c7c(null);};}for(var e in events){if(events[_0xcdb5('0x7')](e)){var event=events[e];VoiceQueue[_0xcdb5('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;