Built motion from commit 639a1a7f.|2.6.19
[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 _0x8a5a=['UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a5a,0x66));var _0xa8a5=function(_0x138e2d,_0x1380f6){_0x138e2d=_0x138e2d-0x0;var _0x5dd2a0=_0x8a5a[_0x138e2d];return _0x5dd2a0;};'use strict';var _=require('lodash');var util=require(_0xa8a5('0x0'));var moment=require('moment');var BPromise=require(_0xa8a5('0x1'));var rs=require(_0xa8a5('0x2'));var fs=require('fs');var Redis=require(_0xa8a5('0x3'));var db=require(_0xa8a5('0x4'))['db'];var utils=require(_0xa8a5('0x5'));var logger=require('../../config/logger')(_0xa8a5('0x6'));var config=require(_0xa8a5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa8a5('0x8')][_0xa8a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1add0a,_0x141646,_0x82e92a){return new BPromise(function(_0x474ff6,_0x4af2ac){return client[_0xa8a5('0xa')](_0x1add0a,_0x82e92a)[_0xa8a5('0xb')](function(_0x1d18da){logger[_0xa8a5('0xc')](_0xa8a5('0xd'),_0x141646,_0xa8a5('0xe'));logger[_0xa8a5('0xf')](_0xa8a5('0x10'),_0x141646,_0xa8a5('0xe'),JSON[_0xa8a5('0x11')](_0x1d18da));if(_0x1d18da[_0xa8a5('0x12')]){if(_0x1d18da['error'][_0xa8a5('0x13')]===0x1f4){logger[_0xa8a5('0x12')](_0xa8a5('0xd'),_0x141646,_0x1d18da[_0xa8a5('0x12')]['message']);return _0x4af2ac(_0x1d18da[_0xa8a5('0x12')][_0xa8a5('0x14')]);}logger[_0xa8a5('0x12')](_0xa8a5('0xd'),_0x141646,_0x1d18da['error'][_0xa8a5('0x14')]);return _0x474ff6(_0x1d18da['error']['message']);}else{logger[_0xa8a5('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x141646,_0xa8a5('0xe'));_0x474ff6(_0x1d18da[_0xa8a5('0x15')][_0xa8a5('0x14')]);}})[_0xa8a5('0x16')](function(_0x2d0100){logger[_0xa8a5('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x141646,_0x2d0100);_0x4af2ac(_0x2d0100);});});}