Built motion from commit a679711e.|2.6.15
[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 _0xc2f3=['client','http','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0xc2f3,0x1d3));var _0x3c2f=function(_0x522df1,_0x4ffa8d){_0x522df1=_0x522df1-0x0;var _0x87ead3=_0xc2f3[_0x522df1];return _0x87ead3;};'use strict';var _=require(_0x3c2f('0x0'));var util=require(_0x3c2f('0x1'));var moment=require('moment');var BPromise=require(_0x3c2f('0x2'));var rs=require(_0x3c2f('0x3'));var fs=require('fs');var Redis=require(_0x3c2f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c2f('0x5'));var logger=require(_0x3c2f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3c2f('0x7'));var client=jayson[_0x3c2f('0x8')][_0x3c2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dd74d,_0x3dfc69,_0x182782){return new BPromise(function(_0x5aa4ad,_0x38c439){return client['request'](_0x1dd74d,_0x182782)['then'](function(_0x5827ea){logger[_0x3c2f('0xa')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3dfc69,_0x3c2f('0xb'));logger[_0x3c2f('0xc')](_0x3c2f('0xd'),_0x3dfc69,'request\x20sent',JSON['stringify'](_0x5827ea));if(_0x5827ea[_0x3c2f('0xe')]){if(_0x5827ea[_0x3c2f('0xe')][_0x3c2f('0xf')]===0x1f4){logger['error'](_0x3c2f('0x10'),_0x3dfc69,_0x5827ea[_0x3c2f('0xe')][_0x3c2f('0x11')]);return _0x38c439(_0x5827ea[_0x3c2f('0xe')][_0x3c2f('0x11')]);}logger[_0x3c2f('0xe')](_0x3c2f('0x10'),_0x3dfc69,_0x5827ea['error'][_0x3c2f('0x11')]);return _0x5aa4ad(_0x5827ea[_0x3c2f('0xe')][_0x3c2f('0x11')]);}else{logger[_0x3c2f('0xa')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3dfc69,'request\x20sent');_0x5aa4ad(_0x5827ea[_0x3c2f('0x12')]['message']);}})['catch'](function(_0x1e6e7b){logger[_0x3c2f('0xe')](_0x3c2f('0x10'),_0x3dfc69,_0x1e6e7b);_0x38c439(_0x1e6e7b);});});}