@northern.tech/store 0.19.0 → 0.19.2

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.
Files changed (125) hide show
  1. package/dist/actions.js +1 -1
  2. package/dist/api/general-api.cjs +13 -9
  3. package/dist/api/general-api.cjs.map +1 -1
  4. package/dist/api/general-api.js +3 -3
  5. package/dist/api/users-api.cjs +13 -9
  6. package/dist/api/users-api.cjs.map +1 -1
  7. package/dist/api/users-api.js +4 -4
  8. package/dist/appSlice/constants.cjs +8 -4
  9. package/dist/appSlice/constants.cjs.map +1 -1
  10. package/dist/appSlice/constants.d.cts +1 -1
  11. package/dist/appSlice/constants.d.ts +1 -1
  12. package/dist/appSlice/constants.js +1 -1
  13. package/dist/appSlice/index.js +1 -1
  14. package/dist/appSlice/mocks.js +1 -1
  15. package/dist/appSlice/thunks.cjs +37 -21
  16. package/dist/appSlice/thunks.cjs.map +1 -1
  17. package/dist/appSlice/thunks.js +12 -12
  18. package/dist/auth.cjs +7 -9
  19. package/dist/auth.cjs.map +1 -1
  20. package/dist/auth.js +2 -2
  21. package/dist/{chunk-GEQ2QQEE.js → chunk-42GZ6FGV.js} +2 -2
  22. package/dist/{chunk-QL6FN2JC.js → chunk-43ZBO3JW.js} +2 -2
  23. package/dist/{chunk-GAHFKM3N.js → chunk-45BHMNX6.js} +5 -5
  24. package/dist/{chunk-EL672W25.js → chunk-AJ6DIDO4.js} +9 -5
  25. package/dist/chunk-AJ6DIDO4.js.map +1 -0
  26. package/dist/{chunk-XC7DABLM.js → chunk-AV7SRATY.js} +6 -6
  27. package/dist/{chunk-U5TPV5X5.js → chunk-B3C6H2PR.js} +2 -2
  28. package/dist/{chunk-5M6EUVNO.js → chunk-IRQRV552.js} +8 -2
  29. package/dist/chunk-IRQRV552.js.map +1 -0
  30. package/dist/{chunk-QFYSFHAF.js → chunk-KJ2SUFAU.js} +19 -10
  31. package/dist/chunk-KJ2SUFAU.js.map +1 -0
  32. package/dist/{chunk-FDSMCFV5.js → chunk-UVTLZV34.js} +8 -10
  33. package/dist/chunk-UVTLZV34.js.map +1 -0
  34. package/dist/{chunk-Y3DJIMEN.js → chunk-XJLZK4QY.js} +3 -3
  35. package/dist/{chunk-TJBX7YHM.js → chunk-XOASGJZU.js} +5 -5
  36. package/dist/{chunk-RVAERI6U.js → chunk-ZAZTNDSY.js} +2 -2
  37. package/dist/commonConstants.js +1 -1
  38. package/dist/commonSelectors.cjs +8 -4
  39. package/dist/commonSelectors.cjs.map +1 -1
  40. package/dist/commonSelectors.js +5 -5
  41. package/dist/constants.cjs +8 -4
  42. package/dist/constants.cjs.map +1 -1
  43. package/dist/constants.js +1 -1
  44. package/dist/deploymentsSlice/constants.js +1 -1
  45. package/dist/deploymentsSlice/index.js +1 -1
  46. package/dist/deploymentsSlice/mocks.js +1 -1
  47. package/dist/deploymentsSlice/selectors.js +1 -1
  48. package/dist/deploymentsSlice/thunks.cjs +37 -21
  49. package/dist/deploymentsSlice/thunks.cjs.map +1 -1
  50. package/dist/deploymentsSlice/thunks.js +12 -12
  51. package/dist/devicesSlice/constants.js +1 -1
  52. package/dist/devicesSlice/index.js +1 -1
  53. package/dist/devicesSlice/mocks.js +1 -1
  54. package/dist/devicesSlice/selectors.js +1 -1
  55. package/dist/devicesSlice/thunks.cjs +39 -21
  56. package/dist/devicesSlice/thunks.cjs.map +1 -1
  57. package/dist/devicesSlice/thunks.d.cts +41 -3
  58. package/dist/devicesSlice/thunks.d.ts +41 -3
  59. package/dist/devicesSlice/thunks.js +14 -12
  60. package/dist/liststatehook.js +1 -1
  61. package/dist/locationutils.js +1 -1
  62. package/dist/monitorSlice/index.js +1 -1
  63. package/dist/monitorSlice/mocks.js +1 -1
  64. package/dist/monitorSlice/thunks.cjs +21 -13
  65. package/dist/monitorSlice/thunks.cjs.map +1 -1
  66. package/dist/monitorSlice/thunks.js +9 -9
  67. package/dist/onboardingSlice/thunks.cjs +40 -24
  68. package/dist/onboardingSlice/thunks.cjs.map +1 -1
  69. package/dist/onboardingSlice/thunks.js +12 -12
  70. package/dist/organizationSlice/constants.js +1 -1
  71. package/dist/organizationSlice/index.js +1 -1
  72. package/dist/organizationSlice/mocks.js +1 -1
  73. package/dist/organizationSlice/selectors.js +1 -1
  74. package/dist/organizationSlice/thunks.cjs +43 -27
  75. package/dist/organizationSlice/thunks.cjs.map +1 -1
  76. package/dist/organizationSlice/thunks.js +12 -12
  77. package/dist/releasesSlice/index.js +1 -1
  78. package/dist/releasesSlice/mocks.js +1 -1
  79. package/dist/releasesSlice/selectors.js +3 -3
  80. package/dist/releasesSlice/thunks.cjs +21 -13
  81. package/dist/releasesSlice/thunks.cjs.map +1 -1
  82. package/dist/releasesSlice/thunks.js +9 -9
  83. package/dist/selectors.cjs +8 -4
  84. package/dist/selectors.cjs.map +1 -1
  85. package/dist/selectors.js +5 -5
  86. package/dist/sockethook.js +1 -1
  87. package/dist/store.cjs +7 -9
  88. package/dist/store.cjs.map +1 -1
  89. package/dist/store.js +3 -3
  90. package/dist/storehooks.cjs +50 -34
  91. package/dist/storehooks.cjs.map +1 -1
  92. package/dist/storehooks.js +12 -12
  93. package/dist/thunks.cjs +48 -30
  94. package/dist/thunks.cjs.map +1 -1
  95. package/dist/thunks.d.cts +1 -1
  96. package/dist/thunks.d.ts +1 -1
  97. package/dist/thunks.js +14 -12
  98. package/dist/useDeploymentDevice.cjs +37 -21
  99. package/dist/useDeploymentDevice.cjs.map +1 -1
  100. package/dist/useDeploymentDevice.js +12 -12
  101. package/dist/usersSlice/constants.js +1 -1
  102. package/dist/usersSlice/index.js +1 -1
  103. package/dist/usersSlice/mocks.js +1 -1
  104. package/dist/usersSlice/selectors.cjs +8 -4
  105. package/dist/usersSlice/selectors.cjs.map +1 -1
  106. package/dist/usersSlice/selectors.js +3 -3
  107. package/dist/usersSlice/thunks.cjs +37 -21
  108. package/dist/usersSlice/thunks.cjs.map +1 -1
  109. package/dist/usersSlice/thunks.js +12 -12
  110. package/dist/utils.cjs +8 -4
  111. package/dist/utils.cjs.map +1 -1
  112. package/dist/utils.js +2 -2
  113. package/package.json +3 -3
  114. package/dist/chunk-5M6EUVNO.js.map +0 -1
  115. package/dist/chunk-EL672W25.js.map +0 -1
  116. package/dist/chunk-FDSMCFV5.js.map +0 -1
  117. package/dist/chunk-QFYSFHAF.js.map +0 -1
  118. /package/dist/{chunk-GEQ2QQEE.js.map → chunk-42GZ6FGV.js.map} +0 -0
  119. /package/dist/{chunk-QL6FN2JC.js.map → chunk-43ZBO3JW.js.map} +0 -0
  120. /package/dist/{chunk-GAHFKM3N.js.map → chunk-45BHMNX6.js.map} +0 -0
  121. /package/dist/{chunk-XC7DABLM.js.map → chunk-AV7SRATY.js.map} +0 -0
  122. /package/dist/{chunk-U5TPV5X5.js.map → chunk-B3C6H2PR.js.map} +0 -0
  123. /package/dist/{chunk-Y3DJIMEN.js.map → chunk-XJLZK4QY.js.map} +0 -0
  124. /package/dist/{chunk-TJBX7YHM.js.map → chunk-XOASGJZU.js.map} +0 -0
  125. /package/dist/{chunk-RVAERI6U.js.map → chunk-ZAZTNDSY.js.map} +0 -0
@@ -37,7 +37,7 @@ __export(thunks_exports, {
37
37
  });
38
38
  module.exports = __toCommonJS(thunks_exports);
39
39
  var import_helpers10 = require("@northern.tech/utils/helpers");
40
- var import_universal_cookie3 = __toESM(require("universal-cookie"), 1);
40
+ var import_universal_cookie4 = __toESM(require("universal-cookie"), 1);
41
41
 
42
42
  // src/appSlice/index.ts
43
43
  var import_toolkit = require("@reduxjs/toolkit");
@@ -94,7 +94,7 @@ var ADDONS = {
94
94
  configure: {
95
95
  id: "configure",
96
96
  title: "Configure",
97
- description: "Expand your plan with device configuration features",
97
+ description: "Seamlessly configure applications and devices remotely \u2013 configure each device to its environment.",
98
98
  needs: ["hasDeviceConfig"],
99
99
  os: {
100
100
  price: "$11/month",
@@ -109,7 +109,7 @@ var ADDONS = {
109
109
  monitor: {
110
110
  id: "monitor",
111
111
  title: "Monitor",
112
- description: "Expand your plan with device monitoring features",
112
+ description: "Detect and analyze health issues of devices, services and applications. Set up alerts so you can act quickly.",
113
113
  needs: ["hasMonitor"],
114
114
  os: {
115
115
  price: "-",
@@ -124,7 +124,7 @@ var ADDONS = {
124
124
  troubleshoot: {
125
125
  id: "troubleshoot",
126
126
  title: "Troubleshoot",
127
- description: "Expand your plan with device troubleshooting features",
127
+ description: "Secure, remote access to your devices \u2013 quickly diagnose and fix issues in real time.",
128
128
  needs: ["hasDeviceConnect"],
129
129
  os: {
130
130
  price: "$27/month",
@@ -138,7 +138,11 @@ var ADDONS = {
138
138
  }
139
139
  };
140
140
  var BENEFITS = {
141
- auditlog: { id: "auditlog", benefit: "trace change across your devices and access troubleshooting session replay", requiredPlan: PLANS.professional.id },
141
+ auditlog: {
142
+ id: "auditlog",
143
+ benefit: "gain access to logs for important events such as changes to devices, deployments and user management, as well as remote terminal session replays",
144
+ requiredPlan: PLANS.enterprise.id
145
+ },
142
146
  dashboard: { id: "dashboard", benefit: "actionable insights into the devices you are updating with Mender", requiredPlan: PLANS.enterprise.id },
143
147
  deltaGeneration: {
144
148
  id: "deltaGeneration",
@@ -902,6 +906,7 @@ var appSlice_default = appSlice.reducer;
902
906
 
903
907
  // src/api/general-api.ts
904
908
  var import_axios = __toESM(require("axios"), 1);
909
+ var import_universal_cookie2 = __toESM(require("universal-cookie"), 1);
905
910
 
906
911
  // src/auth.ts
907
912
  var import_universal_cookie = __toESM(require("universal-cookie"), 1);
@@ -914,19 +919,17 @@ var getSessionInfo = () => {
914
919
  sessionInfo = JSON.parse(window.localStorage.getItem("JWT") ?? "");
915
920
  } catch {
916
921
  }
922
+ const jwtTokenFromCookie = cookies.get("JWT", { doNotParse: true }) ?? "";
923
+ if (jwtTokenFromCookie) {
924
+ setSessionInfo({ token: jwtTokenFromCookie });
925
+ cookies.remove("JWT");
926
+ cookies.remove("JWT", { path: "/" });
927
+ return { token: jwtTokenFromCookie, expiresAt: void 0 };
928
+ }
917
929
  if (sessionInfo.expiresAt && new Date(sessionInfo.expiresAt) < /* @__PURE__ */ new Date()) {
918
930
  cleanUp();
919
931
  return { ...emptySession };
920
932
  }
921
- if (!sessionInfo.token) {
922
- const jwtTokenFromCookie = cookies.get("JWT", { doNotParse: true }) ?? "";
923
- if (jwtTokenFromCookie) {
924
- setSessionInfo({ token: jwtTokenFromCookie });
925
- sessionInfo.token = jwtTokenFromCookie;
926
- cookies.remove("JWT");
927
- cookies.remove("JWT", { path: "/" });
928
- }
929
- }
930
933
  sessionInfo.token = sessionInfo.token || "";
931
934
  tokenCache = sessionInfo.token;
932
935
  return sessionInfo;
@@ -945,8 +948,13 @@ var cleanUp = () => {
945
948
  };
946
949
 
947
950
  // src/api/general-api.ts
951
+ var cookies2 = new import_universal_cookie2.default();
948
952
  var unauthorizedRedirect = (error) => {
949
953
  if (!(0, import_axios.isCancel)(error) && error.response?.status === 401 && getToken() && !window.location.pathname.endsWith("/subscription")) {
954
+ if (cookies2.get("JWT", { doNotParse: true })) {
955
+ window.location.reload();
956
+ return Promise.reject(error);
957
+ }
950
958
  cleanUp();
951
959
  window.location.replace("/ui/");
952
960
  }
@@ -2993,11 +3001,18 @@ var addStaticGroup = createAppAsyncThunk(
2993
3001
  )
2994
3002
  ).catch((err) => commonErrorHandler(err, `Group could not be updated:`, dispatch))
2995
3003
  );
3004
+ var removeReportsByGroupName = createAppAsyncThunk(`${sliceName3}/removeReportsByGroupName`, (groupName, { dispatch, getState }) => {
3005
+ if (!groupName) return Promise.resolve();
3006
+ const reports = getDeviceReportsForUser(getState());
3007
+ const filteredReports = reports.filter((report) => report.group !== groupName);
3008
+ dispatch(saveUserSettings({ reports: filteredReports }));
3009
+ });
2996
3010
  var removeStaticGroup = createAppAsyncThunk(
2997
3011
  `${sliceName3}/removeStaticGroup`,
2998
3012
  (groupName, { dispatch }) => general_api_default.delete(`${import_constants5.inventoryApiUrl}/groups/${groupName}`).then(
2999
3013
  () => Promise.all([
3000
3014
  dispatch(actions3.removeGroup(groupName)),
3015
+ dispatch(removeReportsByGroupName(groupName)),
3001
3016
  dispatch(getGroups2()),
3002
3017
  dispatch(setSnackbar3({ message: "Group was removed successfully", autoHideDuration: TIMEOUTS.fiveSeconds }))
3003
3018
  ])
@@ -3063,6 +3078,7 @@ var removeDynamicGroup = createAppAsyncThunk(`${sliceName3}/removeDynamicGroup`,
3063
3078
  return general_api_default.delete(`${import_constants5.inventoryApiUrlV2}/filters/${filterId}`).then(
3064
3079
  () => Promise.all([
3065
3080
  dispatch(actions3.removeGroup(groupName)),
3081
+ dispatch(removeReportsByGroupName(groupName)),
3066
3082
  dispatch(setSnackbar3({ message: "Group was removed successfully", autoHideDuration: TIMEOUTS.fiveSeconds }))
3067
3083
  ])
3068
3084
  );
@@ -3833,7 +3849,7 @@ var import_helpers9 = require("@northern.tech/utils/helpers");
3833
3849
  var import_retrytimer = require("@northern.tech/utils/retrytimer");
3834
3850
  var import_dayjs2 = __toESM(require("dayjs"), 1);
3835
3851
  var import_md5 = __toESM(require("md5"), 1);
3836
- var import_universal_cookie2 = __toESM(require("universal-cookie"), 1);
3852
+ var import_universal_cookie3 = __toESM(require("universal-cookie"), 1);
3837
3853
 
3838
3854
  // src/api/users-api.ts
3839
3855
  var import_axios3 = __toESM(require("axios"), 1);
@@ -3850,7 +3866,7 @@ var Api2 = {
3850
3866
  var users_api_default = Api2;
3851
3867
 
3852
3868
  // src/usersSlice/thunks.ts
3853
- var cookies2 = new import_universal_cookie2.default();
3869
+ var cookies3 = new import_universal_cookie3.default();
3854
3870
  var { setAnnouncement, setSnackbar: setSnackbar4 } = actions_default;
3855
3871
  var handleLoginError = (err, { token2fa: has2FA, password }, rejectWithValue) => () => {
3856
3872
  const errorText = (0, import_helpers9.extractErrorMessage)(err);
@@ -3885,7 +3901,7 @@ var loginUser = createAppAsyncThunk(
3885
3901
  now.setSeconds(now.getSeconds() + import_constants5.maxSessionAge);
3886
3902
  const expiresAt = stayLoggedIn ? void 0 : now.toISOString();
3887
3903
  setSessionInfo({ token, expiresAt });
3888
- cookies2.remove("JWT", { path: "/" });
3904
+ cookies3.remove("JWT", { path: "/" });
3889
3905
  return dispatch(getUser(OWN_USER_ID)).unwrap().catch((e) => {
3890
3906
  cleanUp();
3891
3907
  return Promise.reject(dispatch(setSnackbar4((0, import_helpers9.extractErrorMessage)(e))));
@@ -4440,9 +4456,9 @@ var setHideAnnouncement = createAppAsyncThunk(
4440
4456
  ({ shouldHide, userId }, { dispatch, getState }) => {
4441
4457
  const currentUserId = userId || getCurrentUser(getState()).id;
4442
4458
  const hash = getState().app.hostedAnnouncement ? (0, import_md5.default)(getState().app.hostedAnnouncement) : "";
4443
- const announceCookie = cookies2.get(`${currentUserId}${hash}`);
4459
+ const announceCookie = cookies3.get(`${currentUserId}${hash}`);
4444
4460
  if (shouldHide || hash.length && typeof announceCookie !== "undefined") {
4445
- cookies2.set(`${currentUserId}${hash}`, true, { maxAge: 604800 });
4461
+ cookies3.set(`${currentUserId}${hash}`, true, { maxAge: 604800 });
4446
4462
  dispatch(setAnnouncement(""));
4447
4463
  }
4448
4464
  }
@@ -4495,9 +4511,9 @@ var submitUserFeedback = createAppAsyncThunk(
4495
4511
  );
4496
4512
 
4497
4513
  // src/appSlice/thunks.ts
4498
- var cookies3 = new import_universal_cookie3.default();
4514
+ var cookies4 = new import_universal_cookie4.default();
4499
4515
  var setFirstLoginAfterSignup = createAppAsyncThunk(`${sliceName}/setFirstLoginAfterSignup`, (firstLoginAfterSignup, { dispatch }) => {
4500
- cookies3.set("firstLoginAfterSignup", !!firstLoginAfterSignup, { maxAge: 60, path: "/", domain: ".mender.io", sameSite: false });
4516
+ cookies4.set("firstLoginAfterSignup", !!firstLoginAfterSignup, { maxAge: 60, path: "/", domain: ".mender.io", sameSite: false });
4501
4517
  dispatch(actions.setFirstLoginAfterSignup(!!firstLoginAfterSignup));
4502
4518
  });
4503
4519
  var dateFunctionMap = {