1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0xfff0=['hook','../../mysqldb','Plugin','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x142d66,_0x259f70){var _0x1ef607=function(_0x266000){while(--_0x266000){_0x142d66['push'](_0x142d66['shift']());}};_0x1ef607(++_0x259f70);}(_0xfff0,0x139));var _0x0fff=function(_0x2755f9,_0x16d589){_0x2755f9=_0x2755f9-0x0;var _0x23ef28=_0xfff0[_0x2755f9];return _0x23ef28;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x0fff('0x0'))['db'][_0x0fff('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x0fff('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0fff('0x3'),'afterDestroy':_0x0fff('0x4')};function emitEvent(_0x266f43){return function(_0x4bec60,_0x2cd3d5,_0x17911e){PluginEvents['emit'](_0x266f43+':'+_0x4bec60['id'],_0x4bec60);PluginEvents[_0x0fff('0x5')](_0x266f43,_0x4bec60);_0x17911e(null);};}for(var e in events){if(events[_0x0fff('0x6')](e)){var event=events[e];Plugin[_0x0fff('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents;