Built motion from commit (unavailable).|2.5.31
[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 _0x98de=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','randomstring','ioredis'];(function(_0x5ddf09,_0xb6cff3){var _0xb74006=function(_0x4f3ad8){while(--_0x4f3ad8){_0x5ddf09['push'](_0x5ddf09['shift']());}};_0xb74006(++_0xb6cff3);}(_0x98de,0xce));var _0xe98d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x98de[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xe98d('0x0'));var moment=require(_0xe98d('0x1'));var BPromise=require('bluebird');var rs=require(_0xe98d('0x2'));var fs=require('fs');var Redis=require(_0xe98d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe98d('0x4'));var logger=require(_0xe98d('0x5'))(_0xe98d('0x6'));var config=require(_0xe98d('0x7'));var jayson=require(_0xe98d('0x8'));var client=jayson[_0xe98d('0x9')][_0xe98d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x255a6f,_0x1fc723,_0x528fd4){return new BPromise(function(_0x44dbfe,_0x41cede){return client[_0xe98d('0xb')](_0x255a6f,_0x528fd4)['then'](function(_0x5f5229){logger['info'](_0xe98d('0xc'),_0x1fc723,'request\x20sent');logger[_0xe98d('0xd')](_0xe98d('0xe'),_0x1fc723,_0xe98d('0xf'),JSON[_0xe98d('0x10')](_0x5f5229));if(_0x5f5229['error']){if(_0x5f5229[_0xe98d('0x11')][_0xe98d('0x12')]===0x1f4){logger[_0xe98d('0x11')](_0xe98d('0xc'),_0x1fc723,_0x5f5229['error']['message']);return _0x41cede(_0x5f5229[_0xe98d('0x11')]['message']);}logger[_0xe98d('0x11')](_0xe98d('0xc'),_0x1fc723,_0x5f5229[_0xe98d('0x11')][_0xe98d('0x13')]);return _0x44dbfe(_0x5f5229[_0xe98d('0x11')][_0xe98d('0x13')]);}else{logger['info'](_0xe98d('0xc'),_0x1fc723,_0xe98d('0xf'));_0x44dbfe(_0x5f5229['result'][_0xe98d('0x13')]);}})[_0xe98d('0x14')](function(_0x386c9a){logger[_0xe98d('0x11')](_0xe98d('0xc'),_0x1fc723,_0x386c9a);_0x41cede(_0x386c9a);});});}