Built motion from commit 753c950e.|2.5.42
[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 _0xf0a3=['bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','info','result','catch','util','moment'];(function(_0x57a491,_0x4d1428){var _0x14f6fc=function(_0x57d4e0){while(--_0x57d4e0){_0x57a491['push'](_0x57a491['shift']());}};_0x14f6fc(++_0x4d1428);}(_0xf0a3,0x18d));var _0x3f0a=function(_0x414540,_0x500b13){_0x414540=_0x414540-0x0;var _0x5039cc=_0xf0a3[_0x414540];return _0x5039cc;};'use strict';var _=require('lodash');var util=require(_0x3f0a('0x0'));var moment=require(_0x3f0a('0x1'));var BPromise=require(_0x3f0a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f0a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f0a('0x4'));var logger=require('../../config/logger')(_0x3f0a('0x5'));var config=require(_0x3f0a('0x6'));var jayson=require(_0x3f0a('0x7'));var client=jayson[_0x3f0a('0x8')][_0x3f0a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x443907,_0x16fbbe,_0xddc037){return new BPromise(function(_0x789ae5,_0xca2e46){return client['request'](_0x443907,_0xddc037)['then'](function(_0x272d44){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x16fbbe,_0x3f0a('0xa'));logger[_0x3f0a('0xb')](_0x3f0a('0xc'),_0x16fbbe,_0x3f0a('0xa'),JSON[_0x3f0a('0xd')](_0x272d44));if(_0x272d44[_0x3f0a('0xe')]){if(_0x272d44[_0x3f0a('0xe')][_0x3f0a('0xf')]===0x1f4){logger[_0x3f0a('0xe')](_0x3f0a('0x10'),_0x16fbbe,_0x272d44['error'][_0x3f0a('0x11')]);return _0xca2e46(_0x272d44[_0x3f0a('0xe')][_0x3f0a('0x11')]);}logger[_0x3f0a('0xe')](_0x3f0a('0x10'),_0x16fbbe,_0x272d44['error']['message']);return _0x789ae5(_0x272d44['error'][_0x3f0a('0x11')]);}else{logger[_0x3f0a('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x16fbbe,_0x3f0a('0xa'));_0x789ae5(_0x272d44[_0x3f0a('0x13')]['message']);}})[_0x3f0a('0x14')](function(_0x3f1ca9){logger[_0x3f0a('0xe')](_0x3f0a('0x10'),_0x16fbbe,_0x3f1ca9);_0xca2e46(_0x3f1ca9);});});}