Built motion from commit 10af8726.|2.6.34
[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 _0x8b2e=['lodash','util','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x39471e,_0x4a195d){var _0x51693a=function(_0x2dc0b9){while(--_0x2dc0b9){_0x39471e['push'](_0x39471e['shift']());}};_0x51693a(++_0x4a195d);}(_0x8b2e,0x12c));var _0xe8b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b2e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe8b2('0x0'));var util=require(_0xe8b2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe8b2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe8b2('0x3'));var logger=require(_0xe8b2('0x4'))(_0xe8b2('0x5'));var config=require('../../config/environment');var jayson=require(_0xe8b2('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2742b1,_0x5ee0b7,_0x50e163){return new BPromise(function(_0x51dc09,_0x2dc36f){return client[_0xe8b2('0x7')](_0x2742b1,_0x50e163)[_0xe8b2('0x8')](function(_0x54641f){logger[_0xe8b2('0x9')](_0xe8b2('0xa'),_0x5ee0b7,_0xe8b2('0xb'));logger[_0xe8b2('0xc')](_0xe8b2('0xd'),_0x5ee0b7,_0xe8b2('0xb'),JSON[_0xe8b2('0xe')](_0x54641f));if(_0x54641f[_0xe8b2('0xf')]){if(_0x54641f[_0xe8b2('0xf')][_0xe8b2('0x10')]===0x1f4){logger[_0xe8b2('0xf')](_0xe8b2('0xa'),_0x5ee0b7,_0x54641f[_0xe8b2('0xf')]['message']);return _0x2dc36f(_0x54641f[_0xe8b2('0xf')][_0xe8b2('0x11')]);}logger['error'](_0xe8b2('0xa'),_0x5ee0b7,_0x54641f[_0xe8b2('0xf')]['message']);return _0x51dc09(_0x54641f[_0xe8b2('0xf')]['message']);}else{logger[_0xe8b2('0x9')](_0xe8b2('0xa'),_0x5ee0b7,_0xe8b2('0xb'));_0x51dc09(_0x54641f[_0xe8b2('0x12')][_0xe8b2('0x11')]);}})[_0xe8b2('0x13')](function(_0x42a9a6){logger[_0xe8b2('0xf')](_0xe8b2('0xa'),_0x5ee0b7,_0x42a9a6);_0x2dc36f(_0x42a9a6);});});}