Built motion from commit cb845558.|2.6.34
[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 _0x8a89=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x40c120,_0x945e7a){var _0xe9f0d=function(_0x40c637){while(--_0x40c637){_0x40c120['push'](_0x40c120['shift']());}};_0xe9f0d(++_0x945e7a);}(_0x8a89,0xf7));var _0x98a8=function(_0x1b2748,_0x4b3ad2){_0x1b2748=_0x1b2748-0x0;var _0x18fe11=_0x8a89[_0x1b2748];return _0x18fe11;};'use strict';var _=require(_0x98a8('0x0'));var util=require(_0x98a8('0x1'));var moment=require(_0x98a8('0x2'));var BPromise=require(_0x98a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98a8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x98a8('0x5'))(_0x98a8('0x6'));var config=require(_0x98a8('0x7'));var jayson=require(_0x98a8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x251703,_0x3d763f,_0xe3e42d){return new BPromise(function(_0xfdb3bb,_0x554e42){return client[_0x98a8('0x9')](_0x251703,_0xe3e42d)[_0x98a8('0xa')](function(_0x1b298a){logger[_0x98a8('0xb')](_0x98a8('0xc'),_0x3d763f,_0x98a8('0xd'));logger[_0x98a8('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3d763f,_0x98a8('0xd'),JSON[_0x98a8('0xf')](_0x1b298a));if(_0x1b298a[_0x98a8('0x10')]){if(_0x1b298a['error'][_0x98a8('0x11')]===0x1f4){logger[_0x98a8('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3d763f,_0x1b298a[_0x98a8('0x10')]['message']);return _0x554e42(_0x1b298a['error']['message']);}logger[_0x98a8('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3d763f,_0x1b298a[_0x98a8('0x10')][_0x98a8('0x12')]);return _0xfdb3bb(_0x1b298a[_0x98a8('0x10')]['message']);}else{logger[_0x98a8('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3d763f,'request\x20sent');_0xfdb3bb(_0x1b298a[_0x98a8('0x13')][_0x98a8('0x12')]);}})[_0x98a8('0x14')](function(_0xed7da3){logger[_0x98a8('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3d763f,_0xed7da3);_0x554e42(_0xed7da3);});});}