a4ec7b16964f20a249a17b0967159e215affb248
[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 _0x25cf=['events','../../mysqldb','SmsAccount','save','update','emit','hook','exports'];(function(_0x222dad,_0x8c14be){var _0xf3791d=function(_0xfe1f97){while(--_0xfe1f97){_0x222dad['push'](_0x222dad['shift']());}};_0xf3791d(++_0x8c14be);}(_0x25cf,0x1e0));var _0xf25c=function(_0x37fa4f,_0x379eb2){_0x37fa4f=_0x37fa4f-0x0;var _0x17133f=_0x25cf[_0x37fa4f];return _0x17133f;};'use strict';var EventEmitter=require(_0xf25c('0x0'));var SmsAccount=require(_0xf25c('0x1'))['db'][_0xf25c('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf25c('0x3'),'afterUpdate':_0xf25c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x491151){return function(_0x2c4804,_0x274958,_0x2a612e){SmsAccountEvents['emit'](_0x491151+':'+_0x2c4804['id'],_0x2c4804);SmsAccountEvents[_0xf25c('0x5')](_0x491151,_0x2c4804);_0x2a612e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xf25c('0x6')](e,emitEvent(event));}}module[_0xf25c('0x7')]=SmsAccountEvents;