Built motion from commit 9e1399f3.|2.5.37
[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 _0xb5da=['debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x18adcd,_0x2932af){var _0xf6cb6f=function(_0x101210){while(--_0x101210){_0x18adcd['push'](_0x18adcd['shift']());}};_0xf6cb6f(++_0x2932af);}(_0xb5da,0xd7));var _0xab5d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xb5da[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xab5d('0x0'));var moment=require(_0xab5d('0x1'));var BPromise=require(_0xab5d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab5d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xab5d('0x4'))(_0xab5d('0x5'));var config=require(_0xab5d('0x6'));var jayson=require(_0xab5d('0x7'));var client=jayson[_0xab5d('0x8')][_0xab5d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x484a35,_0x353579,_0x535359){return new BPromise(function(_0x420e47,_0x369e85){return client['request'](_0x484a35,_0x535359)['then'](function(_0x461801){logger[_0xab5d('0xa')](_0xab5d('0xb'),_0x353579,_0xab5d('0xc'));logger[_0xab5d('0xd')](_0xab5d('0xe'),_0x353579,_0xab5d('0xc'),JSON[_0xab5d('0xf')](_0x461801));if(_0x461801['error']){if(_0x461801[_0xab5d('0x10')][_0xab5d('0x11')]===0x1f4){logger[_0xab5d('0x10')](_0xab5d('0xb'),_0x353579,_0x461801[_0xab5d('0x10')]['message']);return _0x369e85(_0x461801[_0xab5d('0x10')][_0xab5d('0x12')]);}logger[_0xab5d('0x10')](_0xab5d('0xb'),_0x353579,_0x461801[_0xab5d('0x10')][_0xab5d('0x12')]);return _0x420e47(_0x461801['error'][_0xab5d('0x12')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x353579,'request\x20sent');_0x420e47(_0x461801['result'][_0xab5d('0x12')]);}})['catch'](function(_0x290b17){logger[_0xab5d('0x10')](_0xab5d('0xb'),_0x353579,_0x290b17);_0x369e85(_0x290b17);});});}