Built motion from commit (unavailable).|2.4.20
[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 _0x82a9=['ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0x82a9,0x87));var _0x982a=function(_0x5b8f7a,_0x288998){_0x5b8f7a=_0x5b8f7a-0x0;var _0x590140=_0x82a9[_0x5b8f7a];return _0x590140;};'use strict';var _=require(_0x982a('0x0'));var util=require(_0x982a('0x1'));var moment=require(_0x982a('0x2'));var BPromise=require(_0x982a('0x3'));var rs=require(_0x982a('0x4'));var fs=require('fs');var Redis=require(_0x982a('0x5'));var db=require(_0x982a('0x6'))['db'];var utils=require(_0x982a('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x982a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x982a('0x9')][_0x982a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3574ba,_0x4dc47c,_0x251e7d){return new BPromise(function(_0x4c5a3f,_0x356537){return client['request'](_0x3574ba,_0x251e7d)['then'](function(_0x502c0b){logger['info'](_0x982a('0xb'),_0x4dc47c,_0x982a('0xc'));logger[_0x982a('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x4dc47c,_0x982a('0xc'),JSON[_0x982a('0xe')](_0x502c0b));if(_0x502c0b[_0x982a('0xf')]){if(_0x502c0b[_0x982a('0xf')]['code']===0x1f4){logger[_0x982a('0xf')](_0x982a('0xb'),_0x4dc47c,_0x502c0b[_0x982a('0xf')][_0x982a('0x10')]);return _0x356537(_0x502c0b[_0x982a('0xf')][_0x982a('0x10')]);}logger[_0x982a('0xf')](_0x982a('0xb'),_0x4dc47c,_0x502c0b[_0x982a('0xf')][_0x982a('0x10')]);return _0x4c5a3f(_0x502c0b[_0x982a('0xf')][_0x982a('0x10')]);}else{logger[_0x982a('0x11')](_0x982a('0xb'),_0x4dc47c,_0x982a('0xc'));_0x4c5a3f(_0x502c0b[_0x982a('0x12')][_0x982a('0x10')]);}})[_0x982a('0x13')](function(_0x579553){logger[_0x982a('0xf')](_0x982a('0xb'),_0x4dc47c,_0x579553);_0x356537(_0x579553);});});}