Built motion from commit (unavailable).|2.4.18
[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 _0x56f8=['request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x4b8f70,_0x23d6ab){var _0x215d59=function(_0x134672){while(--_0x134672){_0x4b8f70['push'](_0x4b8f70['shift']());}};_0x215d59(++_0x23d6ab);}(_0x56f8,0x1c1));var _0x856f=function(_0x5114c9,_0x496b99){_0x5114c9=_0x5114c9-0x0;var _0x257534=_0x56f8[_0x5114c9];return _0x257534;};'use strict';var _=require(_0x856f('0x0'));var util=require(_0x856f('0x1'));var moment=require('moment');var BPromise=require(_0x856f('0x2'));var rs=require(_0x856f('0x3'));var fs=require('fs');var Redis=require(_0x856f('0x4'));var db=require(_0x856f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x856f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x856f('0x7')][_0x856f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x513e74,_0x1fd69b,_0x39665a){return new BPromise(function(_0x45c754,_0x10d377){return client[_0x856f('0x9')](_0x513e74,_0x39665a)[_0x856f('0xa')](function(_0x540c68){logger[_0x856f('0xb')](_0x856f('0xc'),_0x1fd69b,_0x856f('0xd'));logger[_0x856f('0xe')](_0x856f('0xf'),_0x1fd69b,_0x856f('0xd'),JSON[_0x856f('0x10')](_0x540c68));if(_0x540c68['error']){if(_0x540c68[_0x856f('0x11')][_0x856f('0x12')]===0x1f4){logger[_0x856f('0x11')](_0x856f('0xc'),_0x1fd69b,_0x540c68[_0x856f('0x11')][_0x856f('0x13')]);return _0x10d377(_0x540c68[_0x856f('0x11')][_0x856f('0x13')]);}logger[_0x856f('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1fd69b,_0x540c68[_0x856f('0x11')][_0x856f('0x13')]);return _0x45c754(_0x540c68['error']['message']);}else{logger['info'](_0x856f('0xc'),_0x1fd69b,_0x856f('0xd'));_0x45c754(_0x540c68['result'][_0x856f('0x13')]);}})[_0x856f('0x14')](function(_0x381145){logger[_0x856f('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1fd69b,_0x381145);_0x10d377(_0x381145);});});}