Built motion from commit 43538d75.|2.5.35
[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 _0x6002=['debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x2fdce0,_0x496242){var _0x36f07e=function(_0x44c8c6){while(--_0x44c8c6){_0x2fdce0['push'](_0x2fdce0['shift']());}};_0x36f07e(++_0x496242);}(_0x6002,0x1d5));var _0x2600=function(_0x45c810,_0xb7ff1f){_0x45c810=_0x45c810-0x0;var _0x186e00=_0x6002[_0x45c810];return _0x186e00;};'use strict';var _=require('lodash');var util=require(_0x2600('0x0'));var moment=require(_0x2600('0x1'));var BPromise=require(_0x2600('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2600('0x3'))['db'];var utils=require(_0x2600('0x4'));var logger=require(_0x2600('0x5'))(_0x2600('0x6'));var config=require(_0x2600('0x7'));var jayson=require(_0x2600('0x8'));var client=jayson['client'][_0x2600('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27f4b5,_0xae8b7a,_0x29860b){return new BPromise(function(_0x13dd3c,_0x240e73){return client[_0x2600('0xa')](_0x27f4b5,_0x29860b)[_0x2600('0xb')](function(_0x4436bc){logger[_0x2600('0xc')](_0x2600('0xd'),_0xae8b7a,'request\x20sent');logger[_0x2600('0xe')](_0x2600('0xf'),_0xae8b7a,_0x2600('0x10'),JSON[_0x2600('0x11')](_0x4436bc));if(_0x4436bc['error']){if(_0x4436bc['error'][_0x2600('0x12')]===0x1f4){logger[_0x2600('0x13')](_0x2600('0xd'),_0xae8b7a,_0x4436bc[_0x2600('0x13')][_0x2600('0x14')]);return _0x240e73(_0x4436bc[_0x2600('0x13')]['message']);}logger[_0x2600('0x13')](_0x2600('0xd'),_0xae8b7a,_0x4436bc[_0x2600('0x13')][_0x2600('0x14')]);return _0x13dd3c(_0x4436bc[_0x2600('0x13')][_0x2600('0x14')]);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0xae8b7a,'request\x20sent');_0x13dd3c(_0x4436bc[_0x2600('0x15')][_0x2600('0x14')]);}})[_0x2600('0x16')](function(_0x49795c){logger[_0x2600('0x13')]('UserProfileResource,\x20%s,\x20%s',_0xae8b7a,_0x49795c);_0x240e73(_0x49795c);});});}