Built motion from commit (unavailable).|2.5.2
[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 _0x8fb3=['hook','exports','events','Team','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8fb3,0x13a));var _0x38fb=function(_0x20e332,_0x27c33c){_0x20e332=_0x20e332-0x0;var _0x225672=_0x8fb3[_0x20e332];return _0x225672;};'use strict';var EventEmitter=require(_0x38fb('0x0'));var Team=require('../../mysqldb')['db'][_0x38fb('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x38fb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x38fb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x48d4ce){return function(_0x14719b,_0x4bf249,_0x136dab){TeamEvents[_0x38fb('0x4')](_0x48d4ce+':'+_0x14719b['id'],_0x14719b);TeamEvents[_0x38fb('0x4')](_0x48d4ce,_0x14719b);_0x136dab(null);};}for(var e in events){if(events[_0x38fb('0x5')](e)){var event=events[e];Team[_0x38fb('0x6')](e,emitEvent(event));}}module[_0x38fb('0x7')]=TeamEvents;