9a949aefade7dd0488eeb33dc57f5911f099c0c7
[motion2.git] / server / api / voicePrefix / voicePrefix.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 _0xbe2a=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','emit'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0xbe2a,0x10a));var _0xabe2=function(_0x562c21,_0x5b7fb5){_0x562c21=_0x562c21-0x0;var _0x4b143f=_0xbe2a[_0x562c21];return _0x4b143f;};'use strict';var EventEmitter=require(_0xabe2('0x0'));var VoicePrefix=require(_0xabe2('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xabe2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4e7ff6){return function(_0x39fa87,_0x468840,_0x31a0d3){VoicePrefixEvents[_0xabe2('0x3')](_0x4e7ff6+':'+_0x39fa87['id'],_0x39fa87);VoicePrefixEvents[_0xabe2('0x3')](_0x4e7ff6,_0x39fa87);_0x31a0d3(null);};}for(var e in events){if(events[_0xabe2('0x4')](e)){var event=events[e];VoicePrefix[_0xabe2('0x5')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;