b10a425592880ee9fdc471ce1e14b71bc5557d4f
[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 _0x21a1=['hook','exports','events','../../mysqldb','VoicePrefix','update','emit','hasOwnProperty'];(function(_0x206210,_0x48193b){var _0x3aab18=function(_0x21207a){while(--_0x21207a){_0x206210['push'](_0x206210['shift']());}};_0x3aab18(++_0x48193b);}(_0x21a1,0xaa));var _0x121a=function(_0x384171,_0x65c8e2){_0x384171=_0x384171-0x0;var _0x5be6fb=_0x21a1[_0x384171];return _0x5be6fb;};'use strict';var EventEmitter=require(_0x121a('0x0'));var VoicePrefix=require(_0x121a('0x1'))['db'][_0x121a('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x121a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5609f5){return function(_0x578b0b,_0x33ec04,_0x1f9371){VoicePrefixEvents[_0x121a('0x4')](_0x5609f5+':'+_0x578b0b['id'],_0x578b0b);VoicePrefixEvents[_0x121a('0x4')](_0x5609f5,_0x578b0b);_0x1f9371(null);};}for(var e in events){if(events[_0x121a('0x5')](e)){var event=events[e];VoicePrefix[_0x121a('0x6')](e,emitEvent(event));}}module[_0x121a('0x7')]=VoicePrefixEvents;