@lingk/sync 1.0.99 → 1.1.1

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/main.js CHANGED
@@ -17389,11 +17389,13 @@ module.exports =
17389
17389
  function tryCheckConnection(tenantId, appId, providerType, providerConfig, isFramework, creds, fileSchemaGuid) {
17390
17390
  return function (dispatch, getState, api) {
17391
17391
  var credentialType = providerConfig.credentialType,
17392
- metadataApi = providerConfig.metadataApi;
17392
+ metadataApi = providerConfig.metadataApi,
17393
+ skipCheckConnection = providerConfig.skipCheckConnection;
17393
17394
 
17394
17395
 
17395
- var isOauth = credentialType === 'SalesforceAuthCode';
17396
- var isAdapter = credentialType === 'LingkAdapter';
17396
+ if (skipCheckConnection || fileSchemaGuid || isDemoCreds(creds, providerType)) {
17397
+ return Promise.resolve(null);
17398
+ }
17397
17399
 
17398
17400
  //const isEthos = credentialType==='Ethos'
17399
17401
 
@@ -17413,18 +17415,15 @@ module.exports =
17413
17415
  }
17414
17416
  });
17415
17417
  }
17416
- // if demo creds are entered, skip this
17417
- // ADD: OR IF adaptermetadata SKIP THIS
17418
- else if (!isOauth && !isAdapter && !isDemoCreds(creds, providerType) && !fileSchemaGuid) {
17419
- return api.post(tenantId + '/' + appId + '/testconnection/' + providerType.toLowerCase(), {
17420
- endpoint: config.TRANS_API_URL,
17421
- data: {
17422
- credentialType: credentialType,
17423
- credentialsJson: creds,
17424
- providerLabel: providerType
17425
- }
17426
- });
17427
- } else return Promise.resolve(null);
17418
+
17419
+ return api.post(tenantId + '/' + appId + '/testconnection/' + providerType.toLowerCase(), {
17420
+ endpoint: config.TRANS_API_URL,
17421
+ data: {
17422
+ credentialType: credentialType,
17423
+ credentialsJson: creds,
17424
+ providerLabel: providerType
17425
+ }
17426
+ });
17428
17427
  };
17429
17428
  }
17430
17429
 
@@ -26307,6 +26306,8 @@ module.exports =
26307
26306
 
26308
26307
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26309
26308
 
26309
+ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
26310
+
26310
26311
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
26311
26312
 
26312
26313
  function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
@@ -26321,7 +26322,7 @@ module.exports =
26321
26322
 
26322
26323
  var _this = _possibleConstructorReturn(this, (LingkSync.__proto__ || Object.getPrototypeOf(LingkSync)).call(this));
26323
26324
 
26324
- _this.makeSteps = function (scenarios) {
26325
+ _this.makeSteps = function () {
26325
26326
  var wizard = _this.props.wizardConfig;
26326
26327
  var stepList = [];
26327
26328
  for (var i = 0; i < _this.allSteps.length; i++) {
@@ -26341,41 +26342,41 @@ module.exports =
26341
26342
  stepList.push(step);
26342
26343
  } else if (step.type === 'file' && wizard.source.type === 'SFTP') {
26343
26344
  stepList.push(step);
26344
- } else if (step.type === 'scenario' && scenarios.length > 0) {
26345
- step.options = scenarios;
26346
- step.magicNumber = '2147483647';
26347
- stepList.push(step);
26348
- } else if (step.type === 'environment') {
26349
- step.typeGuid = wizard.typeGuid;
26350
- if (step.mode === 'source' && !wizard.source.skipEnvStep) {
26351
- step.title = wizard.source.type + ' Environment';
26352
- step.message = wizard.source.message;
26353
- step.credentials = wizard.source.credentials || null;
26354
- step.metadataEndpoint = wizard.source.metadataEndpoint;
26355
- step.metadataApi = wizard.source.metadataApi;
26356
- step.previewToken = _this.props.previewToken;
26357
- step.bidirectional = wizard.source.bidirectional;
26345
+ } /*else if(step.type==='scenario'){
26346
+ step.options = []
26347
+ step.magicNumber = '2147483647'
26348
+ stepList.push(step)
26349
+ } */else if (step.type === 'environment') {
26350
+ step.typeGuid = wizard.typeGuid;
26351
+ if (step.mode === 'source' && !wizard.source.skipEnvStep) {
26352
+ step.title = wizard.source.type + ' Environment';
26353
+ step.message = wizard.source.message;
26354
+ step.credentials = wizard.source.credentials || null;
26355
+ step.metadataEndpoint = wizard.source.metadataEndpoint;
26356
+ step.metadataApi = wizard.source.metadataApi;
26357
+ step.previewToken = _this.props.previewToken;
26358
+ step.bidirectional = wizard.source.bidirectional;
26359
+ stepList.push(step);
26360
+ } else if (step.mode === 'destination' && !wizard.destination.skipEnvStep) {
26361
+ step.title = wizard.destination.type + ' Environment';
26362
+ step.message = wizard.destination.message;
26363
+ step.credentials = wizard.destination.credentials || null;
26364
+ step.metadataEndpoint = wizard.destination.metadataEndpoint;
26365
+ step.metadataApi = wizard.destination.metadataApi;
26366
+ step.previewToken = _this.props.previewToken;
26367
+ step.bidirectional = wizard.destination.bidirectional;
26368
+ stepList.push(step);
26369
+ }
26370
+ } else if (step.type === 'schema') {
26358
26371
  stepList.push(step);
26359
- } else if (step.mode === 'destination' && !wizard.destination.skipEnvStep) {
26360
- step.title = wizard.destination.type + ' Environment';
26361
- step.message = wizard.destination.message;
26362
- step.credentials = wizard.destination.credentials || null;
26363
- step.metadataEndpoint = wizard.destination.metadataEndpoint;
26364
- step.metadataApi = wizard.destination.metadataApi;
26365
- step.previewToken = _this.props.previewToken;
26366
- step.bidirectional = wizard.destination.bidirectional;
26372
+ } else if (step.type === 'map') {
26373
+ step.customizable = wizard.destination.customizable;
26374
+ step.typeGuid = wizard.typeGuid;
26375
+ stepList.push(step);
26376
+ } else if (step.type === 'deploy') {
26377
+ step.options = ['once', 'daily', 'repeating'];
26367
26378
  stepList.push(step);
26368
26379
  }
26369
- } else if (step.type === 'schema') {
26370
- stepList.push(step);
26371
- } else if (step.type === 'map') {
26372
- step.customizable = wizard.destination.customizable;
26373
- step.typeGuid = wizard.typeGuid;
26374
- stepList.push(step);
26375
- } else if (step.type === 'deploy') {
26376
- step.options = ['once', 'daily', 'repeating'];
26377
- stepList.push(step);
26378
- }
26379
26380
  }
26380
26381
  _this.setState({
26381
26382
  steps: stepList
@@ -26436,8 +26437,27 @@ module.exports =
26436
26437
  actions = _props.actions,
26437
26438
  wizardConfig = _props.wizardConfig;
26438
26439
 
26439
- actions.callGetScenarioList(tenantId, accountId, wizardConfig.typeGuid).then(function (r) {
26440
- return _this2.makeSteps(r);
26440
+ this.makeSteps();
26441
+ actions.callGetScenarioList(tenantId, accountId, wizardConfig.typeGuid).then(function (scenarios) {
26442
+ var steps = [].concat(_toConsumableArray(_this2.state.steps));
26443
+ var beforeScenarioIndex = void 0;
26444
+ steps.forEach(function (step, i) {
26445
+ if (step.type === 'env') {
26446
+ beforeScenarioIndex = i;
26447
+ }
26448
+ if (step.type === 'file') {
26449
+ beforeScenarioIndex = i;
26450
+ }
26451
+ });
26452
+ if (scenarios.length > 0) {
26453
+ steps.splice(beforeScenarioIndex + 1, 0, {
26454
+ type: 'scenario',
26455
+ title: 'Data Scenario',
26456
+ magicNumber: '2147483647',
26457
+ options: scenarios
26458
+ });
26459
+ }
26460
+ _this2.setState({ steps: steps });
26441
26461
  });
26442
26462
  }
26443
26463
  }, {