f07471ba8391dead0976e01072383ed3067f1460
[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 _0x7b6b=['update','remove','emit','hasOwnProperty','hook','events','VoiceExtension','setMaxListeners'];(function(_0x4f900a,_0x19c5ec){var _0x4dae94=function(_0x22d633){while(--_0x22d633){_0x4f900a['push'](_0x4f900a['shift']());}};_0x4dae94(++_0x19c5ec);}(_0x7b6b,0x105));var _0xb7b6=function(_0x13a9dd,_0x5362fd){_0x13a9dd=_0x13a9dd-0x0;var _0x1f1da9=_0x7b6b[_0x13a9dd];return _0x1f1da9;};'use strict';var EventEmitter=require(_0xb7b6('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xb7b6('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb7b6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb7b6('0x3'),'afterDestroy':_0xb7b6('0x4')};function emitEvent(_0x402e65){return function(_0x6bb422,_0x4811a7,_0x2b11e9){VoiceExtensionEvents[_0xb7b6('0x5')](_0x402e65+':'+_0x6bb422['id'],_0x6bb422);VoiceExtensionEvents[_0xb7b6('0x5')](_0x402e65,_0x6bb422);_0x2b11e9(null);};}for(var e in events){if(events[_0xb7b6('0x6')](e)){var event=events[e];VoiceExtension[_0xb7b6('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;