a2e1ee554030f3c3fbf8d1031803b7fbd2d02d34
[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 _0x0e6d=['../../mysqldb','CmList','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x0e6d,0xe6));var _0xd0e6=function(_0x1ec9d1,_0x35ecaf){_0x1ec9d1=_0x1ec9d1-0x0;var _0x4b6bc2=_0x0e6d[_0x1ec9d1];return _0x4b6bc2;};'use strict';var EventEmitter=require('events');var CmList=require(_0xd0e6('0x0'))['db'][_0xd0e6('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0xd0e6('0x2')](0x0);var events={'afterCreate':_0xd0e6('0x3'),'afterUpdate':_0xd0e6('0x4'),'afterDestroy':_0xd0e6('0x5')};function emitEvent(_0x59948a){return function(_0x10228b,_0x284e45,_0xdadc5e){CmListEvents[_0xd0e6('0x6')](_0x59948a+':'+_0x10228b['id'],_0x10228b);CmListEvents[_0xd0e6('0x6')](_0x59948a,_0x10228b);_0xdadc5e(null);};}for(var e in events){if(events[_0xd0e6('0x7')](e)){var event=events[e];CmList[_0xd0e6('0x8')](e,emitEvent(event));}}module[_0xd0e6('0x9')]=CmListEvents;