Built motion from commit (unavailable).|2.5.15
[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 _0xaebd=['emit','hook','exports','events','Plugin','setMaxListeners','save','update','remove'];(function(_0x459483,_0x41e825){var _0x57ada8=function(_0x208acc){while(--_0x208acc){_0x459483['push'](_0x459483['shift']());}};_0x57ada8(++_0x41e825);}(_0xaebd,0x1e9));var _0xdaeb=function(_0xcf9647,_0x23773e){_0xcf9647=_0xcf9647-0x0;var _0x95b6c0=_0xaebd[_0xcf9647];return _0x95b6c0;};'use strict';var EventEmitter=require(_0xdaeb('0x0'));var Plugin=require('../../mysqldb')['db'][_0xdaeb('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xdaeb('0x2')](0x0);var events={'afterCreate':_0xdaeb('0x3'),'afterUpdate':_0xdaeb('0x4'),'afterDestroy':_0xdaeb('0x5')};function emitEvent(_0x4acd42){return function(_0x44e982,_0x1c617a,_0x1a99be){PluginEvents[_0xdaeb('0x6')](_0x4acd42+':'+_0x44e982['id'],_0x44e982);PluginEvents[_0xdaeb('0x6')](_0x4acd42,_0x44e982);_0x1a99be(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xdaeb('0x7')](e,emitEvent(event));}}module[_0xdaeb('0x8')]=PluginEvents;