Built motion from commit (unavailable).|2.5.23
[motion2.git] / server / api / plugin / plugin.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 _0x8e3f=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','Plugin','save','update'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8e3f[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0xf8e3('0x0'));var Plugin=require(_0xf8e3('0x1'))['db'][_0xf8e3('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf8e3('0x3'),'afterUpdate':_0xf8e3('0x4'),'afterDestroy':_0xf8e3('0x5')};function emitEvent(_0x598e9c){return function(_0x15d6ea,_0x41bc05,_0x4dab56){PluginEvents[_0xf8e3('0x6')](_0x598e9c+':'+_0x15d6ea['id'],_0x15d6ea);PluginEvents[_0xf8e3('0x6')](_0x598e9c,_0x15d6ea);_0x4dab56(null);};}for(var e in events){if(events[_0xf8e3('0x7')](e)){var event=events[e];Plugin[_0xf8e3('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents;