Built motion from commit 97153652.|2.6.26
[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 _0x2e20=['../../config/environment','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0x2e20,0x66));var _0x02e2=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0x2e20[_0x13b392];return _0x39db24;};'use strict';var _=require(_0x02e2('0x0'));var util=require(_0x02e2('0x1'));var moment=require(_0x02e2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02e2('0x3'));var db=require(_0x02e2('0x4'))['db'];var utils=require(_0x02e2('0x5'));var logger=require(_0x02e2('0x6'))(_0x02e2('0x7'));var config=require(_0x02e2('0x8'));var jayson=require(_0x02e2('0x9'));var client=jayson[_0x02e2('0xa')][_0x02e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x226930,_0x572d7f,_0x23a038){return new BPromise(function(_0x2095e4,_0x1f268c){return client['request'](_0x226930,_0x23a038)[_0x02e2('0xc')](function(_0x16c017){logger[_0x02e2('0xd')](_0x02e2('0xe'),_0x572d7f,_0x02e2('0xf'));logger[_0x02e2('0x10')](_0x02e2('0x11'),_0x572d7f,_0x02e2('0xf'),JSON['stringify'](_0x16c017));if(_0x16c017[_0x02e2('0x12')]){if(_0x16c017[_0x02e2('0x12')]['code']===0x1f4){logger['error'](_0x02e2('0xe'),_0x572d7f,_0x16c017[_0x02e2('0x12')][_0x02e2('0x13')]);return _0x1f268c(_0x16c017[_0x02e2('0x12')][_0x02e2('0x13')]);}logger['error'](_0x02e2('0xe'),_0x572d7f,_0x16c017['error'][_0x02e2('0x13')]);return _0x2095e4(_0x16c017['error']['message']);}else{logger['info'](_0x02e2('0xe'),_0x572d7f,_0x02e2('0xf'));_0x2095e4(_0x16c017[_0x02e2('0x14')][_0x02e2('0x13')]);}})[_0x02e2('0x15')](function(_0x41cacc){logger[_0x02e2('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x572d7f,_0x41cacc);_0x1f268c(_0x41cacc);});});}