Built motion from commit (unavailable).|2.5.11
[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 _0x78cf=['rpc','jayson/promise','client','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1e1965,_0x55785c){var _0x1a2e96=function(_0x27d366){while(--_0x27d366){_0x1e1965['push'](_0x1e1965['shift']());}};_0x1a2e96(++_0x55785c);}(_0x78cf,0x133));var _0xf78c=function(_0x31cabf,_0x4fe9a2){_0x31cabf=_0x31cabf-0x0;var _0x276b7f=_0x78cf[_0x31cabf];return _0x276b7f;};'use strict';var _=require(_0xf78c('0x0'));var util=require(_0xf78c('0x1'));var moment=require(_0xf78c('0x2'));var BPromise=require(_0xf78c('0x3'));var rs=require(_0xf78c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf78c('0x5'))['db'];var utils=require(_0xf78c('0x6'));var logger=require(_0xf78c('0x7'))(_0xf78c('0x8'));var config=require('../../config/environment');var jayson=require(_0xf78c('0x9'));var client=jayson[_0xf78c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9d9895,_0x4c9292,_0x498692){return new BPromise(function(_0x3d6540,_0x1065f5){return client[_0xf78c('0xb')](_0x9d9895,_0x498692)[_0xf78c('0xc')](function(_0x794f61){logger[_0xf78c('0xd')](_0xf78c('0xe'),_0x4c9292,_0xf78c('0xf'));logger[_0xf78c('0x10')](_0xf78c('0x11'),_0x4c9292,_0xf78c('0xf'),JSON[_0xf78c('0x12')](_0x794f61));if(_0x794f61['error']){if(_0x794f61[_0xf78c('0x13')]['code']===0x1f4){logger[_0xf78c('0x13')](_0xf78c('0xe'),_0x4c9292,_0x794f61[_0xf78c('0x13')][_0xf78c('0x14')]);return _0x1065f5(_0x794f61['error'][_0xf78c('0x14')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x4c9292,_0x794f61[_0xf78c('0x13')]['message']);return _0x3d6540(_0x794f61['error'][_0xf78c('0x14')]);}else{logger[_0xf78c('0xd')](_0xf78c('0xe'),_0x4c9292,'request\x20sent');_0x3d6540(_0x794f61['result'][_0xf78c('0x14')]);}})['catch'](function(_0x367ab1){logger[_0xf78c('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4c9292,_0x367ab1);_0x1065f5(_0x367ab1);});});}