Built motion from commit 639a1a7f.|2.6.19
[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 _0x47e4=['then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x54d7bf,_0x1e321b){var _0x38528d=function(_0x2d632e){while(--_0x2d632e){_0x54d7bf['push'](_0x54d7bf['shift']());}};_0x38528d(++_0x1e321b);}(_0x47e4,0x196));var _0x447e=function(_0x2b7248,_0x17b24e){_0x2b7248=_0x2b7248-0x0;var _0x418838=_0x47e4[_0x2b7248];return _0x418838;};'use strict';var _=require(_0x447e('0x0'));var util=require(_0x447e('0x1'));var moment=require(_0x447e('0x2'));var BPromise=require(_0x447e('0x3'));var rs=require(_0x447e('0x4'));var fs=require('fs');var Redis=require(_0x447e('0x5'));var db=require(_0x447e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x447e('0x7'))(_0x447e('0x8'));var config=require('../../config/environment');var jayson=require(_0x447e('0x9'));var client=jayson[_0x447e('0xa')][_0x447e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28b094,_0x3c1121,_0x10c3bd){return new BPromise(function(_0x19e14a,_0x4234b4){return client['request'](_0x28b094,_0x10c3bd)[_0x447e('0xc')](function(_0x3a9c35){logger[_0x447e('0xd')](_0x447e('0xe'),_0x3c1121,_0x447e('0xf'));logger[_0x447e('0x10')](_0x447e('0x11'),_0x3c1121,_0x447e('0xf'),JSON['stringify'](_0x3a9c35));if(_0x3a9c35[_0x447e('0x12')]){if(_0x3a9c35['error']['code']===0x1f4){logger[_0x447e('0x12')](_0x447e('0xe'),_0x3c1121,_0x3a9c35['error'][_0x447e('0x13')]);return _0x4234b4(_0x3a9c35['error'][_0x447e('0x13')]);}logger['error'](_0x447e('0xe'),_0x3c1121,_0x3a9c35[_0x447e('0x12')][_0x447e('0x13')]);return _0x19e14a(_0x3a9c35['error'][_0x447e('0x13')]);}else{logger['info'](_0x447e('0xe'),_0x3c1121,_0x447e('0xf'));_0x19e14a(_0x3a9c35[_0x447e('0x14')]['message']);}})[_0x447e('0x15')](function(_0x146641){logger[_0x447e('0x12')](_0x447e('0xe'),_0x3c1121,_0x146641);_0x4234b4(_0x146641);});});}