Built motion from commit (unavailable).|2.5.14
[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 _0x3f43=['exports','events','../../mysqldb','CmList','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x242cbb,_0x22e98f){var _0x147ee6=function(_0x5ff58c){while(--_0x5ff58c){_0x242cbb['push'](_0x242cbb['shift']());}};_0x147ee6(++_0x22e98f);}(_0x3f43,0x16c));var _0x33f4=function(_0x53dd24,_0x30fef7){_0x53dd24=_0x53dd24-0x0;var _0x4cb5a6=_0x3f43[_0x53dd24];return _0x4cb5a6;};'use strict';var EventEmitter=require(_0x33f4('0x0'));var CmList=require(_0x33f4('0x1'))['db'][_0x33f4('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x33f4('0x3')](0x0);var events={'afterCreate':_0x33f4('0x4'),'afterUpdate':_0x33f4('0x5'),'afterDestroy':_0x33f4('0x6')};function emitEvent(_0x2bee9a){return function(_0x3cb73a,_0x4f6d31,_0x49d5ee){CmListEvents[_0x33f4('0x7')](_0x2bee9a+':'+_0x3cb73a['id'],_0x3cb73a);CmListEvents['emit'](_0x2bee9a,_0x3cb73a);_0x49d5ee(null);};}for(var e in events){if(events[_0x33f4('0x8')](e)){var event=events[e];CmList[_0x33f4('0x9')](e,emitEvent(event));}}module[_0x33f4('0xa')]=CmListEvents;