Built motion from commit (unavailable).|2.5.22
[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 _0x4325=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4325,0x1da));var _0x5432=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4325[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x5432('0x0'));var Plugin=require(_0x5432('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x5432('0x2')](0x0);var events={'afterCreate':_0x5432('0x3'),'afterUpdate':_0x5432('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4fc4e9){return function(_0x20f704,_0x36ce53,_0xad26e9){PluginEvents['emit'](_0x4fc4e9+':'+_0x20f704['id'],_0x20f704);PluginEvents[_0x5432('0x5')](_0x4fc4e9,_0x20f704);_0xad26e9(null);};}for(var e in events){if(events[_0x5432('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x5432('0x7')]=PluginEvents;