Built motion from commit 97153652.|2.6.26
[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 _0x2f0b=['../../config/environment','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1abdba,_0x442f96){var _0xb618d4=function(_0x2a2ffa){while(--_0x2a2ffa){_0x1abdba['push'](_0x1abdba['shift']());}};_0xb618d4(++_0x442f96);}(_0x2f0b,0xc2));var _0xb2f0=function(_0x2b39c4,_0x1f9419){_0x2b39c4=_0x2b39c4-0x0;var _0x429ad8=_0x2f0b[_0x2b39c4];return _0x429ad8;};'use strict';var _=require(_0xb2f0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb2f0('0x1'));var rs=require(_0xb2f0('0x2'));var fs=require('fs');var Redis=require(_0xb2f0('0x3'));var db=require(_0xb2f0('0x4'))['db'];var utils=require(_0xb2f0('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb2f0('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb2f0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4f4a32,_0xc8fdc7,_0x4b1c75){return new BPromise(function(_0x5edb28,_0x55ed5b){return client[_0xb2f0('0x8')](_0x4f4a32,_0x4b1c75)[_0xb2f0('0x9')](function(_0x19b76f){logger[_0xb2f0('0xa')](_0xb2f0('0xb'),_0xc8fdc7,_0xb2f0('0xc'));logger['debug'](_0xb2f0('0xd'),_0xc8fdc7,_0xb2f0('0xc'),JSON[_0xb2f0('0xe')](_0x19b76f));if(_0x19b76f['error']){if(_0x19b76f[_0xb2f0('0xf')][_0xb2f0('0x10')]===0x1f4){logger['error'](_0xb2f0('0xb'),_0xc8fdc7,_0x19b76f[_0xb2f0('0xf')][_0xb2f0('0x11')]);return _0x55ed5b(_0x19b76f[_0xb2f0('0xf')][_0xb2f0('0x11')]);}logger[_0xb2f0('0xf')](_0xb2f0('0xb'),_0xc8fdc7,_0x19b76f[_0xb2f0('0xf')][_0xb2f0('0x11')]);return _0x5edb28(_0x19b76f[_0xb2f0('0xf')][_0xb2f0('0x11')]);}else{logger[_0xb2f0('0xa')](_0xb2f0('0xb'),_0xc8fdc7,'request\x20sent');_0x5edb28(_0x19b76f[_0xb2f0('0x12')][_0xb2f0('0x11')]);}})[_0xb2f0('0x13')](function(_0x4f9a8d){logger[_0xb2f0('0xf')](_0xb2f0('0xb'),_0xc8fdc7,_0x4f9a8d);_0x55ed5b(_0x4f9a8d);});});}