06a090bf1502d62d516d7d00c12720e1b967d9a4
[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 _0x833e=['events','../../mysqldb','VoiceExtension','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1e9300,_0x1cd496){var _0x39573d=function(_0x327de2){while(--_0x327de2){_0x1e9300['push'](_0x1e9300['shift']());}};_0x39573d(++_0x1cd496);}(_0x833e,0x104));var _0xe833=function(_0x228ed3,_0x2eb76a){_0x228ed3=_0x228ed3-0x0;var _0x4f3da3=_0x833e[_0x228ed3];return _0x4f3da3;};'use strict';var EventEmitter=require(_0xe833('0x0'));var VoiceExtension=require(_0xe833('0x1'))['db'][_0xe833('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe833('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe833('0x4'),'afterDestroy':_0xe833('0x5')};function emitEvent(_0x5252bc){return function(_0x53e0f4,_0x9b7d6e,_0x5c59af){VoiceExtensionEvents['emit'](_0x5252bc+':'+_0x53e0f4['id'],_0x53e0f4);VoiceExtensionEvents[_0xe833('0x6')](_0x5252bc,_0x53e0f4);_0x5c59af(null);};}for(var e in events){if(events[_0xe833('0x7')](e)){var event=events[e];VoiceExtension[_0xe833('0x8')](e,emitEvent(event));}}module[_0xe833('0x9')]=VoiceExtensionEvents;