@northern.tech/store 0.30.2 → 0.32.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 (197) hide show
  1. package/dist/actions.d.cts +16 -7
  2. package/dist/actions.d.ts +16 -7
  3. package/dist/api/general-api.cjs +2 -2
  4. package/dist/api/general-api.cjs.map +1 -1
  5. package/dist/api/general-api.js.map +1 -1
  6. package/dist/api/users-api.cjs +1 -1
  7. package/dist/api/users-api.cjs.map +1 -1
  8. package/dist/api/users-api.js.map +1 -1
  9. package/dist/appSlice/constants.cjs +6 -1
  10. package/dist/appSlice/constants.cjs.map +1 -1
  11. package/dist/appSlice/constants.d.cts +1 -1
  12. package/dist/appSlice/constants.d.ts +1 -1
  13. package/dist/appSlice/constants.js +7 -2
  14. package/dist/appSlice/constants.js.map +1 -1
  15. package/dist/appSlice/index.cjs.map +1 -1
  16. package/dist/appSlice/index.d.cts +1 -1
  17. package/dist/appSlice/index.d.ts +1 -1
  18. package/dist/appSlice/index.js.map +1 -1
  19. package/dist/appSlice/mocks.d.cts +1 -1
  20. package/dist/appSlice/mocks.d.ts +1 -1
  21. package/dist/appSlice/selectors.d.cts +7 -7
  22. package/dist/appSlice/selectors.d.ts +7 -7
  23. package/dist/appSlice/thunks.d.cts +2 -2
  24. package/dist/appSlice/thunks.d.ts +2 -2
  25. package/dist/auth.cjs +1 -1
  26. package/dist/auth.cjs.map +1 -1
  27. package/dist/auth.d.cts +1 -1
  28. package/dist/auth.d.ts +1 -1
  29. package/dist/auth.js.map +1 -1
  30. package/dist/commonConstants.d.cts +1 -1
  31. package/dist/commonConstants.d.ts +1 -1
  32. package/dist/commonSelectors.cjs +1 -1
  33. package/dist/commonSelectors.cjs.map +1 -1
  34. package/dist/commonSelectors.d.cts +10 -10
  35. package/dist/commonSelectors.d.ts +10 -10
  36. package/dist/commonSelectors.js.map +1 -1
  37. package/dist/{constants-DPLHhjVN.d.cts → constants-BFTS6mge.d.cts} +6 -1
  38. package/dist/{constants-C5AU0mCY.d.ts → constants-BIIEMVoG.d.ts} +6 -1
  39. package/dist/{constants-MPLfugsi.d.cts → constants-BrGIx40B.d.cts} +3 -3
  40. package/dist/{constants-DrwXHsJ1.d.ts → constants-CjO3_FOH.d.ts} +3 -3
  41. package/dist/constants.cjs +1 -0
  42. package/dist/constants.cjs.map +1 -1
  43. package/dist/constants.d.cts +3 -3
  44. package/dist/constants.d.ts +3 -3
  45. package/dist/constants.js +2 -2
  46. package/dist/constants.js.map +1 -1
  47. package/dist/deploymentsSlice/index.cjs.map +1 -1
  48. package/dist/deploymentsSlice/index.js.map +1 -1
  49. package/dist/deploymentsSlice/selectors.cjs.map +1 -1
  50. package/dist/deploymentsSlice/selectors.d.cts +7 -7
  51. package/dist/deploymentsSlice/selectors.d.ts +7 -7
  52. package/dist/deploymentsSlice/selectors.js.map +1 -1
  53. package/dist/deploymentsSlice/thunks.d.cts +4 -4
  54. package/dist/deploymentsSlice/thunks.d.ts +4 -4
  55. package/dist/devicesSlice/constants.d.cts +1 -1
  56. package/dist/devicesSlice/constants.d.ts +1 -1
  57. package/dist/devicesSlice/index.cjs.map +1 -1
  58. package/dist/devicesSlice/index.d.cts +1 -1
  59. package/dist/devicesSlice/index.d.ts +1 -1
  60. package/dist/devicesSlice/index.js.map +1 -1
  61. package/dist/devicesSlice/selectors.cjs.map +1 -1
  62. package/dist/devicesSlice/selectors.d.cts +7 -7
  63. package/dist/devicesSlice/selectors.d.ts +7 -7
  64. package/dist/devicesSlice/selectors.js.map +1 -1
  65. package/dist/devicesSlice/thunks.d.cts +4 -4
  66. package/dist/devicesSlice/thunks.d.ts +4 -4
  67. package/dist/{index-Lz5JsJ6O.d.cts → index-B64X5ozM.d.cts} +2 -2
  68. package/dist/{index-4eaLEXy_.d.cts → index-BFlHWzjv.d.cts} +2 -2
  69. package/dist/{index-DqyY6oZ3.d.ts → index-BI9O8JWe.d.ts} +2 -2
  70. package/dist/{index-Bwx9jEiL.d.cts → index-BbaS7MzW.d.cts} +2 -2
  71. package/dist/{index-Dv3Hfxk_.d.ts → index-Bp1WpATs.d.ts} +2 -2
  72. package/dist/{index-FyYBBeN-.d.cts → index-C-q632wO.d.cts} +41 -8
  73. package/dist/{index-DJSlDPRX.d.ts → index-C6wNUfiV.d.ts} +2 -2
  74. package/dist/{index-BEVkIiNa.d.cts → index-CT5hgXm9.d.cts} +2 -2
  75. package/dist/{index-Cvkvcz4r.d.ts → index-CyokFK2e.d.ts} +41 -8
  76. package/dist/{index-CO-py5d4.d.ts → index-DUvrw_Ed.d.ts} +2 -2
  77. package/dist/{index-CTt-eIY8.d.cts → index-DwACbyUg.d.cts} +2 -2
  78. package/dist/{index-DtePEQPT.d.ts → index-ez3oxfRo.d.ts} +2 -2
  79. package/dist/liststatehook.cjs +5 -3
  80. package/dist/liststatehook.cjs.map +1 -1
  81. package/dist/liststatehook.js +5 -3
  82. package/dist/liststatehook.js.map +1 -1
  83. package/dist/locationutils.cjs +3 -0
  84. package/dist/locationutils.cjs.map +1 -1
  85. package/dist/locationutils.d.cts +3 -2
  86. package/dist/locationutils.d.ts +3 -2
  87. package/dist/locationutils.js +3 -0
  88. package/dist/locationutils.js.map +1 -1
  89. package/dist/monitorSlice/constants.d.cts +1 -1
  90. package/dist/monitorSlice/constants.d.ts +1 -1
  91. package/dist/monitorSlice/index.cjs.map +1 -1
  92. package/dist/monitorSlice/index.d.cts +1 -1
  93. package/dist/monitorSlice/index.d.ts +1 -1
  94. package/dist/monitorSlice/index.js.map +1 -1
  95. package/dist/monitorSlice/mocks.cjs.map +1 -1
  96. package/dist/monitorSlice/mocks.d.cts +1 -1
  97. package/dist/monitorSlice/mocks.d.ts +1 -1
  98. package/dist/monitorSlice/mocks.js.map +1 -1
  99. package/dist/monitorSlice/selectors.d.cts +1 -1
  100. package/dist/monitorSlice/selectors.d.ts +1 -1
  101. package/dist/monitorSlice/thunks.cjs.map +1 -1
  102. package/dist/monitorSlice/thunks.d.cts +4 -4
  103. package/dist/monitorSlice/thunks.d.ts +4 -4
  104. package/dist/monitorSlice/thunks.js.map +1 -1
  105. package/dist/onboardingSlice/index.cjs.map +1 -1
  106. package/dist/onboardingSlice/index.js.map +1 -1
  107. package/dist/onboardingSlice/mocks.cjs.map +1 -1
  108. package/dist/onboardingSlice/selectors.d.cts +1 -1
  109. package/dist/onboardingSlice/selectors.d.ts +1 -1
  110. package/dist/onboardingSlice/thunks.d.cts +2 -2
  111. package/dist/onboardingSlice/thunks.d.ts +2 -2
  112. package/dist/organizationSlice/index.cjs.map +1 -1
  113. package/dist/organizationSlice/index.d.cts +1 -1
  114. package/dist/organizationSlice/index.d.ts +1 -1
  115. package/dist/organizationSlice/index.js.map +1 -1
  116. package/dist/organizationSlice/mocks.d.cts +2 -2
  117. package/dist/organizationSlice/mocks.d.ts +2 -2
  118. package/dist/organizationSlice/selectors.cjs.map +1 -1
  119. package/dist/organizationSlice/selectors.d.cts +8 -8
  120. package/dist/organizationSlice/selectors.d.ts +8 -8
  121. package/dist/organizationSlice/selectors.js.map +1 -1
  122. package/dist/organizationSlice/thunks.d.cts +5 -5
  123. package/dist/organizationSlice/thunks.d.ts +5 -5
  124. package/dist/organizationSlice/types.d.cts +1 -1
  125. package/dist/organizationSlice/types.d.ts +1 -1
  126. package/dist/releasesSlice/index.cjs +63 -2
  127. package/dist/releasesSlice/index.cjs.map +1 -1
  128. package/dist/releasesSlice/index.d.cts +2 -2
  129. package/dist/releasesSlice/index.d.ts +2 -2
  130. package/dist/releasesSlice/index.js +63 -2
  131. package/dist/releasesSlice/index.js.map +1 -1
  132. package/dist/releasesSlice/mocks.cjs +34 -0
  133. package/dist/releasesSlice/mocks.cjs.map +1 -1
  134. package/dist/releasesSlice/mocks.d.cts +44 -1
  135. package/dist/releasesSlice/mocks.d.ts +44 -1
  136. package/dist/releasesSlice/mocks.js +34 -0
  137. package/dist/releasesSlice/mocks.js.map +1 -1
  138. package/dist/releasesSlice/selectors.cjs +37 -5
  139. package/dist/releasesSlice/selectors.cjs.map +1 -1
  140. package/dist/releasesSlice/selectors.d.cts +403 -15
  141. package/dist/releasesSlice/selectors.d.ts +403 -15
  142. package/dist/releasesSlice/selectors.js +27 -6
  143. package/dist/releasesSlice/selectors.js.map +1 -1
  144. package/dist/releasesSlice/thunks.cjs +210 -2
  145. package/dist/releasesSlice/thunks.cjs.map +1 -1
  146. package/dist/releasesSlice/thunks.d.cts +144 -10
  147. package/dist/releasesSlice/thunks.d.ts +144 -10
  148. package/dist/releasesSlice/thunks.js +201 -4
  149. package/dist/releasesSlice/thunks.js.map +1 -1
  150. package/dist/selectors.cjs +11 -0
  151. package/dist/selectors.d.cts +2 -2
  152. package/dist/selectors.d.ts +2 -2
  153. package/dist/selectors.js +2 -2
  154. package/dist/sockethook.cjs +2 -2
  155. package/dist/sockethook.cjs.map +1 -1
  156. package/dist/sockethook.js.map +1 -1
  157. package/dist/{store-BQxOSRC1.d.ts → store-D-xvZXiY.d.ts} +7 -7
  158. package/dist/{store-BiIA0r0A.d.cts → store-b5cF2WB5.d.cts} +7 -7
  159. package/dist/store.cjs.map +1 -1
  160. package/dist/store.d.cts +2 -2
  161. package/dist/store.d.ts +2 -2
  162. package/dist/store.js.map +1 -1
  163. package/dist/storehooks.cjs +3 -3
  164. package/dist/storehooks.cjs.map +1 -1
  165. package/dist/storehooks.d.cts +2 -2
  166. package/dist/storehooks.d.ts +2 -2
  167. package/dist/storehooks.js.map +1 -1
  168. package/dist/thunks.cjs +22 -10
  169. package/dist/thunks.cjs.map +1 -1
  170. package/dist/thunks.d.cts +2 -2
  171. package/dist/thunks.d.ts +2 -2
  172. package/dist/thunks.js +8 -6
  173. package/dist/thunks.js.map +1 -1
  174. package/dist/{types-B2NRQLFw.d.ts → types-BPyM8Inu.d.ts} +3 -3
  175. package/dist/{types-ClEfo0dK.d.cts → types-COdPU2QQ.d.cts} +3 -3
  176. package/dist/useDeploymentDevice.cjs +1 -1
  177. package/dist/useDeploymentDevice.cjs.map +1 -1
  178. package/dist/useDeploymentDevice.js.map +1 -1
  179. package/dist/usersSlice/index.cjs.map +1 -1
  180. package/dist/usersSlice/index.d.cts +1 -1
  181. package/dist/usersSlice/index.d.ts +1 -1
  182. package/dist/usersSlice/index.js.map +1 -1
  183. package/dist/usersSlice/mocks.d.cts +1 -1
  184. package/dist/usersSlice/mocks.d.ts +1 -1
  185. package/dist/usersSlice/selectors.cjs.map +1 -1
  186. package/dist/usersSlice/selectors.d.cts +7 -7
  187. package/dist/usersSlice/selectors.d.ts +7 -7
  188. package/dist/usersSlice/selectors.js.map +1 -1
  189. package/dist/usersSlice/thunks.d.cts +4 -4
  190. package/dist/usersSlice/thunks.d.ts +4 -4
  191. package/dist/{utils-CO_CpGFP.d.ts → utils-CHBWS_tH.d.ts} +4 -4
  192. package/dist/{utils-CpPfqW0Q.d.cts → utils-Do9z5TL1.d.cts} +4 -4
  193. package/dist/utils.cjs.map +1 -1
  194. package/dist/utils.d.cts +1 -1
  195. package/dist/utils.d.ts +1 -1
  196. package/dist/utils.js.map +1 -1
  197. package/package.json +7 -7
@@ -1,12 +1,12 @@
1
- import { ct as AlertChannelKey, pt as DeviceAuthState } from "./constants-MPLfugsi.cjs";
1
+ import { lt as AlertChannelKey, mt as DeviceAuthState } from "./constants-BrGIx40B.cjs";
2
2
  import { i as ReadState } from "./constants-G3wymKIl.cjs";
3
- import { a as UserSettings, i as UserSession, n as GlobalSettings, r as User, t as CustomColumn } from "./index-4eaLEXy_.cjs";
4
- import { n as Release } from "./index-FyYBBeN-.cjs";
5
- import { d as TenantList, i as Organization, l as SSOConfig, n as AuditLogSelectionState, o as ProductConfig, r as Card } from "./types-ClEfo0dK.cjs";
3
+ import { a as UserSettings, i as UserSession, n as GlobalSettings, r as User, t as CustomColumn } from "./index-BFlHWzjv.cjs";
4
+ import { n as ManifestsList, r as Release } from "./index-C-q632wO.cjs";
5
+ import { d as TenantList, i as Organization, l as SSOConfig, n as AuditLogSelectionState, o as ProductConfig, r as Card } from "./types-COdPU2QQ.cjs";
6
6
  import { n as OnboardingSliceType, t as OnboardingApproach } from "./index-UPc3wvVd.cjs";
7
7
  import { i as DeploymentConfig, l as SelectionState, r as DeploymentByStatusKey, t as Deployment } from "./index-BP0uAq36.cjs";
8
- import { a as DeviceListState, n as DeviceFilter, r as DeviceGroup, t as Device } from "./index-Lz5JsJ6O.cjs";
9
- import { l as Upload, s as SnackbarContent } from "./index-CTt-eIY8.cjs";
8
+ import { a as DeviceListState, n as DeviceFilter, r as DeviceGroup, t as Device } from "./index-B64X5ozM.cjs";
9
+ import { l as Upload, s as SnackbarContent } from "./index-DwACbyUg.cjs";
10
10
  import * as _$_reduxjs_toolkit0 from "@reduxjs/toolkit";
11
11
  import * as _$_northern_tech_utils_constants0 from "@northern.tech/utils/constants";
12
12
  import * as _$_northern_tech_types_types_gen0 from "@northern.tech/types/types.gen";
@@ -41,7 +41,8 @@ declare const _default: {
41
41
  setShowStartupNotification: _$_reduxjs_toolkit0.ActionCreatorWithPayload<boolean, "users/setShowStartupNotification">;
42
42
  receiveRelease: _$_reduxjs_toolkit0.ActionCreatorWithPayload<Release, "releases/receiveRelease">;
43
43
  receiveReleases: _$_reduxjs_toolkit0.ActionCreatorWithPayload<Record<string, Release>, "releases/receiveReleases">;
44
- receiveReleaseTags: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string[], "releases/receiveReleaseTags">;
44
+ receiveSoftwareTags: _$_reduxjs_toolkit0.ActionCreatorWithPayload<_$_northern_tech_types_types_gen0.Tags, "releases/receiveSoftwareTags">;
45
+ receiveReleaseTags: _$_reduxjs_toolkit0.ActionCreatorWithPayload<_$_northern_tech_types_types_gen0.Tags, "releases/receiveReleaseTags">;
45
46
  receiveReleaseTypes: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string[], "releases/receiveReleaseTypes">;
46
47
  removeRelease: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string, "releases/removeRelease">;
47
48
  selectedRelease: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string | null, "releases/selectedRelease">;
@@ -50,6 +51,14 @@ declare const _default: {
50
51
  receivedDeltaJobDetails: _$_reduxjs_toolkit0.ActionCreatorWithPayload<any, "releases/receivedDeltaJobDetails">;
51
52
  setDeltaJobsListState: _$_reduxjs_toolkit0.ActionCreatorWithPayload<any, "releases/setDeltaJobsListState">;
52
53
  setSelectedJob: _$_reduxjs_toolkit0.ActionCreatorWithPayload<any, "releases/setSelectedJob">;
54
+ setActiveTab: _$_reduxjs_toolkit0.ActionCreatorWithPayload<"releases" | "delta" | "manifests", "releases/setActiveTab">;
55
+ receiveManifest: _$_reduxjs_toolkit0.ActionCreatorWithPayload<_$_northern_tech_types_types_gen0.Manifest, "releases/receiveManifest">;
56
+ receiveManifests: _$_reduxjs_toolkit0.ActionCreatorWithPayload<Record<string, _$_northern_tech_types_types_gen0.Manifest>, "releases/receiveManifests">;
57
+ receiveManifestTags: _$_reduxjs_toolkit0.ActionCreatorWithPayload<_$_northern_tech_types_types_gen0.Tags, "releases/receiveManifestTags">;
58
+ removeManifest: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string, "releases/removeManifest">;
59
+ removeManifests: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string[], "releases/removeManifests">;
60
+ selectedManifest: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string | null, "releases/selectedManifest">;
61
+ setManifestsListState: _$_reduxjs_toolkit0.ActionCreatorWithPayload<ManifestsList, "releases/setManifestsListState">;
53
62
  receiveAuditLogs: _$_reduxjs_toolkit0.ActionCreatorWithPayload<{
54
63
  events: _$_northern_tech_types_types_gen0.AuditLog[];
55
64
  total: number;
package/dist/actions.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import { ct as AlertChannelKey, pt as DeviceAuthState } from "./constants-DrwXHsJ1.js";
1
+ import { lt as AlertChannelKey, mt as DeviceAuthState } from "./constants-CjO3_FOH.js";
2
2
  import { i as ReadState } from "./constants-Cpgyuy_r.js";
3
- import { a as UserSettings, i as UserSession, n as GlobalSettings, r as User, t as CustomColumn } from "./index-DtePEQPT.js";
4
- import { n as Release } from "./index-Cvkvcz4r.js";
5
- import { d as TenantList, i as Organization, l as SSOConfig, n as AuditLogSelectionState, o as ProductConfig, r as Card } from "./types-B2NRQLFw.js";
3
+ import { a as UserSettings, i as UserSession, n as GlobalSettings, r as User, t as CustomColumn } from "./index-ez3oxfRo.js";
4
+ import { n as ManifestsList, r as Release } from "./index-CyokFK2e.js";
5
+ import { d as TenantList, i as Organization, l as SSOConfig, n as AuditLogSelectionState, o as ProductConfig, r as Card } from "./types-BPyM8Inu.js";
6
6
  import { n as OnboardingSliceType, t as OnboardingApproach } from "./index-CJkrL0oA.js";
7
7
  import { i as DeploymentConfig, l as SelectionState, r as DeploymentByStatusKey, t as Deployment } from "./index-CkwVnIqd.js";
8
- import { a as DeviceListState, n as DeviceFilter, r as DeviceGroup, t as Device } from "./index-DqyY6oZ3.js";
9
- import { l as Upload, s as SnackbarContent } from "./index-Dv3Hfxk_.js";
8
+ import { a as DeviceListState, n as DeviceFilter, r as DeviceGroup, t as Device } from "./index-BI9O8JWe.js";
9
+ import { l as Upload, s as SnackbarContent } from "./index-Bp1WpATs.js";
10
10
  import * as _$_reduxjs_toolkit0 from "@reduxjs/toolkit";
11
11
  import * as _$_northern_tech_utils_constants0 from "@northern.tech/utils/constants";
12
12
  import * as _$_northern_tech_types_types_gen0 from "@northern.tech/types/types.gen";
@@ -41,7 +41,8 @@ declare const _default: {
41
41
  setShowStartupNotification: _$_reduxjs_toolkit0.ActionCreatorWithPayload<boolean, "users/setShowStartupNotification">;
42
42
  receiveRelease: _$_reduxjs_toolkit0.ActionCreatorWithPayload<Release, "releases/receiveRelease">;
43
43
  receiveReleases: _$_reduxjs_toolkit0.ActionCreatorWithPayload<Record<string, Release>, "releases/receiveReleases">;
44
- receiveReleaseTags: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string[], "releases/receiveReleaseTags">;
44
+ receiveSoftwareTags: _$_reduxjs_toolkit0.ActionCreatorWithPayload<_$_northern_tech_types_types_gen0.Tags, "releases/receiveSoftwareTags">;
45
+ receiveReleaseTags: _$_reduxjs_toolkit0.ActionCreatorWithPayload<_$_northern_tech_types_types_gen0.Tags, "releases/receiveReleaseTags">;
45
46
  receiveReleaseTypes: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string[], "releases/receiveReleaseTypes">;
46
47
  removeRelease: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string, "releases/removeRelease">;
47
48
  selectedRelease: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string | null, "releases/selectedRelease">;
@@ -50,6 +51,14 @@ declare const _default: {
50
51
  receivedDeltaJobDetails: _$_reduxjs_toolkit0.ActionCreatorWithPayload<any, "releases/receivedDeltaJobDetails">;
51
52
  setDeltaJobsListState: _$_reduxjs_toolkit0.ActionCreatorWithPayload<any, "releases/setDeltaJobsListState">;
52
53
  setSelectedJob: _$_reduxjs_toolkit0.ActionCreatorWithPayload<any, "releases/setSelectedJob">;
54
+ setActiveTab: _$_reduxjs_toolkit0.ActionCreatorWithPayload<"releases" | "delta" | "manifests", "releases/setActiveTab">;
55
+ receiveManifest: _$_reduxjs_toolkit0.ActionCreatorWithPayload<_$_northern_tech_types_types_gen0.Manifest, "releases/receiveManifest">;
56
+ receiveManifests: _$_reduxjs_toolkit0.ActionCreatorWithPayload<Record<string, _$_northern_tech_types_types_gen0.Manifest>, "releases/receiveManifests">;
57
+ receiveManifestTags: _$_reduxjs_toolkit0.ActionCreatorWithPayload<_$_northern_tech_types_types_gen0.Tags, "releases/receiveManifestTags">;
58
+ removeManifest: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string, "releases/removeManifest">;
59
+ removeManifests: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string[], "releases/removeManifests">;
60
+ selectedManifest: _$_reduxjs_toolkit0.ActionCreatorWithPayload<string | null, "releases/selectedManifest">;
61
+ setManifestsListState: _$_reduxjs_toolkit0.ActionCreatorWithPayload<ManifestsList, "releases/setManifestsListState">;
53
62
  receiveAuditLogs: _$_reduxjs_toolkit0.ActionCreatorWithPayload<{
54
63
  events: _$_northern_tech_types_types_gen0.AuditLog[];
55
64
  total: number;
@@ -6,9 +6,9 @@ const require_chunk = require("../chunk-CKQMccvm.cjs");
6
6
  const require_constants = require("../constants.cjs");
7
7
  const require_auth = require("../auth.cjs");
8
8
  let universal_cookie = require("universal-cookie");
9
- universal_cookie = require_chunk.__toESM(universal_cookie);
9
+ universal_cookie = require_chunk.__toESM(universal_cookie, 1);
10
10
  let axios = require("axios");
11
- axios = require_chunk.__toESM(axios);
11
+ axios = require_chunk.__toESM(axios, 1);
12
12
  //#region src/api/general-api.ts
13
13
  const cookies = new universal_cookie.default();
14
14
  const unauthorizedRedirect = (error) => {
@@ -1 +1 @@
1
- {"version":3,"file":"general-api.cjs","names":["Cookies","getToken","TIMEOUTS"],"sources":["../../src/api/general-api.ts"],"sourcesContent":["// Copyright 2017 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { AxiosError, AxiosProgressEvent, AxiosRequestConfig, GenericAbortSignal, InternalAxiosRequestConfig } from 'axios';\nimport axios, { isCancel } from 'axios';\nimport Cookies from 'universal-cookie';\n\nimport { cleanUp, getToken } from '../auth';\nimport { TIMEOUTS } from '../constants';\n\nconst cookies = new Cookies();\n\nconst unauthorizedRedirect = (error: AxiosError): Promise<never> => {\n if (!isCancel(error) && error.response?.status === 401 && getToken() && !window.location.pathname.endsWith('/subscription')) {\n // a new jwt might have been set by sso while the current request was in-flight with an old token\n // => reload instead of logging out\n if (cookies.get('JWT', { doNotParse: true })) {\n window.location.reload();\n return Promise.reject(error);\n }\n cleanUp();\n window.location.replace('/ui/');\n }\n return Promise.reject(error);\n};\n\nexport const commonRequestConfig: AxiosRequestConfig = { timeout: TIMEOUTS.refreshDefault, headers: { 'Content-Type': 'application/json' } };\n\nexport const authenticatedRequest = axios.create(commonRequestConfig);\nauthenticatedRequest.interceptors.response.use(res => res, unauthorizedRedirect);\nauthenticatedRequest.interceptors.request.use(\n (config: InternalAxiosRequestConfig) => {\n config.headers.Authorization = `Bearer ${getToken()}`;\n return config;\n },\n (error: AxiosError) => Promise.reject(error)\n);\n\nconst Api = {\n get: authenticatedRequest.get,\n delete: <T = unknown, D = unknown>(url: string, data?: D) => authenticatedRequest.request<T>({ method: 'delete', url, data }),\n patch: authenticatedRequest.patch,\n post: authenticatedRequest.post,\n postUnauthorized: <T = unknown, D = unknown>(url: string, data?: D, config: AxiosRequestConfig = {}) =>\n axios.post<T>(url, data, { ...commonRequestConfig, ...config }),\n put: authenticatedRequest.put,\n upload: <T = unknown>(url: string, formData: FormData, progress: (event: AxiosProgressEvent) => void, cancelSignal: GenericAbortSignal) =>\n authenticatedRequest.post<T>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data' },\n onUploadProgress: progress,\n timeout: 0,\n signal: cancelSignal\n }),\n uploadPut: <T = unknown>(url: string, formData: FormData, progress: (event: AxiosProgressEvent) => void, cancelSignal: GenericAbortSignal) =>\n authenticatedRequest.put<T>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data' },\n onUploadProgress: progress,\n timeout: 0,\n signal: cancelSignal\n })\n};\n\nexport default Api;\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAM,UAAU,IAAIA,iBAAAA,SAAS;AAE7B,MAAM,wBAAwB,UAAsC;AAClE,KAAI,EAAA,GAAA,MAAA,UAAU,MAAM,IAAI,MAAM,UAAU,WAAW,OAAOC,aAAAA,UAAU,IAAI,CAAC,OAAO,SAAS,SAAS,SAAS,gBAAgB,EAAE;AAG3H,MAAI,QAAQ,IAAI,OAAO,EAAE,YAAY,MAAM,CAAC,EAAE;AAC5C,UAAO,SAAS,QAAQ;AACxB,UAAO,QAAQ,OAAO,MAAM;;AAE9B,eAAA,SAAS;AACT,SAAO,SAAS,QAAQ,OAAO;;AAEjC,QAAO,QAAQ,OAAO,MAAM;;AAG9B,MAAa,sBAA0C;CAAE,SAASC,kBAAAA,SAAS;CAAgB,SAAS,EAAE,gBAAgB,oBAAoB;CAAE;AAE5I,MAAa,uBAAuB,MAAA,QAAM,OAAO,oBAAoB;AACrE,qBAAqB,aAAa,SAAS,KAAI,QAAO,KAAK,qBAAqB;AAChF,qBAAqB,aAAa,QAAQ,KACvC,WAAuC;AACtC,QAAO,QAAQ,gBAAgB,UAAUD,aAAAA,UAAU;AACnD,QAAO;IAER,UAAsB,QAAQ,OAAO,MAAM,CAC7C;AAED,MAAM,MAAM;CACV,KAAK,qBAAqB;CAC1B,SAAmC,KAAa,SAAa,qBAAqB,QAAW;EAAE,QAAQ;EAAU;EAAK;EAAM,CAAC;CAC7H,OAAO,qBAAqB;CAC5B,MAAM,qBAAqB;CAC3B,mBAA6C,KAAa,MAAU,SAA6B,EAAE,KACjG,MAAA,QAAM,KAAQ,KAAK,MAAM;EAAE,GAAG;EAAqB,GAAG;EAAQ,CAAC;CACjE,KAAK,qBAAqB;CAC1B,SAAsB,KAAa,UAAoB,UAA+C,iBACpG,qBAAqB,KAAQ,KAAK,UAAU;EAC1C,SAAS,EAAE,gBAAgB,uBAAuB;EAClD,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACT,CAAC;CACJ,YAAyB,KAAa,UAAoB,UAA+C,iBACvG,qBAAqB,IAAO,KAAK,UAAU;EACzC,SAAS,EAAE,gBAAgB,uBAAuB;EAClD,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACT,CAAC;CACL"}
1
+ {"version":3,"file":"general-api.cjs","names":["Cookies","getToken","TIMEOUTS"],"sources":["../../src/api/general-api.ts"],"sourcesContent":["// Copyright 2017 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { AxiosError, AxiosProgressEvent, AxiosRequestConfig, GenericAbortSignal, InternalAxiosRequestConfig } from 'axios';\nimport axios, { isCancel } from 'axios';\nimport Cookies from 'universal-cookie';\n\nimport { cleanUp, getToken } from '../auth';\nimport { TIMEOUTS } from '../constants';\n\nconst cookies = new Cookies();\n\nconst unauthorizedRedirect = (error: AxiosError): Promise<never> => {\n if (!isCancel(error) && error.response?.status === 401 && getToken() && !window.location.pathname.endsWith('/subscription')) {\n // a new jwt might have been set by sso while the current request was in-flight with an old token\n // => reload instead of logging out\n if (cookies.get('JWT', { doNotParse: true })) {\n window.location.reload();\n return Promise.reject(error);\n }\n cleanUp();\n window.location.replace('/ui/');\n }\n return Promise.reject(error);\n};\n\nexport const commonRequestConfig: AxiosRequestConfig = { timeout: TIMEOUTS.refreshDefault, headers: { 'Content-Type': 'application/json' } };\n\nexport const authenticatedRequest = axios.create(commonRequestConfig);\nauthenticatedRequest.interceptors.response.use(res => res, unauthorizedRedirect);\nauthenticatedRequest.interceptors.request.use(\n (config: InternalAxiosRequestConfig) => {\n config.headers.Authorization = `Bearer ${getToken()}`;\n return config;\n },\n (error: AxiosError) => Promise.reject(error)\n);\n\nconst Api = {\n get: authenticatedRequest.get,\n delete: <T = unknown, D = unknown>(url: string, data?: D) => authenticatedRequest.request<T>({ method: 'delete', url, data }),\n patch: authenticatedRequest.patch,\n post: authenticatedRequest.post,\n postUnauthorized: <T = unknown, D = unknown>(url: string, data?: D, config: AxiosRequestConfig = {}) =>\n axios.post<T>(url, data, { ...commonRequestConfig, ...config }),\n put: authenticatedRequest.put,\n upload: <T = unknown>(url: string, formData: FormData, progress: (event: AxiosProgressEvent) => void, cancelSignal: GenericAbortSignal) =>\n authenticatedRequest.post<T>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data' },\n onUploadProgress: progress,\n timeout: 0,\n signal: cancelSignal\n }),\n uploadPut: <T = unknown>(url: string, formData: FormData, progress: (event: AxiosProgressEvent) => void, cancelSignal: GenericAbortSignal) =>\n authenticatedRequest.put<T>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data' },\n onUploadProgress: progress,\n timeout: 0,\n signal: cancelSignal\n })\n};\n\nexport default Api;\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAM,UAAU,IAAIA,iBAAAA,SAAS;AAE7B,MAAM,wBAAwB,UAAsC;CAClE,IAAI,EAAA,GAAA,MAAA,UAAU,MAAM,IAAI,MAAM,UAAU,WAAW,OAAOC,aAAAA,UAAU,IAAI,CAAC,OAAO,SAAS,SAAS,SAAS,gBAAgB,EAAE;EAG3H,IAAI,QAAQ,IAAI,OAAO,EAAE,YAAY,MAAM,CAAC,EAAE;GAC5C,OAAO,SAAS,QAAQ;GACxB,OAAO,QAAQ,OAAO,MAAM;;EAE9B,aAAA,SAAS;EACT,OAAO,SAAS,QAAQ,OAAO;;CAEjC,OAAO,QAAQ,OAAO,MAAM;;AAG9B,MAAa,sBAA0C;CAAE,SAASC,kBAAAA,SAAS;CAAgB,SAAS,EAAE,gBAAgB,oBAAoB;CAAE;AAE5I,MAAa,uBAAuB,MAAA,QAAM,OAAO,oBAAoB;AACrE,qBAAqB,aAAa,SAAS,KAAI,QAAO,KAAK,qBAAqB;AAChF,qBAAqB,aAAa,QAAQ,KACvC,WAAuC;CACtC,OAAO,QAAQ,gBAAgB,UAAUD,aAAAA,UAAU;CACnD,OAAO;IAER,UAAsB,QAAQ,OAAO,MAAM,CAC7C;AAED,MAAM,MAAM;CACV,KAAK,qBAAqB;CAC1B,SAAmC,KAAa,SAAa,qBAAqB,QAAW;EAAE,QAAQ;EAAU;EAAK;EAAM,CAAC;CAC7H,OAAO,qBAAqB;CAC5B,MAAM,qBAAqB;CAC3B,mBAA6C,KAAa,MAAU,SAA6B,EAAE,KACjG,MAAA,QAAM,KAAQ,KAAK,MAAM;EAAE,GAAG;EAAqB,GAAG;EAAQ,CAAC;CACjE,KAAK,qBAAqB;CAC1B,SAAsB,KAAa,UAAoB,UAA+C,iBACpG,qBAAqB,KAAQ,KAAK,UAAU;EAC1C,SAAS,EAAE,gBAAgB,uBAAuB;EAClD,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACT,CAAC;CACJ,YAAyB,KAAa,UAAoB,UAA+C,iBACvG,qBAAqB,IAAO,KAAK,UAAU;EACzC,SAAS,EAAE,gBAAgB,uBAAuB;EAClD,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACT,CAAC;CACL"}
@@ -1 +1 @@
1
- {"version":3,"file":"general-api.js","names":[],"sources":["../../src/api/general-api.ts"],"sourcesContent":["// Copyright 2017 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { AxiosError, AxiosProgressEvent, AxiosRequestConfig, GenericAbortSignal, InternalAxiosRequestConfig } from 'axios';\nimport axios, { isCancel } from 'axios';\nimport Cookies from 'universal-cookie';\n\nimport { cleanUp, getToken } from '../auth';\nimport { TIMEOUTS } from '../constants';\n\nconst cookies = new Cookies();\n\nconst unauthorizedRedirect = (error: AxiosError): Promise<never> => {\n if (!isCancel(error) && error.response?.status === 401 && getToken() && !window.location.pathname.endsWith('/subscription')) {\n // a new jwt might have been set by sso while the current request was in-flight with an old token\n // => reload instead of logging out\n if (cookies.get('JWT', { doNotParse: true })) {\n window.location.reload();\n return Promise.reject(error);\n }\n cleanUp();\n window.location.replace('/ui/');\n }\n return Promise.reject(error);\n};\n\nexport const commonRequestConfig: AxiosRequestConfig = { timeout: TIMEOUTS.refreshDefault, headers: { 'Content-Type': 'application/json' } };\n\nexport const authenticatedRequest = axios.create(commonRequestConfig);\nauthenticatedRequest.interceptors.response.use(res => res, unauthorizedRedirect);\nauthenticatedRequest.interceptors.request.use(\n (config: InternalAxiosRequestConfig) => {\n config.headers.Authorization = `Bearer ${getToken()}`;\n return config;\n },\n (error: AxiosError) => Promise.reject(error)\n);\n\nconst Api = {\n get: authenticatedRequest.get,\n delete: <T = unknown, D = unknown>(url: string, data?: D) => authenticatedRequest.request<T>({ method: 'delete', url, data }),\n patch: authenticatedRequest.patch,\n post: authenticatedRequest.post,\n postUnauthorized: <T = unknown, D = unknown>(url: string, data?: D, config: AxiosRequestConfig = {}) =>\n axios.post<T>(url, data, { ...commonRequestConfig, ...config }),\n put: authenticatedRequest.put,\n upload: <T = unknown>(url: string, formData: FormData, progress: (event: AxiosProgressEvent) => void, cancelSignal: GenericAbortSignal) =>\n authenticatedRequest.post<T>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data' },\n onUploadProgress: progress,\n timeout: 0,\n signal: cancelSignal\n }),\n uploadPut: <T = unknown>(url: string, formData: FormData, progress: (event: AxiosProgressEvent) => void, cancelSignal: GenericAbortSignal) =>\n authenticatedRequest.put<T>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data' },\n onUploadProgress: progress,\n timeout: 0,\n signal: cancelSignal\n })\n};\n\nexport default Api;\n"],"mappings":";;;;;AAoBA,MAAM,UAAU,IAAI,SAAS;AAE7B,MAAM,wBAAwB,UAAsC;AAClE,KAAI,CAAC,SAAS,MAAM,IAAI,MAAM,UAAU,WAAW,OAAO,UAAU,IAAI,CAAC,OAAO,SAAS,SAAS,SAAS,gBAAgB,EAAE;AAG3H,MAAI,QAAQ,IAAI,OAAO,EAAE,YAAY,MAAM,CAAC,EAAE;AAC5C,UAAO,SAAS,QAAQ;AACxB,UAAO,QAAQ,OAAO,MAAM;;AAE9B,WAAS;AACT,SAAO,SAAS,QAAQ,OAAO;;AAEjC,QAAO,QAAQ,OAAO,MAAM;;AAG9B,MAAa,sBAA0C;CAAE,SAAS,SAAS;CAAgB,SAAS,EAAE,gBAAgB,oBAAoB;CAAE;AAE5I,MAAa,uBAAuB,MAAM,OAAO,oBAAoB;AACrE,qBAAqB,aAAa,SAAS,KAAI,QAAO,KAAK,qBAAqB;AAChF,qBAAqB,aAAa,QAAQ,KACvC,WAAuC;AACtC,QAAO,QAAQ,gBAAgB,UAAU,UAAU;AACnD,QAAO;IAER,UAAsB,QAAQ,OAAO,MAAM,CAC7C;AAED,MAAM,MAAM;CACV,KAAK,qBAAqB;CAC1B,SAAmC,KAAa,SAAa,qBAAqB,QAAW;EAAE,QAAQ;EAAU;EAAK;EAAM,CAAC;CAC7H,OAAO,qBAAqB;CAC5B,MAAM,qBAAqB;CAC3B,mBAA6C,KAAa,MAAU,SAA6B,EAAE,KACjG,MAAM,KAAQ,KAAK,MAAM;EAAE,GAAG;EAAqB,GAAG;EAAQ,CAAC;CACjE,KAAK,qBAAqB;CAC1B,SAAsB,KAAa,UAAoB,UAA+C,iBACpG,qBAAqB,KAAQ,KAAK,UAAU;EAC1C,SAAS,EAAE,gBAAgB,uBAAuB;EAClD,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACT,CAAC;CACJ,YAAyB,KAAa,UAAoB,UAA+C,iBACvG,qBAAqB,IAAO,KAAK,UAAU;EACzC,SAAS,EAAE,gBAAgB,uBAAuB;EAClD,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACT,CAAC;CACL"}
1
+ {"version":3,"file":"general-api.js","names":[],"sources":["../../src/api/general-api.ts"],"sourcesContent":["// Copyright 2017 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { AxiosError, AxiosProgressEvent, AxiosRequestConfig, GenericAbortSignal, InternalAxiosRequestConfig } from 'axios';\nimport axios, { isCancel } from 'axios';\nimport Cookies from 'universal-cookie';\n\nimport { cleanUp, getToken } from '../auth';\nimport { TIMEOUTS } from '../constants';\n\nconst cookies = new Cookies();\n\nconst unauthorizedRedirect = (error: AxiosError): Promise<never> => {\n if (!isCancel(error) && error.response?.status === 401 && getToken() && !window.location.pathname.endsWith('/subscription')) {\n // a new jwt might have been set by sso while the current request was in-flight with an old token\n // => reload instead of logging out\n if (cookies.get('JWT', { doNotParse: true })) {\n window.location.reload();\n return Promise.reject(error);\n }\n cleanUp();\n window.location.replace('/ui/');\n }\n return Promise.reject(error);\n};\n\nexport const commonRequestConfig: AxiosRequestConfig = { timeout: TIMEOUTS.refreshDefault, headers: { 'Content-Type': 'application/json' } };\n\nexport const authenticatedRequest = axios.create(commonRequestConfig);\nauthenticatedRequest.interceptors.response.use(res => res, unauthorizedRedirect);\nauthenticatedRequest.interceptors.request.use(\n (config: InternalAxiosRequestConfig) => {\n config.headers.Authorization = `Bearer ${getToken()}`;\n return config;\n },\n (error: AxiosError) => Promise.reject(error)\n);\n\nconst Api = {\n get: authenticatedRequest.get,\n delete: <T = unknown, D = unknown>(url: string, data?: D) => authenticatedRequest.request<T>({ method: 'delete', url, data }),\n patch: authenticatedRequest.patch,\n post: authenticatedRequest.post,\n postUnauthorized: <T = unknown, D = unknown>(url: string, data?: D, config: AxiosRequestConfig = {}) =>\n axios.post<T>(url, data, { ...commonRequestConfig, ...config }),\n put: authenticatedRequest.put,\n upload: <T = unknown>(url: string, formData: FormData, progress: (event: AxiosProgressEvent) => void, cancelSignal: GenericAbortSignal) =>\n authenticatedRequest.post<T>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data' },\n onUploadProgress: progress,\n timeout: 0,\n signal: cancelSignal\n }),\n uploadPut: <T = unknown>(url: string, formData: FormData, progress: (event: AxiosProgressEvent) => void, cancelSignal: GenericAbortSignal) =>\n authenticatedRequest.put<T>(url, formData, {\n headers: { 'Content-Type': 'multipart/form-data' },\n onUploadProgress: progress,\n timeout: 0,\n signal: cancelSignal\n })\n};\n\nexport default Api;\n"],"mappings":";;;;;AAoBA,MAAM,UAAU,IAAI,SAAS;AAE7B,MAAM,wBAAwB,UAAsC;CAClE,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,UAAU,WAAW,OAAO,UAAU,IAAI,CAAC,OAAO,SAAS,SAAS,SAAS,gBAAgB,EAAE;EAG3H,IAAI,QAAQ,IAAI,OAAO,EAAE,YAAY,MAAM,CAAC,EAAE;GAC5C,OAAO,SAAS,QAAQ;GACxB,OAAO,QAAQ,OAAO,MAAM;;EAE9B,SAAS;EACT,OAAO,SAAS,QAAQ,OAAO;;CAEjC,OAAO,QAAQ,OAAO,MAAM;;AAG9B,MAAa,sBAA0C;CAAE,SAAS,SAAS;CAAgB,SAAS,EAAE,gBAAgB,oBAAoB;CAAE;AAE5I,MAAa,uBAAuB,MAAM,OAAO,oBAAoB;AACrE,qBAAqB,aAAa,SAAS,KAAI,QAAO,KAAK,qBAAqB;AAChF,qBAAqB,aAAa,QAAQ,KACvC,WAAuC;CACtC,OAAO,QAAQ,gBAAgB,UAAU,UAAU;CACnD,OAAO;IAER,UAAsB,QAAQ,OAAO,MAAM,CAC7C;AAED,MAAM,MAAM;CACV,KAAK,qBAAqB;CAC1B,SAAmC,KAAa,SAAa,qBAAqB,QAAW;EAAE,QAAQ;EAAU;EAAK;EAAM,CAAC;CAC7H,OAAO,qBAAqB;CAC5B,MAAM,qBAAqB;CAC3B,mBAA6C,KAAa,MAAU,SAA6B,EAAE,KACjG,MAAM,KAAQ,KAAK,MAAM;EAAE,GAAG;EAAqB,GAAG;EAAQ,CAAC;CACjE,KAAK,qBAAqB;CAC1B,SAAsB,KAAa,UAAoB,UAA+C,iBACpG,qBAAqB,KAAQ,KAAK,UAAU;EAC1C,SAAS,EAAE,gBAAgB,uBAAuB;EAClD,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACT,CAAC;CACJ,YAAyB,KAAa,UAAoB,UAA+C,iBACvG,qBAAqB,IAAO,KAAK,UAAU;EACzC,SAAS,EAAE,gBAAgB,uBAAuB;EAClD,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACT,CAAC;CACL"}
@@ -2,7 +2,7 @@ const require_chunk = require("../chunk-CKQMccvm.cjs");
2
2
  const require_auth = require("../auth.cjs");
3
3
  const require_api_general_api = require("./general-api.cjs");
4
4
  let axios = require("axios");
5
- axios = require_chunk.__toESM(axios);
5
+ axios = require_chunk.__toESM(axios, 1);
6
6
  //#region src/api/users-api.ts
7
7
  const Api = {
8
8
  postLogin: (url, { email: username, password = "", ...body }) => axios.default.post(url, body, {
@@ -1 +1 @@
1
- {"version":3,"file":"users-api.cjs","names":["commonRequestConfig","getToken"],"sources":["../../src/api/users-api.ts"],"sourcesContent":["// Copyright 2016 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { LoginOptions } from '@northern.tech/types/MenderTypes';\nimport axios from 'axios';\n\nimport { getToken } from '../auth';\nimport { commonRequestConfig } from './general-api';\n\ntype PostLoginBody = LoginOptions & {\n email: string;\n password?: string;\n};\n\ntype VerifyTFAData = Pick<LoginOptions, 'token2fa'>;\n\nconst Api = {\n postLogin: (url: string, { email: username, password = '', ...body }: PostLoginBody) =>\n axios\n .post(url, body, { ...commonRequestConfig, auth: { username, password } })\n .then(res => ({ text: res.data as string, code: res.status, contentType: res.headers?.['content-type'] as string | undefined })),\n putVerifyTFA: (url: string, userData: VerifyTFAData) => {\n let body: VerifyTFAData = {};\n if (Object.hasOwn(userData, 'token2fa')) {\n body = { token2fa: userData.token2fa };\n }\n return axios.put(url, body, { ...commonRequestConfig, headers: { ...commonRequestConfig.headers, Authorization: `Bearer ${getToken()}` } });\n }\n};\n\nexport default Api;\n"],"mappings":";;;;;;AA0BA,MAAM,MAAM;CACV,YAAY,KAAa,EAAE,OAAO,UAAU,WAAW,IAAI,GAAG,WAC5D,MAAA,QACG,KAAK,KAAK,MAAM;EAAE,GAAGA,wBAAAA;EAAqB,MAAM;GAAE;GAAU;GAAU;EAAE,CAAC,CACzE,MAAK,SAAQ;EAAE,MAAM,IAAI;EAAgB,MAAM,IAAI;EAAQ,aAAa,IAAI,UAAU;EAAuC,EAAE;CACpI,eAAe,KAAa,aAA4B;EACtD,IAAI,OAAsB,EAAE;AAC5B,MAAI,OAAO,OAAO,UAAU,WAAW,CACrC,QAAO,EAAE,UAAU,SAAS,UAAU;AAExC,SAAO,MAAA,QAAM,IAAI,KAAK,MAAM;GAAE,GAAGA,wBAAAA;GAAqB,SAAS;IAAE,GAAGA,wBAAAA,oBAAoB;IAAS,eAAe,UAAUC,aAAAA,UAAU;IAAI;GAAE,CAAC;;CAE9I"}
1
+ {"version":3,"file":"users-api.cjs","names":["commonRequestConfig","getToken"],"sources":["../../src/api/users-api.ts"],"sourcesContent":["// Copyright 2016 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { LoginOptions } from '@northern.tech/types/MenderTypes';\nimport axios from 'axios';\n\nimport { getToken } from '../auth';\nimport { commonRequestConfig } from './general-api';\n\ntype PostLoginBody = LoginOptions & {\n email: string;\n password?: string;\n};\n\ntype VerifyTFAData = Pick<LoginOptions, 'token2fa'>;\n\nconst Api = {\n postLogin: (url: string, { email: username, password = '', ...body }: PostLoginBody) =>\n axios\n .post(url, body, { ...commonRequestConfig, auth: { username, password } })\n .then(res => ({ text: res.data as string, code: res.status, contentType: res.headers?.['content-type'] as string | undefined })),\n putVerifyTFA: (url: string, userData: VerifyTFAData) => {\n let body: VerifyTFAData = {};\n if (Object.hasOwn(userData, 'token2fa')) {\n body = { token2fa: userData.token2fa };\n }\n return axios.put(url, body, { ...commonRequestConfig, headers: { ...commonRequestConfig.headers, Authorization: `Bearer ${getToken()}` } });\n }\n};\n\nexport default Api;\n"],"mappings":";;;;;;AA0BA,MAAM,MAAM;CACV,YAAY,KAAa,EAAE,OAAO,UAAU,WAAW,IAAI,GAAG,WAC5D,MAAA,QACG,KAAK,KAAK,MAAM;EAAE,GAAGA,wBAAAA;EAAqB,MAAM;GAAE;GAAU;GAAU;EAAE,CAAC,CACzE,MAAK,SAAQ;EAAE,MAAM,IAAI;EAAgB,MAAM,IAAI;EAAQ,aAAa,IAAI,UAAU;EAAuC,EAAE;CACpI,eAAe,KAAa,aAA4B;EACtD,IAAI,OAAsB,EAAE;EAC5B,IAAI,OAAO,OAAO,UAAU,WAAW,EACrC,OAAO,EAAE,UAAU,SAAS,UAAU;EAExC,OAAO,MAAA,QAAM,IAAI,KAAK,MAAM;GAAE,GAAGA,wBAAAA;GAAqB,SAAS;IAAE,GAAGA,wBAAAA,oBAAoB;IAAS,eAAe,UAAUC,aAAAA,UAAU;IAAI;GAAE,CAAC;;CAE9I"}
@@ -1 +1 @@
1
- {"version":3,"file":"users-api.js","names":[],"sources":["../../src/api/users-api.ts"],"sourcesContent":["// Copyright 2016 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { LoginOptions } from '@northern.tech/types/MenderTypes';\nimport axios from 'axios';\n\nimport { getToken } from '../auth';\nimport { commonRequestConfig } from './general-api';\n\ntype PostLoginBody = LoginOptions & {\n email: string;\n password?: string;\n};\n\ntype VerifyTFAData = Pick<LoginOptions, 'token2fa'>;\n\nconst Api = {\n postLogin: (url: string, { email: username, password = '', ...body }: PostLoginBody) =>\n axios\n .post(url, body, { ...commonRequestConfig, auth: { username, password } })\n .then(res => ({ text: res.data as string, code: res.status, contentType: res.headers?.['content-type'] as string | undefined })),\n putVerifyTFA: (url: string, userData: VerifyTFAData) => {\n let body: VerifyTFAData = {};\n if (Object.hasOwn(userData, 'token2fa')) {\n body = { token2fa: userData.token2fa };\n }\n return axios.put(url, body, { ...commonRequestConfig, headers: { ...commonRequestConfig.headers, Authorization: `Bearer ${getToken()}` } });\n }\n};\n\nexport default Api;\n"],"mappings":";;;;AA0BA,MAAM,MAAM;CACV,YAAY,KAAa,EAAE,OAAO,UAAU,WAAW,IAAI,GAAG,WAC5D,MACG,KAAK,KAAK,MAAM;EAAE,GAAG;EAAqB,MAAM;GAAE;GAAU;GAAU;EAAE,CAAC,CACzE,MAAK,SAAQ;EAAE,MAAM,IAAI;EAAgB,MAAM,IAAI;EAAQ,aAAa,IAAI,UAAU;EAAuC,EAAE;CACpI,eAAe,KAAa,aAA4B;EACtD,IAAI,OAAsB,EAAE;AAC5B,MAAI,OAAO,OAAO,UAAU,WAAW,CACrC,QAAO,EAAE,UAAU,SAAS,UAAU;AAExC,SAAO,MAAM,IAAI,KAAK,MAAM;GAAE,GAAG;GAAqB,SAAS;IAAE,GAAG,oBAAoB;IAAS,eAAe,UAAU,UAAU;IAAI;GAAE,CAAC;;CAE9I"}
1
+ {"version":3,"file":"users-api.js","names":[],"sources":["../../src/api/users-api.ts"],"sourcesContent":["// Copyright 2016 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { LoginOptions } from '@northern.tech/types/MenderTypes';\nimport axios from 'axios';\n\nimport { getToken } from '../auth';\nimport { commonRequestConfig } from './general-api';\n\ntype PostLoginBody = LoginOptions & {\n email: string;\n password?: string;\n};\n\ntype VerifyTFAData = Pick<LoginOptions, 'token2fa'>;\n\nconst Api = {\n postLogin: (url: string, { email: username, password = '', ...body }: PostLoginBody) =>\n axios\n .post(url, body, { ...commonRequestConfig, auth: { username, password } })\n .then(res => ({ text: res.data as string, code: res.status, contentType: res.headers?.['content-type'] as string | undefined })),\n putVerifyTFA: (url: string, userData: VerifyTFAData) => {\n let body: VerifyTFAData = {};\n if (Object.hasOwn(userData, 'token2fa')) {\n body = { token2fa: userData.token2fa };\n }\n return axios.put(url, body, { ...commonRequestConfig, headers: { ...commonRequestConfig.headers, Authorization: `Bearer ${getToken()}` } });\n }\n};\n\nexport default Api;\n"],"mappings":";;;;AA0BA,MAAM,MAAM;CACV,YAAY,KAAa,EAAE,OAAO,UAAU,WAAW,IAAI,GAAG,WAC5D,MACG,KAAK,KAAK,MAAM;EAAE,GAAG;EAAqB,MAAM;GAAE;GAAU;GAAU;EAAE,CAAC,CACzE,MAAK,SAAQ;EAAE,MAAM,IAAI;EAAgB,MAAM,IAAI;EAAQ,aAAa,IAAI,UAAU;EAAuC,EAAE;CACpI,eAAe,KAAa,aAA4B;EACtD,IAAI,OAAsB,EAAE;EAC5B,IAAI,OAAO,OAAO,UAAU,WAAW,EACrC,OAAO,EAAE,UAAU,SAAS,UAAU;EAExC,OAAO,MAAM,IAAI,KAAK,MAAM;GAAE,GAAG;GAAqB,SAAS;IAAE,GAAG,oBAAoB;IAAS,eAAe,UAAU,UAAU;IAAI;GAAE,CAAC;;CAE9I"}
@@ -10,7 +10,7 @@ const chartTypes = {
10
10
  },
11
11
  pie: {
12
12
  key: "pie",
13
- Icon: _mui_icons_material.PieChartOutline
13
+ Icon: _mui_icons_material.PieChartOutlined
14
14
  }
15
15
  };
16
16
  const emptyChartSelection = {
@@ -164,6 +164,11 @@ const BENEFITS = {
164
164
  benefit: "scheduled deployments to steer the distribution of your updates.",
165
165
  requiredPlan: PLANS.professional.id
166
166
  },
167
+ manifests: {
168
+ id: "manifests",
169
+ benefit: "orchestrate multi-component updates with manifests for complex device software management",
170
+ requiredPlan: PLANS.enterprise.id
171
+ },
167
172
  webhookEvents: {
168
173
  id: "webhookEvents",
169
174
  benefit: "receive inventory events and select which type(s) of events the webhook will receive",
@@ -1 +1 @@
1
- {"version":3,"file":"constants.cjs","names":["BarChartIcon","PieChartIcon","yesUtil"],"sources":["../../src/appSlice/constants.ts"],"sourcesContent":["// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { BarChart as BarChartIcon, PieChartOutline as PieChartIcon } from '@mui/icons-material';\n\nimport { yes as yesUtil } from '@northern.tech/utils';\n\nexport const chartTypes = {\n bar: { key: 'bar', Icon: BarChartIcon },\n pie: { key: 'pie', Icon: PieChartIcon }\n} as const;\nexport const emptyChartSelection = { software: '', group: '', chartType: chartTypes.bar.key, attribute: 'artifact_name' };\nexport const defaultReportType = 'distribution';\nexport const defaultReports = [{ ...emptyChartSelection, group: null, attribute: 'artifact_name', type: defaultReportType }];\n\nexport const BEGINNING_OF_TIME = '2016-01-01T00:00:00.000Z';\n\nexport const locations = {\n cn: { key: 'cn', title: 'China', location: 'hosted.mender.cn' },\n eu: { key: 'eu', title: 'EU', location: 'eu.hosted.mender.io' },\n us: { key: 'us', title: 'US', location: 'hosted.mender.io' }\n} as const;\nexport type AvailablePlans = 'os' | 'professional' | 'enterprise';\n\nexport type Plan = {\n description: string;\n id: AvailablePlans;\n name: string;\n};\n\nexport type AvailableAddon = 'configure' | 'troubleshoot' | 'monitor';\n\nexport const PLANS: { [key in AvailablePlans]: Plan } = {\n os: {\n id: 'os',\n name: 'Basic',\n description:\n 'The core features of Mender. To continue using Enterprise Trial features—like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more—please upgrade to a higher plan.'\n },\n professional: {\n id: 'professional',\n name: 'Professional',\n description: 'Everything in Basic, plus enhanced update management and automation features.'\n },\n enterprise: {\n id: 'enterprise',\n name: 'Enterprise',\n description:\n 'Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription — ask us for a quote.'\n }\n} as const;\nexport type Addon = {\n description: string;\n eligible: AvailablePlans[];\n id: string;\n needs: string[];\n title: string;\n};\n\nexport type AddonId = keyof typeof ADDONS;\n\n// the needs names need to be aligned with the name of the features in the appReducer, as they will be checked in the addonselection\nexport const ADDONS: { [key in AvailableAddon]: Addon } = {\n configure: {\n id: 'configure',\n title: 'Configure',\n description: 'Seamlessly configure applications and devices remotely – configure each device to its environment.',\n needs: ['hasDeviceConfig'],\n eligible: ['os', 'professional', 'enterprise']\n },\n monitor: {\n id: 'monitor',\n title: 'Monitor',\n description: 'Detect and analyze health issues of devices, services and applications. Set up alerts so you can act quickly.',\n needs: ['hasMonitor'],\n eligible: ['professional', 'enterprise']\n },\n troubleshoot: {\n id: 'troubleshoot',\n title: 'Troubleshoot',\n description: 'Secure, remote access to your devices – quickly diagnose and fix issues in real time.',\n needs: ['hasDeviceConnect'],\n eligible: ['os', 'professional', 'enterprise']\n }\n};\n\nexport const BENEFITS = {\n auditlog: {\n id: 'auditlog',\n benefit: 'gain access to logs for important events such as changes to devices, deployments and user management, as well as remote terminal session replays',\n requiredPlan: PLANS.enterprise.id\n },\n dashboard: { id: 'dashboard', benefit: 'actionable insights into the devices you are updating with Mender', requiredPlan: PLANS.enterprise.id },\n deltaGeneration: {\n id: 'deltaGeneration',\n benefit: 'automatic delta artifacts generation to minimize data transfer and improve the update delivery',\n requiredPlan: PLANS.enterprise.id\n },\n deviceConfiguration: { id: 'deviceConfiguration', benefit: 'device configuration features', requiredAddon: ADDONS.configure.id },\n deviceMonitor: { id: 'deviceMonitor', benefit: 'device monitoring features', requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },\n deviceTroubleshoot: { id: 'deviceTroubleshoot', benefit: 'device troubleshooting features', requiredAddon: ADDONS.troubleshoot.id },\n dynamicGroups: { id: 'dynamicGroups', benefit: 'create dynamic groups to ease device management', requiredPlan: PLANS.enterprise.id },\n fullFiltering: { id: 'fullFiltering', benefit: 'filtering by multiple attributes to improve the device overview', requiredPlan: PLANS.professional.id },\n gateway: { id: 'gateway', benefit: 'see devices connected to your gateway device for easy access', requiredPlans: PLANS.professional.id },\n pausedDeployments: {\n id: 'pausedDeployments',\n benefit: 'granular control about update rollout to allow synchronization across your fleet',\n requiredPlan: PLANS.enterprise.id\n },\n phasedDeployments: { id: 'phasedDeployments', benefit: 'choose to roll out deployments in multiple phases', requiredPlan: PLANS.enterprise.id },\n rbac: { id: 'rbac', benefit: 'granular role based access control', requiredPlan: PLANS.enterprise.id },\n retryDeployments: { id: 'retryDeployments', benefit: 'optional retries for failed rollout attempts', requiredPlan: PLANS.professional.id },\n scheduledDeployments: {\n id: 'scheduledDeployments',\n benefit: 'scheduled deployments to steer the distribution of your updates.',\n requiredPlan: PLANS.professional.id\n },\n webhookEvents: {\n id: 'webhookEvents',\n benefit: 'receive inventory events and select which type(s) of events the webhook will receive',\n requiredPlan: PLANS.professional.id\n },\n\n default: { id: 'default', benefit: 'gain access to this feature', requiredPlan: PLANS.enterprise.id }\n} as const;\n\nexport const yes = yesUtil;\nexport const canAccess = yes;\n\nexport const DARK_MODE = 'dark';\nexport const LIGHT_MODE = 'light';\n"],"mappings":";;;;;AAiBA,MAAa,aAAa;CACxB,KAAK;EAAE,KAAK;EAAO,MAAMA,oBAAAA;EAAc;CACvC,KAAK;EAAE,KAAK;EAAO,MAAMC,oBAAAA;EAAc;CACxC;AACD,MAAa,sBAAsB;CAAE,UAAU;CAAI,OAAO;CAAI,WAAW,WAAW,IAAI;CAAK,WAAW;CAAiB;AACzH,MAAa,oBAAoB;AACjC,MAAa,iBAAiB,CAAC;CAAE,GAAG;CAAqB,OAAO;CAAM,WAAW;CAAiB,MAAM;CAAmB,CAAC;AAE5H,MAAa,oBAAoB;AAEjC,MAAa,YAAY;CACvB,IAAI;EAAE,KAAK;EAAM,OAAO;EAAS,UAAU;EAAoB;CAC/D,IAAI;EAAE,KAAK;EAAM,OAAO;EAAM,UAAU;EAAuB;CAC/D,IAAI;EAAE,KAAK;EAAM,OAAO;EAAM,UAAU;EAAoB;CAC7D;AAWD,MAAa,QAA2C;CACtD,IAAI;EACF,IAAI;EACJ,MAAM;EACN,aACE;EACH;CACD,cAAc;EACZ,IAAI;EACJ,MAAM;EACN,aAAa;EACd;CACD,YAAY;EACV,IAAI;EACJ,MAAM;EACN,aACE;EACH;CACF;AAYD,MAAa,SAA6C;CACxD,WAAW;EACT,IAAI;EACJ,OAAO;EACP,aAAa;EACb,OAAO,CAAC,kBAAkB;EAC1B,UAAU;GAAC;GAAM;GAAgB;GAAa;EAC/C;CACD,SAAS;EACP,IAAI;EACJ,OAAO;EACP,aAAa;EACb,OAAO,CAAC,aAA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SAAS;EAAE,IAAI;EAAW,SAAS;EAA+B,cAAc,MAAM,WAAW;EAAI;CACtG;AAED,MAAa,MAAMC,qBAAAA;AACnB,MAAa,YAAY;AAEzB,MAAa,YAAY;AACzB,MAAa,aAAa"}
1
+ {"version":3,"file":"constants.cjs","names":["BarChartIcon","PieChartIcon","yesUtil"],"sources":["../../src/appSlice/constants.ts"],"sourcesContent":["// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { BarChart as BarChartIcon, PieChartOutlined as PieChartIcon } from '@mui/icons-material';\n\nimport { yes as yesUtil } from '@northern.tech/utils';\n\nexport const chartTypes = {\n bar: { key: 'bar', Icon: BarChartIcon },\n pie: { key: 'pie', Icon: PieChartIcon }\n} as const;\nexport const emptyChartSelection = { software: '', group: '', chartType: chartTypes.bar.key, attribute: 'artifact_name' };\nexport const defaultReportType = 'distribution';\nexport const defaultReports = [{ ...emptyChartSelection, group: null, attribute: 'artifact_name', type: defaultReportType }];\n\nexport const BEGINNING_OF_TIME = '2016-01-01T00:00:00.000Z';\n\nexport const locations = {\n cn: { key: 'cn', title: 'China', location: 'hosted.mender.cn' },\n eu: { key: 'eu', title: 'EU', location: 'eu.hosted.mender.io' },\n us: { key: 'us', title: 'US', location: 'hosted.mender.io' }\n} as const;\nexport type AvailablePlans = 'os' | 'professional' | 'enterprise';\n\nexport type Plan = {\n description: string;\n id: AvailablePlans;\n name: string;\n};\n\nexport type AvailableAddon = 'configure' | 'troubleshoot' | 'monitor';\n\nexport const PLANS: { [key in AvailablePlans]: Plan } = {\n os: {\n id: 'os',\n name: 'Basic',\n description:\n 'The core features of Mender. To continue using Enterprise Trial features—like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more—please upgrade to a higher plan.'\n },\n professional: {\n id: 'professional',\n name: 'Professional',\n description: 'Everything in Basic, plus enhanced update management and automation features.'\n },\n enterprise: {\n id: 'enterprise',\n name: 'Enterprise',\n description:\n 'Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription — ask us for a quote.'\n }\n} as const;\nexport type Addon = {\n description: string;\n eligible: AvailablePlans[];\n id: string;\n needs: string[];\n title: string;\n};\n\nexport type AddonId = keyof typeof ADDONS;\n\n// the needs names need to be aligned with the name of the features in the appReducer, as they will be checked in the addonselection\nexport const ADDONS: { [key in AvailableAddon]: Addon } = {\n configure: {\n id: 'configure',\n title: 'Configure',\n description: 'Seamlessly configure applications and devices remotely – configure each device to its environment.',\n needs: ['hasDeviceConfig'],\n eligible: ['os', 'professional', 'enterprise']\n },\n monitor: {\n id: 'monitor',\n title: 'Monitor',\n description: 'Detect and analyze health issues of devices, services and applications. Set up alerts so you can act quickly.',\n needs: ['hasMonitor'],\n eligible: ['professional', 'enterprise']\n },\n troubleshoot: {\n id: 'troubleshoot',\n title: 'Troubleshoot',\n description: 'Secure, remote access to your devices – quickly diagnose and fix issues in real time.',\n needs: ['hasDeviceConnect'],\n eligible: ['os', 'professional', 'enterprise']\n }\n};\n\nexport const BENEFITS = {\n auditlog: {\n id: 'auditlog',\n benefit: 'gain access to logs for important events such as changes to devices, deployments and user management, as well as remote terminal session replays',\n requiredPlan: PLANS.enterprise.id\n },\n dashboard: { id: 'dashboard', benefit: 'actionable insights into the devices you are updating with Mender', requiredPlan: PLANS.enterprise.id },\n deltaGeneration: {\n id: 'deltaGeneration',\n benefit: 'automatic delta artifacts generation to minimize data transfer and improve the update delivery',\n requiredPlan: PLANS.enterprise.id\n },\n deviceConfiguration: { id: 'deviceConfiguration', benefit: 'device configuration features', requiredAddon: ADDONS.configure.id },\n deviceMonitor: { id: 'deviceMonitor', benefit: 'device monitoring features', requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },\n deviceTroubleshoot: { id: 'deviceTroubleshoot', benefit: 'device troubleshooting features', requiredAddon: ADDONS.troubleshoot.id },\n dynamicGroups: { id: 'dynamicGroups', benefit: 'create dynamic groups to ease device management', requiredPlan: PLANS.enterprise.id },\n fullFiltering: { id: 'fullFiltering', benefit: 'filtering by multiple attributes to improve the device overview', requiredPlan: PLANS.professional.id },\n gateway: { id: 'gateway', benefit: 'see devices connected to your gateway device for easy access', requiredPlans: PLANS.professional.id },\n pausedDeployments: {\n id: 'pausedDeployments',\n benefit: 'granular control about update rollout to allow synchronization across your fleet',\n requiredPlan: PLANS.enterprise.id\n },\n phasedDeployments: { id: 'phasedDeployments', benefit: 'choose to roll out deployments in multiple phases', requiredPlan: PLANS.enterprise.id },\n rbac: { id: 'rbac', benefit: 'granular role based access control', requiredPlan: PLANS.enterprise.id },\n retryDeployments: { id: 'retryDeployments', benefit: 'optional retries for failed rollout attempts', requiredPlan: PLANS.professional.id },\n scheduledDeployments: {\n id: 'scheduledDeployments',\n benefit: 'scheduled deployments to steer the distribution of your updates.',\n requiredPlan: PLANS.professional.id\n },\n manifests: {\n id: 'manifests',\n benefit: 'orchestrate multi-component updates with manifests for complex device software management',\n requiredPlan: PLANS.enterprise.id\n },\n webhookEvents: {\n id: 'webhookEvents',\n benefit: 'receive inventory events and select which type(s) of events the webhook will receive',\n requiredPlan: PLANS.professional.id\n },\n\n default: { id: 'default', benefit: 'gain access to this feature', requiredPlan: PLANS.enterprise.id }\n} as const;\n\nexport const yes = yesUtil;\nexport const canAccess = yes;\n\nexport const DARK_MODE = 'dark';\nexport const LIGHT_MODE = 'light';\n"],"mappings":";;;;;AAiBA,MAAa,aAAa;CACxB,KAAK;EAAE,KAAK;EAAO,MAAMA,oBAAAA;EAAc;CACvC,KAAK;EAAE,KAAK;EAAO,MAAMC,oBAAAA;EAAc;CACxC;AACD,MAAa,sBAAsB;CA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AI;EAAiB,SAAS;EAA8B,eAAe,OAAO,QAAQ;EAAI,cAAc,MAAM,aAAa;EAAI;CACpJ,oBAAoB;EAAE,IAAI;EAAsB,SAAS;EAAmC,eAAe,OAAO,aAAa;EAAI;CACnI,eAAe;EAAE,IAAI;EAAiB,SAAS;EAAmD,cAAc,MAAM,WAAW;EAAI;CACrI,eAAe;EAAE,IAAI;EAAiB,SAAS;EAAmE,cAAc,MAAM,aAAa;EAAI;CACvJ,SAAS;EAAE,IAAI;EAAW,SAAS;EAAgE,eAAe,MAAM,aAAa;EAAI;CACzI,mBAAmB;EACjB,IAAI;EACJ,SAAS;EACT,cAAc,MAAM,WAAW;EAChC;CACD,mBAAmB;EAAE,IAAI;EAAqB,SAAS;EAAqD,cAAc,MAAM,WAAW;EAAI;CAC/I,MAAM;EAAE,IAAI;EAAQ,SAAS;EAAsC,cAAc,MAAM,WAAW;EAAI;CACtG,kBAAkB;EAAE,IAAI;EAAoB,SAAS;EAAgD,cAAc,MAAM,aAAa;EAAI;CAC1I,sBAAsB;EACpB,IAAI;EACJ,SAAS;EACT,cAAc,MAAM,aAAa;EAClC;CACD,WAAW;EACT,IAAI;EACJ,SAAS;EACT,cAAc,MAAM,WAAW;EAChC;CACD,eAAe;EACb,IAAI;EACJ,SAAS;EACT,cAAc,MAAM,aAAa;EAClC;CAED,SAAS;EAAE,IAAI;EAAW,SAAS;EAA+B,cAAc,MAAM,WAAW;EAAI;CACtG;AAED,MAAa,MAAMC,qBAAAA;AACnB,MAAa,YAAY;AAEzB,MAAa,YAAY;AACzB,MAAa,aAAa"}
@@ -1,2 +1,2 @@
1
- import { _ as locations, a as AvailablePlans, c as DARK_MODE, d as Plan, f as canAccess, g as emptyChartSelection, h as defaultReports, i as AvailableAddon, l as LIGHT_MODE, m as defaultReportType, n as Addon, o as BEGINNING_OF_TIME, p as chartTypes, r as AddonId, s as BENEFITS, t as ADDONS, u as PLANS, v as yes } from "../constants-DPLHhjVN.cjs";
1
+ import { _ as locations, a as AvailablePlans, c as DARK_MODE, d as Plan, f as canAccess, g as emptyChartSelection, h as defaultReports, i as AvailableAddon, l as LIGHT_MODE, m as defaultReportType, n as Addon, o as BEGINNING_OF_TIME, p as chartTypes, r as AddonId, s as BENEFITS, t as ADDONS, u as PLANS, v as yes } from "../constants-BFTS6mge.cjs";
2
2
  export { ADDONS, Addon, AddonId, AvailableAddon, AvailablePlans, BEGINNING_OF_TIME, BENEFITS, DARK_MODE, LIGHT_MODE, PLANS, Plan, canAccess, chartTypes, defaultReportType, defaultReports, emptyChartSelection, locations, yes };
@@ -1,2 +1,2 @@
1
- import { _ as locations, a as AvailablePlans, c as DARK_MODE, d as Plan, f as canAccess, g as emptyChartSelection, h as defaultReports, i as AvailableAddon, l as LIGHT_MODE, m as defaultReportType, n as Addon, o as BEGINNING_OF_TIME, p as chartTypes, r as AddonId, s as BENEFITS, t as ADDONS, u as PLANS, v as yes } from "../constants-C5AU0mCY.js";
1
+ import { _ as locations, a as AvailablePlans, c as DARK_MODE, d as Plan, f as canAccess, g as emptyChartSelection, h as defaultReports, i as AvailableAddon, l as LIGHT_MODE, m as defaultReportType, n as Addon, o as BEGINNING_OF_TIME, p as chartTypes, r as AddonId, s as BENEFITS, t as ADDONS, u as PLANS, v as yes } from "../constants-BIIEMVoG.js";
2
2
  export { ADDONS, Addon, AddonId, AvailableAddon, AvailablePlans, BEGINNING_OF_TIME, BENEFITS, DARK_MODE, LIGHT_MODE, PLANS, Plan, canAccess, chartTypes, defaultReportType, defaultReports, emptyChartSelection, locations, yes };
@@ -1,4 +1,4 @@
1
- import { BarChart, PieChartOutline } from "@mui/icons-material";
1
+ import { BarChart, PieChartOutlined } from "@mui/icons-material";
2
2
  import { yes as yes$1 } from "@northern.tech/utils";
3
3
  //#region src/appSlice/constants.ts
4
4
  const chartTypes = {
@@ -8,7 +8,7 @@ const chartTypes = {
8
8
  },
9
9
  pie: {
10
10
  key: "pie",
11
- Icon: PieChartOutline
11
+ Icon: PieChartOutlined
12
12
  }
13
13
  };
14
14
  const emptyChartSelection = {
@@ -162,6 +162,11 @@ const BENEFITS = {
162
162
  benefit: "scheduled deployments to steer the distribution of your updates.",
163
163
  requiredPlan: PLANS.professional.id
164
164
  },
165
+ manifests: {
166
+ id: "manifests",
167
+ benefit: "orchestrate multi-component updates with manifests for complex device software management",
168
+ requiredPlan: PLANS.enterprise.id
169
+ },
165
170
  webhookEvents: {
166
171
  id: "webhookEvents",
167
172
  benefit: "receive inventory events and select which type(s) of events the webhook will receive",
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":["BarChartIcon","PieChartIcon","yesUtil"],"sources":["../../src/appSlice/constants.ts"],"sourcesContent":["// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { BarChart as BarChartIcon, PieChartOutline as PieChartIcon } from '@mui/icons-material';\n\nimport { yes as yesUtil } from '@northern.tech/utils';\n\nexport const chartTypes = {\n bar: { key: 'bar', Icon: BarChartIcon },\n pie: { key: 'pie', Icon: PieChartIcon }\n} as const;\nexport const emptyChartSelection = { software: '', group: '', chartType: chartTypes.bar.key, attribute: 'artifact_name' };\nexport const defaultReportType = 'distribution';\nexport const defaultReports = [{ ...emptyChartSelection, group: null, attribute: 'artifact_name', type: defaultReportType }];\n\nexport const BEGINNING_OF_TIME = '2016-01-01T00:00:00.000Z';\n\nexport const locations = {\n cn: { key: 'cn', title: 'China', location: 'hosted.mender.cn' },\n eu: { key: 'eu', title: 'EU', location: 'eu.hosted.mender.io' },\n us: { key: 'us', title: 'US', location: 'hosted.mender.io' }\n} as const;\nexport type AvailablePlans = 'os' | 'professional' | 'enterprise';\n\nexport type Plan = {\n description: string;\n id: AvailablePlans;\n name: string;\n};\n\nexport type AvailableAddon = 'configure' | 'troubleshoot' | 'monitor';\n\nexport const PLANS: { [key in AvailablePlans]: Plan } = {\n os: {\n id: 'os',\n name: 'Basic',\n description:\n 'The core features of Mender. To continue using Enterprise Trial features—like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more—please upgrade to a higher plan.'\n },\n professional: {\n id: 'professional',\n name: 'Professional',\n description: 'Everything in Basic, plus enhanced update management and automation features.'\n },\n enterprise: {\n id: 'enterprise',\n name: 'Enterprise',\n description:\n 'Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription — ask us for a quote.'\n }\n} as const;\nexport type Addon = {\n description: string;\n eligible: AvailablePlans[];\n id: string;\n needs: string[];\n title: string;\n};\n\nexport type AddonId = keyof typeof ADDONS;\n\n// the needs names need to be aligned with the name of the features in the appReducer, as they will be checked in the addonselection\nexport const ADDONS: { [key in AvailableAddon]: Addon } = {\n configure: {\n id: 'configure',\n title: 'Configure',\n description: 'Seamlessly configure applications and devices remotely – configure each device to its environment.',\n needs: ['hasDeviceConfig'],\n eligible: ['os', 'professional', 'enterprise']\n },\n monitor: {\n id: 'monitor',\n title: 'Monitor',\n description: 'Detect and analyze health issues of devices, services and applications. Set up alerts so you can act quickly.',\n needs: ['hasMonitor'],\n eligible: ['professional', 'enterprise']\n },\n troubleshoot: {\n id: 'troubleshoot',\n title: 'Troubleshoot',\n description: 'Secure, remote access to your devices – quickly diagnose and fix issues in real time.',\n needs: ['hasDeviceConnect'],\n eligible: ['os', 'professional', 'enterprise']\n }\n};\n\nexport const BENEFITS = {\n auditlog: {\n id: 'auditlog',\n benefit: 'gain access to logs for important events such as changes to devices, deployments and user management, as well as remote terminal session replays',\n requiredPlan: PLANS.enterprise.id\n },\n dashboard: { id: 'dashboard', benefit: 'actionable insights into the devices you are updating with Mender', requiredPlan: PLANS.enterprise.id },\n deltaGeneration: {\n id: 'deltaGeneration',\n benefit: 'automatic delta artifacts generation to minimize data transfer and improve the update delivery',\n requiredPlan: PLANS.enterprise.id\n },\n deviceConfiguration: { id: 'deviceConfiguration', benefit: 'device configuration features', requiredAddon: ADDONS.configure.id },\n deviceMonitor: { id: 'deviceMonitor', benefit: 'device monitoring features', requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },\n deviceTroubleshoot: { id: 'deviceTroubleshoot', benefit: 'device troubleshooting features', requiredAddon: ADDONS.troubleshoot.id },\n dynamicGroups: { id: 'dynamicGroups', benefit: 'create dynamic groups to ease device management', requiredPlan: PLANS.enterprise.id },\n fullFiltering: { id: 'fullFiltering', benefit: 'filtering by multiple attributes to improve the device overview', requiredPlan: PLANS.professional.id },\n gateway: { id: 'gateway', benefit: 'see devices connected to your gateway device for easy access', requiredPlans: PLANS.professional.id },\n pausedDeployments: {\n id: 'pausedDeployments',\n benefit: 'granular control about update rollout to allow synchronization across your fleet',\n requiredPlan: PLANS.enterprise.id\n },\n phasedDeployments: { id: 'phasedDeployments', benefit: 'choose to roll out deployments in multiple phases', requiredPlan: PLANS.enterprise.id },\n rbac: { id: 'rbac', benefit: 'granular role based access control', requiredPlan: PLANS.enterprise.id },\n retryDeployments: { id: 'retryDeployments', benefit: 'optional retries for failed rollout attempts', requiredPlan: PLANS.professional.id },\n scheduledDeployments: {\n id: 'scheduledDeployments',\n benefit: 'scheduled deployments to steer the distribution of your updates.',\n requiredPlan: PLANS.professional.id\n },\n webhookEvents: {\n id: 'webhookEvents',\n benefit: 'receive inventory events and select which type(s) of events the webhook will receive',\n requiredPlan: PLANS.professional.id\n },\n\n default: { id: 'default', benefit: 'gain access to this feature', requiredPlan: PLANS.enterprise.id }\n} as const;\n\nexport const yes = yesUtil;\nexport const canAccess = yes;\n\nexport const DARK_MODE = 'dark';\nexport const LIGHT_MODE = 'light';\n"],"mappings":";;;AAiBA,MAAa,aAAa;CACxB,KAAK;EAAE,KAAK;EAAO,MAAMA;EAAc;CACvC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;EAAuB,SAAS;EAAiC,eAAe,OAAO,UAAU;EAAI;CAChI,eAAe;EAAE,IAAI;EAAiB,SAAS;EAA8B,eAAe,OAAO,QAAQ;EAAI,cAAc,MAAM,aAAa;EAAI;CACpJ,oBAAoB;EAAE,IAAI;EAAsB,SAAS;EAAmC,eAAe,OAAO,aAAa;EAAI;CACnI,eAAe;EAAE,IAAI;EAAiB,SAAS;EAAmD,cAAc,MAAM,WAAW;EAAI;CACrI,eAAe;EAAE,IAAI;EAAiB,SAAS;EAAmE,cAAc,MAAM,aAAa;EAAI;CACvJ,SAAS;EAAE,IAAI;EAAW,SAAS;EAAgE,eAAe,MAAM,aAAa;EAAI;CACzI,mBAAmB;EACjB,IAAI;EACJ,SAAS;EACT,cAAc,MAAM,WAAW;EAChC;CACD,mBAAmB;EAAE,IAAI;EAAqB,SAAS;EAAqD,cAAc,MAAM,WAAW;EAAI;CAC/I,MAAM;EAAE,IAAI;EAAQ,SAAS;EAAsC,cAAc,MAAM,WAAW;EAAI;CACtG,kBAAkB;EAAE,IAAI;EAAoB,SAAS;EAAgD,cAAc,MAAM,aAAa;EAAI;CAC1I,sBAAsB;EACpB,IAAI;EACJ,SAAS;EACT,cAAc,MAAM,aAAa;EAClC;CACD,eAAe;EACb,IAAI;EACJ,SAAS;EACT,cAAc,MAAM,aAAa;EAClC;CAED,SAAS;EAAE,IAAI;EAAW,SAAS;EAA+B,cAAc,MAAM,WAAW;EAAI;CACtG;AAED,MAAa,MAAMC;AACnB,MAAa,YAAY;AAEzB,MAAa,YAAY;AACzB,MAAa,aAAa"}
1
+ {"version":3,"file":"constants.js","names":["BarChartIcon","PieChartIcon","yesUtil"],"sources":["../../src/appSlice/constants.ts"],"sourcesContent":["// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { BarChart as BarChartIcon, PieChartOutlined as PieChartIcon } from '@mui/icons-material';\n\nimport { yes as yesUtil } from '@northern.tech/utils';\n\nexport const chartTypes = {\n bar: { key: 'bar', Icon: BarChartIcon },\n pie: { key: 'pie', Icon: PieChartIcon }\n} as const;\nexport const emptyChartSelection = { software: '', group: '', chartType: chartTypes.bar.key, attribute: 'artifact_name' };\nexport const defaultReportType = 'distribution';\nexport const defaultReports = [{ ...emptyChartSelection, group: null, attribute: 'artifact_name', type: defaultReportType }];\n\nexport const BEGINNING_OF_TIME = '2016-01-01T00:00:00.000Z';\n\nexport const locations = {\n cn: { key: 'cn', title: 'China', location: 'hosted.mender.cn' },\n eu: { key: 'eu', title: 'EU', location: 'eu.hosted.mender.io' },\n us: { key: 'us', title: 'US', location: 'hosted.mender.io' }\n} as const;\nexport type AvailablePlans = 'os' | 'professional' | 'enterprise';\n\nexport type Plan = {\n description: string;\n id: AvailablePlans;\n name: string;\n};\n\nexport type AvailableAddon = 'configure' | 'troubleshoot' | 'monitor';\n\nexport const PLANS: { [key in AvailablePlans]: Plan } = {\n os: {\n id: 'os',\n name: 'Basic',\n description:\n 'The core features of Mender. To continue using Enterprise Trial features—like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more—please upgrade to a higher plan.'\n },\n professional: {\n id: 'professional',\n name: 'Professional',\n description: 'Everything in Basic, plus enhanced update management and automation features.'\n },\n enterprise: {\n id: 'enterprise',\n name: 'Enterprise',\n description:\n 'Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription — ask us for a quote.'\n }\n} as const;\nexport type Addon = {\n description: string;\n eligible: AvailablePlans[];\n id: string;\n needs: string[];\n title: string;\n};\n\nexport type AddonId = keyof typeof ADDONS;\n\n// the needs names need to be aligned with the name of the features in the appReducer, as they will be checked in the addonselection\nexport const ADDONS: { [key in AvailableAddon]: Addon } = {\n configure: {\n id: 'configure',\n title: 'Configure',\n description: 'Seamlessly configure applications and devices remotely – configure each device to its environment.',\n needs: ['hasDeviceConfig'],\n eligible: ['os', 'professional', 'enterprise']\n },\n monitor: {\n id: 'monitor',\n title: 'Monitor',\n description: 'Detect and analyze health issues of devices, services and applications. Set up alerts so you can act quickly.',\n needs: ['hasMonitor'],\n eligible: ['professional', 'enterprise']\n },\n troubleshoot: {\n id: 'troubleshoot',\n title: 'Troubleshoot',\n description: 'Secure, remote access to your devices – quickly diagnose and fix issues in real time.',\n needs: ['hasDeviceConnect'],\n eligible: ['os', 'professional', 'enterprise']\n }\n};\n\nexport const BENEFITS = {\n auditlog: {\n id: 'auditlog',\n benefit: 'gain access to logs for important events such as changes to devices, deployments and user management, as well as remote terminal session replays',\n requiredPlan: PLANS.enterprise.id\n },\n dashboard: { id: 'dashboard', benefit: 'actionable insights into the devices you are updating with Mender', requiredPlan: PLANS.enterprise.id },\n deltaGeneration: {\n id: 'deltaGeneration',\n benefit: 'automatic delta artifacts generation to minimize data transfer and improve the update delivery',\n requiredPlan: PLANS.enterprise.id\n },\n deviceConfiguration: { id: 'deviceConfiguration', benefit: 'device configuration features', requiredAddon: ADDONS.configure.id },\n deviceMonitor: { id: 'deviceMonitor', benefit: 'device monitoring features', requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },\n deviceTroubleshoot: { id: 'deviceTroubleshoot', benefit: 'device troubleshooting features', requiredAddon: ADDONS.troubleshoot.id },\n dynamicGroups: { id: 'dynamicGroups', benefit: 'create dynamic groups to ease device management', requiredPlan: PLANS.enterprise.id },\n fullFiltering: { id: 'fullFiltering', benefit: 'filtering by multiple attributes to improve the device overview', requiredPlan: PLANS.professional.id },\n gateway: { id: 'gateway', benefit: 'see devices connected to your gateway device for easy access', requiredPlans: PLANS.professional.id },\n pausedDeployments: {\n id: 'pausedDeployments',\n benefit: 'granular control about update rollout to allow synchronization across your fleet',\n requiredPlan: PLANS.enterprise.id\n },\n phasedDeployments: { id: 'phasedDeployments', benefit: 'choose to roll out deployments in multiple phases', requiredPlan: PLANS.enterprise.id },\n rbac: { id: 'rbac', benefit: 'granular role based access control', requiredPlan: PLANS.enterprise.id },\n retryDeployments: { id: 'retryDeployments', benefit: 'optional retries for failed rollout attempts', requiredPlan: PLANS.professional.id },\n scheduledDeployments: {\n id: 'scheduledDeployments',\n benefit: 'scheduled deployments to steer the distribution of your updates.',\n requiredPlan: PLANS.professional.id\n },\n manifests: {\n id: 'manifests',\n benefit: 'orchestrate multi-component updates with manifests for complex device software management',\n requiredPlan: PLANS.enterprise.id\n },\n webhookEvents: {\n id: 'webhookEvents',\n benefit: 'receive inventory events and select which type(s) of events the webhook will receive',\n requiredPlan: PLANS.professional.id\n },\n\n default: { id: 'default', benefit: 'gain access to this feature', requiredPlan: PLANS.enterprise.id }\n} as const;\n\nexport const yes = yesUtil;\nexport const canAccess = yes;\n\nexport const DARK_MODE = 'dark';\nexport const LIGHT_MODE = 'light';\n"],"mappings":";;;AAiBA,MAAa,aAAa;CACxB,KAAK;EAAE,KAAK;EAAO,MAAMA;EAAc;CACvC,KAAK;EAAE,KAAK;EAAO,MAAMC;EAAc;CACxC;AACD,MAAa,sBAAsB;CAAE,UAAU;CAAI,OAAO;CAAI,WAAW,WAAW,IAAI;CAAK,WAAW;CAAiB;AACzH,MAAa,oBAAoB;AACjC,MAAa,iBAAiB,CAAC;CAAE,GAAG;CAAqB,OAAO;CAAM,WAAW;CAAiB,MAAM;CAAmB,CAAC;AAE5H,MAAa,oBAAoB;AAEjC,MAAa,YAAY;CACvB,IAAI;EAAE,KAAK;EAAM,OAAO;EAAS,UAAU;EAAoB;CAC/D,IAAI;EAAE,KAAK;EAAM,OAAO;EAAM,UAAU;EAAuB;CAC/D,IAAI;EAAE,KAAK;EAAM,OAAO;EAAM,UAAU;EAAoB;CAC7D;AAWD,MAAa,QAA2C;CACtD,IAAI;EACF,IA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;EAAE,IAAI;EAAqB,SAAS;EAAqD,cAAc,MAAM,WAAW;EAAI;CAC/I,MAAM;EAAE,IAAI;EAAQ,SAAS;EAAsC,cAAc,MAAM,WAAW;EAAI;CACtG,kBAAkB;EAAE,IAAI;EAAoB,SAAS;EAAgD,cAAc,MAAM,aAAa;EAAI;CAC1I,sBAAsB;EACpB,IAAI;EACJ,SAAS;EACT,cAAc,MAAM,aAAa;EAClC;CACD,WAAW;EACT,IAAI;EACJ,SAAS;EACT,cAAc,MAAM,WAAW;EAChC;CACD,eAAe;EACb,IAAI;EACJ,SAAS;EACT,cAAc,MAAM,aAAa;EAClC;CAED,SAAS;EAAE,IAAI;EAAW,SAAS;EAA+B,cAAc,MAAM,WAAW;EAAI;CACtG;AAED,MAAa,MAAMC;AACnB,MAAa,YAAY;AAEzB,MAAa,YAAY;AACzB,MAAa,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["SORTING_OPTIONS"],"sources":["../../src/appSlice/index.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { SnackbarProps } from '@mui/material';\n\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { SortOptions } from '../constants';\nimport { SORTING_OPTIONS } from '../constants';\n\nexport const sliceName = 'app';\n\nconst getYesterday = () => {\n const today = new Date();\n today.setDate(today.getDate() - 1);\n return today.toISOString();\n};\n\nexport type Repository = {\n name: string;\n version: string;\n};\n\nexport type VersionRelease = Partial<{ [versionInfo: string]: VersionRelease }> & {\n release?: string;\n release_date?: string;\n repos?: Repository[];\n supported_until?: string;\n};\n\nexport type SaasVersion = {\n date: string;\n tag: string;\n};\n\nexport type ReleaseData = {\n lts: string[];\n releases: {\n [version: string]: VersionRelease;\n };\n saas: SaasVersion[];\n};\nexport type TagData = { name: string }[];\n\nexport interface SnackbarContent extends Pick<SnackbarProps, 'action' | 'autoHideDuration' | 'message' | 'open'> {\n preventClickToCopy?: boolean;\n}\n\nexport interface SearchState {\n deviceIds: string[];\n isSearching: boolean;\n page?: number;\n perPage?: number;\n searchTerm: string;\n searchTotal: number;\n sort: SortOptions;\n}\n\nexport interface Upload {\n cancelSource: any;\n inprogress?: boolean;\n name?: string;\n progress: number;\n size?: number;\n}\n\ntype UILatestRelease = {\n releaseDate: string;\n repos: Record<string, string>;\n};\n\ntype VersionInformation = {\n [key: string]: string | UILatestRelease | undefined;\n backend?: string;\n GUI?: string;\n latestRelease?: UILatestRelease;\n};\n\nexport type SentryConfig = {\n isReduxEnabled?: string; // no parsing done here as this has to be accessed outside of the store\n location: string;\n replaysSessionSampleRate?: number;\n tracesSampleRate?: number;\n};\n\nexport type AppSliceType = {\n appInitDone: boolean;\n cancelSource: any;\n commit: string;\n demoArtifactLink: string;\n docsVersion: string;\n features: Record<string, boolean>;\n feedbackProbability: number;\n firstLoginAfterSignup: boolean;\n hostAddress: string | null;\n hostedAnnouncement: string;\n newThreshold: string;\n offlineThreshold: string;\n recaptchaSiteKey: string;\n searchState: SearchState;\n sentry: SentryConfig;\n snackbar: SnackbarContent;\n stripeAPIKey: string;\n trackerCode: string;\n uploadsById: Record<string, Upload>;\n versionInformation: VersionInformation;\n yesterday?: string;\n};\n\nexport const initialState: AppSliceType = {\n appInitDone: false,\n cancelSource: undefined,\n commit: '',\n demoArtifactLink: 'https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender',\n hostAddress: null,\n snackbar: {\n action: undefined,\n autoHideDuration: undefined,\n message: '',\n open: false,\n preventClickToCopy: false\n },\n // return boolean rather than organization details\n features: {\n hasAiEnabled: false,\n hasAuditlogs: false,\n hasDeltaProgress: false,\n hasMultitenancy: false,\n hasDeviceConfig: false,\n hasDeviceConnect: false,\n hasFeedbackEnabled: false,\n hasManifestsEnabled: false,\n hasMonitor: false,\n hasMCUEnabled: false,\n isHosted: true,\n isEnterprise: false\n },\n feedbackProbability: 0.3,\n firstLoginAfterSignup: false,\n hostedAnnouncement: '',\n docsVersion: '',\n recaptchaSiteKey: '',\n searchState: {\n deviceIds: [],\n searchTerm: '',\n searchTotal: 0,\n isSearching: false,\n sort: {\n direction: SORTING_OPTIONS.desc\n // key: null,\n // scope: null\n }\n },\n sentry: {\n location: '',\n replaysSessionSampleRate: 0.1,\n tracesSampleRate: 1.0\n },\n stripeAPIKey: '',\n trackerCode: '',\n uploadsById: {\n // id: { progress: 0, cancelSource: undefined }\n },\n newThreshold: getYesterday(),\n offlineThreshold: getYesterday(),\n versionInformation: {\n Integration: '',\n 'Mender-Artifact': '',\n 'Meta-Mender': ''\n },\n yesterday: undefined\n};\n\nexport const appSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n setFeatures: (state, action: PayloadAction<Record<string, boolean>>) => {\n state.features = {\n ...state.features,\n ...action.payload\n };\n },\n setSnackbar: (state, { payload }: PayloadAction<SnackbarContent | string>) => {\n if (typeof payload === 'string' || payload instanceof String) {\n state.snackbar = {\n ...initialState.snackbar,\n message: payload,\n open: !!payload\n };\n return;\n }\n const { message, autoHideDuration, action, preventClickToCopy = false } = payload;\n state.snackbar = {\n message,\n autoHideDuration,\n action,\n preventClickToCopy,\n open: !!message\n };\n },\n setFirstLoginAfterSignup: (state, action: PayloadAction<boolean>) => {\n state.firstLoginAfterSignup = action.payload;\n },\n setAnnouncement: (state, action: PayloadAction<string>) => {\n state.hostedAnnouncement = action.payload;\n },\n setSearchState: (state, action) => {\n state.searchState = {\n ...state.searchState,\n ...action.payload\n };\n },\n setOfflineThreshold: (state, action: PayloadAction<string>) => {\n state.offlineThreshold = action.payload;\n },\n initUpload: (state, action: PayloadAction<{ id: string; upload: Upload }>) => {\n const { id, upload } = action.payload;\n state.uploadsById[id] = upload;\n },\n uploadProgress: (state, action: PayloadAction<{ id: string; progress: number }>) => {\n const { id, progress } = action.payload;\n state.uploadsById[id] = {\n ...state.uploadsById[id],\n progress\n };\n },\n cleanUpUpload: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: current, ...remainder } = state.uploadsById;\n state.uploadsById = remainder;\n },\n setVersionInformation: (state, action: PayloadAction<VersionInformation>) => {\n state.versionInformation = {\n ...state.versionInformation,\n ...action.payload\n };\n },\n setEnvironmentData: (state, action) => ({ ...state, ...action.payload }),\n setAppInitDone: state => {\n state.appInitDone = true;\n }\n }\n});\n\nexport const actions = appSlice.actions;\nexport default appSlice.reducer;\n"],"mappings":";;;;;;;;AAqBA,MAAa,YAAY;AAEzB,MAAM,qBAAqB;CACzB,MAAM,wBAAQ,IAAI,MAAM;AACxB,OAAM,QAAQ,MAAM,SAAS,GAAG,EAAE;AAClC,QAAO,MAAM,aAAa;;AA8F5B,MAAa,eAA6B;CACxC,aAAa;CACb,cAAc,KAAA;CACd,QAAQ;CACR,kBAAkB;CAClB,aAAa;CACb,UAAU;EACR,QAAQ,KAAA;EACR,kBAAkB,KAAA;EAClB,SAAS;EACT,MAAM;EACN,oBAAoB;EACrB;CAED,UAAU;EACR,cAAc;EACd,cAAc;EACd,kBAAkB;EAClB,iBAAiB;EACjB,iBAAiB;EACjB,kBAAkB;EAClB,oBAAoB;EACpB,qBAAqB;EACrB,YAAY;EACZ,eAAe;EACf,UAAU;EACV,cAAc;EACf;CACD,qBAAqB;CACrB,uBAAuB;CACvB,oBAAoB;CACpB,aAAa;CACb,kBAAkB;CAClB,aAAa;EACX,WAAW,EAAE;EACb,YAAY;EACZ,aAAa;EACb,aAAa;EACb,MAAM,EACJ,WAAWA,+BAAAA,gBAAgB,MAG5B;EACF;CACD,QAAQ;EACN,UAAU;EACV,0BAA0B;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IACzB,GAAG,MAAM;IACT,GAAG,OAAO;IACX;;EAEH,qBAAqB,OAAO,YAAY;GAAE,GAAG;GAAO,GAAG,OAAO;GAAS;EACvE,iBAAgB,UAAS;AACvB,SAAM,cAAc;;EAEvB;CACF,CAAC;AAEF,MAAa,UAAU,SAAS;AAChC,IAAA,mBAAe,SAAS"}
1
+ {"version":3,"file":"index.cjs","names":["SORTING_OPTIONS"],"sources":["../../src/appSlice/index.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { SnackbarProps } from '@mui/material';\n\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { SortOptions } from '../constants';\nimport { SORTING_OPTIONS } from '../constants';\n\nexport const sliceName = 'app';\n\nconst getYesterday = () => {\n const today = new Date();\n today.setDate(today.getDate() - 1);\n return today.toISOString();\n};\n\nexport type Repository = {\n name: string;\n version: string;\n};\n\nexport type VersionRelease = Partial<{ [versionInfo: string]: VersionRelease }> & {\n release?: string;\n release_date?: string;\n repos?: Repository[];\n supported_until?: string;\n};\n\nexport type SaasVersion = {\n date: string;\n tag: string;\n};\n\nexport type ReleaseData = {\n lts: string[];\n releases: {\n [version: string]: VersionRelease;\n };\n saas: SaasVersion[];\n};\nexport type TagData = { name: string }[];\n\nexport interface SnackbarContent extends Pick<SnackbarProps, 'action' | 'autoHideDuration' | 'message' | 'open'> {\n preventClickToCopy?: boolean;\n}\n\nexport interface SearchState {\n deviceIds: string[];\n isSearching: boolean;\n page?: number;\n perPage?: number;\n searchTerm: string;\n searchTotal: number;\n sort: SortOptions;\n}\n\nexport interface Upload {\n cancelSource: any;\n inprogress?: boolean;\n name?: string;\n progress: number;\n size?: number;\n}\n\ntype UILatestRelease = {\n releaseDate: string;\n repos: Record<string, string>;\n};\n\ntype VersionInformation = {\n [key: string]: string | UILatestRelease | undefined;\n backend?: string;\n GUI?: string;\n latestRelease?: UILatestRelease;\n};\n\nexport type SentryConfig = {\n isReduxEnabled?: string; // no parsing done here as this has to be accessed outside of the store\n location: string;\n replaysSessionSampleRate?: number;\n tracesSampleRate?: number;\n};\n\nexport type AppSliceType = {\n appInitDone: boolean;\n cancelSource: any;\n commit: string;\n demoArtifactLink: string;\n docsVersion: string;\n features: Record<string, boolean>;\n feedbackProbability: number;\n firstLoginAfterSignup: boolean;\n hostAddress: string | null;\n hostedAnnouncement: string;\n newThreshold: string;\n offlineThreshold: string;\n recaptchaSiteKey: string;\n searchState: SearchState;\n sentry: SentryConfig;\n snackbar: SnackbarContent;\n stripeAPIKey: string;\n trackerCode: string;\n uploadsById: Record<string, Upload>;\n versionInformation: VersionInformation;\n yesterday?: string;\n};\n\nexport const initialState: AppSliceType = {\n appInitDone: false,\n cancelSource: undefined,\n commit: '',\n demoArtifactLink: 'https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender',\n hostAddress: null,\n snackbar: {\n action: undefined,\n autoHideDuration: undefined,\n message: '',\n open: false,\n preventClickToCopy: false\n },\n // return boolean rather than organization details\n features: {\n hasAiEnabled: false,\n hasAuditlogs: false,\n hasDeltaProgress: false,\n hasMultitenancy: false,\n hasDeviceConfig: false,\n hasDeviceConnect: false,\n hasFeedbackEnabled: false,\n hasManifestsEnabled: false,\n hasMonitor: false,\n hasMCUEnabled: false,\n isHosted: true,\n isEnterprise: false\n },\n feedbackProbability: 0.3,\n firstLoginAfterSignup: false,\n hostedAnnouncement: '',\n docsVersion: '',\n recaptchaSiteKey: '',\n searchState: {\n deviceIds: [],\n searchTerm: '',\n searchTotal: 0,\n isSearching: false,\n sort: {\n direction: SORTING_OPTIONS.desc\n // key: null,\n // scope: null\n }\n },\n sentry: {\n location: '',\n replaysSessionSampleRate: 0.1,\n tracesSampleRate: 1.0\n },\n stripeAPIKey: '',\n trackerCode: '',\n uploadsById: {\n // id: { progress: 0, cancelSource: undefined }\n },\n newThreshold: getYesterday(),\n offlineThreshold: getYesterday(),\n versionInformation: {\n Integration: '',\n 'Mender-Artifact': '',\n 'Meta-Mender': ''\n },\n yesterday: undefined\n};\n\nexport const appSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n setFeatures: (state, action: PayloadAction<Record<string, boolean>>) => {\n state.features = {\n ...state.features,\n ...action.payload\n };\n },\n setSnackbar: (state, { payload }: PayloadAction<SnackbarContent | string>) => {\n if (typeof payload === 'string' || payload instanceof String) {\n state.snackbar = {\n ...initialState.snackbar,\n message: payload,\n open: !!payload\n };\n return;\n }\n const { message, autoHideDuration, action, preventClickToCopy = false } = payload;\n state.snackbar = {\n message,\n autoHideDuration,\n action,\n preventClickToCopy,\n open: !!message\n };\n },\n setFirstLoginAfterSignup: (state, action: PayloadAction<boolean>) => {\n state.firstLoginAfterSignup = action.payload;\n },\n setAnnouncement: (state, action: PayloadAction<string>) => {\n state.hostedAnnouncement = action.payload;\n },\n setSearchState: (state, action) => {\n state.searchState = {\n ...state.searchState,\n ...action.payload\n };\n },\n setOfflineThreshold: (state, action: PayloadAction<string>) => {\n state.offlineThreshold = action.payload;\n },\n initUpload: (state, action: PayloadAction<{ id: string; upload: Upload }>) => {\n const { id, upload } = action.payload;\n state.uploadsById[id] = upload;\n },\n uploadProgress: (state, action: PayloadAction<{ id: string; progress: number }>) => {\n const { id, progress } = action.payload;\n state.uploadsById[id] = {\n ...state.uploadsById[id],\n progress\n };\n },\n cleanUpUpload: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: current, ...remainder } = state.uploadsById;\n state.uploadsById = remainder;\n },\n setVersionInformation: (state, action: PayloadAction<VersionInformation>) => {\n state.versionInformation = {\n ...state.versionInformation,\n ...action.payload\n };\n },\n setEnvironmentData: (state, action) => ({ ...state, ...action.payload }),\n setAppInitDone: state => {\n state.appInitDone = true;\n }\n }\n});\n\nexport const actions = appSlice.actions;\nexport default appSlice.reducer;\n"],"mappings":";;;;;;;;AAqBA,MAAa,YAAY;AAEzB,MAAM,qBAAqB;CACzB,MAAM,wBAAQ,IAAI,MAAM;CACxB,MAAM,QAAQ,MAAM,SAAS,GAAG,EAAE;CAClC,OAAO,MAAM,aAAa;;AA8F5B,MAAa,eAA6B;CACxC,aAAa;CACb,cAAc,KAAA;CACd,QAAQ;CACR,kBAAkB;CAClB,aAAa;CACb,UAAU;EACR,QAAQ,KAAA;EACR,kBAAkB,KAAA;EAClB,SAAS;EACT,MAAM;EACN,oBAAoB;EACrB;CAED,UAAU;EACR,cAAc;EACd,cAAc;EACd,kBAAkB;EAClB,iBAAiB;EACjB,iBAAiB;EACjB,kBAAkB;EAClB,oBAAoB;EACpB,qBAAqB;EACrB,YAAY;EACZ,eAAe;EACf,UAAU;EACV,cAAc;EACf;CACD,qBAAqB;CACrB,uBAAuB;CACvB,oBAAoB;CACpB,aAAa;CACb,kBAAkB;CAClB,aAAa;EACX,WAAW,EAAE;EACb,YAAY;EACZ,aAAa;EACb,aAAa;EACb,MAAM,EACJ,WAAWA,+BAAAA,gBAAgB,MAG5B;EACF;CACD,QAAQ;EACN,UAAU;EACV,0BAA0B;EAC1B,kBAAkB;EACnB;CACD,cAAc;CACd,aAAa;CACb,aAAa,EAEZ;CACD,cAAc,cAAc;CAC5B,kBAAkB,cAAc;CAChC,oBAAoB;EAClB,aAAa;EACb,mBAAmB;EACnB,eAAe;EAChB;CACD,WAAW,KAAA;CACZ;AAED,MAAa,YAAA,GAAA,iBAAA,aAAuB;CAClC,MAAA;CACA;CACA,UAAU;EACR,cAAc,OAAO,WAAmD;GACtE,MAAM,WAAW;IACf,GAAG,MAAM;IACT,GAAG,OAAO;IACX;;EAEH,cAAc,OAAO,EAAE,cAAuD;GAC5E,IAAI,OAAO,YAAY,YAAY,mBAAmB,QAAQ;IAC5D,MAAM,WAAW;KACf,GAAG,aAAa;KAChB,SAAS;KACT,MAAM,CAAC,CAAC;KACT;IACD;;GAEF,MAAM,EAAE,SAAS,kBAAkB,QAAQ,qBAAqB,UAAU;GAC1E,MAAM,WAAW;IACf;IACA;IACA;IACA;IACA,MAAM,CAAC,CAAC;IACT;;EAEH,2BAA2B,OAAO,WAAmC;GACnE,MAAM,wBAAwB,OAAO;;EAEvC,kBAAkB,OAAO,WAAkC;GACzD,MAAM,qBAAqB,OAAO;;EAEpC,iBAAiB,OAAO,WAAW;GACjC,MAAM,cAAc;IAClB,GAAG,MAAM;IACT,GAAG,OAAO;IACX;;EAEH,sBAAsB,OAAO,WAAkC;GAC7D,MAAM,mBAAmB,OAAO;;EAElC,aAAa,OAAO,WAA0D;GAC5E,MAAM,EAAE,IAAI,WAAW,OAAO;GAC9B,MAAM,YAAY,MAAM;;EAE1B,iBAAiB,OAAO,WAA4D;GAClF,MAAM,EAAE,IAAI,aAAa,OAAO;GAChC,MAAM,YAAY,MAAM;IACtB,GAAG,MAAM,YAAY;IACrB;IACD;;EAEH,gBAAgB,OAAO,WAAkC;GAEvD,MAAM,GAAG,OAAO,UAAU,SAAS,GAAG,cAAc,MAAM;GAC1D,MAAM,cAAc;;EAEtB,wBAAwB,OAAO,WAA8C;GAC3E,MAAM,qBAAqB;IACzB,GAAG,MAAM;IACT,GAAG,OAAO;IACX;;EAEH,qBAAqB,OAAO,YAAY;GAAE,GAAG;GAAO,GAAG,OAAO;GAAS;EACvE,iBAAgB,UAAS;GACvB,MAAM,cAAc;;EAEvB;CACF,CAAC;AAEF,MAAa,UAAU,SAAS;AAChC,IAAA,mBAAe,SAAS"}
@@ -1,2 +1,2 @@
1
- import { a as SearchState, c as TagData, d as _default, f as actions, h as sliceName, i as SaasVersion, l as Upload, m as initialState, n as ReleaseData, o as SentryConfig, p as appSlice, r as Repository, s as SnackbarContent, t as AppSliceType, u as VersionRelease } from "../index-CTt-eIY8.cjs";
1
+ import { a as SearchState, c as TagData, d as _default, f as actions, h as sliceName, i as SaasVersion, l as Upload, m as initialState, n as ReleaseData, o as SentryConfig, p as appSlice, r as Repository, s as SnackbarContent, t as AppSliceType, u as VersionRelease } from "../index-DwACbyUg.cjs";
2
2
  export { AppSliceType, ReleaseData, Repository, SaasVersion, SearchState, SentryConfig, SnackbarContent, TagData, Upload, VersionRelease, actions, appSlice, _default as default, initialState, sliceName };
@@ -1,2 +1,2 @@
1
- import { a as SearchState, c as TagData, d as _default, f as actions, h as sliceName, i as SaasVersion, l as Upload, m as initialState, n as ReleaseData, o as SentryConfig, p as appSlice, r as Repository, s as SnackbarContent, t as AppSliceType, u as VersionRelease } from "../index-Dv3Hfxk_.js";
1
+ import { a as SearchState, c as TagData, d as _default, f as actions, h as sliceName, i as SaasVersion, l as Upload, m as initialState, n as ReleaseData, o as SentryConfig, p as appSlice, r as Repository, s as SnackbarContent, t as AppSliceType, u as VersionRelease } from "../index-Bp1WpATs.js";
2
2
  export { AppSliceType, ReleaseData, Repository, SaasVersion, SearchState, SentryConfig, SnackbarContent, TagData, Upload, VersionRelease, actions, appSlice, _default as default, initialState, sliceName };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/appSlice/index.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { SnackbarProps } from '@mui/material';\n\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { SortOptions } from '../constants';\nimport { SORTING_OPTIONS } from '../constants';\n\nexport const sliceName = 'app';\n\nconst getYesterday = () => {\n const today = new Date();\n today.setDate(today.getDate() - 1);\n return today.toISOString();\n};\n\nexport type Repository = {\n name: string;\n version: string;\n};\n\nexport type VersionRelease = Partial<{ [versionInfo: string]: VersionRelease }> & {\n release?: string;\n release_date?: string;\n repos?: Repository[];\n supported_until?: string;\n};\n\nexport type SaasVersion = {\n date: string;\n tag: string;\n};\n\nexport type ReleaseData = {\n lts: string[];\n releases: {\n [version: string]: VersionRelease;\n };\n saas: SaasVersion[];\n};\nexport type TagData = { name: string }[];\n\nexport interface SnackbarContent extends Pick<SnackbarProps, 'action' | 'autoHideDuration' | 'message' | 'open'> {\n preventClickToCopy?: boolean;\n}\n\nexport interface SearchState {\n deviceIds: string[];\n isSearching: boolean;\n page?: number;\n perPage?: number;\n searchTerm: string;\n searchTotal: number;\n sort: SortOptions;\n}\n\nexport interface Upload {\n cancelSource: any;\n inprogress?: boolean;\n name?: string;\n progress: number;\n size?: number;\n}\n\ntype UILatestRelease = {\n releaseDate: string;\n repos: Record<string, string>;\n};\n\ntype VersionInformation = {\n [key: string]: string | UILatestRelease | undefined;\n backend?: string;\n GUI?: string;\n latestRelease?: UILatestRelease;\n};\n\nexport type SentryConfig = {\n isReduxEnabled?: string; // no parsing done here as this has to be accessed outside of the store\n location: string;\n replaysSessionSampleRate?: number;\n tracesSampleRate?: number;\n};\n\nexport type AppSliceType = {\n appInitDone: boolean;\n cancelSource: any;\n commit: string;\n demoArtifactLink: string;\n docsVersion: string;\n features: Record<string, boolean>;\n feedbackProbability: number;\n firstLoginAfterSignup: boolean;\n hostAddress: string | null;\n hostedAnnouncement: string;\n newThreshold: string;\n offlineThreshold: string;\n recaptchaSiteKey: string;\n searchState: SearchState;\n sentry: SentryConfig;\n snackbar: SnackbarContent;\n stripeAPIKey: string;\n trackerCode: string;\n uploadsById: Record<string, Upload>;\n versionInformation: VersionInformation;\n yesterday?: string;\n};\n\nexport const initialState: AppSliceType = {\n appInitDone: false,\n cancelSource: undefined,\n commit: '',\n demoArtifactLink: 'https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender',\n hostAddress: null,\n snackbar: {\n action: undefined,\n autoHideDuration: undefined,\n message: '',\n open: false,\n preventClickToCopy: false\n },\n // return boolean rather than organization details\n features: {\n hasAiEnabled: false,\n hasAuditlogs: false,\n hasDeltaProgress: false,\n hasMultitenancy: false,\n hasDeviceConfig: false,\n hasDeviceConnect: false,\n hasFeedbackEnabled: false,\n hasManifestsEnabled: false,\n hasMonitor: false,\n hasMCUEnabled: false,\n isHosted: true,\n isEnterprise: false\n },\n feedbackProbability: 0.3,\n firstLoginAfterSignup: false,\n hostedAnnouncement: '',\n docsVersion: '',\n recaptchaSiteKey: '',\n searchState: {\n deviceIds: [],\n searchTerm: '',\n searchTotal: 0,\n isSearching: false,\n sort: {\n direction: SORTING_OPTIONS.desc\n // key: null,\n // scope: null\n }\n },\n sentry: {\n location: '',\n replaysSessionSampleRate: 0.1,\n tracesSampleRate: 1.0\n },\n stripeAPIKey: '',\n trackerCode: '',\n uploadsById: {\n // id: { progress: 0, cancelSource: undefined }\n },\n newThreshold: getYesterday(),\n offlineThreshold: getYesterday(),\n versionInformation: {\n Integration: '',\n 'Mender-Artifact': '',\n 'Meta-Mender': ''\n },\n yesterday: undefined\n};\n\nexport const appSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n setFeatures: (state, action: PayloadAction<Record<string, boolean>>) => {\n state.features = {\n ...state.features,\n ...action.payload\n };\n },\n setSnackbar: (state, { payload }: PayloadAction<SnackbarContent | string>) => {\n if (typeof payload === 'string' || payload instanceof String) {\n state.snackbar = {\n ...initialState.snackbar,\n message: payload,\n open: !!payload\n };\n return;\n }\n const { message, autoHideDuration, action, preventClickToCopy = false } = payload;\n state.snackbar = {\n message,\n autoHideDuration,\n action,\n preventClickToCopy,\n open: !!message\n };\n },\n setFirstLoginAfterSignup: (state, action: PayloadAction<boolean>) => {\n state.firstLoginAfterSignup = action.payload;\n },\n setAnnouncement: (state, action: PayloadAction<string>) => {\n state.hostedAnnouncement = action.payload;\n },\n setSearchState: (state, action) => {\n state.searchState = {\n ...state.searchState,\n ...action.payload\n };\n },\n setOfflineThreshold: (state, action: PayloadAction<string>) => {\n state.offlineThreshold = action.payload;\n },\n initUpload: (state, action: PayloadAction<{ id: string; upload: Upload }>) => {\n const { id, upload } = action.payload;\n state.uploadsById[id] = upload;\n },\n uploadProgress: (state, action: PayloadAction<{ id: string; progress: number }>) => {\n const { id, progress } = action.payload;\n state.uploadsById[id] = {\n ...state.uploadsById[id],\n progress\n };\n },\n cleanUpUpload: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: current, ...remainder } = state.uploadsById;\n state.uploadsById = remainder;\n },\n setVersionInformation: (state, action: PayloadAction<VersionInformation>) => {\n state.versionInformation = {\n ...state.versionInformation,\n ...action.payload\n };\n },\n setEnvironmentData: (state, action) => ({ ...state, ...action.payload }),\n setAppInitDone: state => {\n state.appInitDone = true;\n }\n }\n});\n\nexport const actions = appSlice.actions;\nexport default appSlice.reducer;\n"],"mappings":";;;AAqBA,MAAa,YAAY;AAEzB,MAAM,qBAAqB;CACzB,MAAM,wBAAQ,IAAI,MAAM;AACxB,OAAM,QAAQ,MAAM,SAAS,GAAG,EAAE;AAClC,QAAO,MAAM,aAAa;;AA8F5B,MAAa,eAA6B;CACxC,aAAa;CACb,cAAc,KAAA;CACd,QAAQ;CACR,kBAAkB;CAClB,aAAa;CACb,UAAU;EACR,QAAQ,KAAA;EACR,kBAAkB,KAAA;EAClB,SAAS;EACT,MAAM;EACN,oBAAoB;EACrB;CAED,UAAU;EACR,cAAc;EACd,cAAc;EACd,kBAAkB;EAClB,iBAAiB;EACjB,iBAAiB;EACjB,kBAAkB;EAClB,oBAAoB;EACpB,qBAAqB;EACrB,YAAY;EACZ,eAAe;EACf,UAAU;EACV,cAAc;EACf;CACD,qBAAq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GAAG,MAAM,YAAY;IACrB;IACD;;EAEH,gBAAgB,OAAO,WAAkC;GAEvD,MAAM,GAAG,OAAO,UAAU,SAAS,GAAG,cAAc,MAAM;AAC1D,SAAM,cAAc;;EAEtB,wBAAwB,OAAO,WAA8C;AAC3E,SAAM,qBAAqB;IACzB,GAAG,MAAM;IACT,GAAG,OAAO;IACX;;EAEH,qBAAqB,OAAO,YAAY;GAAE,GAAG;GAAO,GAAG,OAAO;GAAS;EACvE,iBAAgB,UAAS;AACvB,SAAM,cAAc;;EAEvB;CACF,CAAC;AAEF,MAAa,UAAU,SAAS;AAChC,IAAA,mBAAe,SAAS"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/appSlice/index.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { SnackbarProps } from '@mui/material';\n\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { SortOptions } from '../constants';\nimport { SORTING_OPTIONS } from '../constants';\n\nexport const sliceName = 'app';\n\nconst getYesterday = () => {\n const today = new Date();\n today.setDate(today.getDate() - 1);\n return today.toISOString();\n};\n\nexport type Repository = {\n name: string;\n version: string;\n};\n\nexport type VersionRelease = Partial<{ [versionInfo: string]: VersionRelease }> & {\n release?: string;\n release_date?: string;\n repos?: Repository[];\n supported_until?: string;\n};\n\nexport type SaasVersion = {\n date: string;\n tag: string;\n};\n\nexport type ReleaseData = {\n lts: string[];\n releases: {\n [version: string]: VersionRelease;\n };\n saas: SaasVersion[];\n};\nexport type TagData = { name: string }[];\n\nexport interface SnackbarContent extends Pick<SnackbarProps, 'action' | 'autoHideDuration' | 'message' | 'open'> {\n preventClickToCopy?: boolean;\n}\n\nexport interface SearchState {\n deviceIds: string[];\n isSearching: boolean;\n page?: number;\n perPage?: number;\n searchTerm: string;\n searchTotal: number;\n sort: SortOptions;\n}\n\nexport interface Upload {\n cancelSource: any;\n inprogress?: boolean;\n name?: string;\n progress: number;\n size?: number;\n}\n\ntype UILatestRelease = {\n releaseDate: string;\n repos: Record<string, string>;\n};\n\ntype VersionInformation = {\n [key: string]: string | UILatestRelease | undefined;\n backend?: string;\n GUI?: string;\n latestRelease?: UILatestRelease;\n};\n\nexport type SentryConfig = {\n isReduxEnabled?: string; // no parsing done here as this has to be accessed outside of the store\n location: string;\n replaysSessionSampleRate?: number;\n tracesSampleRate?: number;\n};\n\nexport type AppSliceType = {\n appInitDone: boolean;\n cancelSource: any;\n commit: string;\n demoArtifactLink: string;\n docsVersion: string;\n features: Record<string, boolean>;\n feedbackProbability: number;\n firstLoginAfterSignup: boolean;\n hostAddress: string | null;\n hostedAnnouncement: string;\n newThreshold: string;\n offlineThreshold: string;\n recaptchaSiteKey: string;\n searchState: SearchState;\n sentry: SentryConfig;\n snackbar: SnackbarContent;\n stripeAPIKey: string;\n trackerCode: string;\n uploadsById: Record<string, Upload>;\n versionInformation: VersionInformation;\n yesterday?: string;\n};\n\nexport const initialState: AppSliceType = {\n appInitDone: false,\n cancelSource: undefined,\n commit: '',\n demoArtifactLink: 'https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender',\n hostAddress: null,\n snackbar: {\n action: undefined,\n autoHideDuration: undefined,\n message: '',\n open: false,\n preventClickToCopy: false\n },\n // return boolean rather than organization details\n features: {\n hasAiEnabled: false,\n hasAuditlogs: false,\n hasDeltaProgress: false,\n hasMultitenancy: false,\n hasDeviceConfig: false,\n hasDeviceConnect: false,\n hasFeedbackEnabled: false,\n hasManifestsEnabled: false,\n hasMonitor: false,\n hasMCUEnabled: false,\n isHosted: true,\n isEnterprise: false\n },\n feedbackProbability: 0.3,\n firstLoginAfterSignup: false,\n hostedAnnouncement: '',\n docsVersion: '',\n recaptchaSiteKey: '',\n searchState: {\n deviceIds: [],\n searchTerm: '',\n searchTotal: 0,\n isSearching: false,\n sort: {\n direction: SORTING_OPTIONS.desc\n // key: null,\n // scope: null\n }\n },\n sentry: {\n location: '',\n replaysSessionSampleRate: 0.1,\n tracesSampleRate: 1.0\n },\n stripeAPIKey: '',\n trackerCode: '',\n uploadsById: {\n // id: { progress: 0, cancelSource: undefined }\n },\n newThreshold: getYesterday(),\n offlineThreshold: getYesterday(),\n versionInformation: {\n Integration: '',\n 'Mender-Artifact': '',\n 'Meta-Mender': ''\n },\n yesterday: undefined\n};\n\nexport const appSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n setFeatures: (state, action: PayloadAction<Record<string, boolean>>) => {\n state.features = {\n ...state.features,\n ...action.payload\n };\n },\n setSnackbar: (state, { payload }: PayloadAction<SnackbarContent | string>) => {\n if (typeof payload === 'string' || payload instanceof String) {\n state.snackbar = {\n ...initialState.snackbar,\n message: payload,\n open: !!payload\n };\n return;\n }\n const { message, autoHideDuration, action, preventClickToCopy = false } = payload;\n state.snackbar = {\n message,\n autoHideDuration,\n action,\n preventClickToCopy,\n open: !!message\n };\n },\n setFirstLoginAfterSignup: (state, action: PayloadAction<boolean>) => {\n state.firstLoginAfterSignup = action.payload;\n },\n setAnnouncement: (state, action: PayloadAction<string>) => {\n state.hostedAnnouncement = action.payload;\n },\n setSearchState: (state, action) => {\n state.searchState = {\n ...state.searchState,\n ...action.payload\n };\n },\n setOfflineThreshold: (state, action: PayloadAction<string>) => {\n state.offlineThreshold = action.payload;\n },\n initUpload: (state, action: PayloadAction<{ id: string; upload: Upload }>) => {\n const { id, upload } = action.payload;\n state.uploadsById[id] = upload;\n },\n uploadProgress: (state, action: PayloadAction<{ id: string; progress: number }>) => {\n const { id, progress } = action.payload;\n state.uploadsById[id] = {\n ...state.uploadsById[id],\n progress\n };\n },\n cleanUpUpload: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: current, ...remainder } = state.uploadsById;\n state.uploadsById = remainder;\n },\n setVersionInformation: (state, action: PayloadAction<VersionInformation>) => {\n state.versionInformation = {\n ...state.versionInformation,\n ...action.payload\n };\n },\n setEnvironmentData: (state, action) => ({ ...state, ...action.payload }),\n setAppInitDone: state => {\n state.appInitDone = true;\n }\n }\n});\n\nexport const actions = appSlice.actions;\nexport default appSlice.reducer;\n"],"mappings":";;;AAqBA,MAAa,YAAY;AAEzB,MAAM,qBAAqB;CACzB,MAAM,wBAAQ,IAAI,MAAM;CACxB,MAAM,QAAQ,MAAM,SAAS,GAAG,EAAE;CAClC,OAAO,MAAM,aAAa;;AA8F5B,MAAa,eAA6B;CACxC,aAAa;CACb,cAAc,KAAA;CACd,QAAQ;CACR,kBAAkB;CAClB,aAAa;CACb,UAAU;EACR,QAAQ,KAAA;EACR,kBAAkB,KAAA;EAClB,SAAS;EACT,MAAM;EACN,oBAAoB;EACrB;CAED,UAAU;EACR,cAAc;EACd,cAAc;EACd,kBAAkB;EAClB,iBAAiB;EACjB,iBAAiB;EACjB,kBAAkB;EAClB,oBAAoB;EACpB,qBAAqB;EACrB,YAAY;EACZ,eAAe;EACf,UAAU;EACV,cAAc;EACf;CACD,qBAAqB;CACrB,uBAAuB;CACvB,oBAAoB;CACpB,aAAa;CACb,kBAAkB;CAClB,aAAa;EACX,WAAW,EAAE;EACb,YAAY;EACZ,aAAa;EACb,aAAa;EACb,MAAM,EACJ,WAAW,gBAAgB,MAG5B;EACF;CACD,QAAQ;EACN,UAAU;EACV,0BAA0B;EAC1B,kBAAkB;EACnB;CACD,cAAc;CACd,aAAa;CACb,aAAa,EAEZ;CACD,cAAc,cAAc;CAC5B,kBAAkB,cAAc;CAChC,oBAAoB;EAClB,aAAa;EACb,mBAAmB;EACnB,eAAe;EAChB;CACD,WAAW,KAAA;CACZ;AAED,MAA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,SAAS"}
@@ -1,4 +1,4 @@
1
- import { o as SentryConfig } from "../index-CTt-eIY8.cjs";
1
+ import { o as SentryConfig } from "../index-DwACbyUg.cjs";
2
2
 
3
3
  //#region src/appSlice/mocks.d.ts
4
4
  declare const mockState: {
@@ -1,4 +1,4 @@
1
- import { o as SentryConfig } from "../index-Dv3Hfxk_.js";
1
+ import { o as SentryConfig } from "../index-Bp1WpATs.js";
2
2
 
3
3
  //#region src/appSlice/mocks.d.ts
4
4
  declare const mockState: {
@@ -1,12 +1,12 @@
1
- import { o as UserSliceType } from "../index-4eaLEXy_.cjs";
2
- import { r as ReleaseSliceType } from "../index-FyYBBeN-.cjs";
1
+ import { o as UserSliceType } from "../index-BFlHWzjv.cjs";
2
+ import { i as ReleaseSliceType } from "../index-C-q632wO.cjs";
3
3
  import { n as OnboardingSliceType } from "../index-UPc3wvVd.cjs";
4
4
  import { o as DeploymentsSliceType } from "../index-BP0uAq36.cjs";
5
- import { s as DeviceSliceType } from "../index-Lz5JsJ6O.cjs";
6
- import { a as SearchState, l as Upload, o as SentryConfig, s as SnackbarContent, t as AppSliceType } from "../index-CTt-eIY8.cjs";
7
- import { t as MonitorSliceType } from "../index-BEVkIiNa.cjs";
8
- import { t as OrganizationSliceType } from "../index-Bwx9jEiL.cjs";
9
- import { r as RootState } from "../store-BiIA0r0A.cjs";
5
+ import { s as DeviceSliceType } from "../index-B64X5ozM.cjs";
6
+ import { a as SearchState, l as Upload, o as SentryConfig, s as SnackbarContent, t as AppSliceType } from "../index-DwACbyUg.cjs";
7
+ import { t as MonitorSliceType } from "../index-CT5hgXm9.cjs";
8
+ import { t as OrganizationSliceType } from "../index-BbaS7MzW.cjs";
9
+ import { r as RootState } from "../store-b5cF2WB5.cjs";
10
10
  import * as _$reselect from "reselect";
11
11
 
12
12
  //#region src/appSlice/selectors.d.ts
@@ -1,12 +1,12 @@
1
- import { o as UserSliceType } from "../index-DtePEQPT.js";
2
- import { r as ReleaseSliceType } from "../index-Cvkvcz4r.js";
1
+ import { o as UserSliceType } from "../index-ez3oxfRo.js";
2
+ import { i as ReleaseSliceType } from "../index-CyokFK2e.js";
3
3
  import { n as OnboardingSliceType } from "../index-CJkrL0oA.js";
4
4
  import { o as DeploymentsSliceType } from "../index-CkwVnIqd.js";
5
- import { s as DeviceSliceType } from "../index-DqyY6oZ3.js";
6
- import { a as SearchState, l as Upload, o as SentryConfig, s as SnackbarContent, t as AppSliceType } from "../index-Dv3Hfxk_.js";
7
- import { t as MonitorSliceType } from "../index-CO-py5d4.js";
8
- import { t as OrganizationSliceType } from "../index-DJSlDPRX.js";
9
- import { r as RootState } from "../store-BQxOSRC1.js";
5
+ import { s as DeviceSliceType } from "../index-BI9O8JWe.js";
6
+ import { a as SearchState, l as Upload, o as SentryConfig, s as SnackbarContent, t as AppSliceType } from "../index-Bp1WpATs.js";
7
+ import { t as MonitorSliceType } from "../index-DUvrw_Ed.js";
8
+ import { t as OrganizationSliceType } from "../index-C6wNUfiV.js";
9
+ import { r as RootState } from "../store-D-xvZXiY.js";
10
10
  import * as _$reselect from "reselect";
11
11
 
12
12
  //#region src/appSlice/selectors.d.ts
@@ -1,5 +1,5 @@
1
- import { a as SearchState } from "../index-CTt-eIY8.cjs";
2
- import { r as RootState, t as AppDispatch } from "../store-BiIA0r0A.cjs";
1
+ import { a as SearchState } from "../index-DwACbyUg.cjs";
2
+ import { r as RootState, t as AppDispatch } from "../store-b5cF2WB5.cjs";
3
3
  import * as _$_reduxjs_toolkit0 from "@reduxjs/toolkit";
4
4
 
5
5
  //#region src/appSlice/thunks.d.ts
@@ -1,5 +1,5 @@
1
- import { a as SearchState } from "../index-Dv3Hfxk_.js";
2
- import { r as RootState, t as AppDispatch } from "../store-BQxOSRC1.js";
1
+ import { a as SearchState } from "../index-Bp1WpATs.js";
2
+ import { r as RootState, t as AppDispatch } from "../store-D-xvZXiY.js";
3
3
  import * as _$_reduxjs_toolkit0 from "@reduxjs/toolkit";
4
4
 
5
5
  //#region src/appSlice/thunks.d.ts
package/dist/auth.cjs CHANGED
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("./chunk-CKQMccvm.cjs");
3
3
  const require_constants = require("./constants.cjs");
4
4
  let universal_cookie = require("universal-cookie");
5
- universal_cookie = require_chunk.__toESM(universal_cookie);
5
+ universal_cookie = require_chunk.__toESM(universal_cookie, 1);
6
6
  let _northern_tech_utils_constants = require("@northern.tech/utils/constants");
7
7
  //#region src/auth.ts
8
8
  const cookies = new universal_cookie.default();
package/dist/auth.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"auth.cjs","names":["Cookies","maxSessionAge","TIMEOUTS"],"sources":["../src/auth.ts"],"sourcesContent":["// Copyright 2016 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport Cookies from 'universal-cookie';\n\nimport { TIMEOUTS, maxSessionAge } from './constants';\nimport type { UserSession } from './usersSlice';\n\nconst cookies = new Cookies();\n\nconst emptySession = Object.freeze({ token: '', expiresAt: undefined }) as Readonly<UserSession>;\n\nlet tokenCache = '';\n\nexport const getSessionInfo = (): UserSession => {\n let sessionInfo = { ...emptySession } as UserSession;\n try {\n sessionInfo = JSON.parse(window.localStorage.getItem('JWT') ?? '');\n } catch {\n // most likely not logged in - nothing to do here\n }\n\n // check for cookie first to handles sso login while an old/expired token may still exist in cache/ localStorage\n const jwtTokenFromCookie = cookies.get('JWT', { doNotParse: true }) ?? '';\n if (jwtTokenFromCookie) {\n setSessionInfo({ token: jwtTokenFromCookie });\n cookies.remove('JWT');\n cookies.remove('JWT', { path: '/' });\n return { token: jwtTokenFromCookie, expiresAt: undefined };\n }\n if (sessionInfo.expiresAt && new Date(sessionInfo.expiresAt) < new Date()) {\n cleanUp();\n return { ...emptySession };\n }\n sessionInfo.token = sessionInfo.token || '';\n tokenCache = sessionInfo.token;\n return sessionInfo;\n};\n\nexport const getToken = () => (tokenCache ? tokenCache : getSessionInfo().token);\n\nexport const setSessionInfo = ({ token, expiresAt }: UserSession) => {\n tokenCache = token;\n window.localStorage.setItem('JWT', JSON.stringify({ token, expiresAt }));\n};\n\nexport const cleanUp = () => {\n tokenCache = '';\n cookies.remove('JWT');\n cookies.remove('JWT', { path: '/' });\n window.localStorage.removeItem('JWT');\n window.localStorage.removeItem('oauth');\n};\n\nexport const updateMaxAge = ({ expiresAt, token }) => {\n const oAuthExpiration = Number(window.localStorage.getItem('oauth'));\n let updateWithOAuth = false;\n if (oAuthExpiration) {\n const soon = Date.now() + maxSessionAge * TIMEOUTS.oneSecond;\n updateWithOAuth = oAuthExpiration <= soon;\n if (updateWithOAuth) {\n window.localStorage.removeItem('oauth');\n }\n }\n if (token && expiresAt && (!oAuthExpiration || updateWithOAuth)) {\n const expiration = new Date();\n expiration.setSeconds(expiration.getSeconds() + maxSessionAge);\n setSessionInfo({ token, expiresAt: expiration.toISOString() });\n }\n};\n"],"mappings":";;;;;;;AAkBA,MAAM,UAAU,IAAIA,iBAAAA,SAAS;AAE7B,MAAM,eAAe,OAAO,OAAO;CAAE,OAAO;CAAI,WAAW,KAAA;CAAW,CAAC;AAEvE,IAAI,aAAa;AAEjB,MAAa,uBAAoC;CAC/C,IAAI,cAAc,EAAE,GAAG,cAAc;AACrC,KAAI;AACF,gBAAc,KAAK,MAAM,OAAO,aAAa,QAAQ,MAAM,IAAI,GAAG;SAC5D;CAKR,MAAM,qBAAqB,QAAQ,IAAI,OAAO,EAAE,YAAY,MAAM,CAAC,IAAI;AACvE,KAAI,oBAAoB;AACtB,iBAAe,EAAE,OAAO,oBAAoB,CAAC;AAC7C,UAAQ,OAAO,MAAM;AACrB,UAAQ,OAAO,OAAO,EAAE,MAAM,KAAK,CAAC;AACpC,SAAO;GAAE,OAAO;GAAoB,WAAW,KAAA;GAAW;;AAE5D,KAAI,YAAY,aAAa,IAAI,KAAK,YAAY,UAAU,mBAAG,IAAI,MAAM,EAAE;AACzE,WAAS;AACT,SAAO,EAAE,GAAG,cAAc;;AAE5B,aAAY,QAAQ,YAAY,SAAS;AACzC,cAAa,YAAY;AACzB,QAAO;;AAGT,MAAa,iBAAkB,aAAa,aAAa,gBAAgB,CAAC;AAE1E,MAAa,kBAAkB,EAAE,OAAO,gBAA6B;AACnE,cAAa;AACb,QAAO,aAAa,QAAQ,OAAO,KAAK,UAAU;EAAE;EAAO;EAAW,CAAC,CAAC;;AAG1E,MAAa,gBAAgB;AAC3B,cAAa;AACb,SAAQ,OAAO,MAAM;AACrB,SAAQ,OAAO,OAAO,EAAE,MAAM,KAAK,CAAC;AACpC,QAAO,aAAa,WAAW,MAAM;AACrC,QAAO,aAAa,WAAW,QAAQ;;AAGzC,MAAa,gBAAgB,EAAE,WAAW,YAAY;CACpD,MAAM,kBAAkB,OAAO,OAAO,aAAa,QAAQ,QAAQ,CAAC;CACpE,IAAI,kBAAkB;AACtB,KAAI,iBAAiB;AAEnB,oBAAkB,mBADL,KAAK,KAAK,GAAGC,+BAAAA,gBAAgBC,kBAAAA,SAAS;AAEnD,MAAI,gBACF,QAAO,aAAa,WAAW,QAAQ;;AAG3C,KAAI,SAAS,cAAc,CAAC,mBAAmB,kBAAkB;EAC/D,MAAM,6BAAa,IAAI,MAAM;AAC7B,aAAW,WAAW,WAAW,YAAY,GAAGD,+BAAAA,cAAc;AAC9D,iBAAe;GAAE;GAAO,WAAW,WAAW,aAAa;GAAE,CAAC"}
1
+ {"version":3,"file":"auth.cjs","names":["Cookies","maxSessionAge","TIMEOUTS"],"sources":["../src/auth.ts"],"sourcesContent":["// Copyright 2016 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport Cookies from 'universal-cookie';\n\nimport { TIMEOUTS, maxSessionAge } from './constants';\nimport type { UserSession } from './usersSlice';\n\nconst cookies = new Cookies();\n\nconst emptySession = Object.freeze({ token: '', expiresAt: undefined }) as Readonly<UserSession>;\n\nlet tokenCache = '';\n\nexport const getSessionInfo = (): UserSession => {\n let sessionInfo = { ...emptySession } as UserSession;\n try {\n sessionInfo = JSON.parse(window.localStorage.getItem('JWT') ?? '');\n } catch {\n // most likely not logged in - nothing to do here\n }\n\n // check for cookie first to handles sso login while an old/expired token may still exist in cache/ localStorage\n const jwtTokenFromCookie = cookies.get('JWT', { doNotParse: true }) ?? '';\n if (jwtTokenFromCookie) {\n setSessionInfo({ token: jwtTokenFromCookie });\n cookies.remove('JWT');\n cookies.remove('JWT', { path: '/' });\n return { token: jwtTokenFromCookie, expiresAt: undefined };\n }\n if (sessionInfo.expiresAt && new Date(sessionInfo.expiresAt) < new Date()) {\n cleanUp();\n return { ...emptySession };\n }\n sessionInfo.token = sessionInfo.token || '';\n tokenCache = sessionInfo.token;\n return sessionInfo;\n};\n\nexport const getToken = () => (tokenCache ? tokenCache : getSessionInfo().token);\n\nexport const setSessionInfo = ({ token, expiresAt }: UserSession) => {\n tokenCache = token;\n window.localStorage.setItem('JWT', JSON.stringify({ token, expiresAt }));\n};\n\nexport const cleanUp = () => {\n tokenCache = '';\n cookies.remove('JWT');\n cookies.remove('JWT', { path: '/' });\n window.localStorage.removeItem('JWT');\n window.localStorage.removeItem('oauth');\n};\n\nexport const updateMaxAge = ({ expiresAt, token }) => {\n const oAuthExpiration = Number(window.localStorage.getItem('oauth'));\n let updateWithOAuth = false;\n if (oAuthExpiration) {\n const soon = Date.now() + maxSessionAge * TIMEOUTS.oneSecond;\n updateWithOAuth = oAuthExpiration <= soon;\n if (updateWithOAuth) {\n window.localStorage.removeItem('oauth');\n }\n }\n if (token && expiresAt && (!oAuthExpiration || updateWithOAuth)) {\n const expiration = new Date();\n expiration.setSeconds(expiration.getSeconds() + maxSessionAge);\n setSessionInfo({ token, expiresAt: expiration.toISOString() });\n }\n};\n"],"mappings":";;;;;;;AAkBA,MAAM,UAAU,IAAIA,iBAAAA,SAAS;AAE7B,MAAM,eAAe,OAAO,OAAO;CAAE,OAAO;CAAI,WAAW,KAAA;CAAW,CAAC;AAEvE,IAAI,aAAa;AAEjB,MAAa,uBAAoC;CAC/C,IAAI,cAAc,EAAE,GAAG,cAAc;CACrC,IAAI;EACF,cAAc,KAAK,MAAM,OAAO,aAAa,QAAQ,MAAM,IAAI,GAAG;SAC5D;CAKR,MAAM,qBAAqB,QAAQ,IAAI,OAAO,EAAE,YAAY,MAAM,CAAC,IAAI;CACvE,IAAI,oBAAoB;EACtB,eAAe,EAAE,OAAO,oBAAoB,CAAC;EAC7C,QAAQ,OAAO,MAAM;EACrB,QAAQ,OAAO,OAAO,EAAE,MAAM,KAAK,CAAC;EACpC,OAAO;GAAE,OAAO;GAAoB,WAAW,KAAA;GAAW;;CAE5D,IAAI,YAAY,aAAa,IAAI,KAAK,YAAY,UAAU,mBAAG,IAAI,MAAM,EAAE;EACzE,SAAS;EACT,OAAO,EAAE,GAAG,cAAc;;CAE5B,YAAY,QAAQ,YAAY,SAAS;CACzC,aAAa,YAAY;CACzB,OAAO;;AAGT,MAAa,iBAAkB,aAAa,aAAa,gBAAgB,CAAC;AAE1E,MAAa,kBAAkB,EAAE,OAAO,gBAA6B;CACnE,aAAa;CACb,OAAO,aAAa,QAAQ,OAAO,KAAK,UAAU;EAAE;EAAO;EAAW,CAAC,CAAC;;AAG1E,MAAa,gBAAgB;CAC3B,aAAa;CACb,QAAQ,OAAO,MAAM;CACrB,QAAQ,O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