Built motion from commit 775e2a94.|2.6.3
[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 _0x3e62=['info','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x3e62,0x78));var _0x23e6=function(_0x36b0b4,_0x3aee14){_0x36b0b4=_0x36b0b4-0x0;var _0x172121=_0x3e62[_0x36b0b4];return _0x172121;};'use strict';var _=require(_0x23e6('0x0'));var util=require(_0x23e6('0x1'));var moment=require(_0x23e6('0x2'));var BPromise=require(_0x23e6('0x3'));var rs=require(_0x23e6('0x4'));var fs=require('fs');var Redis=require(_0x23e6('0x5'));var db=require(_0x23e6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x23e6('0x7'))(_0x23e6('0x8'));var config=require(_0x23e6('0x9'));var jayson=require(_0x23e6('0xa'));var client=jayson[_0x23e6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x522418,_0x544d9f,_0x40d4cc){return new BPromise(function(_0x41cbd1,_0x3a7ba0){return client['request'](_0x522418,_0x40d4cc)['then'](function(_0x3f4853){logger[_0x23e6('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x544d9f,_0x23e6('0xd'));logger['debug'](_0x23e6('0xe'),_0x544d9f,_0x23e6('0xd'),JSON[_0x23e6('0xf')](_0x3f4853));if(_0x3f4853['error']){if(_0x3f4853['error'][_0x23e6('0x10')]===0x1f4){logger[_0x23e6('0x11')](_0x23e6('0x12'),_0x544d9f,_0x3f4853[_0x23e6('0x11')]['message']);return _0x3a7ba0(_0x3f4853[_0x23e6('0x11')]['message']);}logger[_0x23e6('0x11')](_0x23e6('0x12'),_0x544d9f,_0x3f4853[_0x23e6('0x11')][_0x23e6('0x13')]);return _0x41cbd1(_0x3f4853[_0x23e6('0x11')]['message']);}else{logger[_0x23e6('0xc')](_0x23e6('0x12'),_0x544d9f,_0x23e6('0xd'));_0x41cbd1(_0x3f4853[_0x23e6('0x14')][_0x23e6('0x13')]);}})[_0x23e6('0x15')](function(_0x28af82){logger[_0x23e6('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x544d9f,_0x28af82);_0x3a7ba0(_0x28af82);});});}