d64609e66721773d434a2d61b43ebe299f22ce4d
[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 _0x2212=['result','catch','UserProfileSection,\x20%s,\x20%s','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','then','info','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x54a53a,_0x29bc5a){var _0x1e8847=function(_0x25bfef){while(--_0x25bfef){_0x54a53a['push'](_0x54a53a['shift']());}};_0x1e8847(++_0x29bc5a);}(_0x2212,0x163));var _0x2221=function(_0x37184b,_0x55deb9){_0x37184b=_0x37184b-0x0;var _0x885d0c=_0x2212[_0x37184b];return _0x885d0c;};'use strict';var _=require(_0x2221('0x0'));var util=require(_0x2221('0x1'));var moment=require(_0x2221('0x2'));var BPromise=require('bluebird');var rs=require(_0x2221('0x3'));var fs=require('fs');var Redis=require(_0x2221('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2221('0x5'));var logger=require('../../config/logger')(_0x2221('0x6'));var config=require(_0x2221('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2221('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a0aaa,_0x51fdf0,_0x2948e1){return new BPromise(function(_0x45a203,_0x1d876b){return client[_0x2221('0x9')](_0x1a0aaa,_0x2948e1)[_0x2221('0xa')](function(_0x4bfe33){logger[_0x2221('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x51fdf0,'request\x20sent');logger[_0x2221('0xc')](_0x2221('0xd'),_0x51fdf0,_0x2221('0xe'),JSON[_0x2221('0xf')](_0x4bfe33));if(_0x4bfe33[_0x2221('0x10')]){if(_0x4bfe33[_0x2221('0x10')][_0x2221('0x11')]===0x1f4){logger[_0x2221('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x51fdf0,_0x4bfe33['error']['message']);return _0x1d876b(_0x4bfe33[_0x2221('0x10')][_0x2221('0x12')]);}logger[_0x2221('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x51fdf0,_0x4bfe33[_0x2221('0x10')]['message']);return _0x45a203(_0x4bfe33[_0x2221('0x10')][_0x2221('0x12')]);}else{logger[_0x2221('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x51fdf0,'request\x20sent');_0x45a203(_0x4bfe33[_0x2221('0x13')][_0x2221('0x12')]);}})[_0x2221('0x14')](function(_0x138506){logger[_0x2221('0x10')](_0x2221('0x15'),_0x51fdf0,_0x138506);_0x1d876b(_0x138506);});});}