4d06b3cfc371135e1788880941adbc65d07f2b48
[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 _0x7795=['request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xfbe06e,_0x2fb7ab){var _0x24e5b6=function(_0x48569f){while(--_0x48569f){_0xfbe06e['push'](_0xfbe06e['shift']());}};_0x24e5b6(++_0x2fb7ab);}(_0x7795,0x17f));var _0x5779=function(_0x171d41,_0xa3ba90){_0x171d41=_0x171d41-0x0;var _0x2df787=_0x7795[_0x171d41];return _0x2df787;};'use strict';var _=require(_0x5779('0x0'));var util=require(_0x5779('0x1'));var moment=require(_0x5779('0x2'));var BPromise=require('bluebird');var rs=require(_0x5779('0x3'));var fs=require('fs');var Redis=require(_0x5779('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5779('0x5'))('rpc');var config=require(_0x5779('0x6'));var jayson=require(_0x5779('0x7'));var client=jayson[_0x5779('0x8')][_0x5779('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12a6a5,_0x43ba77,_0x5552cf){return new BPromise(function(_0x479b25,_0x4fc5f9){return client[_0x5779('0xa')](_0x12a6a5,_0x5552cf)[_0x5779('0xb')](function(_0x42de81){logger[_0x5779('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x43ba77,_0x5779('0xd'));logger['debug'](_0x5779('0xe'),_0x43ba77,_0x5779('0xd'),JSON[_0x5779('0xf')](_0x42de81));if(_0x42de81[_0x5779('0x10')]){if(_0x42de81['error'][_0x5779('0x11')]===0x1f4){logger[_0x5779('0x10')](_0x5779('0x12'),_0x43ba77,_0x42de81['error'][_0x5779('0x13')]);return _0x4fc5f9(_0x42de81[_0x5779('0x10')][_0x5779('0x13')]);}logger[_0x5779('0x10')](_0x5779('0x12'),_0x43ba77,_0x42de81[_0x5779('0x10')][_0x5779('0x13')]);return _0x479b25(_0x42de81[_0x5779('0x10')][_0x5779('0x13')]);}else{logger[_0x5779('0xc')](_0x5779('0x12'),_0x43ba77,_0x5779('0xd'));_0x479b25(_0x42de81[_0x5779('0x14')]['message']);}})[_0x5779('0x15')](function(_0x17057d){logger[_0x5779('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x43ba77,_0x17057d);_0x4fc5f9(_0x17057d);});});}