Built motion from commit (unavailable).|2.5.4
[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 _0xf7c4=['result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0xf7c4,0xd1));var _0x4f7c=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xf7c4[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var util=require(_0x4f7c('0x0'));var moment=require(_0x4f7c('0x1'));var BPromise=require('bluebird');var rs=require(_0x4f7c('0x2'));var fs=require('fs');var Redis=require(_0x4f7c('0x3'));var db=require(_0x4f7c('0x4'))['db'];var utils=require(_0x4f7c('0x5'));var logger=require('../../config/logger')(_0x4f7c('0x6'));var config=require('../../config/environment');var jayson=require(_0x4f7c('0x7'));var client=jayson[_0x4f7c('0x8')][_0x4f7c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58a088,_0x4175d5,_0x79c873){return new BPromise(function(_0x533aff,_0x4e293f){return client[_0x4f7c('0xa')](_0x58a088,_0x79c873)[_0x4f7c('0xb')](function(_0x26f690){logger[_0x4f7c('0xc')](_0x4f7c('0xd'),_0x4175d5,_0x4f7c('0xe'));logger[_0x4f7c('0xf')](_0x4f7c('0x10'),_0x4175d5,_0x4f7c('0xe'),JSON[_0x4f7c('0x11')](_0x26f690));if(_0x26f690[_0x4f7c('0x12')]){if(_0x26f690[_0x4f7c('0x12')][_0x4f7c('0x13')]===0x1f4){logger[_0x4f7c('0x12')](_0x4f7c('0xd'),_0x4175d5,_0x26f690[_0x4f7c('0x12')][_0x4f7c('0x14')]);return _0x4e293f(_0x26f690[_0x4f7c('0x12')]['message']);}logger[_0x4f7c('0x12')](_0x4f7c('0xd'),_0x4175d5,_0x26f690[_0x4f7c('0x12')]['message']);return _0x533aff(_0x26f690[_0x4f7c('0x12')][_0x4f7c('0x14')]);}else{logger['info'](_0x4f7c('0xd'),_0x4175d5,_0x4f7c('0xe'));_0x533aff(_0x26f690[_0x4f7c('0x15')][_0x4f7c('0x14')]);}})[_0x4f7c('0x16')](function(_0x4740ae){logger[_0x4f7c('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4175d5,_0x4740ae);_0x4e293f(_0x4740ae);});});}