8f080c1243ae4414a622988eb94c6259338d0dc4
[motion2.git] / server / api / team / team.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 _0x42ae=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team'];(function(_0x5b9a8c,_0x195ce5){var _0x28c63a=function(_0x9121b4){while(--_0x9121b4){_0x5b9a8c['push'](_0x5b9a8c['shift']());}};_0x28c63a(++_0x195ce5);}(_0x42ae,0x1b5));var _0xe42a=function(_0x49d7ca,_0x514fc4){_0x49d7ca=_0x49d7ca-0x0;var _0x12422f=_0x42ae[_0x49d7ca];return _0x12422f;};'use strict';var EventEmitter=require(_0xe42a('0x0'));var Team=require(_0xe42a('0x1'))['db'][_0xe42a('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xe42a('0x3')](0x0);var events={'afterCreate':_0xe42a('0x4'),'afterUpdate':_0xe42a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x980cfe){return function(_0xafe1ec,_0x5bd50d,_0x104399){TeamEvents[_0xe42a('0x6')](_0x980cfe+':'+_0xafe1ec['id'],_0xafe1ec);TeamEvents[_0xe42a('0x6')](_0x980cfe,_0xafe1ec);_0x104399(null);};}for(var e in events){if(events[_0xe42a('0x7')](e)){var event=events[e];Team[_0xe42a('0x8')](e,emitEvent(event));}}module[_0xe42a('0x9')]=TeamEvents;