c5694f3100a826be0a5ae8d2eaff0063bd091ba5
[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 _0xf398=['request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','request','then','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x317dfa,_0x35fe08){var _0x21ea7c=function(_0xeee34d){while(--_0xeee34d){_0x317dfa['push'](_0x317dfa['shift']());}};_0x21ea7c(++_0x35fe08);}(_0xf398,0x7f));var _0x8f39=function(_0x4d5309,_0x42d4de){_0x4d5309=_0x4d5309-0x0;var _0x61e858=_0xf398[_0x4d5309];return _0x61e858;};'use strict';var _=require(_0x8f39('0x0'));var util=require(_0x8f39('0x1'));var moment=require(_0x8f39('0x2'));var BPromise=require(_0x8f39('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f39('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8f39('0x5'))(_0x8f39('0x6'));var config=require('../../config/environment');var jayson=require(_0x8f39('0x7'));var client=jayson[_0x8f39('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x846f92,_0x4b34e3,_0x508910){return new BPromise(function(_0x438689,_0x45636e){return client[_0x8f39('0x9')](_0x846f92,_0x508910)[_0x8f39('0xa')](function(_0x59188e){logger[_0x8f39('0xb')](_0x8f39('0xc'),_0x4b34e3,_0x8f39('0xd'));logger[_0x8f39('0xe')](_0x8f39('0xf'),_0x4b34e3,_0x8f39('0xd'),JSON['stringify'](_0x59188e));if(_0x59188e[_0x8f39('0x10')]){if(_0x59188e[_0x8f39('0x10')]['code']===0x1f4){logger[_0x8f39('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x4b34e3,_0x59188e[_0x8f39('0x10')][_0x8f39('0x11')]);return _0x45636e(_0x59188e[_0x8f39('0x10')][_0x8f39('0x11')]);}logger['error'](_0x8f39('0xc'),_0x4b34e3,_0x59188e[_0x8f39('0x10')][_0x8f39('0x11')]);return _0x438689(_0x59188e[_0x8f39('0x10')]['message']);}else{logger[_0x8f39('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x4b34e3,_0x8f39('0xd'));_0x438689(_0x59188e[_0x8f39('0x12')]['message']);}})[_0x8f39('0x13')](function(_0x364e9f){logger[_0x8f39('0x10')](_0x8f39('0xc'),_0x4b34e3,_0x364e9f);_0x45636e(_0x364e9f);});});}