Built motion from commit (unavailable).|2.5.22
[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 _0x54a2=['request','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','UserProfileResource,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x13c655,_0x884e4d){var _0x2f4973=function(_0x5076e6){while(--_0x5076e6){_0x13c655['push'](_0x13c655['shift']());}};_0x2f4973(++_0x884e4d);}(_0x54a2,0x1ef));var _0x254a=function(_0x2c271b,_0x5e1728){_0x2c271b=_0x2c271b-0x0;var _0x423d7b=_0x54a2[_0x2c271b];return _0x423d7b;};'use strict';var _=require('lodash');var util=require(_0x254a('0x0'));var moment=require(_0x254a('0x1'));var BPromise=require(_0x254a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x254a('0x3'))['db'];var utils=require(_0x254a('0x4'));var logger=require(_0x254a('0x5'))(_0x254a('0x6'));var config=require(_0x254a('0x7'));var jayson=require(_0x254a('0x8'));var client=jayson[_0x254a('0x9')][_0x254a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47c317,_0x3565b6,_0x5ae1de){return new BPromise(function(_0x4dd3d6,_0x4a049b){return client[_0x254a('0xb')](_0x47c317,_0x5ae1de)['then'](function(_0x23e2a6){logger[_0x254a('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x3565b6,_0x254a('0xd'));logger[_0x254a('0xe')](_0x254a('0xf'),_0x3565b6,_0x254a('0xd'),JSON['stringify'](_0x23e2a6));if(_0x23e2a6[_0x254a('0x10')]){if(_0x23e2a6['error'][_0x254a('0x11')]===0x1f4){logger['error'](_0x254a('0x12'),_0x3565b6,_0x23e2a6['error']['message']);return _0x4a049b(_0x23e2a6[_0x254a('0x10')][_0x254a('0x13')]);}logger[_0x254a('0x10')](_0x254a('0x12'),_0x3565b6,_0x23e2a6[_0x254a('0x10')][_0x254a('0x13')]);return _0x4dd3d6(_0x23e2a6['error'][_0x254a('0x13')]);}else{logger['info'](_0x254a('0x12'),_0x3565b6,_0x254a('0xd'));_0x4dd3d6(_0x23e2a6[_0x254a('0x14')][_0x254a('0x13')]);}})[_0x254a('0x15')](function(_0x5241e4){logger[_0x254a('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x3565b6,_0x5241e4);_0x4a049b(_0x5241e4);});});}