Built motion from commit (unavailable).|2.5.13
[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 _0xe13f=['emit','hasOwnProperty','exports','events','../../mysqldb','CmList','save','update','remove'];(function(_0x274ef7,_0x3d8e37){var _0x2ff6fa=function(_0xb3e0ad){while(--_0xb3e0ad){_0x274ef7['push'](_0x274ef7['shift']());}};_0x2ff6fa(++_0x3d8e37);}(_0xe13f,0x6f));var _0xfe13=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xe13f[_0x5783f4];return _0x28e380;};'use strict';var EventEmitter=require(_0xfe13('0x0'));var CmList=require(_0xfe13('0x1'))['db'][_0xfe13('0x2')];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfe13('0x3'),'afterUpdate':_0xfe13('0x4'),'afterDestroy':_0xfe13('0x5')};function emitEvent(_0x52feaa){return function(_0x4fea1a,_0x5a7380,_0x5023f9){CmListEvents[_0xfe13('0x6')](_0x52feaa+':'+_0x4fea1a['id'],_0x4fea1a);CmListEvents[_0xfe13('0x6')](_0x52feaa,_0x4fea1a);_0x5023f9(null);};}for(var e in events){if(events[_0xfe13('0x7')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0xfe13('0x8')]=CmListEvents;