Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / faxMessage / faxMessage.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 _0x3714=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x52b0b5,_0x2ced39){var _0x1a57cc=function(_0x5f3f46){while(--_0x5f3f46){_0x52b0b5['push'](_0x52b0b5['shift']());}};_0x1a57cc(++_0x2ced39);}(_0x3714,0x95));var _0x4371=function(_0x2a992b,_0x3dd1e0){_0x2a992b=_0x2a992b-0x0;var _0x44777c=_0x3714[_0x2a992b];return _0x44777c;};'use strict';var EventEmitter=require(_0x4371('0x0'));var FaxMessage=require(_0x4371('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x4371('0x2')](0x0);var events={'afterCreate':_0x4371('0x3'),'afterUpdate':_0x4371('0x4'),'afterDestroy':'remove'};function emitEvent(_0x21bccf){return function(_0x20929e,_0x2c0435,_0x5a2ffa){FaxMessageEvents[_0x4371('0x5')](_0x21bccf+':'+_0x20929e['id'],_0x20929e);FaxMessageEvents['emit'](_0x21bccf,_0x20929e);_0x5a2ffa(null);};}for(var e in events){if(events[_0x4371('0x6')](e)){var event=events[e];FaxMessage[_0x4371('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents;