Built motion from commit b0a9a629.|2.6.33
[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 _0x676e=['client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x173db8,_0x3482d4){var _0x6c4d82=function(_0x528a8b){while(--_0x528a8b){_0x173db8['push'](_0x173db8['shift']());}};_0x6c4d82(++_0x3482d4);}(_0x676e,0xdd));var _0xe676=function(_0x25d4ee,_0xc95872){_0x25d4ee=_0x25d4ee-0x0;var _0x214a35=_0x676e[_0x25d4ee];return _0x214a35;};'use strict';var _=require(_0xe676('0x0'));var util=require(_0xe676('0x1'));var moment=require(_0xe676('0x2'));var BPromise=require(_0xe676('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe676('0x4'));var db=require(_0xe676('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe676('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe676('0x7')][_0xe676('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51b623,_0x13bcc0,_0xe898a9){return new BPromise(function(_0x2a4e27,_0x47fe07){return client[_0xe676('0x9')](_0x51b623,_0xe898a9)[_0xe676('0xa')](function(_0x96d5aa){logger[_0xe676('0xb')](_0xe676('0xc'),_0x13bcc0,_0xe676('0xd'));logger[_0xe676('0xe')](_0xe676('0xf'),_0x13bcc0,_0xe676('0xd'),JSON['stringify'](_0x96d5aa));if(_0x96d5aa[_0xe676('0x10')]){if(_0x96d5aa[_0xe676('0x10')]['code']===0x1f4){logger[_0xe676('0x10')](_0xe676('0xc'),_0x13bcc0,_0x96d5aa[_0xe676('0x10')][_0xe676('0x11')]);return _0x47fe07(_0x96d5aa[_0xe676('0x10')]['message']);}logger[_0xe676('0x10')](_0xe676('0xc'),_0x13bcc0,_0x96d5aa['error'][_0xe676('0x11')]);return _0x2a4e27(_0x96d5aa[_0xe676('0x10')]['message']);}else{logger[_0xe676('0xb')](_0xe676('0xc'),_0x13bcc0,_0xe676('0xd'));_0x2a4e27(_0x96d5aa[_0xe676('0x12')]['message']);}})['catch'](function(_0x370eb4){logger[_0xe676('0x10')](_0xe676('0xc'),_0x13bcc0,_0x370eb4);_0x47fe07(_0x370eb4);});});}