Built motion from commit d5e4af8c.|2.6.23
[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 _0x875e=['SalesforceConfiguration,\x20%s,\x20%s','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x394dea,_0x252474){var _0x3a2054=function(_0xd47d76){while(--_0xd47d76){_0x394dea['push'](_0x394dea['shift']());}};_0x3a2054(++_0x252474);}(_0x875e,0x82));var _0xe875=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0x875e[_0x18a436];return _0x5c2cf8;};'use strict';var _=require(_0xe875('0x0'));var util=require(_0xe875('0x1'));var moment=require(_0xe875('0x2'));var BPromise=require('bluebird');var rs=require(_0xe875('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe875('0x4'))['db'];var utils=require(_0xe875('0x5'));var logger=require(_0xe875('0x6'))(_0xe875('0x7'));var config=require('../../config/environment');var jayson=require(_0xe875('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd54ffb,_0x362b6c,_0x1ecfd0){return new BPromise(function(_0x29b7a1,_0x3389a1){return client[_0xe875('0x9')](_0xd54ffb,_0x1ecfd0)[_0xe875('0xa')](function(_0xfc4137){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x362b6c,_0xe875('0xb'));logger[_0xe875('0xc')](_0xe875('0xd'),_0x362b6c,_0xe875('0xb'),JSON['stringify'](_0xfc4137));if(_0xfc4137[_0xe875('0xe')]){if(_0xfc4137[_0xe875('0xe')][_0xe875('0xf')]===0x1f4){logger[_0xe875('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x362b6c,_0xfc4137['error'][_0xe875('0x10')]);return _0x3389a1(_0xfc4137[_0xe875('0xe')][_0xe875('0x10')]);}logger[_0xe875('0xe')](_0xe875('0x11'),_0x362b6c,_0xfc4137['error'][_0xe875('0x10')]);return _0x29b7a1(_0xfc4137[_0xe875('0xe')][_0xe875('0x10')]);}else{logger[_0xe875('0x12')](_0xe875('0x11'),_0x362b6c,_0xe875('0xb'));_0x29b7a1(_0xfc4137[_0xe875('0x13')][_0xe875('0x10')]);}})[_0xe875('0x14')](function(_0x451561){logger[_0xe875('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x362b6c,_0x451561);_0x3389a1(_0x451561);});});}