Built motion from commit (unavailable).|2.5.23
[motion2.git] / server / api / cmList / cmList.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 _0xc66e=['CmList','setMaxListeners','save','emit','hook','exports','../../mysqldb'];(function(_0x530816,_0x300403){var _0xb52865=function(_0x416a48){while(--_0x416a48){_0x530816['push'](_0x530816['shift']());}};_0xb52865(++_0x300403);}(_0xc66e,0xfb));var _0xec66=function(_0x20714a,_0x7de591){_0x20714a=_0x20714a-0x0;var _0x15e877=_0xc66e[_0x20714a];return _0x15e877;};'use strict';var EventEmitter=require('events');var CmList=require(_0xec66('0x0'))['db'][_0xec66('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0xec66('0x2')](0x0);var events={'afterCreate':_0xec66('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x56ea17){return function(_0x2cd6f8,_0x1b7c10,_0x3f09d2){CmListEvents[_0xec66('0x4')](_0x56ea17+':'+_0x2cd6f8['id'],_0x2cd6f8);CmListEvents['emit'](_0x56ea17,_0x2cd6f8);_0x3f09d2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xec66('0x5')](e,emitEvent(event));}}module[_0xec66('0x6')]=CmListEvents;