Built motion from commit (unavailable).|2.5.6
[motion2.git] / server / api / userProfileSection / userProfileSection.rpc.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 _0xeb0b=['error','message','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3ac8e5,_0x287fe4){var _0x4388e1=function(_0x671446){while(--_0x671446){_0x3ac8e5['push'](_0x3ac8e5['shift']());}};_0x4388e1(++_0x287fe4);}(_0xeb0b,0x18e));var _0xbeb0=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xeb0b[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require(_0xbeb0('0x0'));var moment=require('moment');var BPromise=require(_0xbeb0('0x1'));var rs=require(_0xbeb0('0x2'));var fs=require('fs');var Redis=require(_0xbeb0('0x3'));var db=require(_0xbeb0('0x4'))['db'];var utils=require(_0xbeb0('0x5'));var logger=require(_0xbeb0('0x6'))(_0xbeb0('0x7'));var config=require(_0xbeb0('0x8'));var jayson=require(_0xbeb0('0x9'));var client=jayson[_0xbeb0('0xa')][_0xbeb0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x326887,_0x234f92,_0x8d4769){return new BPromise(function(_0x48a918,_0x5b3d47){return client[_0xbeb0('0xc')](_0x326887,_0x8d4769)[_0xbeb0('0xd')](function(_0x3f9376){logger[_0xbeb0('0xe')](_0xbeb0('0xf'),_0x234f92,_0xbeb0('0x10'));logger[_0xbeb0('0x11')](_0xbeb0('0x12'),_0x234f92,_0xbeb0('0x10'),JSON[_0xbeb0('0x13')](_0x3f9376));if(_0x3f9376['error']){if(_0x3f9376['error']['code']===0x1f4){logger['error'](_0xbeb0('0xf'),_0x234f92,_0x3f9376['error']['message']);return _0x5b3d47(_0x3f9376[_0xbeb0('0x14')][_0xbeb0('0x15')]);}logger[_0xbeb0('0x14')](_0xbeb0('0xf'),_0x234f92,_0x3f9376[_0xbeb0('0x14')][_0xbeb0('0x15')]);return _0x48a918(_0x3f9376[_0xbeb0('0x14')][_0xbeb0('0x15')]);}else{logger[_0xbeb0('0xe')](_0xbeb0('0xf'),_0x234f92,_0xbeb0('0x10'));_0x48a918(_0x3f9376['result']['message']);}})['catch'](function(_0x2e451e){logger[_0xbeb0('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x234f92,_0x2e451e);_0x5b3d47(_0x2e451e);});});}