Built motion from commit 9efc8423.|2.6.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 _0x7d6f=['UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserProfileResource,\x20%s,\x20%s','debug'];(function(_0x4f2806,_0x52841f){var _0x45419a=function(_0x3ebb28){while(--_0x3ebb28){_0x4f2806['push'](_0x4f2806['shift']());}};_0x45419a(++_0x52841f);}(_0x7d6f,0xf9));var _0xf7d6=function(_0x12d6e6,_0x1ea259){_0x12d6e6=_0x12d6e6-0x0;var _0x540065=_0x7d6f[_0x12d6e6];return _0x540065;};'use strict';var _=require(_0xf7d6('0x0'));var util=require('util');var moment=require(_0xf7d6('0x1'));var BPromise=require(_0xf7d6('0x2'));var rs=require(_0xf7d6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7d6('0x4'))['db'];var utils=require(_0xf7d6('0x5'));var logger=require(_0xf7d6('0x6'))(_0xf7d6('0x7'));var config=require(_0xf7d6('0x8'));var jayson=require(_0xf7d6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1173d8,_0x1198c3,_0x2f7ff0){return new BPromise(function(_0x57ee65,_0x3bb1f6){return client[_0xf7d6('0xa')](_0x1173d8,_0x2f7ff0)[_0xf7d6('0xb')](function(_0x320f14){logger[_0xf7d6('0xc')](_0xf7d6('0xd'),_0x1198c3,'request\x20sent');logger[_0xf7d6('0xe')](_0xf7d6('0xf'),_0x1198c3,_0xf7d6('0x10'),JSON[_0xf7d6('0x11')](_0x320f14));if(_0x320f14['error']){if(_0x320f14[_0xf7d6('0x12')]['code']===0x1f4){logger[_0xf7d6('0x12')](_0xf7d6('0xd'),_0x1198c3,_0x320f14['error'][_0xf7d6('0x13')]);return _0x3bb1f6(_0x320f14['error'][_0xf7d6('0x13')]);}logger[_0xf7d6('0x12')](_0xf7d6('0xd'),_0x1198c3,_0x320f14[_0xf7d6('0x12')]['message']);return _0x57ee65(_0x320f14[_0xf7d6('0x12')][_0xf7d6('0x13')]);}else{logger[_0xf7d6('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x1198c3,_0xf7d6('0x10'));_0x57ee65(_0x320f14[_0xf7d6('0x14')]['message']);}})[_0xf7d6('0x15')](function(_0x390604){logger['error'](_0xf7d6('0xd'),_0x1198c3,_0x390604);_0x3bb1f6(_0x390604);});});}