Built motion from commit (unavailable).|2.5.21
[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 _0x28ed=['events','../../mysqldb','VoiceExtension','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x28ed,0x17a));var _0xd28e=function(_0x35adc1,_0x248f1f){_0x35adc1=_0x35adc1-0x0;var _0x5befb4=_0x28ed[_0x35adc1];return _0x5befb4;};'use strict';var EventEmitter=require(_0xd28e('0x0'));var VoiceExtension=require(_0xd28e('0x1'))['db'][_0xd28e('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xd28e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd28e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x427545){return function(_0x20400a,_0x39a005,_0x4aa307){VoiceExtensionEvents[_0xd28e('0x5')](_0x427545+':'+_0x20400a['id'],_0x20400a);VoiceExtensionEvents[_0xd28e('0x5')](_0x427545,_0x20400a);_0x4aa307(null);};}for(var e in events){if(events[_0xd28e('0x6')](e)){var event=events[e];VoiceExtension[_0xd28e('0x7')](e,emitEvent(event));}}module[_0xd28e('0x8')]=VoiceExtensionEvents;