@northern.tech/store 0.27.0 → 0.29.0

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 (72) hide show
  1. package/dist/actions.js +4 -4
  2. package/dist/appSlice/thunks.cjs +8 -4
  3. package/dist/appSlice/thunks.cjs.map +1 -1
  4. package/dist/appSlice/thunks.js +13 -13
  5. package/dist/{chunk-KR5IU7TA.js → chunk-4573DUCR.js} +2 -2
  6. package/dist/{chunk-KR5IU7TA.js.map → chunk-4573DUCR.js.map} +1 -1
  7. package/dist/{chunk-DWK4R74O.js → chunk-4BUO44SS.js} +8 -8
  8. package/dist/{chunk-GDJES5SY.js → chunk-5OLM3HEG.js} +7 -7
  9. package/dist/{chunk-WIGVDU4L.js → chunk-66LI4BJO.js} +6 -3
  10. package/dist/{chunk-WIGVDU4L.js.map → chunk-66LI4BJO.js.map} +1 -1
  11. package/dist/{chunk-3JFB22RN.js → chunk-FXPRG4WH.js} +22 -23
  12. package/dist/chunk-FXPRG4WH.js.map +1 -0
  13. package/dist/{chunk-MTY2ODOS.js → chunk-KEQAPMP6.js} +5 -5
  14. package/dist/{chunk-DXMRQEP6.js → chunk-UE2EPKRU.js} +8 -8
  15. package/dist/{chunk-GEJJVRND.js → chunk-Z4QLZNAN.js} +5 -5
  16. package/dist/commonSelectors.cjs +4 -2
  17. package/dist/commonSelectors.cjs.map +1 -1
  18. package/dist/commonSelectors.js +4 -4
  19. package/dist/deploymentsSlice/thunks.cjs +8 -4
  20. package/dist/deploymentsSlice/thunks.cjs.map +1 -1
  21. package/dist/deploymentsSlice/thunks.js +13 -13
  22. package/dist/devicesSlice/selectors.cjs +6 -2
  23. package/dist/devicesSlice/selectors.cjs.map +1 -1
  24. package/dist/devicesSlice/selectors.d.cts +92 -4
  25. package/dist/devicesSlice/selectors.d.ts +92 -4
  26. package/dist/devicesSlice/selectors.js +3 -1
  27. package/dist/devicesSlice/thunks.cjs +8 -4
  28. package/dist/devicesSlice/thunks.cjs.map +1 -1
  29. package/dist/devicesSlice/thunks.js +13 -13
  30. package/dist/liststatehook.cjs +1 -1
  31. package/dist/liststatehook.cjs.map +1 -1
  32. package/dist/liststatehook.js +1 -1
  33. package/dist/locationutils.cjs +1 -1
  34. package/dist/locationutils.cjs.map +1 -1
  35. package/dist/locationutils.js +1 -1
  36. package/dist/monitorSlice/thunks.cjs +4 -2
  37. package/dist/monitorSlice/thunks.cjs.map +1 -1
  38. package/dist/monitorSlice/thunks.js +10 -10
  39. package/dist/onboardingSlice/thunks.cjs +8 -4
  40. package/dist/onboardingSlice/thunks.cjs.map +1 -1
  41. package/dist/onboardingSlice/thunks.js +13 -13
  42. package/dist/organizationSlice/thunks.cjs +13 -12
  43. package/dist/organizationSlice/thunks.cjs.map +1 -1
  44. package/dist/organizationSlice/thunks.js +13 -13
  45. package/dist/releasesSlice/thunks.cjs +4 -2
  46. package/dist/releasesSlice/thunks.cjs.map +1 -1
  47. package/dist/releasesSlice/thunks.js +11 -11
  48. package/dist/selectors.cjs +6 -2
  49. package/dist/selectors.cjs.map +1 -1
  50. package/dist/selectors.d.cts +1 -1
  51. package/dist/selectors.d.ts +1 -1
  52. package/dist/selectors.js +10 -8
  53. package/dist/store.js +5 -5
  54. package/dist/storehooks.cjs +13 -12
  55. package/dist/storehooks.cjs.map +1 -1
  56. package/dist/storehooks.js +13 -13
  57. package/dist/thunks.cjs +13 -12
  58. package/dist/thunks.cjs.map +1 -1
  59. package/dist/thunks.js +13 -13
  60. package/dist/useDeploymentDevice.cjs +8 -4
  61. package/dist/useDeploymentDevice.cjs.map +1 -1
  62. package/dist/useDeploymentDevice.js +13 -13
  63. package/dist/usersSlice/thunks.cjs +8 -4
  64. package/dist/usersSlice/thunks.cjs.map +1 -1
  65. package/dist/usersSlice/thunks.js +13 -13
  66. package/package.json +1 -2
  67. package/dist/chunk-3JFB22RN.js.map +0 -1
  68. /package/dist/{chunk-DWK4R74O.js.map → chunk-4BUO44SS.js.map} +0 -0
  69. /package/dist/{chunk-GDJES5SY.js.map → chunk-5OLM3HEG.js.map} +0 -0
  70. /package/dist/{chunk-MTY2ODOS.js.map → chunk-KEQAPMP6.js.map} +0 -0
  71. /package/dist/{chunk-DXMRQEP6.js.map → chunk-UE2EPKRU.js.map} +0 -0
  72. /package/dist/{chunk-GEJJVRND.js.map → chunk-Z4QLZNAN.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  export { getAppInitDone, getCommit, getDocsVersion, getFeatures, getFeedbackProbability, getFullVersionInformation, getHostAddress, getHostedAnnouncement, getIsFirstLogin, getIsPreview, getIsUploading, getRecaptchaKey, getSearchState, getSearchedDevices, getSentryConfig, getSnackbar, getStripeKey, getTrackerCode, getUploads, getVersionInformation } from './appSlice/selectors.js';
2
2
  export { getAttrsEndpoint, getAuditlogDevice, getAvailableIssueOptionsByType, getDemoDeviceAddress, getDeploymentRelease, getDeviceConfigDeployment, getDeviceReportsForUser, getFilterAttributes, getGroupNames, getIsEnterprise, getMappedDevicesList, getOnboardingState, getRelevantRoles, getSearchEndpoint, getSelectedDeploymentData, getShowSecurityAlert, getTenantCapabilities, getUserCapabilities, getUserRoles } from './commonSelectors.js';
3
3
  export { DEPLOYMENT_CUTOFF, getDeploymentById, getDeploymentsById, getDeploymentsByStatus, getDeploymentsSelectionState, getMappedDeploymentSelection, getRecentDeployments, getSelectedDeploymentDeviceIds } from './deploymentsSlice/selectors.js';
4
- export { getAcceptedDevices, getAttributesList, getCombinedLimit, getDeviceById, getDeviceCountsByStatus, getDeviceFilters, getDeviceIdentityAttributes, getDeviceLimitStats, getDeviceLimits, getDeviceListState, getDeviceReports, getDeviceTypes, getDevicesById, getDevicesByStatus, getFilteringAttributes, getGroupData, getGroups, getGroupsById, getGroupsByIdWithoutUngrouped, getLimitMaxed, getListedDevices, getSelectedGroup, getSelectedGroupInfo, getSortedFilteringAttributes } from './devicesSlice/selectors.js';
4
+ export { getAcceptedDevices, getAttributesList, getCombinedLimit, getDeviceById, getDeviceCountsByStatus, getDeviceFilters, getDeviceIdentityAttributes, getDeviceLimitStats, getDeviceLimits, getDeviceListState, getDeviceReports, getDeviceTypes, getDevicesById, getDevicesByStatus, getEnabledTiers, getFilteringAttributes, getGroupData, getGroups, getGroupsById, getGroupsByIdWithoutUngrouped, getLimitMaxed, getListedDevices, getSelectedGroup, getSelectedGroupInfo, getSortedFilteringAttributes } from './devicesSlice/selectors.js';
5
5
  export { getIssueCountsByType } from './monitorSlice/selectors.js';
6
6
  export { getOnboarding } from './onboardingSlice/selectors.js';
7
7
  export { getAuditLog, getAuditLogEntry, getAuditLogSelectionState, getAuditlogState, getBillingProfile, getCard, getDeviceTwinIntegrations, getDisabledTiers, getExternalIntegrations, getIsServiceProvider, getOrganization, getProducts, getSpLimits, getSsoConfig, getSubscription, getTenantListWithLimits, getTenantsList, getWebhookEventInfo, getWebhookEventTotal, getWebhookEvents, getWebhooks } from './organizationSlice/selectors.js';
package/dist/selectors.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  getTenantCapabilities,
20
20
  getUserCapabilities,
21
21
  getUserRoles
22
- } from "./chunk-DWK4R74O.js";
22
+ } from "./chunk-4BUO44SS.js";
23
23
  import {
24
24
  getDeltaJobById,
25
25
  getDeltaJobsById,
@@ -80,6 +80,12 @@ import {
80
80
  getWebhookEvents,
81
81
  getWebhooks
82
82
  } from "./chunk-XHLNGIAP.js";
83
+ import {
84
+ getIssueCountsByType
85
+ } from "./chunk-YO22XLHI.js";
86
+ import {
87
+ getOnboarding
88
+ } from "./chunk-JIS4PA3R.js";
83
89
  import {
84
90
  DEPLOYMENT_CUTOFF,
85
91
  getDeploymentById,
@@ -90,9 +96,6 @@ import {
90
96
  getRecentDeployments,
91
97
  getSelectedDeploymentDeviceIds
92
98
  } from "./chunk-FAKWYYOB.js";
93
- import {
94
- getOnboarding
95
- } from "./chunk-JIS4PA3R.js";
96
99
  import {
97
100
  getAcceptedDevices,
98
101
  getAttributesList,
@@ -108,6 +111,7 @@ import {
108
111
  getDeviceTypes,
109
112
  getDevicesById,
110
113
  getDevicesByStatus,
114
+ getEnabledTiers,
111
115
  getFilteringAttributes,
112
116
  getGroupData,
113
117
  getGroups,
@@ -118,10 +122,7 @@ import {
118
122
  getSelectedGroup,
119
123
  getSelectedGroupInfo,
120
124
  getSortedFilteringAttributes
121
- } from "./chunk-WIGVDU4L.js";
122
- import {
123
- getIssueCountsByType
124
- } from "./chunk-YO22XLHI.js";
125
+ } from "./chunk-66LI4BJO.js";
125
126
  import {
126
127
  getAppInitDone,
127
128
  getCommit,
@@ -193,6 +194,7 @@ export {
193
194
  getDevicesByStatus,
194
195
  getDisabledTiers,
195
196
  getDocsVersion,
197
+ getEnabledTiers,
196
198
  getExternalIntegrations,
197
199
  getFeatures,
198
200
  getFeedbackProbability,
package/dist/store.js CHANGED
@@ -6,16 +6,16 @@ import {
6
6
  sessionReducer,
7
7
  store,
8
8
  useAppDispatch
9
- } from "./chunk-DXMRQEP6.js";
10
- import "./chunk-GDJES5SY.js";
9
+ } from "./chunk-UE2EPKRU.js";
10
+ import "./chunk-5OLM3HEG.js";
11
11
  import "./chunk-525LX7VL.js";
12
12
  import "./chunk-4YLOOOZH.js";
13
13
  import "./chunk-LSAJE3IU.js";
14
- import "./chunk-2QIGK5IU.js";
15
- import "./chunk-CQXDAXQF.js";
16
14
  import "./chunk-HVZ5BOM6.js";
17
- import "./chunk-GX3X2E57.js";
15
+ import "./chunk-CQXDAXQF.js";
18
16
  import "./chunk-UBFFGYQ4.js";
17
+ import "./chunk-GX3X2E57.js";
18
+ import "./chunk-2QIGK5IU.js";
19
19
  import "./chunk-WXRYJOL3.js";
20
20
  import "./chunk-CMXRPUOF.js";
21
21
  import "./chunk-2DYA3X77.js";
@@ -1716,6 +1716,7 @@ var getFeatures = (state) => state.app.features;
1716
1716
  var getFullVersionInformation = (state) => state.app.versionInformation;
1717
1717
  var getSearchState = (state) => state.app.searchState;
1718
1718
  var getUploads = (state) => state.app.uploadsById;
1719
+ var getHostedAnnouncement = (state) => state.app.hostedAnnouncement;
1719
1720
  var getIsUploading = (0, import_toolkit9.createSelector)([getUploads], (uploadsById) => !!Object.keys(uploadsById).length);
1720
1721
  var getSearchedDevices = (0, import_toolkit9.createSelector)([getSearchState], ({ deviceIds }) => deviceIds);
1721
1722
  var getVersionInformation = (0, import_toolkit9.createSelector)(
@@ -1876,9 +1877,11 @@ var getAttributesList = (0, import_toolkit11.createSelector)(
1876
1877
  [getFilteringAttributes, getFilteringAttributesFromConfig],
1877
1878
  ({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) => [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(import_helpers3.duplicateFilter)
1878
1879
  );
1879
- var getDeviceLimitStats = (0, import_toolkit11.createSelector)([getDeviceLimits, getAcceptedDevices], (limits, accepted) => {
1880
+ var getEnabledTierLimits = (0, import_toolkit11.createSelector)([getDeviceLimits], (limits) => Object.entries(limits).filter(([, limit]) => limit !== 0));
1881
+ var getEnabledTiers = (0, import_toolkit11.createSelector)([getEnabledTierLimits], (enabledTierLimits) => enabledTierLimits.map(([type]) => type));
1882
+ var getDeviceLimitStats = (0, import_toolkit11.createSelector)([getEnabledTierLimits, getAcceptedDevices], (enabledTierLimits, accepted) => {
1880
1883
  const { counts } = accepted;
1881
- return Object.entries(limits).filter(([, limit]) => limit !== 0).map(([type, limit]) => ({
1884
+ return enabledTierLimits.map(([type, limit]) => ({
1882
1885
  type,
1883
1886
  limit,
1884
1887
  total: counts[type] || 0
@@ -2198,7 +2201,6 @@ var getOfflineThresholdSettings = (0, import_toolkit14.createSelector)([getGloba
2198
2201
  intervalUnit: offlineThreshold?.intervalUnit || DEVICE_ONLINE_CUTOFF.intervalName
2199
2202
  }));
2200
2203
  var getRolesList = (0, import_toolkit14.createSelector)([getRolesById], (rolesById2) => Object.entries(rolesById2).map(([value, role]) => ({ value, ...role })));
2201
- var getCurrentSession = (state) => state.users.currentSession;
2202
2204
  var getSecurityAlertDismissedTimestamp = (state) => state.users.userSettings.securityAlertDismissedTimestamp;
2203
2205
 
2204
2206
  // src/commonSelectors.ts
@@ -3034,7 +3036,7 @@ var saveDeltaDeploymentsConfig = createAppAsyncThunk(
3034
3036
  );
3035
3037
  var generateDeploymentLogAnalysis = createAppAsyncThunk(
3036
3038
  `${sliceName2}/generateDeploymentLogAnalysis`,
3037
- ({ deploymentId, deviceId }, { dispatch, rejectWithValue }) => general_api_default.get(`${import_constants5.apiRoot}/v1alpha1/deployments/deployments/${deploymentId}/devices/${deviceId}/log/explain`).then(({ data: result }) => Promise.resolve(result)).catch((err) => {
3039
+ ({ deploymentId, deviceId }, { dispatch, rejectWithValue }) => general_api_default.get(`${import_constants5.apiRoot}/v1alpha1/deployments/deployments/${deploymentId}/devices/${deviceId}/log/explain`, { timeout: 60 * TIMEOUTS.oneSecond }).then(({ data: result }) => Promise.resolve(result)).catch((err) => {
3038
3040
  if (err.response.status === 429) {
3039
3041
  return rejectWithValue(err.response);
3040
3042
  }
@@ -4122,7 +4124,6 @@ var advanceOnboarding = createAppAsyncThunk(`${sliceName5}/advanceOnboarding`, (
4122
4124
  var import_helpers11 = require("@northern.tech/utils/helpers");
4123
4125
  var import_dayjs2 = __toESM(require("dayjs"), 1);
4124
4126
  var import_utc = __toESM(require("dayjs/plugin/utc.js"), 1);
4125
- var import_jwt_decode = require("jwt-decode");
4126
4127
  var import_md5 = __toESM(require("md5"), 1);
4127
4128
  var import_universal_cookie5 = __toESM(require("universal-cookie"), 1);
4128
4129
  var cookies5 = new import_universal_cookie5.default();
@@ -4391,14 +4392,13 @@ var removeTenant = createAppAsyncThunk(
4391
4392
  var getUserOrganization = createAppAsyncThunk(
4392
4393
  `${sliceName6}/getUserOrganization`,
4393
4394
  (_, { dispatch, getState }) => general_api_default.get(`${import_constants5.tenantadmApiUrlv1}/user/tenant?tiers=true`).then((res) => {
4394
- const tasks = [dispatch(actions6.setOrganization(res.data))];
4395
4395
  const { addons, plan, trial } = res.data;
4396
- const { token } = getCurrentSession(getState());
4397
- const jwt = (0, import_jwt_decode.jwtDecode)(token);
4398
- const jwtData = { addons: jwt["mender.addons"], plan: jwt["mender.plan"], trial: jwt["mender.trial"] };
4399
- if (!(0, import_helpers11.deepCompare)({ addons, plan, trial }, jwtData)) {
4396
+ const { addons: currentAddons, id: currentId, plan: currentPlan, trial: currentTrial } = getOrganization(getState());
4397
+ const tasks = [dispatch(actions6.setOrganization(res.data))];
4398
+ if (currentId && !(0, import_helpers11.deepCompare)({ addons, plan, trial }, { addons: currentAddons, plan: currentPlan, trial: currentTrial })) {
4400
4399
  const hash = (0, import_md5.default)(tenantDataDivergedMessage);
4401
- cookies5.remove(`${jwt.sub}${hash}`);
4400
+ const { id: currentUserId } = getCurrentUser(getState());
4401
+ cookies5.remove(`${currentUserId}${hash}`);
4402
4402
  tasks.push(dispatch(setAnnouncement(tenantDataDivergedMessage)));
4403
4403
  }
4404
4404
  return Promise.all(tasks);
@@ -5548,7 +5548,8 @@ var setHideAnnouncement = createAppAsyncThunk(
5548
5548
  `${sliceName8}/setHideAnnouncement`,
5549
5549
  ({ shouldHide, userId }, { dispatch, getState }) => {
5550
5550
  const currentUserId = userId || getCurrentUser(getState()).id;
5551
- const hash = getState().app.hostedAnnouncement ? (0, import_md52.default)(getState().app.hostedAnnouncement) : "";
5551
+ const announcement = getHostedAnnouncement(getState());
5552
+ const hash = announcement ? (0, import_md52.default)(announcement) : "";
5552
5553
  const announceCookie = cookies6.get(`${currentUserId}${hash}`);
5553
5554
  if (shouldHide || hash.length && typeof announceCookie !== "undefined") {
5554
5555
  cookies6.set(`${currentUserId}${hash}`, true, { maxAge: 604800 });