cebeb985916055e3078ffc3a551b11fae2d887a7
[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 _0x1f29=['hook','exports','../../mysqldb','UserNotification','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x39a536,_0x4c7a40){var _0x12eb94=function(_0xf513eb){while(--_0xf513eb){_0x39a536['push'](_0x39a536['shift']());}};_0x12eb94(++_0x4c7a40);}(_0x1f29,0xec));var _0x91f2=function(_0x5463db,_0x292347){_0x5463db=_0x5463db-0x0;var _0x36f44c=_0x1f29[_0x5463db];return _0x36f44c;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x91f2('0x0'))['db'][_0x91f2('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x91f2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x91f2('0x3'),'afterDestroy':_0x91f2('0x4')};function emitEvent(_0x4b403c){return function(_0x130496,_0x45fa10,_0x4cc306){UserNotificationEvents[_0x91f2('0x5')](_0x4b403c+':'+_0x130496['id'],_0x130496);UserNotificationEvents[_0x91f2('0x5')](_0x4b403c,_0x130496);_0x4cc306(null);};}for(var e in events){if(events[_0x91f2('0x6')](e)){var event=events[e];UserNotification[_0x91f2('0x7')](e,emitEvent(event));}}module[_0x91f2('0x8')]=UserNotificationEvents;