Built motion from commit 9d7072cc.|2.5.39
[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 _0x143e=['../../config/environment','jayson/promise','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x143e,0xdf));var _0xe143=function(_0x38462d,_0x4a756d){_0x38462d=_0x38462d-0x0;var _0x4a0ece=_0x143e[_0x38462d];return _0x4a0ece;};'use strict';var _=require(_0xe143('0x0'));var util=require(_0xe143('0x1'));var moment=require('moment');var BPromise=require(_0xe143('0x2'));var rs=require(_0xe143('0x3'));var fs=require('fs');var Redis=require(_0xe143('0x4'));var db=require(_0xe143('0x5'))['db'];var utils=require(_0xe143('0x6'));var logger=require('../../config/logger')(_0xe143('0x7'));var config=require(_0xe143('0x8'));var jayson=require(_0xe143('0x9'));var client=jayson['client'][_0xe143('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a827b,_0x5f2857,_0x491ebc){return new BPromise(function(_0x523fc7,_0x48098a){return client[_0xe143('0xb')](_0x4a827b,_0x491ebc)[_0xe143('0xc')](function(_0x40abed){logger['info'](_0xe143('0xd'),_0x5f2857,_0xe143('0xe'));logger[_0xe143('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x5f2857,_0xe143('0xe'),JSON[_0xe143('0x10')](_0x40abed));if(_0x40abed[_0xe143('0x11')]){if(_0x40abed[_0xe143('0x11')]['code']===0x1f4){logger[_0xe143('0x11')](_0xe143('0xd'),_0x5f2857,_0x40abed[_0xe143('0x11')]['message']);return _0x48098a(_0x40abed['error'][_0xe143('0x12')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x5f2857,_0x40abed[_0xe143('0x11')][_0xe143('0x12')]);return _0x523fc7(_0x40abed['error']['message']);}else{logger['info'](_0xe143('0xd'),_0x5f2857,_0xe143('0xe'));_0x523fc7(_0x40abed[_0xe143('0x13')][_0xe143('0x12')]);}})[_0xe143('0x14')](function(_0x1a4540){logger['error'](_0xe143('0xd'),_0x5f2857,_0x1a4540);_0x48098a(_0x1a4540);});});}