Built motion from commit 953226e6.|2.6.32
[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 _0xf781=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','lodash','util','moment','randomstring'];(function(_0x1533bb,_0x27cd5a){var _0x3599bd=function(_0x116a1f){while(--_0x116a1f){_0x1533bb['push'](_0x1533bb['shift']());}};_0x3599bd(++_0x27cd5a);}(_0xf781,0xc4));var _0x1f78=function(_0xe321f4,_0x5a0b41){_0xe321f4=_0xe321f4-0x0;var _0x577228=_0xf781[_0xe321f4];return _0x577228;};'use strict';var _=require(_0x1f78('0x0'));var util=require(_0x1f78('0x1'));var moment=require(_0x1f78('0x2'));var BPromise=require('bluebird');var rs=require(_0x1f78('0x3'));var fs=require('fs');var Redis=require(_0x1f78('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f78('0x5'));var logger=require('../../config/logger')(_0x1f78('0x6'));var config=require(_0x1f78('0x7'));var jayson=require(_0x1f78('0x8'));var client=jayson[_0x1f78('0x9')][_0x1f78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5111dd,_0x880c44,_0x4d41e9){return new BPromise(function(_0x44350c,_0x44b9c8){return client['request'](_0x5111dd,_0x4d41e9)[_0x1f78('0xb')](function(_0x5e2585){logger[_0x1f78('0xc')](_0x1f78('0xd'),_0x880c44,'request\x20sent');logger[_0x1f78('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x880c44,_0x1f78('0xf'),JSON['stringify'](_0x5e2585));if(_0x5e2585[_0x1f78('0x10')]){if(_0x5e2585[_0x1f78('0x10')][_0x1f78('0x11')]===0x1f4){logger[_0x1f78('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x880c44,_0x5e2585['error'][_0x1f78('0x12')]);return _0x44b9c8(_0x5e2585['error'][_0x1f78('0x12')]);}logger[_0x1f78('0x10')](_0x1f78('0xd'),_0x880c44,_0x5e2585[_0x1f78('0x10')][_0x1f78('0x12')]);return _0x44350c(_0x5e2585[_0x1f78('0x10')]['message']);}else{logger['info'](_0x1f78('0xd'),_0x880c44,_0x1f78('0xf'));_0x44350c(_0x5e2585['result']['message']);}})[_0x1f78('0x13')](function(_0x47dd75){logger[_0x1f78('0x10')](_0x1f78('0xd'),_0x880c44,_0x47dd75);_0x44b9c8(_0x47dd75);});});}