5c3140f368fbd24d1266dac01326873b01c75090
[motion2.git] / server / api / userNotification / userNotification.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 _0xa715=['emit','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa715,0xcb));var _0x5a71=function(_0x23d116,_0x201fd8){_0x23d116=_0x23d116-0x0;var _0x45cc96=_0xa715[_0x23d116];return _0x45cc96;};'use strict';var EventEmitter=require(_0x5a71('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x5a71('0x1')](0x0);var events={'afterCreate':_0x5a71('0x2'),'afterUpdate':_0x5a71('0x3'),'afterDestroy':_0x5a71('0x4')};function emitEvent(_0x3b8b8b){return function(_0xbc24c4,_0x3b1316,_0x2b5af6){UserNotificationEvents[_0x5a71('0x5')](_0x3b8b8b+':'+_0xbc24c4['id'],_0xbc24c4);UserNotificationEvents[_0x5a71('0x5')](_0x3b8b8b,_0xbc24c4);_0x2b5af6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x5a71('0x6')](e,emitEvent(event));}}module[_0x5a71('0x7')]=UserNotificationEvents;