2510af937f43c5367109a2215225a405aca89268
[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 _0x6b74=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x2fdc53,_0x4768ca){var _0x1b8254=function(_0x2e7849){while(--_0x2e7849){_0x2fdc53['push'](_0x2fdc53['shift']());}};_0x1b8254(++_0x4768ca);}(_0x6b74,0x159));var _0x46b7=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x6b74[_0x503950];return _0x1657a9;};'use strict';var _=require(_0x46b7('0x0'));var util=require(_0x46b7('0x1'));var moment=require(_0x46b7('0x2'));var BPromise=require('bluebird');var rs=require(_0x46b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46b7('0x4'))['db'];var utils=require(_0x46b7('0x5'));var logger=require(_0x46b7('0x6'))(_0x46b7('0x7'));var config=require(_0x46b7('0x8'));var jayson=require(_0x46b7('0x9'));var client=jayson[_0x46b7('0xa')][_0x46b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33fad8,_0x555938,_0xf02cb7){return new BPromise(function(_0x1b45d2,_0x5a3c2e){return client[_0x46b7('0xc')](_0x33fad8,_0xf02cb7)[_0x46b7('0xd')](function(_0x2dbbdc){logger[_0x46b7('0xe')](_0x46b7('0xf'),_0x555938,_0x46b7('0x10'));logger[_0x46b7('0x11')](_0x46b7('0x12'),_0x555938,_0x46b7('0x10'),JSON[_0x46b7('0x13')](_0x2dbbdc));if(_0x2dbbdc[_0x46b7('0x14')]){if(_0x2dbbdc[_0x46b7('0x14')][_0x46b7('0x15')]===0x1f4){logger[_0x46b7('0x14')](_0x46b7('0xf'),_0x555938,_0x2dbbdc[_0x46b7('0x14')][_0x46b7('0x16')]);return _0x5a3c2e(_0x2dbbdc[_0x46b7('0x14')]['message']);}logger[_0x46b7('0x14')](_0x46b7('0xf'),_0x555938,_0x2dbbdc[_0x46b7('0x14')][_0x46b7('0x16')]);return _0x1b45d2(_0x2dbbdc[_0x46b7('0x14')][_0x46b7('0x16')]);}else{logger[_0x46b7('0xe')](_0x46b7('0xf'),_0x555938,'request\x20sent');_0x1b45d2(_0x2dbbdc[_0x46b7('0x17')][_0x46b7('0x16')]);}})[_0x46b7('0x18')](function(_0x178bc4){logger['error'](_0x46b7('0xf'),_0x555938,_0x178bc4);_0x5a3c2e(_0x178bc4);});});}