@northern.tech/store 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (395) hide show
  1. package/dist/actions.cjs +1812 -0
  2. package/dist/actions.cjs.map +1 -0
  3. package/dist/actions.js +18 -1860
  4. package/dist/actions.js.map +1 -1
  5. package/dist/api/general-api.cjs +336 -0
  6. package/dist/api/general-api.cjs.map +1 -0
  7. package/dist/api/general-api.js +15 -1051
  8. package/dist/api/general-api.js.map +1 -1
  9. package/dist/api/users-api.cjs +342 -0
  10. package/dist/api/users-api.cjs.map +1 -0
  11. package/dist/api/users-api.js +12 -1062
  12. package/dist/api/users-api.js.map +1 -1
  13. package/dist/appSlice/constants.cjs +207 -0
  14. package/dist/appSlice/constants.cjs.map +1 -0
  15. package/dist/appSlice/{constants.d.mts → constants.d.cts} +12 -1
  16. package/dist/appSlice/constants.d.ts +12 -1
  17. package/dist/appSlice/constants.js +39 -181
  18. package/dist/appSlice/constants.js.map +1 -1
  19. package/dist/appSlice/index.cjs +393 -0
  20. package/dist/appSlice/index.cjs.map +1 -0
  21. package/dist/appSlice/index.js +18 -1112
  22. package/dist/appSlice/index.js.map +1 -1
  23. package/dist/appSlice/selectors.cjs +58 -0
  24. package/dist/appSlice/selectors.cjs.map +1 -0
  25. package/dist/appSlice/selectors.js +17 -46
  26. package/dist/appSlice/selectors.js.map +1 -1
  27. package/dist/appSlice/thunks.cjs +4670 -0
  28. package/dist/appSlice/thunks.cjs.map +1 -0
  29. package/dist/appSlice/thunks.js +42 -5750
  30. package/dist/appSlice/thunks.js.map +1 -1
  31. package/dist/auth.cjs +320 -0
  32. package/dist/auth.cjs.map +1 -0
  33. package/dist/auth.js +20 -1031
  34. package/dist/auth.js.map +1 -1
  35. package/dist/{chunk-5VNQCCAQ.mjs → chunk-25AKG5HH.js} +5 -2
  36. package/dist/chunk-25AKG5HH.js.map +1 -0
  37. package/dist/{chunk-NJNSCJEY.mjs → chunk-2RJIDREZ.js} +21 -24
  38. package/dist/chunk-2RJIDREZ.js.map +1 -0
  39. package/dist/{chunk-QQBUNZHA.mjs → chunk-4B3IMP4I.js} +17 -12
  40. package/dist/{chunk-QQBUNZHA.mjs.map → chunk-4B3IMP4I.js.map} +1 -1
  41. package/dist/{chunk-3ORTTLIB.mjs → chunk-7PVGDMNM.js} +2 -2
  42. package/dist/{chunk-IFWKT27G.mjs → chunk-A6CT6GTI.js} +3 -3
  43. package/dist/{chunk-ZK4W5T53.mjs → chunk-AMGWP7A4.js} +2 -2
  44. package/dist/{chunk-KJAZNKV2.mjs → chunk-ANB5BM5J.js} +29 -29
  45. package/dist/{chunk-DIZJVB6M.mjs → chunk-APHL4JZP.js} +77 -433
  46. package/dist/chunk-APHL4JZP.js.map +1 -0
  47. package/dist/{chunk-G4FGNSV3.mjs → chunk-CK6YE6AN.js} +1 -1
  48. package/dist/{chunk-4SDUITD4.mjs → chunk-CYV6632F.js} +2 -2
  49. package/dist/{chunk-JA27QXVB.mjs → chunk-E5LEU5PF.js} +3 -3
  50. package/dist/{chunk-B42NUKMZ.mjs → chunk-FGKMJS3B.js} +1 -1
  51. package/dist/{chunk-WYHJFSMQ.mjs → chunk-JAROCU6M.js} +3 -3
  52. package/dist/{chunk-QBKCUIWO.mjs → chunk-JIS4PA3R.js} +1 -1
  53. package/dist/{chunk-XD7INCM4.mjs → chunk-KAQJH2YL.js} +4 -4
  54. package/dist/{chunk-2Z3RFYW4.mjs → chunk-LIJIIRON.js} +1 -1
  55. package/dist/{chunk-O6TYYKSD.mjs → chunk-MDC7Y3EX.js} +20 -70
  56. package/dist/chunk-MDC7Y3EX.js.map +1 -0
  57. package/dist/{chunk-IU4OXOPA.mjs → chunk-MRCFLG45.js} +1 -1
  58. package/dist/{chunk-WCUGLHYM.mjs → chunk-NI4SZOCF.js} +13 -13
  59. package/dist/chunk-NMAXZ3ZY.js +1 -0
  60. package/dist/{chunk-H5UCKQWK.mjs → chunk-NNADGHSL.js} +16 -16
  61. package/dist/{chunk-K2NZL5V4.mjs → chunk-Q6M5TTDQ.js} +2 -2
  62. package/dist/{chunk-CHUCIHMY.mjs → chunk-RX55KAKX.js} +2 -2
  63. package/dist/{chunk-ZE7R2XXE.mjs → chunk-UEP36GCI.js} +3 -3
  64. package/dist/{chunk-XC5UXEIB.mjs → chunk-VOCOFE4I.js} +2 -2
  65. package/dist/{chunk-R7LXL3KJ.mjs → chunk-XTRPX7JZ.js} +3 -3
  66. package/dist/{chunk-6CSGHZ3E.mjs → chunk-XXHONFSQ.js} +3 -3
  67. package/dist/{chunk-KPPU6OWF.mjs → chunk-YETZPQFR.js} +4 -19
  68. package/dist/chunk-YETZPQFR.js.map +1 -0
  69. package/dist/{chunk-KZSTW27Q.mjs → chunk-YGBFDXXA.js} +2 -2
  70. package/dist/{chunk-H2PQQMRY.mjs → chunk-YO22XLHI.js} +1 -1
  71. package/dist/{chunk-65YIOCCD.mjs → chunk-YT73QWCN.js} +3 -3
  72. package/dist/{chunk-AZRVRNXT.mjs → chunk-YTQUNAZP.js} +3 -3
  73. package/dist/commonConstants.cjs +285 -0
  74. package/dist/commonConstants.cjs.map +1 -0
  75. package/dist/{commonConstants.d.mts → commonConstants.d.cts} +3 -3
  76. package/dist/commonConstants.d.ts +3 -3
  77. package/dist/commonConstants.js +37 -268
  78. package/dist/commonConstants.js.map +1 -1
  79. package/dist/commonSelectors.cjs +1487 -0
  80. package/dist/commonSelectors.cjs.map +1 -0
  81. package/dist/commonSelectors.js +53 -1500
  82. package/dist/commonSelectors.js.map +1 -1
  83. package/dist/constants.cjs +1297 -0
  84. package/dist/constants.cjs.map +1 -0
  85. package/dist/{constants.d.mts → constants.d.cts} +10 -10
  86. package/dist/constants.d.ts +1 -1
  87. package/dist/constants.js +220 -1189
  88. package/dist/constants.js.map +1 -1
  89. package/dist/deploymentdevicehook.cjs +4686 -0
  90. package/dist/deploymentdevicehook.cjs.map +1 -0
  91. package/dist/deploymentdevicehook.d.cts +3 -0
  92. package/dist/deploymentdevicehook.d.ts +3 -0
  93. package/dist/deploymentdevicehook.js +60 -0
  94. package/dist/deploymentdevicehook.js.map +1 -0
  95. package/dist/deploymentsSlice/constants.cjs +562 -0
  96. package/dist/deploymentsSlice/constants.cjs.map +1 -0
  97. package/dist/deploymentsSlice/constants.js +39 -1006
  98. package/dist/deploymentsSlice/constants.js.map +1 -1
  99. package/dist/deploymentsSlice/index.cjs +648 -0
  100. package/dist/deploymentsSlice/index.cjs.map +1 -0
  101. package/dist/deploymentsSlice/index.js +18 -1104
  102. package/dist/deploymentsSlice/index.js.map +1 -1
  103. package/dist/deploymentsSlice/selectors.cjs +561 -0
  104. package/dist/deploymentsSlice/selectors.cjs.map +1 -0
  105. package/dist/deploymentsSlice/selectors.js +22 -1014
  106. package/dist/deploymentsSlice/selectors.js.map +1 -1
  107. package/dist/deploymentsSlice/thunks.cjs +4686 -0
  108. package/dist/deploymentsSlice/thunks.cjs.map +1 -0
  109. package/dist/deploymentsSlice/thunks.js +60 -5757
  110. package/dist/deploymentsSlice/thunks.js.map +1 -1
  111. package/dist/devicesSlice/constants.cjs +435 -0
  112. package/dist/devicesSlice/constants.cjs.map +1 -0
  113. package/dist/devicesSlice/constants.js +37 -1007
  114. package/dist/devicesSlice/constants.js.map +1 -1
  115. package/dist/devicesSlice/index.cjs +586 -0
  116. package/dist/devicesSlice/index.cjs.map +1 -0
  117. package/dist/devicesSlice/index.js +18 -1161
  118. package/dist/devicesSlice/index.js.map +1 -1
  119. package/dist/devicesSlice/selectors.cjs +531 -0
  120. package/dist/devicesSlice/selectors.cjs.map +1 -0
  121. package/dist/devicesSlice/selectors.js +50 -1097
  122. package/dist/devicesSlice/selectors.js.map +1 -1
  123. package/dist/devicesSlice/thunks.cjs +4758 -0
  124. package/dist/devicesSlice/thunks.cjs.map +1 -0
  125. package/dist/devicesSlice/{thunks.d.mts → thunks.d.cts} +3 -3
  126. package/dist/devicesSlice/thunks.d.ts +3 -3
  127. package/dist/devicesSlice/thunks.js +132 -5793
  128. package/dist/devicesSlice/thunks.js.map +1 -1
  129. package/dist/monitorSlice/constants.cjs +165 -0
  130. package/dist/monitorSlice/constants.cjs.map +1 -0
  131. package/dist/monitorSlice/constants.js +11 -970
  132. package/dist/monitorSlice/constants.js.map +1 -1
  133. package/dist/monitorSlice/index.cjs +435 -0
  134. package/dist/monitorSlice/index.cjs.map +1 -0
  135. package/dist/monitorSlice/index.js +18 -1022
  136. package/dist/monitorSlice/index.js.map +1 -1
  137. package/dist/monitorSlice/selectors.cjs +31 -0
  138. package/dist/monitorSlice/selectors.cjs.map +1 -0
  139. package/dist/monitorSlice/selectors.js +5 -25
  140. package/dist/monitorSlice/selectors.js.map +1 -1
  141. package/dist/monitorSlice/thunks.cjs +2623 -0
  142. package/dist/monitorSlice/thunks.cjs.map +1 -0
  143. package/dist/monitorSlice/{thunks.d.mts → thunks.d.cts} +1 -1
  144. package/dist/monitorSlice/thunks.d.ts +1 -1
  145. package/dist/monitorSlice/thunks.js +41 -2624
  146. package/dist/monitorSlice/thunks.js.map +1 -1
  147. package/dist/onboardingSlice/constants.cjs +71 -0
  148. package/dist/onboardingSlice/constants.cjs.map +1 -0
  149. package/dist/onboardingSlice/constants.js +7 -64
  150. package/dist/onboardingSlice/constants.js.map +1 -1
  151. package/dist/onboardingSlice/index.cjs +80 -0
  152. package/dist/onboardingSlice/index.cjs.map +1 -0
  153. package/dist/onboardingSlice/index.js +13 -71
  154. package/dist/onboardingSlice/index.js.map +1 -1
  155. package/dist/onboardingSlice/selectors.cjs +31 -0
  156. package/dist/onboardingSlice/selectors.cjs.map +1 -0
  157. package/dist/onboardingSlice/selectors.js +5 -25
  158. package/dist/onboardingSlice/selectors.js.map +1 -1
  159. package/dist/onboardingSlice/thunks.cjs +4774 -0
  160. package/dist/onboardingSlice/thunks.cjs.map +1 -0
  161. package/dist/onboardingSlice/thunks.js +48 -5753
  162. package/dist/onboardingSlice/thunks.js.map +1 -1
  163. package/dist/organizationSlice/constants.cjs +830 -0
  164. package/dist/organizationSlice/constants.cjs.map +1 -0
  165. package/dist/organizationSlice/constants.js +33 -1014
  166. package/dist/organizationSlice/constants.js.map +1 -1
  167. package/dist/organizationSlice/index.cjs +505 -0
  168. package/dist/organizationSlice/index.cjs.map +1 -0
  169. package/dist/organizationSlice/index.js +18 -1067
  170. package/dist/organizationSlice/index.js.map +1 -1
  171. package/dist/organizationSlice/selectors.cjs +300 -0
  172. package/dist/organizationSlice/selectors.cjs.map +1 -0
  173. package/dist/organizationSlice/selectors.js +36 -1013
  174. package/dist/organizationSlice/selectors.js.map +1 -1
  175. package/dist/organizationSlice/thunks.cjs +5006 -0
  176. package/dist/organizationSlice/thunks.cjs.map +1 -0
  177. package/dist/organizationSlice/{thunks.d.mts → thunks.d.cts} +2 -2
  178. package/dist/organizationSlice/thunks.d.ts +2 -2
  179. package/dist/organizationSlice/thunks.js +98 -5776
  180. package/dist/organizationSlice/thunks.js.map +1 -1
  181. package/dist/releasesSlice/constants.cjs +40 -0
  182. package/dist/releasesSlice/constants.cjs.map +1 -0
  183. package/dist/releasesSlice/constants.js +11 -31
  184. package/dist/releasesSlice/constants.js.map +1 -1
  185. package/dist/releasesSlice/index.cjs +355 -0
  186. package/dist/releasesSlice/index.cjs.map +1 -0
  187. package/dist/releasesSlice/index.js +18 -1070
  188. package/dist/releasesSlice/index.js.map +1 -1
  189. package/dist/releasesSlice/selectors.cjs +290 -0
  190. package/dist/releasesSlice/selectors.cjs.map +1 -0
  191. package/dist/releasesSlice/selectors.js +25 -1009
  192. package/dist/releasesSlice/selectors.js.map +1 -1
  193. package/dist/releasesSlice/thunks.cjs +2896 -0
  194. package/dist/releasesSlice/thunks.cjs.map +1 -0
  195. package/dist/releasesSlice/{thunks.d.mts → thunks.d.cts} +1 -1
  196. package/dist/releasesSlice/thunks.d.ts +1 -1
  197. package/dist/releasesSlice/thunks.js +63 -2931
  198. package/dist/releasesSlice/thunks.js.map +1 -1
  199. package/dist/selectors.cjs +1641 -0
  200. package/dist/selectors.cjs.map +1 -0
  201. package/dist/{selectors.d.mts → selectors.d.cts} +9 -9
  202. package/dist/selectors.js +206 -1582
  203. package/dist/selectors.js.map +1 -1
  204. package/dist/store.cjs +1932 -0
  205. package/dist/store.cjs.map +1 -0
  206. package/dist/store.js +28 -1980
  207. package/dist/store.js.map +1 -1
  208. package/dist/storehooks.cjs +5565 -0
  209. package/dist/storehooks.cjs.map +1 -0
  210. package/dist/storehooks.js +122 -5802
  211. package/dist/storehooks.js.map +1 -1
  212. package/dist/thunks.cjs +5675 -0
  213. package/dist/thunks.cjs.map +1 -0
  214. package/dist/{thunks.d.mts → thunks.d.cts} +8 -8
  215. package/dist/thunks.js +360 -5910
  216. package/dist/thunks.js.map +1 -1
  217. package/dist/usersSlice/constants.cjs +798 -0
  218. package/dist/usersSlice/constants.cjs.map +1 -0
  219. package/dist/usersSlice/constants.js +42 -1001
  220. package/dist/usersSlice/constants.js.map +1 -1
  221. package/dist/usersSlice/index.cjs +890 -0
  222. package/dist/usersSlice/index.cjs.map +1 -0
  223. package/dist/usersSlice/index.js +18 -1107
  224. package/dist/usersSlice/index.js.map +1 -1
  225. package/dist/usersSlice/selectors.cjs +826 -0
  226. package/dist/usersSlice/selectors.cjs.map +1 -0
  227. package/dist/usersSlice/selectors.js +35 -1034
  228. package/dist/usersSlice/selectors.js.map +1 -1
  229. package/dist/usersSlice/thunks.cjs +4732 -0
  230. package/dist/usersSlice/thunks.cjs.map +1 -0
  231. package/dist/usersSlice/thunks.js +106 -5780
  232. package/dist/usersSlice/thunks.js.map +1 -1
  233. package/dist/utils.cjs +739 -0
  234. package/dist/utils.cjs.map +1 -0
  235. package/dist/{utils.d.mts → utils.d.cts} +1 -3
  236. package/dist/utils.d.ts +1 -3
  237. package/dist/utils.js +42 -1186
  238. package/dist/utils.js.map +1 -1
  239. package/package.json +78 -52
  240. package/dist/actions.mjs +0 -21
  241. package/dist/api/general-api.mjs +0 -18
  242. package/dist/api/general-api.mjs.map +0 -1
  243. package/dist/api/users-api.mjs +0 -15
  244. package/dist/api/users-api.mjs.map +0 -1
  245. package/dist/appSlice/constants.mjs +0 -42
  246. package/dist/appSlice/constants.mjs.map +0 -1
  247. package/dist/appSlice/index.mjs +0 -21
  248. package/dist/appSlice/index.mjs.map +0 -1
  249. package/dist/appSlice/selectors.mjs +0 -20
  250. package/dist/appSlice/selectors.mjs.map +0 -1
  251. package/dist/appSlice/thunks.mjs +0 -45
  252. package/dist/appSlice/thunks.mjs.map +0 -1
  253. package/dist/auth.mjs +0 -23
  254. package/dist/auth.mjs.map +0 -1
  255. package/dist/chunk-5VNQCCAQ.mjs.map +0 -1
  256. package/dist/chunk-DIZJVB6M.mjs.map +0 -1
  257. package/dist/chunk-KPPU6OWF.mjs.map +0 -1
  258. package/dist/chunk-LZOMFHX3.mjs +0 -38
  259. package/dist/chunk-LZOMFHX3.mjs.map +0 -1
  260. package/dist/chunk-NJNSCJEY.mjs.map +0 -1
  261. package/dist/chunk-O6TYYKSD.mjs.map +0 -1
  262. package/dist/chunk-V32GTKOS.mjs +0 -1
  263. package/dist/chunk-V32GTKOS.mjs.map +0 -1
  264. package/dist/commonConstants.mjs +0 -40
  265. package/dist/commonConstants.mjs.map +0 -1
  266. package/dist/commonSelectors.mjs +0 -56
  267. package/dist/commonSelectors.mjs.map +0 -1
  268. package/dist/constants.mjs +0 -223
  269. package/dist/constants.mjs.map +0 -1
  270. package/dist/deploymentsSlice/constants.mjs +0 -42
  271. package/dist/deploymentsSlice/constants.mjs.map +0 -1
  272. package/dist/deploymentsSlice/index.mjs +0 -21
  273. package/dist/deploymentsSlice/index.mjs.map +0 -1
  274. package/dist/deploymentsSlice/selectors.mjs +0 -25
  275. package/dist/deploymentsSlice/selectors.mjs.map +0 -1
  276. package/dist/deploymentsSlice/thunks.mjs +0 -63
  277. package/dist/deploymentsSlice/thunks.mjs.map +0 -1
  278. package/dist/devicesSlice/constants.mjs +0 -40
  279. package/dist/devicesSlice/constants.mjs.map +0 -1
  280. package/dist/devicesSlice/index.mjs +0 -21
  281. package/dist/devicesSlice/index.mjs.map +0 -1
  282. package/dist/devicesSlice/selectors.mjs +0 -53
  283. package/dist/devicesSlice/selectors.mjs.map +0 -1
  284. package/dist/devicesSlice/thunks.mjs +0 -135
  285. package/dist/devicesSlice/thunks.mjs.map +0 -1
  286. package/dist/monitorSlice/constants.mjs +0 -14
  287. package/dist/monitorSlice/constants.mjs.map +0 -1
  288. package/dist/monitorSlice/index.mjs +0 -21
  289. package/dist/monitorSlice/index.mjs.map +0 -1
  290. package/dist/monitorSlice/selectors.mjs +0 -8
  291. package/dist/monitorSlice/selectors.mjs.map +0 -1
  292. package/dist/monitorSlice/thunks.mjs +0 -44
  293. package/dist/monitorSlice/thunks.mjs.map +0 -1
  294. package/dist/onboardingSlice/constants.mjs +0 -10
  295. package/dist/onboardingSlice/constants.mjs.map +0 -1
  296. package/dist/onboardingSlice/index.mjs +0 -16
  297. package/dist/onboardingSlice/index.mjs.map +0 -1
  298. package/dist/onboardingSlice/selectors.mjs +0 -8
  299. package/dist/onboardingSlice/selectors.mjs.map +0 -1
  300. package/dist/onboardingSlice/thunks.mjs +0 -51
  301. package/dist/onboardingSlice/thunks.mjs.map +0 -1
  302. package/dist/organizationSlice/constants.mjs +0 -36
  303. package/dist/organizationSlice/constants.mjs.map +0 -1
  304. package/dist/organizationSlice/index.mjs +0 -21
  305. package/dist/organizationSlice/index.mjs.map +0 -1
  306. package/dist/organizationSlice/selectors.mjs +0 -39
  307. package/dist/organizationSlice/selectors.mjs.map +0 -1
  308. package/dist/organizationSlice/thunks.mjs +0 -101
  309. package/dist/organizationSlice/thunks.mjs.map +0 -1
  310. package/dist/releasesSlice/constants.mjs +0 -14
  311. package/dist/releasesSlice/constants.mjs.map +0 -1
  312. package/dist/releasesSlice/index.mjs +0 -21
  313. package/dist/releasesSlice/index.mjs.map +0 -1
  314. package/dist/releasesSlice/selectors.mjs +0 -28
  315. package/dist/releasesSlice/selectors.mjs.map +0 -1
  316. package/dist/releasesSlice/thunks.mjs +0 -66
  317. package/dist/releasesSlice/thunks.mjs.map +0 -1
  318. package/dist/selectors.mjs +0 -209
  319. package/dist/selectors.mjs.map +0 -1
  320. package/dist/store.mjs +0 -32
  321. package/dist/store.mjs.map +0 -1
  322. package/dist/storehooks.mjs +0 -282
  323. package/dist/storehooks.mjs.map +0 -1
  324. package/dist/thunks.mjs +0 -363
  325. package/dist/thunks.mjs.map +0 -1
  326. package/dist/usersSlice/constants.mjs +0 -45
  327. package/dist/usersSlice/constants.mjs.map +0 -1
  328. package/dist/usersSlice/index.mjs +0 -21
  329. package/dist/usersSlice/index.mjs.map +0 -1
  330. package/dist/usersSlice/selectors.mjs +0 -38
  331. package/dist/usersSlice/selectors.mjs.map +0 -1
  332. package/dist/usersSlice/thunks.mjs +0 -109
  333. package/dist/usersSlice/thunks.mjs.map +0 -1
  334. package/dist/utils.mjs +0 -49
  335. package/dist/utils.mjs.map +0 -1
  336. /package/dist/{actions.d.mts → actions.d.cts} +0 -0
  337. /package/dist/api/{general-api.d.mts → general-api.d.cts} +0 -0
  338. /package/dist/api/{users-api.d.mts → users-api.d.cts} +0 -0
  339. /package/dist/appSlice/{index.d.mts → index.d.cts} +0 -0
  340. /package/dist/appSlice/{selectors.d.mts → selectors.d.cts} +0 -0
  341. /package/dist/appSlice/{thunks.d.mts → thunks.d.cts} +0 -0
  342. /package/dist/{auth.d.mts → auth.d.cts} +0 -0
  343. /package/dist/{chunk-3ORTTLIB.mjs.map → chunk-7PVGDMNM.js.map} +0 -0
  344. /package/dist/{chunk-IFWKT27G.mjs.map → chunk-A6CT6GTI.js.map} +0 -0
  345. /package/dist/{chunk-ZK4W5T53.mjs.map → chunk-AMGWP7A4.js.map} +0 -0
  346. /package/dist/{chunk-KJAZNKV2.mjs.map → chunk-ANB5BM5J.js.map} +0 -0
  347. /package/dist/{chunk-G4FGNSV3.mjs.map → chunk-CK6YE6AN.js.map} +0 -0
  348. /package/dist/{chunk-4SDUITD4.mjs.map → chunk-CYV6632F.js.map} +0 -0
  349. /package/dist/{chunk-JA27QXVB.mjs.map → chunk-E5LEU5PF.js.map} +0 -0
  350. /package/dist/{chunk-B42NUKMZ.mjs.map → chunk-FGKMJS3B.js.map} +0 -0
  351. /package/dist/{chunk-WYHJFSMQ.mjs.map → chunk-JAROCU6M.js.map} +0 -0
  352. /package/dist/{chunk-QBKCUIWO.mjs.map → chunk-JIS4PA3R.js.map} +0 -0
  353. /package/dist/{chunk-XD7INCM4.mjs.map → chunk-KAQJH2YL.js.map} +0 -0
  354. /package/dist/{chunk-2Z3RFYW4.mjs.map → chunk-LIJIIRON.js.map} +0 -0
  355. /package/dist/{chunk-IU4OXOPA.mjs.map → chunk-MRCFLG45.js.map} +0 -0
  356. /package/dist/{chunk-WCUGLHYM.mjs.map → chunk-NI4SZOCF.js.map} +0 -0
  357. /package/dist/{actions.mjs.map → chunk-NMAXZ3ZY.js.map} +0 -0
  358. /package/dist/{chunk-H5UCKQWK.mjs.map → chunk-NNADGHSL.js.map} +0 -0
  359. /package/dist/{chunk-K2NZL5V4.mjs.map → chunk-Q6M5TTDQ.js.map} +0 -0
  360. /package/dist/{chunk-CHUCIHMY.mjs.map → chunk-RX55KAKX.js.map} +0 -0
  361. /package/dist/{chunk-ZE7R2XXE.mjs.map → chunk-UEP36GCI.js.map} +0 -0
  362. /package/dist/{chunk-XC5UXEIB.mjs.map → chunk-VOCOFE4I.js.map} +0 -0
  363. /package/dist/{chunk-R7LXL3KJ.mjs.map → chunk-XTRPX7JZ.js.map} +0 -0
  364. /package/dist/{chunk-6CSGHZ3E.mjs.map → chunk-XXHONFSQ.js.map} +0 -0
  365. /package/dist/{chunk-KZSTW27Q.mjs.map → chunk-YGBFDXXA.js.map} +0 -0
  366. /package/dist/{chunk-H2PQQMRY.mjs.map → chunk-YO22XLHI.js.map} +0 -0
  367. /package/dist/{chunk-65YIOCCD.mjs.map → chunk-YT73QWCN.js.map} +0 -0
  368. /package/dist/{chunk-AZRVRNXT.mjs.map → chunk-YTQUNAZP.js.map} +0 -0
  369. /package/dist/{commonSelectors.d.mts → commonSelectors.d.cts} +0 -0
  370. /package/dist/deploymentsSlice/{constants.d.mts → constants.d.cts} +0 -0
  371. /package/dist/deploymentsSlice/{index.d.mts → index.d.cts} +0 -0
  372. /package/dist/deploymentsSlice/{selectors.d.mts → selectors.d.cts} +0 -0
  373. /package/dist/deploymentsSlice/{thunks.d.mts → thunks.d.cts} +0 -0
  374. /package/dist/devicesSlice/{constants.d.mts → constants.d.cts} +0 -0
  375. /package/dist/devicesSlice/{index.d.mts → index.d.cts} +0 -0
  376. /package/dist/devicesSlice/{selectors.d.mts → selectors.d.cts} +0 -0
  377. /package/dist/monitorSlice/{constants.d.mts → constants.d.cts} +0 -0
  378. /package/dist/monitorSlice/{index.d.mts → index.d.cts} +0 -0
  379. /package/dist/monitorSlice/{selectors.d.mts → selectors.d.cts} +0 -0
  380. /package/dist/onboardingSlice/{constants.d.mts → constants.d.cts} +0 -0
  381. /package/dist/onboardingSlice/{index.d.mts → index.d.cts} +0 -0
  382. /package/dist/onboardingSlice/{selectors.d.mts → selectors.d.cts} +0 -0
  383. /package/dist/onboardingSlice/{thunks.d.mts → thunks.d.cts} +0 -0
  384. /package/dist/organizationSlice/{constants.d.mts → constants.d.cts} +0 -0
  385. /package/dist/organizationSlice/{index.d.mts → index.d.cts} +0 -0
  386. /package/dist/organizationSlice/{selectors.d.mts → selectors.d.cts} +0 -0
  387. /package/dist/releasesSlice/{constants.d.mts → constants.d.cts} +0 -0
  388. /package/dist/releasesSlice/{index.d.mts → index.d.cts} +0 -0
  389. /package/dist/releasesSlice/{selectors.d.mts → selectors.d.cts} +0 -0
  390. /package/dist/{store.d.mts → store.d.cts} +0 -0
  391. /package/dist/{storehooks.d.mts → storehooks.d.cts} +0 -0
  392. /package/dist/usersSlice/{constants.d.mts → constants.d.cts} +0 -0
  393. /package/dist/usersSlice/{index.d.mts → index.d.cts} +0 -0
  394. /package/dist/usersSlice/{selectors.d.mts → selectors.d.cts} +0 -0
  395. /package/dist/usersSlice/{thunks.d.mts → thunks.d.cts} +0 -0
package/dist/store.js CHANGED
@@ -1,1982 +1,30 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
1
+ import {
2
+ commonErrorFallback,
3
+ commonErrorHandler,
4
+ getConfiguredStore,
5
+ sessionReducer,
6
+ store
7
+ } from "./chunk-2RJIDREZ.js";
8
+ import "./chunk-NNADGHSL.js";
9
+ import "./chunk-YGBFDXXA.js";
10
+ import "./chunk-CYV6632F.js";
11
+ import "./chunk-E5LEU5PF.js";
12
+ import "./chunk-FGKMJS3B.js";
13
+ import "./chunk-XTRPX7JZ.js";
14
+ import "./chunk-YTQUNAZP.js";
15
+ import "./chunk-UEP36GCI.js";
16
+ import "./chunk-7PVGDMNM.js";
17
+ import "./chunk-AMGWP7A4.js";
18
+ import "./chunk-A6CT6GTI.js";
19
+ import "./chunk-CK6YE6AN.js";
20
+ import "./chunk-MRCFLG45.js";
21
+ import "./chunk-25AKG5HH.js";
22
+ import "./chunk-4B3IMP4I.js";
23
+ export {
24
+ commonErrorFallback,
25
+ commonErrorHandler,
26
+ getConfiguredStore,
27
+ sessionReducer,
28
+ store
11
29
  };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/store.ts
31
- var store_exports = {};
32
- __export(store_exports, {
33
- commonErrorFallback: () => commonErrorFallback,
34
- commonErrorHandler: () => commonErrorHandler,
35
- getConfiguredStore: () => getConfiguredStore,
36
- sessionReducer: () => sessionReducer,
37
- store: () => store
38
- });
39
- module.exports = __toCommonJS(store_exports);
40
- var import_toolkit9 = require("@reduxjs/toolkit");
41
-
42
- // src/appSlice/constants.ts
43
- var import_icons_material = require("@mui/icons-material");
44
- var startingDeviceCount = {
45
- os: "for first 50 devices",
46
- professional: "for first 250 devices"
47
- };
48
- var apiRoot = "/api/management";
49
- var apiUrl = {
50
- v1: `${apiRoot}/v1`,
51
- v2: `${apiRoot}/v2`
52
- };
53
- var chartTypes = {
54
- bar: { key: "bar", Icon: import_icons_material.BarChart },
55
- pie: { key: "pie", Icon: import_icons_material.PieChartOutline }
56
- };
57
- var emptyChartSelection = { software: "", group: "", chartType: chartTypes.bar.key, attribute: "artifact_name" };
58
- var defaultReportType = "distribution";
59
- var defaultReports = [{ ...emptyChartSelection, group: null, attribute: "artifact_name", type: defaultReportType }];
60
- var PLANS = {
61
- os: {
62
- id: "os",
63
- name: "Basic",
64
- offer: true,
65
- price: "$32/month",
66
- deviceCount: startingDeviceCount.os,
67
- offerprice: "$23/month for first 50 devices",
68
- price2: "for first 6 months;\n$29/month thereafter",
69
- features: ["Basic OTA features"]
70
- },
71
- professional: {
72
- id: "professional",
73
- name: "Professional",
74
- offer: true,
75
- price: "$269/month",
76
- deviceCount: startingDeviceCount.professional,
77
- offerprice: "$200/month for first 50 devices",
78
- price2: "for first 6 months;\n$249/month thereafter",
79
- features: ["+ Advanced OTA features", "+ Standard support"]
80
- },
81
- enterprise: {
82
- id: "enterprise",
83
- name: "Enterprise",
84
- price: "Custom pricing",
85
- deviceCount: "unlimited devices",
86
- features: ["+ Enterprise-grade OTA features", "+ Premium support"]
87
- }
88
- };
89
- var ADDONS = {
90
- configure: {
91
- id: "configure",
92
- title: "Configure",
93
- description: "Expand your plan with device configuration features",
94
- needs: ["hasDeviceConfig"],
95
- os: {
96
- price: "$11/month",
97
- deviceCount: startingDeviceCount.os
98
- },
99
- professional: {
100
- price: "$65/month",
101
- deviceCount: startingDeviceCount.professional
102
- },
103
- eligible: ["os", "professional", "enterprise"]
104
- },
105
- troubleshoot: {
106
- id: "troubleshoot",
107
- title: "Troubleshoot",
108
- description: "Expand your plan with device troubleshooting features",
109
- needs: ["hasDeviceConnect"],
110
- os: {
111
- price: "$27/month",
112
- deviceCount: startingDeviceCount.os
113
- },
114
- professional: {
115
- price: "$72/month",
116
- deviceCount: startingDeviceCount.professional
117
- },
118
- eligible: ["os", "professional", "enterprise"]
119
- },
120
- monitor: {
121
- id: "monitor",
122
- title: "Monitor",
123
- description: "Expand your plan with device monitoring features",
124
- needs: ["hasMonitor"],
125
- os: {
126
- price: "-",
127
- deviceCount: "-"
128
- },
129
- professional: {
130
- price: "$86/month",
131
- deviceCount: startingDeviceCount.professional
132
- },
133
- eligible: ["professional", "enterprise"]
134
- }
135
- };
136
- var BENEFITS = {
137
- auditlog: { id: "auditlog", benefit: "trace change across your devices and access troubleshooting session replay", requiredPlan: PLANS.professional.id },
138
- dashboard: { id: "dashboard", benefit: "actionable insights into the devices you are updating with Mender", requiredPlan: PLANS.enterprise.id },
139
- deltaGeneration: {
140
- id: "deltaGeneration",
141
- benefit: "automatic delta artifacts generation to minimize data transfer and improve the update delivery",
142
- requiredPlan: PLANS.enterprise.id
143
- },
144
- deviceConfiguration: { id: "deviceConfiguration", benefit: "device configuration features", requiredAddon: ADDONS.configure.id },
145
- deviceMonitor: { id: "deviceMonitor", benefit: "device monitoring features", requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },
146
- deviceTroubleshoot: { id: "deviceTroubleshoot", benefit: "device troubleshooting features", requiredAddon: ADDONS.troubleshoot.id },
147
- dynamicGroups: { id: "dynamicGroups", benefit: "create dynamic groups to ease device management", requiredPlan: PLANS.enterprise.id },
148
- fullFiltering: { id: "fullFiltering", benefit: "filtering by multiple attributes to improve the device overview", requiredPlan: PLANS.professional.id },
149
- gateway: { id: "gateway", benefit: "see devices connected to your gateway device for easy access", requiredPlans: PLANS.professional.id },
150
- pausedDeployments: {
151
- id: "pausedDeployments",
152
- benefit: "granular control about update rollout to allow synchronization across your fleet",
153
- requiredPlan: PLANS.enterprise.id
154
- },
155
- phasedDeployments: { id: "phasedDeployments", benefit: "choose to roll out deployments in multiple phases", requiredPlan: PLANS.enterprise.id },
156
- rbac: { id: "rbac", benefit: "granular role based access control", requiredPlan: PLANS.enterprise.id },
157
- retryDeployments: { id: "retryDeployments", benefit: "optional retries for failed rollout attempts", requiredPlan: PLANS.professional.id },
158
- scheduledDeployments: {
159
- id: "scheduledDeployments",
160
- benefit: "scheduled deployments to steer the distribution of your updates.",
161
- requiredPlan: PLANS.professional.id
162
- },
163
- webhookEvents: {
164
- id: "webhookEvents",
165
- benefit: "receive inventory events and select which type(s) of events the webhook will receive",
166
- requiredPlan: PLANS.professional.id
167
- },
168
- default: { id: "default", benefit: "gain access to this feature", requiredPlan: PLANS.enterprise.id }
169
- };
170
-
171
- // src/commonConstants.tsx
172
- var import_react = __toESM(require("react"));
173
- var import_js = require("@mdi/js");
174
- var DEVICE_LIST_DEFAULTS = {
175
- page: 1,
176
- perPage: 20
177
- };
178
- var timeUnits = {
179
- days: "days",
180
- minutes: "minutes",
181
- hours: "hours"
182
- };
183
- var ALL_DEVICES = "All devices";
184
- var DEVICE_FILTERING_OPTIONS = {
185
- $eq: { key: "$eq", title: "equals", shortform: "=" },
186
- $ne: { key: "$ne", title: "not equal", shortform: "!=" },
187
- $gt: {
188
- key: "$gt",
189
- title: ">",
190
- shortform: ">",
191
- help: 'The "greater than" operator can work both on numbers and strings. In the latter case, the operator applies the lexicographical order to the value strings.'
192
- },
193
- $gte: {
194
- title: ">=",
195
- shortform: ">=",
196
- help: 'The "greater than or equal" operator can work both on numbers and strings. In the latter case, the operator applies the lexicographical order to the value strings.'
197
- },
198
- $lt: {
199
- key: "$lt",
200
- title: "<",
201
- shortform: "<",
202
- help: 'The "lesser than" operator can work both on numbers and strings. In the latter case, the operator applies the lexicographical order to the value strings.'
203
- },
204
- $lte: {
205
- title: "<=",
206
- shortform: "<=",
207
- help: 'The "lesser than or equal" operator can work both on numbers and strings. In the latter case, the operator applies the lexicographical order to the value strings.'
208
- },
209
- $ltne: {
210
- key: "$ltne",
211
- title: "$ltne",
212
- shortform: "ltne",
213
- help: 'The "lesser than or does not exist" operator can work both on numbers and strings. In the latter case, the operator applies the lexicographical order to the value strings.'
214
- },
215
- $in: {
216
- key: "$in",
217
- title: "in",
218
- shortform: "in",
219
- help: 'The "in" operator accepts a list of comma-separated values. It matches if the selected field is equal to one of the specified values.'
220
- },
221
- $nin: {
222
- key: "$nin",
223
- title: "not in",
224
- shortform: "not in",
225
- help: `The "not in" operator accepts a list of comma-separated values. It matches if the selected field's value is not equal to any of the specified options.`
226
- },
227
- $exists: {
228
- key: "$exists",
229
- title: "exists",
230
- shortform: "exists",
231
- value: true,
232
- help: `The "exists" operator matches if the selected field's value has a value. No value needs to be provided for this operator.`
233
- },
234
- $nexists: {
235
- key: "$nexists",
236
- title: `doesn't exist`,
237
- shortform: `doesn't exist`,
238
- value: true,
239
- help: `The "doesn't exist" operator matches if the selected field's value has no value. No value needs to be provided for this operator.`
240
- },
241
- $regex: {
242
- key: "$regex",
243
- title: `matches regular expression`,
244
- shortform: `matches`,
245
- help: `The "regular expression" operator matches the selected field's value with a Perl compatible regular expression (PCRE), automatically anchored by ^. If the regular expression is not valid, the filter will produce no results. If you need to specify options and flags, you can provide the full regex in the format of /regex/flags, for example.`
246
- }
247
- };
248
- var DEVICE_ISSUE_OPTIONS = {
249
- issues: {
250
- isCategory: true,
251
- key: "issues",
252
- title: "Devices with issues",
253
- filterRule: {}
254
- },
255
- offline: {
256
- issueCategory: "issues",
257
- key: "offline",
258
- needsFullFiltering: true,
259
- needsMonitor: false,
260
- needsReporting: false,
261
- filterRule: {
262
- scope: "system",
263
- key: "check_in_time",
264
- operator: DEVICE_FILTERING_OPTIONS.$ltne.key,
265
- value: ({ offlineThreshold }) => offlineThreshold
266
- },
267
- title: "Offline devices"
268
- },
269
- failedLastUpdate: {
270
- issueCategory: "issues",
271
- key: "failedLastUpdate",
272
- needsFullFiltering: false,
273
- needsMonitor: false,
274
- needsReporting: true,
275
- filterRule: { scope: "monitor", key: "failed_last_update", operator: DEVICE_FILTERING_OPTIONS.$eq.key, value: true },
276
- title: "Deployment failed"
277
- },
278
- monitoring: {
279
- issueCategory: "issues",
280
- key: "monitoring",
281
- needsFullFiltering: false,
282
- needsMonitor: true,
283
- needsReporting: false,
284
- filterRule: { scope: "monitor", key: "alerts", operator: DEVICE_FILTERING_OPTIONS.$eq.key, value: true },
285
- title: "Monitoring alert"
286
- },
287
- authRequests: {
288
- key: "authRequests",
289
- needsFullFiltering: false,
290
- needsMonitor: false,
291
- needsReporting: true,
292
- filterRule: { scope: "monitor", key: "auth_requests", operator: DEVICE_FILTERING_OPTIONS.$gt.key, value: 1 },
293
- title: "Devices with new authentication requests"
294
- },
295
- gatewayDevices: {
296
- key: "gatewayDevices",
297
- needsFullFiltering: false,
298
- needsMonitor: false,
299
- needsReporting: true,
300
- filterRule: { scope: "inventory", key: "mender_is_gateway", operator: DEVICE_FILTERING_OPTIONS.$eq.key, value: "true" },
301
- title: "Gateway devices"
302
- }
303
- };
304
- var oneSecond = 1e3;
305
- var TIMEOUTS = {
306
- debounceDefault: 700,
307
- debounceShort: 300,
308
- halfASecond: 0.5 * oneSecond,
309
- oneSecond,
310
- twoSeconds: 2 * oneSecond,
311
- threeSeconds: 3 * oneSecond,
312
- fiveSeconds: 5 * oneSecond,
313
- refreshDefault: 10 * oneSecond,
314
- refreshLong: 60 * oneSecond
315
- };
316
- var SORTING_OPTIONS = {
317
- asc: "asc",
318
- desc: "desc"
319
- };
320
- var DEVICE_ONLINE_CUTOFF = { interval: 1, intervalName: timeUnits.days };
321
- var ATTRIBUTE_SCOPES = {
322
- inventory: "inventory",
323
- identity: "identity",
324
- monitor: "monitor",
325
- system: "system",
326
- tags: "tags"
327
- };
328
- var defaultIdAttribute = Object.freeze({ attribute: "id", scope: ATTRIBUTE_SCOPES.identity });
329
- var credentialTypes = {
330
- aws: "aws",
331
- http: "http",
332
- sas: "sas",
333
- x509: "x509"
334
- };
335
- var EXTERNAL_PROVIDER = {
336
- "iot-core": {
337
- credentialsType: credentialTypes.aws,
338
- icon: import_js.mdiAws,
339
- title: "AWS IoT Core",
340
- twinTitle: "Device Shadow",
341
- provider: "iot-core",
342
- enabled: true,
343
- deviceTwin: true,
344
- configHint: /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, "For help finding your AWS IoT Core connection string, check the AWS IoT documentation.")
345
- },
346
- "iot-hub": {
347
- credentialsType: credentialTypes.sas,
348
- icon: import_js.mdiMicrosoftAzure,
349
- title: "Azure IoT Hub",
350
- twinTitle: "Device Twin",
351
- provider: "iot-hub",
352
- enabled: true,
353
- deviceTwin: true,
354
- configHint: /* @__PURE__ */ import_react.default.createElement("span", null, "For help finding your Azure IoT Hub connection string, look under 'Shared access policies' in the Microsoft Azure UI as described", " ", /* @__PURE__ */ import_react.default.createElement(
355
- "a",
356
- {
357
- href: "https://devblogs.microsoft.com/iotdev/understand-different-connection-strings-in-azure-iot-hub/#iothubconn",
358
- target: "_blank",
359
- rel: "noopener noreferrer"
360
- },
361
- "here"
362
- ), ".")
363
- },
364
- webhook: {
365
- credentialsType: credentialTypes.http,
366
- deviceTwin: false,
367
- // disable the webhook provider here, since it is treated different than other integrations, with a custom configuration & management view, etc.
368
- enabled: false,
369
- provider: "webhook"
370
- }
371
- };
372
- var ALL_RELEASES = "All releases";
373
- var emptyUiPermissions = Object.freeze({
374
- auditlog: [],
375
- deployments: [],
376
- groups: Object.freeze({}),
377
- releases: Object.freeze({}),
378
- tenantManagement: [],
379
- userManagement: []
380
- });
381
- var emptyRole = Object.freeze({
382
- name: void 0,
383
- description: "",
384
- permissions: [],
385
- uiPermissions: Object.freeze({ ...emptyUiPermissions })
386
- });
387
-
388
- // src/deploymentsSlice/constants.ts
389
- var alreadyInstalled = "already-installed";
390
- var deploymentsApiUrl = `${apiUrl.v1}/deployments`;
391
- var deploymentsApiUrlV2 = `${apiUrl.v2}/deployments`;
392
- var deploymentSubstates = {
393
- aborted: "aborted",
394
- alreadyInstalled,
395
- decommissioned: "decommissioned",
396
- downloading: "downloading",
397
- failure: "failure",
398
- installing: "installing",
399
- noartifact: "noartifact",
400
- pause_before_committing: "pause_before_committing",
401
- pause_before_installing: "pause_before_installing",
402
- pause_before_rebooting: "pause_before_rebooting",
403
- pending: "pending",
404
- rebooting: "rebooting",
405
- success: "success"
406
- };
407
- var deploymentStatesToSubstates = {
408
- failures: [deploymentSubstates.failure, deploymentSubstates.aborted, deploymentSubstates.decommissioned],
409
- inprogress: [deploymentSubstates.downloading, deploymentSubstates.installing, deploymentSubstates.rebooting],
410
- paused: [deploymentSubstates.pause_before_installing, deploymentSubstates.pause_before_rebooting, deploymentSubstates.pause_before_committing],
411
- pending: [deploymentSubstates.pending],
412
- successes: [deploymentSubstates.success, deploymentSubstates.alreadyInstalled, deploymentSubstates.noartifact]
413
- };
414
- var deploymentStatesToSubstatesWithSkipped = {
415
- ...deploymentStatesToSubstates,
416
- failures: [deploymentSubstates.failure],
417
- skipped: [deploymentSubstates.aborted, deploymentSubstates.noartifact, deploymentSubstates.alreadyInstalled, deploymentSubstates.decommissioned],
418
- successes: [deploymentSubstates.success]
419
- };
420
- var installationSubstatesMap = {
421
- download: {
422
- title: "download",
423
- done: "downloaded",
424
- successIndicators: [deploymentSubstates.installing, deploymentSubstates.rebooting, ...deploymentStatesToSubstates.paused, deploymentSubstates.success],
425
- failureIndicators: deploymentStatesToSubstates.failures,
426
- pauseConfigurationIndicator: "ArtifactInstall_Enter"
427
- },
428
- install: {
429
- title: "install",
430
- done: "installed",
431
- successIndicators: [
432
- deploymentSubstates.rebooting,
433
- deploymentSubstates.pause_before_rebooting,
434
- deploymentSubstates.pause_before_committing,
435
- deploymentSubstates.success
436
- ],
437
- failureIndicators: deploymentStatesToSubstates.failures,
438
- pauseConfigurationIndicator: "ArtifactReboot_Enter"
439
- },
440
- reboot: {
441
- title: "reboot",
442
- done: "rebooted",
443
- successIndicators: [deploymentSubstates.pause_before_committing, deploymentSubstates.success],
444
- failureIndicators: deploymentStatesToSubstates.failures,
445
- pauseConfigurationIndicator: "ArtifactCommit_Enter"
446
- },
447
- commit: {
448
- title: "commit",
449
- done: "committed",
450
- successIndicators: deploymentStatesToSubstates.successes,
451
- failureIndicators: deploymentStatesToSubstates.failures,
452
- pauseConfigurationIndicator: void 0
453
- }
454
- };
455
- var DEPLOYMENT_STATES = {
456
- finished: "finished",
457
- inprogress: "inprogress",
458
- pending: "pending",
459
- scheduled: "scheduled"
460
- };
461
- var listDefaultsByState = {
462
- [DEPLOYMENT_STATES.inprogress]: { page: 1, perPage: 10 },
463
- [DEPLOYMENT_STATES.pending]: { page: 1, perPage: 10 },
464
- [DEPLOYMENT_STATES.scheduled]: { ...DEVICE_LIST_DEFAULTS },
465
- [DEPLOYMENT_STATES.finished]: { ...DEVICE_LIST_DEFAULTS },
466
- sort: { direction: SORTING_OPTIONS.desc }
467
- };
468
- var DEFAULT_PENDING_INPROGRESS_COUNT = 10;
469
- var DEPLOYMENT_ROUTES = {
470
- active: {
471
- key: "active",
472
- route: "/deployments/active",
473
- states: [DEPLOYMENT_STATES.pending, DEPLOYMENT_STATES.inprogress],
474
- title: "Active"
475
- },
476
- finished: {
477
- key: "finished",
478
- route: "/deployments/finished",
479
- states: [DEPLOYMENT_STATES.finished],
480
- title: "Finished"
481
- },
482
- scheduled: {
483
- key: "scheduled",
484
- route: "/deployments/scheduled",
485
- states: [DEPLOYMENT_STATES.scheduled],
486
- title: "Scheduled"
487
- }
488
- };
489
- var defaultStats = {
490
- [deploymentSubstates.aborted]: 0,
491
- [deploymentSubstates.alreadyInstalled]: 0,
492
- [deploymentSubstates.decommissioned]: 0,
493
- [deploymentSubstates.downloading]: 0,
494
- [deploymentSubstates.failure]: 0,
495
- [deploymentSubstates.installing]: 0,
496
- [deploymentSubstates.noartifact]: 0,
497
- [deploymentSubstates.pause_before_committing]: 0,
498
- [deploymentSubstates.pause_before_installing]: 0,
499
- [deploymentSubstates.pause_before_rebooting]: 0,
500
- [deploymentSubstates.pending]: 0,
501
- [deploymentSubstates.rebooting]: 0,
502
- [deploymentSubstates.success]: 0
503
- };
504
- var deploymentPrototype = {
505
- devices: {},
506
- name: void 0,
507
- statistics: { status: {} }
508
- };
509
- var pauseMap = {
510
- [deploymentSubstates.pause_before_installing]: {
511
- title: installationSubstatesMap.download.done,
512
- followUp: installationSubstatesMap.download.pauseConfigurationIndicator
513
- },
514
- [deploymentSubstates.pause_before_rebooting]: {
515
- title: installationSubstatesMap.install.done,
516
- followUp: installationSubstatesMap.install.pauseConfigurationIndicator
517
- },
518
- [deploymentSubstates.pause_before_committing]: {
519
- title: installationSubstatesMap.reboot.done,
520
- followUp: installationSubstatesMap.reboot.pauseConfigurationIndicator
521
- }
522
- };
523
- var limitDefault = { min: 5, max: 100, default: 10 };
524
-
525
- // src/devicesSlice/constants.ts
526
- var emptyFilter = { key: null, value: "", operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: "inventory" };
527
- var deviceAuthV2 = `${apiUrl.v2}/devauth`;
528
- var deviceConnect = `${apiUrl.v1}/deviceconnect`;
529
- var inventoryApiUrl = `${apiUrl.v1}/inventory`;
530
- var inventoryApiUrlV2 = `${apiUrl.v2}/inventory`;
531
- var deviceConfig = `${apiUrl.v1}/deviceconfig/configurations/device`;
532
- var reportingApiUrl = `${apiUrl.v1}/reporting`;
533
- var iotManagerBaseURL = `${apiUrl.v1}/iot-manager`;
534
- var DEVICE_STATES = {
535
- accepted: "accepted",
536
- pending: "pending",
537
- preauth: "preauthorized",
538
- rejected: "rejected"
539
- };
540
- var geoAttributes = ["geo-lat", "geo-lon"].map((attribute) => ({ attribute, scope: "inventory" }));
541
-
542
- // src/monitorSlice/constants.ts
543
- var alertChannels = { email: "email" };
544
- var monitorApiUrlv1 = `${apiUrl.v1}/devicemonitor`;
545
-
546
- // src/onboardingSlice/constants.ts
547
- var onboardingSteps = {
548
- ONBOARDING_START: "onboarding-start",
549
- DEVICES_PENDING_ONBOARDING_START: "devices-pending-onboarding-start",
550
- DASHBOARD_ONBOARDING_START: "dashboard-onboarding-start",
551
- DASHBOARD_ONBOARDING_PENDINGS: "dashboard-onboarding-pendings",
552
- DEVICES_DELAYED_ONBOARDING: "devices-delayed-onboarding",
553
- DEVICES_PENDING_ONBOARDING: "devices-pending-onboarding",
554
- DEVICES_ACCEPTED_ONBOARDING: "devices-accepted-onboarding",
555
- DEVICES_PENDING_ACCEPTING_ONBOARDING: "devices-pending-accepting-onboarding",
556
- DEVICES_DEPLOY_RELEASE_ONBOARDING: "devices-deploy-release-onboarding",
557
- SCHEDULING_ARTIFACT_SELECTION: "scheduling-artifact-selection",
558
- SCHEDULING_ALL_DEVICES_SELECTION: "scheduling-all-devices-selection",
559
- SCHEDULING_GROUP_SELECTION: "scheduling-group-selection",
560
- SCHEDULING_RELEASE_TO_DEVICES: "scheduling-release-to-devices",
561
- DEPLOYMENTS_INPROGRESS: "deployments-inprogress",
562
- DEPLOYMENTS_PAST: "deployments-past",
563
- DEPLOYMENTS_PAST_COMPLETED: "deployments-past-completed",
564
- DEPLOYMENTS_PAST_COMPLETED_FAILURE: "deployments-past-completed-failure",
565
- ONBOARDING_CANCELED: "onboarding-canceled"
566
- };
567
- var orderedOnboardingSteps = [
568
- onboardingSteps.DASHBOARD_ONBOARDING_START,
569
- onboardingSteps.DEVICES_PENDING_ONBOARDING_START,
570
- onboardingSteps.DEVICES_DELAYED_ONBOARDING,
571
- onboardingSteps.DEVICES_PENDING_ONBOARDING,
572
- onboardingSteps.DEVICES_PENDING_ACCEPTING_ONBOARDING,
573
- onboardingSteps.DASHBOARD_ONBOARDING_PENDINGS,
574
- onboardingSteps.DEVICES_ACCEPTED_ONBOARDING,
575
- onboardingSteps.DEVICES_DEPLOY_RELEASE_ONBOARDING,
576
- onboardingSteps.SCHEDULING_ALL_DEVICES_SELECTION,
577
- onboardingSteps.SCHEDULING_GROUP_SELECTION,
578
- onboardingSteps.SCHEDULING_ARTIFACT_SELECTION,
579
- onboardingSteps.SCHEDULING_RELEASE_TO_DEVICES,
580
- onboardingSteps.DEPLOYMENTS_INPROGRESS,
581
- onboardingSteps.DEPLOYMENTS_PAST,
582
- onboardingSteps.DEPLOYMENTS_PAST_COMPLETED,
583
- onboardingSteps.DEPLOYMENTS_PAST_COMPLETED_FAILURE,
584
- onboardingSteps.ONBOARDING_CANCELED
585
- ];
586
-
587
- // src/organizationSlice/constants.ts
588
- var auditLogsApiUrl = `${apiUrl.v1}/auditlogs`;
589
- var tenantadmApiUrlv1 = `${apiUrl.v1}/tenantadm`;
590
- var tenantadmApiUrlv2 = `${apiUrl.v2}/tenantadm`;
591
- var ssoIdpApiUrlv1 = `${apiUrl.v1}/useradm/sso/idp/metadata`;
592
- var AUDIT_LOGS_TYPES = [
593
- { title: "Artifact", queryParameter: "object_type", value: "artifact" },
594
- { title: "Deployment", queryParameter: "object_deployment_name", value: "deployment" },
595
- { title: "Device", queryParameter: "object_id", value: "device" },
596
- { title: "User", queryParameter: "object_id", value: "user" }
597
- ];
598
- var SP_AUDIT_LOGS_TYPES = [AUDIT_LOGS_TYPES[3], { title: "Tenant", queryParameter: "object_id", value: "tenant" }];
599
- var emptyWebhook = {
600
- description: "",
601
- enabled: true,
602
- credentials: {
603
- type: EXTERNAL_PROVIDER.webhook.credentialsType,
604
- [EXTERNAL_PROVIDER.webhook.credentialsType]: {
605
- secret: "",
606
- url: ""
607
- }
608
- }
609
- };
610
- var TENANT_LIST_DEFAULT = {
611
- page: 1,
612
- perPage: 20
613
- };
614
-
615
- // src/releasesSlice/constants.ts
616
- var rootfsImageVersion = "rootfs-image.version";
617
- var softwareTitleMap = { [rootfsImageVersion]: { title: "Root filesystem", priority: 0, key: rootfsImageVersion } };
618
-
619
- // src/usersSlice/constants.ts
620
- var useradmApiUrlv1 = `${apiUrl.v1}/useradm`;
621
- var useradmApiUrlv2 = `${apiUrl.v2}/useradm`;
622
- var staticRolesByName = {
623
- admin: "RBAC_ROLE_PERMIT_ALL",
624
- readOnly: "RBAC_ROLE_OBSERVER",
625
- ci: "RBAC_ROLE_CI",
626
- deploymentsManager: "RBAC_ROLE_DEPLOYMENTS_MANAGER",
627
- terminalAccess: "RBAC_ROLE_REMOTE_TERMINAL"
628
- };
629
- var PermissionTypes = {
630
- Any: "any",
631
- Get: "GET",
632
- Post: "POST",
633
- Put: "PUT",
634
- Delete: "DELETE",
635
- Patch: "PATCH",
636
- DeviceGroup: "DEVICE_GROUP",
637
- DeviceId: "DEVICE_ID"
638
- };
639
- var permissionSetIds = {
640
- Basic: "Basic",
641
- ConfigureDevices: "ConfigureDevices",
642
- ConnectToDevices: "ConnectToDevices",
643
- DeployToDevices: "DeployToDevices",
644
- ManageDevices: "ManageDevices",
645
- ManageReleases: "ManageReleases",
646
- ManageTenants: "ManageTenants",
647
- ManageUsers: "ManageUsers",
648
- ReadAuditLogs: "ReadAuditLogs",
649
- ReadDevices: "ReadDevices",
650
- ReadReleases: "ReadReleases",
651
- ReadTenants: "ReadTenants",
652
- ReadUsers: "ReadUsers",
653
- SuperUser: "SuperUser",
654
- UploadArtifacts: "UploadArtifacts"
655
- };
656
- var uiPermissionsById = {
657
- configure: {
658
- explanations: { groups: `'Configure' allows the user to use mender-configure features and apply configurations.` },
659
- permissionLevel: 2,
660
- permissionSets: { groups: permissionSetIds.ConfigureDevices },
661
- title: "Configure",
662
- value: "configure",
663
- verbs: [PermissionTypes.Get, PermissionTypes.Put, PermissionTypes.Post]
664
- },
665
- connect: {
666
- explanations: { groups: `'Connect' allows the user to use mender-connect features and Troubleshoot add-ons.` },
667
- permissionLevel: 2,
668
- permissionSets: { groups: permissionSetIds.ConnectToDevices },
669
- title: "Connect",
670
- value: "connect",
671
- verbs: [PermissionTypes.Get, PermissionTypes.Put]
672
- },
673
- deploy: {
674
- explanations: { groups: `'Deploy' allows the user to deploy software or configuration updates to devices.` },
675
- permissionLevel: 2,
676
- permissionSets: { deployments: permissionSetIds.DeployToDevices, groups: permissionSetIds.DeployToDevices },
677
- title: "Deploy",
678
- value: "deploy",
679
- verbs: [PermissionTypes.Post]
680
- },
681
- manage: {
682
- explanations: {
683
- groups: `'Manage' allows the user to edit device name, notes, and manage authentication status. For 'All devices' it also allows the user to edit and create device groups.`,
684
- releases: `'Manage' allows the user to upload new artifacts, edit release descriptions and remove artifacts.`
685
- },
686
- permissionLevel: 2,
687
- permissionSets: {
688
- groups: permissionSetIds.ManageDevices,
689
- releases: permissionSetIds.ManageReleases,
690
- tenantManagement: permissionSetIds.ManageTenants,
691
- userManagement: permissionSetIds.ManageUsers
692
- },
693
- title: "Manage",
694
- value: "manage",
695
- verbs: [PermissionTypes.Post, PermissionTypes.Put, PermissionTypes.Patch]
696
- },
697
- read: {
698
- explanations: { groups: `'Read' allows the user to view devices.` },
699
- permissionLevel: 1,
700
- permissionSets: {
701
- auditlog: permissionSetIds.ReadAuditLogs,
702
- groups: permissionSetIds.ReadDevices,
703
- releases: permissionSetIds.ReadReleases,
704
- tenantManagement: permissionSetIds.ReadTenants,
705
- userManagement: permissionSetIds.ReadUsers
706
- },
707
- title: "Read",
708
- value: "read",
709
- verbs: [PermissionTypes.Get, PermissionTypes.Post]
710
- },
711
- upload: {
712
- explanations: { groups: `'Upload' allows the user to upload new Artifacts.` },
713
- unscopedOnly: { releases: true },
714
- permissionLevel: 1,
715
- permissionSets: { releases: permissionSetIds.UploadArtifacts },
716
- title: "Upload",
717
- value: "upload",
718
- verbs: [PermissionTypes.Post, PermissionTypes.Put, PermissionTypes.Patch]
719
- }
720
- };
721
- var scopedPermissionAreas = {
722
- groups: { key: "groups", excessiveAccessSelector: ALL_DEVICES, scopeType: "DeviceGroups" },
723
- releases: { key: "releases", excessiveAccessSelector: ALL_RELEASES, scopeType: "Releases" }
724
- };
725
- var uiPermissionsByArea = {
726
- auditlog: {
727
- endpoints: [{ path: /\/(auditlog)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] }],
728
- explanation: "Granting access to the audit log will allow tracing changes to devices, releases and user accounts, as well as providing information about deployments.",
729
- key: "auditlog",
730
- uiPermissions: [uiPermissionsById.read],
731
- title: "System audit log"
732
- },
733
- deployments: {
734
- endpoints: [
735
- { path: /\/(deployments\/deployments)/i, types: [PermissionTypes.Post, PermissionTypes.Put], uiPermissions: [uiPermissionsById.deploy] },
736
- { path: /\/(deployments\/deployments)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] },
737
- { path: /\/(deployments\/config)/i, types: [PermissionTypes.Get, PermissionTypes.Put], uiPermissions: [uiPermissionsById.manage] }
738
- ],
739
- explanation: "Providing deploy permissions will allow deployments to be created using the releases and devices a user has access to.",
740
- key: "deployments",
741
- uiPermissions: [uiPermissionsById.read, uiPermissionsById.deploy],
742
- title: "Deployments"
743
- },
744
- groups: {
745
- endpoints: [
746
- {
747
- path: /\/(devauth|inventory|deviceconfig|devicemonitor|deviceconnect\/devices)/i,
748
- types: [PermissionTypes.Get],
749
- uiPermissions: [uiPermissionsById.read]
750
- },
751
- { path: /\/(devauth|inventory)/i, types: [PermissionTypes.Put, PermissionTypes.Post], uiPermissions: [uiPermissionsById.manage] },
752
- { path: /\/(deviceconfig)/i, types: [PermissionTypes.Get, PermissionTypes.Put, PermissionTypes.Post], uiPermissions: [uiPermissionsById.configure] },
753
- { path: /\/(deviceconnect\/devices)/i, types: [PermissionTypes.Get, PermissionTypes.Post], uiPermissions: [uiPermissionsById.connect] }
754
- ],
755
- explanation: "Device group management permissions control the degree to which devices in a group can be accessed and moved to other groups.",
756
- key: "groups",
757
- scope: scopedPermissionAreas.groups.scopeType,
758
- uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage, uiPermissionsById.deploy, uiPermissionsById.configure, uiPermissionsById.connect],
759
- title: "Group Management"
760
- },
761
- releases: {
762
- endpoints: [
763
- { path: /\/(deployments\/artifacts|deployments\/deployments\/releases)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] },
764
- {
765
- path: /\/(deployments\/artifacts|deployments\/deployments\/releases)/i,
766
- types: [PermissionTypes.Post, PermissionTypes.Put],
767
- uiPermissions: [uiPermissionsById.read, uiPermissionsById.upload]
768
- },
769
- {
770
- path: /\/(deployments\/artifacts|deployments\/deployments\/releases)/i,
771
- types: [PermissionTypes.Delete],
772
- uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage]
773
- }
774
- ],
775
- explanation: "Release permissions can be granted to allow artifact & release modifications, as well as the creation of new releases.",
776
- key: "releases",
777
- scope: "ReleaseTags",
778
- uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage, uiPermissionsById.upload],
779
- title: "Release Management"
780
- },
781
- tenantManagement: {
782
- endpoints: [
783
- { path: /\/(tenantadm\/tenants)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] },
784
- { path: /\/(tenantadm\/tenants)/i, types: [PermissionTypes.Post, PermissionTypes.Put], uiPermissions: [uiPermissionsById.manage] },
785
- { path: /\/(users\/exists)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.manage] }
786
- ],
787
- explanation: "Tenant management permissions allow listing, creating and modifying child tenants",
788
- key: "tenantManagement",
789
- uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage],
790
- title: "Tenant Management"
791
- },
792
- userManagement: {
793
- endpoints: [
794
- { path: /\/(useradm)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] },
795
- { path: /\/(useradm)/i, types: [PermissionTypes.Post], uiPermissions: [uiPermissionsById.manage] }
796
- ],
797
- explanation: "User management permissions should be granted carefully, as these allow privilege increases for any users managed by a user with user management permissions",
798
- key: "userManagement",
799
- uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage],
800
- title: "User Management"
801
- }
802
- };
803
- var permissionMapper = (permission) => permission.value;
804
- var rolesById = Object.freeze({
805
- [staticRolesByName.admin]: {
806
- name: "Admin",
807
- value: staticRolesByName.admin,
808
- description: "Full access",
809
- permissions: [],
810
- // permissions refers to the values returned from the backend
811
- uiPermissions: {
812
- ...emptyUiPermissions,
813
- auditlog: uiPermissionsByArea.auditlog.uiPermissions.map(permissionMapper),
814
- deployments: uiPermissionsByArea.deployments.uiPermissions.map(permissionMapper),
815
- groups: { [ALL_DEVICES]: uiPermissionsByArea.groups.uiPermissions.map(permissionMapper) },
816
- releases: { [ALL_RELEASES]: uiPermissionsByArea.releases.uiPermissions.map(permissionMapper) },
817
- userManagement: uiPermissionsByArea.userManagement.uiPermissions.map(permissionMapper)
818
- }
819
- },
820
- [staticRolesByName.readOnly]: {
821
- name: "Read Access",
822
- value: staticRolesByName.readOnly,
823
- description: "",
824
- permissions: [],
825
- uiPermissions: {
826
- ...emptyUiPermissions,
827
- deployments: [uiPermissionsById.read.value],
828
- groups: { [ALL_DEVICES]: [uiPermissionsById.read.value] },
829
- releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] },
830
- userManagement: [uiPermissionsById.read.value]
831
- }
832
- },
833
- [staticRolesByName.ci]: {
834
- name: "Releases Manager",
835
- value: staticRolesByName.ci,
836
- description: "",
837
- permissions: [],
838
- uiPermissions: {
839
- ...emptyUiPermissions,
840
- releases: { [ALL_RELEASES]: uiPermissionsByArea.releases.uiPermissions.map(permissionMapper) }
841
- }
842
- },
843
- [staticRolesByName.deploymentsManager]: {
844
- name: "Deployments Manager",
845
- value: staticRolesByName.deploymentsManager,
846
- description: "",
847
- permissions: [],
848
- uiPermissions: {
849
- ...emptyUiPermissions,
850
- deployments: uiPermissionsByArea.deployments.uiPermissions.map(permissionMapper),
851
- groups: { [ALL_DEVICES]: [uiPermissionsById.deploy.value, uiPermissionsById.read.value] },
852
- releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] }
853
- }
854
- },
855
- [staticRolesByName.terminalAccess]: {
856
- name: "Troubleshooting",
857
- value: staticRolesByName.terminalAccess,
858
- description: "Access to the troubleshooting features: Remote Terminal, File Transfer, Port Forwarding",
859
- permissions: [],
860
- uiPermissions: {
861
- ...emptyUiPermissions,
862
- groups: { [ALL_DEVICES]: [uiPermissionsById.connect.value] }
863
- }
864
- }
865
- });
866
- var serviceProviderRolesById = {
867
- admin: {
868
- name: "Admin",
869
- value: staticRolesByName.admin,
870
- description: "Full access",
871
- permissions: [],
872
- uiPermissions: {
873
- ...emptyUiPermissions,
874
- auditlog: uiPermissionsByArea.auditlog.uiPermissions.map(permissionMapper),
875
- userManagement: uiPermissionsByArea.userManagement.uiPermissions.map(permissionMapper),
876
- tenantManagement: uiPermissionsByArea.tenantManagement.uiPermissions.map(permissionMapper)
877
- }
878
- },
879
- readOnly: {
880
- name: "Read access",
881
- value: staticRolesByName.admin,
882
- description: "This role can see all linked organizations but cannot make any changes",
883
- permissions: [],
884
- uiPermissions: {
885
- ...emptyUiPermissions,
886
- auditlog: [uiPermissionsById.read.value],
887
- userManagement: [uiPermissionsById.read.value],
888
- tenantManagement: [uiPermissionsById.read.value]
889
- }
890
- }
891
- };
892
- var defaultPermissionSets = {
893
- [permissionSetIds.Basic]: {
894
- name: permissionSetIds.Basic,
895
- result: {
896
- // this is needed to prevent the detailed permissions of the basic permission set from being interpreted as allowing read & management access to user endpoints
897
- userManagement: [uiPermissionsById.read.value]
898
- }
899
- },
900
- [permissionSetIds.SuperUser]: {
901
- name: permissionSetIds.SuperUser,
902
- result: {
903
- ...rolesById[staticRolesByName.admin].uiPermissions
904
- }
905
- },
906
- [permissionSetIds.ManageUsers]: {
907
- name: permissionSetIds.ManageUsers,
908
- result: {
909
- userManagement: [uiPermissionsById.manage.value]
910
- }
911
- },
912
- [permissionSetIds.ReadAuditLogs]: {
913
- name: permissionSetIds.ReadAuditLogs,
914
- result: {
915
- auditlog: [uiPermissionsById.read.value]
916
- }
917
- },
918
- [permissionSetIds.ReadReleases]: {
919
- name: permissionSetIds.ReadReleases,
920
- result: {
921
- releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] }
922
- }
923
- },
924
- [permissionSetIds.ReadTenants]: {
925
- name: permissionSetIds.ReadTenants,
926
- result: {
927
- tenantManagement: [uiPermissionsById.read.value]
928
- }
929
- },
930
- [permissionSetIds.ManageTenants]: {
931
- name: permissionSetIds.ManageTenants,
932
- result: {
933
- tenantManagement: [uiPermissionsById.manage.value]
934
- }
935
- },
936
- [permissionSetIds.ReadUsers]: {
937
- name: permissionSetIds.ReadUsers,
938
- result: {
939
- userManagement: [uiPermissionsById.read.value]
940
- }
941
- },
942
- [permissionSetIds.UploadArtifacts]: {
943
- name: permissionSetIds.UploadArtifacts,
944
- result: {
945
- releases: { [ALL_RELEASES]: [uiPermissionsById.upload.value] }
946
- }
947
- },
948
- [permissionSetIds.ManageReleases]: {
949
- name: permissionSetIds.ManageReleases,
950
- result: {
951
- releases: { [ALL_RELEASES]: [uiPermissionsById.manage.value] }
952
- }
953
- },
954
- [permissionSetIds.ConfigureDevices]: {
955
- name: permissionSetIds.ConfigureDevices,
956
- result: {
957
- deployments: [uiPermissionsById.read.value, uiPermissionsById.deploy.value],
958
- groups: { [ALL_DEVICES]: [uiPermissionsById.read.value, uiPermissionsById.configure.value] }
959
- }
960
- },
961
- [permissionSetIds.ConnectToDevices]: {
962
- name: permissionSetIds.ConnectToDevices,
963
- result: {
964
- groups: { [ALL_DEVICES]: [uiPermissionsById.read.value, uiPermissionsById.connect.value] }
965
- }
966
- },
967
- [permissionSetIds.DeployToDevices]: {
968
- name: permissionSetIds.DeployToDevices,
969
- result: {
970
- deployments: [uiPermissionsById.deploy.value, uiPermissionsById.manage.value, uiPermissionsById.read.value],
971
- groups: { [ALL_DEVICES]: [uiPermissionsById.read.value, uiPermissionsById.deploy.value] }
972
- }
973
- },
974
- [permissionSetIds.ManageDevices]: {
975
- name: permissionSetIds.ManageDevices,
976
- result: {
977
- groups: { [ALL_DEVICES]: [uiPermissionsById.read.value, uiPermissionsById.manage.value] }
978
- }
979
- },
980
- [permissionSetIds.ReadDevices]: {
981
- name: permissionSetIds.ReadDevices,
982
- result: {
983
- groups: { [ALL_DEVICES]: [uiPermissionsById.read.value] }
984
- }
985
- }
986
- };
987
- var USER_LOGOUT = "USER_LOGOUT";
988
- var rolesByName = {
989
- ...staticRolesByName,
990
- deploymentCreation: { action: "CREATE_DEPLOYMENT", object: { type: "DEVICE_GROUP", value: void 0 } },
991
- groupAccess: { action: "VIEW_DEVICE", object: { type: "DEVICE_GROUP", value: void 0 } },
992
- userManagement: { action: "http", object: { type: "any", value: `${useradmApiUrlv1}/.*` } }
993
- };
994
- var settingsKeys = { initialized: "settings-initialized" };
995
- var READ_STATES = {
996
- read: "read",
997
- seen: "seen",
998
- unread: "unread"
999
- };
1000
-
1001
- // src/appSlice/index.ts
1002
- var import_toolkit = require("@reduxjs/toolkit");
1003
- var sliceName = "app";
1004
- var getYesterday = () => {
1005
- const today = /* @__PURE__ */ new Date();
1006
- today.setDate(today.getDate() - 1);
1007
- return today.toISOString();
1008
- };
1009
- var initialState = {
1010
- cancelSource: void 0,
1011
- demoArtifactLink: "https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender",
1012
- hostAddress: null,
1013
- snackbar: {
1014
- open: false,
1015
- message: "",
1016
- maxWidth: 900,
1017
- autoHideDuration: void 0,
1018
- action: void 0,
1019
- children: void 0,
1020
- onClick: void 0,
1021
- onClose: void 0
1022
- },
1023
- // return boolean rather than organization details
1024
- features: {
1025
- hasAuditlogs: false,
1026
- hasDeltaProgress: false,
1027
- hasMultitenancy: false,
1028
- hasDeviceConfig: false,
1029
- hasDeviceConnect: false,
1030
- hasFeedbackEnabled: false,
1031
- hasMonitor: false,
1032
- hasReporting: false,
1033
- isDemoMode: false,
1034
- isHosted: false,
1035
- isEnterprise: false
1036
- },
1037
- feedbackProbability: 0.3,
1038
- firstLoginAfterSignup: false,
1039
- hostedAnnouncement: "",
1040
- docsVersion: "",
1041
- recaptchaSiteKey: "",
1042
- searchState: {
1043
- deviceIds: [],
1044
- searchTerm: "",
1045
- searchTotal: 0,
1046
- sort: {
1047
- direction: SORTING_OPTIONS.desc
1048
- // key: null,
1049
- // scope: null
1050
- }
1051
- },
1052
- stripeAPIKey: "",
1053
- trackerCode: "",
1054
- uploadsById: {
1055
- // id: { uploading: false, uploadProgress: 0, cancelSource: undefined }
1056
- },
1057
- newThreshold: getYesterday(),
1058
- offlineThreshold: getYesterday(),
1059
- versionInformation: {
1060
- Integration: "",
1061
- "Mender-Client": "",
1062
- "Mender-Artifact": "",
1063
- "Meta-Mender": "",
1064
- Deployments: "",
1065
- Deviceauth: "",
1066
- Inventory: "",
1067
- GUI: "latest"
1068
- },
1069
- yesterday: void 0
1070
- };
1071
- var appSlice = (0, import_toolkit.createSlice)({
1072
- name: sliceName,
1073
- initialState,
1074
- reducers: {
1075
- setFeatures: (state, action) => {
1076
- state.features = {
1077
- ...state.features,
1078
- ...action.payload
1079
- };
1080
- },
1081
- setSnackbar: (state, { payload }) => {
1082
- let { message, autoHideDuration, action, children, onClick, onClose } = payload;
1083
- if (typeof payload === "string" || payload instanceof String) {
1084
- message = payload;
1085
- }
1086
- state.snackbar = {
1087
- open: message ? true : false,
1088
- message,
1089
- maxWidth: 900,
1090
- autoHideDuration,
1091
- action,
1092
- children,
1093
- onClick,
1094
- onClose
1095
- };
1096
- },
1097
- setFirstLoginAfterSignup: (state, action) => {
1098
- state.firstLoginAfterSignup = action.payload;
1099
- },
1100
- setAnnouncement: (state, action) => {
1101
- state.hostedAnnouncement = action.payload;
1102
- },
1103
- setSearchState: (state, action) => {
1104
- state.searchState = {
1105
- ...state.searchState,
1106
- ...action.payload
1107
- };
1108
- },
1109
- setOfflineThreshold: (state, action) => {
1110
- state.offlineThreshold = action.payload;
1111
- },
1112
- initUpload: (state, action) => {
1113
- const { id, upload } = action.payload;
1114
- state.uploadsById[id] = upload;
1115
- },
1116
- uploadProgress: (state, action) => {
1117
- const { id, progress } = action.payload;
1118
- state.uploadsById[id] = {
1119
- ...state.uploadsById[id],
1120
- progress
1121
- };
1122
- },
1123
- cleanUpUpload: (state, action) => {
1124
- const { [action.payload]: current, ...remainder } = state.uploadsById;
1125
- state.uploadsById = remainder;
1126
- },
1127
- setVersionInformation: (state, action) => {
1128
- state.versionInformation = {
1129
- ...state.versionInformation,
1130
- ...action.payload
1131
- };
1132
- },
1133
- setEnvironmentData: (state, action) => {
1134
- return { ...state, ...action.payload };
1135
- }
1136
- }
1137
- });
1138
- var actions = appSlice.actions;
1139
- var appSlice_default = appSlice.reducer;
1140
-
1141
- // src/deploymentsSlice/index.ts
1142
- var import_toolkit2 = require("@reduxjs/toolkit");
1143
- var sliceName2 = "deployments";
1144
- var initialState2 = {
1145
- byId: {
1146
- // [id]: { statistics: { status: {}, total_size }, devices: { [deploymentId]: { id, log } }, totalDeviceCount }
1147
- },
1148
- byStatus: {
1149
- finished: { deploymentIds: [], total: 0 },
1150
- inprogress: { deploymentIds: [], total: 0 },
1151
- pending: { deploymentIds: [], total: 0 },
1152
- scheduled: { deploymentIds: [], total: 0 }
1153
- },
1154
- config: {
1155
- binaryDelta: {
1156
- timeout: -1,
1157
- duplicatesWindow: -1,
1158
- compressionLevel: -1,
1159
- disableChecksum: false,
1160
- disableDecompression: false,
1161
- inputWindow: -1,
1162
- instructionBuffer: -1,
1163
- sourceWindow: -1
1164
- },
1165
- binaryDeltaLimits: {
1166
- timeout: { ...limitDefault, default: 60, max: 3600, min: 60 },
1167
- sourceWindow: limitDefault,
1168
- inputWindow: limitDefault,
1169
- duplicatesWindow: limitDefault,
1170
- instructionBuffer: limitDefault
1171
- }
1172
- },
1173
- deploymentDeviceLimit: 5e3,
1174
- selectedDeviceIds: [],
1175
- selectionState: {
1176
- finished: { ...DEVICE_LIST_DEFAULTS, endDate: void 0, search: "", selection: [], startDate: void 0, total: 0, type: "" },
1177
- inprogress: { ...DEVICE_LIST_DEFAULTS, perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] },
1178
- pending: { ...DEVICE_LIST_DEFAULTS, perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] },
1179
- scheduled: { ...DEVICE_LIST_DEFAULTS, selection: [] },
1180
- general: {
1181
- state: DEPLOYMENT_ROUTES.active.key,
1182
- showCreationDialog: false,
1183
- showReportDialog: false,
1184
- reportType: null
1185
- // DeploymentConstants.DEPLOYMENT_TYPES.configuration|DeploymentConstants.DEPLOYMENT_TYPES.software
1186
- },
1187
- selectedId: void 0
1188
- }
1189
- };
1190
- var deploymentsSlice = (0, import_toolkit2.createSlice)({
1191
- name: sliceName2,
1192
- initialState: initialState2,
1193
- reducers: {
1194
- createdDeployment: (state, action) => {
1195
- state.byId[action.payload.id] = {
1196
- ...deploymentPrototype,
1197
- ...action.payload
1198
- };
1199
- state.byStatus[DEPLOYMENT_STATES.pending].total = state.byStatus[DEPLOYMENT_STATES.pending].total + 1;
1200
- state.byStatus[DEPLOYMENT_STATES.pending].deploymentIds = [...state.byStatus.pending.deploymentIds, action.payload.id];
1201
- state.selectionState[DEPLOYMENT_STATES.pending].selection = [action.payload.id, ...state.selectionState[DEPLOYMENT_STATES.pending].selection], state.selectionState[DEPLOYMENT_STATES.pending].total = state.selectionState[DEPLOYMENT_STATES.pending].total + 1;
1202
- },
1203
- removedDeployment: (state, action) => {
1204
- const { [action.payload]: removedDeployment, ...remainder } = state.byId;
1205
- state.byId = remainder;
1206
- },
1207
- receivedDeployment: (state, action) => {
1208
- state.byId[action.payload.id] = {
1209
- ...state.byId[action.payload.id] || {},
1210
- ...action.payload
1211
- };
1212
- },
1213
- receivedDeploymentDeviceLog: (state, action) => {
1214
- const { id, deviceId, log } = action.payload;
1215
- const deployment = {
1216
- ...deploymentPrototype,
1217
- ...state.byId[id]
1218
- };
1219
- state.byId[id] = {
1220
- ...deployment,
1221
- devices: {
1222
- ...deployment.devices,
1223
- [deviceId]: {
1224
- ...deployment.devices[deviceId],
1225
- log
1226
- }
1227
- }
1228
- };
1229
- },
1230
- receivedDeploymentDevices: (state, action) => {
1231
- const { id, devices, selectedDeviceIds, totalDeviceCount } = action.payload;
1232
- state.byId[id] = {
1233
- ...state.byId[id],
1234
- devices,
1235
- totalDeviceCount
1236
- };
1237
- state.selectedDeviceIds = selectedDeviceIds;
1238
- },
1239
- receivedDeployments: (state, action) => {
1240
- state.byId = {
1241
- ...state.byId,
1242
- ...action.payload
1243
- };
1244
- },
1245
- receivedDeploymentsForStatus: (state, action) => {
1246
- const { status, deploymentIds, total } = action.payload;
1247
- state.byStatus[status].deploymentIds = deploymentIds;
1248
- state.byStatus[status].total = total;
1249
- },
1250
- selectDeploymentsForStatus: (state, action) => {
1251
- const { status, deploymentIds, total } = action.payload;
1252
- state.selectionState[status].selection = deploymentIds;
1253
- state.selectionState[status].total = total;
1254
- },
1255
- setDeploymentsState: (state, action) => {
1256
- state.selectionState = action.payload;
1257
- },
1258
- setDeploymentsConfig: (state, action) => {
1259
- state.config = action.payload;
1260
- }
1261
- }
1262
- });
1263
- var actions2 = deploymentsSlice.actions;
1264
- var deploymentsSlice_default = deploymentsSlice.reducer;
1265
-
1266
- // src/devicesSlice/index.ts
1267
- var import_helpers = require("@northern.tech/utils/helpers");
1268
- var import_toolkit3 = require("@reduxjs/toolkit");
1269
- var sliceName3 = "devices";
1270
- var initialState3 = {
1271
- byId: {
1272
- // [deviceId]: {
1273
- // ...,
1274
- // twinsByIntegration: { [external.provider.id]: twinData }
1275
- // }
1276
- },
1277
- byStatus: {
1278
- [DEVICE_STATES.accepted]: { deviceIds: [], total: 0 },
1279
- active: { deviceIds: [], total: 0 },
1280
- inactive: { deviceIds: [], total: 0 },
1281
- [DEVICE_STATES.pending]: { deviceIds: [], total: 0 },
1282
- [DEVICE_STATES.preauth]: { deviceIds: [], total: 0 },
1283
- [DEVICE_STATES.rejected]: { deviceIds: [], total: 0 }
1284
- },
1285
- deviceList: {
1286
- deviceIds: [],
1287
- ...DEVICE_LIST_DEFAULTS,
1288
- selectedAttributes: [],
1289
- selectedIssues: [],
1290
- selection: [],
1291
- sort: {
1292
- direction: SORTING_OPTIONS.desc
1293
- // key: null,
1294
- // scope: null
1295
- },
1296
- state: DEVICE_STATES.accepted,
1297
- total: 0
1298
- },
1299
- filters: [
1300
- // { key: 'device_type', value: 'raspberry', operator: '$eq', scope: 'inventory' }
1301
- ],
1302
- filteringAttributes: { identityAttributes: [], inventoryAttributes: [], systemAttributes: [], tagAttributes: [] },
1303
- filteringAttributesLimit: 10,
1304
- filteringAttributesConfig: {
1305
- attributes: {
1306
- // inventory: ['some_attribute']
1307
- },
1308
- count: 0,
1309
- limit: 100
1310
- },
1311
- reports: [
1312
- // { items: [{ key: "someKey", count: 42 }], otherCount: 123, total: <otherCount + itemsCount> }
1313
- ],
1314
- total: 0,
1315
- limit: 0,
1316
- groups: {
1317
- byId: {
1318
- // groupName: { deviceIds: [], total: 0, filters: [] },
1319
- // dynamo: { deviceIds: [], total: 3, filters: [{ a: 1 }] }
1320
- },
1321
- selectedGroup: void 0
1322
- }
1323
- };
1324
- var devicesSlice = (0, import_toolkit3.createSlice)({
1325
- name: sliceName3,
1326
- initialState: initialState3,
1327
- reducers: {
1328
- receivedGroups: (state, action) => {
1329
- state.groups.byId = action.payload;
1330
- },
1331
- addToGroup: (state, action) => {
1332
- const { group, deviceIds } = action.payload;
1333
- const maybeExistingGroup = {
1334
- filters: [],
1335
- deviceIds: [],
1336
- ...state.groups.byId[group]
1337
- };
1338
- state.groups.byId[group] = {
1339
- ...maybeExistingGroup,
1340
- deviceIds: [...maybeExistingGroup.deviceIds, ...deviceIds].filter(import_helpers.duplicateFilter),
1341
- total: (maybeExistingGroup.total || 0) + 1
1342
- };
1343
- },
1344
- removeFromGroup: (state, action) => {
1345
- const { group, deviceIds: removedIds } = action.payload;
1346
- const { deviceIds = [], total = 0, ...maybeExistingGroup } = state.groups.byId[group] || {};
1347
- const changedGroup = {
1348
- ...maybeExistingGroup,
1349
- deviceIds: deviceIds.filter((id) => !removedIds.includes(id)),
1350
- total: Math.max(total - removedIds.length, 0)
1351
- };
1352
- if (changedGroup.total || changedGroup.deviceIds.length) {
1353
- state.groups.byId[group] = changedGroup;
1354
- return;
1355
- } else if (state.groups.selectedGroup === group) {
1356
- state.groups.selectedGroup = void 0;
1357
- }
1358
- const { [group]: removal, ...remainingById } = state.groups.byId;
1359
- state.groups.byId = remainingById;
1360
- },
1361
- addGroup: (state, action) => {
1362
- const { groupName, group } = action.payload;
1363
- state.groups.byId[groupName] = {
1364
- ...state.groups.byId[groupName],
1365
- ...group
1366
- };
1367
- },
1368
- selectGroup: (state, { payload: group }) => {
1369
- state.deviceList.deviceIds = state.groups.byId[group] && state.groups.byId[group].deviceIds.length > 0 ? state.groups.byId[group].deviceIds : [];
1370
- state.groups.selectedGroup = group;
1371
- },
1372
- removeGroup: (state, action) => {
1373
- const { [action.payload]: removal, ...remainingById } = state.groups.byId;
1374
- state.groups.byId = remainingById;
1375
- state.groups.selectedGroup = state.groups.selectedGroup === action.payload ? void 0 : state.groups.selectedGroup;
1376
- },
1377
- setDeviceListState: (state, action) => {
1378
- state.deviceList = {
1379
- ...state.deviceList,
1380
- ...action.payload,
1381
- sort: {
1382
- ...state.deviceList.sort,
1383
- ...action.payload.sort
1384
- }
1385
- };
1386
- },
1387
- setFilterAttributes: (state, action) => {
1388
- state.filteringAttributes = action.payload;
1389
- },
1390
- setFilterablesConfig: (state, action) => {
1391
- state.filteringAttributesConfig = action.payload;
1392
- },
1393
- receivedDevices: (state, action) => {
1394
- state.byId = {
1395
- ...state.byId,
1396
- ...action.payload
1397
- };
1398
- },
1399
- setDeviceFilters: (state, action) => {
1400
- if ((0, import_helpers.deepCompare)(action.payload, state.filters)) {
1401
- return;
1402
- }
1403
- state.filters = action.payload.filter((filter) => filter.key && filter.operator && filter.scope && typeof filter.value !== "undefined");
1404
- },
1405
- setInactiveDevices: (state, action) => {
1406
- const { activeDeviceTotal, inactiveDeviceTotal } = action.payload;
1407
- state.byStatus.active.total = activeDeviceTotal;
1408
- state.byStatus.inactive.total = inactiveDeviceTotal;
1409
- },
1410
- setDeviceReports: (state, action) => {
1411
- state.reports = action.payload;
1412
- },
1413
- setDevicesByStatus: (state, action) => {
1414
- const { forceUpdate, status, total, deviceIds } = action.payload;
1415
- state.byStatus[status] = total || forceUpdate ? { deviceIds, total } : state.byStatus[status];
1416
- },
1417
- setDevicesCountByStatus: (state, action) => {
1418
- const { count, status } = action.payload;
1419
- state.byStatus[status].total = count;
1420
- },
1421
- setTotalDevices: (state, action) => {
1422
- state.total = action.payload;
1423
- },
1424
- setDeviceLimit: (state, action) => {
1425
- state.limit = action.payload;
1426
- },
1427
- receivedDevice: (state, action) => {
1428
- state.byId[action.payload.id] = {
1429
- ...state.byId[action.payload.id],
1430
- ...action.payload
1431
- };
1432
- },
1433
- maybeUpdateDevicesByStatus: (state, action) => {
1434
- const { deviceId, authId } = action.payload;
1435
- const device = state.byId[deviceId];
1436
- const hasMultipleAuthSets = authId ? device.auth_sets.filter((authset) => authset.id !== authId).length > 0 : false;
1437
- if (!hasMultipleAuthSets && Object.values(DEVICE_STATES).includes(device.status)) {
1438
- const deviceIds = state.byStatus[device.status].deviceIds.filter((id) => id !== deviceId);
1439
- state.byStatus[device.status] = { deviceIds, total: Math.max(0, state.byStatus[device.status].total - 1) };
1440
- }
1441
- }
1442
- }
1443
- });
1444
- var actions3 = devicesSlice.actions;
1445
- var devicesSlice_default = devicesSlice.reducer;
1446
-
1447
- // src/monitorSlice/index.ts
1448
- var import_toolkit4 = require("@reduxjs/toolkit");
1449
- var sliceName4 = "monitor";
1450
- var initialState4 = {
1451
- alerts: {
1452
- alertList: { ...DEVICE_LIST_DEFAULTS, total: 0 },
1453
- byDeviceId: {}
1454
- },
1455
- issueCounts: {
1456
- byType: Object.values(DEVICE_ISSUE_OPTIONS).reduce((accu, { key }) => ({ ...accu, [key]: { filtered: 0, total: 0 } }), {})
1457
- },
1458
- settings: {
1459
- global: {
1460
- channels: {
1461
- ...Object.keys(alertChannels).reduce((accu, item) => ({ ...accu, [item]: { enabled: true } }), {})
1462
- }
1463
- }
1464
- }
1465
- };
1466
- var monitorSlice = (0, import_toolkit4.createSlice)({
1467
- name: sliceName4,
1468
- initialState: initialState4,
1469
- reducers: {
1470
- changeAlertChannel: (state, action) => {
1471
- const { channel, enabled } = action.payload;
1472
- state.settings.global.channels[channel] = { enabled };
1473
- },
1474
- receiveDeviceAlerts: (state, action) => {
1475
- const { deviceId, alerts } = action.payload;
1476
- state.alerts.byDeviceId[deviceId] = { alerts };
1477
- },
1478
- receiveLatestDeviceAlerts: (state, action) => {
1479
- const { deviceId, alerts } = action.payload;
1480
- state.alerts.byDeviceId[deviceId] = { ...state.alerts.byDeviceId[deviceId], latest: alerts };
1481
- },
1482
- receiveDeviceIssueCounts: (state, action) => {
1483
- const { issueType, counts } = action.payload;
1484
- state.issueCounts.byType[issueType] = counts;
1485
- },
1486
- setAlertListState: (state, action) => {
1487
- state.alerts.alertList = { ...state.alerts.alertList, ...action.payload };
1488
- }
1489
- }
1490
- });
1491
- var actions4 = monitorSlice.actions;
1492
- var monitorSlice_default = monitorSlice.reducer;
1493
-
1494
- // src/onboardingSlice/index.ts
1495
- var import_toolkit5 = require("@reduxjs/toolkit");
1496
- var sliceName5 = "onboarding";
1497
- var initialState5 = {
1498
- approach: null,
1499
- complete: false,
1500
- deviceType: null,
1501
- demoArtifactPort: 85,
1502
- progress: null,
1503
- showTips: null,
1504
- showTipsDialog: false
1505
- };
1506
- var onboardingSlice = (0, import_toolkit5.createSlice)({
1507
- name: sliceName5,
1508
- initialState: initialState5,
1509
- reducers: {
1510
- setOnboardingState: (state, action) => {
1511
- return { ...state, ...action.payload };
1512
- },
1513
- setDemoArtifactPort: (state, action) => {
1514
- state.demoArtifactPort = action.payload;
1515
- },
1516
- setShowOnboardingHelp: (state, action) => {
1517
- state.showTips = action.payload;
1518
- },
1519
- setShowDismissOnboardingTipsDialog: (state, action) => {
1520
- state.showTipsDialog = action.payload;
1521
- },
1522
- setOnboardingComplete: (state, action) => {
1523
- state.complete = action.payload;
1524
- },
1525
- setOnboardingProgress: (state, action) => {
1526
- state.progress = action.payload;
1527
- },
1528
- setOnboardingDeviceType: (state, action) => {
1529
- state.deviceType = action.payload;
1530
- },
1531
- setOnboardingApproach: (state, action) => {
1532
- state.approach = action.payload;
1533
- }
1534
- }
1535
- });
1536
- var actions5 = onboardingSlice.actions;
1537
- var onboardingSlice_default = onboardingSlice.reducer;
1538
-
1539
- // src/organizationSlice/index.ts
1540
- var import_toolkit6 = require("@reduxjs/toolkit");
1541
- var sliceName6 = "organization";
1542
- var initialState6 = {
1543
- card: {
1544
- last4: "",
1545
- expiration: { month: 1, year: 2020 },
1546
- brand: ""
1547
- },
1548
- intentId: null,
1549
- tenantList: {
1550
- ...TENANT_LIST_DEFAULT,
1551
- total: 0,
1552
- tenants: [],
1553
- selectedTenant: null,
1554
- sort: {
1555
- direction: SORTING_OPTIONS.desc,
1556
- key: "name"
1557
- }
1558
- },
1559
- organization: {
1560
- // id, name, status, tenant_token, plan
1561
- },
1562
- auditlog: {
1563
- events: [],
1564
- selectionState: {
1565
- ...DEVICE_LIST_DEFAULTS,
1566
- detail: void 0,
1567
- endDate: void 0,
1568
- selectedIssue: void 0,
1569
- sort: { direction: SORTING_OPTIONS.desc },
1570
- startDate: void 0,
1571
- total: 0,
1572
- type: void 0,
1573
- user: void 0
1574
- }
1575
- },
1576
- externalDeviceIntegrations: [
1577
- // { <connection_string|x509|...>, id, provider }
1578
- ],
1579
- ssoConfigs: [],
1580
- webhooks: {
1581
- // [id]: { events: [] }
1582
- // for now:
1583
- events: [],
1584
- eventsTotal: 0
1585
- }
1586
- };
1587
- var organizationSlice = (0, import_toolkit6.createSlice)({
1588
- name: sliceName6,
1589
- initialState: initialState6,
1590
- reducers: {
1591
- receiveAuditLogs: (state, action) => {
1592
- const { events, total } = action.payload;
1593
- state.auditlog.events = events;
1594
- state.auditlog.selectionState.total = total;
1595
- },
1596
- setAuditLogState: (state, action) => {
1597
- state.auditlog.selectionState = {
1598
- ...state.auditlog.selectionState,
1599
- ...action.payload
1600
- };
1601
- },
1602
- receiveCurrentCard: (state, action) => {
1603
- state.card = action.payload;
1604
- },
1605
- receiveSetupIntent: (state, action) => {
1606
- state.intentId = action.payload;
1607
- },
1608
- setOrganization: (state, action) => {
1609
- state.organization = { ...state.organization, ...action.payload };
1610
- },
1611
- setTenantListState: (state, action) => {
1612
- state.tenantList = action.payload;
1613
- },
1614
- receiveExternalDeviceIntegrations: (state, action) => {
1615
- state.externalDeviceIntegrations = action.payload;
1616
- },
1617
- receiveSsoConfigs: (state, action) => {
1618
- state.ssoConfigs = action.payload;
1619
- },
1620
- receiveWebhookEvents: (state, action) => {
1621
- const { value, total } = action.payload;
1622
- state.webhooks.events = value;
1623
- state.webhooks.eventsTotal = total;
1624
- }
1625
- }
1626
- });
1627
- var actions6 = organizationSlice.actions;
1628
- var organizationSlice_default = organizationSlice.reducer;
1629
-
1630
- // src/releasesSlice/index.ts
1631
- var import_toolkit7 = require("@reduxjs/toolkit");
1632
- var sliceName7 = "releases";
1633
- var initialState7 = {
1634
- /*
1635
- * Return list of saved artifacts objects
1636
- */
1637
- /*
1638
- * return list of artifacts where duplicate names are collated with device compatibility lists combined
1639
- */
1640
- // artifacts: AppStore.getCollatedArtifacts(AppStore.getArtifactsRepo()),
1641
- artifacts: [],
1642
- /*
1643
- * Return list of saved release objects
1644
- */
1645
- byId: {
1646
- /*
1647
- [releaseName]: {
1648
- artifacts: [
1649
- {
1650
- id: '',
1651
- name: '',
1652
- description: '',
1653
- device_types_compatible: [],
1654
- ...
1655
- updates: [{
1656
- files: [
1657
- { size: 123, name: '' }
1658
- ],
1659
- type_info: { type: '' }
1660
- }],
1661
- url: '' // optional
1662
- }
1663
- ],
1664
- modified: ''
1665
- device_types_compatible,
1666
- name: '',
1667
- tags: ['something'],
1668
- notes: ''
1669
- }
1670
- */
1671
- },
1672
- releasesList: {
1673
- ...DEVICE_LIST_DEFAULTS,
1674
- searchedIds: [],
1675
- releaseIds: [],
1676
- selection: [],
1677
- sort: {
1678
- direction: SORTING_OPTIONS.desc,
1679
- key: "modified"
1680
- },
1681
- isLoading: void 0,
1682
- searchTerm: "",
1683
- searchTotal: 0,
1684
- selectedTags: [],
1685
- total: 0,
1686
- type: ""
1687
- },
1688
- tags: [],
1689
- updateTypes: [],
1690
- /*
1691
- * Return single release with corresponding Artifacts
1692
- */
1693
- selectedRelease: null
1694
- };
1695
- var releaseSlice = (0, import_toolkit7.createSlice)({
1696
- name: sliceName7,
1697
- initialState: initialState7,
1698
- reducers: {
1699
- receiveRelease: (state, action) => {
1700
- const { name } = action.payload;
1701
- state.byId[name] = action.payload;
1702
- },
1703
- receiveReleases: (state, action) => {
1704
- state.byId = action.payload;
1705
- },
1706
- receiveReleaseTags: (state, action) => {
1707
- state.tags = action.payload;
1708
- },
1709
- receiveReleaseTypes: (state, action) => {
1710
- state.updateTypes = action.payload;
1711
- },
1712
- removeRelease: (state, action) => {
1713
- const { [action.payload]: toBeRemoved, ...byId } = state.byId;
1714
- state.byId = byId;
1715
- state.selectedRelease = action.payload === state.selectedRelease ? null : state.selectedRelease;
1716
- },
1717
- selectedRelease: (state, action) => {
1718
- state.selectedRelease = action.payload;
1719
- },
1720
- setReleaseListState: (state, action) => {
1721
- state.releasesList = action.payload;
1722
- }
1723
- }
1724
- });
1725
- var actions7 = releaseSlice.actions;
1726
- var releasesSlice_default = releaseSlice.reducer;
1727
-
1728
- // src/usersSlice/index.ts
1729
- var import_toolkit8 = require("@reduxjs/toolkit");
1730
- var sliceName8 = "users";
1731
- var initialState8 = {
1732
- activationCode: void 0,
1733
- byId: {},
1734
- currentUser: null,
1735
- currentSession: {
1736
- // { token: window.localStorage.getItem('JWT'), expiresAt: '2023-01-01T00:15:00.000Z' | undefined }, // expiresAt depending on the stay logged in setting
1737
- },
1738
- customColumns: [],
1739
- qrCode: null,
1740
- globalSettings: {
1741
- id_attribute: void 0,
1742
- previousFilters: [],
1743
- previousPhases: [],
1744
- retries: 0
1745
- },
1746
- permissionSetsById: {
1747
- ...defaultPermissionSets
1748
- },
1749
- rolesById: {
1750
- ...rolesById
1751
- },
1752
- settingsInitialized: false,
1753
- showConnectDeviceDialog: false,
1754
- showFeedbackDialog: false,
1755
- showStartupNotification: false,
1756
- tooltips: {
1757
- byId: {
1758
- // <id>: { readState: <read|unread> } // this object is getting enhanced by the tooltip texts in the app constants
1759
- }
1760
- },
1761
- userSettings: {
1762
- columnSelection: [],
1763
- onboarding: {}
1764
- },
1765
- userSettingsInitialized: false
1766
- };
1767
- var usersSlice = (0, import_toolkit8.createSlice)({
1768
- name: sliceName8,
1769
- initialState: initialState8,
1770
- reducers: {
1771
- receivedQrCode: (state, action) => {
1772
- state.qrCode = action.payload;
1773
- },
1774
- successfullyLoggedIn: (state, action) => {
1775
- state.currentSession = action.payload;
1776
- },
1777
- receivedUserList: (state, action) => {
1778
- state.byId = action.payload;
1779
- },
1780
- receivedActivationCode: (state, action) => {
1781
- state.activationCode = action.payload;
1782
- },
1783
- receivedUser: (state, action) => {
1784
- state.byId[action.payload.id] = action.payload;
1785
- state.currentUser = action.payload.id;
1786
- },
1787
- createdUser: (state, action) => {
1788
- state.byId[0] = action.payload;
1789
- },
1790
- removedUser: (state, action) => {
1791
- const { [action.payload]: removedUser, ...byId } = state.byId;
1792
- state.byId = byId;
1793
- state.currentUser = state.currentUser === action.payload ? null : state.currentUser;
1794
- },
1795
- updatedUser: (state, action) => {
1796
- state.byId[action.payload.id] = {
1797
- ...state.byId[action.payload.id],
1798
- ...action.payload
1799
- };
1800
- },
1801
- receivedPermissionSets: (state, action) => {
1802
- state.permissionSetsById = action.payload;
1803
- },
1804
- receivedRoles: (state, action) => {
1805
- state.rolesById = action.payload;
1806
- },
1807
- createdRole: (state, action) => {
1808
- state.rolesById[action.payload.name] = {
1809
- ...state.rolesById[action.payload.name],
1810
- ...action.payload
1811
- };
1812
- },
1813
- removedRole: (state, action) => {
1814
- const { [action.payload]: toBeRemoved, ...rolesById2 } = state.rolesById;
1815
- state.rolesById = rolesById2;
1816
- },
1817
- setCustomColumns: (state, action) => {
1818
- state.customColumns = action.payload;
1819
- },
1820
- setGlobalSettings: (state, action) => {
1821
- state.settingsInitialized = true;
1822
- state.globalSettings = {
1823
- ...state.globalSettings,
1824
- ...action.payload
1825
- };
1826
- },
1827
- setUserSettings: (state, action) => {
1828
- state.userSettingsInitialized = true;
1829
- state.userSettings = {
1830
- ...state.userSettings,
1831
- ...action.payload
1832
- };
1833
- },
1834
- setTooltipState: (state, action) => {
1835
- const { id, readState = READ_STATES.read } = action.payload;
1836
- state.tooltips.byId[id].readState = readState;
1837
- },
1838
- setTooltipsState: (state, action) => {
1839
- state.tooltips.byId = {
1840
- ...state.tooltips.byId,
1841
- ...action.payload
1842
- };
1843
- },
1844
- setShowFeedbackDialog: (state, action) => {
1845
- state.showFeedbackDialog = action.payload;
1846
- },
1847
- setShowConnectingDialog: (state, action) => {
1848
- state.showConnectDeviceDialog = action.payload;
1849
- },
1850
- setShowStartupNotification: (state, action) => {
1851
- state.showStartupNotification = action.payload;
1852
- }
1853
- }
1854
- });
1855
- var actions8 = usersSlice.actions;
1856
- var usersSlice_default = usersSlice.reducer;
1857
-
1858
- // src/actions.ts
1859
- var actions_default = {
1860
- ...actions,
1861
- ...actions2,
1862
- ...actions3,
1863
- ...actions4,
1864
- ...actions5,
1865
- ...actions6,
1866
- ...actions7,
1867
- ...actions8
1868
- };
1869
-
1870
- // src/auth.ts
1871
- var import_universal_cookie = __toESM(require("universal-cookie"));
1872
- var cookies = new import_universal_cookie.default();
1873
- var emptySession = Object.freeze({ token: "", exiresAt: void 0 });
1874
- var tokenCache = "";
1875
- var getSessionInfo = () => {
1876
- let sessionInfo = { ...emptySession };
1877
- try {
1878
- sessionInfo = JSON.parse(window.localStorage.getItem("JWT") ?? "");
1879
- } catch {
1880
- }
1881
- if (sessionInfo.expiresAt && new Date(sessionInfo.expiresAt) < /* @__PURE__ */ new Date()) {
1882
- cleanUp();
1883
- return { ...emptySession };
1884
- }
1885
- if (!sessionInfo.token) {
1886
- let jwtTokenFromCookie = cookies.get("JWT", { doNotParse: true }) ?? "";
1887
- if (jwtTokenFromCookie) {
1888
- setSessionInfo({ token: jwtTokenFromCookie, undefined: void 0 });
1889
- sessionInfo.token = jwtTokenFromCookie;
1890
- cookies.remove("JWT");
1891
- cookies.remove("JWT", { path: "/" });
1892
- }
1893
- }
1894
- sessionInfo.token = sessionInfo.token || void 0;
1895
- tokenCache = sessionInfo.token;
1896
- return sessionInfo;
1897
- };
1898
- var getToken = () => tokenCache ? tokenCache : getSessionInfo().token;
1899
- var setSessionInfo = ({ token, expiresAt }) => {
1900
- tokenCache = token;
1901
- window.localStorage.setItem("JWT", JSON.stringify({ token, expiresAt }));
1902
- };
1903
- var cleanUp = () => {
1904
- tokenCache = "";
1905
- cookies.remove("JWT");
1906
- cookies.remove("JWT", { path: "/" });
1907
- window.localStorage.removeItem("JWT");
1908
- window.localStorage.removeItem("oauth");
1909
- };
1910
-
1911
- // src/utils.ts
1912
- var import_helpers2 = require("@northern.tech/utils/helpers");
1913
- var filterAliases = {
1914
- $nexists: { alias: DEVICE_FILTERING_OPTIONS.$exists.key, value: false }
1915
- };
1916
- var extractErrorMessage = (err, fallback = "") => err.response?.data?.error?.message || err.response?.data?.error || err.error || err.message || fallback;
1917
- var preformatWithRequestID = (res, failMsg) => {
1918
- if (failMsg.length > 100) failMsg = `${failMsg.substring(0, 220)}...`;
1919
- try {
1920
- if (res?.data && Object.keys(res.data).includes("request_id")) {
1921
- let shortRequestUUID = res.data["request_id"].substring(0, 8);
1922
- return `${failMsg} [Request ID: ${shortRequestUUID}]`;
1923
- }
1924
- } catch (e) {
1925
- console.log("failed to extract request id:", e);
1926
- }
1927
- return failMsg;
1928
- };
1929
-
1930
- // src/store.ts
1931
- var { setSnackbar, uploadProgress } = actions_default;
1932
- var keys = ["sessionDeploymentChecker", settingsKeys.initialized];
1933
- var resetEnvironment = () => {
1934
- keys.map((key) => window.sessionStorage.removeItem(key));
1935
- };
1936
- resetEnvironment();
1937
- var commonErrorFallback = "Please check your connection.";
1938
- var commonErrorHandler = (err, errorContext, dispatch, fallback, mightBeAuthRelated = false) => {
1939
- const errMsg = extractErrorMessage(err, fallback);
1940
- if (mightBeAuthRelated || getToken()) {
1941
- dispatch(setSnackbar({ message: preformatWithRequestID(err.response, `${errorContext} ${errMsg}`), action: "Copy to clipboard" }));
1942
- }
1943
- return Promise.reject(err);
1944
- };
1945
- var rootReducer = (0, import_toolkit9.combineReducers)({
1946
- app: appSlice_default,
1947
- devices: devicesSlice_default,
1948
- deployments: deploymentsSlice_default,
1949
- monitor: monitorSlice_default,
1950
- onboarding: onboardingSlice_default,
1951
- organization: organizationSlice_default,
1952
- releases: releasesSlice_default,
1953
- users: usersSlice_default
1954
- });
1955
- var sessionReducer = (state, action) => {
1956
- if (action.type === USER_LOGOUT) {
1957
- state = void 0;
1958
- }
1959
- return rootReducer(state, action);
1960
- };
1961
- var getConfiguredStore = (options = {}) => {
1962
- const { preloadedState = {}, ...config } = options;
1963
- return (0, import_toolkit9.configureStore)({
1964
- ...config,
1965
- preloadedState,
1966
- reducer: sessionReducer,
1967
- middleware: (getDefaultMiddleware) => getDefaultMiddleware({
1968
- immutableCheck: {
1969
- ignoredPaths: ["app.uploadsById"]
1970
- },
1971
- serializableCheck: {
1972
- ignoredActions: [actions6.receiveExternalDeviceIntegrations.name, setSnackbar.name, uploadProgress.name],
1973
- ignoredActionPaths: ["uploads", "snackbar", /payload\..*$/],
1974
- ignoredPaths: ["app.uploadsById", "app.snackbar", "organization.externalDeviceIntegrations"]
1975
- }
1976
- })
1977
- });
1978
- };
1979
- var store = getConfiguredStore({
1980
- preloadedState: {}
1981
- });
1982
30
  //# sourceMappingURL=store.js.map