Built motion from commit (unavailable).|2.5.14
[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 _0x5fdc=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','Plugin','setMaxListeners','save'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5fdc,0x127));var _0xc5fd=function(_0x486bd8,_0x4ea3e2){_0x486bd8=_0x486bd8-0x0;var _0x25c667=_0x5fdc[_0x486bd8];return _0x25c667;};'use strict';var EventEmitter=require(_0xc5fd('0x0'));var Plugin=require(_0xc5fd('0x1'))['db'][_0xc5fd('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xc5fd('0x3')](0x0);var events={'afterCreate':_0xc5fd('0x4'),'afterUpdate':_0xc5fd('0x5'),'afterDestroy':_0xc5fd('0x6')};function emitEvent(_0x4d015c){return function(_0xfdf928,_0x1b6205,_0xca27a0){PluginEvents[_0xc5fd('0x7')](_0x4d015c+':'+_0xfdf928['id'],_0xfdf928);PluginEvents[_0xc5fd('0x7')](_0x4d015c,_0xfdf928);_0xca27a0(null);};}for(var e in events){if(events[_0xc5fd('0x8')](e)){var event=events[e];Plugin[_0xc5fd('0x9')](e,emitEvent(event));}}module['exports']=PluginEvents;