@lingk/sync 1.1.0 → 1.1.2

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
@@ -17343,7 +17343,8 @@ module.exports =
17343
17343
  // isReload means that the "Check Connection" button was NOT clicked
17344
17344
  function callGetMetadata(tenantId, appId, mode, providerType, providerConfig, endpoint, isFramework, creds, environment, isReload, fileSchemaGuid, extraQuery) {
17345
17345
  var metadata = null;
17346
- var credentialType = providerConfig.credentialType;
17346
+ var credentialType = providerConfig.credentialType,
17347
+ metadataApi = providerConfig.metadataApi;
17347
17348
 
17348
17349
  var isOauth = credentialType === 'SalesforceAuthCode';
17349
17350
  return function (dispatch) {
@@ -17376,8 +17377,14 @@ module.exports =
17376
17377
  data: { metadata: metadata, mode: mode, code: '200 OK', providerType: providerType }
17377
17378
  });
17378
17379
  return metadata;
17379
- }).catch(function (err) {
17380
- console.log(err);
17380
+ }).catch(function (error) {
17381
+ var err = null;
17382
+ if (error.response && error.response.data) {
17383
+ err = error.response.data;
17384
+ }
17385
+ if (metadataApi === 'TEST_CONN_API_URL') {
17386
+ err = error.response.data.error;
17387
+ }
17381
17388
  dispatch({
17382
17389
  type: types.FINISH_WIZARD_ENV_CHECK,
17383
17390
  data: { res: null, mode: mode, code: '404 Error', providerType: providerType, err: err }
@@ -26306,6 +26313,8 @@ module.exports =
26306
26313
 
26307
26314
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26308
26315
 
26316
+ 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); } }
26317
+
26309
26318
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
26310
26319
 
26311
26320
  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; }
@@ -26320,7 +26329,7 @@ module.exports =
26320
26329
 
26321
26330
  var _this = _possibleConstructorReturn(this, (LingkSync.__proto__ || Object.getPrototypeOf(LingkSync)).call(this));
26322
26331
 
26323
- _this.makeSteps = function (scenarios) {
26332
+ _this.makeSteps = function () {
26324
26333
  var wizard = _this.props.wizardConfig;
26325
26334
  var stepList = [];
26326
26335
  for (var i = 0; i < _this.allSteps.length; i++) {
@@ -26340,41 +26349,41 @@ module.exports =
26340
26349
  stepList.push(step);
26341
26350
  } else if (step.type === 'file' && wizard.source.type === 'SFTP') {
26342
26351
  stepList.push(step);
26343
- } else if (step.type === 'scenario' && scenarios.length > 0) {
26344
- step.options = scenarios;
26345
- step.magicNumber = '2147483647';
26346
- stepList.push(step);
26347
- } else if (step.type === 'environment') {
26348
- step.typeGuid = wizard.typeGuid;
26349
- if (step.mode === 'source' && !wizard.source.skipEnvStep) {
26350
- step.title = wizard.source.type + ' Environment';
26351
- step.message = wizard.source.message;
26352
- step.credentials = wizard.source.credentials || null;
26353
- step.metadataEndpoint = wizard.source.metadataEndpoint;
26354
- step.metadataApi = wizard.source.metadataApi;
26355
- step.previewToken = _this.props.previewToken;
26356
- step.bidirectional = wizard.source.bidirectional;
26352
+ } /*else if(step.type==='scenario'){
26353
+ step.options = []
26354
+ step.magicNumber = '2147483647'
26355
+ stepList.push(step)
26356
+ } */else if (step.type === 'environment') {
26357
+ step.typeGuid = wizard.typeGuid;
26358
+ if (step.mode === 'source' && !wizard.source.skipEnvStep) {
26359
+ step.title = wizard.source.type + ' Environment';
26360
+ step.message = wizard.source.message;
26361
+ step.credentials = wizard.source.credentials || null;
26362
+ step.metadataEndpoint = wizard.source.metadataEndpoint;
26363
+ step.metadataApi = wizard.source.metadataApi;
26364
+ step.previewToken = _this.props.previewToken;
26365
+ step.bidirectional = wizard.source.bidirectional;
26366
+ stepList.push(step);
26367
+ } else if (step.mode === 'destination' && !wizard.destination.skipEnvStep) {
26368
+ step.title = wizard.destination.type + ' Environment';
26369
+ step.message = wizard.destination.message;
26370
+ step.credentials = wizard.destination.credentials || null;
26371
+ step.metadataEndpoint = wizard.destination.metadataEndpoint;
26372
+ step.metadataApi = wizard.destination.metadataApi;
26373
+ step.previewToken = _this.props.previewToken;
26374
+ step.bidirectional = wizard.destination.bidirectional;
26375
+ stepList.push(step);
26376
+ }
26377
+ } else if (step.type === 'schema') {
26378
+ stepList.push(step);
26379
+ } else if (step.type === 'map') {
26380
+ step.customizable = wizard.destination.customizable;
26381
+ step.typeGuid = wizard.typeGuid;
26357
26382
  stepList.push(step);
26358
- } else if (step.mode === 'destination' && !wizard.destination.skipEnvStep) {
26359
- step.title = wizard.destination.type + ' Environment';
26360
- step.message = wizard.destination.message;
26361
- step.credentials = wizard.destination.credentials || null;
26362
- step.metadataEndpoint = wizard.destination.metadataEndpoint;
26363
- step.metadataApi = wizard.destination.metadataApi;
26364
- step.previewToken = _this.props.previewToken;
26365
- step.bidirectional = wizard.destination.bidirectional;
26383
+ } else if (step.type === 'deploy') {
26384
+ step.options = ['once', 'daily', 'repeating'];
26366
26385
  stepList.push(step);
26367
26386
  }
26368
- } else if (step.type === 'schema') {
26369
- stepList.push(step);
26370
- } else if (step.type === 'map') {
26371
- step.customizable = wizard.destination.customizable;
26372
- step.typeGuid = wizard.typeGuid;
26373
- stepList.push(step);
26374
- } else if (step.type === 'deploy') {
26375
- step.options = ['once', 'daily', 'repeating'];
26376
- stepList.push(step);
26377
- }
26378
26387
  }
26379
26388
  _this.setState({
26380
26389
  steps: stepList
@@ -26435,8 +26444,27 @@ module.exports =
26435
26444
  actions = _props.actions,
26436
26445
  wizardConfig = _props.wizardConfig;
26437
26446
 
26438
- actions.callGetScenarioList(tenantId, accountId, wizardConfig.typeGuid).then(function (r) {
26439
- return _this2.makeSteps(r);
26447
+ this.makeSteps();
26448
+ actions.callGetScenarioList(tenantId, accountId, wizardConfig.typeGuid).then(function (scenarios) {
26449
+ var steps = [].concat(_toConsumableArray(_this2.state.steps));
26450
+ var beforeScenarioIndex = void 0;
26451
+ steps.forEach(function (step, i) {
26452
+ if (step.type === 'env') {
26453
+ beforeScenarioIndex = i;
26454
+ }
26455
+ if (step.type === 'file') {
26456
+ beforeScenarioIndex = i;
26457
+ }
26458
+ });
26459
+ if (scenarios.length > 0) {
26460
+ steps.splice(beforeScenarioIndex + 1, 0, {
26461
+ type: 'scenario',
26462
+ title: 'Data Scenario',
26463
+ magicNumber: '2147483647',
26464
+ options: scenarios
26465
+ });
26466
+ }
26467
+ _this2.setState({ steps: steps });
26440
26468
  });
26441
26469
  }
26442
26470
  }, {