da485b868cd2108fce2af9e7291a2e653b41af43
[motion2.git] / server / api / smsAccount / smsAccount.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 _0x5dac=['events','../../mysqldb','SmsAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x29ae7f,_0x3a9178){var _0x1eea37=function(_0x1a2946){while(--_0x1a2946){_0x29ae7f['push'](_0x29ae7f['shift']());}};_0x1eea37(++_0x3a9178);}(_0x5dac,0x17c));var _0xc5da=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x5dac[_0x1ac595];return _0x455fff;};'use strict';var EventEmitter=require(_0xc5da('0x0'));var SmsAccount=require(_0xc5da('0x1'))['db'][_0xc5da('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xc5da('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc5da('0x4'),'afterDestroy':_0xc5da('0x5')};function emitEvent(_0x54504b){return function(_0x9a96b0,_0x271829,_0x2466dc){SmsAccountEvents[_0xc5da('0x6')](_0x54504b+':'+_0x9a96b0['id'],_0x9a96b0);SmsAccountEvents[_0xc5da('0x6')](_0x54504b,_0x9a96b0);_0x2466dc(null);};}for(var e in events){if(events[_0xc5da('0x7')](e)){var event=events[e];SmsAccount[_0xc5da('0x8')](e,emitEvent(event));}}module[_0xc5da('0x9')]=SmsAccountEvents;