@lingk/sync 2.0.8 → 2.0.9

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
@@ -6675,7 +6675,7 @@ module.exports =
6675
6675
  var bvaToken = {};
6676
6676
  var credentials = config && config.credentials.filter(function (o) {
6677
6677
  if (creds["authenticationType"] === "key") {
6678
- if (o == "refreshToken" || o == "accessToken" || o == "clientId" || o == "rootUrl") {
6678
+ if (o == "refreshToken" || o == "accessToken" || o == "clientId" || o == "rootUrl" || o == "clientSecret") {
6679
6679
  return true;
6680
6680
  } else {
6681
6681
  return false;
@@ -6683,18 +6683,13 @@ module.exports =
6683
6683
  }
6684
6684
  return true;
6685
6685
  });
6686
- var credentialsRemoveToken = credentials.filter(function (c) {
6687
- if (c == "refreshToken" || c == "accessToken" || c == "scope") {
6688
- return false;
6689
- } else {
6690
- return true;
6691
- }
6692
- });
6693
- var credsDisabledCheck = credentialsRemoveToken && credentialsRemoveToken.some(function (c) {
6686
+ var requiredFieldsOAuth = ["rootUrl", "clientId", "clientSecret"];
6687
+ var requiredFieldsKey = ["rootUrl", "clientId", "clientSecret", "refreshToken"];
6688
+
6689
+ var credsDisabledCheck = requiredFieldsOAuth.some(function (c) {
6694
6690
  var formCreds = creds;
6695
- return !Object.keys(formCreds).includes(c.split(" ").join(""));
6691
+ return !Object.keys(formCreds).includes(c.split(" ").join("")) || formCreds[c] == "";
6696
6692
  });
6697
-
6698
6693
  return _react2.default.createElement(
6699
6694
  "div",
6700
6695
  null,
@@ -6718,6 +6713,9 @@ module.exports =
6718
6713
  })
6719
6714
  ),
6720
6715
  credentials.map(function (credType, index) {
6716
+ var key = requiredFieldsKey.find(function (r) {
6717
+ return r == credType;
6718
+ });
6721
6719
  return _react2.default.createElement(
6722
6720
  "div",
6723
6721
  { key: index, style: { marginTop: 8 } },
@@ -6728,19 +6726,40 @@ module.exports =
6728
6726
  className: "labelz",
6729
6727
  style: { fontWeight: "normal" }
6730
6728
  },
6731
- unCamelize(credType)
6729
+ unCamelize(credType),
6730
+ key && creds["authenticationType"] == "key" && _react2.default.createElement(
6731
+ "span",
6732
+ { style: { color: "red" } },
6733
+ "*"
6734
+ )
6732
6735
  ),
6733
6736
  _react2.default.createElement("br", null),
6734
6737
  credType === "refreshToken" || credType === "accessToken" || credType === "scope" ? _react2.default.createElement(
6735
6738
  "div",
6736
6739
  null,
6737
- _react2.default.createElement(Input, {
6740
+ creds["authenticationType"] == "key" ? _react2.default.createElement(Input, {
6738
6741
  name: credType,
6739
6742
  value: creds.bvaToken && creds.bvaToken[credType] || "",
6740
- disabled: credType == "accessToken" || credType == "refreshToken" && creds.authenticationType == "oauth" ? true : false,
6743
+ disabled: credType == "accessToken" ? true : false,
6741
6744
  onChange: function onChange(e) {
6742
6745
  return onChangeCustomKey(e, credType, bvaToken);
6743
6746
  }
6747
+ }) : _react2.default.createElement(Input, {
6748
+ name: credType,
6749
+ value: creds.bvaToken && creds.bvaToken[credType] || "",
6750
+ disabled: credType == "accessToken" || credType == "refreshToken" ? true : false,
6751
+ onChange: function onChange(e) {
6752
+ return onChangeCustomKey(e, credType, bvaToken);
6753
+ }
6754
+ }),
6755
+ credType == "accessToken" && _react2.default.createElement("img", {
6756
+ alt: "small-spinner",
6757
+ src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAeFBMVEX///8AAAD09PRpaWlxcXHw8PAiIiJhYWEYGBhTU1Pz8/N7e3v8/Px4eHjT09OTk5Pb29stLS2BgYHk5OTGxsa+vr64uLiJiYk4ODjU1NQqKiqvr69AQEDr6+tXV1ebm5tGRkaXl5dLS0sPDw8kJCSioqIUFBRsbGw/k7GAAAAFvUlEQVR4nO2d61bqMBBGWy6iULDcFAEFlKPv/4YHOLhU8pWmdr5Mc9bs38q4pWmadGaSJIZhGIZhGP3R/HHQaTP4GE5Wo6muXr7bvqVkxsO5ll73nm73yceTht9jKL0TvVFowVWw7++TY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MBr6OzTfEr+GPjL/SHya7WdGFG4FhQV6DwwanjEdg6H0+ySt8YI3AMPnwVYSpDjEYwikRgnLjYjCskDwJch2iMEzefQ177u/GYeh9nYLOhnEYJitfRfc5IBJD76EYr2Ey+e8N/VKZ39x1VTyGMMfQ42+PyNDn/DxQexOTYfkxnUvwS1EZJsnsegUa2kmNzPCwIEbZxWdgOWp0hofVVMHc+Ir3pyI0PDCd73rrxfJ7G4NhUT1xnIb/yLxaUcRs6IcZ8jBDKcyQhxlKYYY8zFAKM+RhhlKYIQ8zlMIMeZihFGbIwwylMEMeZiiFGfIwQynMkIcZSmGGPMxQCjPkYYZS6Bn2Axm23B7CMKdfHlBGwelHCUrDKHEcQOnk1fbzvwb03OMcsH0JKPbhtDO8cwMFaH2Jm/tWK2H2BeVP+xf3/R6U1My5eFCe/6JCieYvgVWFnMa+sDJszW5/CW4zh6ikYChWxXLpqmT4vKUrZ0DUoqCAcbybTxlHdnVHK1jZm/Lu4R4Z8GGo1kigCmBGVIHX3BeOegV4h/5lxX3gQ8LsId6IL/GGem6j9jk6R6jTE26QHpaC8zvEUD9KZ1/xZMvqaB81E+BZ37c1A4eS8/NkCHI0ZwGcdaGD3oE6Qb7BIz5VqAQqNNOpjXcTEUlKj+kUJfMsCZfjhjvRA/J2UMGdxhHbebCb6vtG7Qjxhw48rEiSt/V9mF3ZQqaj1WT40WbQGTzOn/ibeYZhGIZhNJ+/d+ho7XA8/W8AAAAASUVORK5CYII=",
6758
+ height: "18",
6759
+ style: { marginLeft: 3 },
6760
+ onClick: function onClick() {
6761
+ navigator.clipboard.writeText(creds.bvaToken && creds.bvaToken[credType] ? creds.bvaToken[credType] : "");
6762
+ }
6744
6763
  })
6745
6764
  ) : _react2.default.createElement(Input, {
6746
6765
  name: credType,
@@ -6760,11 +6779,11 @@ module.exports =
6760
6779
  lineHeight: "10px",
6761
6780
  marginTop: -1,
6762
6781
  position: "absolute",
6763
- top: 120,
6782
+ top: 130,
6764
6783
  left: 850
6765
6784
  },
6766
- disabled: credsDisabledCheck,
6767
- onClick: this.startOauth
6785
+ onClick: this.startOauth,
6786
+ disabled: credsDisabledCheck
6768
6787
  },
6769
6788
  _react2.default.createElement(
6770
6789
  "span",
@@ -8461,7 +8480,7 @@ module.exports =
8461
8480
  /* 72 */
8462
8481
  /***/ function(module, exports, __webpack_require__) {
8463
8482
 
8464
- 'use strict';
8483
+ "use strict";
8465
8484
 
8466
8485
  Object.defineProperty(exports, "__esModule", {
8467
8486
  value: true
@@ -8496,36 +8515,36 @@ module.exports =
8496
8515
  }
8497
8516
 
8498
8517
  return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Oauth.__proto__ || Object.getPrototypeOf(Oauth)).call.apply(_ref, [this].concat(args))), _this), _this.finishOauth = function (e) {
8499
- if (e.data && e.data.lingkOauthMessage && e.data.lingkOauthMessage === 'complete') {
8500
- _this.props.checkOauthCreds('finish');
8518
+ if (e.data && e.data.lingkOauthMessage && e.data.lingkOauthMessage === "complete") {
8519
+ _this.props.checkOauthCreds("finish");
8501
8520
  }
8502
8521
  }, _this.startOauth = function () {
8503
8522
  var _this$props = _this.props,
8504
8523
  wizard = _this$props.wizard,
8505
8524
  checkOauthCreds = _this$props.checkOauthCreds;
8506
8525
 
8507
- checkOauthCreds('start');
8526
+ checkOauthCreds("start");
8508
8527
  var width = 600;
8509
8528
  var height = 600;
8510
8529
  var left = window.screenX + (window.outerWidth - width) / 2;
8511
8530
  var top = window.screenY + (window.outerHeight - height) / 2.5;
8512
- var popup = window.open(wizard.oauthUrl, 'Oauth', 'width=' + width + ',height=' + height + ',top=' + top + ',left=' + left);
8531
+ var popup = window.open(wizard.oauthUrl, "Oauth", "width=" + width + ",height=" + height + ",top=" + top + ",left=" + left);
8513
8532
  popup.focus();
8514
8533
  }, _temp), _possibleConstructorReturn(_this, _ret);
8515
8534
  }
8516
8535
 
8517
8536
  _createClass(Oauth, [{
8518
- key: 'componentWillMount',
8537
+ key: "componentWillMount",
8519
8538
  value: function componentWillMount() {
8520
- window.addEventListener('message', this.finishOauth);
8539
+ window.addEventListener("message", this.finishOauth);
8521
8540
  }
8522
8541
  }, {
8523
- key: 'componentWillUnmount',
8542
+ key: "componentWillUnmount",
8524
8543
  value: function componentWillUnmount() {
8525
- window.removeEventListener('message', this.finishOauth);
8544
+ window.removeEventListener("message", this.finishOauth);
8526
8545
  }
8527
8546
  }, {
8528
- key: 'render',
8547
+ key: "render",
8529
8548
  value: function render() {
8530
8549
  var _props = this.props,
8531
8550
  EnvCheckIcons = _props.EnvCheckIcons,
@@ -8541,135 +8560,159 @@ module.exports =
8541
8560
  isWiz = _props.isWiz,
8542
8561
  change = _props.change;
8543
8562
 
8563
+ console.log("OAUTH Creds", creds);
8544
8564
  var Spinner = inputs.Spinner;
8545
8565
  var Button = inputs.Button;
8546
8566
  var userName = creds && creds.userName;
8547
- var btnStyle = { height: 30, lineHeight: '11px', marginTop: -1 };
8567
+ var btnStyle = { height: 30, lineHeight: "11px", marginTop: -1 };
8548
8568
  var ToggleButtonGroup = inputs.ToggleButtonGroup;
8549
8569
  return _react2.default.createElement(
8550
- 'div',
8570
+ "div",
8551
8571
  null,
8552
8572
  userName && _react2.default.createElement(
8553
- 'div',
8573
+ "div",
8554
8574
  null,
8555
- userName === '_' ? _react2.default.createElement(
8556
- 'div',
8575
+ userName === "_" ? _react2.default.createElement(
8576
+ "div",
8557
8577
  null,
8558
- _react2.default.createElement(DotDot, { text: 'Authorizing' })
8578
+ _react2.default.createElement(DotDot, { text: "Authorizing" })
8559
8579
  ) : _react2.default.createElement(
8560
- 'div',
8580
+ "div",
8561
8581
  null,
8562
- 'Authorized with account ',
8582
+ "Authorized with account ",
8563
8583
  _react2.default.createElement(
8564
- 'strong',
8584
+ "strong",
8565
8585
  null,
8566
8586
  userName
8567
8587
  )
8568
8588
  ),
8569
- _react2.default.createElement('br', null)
8589
+ _react2.default.createElement("br", null)
8570
8590
  ),
8571
8591
  userName ? _react2.default.createElement(
8572
- 'div',
8592
+ "div",
8573
8593
  null,
8574
- 'Connect to a different Salesforce Org:'
8594
+ "Connect to a different Salesforce Org:"
8575
8595
  ) : _react2.default.createElement(
8576
- 'div',
8596
+ "div",
8577
8597
  null,
8578
- 'Are you connecting to a Sandbox or Production Org?'
8598
+ "Are you connecting to a Sandbox or Production Org?"
8579
8599
  ),
8580
8600
  _react2.default.createElement(
8581
- 'div',
8601
+ "div",
8582
8602
  { style: { marginTop: 12 } },
8583
8603
  _react2.default.createElement(
8584
8604
  Button,
8585
- { type: 'brand', style: btnStyle,
8605
+ {
8606
+ type: "brand",
8607
+ style: btnStyle,
8586
8608
  onClick: function onClick() {
8587
- return onGenerateUrl('sandbox');
8588
- } },
8589
- 'Sandbox'
8609
+ return onGenerateUrl("sandbox");
8610
+ }
8611
+ },
8612
+ "Sandbox"
8590
8613
  ),
8591
8614
  _react2.default.createElement(
8592
8615
  Button,
8593
- { type: 'brand',
8594
- style: Object.assign({ margin: '0 12px' }, btnStyle),
8616
+ {
8617
+ type: "brand",
8618
+ style: Object.assign({ margin: "0 12px" }, btnStyle),
8595
8619
  onClick: function onClick() {
8596
- return onGenerateUrl('production');
8597
- } },
8598
- 'Production'
8620
+ return onGenerateUrl("production");
8621
+ }
8622
+ },
8623
+ "Production"
8599
8624
  ),
8600
8625
  _react2.default.createElement(
8601
8626
  Button,
8602
- { type: 'brand',
8627
+ {
8628
+ type: "brand",
8603
8629
  onClick: function onClick() {
8604
- return onCheck(creds, formValues.includeSystemResources ? '?all=true' : '');
8630
+ return onCheck(creds, formValues.includeSystemResources ? "?all=true" : "");
8605
8631
  },
8606
- style: Object.assign({ marginLeft: 8 }, btnStyle) },
8632
+ style: Object.assign({ marginLeft: 8 }, btnStyle)
8633
+ },
8607
8634
  _react2.default.createElement(
8608
- 'span',
8609
- { style: { display: 'inline-block', verticalAlign: 'top', marginTop: 3 } },
8610
- 'Test Connection'
8635
+ "span",
8636
+ {
8637
+ style: {
8638
+ display: "inline-block",
8639
+ verticalAlign: "top",
8640
+ marginTop: 3
8641
+ }
8642
+ },
8643
+ "Test Connection"
8611
8644
  ),
8612
- '\xA0\xA0',
8645
+ "\xA0\xA0",
8613
8646
  _react2.default.createElement(Loop, null)
8614
8647
  ),
8615
8648
  _react2.default.createElement(
8616
- 'div',
8617
- { style: { display: 'inline-block', marginLeft: 12 } },
8649
+ "div",
8650
+ { style: { display: "inline-block", marginLeft: 12 } },
8618
8651
  checking && _react2.default.createElement(Spinner, null),
8619
8652
  envCheckResult && _react2.default.createElement(
8620
- 'span',
8653
+ "span",
8621
8654
  null,
8622
8655
  envCheckResult,
8623
- ' ',
8656
+ " ",
8624
8657
  _react2.default.createElement(EnvCheckIcons, { result: envCheckResult })
8625
8658
  )
8626
8659
  ),
8627
8660
  isWiz && _react2.default.createElement(
8628
- 'div',
8629
- { style: { display: 'inline-block', marginLeft: 20, width: 150, verticalAlign: 'top', marginTop: -11 } },
8661
+ "div",
8662
+ {
8663
+ style: {
8664
+ display: "inline-block",
8665
+ marginLeft: 20,
8666
+ width: 150,
8667
+ verticalAlign: "top",
8668
+ marginTop: -11
8669
+ }
8670
+ },
8630
8671
  _react2.default.createElement(
8631
- 'span',
8632
- { className: 'labelz' },
8633
- 'Metadata:'
8672
+ "span",
8673
+ { className: "labelz" },
8674
+ "Metadata:"
8634
8675
  ),
8635
- '\xA0\xA0',
8636
- _react2.default.createElement(ToggleButtonGroup, { style: { height: 19, margin: 0 },
8637
- options: ['Default', 'All Resources'],
8676
+ "\xA0\xA0",
8677
+ _react2.default.createElement(ToggleButtonGroup, {
8678
+ style: { height: 19, margin: 0 },
8679
+ options: ["Default", "All Resources"],
8638
8680
  handleToggle: function handleToggle(e) {
8639
- change('includeSystemResources', e === 'All Resources');
8681
+ change("includeSystemResources", e === "All Resources");
8640
8682
  },
8641
- value: formValues.includeSystemResources ? 'All Resources' : 'Default'
8683
+ value: formValues.includeSystemResources ? "All Resources" : "Default"
8642
8684
  })
8643
8685
  ),
8644
8686
  wizard.gettingOauthUrl && _react2.default.createElement(
8645
- 'div',
8687
+ "div",
8646
8688
  null,
8647
- _react2.default.createElement('br', null),
8689
+ _react2.default.createElement("br", null),
8648
8690
  _react2.default.createElement(Spinner, null),
8649
- _react2.default.createElement('br', null),
8650
- _react2.default.createElement('br', null)
8691
+ _react2.default.createElement("br", null),
8692
+ _react2.default.createElement("br", null)
8651
8693
  ),
8652
8694
  wizard.oauthUrl && _react2.default.createElement(
8653
- 'div',
8695
+ "div",
8654
8696
  null,
8655
- _react2.default.createElement('br', null),
8697
+ _react2.default.createElement("br", null),
8656
8698
  _react2.default.createElement(
8657
- 'div',
8699
+ "div",
8658
8700
  null,
8659
8701
  _react2.default.createElement(
8660
- 'strong',
8702
+ "strong",
8661
8703
  null,
8662
8704
  _react2.default.createElement(
8663
- 'a',
8664
- { onClick: this.startOauth, style: { cursor: 'pointer' } },
8665
- 'Click Here'
8705
+ "a",
8706
+ { onClick: this.startOauth, style: { cursor: "pointer" } },
8707
+ "Click Here"
8666
8708
  )
8667
8709
  ),
8668
- ' to authorize your ',
8710
+ " ",
8711
+ "to authorize your ",
8669
8712
  providerType,
8670
- ' Org.'
8713
+ " Org."
8671
8714
  ),
8672
- _react2.default.createElement('br', null)
8715
+ _react2.default.createElement("br", null)
8673
8716
  )
8674
8717
  )
8675
8718
  );
@@ -8694,7 +8737,7 @@ module.exports =
8694
8737
  }
8695
8738
 
8696
8739
  _createClass(DotDot, [{
8697
- key: 'componentWillMount',
8740
+ key: "componentWillMount",
8698
8741
  value: function componentWillMount() {
8699
8742
  var _this3 = this;
8700
8743
 
@@ -8702,22 +8745,22 @@ module.exports =
8702
8745
  var text = _this3.state.text;
8703
8746
 
8704
8747
  if (text.length < 28) {
8705
- _this3.setState({ text: text + '.' });
8748
+ _this3.setState({ text: text + "." });
8706
8749
  } else {
8707
8750
  _this3.setState({ text: _this3.props.text });
8708
8751
  }
8709
8752
  }, 200);
8710
8753
  }
8711
8754
  }, {
8712
- key: 'componentWillUnmount',
8755
+ key: "componentWillUnmount",
8713
8756
  value: function componentWillUnmount() {
8714
8757
  clearInterval(this.interval);
8715
8758
  }
8716
8759
  }, {
8717
- key: 'render',
8760
+ key: "render",
8718
8761
  value: function render() {
8719
8762
  return _react2.default.createElement(
8720
- 'span',
8763
+ "span",
8721
8764
  null,
8722
8765
  this.state.text
8723
8766
  );
@@ -8729,11 +8772,16 @@ module.exports =
8729
8772
 
8730
8773
  var Loop = function Loop() {
8731
8774
  return _react2.default.createElement(
8732
- 'svg',
8733
- { fill: '#FFFFFF', height: '18', viewBox: '0 0 24 24', width: '18',
8734
- style: { marginTop: -1 } },
8735
- _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' }),
8736
- _react2.default.createElement('path', { d: 'M0 0h24v24H0z', fill: 'none' })
8775
+ "svg",
8776
+ {
8777
+ fill: "#FFFFFF",
8778
+ height: "18",
8779
+ viewBox: "0 0 24 24",
8780
+ width: "18",
8781
+ style: { marginTop: -1 }
8782
+ },
8783
+ _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" }),
8784
+ _react2.default.createElement("path", { d: "M0 0h24v24H0z", fill: "none" })
8737
8785
  );
8738
8786
  };
8739
8787