befee47abdcdff72e2e9da80f70658a1c5ee46a5
[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 _0x1c1a=['error','UserProfileResource,\x20%s,\x20%s','message','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','request\x20sent'];(function(_0x5287fb,_0x2d9f60){var _0x5a7f46=function(_0x324ecd){while(--_0x324ecd){_0x5287fb['push'](_0x5287fb['shift']());}};_0x5a7f46(++_0x2d9f60);}(_0x1c1a,0x84));var _0xa1c1=function(_0x2ac2b1,_0x73c90c){_0x2ac2b1=_0x2ac2b1-0x0;var _0x455350=_0x1c1a[_0x2ac2b1];return _0x455350;};'use strict';var _=require(_0xa1c1('0x0'));var util=require(_0xa1c1('0x1'));var moment=require(_0xa1c1('0x2'));var BPromise=require(_0xa1c1('0x3'));var rs=require(_0xa1c1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1c1('0x5'))['db'];var utils=require(_0xa1c1('0x6'));var logger=require(_0xa1c1('0x7'))('rpc');var config=require(_0xa1c1('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d1605,_0x2d8f09,_0x387a45){return new BPromise(function(_0x426841,_0xe759da){return client[_0xa1c1('0x9')](_0x1d1605,_0x387a45)[_0xa1c1('0xa')](function(_0x596da1){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x2d8f09,_0xa1c1('0xb'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x2d8f09,_0xa1c1('0xb'),JSON['stringify'](_0x596da1));if(_0x596da1[_0xa1c1('0xc')]){if(_0x596da1[_0xa1c1('0xc')]['code']===0x1f4){logger[_0xa1c1('0xc')](_0xa1c1('0xd'),_0x2d8f09,_0x596da1[_0xa1c1('0xc')][_0xa1c1('0xe')]);return _0xe759da(_0x596da1[_0xa1c1('0xc')][_0xa1c1('0xe')]);}logger[_0xa1c1('0xc')](_0xa1c1('0xd'),_0x2d8f09,_0x596da1[_0xa1c1('0xc')][_0xa1c1('0xe')]);return _0x426841(_0x596da1[_0xa1c1('0xc')][_0xa1c1('0xe')]);}else{logger[_0xa1c1('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x2d8f09,'request\x20sent');_0x426841(_0x596da1['result'][_0xa1c1('0xe')]);}})['catch'](function(_0x273570){logger['error'](_0xa1c1('0xd'),_0x2d8f09,_0x273570);_0xe759da(_0x273570);});});}