Built motion from commit (unavailable).|2.5.23
[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 _0xe3a0=['moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','util'];(function(_0x1e0a4a,_0x55752e){var _0x352afd=function(_0x579bae){while(--_0x579bae){_0x1e0a4a['push'](_0x1e0a4a['shift']());}};_0x352afd(++_0x55752e);}(_0xe3a0,0x1e2));var _0x0e3a=function(_0x2b5d30,_0x127512){_0x2b5d30=_0x2b5d30-0x0;var _0x4bb534=_0xe3a0[_0x2b5d30];return _0x4bb534;};'use strict';var _=require('lodash');var util=require(_0x0e3a('0x0'));var moment=require(_0x0e3a('0x1'));var BPromise=require(_0x0e3a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0e3a('0x3'));var logger=require(_0x0e3a('0x4'))(_0x0e3a('0x5'));var config=require(_0x0e3a('0x6'));var jayson=require(_0x0e3a('0x7'));var client=jayson[_0x0e3a('0x8')][_0x0e3a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x497795,_0x2176ca,_0x274d62){return new BPromise(function(_0x4f01b7,_0x49e618){return client[_0x0e3a('0xa')](_0x497795,_0x274d62)[_0x0e3a('0xb')](function(_0x37d337){logger[_0x0e3a('0xc')](_0x0e3a('0xd'),_0x2176ca,_0x0e3a('0xe'));logger[_0x0e3a('0xf')](_0x0e3a('0x10'),_0x2176ca,_0x0e3a('0xe'),JSON['stringify'](_0x37d337));if(_0x37d337['error']){if(_0x37d337[_0x0e3a('0x11')][_0x0e3a('0x12')]===0x1f4){logger[_0x0e3a('0x11')](_0x0e3a('0xd'),_0x2176ca,_0x37d337[_0x0e3a('0x11')][_0x0e3a('0x13')]);return _0x49e618(_0x37d337[_0x0e3a('0x11')][_0x0e3a('0x13')]);}logger[_0x0e3a('0x11')](_0x0e3a('0xd'),_0x2176ca,_0x37d337[_0x0e3a('0x11')]['message']);return _0x4f01b7(_0x37d337['error'][_0x0e3a('0x13')]);}else{logger[_0x0e3a('0xc')](_0x0e3a('0xd'),_0x2176ca,_0x0e3a('0xe'));_0x4f01b7(_0x37d337[_0x0e3a('0x14')][_0x0e3a('0x13')]);}})['catch'](function(_0x3f9146){logger[_0x0e3a('0x11')](_0x0e3a('0xd'),_0x2176ca,_0x3f9146);_0x49e618(_0x3f9146);});});}