d273f571c4ffee002d780062ac853fa6d4402538
[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 _0xfe11=['hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners','save','remove','emit'];(function(_0x3bf181,_0x217849){var _0x41eb54=function(_0x18fb4e){while(--_0x18fb4e){_0x3bf181['push'](_0x3bf181['shift']());}};_0x41eb54(++_0x217849);}(_0xfe11,0xda));var _0x1fe1=function(_0x2e09cf,_0x3e042f){_0x2e09cf=_0x2e09cf-0x0;var _0x251a4f=_0xfe11[_0x2e09cf];return _0x251a4f;};'use strict';var EventEmitter=require(_0x1fe1('0x0'));var VoicePrefix=require(_0x1fe1('0x1'))['db'][_0x1fe1('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x1fe1('0x3')](0x0);var events={'afterCreate':_0x1fe1('0x4'),'afterUpdate':'update','afterDestroy':_0x1fe1('0x5')};function emitEvent(_0x1e1f9d){return function(_0x4b33f0,_0x48f77f,_0x2e08a1){VoicePrefixEvents[_0x1fe1('0x6')](_0x1e1f9d+':'+_0x4b33f0['id'],_0x4b33f0);VoicePrefixEvents['emit'](_0x1e1f9d,_0x4b33f0);_0x2e08a1(null);};}for(var e in events){if(events[_0x1fe1('0x7')](e)){var event=events[e];VoicePrefix[_0x1fe1('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;