@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.
package/build/main.js CHANGED
@@ -8322,7 +8322,7 @@ module.exports =
8322
8322
  /* 72 */
8323
8323
  /***/ function(module, exports, __webpack_require__) {
8324
8324
 
8325
- 'use strict';
8325
+ "use strict";
8326
8326
 
8327
8327
  Object.defineProperty(exports, "__esModule", {
8328
8328
  value: true
@@ -8346,13 +8346,13 @@ module.exports =
8346
8346
 
8347
8347
  // SKIP ON SERVER-SIDE RENDERING
8348
8348
  var codemirror = null;
8349
- if (typeof window !== 'undefined' && typeof window.navigator !== 'undefined') {
8349
+ if (typeof window !== "undefined" && typeof window.navigator !== "undefined") {
8350
8350
  codemirror = __webpack_require__(49);
8351
8351
  __webpack_require__(40);
8352
8352
  }
8353
8353
 
8354
8354
  function unCamelize(text) {
8355
- return text.replace(/([A-Z])/g, ' $1').replace(/^./, function (str) {
8355
+ return text.replace(/([A-Z])/g, " $1").replace(/^./, function (str) {
8356
8356
  return str.toUpperCase();
8357
8357
  });
8358
8358
  }
@@ -8362,21 +8362,32 @@ module.exports =
8362
8362
  showPass = _ref.showPass;
8363
8363
 
8364
8364
  return _react2.default.createElement(
8365
- 'svg',
8366
- { onClick: onClick, style: showPass ? { fill: '#3a91dcb3' } : {},
8367
- height: '24', width: '24', className: 'pass-key-svg', viewBox: '0 0 24 24' },
8368
- _react2.default.createElement('path', { d: 'M0 0h24v24H0z', fill: 'none' }),
8369
- _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' })
8365
+ "svg",
8366
+ {
8367
+ onClick: onClick,
8368
+ style: showPass ? { fill: "#3a91dcb3" } : {},
8369
+ height: "24",
8370
+ width: "24",
8371
+ className: "pass-key-svg",
8372
+ viewBox: "0 0 24 24"
8373
+ },
8374
+ _react2.default.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }),
8375
+ _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" })
8370
8376
  );
8371
8377
  };
8372
8378
 
8373
8379
  var Loop = function Loop() {
8374
8380
  return _react2.default.createElement(
8375
- 'svg',
8376
- { fill: '#FFFFFF', height: '18', viewBox: '0 0 24 24', width: '18',
8377
- style: { marginTop: -1 } },
8378
- _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' }),
8379
- _react2.default.createElement('path', { d: 'M0 0h24v24H0z', fill: 'none' })
8381
+ "svg",
8382
+ {
8383
+ fill: "#FFFFFF",
8384
+ height: "18",
8385
+ viewBox: "0 0 24 24",
8386
+ width: "18",
8387
+ style: { marginTop: -1 }
8388
+ },
8389
+ _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" }),
8390
+ _react2.default.createElement("path", { d: "M0 0h24v24H0z", fill: "none" })
8380
8391
  );
8381
8392
  };
8382
8393
 
@@ -8391,30 +8402,30 @@ module.exports =
8391
8402
  _this.handleToggle = function (value) {
8392
8403
  var credentialType = _this.state.credentialType;
8393
8404
 
8394
- var toggle = credentialType === 'password' ? 'ssh-key' : 'password';
8405
+ var toggle = credentialType === "password" ? "ssh-key" : "password";
8395
8406
  _this.setState({ credentialType: toggle });
8396
8407
  };
8397
8408
 
8398
8409
  _this.state = {
8399
- credentialType: 'password', // password or ssh-key
8410
+ credentialType: "password", // password or ssh-key
8400
8411
  showPass: false
8401
8412
  };
8402
8413
  return _this;
8403
8414
  }
8404
8415
 
8405
8416
  _createClass(SFTP, [{
8406
- key: 'componentDidMount',
8417
+ key: "componentDidMount",
8407
8418
  value: function componentDidMount() {
8408
8419
  var _props = this.props,
8409
8420
  creds = _props.creds,
8410
8421
  onChange = _props.onChange;
8411
8422
 
8412
8423
  if (!creds["credentialType"]) {
8413
- onChange({ target: { name: 'credentialType', value: 'password' } });
8424
+ onChange({ target: { name: "credentialType", value: "password" } });
8414
8425
  }
8415
8426
  }
8416
8427
  }, {
8417
- key: 'render',
8428
+ key: "render",
8418
8429
  value: function render() {
8419
8430
  var _this2 = this;
8420
8431
 
@@ -8431,119 +8442,146 @@ module.exports =
8431
8442
 
8432
8443
 
8433
8444
  var CodeMirror = codemirror && codemirror.Controlled;
8434
-
8435
8445
  var Button = inputs.Button;
8436
8446
  var Input = inputs.Input;
8437
8447
  var Toggle = inputs.ToggleButtonGroup;
8438
8448
  var Spinner = inputs.Spinner;
8439
-
8440
8449
  var credentials = config && config.credentials.filter(function (o) {
8441
- if (o === 'privateKey') {
8442
- var i = o;
8443
- if (o === 'privateKey') {
8444
- i = 'ssh-key';
8445
- }
8446
-
8447
- if (creds["credentialType"] === i) {
8450
+ if (o === "privateKey") {
8451
+ var i = "ssh-key";
8452
+ var j = "two-Factor Auth";
8453
+ if (creds["credentialType"] === i || creds["credentialType"] === j) {
8448
8454
  return true;
8449
8455
  } else {
8450
8456
  return false;
8451
8457
  }
8452
8458
  }
8453
-
8459
+ if (o === "password") {
8460
+ var _i = "ssh-key";
8461
+ if (creds["credentialType"] === _i) {
8462
+ return false;
8463
+ } else {
8464
+ return true;
8465
+ }
8466
+ }
8454
8467
  return true;
8455
8468
  });
8456
8469
 
8457
- //
8458
-
8459
- var passwordIsOptional = credentials.includes('privateKey');
8470
+ var passwordIsOptional = credentials.includes("privateKey");
8460
8471
 
8461
8472
  var credsDisabledCheck = credentials.some(function (c) {
8462
- return !Object.keys(creds).includes(c.split(' ').join(''));
8473
+ return !Object.keys(creds).includes(c.split(" ").join(""));
8463
8474
  });
8464
8475
 
8465
8476
  return _react2.default.createElement(
8466
- 'div',
8477
+ "div",
8467
8478
  null,
8468
8479
  credentials && _react2.default.createElement(
8469
- 'div',
8470
- { style: { display: 'inline-block' } },
8480
+ "div",
8481
+ { style: { display: "inline-block" } },
8471
8482
  _react2.default.createElement(
8472
- 'div',
8473
- { style: { marginLeft: 15, marginTop: 40, float: 'right' } },
8483
+ "div",
8484
+ { style: { marginLeft: 15, marginTop: 40, float: "right" } },
8474
8485
  checking && _react2.default.createElement(Spinner, null),
8475
8486
  envCheckResult && _react2.default.createElement(
8476
- 'span',
8487
+ "span",
8477
8488
  null,
8478
8489
  envCheckResult,
8479
- ' ',
8490
+ " ",
8480
8491
  _react2.default.createElement(EnvCheckIcons, { result: envCheckResult }),
8481
- ' '
8492
+ " "
8482
8493
  )
8483
8494
  ),
8484
8495
  _react2.default.createElement(
8485
- 'div',
8486
- { style: { display: 'inline-block', marginLeft: 16 } },
8496
+ "div",
8497
+ { style: { display: "inline-block", marginLeft: 16 } },
8487
8498
  _react2.default.createElement(
8488
- 'div',
8489
- { className: 'pass-ssh-toggle' },
8499
+ "div",
8500
+ { className: "pass-ssh-toggle" },
8490
8501
  _react2.default.createElement(Toggle, {
8491
8502
  value: creds["credentialType"],
8492
- options: ['password', 'ssh-key'],
8503
+ options: ["password", "ssh-key", "two-Factor Auth"],
8493
8504
  handleToggle: function handleToggle(v) {
8494
- return onChange({ target: { name: 'credentialType', value: v } });
8505
+ return onChange({ target: { name: "credentialType", value: v } });
8495
8506
  }
8496
8507
  })
8497
8508
  ),
8498
8509
  credentials.map(function (credType, index) {
8499
8510
  return _react2.default.createElement(
8500
- 'div',
8511
+ "div",
8501
8512
  { key: index, style: { marginTop: 8 } },
8502
- credType === 'privateKey' ? _react2.default.createElement(
8503
- 'label',
8504
- { htmlFor: credType, className: 'labelz', style: { fontWeight: 'normal' } },
8505
- 'SSH Key'
8513
+ credType === "privateKey" ? _react2.default.createElement(
8514
+ "label",
8515
+ {
8516
+ htmlFor: credType,
8517
+ className: "labelz",
8518
+ style: { fontWeight: "normal" }
8519
+ },
8520
+ "SSH Key"
8506
8521
  ) : _react2.default.createElement(
8507
- 'label',
8508
- { htmlFor: credType, className: 'labelz', style: { fontWeight: 'normal' } },
8522
+ "label",
8523
+ {
8524
+ htmlFor: credType,
8525
+ className: "labelz",
8526
+ style: { fontWeight: "normal" }
8527
+ },
8509
8528
  unCamelize(credType)
8510
8529
  ),
8511
- _react2.default.createElement('br', null),
8512
- credType === 'privateKey' ? _react2.default.createElement(
8513
- 'div',
8530
+ _react2.default.createElement("br", null),
8531
+ credType === "privateKey" ? _react2.default.createElement(
8532
+ "div",
8514
8533
  null,
8515
- _react2.default.createElement(CodeMirror, { value: creds[credType],
8516
- className: 'env-creds-json-codemirror-sftp',
8534
+ _react2.default.createElement(CodeMirror, {
8535
+ value: creds[credType],
8536
+ className: "env-creds-json-codemirror-sftp",
8517
8537
  options: {
8518
8538
  lineNumbers: true,
8519
- theme: 'default',
8520
- mode: 'javascript',
8539
+ theme: "default",
8540
+ mode: "javascript",
8521
8541
  dragDrop: true
8522
8542
  },
8523
8543
  onBeforeChange: function onBeforeChange(e, d, v) {
8524
8544
  return onChange({ target: { name: credType, value: v } });
8525
- } })
8526
- ) : _react2.default.createElement(Input, { name: credType,
8527
- datatype: credType === 'password' && !_this2.state.showPass ? 'password' : null,
8528
- value: creds[credType] || '',
8529
- onChange: onChange }),
8545
+ }
8546
+ })
8547
+ ) : _react2.default.createElement(Input, {
8548
+ name: credType,
8549
+ datatype: credType === "password" && !_this2.state.showPass ? "password" : null,
8550
+ value: creds[credType] || "",
8551
+ onChange: onChange
8552
+ }),
8530
8553
  index === 0 && _react2.default.createElement(
8531
8554
  Button,
8532
- { type: 'brand',
8555
+ {
8556
+ type: "brand",
8533
8557
  onClick: function onClick() {
8534
8558
  return onCheck(creds);
8535
8559
  },
8536
- style: { marginLeft: 8, marginBottom: 4, height: 30, lineHeight: '10px', marginTop: -1 },
8537
- disabled: credsDisabledCheck },
8560
+ style: {
8561
+ marginLeft: 8,
8562
+ marginBottom: 4,
8563
+ height: 30,
8564
+ lineHeight: "10px",
8565
+ marginTop: -1
8566
+ },
8567
+ disabled: credsDisabledCheck
8568
+ },
8538
8569
  _react2.default.createElement(
8539
- 'span',
8540
- { style: { display: 'inline-block', verticalAlign: 'top', marginTop: 3 } },
8541
- 'Test Connection'
8570
+ "span",
8571
+ {
8572
+ style: {
8573
+ display: "inline-block",
8574
+ verticalAlign: "top",
8575
+ marginTop: 3
8576
+ }
8577
+ },
8578
+ "Test Connection"
8542
8579
  ),
8543
- '\xA0\xA0',
8580
+ "\xA0\xA0",
8544
8581
  _react2.default.createElement(Loop, null)
8545
8582
  ),
8546
- credType === 'password' && _react2.default.createElement(Key, { showPass: _this2.state.showPass,
8583
+ credType === "password" && _react2.default.createElement(Key, {
8584
+ showPass: _this2.state.showPass,
8547
8585
  onClick: function onClick() {
8548
8586
  return _this2.setState({ showPass: !_this2.state.showPass });
8549
8587
  }