87450cd9fb3ccf0b7e6080f9467714233675d05b
[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 _0x5d6e=['request','then','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UserProfileResource,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2ab365,_0xa3812e){var _0x49fef3=function(_0x29b883){while(--_0x29b883){_0x2ab365['push'](_0x2ab365['shift']());}};_0x49fef3(++_0xa3812e);}(_0x5d6e,0xb4));var _0xe5d6=function(_0x1f6691,_0x3a3d46){_0x1f6691=_0x1f6691-0x0;var _0xf786b6=_0x5d6e[_0x1f6691];return _0xf786b6;};'use strict';var _=require(_0xe5d6('0x0'));var util=require(_0xe5d6('0x1'));var moment=require(_0xe5d6('0x2'));var BPromise=require(_0xe5d6('0x3'));var rs=require(_0xe5d6('0x4'));var fs=require('fs');var Redis=require(_0xe5d6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe5d6('0x6'));var logger=require(_0xe5d6('0x7'))(_0xe5d6('0x8'));var config=require(_0xe5d6('0x9'));var jayson=require(_0xe5d6('0xa'));var client=jayson['client'][_0xe5d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20df78,_0x3fa905,_0x2a0d6a){return new BPromise(function(_0x150ce9,_0x2c17e4){return client[_0xe5d6('0xc')](_0x20df78,_0x2a0d6a)[_0xe5d6('0xd')](function(_0x11c211){logger[_0xe5d6('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x3fa905,_0xe5d6('0xf'));logger[_0xe5d6('0x10')](_0xe5d6('0x11'),_0x3fa905,_0xe5d6('0xf'),JSON[_0xe5d6('0x12')](_0x11c211));if(_0x11c211['error']){if(_0x11c211['error']['code']===0x1f4){logger[_0xe5d6('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x3fa905,_0x11c211[_0xe5d6('0x13')][_0xe5d6('0x14')]);return _0x2c17e4(_0x11c211[_0xe5d6('0x13')][_0xe5d6('0x14')]);}logger[_0xe5d6('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x3fa905,_0x11c211['error'][_0xe5d6('0x14')]);return _0x150ce9(_0x11c211[_0xe5d6('0x13')]['message']);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x3fa905,_0xe5d6('0xf'));_0x150ce9(_0x11c211[_0xe5d6('0x15')][_0xe5d6('0x14')]);}})[_0xe5d6('0x16')](function(_0x41068b){logger[_0xe5d6('0x13')](_0xe5d6('0x17'),_0x3fa905,_0x41068b);_0x2c17e4(_0x41068b);});});}