Built motion from commit (unavailable).|2.5.15
[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 _0x4bb4=['hook','events','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0x4bb4,0x71));var _0x44bb=function(_0x9fdefe,_0x1dddf2){_0x9fdefe=_0x9fdefe-0x0;var _0x40048e=_0x4bb4[_0x9fdefe];return _0x40048e;};'use strict';var EventEmitter=require(_0x44bb('0x0'));var VoiceQueue=require(_0x44bb('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x44bb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x44bb('0x3')};function emitEvent(_0x8c75c){return function(_0x5c874b,_0x2b1e9b,_0x242a7a){VoiceQueueEvents[_0x44bb('0x4')](_0x8c75c+':'+_0x5c874b['id'],_0x5c874b);VoiceQueueEvents[_0x44bb('0x4')](_0x8c75c,_0x5c874b);_0x242a7a(null);};}for(var e in events){if(events[_0x44bb('0x5')](e)){var event=events[e];VoiceQueue[_0x44bb('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;