9bf4e5859489facfeb842c48f75726a258c2503f
[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 _0xd9bb=['update','emit','hasOwnProperty','exports','../../mysqldb','VoicePrefix','save'];(function(_0x3b91ed,_0x3cd0e2){var _0x1c30e6=function(_0x552e06){while(--_0x552e06){_0x3b91ed['push'](_0x3b91ed['shift']());}};_0x1c30e6(++_0x3cd0e2);}(_0xd9bb,0x193));var _0xbd9b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd9bb[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xbd9b('0x0'))['db'][_0xbd9b('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbd9b('0x2'),'afterUpdate':_0xbd9b('0x3'),'afterDestroy':'remove'};function emitEvent(_0xd6a8a2){return function(_0x49a590,_0x22ee86,_0x152293){VoicePrefixEvents[_0xbd9b('0x4')](_0xd6a8a2+':'+_0x49a590['id'],_0x49a590);VoicePrefixEvents[_0xbd9b('0x4')](_0xd6a8a2,_0x49a590);_0x152293(null);};}for(var e in events){if(events[_0xbd9b('0x5')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xbd9b('0x6')]=VoicePrefixEvents;