Built motion from commit 5ae82ce5.|2.6.7
[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 _0x0654=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue'];(function(_0x283771,_0x3ba4bd){var _0x251945=function(_0x4fefcc){while(--_0x4fefcc){_0x283771['push'](_0x283771['shift']());}};_0x251945(++_0x3ba4bd);}(_0x0654,0x16f));var _0x4065=function(_0x5c7734,_0x5a2a10){_0x5c7734=_0x5c7734-0x0;var _0xdcee38=_0x0654[_0x5c7734];return _0xdcee38;};'use strict';var EventEmitter=require(_0x4065('0x0'));var VoiceQueue=require(_0x4065('0x1'))['db'][_0x4065('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x4065('0x3')](0x0);var events={'afterCreate':_0x4065('0x4'),'afterUpdate':_0x4065('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2e4225){return function(_0x1c7694,_0x4098ff,_0x470117){VoiceQueueEvents[_0x4065('0x6')](_0x2e4225+':'+_0x1c7694['id'],_0x1c7694);VoiceQueueEvents['emit'](_0x2e4225,_0x1c7694);_0x470117(null);};}for(var e in events){if(events[_0x4065('0x7')](e)){var event=events[e];VoiceQueue[_0x4065('0x8')](e,emitEvent(event));}}module[_0x4065('0x9')]=VoiceQueueEvents;