@lingk/sync 2.0.3 → 2.0.4

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.
@@ -6564,7 +6564,7 @@ module.exports =
6564
6564
  /* 72 */
6565
6565
  /***/ function(module, exports, __webpack_require__) {
6566
6566
 
6567
- 'use strict';
6567
+ "use strict";
6568
6568
 
6569
6569
  Object.defineProperty(exports, "__esModule", {
6570
6570
  value: true
@@ -6588,13 +6588,13 @@ module.exports =
6588
6588
 
6589
6589
  // SKIP ON SERVER-SIDE RENDERING
6590
6590
  var codemirror = null;
6591
- if (typeof window !== 'undefined' && typeof window.navigator !== 'undefined') {
6591
+ if (typeof window !== "undefined" && typeof window.navigator !== "undefined") {
6592
6592
  codemirror = __webpack_require__(49);
6593
6593
  __webpack_require__(40);
6594
6594
  }
6595
6595
 
6596
6596
  function unCamelize(text) {
6597
- return text.replace(/([A-Z])/g, ' $1').replace(/^./, function (str) {
6597
+ return text.replace(/([A-Z])/g, " $1").replace(/^./, function (str) {
6598
6598
  return str.toUpperCase();
6599
6599
  });
6600
6600
  }
@@ -6604,21 +6604,32 @@ module.exports =
6604
6604
  showPass = _ref.showPass;
6605
6605
 
6606
6606
  return _react2.default.createElement(
6607
- 'svg',
6608
- { onClick: onClick, style: showPass ? { fill: '#3a91dcb3' } : {},
6609
- height: '24', width: '24', className: 'pass-key-svg', viewBox: '0 0 24 24' },
6610
- _react2.default.createElement('path', { d: 'M0 0h24v24H0z', fill: 'none' }),
6611
- _react2.default.createElement('path', { d: 'M12.65 10C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H17v4h4v-4h2v-4H12.65zM7 14c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z' })
6607
+ "svg",
6608
+ {
6609
+ onClick: onClick,
6610
+ style: showPass ? { fill: "#3a91dcb3" } : {},
6611
+ height: "24",
6612
+ width: "24",
6613
+ className: "pass-key-svg",
6614
+ viewBox: "0 0 24 24"
6615
+ },
6616
+ _react2.default.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }),
6617
+ _react2.default.createElement("path", { d: "M12.65 10C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H17v4h4v-4h2v-4H12.65zM7 14c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z" })
6612
6618
  );
6613
6619
  };
6614
6620
 
6615
6621
  var Loop = function Loop() {
6616
6622
  return _react2.default.createElement(
6617
- 'svg',
6618
- { fill: '#FFFFFF', height: '18', viewBox: '0 0 24 24', width: '18',
6619
- style: { marginTop: -1 } },
6620
- _react2.default.createElement('path', { d: 'M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z' }),
6621
- _react2.default.createElement('path', { d: 'M0 0h24v24H0z', fill: 'none' })
6623
+ "svg",
6624
+ {
6625
+ fill: "#FFFFFF",
6626
+ height: "18",
6627
+ viewBox: "0 0 24 24",
6628
+ width: "18",
6629
+ style: { marginTop: -1 }
6630
+ },
6631
+ _react2.default.createElement("path", { d: "M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z" }),
6632
+ _react2.default.createElement("path", { d: "M0 0h24v24H0z", fill: "none" })
6622
6633
  );
6623
6634
  };
6624
6635
 
@@ -6633,30 +6644,30 @@ module.exports =
6633
6644
  _this.handleToggle = function (value) {
6634
6645
  var credentialType = _this.state.credentialType;
6635
6646
 
6636
- var toggle = credentialType === 'password' ? 'ssh-key' : 'password';
6647
+ var toggle = credentialType === "password" ? "ssh-key" : "password";
6637
6648
  _this.setState({ credentialType: toggle });
6638
6649
  };
6639
6650
 
6640
6651
  _this.state = {
6641
- credentialType: 'password', // password or ssh-key
6652
+ credentialType: "password", // password or ssh-key
6642
6653
  showPass: false
6643
6654
  };
6644
6655
  return _this;
6645
6656
  }
6646
6657
 
6647
6658
  _createClass(SFTP, [{
6648
- key: 'componentDidMount',
6659
+ key: "componentDidMount",
6649
6660
  value: function componentDidMount() {
6650
6661
  var _props = this.props,
6651
6662
  creds = _props.creds,
6652
6663
  onChange = _props.onChange;
6653
6664
 
6654
6665
  if (!creds["credentialType"]) {
6655
- onChange({ target: { name: 'credentialType', value: 'password' } });
6666
+ onChange({ target: { name: "credentialType", value: "password" } });
6656
6667
  }
6657
6668
  }
6658
6669
  }, {
6659
- key: 'render',
6670
+ key: "render",
6660
6671
  value: function render() {
6661
6672
  var _this2 = this;
6662
6673
 
@@ -6673,119 +6684,146 @@ module.exports =
6673
6684
 
6674
6685
 
6675
6686
  var CodeMirror = codemirror && codemirror.Controlled;
6676
-
6677
6687
  var Button = inputs.Button;
6678
6688
  var Input = inputs.Input;
6679
6689
  var Toggle = inputs.ToggleButtonGroup;
6680
6690
  var Spinner = inputs.Spinner;
6681
-
6682
6691
  var credentials = config && config.credentials.filter(function (o) {
6683
- if (o === 'privateKey') {
6684
- var i = o;
6685
- if (o === 'privateKey') {
6686
- i = 'ssh-key';
6687
- }
6688
-
6689
- if (creds["credentialType"] === i) {
6692
+ if (o === "privateKey") {
6693
+ var i = "ssh-key";
6694
+ var j = "two-Factor Auth";
6695
+ if (creds["credentialType"] === i || creds["credentialType"] === j) {
6690
6696
  return true;
6691
6697
  } else {
6692
6698
  return false;
6693
6699
  }
6694
6700
  }
6695
-
6701
+ if (o === "password") {
6702
+ var _i = "ssh-key";
6703
+ if (creds["credentialType"] === _i) {
6704
+ return false;
6705
+ } else {
6706
+ return true;
6707
+ }
6708
+ }
6696
6709
  return true;
6697
6710
  });
6698
6711
 
6699
- //
6700
-
6701
- var passwordIsOptional = credentials.includes('privateKey');
6712
+ var passwordIsOptional = credentials.includes("privateKey");
6702
6713
 
6703
6714
  var credsDisabledCheck = credentials.some(function (c) {
6704
- return !Object.keys(creds).includes(c.split(' ').join(''));
6715
+ return !Object.keys(creds).includes(c.split(" ").join(""));
6705
6716
  });
6706
6717
 
6707
6718
  return _react2.default.createElement(
6708
- 'div',
6719
+ "div",
6709
6720
  null,
6710
6721
  credentials && _react2.default.createElement(
6711
- 'div',
6712
- { style: { display: 'inline-block' } },
6722
+ "div",
6723
+ { style: { display: "inline-block" } },
6713
6724
  _react2.default.createElement(
6714
- 'div',
6715
- { style: { marginLeft: 15, marginTop: 40, float: 'right' } },
6725
+ "div",
6726
+ { style: { marginLeft: 15, marginTop: 40, float: "right" } },
6716
6727
  checking && _react2.default.createElement(Spinner, null),
6717
6728
  envCheckResult && _react2.default.createElement(
6718
- 'span',
6729
+ "span",
6719
6730
  null,
6720
6731
  envCheckResult,
6721
- ' ',
6732
+ " ",
6722
6733
  _react2.default.createElement(EnvCheckIcons, { result: envCheckResult }),
6723
- ' '
6734
+ " "
6724
6735
  )
6725
6736
  ),
6726
6737
  _react2.default.createElement(
6727
- 'div',
6728
- { style: { display: 'inline-block', marginLeft: 16 } },
6738
+ "div",
6739
+ { style: { display: "inline-block", marginLeft: 16 } },
6729
6740
  _react2.default.createElement(
6730
- 'div',
6731
- { className: 'pass-ssh-toggle' },
6741
+ "div",
6742
+ { className: "pass-ssh-toggle" },
6732
6743
  _react2.default.createElement(Toggle, {
6733
6744
  value: creds["credentialType"],
6734
- options: ['password', 'ssh-key'],
6745
+ options: ["password", "ssh-key", "two-Factor Auth"],
6735
6746
  handleToggle: function handleToggle(v) {
6736
- return onChange({ target: { name: 'credentialType', value: v } });
6747
+ return onChange({ target: { name: "credentialType", value: v } });
6737
6748
  }
6738
6749
  })
6739
6750
  ),
6740
6751
  credentials.map(function (credType, index) {
6741
6752
  return _react2.default.createElement(
6742
- 'div',
6753
+ "div",
6743
6754
  { key: index, style: { marginTop: 8 } },
6744
- credType === 'privateKey' ? _react2.default.createElement(
6745
- 'label',
6746
- { htmlFor: credType, className: 'labelz', style: { fontWeight: 'normal' } },
6747
- 'SSH Key'
6755
+ credType === "privateKey" ? _react2.default.createElement(
6756
+ "label",
6757
+ {
6758
+ htmlFor: credType,
6759
+ className: "labelz",
6760
+ style: { fontWeight: "normal" }
6761
+ },
6762
+ "SSH Key"
6748
6763
  ) : _react2.default.createElement(
6749
- 'label',
6750
- { htmlFor: credType, className: 'labelz', style: { fontWeight: 'normal' } },
6764
+ "label",
6765
+ {
6766
+ htmlFor: credType,
6767
+ className: "labelz",
6768
+ style: { fontWeight: "normal" }
6769
+ },
6751
6770
  unCamelize(credType)
6752
6771
  ),
6753
- _react2.default.createElement('br', null),
6754
- credType === 'privateKey' ? _react2.default.createElement(
6755
- 'div',
6772
+ _react2.default.createElement("br", null),
6773
+ credType === "privateKey" ? _react2.default.createElement(
6774
+ "div",
6756
6775
  null,
6757
- _react2.default.createElement(CodeMirror, { value: creds[credType],
6758
- className: 'env-creds-json-codemirror-sftp',
6776
+ _react2.default.createElement(CodeMirror, {
6777
+ value: creds[credType],
6778
+ className: "env-creds-json-codemirror-sftp",
6759
6779
  options: {
6760
6780
  lineNumbers: true,
6761
- theme: 'default',
6762
- mode: 'javascript',
6781
+ theme: "default",
6782
+ mode: "javascript",
6763
6783
  dragDrop: true
6764
6784
  },
6765
6785
  onBeforeChange: function onBeforeChange(e, d, v) {
6766
6786
  return onChange({ target: { name: credType, value: v } });
6767
- } })
6768
- ) : _react2.default.createElement(Input, { name: credType,
6769
- datatype: credType === 'password' && !_this2.state.showPass ? 'password' : null,
6770
- value: creds[credType] || '',
6771
- onChange: onChange }),
6787
+ }
6788
+ })
6789
+ ) : _react2.default.createElement(Input, {
6790
+ name: credType,
6791
+ datatype: credType === "password" && !_this2.state.showPass ? "password" : null,
6792
+ value: creds[credType] || "",
6793
+ onChange: onChange
6794
+ }),
6772
6795
  index === 0 && _react2.default.createElement(
6773
6796
  Button,
6774
- { type: 'brand',
6797
+ {
6798
+ type: "brand",
6775
6799
  onClick: function onClick() {
6776
6800
  return onCheck(creds);
6777
6801
  },
6778
- style: { marginLeft: 8, marginBottom: 4, height: 30, lineHeight: '10px', marginTop: -1 },
6779
- disabled: credsDisabledCheck },
6802
+ style: {
6803
+ marginLeft: 8,
6804
+ marginBottom: 4,
6805
+ height: 30,
6806
+ lineHeight: "10px",
6807
+ marginTop: -1
6808
+ },
6809
+ disabled: credsDisabledCheck
6810
+ },
6780
6811
  _react2.default.createElement(
6781
- 'span',
6782
- { style: { display: 'inline-block', verticalAlign: 'top', marginTop: 3 } },
6783
- 'Test Connection'
6812
+ "span",
6813
+ {
6814
+ style: {
6815
+ display: "inline-block",
6816
+ verticalAlign: "top",
6817
+ marginTop: 3
6818
+ }
6819
+ },
6820
+ "Test Connection"
6784
6821
  ),
6785
- '\xA0\xA0',
6822
+ "\xA0\xA0",
6786
6823
  _react2.default.createElement(Loop, null)
6787
6824
  ),
6788
- credType === 'password' && _react2.default.createElement(Key, { showPass: _this2.state.showPass,
6825
+ credType === "password" && _react2.default.createElement(Key, {
6826
+ showPass: _this2.state.showPass,
6789
6827
  onClick: function onClick() {
6790
6828
  return _this2.setState({ showPass: !_this2.state.showPass });
6791
6829
  }