b77bbdc20eb2508efcd7905e286b29f289a72bf7
[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 _0x7ea2=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x4c84c9,_0x4d200e){var _0x3707fd=function(_0x19113a){while(--_0x19113a){_0x4c84c9['push'](_0x4c84c9['shift']());}};_0x3707fd(++_0x4d200e);}(_0x7ea2,0x8c));var _0x27ea=function(_0x20118a,_0x3dbdf3){_0x20118a=_0x20118a-0x0;var _0x538b5f=_0x7ea2[_0x20118a];return _0x538b5f;};'use strict';var EventEmitter=require(_0x27ea('0x0'));var VoiceExtension=require(_0x27ea('0x1'))['db'][_0x27ea('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x27ea('0x3')](0x0);var events={'afterCreate':_0x27ea('0x4'),'afterUpdate':_0x27ea('0x5'),'afterDestroy':_0x27ea('0x6')};function emitEvent(_0x320ace){return function(_0xa3f55e,_0x30c627,_0x25ea53){VoiceExtensionEvents[_0x27ea('0x7')](_0x320ace+':'+_0xa3f55e['id'],_0xa3f55e);VoiceExtensionEvents[_0x27ea('0x7')](_0x320ace,_0xa3f55e);_0x25ea53(null);};}for(var e in events){if(events[_0x27ea('0x8')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;