8153991be4ac4038cf4ffaa6b0ffd7df6898102b
[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 _0x4cf1=['catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x47e12d,_0x4f3ce6){var _0x3282c7=function(_0x55feed){while(--_0x55feed){_0x47e12d['push'](_0x47e12d['shift']());}};_0x3282c7(++_0x4f3ce6);}(_0x4cf1,0x65));var _0x14cf=function(_0x5bff0,_0x20716d){_0x5bff0=_0x5bff0-0x0;var _0x3ead2e=_0x4cf1[_0x5bff0];return _0x3ead2e;};'use strict';var _=require(_0x14cf('0x0'));var util=require(_0x14cf('0x1'));var moment=require(_0x14cf('0x2'));var BPromise=require(_0x14cf('0x3'));var rs=require(_0x14cf('0x4'));var fs=require('fs');var Redis=require(_0x14cf('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x14cf('0x6'));var config=require('../../config/environment');var jayson=require(_0x14cf('0x7'));var client=jayson[_0x14cf('0x8')][_0x14cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31c8a7,_0x271a5c,_0x53e29){return new BPromise(function(_0x5242cc,_0x11740d){return client[_0x14cf('0xa')](_0x31c8a7,_0x53e29)[_0x14cf('0xb')](function(_0x348d12){logger[_0x14cf('0xc')](_0x14cf('0xd'),_0x271a5c,_0x14cf('0xe'));logger[_0x14cf('0xf')](_0x14cf('0x10'),_0x271a5c,_0x14cf('0xe'),JSON['stringify'](_0x348d12));if(_0x348d12[_0x14cf('0x11')]){if(_0x348d12[_0x14cf('0x11')]['code']===0x1f4){logger[_0x14cf('0x11')](_0x14cf('0xd'),_0x271a5c,_0x348d12[_0x14cf('0x11')]['message']);return _0x11740d(_0x348d12[_0x14cf('0x11')][_0x14cf('0x12')]);}logger[_0x14cf('0x11')](_0x14cf('0xd'),_0x271a5c,_0x348d12[_0x14cf('0x11')][_0x14cf('0x12')]);return _0x5242cc(_0x348d12['error'][_0x14cf('0x12')]);}else{logger[_0x14cf('0xc')](_0x14cf('0xd'),_0x271a5c,_0x14cf('0xe'));_0x5242cc(_0x348d12['result'][_0x14cf('0x12')]);}})[_0x14cf('0x13')](function(_0x36b8c1){logger[_0x14cf('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x271a5c,_0x36b8c1);_0x11740d(_0x36b8c1);});});}