80cdc8cb0810d0f70a933ed2dd259903b28708cc
[motion2.git] / server / api / userProfileSection / userProfileSection.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 _0x64f5=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x581c1e,_0x210a09){var _0x341309=function(_0x136778){while(--_0x136778){_0x581c1e['push'](_0x581c1e['shift']());}};_0x341309(++_0x210a09);}(_0x64f5,0x6e));var _0x564f=function(_0x83a4d7,_0x5e1143){_0x83a4d7=_0x83a4d7-0x0;var _0x400408=_0x64f5[_0x83a4d7];return _0x400408;};'use strict';var _=require(_0x564f('0x0'));var util=require('util');var moment=require(_0x564f('0x1'));var BPromise=require(_0x564f('0x2'));var rs=require(_0x564f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x564f('0x4'))['db'];var utils=require(_0x564f('0x5'));var logger=require('../../config/logger')(_0x564f('0x6'));var config=require(_0x564f('0x7'));var jayson=require(_0x564f('0x8'));var client=jayson[_0x564f('0x9')][_0x564f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53b631,_0x2839a5,_0x52283a){return new BPromise(function(_0x1b4697,_0x2e3168){return client['request'](_0x53b631,_0x52283a)[_0x564f('0xb')](function(_0x1392a8){logger[_0x564f('0xc')](_0x564f('0xd'),_0x2839a5,_0x564f('0xe'));logger[_0x564f('0xf')](_0x564f('0x10'),_0x2839a5,'request\x20sent',JSON[_0x564f('0x11')](_0x1392a8));if(_0x1392a8[_0x564f('0x12')]){if(_0x1392a8[_0x564f('0x12')][_0x564f('0x13')]===0x1f4){logger[_0x564f('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x2839a5,_0x1392a8[_0x564f('0x12')]['message']);return _0x2e3168(_0x1392a8[_0x564f('0x12')][_0x564f('0x14')]);}logger[_0x564f('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x2839a5,_0x1392a8[_0x564f('0x12')]['message']);return _0x1b4697(_0x1392a8[_0x564f('0x12')][_0x564f('0x14')]);}else{logger[_0x564f('0xc')](_0x564f('0xd'),_0x2839a5,'request\x20sent');_0x1b4697(_0x1392a8[_0x564f('0x15')][_0x564f('0x14')]);}})[_0x564f('0x16')](function(_0x3138a3){logger[_0x564f('0x12')](_0x564f('0xd'),_0x2839a5,_0x3138a3);_0x2e3168(_0x3138a3);});});}