4bc9c9413ef809464dd2811dc08a6fe641e0e8c6
[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 _0x33de=['exports','events','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x9737f6,_0x3fee5b){var _0x3f4f67=function(_0x11cfaf){while(--_0x11cfaf){_0x9737f6['push'](_0x9737f6['shift']());}};_0x3f4f67(++_0x3fee5b);}(_0x33de,0x10f));var _0xe33d=function(_0x173465,_0x3e4f73){_0x173465=_0x173465-0x0;var _0x5d3808=_0x33de[_0x173465];return _0x5d3808;};'use strict';var EventEmitter=require(_0xe33d('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xe33d('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe33d('0x2')](0x0);var events={'afterCreate':_0xe33d('0x3'),'afterUpdate':_0xe33d('0x4'),'afterDestroy':_0xe33d('0x5')};function emitEvent(_0x271d18){return function(_0x2e7814,_0x1bc8bc,_0x1217ff){VoiceExtensionEvents[_0xe33d('0x6')](_0x271d18+':'+_0x2e7814['id'],_0x2e7814);VoiceExtensionEvents[_0xe33d('0x6')](_0x271d18,_0x2e7814);_0x1217ff(null);};}for(var e in events){if(events[_0xe33d('0x7')](e)){var event=events[e];VoiceExtension[_0xe33d('0x8')](e,emitEvent(event));}}module[_0xe33d('0x9')]=VoiceExtensionEvents;