9aa68ff2caaef7bad681f9b4074eb071b027493b
[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 _0x10a0=['setMaxListeners','save','update','emit','hasOwnProperty','hook','../../mysqldb','VoicePrefix'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x10a0,0x166));var _0x010a=function(_0x29d295,_0x130a9a){_0x29d295=_0x29d295-0x0;var _0x125c88=_0x10a0[_0x29d295];return _0x125c88;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x010a('0x0'))['db'][_0x010a('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x010a('0x2')](0x0);var events={'afterCreate':_0x010a('0x3'),'afterUpdate':_0x010a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x32c30e){return function(_0x26cb5b,_0x4e4492,_0x31e23e){VoicePrefixEvents[_0x010a('0x5')](_0x32c30e+':'+_0x26cb5b['id'],_0x26cb5b);VoicePrefixEvents[_0x010a('0x5')](_0x32c30e,_0x26cb5b);_0x31e23e(null);};}for(var e in events){if(events[_0x010a('0x6')](e)){var event=events[e];VoicePrefix[_0x010a('0x7')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;