f6adbdb8c7afd431721fe71e0f57049e9aa24ab1
[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 _0x53d5=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5b9d6b,_0x592ddc){var _0x349c35=function(_0x1b2eb7){while(--_0x1b2eb7){_0x5b9d6b['push'](_0x5b9d6b['shift']());}};_0x349c35(++_0x592ddc);}(_0x53d5,0x120));var _0x553d=function(_0x4f7339,_0x1dc41e){_0x4f7339=_0x4f7339-0x0;var _0x241781=_0x53d5[_0x4f7339];return _0x241781;};'use strict';var _=require('lodash');var util=require(_0x553d('0x0'));var moment=require(_0x553d('0x1'));var BPromise=require(_0x553d('0x2'));var rs=require(_0x553d('0x3'));var fs=require('fs');var Redis=require(_0x553d('0x4'));var db=require(_0x553d('0x5'))['db'];var utils=require(_0x553d('0x6'));var logger=require('../../config/logger')(_0x553d('0x7'));var config=require(_0x553d('0x8'));var jayson=require(_0x553d('0x9'));var client=jayson[_0x553d('0xa')][_0x553d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5be2da,_0x275112,_0x52b05a){return new BPromise(function(_0x2e8a9b,_0x5f4da9){return client['request'](_0x5be2da,_0x52b05a)[_0x553d('0xc')](function(_0x321901){logger[_0x553d('0xd')](_0x553d('0xe'),_0x275112,'request\x20sent');logger['debug'](_0x553d('0xf'),_0x275112,'request\x20sent',JSON['stringify'](_0x321901));if(_0x321901[_0x553d('0x10')]){if(_0x321901[_0x553d('0x10')][_0x553d('0x11')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x275112,_0x321901[_0x553d('0x10')][_0x553d('0x12')]);return _0x5f4da9(_0x321901[_0x553d('0x10')][_0x553d('0x12')]);}logger[_0x553d('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x275112,_0x321901['error'][_0x553d('0x12')]);return _0x2e8a9b(_0x321901[_0x553d('0x10')]['message']);}else{logger['info'](_0x553d('0xe'),_0x275112,'request\x20sent');_0x2e8a9b(_0x321901[_0x553d('0x13')][_0x553d('0x12')]);}})[_0x553d('0x14')](function(_0x426821){logger[_0x553d('0x10')](_0x553d('0xe'),_0x275112,_0x426821);_0x5f4da9(_0x426821);});});}