Built motion from commit (unavailable).|2.5.31
[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 _0x857f=['../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','request\x20sent','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x857f,0xa3));var _0xf857=function(_0x322652,_0x5a85c0){_0x322652=_0x322652-0x0;var _0x5d5e88=_0x857f[_0x322652];return _0x5d5e88;};'use strict';var _=require('lodash');var util=require(_0xf857('0x0'));var moment=require(_0xf857('0x1'));var BPromise=require(_0xf857('0x2'));var rs=require(_0xf857('0x3'));var fs=require('fs');var Redis=require(_0xf857('0x4'));var db=require(_0xf857('0x5'))['db'];var utils=require(_0xf857('0x6'));var logger=require('../../config/logger')(_0xf857('0x7'));var config=require(_0xf857('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf857('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3723d7,_0x4d37da,_0x203b91){return new BPromise(function(_0x1bd54b,_0x1c399c){return client[_0xf857('0xa')](_0x3723d7,_0x203b91)[_0xf857('0xb')](function(_0x6f103f){logger[_0xf857('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x4d37da,_0xf857('0xd'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x4d37da,'request\x20sent',JSON[_0xf857('0xe')](_0x6f103f));if(_0x6f103f['error']){if(_0x6f103f[_0xf857('0xf')][_0xf857('0x10')]===0x1f4){logger['error'](_0xf857('0x11'),_0x4d37da,_0x6f103f[_0xf857('0xf')][_0xf857('0x12')]);return _0x1c399c(_0x6f103f[_0xf857('0xf')]['message']);}logger['error'](_0xf857('0x11'),_0x4d37da,_0x6f103f['error'][_0xf857('0x12')]);return _0x1bd54b(_0x6f103f[_0xf857('0xf')][_0xf857('0x12')]);}else{logger[_0xf857('0xc')](_0xf857('0x11'),_0x4d37da,'request\x20sent');_0x1bd54b(_0x6f103f[_0xf857('0x13')][_0xf857('0x12')]);}})[_0xf857('0x14')](function(_0x545181){logger['error'](_0xf857('0x11'),_0x4d37da,_0x545181);_0x1c399c(_0x545181);});});}