Built motion from commit 14588770.|2.5.38
[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 _0x2fec=['../../config/logger','../../config/environment','jayson/promise','client','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x49deb6,_0x24fac1){var _0x5815a6=function(_0x5500e5){while(--_0x5500e5){_0x49deb6['push'](_0x49deb6['shift']());}};_0x5815a6(++_0x24fac1);}(_0x2fec,0x13e));var _0xc2fe=function(_0x2c0c0c,_0x471e08){_0x2c0c0c=_0x2c0c0c-0x0;var _0x56a90e=_0x2fec[_0x2c0c0c];return _0x56a90e;};'use strict';var _=require('lodash');var util=require(_0xc2fe('0x0'));var moment=require(_0xc2fe('0x1'));var BPromise=require(_0xc2fe('0x2'));var rs=require(_0xc2fe('0x3'));var fs=require('fs');var Redis=require(_0xc2fe('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc2fe('0x5'))('rpc');var config=require(_0xc2fe('0x6'));var jayson=require(_0xc2fe('0x7'));var client=jayson[_0xc2fe('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x493dcb,_0xbccc84,_0x486550){return new BPromise(function(_0x472235,_0x5dd602){return client['request'](_0x493dcb,_0x486550)[_0xc2fe('0x9')](function(_0x2b2cf7){logger['info'](_0xc2fe('0xa'),_0xbccc84,_0xc2fe('0xb'));logger['debug'](_0xc2fe('0xc'),_0xbccc84,_0xc2fe('0xb'),JSON[_0xc2fe('0xd')](_0x2b2cf7));if(_0x2b2cf7[_0xc2fe('0xe')]){if(_0x2b2cf7[_0xc2fe('0xe')][_0xc2fe('0xf')]===0x1f4){logger[_0xc2fe('0xe')](_0xc2fe('0xa'),_0xbccc84,_0x2b2cf7[_0xc2fe('0xe')][_0xc2fe('0x10')]);return _0x5dd602(_0x2b2cf7[_0xc2fe('0xe')][_0xc2fe('0x10')]);}logger[_0xc2fe('0xe')](_0xc2fe('0xa'),_0xbccc84,_0x2b2cf7['error'][_0xc2fe('0x10')]);return _0x472235(_0x2b2cf7[_0xc2fe('0xe')][_0xc2fe('0x10')]);}else{logger[_0xc2fe('0x11')](_0xc2fe('0xa'),_0xbccc84,_0xc2fe('0xb'));_0x472235(_0x2b2cf7['result'][_0xc2fe('0x10')]);}})[_0xc2fe('0x12')](function(_0x18a7f3){logger[_0xc2fe('0xe')](_0xc2fe('0xa'),_0xbccc84,_0x18a7f3);_0x5dd602(_0x18a7f3);});});}