@northern.tech/store 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) hide show
  1. package/dist/actions.cjs +1812 -0
  2. package/dist/actions.cjs.map +1 -0
  3. package/dist/actions.js +18 -1806
  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 -1064
  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 -1088
  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 +22 -202
  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 +14 -1125
  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 +11 -82
  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 +39 -5728
  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 +15 -1042
  34. package/dist/auth.js.map +1 -1
  35. package/dist/{chunk-BOSBROA3.mjs → chunk-25AKG5HH.js} +6 -8
  36. package/dist/chunk-25AKG5HH.js.map +1 -0
  37. package/dist/{chunk-OGAMVFPS.mjs → chunk-4B3IMP4I.js} +18 -17
  38. package/dist/chunk-4B3IMP4I.js.map +1 -0
  39. package/dist/{chunk-OWHFMKTA.mjs → chunk-7PVGDMNM.js} +19 -16
  40. package/dist/{chunk-OWHFMKTA.mjs.map → chunk-7PVGDMNM.js.map} +1 -1
  41. package/dist/{chunk-MQIKQKSW.mjs → chunk-A6CT6GTI.js} +37 -33
  42. package/dist/{chunk-MQIKQKSW.mjs.map → chunk-A6CT6GTI.js.map} +1 -1
  43. package/dist/{chunk-4C6IY46N.mjs → chunk-AMGWP7A4.js} +7 -11
  44. package/dist/{chunk-4C6IY46N.mjs.map → chunk-AMGWP7A4.js.map} +1 -1
  45. package/dist/{chunk-G4FGNSV3.mjs → chunk-CK6YE6AN.js} +1 -1
  46. package/dist/{chunk-NCI6JV5R.mjs → chunk-CYV6632F.js} +6 -12
  47. package/dist/{chunk-NCI6JV5R.mjs.map → chunk-CYV6632F.js.map} +1 -1
  48. package/dist/{chunk-Y47SYXII.mjs → chunk-DGD6FVWF.js} +33 -42
  49. package/dist/{chunk-Y47SYXII.mjs.map → chunk-DGD6FVWF.js.map} +1 -1
  50. package/dist/{chunk-UPMSYTWW.mjs → chunk-DQ4ZLUIU.js} +307 -648
  51. package/dist/chunk-DQ4ZLUIU.js.map +1 -0
  52. package/dist/{chunk-EM2HUGUY.mjs → chunk-E5LEU5PF.js} +37 -28
  53. package/dist/{chunk-EM2HUGUY.mjs.map → chunk-E5LEU5PF.js.map} +1 -1
  54. package/dist/{chunk-M4U5R7A4.mjs → chunk-FGKMJS3B.js} +2 -6
  55. package/dist/{chunk-M4U5R7A4.mjs.map → chunk-FGKMJS3B.js.map} +1 -1
  56. package/dist/{chunk-RWYS5MKN.mjs → chunk-GZ5VQMDM.js} +17 -24
  57. package/dist/chunk-GZ5VQMDM.js.map +1 -0
  58. package/dist/{chunk-ZLRZO4EY.mjs → chunk-H6DUEJFF.js} +53 -101
  59. package/dist/chunk-H6DUEJFF.js.map +1 -0
  60. package/dist/chunk-JAROCU6M.js +25 -0
  61. package/dist/{chunk-L4HIW3KB.mjs.map → chunk-JAROCU6M.js.map} +1 -1
  62. package/dist/{chunk-QBKCUIWO.mjs → chunk-JIS4PA3R.js} +1 -1
  63. package/dist/{chunk-4U4X4KAC.mjs → chunk-KAQJH2YL.js} +11 -17
  64. package/dist/{chunk-4U4X4KAC.mjs.map → chunk-KAQJH2YL.js.map} +1 -1
  65. package/dist/{chunk-C2YZYTJ6.mjs → chunk-LIJIIRON.js} +2 -11
  66. package/dist/{chunk-C2YZYTJ6.mjs.map → chunk-LIJIIRON.js.map} +1 -1
  67. package/dist/{chunk-IU4OXOPA.mjs → chunk-MRCFLG45.js} +1 -1
  68. package/dist/chunk-NMAXZ3ZY.js +1 -0
  69. package/dist/{chunk-2HCZYULZ.mjs → chunk-Q6M5TTDQ.js} +3 -6
  70. package/dist/{chunk-2HCZYULZ.mjs.map → chunk-Q6M5TTDQ.js.map} +1 -1
  71. package/dist/{chunk-BWFTQHNM.mjs → chunk-RX55KAKX.js} +3 -4
  72. package/dist/{chunk-BWFTQHNM.mjs.map → chunk-RX55KAKX.js.map} +1 -1
  73. package/dist/{chunk-ZZ6VIQ3U.mjs → chunk-UEP36GCI.js} +10 -12
  74. package/dist/{chunk-ZZ6VIQ3U.mjs.map → chunk-UEP36GCI.js.map} +1 -1
  75. package/dist/{chunk-MJW4632R.mjs → chunk-UVQX743T.js} +18 -22
  76. package/dist/{chunk-MJW4632R.mjs.map → chunk-UVQX743T.js.map} +1 -1
  77. package/dist/chunk-V4DKKRWS.js +41 -0
  78. package/dist/{chunk-ENLZPHTQ.mjs.map → chunk-V4DKKRWS.js.map} +1 -1
  79. package/dist/{chunk-XJNI62IP.mjs → chunk-VOCOFE4I.js} +4 -11
  80. package/dist/{chunk-XJNI62IP.mjs.map → chunk-VOCOFE4I.js.map} +1 -1
  81. package/dist/{chunk-WS3YYLTJ.mjs → chunk-XTRPX7JZ.js} +14 -13
  82. package/dist/{chunk-WS3YYLTJ.mjs.map → chunk-XTRPX7JZ.js.map} +1 -1
  83. package/dist/{chunk-QG4PT5WK.mjs → chunk-XXHONFSQ.js} +9 -21
  84. package/dist/{chunk-QG4PT5WK.mjs.map → chunk-XXHONFSQ.js.map} +1 -1
  85. package/dist/{chunk-U6YTBIDT.mjs → chunk-YETZPQFR.js} +25 -52
  86. package/dist/chunk-YETZPQFR.js.map +1 -0
  87. package/dist/{chunk-EFHEROXZ.mjs → chunk-YGBFDXXA.js} +30 -18
  88. package/dist/{chunk-EFHEROXZ.mjs.map → chunk-YGBFDXXA.js.map} +1 -1
  89. package/dist/{chunk-H2PQQMRY.mjs → chunk-YO22XLHI.js} +1 -1
  90. package/dist/{chunk-2P4VECEE.mjs → chunk-YT73QWCN.js} +6 -11
  91. package/dist/{chunk-2P4VECEE.mjs.map → chunk-YT73QWCN.js.map} +1 -1
  92. package/dist/{chunk-X65NMDPS.mjs → chunk-YTQUNAZP.js} +40 -30
  93. package/dist/{chunk-X65NMDPS.mjs.map → chunk-YTQUNAZP.js.map} +1 -1
  94. package/dist/commonConstants.cjs +285 -0
  95. package/dist/{chunk-OGAMVFPS.mjs.map → commonConstants.cjs.map} +1 -1
  96. package/dist/{commonConstants.d.mts → commonConstants.d.cts} +3 -3
  97. package/dist/commonConstants.d.ts +3 -3
  98. package/dist/commonConstants.js +21 -286
  99. package/dist/commonConstants.js.map +1 -1
  100. package/dist/commonSelectors.cjs +1487 -0
  101. package/dist/commonSelectors.cjs.map +1 -0
  102. package/dist/commonSelectors.js +36 -1545
  103. package/dist/commonSelectors.js.map +1 -1
  104. package/dist/constants.cjs +1297 -0
  105. package/dist/constants.cjs.map +1 -0
  106. package/dist/{constants.d.mts → constants.d.cts} +10 -10
  107. package/dist/constants.d.ts +1 -1
  108. package/dist/constants.js +117 -1203
  109. package/dist/constants.js.map +1 -1
  110. package/dist/deploymentdevicehook.cjs +4686 -0
  111. package/dist/deploymentdevicehook.cjs.map +1 -0
  112. package/dist/deploymentdevicehook.d.cts +3 -0
  113. package/dist/deploymentdevicehook.d.ts +3 -0
  114. package/dist/deploymentdevicehook.js +60 -0
  115. package/dist/deploymentdevicehook.js.map +1 -0
  116. package/dist/deploymentsSlice/constants.cjs +562 -0
  117. package/dist/deploymentsSlice/constants.cjs.map +1 -0
  118. package/dist/deploymentsSlice/constants.js +24 -1016
  119. package/dist/deploymentsSlice/constants.js.map +1 -1
  120. package/dist/deploymentsSlice/index.cjs +648 -0
  121. package/dist/deploymentsSlice/index.cjs.map +1 -0
  122. package/dist/deploymentsSlice/index.js +14 -1111
  123. package/dist/deploymentsSlice/index.js.map +1 -1
  124. package/dist/deploymentsSlice/selectors.cjs +561 -0
  125. package/dist/deploymentsSlice/selectors.cjs.map +1 -0
  126. package/dist/deploymentsSlice/selectors.js +16 -1025
  127. package/dist/deploymentsSlice/selectors.js.map +1 -1
  128. package/dist/deploymentsSlice/thunks.cjs +4686 -0
  129. package/dist/deploymentsSlice/thunks.cjs.map +1 -0
  130. package/dist/deploymentsSlice/thunks.js +48 -5735
  131. package/dist/deploymentsSlice/thunks.js.map +1 -1
  132. package/dist/devicesSlice/constants.cjs +435 -0
  133. package/dist/devicesSlice/constants.cjs.map +1 -0
  134. package/dist/devicesSlice/constants.js +23 -1017
  135. package/dist/devicesSlice/constants.js.map +1 -1
  136. package/dist/devicesSlice/index.cjs +586 -0
  137. package/dist/devicesSlice/index.cjs.map +1 -0
  138. package/dist/devicesSlice/index.js +14 -1167
  139. package/dist/devicesSlice/index.js.map +1 -1
  140. package/dist/devicesSlice/selectors.cjs +531 -0
  141. package/dist/devicesSlice/selectors.cjs.map +1 -0
  142. package/dist/devicesSlice/selectors.js +30 -1126
  143. package/dist/devicesSlice/selectors.js.map +1 -1
  144. package/dist/devicesSlice/thunks.cjs +4758 -0
  145. package/dist/devicesSlice/thunks.cjs.map +1 -0
  146. package/dist/devicesSlice/thunks.js +84 -5771
  147. package/dist/devicesSlice/thunks.js.map +1 -1
  148. package/dist/monitorSlice/constants.cjs +165 -0
  149. package/dist/monitorSlice/constants.cjs.map +1 -0
  150. package/dist/monitorSlice/constants.js +10 -980
  151. package/dist/monitorSlice/constants.js.map +1 -1
  152. package/dist/monitorSlice/index.cjs +435 -0
  153. package/dist/monitorSlice/index.cjs.map +1 -0
  154. package/dist/monitorSlice/index.js +14 -1029
  155. package/dist/monitorSlice/index.js.map +1 -1
  156. package/dist/monitorSlice/selectors.cjs +31 -0
  157. package/dist/monitorSlice/selectors.cjs.map +1 -0
  158. package/dist/monitorSlice/selectors.js +5 -29
  159. package/dist/monitorSlice/selectors.js.map +1 -1
  160. package/dist/monitorSlice/thunks.cjs +2623 -0
  161. package/dist/monitorSlice/thunks.cjs.map +1 -0
  162. package/dist/monitorSlice/thunks.js +37 -2603
  163. package/dist/monitorSlice/thunks.js.map +1 -1
  164. package/dist/onboardingSlice/constants.cjs +71 -0
  165. package/dist/onboardingSlice/constants.cjs.map +1 -0
  166. package/dist/onboardingSlice/constants.js +6 -68
  167. package/dist/onboardingSlice/constants.js.map +1 -1
  168. package/dist/onboardingSlice/index.cjs +80 -0
  169. package/dist/onboardingSlice/index.cjs.map +1 -0
  170. package/dist/onboardingSlice/index.js +9 -88
  171. package/dist/onboardingSlice/index.js.map +1 -1
  172. package/dist/onboardingSlice/selectors.cjs +31 -0
  173. package/dist/onboardingSlice/selectors.cjs.map +1 -0
  174. package/dist/onboardingSlice/selectors.js +5 -29
  175. package/dist/onboardingSlice/selectors.js.map +1 -1
  176. package/dist/onboardingSlice/thunks.cjs +4774 -0
  177. package/dist/onboardingSlice/thunks.cjs.map +1 -0
  178. package/dist/onboardingSlice/thunks.js +42 -5731
  179. package/dist/onboardingSlice/thunks.js.map +1 -1
  180. package/dist/organizationSlice/constants.cjs +830 -0
  181. package/dist/organizationSlice/constants.cjs.map +1 -0
  182. package/dist/organizationSlice/constants.js +21 -1024
  183. package/dist/organizationSlice/constants.js.map +1 -1
  184. package/dist/organizationSlice/index.cjs +505 -0
  185. package/dist/organizationSlice/index.cjs.map +1 -0
  186. package/dist/organizationSlice/index.js +14 -1071
  187. package/dist/organizationSlice/index.js.map +1 -1
  188. package/dist/organizationSlice/selectors.cjs +300 -0
  189. package/dist/organizationSlice/selectors.cjs.map +1 -0
  190. package/dist/organizationSlice/selectors.js +23 -1026
  191. package/dist/organizationSlice/selectors.js.map +1 -1
  192. package/dist/organizationSlice/thunks.cjs +5006 -0
  193. package/dist/organizationSlice/thunks.cjs.map +1 -0
  194. package/dist/organizationSlice/thunks.js +67 -5754
  195. package/dist/organizationSlice/thunks.js.map +1 -1
  196. package/dist/releasesSlice/constants.cjs +40 -0
  197. package/dist/releasesSlice/constants.cjs.map +1 -0
  198. package/dist/releasesSlice/constants.js +8 -35
  199. package/dist/releasesSlice/constants.js.map +1 -1
  200. package/dist/releasesSlice/index.cjs +355 -0
  201. package/dist/releasesSlice/index.cjs.map +1 -0
  202. package/dist/releasesSlice/index.js +14 -1092
  203. package/dist/releasesSlice/index.js.map +1 -1
  204. package/dist/releasesSlice/selectors.cjs +290 -0
  205. package/dist/releasesSlice/selectors.cjs.map +1 -0
  206. package/dist/releasesSlice/selectors.js +18 -1022
  207. package/dist/releasesSlice/selectors.js.map +1 -1
  208. package/dist/releasesSlice/thunks.cjs +2896 -0
  209. package/dist/releasesSlice/thunks.cjs.map +1 -0
  210. package/dist/releasesSlice/thunks.js +48 -2904
  211. package/dist/releasesSlice/thunks.js.map +1 -1
  212. package/dist/selectors.cjs +1641 -0
  213. package/dist/selectors.cjs.map +1 -0
  214. package/dist/{selectors.d.mts → selectors.d.cts} +9 -9
  215. package/dist/selectors.js +117 -1627
  216. package/dist/selectors.js.map +1 -1
  217. package/dist/store.cjs +1932 -0
  218. package/dist/store.cjs.map +1 -0
  219. package/dist/store.js +24 -1933
  220. package/dist/store.js.map +1 -1
  221. package/dist/storehooks.cjs +5565 -0
  222. package/dist/storehooks.cjs.map +1 -0
  223. package/dist/storehooks.js +125 -5784
  224. package/dist/storehooks.js.map +1 -1
  225. package/dist/thunks.cjs +5675 -0
  226. package/dist/thunks.cjs.map +1 -0
  227. package/dist/{thunks.d.mts → thunks.d.cts} +8 -8
  228. package/dist/thunks.js +199 -5888
  229. package/dist/thunks.js.map +1 -1
  230. package/dist/usersSlice/constants.cjs +798 -0
  231. package/dist/usersSlice/constants.cjs.map +1 -0
  232. package/dist/usersSlice/constants.js +26 -1015
  233. package/dist/usersSlice/constants.js.map +1 -1
  234. package/dist/usersSlice/index.cjs +890 -0
  235. package/dist/usersSlice/index.cjs.map +1 -0
  236. package/dist/usersSlice/index.js +14 -1112
  237. package/dist/usersSlice/index.js.map +1 -1
  238. package/dist/usersSlice/selectors.cjs +826 -0
  239. package/dist/usersSlice/selectors.cjs.map +1 -0
  240. package/dist/usersSlice/selectors.js +23 -1047
  241. package/dist/usersSlice/selectors.js.map +1 -1
  242. package/dist/usersSlice/thunks.cjs +4732 -0
  243. package/dist/usersSlice/thunks.cjs.map +1 -0
  244. package/dist/usersSlice/thunks.js +71 -5758
  245. package/dist/usersSlice/thunks.js.map +1 -1
  246. package/dist/utils.cjs +739 -0
  247. package/dist/utils.cjs.map +1 -0
  248. package/dist/{utils.d.mts → utils.d.cts} +1 -3
  249. package/dist/utils.d.ts +1 -3
  250. package/dist/utils.js +26 -1206
  251. package/dist/utils.js.map +1 -1
  252. package/package.json +96 -7
  253. package/dist/actions.mjs +0 -21
  254. package/dist/api/general-api.mjs +0 -18
  255. package/dist/api/general-api.mjs.map +0 -1
  256. package/dist/api/users-api.mjs +0 -15
  257. package/dist/api/users-api.mjs.map +0 -1
  258. package/dist/appSlice/constants.mjs +0 -42
  259. package/dist/appSlice/constants.mjs.map +0 -1
  260. package/dist/appSlice/index.mjs +0 -21
  261. package/dist/appSlice/index.mjs.map +0 -1
  262. package/dist/appSlice/selectors.mjs +0 -20
  263. package/dist/appSlice/selectors.mjs.map +0 -1
  264. package/dist/appSlice/thunks.mjs +0 -45
  265. package/dist/appSlice/thunks.mjs.map +0 -1
  266. package/dist/auth.mjs +0 -23
  267. package/dist/auth.mjs.map +0 -1
  268. package/dist/chunk-BOSBROA3.mjs.map +0 -1
  269. package/dist/chunk-ENLZPHTQ.mjs +0 -35
  270. package/dist/chunk-L4HIW3KB.mjs +0 -36
  271. package/dist/chunk-RWYS5MKN.mjs.map +0 -1
  272. package/dist/chunk-U6YTBIDT.mjs.map +0 -1
  273. package/dist/chunk-UPMSYTWW.mjs.map +0 -1
  274. package/dist/chunk-V32GTKOS.mjs +0 -1
  275. package/dist/chunk-V32GTKOS.mjs.map +0 -1
  276. package/dist/chunk-XWBD7VOK.mjs +0 -93
  277. package/dist/chunk-XWBD7VOK.mjs.map +0 -1
  278. package/dist/chunk-ZLRZO4EY.mjs.map +0 -1
  279. package/dist/commonConstants.mjs +0 -40
  280. package/dist/commonConstants.mjs.map +0 -1
  281. package/dist/commonSelectors.mjs +0 -56
  282. package/dist/commonSelectors.mjs.map +0 -1
  283. package/dist/constants.mjs +0 -223
  284. package/dist/constants.mjs.map +0 -1
  285. package/dist/deploymentsSlice/constants.mjs +0 -42
  286. package/dist/deploymentsSlice/constants.mjs.map +0 -1
  287. package/dist/deploymentsSlice/index.mjs +0 -21
  288. package/dist/deploymentsSlice/index.mjs.map +0 -1
  289. package/dist/deploymentsSlice/selectors.mjs +0 -25
  290. package/dist/deploymentsSlice/selectors.mjs.map +0 -1
  291. package/dist/deploymentsSlice/thunks.mjs +0 -63
  292. package/dist/deploymentsSlice/thunks.mjs.map +0 -1
  293. package/dist/devicesSlice/constants.mjs +0 -40
  294. package/dist/devicesSlice/constants.mjs.map +0 -1
  295. package/dist/devicesSlice/index.mjs +0 -21
  296. package/dist/devicesSlice/index.mjs.map +0 -1
  297. package/dist/devicesSlice/selectors.mjs +0 -53
  298. package/dist/devicesSlice/selectors.mjs.map +0 -1
  299. package/dist/devicesSlice/thunks.mjs +0 -135
  300. package/dist/devicesSlice/thunks.mjs.map +0 -1
  301. package/dist/monitorSlice/constants.mjs +0 -14
  302. package/dist/monitorSlice/constants.mjs.map +0 -1
  303. package/dist/monitorSlice/index.mjs +0 -21
  304. package/dist/monitorSlice/index.mjs.map +0 -1
  305. package/dist/monitorSlice/selectors.mjs +0 -8
  306. package/dist/monitorSlice/selectors.mjs.map +0 -1
  307. package/dist/monitorSlice/thunks.mjs +0 -44
  308. package/dist/monitorSlice/thunks.mjs.map +0 -1
  309. package/dist/onboardingSlice/constants.mjs +0 -10
  310. package/dist/onboardingSlice/constants.mjs.map +0 -1
  311. package/dist/onboardingSlice/index.mjs +0 -16
  312. package/dist/onboardingSlice/index.mjs.map +0 -1
  313. package/dist/onboardingSlice/selectors.mjs +0 -8
  314. package/dist/onboardingSlice/selectors.mjs.map +0 -1
  315. package/dist/onboardingSlice/thunks.mjs +0 -51
  316. package/dist/onboardingSlice/thunks.mjs.map +0 -1
  317. package/dist/organizationSlice/constants.mjs +0 -36
  318. package/dist/organizationSlice/constants.mjs.map +0 -1
  319. package/dist/organizationSlice/index.mjs +0 -21
  320. package/dist/organizationSlice/index.mjs.map +0 -1
  321. package/dist/organizationSlice/selectors.mjs +0 -39
  322. package/dist/organizationSlice/selectors.mjs.map +0 -1
  323. package/dist/organizationSlice/thunks.mjs +0 -101
  324. package/dist/organizationSlice/thunks.mjs.map +0 -1
  325. package/dist/releasesSlice/constants.mjs +0 -14
  326. package/dist/releasesSlice/constants.mjs.map +0 -1
  327. package/dist/releasesSlice/index.mjs +0 -21
  328. package/dist/releasesSlice/index.mjs.map +0 -1
  329. package/dist/releasesSlice/selectors.mjs +0 -28
  330. package/dist/releasesSlice/selectors.mjs.map +0 -1
  331. package/dist/releasesSlice/thunks.mjs +0 -66
  332. package/dist/releasesSlice/thunks.mjs.map +0 -1
  333. package/dist/selectors.mjs +0 -209
  334. package/dist/selectors.mjs.map +0 -1
  335. package/dist/store.mjs +0 -32
  336. package/dist/store.mjs.map +0 -1
  337. package/dist/storehooks.mjs +0 -285
  338. package/dist/storehooks.mjs.map +0 -1
  339. package/dist/thunks.mjs +0 -363
  340. package/dist/thunks.mjs.map +0 -1
  341. package/dist/usersSlice/constants.mjs +0 -45
  342. package/dist/usersSlice/constants.mjs.map +0 -1
  343. package/dist/usersSlice/index.mjs +0 -21
  344. package/dist/usersSlice/index.mjs.map +0 -1
  345. package/dist/usersSlice/selectors.mjs +0 -38
  346. package/dist/usersSlice/selectors.mjs.map +0 -1
  347. package/dist/usersSlice/thunks.mjs +0 -109
  348. package/dist/usersSlice/thunks.mjs.map +0 -1
  349. package/dist/utils.mjs +0 -49
  350. package/dist/utils.mjs.map +0 -1
  351. /package/dist/{actions.d.mts → actions.d.cts} +0 -0
  352. /package/dist/api/{general-api.d.mts → general-api.d.cts} +0 -0
  353. /package/dist/api/{users-api.d.mts → users-api.d.cts} +0 -0
  354. /package/dist/appSlice/{index.d.mts → index.d.cts} +0 -0
  355. /package/dist/appSlice/{selectors.d.mts → selectors.d.cts} +0 -0
  356. /package/dist/appSlice/{thunks.d.mts → thunks.d.cts} +0 -0
  357. /package/dist/{auth.d.mts → auth.d.cts} +0 -0
  358. /package/dist/{chunk-G4FGNSV3.mjs.map → chunk-CK6YE6AN.js.map} +0 -0
  359. /package/dist/{chunk-QBKCUIWO.mjs.map → chunk-JIS4PA3R.js.map} +0 -0
  360. /package/dist/{chunk-IU4OXOPA.mjs.map → chunk-MRCFLG45.js.map} +0 -0
  361. /package/dist/{actions.mjs.map → chunk-NMAXZ3ZY.js.map} +0 -0
  362. /package/dist/{chunk-H2PQQMRY.mjs.map → chunk-YO22XLHI.js.map} +0 -0
  363. /package/dist/{commonSelectors.d.mts → commonSelectors.d.cts} +0 -0
  364. /package/dist/deploymentsSlice/{constants.d.mts → constants.d.cts} +0 -0
  365. /package/dist/deploymentsSlice/{index.d.mts → index.d.cts} +0 -0
  366. /package/dist/deploymentsSlice/{selectors.d.mts → selectors.d.cts} +0 -0
  367. /package/dist/deploymentsSlice/{thunks.d.mts → thunks.d.cts} +0 -0
  368. /package/dist/devicesSlice/{constants.d.mts → constants.d.cts} +0 -0
  369. /package/dist/devicesSlice/{index.d.mts → index.d.cts} +0 -0
  370. /package/dist/devicesSlice/{selectors.d.mts → selectors.d.cts} +0 -0
  371. /package/dist/devicesSlice/{thunks.d.mts → thunks.d.cts} +0 -0
  372. /package/dist/monitorSlice/{constants.d.mts → constants.d.cts} +0 -0
  373. /package/dist/monitorSlice/{index.d.mts → index.d.cts} +0 -0
  374. /package/dist/monitorSlice/{selectors.d.mts → selectors.d.cts} +0 -0
  375. /package/dist/monitorSlice/{thunks.d.mts → thunks.d.cts} +0 -0
  376. /package/dist/onboardingSlice/{constants.d.mts → constants.d.cts} +0 -0
  377. /package/dist/onboardingSlice/{index.d.mts → index.d.cts} +0 -0
  378. /package/dist/onboardingSlice/{selectors.d.mts → selectors.d.cts} +0 -0
  379. /package/dist/onboardingSlice/{thunks.d.mts → thunks.d.cts} +0 -0
  380. /package/dist/organizationSlice/{constants.d.mts → constants.d.cts} +0 -0
  381. /package/dist/organizationSlice/{index.d.mts → index.d.cts} +0 -0
  382. /package/dist/organizationSlice/{selectors.d.mts → selectors.d.cts} +0 -0
  383. /package/dist/organizationSlice/{thunks.d.mts → thunks.d.cts} +0 -0
  384. /package/dist/releasesSlice/{constants.d.mts → constants.d.cts} +0 -0
  385. /package/dist/releasesSlice/{index.d.mts → index.d.cts} +0 -0
  386. /package/dist/releasesSlice/{selectors.d.mts → selectors.d.cts} +0 -0
  387. /package/dist/releasesSlice/{thunks.d.mts → thunks.d.cts} +0 -0
  388. /package/dist/{store.d.mts → store.d.cts} +0 -0
  389. /package/dist/{storehooks.d.mts → storehooks.d.cts} +0 -0
  390. /package/dist/usersSlice/{constants.d.mts → constants.d.cts} +0 -0
  391. /package/dist/usersSlice/{index.d.mts → index.d.cts} +0 -0
  392. /package/dist/usersSlice/{selectors.d.mts → selectors.d.cts} +0 -0
  393. /package/dist/usersSlice/{thunks.d.mts → thunks.d.cts} +0 -0
package/dist/utils.cjs ADDED
@@ -0,0 +1,739 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/utils.ts
21
+ var utils_exports = {};
22
+ __export(utils_exports, {
23
+ convertDeviceListStateToFilters: () => convertDeviceListStateToFilters,
24
+ filtersFilter: () => filtersFilter,
25
+ generateDeploymentGroupDetails: () => generateDeploymentGroupDetails,
26
+ getComparisonCompatibleVersion: () => getComparisonCompatibleVersion,
27
+ getDeploymentState: () => getDeploymentState,
28
+ groupDeploymentDevicesStats: () => groupDeploymentDevicesStats,
29
+ groupDeploymentStats: () => groupDeploymentStats,
30
+ isDarkMode: () => isDarkMode,
31
+ listItemMapper: () => listItemMapper,
32
+ mapDeviceAttributes: () => mapDeviceAttributes,
33
+ mapFiltersToTerms: () => mapFiltersToTerms,
34
+ mapTermsToFilters: () => mapTermsToFilters,
35
+ mapUserRolesToUiPermissions: () => mapUserRolesToUiPermissions,
36
+ mergePermissions: () => mergePermissions,
37
+ progress: () => progress,
38
+ statCollector: () => statCollector,
39
+ stringToBoolean: () => stringToBoolean
40
+ });
41
+ module.exports = __toCommonJS(utils_exports);
42
+ var import_helpers = require("@northern.tech/utils/helpers");
43
+
44
+ // src/commonConstants.tsx
45
+ var import_js = require("@mdi/js");
46
+ var import_jsx_runtime = require("react/jsx-runtime");
47
+ var DEVICE_LIST_DEFAULTS = {
48
+ page: 1,
49
+ perPage: 20
50
+ };
51
+ var timeUnits = {
52
+ days: "days",
53
+ minutes: "minutes",
54
+ hours: "hours"
55
+ };
56
+ var DEVICE_LIST_MAXIMUM_LENGTH = 50;
57
+ var DEVICE_FILTERING_OPTIONS = {
58
+ $eq: { key: "$eq", title: "equals", shortform: "=" },
59
+ $ne: { key: "$ne", title: "not equal", shortform: "!=" },
60
+ $gt: {
61
+ key: "$gt",
62
+ title: ">",
63
+ shortform: ">",
64
+ 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.'
65
+ },
66
+ $gte: {
67
+ title: ">=",
68
+ shortform: ">=",
69
+ 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.'
70
+ },
71
+ $lt: {
72
+ key: "$lt",
73
+ title: "<",
74
+ shortform: "<",
75
+ 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.'
76
+ },
77
+ $lte: {
78
+ title: "<=",
79
+ shortform: "<=",
80
+ 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.'
81
+ },
82
+ $ltne: {
83
+ key: "$ltne",
84
+ title: "$ltne",
85
+ shortform: "ltne",
86
+ 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.'
87
+ },
88
+ $in: {
89
+ key: "$in",
90
+ title: "in",
91
+ shortform: "in",
92
+ 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.'
93
+ },
94
+ $nin: {
95
+ key: "$nin",
96
+ title: "not in",
97
+ shortform: "not in",
98
+ 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.`
99
+ },
100
+ $exists: {
101
+ key: "$exists",
102
+ title: "exists",
103
+ shortform: "exists",
104
+ value: true,
105
+ help: `The "exists" operator matches if the selected field's value has a value. No value needs to be provided for this operator.`
106
+ },
107
+ $nexists: {
108
+ key: "$nexists",
109
+ title: `doesn't exist`,
110
+ shortform: `doesn't exist`,
111
+ value: true,
112
+ 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.`
113
+ },
114
+ $regex: {
115
+ key: "$regex",
116
+ title: `matches regular expression`,
117
+ shortform: `matches`,
118
+ 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.`
119
+ }
120
+ };
121
+ var DEVICE_ISSUE_OPTIONS = {
122
+ issues: {
123
+ isCategory: true,
124
+ key: "issues",
125
+ title: "Devices with issues",
126
+ filterRule: {}
127
+ },
128
+ offline: {
129
+ issueCategory: "issues",
130
+ key: "offline",
131
+ needsFullFiltering: true,
132
+ needsMonitor: false,
133
+ needsReporting: false,
134
+ filterRule: {
135
+ scope: "system",
136
+ key: "check_in_time",
137
+ operator: DEVICE_FILTERING_OPTIONS.$ltne.key,
138
+ value: ({ offlineThreshold }) => offlineThreshold
139
+ },
140
+ title: "Offline devices"
141
+ },
142
+ failedLastUpdate: {
143
+ issueCategory: "issues",
144
+ key: "failedLastUpdate",
145
+ needsFullFiltering: false,
146
+ needsMonitor: false,
147
+ needsReporting: true,
148
+ filterRule: { scope: "monitor", key: "failed_last_update", operator: DEVICE_FILTERING_OPTIONS.$eq.key, value: true },
149
+ title: "Deployment failed"
150
+ },
151
+ monitoring: {
152
+ issueCategory: "issues",
153
+ key: "monitoring",
154
+ needsFullFiltering: false,
155
+ needsMonitor: true,
156
+ needsReporting: false,
157
+ filterRule: { scope: "monitor", key: "alerts", operator: DEVICE_FILTERING_OPTIONS.$eq.key, value: true },
158
+ title: "Monitoring alert"
159
+ },
160
+ authRequests: {
161
+ key: "authRequests",
162
+ needsFullFiltering: false,
163
+ needsMonitor: false,
164
+ needsReporting: true,
165
+ filterRule: { scope: "monitor", key: "auth_requests", operator: DEVICE_FILTERING_OPTIONS.$gt.key, value: 1 },
166
+ title: "Devices with new authentication requests"
167
+ },
168
+ gatewayDevices: {
169
+ key: "gatewayDevices",
170
+ needsFullFiltering: false,
171
+ needsMonitor: false,
172
+ needsReporting: true,
173
+ filterRule: { scope: "inventory", key: "mender_is_gateway", operator: DEVICE_FILTERING_OPTIONS.$eq.key, value: "true" },
174
+ title: "Gateway devices"
175
+ }
176
+ };
177
+ var oneSecond = 1e3;
178
+ var TIMEOUTS = {
179
+ debounceDefault: 700,
180
+ debounceShort: 300,
181
+ halfASecond: 0.5 * oneSecond,
182
+ oneSecond,
183
+ twoSeconds: 2 * oneSecond,
184
+ threeSeconds: 3 * oneSecond,
185
+ fiveSeconds: 5 * oneSecond,
186
+ refreshDefault: 10 * oneSecond,
187
+ refreshLong: 60 * oneSecond
188
+ };
189
+ var SORTING_OPTIONS = {
190
+ asc: "asc",
191
+ desc: "desc"
192
+ };
193
+ var DEVICE_ONLINE_CUTOFF = { interval: 1, intervalName: timeUnits.days };
194
+ var ATTRIBUTE_SCOPES = {
195
+ inventory: "inventory",
196
+ identity: "identity",
197
+ monitor: "monitor",
198
+ system: "system",
199
+ tags: "tags"
200
+ };
201
+ var defaultIdAttribute = Object.freeze({ attribute: "id", scope: ATTRIBUTE_SCOPES.identity });
202
+ var credentialTypes = {
203
+ aws: "aws",
204
+ http: "http",
205
+ sas: "sas",
206
+ x509: "x509"
207
+ };
208
+ var EXTERNAL_PROVIDER = {
209
+ "iot-core": {
210
+ credentialsType: credentialTypes.aws,
211
+ icon: import_js.mdiAws,
212
+ title: "AWS IoT Core",
213
+ twinTitle: "Device Shadow",
214
+ provider: "iot-core",
215
+ enabled: true,
216
+ deviceTwin: true,
217
+ configHint: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: "For help finding your AWS IoT Core connection string, check the AWS IoT documentation." })
218
+ },
219
+ "iot-hub": {
220
+ credentialsType: credentialTypes.sas,
221
+ icon: import_js.mdiMicrosoftAzure,
222
+ title: "Azure IoT Hub",
223
+ twinTitle: "Device Twin",
224
+ provider: "iot-hub",
225
+ enabled: true,
226
+ deviceTwin: true,
227
+ configHint: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
228
+ "For help finding your Azure IoT Hub connection string, look under 'Shared access policies' in the Microsoft Azure UI as described",
229
+ " ",
230
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
231
+ "a",
232
+ {
233
+ href: "https://devblogs.microsoft.com/iotdev/understand-different-connection-strings-in-azure-iot-hub/#iothubconn",
234
+ target: "_blank",
235
+ rel: "noopener noreferrer",
236
+ children: "here"
237
+ }
238
+ ),
239
+ "."
240
+ ] })
241
+ },
242
+ webhook: {
243
+ credentialsType: credentialTypes.http,
244
+ deviceTwin: false,
245
+ // disable the webhook provider here, since it is treated different than other integrations, with a custom configuration & management view, etc.
246
+ enabled: false,
247
+ provider: "webhook"
248
+ }
249
+ };
250
+ var emptyUiPermissions = Object.freeze({
251
+ auditlog: [],
252
+ deployments: [],
253
+ groups: Object.freeze({}),
254
+ releases: Object.freeze({}),
255
+ tenantManagement: [],
256
+ userManagement: []
257
+ });
258
+ var emptyRole = Object.freeze({
259
+ name: void 0,
260
+ description: "",
261
+ permissions: [],
262
+ uiPermissions: Object.freeze({ ...emptyUiPermissions })
263
+ });
264
+
265
+ // src/appSlice/constants.ts
266
+ var import_icons_material = require("@mui/icons-material");
267
+ var startingDeviceCount = {
268
+ os: "for first 50 devices",
269
+ professional: "for first 250 devices"
270
+ };
271
+ var apiRoot = "/api/management";
272
+ var apiUrl = {
273
+ v1: `${apiRoot}/v1`,
274
+ v2: `${apiRoot}/v2`
275
+ };
276
+ var chartTypes = {
277
+ bar: { key: "bar", Icon: import_icons_material.BarChart },
278
+ pie: { key: "pie", Icon: import_icons_material.PieChartOutline }
279
+ };
280
+ var emptyChartSelection = { software: "", group: "", chartType: chartTypes.bar.key, attribute: "artifact_name" };
281
+ var defaultReportType = "distribution";
282
+ var defaultReports = [{ ...emptyChartSelection, group: null, attribute: "artifact_name", type: defaultReportType }];
283
+ var PLANS = {
284
+ os: {
285
+ id: "os",
286
+ name: "Basic",
287
+ offer: true,
288
+ price: "$32/month",
289
+ deviceCount: startingDeviceCount.os,
290
+ offerprice: "$23/month for first 50 devices",
291
+ price2: "for first 6 months;\n$29/month thereafter",
292
+ features: ["Basic OTA features"]
293
+ },
294
+ professional: {
295
+ id: "professional",
296
+ name: "Professional",
297
+ offer: true,
298
+ price: "$269/month",
299
+ deviceCount: startingDeviceCount.professional,
300
+ offerprice: "$200/month for first 50 devices",
301
+ price2: "for first 6 months;\n$249/month thereafter",
302
+ features: ["+ Advanced OTA features", "+ Standard support"]
303
+ },
304
+ enterprise: {
305
+ id: "enterprise",
306
+ name: "Enterprise",
307
+ price: "Custom pricing",
308
+ deviceCount: "unlimited devices",
309
+ features: ["+ Enterprise-grade OTA features", "+ Premium support"]
310
+ }
311
+ };
312
+ var ADDONS = {
313
+ configure: {
314
+ id: "configure",
315
+ title: "Configure",
316
+ description: "Expand your plan with device configuration features",
317
+ needs: ["hasDeviceConfig"],
318
+ os: {
319
+ price: "$11/month",
320
+ deviceCount: startingDeviceCount.os
321
+ },
322
+ professional: {
323
+ price: "$65/month",
324
+ deviceCount: startingDeviceCount.professional
325
+ },
326
+ eligible: ["os", "professional", "enterprise"]
327
+ },
328
+ troubleshoot: {
329
+ id: "troubleshoot",
330
+ title: "Troubleshoot",
331
+ description: "Expand your plan with device troubleshooting features",
332
+ needs: ["hasDeviceConnect"],
333
+ os: {
334
+ price: "$27/month",
335
+ deviceCount: startingDeviceCount.os
336
+ },
337
+ professional: {
338
+ price: "$72/month",
339
+ deviceCount: startingDeviceCount.professional
340
+ },
341
+ eligible: ["os", "professional", "enterprise"]
342
+ },
343
+ monitor: {
344
+ id: "monitor",
345
+ title: "Monitor",
346
+ description: "Expand your plan with device monitoring features",
347
+ needs: ["hasMonitor"],
348
+ os: {
349
+ price: "-",
350
+ deviceCount: "-"
351
+ },
352
+ professional: {
353
+ price: "$86/month",
354
+ deviceCount: startingDeviceCount.professional
355
+ },
356
+ eligible: ["professional", "enterprise"]
357
+ }
358
+ };
359
+ var BENEFITS = {
360
+ auditlog: { id: "auditlog", benefit: "trace change across your devices and access troubleshooting session replay", requiredPlan: PLANS.professional.id },
361
+ dashboard: { id: "dashboard", benefit: "actionable insights into the devices you are updating with Mender", requiredPlan: PLANS.enterprise.id },
362
+ deltaGeneration: {
363
+ id: "deltaGeneration",
364
+ benefit: "automatic delta artifacts generation to minimize data transfer and improve the update delivery",
365
+ requiredPlan: PLANS.enterprise.id
366
+ },
367
+ deviceConfiguration: { id: "deviceConfiguration", benefit: "device configuration features", requiredAddon: ADDONS.configure.id },
368
+ deviceMonitor: { id: "deviceMonitor", benefit: "device monitoring features", requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },
369
+ deviceTroubleshoot: { id: "deviceTroubleshoot", benefit: "device troubleshooting features", requiredAddon: ADDONS.troubleshoot.id },
370
+ dynamicGroups: { id: "dynamicGroups", benefit: "create dynamic groups to ease device management", requiredPlan: PLANS.enterprise.id },
371
+ fullFiltering: { id: "fullFiltering", benefit: "filtering by multiple attributes to improve the device overview", requiredPlan: PLANS.professional.id },
372
+ gateway: { id: "gateway", benefit: "see devices connected to your gateway device for easy access", requiredPlans: PLANS.professional.id },
373
+ pausedDeployments: {
374
+ id: "pausedDeployments",
375
+ benefit: "granular control about update rollout to allow synchronization across your fleet",
376
+ requiredPlan: PLANS.enterprise.id
377
+ },
378
+ phasedDeployments: { id: "phasedDeployments", benefit: "choose to roll out deployments in multiple phases", requiredPlan: PLANS.enterprise.id },
379
+ rbac: { id: "rbac", benefit: "granular role based access control", requiredPlan: PLANS.enterprise.id },
380
+ retryDeployments: { id: "retryDeployments", benefit: "optional retries for failed rollout attempts", requiredPlan: PLANS.professional.id },
381
+ scheduledDeployments: {
382
+ id: "scheduledDeployments",
383
+ benefit: "scheduled deployments to steer the distribution of your updates.",
384
+ requiredPlan: PLANS.professional.id
385
+ },
386
+ webhookEvents: {
387
+ id: "webhookEvents",
388
+ benefit: "receive inventory events and select which type(s) of events the webhook will receive",
389
+ requiredPlan: PLANS.professional.id
390
+ },
391
+ default: { id: "default", benefit: "gain access to this feature", requiredPlan: PLANS.enterprise.id }
392
+ };
393
+ var DARK_MODE = "dark";
394
+
395
+ // src/deploymentsSlice/constants.ts
396
+ var alreadyInstalled = "already-installed";
397
+ var deploymentsApiUrl = `${apiUrl.v1}/deployments`;
398
+ var deploymentsApiUrlV2 = `${apiUrl.v2}/deployments`;
399
+ var deploymentSubstates = {
400
+ aborted: "aborted",
401
+ alreadyInstalled,
402
+ decommissioned: "decommissioned",
403
+ downloading: "downloading",
404
+ failure: "failure",
405
+ installing: "installing",
406
+ noartifact: "noartifact",
407
+ pause_before_committing: "pause_before_committing",
408
+ pause_before_installing: "pause_before_installing",
409
+ pause_before_rebooting: "pause_before_rebooting",
410
+ pending: "pending",
411
+ rebooting: "rebooting",
412
+ success: "success"
413
+ };
414
+ var deploymentStatesToSubstates = {
415
+ failures: [deploymentSubstates.failure, deploymentSubstates.aborted, deploymentSubstates.decommissioned],
416
+ inprogress: [deploymentSubstates.downloading, deploymentSubstates.installing, deploymentSubstates.rebooting],
417
+ paused: [deploymentSubstates.pause_before_installing, deploymentSubstates.pause_before_rebooting, deploymentSubstates.pause_before_committing],
418
+ pending: [deploymentSubstates.pending],
419
+ successes: [deploymentSubstates.success, deploymentSubstates.alreadyInstalled, deploymentSubstates.noartifact]
420
+ };
421
+ var deploymentStatesToSubstatesWithSkipped = {
422
+ ...deploymentStatesToSubstates,
423
+ failures: [deploymentSubstates.failure],
424
+ skipped: [deploymentSubstates.aborted, deploymentSubstates.noartifact, deploymentSubstates.alreadyInstalled, deploymentSubstates.decommissioned],
425
+ successes: [deploymentSubstates.success]
426
+ };
427
+ var installationSubstatesMap = {
428
+ download: {
429
+ title: "download",
430
+ done: "downloaded",
431
+ successIndicators: [deploymentSubstates.installing, deploymentSubstates.rebooting, ...deploymentStatesToSubstates.paused, deploymentSubstates.success],
432
+ failureIndicators: deploymentStatesToSubstates.failures,
433
+ pauseConfigurationIndicator: "ArtifactInstall_Enter"
434
+ },
435
+ install: {
436
+ title: "install",
437
+ done: "installed",
438
+ successIndicators: [
439
+ deploymentSubstates.rebooting,
440
+ deploymentSubstates.pause_before_rebooting,
441
+ deploymentSubstates.pause_before_committing,
442
+ deploymentSubstates.success
443
+ ],
444
+ failureIndicators: deploymentStatesToSubstates.failures,
445
+ pauseConfigurationIndicator: "ArtifactReboot_Enter"
446
+ },
447
+ reboot: {
448
+ title: "reboot",
449
+ done: "rebooted",
450
+ successIndicators: [deploymentSubstates.pause_before_committing, deploymentSubstates.success],
451
+ failureIndicators: deploymentStatesToSubstates.failures,
452
+ pauseConfigurationIndicator: "ArtifactCommit_Enter"
453
+ },
454
+ commit: {
455
+ title: "commit",
456
+ done: "committed",
457
+ successIndicators: deploymentStatesToSubstates.successes,
458
+ failureIndicators: deploymentStatesToSubstates.failures,
459
+ pauseConfigurationIndicator: void 0
460
+ }
461
+ };
462
+ var DEPLOYMENT_STATES = {
463
+ finished: "finished",
464
+ inprogress: "inprogress",
465
+ pending: "pending",
466
+ scheduled: "scheduled"
467
+ };
468
+ var listDefaultsByState = {
469
+ [DEPLOYMENT_STATES.inprogress]: { page: 1, perPage: 10 },
470
+ [DEPLOYMENT_STATES.pending]: { page: 1, perPage: 10 },
471
+ [DEPLOYMENT_STATES.scheduled]: { ...DEVICE_LIST_DEFAULTS },
472
+ [DEPLOYMENT_STATES.finished]: { ...DEVICE_LIST_DEFAULTS },
473
+ sort: { direction: SORTING_OPTIONS.desc }
474
+ };
475
+ var DEPLOYMENT_ROUTES = {
476
+ active: {
477
+ key: "active",
478
+ route: "/deployments/active",
479
+ states: [DEPLOYMENT_STATES.pending, DEPLOYMENT_STATES.inprogress],
480
+ title: "Active"
481
+ },
482
+ finished: {
483
+ key: "finished",
484
+ route: "/deployments/finished",
485
+ states: [DEPLOYMENT_STATES.finished],
486
+ title: "Finished"
487
+ },
488
+ scheduled: {
489
+ key: "scheduled",
490
+ route: "/deployments/scheduled",
491
+ states: [DEPLOYMENT_STATES.scheduled],
492
+ title: "Scheduled"
493
+ }
494
+ };
495
+ var defaultStats = {
496
+ [deploymentSubstates.aborted]: 0,
497
+ [deploymentSubstates.alreadyInstalled]: 0,
498
+ [deploymentSubstates.decommissioned]: 0,
499
+ [deploymentSubstates.downloading]: 0,
500
+ [deploymentSubstates.failure]: 0,
501
+ [deploymentSubstates.installing]: 0,
502
+ [deploymentSubstates.noartifact]: 0,
503
+ [deploymentSubstates.pause_before_committing]: 0,
504
+ [deploymentSubstates.pause_before_installing]: 0,
505
+ [deploymentSubstates.pause_before_rebooting]: 0,
506
+ [deploymentSubstates.pending]: 0,
507
+ [deploymentSubstates.rebooting]: 0,
508
+ [deploymentSubstates.success]: 0
509
+ };
510
+ var deploymentDisplayStates = {
511
+ finished: "Finished",
512
+ scheduled: "Scheduled",
513
+ skipped: "Skipped",
514
+ paused: "Paused",
515
+ pending: "Pending",
516
+ inprogress: "In Progress",
517
+ success: "Success",
518
+ successes: "Success",
519
+ failure: "Fail",
520
+ failures: "Fail"
521
+ };
522
+ var pauseMap = {
523
+ [deploymentSubstates.pause_before_installing]: {
524
+ title: installationSubstatesMap.download.done,
525
+ followUp: installationSubstatesMap.download.pauseConfigurationIndicator
526
+ },
527
+ [deploymentSubstates.pause_before_rebooting]: {
528
+ title: installationSubstatesMap.install.done,
529
+ followUp: installationSubstatesMap.install.pauseConfigurationIndicator
530
+ },
531
+ [deploymentSubstates.pause_before_committing]: {
532
+ title: installationSubstatesMap.reboot.done,
533
+ followUp: installationSubstatesMap.reboot.pauseConfigurationIndicator
534
+ }
535
+ };
536
+
537
+ // src/devicesSlice/constants.ts
538
+ var emptyFilter = { key: null, value: "", operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: "inventory" };
539
+ var deviceAuthV2 = `${apiUrl.v2}/devauth`;
540
+ var deviceConnect = `${apiUrl.v1}/deviceconnect`;
541
+ var inventoryApiUrl = `${apiUrl.v1}/inventory`;
542
+ var inventoryApiUrlV2 = `${apiUrl.v2}/inventory`;
543
+ var deviceConfig = `${apiUrl.v1}/deviceconfig/configurations/device`;
544
+ var reportingApiUrl = `${apiUrl.v1}/reporting`;
545
+ var iotManagerBaseURL = `${apiUrl.v1}/iot-manager`;
546
+ var geoAttributes = ["geo-lat", "geo-lon"].map((attribute) => ({ attribute, scope: "inventory" }));
547
+
548
+ // src/utils.ts
549
+ var filterProcessors = {
550
+ $gt: (val) => Number(val) || val,
551
+ $gte: (val) => Number(val) || val,
552
+ $lt: (val) => Number(val) || val,
553
+ $lte: (val) => Number(val) || val,
554
+ $in: (val) => ("" + val).split(",").map((i) => i.trim()),
555
+ $nin: (val) => ("" + val).split(",").map((i) => i.trim()),
556
+ $exists: import_helpers.yes,
557
+ $nexists: () => false
558
+ };
559
+ var filterAliases = {
560
+ $nexists: { alias: DEVICE_FILTERING_OPTIONS.$exists.key, value: false }
561
+ };
562
+ var mapFiltersToTerms = (filters) => filters.map((filter) => ({
563
+ scope: filter.scope,
564
+ attribute: filter.key,
565
+ type: filterAliases[filter.operator]?.alias || filter.operator,
566
+ value: filterProcessors.hasOwnProperty(filter.operator) ? filterProcessors[filter.operator](filter.value) : filter.value
567
+ }));
568
+ var mapTermsToFilters = (terms) => terms.map((term) => {
569
+ const aliasedFilter = Object.entries(filterAliases).find(
570
+ (aliasDefinition) => aliasDefinition[1].alias === term.type && aliasDefinition[1].value === term.value
571
+ );
572
+ const operator = aliasedFilter ? aliasedFilter[0] : term.type;
573
+ return { scope: term.scope, key: term.attribute, operator, value: term.value };
574
+ });
575
+ var convertIssueOptionsToFilters = (issuesSelection, filtersState = {}) => issuesSelection.map((item) => {
576
+ if (typeof DEVICE_ISSUE_OPTIONS[item].filterRule.value === "function") {
577
+ return { ...DEVICE_ISSUE_OPTIONS[item].filterRule, value: DEVICE_ISSUE_OPTIONS[item].filterRule.value(filtersState) };
578
+ }
579
+ return DEVICE_ISSUE_OPTIONS[item].filterRule;
580
+ });
581
+ var convertDeviceListStateToFilters = ({ filters = [], group, groups = { byId: {} }, offlineThreshold, selectedIssues = [], status }) => {
582
+ let applicableFilters = [...filters];
583
+ if (typeof group === "string" && !(groups.byId[group]?.filters || applicableFilters).length) {
584
+ applicableFilters.push({ key: "group", value: group, operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: "system" });
585
+ }
586
+ const nonMonitorFilters = applicableFilters.filter(
587
+ (filter) => !Object.values(DEVICE_ISSUE_OPTIONS).some(
588
+ ({ filterRule }) => filter.scope !== "inventory" && filterRule.scope === filter.scope && filterRule.key === filter.key
589
+ )
590
+ );
591
+ const deviceIssueFilters = convertIssueOptionsToFilters(selectedIssues, { offlineThreshold });
592
+ applicableFilters = [...nonMonitorFilters, ...deviceIssueFilters];
593
+ const effectiveFilters = status ? [...applicableFilters, { key: "status", value: status, operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: "identity" }] : applicableFilters;
594
+ return { applicableFilters: nonMonitorFilters, filterTerms: mapFiltersToTerms(effectiveFilters) };
595
+ };
596
+ var filterCompare = (filter, item) => Object.keys(emptyFilter).every((key) => item[key].toString() === filter[key].toString());
597
+ var filtersFilter = (item, index, array) => {
598
+ const firstIndex = array.findIndex((filter) => filterCompare(filter, item));
599
+ return firstIndex === index;
600
+ };
601
+ var listItemMapper = (byId, ids, { defaultObject = {}, cutOffSize = DEVICE_LIST_MAXIMUM_LENGTH }) => {
602
+ return ids.slice(0, cutOffSize).reduce((accu, id) => {
603
+ if (id && byId[id]) {
604
+ accu.push({ ...defaultObject, ...byId[id] });
605
+ }
606
+ return accu;
607
+ }, []);
608
+ };
609
+ var mergePermissions = (existingPermissions = { ...emptyUiPermissions }, addedPermissions) => Object.entries(existingPermissions).reduce(
610
+ (accu, [key, value]) => {
611
+ let values;
612
+ if (!accu[key]) {
613
+ accu[key] = value;
614
+ return accu;
615
+ }
616
+ if (Array.isArray(value)) {
617
+ values = [...value, ...accu[key]].filter(import_helpers.duplicateFilter);
618
+ } else {
619
+ values = mergePermissions(accu[key], { ...value });
620
+ }
621
+ accu[key] = values;
622
+ return accu;
623
+ },
624
+ { ...addedPermissions }
625
+ );
626
+ var mapUserRolesToUiPermissions = (userRoles, roles) => userRoles.reduce(
627
+ (accu, roleId) => {
628
+ if (!(roleId && roles[roleId])) {
629
+ return accu;
630
+ }
631
+ return mergePermissions(accu, roles[roleId].uiPermissions);
632
+ },
633
+ { ...emptyUiPermissions }
634
+ );
635
+ var progress = ({ loaded, total }) => {
636
+ let uploadProgress = loaded / total * 100;
637
+ return uploadProgress = uploadProgress < 50 ? Math.ceil(uploadProgress) : Math.round(uploadProgress);
638
+ };
639
+ var getComparisonCompatibleVersion = (version) => isNaN(version.charAt(0)) && version !== "next" ? "master" : version;
640
+ var stringToBoolean = (content) => {
641
+ if (!content) {
642
+ return false;
643
+ }
644
+ const string = content + "";
645
+ switch (string.trim().toLowerCase()) {
646
+ case "true":
647
+ case "yes":
648
+ case "1":
649
+ return true;
650
+ case "false":
651
+ case "no":
652
+ case "0":
653
+ case null:
654
+ return false;
655
+ default:
656
+ return Boolean(string);
657
+ }
658
+ };
659
+ var groupDeploymentDevicesStats = (deployment) => {
660
+ const deviceStatCollector = (deploymentStates, devices) => Object.values(devices).reduce((accu, device) => deploymentStates.includes(device.status) ? accu + 1 : accu, 0);
661
+ const inprogress = deviceStatCollector(deploymentStatesToSubstates.inprogress, deployment.devices);
662
+ const pending = deviceStatCollector(deploymentStatesToSubstates.pending, deployment.devices);
663
+ const successes = deviceStatCollector(deploymentStatesToSubstates.successes, deployment.devices);
664
+ const failures = deviceStatCollector(deploymentStatesToSubstates.failures, deployment.devices);
665
+ const paused = deviceStatCollector(deploymentStatesToSubstates.paused, deployment.devices);
666
+ return { inprogress, paused, pending, successes, failures };
667
+ };
668
+ var statCollector = (items, statistics) => items.reduce((accu, property) => accu + Number(statistics[property] || 0), 0);
669
+ var groupDeploymentStats = (deployment, withSkipped) => {
670
+ const { statistics = {} } = deployment;
671
+ const { status = {} } = statistics;
672
+ const stats = { ...defaultStats, ...status };
673
+ let groupStates = deploymentStatesToSubstates;
674
+ let result = {};
675
+ if (withSkipped) {
676
+ groupStates = deploymentStatesToSubstatesWithSkipped;
677
+ result.skipped = statCollector(groupStates.skipped, stats);
678
+ }
679
+ result = {
680
+ ...result,
681
+ // don't include 'pending' as inprogress, as all remaining devices will be pending - we don't discriminate based on phase membership
682
+ inprogress: statCollector(groupStates.inprogress, stats),
683
+ pending: (deployment.max_devices ? deployment.max_devices - deployment.device_count : 0) + statCollector(groupStates.pending, stats),
684
+ successes: statCollector(groupStates.successes, stats),
685
+ failures: statCollector(groupStates.failures, stats),
686
+ paused: statCollector(groupStates.paused, stats)
687
+ };
688
+ return result;
689
+ };
690
+ var getDeploymentState = (deployment) => {
691
+ const { status: deploymentStatus = DEPLOYMENT_STATES.pending } = deployment;
692
+ const { inprogress: currentProgressCount, paused } = groupDeploymentStats(deployment);
693
+ let status = deploymentDisplayStates[deploymentStatus];
694
+ if (deploymentStatus === DEPLOYMENT_STATES.pending && currentProgressCount === 0) {
695
+ status = "queued";
696
+ } else if (paused > 0) {
697
+ status = deploymentDisplayStates.paused;
698
+ }
699
+ return status;
700
+ };
701
+ var generateDeploymentGroupDetails = (filter, groupName) => filter && filter.terms?.length ? `${groupName} (${filter.terms.map((filter2) => `${filter2.attribute || filter2.key} ${DEVICE_FILTERING_OPTIONS[filter2.type || filter2.operator].shortform} ${filter2.value}`).join(", ")})` : groupName;
702
+ var mapDeviceAttributes = (attributes = []) => attributes.reduce(
703
+ (accu, attribute) => {
704
+ if (!(attribute.value && attribute.name) && attribute.scope === ATTRIBUTE_SCOPES.inventory) {
705
+ return accu;
706
+ }
707
+ accu[attribute.scope || ATTRIBUTE_SCOPES.inventory] = {
708
+ ...accu[attribute.scope || ATTRIBUTE_SCOPES.inventory],
709
+ [attribute.name]: attribute.value
710
+ };
711
+ if (attribute.name === "device_type" && attribute.scope === ATTRIBUTE_SCOPES.inventory) {
712
+ accu.inventory.device_type = [].concat(attribute.value);
713
+ }
714
+ return accu;
715
+ },
716
+ { inventory: { device_type: [], artifact_name: "" }, identity: {}, monitor: {}, system: {}, tags: {} }
717
+ );
718
+ var isDarkMode = (mode) => mode === DARK_MODE;
719
+ // Annotate the CommonJS export names for ESM import in node:
720
+ 0 && (module.exports = {
721
+ convertDeviceListStateToFilters,
722
+ filtersFilter,
723
+ generateDeploymentGroupDetails,
724
+ getComparisonCompatibleVersion,
725
+ getDeploymentState,
726
+ groupDeploymentDevicesStats,
727
+ groupDeploymentStats,
728
+ isDarkMode,
729
+ listItemMapper,
730
+ mapDeviceAttributes,
731
+ mapFiltersToTerms,
732
+ mapTermsToFilters,
733
+ mapUserRolesToUiPermissions,
734
+ mergePermissions,
735
+ progress,
736
+ statCollector,
737
+ stringToBoolean
738
+ });
739
+ //# sourceMappingURL=utils.cjs.map