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 _0xce22=['events','../../mysqldb','Plugin','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0xa7de0e,_0x22ae8d){var _0x508b97=function(_0x1e9f2d){while(--_0x1e9f2d){_0xa7de0e['push'](_0xa7de0e['shift']());}};_0x508b97(++_0x22ae8d);}(_0xce22,0xea));var _0x2ce2=function(_0xcc61ed,_0xaa2193){_0xcc61ed=_0xcc61ed-0x0;var _0x4eee8=_0xce22[_0xcc61ed];return _0x4eee8;};'use strict';var EventEmitter=require(_0x2ce2('0x0'));var Plugin=require(_0x2ce2('0x1'))['db'][_0x2ce2('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x2ce2('0x3')](0x0);var events={'afterCreate':_0x2ce2('0x4'),'afterUpdate':'update','afterDestroy':_0x2ce2('0x5')};function emitEvent(_0x5bc506){return function(_0x26b273,_0x1801be,_0x470a06){PluginEvents[_0x2ce2('0x6')](_0x5bc506+':'+_0x26b273['id'],_0x26b273);PluginEvents[_0x2ce2('0x6')](_0x5bc506,_0x26b273);_0x470a06(null);};}for(var e in events){if(events[_0x2ce2('0x7')](e)){var event=events[e];Plugin[_0x2ce2('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents;