Built motion from commit 9d1906d1.|2.5.40
[motion2.git] / server / api / userProfileResource / userProfileResource.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 _0x4185=['bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment'];(function(_0x468f7d,_0xb3de39){var _0x4f96a6=function(_0x25322c){while(--_0x25322c){_0x468f7d['push'](_0x468f7d['shift']());}};_0x4f96a6(++_0xb3de39);}(_0x4185,0x147));var _0x5418=function(_0x425561,_0x3a4598){_0x425561=_0x425561-0x0;var _0x303b28=_0x4185[_0x425561];return _0x303b28;};'use strict';var _=require(_0x5418('0x0'));var util=require(_0x5418('0x1'));var moment=require(_0x5418('0x2'));var BPromise=require(_0x5418('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5418('0x4'));var logger=require(_0x5418('0x5'))(_0x5418('0x6'));var config=require(_0x5418('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5418('0x8')][_0x5418('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5db0e1,_0x507616,_0x3819f4){return new BPromise(function(_0x155cab,_0x388405){return client[_0x5418('0xa')](_0x5db0e1,_0x3819f4)[_0x5418('0xb')](function(_0x40eac2){logger[_0x5418('0xc')](_0x5418('0xd'),_0x507616,'request\x20sent');logger['debug'](_0x5418('0xe'),_0x507616,_0x5418('0xf'),JSON[_0x5418('0x10')](_0x40eac2));if(_0x40eac2['error']){if(_0x40eac2['error'][_0x5418('0x11')]===0x1f4){logger[_0x5418('0x12')](_0x5418('0xd'),_0x507616,_0x40eac2[_0x5418('0x12')]['message']);return _0x388405(_0x40eac2[_0x5418('0x12')][_0x5418('0x13')]);}logger[_0x5418('0x12')](_0x5418('0xd'),_0x507616,_0x40eac2[_0x5418('0x12')]['message']);return _0x155cab(_0x40eac2[_0x5418('0x12')]['message']);}else{logger[_0x5418('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x507616,'request\x20sent');_0x155cab(_0x40eac2[_0x5418('0x14')][_0x5418('0x13')]);}})[_0x5418('0x15')](function(_0x53e4b4){logger[_0x5418('0x12')](_0x5418('0xd'),_0x507616,_0x53e4b4);_0x388405(_0x53e4b4);});});}