a4cc924d051464fff27531bb9fc1689ae3e2ad3b
[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 _0x533b=['hasOwnProperty','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','remove','emit'];(function(_0x19159d,_0x3d05c8){var _0x35884a=function(_0xe419f8){while(--_0xe419f8){_0x19159d['push'](_0x19159d['shift']());}};_0x35884a(++_0x3d05c8);}(_0x533b,0x1bb));var _0xb533=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x533b[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xb533('0x0'));var FaxAccount=require(_0xb533('0x1'))['db'][_0xb533('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xb533('0x3')](0x0);var events={'afterCreate':_0xb533('0x4'),'afterUpdate':'update','afterDestroy':_0xb533('0x5')};function emitEvent(_0x9c53b1){return function(_0x2c74c8,_0x10e24f,_0x25ea72){FaxAccountEvents[_0xb533('0x6')](_0x9c53b1+':'+_0x2c74c8['id'],_0x2c74c8);FaxAccountEvents[_0xb533('0x6')](_0x9c53b1,_0x2c74c8);_0x25ea72(null);};}for(var e in events){if(events[_0xb533('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xb533('0x8')]=FaxAccountEvents;