030ca5d0ef61c02ba6f43144e2a0369554b8c500
[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 _0xc3c5=['code','UserProfileResource,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x139545,_0x5d3d9d){var _0x16d2f4=function(_0x4d4790){while(--_0x4d4790){_0x139545['push'](_0x139545['shift']());}};_0x16d2f4(++_0x5d3d9d);}(_0xc3c5,0x1a6));var _0x5c3c=function(_0x1822c0,_0x1ea477){_0x1822c0=_0x1822c0-0x0;var _0x27e01d=_0xc3c5[_0x1822c0];return _0x27e01d;};'use strict';var _=require(_0x5c3c('0x0'));var util=require(_0x5c3c('0x1'));var moment=require(_0x5c3c('0x2'));var BPromise=require(_0x5c3c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c3c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5c3c('0x5'));var logger=require(_0x5c3c('0x6'))(_0x5c3c('0x7'));var config=require(_0x5c3c('0x8'));var jayson=require(_0x5c3c('0x9'));var client=jayson[_0x5c3c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41ceff,_0x2e9b21,_0xae6857){return new BPromise(function(_0x77c2dc,_0x41980f){return client[_0x5c3c('0xb')](_0x41ceff,_0xae6857)[_0x5c3c('0xc')](function(_0x228a26){logger[_0x5c3c('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x2e9b21,_0x5c3c('0xe'));logger['debug'](_0x5c3c('0xf'),_0x2e9b21,_0x5c3c('0xe'),JSON[_0x5c3c('0x10')](_0x228a26));if(_0x228a26[_0x5c3c('0x11')]){if(_0x228a26[_0x5c3c('0x11')][_0x5c3c('0x12')]===0x1f4){logger[_0x5c3c('0x11')](_0x5c3c('0x13'),_0x2e9b21,_0x228a26[_0x5c3c('0x11')][_0x5c3c('0x14')]);return _0x41980f(_0x228a26[_0x5c3c('0x11')]['message']);}logger[_0x5c3c('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x2e9b21,_0x228a26['error']['message']);return _0x77c2dc(_0x228a26[_0x5c3c('0x11')][_0x5c3c('0x14')]);}else{logger[_0x5c3c('0xd')](_0x5c3c('0x13'),_0x2e9b21,'request\x20sent');_0x77c2dc(_0x228a26[_0x5c3c('0x15')][_0x5c3c('0x14')]);}})['catch'](function(_0x7de9a1){logger[_0x5c3c('0x11')](_0x5c3c('0x13'),_0x2e9b21,_0x7de9a1);_0x41980f(_0x7de9a1);});});}