1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x487c=['stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x139caa,_0x3f4b0b){var _0xae1816=function(_0x19714a){while(--_0x19714a){_0x139caa['push'](_0x139caa['shift']());}};_0xae1816(++_0x3f4b0b);}(_0x487c,0x85));var _0xc487=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x487c[_0x5b561d];return _0x431060;};'use strict';var _=require(_0xc487('0x0'));var util=require('util');var moment=require(_0xc487('0x1'));var BPromise=require(_0xc487('0x2'));var rs=require(_0xc487('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc487('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc487('0x5'))(_0xc487('0x6'));var config=require('../../config/environment');var jayson=require(_0xc487('0x7'));var client=jayson[_0xc487('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc46fde,_0x2d2664,_0x1c6ee4){return new BPromise(function(_0x12c54e,_0x44d37b){return client[_0xc487('0x9')](_0xc46fde,_0x1c6ee4)[_0xc487('0xa')](function(_0x475efd){logger[_0xc487('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2d2664,_0xc487('0xc'));logger['debug'](_0xc487('0xd'),_0x2d2664,'request\x20sent',JSON[_0xc487('0xe')](_0x475efd));if(_0x475efd[_0xc487('0xf')]){if(_0x475efd[_0xc487('0xf')][_0xc487('0x10')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x2d2664,_0x475efd[_0xc487('0xf')][_0xc487('0x11')]);return _0x44d37b(_0x475efd['error'][_0xc487('0x11')]);}logger['error'](_0xc487('0x12'),_0x2d2664,_0x475efd[_0xc487('0xf')]['message']);return _0x12c54e(_0x475efd['error']['message']);}else{logger[_0xc487('0xb')](_0xc487('0x12'),_0x2d2664,'request\x20sent');_0x12c54e(_0x475efd[_0xc487('0x13')][_0xc487('0x11')]);}})[_0xc487('0x14')](function(_0x18e81d){logger[_0xc487('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2d2664,_0x18e81d);_0x44d37b(_0x18e81d);});});}