5f414697a55ab554d87c6840ee4feb922a41262f
[motion2.git] / server / api / intSalesforceConfiguration / intSalesforceConfiguration.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 _0xac06=['SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x604f5a,_0x35dc68){var _0x760281=function(_0xd1cd89){while(--_0xd1cd89){_0x604f5a['push'](_0x604f5a['shift']());}};_0x760281(++_0x35dc68);}(_0xac06,0x126));var _0x6ac0=function(_0x469622,_0x23338c){_0x469622=_0x469622-0x0;var _0x19b533=_0xac06[_0x469622];return _0x19b533;};'use strict';var _=require(_0x6ac0('0x0'));var util=require(_0x6ac0('0x1'));var moment=require(_0x6ac0('0x2'));var BPromise=require(_0x6ac0('0x3'));var rs=require(_0x6ac0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6ac0('0x5'));var logger=require(_0x6ac0('0x6'))(_0x6ac0('0x7'));var config=require(_0x6ac0('0x8'));var jayson=require(_0x6ac0('0x9'));var client=jayson['client'][_0x6ac0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x78f6cf,_0x35390b,_0x4c0894){return new BPromise(function(_0x102573,_0x1719d3){return client[_0x6ac0('0xb')](_0x78f6cf,_0x4c0894)[_0x6ac0('0xc')](function(_0x1e66e4){logger[_0x6ac0('0xd')](_0x6ac0('0xe'),_0x35390b,'request\x20sent');logger['debug'](_0x6ac0('0xf'),_0x35390b,'request\x20sent',JSON[_0x6ac0('0x10')](_0x1e66e4));if(_0x1e66e4['error']){if(_0x1e66e4[_0x6ac0('0x11')][_0x6ac0('0x12')]===0x1f4){logger[_0x6ac0('0x11')](_0x6ac0('0xe'),_0x35390b,_0x1e66e4[_0x6ac0('0x11')]['message']);return _0x1719d3(_0x1e66e4[_0x6ac0('0x11')][_0x6ac0('0x13')]);}logger[_0x6ac0('0x11')](_0x6ac0('0xe'),_0x35390b,_0x1e66e4['error'][_0x6ac0('0x13')]);return _0x102573(_0x1e66e4['error']['message']);}else{logger[_0x6ac0('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x35390b,_0x6ac0('0x14'));_0x102573(_0x1e66e4['result']['message']);}})[_0x6ac0('0x15')](function(_0x3555aa){logger[_0x6ac0('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x35390b,_0x3555aa);_0x1719d3(_0x3555aa);});});}