9d07e741ddce05ac20027243b65bd7e07c097e26
[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 _0x112e=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceExtension','setMaxListeners','save'];(function(_0x2c1c86,_0xb5268b){var _0x127659=function(_0x598cbe){while(--_0x598cbe){_0x2c1c86['push'](_0x2c1c86['shift']());}};_0x127659(++_0xb5268b);}(_0x112e,0x16d));var _0xe112=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0x112e[_0x3bf925];return _0x2128a1;};'use strict';var EventEmitter=require(_0xe112('0x0'));var VoiceExtension=require(_0xe112('0x1'))['db'][_0xe112('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe112('0x3')](0x0);var events={'afterCreate':_0xe112('0x4'),'afterUpdate':_0xe112('0x5'),'afterDestroy':_0xe112('0x6')};function emitEvent(_0xeb6cfa){return function(_0x2a4280,_0x1f7817,_0x38ea52){VoiceExtensionEvents[_0xe112('0x7')](_0xeb6cfa+':'+_0x2a4280['id'],_0x2a4280);VoiceExtensionEvents[_0xe112('0x7')](_0xeb6cfa,_0x2a4280);_0x38ea52(null);};}for(var e in events){if(events[_0xe112('0x8')](e)){var event=events[e];VoiceExtension[_0xe112('0x9')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;