882e45679c3f07b2ac154276a294d06818c3d956
[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 _0x1441=['emit','hasOwnProperty','hook','exports','events','save','update'];(function(_0x594a5c,_0x357420){var _0x28fe3a=function(_0x1dd39b){while(--_0x1dd39b){_0x594a5c['push'](_0x594a5c['shift']());}};_0x28fe3a(++_0x357420);}(_0x1441,0x193));var _0x1144=function(_0x2389bc,_0x167cd2){_0x2389bc=_0x2389bc-0x0;var _0x170548=_0x1441[_0x2389bc];return _0x170548;};'use strict';var EventEmitter=require(_0x1144('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1144('0x1'),'afterUpdate':_0x1144('0x2'),'afterDestroy':'remove'};function emitEvent(_0xb43b28){return function(_0x177b47,_0x3f33bc,_0x259481){VoiceQueueEvents['emit'](_0xb43b28+':'+_0x177b47['id'],_0x177b47);VoiceQueueEvents[_0x1144('0x3')](_0xb43b28,_0x177b47);_0x259481(null);};}for(var e in events){if(events[_0x1144('0x4')](e)){var event=events[e];VoiceQueue[_0x1144('0x5')](e,emitEvent(event));}}module[_0x1144('0x6')]=VoiceQueueEvents;