@lingk/sync 0.1.52 → 0.1.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/css/main.css +1 -1
- package/build/lightning.js.map +1 -1
- package/build/lightningStyles.js.map +1 -1
- package/build/lingk.js.map +1 -1
- package/build/lingkStyles.js.map +1 -1
- package/build/main.js +142 -159
- package/build/main.js.map +1 -1
- package/build/reducer.js +4 -2
- package/build/reducer.js.map +1 -1
- package/package.json +1 -1
package/build/main.js
CHANGED
|
@@ -4932,7 +4932,10 @@ module.exports =
|
|
|
4932
4932
|
Object.defineProperty(exports, "__esModule", {
|
|
4933
4933
|
value: true
|
|
4934
4934
|
});
|
|
4935
|
+
exports.getMetadataFromEnvStep = getMetadataFromEnvStep;
|
|
4935
4936
|
exports.callCheckConnection = callCheckConnection;
|
|
4937
|
+
exports.callCheckConnectionForProvider = callCheckConnectionForProvider;
|
|
4938
|
+
exports.callGetProviderMetadata = callGetProviderMetadata;
|
|
4936
4939
|
exports.getOauthUrl = getOauthUrl;
|
|
4937
4940
|
exports.createLingkExternalIds = createLingkExternalIds;
|
|
4938
4941
|
exports.callTest = callTest;
|
|
@@ -4961,7 +4964,6 @@ module.exports =
|
|
|
4961
4964
|
exports.postCredentials = postCredentials;
|
|
4962
4965
|
exports.callGetCredentials = callGetCredentials;
|
|
4963
4966
|
exports.tryGetCredentials = tryGetCredentials;
|
|
4964
|
-
exports.callGetProviderMetadata = callGetProviderMetadata;
|
|
4965
4967
|
exports.callGetTrigger = callGetTrigger;
|
|
4966
4968
|
exports.setWizardLoaded = setWizardLoaded;
|
|
4967
4969
|
exports.setWizardDataLoaded = setWizardDataLoaded;
|
|
@@ -4981,27 +4983,90 @@ module.exports =
|
|
|
4981
4983
|
|
|
4982
4984
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
4983
4985
|
|
|
4984
|
-
|
|
4986
|
+
// runs when "checkconnection" is click in environment step
|
|
4987
|
+
function getMetadataFromEnvStep(tenantId, appId, mode, providerType, urlSuffix, apiUrl, endpoint, creds) {
|
|
4988
|
+
return function (dispatch) {
|
|
4989
|
+
if (urlSuffix) {
|
|
4990
|
+
dispatch(callGetProviderMetadata(tenantId, appId, urlSuffix, apiUrl, mode, providerType));
|
|
4991
|
+
}
|
|
4992
|
+
if (endpoint && endpoint.length > 8 && creds) {
|
|
4993
|
+
//dont check if its just https://
|
|
4994
|
+
// creds is the actual value of credentials from environmentStep
|
|
4995
|
+
// for Salesforce (using Oauth) it will be undefined
|
|
4996
|
+
dispatch(callCheckConnection(tenantId, appId, endpoint, mode, providerType, creds));
|
|
4997
|
+
}
|
|
4998
|
+
};
|
|
4999
|
+
}
|
|
5000
|
+
|
|
5001
|
+
function callCheckConnection(tenantId, appId, url, mode, providerType, creds) {
|
|
4985
5002
|
return function (dispatch, getState, api) {
|
|
4986
5003
|
dispatch({
|
|
4987
5004
|
type: types.START_ENV_CHECK,
|
|
4988
5005
|
mode: mode
|
|
4989
5006
|
});
|
|
5007
|
+
return dispatch(callCheckConnectionForProvider(tenantId, appId, url, mode, providerType, creds)).then(function (res) {
|
|
5008
|
+
dispatch({
|
|
5009
|
+
type: types.FINISH_ENV_CHECK,
|
|
5010
|
+
data: { res: res, mode: mode, code: '200 OK', providerType: providerType }
|
|
5011
|
+
});
|
|
5012
|
+
}).catch(function (err) {
|
|
5013
|
+
dispatch({
|
|
5014
|
+
type: types.FINISH_ENV_CHECK,
|
|
5015
|
+
data: { res: null, mode: mode, code: '404 Error', providerType: providerType }
|
|
5016
|
+
});
|
|
5017
|
+
});
|
|
5018
|
+
};
|
|
5019
|
+
}
|
|
4990
5020
|
|
|
5021
|
+
function callCheckConnectionForProvider(tenantId, appId, url, mode, providerType, creds) {
|
|
5022
|
+
return function (dispatch, getState, api) {
|
|
4991
5023
|
var _getState = getState(),
|
|
4992
5024
|
config = _getState.config;
|
|
4993
5025
|
|
|
4994
|
-
|
|
4995
|
-
|
|
5026
|
+
if (providerType === 'Canvas' && creds && creds.Token) {
|
|
5027
|
+
// if creds exist, check connection
|
|
5028
|
+
return api.post(tenantId + '/' + appId + '/testconnection/canvas', {
|
|
5029
|
+
endpoint: config.TRANS_API_URL,
|
|
5030
|
+
data: {
|
|
5031
|
+
credentialType: providerType,
|
|
5032
|
+
credentialsJson: {
|
|
5033
|
+
rootUrl: url,
|
|
5034
|
+
accessToken: creds.Token
|
|
5035
|
+
}
|
|
5036
|
+
}
|
|
5037
|
+
});
|
|
5038
|
+
} else {
|
|
5039
|
+
// else just check for adapter connection
|
|
5040
|
+
return api.get(tenantId + '/' + appId + '/testconnection?url=' + url, {
|
|
5041
|
+
endpoint: config.TRANS_API_URL
|
|
5042
|
+
});
|
|
5043
|
+
}
|
|
5044
|
+
};
|
|
5045
|
+
}
|
|
5046
|
+
|
|
5047
|
+
function callGetProviderMetadata(tenantId, appId, urlSuffix, apiUrl, mode, providerType) {
|
|
5048
|
+
return function (dispatch, getState, api) {
|
|
5049
|
+
dispatch({
|
|
5050
|
+
type: types.START_ENV_CHECK,
|
|
5051
|
+
mode: mode
|
|
5052
|
+
});
|
|
5053
|
+
|
|
5054
|
+
var _getState2 = getState(),
|
|
5055
|
+
config = _getState2.config;
|
|
5056
|
+
|
|
5057
|
+
return api.get(tenantId + '/' + appId + '/' + urlSuffix, {
|
|
5058
|
+
endpoint: config[apiUrl]
|
|
4996
5059
|
}).then(function (res) {
|
|
4997
5060
|
dispatch({
|
|
4998
5061
|
type: types.FINISH_ENV_CHECK,
|
|
4999
5062
|
data: { res: res, mode: mode, code: '200 OK', providerType: providerType }
|
|
5000
5063
|
});
|
|
5064
|
+
return true;
|
|
5001
5065
|
}).catch(function (err) {
|
|
5066
|
+
console.log(err);
|
|
5002
5067
|
dispatch({
|
|
5003
5068
|
type: types.FINISH_ENV_CHECK,
|
|
5004
|
-
data: { res: null, mode: mode, code: '404 Error'
|
|
5069
|
+
data: { res: null, mode: mode, code: '404 Error' }
|
|
5005
5070
|
});
|
|
5006
5071
|
});
|
|
5007
5072
|
};
|
|
@@ -5015,8 +5080,8 @@ module.exports =
|
|
|
5015
5080
|
mode: mode
|
|
5016
5081
|
});
|
|
5017
5082
|
|
|
5018
|
-
var
|
|
5019
|
-
config =
|
|
5083
|
+
var _getState3 = getState(),
|
|
5084
|
+
config = _getState3.config;
|
|
5020
5085
|
|
|
5021
5086
|
return api.get(tenantId + '/' + appId + '/oauthurl/' + typeGuid + '/' + orgType, {
|
|
5022
5087
|
endpoint: config.SF_AGENT_API_URL
|
|
@@ -5033,8 +5098,8 @@ module.exports =
|
|
|
5033
5098
|
|
|
5034
5099
|
function createLingkExternalIds(tenantId, appId, bundles, mappings, destinationMetadata) {
|
|
5035
5100
|
return function (dispatch, getState, api) {
|
|
5036
|
-
var
|
|
5037
|
-
config =
|
|
5101
|
+
var _getState4 = getState(),
|
|
5102
|
+
config = _getState4.config;
|
|
5038
5103
|
|
|
5039
5104
|
var externalIdlessObjects = [];
|
|
5040
5105
|
bundles.forEach(function (b) {
|
|
@@ -5092,8 +5157,8 @@ module.exports =
|
|
|
5092
5157
|
|
|
5093
5158
|
function callAddCustomField(tenantId, appId, objectType, fieldName, completedCallback) {
|
|
5094
5159
|
return function (dispatch, getState, api) {
|
|
5095
|
-
var
|
|
5096
|
-
config =
|
|
5160
|
+
var _getState5 = getState(),
|
|
5161
|
+
config = _getState5.config;
|
|
5097
5162
|
|
|
5098
5163
|
return api.post(tenantId + '/' + appId + '/salesforceschema/field', {
|
|
5099
5164
|
endpoint: config.SF_AGENT_API_URL,
|
|
@@ -5149,8 +5214,8 @@ module.exports =
|
|
|
5149
5214
|
type: types.START_PREVIEW
|
|
5150
5215
|
});
|
|
5151
5216
|
|
|
5152
|
-
var
|
|
5153
|
-
config =
|
|
5217
|
+
var _getState6 = getState(),
|
|
5218
|
+
config = _getState6.config;
|
|
5154
5219
|
|
|
5155
5220
|
return api.get(tenantId + '/' + appId + '/previewintegration?url=' + url, {
|
|
5156
5221
|
endpoint: config.TRANS_API_URL
|
|
@@ -5165,8 +5230,8 @@ module.exports =
|
|
|
5165
5230
|
|
|
5166
5231
|
function callGetScenarioList(tenantId, appId, typeGuid) {
|
|
5167
5232
|
return function (dispatch, getState, api) {
|
|
5168
|
-
var
|
|
5169
|
-
config =
|
|
5233
|
+
var _getState7 = getState(),
|
|
5234
|
+
config = _getState7.config;
|
|
5170
5235
|
|
|
5171
5236
|
return api.get(tenantId + '/' + appId + '/scenarios/' + typeGuid, {
|
|
5172
5237
|
endpoint: config.TRANS_API_URL
|
|
@@ -5176,8 +5241,8 @@ module.exports =
|
|
|
5176
5241
|
|
|
5177
5242
|
function callCreateScenario(tenantId, appId, data) {
|
|
5178
5243
|
return function (dispatch, getState, api) {
|
|
5179
|
-
var
|
|
5180
|
-
config =
|
|
5244
|
+
var _getState8 = getState(),
|
|
5245
|
+
config = _getState8.config;
|
|
5181
5246
|
|
|
5182
5247
|
return api.post(tenantId + '/' + appId + '/scenario', {
|
|
5183
5248
|
endpoint: config.TRANS_API_URL,
|
|
@@ -5188,8 +5253,8 @@ module.exports =
|
|
|
5188
5253
|
|
|
5189
5254
|
function callUpdateScenarioList(tenantId, appId, typeGuid, scenarioIds) {
|
|
5190
5255
|
return function (dispatch, getState, api) {
|
|
5191
|
-
var
|
|
5192
|
-
config =
|
|
5256
|
+
var _getState9 = getState(),
|
|
5257
|
+
config = _getState9.config;
|
|
5193
5258
|
|
|
5194
5259
|
return api.post(tenantId + '/' + appId + '/scenarios/' + typeGuid, {
|
|
5195
5260
|
endpoint: config.TRANS_API_URL,
|
|
@@ -5202,8 +5267,8 @@ module.exports =
|
|
|
5202
5267
|
|
|
5203
5268
|
function callPostBundles(tenantId, appId, bundles) {
|
|
5204
5269
|
return function (dispatch, getState, api) {
|
|
5205
|
-
var
|
|
5206
|
-
config =
|
|
5270
|
+
var _getState10 = getState(),
|
|
5271
|
+
config = _getState10.config;
|
|
5207
5272
|
|
|
5208
5273
|
var data = { bundles: bundles };
|
|
5209
5274
|
return api.post(tenantId + '/' + appId + '/bundle', {
|
|
@@ -5217,8 +5282,8 @@ module.exports =
|
|
|
5217
5282
|
|
|
5218
5283
|
function callPostMapping(tenantId, appId, mappings) {
|
|
5219
5284
|
return function (dispatch, getState, api) {
|
|
5220
|
-
var
|
|
5221
|
-
config =
|
|
5285
|
+
var _getState11 = getState(),
|
|
5286
|
+
config = _getState11.config;
|
|
5222
5287
|
|
|
5223
5288
|
var data = { mappings: mappings };
|
|
5224
5289
|
return api.post(tenantId + '/' + appId + '/schemamappings', {
|
|
@@ -5232,8 +5297,8 @@ module.exports =
|
|
|
5232
5297
|
|
|
5233
5298
|
function callPostProductizedIntegration(tenantId, appId, schemaMappingGuid, bundlePackGuid, configuration, title, typeGuid) {
|
|
5234
5299
|
return function (dispatch, getState, api) {
|
|
5235
|
-
var
|
|
5236
|
-
config =
|
|
5300
|
+
var _getState12 = getState(),
|
|
5301
|
+
config = _getState12.config;
|
|
5237
5302
|
|
|
5238
5303
|
var data = {
|
|
5239
5304
|
schemaMappingGuid: schemaMappingGuid,
|
|
@@ -5253,8 +5318,8 @@ module.exports =
|
|
|
5253
5318
|
|
|
5254
5319
|
function callUpdateProductizedIntegration(tenantId, appId, schemaMappingGuid, bundlePackGuid, configuration, title, typeGuid, piGuid) {
|
|
5255
5320
|
return function (dispatch, getState, api) {
|
|
5256
|
-
var
|
|
5257
|
-
config =
|
|
5321
|
+
var _getState13 = getState(),
|
|
5322
|
+
config = _getState13.config;
|
|
5258
5323
|
|
|
5259
5324
|
var data = {
|
|
5260
5325
|
schemaMappingGuid: schemaMappingGuid,
|
|
@@ -5274,8 +5339,8 @@ module.exports =
|
|
|
5274
5339
|
|
|
5275
5340
|
function callGenerateRecipe(tenantId, appId, typeId, typeGuid, title, piGuid, mappingGuid, sourceMetadata, destinationMetadata, isManagedPackage) {
|
|
5276
5341
|
return function (dispatch, getState, api) {
|
|
5277
|
-
var
|
|
5278
|
-
config =
|
|
5342
|
+
var _getState14 = getState(),
|
|
5343
|
+
config = _getState14.config;
|
|
5279
5344
|
|
|
5280
5345
|
return api.post(tenantId + '/' + appId + '/productizedintegrations/' + piGuid + '/generate', {
|
|
5281
5346
|
endpoint: config.TRANS_API_URL,
|
|
@@ -5331,8 +5396,8 @@ module.exports =
|
|
|
5331
5396
|
|
|
5332
5397
|
function callExecuteTransformer(transId) {
|
|
5333
5398
|
return function (dispatch, getState, api) {
|
|
5334
|
-
var
|
|
5335
|
-
config =
|
|
5399
|
+
var _getState15 = getState(),
|
|
5400
|
+
config = _getState15.config;
|
|
5336
5401
|
|
|
5337
5402
|
var query = '';
|
|
5338
5403
|
var d = new Date();
|
|
@@ -5356,8 +5421,8 @@ module.exports =
|
|
|
5356
5421
|
|
|
5357
5422
|
function callLookupLogData(externalExecutionId, index, onFinish, generatedRecipe, pi) {
|
|
5358
5423
|
return function (dispatch, getState, api) {
|
|
5359
|
-
var
|
|
5360
|
-
config =
|
|
5424
|
+
var _getState16 = getState(),
|
|
5425
|
+
config = _getState16.config;
|
|
5361
5426
|
|
|
5362
5427
|
return api.get('logs/transformers/externalExecutionId/' + externalExecutionId, {
|
|
5363
5428
|
endpoint: config.TRANS_API_URL
|
|
@@ -5400,8 +5465,8 @@ module.exports =
|
|
|
5400
5465
|
};
|
|
5401
5466
|
}
|
|
5402
5467
|
return function (dispatch, getState, api) {
|
|
5403
|
-
var
|
|
5404
|
-
config =
|
|
5468
|
+
var _getState17 = getState(),
|
|
5469
|
+
config = _getState17.config;
|
|
5405
5470
|
|
|
5406
5471
|
return api.post('createtrigger', {
|
|
5407
5472
|
endpoint: config.TRANS_API_URL,
|
|
@@ -5414,8 +5479,8 @@ module.exports =
|
|
|
5414
5479
|
|
|
5415
5480
|
function callDeployTrigger(generatedRecipe, pi, onFinish) {
|
|
5416
5481
|
return function (dispatch, getState, api) {
|
|
5417
|
-
var
|
|
5418
|
-
config =
|
|
5482
|
+
var _getState18 = getState(),
|
|
5483
|
+
config = _getState18.config;
|
|
5419
5484
|
|
|
5420
5485
|
return api.put('transformer/deploy/' + generatedRecipe.Id, {
|
|
5421
5486
|
endpoint: config.TRANS_API_URL,
|
|
@@ -5459,8 +5524,8 @@ module.exports =
|
|
|
5459
5524
|
|
|
5460
5525
|
if (piGuid && piGuid !== '_') {
|
|
5461
5526
|
return function (dispatch, getState, api) {
|
|
5462
|
-
var
|
|
5463
|
-
config =
|
|
5527
|
+
var _getState19 = getState(),
|
|
5528
|
+
config = _getState19.config;
|
|
5464
5529
|
|
|
5465
5530
|
return api.get(tenantId + '/' + accountId + '/productizedintegration/' + piGuid, {
|
|
5466
5531
|
endpoint: config.TRANS_API_URL
|
|
@@ -5479,68 +5544,17 @@ module.exports =
|
|
|
5479
5544
|
type: types.SET_WIZARD_SAVED_CONFIGURATION,
|
|
5480
5545
|
data: config
|
|
5481
5546
|
});
|
|
5482
|
-
return Promise.all([dispatch(tryGetMetadata(tenantId, accountId, 'source', providers.source, source, sourceApi, savedSourceEndpoint,
|
|
5547
|
+
return Promise.all([dispatch(tryGetMetadata(tenantId, accountId, 'source', providers.source, source, sourceApi, savedSourceEndpoint, skipSourceEnv)), dispatch(tryGetMetadata(tenantId, accountId, 'destination', providers.destination, destination, destinationApi, savedDestinationEndpoint, skipDestinationEnv)), dispatch(callGetMapping(tenantId, accountId, pi.schemaMappingGuid)), dispatch(callGetBundles(tenantId, accountId, pi.bundlePackGuid)), dispatch(callGetCredentials(tenantId, accountId, providers)), dispatch(callGetTrigger(pi.transformerBaseId))]);
|
|
5483
5548
|
});
|
|
5484
5549
|
};
|
|
5485
5550
|
} else return function (dispatch) {
|
|
5486
5551
|
// FIRST TIME!
|
|
5487
|
-
return Promise.all([dispatch(tryGetMetadata(tenantId, accountId, 'source', providers.source, source, sourceApi, null,
|
|
5552
|
+
return Promise.all([dispatch(tryGetMetadata(tenantId, accountId, 'source', providers.source, source, sourceApi, null, skipSourceEnv)), dispatch(tryGetMetadata(tenantId, accountId, 'destination', providers.destination, destination, destinationApi, null, skipDestinationEnv))]);
|
|
5488
5553
|
};
|
|
5489
5554
|
}
|
|
5490
5555
|
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
const { source, sourceApi, destination, destinationApi } = metadataEndpoints
|
|
5494
|
-
const {skipSourceEnv, skipDestinationEnv} = providers
|
|
5495
|
-
|
|
5496
|
-
if(piGuid && piGuid!=='_'){
|
|
5497
|
-
return (dispatch, getState, api) => {
|
|
5498
|
-
const { config } = getState()
|
|
5499
|
-
return api.get(`${tenantId}/${accountId}/productizedintegrations`, {
|
|
5500
|
-
endpoint: config.TRANS_API_URL,
|
|
5501
|
-
})
|
|
5502
|
-
.then((data) => {
|
|
5503
|
-
const PI = data.find(pi=>pi.ProductizedIntegrationGuid===piGuid)
|
|
5504
|
-
const config = {}
|
|
5505
|
-
var savedSourceEndpoint = null
|
|
5506
|
-
var savedDestinationEndpoint = null
|
|
5507
|
-
PI.Configuration.forEach((c) => {
|
|
5508
|
-
config[c.Key] = c.Value
|
|
5509
|
-
if(c.Key==='sourceEndpoint'){
|
|
5510
|
-
savedSourceEndpoint = c.Value
|
|
5511
|
-
}
|
|
5512
|
-
if(c.Key==='destinationEndpoint'){
|
|
5513
|
-
savedDestinationEndpoint = c.Value
|
|
5514
|
-
}
|
|
5515
|
-
})
|
|
5516
|
-
config['title'] = PI.Name
|
|
5517
|
-
dispatch({
|
|
5518
|
-
type: types.SET_WIZARD_SAVED_CONFIGURATION,
|
|
5519
|
-
data: config
|
|
5520
|
-
})
|
|
5521
|
-
return Promise.all([
|
|
5522
|
-
dispatch(tryGetMetadata(tenantId, accountId, 'source', providers.source,
|
|
5523
|
-
source, sourceApi, savedSourceEndpoint, false, skipSourceEnv)),
|
|
5524
|
-
dispatch(tryGetMetadata(tenantId, accountId, 'destination', providers.destination,
|
|
5525
|
-
destination, destinationApi, savedDestinationEndpoint, false, skipDestinationEnv)),
|
|
5526
|
-
dispatch(callGetMapping(tenantId, accountId, PI.SchemaMappingGuid)),
|
|
5527
|
-
dispatch(callGetBundles(tenantId, accountId, PI.BundlePackGuid)),
|
|
5528
|
-
dispatch(callGetCredentials(tenantId, accountId, providers)),
|
|
5529
|
-
dispatch(callGetTrigger(PI.TransformerBaseId)),
|
|
5530
|
-
])
|
|
5531
|
-
})
|
|
5532
|
-
}
|
|
5533
|
-
} else return (dispatch) => { // FIRST TIME!
|
|
5534
|
-
return Promise.all([
|
|
5535
|
-
dispatch(tryGetMetadata(tenantId, accountId, 'source', providers.source,
|
|
5536
|
-
source, sourceApi, null, false, skipSourceEnv)),
|
|
5537
|
-
dispatch(tryGetMetadata(tenantId, accountId, 'destination', providers.destination,
|
|
5538
|
-
destination, destinationApi, null, false, skipDestinationEnv)),
|
|
5539
|
-
])
|
|
5540
|
-
}
|
|
5541
|
-
}*/
|
|
5542
|
-
|
|
5543
|
-
function tryGetMetadata(tenantId, appId, mode, providerType, urlSuffix, apiUrl, savedEndpoint, isFromEnvStep, skipEnvStep) {
|
|
5556
|
+
// this function runs when wizard first loads
|
|
5557
|
+
function tryGetMetadata(tenantId, appId, mode, providerType, urlSuffix, apiUrl, savedEndpoint, skipEnvStep) {
|
|
5544
5558
|
// if its first time AND there is no env step, automatically pull metadata (SF app)
|
|
5545
5559
|
if (!savedEndpoint && !skipEnvStep) return function () {
|
|
5546
5560
|
return Promise.resolve(null);
|
|
@@ -5549,7 +5563,7 @@ module.exports =
|
|
|
5549
5563
|
return function (dispatch) {
|
|
5550
5564
|
return dispatch(callGetProviderMetadata(tenantId, appId, urlSuffix, apiUrl, mode, providerType));
|
|
5551
5565
|
};
|
|
5552
|
-
} else if (savedEndpoint && savedEndpoint !== 'https://' && savedEndpoint !== 'http://') {
|
|
5566
|
+
} else if (savedEndpoint && savedEndpoint !== 'https://' && savedEndpoint !== 'http://' && savedEndpoint !== '_blank') {
|
|
5553
5567
|
return function (dispatch) {
|
|
5554
5568
|
return dispatch(callCheckConnection(tenantId, appId, savedEndpoint, mode, providerType));
|
|
5555
5569
|
};
|
|
@@ -5561,8 +5575,8 @@ module.exports =
|
|
|
5561
5575
|
function callGetBundles(tenantId, accountId, bundlePackGuid) {
|
|
5562
5576
|
if (bundlePackGuid) {
|
|
5563
5577
|
return function (dispatch, getState, api) {
|
|
5564
|
-
var
|
|
5565
|
-
config =
|
|
5578
|
+
var _getState20 = getState(),
|
|
5579
|
+
config = _getState20.config;
|
|
5566
5580
|
|
|
5567
5581
|
return api.get(tenantId + '/' + accountId + '/bundle/' + bundlePackGuid, {
|
|
5568
5582
|
endpoint: config.TRANS_API_URL
|
|
@@ -5581,8 +5595,8 @@ module.exports =
|
|
|
5581
5595
|
function callGetMapping(tenantId, accountId, mappingGuid) {
|
|
5582
5596
|
if (mappingGuid) {
|
|
5583
5597
|
return function (dispatch, getState, api) {
|
|
5584
|
-
var
|
|
5585
|
-
config =
|
|
5598
|
+
var _getState21 = getState(),
|
|
5599
|
+
config = _getState21.config;
|
|
5586
5600
|
|
|
5587
5601
|
return api.get(tenantId + '/' + accountId + '/schemamappings/' + mappingGuid, {
|
|
5588
5602
|
endpoint: config.TRANS_API_URL
|
|
@@ -5605,18 +5619,25 @@ module.exports =
|
|
|
5605
5619
|
mode: mode
|
|
5606
5620
|
});
|
|
5607
5621
|
|
|
5608
|
-
var
|
|
5609
|
-
config =
|
|
5622
|
+
var _getState22 = getState(),
|
|
5623
|
+
config = _getState22.config;
|
|
5610
5624
|
|
|
5625
|
+
var credentialsJson = {
|
|
5626
|
+
rootUrl: url,
|
|
5627
|
+
key: credentials.ClientKey || credentials.ClientID,
|
|
5628
|
+
secret: credentials.ClientSecret
|
|
5629
|
+
};
|
|
5630
|
+
if (providerType === 'Canvas') {
|
|
5631
|
+
credentialsJson = {
|
|
5632
|
+
rootUrl: url,
|
|
5633
|
+
accessToken: credentials.Token
|
|
5634
|
+
};
|
|
5635
|
+
}
|
|
5611
5636
|
return api.post(tenantId + '/' + appId + '/credentials', {
|
|
5612
5637
|
endpoint: config.TRANS_API_URL,
|
|
5613
5638
|
data: {
|
|
5614
5639
|
credentialType: providerType,
|
|
5615
|
-
credentialsJson:
|
|
5616
|
-
rootUrl: url,
|
|
5617
|
-
key: credentials.ClientKey || credentials.ClientID,
|
|
5618
|
-
secret: credentials.ClientSecret
|
|
5619
|
-
}
|
|
5640
|
+
credentialsJson: credentialsJson
|
|
5620
5641
|
}
|
|
5621
5642
|
});
|
|
5622
5643
|
};
|
|
@@ -5638,8 +5659,8 @@ module.exports =
|
|
|
5638
5659
|
|
|
5639
5660
|
function tryGetCredentials(tenantId, appId, credentialType, creds) {
|
|
5640
5661
|
return function (dispatch, getState, api) {
|
|
5641
|
-
var
|
|
5642
|
-
config =
|
|
5662
|
+
var _getState23 = getState(),
|
|
5663
|
+
config = _getState23.config;
|
|
5643
5664
|
|
|
5644
5665
|
if (creds && creds.length > 0 && creds[0] !== 'Oauth') {
|
|
5645
5666
|
return api.get(tenantId + '/' + appId + '/credentials/' + credentialType, {
|
|
@@ -5651,34 +5672,6 @@ module.exports =
|
|
|
5651
5672
|
};
|
|
5652
5673
|
}
|
|
5653
5674
|
|
|
5654
|
-
function callGetProviderMetadata(tenantId, appId, urlSuffix, apiUrl, mode, providerType) {
|
|
5655
|
-
return function (dispatch, getState, api) {
|
|
5656
|
-
dispatch({
|
|
5657
|
-
type: types.START_ENV_CHECK,
|
|
5658
|
-
mode: mode
|
|
5659
|
-
});
|
|
5660
|
-
|
|
5661
|
-
var _getState23 = getState(),
|
|
5662
|
-
config = _getState23.config;
|
|
5663
|
-
|
|
5664
|
-
return api.get(tenantId + '/' + appId + '/' + urlSuffix, {
|
|
5665
|
-
endpoint: config[apiUrl]
|
|
5666
|
-
}).then(function (res) {
|
|
5667
|
-
dispatch({
|
|
5668
|
-
type: types.FINISH_ENV_CHECK,
|
|
5669
|
-
data: { res: res, mode: mode, code: '200 OK', providerType: providerType }
|
|
5670
|
-
});
|
|
5671
|
-
return true;
|
|
5672
|
-
}).catch(function (err) {
|
|
5673
|
-
console.log(err);
|
|
5674
|
-
dispatch({
|
|
5675
|
-
type: types.FINISH_ENV_CHECK,
|
|
5676
|
-
data: { res: null, mode: mode, code: '404 Error' }
|
|
5677
|
-
});
|
|
5678
|
-
});
|
|
5679
|
-
};
|
|
5680
|
-
}
|
|
5681
|
-
|
|
5682
5675
|
function callGetTrigger(transBaseId) {
|
|
5683
5676
|
return function (dispatch, getState, api) {
|
|
5684
5677
|
var _getState24 = getState(),
|
|
@@ -8909,21 +8902,13 @@ module.exports =
|
|
|
8909
8902
|
endpoint = endpoint.slice(0, -1);
|
|
8910
8903
|
change(step.mode + 'Endpoint', endpoint);
|
|
8911
8904
|
}
|
|
8912
|
-
|
|
8913
|
-
/*actions.tryGetMetadata(
|
|
8914
|
-
tenantId, accountId, step.mode, step.providerType,
|
|
8915
|
-
step.metadataEndpoint, step.metadataApi, endpoint || '_blank', true
|
|
8916
|
-
).then(j=>{
|
|
8917
|
-
if(j && credentials){
|
|
8918
|
-
actions.postCredentials(tenantId, accountId, step.providerType, endpoint, credentials)
|
|
8919
|
-
}
|
|
8920
|
-
})*/
|
|
8905
|
+
|
|
8921
8906
|
if (credentials) {
|
|
8922
8907
|
actions.postCredentials(tenantId, accountId, step.providerType, endpoint, credentials, step.mode).then(function () {
|
|
8923
|
-
actions.
|
|
8908
|
+
actions.getMetadataFromEnvStep(tenantId, accountId, step.mode, step.providerType, step.metadataEndpoint, step.metadataApi, endpoint || '_blank', credentials);
|
|
8924
8909
|
});
|
|
8925
8910
|
} else {
|
|
8926
|
-
actions.
|
|
8911
|
+
actions.getMetadataFromEnvStep(tenantId, accountId, step.mode, step.providerType, step.metadataEndpoint, step.metadataApi, endpoint || '_blank', credentials);
|
|
8927
8912
|
}
|
|
8928
8913
|
}
|
|
8929
8914
|
}, {
|
|
@@ -9159,7 +9144,7 @@ module.exports =
|
|
|
9159
9144
|
),
|
|
9160
9145
|
_react2.default.createElement(
|
|
9161
9146
|
'ul',
|
|
9162
|
-
|
|
9147
|
+
{ style: { listStyle: 'none', paddingLeft: 5 } },
|
|
9163
9148
|
wizard[step.mode + 'Metadata'].filter(function (m) {
|
|
9164
9149
|
return m.method !== 'POST';
|
|
9165
9150
|
}).map(function (rsc, i) {
|
|
@@ -11052,20 +11037,18 @@ module.exports =
|
|
|
11052
11037
|
mappings = _saveData.mappings;
|
|
11053
11038
|
|
|
11054
11039
|
var data = { bundles: bundles, mappings: mappings, title: title, label: description, typeGuid: step.typeGuid };
|
|
11055
|
-
|
|
11056
|
-
|
|
11057
|
-
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
})*/
|
|
11064
|
-
var dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(data));
|
|
11040
|
+
actions.callCreateScenario(tenantId, accountId, data).then(function () {
|
|
11041
|
+
_this3.setState({ loading: true });
|
|
11042
|
+
actions.callGetScenarioList(tenantId, accountId, step.typeGuid).then(function (r) {
|
|
11043
|
+
console.log(r);
|
|
11044
|
+
_this3.setState({ loading: false });
|
|
11045
|
+
});
|
|
11046
|
+
});
|
|
11047
|
+
/*var dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(data));
|
|
11065
11048
|
var dlAnchor = this.downloadAnchor;
|
|
11066
11049
|
dlAnchor.setAttribute("href", dataStr);
|
|
11067
11050
|
dlAnchor.setAttribute("download", "scenario.json");
|
|
11068
|
-
dlAnchor.click()
|
|
11051
|
+
dlAnchor.click();*/
|
|
11069
11052
|
}
|
|
11070
11053
|
}
|
|
11071
11054
|
}, {
|