Built motion from commit 980b26c3.|2.6.29
[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 _0x51ca=['UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','UserProfileSection,\x20%s,\x20%s','request\x20sent'];(function(_0x598475,_0x4405d2){var _0x304ec2=function(_0xc8cb7b){while(--_0xc8cb7b){_0x598475['push'](_0x598475['shift']());}};_0x304ec2(++_0x4405d2);}(_0x51ca,0x1be));var _0xa51c=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x51ca[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0xa51c('0x0'));var util=require(_0xa51c('0x1'));var moment=require(_0xa51c('0x2'));var BPromise=require(_0xa51c('0x3'));var rs=require(_0xa51c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa51c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa51c('0x6'))(_0xa51c('0x7'));var config=require(_0xa51c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa51c('0x9')][_0xa51c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x381618,_0x5e665b,_0x4b352a){return new BPromise(function(_0xd71704,_0x1783bd){return client[_0xa51c('0xb')](_0x381618,_0x4b352a)['then'](function(_0x54e134){logger['info'](_0xa51c('0xc'),_0x5e665b,_0xa51c('0xd'));logger['debug'](_0xa51c('0xe'),_0x5e665b,'request\x20sent',JSON[_0xa51c('0xf')](_0x54e134));if(_0x54e134[_0xa51c('0x10')]){if(_0x54e134['error']['code']===0x1f4){logger[_0xa51c('0x10')](_0xa51c('0xc'),_0x5e665b,_0x54e134[_0xa51c('0x10')][_0xa51c('0x11')]);return _0x1783bd(_0x54e134[_0xa51c('0x10')]['message']);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x5e665b,_0x54e134['error'][_0xa51c('0x11')]);return _0xd71704(_0x54e134[_0xa51c('0x10')][_0xa51c('0x11')]);}else{logger[_0xa51c('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x5e665b,_0xa51c('0xd'));_0xd71704(_0x54e134[_0xa51c('0x13')]['message']);}})['catch'](function(_0x5df587){logger['error'](_0xa51c('0xc'),_0x5e665b,_0x5df587);_0x1783bd(_0x5df587);});});}