dc644a617bd7f3a89cadf3dfa2dbab7076a81a44
[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 _0x0874=['info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x520843,_0x3340d1){var _0xc7165e=function(_0x43ada9){while(--_0x43ada9){_0x520843['push'](_0x520843['shift']());}};_0xc7165e(++_0x3340d1);}(_0x0874,0xb1));var _0x4087=function(_0x13f83f,_0x44e4b6){_0x13f83f=_0x13f83f-0x0;var _0x5648f5=_0x0874[_0x13f83f];return _0x5648f5;};'use strict';var _=require('lodash');var util=require(_0x4087('0x0'));var moment=require('moment');var BPromise=require(_0x4087('0x1'));var rs=require(_0x4087('0x2'));var fs=require('fs');var Redis=require(_0x4087('0x3'));var db=require(_0x4087('0x4'))['db'];var utils=require(_0x4087('0x5'));var logger=require(_0x4087('0x6'))('rpc');var config=require(_0x4087('0x7'));var jayson=require(_0x4087('0x8'));var client=jayson[_0x4087('0x9')][_0x4087('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f4b39,_0x28044d,_0x5eb266){return new BPromise(function(_0x441d49,_0x1bf287){return client['request'](_0x5f4b39,_0x5eb266)[_0x4087('0xb')](function(_0x10e9cc){logger[_0x4087('0xc')](_0x4087('0xd'),_0x28044d,_0x4087('0xe'));logger['debug'](_0x4087('0xf'),_0x28044d,_0x4087('0xe'),JSON[_0x4087('0x10')](_0x10e9cc));if(_0x10e9cc[_0x4087('0x11')]){if(_0x10e9cc[_0x4087('0x11')]['code']===0x1f4){logger[_0x4087('0x11')](_0x4087('0xd'),_0x28044d,_0x10e9cc[_0x4087('0x11')][_0x4087('0x12')]);return _0x1bf287(_0x10e9cc['error'][_0x4087('0x12')]);}logger[_0x4087('0x11')](_0x4087('0xd'),_0x28044d,_0x10e9cc[_0x4087('0x11')]['message']);return _0x441d49(_0x10e9cc[_0x4087('0x11')][_0x4087('0x12')]);}else{logger[_0x4087('0xc')](_0x4087('0xd'),_0x28044d,'request\x20sent');_0x441d49(_0x10e9cc[_0x4087('0x13')][_0x4087('0x12')]);}})[_0x4087('0x14')](function(_0x3e807f){logger[_0x4087('0x11')](_0x4087('0xd'),_0x28044d,_0x3e807f);_0x1bf287(_0x3e807f);});});}