3b956d683f49e0d8696b5e74c369ad31572b5d30
[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 _0x9f23=['../../mysqldb','VoiceExtension','setMaxListeners','save','update','emit','hasOwnProperty','events'];(function(_0x5982a5,_0x3dc07b){var _0x159c80=function(_0x274c92){while(--_0x274c92){_0x5982a5['push'](_0x5982a5['shift']());}};_0x159c80(++_0x3dc07b);}(_0x9f23,0x1bf));var _0x39f2=function(_0x1e0963,_0x3096cc){_0x1e0963=_0x1e0963-0x0;var _0x3ef4b7=_0x9f23[_0x1e0963];return _0x3ef4b7;};'use strict';var EventEmitter=require(_0x39f2('0x0'));var VoiceExtension=require(_0x39f2('0x1'))['db'][_0x39f2('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x39f2('0x3')](0x0);var events={'afterCreate':_0x39f2('0x4'),'afterUpdate':_0x39f2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x181935){return function(_0x2599d9,_0x349896,_0x5a7066){VoiceExtensionEvents['emit'](_0x181935+':'+_0x2599d9['id'],_0x2599d9);VoiceExtensionEvents[_0x39f2('0x6')](_0x181935,_0x2599d9);_0x5a7066(null);};}for(var e in events){if(events[_0x39f2('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;