@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.
@@ -4917,7 +4917,7 @@ module.exports =
4917
4917
  var bvaToken = {};
4918
4918
  var credentials = config && config.credentials.filter(function (o) {
4919
4919
  if (creds["authenticationType"] === "key") {
4920
- if (o == "refreshToken" || o == "accessToken" || o == "clientId" || o == "rootUrl") {
4920
+ if (o == "refreshToken" || o == "accessToken" || o == "clientId" || o == "rootUrl" || o == "clientSecret") {
4921
4921
  return true;
4922
4922
  } else {
4923
4923
  return false;
@@ -4925,18 +4925,13 @@ module.exports =
4925
4925
  }
4926
4926
  return true;
4927
4927
  });
4928
- var credentialsRemoveToken = credentials.filter(function (c) {
4929
- if (c == "refreshToken" || c == "accessToken" || c == "scope") {
4930
- return false;
4931
- } else {
4932
- return true;
4933
- }
4934
- });
4935
- var credsDisabledCheck = credentialsRemoveToken && credentialsRemoveToken.some(function (c) {
4928
+ var requiredFieldsOAuth = ["rootUrl", "clientId", "clientSecret"];
4929
+ var requiredFieldsKey = ["rootUrl", "clientId", "clientSecret", "refreshToken"];
4930
+
4931
+ var credsDisabledCheck = requiredFieldsOAuth.some(function (c) {
4936
4932
  var formCreds = creds;
4937
- return !Object.keys(formCreds).includes(c.split(" ").join(""));
4933
+ return !Object.keys(formCreds).includes(c.split(" ").join("")) || formCreds[c] == "";
4938
4934
  });
4939
-
4940
4935
  return _react2.default.createElement(
4941
4936
  "div",
4942
4937
  null,
@@ -4960,6 +4955,9 @@ module.exports =
4960
4955
  })
4961
4956
  ),
4962
4957
  credentials.map(function (credType, index) {
4958
+ var key = requiredFieldsKey.find(function (r) {
4959
+ return r == credType;
4960
+ });
4963
4961
  return _react2.default.createElement(
4964
4962
  "div",
4965
4963
  { key: index, style: { marginTop: 8 } },
@@ -4970,19 +4968,40 @@ module.exports =
4970
4968
  className: "labelz",
4971
4969
  style: { fontWeight: "normal" }
4972
4970
  },
4973
- unCamelize(credType)
4971
+ unCamelize(credType),
4972
+ key && creds["authenticationType"] == "key" && _react2.default.createElement(
4973
+ "span",
4974
+ { style: { color: "red" } },
4975
+ "*"
4976
+ )
4974
4977
  ),
4975
4978
  _react2.default.createElement("br", null),
4976
4979
  credType === "refreshToken" || credType === "accessToken" || credType === "scope" ? _react2.default.createElement(
4977
4980
  "div",
4978
4981
  null,
4979
- _react2.default.createElement(Input, {
4982
+ creds["authenticationType"] == "key" ? _react2.default.createElement(Input, {
4983
+ name: credType,
4984
+ value: creds.bvaToken && creds.bvaToken[credType] || "",
4985
+ disabled: credType == "accessToken" ? true : false,
4986
+ onChange: function onChange(e) {
4987
+ return onChangeCustomKey(e, credType, bvaToken);
4988
+ }
4989
+ }) : _react2.default.createElement(Input, {
4980
4990
  name: credType,
4981
4991
  value: creds.bvaToken && creds.bvaToken[credType] || "",
4982
- disabled: credType == "accessToken" || credType == "refreshToken" && creds.authenticationType == "oauth" ? true : false,
4992
+ disabled: credType == "accessToken" || credType == "refreshToken" ? true : false,
4983
4993
  onChange: function onChange(e) {
4984
4994
  return onChangeCustomKey(e, credType, bvaToken);
4985
4995
  }
4996
+ }),
4997
+ credType == "accessToken" && _react2.default.createElement("img", {
4998
+ alt: "small-spinner",
4999
+ src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAeFBMVEX///8AAAD09PRpaWlxcXHw8PAiIiJhYWEYGBhTU1Pz8/N7e3v8/Px4eHjT09OTk5Pb29stLS2BgYHk5OTGxsa+vr64uLiJiYk4ODjU1NQqKiqvr69AQEDr6+tXV1ebm5tGRkaXl5dLS0sPDw8kJCSioqIUFBRsbGw/k7GAAAAFvUlEQVR4nO2d61bqMBBGWy6iULDcFAEFlKPv/4YHOLhU8pWmdr5Mc9bs38q4pWmadGaSJIZhGIZhGP3R/HHQaTP4GE5Wo6muXr7bvqVkxsO5ll73nm73yceTht9jKL0TvVFowVWw7++TYSukX9YL7Xck4KW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jL/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=",
5000
+ height: "18",
5001
+ style: { marginLeft: 3 },
5002
+ onClick: function onClick() {
5003
+ navigator.clipboard.writeText(creds.bvaToken && creds.bvaToken[credType] ? creds.bvaToken[credType] : "");
5004
+ }
4986
5005
  })
4987
5006
  ) : _react2.default.createElement(Input, {
4988
5007
  name: credType,
@@ -5002,11 +5021,11 @@ module.exports =
5002
5021
  lineHeight: "10px",
5003
5022
  marginTop: -1,
5004
5023
  position: "absolute",
5005
- top: 120,
5024
+ top: 130,
5006
5025
  left: 850
5007
5026
  },
5008
- disabled: credsDisabledCheck,
5009
- onClick: this.startOauth
5027
+ onClick: this.startOauth,
5028
+ disabled: credsDisabledCheck
5010
5029
  },
5011
5030
  _react2.default.createElement(
5012
5031
  "span",
@@ -6703,7 +6722,7 @@ module.exports =
6703
6722
  /* 72 */
6704
6723
  /***/ function(module, exports, __webpack_require__) {
6705
6724
 
6706
- 'use strict';
6725
+ "use strict";
6707
6726
 
6708
6727
  Object.defineProperty(exports, "__esModule", {
6709
6728
  value: true
@@ -6738,36 +6757,36 @@ module.exports =
6738
6757
  }
6739
6758
 
6740
6759
  return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Oauth.__proto__ || Object.getPrototypeOf(Oauth)).call.apply(_ref, [this].concat(args))), _this), _this.finishOauth = function (e) {
6741
- if (e.data && e.data.lingkOauthMessage && e.data.lingkOauthMessage === 'complete') {
6742
- _this.props.checkOauthCreds('finish');
6760
+ if (e.data && e.data.lingkOauthMessage && e.data.lingkOauthMessage === "complete") {
6761
+ _this.props.checkOauthCreds("finish");
6743
6762
  }
6744
6763
  }, _this.startOauth = function () {
6745
6764
  var _this$props = _this.props,
6746
6765
  wizard = _this$props.wizard,
6747
6766
  checkOauthCreds = _this$props.checkOauthCreds;
6748
6767
 
6749
- checkOauthCreds('start');
6768
+ checkOauthCreds("start");
6750
6769
  var width = 600;
6751
6770
  var height = 600;
6752
6771
  var left = window.screenX + (window.outerWidth - width) / 2;
6753
6772
  var top = window.screenY + (window.outerHeight - height) / 2.5;
6754
- var popup = window.open(wizard.oauthUrl, 'Oauth', 'width=' + width + ',height=' + height + ',top=' + top + ',left=' + left);
6773
+ var popup = window.open(wizard.oauthUrl, "Oauth", "width=" + width + ",height=" + height + ",top=" + top + ",left=" + left);
6755
6774
  popup.focus();
6756
6775
  }, _temp), _possibleConstructorReturn(_this, _ret);
6757
6776
  }
6758
6777
 
6759
6778
  _createClass(Oauth, [{
6760
- key: 'componentWillMount',
6779
+ key: "componentWillMount",
6761
6780
  value: function componentWillMount() {
6762
- window.addEventListener('message', this.finishOauth);
6781
+ window.addEventListener("message", this.finishOauth);
6763
6782
  }
6764
6783
  }, {
6765
- key: 'componentWillUnmount',
6784
+ key: "componentWillUnmount",
6766
6785
  value: function componentWillUnmount() {
6767
- window.removeEventListener('message', this.finishOauth);
6786
+ window.removeEventListener("message", this.finishOauth);
6768
6787
  }
6769
6788
  }, {
6770
- key: 'render',
6789
+ key: "render",
6771
6790
  value: function render() {
6772
6791
  var _props = this.props,
6773
6792
  EnvCheckIcons = _props.EnvCheckIcons,
@@ -6783,135 +6802,159 @@ module.exports =
6783
6802
  isWiz = _props.isWiz,
6784
6803
  change = _props.change;
6785
6804
 
6805
+ console.log("OAUTH Creds", creds);
6786
6806
  var Spinner = inputs.Spinner;
6787
6807
  var Button = inputs.Button;
6788
6808
  var userName = creds && creds.userName;
6789
- var btnStyle = { height: 30, lineHeight: '11px', marginTop: -1 };
6809
+ var btnStyle = { height: 30, lineHeight: "11px", marginTop: -1 };
6790
6810
  var ToggleButtonGroup = inputs.ToggleButtonGroup;
6791
6811
  return _react2.default.createElement(
6792
- 'div',
6812
+ "div",
6793
6813
  null,
6794
6814
  userName && _react2.default.createElement(
6795
- 'div',
6815
+ "div",
6796
6816
  null,
6797
- userName === '_' ? _react2.default.createElement(
6798
- 'div',
6817
+ userName === "_" ? _react2.default.createElement(
6818
+ "div",
6799
6819
  null,
6800
- _react2.default.createElement(DotDot, { text: 'Authorizing' })
6820
+ _react2.default.createElement(DotDot, { text: "Authorizing" })
6801
6821
  ) : _react2.default.createElement(
6802
- 'div',
6822
+ "div",
6803
6823
  null,
6804
- 'Authorized with account ',
6824
+ "Authorized with account ",
6805
6825
  _react2.default.createElement(
6806
- 'strong',
6826
+ "strong",
6807
6827
  null,
6808
6828
  userName
6809
6829
  )
6810
6830
  ),
6811
- _react2.default.createElement('br', null)
6831
+ _react2.default.createElement("br", null)
6812
6832
  ),
6813
6833
  userName ? _react2.default.createElement(
6814
- 'div',
6834
+ "div",
6815
6835
  null,
6816
- 'Connect to a different Salesforce Org:'
6836
+ "Connect to a different Salesforce Org:"
6817
6837
  ) : _react2.default.createElement(
6818
- 'div',
6838
+ "div",
6819
6839
  null,
6820
- 'Are you connecting to a Sandbox or Production Org?'
6840
+ "Are you connecting to a Sandbox or Production Org?"
6821
6841
  ),
6822
6842
  _react2.default.createElement(
6823
- 'div',
6843
+ "div",
6824
6844
  { style: { marginTop: 12 } },
6825
6845
  _react2.default.createElement(
6826
6846
  Button,
6827
- { type: 'brand', style: btnStyle,
6847
+ {
6848
+ type: "brand",
6849
+ style: btnStyle,
6828
6850
  onClick: function onClick() {
6829
- return onGenerateUrl('sandbox');
6830
- } },
6831
- 'Sandbox'
6851
+ return onGenerateUrl("sandbox");
6852
+ }
6853
+ },
6854
+ "Sandbox"
6832
6855
  ),
6833
6856
  _react2.default.createElement(
6834
6857
  Button,
6835
- { type: 'brand',
6836
- style: Object.assign({ margin: '0 12px' }, btnStyle),
6858
+ {
6859
+ type: "brand",
6860
+ style: Object.assign({ margin: "0 12px" }, btnStyle),
6837
6861
  onClick: function onClick() {
6838
- return onGenerateUrl('production');
6839
- } },
6840
- 'Production'
6862
+ return onGenerateUrl("production");
6863
+ }
6864
+ },
6865
+ "Production"
6841
6866
  ),
6842
6867
  _react2.default.createElement(
6843
6868
  Button,
6844
- { type: 'brand',
6869
+ {
6870
+ type: "brand",
6845
6871
  onClick: function onClick() {
6846
- return onCheck(creds, formValues.includeSystemResources ? '?all=true' : '');
6872
+ return onCheck(creds, formValues.includeSystemResources ? "?all=true" : "");
6847
6873
  },
6848
- style: Object.assign({ marginLeft: 8 }, btnStyle) },
6874
+ style: Object.assign({ marginLeft: 8 }, btnStyle)
6875
+ },
6849
6876
  _react2.default.createElement(
6850
- 'span',
6851
- { style: { display: 'inline-block', verticalAlign: 'top', marginTop: 3 } },
6852
- 'Test Connection'
6877
+ "span",
6878
+ {
6879
+ style: {
6880
+ display: "inline-block",
6881
+ verticalAlign: "top",
6882
+ marginTop: 3
6883
+ }
6884
+ },
6885
+ "Test Connection"
6853
6886
  ),
6854
- '\xA0\xA0',
6887
+ "\xA0\xA0",
6855
6888
  _react2.default.createElement(Loop, null)
6856
6889
  ),
6857
6890
  _react2.default.createElement(
6858
- 'div',
6859
- { style: { display: 'inline-block', marginLeft: 12 } },
6891
+ "div",
6892
+ { style: { display: "inline-block", marginLeft: 12 } },
6860
6893
  checking && _react2.default.createElement(Spinner, null),
6861
6894
  envCheckResult && _react2.default.createElement(
6862
- 'span',
6895
+ "span",
6863
6896
  null,
6864
6897
  envCheckResult,
6865
- ' ',
6898
+ " ",
6866
6899
  _react2.default.createElement(EnvCheckIcons, { result: envCheckResult })
6867
6900
  )
6868
6901
  ),
6869
6902
  isWiz && _react2.default.createElement(
6870
- 'div',
6871
- { style: { display: 'inline-block', marginLeft: 20, width: 150, verticalAlign: 'top', marginTop: -11 } },
6903
+ "div",
6904
+ {
6905
+ style: {
6906
+ display: "inline-block",
6907
+ marginLeft: 20,
6908
+ width: 150,
6909
+ verticalAlign: "top",
6910
+ marginTop: -11
6911
+ }
6912
+ },
6872
6913
  _react2.default.createElement(
6873
- 'span',
6874
- { className: 'labelz' },
6875
- 'Metadata:'
6914
+ "span",
6915
+ { className: "labelz" },
6916
+ "Metadata:"
6876
6917
  ),
6877
- '\xA0\xA0',
6878
- _react2.default.createElement(ToggleButtonGroup, { style: { height: 19, margin: 0 },
6879
- options: ['Default', 'All Resources'],
6918
+ "\xA0\xA0",
6919
+ _react2.default.createElement(ToggleButtonGroup, {
6920
+ style: { height: 19, margin: 0 },
6921
+ options: ["Default", "All Resources"],
6880
6922
  handleToggle: function handleToggle(e) {
6881
- change('includeSystemResources', e === 'All Resources');
6923
+ change("includeSystemResources", e === "All Resources");
6882
6924
  },
6883
- value: formValues.includeSystemResources ? 'All Resources' : 'Default'
6925
+ value: formValues.includeSystemResources ? "All Resources" : "Default"
6884
6926
  })
6885
6927
  ),
6886
6928
  wizard.gettingOauthUrl && _react2.default.createElement(
6887
- 'div',
6929
+ "div",
6888
6930
  null,
6889
- _react2.default.createElement('br', null),
6931
+ _react2.default.createElement("br", null),
6890
6932
  _react2.default.createElement(Spinner, null),
6891
- _react2.default.createElement('br', null),
6892
- _react2.default.createElement('br', null)
6933
+ _react2.default.createElement("br", null),
6934
+ _react2.default.createElement("br", null)
6893
6935
  ),
6894
6936
  wizard.oauthUrl && _react2.default.createElement(
6895
- 'div',
6937
+ "div",
6896
6938
  null,
6897
- _react2.default.createElement('br', null),
6939
+ _react2.default.createElement("br", null),
6898
6940
  _react2.default.createElement(
6899
- 'div',
6941
+ "div",
6900
6942
  null,
6901
6943
  _react2.default.createElement(
6902
- 'strong',
6944
+ "strong",
6903
6945
  null,
6904
6946
  _react2.default.createElement(
6905
- 'a',
6906
- { onClick: this.startOauth, style: { cursor: 'pointer' } },
6907
- 'Click Here'
6947
+ "a",
6948
+ { onClick: this.startOauth, style: { cursor: "pointer" } },
6949
+ "Click Here"
6908
6950
  )
6909
6951
  ),
6910
- ' to authorize your ',
6952
+ " ",
6953
+ "to authorize your ",
6911
6954
  providerType,
6912
- ' Org.'
6955
+ " Org."
6913
6956
  ),
6914
- _react2.default.createElement('br', null)
6957
+ _react2.default.createElement("br", null)
6915
6958
  )
6916
6959
  )
6917
6960
  );
@@ -6936,7 +6979,7 @@ module.exports =
6936
6979
  }
6937
6980
 
6938
6981
  _createClass(DotDot, [{
6939
- key: 'componentWillMount',
6982
+ key: "componentWillMount",
6940
6983
  value: function componentWillMount() {
6941
6984
  var _this3 = this;
6942
6985
 
@@ -6944,22 +6987,22 @@ module.exports =
6944
6987
  var text = _this3.state.text;
6945
6988
 
6946
6989
  if (text.length < 28) {
6947
- _this3.setState({ text: text + '.' });
6990
+ _this3.setState({ text: text + "." });
6948
6991
  } else {
6949
6992
  _this3.setState({ text: _this3.props.text });
6950
6993
  }
6951
6994
  }, 200);
6952
6995
  }
6953
6996
  }, {
6954
- key: 'componentWillUnmount',
6997
+ key: "componentWillUnmount",
6955
6998
  value: function componentWillUnmount() {
6956
6999
  clearInterval(this.interval);
6957
7000
  }
6958
7001
  }, {
6959
- key: 'render',
7002
+ key: "render",
6960
7003
  value: function render() {
6961
7004
  return _react2.default.createElement(
6962
- 'span',
7005
+ "span",
6963
7006
  null,
6964
7007
  this.state.text
6965
7008
  );
@@ -6971,11 +7014,16 @@ module.exports =
6971
7014
 
6972
7015
  var Loop = function Loop() {
6973
7016
  return _react2.default.createElement(
6974
- 'svg',
6975
- { fill: '#FFFFFF', height: '18', viewBox: '0 0 24 24', width: '18',
6976
- style: { marginTop: -1 } },
6977
- _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' }),
6978
- _react2.default.createElement('path', { d: 'M0 0h24v24H0z', fill: 'none' })
7017
+ "svg",
7018
+ {
7019
+ fill: "#FFFFFF",
7020
+ height: "18",
7021
+ viewBox: "0 0 24 24",
7022
+ width: "18",
7023
+ style: { marginTop: -1 }
7024
+ },
7025
+ _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" }),
7026
+ _react2.default.createElement("path", { d: "M0 0h24v24H0z", fill: "none" })
6979
7027
  );
6980
7028
  };
6981
7029