Built motion from commit 8356fca3.|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 _0x9fda=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','info','UserProfileResource,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','lodash','bluebird','randomstring','ioredis'];(function(_0x8672b2,_0x3230c){var _0x4e9e0b=function(_0x3ab163){while(--_0x3ab163){_0x8672b2['push'](_0x8672b2['shift']());}};_0x4e9e0b(++_0x3230c);}(_0x9fda,0x8c));var _0xa9fd=function(_0x2fad4b,_0x221269){_0x2fad4b=_0x2fad4b-0x0;var _0x5e1fc0=_0x9fda[_0x2fad4b];return _0x5e1fc0;};'use strict';var _=require(_0xa9fd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa9fd('0x1'));var rs=require(_0xa9fd('0x2'));var fs=require('fs');var Redis=require(_0xa9fd('0x3'));var db=require(_0xa9fd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa9fd('0x5'))(_0xa9fd('0x6'));var config=require('../../config/environment');var jayson=require(_0xa9fd('0x7'));var client=jayson[_0xa9fd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f2d27,_0x3e5143,_0x1e249e){return new BPromise(function(_0x4072e3,_0x1b1c2e){return client[_0xa9fd('0x9')](_0x5f2d27,_0x1e249e)['then'](function(_0x7bc6c4){logger[_0xa9fd('0xa')](_0xa9fd('0xb'),_0x3e5143,'request\x20sent');logger[_0xa9fd('0xc')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x3e5143,'request\x20sent',JSON[_0xa9fd('0xd')](_0x7bc6c4));if(_0x7bc6c4[_0xa9fd('0xe')]){if(_0x7bc6c4[_0xa9fd('0xe')]['code']===0x1f4){logger[_0xa9fd('0xe')](_0xa9fd('0xb'),_0x3e5143,_0x7bc6c4[_0xa9fd('0xe')][_0xa9fd('0xf')]);return _0x1b1c2e(_0x7bc6c4['error'][_0xa9fd('0xf')]);}logger[_0xa9fd('0xe')](_0xa9fd('0xb'),_0x3e5143,_0x7bc6c4[_0xa9fd('0xe')][_0xa9fd('0xf')]);return _0x4072e3(_0x7bc6c4[_0xa9fd('0xe')][_0xa9fd('0xf')]);}else{logger[_0xa9fd('0xa')]('UserProfileResource,\x20%s,\x20%s',_0x3e5143,_0xa9fd('0x10'));_0x4072e3(_0x7bc6c4[_0xa9fd('0x11')]['message']);}})['catch'](function(_0x42d7d9){logger[_0xa9fd('0xe')](_0xa9fd('0xb'),_0x3e5143,_0x42d7d9);_0x1b1c2e(_0x42d7d9);});});}