10c7bd88a2578e8a8b80fa33df07cf0f29303d06
[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 _0x2ec2=['then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x3f465d,_0xbd2037){var _0x121ad1=function(_0x5b13d6){while(--_0x5b13d6){_0x3f465d['push'](_0x3f465d['shift']());}};_0x121ad1(++_0xbd2037);}(_0x2ec2,0x151));var _0x22ec=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0x2ec2[_0x4e5552];return _0x60a338;};'use strict';var _=require(_0x22ec('0x0'));var util=require(_0x22ec('0x1'));var moment=require(_0x22ec('0x2'));var BPromise=require(_0x22ec('0x3'));var rs=require(_0x22ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22ec('0x5'))['db'];var utils=require(_0x22ec('0x6'));var logger=require(_0x22ec('0x7'))(_0x22ec('0x8'));var config=require(_0x22ec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x22ec('0xa')][_0x22ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ce83f,_0x5a6b0f,_0x20bd30){return new BPromise(function(_0x423fbe,_0x5d52b7){return client[_0x22ec('0xc')](_0x4ce83f,_0x20bd30)[_0x22ec('0xd')](function(_0x153278){logger[_0x22ec('0xe')](_0x22ec('0xf'),_0x5a6b0f,_0x22ec('0x10'));logger[_0x22ec('0x11')](_0x22ec('0x12'),_0x5a6b0f,_0x22ec('0x10'),JSON[_0x22ec('0x13')](_0x153278));if(_0x153278[_0x22ec('0x14')]){if(_0x153278[_0x22ec('0x14')][_0x22ec('0x15')]===0x1f4){logger['error'](_0x22ec('0xf'),_0x5a6b0f,_0x153278[_0x22ec('0x14')][_0x22ec('0x16')]);return _0x5d52b7(_0x153278[_0x22ec('0x14')][_0x22ec('0x16')]);}logger[_0x22ec('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5a6b0f,_0x153278['error'][_0x22ec('0x16')]);return _0x423fbe(_0x153278[_0x22ec('0x14')][_0x22ec('0x16')]);}else{logger[_0x22ec('0xe')](_0x22ec('0xf'),_0x5a6b0f,'request\x20sent');_0x423fbe(_0x153278[_0x22ec('0x17')]['message']);}})[_0x22ec('0x18')](function(_0x3bd970){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x5a6b0f,_0x3bd970);_0x5d52b7(_0x3bd970);});});}