fffced661daa0b5bd350d1aeb26b9fcecedee195
[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 _0x12ca=['then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2c9ee8,_0x551fd5){var _0x5c0a6a=function(_0x357720){while(--_0x357720){_0x2c9ee8['push'](_0x2c9ee8['shift']());}};_0x5c0a6a(++_0x551fd5);}(_0x12ca,0x9c));var _0xa12c=function(_0x198480,_0x574b93){_0x198480=_0x198480-0x0;var _0x58dff5=_0x12ca[_0x198480];return _0x58dff5;};'use strict';var _=require(_0xa12c('0x0'));var util=require(_0xa12c('0x1'));var moment=require('moment');var BPromise=require(_0xa12c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa12c('0x3'))['db'];var utils=require(_0xa12c('0x4'));var logger=require(_0xa12c('0x5'))(_0xa12c('0x6'));var config=require(_0xa12c('0x7'));var jayson=require(_0xa12c('0x8'));var client=jayson[_0xa12c('0x9')][_0xa12c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfc8278,_0x4f5f2c,_0x5b1932){return new BPromise(function(_0x1ca945,_0x352f47){return client[_0xa12c('0xb')](_0xfc8278,_0x5b1932)[_0xa12c('0xc')](function(_0x3fb1fe){logger[_0xa12c('0xd')](_0xa12c('0xe'),_0x4f5f2c,_0xa12c('0xf'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x4f5f2c,_0xa12c('0xf'),JSON['stringify'](_0x3fb1fe));if(_0x3fb1fe[_0xa12c('0x10')]){if(_0x3fb1fe['error'][_0xa12c('0x11')]===0x1f4){logger[_0xa12c('0x10')](_0xa12c('0xe'),_0x4f5f2c,_0x3fb1fe['error'][_0xa12c('0x12')]);return _0x352f47(_0x3fb1fe[_0xa12c('0x10')]['message']);}logger[_0xa12c('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4f5f2c,_0x3fb1fe['error']['message']);return _0x1ca945(_0x3fb1fe[_0xa12c('0x10')][_0xa12c('0x12')]);}else{logger[_0xa12c('0xd')](_0xa12c('0xe'),_0x4f5f2c,_0xa12c('0xf'));_0x1ca945(_0x3fb1fe[_0xa12c('0x13')]['message']);}})[_0xa12c('0x14')](function(_0x39d8da){logger[_0xa12c('0x10')](_0xa12c('0xe'),_0x4f5f2c,_0x39d8da);_0x352f47(_0x39d8da);});});}