Built motion from commit (unavailable).|2.6.0
[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 _0x77e6=['../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x2c5d18,_0x2ad80e){var _0x3fe914=function(_0x17f67d){while(--_0x17f67d){_0x2c5d18['push'](_0x2c5d18['shift']());}};_0x3fe914(++_0x2ad80e);}(_0x77e6,0x1a6));var _0x677e=function(_0x288930,_0x20dbf4){_0x288930=_0x288930-0x0;var _0x3407a9=_0x77e6[_0x288930];return _0x3407a9;};'use strict';var EventEmitter=require(_0x677e('0x0'));var Plugin=require(_0x677e('0x1'))['db'][_0x677e('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x677e('0x3')](0x0);var events={'afterCreate':_0x677e('0x4'),'afterUpdate':_0x677e('0x5'),'afterDestroy':_0x677e('0x6')};function emitEvent(_0x186923){return function(_0x50231c,_0x2f0307,_0x2560a6){PluginEvents['emit'](_0x186923+':'+_0x50231c['id'],_0x50231c);PluginEvents[_0x677e('0x7')](_0x186923,_0x50231c);_0x2560a6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x677e('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents;