@northern.tech/store 0.30.2 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/dist/actions.d.cts +16 -7
  2. package/dist/actions.d.ts +16 -7
  3. package/dist/api/general-api.cjs +2 -2
  4. package/dist/api/general-api.cjs.map +1 -1
  5. package/dist/api/general-api.js.map +1 -1
  6. package/dist/api/users-api.cjs +1 -1
  7. package/dist/api/users-api.cjs.map +1 -1
  8. package/dist/api/users-api.js.map +1 -1
  9. package/dist/appSlice/constants.cjs +6 -1
  10. package/dist/appSlice/constants.cjs.map +1 -1
  11. package/dist/appSlice/constants.d.cts +1 -1
  12. package/dist/appSlice/constants.d.ts +1 -1
  13. package/dist/appSlice/constants.js +7 -2
  14. package/dist/appSlice/constants.js.map +1 -1
  15. package/dist/appSlice/index.cjs.map +1 -1
  16. package/dist/appSlice/index.d.cts +1 -1
  17. package/dist/appSlice/index.d.ts +1 -1
  18. package/dist/appSlice/index.js.map +1 -1
  19. package/dist/appSlice/mocks.d.cts +1 -1
  20. package/dist/appSlice/mocks.d.ts +1 -1
  21. package/dist/appSlice/selectors.d.cts +7 -7
  22. package/dist/appSlice/selectors.d.ts +7 -7
  23. package/dist/appSlice/thunks.d.cts +2 -2
  24. package/dist/appSlice/thunks.d.ts +2 -2
  25. package/dist/auth.cjs +1 -1
  26. package/dist/auth.cjs.map +1 -1
  27. package/dist/auth.d.cts +1 -1
  28. package/dist/auth.d.ts +1 -1
  29. package/dist/auth.js.map +1 -1
  30. package/dist/commonConstants.d.cts +1 -1
  31. package/dist/commonConstants.d.ts +1 -1
  32. package/dist/commonSelectors.cjs +1 -1
  33. package/dist/commonSelectors.cjs.map +1 -1
  34. package/dist/commonSelectors.d.cts +10 -10
  35. package/dist/commonSelectors.d.ts +10 -10
  36. package/dist/commonSelectors.js.map +1 -1
  37. package/dist/{constants-DPLHhjVN.d.cts → constants-BFTS6mge.d.cts} +6 -1
  38. package/dist/{constants-C5AU0mCY.d.ts → constants-BIIEMVoG.d.ts} +6 -1
  39. package/dist/{constants-MPLfugsi.d.cts → constants-BrGIx40B.d.cts} +3 -3
  40. package/dist/{constants-DrwXHsJ1.d.ts → constants-CjO3_FOH.d.ts} +3 -3
  41. package/dist/constants.cjs +1 -0
  42. package/dist/constants.cjs.map +1 -1
  43. package/dist/constants.d.cts +3 -3
  44. package/dist/constants.d.ts +3 -3
  45. package/dist/constants.js +2 -2
  46. package/dist/constants.js.map +1 -1
  47. package/dist/deploymentsSlice/index.cjs.map +1 -1
  48. package/dist/deploymentsSlice/index.js.map +1 -1
  49. package/dist/deploymentsSlice/selectors.cjs.map +1 -1
  50. package/dist/deploymentsSlice/selectors.d.cts +7 -7
  51. package/dist/deploymentsSlice/selectors.d.ts +7 -7
  52. package/dist/deploymentsSlice/selectors.js.map +1 -1
  53. package/dist/deploymentsSlice/thunks.d.cts +4 -4
  54. package/dist/deploymentsSlice/thunks.d.ts +4 -4
  55. package/dist/devicesSlice/constants.d.cts +1 -1
  56. package/dist/devicesSlice/constants.d.ts +1 -1
  57. package/dist/devicesSlice/index.cjs.map +1 -1
  58. package/dist/devicesSlice/index.d.cts +1 -1
  59. package/dist/devicesSlice/index.d.ts +1 -1
  60. package/dist/devicesSlice/index.js.map +1 -1
  61. package/dist/devicesSlice/selectors.cjs.map +1 -1
  62. package/dist/devicesSlice/selectors.d.cts +7 -7
  63. package/dist/devicesSlice/selectors.d.ts +7 -7
  64. package/dist/devicesSlice/selectors.js.map +1 -1
  65. package/dist/devicesSlice/thunks.d.cts +4 -4
  66. package/dist/devicesSlice/thunks.d.ts +4 -4
  67. package/dist/{index-Lz5JsJ6O.d.cts → index-B64X5ozM.d.cts} +2 -2
  68. package/dist/{index-4eaLEXy_.d.cts → index-BFlHWzjv.d.cts} +2 -2
  69. package/dist/{index-DqyY6oZ3.d.ts → index-BI9O8JWe.d.ts} +2 -2
  70. package/dist/{index-Bwx9jEiL.d.cts → index-BbaS7MzW.d.cts} +2 -2
  71. package/dist/{index-Dv3Hfxk_.d.ts → index-Bp1WpATs.d.ts} +2 -2
  72. package/dist/{index-FyYBBeN-.d.cts → index-C-q632wO.d.cts} +41 -8
  73. package/dist/{index-DJSlDPRX.d.ts → index-C6wNUfiV.d.ts} +2 -2
  74. package/dist/{index-BEVkIiNa.d.cts → index-CT5hgXm9.d.cts} +2 -2
  75. package/dist/{index-Cvkvcz4r.d.ts → index-CyokFK2e.d.ts} +41 -8
  76. package/dist/{index-CO-py5d4.d.ts → index-DUvrw_Ed.d.ts} +2 -2
  77. package/dist/{index-CTt-eIY8.d.cts → index-DwACbyUg.d.cts} +2 -2
  78. package/dist/{index-DtePEQPT.d.ts → index-ez3oxfRo.d.ts} +2 -2
  79. package/dist/liststatehook.cjs +5 -3
  80. package/dist/liststatehook.cjs.map +1 -1
  81. package/dist/liststatehook.js +5 -3
  82. package/dist/liststatehook.js.map +1 -1
  83. package/dist/locationutils.cjs +3 -0
  84. package/dist/locationutils.cjs.map +1 -1
  85. package/dist/locationutils.d.cts +3 -2
  86. package/dist/locationutils.d.ts +3 -2
  87. package/dist/locationutils.js +3 -0
  88. package/dist/locationutils.js.map +1 -1
  89. package/dist/monitorSlice/constants.d.cts +1 -1
  90. package/dist/monitorSlice/constants.d.ts +1 -1
  91. package/dist/monitorSlice/index.cjs.map +1 -1
  92. package/dist/monitorSlice/index.d.cts +1 -1
  93. package/dist/monitorSlice/index.d.ts +1 -1
  94. package/dist/monitorSlice/index.js.map +1 -1
  95. package/dist/monitorSlice/mocks.cjs.map +1 -1
  96. package/dist/monitorSlice/mocks.d.cts +1 -1
  97. package/dist/monitorSlice/mocks.d.ts +1 -1
  98. package/dist/monitorSlice/mocks.js.map +1 -1
  99. package/dist/monitorSlice/selectors.d.cts +1 -1
  100. package/dist/monitorSlice/selectors.d.ts +1 -1
  101. package/dist/monitorSlice/thunks.cjs.map +1 -1
  102. package/dist/monitorSlice/thunks.d.cts +4 -4
  103. package/dist/monitorSlice/thunks.d.ts +4 -4
  104. package/dist/monitorSlice/thunks.js.map +1 -1
  105. package/dist/onboardingSlice/index.cjs.map +1 -1
  106. package/dist/onboardingSlice/index.js.map +1 -1
  107. package/dist/onboardingSlice/mocks.cjs.map +1 -1
  108. package/dist/onboardingSlice/selectors.d.cts +1 -1
  109. package/dist/onboardingSlice/selectors.d.ts +1 -1
  110. package/dist/onboardingSlice/thunks.d.cts +2 -2
  111. package/dist/onboardingSlice/thunks.d.ts +2 -2
  112. package/dist/organizationSlice/index.cjs.map +1 -1
  113. package/dist/organizationSlice/index.d.cts +1 -1
  114. package/dist/organizationSlice/index.d.ts +1 -1
  115. package/dist/organizationSlice/index.js.map +1 -1
  116. package/dist/organizationSlice/mocks.d.cts +2 -2
  117. package/dist/organizationSlice/mocks.d.ts +2 -2
  118. package/dist/organizationSlice/selectors.cjs.map +1 -1
  119. package/dist/organizationSlice/selectors.d.cts +8 -8
  120. package/dist/organizationSlice/selectors.d.ts +8 -8
  121. package/dist/organizationSlice/selectors.js.map +1 -1
  122. package/dist/organizationSlice/thunks.d.cts +5 -5
  123. package/dist/organizationSlice/thunks.d.ts +5 -5
  124. package/dist/organizationSlice/types.d.cts +1 -1
  125. package/dist/organizationSlice/types.d.ts +1 -1
  126. package/dist/releasesSlice/index.cjs +63 -2
  127. package/dist/releasesSlice/index.cjs.map +1 -1
  128. package/dist/releasesSlice/index.d.cts +2 -2
  129. package/dist/releasesSlice/index.d.ts +2 -2
  130. package/dist/releasesSlice/index.js +63 -2
  131. package/dist/releasesSlice/index.js.map +1 -1
  132. package/dist/releasesSlice/mocks.cjs +34 -0
  133. package/dist/releasesSlice/mocks.cjs.map +1 -1
  134. package/dist/releasesSlice/mocks.d.cts +44 -1
  135. package/dist/releasesSlice/mocks.d.ts +44 -1
  136. package/dist/releasesSlice/mocks.js +34 -0
  137. package/dist/releasesSlice/mocks.js.map +1 -1
  138. package/dist/releasesSlice/selectors.cjs +37 -5
  139. package/dist/releasesSlice/selectors.cjs.map +1 -1
  140. package/dist/releasesSlice/selectors.d.cts +403 -15
  141. package/dist/releasesSlice/selectors.d.ts +403 -15
  142. package/dist/releasesSlice/selectors.js +27 -6
  143. package/dist/releasesSlice/selectors.js.map +1 -1
  144. package/dist/releasesSlice/thunks.cjs +210 -2
  145. package/dist/releasesSlice/thunks.cjs.map +1 -1
  146. package/dist/releasesSlice/thunks.d.cts +144 -10
  147. package/dist/releasesSlice/thunks.d.ts +144 -10
  148. package/dist/releasesSlice/thunks.js +201 -4
  149. package/dist/releasesSlice/thunks.js.map +1 -1
  150. package/dist/selectors.cjs +11 -0
  151. package/dist/selectors.d.cts +2 -2
  152. package/dist/selectors.d.ts +2 -2
  153. package/dist/selectors.js +2 -2
  154. package/dist/sockethook.cjs +2 -2
  155. package/dist/sockethook.cjs.map +1 -1
  156. package/dist/sockethook.js.map +1 -1
  157. package/dist/{store-BQxOSRC1.d.ts → store-D-xvZXiY.d.ts} +7 -7
  158. package/dist/{store-BiIA0r0A.d.cts → store-b5cF2WB5.d.cts} +7 -7
  159. package/dist/store.cjs.map +1 -1
  160. package/dist/store.d.cts +2 -2
  161. package/dist/store.d.ts +2 -2
  162. package/dist/store.js.map +1 -1
  163. package/dist/storehooks.cjs +3 -3
  164. package/dist/storehooks.cjs.map +1 -1
  165. package/dist/storehooks.d.cts +2 -2
  166. package/dist/storehooks.d.ts +2 -2
  167. package/dist/storehooks.js.map +1 -1
  168. package/dist/thunks.cjs +22 -10
  169. package/dist/thunks.cjs.map +1 -1
  170. package/dist/thunks.d.cts +2 -2
  171. package/dist/thunks.d.ts +2 -2
  172. package/dist/thunks.js +8 -6
  173. package/dist/thunks.js.map +1 -1
  174. package/dist/{types-B2NRQLFw.d.ts → types-BPyM8Inu.d.ts} +3 -3
  175. package/dist/{types-ClEfo0dK.d.cts → types-COdPU2QQ.d.cts} +3 -3
  176. package/dist/useDeploymentDevice.cjs +1 -1
  177. package/dist/useDeploymentDevice.cjs.map +1 -1
  178. package/dist/useDeploymentDevice.js.map +1 -1
  179. package/dist/usersSlice/index.cjs.map +1 -1
  180. package/dist/usersSlice/index.d.cts +1 -1
  181. package/dist/usersSlice/index.d.ts +1 -1
  182. package/dist/usersSlice/index.js.map +1 -1
  183. package/dist/usersSlice/mocks.d.cts +1 -1
  184. package/dist/usersSlice/mocks.d.ts +1 -1
  185. package/dist/usersSlice/selectors.cjs.map +1 -1
  186. package/dist/usersSlice/selectors.d.cts +7 -7
  187. package/dist/usersSlice/selectors.d.ts +7 -7
  188. package/dist/usersSlice/selectors.js.map +1 -1
  189. package/dist/usersSlice/thunks.d.cts +4 -4
  190. package/dist/usersSlice/thunks.d.ts +4 -4
  191. package/dist/{utils-CO_CpGFP.d.ts → utils-CHBWS_tH.d.ts} +4 -4
  192. package/dist/{utils-CpPfqW0Q.d.cts → utils-Do9z5TL1.d.cts} +4 -4
  193. package/dist/utils.cjs.map +1 -1
  194. package/dist/utils.d.cts +1 -1
  195. package/dist/utils.d.ts +1 -1
  196. package/dist/utils.js.map +1 -1
  197. package/package.json +7 -7
package/dist/auth.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as UserSession } from "./index-4eaLEXy_.cjs";
1
+ import { i as UserSession } from "./index-BFlHWzjv.cjs";
2
2
 
3
3
  //#region src/auth.d.ts
4
4
  declare const getSessionInfo: () => UserSession;
package/dist/auth.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as UserSession } from "./index-DtePEQPT.js";
1
+ import { i as UserSession } from "./index-ez3oxfRo.js";
2
2
 
3
3
  //#region src/auth.d.ts
4
4
  declare const getSessionInfo: () => UserSession;
package/dist/auth.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","names":[],"sources":["../src/auth.ts"],"sourcesContent":["// Copyright 2016 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport Cookies from 'universal-cookie';\n\nimport { TIMEOUTS, maxSessionAge } from './constants';\nimport type { UserSession } from './usersSlice';\n\nconst cookies = new Cookies();\n\nconst emptySession = Object.freeze({ token: '', expiresAt: undefined }) as Readonly<UserSession>;\n\nlet tokenCache = '';\n\nexport const getSessionInfo = (): UserSession => {\n let sessionInfo = { ...emptySession } as UserSession;\n try {\n sessionInfo = JSON.parse(window.localStorage.getItem('JWT') ?? '');\n } catch {\n // most likely not logged in - nothing to do here\n }\n\n // check for cookie first to handles sso login while an old/expired token may still exist in cache/ localStorage\n const jwtTokenFromCookie = cookies.get('JWT', { doNotParse: true }) ?? '';\n if (jwtTokenFromCookie) {\n setSessionInfo({ token: jwtTokenFromCookie });\n cookies.remove('JWT');\n cookies.remove('JWT', { path: '/' });\n return { token: jwtTokenFromCookie, expiresAt: undefined };\n }\n if (sessionInfo.expiresAt && new Date(sessionInfo.expiresAt) < new Date()) {\n cleanUp();\n return { ...emptySession };\n }\n sessionInfo.token = sessionInfo.token || '';\n tokenCache = sessionInfo.token;\n return sessionInfo;\n};\n\nexport const getToken = () => (tokenCache ? tokenCache : getSessionInfo().token);\n\nexport const setSessionInfo = ({ token, expiresAt }: UserSession) => {\n tokenCache = token;\n window.localStorage.setItem('JWT', JSON.stringify({ token, expiresAt }));\n};\n\nexport const cleanUp = () => {\n tokenCache = '';\n cookies.remove('JWT');\n cookies.remove('JWT', { path: '/' });\n window.localStorage.removeItem('JWT');\n window.localStorage.removeItem('oauth');\n};\n\nexport const updateMaxAge = ({ expiresAt, token }) => {\n const oAuthExpiration = Number(window.localStorage.getItem('oauth'));\n let updateWithOAuth = false;\n if (oAuthExpiration) {\n const soon = Date.now() + maxSessionAge * TIMEOUTS.oneSecond;\n updateWithOAuth = oAuthExpiration <= soon;\n if (updateWithOAuth) {\n window.localStorage.removeItem('oauth');\n }\n }\n if (token && expiresAt && (!oAuthExpiration || updateWithOAuth)) {\n const expiration = new Date();\n expiration.setSeconds(expiration.getSeconds() + maxSessionAge);\n setSessionInfo({ token, expiresAt: expiration.toISOString() });\n }\n};\n"],"mappings":";;;AAkBA,MAAM,UAAU,IAAI,SAAS;AAE7B,MAAM,eAAe,OAAO,OAAO;CAAE,OAAO;CAAI,WAAW,KAAA;CAAW,CAAC;AAEvE,IAAI,aAAa;AAEjB,MAAa,uBAAoC;CAC/C,IAAI,cAAc,EAAE,GAAG,cAAc;AACrC,KAAI;AACF,gBAAc,KAAK,MAAM,OAAO,aAAa,QAAQ,MAAM,IAAI,GAAG;SAC5D;CAKR,MAAM,qBAAqB,QAAQ,IAAI,OAAO,EAAE,YAAY,MAAM,CAAC,IAAI;AACvE,KAAI,oBAAoB;AACtB,iBAAe,EAAE,OAAO,oBAAoB,CAAC;AAC7C,UAAQ,OAAO,MAAM;AACrB,UAAQ,OAAO,OAAO,EAAE,MAAM,KAAK,CAAC;AACpC,SAAO;GAAE,OAAO;GAAoB,WAAW,KAAA;GAAW;;AAE5D,KAAI,YAAY,aAAa,IAAI,KAAK,YAAY,UAAU,mBAAG,IAAI,MAAM,EAAE;AACzE,WAAS;AACT,SAAO,EAAE,GAAG,cAAc;;AAE5B,aAAY,QAAQ,YAAY,SAAS;AACzC,cAAa,YAAY;AACzB,QAAO;;AAGT,MAAa,iBAAkB,aAAa,aAAa,gBAAgB,CAAC;AAE1E,MAAa,kBAAkB,EAAE,OAAO,gBAA6B;AACnE,cAAa;AACb,QAAO,aAAa,QAAQ,OAAO,KAAK,UAAU;EAAE;EAAO;EAAW,CAAC,CAAC;;AAG1E,MAAa,gBAAgB;AAC3B,cAAa;AACb,SAAQ,OAAO,MAAM;AACrB,SAAQ,OAAO,OAAO,EAAE,MAAM,KAAK,CAAC;AACpC,QAAO,aAAa,WAAW,MAAM;AACrC,QAAO,aAAa,WAAW,QAAQ;;AAGzC,MAAa,gBAAgB,EAAE,WAAW,YAAY;CACpD,MAAM,kBAAkB,OAAO,OAAO,aAAa,QAAQ,QAAQ,CAAC;CACpE,IAAI,kBAAkB;AACtB,KAAI,iBAAiB;AAEnB,oBAAkB,mBADL,KAAK,KAAK,GAAG,gBAAgB,SAAS;AAEnD,MAAI,gBACF,QAAO,aAAa,WAAW,QAAQ;;AAG3C,KAAI,SAAS,cAAc,CAAC,mBAAmB,kBAAkB;EAC/D,MAAM,6BAAa,IAAI,MAAM;AAC7B,aAAW,WAAW,WAAW,YAAY,GAAG,cAAc;AAC9D,iBAAe;GAAE;GAAO,WAAW,WAAW,aAAa;GAAE,CAAC"}
1
+ {"version":3,"file":"auth.js","names":[],"sources":["../src/auth.ts"],"sourcesContent":["// Copyright 2016 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport Cookies from 'universal-cookie';\n\nimport { TIMEOUTS, maxSessionAge } from './constants';\nimport type { UserSession } from './usersSlice';\n\nconst cookies = new Cookies();\n\nconst emptySession = Object.freeze({ token: '', expiresAt: undefined }) as Readonly<UserSession>;\n\nlet tokenCache = '';\n\nexport const getSessionInfo = (): UserSession => {\n let sessionInfo = { ...emptySession } as UserSession;\n try {\n sessionInfo = JSON.parse(window.localStorage.getItem('JWT') ?? '');\n } catch {\n // most likely not logged in - nothing to do here\n }\n\n // check for cookie first to handles sso login while an old/expired token may still exist in cache/ localStorage\n const jwtTokenFromCookie = cookies.get('JWT', { doNotParse: true }) ?? '';\n if (jwtTokenFromCookie) {\n setSessionInfo({ token: jwtTokenFromCookie });\n cookies.remove('JWT');\n cookies.remove('JWT', { path: '/' });\n return { token: jwtTokenFromCookie, expiresAt: undefined };\n }\n if (sessionInfo.expiresAt && new Date(sessionInfo.expiresAt) < new Date()) {\n cleanUp();\n return { ...emptySession };\n }\n sessionInfo.token = sessionInfo.token || '';\n tokenCache = sessionInfo.token;\n return sessionInfo;\n};\n\nexport const getToken = () => (tokenCache ? tokenCache : getSessionInfo().token);\n\nexport const setSessionInfo = ({ token, expiresAt }: UserSession) => {\n tokenCache = token;\n window.localStorage.setItem('JWT', JSON.stringify({ token, expiresAt }));\n};\n\nexport const cleanUp = () => {\n tokenCache = '';\n cookies.remove('JWT');\n cookies.remove('JWT', { path: '/' });\n window.localStorage.removeItem('JWT');\n window.localStorage.removeItem('oauth');\n};\n\nexport const updateMaxAge = ({ expiresAt, token }) => {\n const oAuthExpiration = Number(window.localStorage.getItem('oauth'));\n let updateWithOAuth = false;\n if (oAuthExpiration) {\n const soon = Date.now() + maxSessionAge * TIMEOUTS.oneSecond;\n updateWithOAuth = oAuthExpiration <= soon;\n if (updateWithOAuth) {\n window.localStorage.removeItem('oauth');\n }\n }\n if (token && expiresAt && (!oAuthExpiration || updateWithOAuth)) {\n const expiration = new Date();\n expiration.setSeconds(expiration.getSeconds() + maxSessionAge);\n setSessionInfo({ token, expiresAt: expiration.toISOString() });\n }\n};\n"],"mappings":";;;AAkBA,MAAM,UAAU,IAAI,SAAS;AAE7B,MAAM,eAAe,OAAO,OAAO;CAAE,OAAO;CAAI,WAAW,KAAA;CAAW,CAAC;AAEvE,IAAI,aAAa;AAEjB,MAAa,uBAAoC;CAC/C,IAAI,cAAc,EAAE,GAAG,cAAc;CACrC,IAAI;EACF,cAAc,KAAK,MAAM,OAAO,aAAa,QAAQ,MAAM,IAAI,GAAG;SAC5D;CAKR,MAAM,qBAAqB,QAAQ,IAAI,OAAO,EAAE,YAAY,MAAM,CAAC,IAAI;CACvE,IAAI,oBAAoB;EACtB,eAAe,EAAE,OAAO,oBAAoB,CAAC;EAC7C,QAAQ,OAAO,MAAM;EACrB,QAAQ,OAAO,OAAO,EAAE,MAAM,KAAK,CAAC;EACpC,OAAO;GAAE,OAAO;GAAoB,WAAW,KAAA;GAAW;;CAE5D,IAAI,YAAY,aAAa,IAAI,KAAK,YAAY,UAAU,mBAAG,IAAI,MAAM,EAAE;EACzE,SAAS;EACT,OAAO,EAAE,GAAG,cAAc;;CAE5B,YAAY,QAAQ,YAAY,SAAS;CACzC,aAAa,YAAY;CACzB,OAAO;;AAGT,MAAa,iBAAkB,aAAa,aAAa,gBAAgB,CAAC;AAE1E,MAAa,kBAAkB,EAAE,OAAO,gBAA6B;CACnE,aAAa;CACb,OAAO,aAAa,QAAQ,OAAO,KAAK,UAAU;EAAE;EAAO;EAAW,CAAC,CAAC;;AAG1E,MAAa,gBAAgB;CAC3B,aAAa;CACb,QAAQ,OAAO,MAAM;CACrB,QAAQ,OAAO,OAAO,EAAE,MAAM,KAAK,CAAC;CACpC,OAAO,aAAa,WAAW,MAAM;CACrC,OAAO,aAAa,WAAW,QAAQ;;AAGzC,MAAa,gBAAgB,EAAE,WAAW,YAAY;CACpD,MAAM,kBAAkB,OAAO,OAAO,aAAa,QAAQ,QAAQ,CAAC;CACpE,IAAI,kBAAkB;CACtB,IAAI,iBAAiB;EAEnB,kBAAkB,mBADL,KAAK,KAAK,GAAG,gBAAgB,SAAS;EAEnD,IAAI,iBACF,OAAO,aAAa,WAAW,QAAQ;;CAG3C,IAAI,SAAS,cAAc,CAAC,mBAAmB,kBAAkB;EAC/D,MAAM,6BAAa,IAAI,MAAM;EAC7B,WAAW,WAAW,WAAW,YAAY,GAAG,cAAc;EAC9D,eAAe;GAAE;GAAO,WAAW,WAAW,aAAa;GAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- import { At as productOrder, Ct as TIMEOUTS, Dt as credentialTypes, Et as countries, Ot as defaultIdAttribute, St as MAX_PAGE_SIZE, Tt as Webhook, _t as DEVICE_LIST_MAXIMUM_LENGTH, bt as FilterOperator, jt as timeUnits, kt as emptyWebhook, vt as DEVICE_ONLINE_CUTOFF, wt as UNGROUPED_GROUP, xt as IdAttribute, yt as EXTERNAL_PROVIDER } from "./constants-MPLfugsi.cjs";
1
+ import { At as emptyWebhook, Ct as MAX_PAGE_SIZE, Dt as countries, Et as Webhook, Mt as timeUnits, Ot as credentialTypes, St as IdAttribute, Tt as UNGROUPED_GROUP, bt as EXTERNAL_PROVIDER, jt as productOrder, kt as defaultIdAttribute, vt as DEVICE_LIST_MAXIMUM_LENGTH, wt as TIMEOUTS, xt as FilterOperator, yt as DEVICE_ONLINE_CUTOFF } from "./constants-BrGIx40B.cjs";
2
2
  export { DEVICE_LIST_MAXIMUM_LENGTH, DEVICE_ONLINE_CUTOFF, EXTERNAL_PROVIDER, FilterOperator, IdAttribute, MAX_PAGE_SIZE, TIMEOUTS, UNGROUPED_GROUP, Webhook, countries, credentialTypes, defaultIdAttribute, emptyWebhook, productOrder, timeUnits };
@@ -1,2 +1,2 @@
1
- import { At as productOrder, Ct as TIMEOUTS, Dt as credentialTypes, Et as countries, Ot as defaultIdAttribute, St as MAX_PAGE_SIZE, Tt as Webhook, _t as DEVICE_LIST_MAXIMUM_LENGTH, bt as FilterOperator, jt as timeUnits, kt as emptyWebhook, vt as DEVICE_ONLINE_CUTOFF, wt as UNGROUPED_GROUP, xt as IdAttribute, yt as EXTERNAL_PROVIDER } from "./constants-DrwXHsJ1.js";
1
+ import { At as emptyWebhook, Ct as MAX_PAGE_SIZE, Dt as countries, Et as Webhook, Mt as timeUnits, Ot as credentialTypes, St as IdAttribute, Tt as UNGROUPED_GROUP, bt as EXTERNAL_PROVIDER, jt as productOrder, kt as defaultIdAttribute, vt as DEVICE_LIST_MAXIMUM_LENGTH, wt as TIMEOUTS, xt as FilterOperator, yt as DEVICE_ONLINE_CUTOFF } from "./constants-CjO3_FOH.js";
2
2
  export { DEVICE_LIST_MAXIMUM_LENGTH, DEVICE_ONLINE_CUTOFF, EXTERNAL_PROVIDER, FilterOperator, IdAttribute, MAX_PAGE_SIZE, TIMEOUTS, UNGROUPED_GROUP, Webhook, countries, credentialTypes, defaultIdAttribute, emptyWebhook, productOrder, timeUnits };
@@ -15,7 +15,7 @@ const require_usersSlice_selectors = require("./usersSlice/selectors.cjs");
15
15
  let _reduxjs_toolkit = require("@reduxjs/toolkit");
16
16
  let _northern_tech_utils_helpers = require("@northern.tech/utils/helpers");
17
17
  let dayjs = require("dayjs");
18
- dayjs = require_chunk.__toESM(dayjs);
18
+ dayjs = require_chunk.__toESM(dayjs, 1);
19
19
  let _northern_tech_utils_constants = require("@northern.tech/utils/constants");
20
20
  //#region src/commonSelectors.ts
21
21
  const getIsEnterprise = (0, _reduxjs_toolkit.createSelector)([require_organizationSlice_selectors.getOrganization, require_appSlice_selectors.getFeatures], ({ plan = require_appSlice_constants.PLANS.os.id }, { isEnterprise, isHosted }) => isEnterprise || isHosted && plan === require_appSlice_constants.PLANS.enterprise.id);
@@ -1 +1 @@
1
- {"version":3,"file":"commonSelectors.cjs","names":["getOrganization","getFeatures","PLANS","getCurrentUser","getRolesById","rolesByName","mapUserRolesToUiPermissions","getIsServiceProvider","uiPermissionsById","ADDONS","getGlobalSettings","getFilteringAttributes","ATTRIBUTE_SCOPES","getOnboarding","getUserSettings","onboardingSteps","getDevicesById","getDeviceById","getDeploymentsById","getDeploymentsSelectionState","getReleasesById","getSelectedDeploymentDeviceIds","getIssueCountsByType","DEVICE_ISSUE_OPTIONS","getGroupsById","UNGROUPED_GROUP","ALL_DEVICES","defaultReports","getListedDevices","getSearchedDevices","listItemMapper","getAuditLogEntry","getRolesList","rolesById","serviceProviderRolesById","getHas2FA","getUserSettingsInitialized","getSecurityAlertDismissedTimestamp"],"sources":["../src/commonSelectors.ts"],"sourcesContent":["// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { AuditLog as AuditLogEvent } from '@northern.tech/types/types.gen';\nimport type { DeviceIssueOption } from '@northern.tech/utils/constants';\nimport { attributeDuplicateFilter, getDemoDeviceAddress as getDemoDeviceAddressHelper } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\nimport dayjs from 'dayjs';\n\nimport { ADDONS, PLANS, defaultReports } from './appSlice/constants';\nimport { getFeatures, getSearchedDevices } from './appSlice/selectors';\nimport { DEVICE_LIST_MAXIMUM_LENGTH, UNGROUPED_GROUP } from './commonConstants';\nimport { ALL_DEVICES, ATTRIBUTE_SCOPES, DEVICE_ISSUE_OPTIONS, rolesById, rolesByName, serviceProviderRolesById, uiPermissionsById } from './constants';\nimport type { Role } from './constants';\nimport type { Deployment } from './deploymentsSlice';\nimport { getDeploymentsById, getDeploymentsSelectionState, getSelectedDeploymentDeviceIds } from './deploymentsSlice/selectors';\nimport type { Device, DeviceGroup } from './devicesSlice';\nimport { getDeviceById, getDevicesById, getFilteringAttributes, getGroupsById, getListedDevices } from './devicesSlice/selectors';\nimport { getIssueCountsByType } from './monitorSlice/selectors';\nimport { onboardingSteps } from './onboardingSlice/constants';\nimport { getOnboarding } from './onboardingSlice/selectors';\nimport { getAuditLogEntry, getIsServiceProvider, getOrganization } from './organizationSlice/selectors';\nimport { getReleasesById } from './releasesSlice/selectors';\nimport {\n getCurrentUser,\n getGlobalSettings,\n getHas2FA,\n getRolesById,\n getRolesList,\n getSecurityAlertDismissedTimestamp,\n getUserSettings,\n getUserSettingsInitialized\n} from './usersSlice/selectors';\nimport { listItemMapper, mapUserRolesToUiPermissions } from './utils';\n\nexport const getIsEnterprise = createSelector(\n [getOrganization, getFeatures],\n ({ plan = PLANS.os.id }, { isEnterprise, isHosted }) => isEnterprise || (isHosted && plan === PLANS.enterprise.id)\n);\n\nexport const getUserRoles = createSelector([getCurrentUser, getRolesById, getIsEnterprise], (currentUser, rolesById, isEnterprise) => {\n const isAdmin = currentUser.roles?.length ? currentUser.roles.some(role => role === rolesByName.admin) : !isEnterprise;\n const uiPermissions = isAdmin ? mapUserRolesToUiPermissions([rolesByName.admin], rolesById) : mapUserRolesToUiPermissions(currentUser.roles || [], rolesById);\n return { isAdmin, uiPermissions };\n});\n\nconst hasPermission = (thing: Record<string, string[]>, permission: string): boolean =>\n Object.values(thing).some(permissions => permissions.includes(permission));\n\nexport const getUserCapabilities = createSelector([getUserRoles, getIsServiceProvider], ({ uiPermissions }, isServiceProvider) => {\n const canManageReleases = hasPermission(uiPermissions.releases, uiPermissionsById.manage.value);\n const canReadReleases = canManageReleases || hasPermission(uiPermissions.releases, uiPermissionsById.read.value);\n const canUploadReleases = canManageReleases || hasPermission(uiPermissions.releases, uiPermissionsById.upload.value);\n\n const canAuditlog = uiPermissions.auditlog.includes(uiPermissionsById.read.value);\n\n const canReadUsers = uiPermissions.userManagement.includes(uiPermissionsById.read.value);\n const canManageUsers = uiPermissions.userManagement.includes(uiPermissionsById.manage.value);\n\n const canReadDevices = hasPermission(uiPermissions.groups, uiPermissionsById.read.value);\n const canWriteDevices = Object.values(uiPermissions.groups).some(\n groupPermissions => groupPermissions.includes(uiPermissionsById.read.value) && groupPermissions.length > 1\n );\n const canTroubleshoot = hasPermission(uiPermissions.groups, uiPermissionsById.connect.value);\n const canManageDevices = hasPermission(uiPermissions.groups, uiPermissionsById.manage.value);\n const canConfigure = hasPermission(uiPermissions.groups, uiPermissionsById.configure.value);\n\n const canDeploy =\n (uiPermissions.deployments?.includes(uiPermissionsById.deploy.value) ?? false) || hasPermission(uiPermissions.groups, uiPermissionsById.deploy.value);\n const canReadDeployments = uiPermissions.deployments?.includes(uiPermissionsById.read.value) ?? false;\n\n return {\n canAuditlog,\n canConfigure,\n canDeploy,\n canManageDevices,\n canManageReleases,\n canManageUsers,\n canReadDeployments,\n canReadDevices,\n canReadReleases,\n canReadUsers,\n canTroubleshoot,\n canUploadReleases,\n canWriteDevices,\n groupsPermissions: uiPermissions.groups,\n releasesPermissions: uiPermissions.releases,\n SPTenant: isServiceProvider\n };\n});\n\nexport const getTenantCapabilities = createSelector(\n [getFeatures, getOrganization, getIsEnterprise],\n (\n {\n hasAuditlogs: isAuditlogEnabled,\n hasDeviceConfig: isDeviceConfigEnabled,\n hasDeviceConnect: isDeviceConnectEnabled,\n hasMonitor: isMonitorEnabled,\n isHosted\n },\n { addons = [], plan = PLANS.os.id },\n isEnterprise\n ) => {\n const canDelta = isEnterprise || plan === PLANS.professional.id;\n const hasAuditlogs = isAuditlogEnabled && isEnterprise;\n const hasDeviceConfig = addons.some(addon => addon.name === ADDONS.configure.id && addon.enabled) || (isDeviceConfigEnabled && !isHosted);\n const hasDeviceConnect = addons.some(addon => addon.name === ADDONS.troubleshoot.id && addon.enabled) || (isDeviceConnectEnabled && !isHosted);\n const hasMonitor = isMonitorEnabled && addons.some(addon => addon.name === ADDONS.monitor.id && addon.enabled);\n return {\n canDelta,\n canRetry: canDelta,\n canSchedule: canDelta,\n hasAuditlogs,\n hasDeviceConfig,\n hasDeviceConnect,\n hasFullFiltering: canDelta,\n hasMonitor,\n isEnterprise,\n plan\n };\n }\n);\n\nexport const getFilterAttributes = createSelector(\n [getGlobalSettings, getFilteringAttributes],\n ({ previousFilters }, { identityAttributes, inventoryAttributes, systemAttributes, tagAttributes }) => {\n const deviceNameAttribute = { key: 'name', value: 'Name', scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 1 };\n const deviceIdAttribute = { key: 'id', value: 'Device ID', scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 };\n const checkInAttribute = { key: 'check_in_time', value: 'Latest activity', scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };\n const updateAttribute = { ...checkInAttribute, key: 'updated_ts', value: 'Last inventory update' };\n const firstRequestAttribute = { key: 'created_ts', value: 'First request', scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };\n const attributes = [\n ...previousFilters.map(item => ({\n ...item,\n value: deviceIdAttribute.key === item.key ? deviceIdAttribute.value : item.key,\n category: 'recently used',\n priority: 0\n })),\n deviceNameAttribute,\n deviceIdAttribute,\n ...identityAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 })),\n ...inventoryAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.inventory, category: ATTRIBUTE_SCOPES.inventory, priority: 2 })),\n ...tagAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 3 })),\n checkInAttribute,\n updateAttribute,\n firstRequestAttribute,\n ...systemAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 }))\n ];\n return attributeDuplicateFilter(attributes, 'key');\n }\n);\n\nexport const getOnboardingState = createSelector([getOnboarding, getUserSettings], ({ complete, progress, showTips, ...remainder }, { onboarding = {} }) => ({\n ...remainder,\n ...onboarding,\n complete: onboarding.complete || complete,\n progress:\n Object.keys(onboardingSteps).findIndex(step => step === progress) > Object.keys(onboardingSteps).findIndex(step => step === onboarding.progress)\n ? progress\n : onboarding.progress,\n showTips: !onboarding.showTips ? onboarding.showTips : showTips\n}));\n\nexport const getDemoDeviceAddress = createSelector([getDevicesById, getOnboarding], (devicesById, { approach, demoArtifactPort }) => {\n const demoDeviceAddress = `http://${getDemoDeviceAddressHelper(Object.values(devicesById), approach)}`;\n return demoArtifactPort ? `${demoDeviceAddress}:${demoArtifactPort}` : demoDeviceAddress;\n});\n\nexport const getDeviceConfigDeployment = createSelector([getDeviceById, getDeploymentsById], (device, deploymentsById) => {\n const { config = {} } = device;\n const { deployment_id: configDeploymentId = '' } = config;\n const deviceConfigDeployment = deploymentsById[configDeploymentId] ?? {};\n return { device, deviceConfigDeployment };\n});\n\nexport const getDeploymentRelease = createSelector(\n [getDeploymentsById, getDeploymentsSelectionState, getReleasesById],\n (deploymentsById, { selectedId = '' }, releasesById) => {\n const deployment = deploymentsById[selectedId] ?? {};\n return deployment?.artifact_name && releasesById[deployment.artifact_name] ? releasesById[deployment.artifact_name] : { device_types_compatible: [] };\n }\n);\n\nexport const getSelectedDeploymentData = createSelector(\n [getDeploymentsById, getDeploymentsSelectionState, getDevicesById, getSelectedDeploymentDeviceIds],\n (deploymentsById, { selectedId = '' }, devicesById, selectedDeviceIds) => {\n const deployment = deploymentsById[selectedId] ?? {};\n const { devices = {} } = deployment as Deployment;\n return {\n deployment,\n selectedDevices: selectedDeviceIds.map(deviceId => ({ ...devicesById[deviceId], ...(devices[deviceId] ?? {}) }))\n };\n }\n);\n\nexport const getAvailableIssueOptionsByType = createSelector([getTenantCapabilities, getIssueCountsByType], ({ hasFullFiltering, hasMonitor }, issueCounts) =>\n Object.values<DeviceIssueOption>(DEVICE_ISSUE_OPTIONS).reduce(\n (accu, { isCategory, key, needsFullFiltering, needsMonitor, title }) => {\n if (isCategory || (needsFullFiltering && !hasFullFiltering) || (needsMonitor && !hasMonitor)) {\n return accu;\n }\n accu[key] = { count: issueCounts[key].filtered, key, title };\n return accu;\n },\n {} as Record<string, { count: number; key: string; title: string }>\n )\n);\n\nexport const getGroupNames = createSelector([getGroupsById, getUserRoles], (groupsById, { uiPermissions }) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [UNGROUPED_GROUP.id]: ungrouped, ...groups } = groupsById;\n return Object.keys(\n Object.entries(groups).reduce(\n (accu, [groupName, group]) => {\n if (group.filters || uiPermissions.groups[ALL_DEVICES]) {\n accu[groupName] = group;\n }\n return accu;\n },\n { ...uiPermissions.groups } as Record<string, DeviceGroup>\n )\n ).sort();\n});\n\nexport const getDeviceReportsForUser = createSelector(\n [getUserSettings, getCurrentUser, getGlobalSettings, getDevicesById],\n ({ reports }, { id: currentUserId }, globalSettings, devicesById) =>\n reports || globalSettings[`${currentUserId}-reports`] || (Object.keys(devicesById).length ? defaultReports : [])\n);\n\nconst listTypeDeviceIdMap = {\n deviceList: getListedDevices,\n search: getSearchedDevices\n};\nconst deviceMapDefault = { defaultObject: { auth_sets: [] }, cutOffSize: DEVICE_LIST_MAXIMUM_LENGTH };\nconst getDeviceMappingDefaults = () => deviceMapDefault;\n\nexport const getMappedDevicesList = createSelector(\n [getDevicesById, (state, listType) => listTypeDeviceIdMap[listType](state), getDeviceMappingDefaults],\n listItemMapper\n);\n\nexport const getAuditlogDevice = createSelector([getAuditLogEntry, getDevicesById], (auditlogEvent, devicesById) => {\n let auditlogDevice: Partial<Device> = {};\n if (auditlogEvent) {\n const { object } = auditlogEvent as AuditLogEvent;\n const objectData = object as AuditLogEvent['object'] | undefined;\n if (objectData?.type === 'device' && objectData.id) {\n auditlogDevice = { id: objectData.id, ...(objectData.device ?? {}) } as Device;\n }\n }\n return { ...auditlogDevice, ...(auditlogDevice.id ? devicesById[auditlogDevice.id] : {}) };\n});\n\ntype RoleItem = Role | { value: string };\nexport const getRelevantRoles = createSelector([getOrganization, getRolesList], ({ service_provider }, roles) => {\n if (service_provider) {\n return roles.reduce(\n (accu, role) => {\n if (rolesById[role.value as keyof typeof rolesById]) {\n return accu;\n }\n accu.push(role);\n return accu;\n },\n [...Object.values(serviceProviderRolesById)] as RoleItem[]\n );\n }\n return Object.keys(rolesById)\n .reverse()\n .reduce((accu, key) => {\n const index = accu.findIndex(({ value }) => value === key);\n if (index >= 0) {\n accu = [accu[index], ...accu.filter((_, itemIndex) => index !== itemIndex)];\n }\n return accu;\n }, roles);\n});\n\nexport const getShowSecurityAlert = createSelector(\n [getCurrentUser, getHas2FA, getFeatures, getIsEnterprise, getUserSettingsInitialized, getSecurityAlertDismissedTimestamp],\n (currentUser, has2FA, features, isEnterprise, settingsInitialized, dismissedTimestamp) => {\n const isOAuth2 = !!currentUser?.sso?.length;\n const userVerified = !!currentUser.verified;\n\n const isHosted = features?.isHosted;\n const canHave2FA = isEnterprise || isHosted;\n const secureOAuthUser = isOAuth2 && userVerified;\n if (!currentUser || !settingsInitialized || has2FA || !canHave2FA || secureOAuthUser) {\n return false;\n }\n\n if (dismissedTimestamp === null) {\n return true;\n }\n\n const today = dayjs();\n const dismissedMonthAgo = today.diff(dismissedTimestamp, 'months');\n\n return dismissedMonthAgo > 0;\n }\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA6CA,MAAa,mBAAA,GAAA,iBAAA,gBACX,CAACA,oCAAAA,iBAAiBC,2BAAAA,YAAY,GAC7B,EAAE,OAAOC,2BAAAA,MAAM,GAAG,MAAM,EAAE,cAAc,eAAe,gBAAiB,YAAY,SAASA,2BAAAA,MAAM,WAAW,GAChH;AAED,MAAa,gBAAA,GAAA,iBAAA,gBAA8B;CAACC,6BAAAA;CAAgBC,6BAAAA;CAAc;CAAgB,GAAG,aAAa,WAAW,iBAAiB;CACpI,MAAM,UAAU,YAAY,OAAO,SAAS,YAAY,MAAM,MAAK,SAAQ,SAASC,+BAAAA,YAAY,MAAM,GAAG,CAAC;AAE1G,QAAO;EAAE;EAAS,eADI,UAAUC,cAAAA,4BAA4B,CAACD,+BAAAA,YAAY,MAAM,EAAE,UAAU,GAAGC,cAAAA,4BAA4B,YAAY,SAAS,EAAE,EAAE,UAAU;EAC5H;EACjC;AAEF,MAAM,iBAAiB,OAAiC,eACtD,OAAO,OAAO,MAAM,CAAC,MAAK,gBAAe,YAAY,SAAS,WAAW,CAAC;AAE5E,MAAa,uBAAA,GAAA,iBAAA,gBAAqC,CAAC,cAAcC,oCAAAA,qBAAqB,GAAG,EAAE,iBAAiB,sBAAsB;CAChI,MAAM,oBAAoB,cAAc,cAAc,UAAUC,+BAAAA,kBAAkB,OAAO,MAAM;CAC/F,MAAM,kBAAkB,qBAAqB,cAAc,cAAc,UAAUA,+BAAAA,kBA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E9B"}
1
+ {"version":3,"file":"commonSelectors.cjs","names":["getOrganization","getFeatures","PLANS","getCurrentUser","getRolesById","rolesByName","mapUserRolesToUiPermissions","getIsServiceProvider","uiPermissionsById","ADDONS","getGlobalSettings","getFilteringAttributes","ATTRIBUTE_SCOPES","getOnboarding","getUserSettings","onboardingSteps","getDevicesById","getDeviceById","getDeploymentsById","getDeploymentsSelectionState","getReleasesById","getSelectedDeploymentDeviceIds","getIssueCountsByType","DEVICE_ISSUE_OPTIONS","getGroupsById","UNGROUPED_GROUP","ALL_DEVICES","defaultReports","getListedDevices","getSearchedDevices","listItemMapper","getAuditLogEntry","getRolesList","rolesById","serviceProviderRolesById","getHas2FA","getUserSettingsInitialized","getSecurityAlertDismissedTimestamp"],"sources":["../src/commonSelectors.ts"],"sourcesContent":["// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { AuditLog as AuditLogEvent } from '@northern.tech/types/types.gen';\nimport type { DeviceIssueOption } from '@northern.tech/utils/constants';\nimport { attributeDuplicateFilter, getDemoDeviceAddress as getDemoDeviceAddressHelper } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\nimport dayjs from 'dayjs';\n\nimport { ADDONS, PLANS, defaultReports } from './appSlice/constants';\nimport { getFeatures, getSearchedDevices } from './appSlice/selectors';\nimport { DEVICE_LIST_MAXIMUM_LENGTH, UNGROUPED_GROUP } from './commonConstants';\nimport { ALL_DEVICES, ATTRIBUTE_SCOPES, DEVICE_ISSUE_OPTIONS, rolesById, rolesByName, serviceProviderRolesById, uiPermissionsById } from './constants';\nimport type { Role } from './constants';\nimport type { Deployment } from './deploymentsSlice';\nimport { getDeploymentsById, getDeploymentsSelectionState, getSelectedDeploymentDeviceIds } from './deploymentsSlice/selectors';\nimport type { Device, DeviceGroup } from './devicesSlice';\nimport { getDeviceById, getDevicesById, getFilteringAttributes, getGroupsById, getListedDevices } from './devicesSlice/selectors';\nimport { getIssueCountsByType } from './monitorSlice/selectors';\nimport { onboardingSteps } from './onboardingSlice/constants';\nimport { getOnboarding } from './onboardingSlice/selectors';\nimport { getAuditLogEntry, getIsServiceProvider, getOrganization } from './organizationSlice/selectors';\nimport { getReleasesById } from './releasesSlice/selectors';\nimport {\n getCurrentUser,\n getGlobalSettings,\n getHas2FA,\n getRolesById,\n getRolesList,\n getSecurityAlertDismissedTimestamp,\n getUserSettings,\n getUserSettingsInitialized\n} from './usersSlice/selectors';\nimport { listItemMapper, mapUserRolesToUiPermissions } from './utils';\n\nexport const getIsEnterprise = createSelector(\n [getOrganization, getFeatures],\n ({ plan = PLANS.os.id }, { isEnterprise, isHosted }) => isEnterprise || (isHosted && plan === PLANS.enterprise.id)\n);\n\nexport const getUserRoles = createSelector([getCurrentUser, getRolesById, getIsEnterprise], (currentUser, rolesById, isEnterprise) => {\n const isAdmin = currentUser.roles?.length ? currentUser.roles.some(role => role === rolesByName.admin) : !isEnterprise;\n const uiPermissions = isAdmin ? mapUserRolesToUiPermissions([rolesByName.admin], rolesById) : mapUserRolesToUiPermissions(currentUser.roles || [], rolesById);\n return { isAdmin, uiPermissions };\n});\n\nconst hasPermission = (thing: Record<string, string[]>, permission: string): boolean =>\n Object.values(thing).some(permissions => permissions.includes(permission));\n\nexport const getUserCapabilities = createSelector([getUserRoles, getIsServiceProvider], ({ uiPermissions }, isServiceProvider) => {\n const canManageReleases = hasPermission(uiPermissions.releases, uiPermissionsById.manage.value);\n const canReadReleases = canManageReleases || hasPermission(uiPermissions.releases, uiPermissionsById.read.value);\n const canUploadReleases = canManageReleases || hasPermission(uiPermissions.releases, uiPermissionsById.upload.value);\n\n const canAuditlog = uiPermissions.auditlog.includes(uiPermissionsById.read.value);\n\n const canReadUsers = uiPermissions.userManagement.includes(uiPermissionsById.read.value);\n const canManageUsers = uiPermissions.userManagement.includes(uiPermissionsById.manage.value);\n\n const canReadDevices = hasPermission(uiPermissions.groups, uiPermissionsById.read.value);\n const canWriteDevices = Object.values(uiPermissions.groups).some(\n groupPermissions => groupPermissions.includes(uiPermissionsById.read.value) && groupPermissions.length > 1\n );\n const canTroubleshoot = hasPermission(uiPermissions.groups, uiPermissionsById.connect.value);\n const canManageDevices = hasPermission(uiPermissions.groups, uiPermissionsById.manage.value);\n const canConfigure = hasPermission(uiPermissions.groups, uiPermissionsById.configure.value);\n\n const canDeploy =\n (uiPermissions.deployments?.includes(uiPermissionsById.deploy.value) ?? false) || hasPermission(uiPermissions.groups, uiPermissionsById.deploy.value);\n const canReadDeployments = uiPermissions.deployments?.includes(uiPermissionsById.read.value) ?? false;\n\n return {\n canAuditlog,\n canConfigure,\n canDeploy,\n canManageDevices,\n canManageReleases,\n canManageUsers,\n canReadDeployments,\n canReadDevices,\n canReadReleases,\n canReadUsers,\n canTroubleshoot,\n canUploadReleases,\n canWriteDevices,\n groupsPermissions: uiPermissions.groups,\n releasesPermissions: uiPermissions.releases,\n SPTenant: isServiceProvider\n };\n});\n\nexport const getTenantCapabilities = createSelector(\n [getFeatures, getOrganization, getIsEnterprise],\n (\n {\n hasAuditlogs: isAuditlogEnabled,\n hasDeviceConfig: isDeviceConfigEnabled,\n hasDeviceConnect: isDeviceConnectEnabled,\n hasMonitor: isMonitorEnabled,\n isHosted\n },\n { addons = [], plan = PLANS.os.id },\n isEnterprise\n ) => {\n const canDelta = isEnterprise || plan === PLANS.professional.id;\n const hasAuditlogs = isAuditlogEnabled && isEnterprise;\n const hasDeviceConfig = addons.some(addon => addon.name === ADDONS.configure.id && addon.enabled) || (isDeviceConfigEnabled && !isHosted);\n const hasDeviceConnect = addons.some(addon => addon.name === ADDONS.troubleshoot.id && addon.enabled) || (isDeviceConnectEnabled && !isHosted);\n const hasMonitor = isMonitorEnabled && addons.some(addon => addon.name === ADDONS.monitor.id && addon.enabled);\n return {\n canDelta,\n canRetry: canDelta,\n canSchedule: canDelta,\n hasAuditlogs,\n hasDeviceConfig,\n hasDeviceConnect,\n hasFullFiltering: canDelta,\n hasMonitor,\n isEnterprise,\n plan\n };\n }\n);\n\nexport const getFilterAttributes = createSelector(\n [getGlobalSettings, getFilteringAttributes],\n ({ previousFilters }, { identityAttributes, inventoryAttributes, systemAttributes, tagAttributes }) => {\n const deviceNameAttribute = { key: 'name', value: 'Name', scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 1 };\n const deviceIdAttribute = { key: 'id', value: 'Device ID', scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 };\n const checkInAttribute = { key: 'check_in_time', value: 'Latest activity', scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };\n const updateAttribute = { ...checkInAttribute, key: 'updated_ts', value: 'Last inventory update' };\n const firstRequestAttribute = { key: 'created_ts', value: 'First request', scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };\n const attributes = [\n ...previousFilters.map(item => ({\n ...item,\n value: deviceIdAttribute.key === item.key ? deviceIdAttribute.value : item.key,\n category: 'recently used',\n priority: 0\n })),\n deviceNameAttribute,\n deviceIdAttribute,\n ...identityAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 })),\n ...inventoryAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.inventory, category: ATTRIBUTE_SCOPES.inventory, priority: 2 })),\n ...tagAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 3 })),\n checkInAttribute,\n updateAttribute,\n firstRequestAttribute,\n ...systemAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 }))\n ];\n return attributeDuplicateFilter(attributes, 'key');\n }\n);\n\nexport const getOnboardingState = createSelector([getOnboarding, getUserSettings], ({ complete, progress, showTips, ...remainder }, { onboarding = {} }) => ({\n ...remainder,\n ...onboarding,\n complete: onboarding.complete || complete,\n progress:\n Object.keys(onboardingSteps).findIndex(step => step === progress) > Object.keys(onboardingSteps).findIndex(step => step === onboarding.progress)\n ? progress\n : onboarding.progress,\n showTips: !onboarding.showTips ? onboarding.showTips : showTips\n}));\n\nexport const getDemoDeviceAddress = createSelector([getDevicesById, getOnboarding], (devicesById, { approach, demoArtifactPort }) => {\n const demoDeviceAddress = `http://${getDemoDeviceAddressHelper(Object.values(devicesById), approach)}`;\n return demoArtifactPort ? `${demoDeviceAddress}:${demoArtifactPort}` : demoDeviceAddress;\n});\n\nexport const getDeviceConfigDeployment = createSelector([getDeviceById, getDeploymentsById], (device, deploymentsById) => {\n const { config = {} } = device;\n const { deployment_id: configDeploymentId = '' } = config;\n const deviceConfigDeployment = deploymentsById[configDeploymentId] ?? {};\n return { device, deviceConfigDeployment };\n});\n\nexport const getDeploymentRelease = createSelector(\n [getDeploymentsById, getDeploymentsSelectionState, getReleasesById],\n (deploymentsById, { selectedId = '' }, releasesById) => {\n const deployment = deploymentsById[selectedId] ?? {};\n return deployment?.artifact_name && releasesById[deployment.artifact_name] ? releasesById[deployment.artifact_name] : { device_types_compatible: [] };\n }\n);\n\nexport const getSelectedDeploymentData = createSelector(\n [getDeploymentsById, getDeploymentsSelectionState, getDevicesById, getSelectedDeploymentDeviceIds],\n (deploymentsById, { selectedId = '' }, devicesById, selectedDeviceIds) => {\n const deployment = deploymentsById[selectedId] ?? {};\n const { devices = {} } = deployment as Deployment;\n return {\n deployment,\n selectedDevices: selectedDeviceIds.map(deviceId => ({ ...devicesById[deviceId], ...(devices[deviceId] ?? {}) }))\n };\n }\n);\n\nexport const getAvailableIssueOptionsByType = createSelector([getTenantCapabilities, getIssueCountsByType], ({ hasFullFiltering, hasMonitor }, issueCounts) =>\n Object.values<DeviceIssueOption>(DEVICE_ISSUE_OPTIONS).reduce(\n (accu, { isCategory, key, needsFullFiltering, needsMonitor, title }) => {\n if (isCategory || (needsFullFiltering && !hasFullFiltering) || (needsMonitor && !hasMonitor)) {\n return accu;\n }\n accu[key] = { count: issueCounts[key].filtered, key, title };\n return accu;\n },\n {} as Record<string, { count: number; key: string; title: string }>\n )\n);\n\nexport const getGroupNames = createSelector([getGroupsById, getUserRoles], (groupsById, { uiPermissions }) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [UNGROUPED_GROUP.id]: ungrouped, ...groups } = groupsById;\n return Object.keys(\n Object.entries(groups).reduce(\n (accu, [groupName, group]) => {\n if (group.filters || uiPermissions.groups[ALL_DEVICES]) {\n accu[groupName] = group;\n }\n return accu;\n },\n { ...uiPermissions.groups } as Record<string, DeviceGroup>\n )\n ).sort();\n});\n\nexport const getDeviceReportsForUser = createSelector(\n [getUserSettings, getCurrentUser, getGlobalSettings, getDevicesById],\n ({ reports }, { id: currentUserId }, globalSettings, devicesById) =>\n reports || globalSettings[`${currentUserId}-reports`] || (Object.keys(devicesById).length ? defaultReports : [])\n);\n\nconst listTypeDeviceIdMap = {\n deviceList: getListedDevices,\n search: getSearchedDevices\n};\nconst deviceMapDefault = { defaultObject: { auth_sets: [] }, cutOffSize: DEVICE_LIST_MAXIMUM_LENGTH };\nconst getDeviceMappingDefaults = () => deviceMapDefault;\n\nexport const getMappedDevicesList = createSelector(\n [getDevicesById, (state, listType) => listTypeDeviceIdMap[listType](state), getDeviceMappingDefaults],\n listItemMapper\n);\n\nexport const getAuditlogDevice = createSelector([getAuditLogEntry, getDevicesById], (auditlogEvent, devicesById) => {\n let auditlogDevice: Partial<Device> = {};\n if (auditlogEvent) {\n const { object } = auditlogEvent as AuditLogEvent;\n const objectData = object as AuditLogEvent['object'] | undefined;\n if (objectData?.type === 'device' && objectData.id) {\n auditlogDevice = { id: objectData.id, ...(objectData.device ?? {}) } as Device;\n }\n }\n return { ...auditlogDevice, ...(auditlogDevice.id ? devicesById[auditlogDevice.id] : {}) };\n});\n\ntype RoleItem = Role | { value: string };\nexport const getRelevantRoles = createSelector([getOrganization, getRolesList], ({ service_provider }, roles) => {\n if (service_provider) {\n return roles.reduce(\n (accu, role) => {\n if (rolesById[role.value as keyof typeof rolesById]) {\n return accu;\n }\n accu.push(role);\n return accu;\n },\n [...Object.values(serviceProviderRolesById)] as RoleItem[]\n );\n }\n return Object.keys(rolesById)\n .reverse()\n .reduce((accu, key) => {\n const index = accu.findIndex(({ value }) => value === key);\n if (index >= 0) {\n accu = [accu[index], ...accu.filter((_, itemIndex) => index !== itemIndex)];\n }\n return accu;\n }, roles);\n});\n\nexport const getShowSecurityAlert = createSelector(\n [getCurrentUser, getHas2FA, getFeatures, getIsEnterprise, getUserSettingsInitialized, getSecurityAlertDismissedTimestamp],\n (currentUser, has2FA, features, isEnterprise, settingsInitialized, dismissedTimestamp) => {\n const isOAuth2 = !!currentUser?.sso?.length;\n const userVerified = !!currentUser.verified;\n\n const isHosted = features?.isHosted;\n const canHave2FA = isEnterprise || isHosted;\n const secureOAuthUser = isOAuth2 && userVerified;\n if (!currentUser || !settingsInitialized || has2FA || !canHave2FA || secureOAuthUser) {\n return false;\n }\n\n if (dismissedTimestamp === null) {\n return true;\n }\n\n const today = dayjs();\n const dismissedMonthAgo = today.diff(dismissedTimestamp, 'months');\n\n return dismissedMonthAgo > 0;\n }\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA6CA,MAAa,mBAAA,GAAA,iBAAA,gBACX,CAACA,oCAAAA,iBAAiBC,2BAAAA,YAAY,GAC7B,EAAE,OAAOC,2BAAAA,MAAM,GAAG,MAAM,EAAE,cAAc,eAAe,gBAAiB,YAAY,SAASA,2BAAAA,MAAM,WAAW,GAChH;AAED,MAAa,gBAAA,GAAA,iBAAA,gBAA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;EACrB,MAAM,QAAQ,KAAK,WAAW,EAAE,YAAY,UAAU,IAAI;EAC1D,IAAI,SAAS,GACX,OAAO,CAAC,KAAK,QAAQ,GAAG,KAAK,QAAQ,GAAG,cAAc,UAAU,UAAU,CAAC;EAE7E,OAAO;IACN,MAAM;EACX;AAEF,MAAa,wBAAA,GAAA,iBAAA,gBACX;CAAC9B,6BAAAA;CAAgBgC,6BAAAA;CAAWlC,2BAAAA;CAAa;CAAiBmC,6BAAAA;CAA4BC,6BAAAA;CAAmC,GACxH,aAAa,QAAQ,UAAU,cAAc,qBAAqB,uBAAuB;CACxF,MAAM,WAAW,CAAC,CAAC,aAAa,KAAK;CACrC,MAAM,eAAe,CAAC,CAAC,YAAY;CAEnC,MAAM,WAAW,UAAU;CAG3B,IAAI,CAAC,eAAe,CAAC,uBAAuB,UAAU,EAFnC,gBAAgB,aACX,YAAY,cAElC,OAAO;CAGT,IAAI,uBAAuB,MACzB,OAAO;CAMT,QAAA,GAAA,MAAA,UAF+B,CAAC,KAAK,oBAAoB,SAEjC,GAAG;EAE9B"}
@@ -1,15 +1,15 @@
1
- import { a as AvailablePlans } from "./constants-DPLHhjVN.cjs";
2
- import { S as Role } from "./constants-MPLfugsi.cjs";
3
- import { a as UserSettings, n as GlobalSettings, o as UserSliceType, r as User } from "./index-4eaLEXy_.cjs";
4
- import { n as Release, r as ReleaseSliceType } from "./index-FyYBBeN-.cjs";
5
- import { i as Organization, n as AuditLogSelectionState } from "./types-ClEfo0dK.cjs";
1
+ import { a as AvailablePlans } from "./constants-BFTS6mge.cjs";
2
+ import { S as Role } from "./constants-BrGIx40B.cjs";
3
+ import { a as UserSettings, n as GlobalSettings, o as UserSliceType, r as User } from "./index-BFlHWzjv.cjs";
4
+ import { i as ReleaseSliceType, r as Release } from "./index-C-q632wO.cjs";
5
+ import { i as Organization, n as AuditLogSelectionState } from "./types-COdPU2QQ.cjs";
6
6
  import { n as OnboardingSliceType, t as OnboardingApproach } from "./index-UPc3wvVd.cjs";
7
7
  import { l as SelectionState, o as DeploymentsSliceType, s as DeviceDeployment, t as Deployment } from "./index-BP0uAq36.cjs";
8
- import { c as InventoryAttributes, r as DeviceGroup, s as DeviceSliceType, t as Device } from "./index-Lz5JsJ6O.cjs";
9
- import { t as AppSliceType } from "./index-CTt-eIY8.cjs";
10
- import { t as MonitorSliceType } from "./index-BEVkIiNa.cjs";
11
- import { t as OrganizationSliceType } from "./index-Bwx9jEiL.cjs";
12
- import { r as RootState } from "./store-BiIA0r0A.cjs";
8
+ import { c as InventoryAttributes, r as DeviceGroup, s as DeviceSliceType, t as Device } from "./index-B64X5ozM.cjs";
9
+ import { t as AppSliceType } from "./index-DwACbyUg.cjs";
10
+ import { t as MonitorSliceType } from "./index-CT5hgXm9.cjs";
11
+ import { t as OrganizationSliceType } from "./index-BbaS7MzW.cjs";
12
+ import { r as RootState } from "./store-b5cF2WB5.cjs";
13
13
  import * as _$_northern_tech_types_types_gen0 from "@northern.tech/types/types.gen";
14
14
  import { AuditLog } from "@northern.tech/types/types.gen";
15
15
  import * as _$reselect from "reselect";
@@ -1,15 +1,15 @@
1
- import { a as AvailablePlans } from "./constants-C5AU0mCY.js";
2
- import { S as Role } from "./constants-DrwXHsJ1.js";
3
- import { a as UserSettings, n as GlobalSettings, o as UserSliceType, r as User } from "./index-DtePEQPT.js";
4
- import { n as Release, r as ReleaseSliceType } from "./index-Cvkvcz4r.js";
5
- import { i as Organization, n as AuditLogSelectionState } from "./types-B2NRQLFw.js";
1
+ import { a as AvailablePlans } from "./constants-BIIEMVoG.js";
2
+ import { S as Role } from "./constants-CjO3_FOH.js";
3
+ import { a as UserSettings, n as GlobalSettings, o as UserSliceType, r as User } from "./index-ez3oxfRo.js";
4
+ import { i as ReleaseSliceType, r as Release } from "./index-CyokFK2e.js";
5
+ import { i as Organization, n as AuditLogSelectionState } from "./types-BPyM8Inu.js";
6
6
  import { n as OnboardingSliceType, t as OnboardingApproach } from "./index-CJkrL0oA.js";
7
7
  import { l as SelectionState, o as DeploymentsSliceType, s as DeviceDeployment, t as Deployment } from "./index-CkwVnIqd.js";
8
- import { c as InventoryAttributes, r as DeviceGroup, s as DeviceSliceType, t as Device } from "./index-DqyY6oZ3.js";
9
- import { t as AppSliceType } from "./index-Dv3Hfxk_.js";
10
- import { t as MonitorSliceType } from "./index-CO-py5d4.js";
11
- import { t as OrganizationSliceType } from "./index-DJSlDPRX.js";
12
- import { r as RootState } from "./store-BQxOSRC1.js";
8
+ import { c as InventoryAttributes, r as DeviceGroup, s as DeviceSliceType, t as Device } from "./index-BI9O8JWe.js";
9
+ import { t as AppSliceType } from "./index-Bp1WpATs.js";
10
+ import { t as MonitorSliceType } from "./index-DUvrw_Ed.js";
11
+ import { t as OrganizationSliceType } from "./index-C6wNUfiV.js";
12
+ import { r as RootState } from "./store-D-xvZXiY.js";
13
13
  import * as _$_northern_tech_types_types_gen0 from "@northern.tech/types/types.gen";
14
14
  import { AuditLog } from "@northern.tech/types/types.gen";
15
15
  import * as _$reselect from "reselect";
@@ -1 +1 @@
1
- {"version":3,"file":"commonSelectors.js","names":["getDemoDeviceAddressHelper"],"sources":["../src/commonSelectors.ts"],"sourcesContent":["// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { AuditLog as AuditLogEvent } from '@northern.tech/types/types.gen';\nimport type { DeviceIssueOption } from '@northern.tech/utils/constants';\nimport { attributeDuplicateFilter, getDemoDeviceAddress as getDemoDeviceAddressHelper } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\nimport dayjs from 'dayjs';\n\nimport { ADDONS, PLANS, defaultReports } from './appSlice/constants';\nimport { getFeatures, getSearchedDevices } from './appSlice/selectors';\nimport { DEVICE_LIST_MAXIMUM_LENGTH, UNGROUPED_GROUP } from './commonConstants';\nimport { ALL_DEVICES, ATTRIBUTE_SCOPES, DEVICE_ISSUE_OPTIONS, rolesById, rolesByName, serviceProviderRolesById, uiPermissionsById } from './constants';\nimport type { Role } from './constants';\nimport type { Deployment } from './deploymentsSlice';\nimport { getDeploymentsById, getDeploymentsSelectionState, getSelectedDeploymentDeviceIds } from './deploymentsSlice/selectors';\nimport type { Device, DeviceGroup } from './devicesSlice';\nimport { getDeviceById, getDevicesById, getFilteringAttributes, getGroupsById, getListedDevices } from './devicesSlice/selectors';\nimport { getIssueCountsByType } from './monitorSlice/selectors';\nimport { onboardingSteps } from './onboardingSlice/constants';\nimport { getOnboarding } from './onboardingSlice/selectors';\nimport { getAuditLogEntry, getIsServiceProvider, getOrganization } from './organizationSlice/selectors';\nimport { getReleasesById } from './releasesSlice/selectors';\nimport {\n getCurrentUser,\n getGlobalSettings,\n getHas2FA,\n getRolesById,\n getRolesList,\n getSecurityAlertDismissedTimestamp,\n getUserSettings,\n getUserSettingsInitialized\n} from './usersSlice/selectors';\nimport { listItemMapper, mapUserRolesToUiPermissions } from './utils';\n\nexport const getIsEnterprise = createSelector(\n [getOrganization, getFeatures],\n ({ plan = PLANS.os.id }, { isEnterprise, isHosted }) => isEnterprise || (isHosted && plan === PLANS.enterprise.id)\n);\n\nexport const getUserRoles = createSelector([getCurrentUser, getRolesById, getIsEnterprise], (currentUser, rolesById, isEnterprise) => {\n const isAdmin = currentUser.roles?.length ? currentUser.roles.some(role => role === rolesByName.admin) : !isEnterprise;\n const uiPermissions = isAdmin ? mapUserRolesToUiPermissions([rolesByName.admin], rolesById) : mapUserRolesToUiPermissions(currentUser.roles || [], rolesById);\n return { isAdmin, uiPermissions };\n});\n\nconst hasPermission = (thing: Record<string, string[]>, permission: string): boolean =>\n Object.values(thing).some(permissions => permissions.includes(permission));\n\nexport const getUserCapabilities = createSelector([getUserRoles, getIsServiceProvider], ({ uiPermissions }, isServiceProvider) => {\n const canManageReleases = hasPermission(uiPermissions.releases, uiPermissionsById.manage.value);\n const canReadReleases = canManageReleases || hasPermission(uiPermissions.releases, uiPermissionsById.read.value);\n const canUploadReleases = canManageReleases || hasPermission(uiPermissions.releases, uiPermissionsById.upload.value);\n\n const canAuditlog = uiPermissions.auditlog.includes(uiPermissionsById.read.value);\n\n const canReadUsers = uiPermissions.userManagement.includes(uiPermissionsById.read.value);\n const canManageUsers = uiPermissions.userManagement.includes(uiPermissionsById.manage.value);\n\n const canReadDevices = hasPermission(uiPermissions.groups, uiPermissionsById.read.value);\n const canWriteDevices = Object.values(uiPermissions.groups).some(\n groupPermissions => groupPermissions.includes(uiPermissionsById.read.value) && groupPermissions.length > 1\n );\n const canTroubleshoot = hasPermission(uiPermissions.groups, uiPermissionsById.connect.value);\n const canManageDevices = hasPermission(uiPermissions.groups, uiPermissionsById.manage.value);\n const canConfigure = hasPermission(uiPermissions.groups, uiPermissionsById.configure.value);\n\n const canDeploy =\n (uiPermissions.deployments?.includes(uiPermissionsById.deploy.value) ?? false) || hasPermission(uiPermissions.groups, uiPermissionsById.deploy.value);\n const canReadDeployments = uiPermissions.deployments?.includes(uiPermissionsById.read.value) ?? false;\n\n return {\n canAuditlog,\n canConfigure,\n canDeploy,\n canManageDevices,\n canManageReleases,\n canManageUsers,\n canReadDeployments,\n canReadDevices,\n canReadReleases,\n canReadUsers,\n canTroubleshoot,\n canUploadReleases,\n canWriteDevices,\n groupsPermissions: uiPermissions.groups,\n releasesPermissions: uiPermissions.releases,\n SPTenant: isServiceProvider\n };\n});\n\nexport const getTenantCapabilities = createSelector(\n [getFeatures, getOrganization, getIsEnterprise],\n (\n {\n hasAuditlogs: isAuditlogEnabled,\n hasDeviceConfig: isDeviceConfigEnabled,\n hasDeviceConnect: isDeviceConnectEnabled,\n hasMonitor: isMonitorEnabled,\n isHosted\n },\n { addons = [], plan = PLANS.os.id },\n isEnterprise\n ) => {\n const canDelta = isEnterprise || plan === PLANS.professional.id;\n const hasAuditlogs = isAuditlogEnabled && isEnterprise;\n const hasDeviceConfig = addons.some(addon => addon.name === ADDONS.configure.id && addon.enabled) || (isDeviceConfigEnabled && !isHosted);\n const hasDeviceConnect = addons.some(addon => addon.name === ADDONS.troubleshoot.id && addon.enabled) || (isDeviceConnectEnabled && !isHosted);\n const hasMonitor = isMonitorEnabled && addons.some(addon => addon.name === ADDONS.monitor.id && addon.enabled);\n return {\n canDelta,\n canRetry: canDelta,\n canSchedule: canDelta,\n hasAuditlogs,\n hasDeviceConfig,\n hasDeviceConnect,\n hasFullFiltering: canDelta,\n hasMonitor,\n isEnterprise,\n plan\n };\n }\n);\n\nexport const getFilterAttributes = createSelector(\n [getGlobalSettings, getFilteringAttributes],\n ({ previousFilters }, { identityAttributes, inventoryAttributes, systemAttributes, tagAttributes }) => {\n const deviceNameAttribute = { key: 'name', value: 'Name', scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 1 };\n const deviceIdAttribute = { key: 'id', value: 'Device ID', scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 };\n const checkInAttribute = { key: 'check_in_time', value: 'Latest activity', scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };\n const updateAttribute = { ...checkInAttribute, key: 'updated_ts', value: 'Last inventory update' };\n const firstRequestAttribute = { key: 'created_ts', value: 'First request', scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };\n const attributes = [\n ...previousFilters.map(item => ({\n ...item,\n value: deviceIdAttribute.key === item.key ? deviceIdAttribute.value : item.key,\n category: 'recently used',\n priority: 0\n })),\n deviceNameAttribute,\n deviceIdAttribute,\n ...identityAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 })),\n ...inventoryAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.inventory, category: ATTRIBUTE_SCOPES.inventory, priority: 2 })),\n ...tagAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 3 })),\n checkInAttribute,\n updateAttribute,\n firstRequestAttribute,\n ...systemAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 }))\n ];\n return attributeDuplicateFilter(attributes, 'key');\n }\n);\n\nexport const getOnboardingState = createSelector([getOnboarding, getUserSettings], ({ complete, progress, showTips, ...remainder }, { onboarding = {} }) => ({\n ...remainder,\n ...onboarding,\n complete: onboarding.complete || complete,\n progress:\n Object.keys(onboardingSteps).findIndex(step => step === progress) > Object.keys(onboardingSteps).findIndex(step => step === onboarding.progress)\n ? progress\n : onboarding.progress,\n showTips: !onboarding.showTips ? onboarding.showTips : showTips\n}));\n\nexport const getDemoDeviceAddress = createSelector([getDevicesById, getOnboarding], (devicesById, { approach, demoArtifactPort }) => {\n const demoDeviceAddress = `http://${getDemoDeviceAddressHelper(Object.values(devicesById), approach)}`;\n return demoArtifactPort ? `${demoDeviceAddress}:${demoArtifactPort}` : demoDeviceAddress;\n});\n\nexport const getDeviceConfigDeployment = createSelector([getDeviceById, getDeploymentsById], (device, deploymentsById) => {\n const { config = {} } = device;\n const { deployment_id: configDeploymentId = '' } = config;\n const deviceConfigDeployment = deploymentsById[configDeploymentId] ?? {};\n return { device, deviceConfigDeployment };\n});\n\nexport const getDeploymentRelease = createSelector(\n [getDeploymentsById, getDeploymentsSelectionState, getReleasesById],\n (deploymentsById, { selectedId = '' }, releasesById) => {\n const deployment = deploymentsById[selectedId] ?? {};\n return deployment?.artifact_name && releasesById[deployment.artifact_name] ? releasesById[deployment.artifact_name] : { device_types_compatible: [] };\n }\n);\n\nexport const getSelectedDeploymentData = createSelector(\n [getDeploymentsById, getDeploymentsSelectionState, getDevicesById, getSelectedDeploymentDeviceIds],\n (deploymentsById, { selectedId = '' }, devicesById, selectedDeviceIds) => {\n const deployment = deploymentsById[selectedId] ?? {};\n const { devices = {} } = deployment as Deployment;\n return {\n deployment,\n selectedDevices: selectedDeviceIds.map(deviceId => ({ ...devicesById[deviceId], ...(devices[deviceId] ?? {}) }))\n };\n }\n);\n\nexport const getAvailableIssueOptionsByType = createSelector([getTenantCapabilities, getIssueCountsByType], ({ hasFullFiltering, hasMonitor }, issueCounts) =>\n Object.values<DeviceIssueOption>(DEVICE_ISSUE_OPTIONS).reduce(\n (accu, { isCategory, key, needsFullFiltering, needsMonitor, title }) => {\n if (isCategory || (needsFullFiltering && !hasFullFiltering) || (needsMonitor && !hasMonitor)) {\n return accu;\n }\n accu[key] = { count: issueCounts[key].filtered, key, title };\n return accu;\n },\n {} as Record<string, { count: number; key: string; title: string }>\n )\n);\n\nexport const getGroupNames = createSelector([getGroupsById, getUserRoles], (groupsById, { uiPermissions }) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [UNGROUPED_GROUP.id]: ungrouped, ...groups } = groupsById;\n return Object.keys(\n Object.entries(groups).reduce(\n (accu, [groupName, group]) => {\n if (group.filters || uiPermissions.groups[ALL_DEVICES]) {\n accu[groupName] = group;\n }\n return accu;\n },\n { ...uiPermissions.groups } as Record<string, DeviceGroup>\n )\n ).sort();\n});\n\nexport const getDeviceReportsForUser = createSelector(\n [getUserSettings, getCurrentUser, getGlobalSettings, getDevicesById],\n ({ reports }, { id: currentUserId }, globalSettings, devicesById) =>\n reports || globalSettings[`${currentUserId}-reports`] || (Object.keys(devicesById).length ? defaultReports : [])\n);\n\nconst listTypeDeviceIdMap = {\n deviceList: getListedDevices,\n search: getSearchedDevices\n};\nconst deviceMapDefault = { defaultObject: { auth_sets: [] }, cutOffSize: DEVICE_LIST_MAXIMUM_LENGTH };\nconst getDeviceMappingDefaults = () => deviceMapDefault;\n\nexport const getMappedDevicesList = createSelector(\n [getDevicesById, (state, listType) => listTypeDeviceIdMap[listType](state), getDeviceMappingDefaults],\n listItemMapper\n);\n\nexport const getAuditlogDevice = createSelector([getAuditLogEntry, getDevicesById], (auditlogEvent, devicesById) => {\n let auditlogDevice: Partial<Device> = {};\n if (auditlogEvent) {\n const { object } = auditlogEvent as AuditLogEvent;\n const objectData = object as AuditLogEvent['object'] | undefined;\n if (objectData?.type === 'device' && objectData.id) {\n auditlogDevice = { id: objectData.id, ...(objectData.device ?? {}) } as Device;\n }\n }\n return { ...auditlogDevice, ...(auditlogDevice.id ? devicesById[auditlogDevice.id] : {}) };\n});\n\ntype RoleItem = Role | { value: string };\nexport const getRelevantRoles = createSelector([getOrganization, getRolesList], ({ service_provider }, roles) => {\n if (service_provider) {\n return roles.reduce(\n (accu, role) => {\n if (rolesById[role.value as keyof typeof rolesById]) {\n return accu;\n }\n accu.push(role);\n return accu;\n },\n [...Object.values(serviceProviderRolesById)] as RoleItem[]\n );\n }\n return Object.keys(rolesById)\n .reverse()\n .reduce((accu, key) => {\n const index = accu.findIndex(({ value }) => value === key);\n if (index >= 0) {\n accu = [accu[index], ...accu.filter((_, itemIndex) => index !== itemIndex)];\n }\n return accu;\n }, roles);\n});\n\nexport const getShowSecurityAlert = createSelector(\n [getCurrentUser, getHas2FA, getFeatures, getIsEnterprise, getUserSettingsInitialized, getSecurityAlertDismissedTimestamp],\n (currentUser, has2FA, features, isEnterprise, settingsInitialized, dismissedTimestamp) => {\n const isOAuth2 = !!currentUser?.sso?.length;\n const userVerified = !!currentUser.verified;\n\n const isHosted = features?.isHosted;\n const canHave2FA = isEnterprise || isHosted;\n const secureOAuthUser = isOAuth2 && userVerified;\n if (!currentUser || !settingsInitialized || has2FA || !canHave2FA || secureOAuthUser) {\n return false;\n }\n\n if (dismissedTimestamp === null) {\n return true;\n }\n\n const today = dayjs();\n const dismissedMonthAgo = today.diff(dismissedTimestamp, 'months');\n\n return dismissedMonthAgo > 0;\n }\n);\n"],"mappings":";;;;;;;;;;;;;;;;AA6CA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AI,WAAW,UAAU,EAAE;GAAG;;AAGxE,QAAO;EAAE,GAAG;EAAgB,GAAI,eAAe,KAAK,YAAY,eAAe,MAAM,EAAE;EAAG;EAC1F;AAGF,MAAa,mBAAmB,eAAe,CAAC,iBAAiB,aAAa,GAAG,EAAE,oBAAoB,UAAU;AAC/G,KAAI,iBACF,QAAO,MAAM,QACV,MAAM,SAAS;AACd,MAAI,UAAU,KAAK,OACjB,QAAO;AAET,OAAK,KAAK,KAAK;AACf,SAAO;IAET,CAAC,GAAG,OAAO,OAAO,yBAAyB,CAAC,CAC7C;AAEH,QAAO,OAAO,KAAK,UAAU,CAC1B,SAAS,CACT,QAAQ,MAAM,QAAQ;EACrB,MAAM,QAAQ,KAAK,WAAW,EAAE,YAAY,UAAU,IAAI;AAC1D,MAAI,SAAS,EACX,QAAO,CAAC,KAAK,QAAQ,GAAG,KAAK,QAAQ,GAAG,cAAc,UAAU,UAAU,CAAC;AAE7E,SAAO;IACN,MAAM;EACX;AAEF,MAAa,uBAAuB,eAClC;CAAC;CAAgB;CAAW;CAAa;CAAiB;CAA4B;CAAmC,GACxH,aAAa,QAAQ,UAAU,cAAc,qBAAqB,uBAAuB;CACxF,MAAM,WAAW,CAAC,CAAC,aAAa,KAAK;CACrC,MAAM,eAAe,CAAC,CAAC,YAAY;CAEnC,MAAM,WAAW,UAAU;AAG3B,KAAI,CAAC,eAAe,CAAC,uBAAuB,UAAU,EAFnC,gBAAgB,aACX,YAAY,aAElC,QAAO;AAGT,KAAI,uBAAuB,KACzB,QAAO;AAMT,QAHc,OAAO,CACW,KAAK,oBAAoB,SAAS,GAEvC;EAE9B"}
1
+ {"version":3,"file":"commonSelectors.js","names":["getDemoDeviceAddressHelper"],"sources":["../src/commonSelectors.ts"],"sourcesContent":["// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { AuditLog as AuditLogEvent } from '@northern.tech/types/types.gen';\nimport type { DeviceIssueOption } from '@northern.tech/utils/constants';\nimport { attributeDuplicateFilter, getDemoDeviceAddress as getDemoDeviceAddressHelper } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\nimport dayjs from 'dayjs';\n\nimport { ADDONS, PLANS, defaultReports } from './appSlice/constants';\nimport { getFeatures, getSearchedDevices } from './appSlice/selectors';\nimport { DEVICE_LIST_MAXIMUM_LENGTH, UNGROUPED_GROUP } from './commonConstants';\nimport { ALL_DEVICES, ATTRIBUTE_SCOPES, DEVICE_ISSUE_OPTIONS, rolesById, rolesByName, serviceProviderRolesById, uiPermissionsById } from './constants';\nimport type { Role } from './constants';\nimport type { Deployment } from './deploymentsSlice';\nimport { getDeploymentsById, getDeploymentsSelectionState, getSelectedDeploymentDeviceIds } from './deploymentsSlice/selectors';\nimport type { Device, DeviceGroup } from './devicesSlice';\nimport { getDeviceById, getDevicesById, getFilteringAttributes, getGroupsById, getListedDevices } from './devicesSlice/selectors';\nimport { getIssueCountsByType } from './monitorSlice/selectors';\nimport { onboardingSteps } from './onboardingSlice/constants';\nimport { getOnboarding } from './onboardingSlice/selectors';\nimport { getAuditLogEntry, getIsServiceProvider, getOrganization } from './organizationSlice/selectors';\nimport { getReleasesById } from './releasesSlice/selectors';\nimport {\n getCurrentUser,\n getGlobalSettings,\n getHas2FA,\n getRolesById,\n getRolesList,\n getSecurityAlertDismissedTimestamp,\n getUserSettings,\n getUserSettingsInitialized\n} from './usersSlice/selectors';\nimport { listItemMapper, mapUserRolesToUiPermissions } from './utils';\n\nexport const getIsEnterprise = createSelector(\n [getOrganization, getFeatures],\n ({ plan = PLANS.os.id }, { isEnterprise, isHosted }) => isEnterprise || (isHosted && plan === PLANS.enterprise.id)\n);\n\nexport const getUserRoles = createSelector([getCurrentUser, getRolesById, getIsEnterprise], (currentUser, rolesById, isEnterprise) => {\n const isAdmin = currentUser.roles?.length ? currentUser.roles.some(role => role === rolesByName.admin) : !isEnterprise;\n const uiPermissions = isAdmin ? mapUserRolesToUiPermissions([rolesByName.admin], rolesById) : mapUserRolesToUiPermissions(currentUser.roles || [], rolesById);\n return { isAdmin, uiPermissions };\n});\n\nconst hasPermission = (thing: Record<string, string[]>, permission: string): boolean =>\n Object.values(thing).some(permissions => permissions.includes(permission));\n\nexport const getUserCapabilities = createSelector([getUserRoles, getIsServiceProvider], ({ uiPermissions }, isServiceProvider) => {\n const canManageReleases = hasPermission(uiPermissions.releases, uiPermissionsById.manage.value);\n const canReadReleases = canManageReleases || hasPermission(uiPermissions.releases, uiPermissionsById.read.value);\n const canUploadReleases = canManageReleases || hasPermission(uiPermissions.releases, uiPermissionsById.upload.value);\n\n const canAuditlog = uiPermissions.auditlog.includes(uiPermissionsById.read.value);\n\n const canReadUsers = uiPermissions.userManagement.includes(uiPermissionsById.read.value);\n const canManageUsers = uiPermissions.userManagement.includes(uiPermissionsById.manage.value);\n\n const canReadDevices = hasPermission(uiPermissions.groups, uiPermissionsById.read.value);\n const canWriteDevices = Object.values(uiPermissions.groups).some(\n groupPermissions => groupPermissions.includes(uiPermissionsById.read.value) && groupPermissions.length > 1\n );\n const canTroubleshoot = hasPermission(uiPermissions.groups, uiPermissionsById.connect.value);\n const canManageDevices = hasPermission(uiPermissions.groups, uiPermissionsById.manage.value);\n const canConfigure = hasPermission(uiPermissions.groups, uiPermissionsById.configure.value);\n\n const canDeploy =\n (uiPermissions.deployments?.includes(uiPermissionsById.deploy.value) ?? false) || hasPermission(uiPermissions.groups, uiPermissionsById.deploy.value);\n const canReadDeployments = uiPermissions.deployments?.includes(uiPermissionsById.read.value) ?? false;\n\n return {\n canAuditlog,\n canConfigure,\n canDeploy,\n canManageDevices,\n canManageReleases,\n canManageUsers,\n canReadDeployments,\n canReadDevices,\n canReadReleases,\n canReadUsers,\n canTroubleshoot,\n canUploadReleases,\n canWriteDevices,\n groupsPermissions: uiPermissions.groups,\n releasesPermissions: uiPermissions.releases,\n SPTenant: isServiceProvider\n };\n});\n\nexport const getTenantCapabilities = createSelector(\n [getFeatures, getOrganization, getIsEnterprise],\n (\n {\n hasAuditlogs: isAuditlogEnabled,\n hasDeviceConfig: isDeviceConfigEnabled,\n hasDeviceConnect: isDeviceConnectEnabled,\n hasMonitor: isMonitorEnabled,\n isHosted\n },\n { addons = [], plan = PLANS.os.id },\n isEnterprise\n ) => {\n const canDelta = isEnterprise || plan === PLANS.professional.id;\n const hasAuditlogs = isAuditlogEnabled && isEnterprise;\n const hasDeviceConfig = addons.some(addon => addon.name === ADDONS.configure.id && addon.enabled) || (isDeviceConfigEnabled && !isHosted);\n const hasDeviceConnect = addons.some(addon => addon.name === ADDONS.troubleshoot.id && addon.enabled) || (isDeviceConnectEnabled && !isHosted);\n const hasMonitor = isMonitorEnabled && addons.some(addon => addon.name === ADDONS.monitor.id && addon.enabled);\n return {\n canDelta,\n canRetry: canDelta,\n canSchedule: canDelta,\n hasAuditlogs,\n hasDeviceConfig,\n hasDeviceConnect,\n hasFullFiltering: canDelta,\n hasMonitor,\n isEnterprise,\n plan\n };\n }\n);\n\nexport const getFilterAttributes = createSelector(\n [getGlobalSettings, getFilteringAttributes],\n ({ previousFilters }, { identityAttributes, inventoryAttributes, systemAttributes, tagAttributes }) => {\n const deviceNameAttribute = { key: 'name', value: 'Name', scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 1 };\n const deviceIdAttribute = { key: 'id', value: 'Device ID', scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 };\n const checkInAttribute = { key: 'check_in_time', value: 'Latest activity', scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };\n const updateAttribute = { ...checkInAttribute, key: 'updated_ts', value: 'Last inventory update' };\n const firstRequestAttribute = { key: 'created_ts', value: 'First request', scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };\n const attributes = [\n ...previousFilters.map(item => ({\n ...item,\n value: deviceIdAttribute.key === item.key ? deviceIdAttribute.value : item.key,\n category: 'recently used',\n priority: 0\n })),\n deviceNameAttribute,\n deviceIdAttribute,\n ...identityAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 })),\n ...inventoryAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.inventory, category: ATTRIBUTE_SCOPES.inventory, priority: 2 })),\n ...tagAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 3 })),\n checkInAttribute,\n updateAttribute,\n firstRequestAttribute,\n ...systemAttributes.map(item => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 }))\n ];\n return attributeDuplicateFilter(attributes, 'key');\n }\n);\n\nexport const getOnboardingState = createSelector([getOnboarding, getUserSettings], ({ complete, progress, showTips, ...remainder }, { onboarding = {} }) => ({\n ...remainder,\n ...onboarding,\n complete: onboarding.complete || complete,\n progress:\n Object.keys(onboardingSteps).findIndex(step => step === progress) > Object.keys(onboardingSteps).findIndex(step => step === onboarding.progress)\n ? progress\n : onboarding.progress,\n showTips: !onboarding.showTips ? onboarding.showTips : showTips\n}));\n\nexport const getDemoDeviceAddress = createSelector([getDevicesById, getOnboarding], (devicesById, { approach, demoArtifactPort }) => {\n const demoDeviceAddress = `http://${getDemoDeviceAddressHelper(Object.values(devicesById), approach)}`;\n return demoArtifactPort ? `${demoDeviceAddress}:${demoArtifactPort}` : demoDeviceAddress;\n});\n\nexport const getDeviceConfigDeployment = createSelector([getDeviceById, getDeploymentsById], (device, deploymentsById) => {\n const { config = {} } = device;\n const { deployment_id: configDeploymentId = '' } = config;\n const deviceConfigDeployment = deploymentsById[configDeploymentId] ?? {};\n return { device, deviceConfigDeployment };\n});\n\nexport const getDeploymentRelease = createSelector(\n [getDeploymentsById, getDeploymentsSelectionState, getReleasesById],\n (deploymentsById, { selectedId = '' }, releasesById) => {\n const deployment = deploymentsById[selectedId] ?? {};\n return deployment?.artifact_name && releasesById[deployment.artifact_name] ? releasesById[deployment.artifact_name] : { device_types_compatible: [] };\n }\n);\n\nexport const getSelectedDeploymentData = createSelector(\n [getDeploymentsById, getDeploymentsSelectionState, getDevicesById, getSelectedDeploymentDeviceIds],\n (deploymentsById, { selectedId = '' }, devicesById, selectedDeviceIds) => {\n const deployment = deploymentsById[selectedId] ?? {};\n const { devices = {} } = deployment as Deployment;\n return {\n deployment,\n selectedDevices: selectedDeviceIds.map(deviceId => ({ ...devicesById[deviceId], ...(devices[deviceId] ?? {}) }))\n };\n }\n);\n\nexport const getAvailableIssueOptionsByType = createSelector([getTenantCapabilities, getIssueCountsByType], ({ hasFullFiltering, hasMonitor }, issueCounts) =>\n Object.values<DeviceIssueOption>(DEVICE_ISSUE_OPTIONS).reduce(\n (accu, { isCategory, key, needsFullFiltering, needsMonitor, title }) => {\n if (isCategory || (needsFullFiltering && !hasFullFiltering) || (needsMonitor && !hasMonitor)) {\n return accu;\n }\n accu[key] = { count: issueCounts[key].filtered, key, title };\n return accu;\n },\n {} as Record<string, { count: number; key: string; title: string }>\n )\n);\n\nexport const getGroupNames = createSelector([getGroupsById, getUserRoles], (groupsById, { uiPermissions }) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [UNGROUPED_GROUP.id]: ungrouped, ...groups } = groupsById;\n return Object.keys(\n Object.entries(groups).reduce(\n (accu, [groupName, group]) => {\n if (group.filters || uiPermissions.groups[ALL_DEVICES]) {\n accu[groupName] = group;\n }\n return accu;\n },\n { ...uiPermissions.groups } as Record<string, DeviceGroup>\n )\n ).sort();\n});\n\nexport const getDeviceReportsForUser = createSelector(\n [getUserSettings, getCurrentUser, getGlobalSettings, getDevicesById],\n ({ reports }, { id: currentUserId }, globalSettings, devicesById) =>\n reports || globalSettings[`${currentUserId}-reports`] || (Object.keys(devicesById).length ? defaultReports : [])\n);\n\nconst listTypeDeviceIdMap = {\n deviceList: getListedDevices,\n search: getSearchedDevices\n};\nconst deviceMapDefault = { defaultObject: { auth_sets: [] }, cutOffSize: DEVICE_LIST_MAXIMUM_LENGTH };\nconst getDeviceMappingDefaults = () => deviceMapDefault;\n\nexport const getMappedDevicesList = createSelector(\n [getDevicesById, (state, listType) => listTypeDeviceIdMap[listType](state), getDeviceMappingDefaults],\n listItemMapper\n);\n\nexport const getAuditlogDevice = createSelector([getAuditLogEntry, getDevicesById], (auditlogEvent, devicesById) => {\n let auditlogDevice: Partial<Device> = {};\n if (auditlogEvent) {\n const { object } = auditlogEvent as AuditLogEvent;\n const objectData = object as AuditLogEvent['object'] | undefined;\n if (objectData?.type === 'device' && objectData.id) {\n auditlogDevice = { id: objectData.id, ...(objectData.device ?? {}) } as Device;\n }\n }\n return { ...auditlogDevice, ...(auditlogDevice.id ? devicesById[auditlogDevice.id] : {}) };\n});\n\ntype RoleItem = Role | { value: string };\nexport const getRelevantRoles = createSelector([getOrganization, getRolesList], ({ service_provider }, roles) => {\n if (service_provider) {\n return roles.reduce(\n (accu, role) => {\n if (rolesById[role.value as keyof typeof rolesById]) {\n return accu;\n }\n accu.push(role);\n return accu;\n },\n [...Object.values(serviceProviderRolesById)] as RoleItem[]\n );\n }\n return Object.keys(rolesById)\n .reverse()\n .reduce((accu, key) => {\n const index = accu.findIndex(({ value }) => value === key);\n if (index >= 0) {\n accu = [accu[index], ...accu.filter((_, itemIndex) => index !== itemIndex)];\n }\n return accu;\n }, roles);\n});\n\nexport const getShowSecurityAlert = createSelector(\n [getCurrentUser, getHas2FA, getFeatures, getIsEnterprise, getUserSettingsInitialized, getSecurityAlertDismissedTimestamp],\n (currentUser, has2FA, features, isEnterprise, settingsInitialized, dismissedTimestamp) => {\n const isOAuth2 = !!currentUser?.sso?.length;\n const userVerified = !!currentUser.verified;\n\n const isHosted = features?.isHosted;\n const canHave2FA = isEnterprise || isHosted;\n const secureOAuthUser = isOAuth2 && userVerified;\n if (!currentUser || !settingsInitialized || has2FA || !canHave2FA || secureOAuthUser) {\n return false;\n }\n\n if (dismissedTimestamp === null) {\n return true;\n }\n\n const today = dayjs();\n const dismissedMonthAgo = today.diff(dismissedTimestamp, 'months');\n\n return dismissedMonthAgo > 0;\n }\n);\n"],"mappings":";;;;;;;;;;;;;;;;AA6CA,MAAa,kBAAkB,eAC7B,CAAC,iBAAiB,YAAY,GAC7B,EAAE,OAAO,MAAM,GAAG,MAAM,EAAE,cAAc,eAAe,gBAAiB,YAAY,SAAS,MAAM,WAAW,GAChH;AAED,MAAa,eAAe,eAAe;CAAC;CAAgB;CAAc;CAAgB,GAAG,aAAa,WAAW,iBAAiB;CACpI,MAAM,UAAU,YAAY,OAAO,SAAS,YAAY,MAAM,MAAK,SAAQ,SAAS,YAAY,MAAM,GAAG,CAAC;CAE1G,OAAO;EAAE;EAAS,eADI,UAAU,4BAA4B,CAAC,YAAY,MAAM,EAAE,UAAU,GAAG,4BAA4B,YAAY,SAAS,EAAE,EAAE,UAAU;EAC5H;EACjC;AAEF,MAAM,iBAAiB,OAAiC,eACtD,OAAO,OAAO,MAAM,CAAC,MAAK,gBAAe,YAAY,SAAS,WAAW,CAAC;AAE5E,MAAa,sBAAsB,eAAe,CAAC,cAAc,qBAAqB,GAAG,EAAE,iBAAiB,sBAAsB;CAChI,MAAM,oBAAoB,cAAc,cAAc,UAAU,kBAAkB,OAAO,MAAM;CAC/F,MAAM,kBAAkB,qBAAqB,cAAc,cAAc,UAAU,kBAAkB,KAAK,MAAM;CAChH,MAAM,oBAAoB,qBAAqB,cAAc,cAAc,UAAU,kBAAkB,OAAO,MAAM;CAEpH,MAAM,cAAc,cAAc,SAAS,SAAS,kBAAkB,KAAK,MAAM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CAAC,uBAAuB,UAAU,EAFnC,gBAAgB,aACX,YAAY,cAElC,OAAO;CAGT,IAAI,uBAAuB,MACzB,OAAO;CAMT,OAHc,OACiB,CAAC,KAAK,oBAAoB,SAEjC,GAAG;EAE9B"}
@@ -137,6 +137,11 @@ declare const BENEFITS: {
137
137
  readonly benefit: "scheduled deployments to steer the distribution of your updates.";
138
138
  readonly requiredPlan: AvailablePlans;
139
139
  };
140
+ readonly manifests: {
141
+ readonly id: "manifests";
142
+ readonly benefit: "orchestrate multi-component updates with manifests for complex device software management";
143
+ readonly requiredPlan: AvailablePlans;
144
+ };
140
145
  readonly webhookEvents: {
141
146
  readonly id: "webhookEvents";
142
147
  readonly benefit: "receive inventory events and select which type(s) of events the webhook will receive";
@@ -154,4 +159,4 @@ declare const DARK_MODE = "dark";
154
159
  declare const LIGHT_MODE = "light";
155
160
  //#endregion
156
161
  export { locations as _, AvailablePlans as a, DARK_MODE as c, Plan as d, canAccess as f, emptyChartSelection as g, defaultReports as h, AvailableAddon as i, LIGHT_MODE as l, defaultReportType as m, Addon as n, BEGINNING_OF_TIME as o, chartTypes as p, AddonId as r, BENEFITS as s, ADDONS as t, PLANS as u, yes as v };
157
- //# sourceMappingURL=constants-DPLHhjVN.d.cts.map
162
+ //# sourceMappingURL=constants-BFTS6mge.d.cts.map
@@ -137,6 +137,11 @@ declare const BENEFITS: {
137
137
  readonly benefit: "scheduled deployments to steer the distribution of your updates.";
138
138
  readonly requiredPlan: AvailablePlans;
139
139
  };
140
+ readonly manifests: {
141
+ readonly id: "manifests";
142
+ readonly benefit: "orchestrate multi-component updates with manifests for complex device software management";
143
+ readonly requiredPlan: AvailablePlans;
144
+ };
140
145
  readonly webhookEvents: {
141
146
  readonly id: "webhookEvents";
142
147
  readonly benefit: "receive inventory events and select which type(s) of events the webhook will receive";
@@ -154,4 +159,4 @@ declare const DARK_MODE = "dark";
154
159
  declare const LIGHT_MODE = "light";
155
160
  //#endregion
156
161
  export { locations as _, AvailablePlans as a, DARK_MODE as c, Plan as d, canAccess as f, emptyChartSelection as g, defaultReports as h, AvailableAddon as i, LIGHT_MODE as l, defaultReportType as m, Addon as n, BEGINNING_OF_TIME as o, chartTypes as p, AddonId as r, BENEFITS as s, ADDONS as t, PLANS as u, yes as v };
157
- //# sourceMappingURL=constants-C5AU0mCY.d.ts.map
162
+ //# sourceMappingURL=constants-BIIEMVoG.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { Integration } from "@northern.tech/types/MenderTypes";
2
- import { ALL_DEVICES, ALL_DEVICE_STATES, ALL_RELEASES, APPLICATION_JSON_CONTENT_TYPE, APPLICATION_JWT_CONTENT_TYPE, ATTRIBUTE_SCOPES, AnyPermission, AuditLogPermission, DEVICE_FILTERING_OPTIONS, DEVICE_ISSUE_OPTIONS, DEVICE_LIST_DEFAULTS, DEVICE_STATES, DeploymentPermission, DeviceIssueOptionKey, GroupsPermission, PaginationOptions, PermissionObject, PermissionSet, PermissionSetId, PermissionTypes, ReleasesPermission, Role, SORTING_OPTIONS, ScopedPermissionsByAreaKey, SortOptions, UiPermissionsByAreaKey, UiPermissionsByIdKey, UiPermissionsDefinition, UserManagementPermission, alertChannels, apiRoot, apiUrl, auditLogsApiUrl, defaultPermissionSets, deploymentsApiUrl, deploymentsApiUrlV2, deviceAuthV2, deviceConfig, deviceConnect, emptyRole, emptyUiPermissions, headerNames, inventoryApiUrl, inventoryApiUrlV2, iotManagerBaseURL, limitDefault, maxSessionAge, monitorApiUrlv1, rolesById, rolesByName, scopedPermissionAreas, serviceProviderRolesById, ssoIdpApiUrlv1, tenantadmApiUrlv1, tenantadmApiUrlv2, twoFAStates, uiPermissionsByArea, uiPermissionsById, useradmApiUrl, useradmApiUrlv1, useradmApiUrlv2 } from "@northern.tech/utils/constants";
2
+ import { ALL_DEVICES, ALL_DEVICE_STATES, ALL_RELEASES, APPLICATION_JSON_CONTENT_TYPE, APPLICATION_JWT_CONTENT_TYPE, ATTRIBUTE_SCOPES, AnyPermission, AuditLogPermission, DEVICE_FILTERING_OPTIONS, DEVICE_ISSUE_OPTIONS, DEVICE_LIST_DEFAULTS, DEVICE_STATES, DeploymentPermission, DeviceIssueOptionKey, GroupsPermission, PaginationOptions, PermissionObject, PermissionSet, PermissionSetId, PermissionTypes, ReleasesPermission, Role, SORTING_OPTIONS, ScopedPermissionsByAreaKey, SortOptions, UiPermissionsByAreaKey, UiPermissionsByIdKey, UiPermissionsDefinition, UserManagementPermission, alertChannels, apiRoot, apiUrl, auditLogsApiUrl, defaultPermissionSets, deploymentsApiUrl, deploymentsApiUrlV1alpha1, deploymentsApiUrlV2, deviceAuthV2, deviceConfig, deviceConnect, emptyRole, emptyUiPermissions, headerNames, inventoryApiUrl, inventoryApiUrlV2, iotManagerBaseURL, limitDefault, maxSessionAge, monitorApiUrlv1, rolesById, rolesByName, scopedPermissionAreas, serviceProviderRolesById, ssoIdpApiUrlv1, tenantadmApiUrlv1, tenantadmApiUrlv2, twoFAStates, uiPermissionsByArea, uiPermissionsById, useradmApiUrl, useradmApiUrlv1, useradmApiUrlv2 } from "@northern.tech/utils/constants";
3
3
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/commonConstants.d.ts
@@ -116,5 +116,5 @@ declare const REPORT_CHART_SIZE_LIMIT = 6;
116
116
  //#region src/monitorSlice/constants.d.ts
117
117
  type AlertChannelKey = keyof typeof alertChannels;
118
118
  //#endregion
119
- export { ssoIdpApiUrlv1 as $, alertChannels as A, productOrder as At, emptyRole as B, SORTING_OPTIONS as C, TIMEOUTS as Ct, UiPermissionsByIdKey as D, credentialTypes as Dt, UiPermissionsByAreaKey as E, countries as Et, deploymentsApiUrl as F, iotManagerBaseURL as G, headerNames as H, deploymentsApiUrlV2 as I, monitorApiUrlv1 as J, limitDefault as K, deviceAuthV2 as L, apiUrl as M, auditLogsApiUrl as N, UiPermissionsDefinition as O, defaultIdAttribute as Ot, defaultPermissionSets as P, serviceProviderRolesById as Q, deviceConfig as R, Role as S, MAX_PAGE_SIZE as St, SortOptions as T, Webhook as Tt, inventoryApiUrl as U, emptyUiPermissions as V, inventoryApiUrlV2 as W, rolesByName as X, rolesById as Y, scopedPermissionAreas as Z, PermissionObject as _, DEVICE_LIST_MAXIMUM_LENGTH as _t, APPLICATION_JWT_CONTENT_TYPE as a, useradmApiUrl as at, PermissionTypes as b, FilterOperator as bt, AuditLogPermission as c, AlertChannelKey as ct, DEVICE_LIST_DEFAULTS as d, DEVICE_MESSAGE_PROTOCOLS as dt, tenantadmApiUrlv1 as et, DEVICE_STATES as f, DEVICE_MESSAGE_TYPES as ft, PaginationOptions as g, geoAttributes as gt, GroupsPermission as h, emptyFilter as ht, APPLICATION_JSON_CONTENT_TYPE as i, uiPermissionsById as it, apiRoot as j, timeUnits as jt, UserManagementPermission as k, emptyWebhook as kt, DEVICE_FILTERING_OPTIONS as l, DEVICE_CONNECT_STATES as lt, DeviceIssueOptionKey as m, REPORT_CHART_SIZE_LIMIT as mt, ALL_DEVICE_STATES as n, twoFAStates as nt, ATTRIBUTE_SCOPES as o, useradmApiUrlv1 as ot, DeploymentPermission as p, DeviceAuthState as pt, maxSessionAge as q, ALL_RELEASES as r, uiPermissionsByArea as rt, AnyPermission as s, useradmApiUrlv2 as st, ALL_DEVICES as t, tenantadmApiUrlv2 as tt, DEVICE_ISSUE_OPTIONS as u, DEVICE_DISMISSAL_STATE as ut, PermissionSet as v, DEVICE_ONLINE_CUTOFF as vt, ScopedPermissionsByAreaKey as w, UNGROUPED_GROUP as wt, ReleasesPermission as x, IdAttribute as xt, PermissionSetId as y, EXTERNAL_PROVIDER as yt, deviceConnect as z };
120
- //# sourceMappingURL=constants-MPLfugsi.d.cts.map
119
+ export { serviceProviderRolesById as $, alertChannels as A, emptyWebhook as At, deviceConnect as B, SORTING_OPTIONS as C, MAX_PAGE_SIZE as Ct, UiPermissionsByIdKey as D, countries as Dt, UiPermissionsByAreaKey as E, Webhook as Et, deploymentsApiUrl as F, inventoryApiUrlV2 as G, emptyUiPermissions as H, deploymentsApiUrlV1alpha1 as I, maxSessionAge as J, iotManagerBaseURL as K, deploymentsApiUrlV2 as L, apiUrl as M, timeUnits as Mt, auditLogsApiUrl as N, UiPermissionsDefinition as O, credentialTypes as Ot, defaultPermissionSets as P, scopedPermissionAreas as Q, deviceAuthV2 as R, Role as S, IdAttribute as St, SortOptions as T, UNGROUPED_GROUP as Tt, headerNames as U, emptyRole as V, inventoryApiUrl as W, rolesById as X, monitorApiUrlv1 as Y, rolesByName as Z, PermissionObject as _, geoAttributes as _t, APPLICATION_JWT_CONTENT_TYPE as a, uiPermissionsById as at, PermissionTypes as b, EXTERNAL_PROVIDER as bt, AuditLogPermission as c, useradmApiUrlv2 as ct, DEVICE_LIST_DEFAULTS as d, DEVICE_DISMISSAL_STATE as dt, ssoIdpApiUrlv1 as et, DEVICE_STATES as f, DEVICE_MESSAGE_PROTOCOLS as ft, PaginationOptions as g, emptyFilter as gt, GroupsPermission as h, REPORT_CHART_SIZE_LIMIT as ht, APPLICATION_JSON_CONTENT_TYPE as i, uiPermissionsByArea as it, apiRoot as j, productOrder as jt, UserManagementPermission as k, defaultIdAttribute as kt, DEVICE_FILTERING_OPTIONS as l, AlertChannelKey as lt, DeviceIssueOptionKey as m, DeviceAuthState as mt, ALL_DEVICE_STATES as n, tenantadmApiUrlv2 as nt, ATTRIBUTE_SCOPES as o, useradmApiUrl as ot, DeploymentPermission as p, DEVICE_MESSAGE_TYPES as pt, limitDefault as q, ALL_RELEASES as r, twoFAStates as rt, AnyPermission as s, useradmApiUrlv1 as st, ALL_DEVICES as t, tenantadmApiUrlv1 as tt, DEVICE_ISSUE_OPTIONS as u, DEVICE_CONNECT_STATES as ut, PermissionSet as v, DEVICE_LIST_MAXIMUM_LENGTH as vt, ScopedPermissionsByAreaKey as w, TIMEOUTS as wt, ReleasesPermission as x, FilterOperator as xt, PermissionSetId as y, DEVICE_ONLINE_CUTOFF as yt, deviceConfig as z };
120
+ //# sourceMappingURL=constants-BrGIx40B.d.cts.map
@@ -1,4 +1,4 @@
1
- import { ALL_DEVICES, ALL_DEVICE_STATES, ALL_RELEASES, APPLICATION_JSON_CONTENT_TYPE, APPLICATION_JWT_CONTENT_TYPE, ATTRIBUTE_SCOPES, AnyPermission, AuditLogPermission, DEVICE_FILTERING_OPTIONS, DEVICE_ISSUE_OPTIONS, DEVICE_LIST_DEFAULTS, DEVICE_STATES, DeploymentPermission, DeviceIssueOptionKey, GroupsPermission, PaginationOptions, PermissionObject, PermissionSet, PermissionSetId, PermissionTypes, ReleasesPermission, Role, SORTING_OPTIONS, ScopedPermissionsByAreaKey, SortOptions, UiPermissionsByAreaKey, UiPermissionsByIdKey, UiPermissionsDefinition, UserManagementPermission, alertChannels, apiRoot, apiUrl, auditLogsApiUrl, defaultPermissionSets, deploymentsApiUrl, deploymentsApiUrlV2, deviceAuthV2, deviceConfig, deviceConnect, emptyRole, emptyUiPermissions, headerNames, inventoryApiUrl, inventoryApiUrlV2, iotManagerBaseURL, limitDefault, maxSessionAge, monitorApiUrlv1, rolesById, rolesByName, scopedPermissionAreas, serviceProviderRolesById, ssoIdpApiUrlv1, tenantadmApiUrlv1, tenantadmApiUrlv2, twoFAStates, uiPermissionsByArea, uiPermissionsById, useradmApiUrl, useradmApiUrlv1, useradmApiUrlv2 } from "@northern.tech/utils/constants";
1
+ import { ALL_DEVICES, ALL_DEVICE_STATES, ALL_RELEASES, APPLICATION_JSON_CONTENT_TYPE, APPLICATION_JWT_CONTENT_TYPE, ATTRIBUTE_SCOPES, AnyPermission, AuditLogPermission, DEVICE_FILTERING_OPTIONS, DEVICE_ISSUE_OPTIONS, DEVICE_LIST_DEFAULTS, DEVICE_STATES, DeploymentPermission, DeviceIssueOptionKey, GroupsPermission, PaginationOptions, PermissionObject, PermissionSet, PermissionSetId, PermissionTypes, ReleasesPermission, Role, SORTING_OPTIONS, ScopedPermissionsByAreaKey, SortOptions, UiPermissionsByAreaKey, UiPermissionsByIdKey, UiPermissionsDefinition, UserManagementPermission, alertChannels, apiRoot, apiUrl, auditLogsApiUrl, defaultPermissionSets, deploymentsApiUrl, deploymentsApiUrlV1alpha1, deploymentsApiUrlV2, deviceAuthV2, deviceConfig, deviceConnect, emptyRole, emptyUiPermissions, headerNames, inventoryApiUrl, inventoryApiUrlV2, iotManagerBaseURL, limitDefault, maxSessionAge, monitorApiUrlv1, rolesById, rolesByName, scopedPermissionAreas, serviceProviderRolesById, ssoIdpApiUrlv1, tenantadmApiUrlv1, tenantadmApiUrlv2, twoFAStates, uiPermissionsByArea, uiPermissionsById, useradmApiUrl, useradmApiUrlv1, useradmApiUrlv2 } from "@northern.tech/utils/constants";
2
2
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
3
  import { Integration } from "@northern.tech/types/MenderTypes";
4
4
 
@@ -116,5 +116,5 @@ declare const REPORT_CHART_SIZE_LIMIT = 6;
116
116
  //#region src/monitorSlice/constants.d.ts
117
117
  type AlertChannelKey = keyof typeof alertChannels;
118
118
  //#endregion
119
- export { ssoIdpApiUrlv1 as $, alertChannels as A, productOrder as At, emptyRole as B, SORTING_OPTIONS as C, TIMEOUTS as Ct, UiPermissionsByIdKey as D, credentialTypes as Dt, UiPermissionsByAreaKey as E, countries as Et, deploymentsApiUrl as F, iotManagerBaseURL as G, headerNames as H, deploymentsApiUrlV2 as I, monitorApiUrlv1 as J, limitDefault as K, deviceAuthV2 as L, apiUrl as M, auditLogsApiUrl as N, UiPermissionsDefinition as O, defaultIdAttribute as Ot, defaultPermissionSets as P, serviceProviderRolesById as Q, deviceConfig as R, Role as S, MAX_PAGE_SIZE as St, SortOptions as T, Webhook as Tt, inventoryApiUrl as U, emptyUiPermissions as V, inventoryApiUrlV2 as W, rolesByName as X, rolesById as Y, scopedPermissionAreas as Z, PermissionObject as _, DEVICE_LIST_MAXIMUM_LENGTH as _t, APPLICATION_JWT_CONTENT_TYPE as a, useradmApiUrl as at, PermissionTypes as b, FilterOperator as bt, AuditLogPermission as c, AlertChannelKey as ct, DEVICE_LIST_DEFAULTS as d, DEVICE_MESSAGE_PROTOCOLS as dt, tenantadmApiUrlv1 as et, DEVICE_STATES as f, DEVICE_MESSAGE_TYPES as ft, PaginationOptions as g, geoAttributes as gt, GroupsPermission as h, emptyFilter as ht, APPLICATION_JSON_CONTENT_TYPE as i, uiPermissionsById as it, apiRoot as j, timeUnits as jt, UserManagementPermission as k, emptyWebhook as kt, DEVICE_FILTERING_OPTIONS as l, DEVICE_CONNECT_STATES as lt, DeviceIssueOptionKey as m, REPORT_CHART_SIZE_LIMIT as mt, ALL_DEVICE_STATES as n, twoFAStates as nt, ATTRIBUTE_SCOPES as o, useradmApiUrlv1 as ot, DeploymentPermission as p, DeviceAuthState as pt, maxSessionAge as q, ALL_RELEASES as r, uiPermissionsByArea as rt, AnyPermission as s, useradmApiUrlv2 as st, ALL_DEVICES as t, tenantadmApiUrlv2 as tt, DEVICE_ISSUE_OPTIONS as u, DEVICE_DISMISSAL_STATE as ut, PermissionSet as v, DEVICE_ONLINE_CUTOFF as vt, ScopedPermissionsByAreaKey as w, UNGROUPED_GROUP as wt, ReleasesPermission as x, IdAttribute as xt, PermissionSetId as y, EXTERNAL_PROVIDER as yt, deviceConnect as z };
120
- //# sourceMappingURL=constants-DrwXHsJ1.d.ts.map
119
+ export { serviceProviderRolesById as $, alertChannels as A, emptyWebhook as At, deviceConnect as B, SORTING_OPTIONS as C, MAX_PAGE_SIZE as Ct, UiPermissionsByIdKey as D, countries as Dt, UiPermissionsByAreaKey as E, Webhook as Et, deploymentsApiUrl as F, inventoryApiUrlV2 as G, emptyUiPermissions as H, deploymentsApiUrlV1alpha1 as I, maxSessionAge as J, iotManagerBaseURL as K, deploymentsApiUrlV2 as L, apiUrl as M, timeUnits as Mt, auditLogsApiUrl as N, UiPermissionsDefinition as O, credentialTypes as Ot, defaultPermissionSets as P, scopedPermissionAreas as Q, deviceAuthV2 as R, Role as S, IdAttribute as St, SortOptions as T, UNGROUPED_GROUP as Tt, headerNames as U, emptyRole as V, inventoryApiUrl as W, rolesById as X, monitorApiUrlv1 as Y, rolesByName as Z, PermissionObject as _, geoAttributes as _t, APPLICATION_JWT_CONTENT_TYPE as a, uiPermissionsById as at, PermissionTypes as b, EXTERNAL_PROVIDER as bt, AuditLogPermission as c, useradmApiUrlv2 as ct, DEVICE_LIST_DEFAULTS as d, DEVICE_DISMISSAL_STATE as dt, ssoIdpApiUrlv1 as et, DEVICE_STATES as f, DEVICE_MESSAGE_PROTOCOLS as ft, PaginationOptions as g, emptyFilter as gt, GroupsPermission as h, REPORT_CHART_SIZE_LIMIT as ht, APPLICATION_JSON_CONTENT_TYPE as i, uiPermissionsByArea as it, apiRoot as j, productOrder as jt, UserManagementPermission as k, defaultIdAttribute as kt, DEVICE_FILTERING_OPTIONS as l, AlertChannelKey as lt, DeviceIssueOptionKey as m, DeviceAuthState as mt, ALL_DEVICE_STATES as n, tenantadmApiUrlv2 as nt, ATTRIBUTE_SCOPES as o, useradmApiUrl as ot, DeploymentPermission as p, DEVICE_MESSAGE_TYPES as pt, limitDefault as q, ALL_RELEASES as r, twoFAStates as rt, AnyPermission as s, useradmApiUrlv1 as st, ALL_DEVICES as t, tenantadmApiUrlv1 as tt, DEVICE_ISSUE_OPTIONS as u, DEVICE_CONNECT_STATES as ut, PermissionSet as v, DEVICE_LIST_MAXIMUM_LENGTH as vt, ScopedPermissionsByAreaKey as w, TIMEOUTS as wt, ReleasesPermission as x, FilterOperator as xt, PermissionSetId as y, DEVICE_ONLINE_CUTOFF as yt, deviceConfig as z };
120
+ //# sourceMappingURL=constants-CjO3_FOH.d.ts.map
@@ -738,6 +738,7 @@ exports.deploymentStatesToSubstates = deploymentStatesToSubstates;
738
738
  exports.deploymentStatesToSubstatesWithSkipped = deploymentStatesToSubstatesWithSkipped;
739
739
  exports.deploymentSubstates = deploymentSubstates;
740
740
  exports.deploymentsApiUrl = _northern_tech_utils_constants.deploymentsApiUrl;
741
+ exports.deploymentsApiUrlV1alpha1 = _northern_tech_utils_constants.deploymentsApiUrlV1alpha1;
741
742
  exports.deploymentsApiUrlV2 = _northern_tech_utils_constants.deploymentsApiUrlV2;
742
743
  exports.deviceAuthV2 = _northern_tech_utils_constants.deviceAuthV2;
743
744
  exports.deviceConfig = _northern_tech_utils_constants.deviceConfig;