@northern.tech/store 0.18.0 → 0.19.1

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 (106) hide show
  1. package/dist/actions.js +6 -6
  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/index.js +1 -1
  9. package/dist/appSlice/mocks.js +1 -1
  10. package/dist/appSlice/thunks.cjs +42 -19
  11. package/dist/appSlice/thunks.cjs.map +1 -1
  12. package/dist/appSlice/thunks.js +18 -18
  13. package/dist/auth.cjs +7 -9
  14. package/dist/auth.cjs.map +1 -1
  15. package/dist/auth.js +2 -2
  16. package/dist/{chunk-6UO33KLN.js → chunk-C3EMLDPU.js} +5 -5
  17. package/dist/{chunk-EFFRZCDN.js → chunk-FUGCLQ5L.js} +23 -23
  18. package/dist/{chunk-C5QK6HH6.js → chunk-GBXG2XBY.js} +5 -5
  19. package/dist/{chunk-5M6EUVNO.js → chunk-IRQRV552.js} +8 -2
  20. package/dist/chunk-IRQRV552.js.map +1 -0
  21. package/dist/{chunk-CXBQKY7F.js → chunk-KJHHSYGP.js} +14 -14
  22. package/dist/{chunk-PFWOM36E.js → chunk-MZ5NRW3K.js} +38 -17
  23. package/dist/{chunk-PFWOM36E.js.map → chunk-MZ5NRW3K.js.map} +1 -1
  24. package/dist/{chunk-BX2CTAJO.js → chunk-QFYYTAYD.js} +11 -11
  25. package/dist/{chunk-FDSMCFV5.js → chunk-UVTLZV34.js} +8 -10
  26. package/dist/chunk-UVTLZV34.js.map +1 -0
  27. package/dist/{chunk-Y3DJIMEN.js → chunk-XJLZK4QY.js} +3 -3
  28. package/dist/commonConstants.js +1 -1
  29. package/dist/commonSelectors.cjs +31 -0
  30. package/dist/commonSelectors.cjs.map +1 -1
  31. package/dist/commonSelectors.d.cts +147 -1
  32. package/dist/commonSelectors.d.ts +147 -1
  33. package/dist/commonSelectors.js +8 -6
  34. package/dist/constants.js +1 -1
  35. package/dist/deploymentsSlice/constants.js +1 -1
  36. package/dist/deploymentsSlice/index.js +1 -1
  37. package/dist/deploymentsSlice/mocks.js +1 -1
  38. package/dist/deploymentsSlice/selectors.js +1 -1
  39. package/dist/deploymentsSlice/thunks.cjs +42 -19
  40. package/dist/deploymentsSlice/thunks.cjs.map +1 -1
  41. package/dist/deploymentsSlice/thunks.js +18 -18
  42. package/dist/devicesSlice/constants.js +1 -1
  43. package/dist/devicesSlice/index.js +1 -1
  44. package/dist/devicesSlice/mocks.js +1 -1
  45. package/dist/devicesSlice/selectors.js +1 -1
  46. package/dist/devicesSlice/thunks.cjs +42 -19
  47. package/dist/devicesSlice/thunks.cjs.map +1 -1
  48. package/dist/devicesSlice/thunks.js +18 -18
  49. package/dist/liststatehook.js +1 -1
  50. package/dist/locationutils.js +1 -1
  51. package/dist/monitorSlice/index.js +1 -1
  52. package/dist/monitorSlice/mocks.js +1 -1
  53. package/dist/monitorSlice/thunks.cjs +32 -9
  54. package/dist/monitorSlice/thunks.cjs.map +1 -1
  55. package/dist/monitorSlice/thunks.js +15 -15
  56. package/dist/onboardingSlice/thunks.cjs +45 -22
  57. package/dist/onboardingSlice/thunks.cjs.map +1 -1
  58. package/dist/onboardingSlice/thunks.js +18 -18
  59. package/dist/organizationSlice/constants.js +1 -1
  60. package/dist/organizationSlice/index.js +1 -1
  61. package/dist/organizationSlice/mocks.js +1 -1
  62. package/dist/organizationSlice/selectors.js +1 -1
  63. package/dist/organizationSlice/thunks.cjs +50 -27
  64. package/dist/organizationSlice/thunks.cjs.map +1 -1
  65. package/dist/organizationSlice/thunks.js +18 -18
  66. package/dist/releasesSlice/index.js +1 -1
  67. package/dist/releasesSlice/mocks.js +1 -1
  68. package/dist/releasesSlice/selectors.js +1 -1
  69. package/dist/releasesSlice/thunks.cjs +32 -9
  70. package/dist/releasesSlice/thunks.cjs.map +1 -1
  71. package/dist/releasesSlice/thunks.js +15 -15
  72. package/dist/selectors.cjs +29 -0
  73. package/dist/selectors.cjs.map +1 -1
  74. package/dist/selectors.d.cts +1 -1
  75. package/dist/selectors.d.ts +1 -1
  76. package/dist/selectors.js +44 -42
  77. package/dist/sockethook.js +1 -1
  78. package/dist/store.cjs +7 -9
  79. package/dist/store.cjs.map +1 -1
  80. package/dist/store.js +8 -8
  81. package/dist/storehooks.cjs +60 -37
  82. package/dist/storehooks.cjs.map +1 -1
  83. package/dist/storehooks.js +20 -20
  84. package/dist/thunks.cjs +53 -30
  85. package/dist/thunks.cjs.map +1 -1
  86. package/dist/thunks.js +18 -18
  87. package/dist/useDeploymentDevice.cjs +42 -19
  88. package/dist/useDeploymentDevice.cjs.map +1 -1
  89. package/dist/useDeploymentDevice.js +18 -18
  90. package/dist/usersSlice/constants.js +1 -1
  91. package/dist/usersSlice/index.js +1 -1
  92. package/dist/usersSlice/mocks.js +1 -1
  93. package/dist/usersSlice/selectors.js +1 -1
  94. package/dist/usersSlice/thunks.cjs +42 -19
  95. package/dist/usersSlice/thunks.cjs.map +1 -1
  96. package/dist/usersSlice/thunks.js +18 -18
  97. package/dist/utils.js +1 -1
  98. package/package.json +1 -1
  99. package/dist/chunk-5M6EUVNO.js.map +0 -1
  100. package/dist/chunk-FDSMCFV5.js.map +0 -1
  101. /package/dist/{chunk-6UO33KLN.js.map → chunk-C3EMLDPU.js.map} +0 -0
  102. /package/dist/{chunk-EFFRZCDN.js.map → chunk-FUGCLQ5L.js.map} +0 -0
  103. /package/dist/{chunk-C5QK6HH6.js.map → chunk-GBXG2XBY.js.map} +0 -0
  104. /package/dist/{chunk-CXBQKY7F.js.map → chunk-KJHHSYGP.js.map} +0 -0
  105. /package/dist/{chunk-BX2CTAJO.js.map → chunk-QFYYTAYD.js.map} +0 -0
  106. /package/dist/{chunk-Y3DJIMEN.js.map → chunk-XJLZK4QY.js.map} +0 -0
@@ -1613,5 +1613,151 @@ declare const getRelevantRoles: ((state: {
1613
1613
  memoize: typeof reselect.weakMapMemoize;
1614
1614
  argsMemoize: typeof reselect.weakMapMemoize;
1615
1615
  };
1616
+ declare const getShowSecurityAlert: ((state: {
1617
+ app: AppSliceType;
1618
+ devices: DeviceSliceType;
1619
+ deployments: DeploymentsSliceType;
1620
+ monitor: MonitorSliceType;
1621
+ onboarding: OnboardingSliceType;
1622
+ organization: OrganizationSliceType;
1623
+ releases: ReleaseSliceType;
1624
+ users: UserSliceType;
1625
+ }) => boolean) & {
1626
+ clearCache: () => void;
1627
+ resultsCount: () => number;
1628
+ resetResultsCount: () => void;
1629
+ } & {
1630
+ resultFunc: (resultFuncArgs_0: User, resultFuncArgs_1: boolean, resultFuncArgs_2: Record<string, boolean>, resultFuncArgs_3: boolean, resultFuncArgs_4: boolean, resultFuncArgs_5: string | null) => boolean;
1631
+ memoizedResultFunc: ((resultFuncArgs_0: User, resultFuncArgs_1: boolean, resultFuncArgs_2: Record<string, boolean>, resultFuncArgs_3: boolean, resultFuncArgs_4: boolean, resultFuncArgs_5: string | null) => boolean) & {
1632
+ clearCache: () => void;
1633
+ resultsCount: () => number;
1634
+ resetResultsCount: () => void;
1635
+ };
1636
+ lastResult: () => boolean;
1637
+ dependencies: [((state: {
1638
+ app: AppSliceType;
1639
+ devices: DeviceSliceType;
1640
+ deployments: DeploymentsSliceType;
1641
+ monitor: MonitorSliceType;
1642
+ onboarding: OnboardingSliceType;
1643
+ organization: OrganizationSliceType;
1644
+ releases: ReleaseSliceType;
1645
+ users: UserSliceType;
1646
+ }) => User) & {
1647
+ clearCache: () => void;
1648
+ resultsCount: () => number;
1649
+ resetResultsCount: () => void;
1650
+ } & {
1651
+ resultFunc: (resultFuncArgs_0: Record<string, User>, resultFuncArgs_1: string | null) => User;
1652
+ memoizedResultFunc: ((resultFuncArgs_0: Record<string, User>, resultFuncArgs_1: string | null) => User) & {
1653
+ clearCache: () => void;
1654
+ resultsCount: () => number;
1655
+ resetResultsCount: () => void;
1656
+ };
1657
+ lastResult: () => User;
1658
+ dependencies: [(state: RootState) => Record<string, User>, (state: RootState) => string | null];
1659
+ recomputations: () => number;
1660
+ resetRecomputations: () => void;
1661
+ dependencyRecomputations: () => number;
1662
+ resetDependencyRecomputations: () => void;
1663
+ } & {
1664
+ memoize: typeof reselect.weakMapMemoize;
1665
+ argsMemoize: typeof reselect.weakMapMemoize;
1666
+ }, ((state: {
1667
+ app: AppSliceType;
1668
+ devices: DeviceSliceType;
1669
+ deployments: DeploymentsSliceType;
1670
+ monitor: MonitorSliceType;
1671
+ onboarding: OnboardingSliceType;
1672
+ organization: OrganizationSliceType;
1673
+ releases: ReleaseSliceType;
1674
+ users: UserSliceType;
1675
+ }) => boolean) & {
1676
+ clearCache: () => void;
1677
+ resultsCount: () => number;
1678
+ resetResultsCount: () => void;
1679
+ } & {
1680
+ resultFunc: (resultFuncArgs_0: User) => boolean;
1681
+ memoizedResultFunc: ((resultFuncArgs_0: User) => boolean) & {
1682
+ clearCache: () => void;
1683
+ resultsCount: () => number;
1684
+ resetResultsCount: () => void;
1685
+ };
1686
+ lastResult: () => boolean;
1687
+ dependencies: [((state: {
1688
+ app: AppSliceType;
1689
+ devices: DeviceSliceType;
1690
+ deployments: DeploymentsSliceType;
1691
+ monitor: MonitorSliceType;
1692
+ onboarding: OnboardingSliceType;
1693
+ organization: OrganizationSliceType;
1694
+ releases: ReleaseSliceType;
1695
+ users: UserSliceType;
1696
+ }) => User) & {
1697
+ clearCache: () => void;
1698
+ resultsCount: () => number;
1699
+ resetResultsCount: () => void;
1700
+ } & {
1701
+ resultFunc: (resultFuncArgs_0: Record<string, User>, resultFuncArgs_1: string | null) => User;
1702
+ memoizedResultFunc: ((resultFuncArgs_0: Record<string, User>, resultFuncArgs_1: string | null) => User) & {
1703
+ clearCache: () => void;
1704
+ resultsCount: () => number;
1705
+ resetResultsCount: () => void;
1706
+ };
1707
+ lastResult: () => User;
1708
+ dependencies: [(state: RootState) => Record<string, User>, (state: RootState) => string | null];
1709
+ recomputations: () => number;
1710
+ resetRecomputations: () => void;
1711
+ dependencyRecomputations: () => number;
1712
+ resetDependencyRecomputations: () => void;
1713
+ } & {
1714
+ memoize: typeof reselect.weakMapMemoize;
1715
+ argsMemoize: typeof reselect.weakMapMemoize;
1716
+ }];
1717
+ recomputations: () => number;
1718
+ resetRecomputations: () => void;
1719
+ dependencyRecomputations: () => number;
1720
+ resetDependencyRecomputations: () => void;
1721
+ } & {
1722
+ memoize: typeof reselect.weakMapMemoize;
1723
+ argsMemoize: typeof reselect.weakMapMemoize;
1724
+ }, (state: RootState) => Record<string, boolean>, ((state: {
1725
+ app: AppSliceType;
1726
+ devices: DeviceSliceType;
1727
+ deployments: DeploymentsSliceType;
1728
+ monitor: MonitorSliceType;
1729
+ onboarding: OnboardingSliceType;
1730
+ organization: OrganizationSliceType;
1731
+ releases: ReleaseSliceType;
1732
+ users: UserSliceType;
1733
+ }) => boolean) & {
1734
+ clearCache: () => void;
1735
+ resultsCount: () => number;
1736
+ resetResultsCount: () => void;
1737
+ } & {
1738
+ resultFunc: (resultFuncArgs_0: Partial<Organization>, resultFuncArgs_1: Record<string, boolean>) => boolean;
1739
+ memoizedResultFunc: ((resultFuncArgs_0: Partial<Organization>, resultFuncArgs_1: Record<string, boolean>) => boolean) & {
1740
+ clearCache: () => void;
1741
+ resultsCount: () => number;
1742
+ resetResultsCount: () => void;
1743
+ };
1744
+ lastResult: () => boolean;
1745
+ dependencies: [(state: RootState) => Partial<Organization>, (state: RootState) => Record<string, boolean>];
1746
+ recomputations: () => number;
1747
+ resetRecomputations: () => void;
1748
+ dependencyRecomputations: () => number;
1749
+ resetDependencyRecomputations: () => void;
1750
+ } & {
1751
+ memoize: typeof reselect.weakMapMemoize;
1752
+ argsMemoize: typeof reselect.weakMapMemoize;
1753
+ }, (state: RootState) => boolean, (state: RootState) => string | null];
1754
+ recomputations: () => number;
1755
+ resetRecomputations: () => void;
1756
+ dependencyRecomputations: () => number;
1757
+ resetDependencyRecomputations: () => void;
1758
+ } & {
1759
+ memoize: typeof reselect.weakMapMemoize;
1760
+ argsMemoize: typeof reselect.weakMapMemoize;
1761
+ };
1616
1762
 
1617
- export { getAttrsEndpoint, getAuditlogDevice, getAvailableIssueOptionsByType, getDemoDeviceAddress, getDeploymentRelease, getDeviceConfigDeployment, getDeviceReportsForUser, getFilterAttributes, getGroupNames, getIsEnterprise, getMappedDevicesList, getOnboardingState, getRelevantRoles, getSearchEndpoint, getSelectedDeploymentData, getTenantCapabilities, getUserCapabilities, getUserRoles };
1763
+ export { getAttrsEndpoint, getAuditlogDevice, getAvailableIssueOptionsByType, getDemoDeviceAddress, getDeploymentRelease, getDeviceConfigDeployment, getDeviceReportsForUser, getFilterAttributes, getGroupNames, getIsEnterprise, getMappedDevicesList, getOnboardingState, getRelevantRoles, getSearchEndpoint, getSelectedDeploymentData, getShowSecurityAlert, getTenantCapabilities, getUserCapabilities, getUserRoles };
@@ -1613,5 +1613,151 @@ declare const getRelevantRoles: ((state: {
1613
1613
  memoize: typeof reselect.weakMapMemoize;
1614
1614
  argsMemoize: typeof reselect.weakMapMemoize;
1615
1615
  };
1616
+ declare const getShowSecurityAlert: ((state: {
1617
+ app: AppSliceType;
1618
+ devices: DeviceSliceType;
1619
+ deployments: DeploymentsSliceType;
1620
+ monitor: MonitorSliceType;
1621
+ onboarding: OnboardingSliceType;
1622
+ organization: OrganizationSliceType;
1623
+ releases: ReleaseSliceType;
1624
+ users: UserSliceType;
1625
+ }) => boolean) & {
1626
+ clearCache: () => void;
1627
+ resultsCount: () => number;
1628
+ resetResultsCount: () => void;
1629
+ } & {
1630
+ resultFunc: (resultFuncArgs_0: User, resultFuncArgs_1: boolean, resultFuncArgs_2: Record<string, boolean>, resultFuncArgs_3: boolean, resultFuncArgs_4: boolean, resultFuncArgs_5: string | null) => boolean;
1631
+ memoizedResultFunc: ((resultFuncArgs_0: User, resultFuncArgs_1: boolean, resultFuncArgs_2: Record<string, boolean>, resultFuncArgs_3: boolean, resultFuncArgs_4: boolean, resultFuncArgs_5: string | null) => boolean) & {
1632
+ clearCache: () => void;
1633
+ resultsCount: () => number;
1634
+ resetResultsCount: () => void;
1635
+ };
1636
+ lastResult: () => boolean;
1637
+ dependencies: [((state: {
1638
+ app: AppSliceType;
1639
+ devices: DeviceSliceType;
1640
+ deployments: DeploymentsSliceType;
1641
+ monitor: MonitorSliceType;
1642
+ onboarding: OnboardingSliceType;
1643
+ organization: OrganizationSliceType;
1644
+ releases: ReleaseSliceType;
1645
+ users: UserSliceType;
1646
+ }) => User) & {
1647
+ clearCache: () => void;
1648
+ resultsCount: () => number;
1649
+ resetResultsCount: () => void;
1650
+ } & {
1651
+ resultFunc: (resultFuncArgs_0: Record<string, User>, resultFuncArgs_1: string | null) => User;
1652
+ memoizedResultFunc: ((resultFuncArgs_0: Record<string, User>, resultFuncArgs_1: string | null) => User) & {
1653
+ clearCache: () => void;
1654
+ resultsCount: () => number;
1655
+ resetResultsCount: () => void;
1656
+ };
1657
+ lastResult: () => User;
1658
+ dependencies: [(state: RootState) => Record<string, User>, (state: RootState) => string | null];
1659
+ recomputations: () => number;
1660
+ resetRecomputations: () => void;
1661
+ dependencyRecomputations: () => number;
1662
+ resetDependencyRecomputations: () => void;
1663
+ } & {
1664
+ memoize: typeof reselect.weakMapMemoize;
1665
+ argsMemoize: typeof reselect.weakMapMemoize;
1666
+ }, ((state: {
1667
+ app: AppSliceType;
1668
+ devices: DeviceSliceType;
1669
+ deployments: DeploymentsSliceType;
1670
+ monitor: MonitorSliceType;
1671
+ onboarding: OnboardingSliceType;
1672
+ organization: OrganizationSliceType;
1673
+ releases: ReleaseSliceType;
1674
+ users: UserSliceType;
1675
+ }) => boolean) & {
1676
+ clearCache: () => void;
1677
+ resultsCount: () => number;
1678
+ resetResultsCount: () => void;
1679
+ } & {
1680
+ resultFunc: (resultFuncArgs_0: User) => boolean;
1681
+ memoizedResultFunc: ((resultFuncArgs_0: User) => boolean) & {
1682
+ clearCache: () => void;
1683
+ resultsCount: () => number;
1684
+ resetResultsCount: () => void;
1685
+ };
1686
+ lastResult: () => boolean;
1687
+ dependencies: [((state: {
1688
+ app: AppSliceType;
1689
+ devices: DeviceSliceType;
1690
+ deployments: DeploymentsSliceType;
1691
+ monitor: MonitorSliceType;
1692
+ onboarding: OnboardingSliceType;
1693
+ organization: OrganizationSliceType;
1694
+ releases: ReleaseSliceType;
1695
+ users: UserSliceType;
1696
+ }) => User) & {
1697
+ clearCache: () => void;
1698
+ resultsCount: () => number;
1699
+ resetResultsCount: () => void;
1700
+ } & {
1701
+ resultFunc: (resultFuncArgs_0: Record<string, User>, resultFuncArgs_1: string | null) => User;
1702
+ memoizedResultFunc: ((resultFuncArgs_0: Record<string, User>, resultFuncArgs_1: string | null) => User) & {
1703
+ clearCache: () => void;
1704
+ resultsCount: () => number;
1705
+ resetResultsCount: () => void;
1706
+ };
1707
+ lastResult: () => User;
1708
+ dependencies: [(state: RootState) => Record<string, User>, (state: RootState) => string | null];
1709
+ recomputations: () => number;
1710
+ resetRecomputations: () => void;
1711
+ dependencyRecomputations: () => number;
1712
+ resetDependencyRecomputations: () => void;
1713
+ } & {
1714
+ memoize: typeof reselect.weakMapMemoize;
1715
+ argsMemoize: typeof reselect.weakMapMemoize;
1716
+ }];
1717
+ recomputations: () => number;
1718
+ resetRecomputations: () => void;
1719
+ dependencyRecomputations: () => number;
1720
+ resetDependencyRecomputations: () => void;
1721
+ } & {
1722
+ memoize: typeof reselect.weakMapMemoize;
1723
+ argsMemoize: typeof reselect.weakMapMemoize;
1724
+ }, (state: RootState) => Record<string, boolean>, ((state: {
1725
+ app: AppSliceType;
1726
+ devices: DeviceSliceType;
1727
+ deployments: DeploymentsSliceType;
1728
+ monitor: MonitorSliceType;
1729
+ onboarding: OnboardingSliceType;
1730
+ organization: OrganizationSliceType;
1731
+ releases: ReleaseSliceType;
1732
+ users: UserSliceType;
1733
+ }) => boolean) & {
1734
+ clearCache: () => void;
1735
+ resultsCount: () => number;
1736
+ resetResultsCount: () => void;
1737
+ } & {
1738
+ resultFunc: (resultFuncArgs_0: Partial<Organization>, resultFuncArgs_1: Record<string, boolean>) => boolean;
1739
+ memoizedResultFunc: ((resultFuncArgs_0: Partial<Organization>, resultFuncArgs_1: Record<string, boolean>) => boolean) & {
1740
+ clearCache: () => void;
1741
+ resultsCount: () => number;
1742
+ resetResultsCount: () => void;
1743
+ };
1744
+ lastResult: () => boolean;
1745
+ dependencies: [(state: RootState) => Partial<Organization>, (state: RootState) => Record<string, boolean>];
1746
+ recomputations: () => number;
1747
+ resetRecomputations: () => void;
1748
+ dependencyRecomputations: () => number;
1749
+ resetDependencyRecomputations: () => void;
1750
+ } & {
1751
+ memoize: typeof reselect.weakMapMemoize;
1752
+ argsMemoize: typeof reselect.weakMapMemoize;
1753
+ }, (state: RootState) => boolean, (state: RootState) => string | null];
1754
+ recomputations: () => number;
1755
+ resetRecomputations: () => void;
1756
+ dependencyRecomputations: () => number;
1757
+ resetDependencyRecomputations: () => void;
1758
+ } & {
1759
+ memoize: typeof reselect.weakMapMemoize;
1760
+ argsMemoize: typeof reselect.weakMapMemoize;
1761
+ };
1616
1762
 
1617
- export { getAttrsEndpoint, getAuditlogDevice, getAvailableIssueOptionsByType, getDemoDeviceAddress, getDeploymentRelease, getDeviceConfigDeployment, getDeviceReportsForUser, getFilterAttributes, getGroupNames, getIsEnterprise, getMappedDevicesList, getOnboardingState, getRelevantRoles, getSearchEndpoint, getSelectedDeploymentData, getTenantCapabilities, getUserCapabilities, getUserRoles };
1763
+ export { getAttrsEndpoint, getAuditlogDevice, getAvailableIssueOptionsByType, getDemoDeviceAddress, getDeploymentRelease, getDeviceConfigDeployment, getDeviceReportsForUser, getFilterAttributes, getGroupNames, getIsEnterprise, getMappedDevicesList, getOnboardingState, getRelevantRoles, getSearchEndpoint, getSelectedDeploymentData, getShowSecurityAlert, getTenantCapabilities, getUserCapabilities, getUserRoles };
@@ -14,23 +14,24 @@ import {
14
14
  getRelevantRoles,
15
15
  getSearchEndpoint,
16
16
  getSelectedDeploymentData,
17
+ getShowSecurityAlert,
17
18
  getTenantCapabilities,
18
19
  getUserCapabilities,
19
20
  getUserRoles
20
- } from "./chunk-PFWOM36E.js";
21
- import "./chunk-GEQ2QQEE.js";
21
+ } from "./chunk-MZ5NRW3K.js";
22
22
  import "./chunk-QL6FN2JC.js";
23
- import "./chunk-3NOV7X4M.js";
24
- import "./chunk-YO22XLHI.js";
25
- import "./chunk-JIS4PA3R.js";
26
23
  import "./chunk-O7DR57RN.js";
24
+ import "./chunk-GEQ2QQEE.js";
25
+ import "./chunk-JIS4PA3R.js";
26
+ import "./chunk-3NOV7X4M.js";
27
27
  import "./chunk-WR6RQKF5.js";
28
+ import "./chunk-YO22XLHI.js";
28
29
  import "./chunk-4BHM6WVX.js";
29
30
  import "./chunk-U5TPV5X5.js";
30
31
  import "./chunk-WWED74SG.js";
31
32
  import "./chunk-2DYA3X77.js";
32
- import "./chunk-FAJ3I2UQ.js";
33
33
  import "./chunk-ZKAH3APE.js";
34
+ import "./chunk-FAJ3I2UQ.js";
34
35
  import "./chunk-EL672W25.js";
35
36
  export {
36
37
  getAttrsEndpoint,
@@ -48,6 +49,7 @@ export {
48
49
  getRelevantRoles,
49
50
  getSearchEndpoint,
50
51
  getSelectedDeploymentData,
52
+ getShowSecurityAlert,
51
53
  getTenantCapabilities,
52
54
  getUserCapabilities,
53
55
  getUserRoles
package/dist/constants.js CHANGED
@@ -98,11 +98,11 @@ import {
98
98
  softwareIndicator,
99
99
  softwareTitleMap
100
100
  } from "./chunk-2DYA3X77.js";
101
+ import "./chunk-ZKAH3APE.js";
101
102
  import {
102
103
  onboardingSteps,
103
104
  orderedOnboardingSteps
104
105
  } from "./chunk-FAJ3I2UQ.js";
105
- import "./chunk-ZKAH3APE.js";
106
106
  import {
107
107
  ADDONS,
108
108
  BEGINNING_OF_TIME,
@@ -14,8 +14,8 @@ import {
14
14
  pauseMap
15
15
  } from "../chunk-WWED74SG.js";
16
16
  import "../chunk-2DYA3X77.js";
17
- import "../chunk-FAJ3I2UQ.js";
18
17
  import "../chunk-ZKAH3APE.js";
18
+ import "../chunk-FAJ3I2UQ.js";
19
19
  import "../chunk-EL672W25.js";
20
20
  export {
21
21
  DEFAULT_PENDING_INPROGRESS_COUNT,
@@ -7,8 +7,8 @@ import {
7
7
  } from "../chunk-OLKM53RL.js";
8
8
  import "../chunk-WWED74SG.js";
9
9
  import "../chunk-2DYA3X77.js";
10
- import "../chunk-FAJ3I2UQ.js";
11
10
  import "../chunk-ZKAH3APE.js";
11
+ import "../chunk-FAJ3I2UQ.js";
12
12
  import "../chunk-EL672W25.js";
13
13
  export {
14
14
  actions,
@@ -3,8 +3,8 @@ import {
3
3
  } from "../chunk-OLKM53RL.js";
4
4
  import "../chunk-WWED74SG.js";
5
5
  import "../chunk-2DYA3X77.js";
6
- import "../chunk-FAJ3I2UQ.js";
7
6
  import "../chunk-ZKAH3APE.js";
7
+ import "../chunk-FAJ3I2UQ.js";
8
8
  import "../chunk-EL672W25.js";
9
9
 
10
10
  // src/deploymentsSlice/mocks.ts
@@ -10,8 +10,8 @@ import {
10
10
  } from "../chunk-WR6RQKF5.js";
11
11
  import "../chunk-WWED74SG.js";
12
12
  import "../chunk-2DYA3X77.js";
13
- import "../chunk-FAJ3I2UQ.js";
14
13
  import "../chunk-ZKAH3APE.js";
14
+ import "../chunk-FAJ3I2UQ.js";
15
15
  import "../chunk-EL672W25.js";
16
16
  export {
17
17
  DEPLOYMENT_CUTOFF,
@@ -1707,6 +1707,7 @@ var actions_default = {
1707
1707
 
1708
1708
  // src/api/general-api.ts
1709
1709
  var import_axios = __toESM(require("axios"), 1);
1710
+ var import_universal_cookie2 = __toESM(require("universal-cookie"), 1);
1710
1711
 
1711
1712
  // src/auth.ts
1712
1713
  var import_universal_cookie = __toESM(require("universal-cookie"), 1);
@@ -1719,19 +1720,17 @@ var getSessionInfo = () => {
1719
1720
  sessionInfo = JSON.parse(window.localStorage.getItem("JWT") ?? "");
1720
1721
  } catch {
1721
1722
  }
1723
+ const jwtTokenFromCookie = cookies.get("JWT", { doNotParse: true }) ?? "";
1724
+ if (jwtTokenFromCookie) {
1725
+ setSessionInfo({ token: jwtTokenFromCookie });
1726
+ cookies.remove("JWT");
1727
+ cookies.remove("JWT", { path: "/" });
1728
+ return { token: jwtTokenFromCookie, expiresAt: void 0 };
1729
+ }
1722
1730
  if (sessionInfo.expiresAt && new Date(sessionInfo.expiresAt) < /* @__PURE__ */ new Date()) {
1723
1731
  cleanUp();
1724
1732
  return { ...emptySession };
1725
1733
  }
1726
- if (!sessionInfo.token) {
1727
- const jwtTokenFromCookie = cookies.get("JWT", { doNotParse: true }) ?? "";
1728
- if (jwtTokenFromCookie) {
1729
- setSessionInfo({ token: jwtTokenFromCookie });
1730
- sessionInfo.token = jwtTokenFromCookie;
1731
- cookies.remove("JWT");
1732
- cookies.remove("JWT", { path: "/" });
1733
- }
1734
- }
1735
1734
  sessionInfo.token = sessionInfo.token || "";
1736
1735
  tokenCache = sessionInfo.token;
1737
1736
  return sessionInfo;
@@ -1750,8 +1749,13 @@ var cleanUp = () => {
1750
1749
  };
1751
1750
 
1752
1751
  // src/api/general-api.ts
1752
+ var cookies2 = new import_universal_cookie2.default();
1753
1753
  var unauthorizedRedirect = (error) => {
1754
1754
  if (!(0, import_axios.isCancel)(error) && error.response?.status === 401 && getToken() && !window.location.pathname.endsWith("/subscription")) {
1755
+ if (cookies2.get("JWT", { doNotParse: true })) {
1756
+ window.location.reload();
1757
+ return Promise.reject(error);
1758
+ }
1755
1759
  cleanUp();
1756
1760
  window.location.replace("/ui/");
1757
1761
  }
@@ -1804,6 +1808,7 @@ var getIsPreview = (0, import_toolkit9.createSelector)([getFullVersionInformatio
1804
1808
  // src/commonSelectors.ts
1805
1809
  var import_helpers5 = require("@northern.tech/utils/helpers");
1806
1810
  var import_toolkit15 = require("@reduxjs/toolkit");
1811
+ var import_dayjs = __toESM(require("dayjs"), 1);
1807
1812
 
1808
1813
  // src/deploymentsSlice/selectors.ts
1809
1814
  var import_toolkit10 = require("@reduxjs/toolkit");
@@ -2162,6 +2167,7 @@ var emptyObject = {};
2162
2167
  var getRolesById = (state) => state.users.rolesById;
2163
2168
  var getTooltipsById = (state) => state.users.tooltips.byId;
2164
2169
  var getGlobalSettings = (state) => state.users.globalSettings;
2170
+ var getUserSettingsInitialized = (state) => state.users.userSettingsInitialized;
2165
2171
  var getCurrentUserId = (state) => state.users.currentUser;
2166
2172
  var getUsersById = (state) => state.users.byId;
2167
2173
  var getUsersList = (0, import_toolkit14.createSelector)([getUsersById], (usersById) => Object.values(usersById));
@@ -2199,6 +2205,7 @@ var getOfflineThresholdSettings = (0, import_toolkit14.createSelector)([getGloba
2199
2205
  intervalUnit: offlineThreshold?.intervalUnit || DEVICE_ONLINE_CUTOFF.intervalName
2200
2206
  }));
2201
2207
  var getRolesList = (0, import_toolkit14.createSelector)([getRolesById], (rolesById2) => Object.entries(rolesById2).map(([value, role]) => ({ value, ...role })));
2208
+ var getSecurityAlertDismissedTimestamp = (state) => state.users.userSettings.securityAlertDismissedTimestamp;
2202
2209
 
2203
2210
  // src/commonSelectors.ts
2204
2211
  var getIsEnterprise = (0, import_toolkit15.createSelector)(
@@ -2405,6 +2412,22 @@ var getRelevantRoles = (0, import_toolkit15.createSelector)([getOrganization, ge
2405
2412
  return accu;
2406
2413
  }, roles);
2407
2414
  });
2415
+ var getShowSecurityAlert = (0, import_toolkit15.createSelector)(
2416
+ [getCurrentUser, getHas2FA, getFeatures, getIsEnterprise, getUserSettingsInitialized, getSecurityAlertDismissedTimestamp],
2417
+ (currentUser, has2FA, features, isEnterprise, settingsInitialized, dismissedTimestamp) => {
2418
+ const isHosted = features?.isHosted;
2419
+ const canHave2FA = isEnterprise || isHosted;
2420
+ if (!currentUser || !settingsInitialized || has2FA || !canHave2FA) {
2421
+ return false;
2422
+ }
2423
+ if (dismissedTimestamp === null) {
2424
+ return true;
2425
+ }
2426
+ const today = (0, import_dayjs.default)();
2427
+ const dismissedMonthAgo = today.diff(dismissedTimestamp, "months");
2428
+ return dismissedMonthAgo > 0;
2429
+ }
2430
+ );
2408
2431
 
2409
2432
  // src/store.ts
2410
2433
  var import_react_redux = require("react-redux");
@@ -2502,10 +2525,10 @@ var createAppAsyncThunk = import_toolkit16.createAsyncThunk.withTypes();
2502
2525
 
2503
2526
  // src/appSlice/thunks.ts
2504
2527
  var import_helpers7 = require("@northern.tech/utils/helpers");
2505
- var import_universal_cookie2 = __toESM(require("universal-cookie"), 1);
2506
- var cookies2 = new import_universal_cookie2.default();
2528
+ var import_universal_cookie3 = __toESM(require("universal-cookie"), 1);
2529
+ var cookies3 = new import_universal_cookie3.default();
2507
2530
  var setFirstLoginAfterSignup = createAppAsyncThunk(`${sliceName2}/setFirstLoginAfterSignup`, (firstLoginAfterSignup, { dispatch }) => {
2508
- cookies2.set("firstLoginAfterSignup", !!firstLoginAfterSignup, { maxAge: 60, path: "/", domain: ".mender.io", sameSite: false });
2531
+ cookies3.set("firstLoginAfterSignup", !!firstLoginAfterSignup, { maxAge: 60, path: "/", domain: ".mender.io", sameSite: false });
2509
2532
  dispatch(actions2.setFirstLoginAfterSignup(!!firstLoginAfterSignup));
2510
2533
  });
2511
2534
  var dateFunctionMap = {
@@ -3556,9 +3579,9 @@ var changeNotificationSetting = createAppAsyncThunk(
3556
3579
  // src/usersSlice/thunks.ts
3557
3580
  var import_helpers9 = require("@northern.tech/utils/helpers");
3558
3581
  var import_retrytimer = require("@northern.tech/utils/retrytimer");
3559
- var import_dayjs = __toESM(require("dayjs"), 1);
3582
+ var import_dayjs2 = __toESM(require("dayjs"), 1);
3560
3583
  var import_md5 = __toESM(require("md5"), 1);
3561
- var import_universal_cookie3 = __toESM(require("universal-cookie"), 1);
3584
+ var import_universal_cookie4 = __toESM(require("universal-cookie"), 1);
3562
3585
 
3563
3586
  // src/api/users-api.ts
3564
3587
  var import_axios3 = __toESM(require("axios"), 1);
@@ -3575,7 +3598,7 @@ var Api2 = {
3575
3598
  var users_api_default = Api2;
3576
3599
 
3577
3600
  // src/usersSlice/thunks.ts
3578
- var cookies3 = new import_universal_cookie3.default();
3601
+ var cookies4 = new import_universal_cookie4.default();
3579
3602
  var { setAnnouncement, setSnackbar: setSnackbar3 } = actions_default;
3580
3603
  var handleLoginError = (err, { token2fa: has2FA, password }, rejectWithValue) => () => {
3581
3604
  const errorText = (0, import_helpers9.extractErrorMessage)(err);
@@ -3610,7 +3633,7 @@ var loginUser = createAppAsyncThunk(
3610
3633
  now.setSeconds(now.getSeconds() + import_constants5.maxSessionAge);
3611
3634
  const expiresAt = stayLoggedIn ? void 0 : now.toISOString();
3612
3635
  setSessionInfo({ token, expiresAt });
3613
- cookies3.remove("JWT", { path: "/" });
3636
+ cookies4.remove("JWT", { path: "/" });
3614
3637
  return dispatch(getUser(OWN_USER_ID)).unwrap().catch((e) => {
3615
3638
  cleanUp();
3616
3639
  return Promise.reject(dispatch(setSnackbar3((0, import_helpers9.extractErrorMessage)(e))));
@@ -4141,7 +4164,7 @@ var saveUserSettings = createAppAsyncThunk(
4141
4164
  const updatedSettings = {
4142
4165
  ...userSettings,
4143
4166
  ...settings,
4144
- firstLoginTimestamp: userSettings.firstLoginTimestamp ?? (0, import_dayjs.default)().format(),
4167
+ firstLoginTimestamp: userSettings.firstLoginTimestamp ?? (0, import_dayjs2.default)().format(),
4145
4168
  onboarding: {
4146
4169
  ...onboardingState,
4147
4170
  ...settings.onboarding
@@ -4165,9 +4188,9 @@ var setHideAnnouncement = createAppAsyncThunk(
4165
4188
  ({ shouldHide, userId }, { dispatch, getState }) => {
4166
4189
  const currentUserId = userId || getCurrentUser(getState()).id;
4167
4190
  const hash = getState().app.hostedAnnouncement ? (0, import_md5.default)(getState().app.hostedAnnouncement) : "";
4168
- const announceCookie = cookies3.get(`${currentUserId}${hash}`);
4191
+ const announceCookie = cookies4.get(`${currentUserId}${hash}`);
4169
4192
  if (shouldHide || hash.length && typeof announceCookie !== "undefined") {
4170
- cookies3.set(`${currentUserId}${hash}`, true, { maxAge: 604800 });
4193
+ cookies4.set(`${currentUserId}${hash}`, true, { maxAge: 604800 });
4171
4194
  dispatch(setAnnouncement(""));
4172
4195
  }
4173
4196
  }