Built motion from commit (unavailable).|2.3.8
[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 _0x09be=['save','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0x511f47,_0x5e6293){var _0x4a0a4f=function(_0x22d1af){while(--_0x22d1af){_0x511f47['push'](_0x511f47['shift']());}};_0x4a0a4f(++_0x5e6293);}(_0x09be,0x184));var _0xe09b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x09be[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var Team=require(_0xe09b('0x0'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xe09b('0x1')](0x0);var events={'afterCreate':_0xe09b('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5ac673){return function(_0x481855,_0x190438,_0x36a324){TeamEvents[_0xe09b('0x3')](_0x5ac673+':'+_0x481855['id'],_0x481855);TeamEvents['emit'](_0x5ac673,_0x481855);_0x36a324(null);};}for(var e in events){if(events[_0xe09b('0x4')](e)){var event=events[e];Team[_0xe09b('0x5')](e,emitEvent(event));}}module['exports']=TeamEvents;