c60c76a6574d7dc99615998bcedd790d1fd96841
[motion2.git] / server / api / faxAccount / faxAccount.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 _0x82f4=['save','remove','emit','hasOwnProperty','events','../../mysqldb','FaxAccount','setMaxListeners'];(function(_0x1b8f6f,_0x3dacc0){var _0x15410d=function(_0x1071d1){while(--_0x1071d1){_0x1b8f6f['push'](_0x1b8f6f['shift']());}};_0x15410d(++_0x3dacc0);}(_0x82f4,0x144));var _0x482f=function(_0x244694,_0x4c866f){_0x244694=_0x244694-0x0;var _0x282042=_0x82f4[_0x244694];return _0x282042;};'use strict';var EventEmitter=require(_0x482f('0x0'));var FaxAccount=require(_0x482f('0x1'))['db'][_0x482f('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x482f('0x3')](0x0);var events={'afterCreate':_0x482f('0x4'),'afterUpdate':'update','afterDestroy':_0x482f('0x5')};function emitEvent(_0x387ea8){return function(_0x25eb56,_0x22e0ca,_0x314b38){FaxAccountEvents[_0x482f('0x6')](_0x387ea8+':'+_0x25eb56['id'],_0x25eb56);FaxAccountEvents['emit'](_0x387ea8,_0x25eb56);_0x314b38(null);};}for(var e in events){if(events[_0x482f('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module['exports']=FaxAccountEvents;