Built motion from commit 497d3d92.|2.5.43
[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 _0xd503=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x45fe9c,_0x55e0d7){var _0x233d48=function(_0xa2ba2e){while(--_0xa2ba2e){_0x45fe9c['push'](_0x45fe9c['shift']());}};_0x233d48(++_0x55e0d7);}(_0xd503,0x1f0));var _0x3d50=function(_0x251378,_0x1ac5ec){_0x251378=_0x251378-0x0;var _0x4019bf=_0xd503[_0x251378];return _0x4019bf;};'use strict';var EventEmitter=require(_0x3d50('0x0'));var VoiceQueue=require(_0x3d50('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x3d50('0x2')](0x0);var events={'afterCreate':_0x3d50('0x3'),'afterUpdate':_0x3d50('0x4'),'afterDestroy':_0x3d50('0x5')};function emitEvent(_0xb3e74f){return function(_0x2fdff8,_0x43020c,_0x3909ed){VoiceQueueEvents[_0x3d50('0x6')](_0xb3e74f+':'+_0x2fdff8['id'],_0x2fdff8);VoiceQueueEvents['emit'](_0xb3e74f,_0x2fdff8);_0x3909ed(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x3d50('0x7')](e,emitEvent(event));}}module[_0x3d50('0x8')]=VoiceQueueEvents;