Built motion from commit 6a09e18b.|2.6.11
[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 _0x6581=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x6581,0x155));var _0x1658=function(_0x22095d,_0x235455){_0x22095d=_0x22095d-0x0;var _0x4c3ff5=_0x6581[_0x22095d];return _0x4c3ff5;};'use strict';var _=require('lodash');var util=require(_0x1658('0x0'));var moment=require(_0x1658('0x1'));var BPromise=require(_0x1658('0x2'));var rs=require(_0x1658('0x3'));var fs=require('fs');var Redis=require(_0x1658('0x4'));var db=require(_0x1658('0x5'))['db'];var utils=require(_0x1658('0x6'));var logger=require('../../config/logger')(_0x1658('0x7'));var config=require(_0x1658('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1658('0x9')][_0x1658('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35a6f1,_0x1761e2,_0x420e19){return new BPromise(function(_0x3b8ef3,_0x1403bf){return client[_0x1658('0xb')](_0x35a6f1,_0x420e19)[_0x1658('0xc')](function(_0x4440bf){logger[_0x1658('0xd')](_0x1658('0xe'),_0x1761e2,_0x1658('0xf'));logger[_0x1658('0x10')](_0x1658('0x11'),_0x1761e2,_0x1658('0xf'),JSON[_0x1658('0x12')](_0x4440bf));if(_0x4440bf[_0x1658('0x13')]){if(_0x4440bf[_0x1658('0x13')]['code']===0x1f4){logger['error'](_0x1658('0xe'),_0x1761e2,_0x4440bf[_0x1658('0x13')][_0x1658('0x14')]);return _0x1403bf(_0x4440bf[_0x1658('0x13')][_0x1658('0x14')]);}logger[_0x1658('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x1761e2,_0x4440bf[_0x1658('0x13')]['message']);return _0x3b8ef3(_0x4440bf[_0x1658('0x13')][_0x1658('0x14')]);}else{logger[_0x1658('0xd')](_0x1658('0xe'),_0x1761e2,_0x1658('0xf'));_0x3b8ef3(_0x4440bf[_0x1658('0x15')][_0x1658('0x14')]);}})[_0x1658('0x16')](function(_0x3e5f5f){logger['error'](_0x1658('0xe'),_0x1761e2,_0x3e5f5f);_0x1403bf(_0x3e5f5f);});});}