a134e57fcf57752fcfb99b55c0127254135f0d1c
[motion2.git] / server / api / voiceExtension / voiceExtension.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 _0x63cd=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x497fae,_0x1b9e83){var _0x460595=function(_0x1e0001){while(--_0x1e0001){_0x497fae['push'](_0x497fae['shift']());}};_0x460595(++_0x1b9e83);}(_0x63cd,0xeb));var _0xd63c=function(_0x205cf3,_0x3c5321){_0x205cf3=_0x205cf3-0x0;var _0x1dd37a=_0x63cd[_0x205cf3];return _0x1dd37a;};'use strict';var EventEmitter=require(_0xd63c('0x0'));var VoiceExtension=require(_0xd63c('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xd63c('0x2')](0x0);var events={'afterCreate':_0xd63c('0x3'),'afterUpdate':_0xd63c('0x4'),'afterDestroy':_0xd63c('0x5')};function emitEvent(_0x513b95){return function(_0x4e112b,_0x1b57d1,_0x27409b){VoiceExtensionEvents[_0xd63c('0x6')](_0x513b95+':'+_0x4e112b['id'],_0x4e112b);VoiceExtensionEvents[_0xd63c('0x6')](_0x513b95,_0x4e112b);_0x27409b(null);};}for(var e in events){if(events[_0xd63c('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xd63c('0x8')]=VoiceExtensionEvents;