69ef0221d703599f6c014786cee84cb578bf7b0a
[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 _0xf4c8=['jayson/promise','client','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x12c08c,_0x6a91d0){var _0x361d0a=function(_0x1692cb){while(--_0x1692cb){_0x12c08c['push'](_0x12c08c['shift']());}};_0x361d0a(++_0x6a91d0);}(_0xf4c8,0x142));var _0x8f4c=function(_0x27e2c8,_0x5f40a0){_0x27e2c8=_0x27e2c8-0x0;var _0x5454d4=_0xf4c8[_0x27e2c8];return _0x5454d4;};'use strict';var _=require(_0x8f4c('0x0'));var util=require(_0x8f4c('0x1'));var moment=require(_0x8f4c('0x2'));var BPromise=require('bluebird');var rs=require(_0x8f4c('0x3'));var fs=require('fs');var Redis=require(_0x8f4c('0x4'));var db=require(_0x8f4c('0x5'))['db'];var utils=require(_0x8f4c('0x6'));var logger=require(_0x8f4c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8f4c('0x8'));var client=jayson[_0x8f4c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a48a1,_0x58b747,_0x18095f){return new BPromise(function(_0x31d2ec,_0x23379b){return client['request'](_0x2a48a1,_0x18095f)[_0x8f4c('0xa')](function(_0xf91770){logger['info'](_0x8f4c('0xb'),_0x58b747,_0x8f4c('0xc'));logger[_0x8f4c('0xd')](_0x8f4c('0xe'),_0x58b747,_0x8f4c('0xc'),JSON[_0x8f4c('0xf')](_0xf91770));if(_0xf91770[_0x8f4c('0x10')]){if(_0xf91770[_0x8f4c('0x10')][_0x8f4c('0x11')]===0x1f4){logger[_0x8f4c('0x10')](_0x8f4c('0xb'),_0x58b747,_0xf91770['error'][_0x8f4c('0x12')]);return _0x23379b(_0xf91770[_0x8f4c('0x10')][_0x8f4c('0x12')]);}logger[_0x8f4c('0x10')](_0x8f4c('0xb'),_0x58b747,_0xf91770[_0x8f4c('0x10')][_0x8f4c('0x12')]);return _0x31d2ec(_0xf91770[_0x8f4c('0x10')][_0x8f4c('0x12')]);}else{logger[_0x8f4c('0x13')](_0x8f4c('0xb'),_0x58b747,'request\x20sent');_0x31d2ec(_0xf91770[_0x8f4c('0x14')]['message']);}})[_0x8f4c('0x15')](function(_0x5933eb){logger[_0x8f4c('0x10')](_0x8f4c('0xb'),_0x58b747,_0x5933eb);_0x23379b(_0x5933eb);});});}