@lingk/sync 0.1.52 → 0.1.54
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 +143 -162
- package/build/main.js.map +1 -1
- package/build/reducer.js +5 -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,81 @@ 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 clicked 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) {
|
|
4993
|
+
//dont check if its just https://
|
|
4994
|
+
dispatch(callCheckConnection(tenantId, appId, endpoint, mode, providerType, creds));
|
|
4995
|
+
}
|
|
4996
|
+
};
|
|
4997
|
+
}
|
|
4998
|
+
|
|
4999
|
+
function callCheckConnection(tenantId, appId, url, mode, providerType, creds) {
|
|
4985
5000
|
return function (dispatch, getState, api) {
|
|
4986
5001
|
dispatch({
|
|
4987
5002
|
type: types.START_ENV_CHECK,
|
|
4988
5003
|
mode: mode
|
|
4989
5004
|
});
|
|
5005
|
+
return dispatch(callCheckConnectionForProvider(tenantId, appId, url, mode, providerType, creds)).then(function (res) {
|
|
5006
|
+
dispatch({
|
|
5007
|
+
type: types.FINISH_ENV_CHECK,
|
|
5008
|
+
data: { res: res, mode: mode, code: '200 OK', providerType: providerType }
|
|
5009
|
+
});
|
|
5010
|
+
}).catch(function (err) {
|
|
5011
|
+
dispatch({
|
|
5012
|
+
type: types.FINISH_ENV_CHECK,
|
|
5013
|
+
data: { res: null, mode: mode, code: '404 Error', providerType: providerType }
|
|
5014
|
+
});
|
|
5015
|
+
});
|
|
5016
|
+
};
|
|
5017
|
+
}
|
|
4990
5018
|
|
|
5019
|
+
function callCheckConnectionForProvider(tenantId, appId, url, mode, providerType, creds) {
|
|
5020
|
+
return function (dispatch, getState, api) {
|
|
4991
5021
|
var _getState = getState(),
|
|
4992
5022
|
config = _getState.config;
|
|
4993
5023
|
|
|
4994
|
-
|
|
4995
|
-
|
|
5024
|
+
if (creds && creds.Token) {
|
|
5025
|
+
// if creds exist, check connection
|
|
5026
|
+
return api.post(tenantId + '/' + appId + '/testconnection/canvas', {
|
|
5027
|
+
endpoint: config.TRANS_API_URL
|
|
5028
|
+
});
|
|
5029
|
+
} else {
|
|
5030
|
+
// else just check for adapter connection
|
|
5031
|
+
return api.get(tenantId + '/' + appId + '/testconnection?url=' + url, {
|
|
5032
|
+
endpoint: config.TRANS_API_URL
|
|
5033
|
+
});
|
|
5034
|
+
}
|
|
5035
|
+
};
|
|
5036
|
+
}
|
|
5037
|
+
|
|
5038
|
+
function callGetProviderMetadata(tenantId, appId, urlSuffix, apiUrl, mode, providerType) {
|
|
5039
|
+
return function (dispatch, getState, api) {
|
|
5040
|
+
dispatch({
|
|
5041
|
+
type: types.START_ENV_CHECK,
|
|
5042
|
+
mode: mode
|
|
5043
|
+
});
|
|
5044
|
+
|
|
5045
|
+
var _getState2 = getState(),
|
|
5046
|
+
config = _getState2.config;
|
|
5047
|
+
|
|
5048
|
+
return api.get(tenantId + '/' + appId + '/' + urlSuffix, {
|
|
5049
|
+
endpoint: config[apiUrl]
|
|
4996
5050
|
}).then(function (res) {
|
|
4997
5051
|
dispatch({
|
|
4998
5052
|
type: types.FINISH_ENV_CHECK,
|
|
4999
5053
|
data: { res: res, mode: mode, code: '200 OK', providerType: providerType }
|
|
5000
5054
|
});
|
|
5055
|
+
return true;
|
|
5001
5056
|
}).catch(function (err) {
|
|
5057
|
+
console.log(err);
|
|
5002
5058
|
dispatch({
|
|
5003
5059
|
type: types.FINISH_ENV_CHECK,
|
|
5004
|
-
data: { res: null, mode: mode, code: '404 Error'
|
|
5060
|
+
data: { res: null, mode: mode, code: '404 Error' }
|
|
5005
5061
|
});
|
|
5006
5062
|
});
|
|
5007
5063
|
};
|
|
@@ -5015,8 +5071,8 @@ module.exports =
|
|
|
5015
5071
|
mode: mode
|
|
5016
5072
|
});
|
|
5017
5073
|
|
|
5018
|
-
var
|
|
5019
|
-
config =
|
|
5074
|
+
var _getState3 = getState(),
|
|
5075
|
+
config = _getState3.config;
|
|
5020
5076
|
|
|
5021
5077
|
return api.get(tenantId + '/' + appId + '/oauthurl/' + typeGuid + '/' + orgType, {
|
|
5022
5078
|
endpoint: config.SF_AGENT_API_URL
|
|
@@ -5033,8 +5089,8 @@ module.exports =
|
|
|
5033
5089
|
|
|
5034
5090
|
function createLingkExternalIds(tenantId, appId, bundles, mappings, destinationMetadata) {
|
|
5035
5091
|
return function (dispatch, getState, api) {
|
|
5036
|
-
var
|
|
5037
|
-
config =
|
|
5092
|
+
var _getState4 = getState(),
|
|
5093
|
+
config = _getState4.config;
|
|
5038
5094
|
|
|
5039
5095
|
var externalIdlessObjects = [];
|
|
5040
5096
|
bundles.forEach(function (b) {
|
|
@@ -5092,8 +5148,8 @@ module.exports =
|
|
|
5092
5148
|
|
|
5093
5149
|
function callAddCustomField(tenantId, appId, objectType, fieldName, completedCallback) {
|
|
5094
5150
|
return function (dispatch, getState, api) {
|
|
5095
|
-
var
|
|
5096
|
-
config =
|
|
5151
|
+
var _getState5 = getState(),
|
|
5152
|
+
config = _getState5.config;
|
|
5097
5153
|
|
|
5098
5154
|
return api.post(tenantId + '/' + appId + '/salesforceschema/field', {
|
|
5099
5155
|
endpoint: config.SF_AGENT_API_URL,
|
|
@@ -5149,8 +5205,8 @@ module.exports =
|
|
|
5149
5205
|
type: types.START_PREVIEW
|
|
5150
5206
|
});
|
|
5151
5207
|
|
|
5152
|
-
var
|
|
5153
|
-
config =
|
|
5208
|
+
var _getState6 = getState(),
|
|
5209
|
+
config = _getState6.config;
|
|
5154
5210
|
|
|
5155
5211
|
return api.get(tenantId + '/' + appId + '/previewintegration?url=' + url, {
|
|
5156
5212
|
endpoint: config.TRANS_API_URL
|
|
@@ -5165,8 +5221,8 @@ module.exports =
|
|
|
5165
5221
|
|
|
5166
5222
|
function callGetScenarioList(tenantId, appId, typeGuid) {
|
|
5167
5223
|
return function (dispatch, getState, api) {
|
|
5168
|
-
var
|
|
5169
|
-
config =
|
|
5224
|
+
var _getState7 = getState(),
|
|
5225
|
+
config = _getState7.config;
|
|
5170
5226
|
|
|
5171
5227
|
return api.get(tenantId + '/' + appId + '/scenarios/' + typeGuid, {
|
|
5172
5228
|
endpoint: config.TRANS_API_URL
|
|
@@ -5176,8 +5232,8 @@ module.exports =
|
|
|
5176
5232
|
|
|
5177
5233
|
function callCreateScenario(tenantId, appId, data) {
|
|
5178
5234
|
return function (dispatch, getState, api) {
|
|
5179
|
-
var
|
|
5180
|
-
config =
|
|
5235
|
+
var _getState8 = getState(),
|
|
5236
|
+
config = _getState8.config;
|
|
5181
5237
|
|
|
5182
5238
|
return api.post(tenantId + '/' + appId + '/scenario', {
|
|
5183
5239
|
endpoint: config.TRANS_API_URL,
|
|
@@ -5188,8 +5244,8 @@ module.exports =
|
|
|
5188
5244
|
|
|
5189
5245
|
function callUpdateScenarioList(tenantId, appId, typeGuid, scenarioIds) {
|
|
5190
5246
|
return function (dispatch, getState, api) {
|
|
5191
|
-
var
|
|
5192
|
-
config =
|
|
5247
|
+
var _getState9 = getState(),
|
|
5248
|
+
config = _getState9.config;
|
|
5193
5249
|
|
|
5194
5250
|
return api.post(tenantId + '/' + appId + '/scenarios/' + typeGuid, {
|
|
5195
5251
|
endpoint: config.TRANS_API_URL,
|
|
@@ -5202,8 +5258,8 @@ module.exports =
|
|
|
5202
5258
|
|
|
5203
5259
|
function callPostBundles(tenantId, appId, bundles) {
|
|
5204
5260
|
return function (dispatch, getState, api) {
|
|
5205
|
-
var
|
|
5206
|
-
config =
|
|
5261
|
+
var _getState10 = getState(),
|
|
5262
|
+
config = _getState10.config;
|
|
5207
5263
|
|
|
5208
5264
|
var data = { bundles: bundles };
|
|
5209
5265
|
return api.post(tenantId + '/' + appId + '/bundle', {
|
|
@@ -5217,8 +5273,8 @@ module.exports =
|
|
|
5217
5273
|
|
|
5218
5274
|
function callPostMapping(tenantId, appId, mappings) {
|
|
5219
5275
|
return function (dispatch, getState, api) {
|
|
5220
|
-
var
|
|
5221
|
-
config =
|
|
5276
|
+
var _getState11 = getState(),
|
|
5277
|
+
config = _getState11.config;
|
|
5222
5278
|
|
|
5223
5279
|
var data = { mappings: mappings };
|
|
5224
5280
|
return api.post(tenantId + '/' + appId + '/schemamappings', {
|
|
@@ -5232,8 +5288,8 @@ module.exports =
|
|
|
5232
5288
|
|
|
5233
5289
|
function callPostProductizedIntegration(tenantId, appId, schemaMappingGuid, bundlePackGuid, configuration, title, typeGuid) {
|
|
5234
5290
|
return function (dispatch, getState, api) {
|
|
5235
|
-
var
|
|
5236
|
-
config =
|
|
5291
|
+
var _getState12 = getState(),
|
|
5292
|
+
config = _getState12.config;
|
|
5237
5293
|
|
|
5238
5294
|
var data = {
|
|
5239
5295
|
schemaMappingGuid: schemaMappingGuid,
|
|
@@ -5253,8 +5309,8 @@ module.exports =
|
|
|
5253
5309
|
|
|
5254
5310
|
function callUpdateProductizedIntegration(tenantId, appId, schemaMappingGuid, bundlePackGuid, configuration, title, typeGuid, piGuid) {
|
|
5255
5311
|
return function (dispatch, getState, api) {
|
|
5256
|
-
var
|
|
5257
|
-
config =
|
|
5312
|
+
var _getState13 = getState(),
|
|
5313
|
+
config = _getState13.config;
|
|
5258
5314
|
|
|
5259
5315
|
var data = {
|
|
5260
5316
|
schemaMappingGuid: schemaMappingGuid,
|
|
@@ -5274,8 +5330,8 @@ module.exports =
|
|
|
5274
5330
|
|
|
5275
5331
|
function callGenerateRecipe(tenantId, appId, typeId, typeGuid, title, piGuid, mappingGuid, sourceMetadata, destinationMetadata, isManagedPackage) {
|
|
5276
5332
|
return function (dispatch, getState, api) {
|
|
5277
|
-
var
|
|
5278
|
-
config =
|
|
5333
|
+
var _getState14 = getState(),
|
|
5334
|
+
config = _getState14.config;
|
|
5279
5335
|
|
|
5280
5336
|
return api.post(tenantId + '/' + appId + '/productizedintegrations/' + piGuid + '/generate', {
|
|
5281
5337
|
endpoint: config.TRANS_API_URL,
|
|
@@ -5331,8 +5387,8 @@ module.exports =
|
|
|
5331
5387
|
|
|
5332
5388
|
function callExecuteTransformer(transId) {
|
|
5333
5389
|
return function (dispatch, getState, api) {
|
|
5334
|
-
var
|
|
5335
|
-
config =
|
|
5390
|
+
var _getState15 = getState(),
|
|
5391
|
+
config = _getState15.config;
|
|
5336
5392
|
|
|
5337
5393
|
var query = '';
|
|
5338
5394
|
var d = new Date();
|
|
@@ -5356,8 +5412,8 @@ module.exports =
|
|
|
5356
5412
|
|
|
5357
5413
|
function callLookupLogData(externalExecutionId, index, onFinish, generatedRecipe, pi) {
|
|
5358
5414
|
return function (dispatch, getState, api) {
|
|
5359
|
-
var
|
|
5360
|
-
config =
|
|
5415
|
+
var _getState16 = getState(),
|
|
5416
|
+
config = _getState16.config;
|
|
5361
5417
|
|
|
5362
5418
|
return api.get('logs/transformers/externalExecutionId/' + externalExecutionId, {
|
|
5363
5419
|
endpoint: config.TRANS_API_URL
|
|
@@ -5400,8 +5456,8 @@ module.exports =
|
|
|
5400
5456
|
};
|
|
5401
5457
|
}
|
|
5402
5458
|
return function (dispatch, getState, api) {
|
|
5403
|
-
var
|
|
5404
|
-
config =
|
|
5459
|
+
var _getState17 = getState(),
|
|
5460
|
+
config = _getState17.config;
|
|
5405
5461
|
|
|
5406
5462
|
return api.post('createtrigger', {
|
|
5407
5463
|
endpoint: config.TRANS_API_URL,
|
|
@@ -5414,8 +5470,8 @@ module.exports =
|
|
|
5414
5470
|
|
|
5415
5471
|
function callDeployTrigger(generatedRecipe, pi, onFinish) {
|
|
5416
5472
|
return function (dispatch, getState, api) {
|
|
5417
|
-
var
|
|
5418
|
-
config =
|
|
5473
|
+
var _getState18 = getState(),
|
|
5474
|
+
config = _getState18.config;
|
|
5419
5475
|
|
|
5420
5476
|
return api.put('transformer/deploy/' + generatedRecipe.Id, {
|
|
5421
5477
|
endpoint: config.TRANS_API_URL,
|
|
@@ -5459,8 +5515,8 @@ module.exports =
|
|
|
5459
5515
|
|
|
5460
5516
|
if (piGuid && piGuid !== '_') {
|
|
5461
5517
|
return function (dispatch, getState, api) {
|
|
5462
|
-
var
|
|
5463
|
-
config =
|
|
5518
|
+
var _getState19 = getState(),
|
|
5519
|
+
config = _getState19.config;
|
|
5464
5520
|
|
|
5465
5521
|
return api.get(tenantId + '/' + accountId + '/productizedintegration/' + piGuid, {
|
|
5466
5522
|
endpoint: config.TRANS_API_URL
|
|
@@ -5479,68 +5535,17 @@ module.exports =
|
|
|
5479
5535
|
type: types.SET_WIZARD_SAVED_CONFIGURATION,
|
|
5480
5536
|
data: config
|
|
5481
5537
|
});
|
|
5482
|
-
return Promise.all([dispatch(tryGetMetadata(tenantId, accountId, 'source', providers.source, source, sourceApi, savedSourceEndpoint,
|
|
5538
|
+
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
5539
|
});
|
|
5484
5540
|
};
|
|
5485
5541
|
} else return function (dispatch) {
|
|
5486
5542
|
// FIRST TIME!
|
|
5487
|
-
return Promise.all([dispatch(tryGetMetadata(tenantId, accountId, 'source', providers.source, source, sourceApi, null,
|
|
5543
|
+
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
5544
|
};
|
|
5489
5545
|
}
|
|
5490
5546
|
|
|
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) {
|
|
5547
|
+
// this function runs when wizard first loads
|
|
5548
|
+
function tryGetMetadata(tenantId, appId, mode, providerType, urlSuffix, apiUrl, savedEndpoint, skipEnvStep) {
|
|
5544
5549
|
// if its first time AND there is no env step, automatically pull metadata (SF app)
|
|
5545
5550
|
if (!savedEndpoint && !skipEnvStep) return function () {
|
|
5546
5551
|
return Promise.resolve(null);
|
|
@@ -5549,7 +5554,7 @@ module.exports =
|
|
|
5549
5554
|
return function (dispatch) {
|
|
5550
5555
|
return dispatch(callGetProviderMetadata(tenantId, appId, urlSuffix, apiUrl, mode, providerType));
|
|
5551
5556
|
};
|
|
5552
|
-
} else if (savedEndpoint && savedEndpoint !== 'https://' && savedEndpoint !== 'http://') {
|
|
5557
|
+
} else if (savedEndpoint && savedEndpoint !== 'https://' && savedEndpoint !== 'http://' && savedEndpoint !== '_blank') {
|
|
5553
5558
|
return function (dispatch) {
|
|
5554
5559
|
return dispatch(callCheckConnection(tenantId, appId, savedEndpoint, mode, providerType));
|
|
5555
5560
|
};
|
|
@@ -5561,8 +5566,8 @@ module.exports =
|
|
|
5561
5566
|
function callGetBundles(tenantId, accountId, bundlePackGuid) {
|
|
5562
5567
|
if (bundlePackGuid) {
|
|
5563
5568
|
return function (dispatch, getState, api) {
|
|
5564
|
-
var
|
|
5565
|
-
config =
|
|
5569
|
+
var _getState20 = getState(),
|
|
5570
|
+
config = _getState20.config;
|
|
5566
5571
|
|
|
5567
5572
|
return api.get(tenantId + '/' + accountId + '/bundle/' + bundlePackGuid, {
|
|
5568
5573
|
endpoint: config.TRANS_API_URL
|
|
@@ -5581,8 +5586,8 @@ module.exports =
|
|
|
5581
5586
|
function callGetMapping(tenantId, accountId, mappingGuid) {
|
|
5582
5587
|
if (mappingGuid) {
|
|
5583
5588
|
return function (dispatch, getState, api) {
|
|
5584
|
-
var
|
|
5585
|
-
config =
|
|
5589
|
+
var _getState21 = getState(),
|
|
5590
|
+
config = _getState21.config;
|
|
5586
5591
|
|
|
5587
5592
|
return api.get(tenantId + '/' + accountId + '/schemamappings/' + mappingGuid, {
|
|
5588
5593
|
endpoint: config.TRANS_API_URL
|
|
@@ -5605,23 +5610,37 @@ module.exports =
|
|
|
5605
5610
|
mode: mode
|
|
5606
5611
|
});
|
|
5607
5612
|
|
|
5608
|
-
var
|
|
5609
|
-
config =
|
|
5613
|
+
var _getState22 = getState(),
|
|
5614
|
+
config = _getState22.config;
|
|
5610
5615
|
|
|
5611
5616
|
return api.post(tenantId + '/' + appId + '/credentials', {
|
|
5612
5617
|
endpoint: config.TRANS_API_URL,
|
|
5613
|
-
data:
|
|
5614
|
-
credentialType: providerType,
|
|
5615
|
-
credentialsJson: {
|
|
5616
|
-
rootUrl: url,
|
|
5617
|
-
key: credentials.ClientKey || credentials.ClientID,
|
|
5618
|
-
secret: credentials.ClientSecret
|
|
5619
|
-
}
|
|
5620
|
-
}
|
|
5618
|
+
data: makeCredsForProvider(credentials, providerType, url)
|
|
5621
5619
|
});
|
|
5622
5620
|
};
|
|
5623
5621
|
}
|
|
5624
5622
|
|
|
5623
|
+
function makeCredsForProvider(creds, providerType, url) {
|
|
5624
|
+
var data = {
|
|
5625
|
+
credentialType: providerType,
|
|
5626
|
+
credentialsJson: {
|
|
5627
|
+
rootUrl: url
|
|
5628
|
+
}
|
|
5629
|
+
};
|
|
5630
|
+
switch (providerType) {
|
|
5631
|
+
case 'Canvas':
|
|
5632
|
+
data.credentialsJson.accessToken = creds.Token;
|
|
5633
|
+
break;
|
|
5634
|
+
case 'Blackboard':
|
|
5635
|
+
data.credentialsJson.key = creds.ClientKey;
|
|
5636
|
+
data.credentialsJson.secret = creds.ClientSecret;
|
|
5637
|
+
break;
|
|
5638
|
+
default:
|
|
5639
|
+
break;
|
|
5640
|
+
}
|
|
5641
|
+
return data;
|
|
5642
|
+
}
|
|
5643
|
+
|
|
5625
5644
|
function callGetCredentials(tenantId, appId, providers) {
|
|
5626
5645
|
return function (dispatch, getState, api) {
|
|
5627
5646
|
return Promise.all([dispatch(tryGetCredentials(tenantId, appId, providers.source, providers.sourceCredentials)), dispatch(tryGetCredentials(tenantId, appId, providers.destination, providers.destinationCredentials))]).then(function (res) {
|
|
@@ -5638,8 +5657,8 @@ module.exports =
|
|
|
5638
5657
|
|
|
5639
5658
|
function tryGetCredentials(tenantId, appId, credentialType, creds) {
|
|
5640
5659
|
return function (dispatch, getState, api) {
|
|
5641
|
-
var
|
|
5642
|
-
config =
|
|
5660
|
+
var _getState23 = getState(),
|
|
5661
|
+
config = _getState23.config;
|
|
5643
5662
|
|
|
5644
5663
|
if (creds && creds.length > 0 && creds[0] !== 'Oauth') {
|
|
5645
5664
|
return api.get(tenantId + '/' + appId + '/credentials/' + credentialType, {
|
|
@@ -5651,34 +5670,6 @@ module.exports =
|
|
|
5651
5670
|
};
|
|
5652
5671
|
}
|
|
5653
5672
|
|
|
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
5673
|
function callGetTrigger(transBaseId) {
|
|
5683
5674
|
return function (dispatch, getState, api) {
|
|
5684
5675
|
var _getState24 = getState(),
|
|
@@ -8909,21 +8900,13 @@ module.exports =
|
|
|
8909
8900
|
endpoint = endpoint.slice(0, -1);
|
|
8910
8901
|
change(step.mode + 'Endpoint', endpoint);
|
|
8911
8902
|
}
|
|
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
|
-
})*/
|
|
8903
|
+
|
|
8921
8904
|
if (credentials) {
|
|
8922
8905
|
actions.postCredentials(tenantId, accountId, step.providerType, endpoint, credentials, step.mode).then(function () {
|
|
8923
|
-
actions.
|
|
8906
|
+
actions.getMetadataFromEnvStep(tenantId, accountId, step.mode, step.providerType, step.metadataEndpoint, step.metadataApi, endpoint || '_blank', credentials);
|
|
8924
8907
|
});
|
|
8925
8908
|
} else {
|
|
8926
|
-
actions.
|
|
8909
|
+
actions.getMetadataFromEnvStep(tenantId, accountId, step.mode, step.providerType, step.metadataEndpoint, step.metadataApi, endpoint || '_blank', credentials);
|
|
8927
8910
|
}
|
|
8928
8911
|
}
|
|
8929
8912
|
}, {
|
|
@@ -9159,7 +9142,7 @@ module.exports =
|
|
|
9159
9142
|
),
|
|
9160
9143
|
_react2.default.createElement(
|
|
9161
9144
|
'ul',
|
|
9162
|
-
|
|
9145
|
+
{ style: { listStyle: 'none', paddingLeft: 5 } },
|
|
9163
9146
|
wizard[step.mode + 'Metadata'].filter(function (m) {
|
|
9164
9147
|
return m.method !== 'POST';
|
|
9165
9148
|
}).map(function (rsc, i) {
|
|
@@ -11052,20 +11035,18 @@ module.exports =
|
|
|
11052
11035
|
mappings = _saveData.mappings;
|
|
11053
11036
|
|
|
11054
11037
|
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));
|
|
11038
|
+
actions.callCreateScenario(tenantId, accountId, data).then(function () {
|
|
11039
|
+
_this3.setState({ loading: true });
|
|
11040
|
+
actions.callGetScenarioList(tenantId, accountId, step.typeGuid).then(function (r) {
|
|
11041
|
+
console.log(r);
|
|
11042
|
+
_this3.setState({ loading: false });
|
|
11043
|
+
});
|
|
11044
|
+
});
|
|
11045
|
+
/*var dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(data));
|
|
11065
11046
|
var dlAnchor = this.downloadAnchor;
|
|
11066
11047
|
dlAnchor.setAttribute("href", dataStr);
|
|
11067
11048
|
dlAnchor.setAttribute("download", "scenario.json");
|
|
11068
|
-
dlAnchor.click()
|
|
11049
|
+
dlAnchor.click();*/
|
|
11069
11050
|
}
|
|
11070
11051
|
}
|
|
11071
11052
|
}, {
|