c52c84aa5dc116f4a27e8fefdbd7be01e195ea1f
[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 _0xf435=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0xf435,0x14d));var _0x5f43=function(_0x5a0364,_0x2ed849){_0x5a0364=_0x5a0364-0x0;var _0x3d00e2=_0xf435[_0x5a0364];return _0x3d00e2;};'use strict';var _=require(_0x5f43('0x0'));var util=require(_0x5f43('0x1'));var moment=require(_0x5f43('0x2'));var BPromise=require(_0x5f43('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f43('0x4'));var db=require(_0x5f43('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f43('0x6'))(_0x5f43('0x7'));var config=require('../../config/environment');var jayson=require(_0x5f43('0x8'));var client=jayson[_0x5f43('0x9')][_0x5f43('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x263f9a,_0x110096,_0x2ab2e3){return new BPromise(function(_0x3b5224,_0x3c7a59){return client['request'](_0x263f9a,_0x2ab2e3)[_0x5f43('0xb')](function(_0x43d480){logger[_0x5f43('0xc')](_0x5f43('0xd'),_0x110096,_0x5f43('0xe'));logger['debug'](_0x5f43('0xf'),_0x110096,_0x5f43('0xe'),JSON['stringify'](_0x43d480));if(_0x43d480[_0x5f43('0x10')]){if(_0x43d480['error'][_0x5f43('0x11')]===0x1f4){logger[_0x5f43('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x110096,_0x43d480[_0x5f43('0x10')][_0x5f43('0x12')]);return _0x3c7a59(_0x43d480[_0x5f43('0x10')][_0x5f43('0x12')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x110096,_0x43d480['error'][_0x5f43('0x12')]);return _0x3b5224(_0x43d480['error']['message']);}else{logger['info'](_0x5f43('0xd'),_0x110096,_0x5f43('0xe'));_0x3b5224(_0x43d480[_0x5f43('0x13')][_0x5f43('0x12')]);}})[_0x5f43('0x14')](function(_0x33ed7e){logger[_0x5f43('0x10')](_0x5f43('0xd'),_0x110096,_0x33ed7e);_0x3c7a59(_0x33ed7e);});});}