Built motion from commit 85328c08.|2.5.50
[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 _0x826f=['SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x5eb8d4,_0x21fdd7){var _0x543c80=function(_0x51da62){while(--_0x51da62){_0x5eb8d4['push'](_0x5eb8d4['shift']());}};_0x543c80(++_0x21fdd7);}(_0x826f,0x1e9));var _0xf826=function(_0x317353,_0x3dae98){_0x317353=_0x317353-0x0;var _0x327e3f=_0x826f[_0x317353];return _0x327e3f;};'use strict';var _=require(_0xf826('0x0'));var util=require(_0xf826('0x1'));var moment=require(_0xf826('0x2'));var BPromise=require(_0xf826('0x3'));var rs=require(_0xf826('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf826('0x5'))['db'];var utils=require(_0xf826('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf826('0x7'));var jayson=require(_0xf826('0x8'));var client=jayson[_0xf826('0x9')][_0xf826('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a54ce,_0x2db002,_0xfc34f0){return new BPromise(function(_0x14bb88,_0x15f260){return client[_0xf826('0xb')](_0x1a54ce,_0xfc34f0)['then'](function(_0xae39c6){logger[_0xf826('0xc')](_0xf826('0xd'),_0x2db002,_0xf826('0xe'));logger['debug'](_0xf826('0xf'),_0x2db002,_0xf826('0xe'),JSON[_0xf826('0x10')](_0xae39c6));if(_0xae39c6[_0xf826('0x11')]){if(_0xae39c6[_0xf826('0x11')][_0xf826('0x12')]===0x1f4){logger[_0xf826('0x11')](_0xf826('0xd'),_0x2db002,_0xae39c6['error'][_0xf826('0x13')]);return _0x15f260(_0xae39c6['error'][_0xf826('0x13')]);}logger['error'](_0xf826('0xd'),_0x2db002,_0xae39c6[_0xf826('0x11')][_0xf826('0x13')]);return _0x14bb88(_0xae39c6['error'][_0xf826('0x13')]);}else{logger[_0xf826('0xc')](_0xf826('0xd'),_0x2db002,_0xf826('0xe'));_0x14bb88(_0xae39c6['result'][_0xf826('0x13')]);}})[_0xf826('0x14')](function(_0x14dc97){logger[_0xf826('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2db002,_0x14dc97);_0x15f260(_0x14dc97);});});}