@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/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