6fd8f13202da065b16ab36bd048106d19faefb8b
[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 _0x8600=['hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue','remove','emit'];(function(_0x2f2e0e,_0x21a555){var _0xe1467c=function(_0x59e5b1){while(--_0x59e5b1){_0x2f2e0e['push'](_0x2f2e0e['shift']());}};_0xe1467c(++_0x21a555);}(_0x8600,0x96));var _0x0860=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x8600[_0x17928f];return _0x500b63;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x0860('0x0'))['db'][_0x0860('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0860('0x2')};function emitEvent(_0x2c3a69){return function(_0x3a99d0,_0x4c9146,_0x5b727b){VoiceQueueEvents[_0x0860('0x3')](_0x2c3a69+':'+_0x3a99d0['id'],_0x3a99d0);VoiceQueueEvents[_0x0860('0x3')](_0x2c3a69,_0x3a99d0);_0x5b727b(null);};}for(var e in events){if(events[_0x0860('0x4')](e)){var event=events[e];VoiceQueue[_0x0860('0x5')](e,emitEvent(event));}}module[_0x0860('0x6')]=VoiceQueueEvents;