@stokr/components-library 2.3.41-beta.8 → 2.3.42-beta

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.
@@ -761,59 +761,19 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
761
761
  return _ref14.apply(this, arguments);
762
762
  };
763
763
  }());
764
- _defineProperty(_assertThisInitialized(_this), "checkActivationLinkExpired", /*#__PURE__*/function () {
765
- var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(actionCode) {
766
- var actionCodeInfo;
767
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
768
- while (1) switch (_context15.prev = _context15.next) {
769
- case 0:
770
- console.log('does this even run??');
771
- _context15.prev = 1;
772
- _context15.next = 4;
773
- return (0, _auth.checkActionCode)(_firebaseConfig.auth, actionCode);
774
- case 4:
775
- actionCodeInfo = _context15.sent;
776
- console.log('actionCodeInfo', actionCodeInfo);
777
- return _context15.abrupt("return", {
778
- expired: false,
779
- info: actionCodeInfo
780
- });
781
- case 9:
782
- _context15.prev = 9;
783
- _context15.t0 = _context15["catch"](1);
784
- console.log('checkActivationLinkExpired error:', _context15.t0);
785
- if (!(_context15.t0.code === 'auth/expired-action-code' || _context15.t0.code === 'auth/invalid-action-code')) {
786
- _context15.next = 15;
787
- break;
788
- }
789
- console.log('checkActivationLink error was either auth/expired-action-code or auth/invalid-action-code, setting token to EXPIRED! ');
790
- return _context15.abrupt("return", {
791
- expired: true,
792
- error: _context15.t0
793
- });
794
- case 15:
795
- case "end":
796
- return _context15.stop();
797
- }
798
- }, _callee15, null, [[1, 9]]);
799
- }));
800
- return function (_x18) {
801
- return _ref15.apply(this, arguments);
802
- };
803
- }());
804
- _defineProperty(_assertThisInitialized(_this), "handleVerifyEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
764
+ _defineProperty(_assertThisInitialized(_this), "handleVerifyEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
805
765
  var location, query, oobCode, customToken, email;
806
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
807
- while (1) switch (_context16.prev = _context16.next) {
766
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
767
+ while (1) switch (_context15.prev = _context15.next) {
808
768
  case 0:
809
769
  _this.setState({
810
770
  isVerifyingEmail: true
811
771
  });
812
772
  location = _this.props.location;
813
773
  query = new URLSearchParams(location.search);
814
- _context16.prev = 3;
774
+ _context15.prev = 3;
815
775
  oobCode = query.get('oobCode');
816
- _context16.next = 7;
776
+ _context15.next = 7;
817
777
  return _Auth.default.handleVerifyEmail(oobCode);
818
778
  case 7:
819
779
  _this.setState({
@@ -823,188 +783,188 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
823
783
  if (customToken) {
824
784
  _this.loginUser(null, null, customToken);
825
785
  }
826
- _context16.next = 28;
786
+ _context15.next = 28;
827
787
  break;
828
788
  case 12:
829
- _context16.prev = 12;
830
- _context16.t0 = _context16["catch"](3);
831
- _context16.t1 = _context16.t0 === null || _context16.t0 === void 0 ? void 0 : _context16.t0.code;
832
- _context16.next = _context16.t1 === 'auth/expired-action-code' ? 17 : _context16.t1 === 'auth/invalid-action-code' ? 21 : _context16.t1 === 'auth/user-disabled' ? 23 : 25;
789
+ _context15.prev = 12;
790
+ _context15.t0 = _context15["catch"](3);
791
+ _context15.t1 = _context15.t0 === null || _context15.t0 === void 0 ? void 0 : _context15.t0.code;
792
+ _context15.next = _context15.t1 === 'auth/expired-action-code' ? 17 : _context15.t1 === 'auth/invalid-action-code' ? 21 : _context15.t1 === 'auth/user-disabled' ? 23 : 25;
833
793
  break;
834
794
  case 17:
835
- _context16.t0.message = 'The activation link has expired. We are sending you a new one right now.';
795
+ _context15.t0.message = 'The activation link has expired. We are sending you a new one right now.';
836
796
  email = query.get('email');
837
797
  if (email) {
838
- _context16.t0.email = email;
798
+ _context15.t0.email = email;
839
799
  //Auth.resendActivationEmail(email)
840
800
  }
841
- return _context16.abrupt("break", 26);
801
+ return _context15.abrupt("break", 26);
842
802
  case 21:
843
- _context16.t0.message = 'This link is invalid. Please try verifying email again.';
844
- return _context16.abrupt("break", 26);
803
+ _context15.t0.message = 'This link is invalid. Please try verifying email again.';
804
+ return _context15.abrupt("break", 26);
845
805
  case 23:
846
- _context16.t0.message = 'Your account has been disabled. Please contact our support.';
847
- return _context16.abrupt("break", 26);
806
+ _context15.t0.message = 'Your account has been disabled. Please contact our support.';
807
+ return _context15.abrupt("break", 26);
848
808
  case 25:
849
- return _context16.abrupt("break", 26);
809
+ return _context15.abrupt("break", 26);
850
810
  case 26:
851
- console.log('🚀 ~ file: AuthContext.js:446 ~ error:', _context16.t0);
811
+ console.log('🚀 ~ file: AuthContext.js:446 ~ error:', _context15.t0);
852
812
  _this.setState({
853
- verifyEmailError: _context16.t0,
813
+ verifyEmailError: _context15.t0,
854
814
  isVerifyingEmail: false,
855
815
  isFetchingUser: false
856
816
  });
857
817
  //throw error
858
818
  case 28:
859
819
  case "end":
860
- return _context16.stop();
820
+ return _context15.stop();
861
821
  }
862
- }, _callee16, null, [[3, 12]]);
822
+ }, _callee15, null, [[3, 12]]);
863
823
  })));
864
824
  _defineProperty(_assertThisInitialized(_this), "handleResetPassword", /*#__PURE__*/function () {
865
- var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(password) {
825
+ var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(password) {
866
826
  var location, query, oobCode;
867
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
868
- while (1) switch (_context17.prev = _context17.next) {
827
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
828
+ while (1) switch (_context16.prev = _context16.next) {
869
829
  case 0:
870
830
  location = _this.props.location;
871
- _context17.prev = 1;
831
+ _context16.prev = 1;
872
832
  query = new URLSearchParams(location.search);
873
833
  oobCode = query.get('oobCode');
874
- _context17.next = 6;
834
+ _context16.next = 6;
875
835
  return _Auth.default.handleResetPassword(oobCode, password);
876
836
  case 6:
877
- _context17.next = 21;
837
+ _context16.next = 21;
878
838
  break;
879
839
  case 8:
880
- _context17.prev = 8;
881
- _context17.t0 = _context17["catch"](1);
882
- _context17.t1 = _context17.t0 === null || _context17.t0 === void 0 ? void 0 : _context17.t0.code;
883
- _context17.next = _context17.t1 === 'auth/expired-action-code' ? 13 : _context17.t1 === 'auth/invalid-action-code' ? 15 : _context17.t1 === 'auth/user-disabled' ? 17 : 19;
840
+ _context16.prev = 8;
841
+ _context16.t0 = _context16["catch"](1);
842
+ _context16.t1 = _context16.t0 === null || _context16.t0 === void 0 ? void 0 : _context16.t0.code;
843
+ _context16.next = _context16.t1 === 'auth/expired-action-code' ? 13 : _context16.t1 === 'auth/invalid-action-code' ? 15 : _context16.t1 === 'auth/user-disabled' ? 17 : 19;
884
844
  break;
885
845
  case 13:
886
- _context17.t0.message = 'This link has expired. Please try reseting password again.';
887
- return _context17.abrupt("break", 20);
846
+ _context16.t0.message = 'This link has expired. Please try reseting password again.';
847
+ return _context16.abrupt("break", 20);
888
848
  case 15:
889
- _context17.t0.message = 'This link is invalid. Please try reseting password again.';
890
- return _context17.abrupt("break", 20);
849
+ _context16.t0.message = 'This link is invalid. Please try reseting password again.';
850
+ return _context16.abrupt("break", 20);
891
851
  case 17:
892
- _context17.t0.message = 'Your account has been disabled. Please contact our support.';
893
- return _context17.abrupt("break", 20);
852
+ _context16.t0.message = 'Your account has been disabled. Please contact our support.';
853
+ return _context16.abrupt("break", 20);
894
854
  case 19:
895
- return _context17.abrupt("break", 20);
855
+ return _context16.abrupt("break", 20);
896
856
  case 20:
897
- throw _context17.t0;
857
+ throw _context16.t0;
898
858
  case 21:
899
859
  case "end":
900
- return _context17.stop();
860
+ return _context16.stop();
901
861
  }
902
- }, _callee17, null, [[1, 8]]);
862
+ }, _callee16, null, [[1, 8]]);
903
863
  }));
904
- return function (_x19) {
905
- return _ref17.apply(this, arguments);
864
+ return function (_x18) {
865
+ return _ref16.apply(this, arguments);
906
866
  };
907
867
  }());
908
- _defineProperty(_assertThisInitialized(_this), "sendWelcomeEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
909
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
910
- while (1) switch (_context18.prev = _context18.next) {
868
+ _defineProperty(_assertThisInitialized(_this), "sendWelcomeEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
869
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
870
+ while (1) switch (_context17.prev = _context17.next) {
911
871
  case 0:
912
- _context18.prev = 0;
913
- _context18.next = 3;
872
+ _context17.prev = 0;
873
+ _context17.next = 3;
914
874
  return _Auth.default.sendWelcomeEmail();
915
875
  case 3:
916
- _context18.next = 8;
876
+ _context17.next = 8;
917
877
  break;
918
878
  case 5:
919
- _context18.prev = 5;
920
- _context18.t0 = _context18["catch"](0);
921
- console.log("Error sending welcome email: ".concat(_context18.t0));
879
+ _context17.prev = 5;
880
+ _context17.t0 = _context17["catch"](0);
881
+ console.log("Error sending welcome email: ".concat(_context17.t0));
922
882
  // No need to throw error, let the app continue even if it fails
923
883
  case 8:
924
884
  case "end":
925
- return _context18.stop();
885
+ return _context17.stop();
926
886
  }
927
- }, _callee18, null, [[0, 5]]);
887
+ }, _callee17, null, [[0, 5]]);
928
888
  })));
929
889
  _defineProperty(_assertThisInitialized(_this), "uploaProofOfAddress", /*#__PURE__*/function () {
930
- var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(data, ip) {
890
+ var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(data, ip) {
931
891
  var user;
932
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
933
- while (1) switch (_context19.prev = _context19.next) {
892
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
893
+ while (1) switch (_context18.prev = _context18.next) {
934
894
  case 0:
935
- _context19.prev = 0;
936
- _context19.next = 3;
895
+ _context18.prev = 0;
896
+ _context18.next = 3;
937
897
  return _Auth.default.uploaProofOfAddress(data, ip);
938
898
  case 3:
939
- user = _context19.sent;
899
+ user = _context18.sent;
940
900
  _this.setUser(user);
941
- _context19.next = 11;
901
+ _context18.next = 11;
942
902
  break;
943
903
  case 7:
944
- _context19.prev = 7;
945
- _context19.t0 = _context19["catch"](0);
946
- console.log("Error uploading proof of address: ".concat(_context19.t0));
947
- throw _context19.t0;
904
+ _context18.prev = 7;
905
+ _context18.t0 = _context18["catch"](0);
906
+ console.log("Error uploading proof of address: ".concat(_context18.t0));
907
+ throw _context18.t0;
948
908
  case 11:
949
909
  case "end":
950
- return _context19.stop();
910
+ return _context18.stop();
951
911
  }
952
- }, _callee19, null, [[0, 7]]);
912
+ }, _callee18, null, [[0, 7]]);
953
913
  }));
954
- return function (_x20, _x21) {
955
- return _ref19.apply(this, arguments);
914
+ return function (_x19, _x20) {
915
+ return _ref18.apply(this, arguments);
956
916
  };
957
917
  }());
958
918
  _defineProperty(_assertThisInitialized(_this), "validateGreenWalletId", /*#__PURE__*/function () {
959
- var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(id) {
960
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
961
- while (1) switch (_context20.prev = _context20.next) {
919
+ var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(id) {
920
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
921
+ while (1) switch (_context19.prev = _context19.next) {
962
922
  case 0:
963
- _context20.prev = 0;
964
- _context20.next = 3;
923
+ _context19.prev = 0;
924
+ _context19.next = 3;
965
925
  return _Auth.default.validateGreenWalletId(id);
966
926
  case 3:
967
- return _context20.abrupt("return", _context20.sent);
927
+ return _context19.abrupt("return", _context19.sent);
968
928
  case 6:
969
- _context20.prev = 6;
970
- _context20.t0 = _context20["catch"](0);
971
- console.log("Error validating Green Wallet ID: ".concat(_context20.t0));
972
- throw _context20.t0;
929
+ _context19.prev = 6;
930
+ _context19.t0 = _context19["catch"](0);
931
+ console.log("Error validating Green Wallet ID: ".concat(_context19.t0));
932
+ throw _context19.t0;
973
933
  case 10:
974
934
  case "end":
975
- return _context20.stop();
935
+ return _context19.stop();
976
936
  }
977
- }, _callee20, null, [[0, 6]]);
937
+ }, _callee19, null, [[0, 6]]);
978
938
  }));
979
- return function (_x22) {
980
- return _ref20.apply(this, arguments);
939
+ return function (_x21) {
940
+ return _ref19.apply(this, arguments);
981
941
  };
982
942
  }());
983
943
  _defineProperty(_assertThisInitialized(_this), "createWallet", /*#__PURE__*/function () {
984
- var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(data) {
944
+ var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(data) {
985
945
  var wallet;
986
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
987
- while (1) switch (_context21.prev = _context21.next) {
946
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
947
+ while (1) switch (_context20.prev = _context20.next) {
988
948
  case 0:
989
- _context21.prev = 0;
990
- _context21.next = 3;
949
+ _context20.prev = 0;
950
+ _context20.next = 3;
991
951
  return _Auth.default.createWallet(data);
992
952
  case 3:
993
- wallet = _context21.sent;
994
- return _context21.abrupt("return", wallet);
953
+ wallet = _context20.sent;
954
+ return _context20.abrupt("return", wallet);
995
955
  case 7:
996
- _context21.prev = 7;
997
- _context21.t0 = _context21["catch"](0);
998
- console.log("Error creating wallet: ".concat(_context21.t0));
999
- throw _context21.t0;
956
+ _context20.prev = 7;
957
+ _context20.t0 = _context20["catch"](0);
958
+ console.log("Error creating wallet: ".concat(_context20.t0));
959
+ throw _context20.t0;
1000
960
  case 11:
1001
961
  case "end":
1002
- return _context21.stop();
962
+ return _context20.stop();
1003
963
  }
1004
- }, _callee21, null, [[0, 7]]);
964
+ }, _callee20, null, [[0, 7]]);
1005
965
  }));
1006
- return function (_x23) {
1007
- return _ref21.apply(this, arguments);
966
+ return function (_x22) {
967
+ return _ref20.apply(this, arguments);
1008
968
  };
1009
969
  }());
1010
970
  _defineProperty(_assertThisInitialized(_this), "setUser", function (user) {
@@ -1016,12 +976,12 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
1016
976
  });
1017
977
  });
1018
978
  _defineProperty(_assertThisInitialized(_this), "fetchLastTime", /*#__PURE__*/function () {
1019
- var _ref22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(projectName, page, userId) {
979
+ var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(projectName, page, userId) {
1020
980
  var filterBody, response;
1021
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1022
- while (1) switch (_context22.prev = _context22.next) {
981
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
982
+ while (1) switch (_context21.prev = _context21.next) {
1023
983
  case 0:
1024
- _context22.prev = 0;
984
+ _context21.prev = 0;
1025
985
  filterBody = {
1026
986
  projectName: projectName,
1027
987
  page: page
@@ -1029,25 +989,25 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
1029
989
  if (userId) {
1030
990
  filterBody.userId = userId;
1031
991
  }
1032
- _context22.next = 5;
992
+ _context21.next = 5;
1033
993
  return _Auth.default.fetchTrackingUserLastTime({
1034
994
  filter: filterBody
1035
995
  });
1036
996
  case 5:
1037
- response = _context22.sent;
1038
- return _context22.abrupt("return", response);
997
+ response = _context21.sent;
998
+ return _context21.abrupt("return", response);
1039
999
  case 9:
1040
- _context22.prev = 9;
1041
- _context22.t0 = _context22["catch"](0);
1042
- console.log(' error', _context22.t0);
1000
+ _context21.prev = 9;
1001
+ _context21.t0 = _context21["catch"](0);
1002
+ console.log(' error', _context21.t0);
1043
1003
  case 12:
1044
1004
  case "end":
1045
- return _context22.stop();
1005
+ return _context21.stop();
1046
1006
  }
1047
- }, _callee22, null, [[0, 9]]);
1007
+ }, _callee21, null, [[0, 9]]);
1048
1008
  }));
1049
- return function (_x24, _x25, _x26) {
1050
- return _ref22.apply(this, arguments);
1009
+ return function (_x23, _x24, _x25) {
1010
+ return _ref21.apply(this, arguments);
1051
1011
  };
1052
1012
  }());
1053
1013
  return _this;
@@ -1099,7 +1059,6 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
1099
1059
  updateFirebaseUser: _Auth.default.updateFirebaseUser,
1100
1060
  handleResetPassword: this.handleResetPassword,
1101
1061
  handleVerifyEmail: this.handleVerifyEmail,
1102
- checkActivationLinkExpired: this.checkActivationLinkExpired,
1103
1062
  setUser: this.setUser,
1104
1063
  refreshIdToken: _Auth.default.refreshIdToken
1105
1064
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "2.3.41-beta.8",
3
+ "version": "2.3.42-beta",
4
4
  "description": "STOKR - Components Library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",