@northern.tech/store 0.1.3 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/dist/actions.js +251 -135
  2. package/dist/actions.js.map +1 -1
  3. package/dist/actions.mjs +13 -13
  4. package/dist/api/general-api.js +102 -51
  5. package/dist/api/general-api.js.map +1 -1
  6. package/dist/api/general-api.mjs +6 -6
  7. package/dist/api/users-api.js +104 -66
  8. package/dist/api/users-api.js.map +1 -1
  9. package/dist/api/users-api.mjs +7 -7
  10. package/dist/appSlice/constants.js +1 -39
  11. package/dist/appSlice/constants.js.map +1 -1
  12. package/dist/appSlice/constants.mjs +2 -2
  13. package/dist/appSlice/index.js +111 -64
  14. package/dist/appSlice/index.js.map +1 -1
  15. package/dist/appSlice/index.mjs +5 -5
  16. package/dist/appSlice/selectors.js +1 -43
  17. package/dist/appSlice/selectors.js.map +1 -1
  18. package/dist/appSlice/selectors.mjs +2 -2
  19. package/dist/appSlice/thunks.js +649 -552
  20. package/dist/appSlice/thunks.js.map +1 -1
  21. package/dist/appSlice/thunks.mjs +28 -28
  22. package/dist/auth.js +99 -51
  23. package/dist/auth.js.map +1 -1
  24. package/dist/auth.mjs +5 -5
  25. package/dist/{chunk-C2YZYTJ6.mjs → chunk-2Z3RFYW4.mjs} +2 -11
  26. package/dist/{chunk-C2YZYTJ6.mjs.map → chunk-2Z3RFYW4.mjs.map} +1 -1
  27. package/dist/{chunk-F37LUTBX.mjs → chunk-3ORTTLIB.mjs} +19 -16
  28. package/dist/{chunk-F37LUTBX.mjs.map → chunk-3ORTTLIB.mjs.map} +1 -1
  29. package/dist/{chunk-7E7KJHY3.mjs → chunk-4SDUITD4.mjs} +6 -12
  30. package/dist/{chunk-7E7KJHY3.mjs.map → chunk-4SDUITD4.mjs.map} +1 -1
  31. package/dist/{chunk-BOSBROA3.mjs → chunk-5VNQCCAQ.mjs} +2 -7
  32. package/dist/{chunk-BOSBROA3.mjs.map → chunk-5VNQCCAQ.mjs.map} +1 -1
  33. package/dist/{chunk-R2GBNXLV.mjs → chunk-65YIOCCD.mjs} +6 -11
  34. package/dist/{chunk-R2GBNXLV.mjs.map → chunk-65YIOCCD.mjs.map} +1 -1
  35. package/dist/{chunk-ZIYGEXSJ.mjs → chunk-6CSGHZ3E.mjs} +9 -21
  36. package/dist/{chunk-ZIYGEXSJ.mjs.map → chunk-6CSGHZ3E.mjs.map} +1 -1
  37. package/dist/{chunk-HRWZJQMH.mjs → chunk-AZRVRNXT.mjs} +40 -30
  38. package/dist/{chunk-HRWZJQMH.mjs.map → chunk-AZRVRNXT.mjs.map} +1 -1
  39. package/dist/{chunk-M4U5R7A4.mjs → chunk-B42NUKMZ.mjs} +2 -6
  40. package/dist/{chunk-M4U5R7A4.mjs.map → chunk-B42NUKMZ.mjs.map} +1 -1
  41. package/dist/{chunk-DZBVTSIX.mjs → chunk-CHUCIHMY.mjs} +3 -4
  42. package/dist/{chunk-DZBVTSIX.mjs.map → chunk-CHUCIHMY.mjs.map} +1 -1
  43. package/dist/{chunk-YNVSU3AA.mjs → chunk-DIZJVB6M.mjs} +307 -292
  44. package/dist/chunk-DIZJVB6M.mjs.map +1 -0
  45. package/dist/chunk-H5UCKQWK.mjs +41 -0
  46. package/dist/{chunk-IPPIKGIB.mjs.map → chunk-H5UCKQWK.mjs.map} +1 -1
  47. package/dist/{chunk-ZNST5R6O.mjs → chunk-IFWKT27G.mjs} +92 -29
  48. package/dist/chunk-IFWKT27G.mjs.map +1 -0
  49. package/dist/{chunk-6667TCAJ.mjs → chunk-JA27QXVB.mjs} +37 -28
  50. package/dist/{chunk-6667TCAJ.mjs.map → chunk-JA27QXVB.mjs.map} +1 -1
  51. package/dist/{chunk-HVHZG2H4.mjs → chunk-K2NZL5V4.mjs} +4 -7
  52. package/dist/chunk-K2NZL5V4.mjs.map +1 -0
  53. package/dist/{chunk-RQOE5OOT.mjs → chunk-KJAZNKV2.mjs} +66 -55
  54. package/dist/chunk-KJAZNKV2.mjs.map +1 -0
  55. package/dist/{chunk-G32LAKW4.mjs → chunk-KPPU6OWF.mjs} +27 -39
  56. package/dist/{chunk-G32LAKW4.mjs.map → chunk-KPPU6OWF.mjs.map} +1 -1
  57. package/dist/{chunk-BJSH2G7W.mjs → chunk-KZSTW27Q.mjs} +30 -18
  58. package/dist/{chunk-BJSH2G7W.mjs.map → chunk-KZSTW27Q.mjs.map} +1 -1
  59. package/dist/chunk-LZOMFHX3.mjs +38 -0
  60. package/dist/{chunk-XYVPYFSM.mjs → chunk-NJNSCJEY.mjs} +22 -26
  61. package/dist/{chunk-XYVPYFSM.mjs.map → chunk-NJNSCJEY.mjs.map} +1 -1
  62. package/dist/{chunk-N7G6QK2E.mjs → chunk-O6TYYKSD.mjs} +62 -60
  63. package/dist/chunk-O6TYYKSD.mjs.map +1 -0
  64. package/dist/{chunk-G3I53JGW.mjs → chunk-QQBUNZHA.mjs} +3 -6
  65. package/dist/{chunk-G3I53JGW.mjs.map → chunk-QQBUNZHA.mjs.map} +1 -1
  66. package/dist/{chunk-TD45YTYK.mjs → chunk-R7LXL3KJ.mjs} +22 -23
  67. package/dist/chunk-R7LXL3KJ.mjs.map +1 -0
  68. package/dist/{chunk-G7LATUT6.mjs → chunk-WCUGLHYM.mjs} +16 -20
  69. package/dist/{chunk-G7LATUT6.mjs.map → chunk-WCUGLHYM.mjs.map} +1 -1
  70. package/dist/chunk-WYHJFSMQ.mjs +25 -0
  71. package/dist/{chunk-IVSYYXTC.mjs.map → chunk-WYHJFSMQ.mjs.map} +1 -1
  72. package/dist/{chunk-O6O3D52B.mjs → chunk-XC5UXEIB.mjs} +4 -11
  73. package/dist/{chunk-O6O3D52B.mjs.map → chunk-XC5UXEIB.mjs.map} +1 -1
  74. package/dist/{chunk-BRHSKNFC.mjs → chunk-XD7INCM4.mjs} +11 -17
  75. package/dist/{chunk-BRHSKNFC.mjs.map → chunk-XD7INCM4.mjs.map} +1 -1
  76. package/dist/{chunk-RH6ONMG7.mjs → chunk-ZE7R2XXE.mjs} +10 -12
  77. package/dist/{chunk-RH6ONMG7.mjs.map → chunk-ZE7R2XXE.mjs.map} +1 -1
  78. package/dist/{chunk-HXPYJ6QN.mjs → chunk-ZK4W5T53.mjs} +7 -11
  79. package/dist/{chunk-HXPYJ6QN.mjs.map → chunk-ZK4W5T53.mjs.map} +1 -1
  80. package/dist/commonConstants.d.mts +18 -19
  81. package/dist/commonConstants.d.ts +18 -19
  82. package/dist/commonConstants.js +2 -35
  83. package/dist/commonConstants.js.map +1 -1
  84. package/dist/commonConstants.mjs +2 -2
  85. package/dist/commonSelectors.d.mts +42 -1
  86. package/dist/commonSelectors.d.ts +42 -1
  87. package/dist/commonSelectors.js +149 -129
  88. package/dist/commonSelectors.js.map +1 -1
  89. package/dist/commonSelectors.mjs +14 -12
  90. package/dist/constants.d.mts +3 -3
  91. package/dist/constants.d.ts +3 -3
  92. package/dist/constants.js +92 -147
  93. package/dist/constants.js.map +1 -1
  94. package/dist/constants.mjs +18 -14
  95. package/dist/deploymentsSlice/constants.js +94 -55
  96. package/dist/deploymentsSlice/constants.js.map +1 -1
  97. package/dist/deploymentsSlice/constants.mjs +4 -4
  98. package/dist/deploymentsSlice/index.js +128 -75
  99. package/dist/deploymentsSlice/index.js.map +1 -1
  100. package/dist/deploymentsSlice/index.mjs +5 -5
  101. package/dist/deploymentsSlice/selectors.js +95 -48
  102. package/dist/deploymentsSlice/selectors.js.map +1 -1
  103. package/dist/deploymentsSlice/selectors.mjs +5 -5
  104. package/dist/deploymentsSlice/thunks.js +649 -561
  105. package/dist/deploymentsSlice/thunks.js.map +1 -1
  106. package/dist/deploymentsSlice/thunks.mjs +28 -28
  107. package/dist/devicesSlice/constants.js +94 -54
  108. package/dist/devicesSlice/constants.js.map +1 -1
  109. package/dist/devicesSlice/constants.mjs +4 -4
  110. package/dist/devicesSlice/index.js +131 -77
  111. package/dist/devicesSlice/index.js.map +1 -1
  112. package/dist/devicesSlice/index.mjs +5 -5
  113. package/dist/devicesSlice/selectors.js +100 -85
  114. package/dist/devicesSlice/selectors.js.map +1 -1
  115. package/dist/devicesSlice/selectors.mjs +5 -5
  116. package/dist/devicesSlice/thunks.js +649 -597
  117. package/dist/devicesSlice/thunks.js.map +1 -1
  118. package/dist/devicesSlice/thunks.mjs +28 -28
  119. package/dist/monitorSlice/constants.js +94 -41
  120. package/dist/monitorSlice/constants.js.map +1 -1
  121. package/dist/monitorSlice/constants.mjs +4 -4
  122. package/dist/monitorSlice/index.js +101 -48
  123. package/dist/monitorSlice/index.js.map +1 -1
  124. package/dist/monitorSlice/index.mjs +5 -5
  125. package/dist/monitorSlice/selectors.js +0 -4
  126. package/dist/monitorSlice/selectors.mjs +1 -1
  127. package/dist/monitorSlice/thunks.js +333 -238
  128. package/dist/monitorSlice/thunks.js.map +1 -1
  129. package/dist/monitorSlice/thunks.mjs +25 -25
  130. package/dist/onboardingSlice/constants.js +0 -5
  131. package/dist/onboardingSlice/constants.mjs +1 -1
  132. package/dist/onboardingSlice/index.js +1 -22
  133. package/dist/onboardingSlice/index.js.map +1 -1
  134. package/dist/onboardingSlice/index.mjs +2 -2
  135. package/dist/onboardingSlice/selectors.js +0 -4
  136. package/dist/onboardingSlice/selectors.mjs +1 -1
  137. package/dist/onboardingSlice/thunks.js +649 -555
  138. package/dist/onboardingSlice/thunks.js.map +1 -1
  139. package/dist/onboardingSlice/thunks.mjs +28 -28
  140. package/dist/organizationSlice/constants.d.mts +6 -1
  141. package/dist/organizationSlice/constants.d.ts +6 -1
  142. package/dist/organizationSlice/constants.js +89 -51
  143. package/dist/organizationSlice/constants.js.map +1 -1
  144. package/dist/organizationSlice/constants.mjs +6 -4
  145. package/dist/organizationSlice/index.d.mts +224 -246
  146. package/dist/organizationSlice/index.d.ts +224 -246
  147. package/dist/organizationSlice/index.js +113 -59
  148. package/dist/organizationSlice/index.js.map +1 -1
  149. package/dist/organizationSlice/index.mjs +5 -5
  150. package/dist/organizationSlice/selectors.js +96 -58
  151. package/dist/organizationSlice/selectors.js.map +1 -1
  152. package/dist/organizationSlice/selectors.mjs +5 -5
  153. package/dist/organizationSlice/thunks.js +649 -580
  154. package/dist/organizationSlice/thunks.js.map +1 -1
  155. package/dist/organizationSlice/thunks.mjs +28 -28
  156. package/dist/releasesSlice/constants.js +0 -7
  157. package/dist/releasesSlice/constants.mjs +1 -1
  158. package/dist/releasesSlice/index.js +98 -60
  159. package/dist/releasesSlice/index.js.map +1 -1
  160. package/dist/releasesSlice/index.mjs +5 -5
  161. package/dist/releasesSlice/selectors.js +97 -53
  162. package/dist/releasesSlice/selectors.js.map +1 -1
  163. package/dist/releasesSlice/selectors.mjs +6 -6
  164. package/dist/releasesSlice/thunks.js +377 -287
  165. package/dist/releasesSlice/thunks.js.map +1 -1
  166. package/dist/releasesSlice/thunks.mjs +25 -25
  167. package/dist/selectors.d.mts +1 -1
  168. package/dist/selectors.d.ts +1 -1
  169. package/dist/selectors.js +150 -202
  170. package/dist/selectors.js.map +1 -1
  171. package/dist/selectors.mjs +45 -43
  172. package/dist/store.d.mts +235 -135
  173. package/dist/store.d.ts +235 -135
  174. package/dist/store.js +262 -157
  175. package/dist/store.js.map +1 -1
  176. package/dist/store.mjs +16 -16
  177. package/dist/storehooks.d.mts +3 -1
  178. package/dist/storehooks.d.ts +3 -1
  179. package/dist/storehooks.js +686 -569
  180. package/dist/storehooks.js.map +1 -1
  181. package/dist/storehooks.mjs +71 -54
  182. package/dist/storehooks.mjs.map +1 -1
  183. package/dist/thunks.js +649 -710
  184. package/dist/thunks.js.map +1 -1
  185. package/dist/thunks.mjs +28 -28
  186. package/dist/usersSlice/constants.d.mts +192 -17
  187. package/dist/usersSlice/constants.d.ts +192 -17
  188. package/dist/usersSlice/constants.js +97 -61
  189. package/dist/usersSlice/constants.js.map +1 -1
  190. package/dist/usersSlice/constants.mjs +6 -4
  191. package/dist/usersSlice/index.d.mts +1628 -704
  192. package/dist/usersSlice/index.d.ts +1628 -704
  193. package/dist/usersSlice/index.js +122 -67
  194. package/dist/usersSlice/index.js.map +1 -1
  195. package/dist/usersSlice/index.mjs +5 -5
  196. package/dist/usersSlice/selectors.js +101 -62
  197. package/dist/usersSlice/selectors.js.map +1 -1
  198. package/dist/usersSlice/selectors.mjs +6 -6
  199. package/dist/usersSlice/thunks.js +649 -584
  200. package/dist/usersSlice/thunks.js.map +1 -1
  201. package/dist/usersSlice/thunks.mjs +28 -28
  202. package/dist/utils.d.mts +6 -5
  203. package/dist/utils.d.ts +6 -5
  204. package/dist/utils.js +117 -89
  205. package/dist/utils.js.map +1 -1
  206. package/dist/utils.mjs +5 -5
  207. package/package.json +66 -1
  208. package/dist/chunk-HVHZG2H4.mjs.map +0 -1
  209. package/dist/chunk-IPPIKGIB.mjs +0 -35
  210. package/dist/chunk-IVSYYXTC.mjs +0 -36
  211. package/dist/chunk-N7G6QK2E.mjs.map +0 -1
  212. package/dist/chunk-RQOE5OOT.mjs.map +0 -1
  213. package/dist/chunk-TD45YTYK.mjs.map +0 -1
  214. package/dist/chunk-XWBD7VOK.mjs +0 -93
  215. package/dist/chunk-YNVSU3AA.mjs.map +0 -1
  216. package/dist/chunk-ZNST5R6O.mjs.map +0 -1
  217. /package/dist/{chunk-XWBD7VOK.mjs.map → chunk-LZOMFHX3.mjs.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/commonSelectors.ts","../src/appSlice/constants.ts","../src/appSlice/selectors.ts","../src/commonConstants.tsx","../src/deploymentsSlice/selectors.ts","../src/devicesSlice/constants.ts","../src/monitorSlice/constants.ts","../src/onboardingSlice/constants.ts","../src/organizationSlice/constants.ts","../src/releasesSlice/constants.ts","../src/usersSlice/constants.ts","../src/deploymentsSlice/constants.ts","../src/devicesSlice/selectors.ts","../src/monitorSlice/selectors.ts","../src/onboardingSlice/selectors.ts","../src/organizationSlice/selectors.ts","../src/utils.ts","../src/releasesSlice/selectors.ts","../src/usersSlice/selectors.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.\n// @ts-nocheck\nimport { attributeDuplicateFilter, getDemoDeviceAddress as getDemoDeviceAddressHelper } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport { PLANS, defaultReports } from './appSlice/constants';\nimport { getFeatures, getSearchedDevices } from './appSlice/selectors';\nimport { ALL_DEVICES, ATTRIBUTE_SCOPES, DEVICE_ISSUE_OPTIONS, DEVICE_LIST_MAXIMUM_LENGTH, UNGROUPED_GROUP } from './commonConstants';\nimport { getDeploymentsById, getDeploymentsSelectionState, getSelectedDeploymentDeviceIds } from './deploymentsSlice/selectors';\nimport { inventoryApiUrlV2, reportingApiUrl } from './devicesSlice/constants';\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 { rolesByName, uiPermissionsById } from './usersSlice/constants';\nimport { getCurrentUser, getGlobalSettings, getRolesById, getUserSettings } 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 getAttrsEndpoint = createSelector([getFeatures], ({ hasReporting }) =>\n hasReporting ? `${reportingApiUrl}/devices/search/attributes` : `${inventoryApiUrlV2}/filters/attributes`\n);\nexport const getSearchEndpoint = createSelector([getFeatures], ({ hasReporting }) =>\n hasReporting ? `${reportingApiUrl}/devices/search` : `${inventoryApiUrlV2}/filters/search`\n);\n\nexport const getUserRoles = createSelector(\n [getCurrentUser, getRolesById, getIsEnterprise, getFeatures, getOrganization],\n (currentUser, rolesById, isEnterprise, { isHosted, hasMultitenancy }, { plan = PLANS.os.id }) => {\n const isAdmin = currentUser.roles?.length\n ? currentUser.roles.some(role => role === rolesByName.admin)\n : !(hasMultitenancy || isEnterprise || (isHosted && plan !== PLANS.os.id));\n const uiPermissions = isAdmin\n ? mapUserRolesToUiPermissions([rolesByName.admin], rolesById)\n : mapUserRolesToUiPermissions(currentUser.roles || [], rolesById);\n return { isAdmin, uiPermissions };\n }\n);\n\nconst hasPermission = (thing, permission) => 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 = uiPermissions.deployments.includes(uiPermissionsById.deploy.value) || hasPermission(uiPermissions.groups, uiPermissionsById.deploy.value);\n const canReadDeployments = uiPermissions.deployments.includes(uiPermissionsById.read.value);\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 { hasAuditlogs: isAuditlogEnabled, hasDeviceConfig: isDeviceConfigEnabled, hasDeviceConnect: isDeviceConnectEnabled, hasMonitor: isMonitorEnabled },\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 = isDeviceConfigEnabled && addons.some(addon => addon.name === 'configure' && Boolean(addon.enabled));\n const hasDeviceConnect = isDeviceConnectEnabled && (!isEnterprise || addons.some(addon => addon.name === 'troubleshoot' && Boolean(addon.enabled)));\n const hasMonitor = isMonitorEnabled && addons.some(addon => addon.name === 'monitor' && Boolean(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;\n return {\n deployment,\n selectedDevices: selectedDeviceIds.map(deviceId => ({ ...devicesById[deviceId], ...devices[deviceId] }))\n };\n }\n);\n\nexport const getAvailableIssueOptionsByType = createSelector(\n [getFeatures, getTenantCapabilities, getIssueCountsByType],\n ({ hasReporting }, { hasFullFiltering, hasMonitor }, issueCounts) =>\n Object.values(DEVICE_ISSUE_OPTIONS).reduce((accu, { isCategory, key, needsFullFiltering, needsMonitor, needsReporting, title }) => {\n if (isCategory || (needsReporting && !hasReporting) || (needsFullFiltering && !hasFullFiltering) || (needsMonitor && !hasMonitor)) {\n return accu;\n }\n accu[key] = { count: issueCounts[key].filtered, key, title };\n return accu;\n }, {})\n);\n\nexport const getGroupNames = createSelector([getGroupsById, getUserRoles, (_, options = {}) => options], (groupsById, { uiPermissions }, { staticOnly }) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [UNGROUPED_GROUP.id]: ungrouped, ...groups } = groupsById;\n if (staticOnly) {\n return Object.keys(uiPermissions.groups).sort();\n }\n return Object.keys(\n Object.entries(groups).reduce((accu, [groupName, group]) => {\n if (group.filterId || uiPermissions.groups[ALL_DEVICES]) {\n accu[groupName] = group;\n }\n return accu;\n }, uiPermissions.groups)\n ).sort();\n});\n\nexport const getDeviceReportsForUser = createSelector(\n [getUserSettings, getCurrentUser, getGlobalSettings, getDevicesById],\n ({ reports }, { id: currentUserId }, globalSettings, devicesById) => {\n return reports || globalSettings[`${currentUserId}-reports`] || (Object.keys(devicesById).length ? defaultReports : []);\n }\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 = {};\n if (auditlogEvent) {\n const { object = {} } = auditlogEvent;\n const { device = {}, id, type } = object;\n auditlogDevice = type === 'device' ? { id, ...device } : auditlogDevice;\n }\n return { ...auditlogDevice, ...devicesById[auditlogDevice.id] };\n});\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { BarChart as BarChartIcon, PieChartOutline as PieChartIcon } from '@mui/icons-material';\n\nconst startingDeviceCount = {\n os: 'for first 50 devices',\n professional: 'for first 250 devices'\n};\n\nexport const apiRoot = '/api/management';\nexport const apiUrl = {\n v1: `${apiRoot}/v1`,\n v2: `${apiRoot}/v2`\n};\n\nexport const headerNames = {\n link: 'link',\n location: 'location',\n total: 'x-total-count'\n};\n\nexport const chartTypes = {\n bar: { key: 'bar', Icon: BarChartIcon },\n pie: { key: 'pie', Icon: PieChartIcon }\n};\nexport const emptyChartSelection = { software: '', group: '', chartType: chartTypes.bar.key, attribute: 'artifact_name' };\nexport const defaultReportType = 'distribution';\nexport const defaultReports = [{ ...emptyChartSelection, group: null, attribute: 'artifact_name', type: defaultReportType }];\n\nexport const BEGINNING_OF_TIME = '2016-01-01T00:00:00.000Z';\n\nexport const locations = {};\n\nexport const PLANS = {\n os: {\n id: 'os',\n name: 'Basic',\n offer: true,\n price: '$32/month',\n deviceCount: startingDeviceCount.os,\n offerprice: '$23/month for first 50 devices',\n price2: 'for first 6 months;\\n$29/month thereafter',\n features: ['Basic OTA features']\n },\n professional: {\n id: 'professional',\n name: 'Professional',\n offer: true,\n price: '$269/month',\n deviceCount: startingDeviceCount.professional,\n offerprice: '$200/month for first 50 devices',\n price2: 'for first 6 months;\\n$249/month thereafter',\n features: ['+ Advanced OTA features', '+ Standard support']\n },\n enterprise: {\n id: 'enterprise',\n name: 'Enterprise',\n price: 'Custom pricing',\n deviceCount: 'unlimited devices',\n features: ['+ Enterprise-grade OTA features', '+ Premium support']\n }\n};\n// the needs names need to be aligned with the name of the features in the appReducer, as they will be checked in the addonselection\nexport const ADDONS = {\n configure: {\n id: 'configure',\n title: 'Configure',\n description: 'Expand your plan with device configuration features',\n needs: ['hasDeviceConfig'],\n os: {\n price: '$11/month',\n deviceCount: startingDeviceCount.os\n },\n professional: {\n price: '$65/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['os', 'professional', 'enterprise']\n },\n troubleshoot: {\n id: 'troubleshoot',\n title: 'Troubleshoot',\n description: 'Expand your plan with device troubleshooting features',\n needs: ['hasDeviceConnect'],\n os: {\n price: '$27/month',\n deviceCount: startingDeviceCount.os\n },\n professional: {\n price: '$72/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['os', 'professional', 'enterprise']\n },\n monitor: {\n id: 'monitor',\n title: 'Monitor',\n description: 'Expand your plan with device monitoring features',\n needs: ['hasMonitor'],\n os: {\n price: '-',\n deviceCount: '-'\n },\n professional: {\n price: '$86/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['professional', 'enterprise']\n }\n};\n\nexport const BENEFITS = {\n auditlog: { id: 'auditlog', benefit: 'trace change across your devices and access troubleshooting session replay', requiredPlan: PLANS.professional.id },\n dashboard: { id: 'dashboard', benefit: 'actionable insights into the devices you are updating with Mender', requiredPlan: PLANS.enterprise.id },\n deltaGeneration: {\n id: 'deltaGeneration',\n benefit: 'automatic delta artifacts generation to minimize data transfer and improve the update delivery',\n requiredPlan: PLANS.enterprise.id\n },\n deviceConfiguration: { id: 'deviceConfiguration', benefit: 'device configuration features', requiredAddon: ADDONS.configure.id },\n deviceMonitor: { id: 'deviceMonitor', benefit: 'device monitoring features', requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },\n deviceTroubleshoot: { id: 'deviceTroubleshoot', benefit: 'device troubleshooting features', requiredAddon: ADDONS.troubleshoot.id },\n dynamicGroups: { id: 'dynamicGroups', benefit: 'create dynamic groups to ease device management', requiredPlan: PLANS.enterprise.id },\n fullFiltering: { id: 'fullFiltering', benefit: 'filtering by multiple attributes to improve the device overview', requiredPlan: PLANS.professional.id },\n gateway: { id: 'gateway', benefit: 'see devices connected to your gateway device for easy access', requiredPlans: PLANS.professional.id },\n pausedDeployments: {\n id: 'pausedDeployments',\n benefit: 'granular control about update rollout to allow synchronization across your fleet',\n requiredPlan: PLANS.enterprise.id\n },\n phasedDeployments: { id: 'phasedDeployments', benefit: 'choose to roll out deployments in multiple phases', requiredPlan: PLANS.enterprise.id },\n rbac: { id: 'rbac', benefit: 'granular role based access control', requiredPlan: PLANS.enterprise.id },\n retryDeployments: { id: 'retryDeployments', benefit: 'optional retries for failed rollout attempts', requiredPlan: PLANS.professional.id },\n scheduledDeployments: {\n id: 'scheduledDeployments',\n benefit: 'scheduled deployments to steer the distribution of your updates.',\n requiredPlan: PLANS.professional.id\n },\n webhookEvents: {\n id: 'webhookEvents',\n benefit: 'receive inventory events and select which type(s) of events the webhook will receive',\n requiredPlan: PLANS.professional.id\n },\n\n default: { id: 'default', benefit: 'gain access to this feature', requiredPlan: PLANS.enterprise.id }\n};\n\nexport const yes = () => true;\nexport const canAccess = yes;\n\nexport const DARK_MODE = 'dark';\nexport const LIGHT_MODE = 'light';\n\nexport const APPLICATION_JSON_CONTENT_TYPE = 'application/json';\nexport const APPLICATION_JWT_CONTENT_TYPE = 'application/jwt';\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { versionCompare } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\n\nconst getAppDocsVersion = state => state.app.docsVersion;\nexport const getFeatures = state => state.app.features;\nexport const getFullVersionInformation = state => state.app.versionInformation;\n\nexport const getDocsVersion = createSelector([getAppDocsVersion, getFeatures], (appDocsVersion, { isHosted }) => {\n // if hosted, use latest docs version\n const docsVersion = appDocsVersion ? `${appDocsVersion}/` : 'development/';\n return isHosted ? '' : docsVersion;\n});\n\nexport const getSearchState = state => state.app.searchState;\n\nexport const getSearchedDevices = createSelector([getSearchState], ({ deviceIds }) => deviceIds);\nexport const getVersionInformation = createSelector([getFullVersionInformation, getFeatures], ({ Integration, ...remainder }, { isHosted }) =>\n isHosted && Integration !== 'next' ? remainder : { ...remainder, Integration }\n);\nexport const getIsPreview = createSelector([getFullVersionInformation], ({ Integration }) => versionCompare(Integration, 'next') > -1);\n","// 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.\n// @ts-nocheck\nimport React from 'react';\n\nimport { mdiAws as AWS, mdiMicrosoftAzure as Azure } from '@mdi/js';\n\nexport const DEVICE_LIST_DEFAULTS = {\n page: 1,\n perPage: 20\n};\n\nexport const timeUnits = {\n days: 'days',\n minutes: 'minutes',\n hours: 'hours'\n};\n\nexport const ALL_DEVICES = 'All devices';\nexport const UNGROUPED_GROUP = { id: '*|=ungrouped=|*', name: 'Unassigned' };\n\nexport const DEVICE_LIST_MAXIMUM_LENGTH = 50;\n\nexport const DEVICE_FILTERING_OPTIONS = {\n $eq: { key: '$eq', title: 'equals', shortform: '=' },\n $ne: { key: '$ne', title: 'not equal', shortform: '!=' },\n $gt: {\n key: '$gt',\n title: '>',\n shortform: '>',\n help: 'The \"greater than\" operator can work both on numbers and strings. In the latter case, the operator applies the lexicographical order to the value strings.'\n },\n $gte: {\n title: '>=',\n shortform: '>=',\n help: 'The \"greater than or equal\" operator can work both on numbers and strings. In the latter case, the operator applies the lexicographical order to the value strings.'\n },\n $lt: {\n key: '$lt',\n title: '<',\n shortform: '<',\n help: 'The \"lesser than\" operator can work both on numbers and strings. In the latter case, the operator applies the lexicographical order to the value strings.'\n },\n $lte: {\n title: '<=',\n shortform: '<=',\n help: 'The \"lesser than or equal\" operator can work both on numbers and strings. In the latter case, the operator applies the lexicographical order to the value strings.'\n },\n $ltne: {\n key: '$ltne',\n title: '$ltne',\n shortform: 'ltne',\n help: 'The \"lesser than or does not exist\" operator can work both on numbers and strings. In the latter case, the operator applies the lexicographical order to the value strings.'\n },\n $in: {\n key: '$in',\n title: 'in',\n shortform: 'in',\n help: 'The \"in\" operator accepts a list of comma-separated values. It matches if the selected field is equal to one of the specified values.'\n },\n $nin: {\n key: '$nin',\n title: 'not in',\n shortform: 'not in',\n help: `The \"not in\" operator accepts a list of comma-separated values. It matches if the selected field's value is not equal to any of the specified options.`\n },\n $exists: {\n key: '$exists',\n title: 'exists',\n shortform: 'exists',\n value: true,\n help: `The \"exists\" operator matches if the selected field's value has a value. No value needs to be provided for this operator.`\n },\n $nexists: {\n key: '$nexists',\n title: `doesn't exist`,\n shortform: `doesn't exist`,\n value: true,\n help: `The \"doesn't exist\" operator matches if the selected field's value has no value. No value needs to be provided for this operator.`\n },\n $regex: {\n key: '$regex',\n title: `matches regular expression`,\n shortform: `matches`,\n help: `The \"regular expression\" operator matches the selected field's value with a Perl compatible regular expression (PCRE), automatically anchored by ^. If the regular expression is not valid, the filter will produce no results. If you need to specify options and flags, you can provide the full regex in the format of /regex/flags, for example.`\n }\n};\n\nexport const DEVICE_ISSUE_OPTIONS = {\n issues: {\n isCategory: true,\n key: 'issues',\n title: 'Devices with issues',\n filterRule: {}\n },\n offline: {\n issueCategory: 'issues',\n key: 'offline',\n needsFullFiltering: true,\n needsMonitor: false,\n needsReporting: false,\n filterRule: {\n scope: 'system',\n key: 'check_in_time',\n operator: DEVICE_FILTERING_OPTIONS.$ltne.key,\n value: ({ offlineThreshold }) => offlineThreshold\n },\n title: 'Offline devices'\n },\n failedLastUpdate: {\n issueCategory: 'issues',\n key: 'failedLastUpdate',\n needsFullFiltering: false,\n needsMonitor: false,\n needsReporting: true,\n filterRule: { scope: 'monitor', key: 'failed_last_update', operator: DEVICE_FILTERING_OPTIONS.$eq.key, value: true },\n title: 'Deployment failed'\n },\n monitoring: {\n issueCategory: 'issues',\n key: 'monitoring',\n needsFullFiltering: false,\n needsMonitor: true,\n needsReporting: false,\n filterRule: { scope: 'monitor', key: 'alerts', operator: DEVICE_FILTERING_OPTIONS.$eq.key, value: true },\n title: 'Monitoring alert'\n },\n authRequests: {\n key: 'authRequests',\n needsFullFiltering: false,\n needsMonitor: false,\n needsReporting: true,\n filterRule: { scope: 'monitor', key: 'auth_requests', operator: DEVICE_FILTERING_OPTIONS.$gt.key, value: 1 },\n title: 'Devices with new authentication requests'\n },\n gatewayDevices: {\n key: 'gatewayDevices',\n needsFullFiltering: false,\n needsMonitor: false,\n needsReporting: true,\n filterRule: { scope: 'inventory', key: 'mender_is_gateway', operator: DEVICE_FILTERING_OPTIONS.$eq.key, value: 'true' },\n title: 'Gateway devices'\n }\n};\nconst oneSecond = 1000;\nexport const TIMEOUTS = {\n debounceDefault: 700,\n debounceShort: 300,\n halfASecond: 0.5 * oneSecond,\n oneSecond,\n twoSeconds: 2 * oneSecond,\n threeSeconds: 3 * oneSecond,\n fiveSeconds: 5 * oneSecond,\n refreshDefault: 10 * oneSecond,\n refreshLong: 60 * oneSecond\n};\n\nexport const SORTING_OPTIONS = {\n asc: 'asc',\n desc: 'desc'\n};\n\nexport const DEVICE_ONLINE_CUTOFF = { interval: 1, intervalName: timeUnits.days };\n\nexport const ATTRIBUTE_SCOPES = {\n inventory: 'inventory',\n identity: 'identity',\n monitor: 'monitor',\n system: 'system',\n tags: 'tags'\n};\n\nexport const defaultIdAttribute = Object.freeze({ attribute: 'id', scope: ATTRIBUTE_SCOPES.identity });\n\nconst credentialTypes = {\n aws: 'aws',\n http: 'http',\n sas: 'sas',\n x509: 'x509'\n};\nexport const EXTERNAL_PROVIDER = {\n 'iot-core': {\n credentialsType: credentialTypes.aws,\n icon: AWS,\n title: 'AWS IoT Core',\n twinTitle: 'Device Shadow',\n provider: 'iot-core',\n enabled: true,\n deviceTwin: true,\n configHint: <>For help finding your AWS IoT Core connection string, check the AWS IoT documentation.</>\n },\n 'iot-hub': {\n credentialsType: credentialTypes.sas,\n icon: Azure,\n title: 'Azure IoT Hub',\n twinTitle: 'Device Twin',\n provider: 'iot-hub',\n enabled: true,\n deviceTwin: true,\n configHint: (\n <span>\n For help finding your Azure IoT Hub connection string, look under &apos;Shared access policies&apos; in the Microsoft Azure UI as described{' '}\n {\n <a\n href=\"https://devblogs.microsoft.com/iotdev/understand-different-connection-strings-in-azure-iot-hub/#iothubconn\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n here\n </a>\n }\n .\n </span>\n )\n },\n webhook: {\n credentialsType: credentialTypes.http,\n deviceTwin: false,\n // disable the webhook provider here, since it is treated different than other integrations, with a custom configuration & management view, etc.\n enabled: false,\n provider: 'webhook'\n }\n};\nexport const MAX_PAGE_SIZE = 500;\n\nexport const ALL_RELEASES = 'All releases';\n\nexport const emptyUiPermissions = Object.freeze({\n auditlog: [],\n deployments: [],\n groups: Object.freeze({}),\n releases: Object.freeze({}),\n userManagement: []\n});\n\nexport const emptyRole = Object.freeze({\n name: undefined,\n description: '',\n permissions: [],\n uiPermissions: Object.freeze({ ...emptyUiPermissions })\n});\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// @ts-nocheck\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport { DEPLOYMENT_STATES } from './constants';\n\nexport const getDeploymentsById = state => state.deployments.byId;\nexport const getDeploymentsByStatus = state => state.deployments.byStatus;\nexport const getSelectedDeploymentDeviceIds = state => state.deployments.selectedDeviceIds;\nexport const getDeploymentsSelectionState = state => state.deployments.selectionState;\n\nexport const getMappedDeploymentSelection = createSelector(\n [getDeploymentsSelectionState, (_, deploymentsState) => deploymentsState, getDeploymentsById],\n (selectionState, deploymentsState, deploymentsById) => {\n const { selection = [] } = selectionState[deploymentsState] ?? {};\n return selection.reduce((accu, id) => {\n if (deploymentsById[id]) {\n accu.push(deploymentsById[id]);\n }\n return accu;\n }, []);\n }\n);\n\nconst relevantDeploymentStates = [DEPLOYMENT_STATES.pending, DEPLOYMENT_STATES.inprogress, DEPLOYMENT_STATES.finished];\nexport const DEPLOYMENT_CUTOFF = 3;\nexport const getRecentDeployments = createSelector([getDeploymentsById, getDeploymentsByStatus], (deploymentsById, deploymentsByStatus) =>\n Object.entries(deploymentsByStatus).reduce(\n (accu, [state, byStatus]) => {\n if (!relevantDeploymentStates.includes(state) || !byStatus.deploymentIds.length) {\n return accu;\n }\n accu[state] = byStatus.deploymentIds\n .reduce((accu, id) => {\n if (deploymentsById[id]) {\n accu.push(deploymentsById[id]);\n }\n return accu;\n }, [])\n .slice(0, DEPLOYMENT_CUTOFF);\n accu.total += byStatus.total;\n return accu;\n },\n { total: 0 }\n )\n);\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { DEVICE_FILTERING_OPTIONS, apiUrl } from '@northern.tech/store/constants';\n\nexport const emptyFilter = { key: null, value: '', operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: 'inventory' };\n\nexport const deviceAuthV2 = `${apiUrl.v2}/devauth`;\nexport const deviceConnect = `${apiUrl.v1}/deviceconnect`;\nexport const inventoryApiUrl = `${apiUrl.v1}/inventory`;\nexport const inventoryApiUrlV2 = `${apiUrl.v2}/inventory`;\nexport const deviceConfig = `${apiUrl.v1}/deviceconfig/configurations/device`;\nexport const reportingApiUrl = `${apiUrl.v1}/reporting`;\nexport const iotManagerBaseURL = `${apiUrl.v1}/iot-manager`;\n\n// see https://github.com/mendersoftware/go-lib-micro/tree/master/ws\n// for the description of proto_header and the consts\n// *Note*: this needs to be aligned with mender-connect and deviceconnect.\nexport const DEVICE_MESSAGE_PROTOCOLS = {\n Shell: 1\n};\nexport const DEVICE_MESSAGE_TYPES = {\n Delay: 'delay',\n New: 'new',\n Ping: 'ping',\n Pong: 'pong',\n Resize: 'resize',\n Shell: 'shell',\n Stop: 'stop'\n};\n\n// we can't include the dismiss state with the rest since this would include dismissed devices in several queries\nexport const DEVICE_DISMISSAL_STATE = 'dismiss';\nexport const ALL_DEVICE_STATES = 'any';\nexport const DEVICE_STATES = {\n accepted: 'accepted',\n pending: 'pending',\n preauth: 'preauthorized',\n rejected: 'rejected'\n};\nexport const DEVICE_CONNECT_STATES = {\n connected: 'connected',\n disconnected: 'disconnected',\n unknown: 'unknown'\n};\n\nexport const geoAttributes = ['geo-lat', 'geo-lon'].map(attribute => ({ attribute, scope: 'inventory' }));\n","// Copyright 2021 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\nimport { apiUrl } from '@northern.tech/store/constants';\n\n// limitations under the License.\nexport const alertChannels = { email: 'email' };\nexport const monitorApiUrlv1 = `${apiUrl.v1}/devicemonitor`;\n","// Copyright 2020 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.\nexport const onboardingSteps = {\n ONBOARDING_START: 'onboarding-start',\n DEVICES_PENDING_ONBOARDING_START: 'devices-pending-onboarding-start',\n DASHBOARD_ONBOARDING_START: 'dashboard-onboarding-start',\n DASHBOARD_ONBOARDING_PENDINGS: 'dashboard-onboarding-pendings',\n DEVICES_DELAYED_ONBOARDING: 'devices-delayed-onboarding',\n DEVICES_PENDING_ONBOARDING: 'devices-pending-onboarding',\n DEVICES_ACCEPTED_ONBOARDING: 'devices-accepted-onboarding',\n DEVICES_PENDING_ACCEPTING_ONBOARDING: 'devices-pending-accepting-onboarding',\n DEVICES_DEPLOY_RELEASE_ONBOARDING: 'devices-deploy-release-onboarding',\n SCHEDULING_ARTIFACT_SELECTION: 'scheduling-artifact-selection',\n SCHEDULING_ALL_DEVICES_SELECTION: 'scheduling-all-devices-selection',\n SCHEDULING_GROUP_SELECTION: 'scheduling-group-selection',\n SCHEDULING_RELEASE_TO_DEVICES: 'scheduling-release-to-devices',\n DEPLOYMENTS_INPROGRESS: 'deployments-inprogress',\n DEPLOYMENTS_PAST: 'deployments-past',\n DEPLOYMENTS_PAST_COMPLETED: 'deployments-past-completed',\n DEPLOYMENTS_PAST_COMPLETED_FAILURE: 'deployments-past-completed-failure',\n ONBOARDING_CANCELED: 'onboarding-canceled'\n};\n\nexport const orderedOnboardingSteps = [\n onboardingSteps.DASHBOARD_ONBOARDING_START,\n onboardingSteps.DEVICES_PENDING_ONBOARDING_START,\n onboardingSteps.DEVICES_DELAYED_ONBOARDING,\n onboardingSteps.DEVICES_PENDING_ONBOARDING,\n onboardingSteps.DEVICES_PENDING_ACCEPTING_ONBOARDING,\n onboardingSteps.DASHBOARD_ONBOARDING_PENDINGS,\n onboardingSteps.DEVICES_ACCEPTED_ONBOARDING,\n onboardingSteps.DEVICES_DEPLOY_RELEASE_ONBOARDING,\n onboardingSteps.SCHEDULING_ALL_DEVICES_SELECTION,\n onboardingSteps.SCHEDULING_GROUP_SELECTION,\n onboardingSteps.SCHEDULING_ARTIFACT_SELECTION,\n onboardingSteps.SCHEDULING_RELEASE_TO_DEVICES,\n onboardingSteps.DEPLOYMENTS_INPROGRESS,\n onboardingSteps.DEPLOYMENTS_PAST,\n onboardingSteps.DEPLOYMENTS_PAST_COMPLETED,\n onboardingSteps.DEPLOYMENTS_PAST_COMPLETED_FAILURE,\n onboardingSteps.ONBOARDING_CANCELED\n];\n","// Copyright 2020 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.\n// @ts-nocheck\nimport { Integration } from '@northern.tech/store/api/types/MenderTypes';\nimport { EXTERNAL_PROVIDER, apiUrl, useradmApiUrl } from '@northern.tech/store/constants';\n\nexport const auditLogsApiUrl = `${apiUrl.v1}/auditlogs`;\nexport const tenantadmApiUrlv1 = `${apiUrl.v1}/tenantadm`;\nexport const tenantadmApiUrlv2 = `${apiUrl.v2}/tenantadm`;\nexport const ssoIdpApiUrlv1 = `${apiUrl.v1}/useradm/sso/idp/metadata`;\n\nexport const XML_METADATA_FORMAT = 'xml';\nexport const JSON_METADATA_FORMAT = 'json';\n\nexport const getSamlStartUrl = id => `${window.location.origin}${useradmApiUrl}/auth/sso/${id}/login`;\nexport const getOidcStartUrl = id => `${window.location.origin}${useradmApiUrl}/oidc/${id}/start`;\n\nexport const SSO_TYPES = {\n saml: {\n id: 'saml',\n type: 'saml',\n title: 'SAML',\n metadataFormat: XML_METADATA_FORMAT,\n editorLanguage: XML_METADATA_FORMAT,\n contentType: 'application/samlmetadata+xml',\n getStartUrl: getSamlStartUrl,\n configDetails: [\n { key: 'entityID', label: 'Entity ID', getValue: id => `${window.location.origin}${useradmApiUrl}/sso/sp/metadata/${id}` },\n { key: 'acs', label: 'ACS URL', getValue: id => `${window.location.origin}${useradmApiUrl}/auth/sso/${id}/acs` },\n { key: 'startURL', label: 'Start URL', getValue: getSamlStartUrl }\n ]\n },\n oidc: {\n id: 'oidc',\n type: 'oidc',\n title: 'OpenID Connect',\n metadataFormat: JSON_METADATA_FORMAT,\n editorLanguage: JSON_METADATA_FORMAT,\n contentType: 'application/json',\n getStartUrl: getOidcStartUrl,\n configDetails: [{ key: 'startURL', label: 'Start Url', getValue: getOidcStartUrl }]\n }\n};\n\nexport const AUDIT_LOGS_TYPES = [\n { title: 'Artifact', queryParameter: 'object_type', value: 'artifact' },\n { title: 'Deployment', queryParameter: 'object_deployment_name', value: 'deployment' },\n { title: 'Device', queryParameter: 'object_id', value: 'device' },\n { title: 'User', queryParameter: 'object_id', value: 'user' }\n];\n\nexport interface Webhook extends Integration {\n provider: Integration.provider.WEBHOOK;\n scopes?: string[];\n}\n\nexport const emptyWebhook: Webhook = {\n description: '',\n enabled: true,\n credentials: {\n type: EXTERNAL_PROVIDER.webhook.credentialsType,\n [EXTERNAL_PROVIDER.webhook.credentialsType]: {\n secret: '',\n url: ''\n }\n }\n};\nexport const TENANT_LIST_DEFAULT = {\n page: 1,\n perPage: 20\n};\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nexport const ARTIFACT_GENERATION_TYPE = { SINGLE_FILE: 'single_file' };\n\nexport const currentArtifact = 'artifact_name';\nexport const rootfsImageVersion = 'rootfs-image.version';\nexport const softwareTitleMap = { [rootfsImageVersion]: { title: 'Root filesystem', priority: 0, key: rootfsImageVersion } };\n","'use strict';\n\n// Copyright 2015 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 { ALL_DEVICES, ALL_RELEASES, apiUrl, emptyUiPermissions } from '@northern.tech/store/constants';\n\nexport const useradmApiUrlv1 = `${apiUrl.v1}/useradm`;\nexport const useradmApiUrlv2 = `${apiUrl.v2}/useradm`;\nexport { useradmApiUrlv1 as useradmApiUrl };\n\nconst staticRolesByName = {\n admin: 'RBAC_ROLE_PERMIT_ALL',\n readOnly: 'RBAC_ROLE_OBSERVER',\n ci: 'RBAC_ROLE_CI',\n deploymentsManager: 'RBAC_ROLE_DEPLOYMENTS_MANAGER',\n terminalAccess: 'RBAC_ROLE_REMOTE_TERMINAL'\n};\n\nexport const PermissionTypes = {\n Any: 'any',\n Get: 'GET',\n Post: 'POST',\n Put: 'PUT',\n Delete: 'DELETE',\n Patch: 'PATCH',\n DeviceGroup: 'DEVICE_GROUP',\n DeviceId: 'DEVICE_ID'\n};\n\nconst permissionSetIds = {\n Basic: 'Basic',\n ConfigureDevices: 'ConfigureDevices',\n ConnectToDevices: 'ConnectToDevices',\n DeployToDevices: 'DeployToDevices',\n ManageDevices: 'ManageDevices',\n ManageReleases: 'ManageReleases',\n ManageUsers: 'ManageUsers',\n ReadAuditLogs: 'ReadAuditLogs',\n ReadDevices: 'ReadDevices',\n ReadReleases: 'ReadReleases',\n ReadUsers: 'ReadUsers',\n SuperUser: 'SuperUser',\n UploadArtifacts: 'UploadArtifacts'\n};\n\nexport const uiPermissionsById = {\n configure: {\n explanations: { groups: `'Configure' allows the user to use mender-configure features and apply configurations.` },\n permissionLevel: 2,\n permissionSets: { groups: permissionSetIds.ConfigureDevices },\n title: 'Configure',\n value: 'configure',\n verbs: [PermissionTypes.Get, PermissionTypes.Put, PermissionTypes.Post]\n },\n connect: {\n explanations: { groups: `'Connect' allows the user to use mender-connect features and Troubleshoot add-ons.` },\n permissionLevel: 2,\n permissionSets: { groups: permissionSetIds.ConnectToDevices },\n title: 'Connect',\n value: 'connect',\n verbs: [PermissionTypes.Get, PermissionTypes.Put]\n },\n deploy: {\n explanations: { groups: `'Deploy' allows the user to deploy software or configuration updates to devices.` },\n permissionLevel: 2,\n permissionSets: { deployments: permissionSetIds.DeployToDevices, groups: permissionSetIds.DeployToDevices },\n title: 'Deploy',\n value: 'deploy',\n verbs: [PermissionTypes.Post]\n },\n manage: {\n explanations: {\n groups: `'Manage' allows the user to edit device name, notes, and manage authentication status. For 'All devices' it also allows the user to edit and create device groups.`,\n releases: `'Manage' allows the user to upload new artifacts, edit release descriptions and remove artifacts.`\n },\n permissionLevel: 2,\n permissionSets: {\n groups: permissionSetIds.ManageDevices,\n releases: permissionSetIds.ManageReleases,\n userManagement: permissionSetIds.ManageUsers\n },\n title: 'Manage',\n value: 'manage',\n verbs: [PermissionTypes.Post, PermissionTypes.Put, PermissionTypes.Patch]\n },\n read: {\n explanations: { groups: `'Read' allows the user to view devices.` },\n permissionLevel: 1,\n permissionSets: {\n auditlog: permissionSetIds.ReadAuditLogs,\n groups: permissionSetIds.ReadDevices,\n releases: permissionSetIds.ReadReleases,\n userManagement: permissionSetIds.ReadUsers\n },\n title: 'Read',\n value: 'read',\n verbs: [PermissionTypes.Get, PermissionTypes.Post]\n },\n upload: {\n explanations: { groups: `'Upload' allows the user to upload new Artifacts.` },\n unscopedOnly: { releases: true },\n permissionLevel: 1,\n permissionSets: { releases: permissionSetIds.UploadArtifacts },\n title: 'Upload',\n value: 'upload',\n verbs: [PermissionTypes.Post, PermissionTypes.Put, PermissionTypes.Patch]\n }\n};\n\n/**\n * _uiPermissions_ represent the possible permissions/ rights that can be given for the area\n * _endpoints_ represent the possible endpoints this definition might be affecting in the UI and what\n * functionality might be affected\n *\n */\nexport const scopedPermissionAreas = {\n groups: { key: 'groups', excessiveAccessSelector: ALL_DEVICES, scopeType: 'DeviceGroups' },\n releases: { key: 'releases', excessiveAccessSelector: ALL_RELEASES, scopeType: 'Releases' }\n};\n\nexport const uiPermissionsByArea = {\n auditlog: {\n endpoints: [{ path: /\\/(auditlog)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] }],\n explanation:\n 'Granting access to the audit log will allow tracing changes to devices, releases and user accounts, as well as providing information about deployments.',\n uiPermissions: [uiPermissionsById.read],\n title: 'System audit log'\n },\n deployments: {\n endpoints: [\n { path: /\\/(deployments\\/deployments)/i, types: [PermissionTypes.Post, PermissionTypes.Put], uiPermissions: [uiPermissionsById.deploy] },\n { path: /\\/(deployments\\/deployments)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] },\n { path: /\\/(deployments\\/config)/i, types: [PermissionTypes.Get, PermissionTypes.Put], uiPermissions: [uiPermissionsById.manage] }\n ],\n explanation: 'Providing deploy permissions will allow deployments to be created using the releases and devices a user has access to.',\n uiPermissions: [uiPermissionsById.read, uiPermissionsById.deploy],\n title: 'Deployments'\n },\n groups: {\n endpoints: [\n {\n path: /\\/(devauth|inventory|deviceconfig|devicemonitor|deviceconnect\\/devices)/i,\n types: [PermissionTypes.Get],\n uiPermissions: [uiPermissionsById.read]\n },\n { path: /\\/(devauth|inventory)/i, types: [PermissionTypes.Put, PermissionTypes.Post], uiPermissions: [uiPermissionsById.manage] },\n { path: /\\/(deviceconfig)/i, types: [PermissionTypes.Get, PermissionTypes.Put, PermissionTypes.Post], uiPermissions: [uiPermissionsById.configure] },\n { path: /\\/(deviceconnect\\/devices)/i, types: [PermissionTypes.Get, PermissionTypes.Post], uiPermissions: [uiPermissionsById.connect] }\n ],\n explanation: 'Device group management permissions control the degree to which devices in a group can be accessed and moved to other groups.',\n scope: scopedPermissionAreas.groups.scopeType,\n uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage, uiPermissionsById.deploy, uiPermissionsById.configure, uiPermissionsById.connect],\n title: 'Group Management'\n },\n releases: {\n endpoints: [\n { path: /\\/(deployments\\/artifacts|deployments\\/deployments\\/releases)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] },\n {\n path: /\\/(deployments\\/artifacts|deployments\\/deployments\\/releases)/i,\n types: [PermissionTypes.Post, PermissionTypes.Put],\n uiPermissions: [uiPermissionsById.read, uiPermissionsById.upload]\n },\n {\n path: /\\/(deployments\\/artifacts|deployments\\/deployments\\/releases)/i,\n types: [PermissionTypes.Delete],\n uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage]\n }\n ],\n explanation: 'Release permissions can be granted to allow artifact & release modifications, as well as the creation of new releases.',\n scope: 'ReleaseTags',\n uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage, uiPermissionsById.upload],\n title: 'Release Management'\n },\n userManagement: {\n endpoints: [\n { path: /\\/(useradm)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] },\n { path: /\\/(useradm)/i, types: [PermissionTypes.Post], uiPermissions: [uiPermissionsById.manage] }\n ],\n explanation:\n 'User management permissions should be granted carefully, as these allow privilege increases for any users managed by a user with user management permissions',\n uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage],\n title: 'User Management'\n }\n};\n\nconst permissionMapper = permission => permission.value;\nexport const itemUiPermissionsReducer = (accu, { item, uiPermissions }) => (item ? { ...accu, [item]: uiPermissions } : accu);\n\nconst checkSinglePermission = (permission, requiredPermission) =>\n requiredPermission === permission || uiPermissionsById[permission].permissionLevel > uiPermissionsById[requiredPermission].permissionLevel;\n\nexport const checkPermissionsObject = (permissions, requiredPermission, scopedAccess, superAccess) =>\n permissions[superAccess]?.some(permission => checkSinglePermission(permission, requiredPermission)) ||\n permissions[scopedAccess]?.some(permission => checkSinglePermission(permission, requiredPermission));\n\nexport const rolesById = Object.freeze({\n [staticRolesByName.admin]: {\n name: 'Admin',\n value: staticRolesByName.admin,\n description: 'Full access',\n permissions: [], // permissions refers to the values returned from the backend\n uiPermissions: {\n ...emptyUiPermissions,\n auditlog: uiPermissionsByArea.auditlog.uiPermissions.map(permissionMapper),\n deployments: uiPermissionsByArea.deployments.uiPermissions.map(permissionMapper),\n groups: { [ALL_DEVICES]: uiPermissionsByArea.groups.uiPermissions.map(permissionMapper) },\n releases: { [ALL_RELEASES]: uiPermissionsByArea.releases.uiPermissions.map(permissionMapper) },\n userManagement: uiPermissionsByArea.userManagement.uiPermissions.map(permissionMapper)\n }\n },\n [staticRolesByName.readOnly]: {\n name: 'Read Access',\n value: staticRolesByName.readOnly,\n description: '',\n permissions: [],\n uiPermissions: {\n ...emptyUiPermissions,\n deployments: [uiPermissionsById.read.value],\n groups: { [ALL_DEVICES]: [uiPermissionsById.read.value] },\n releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] },\n userManagement: [uiPermissionsById.read.value]\n }\n },\n [staticRolesByName.ci]: {\n name: 'Releases Manager',\n value: staticRolesByName.ci,\n description: '',\n permissions: [],\n uiPermissions: {\n ...emptyUiPermissions,\n releases: { [ALL_RELEASES]: uiPermissionsByArea.releases.uiPermissions.map(permissionMapper) }\n }\n },\n [staticRolesByName.deploymentsManager]: {\n name: 'Deployments Manager',\n value: staticRolesByName.deploymentsManager,\n description: '',\n permissions: [],\n uiPermissions: {\n ...emptyUiPermissions,\n deployments: uiPermissionsByArea.deployments.uiPermissions.map(permissionMapper),\n groups: { [ALL_DEVICES]: [uiPermissionsById.deploy.value, uiPermissionsById.read.value] },\n releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] }\n }\n },\n [staticRolesByName.terminalAccess]: {\n name: 'Troubleshooting',\n value: staticRolesByName.terminalAccess,\n description: 'Access to the troubleshooting features: Remote Terminal, File Transfer, Port Forwarding',\n permissions: [],\n uiPermissions: {\n ...emptyUiPermissions,\n groups: { [ALL_DEVICES]: [uiPermissionsById.connect.value] }\n }\n }\n});\n\nexport const defaultPermissionSets = {\n [permissionSetIds.Basic]: {\n name: permissionSetIds.Basic,\n result: {\n // this is needed to prevent the detailed permissions of the basic permission set from being interpreted as allowing read & management access to user endpoints\n userManagement: [uiPermissionsById.read.value]\n }\n },\n [permissionSetIds.SuperUser]: {\n name: permissionSetIds.SuperUser,\n result: {\n ...rolesById[staticRolesByName.admin].uiPermissions\n }\n },\n [permissionSetIds.ManageUsers]: {\n name: permissionSetIds.ManageUsers,\n result: {\n userManagement: [uiPermissionsById.manage.value]\n }\n },\n [permissionSetIds.ReadAuditLogs]: {\n name: permissionSetIds.ReadAuditLogs,\n result: {\n auditlog: [uiPermissionsById.read.value]\n }\n },\n [permissionSetIds.ReadReleases]: {\n name: permissionSetIds.ReadReleases,\n result: {\n releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] }\n }\n },\n [permissionSetIds.ReadUsers]: {\n name: permissionSetIds.ReadUsers,\n result: {\n userManagement: [uiPermissionsById.read.value]\n }\n },\n [permissionSetIds.UploadArtifacts]: {\n name: permissionSetIds.UploadArtifacts,\n result: {\n releases: { [ALL_RELEASES]: [uiPermissionsById.upload.value] }\n }\n },\n [permissionSetIds.ManageReleases]: {\n name: permissionSetIds.ManageReleases,\n result: {\n releases: { [ALL_RELEASES]: [uiPermissionsById.manage.value] }\n }\n },\n [permissionSetIds.ConfigureDevices]: {\n name: permissionSetIds.ConfigureDevices,\n result: {\n deployments: [uiPermissionsById.read.value, uiPermissionsById.deploy.value],\n groups: { [ALL_DEVICES]: [uiPermissionsById.read.value, uiPermissionsById.configure.value] }\n }\n },\n [permissionSetIds.ConnectToDevices]: {\n name: permissionSetIds.ConnectToDevices,\n result: {\n groups: { [ALL_DEVICES]: [uiPermissionsById.read.value, uiPermissionsById.connect.value] }\n }\n },\n [permissionSetIds.DeployToDevices]: {\n name: permissionSetIds.DeployToDevices,\n result: {\n deployments: [uiPermissionsById.deploy.value, uiPermissionsById.manage.value, uiPermissionsById.read.value],\n groups: { [ALL_DEVICES]: [uiPermissionsById.read.value, uiPermissionsById.deploy.value] }\n }\n },\n [permissionSetIds.ManageDevices]: {\n name: permissionSetIds.ManageDevices,\n result: {\n groups: { [ALL_DEVICES]: [uiPermissionsById.read.value, uiPermissionsById.manage.value] }\n }\n },\n [permissionSetIds.ReadDevices]: {\n name: permissionSetIds.ReadDevices,\n result: {\n groups: { [ALL_DEVICES]: [uiPermissionsById.read.value] }\n }\n }\n};\n\nexport const USER_LOGOUT = 'USER_LOGOUT';\n\nexport const OWN_USER_ID = 'me';\n\nexport const rolesByName = {\n ...staticRolesByName,\n deploymentCreation: { action: 'CREATE_DEPLOYMENT', object: { type: 'DEVICE_GROUP', value: undefined } },\n groupAccess: { action: 'VIEW_DEVICE', object: { type: 'DEVICE_GROUP', value: undefined } },\n userManagement: { action: 'http', object: { type: 'any', value: `${useradmApiUrlv1}/.*` } }\n};\nexport const twoFAStates = {\n enabled: 'enabled',\n disabled: 'disabled',\n unverified: 'unverified'\n};\nexport const settingsKeys = { initialized: 'settings-initialized' };\n\nexport const READ_STATES = {\n read: 'read',\n seen: 'seen',\n unread: 'unread'\n};\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { DEVICE_LIST_DEFAULTS, SORTING_OPTIONS, apiUrl } from '@northern.tech/store/constants';\n\nconst alreadyInstalled = 'already-installed';\n\nexport const deploymentsApiUrl = `${apiUrl.v1}/deployments`;\nexport const deploymentsApiUrlV2 = `${apiUrl.v2}/deployments`;\n\nexport const deploymentSubstates = {\n aborted: 'aborted',\n alreadyInstalled,\n decommissioned: 'decommissioned',\n downloading: 'downloading',\n failure: 'failure',\n installing: 'installing',\n noartifact: 'noartifact',\n pause_before_committing: 'pause_before_committing',\n pause_before_installing: 'pause_before_installing',\n pause_before_rebooting: 'pause_before_rebooting',\n pending: 'pending',\n rebooting: 'rebooting',\n success: 'success'\n};\n\nexport const deploymentStatesToSubstates = {\n failures: [deploymentSubstates.failure, deploymentSubstates.aborted, deploymentSubstates.decommissioned],\n inprogress: [deploymentSubstates.downloading, deploymentSubstates.installing, deploymentSubstates.rebooting],\n paused: [deploymentSubstates.pause_before_installing, deploymentSubstates.pause_before_rebooting, deploymentSubstates.pause_before_committing],\n pending: [deploymentSubstates.pending],\n successes: [deploymentSubstates.success, deploymentSubstates.alreadyInstalled, deploymentSubstates.noartifact]\n};\n\nexport const deploymentStatesToSubstatesWithSkipped = {\n ...deploymentStatesToSubstates,\n failures: [deploymentSubstates.failure],\n skipped: [deploymentSubstates.aborted, deploymentSubstates.noartifact, deploymentSubstates.alreadyInstalled, deploymentSubstates.decommissioned],\n successes: [deploymentSubstates.success]\n};\nexport const installationSubstatesMap = {\n download: {\n title: 'download',\n done: 'downloaded',\n successIndicators: [deploymentSubstates.installing, deploymentSubstates.rebooting, ...deploymentStatesToSubstates.paused, deploymentSubstates.success],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactInstall_Enter'\n },\n install: {\n title: 'install',\n done: 'installed',\n successIndicators: [\n deploymentSubstates.rebooting,\n deploymentSubstates.pause_before_rebooting,\n deploymentSubstates.pause_before_committing,\n deploymentSubstates.success\n ],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactReboot_Enter'\n },\n reboot: {\n title: 'reboot',\n done: 'rebooted',\n successIndicators: [deploymentSubstates.pause_before_committing, deploymentSubstates.success],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactCommit_Enter'\n },\n commit: {\n title: 'commit',\n done: 'committed',\n successIndicators: deploymentStatesToSubstates.successes,\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: undefined\n }\n};\n\nexport const DEPLOYMENT_STATES = {\n finished: 'finished',\n inprogress: 'inprogress',\n pending: 'pending',\n scheduled: 'scheduled'\n};\n\nexport const listDefaultsByState = {\n [DEPLOYMENT_STATES.inprogress]: { page: 1, perPage: 10 },\n [DEPLOYMENT_STATES.pending]: { page: 1, perPage: 10 },\n [DEPLOYMENT_STATES.scheduled]: { ...DEVICE_LIST_DEFAULTS },\n [DEPLOYMENT_STATES.finished]: { ...DEVICE_LIST_DEFAULTS },\n sort: { direction: SORTING_OPTIONS.desc }\n};\n\nexport const DEFAULT_PENDING_INPROGRESS_COUNT = 10;\nexport const DEPLOYMENT_ROUTES = {\n active: {\n key: 'active',\n route: '/deployments/active',\n states: [DEPLOYMENT_STATES.pending, DEPLOYMENT_STATES.inprogress],\n title: 'Active'\n },\n finished: {\n key: 'finished',\n route: '/deployments/finished',\n states: [DEPLOYMENT_STATES.finished],\n title: 'Finished'\n },\n scheduled: {\n key: 'scheduled',\n route: '/deployments/scheduled',\n states: [DEPLOYMENT_STATES.scheduled],\n title: 'Scheduled'\n }\n};\nexport const DEPLOYMENT_TYPES = {\n software: 'software',\n configuration: 'configuration'\n};\nexport const defaultStats = {\n [deploymentSubstates.aborted]: 0,\n [deploymentSubstates.alreadyInstalled]: 0,\n [deploymentSubstates.decommissioned]: 0,\n [deploymentSubstates.downloading]: 0,\n [deploymentSubstates.failure]: 0,\n [deploymentSubstates.installing]: 0,\n [deploymentSubstates.noartifact]: 0,\n [deploymentSubstates.pause_before_committing]: 0,\n [deploymentSubstates.pause_before_installing]: 0,\n [deploymentSubstates.pause_before_rebooting]: 0,\n [deploymentSubstates.pending]: 0,\n [deploymentSubstates.rebooting]: 0,\n [deploymentSubstates.success]: 0\n};\nexport const deploymentDisplayStates = {\n finished: 'Finished',\n scheduled: 'Scheduled',\n skipped: 'Skipped',\n paused: 'Paused',\n pending: 'Pending',\n inprogress: 'In Progress',\n success: 'Success',\n successes: 'Success',\n failure: 'Fail',\n failures: 'Fail'\n};\n\nexport const deploymentPrototype = {\n devices: {},\n name: undefined,\n statistics: { status: {} }\n};\n\nexport const pauseMap = {\n [deploymentSubstates.pause_before_installing]: {\n title: installationSubstatesMap.download.done,\n followUp: installationSubstatesMap.download.pauseConfigurationIndicator\n },\n [deploymentSubstates.pause_before_rebooting]: {\n title: installationSubstatesMap.install.done,\n followUp: installationSubstatesMap.install.pauseConfigurationIndicator\n },\n [deploymentSubstates.pause_before_committing]: {\n title: installationSubstatesMap.reboot.done,\n followUp: installationSubstatesMap.reboot.pauseConfigurationIndicator\n }\n};\nexport const limitDefault = { min: 5, max: 100, default: 10 };\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// @ts-nocheck\nimport { DEVICE_STATES, UNGROUPED_GROUP } from '@northern.tech/store/constants';\nimport { duplicateFilter } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\n\nexport const getAcceptedDevices = state => state.devices.byStatus.accepted;\nexport const getDevicesByStatus = state => state.devices.byStatus;\nexport const getDevicesById = state => state.devices.byId;\nexport const getDeviceReports = state => state.devices.reports;\nexport const getGroupsById = state => state.devices.groups.byId;\nexport const getSelectedGroup = state => state.devices.groups.selectedGroup;\n\nexport const getDeviceListState = state => state.devices.deviceList;\nexport const getListedDevices = state => state.devices.deviceList.deviceIds;\nexport const getFilteringAttributes = state => state.devices.filteringAttributes;\nexport const getDeviceFilters = state => state.devices.filters || [];\nconst getFilteringAttributesFromConfig = state => state.devices.filteringAttributesConfig.attributes;\nexport const getSortedFilteringAttributes = createSelector([getFilteringAttributes], filteringAttributes => ({\n ...filteringAttributes,\n identityAttributes: [...filteringAttributes.identityAttributes, 'id']\n}));\nexport const getDeviceLimit = state => state.devices.limit;\nconst getFilteringAttributesLimit = state => state.devices.filteringAttributesLimit;\n\nexport const getDeviceIdentityAttributes = createSelector(\n [getFilteringAttributes, getFilteringAttributesLimit],\n ({ identityAttributes }, filteringAttributesLimit) => {\n // limit the selection of the available attribute to AVAILABLE_ATTRIBUTE_LIMIT\n const attributes = identityAttributes.slice(0, filteringAttributesLimit);\n return attributes.reduce(\n (accu, value) => {\n accu.push({ value, label: value, scope: 'identity' });\n return accu;\n },\n [\n { value: 'name', label: 'Name', scope: 'tags' },\n { value: 'id', label: 'Device ID', scope: 'identity' }\n ]\n );\n }\n);\n\nexport const getDeviceCountsByStatus = createSelector([getDevicesByStatus], byStatus =>\n Object.values(DEVICE_STATES).reduce((accu, state) => {\n accu[state] = byStatus[state].total || 0;\n return accu;\n }, {})\n);\n\nexport const getDeviceById = createSelector([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = '') => devicesById[deviceId] ?? {});\n\nexport const getSelectedGroupInfo = createSelector(\n [getAcceptedDevices, getGroupsById, getSelectedGroup],\n ({ total: acceptedDeviceTotal }, groupsById, selectedGroup) => {\n let groupCount = acceptedDeviceTotal;\n let groupFilters = [];\n if (selectedGroup && groupsById[selectedGroup]) {\n groupCount = groupsById[selectedGroup].total;\n groupFilters = groupsById[selectedGroup].filters || [];\n }\n return { groupCount, selectedGroup, groupFilters };\n }\n);\n\nexport const getLimitMaxed = createSelector([getAcceptedDevices, getDeviceLimit], ({ total: acceptedDevices = 0 }, deviceLimit) =>\n Boolean(deviceLimit && deviceLimit <= acceptedDevices)\n);\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const getGroupsByIdWithoutUngrouped = createSelector([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);\n\nexport const getGroups = createSelector([getGroupsById], groupsById => {\n const groupNames = Object.keys(groupsById).sort();\n const groupedGroups = Object.entries(groupsById)\n .sort((a, b) => a[0].localeCompare(b[0]))\n .reduce(\n (accu, [groupname, group]) => {\n const name = groupname === UNGROUPED_GROUP.id ? UNGROUPED_GROUP.name : groupname;\n const groupItem = { ...group, groupId: name, name: groupname };\n if (group.filters.length > 0) {\n if (groupname !== UNGROUPED_GROUP.id) {\n accu.dynamic.push(groupItem);\n } else {\n accu.ungrouped.push(groupItem);\n }\n } else {\n accu.static.push(groupItem);\n }\n return accu;\n },\n { dynamic: [], static: [], ungrouped: [] }\n );\n return { groupNames, ...groupedGroups };\n});\nexport const getAttributesList = createSelector(\n [getFilteringAttributes, getFilteringAttributesFromConfig],\n ({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) =>\n [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(duplicateFilter)\n);\n\nexport const getDeviceTypes = createSelector([getAcceptedDevices, getDevicesById], ({ deviceIds = [] }, devicesById) =>\n Object.keys(\n deviceIds.slice(0, 200).reduce((accu, item) => {\n const { device_type: deviceTypes = [] } = devicesById[item] ? devicesById[item].attributes : {};\n accu = deviceTypes.reduce((deviceTypeAccu, deviceType) => {\n if (deviceType.length > 1) {\n deviceTypeAccu[deviceType] = deviceTypeAccu[deviceType] ? deviceTypeAccu[deviceType] + 1 : 1;\n }\n return deviceTypeAccu;\n }, accu);\n return accu;\n }, {})\n )\n);\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport const getIssueCountsByType = state => state.monitor.issueCounts.byType;\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport const getOnboarding = state => state.onboarding;\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { EXTERNAL_PROVIDER } from '@northern.tech/store/constants';\nimport { createSelector } from '@reduxjs/toolkit';\n\nexport const getOrganization = state => state.organization.organization;\nexport const getExternalIntegrations = state => state.organization.externalDeviceIntegrations;\nexport const getAuditlogState = state => state.organization.auditlog.selectionState;\nexport const getAuditLog = state => state.organization.auditlog.events;\nexport const getAuditLogSelectionState = state => state.organization.auditlog.selectionState;\nexport const getSsoConfig = ({ organization: { ssoConfigs = [] } }) => ssoConfigs[0];\nexport const getTenantsList = state => state.organization.organization.tenantList;\nexport const getWebhookEvents = state => state.organization.webhooks.events;\nexport const getWebhookEventTotal = state => state.organization.webhooks.eventTotal;\n\nexport const getDeviceTwinIntegrations = createSelector([getExternalIntegrations], integrations =>\n integrations.filter(integration => integration.id && EXTERNAL_PROVIDER[integration.provider]?.deviceTwin)\n);\nexport const getIsServiceProvider = state => state.organization.organization.service_provider;\n\nexport const getWebhooks = createSelector([getExternalIntegrations], integrations =>\n integrations.filter(integration => integration.id && integration.provider === EXTERNAL_PROVIDER.webhook.provider)\n);\nexport const getWebhookEventInfo = createSelector([getWebhooks, getWebhookEvents, getWebhookEventTotal], (webhooks, events, eventTotal) =>\n webhooks.length ? { events, eventTotal } : { events: [], eventTotal: 0 }\n);\n\nexport const getAuditLogEntry = createSelector([getAuditLog, getAuditLogSelectionState], (events, { selectedId }) => {\n if (!selectedId) {\n return;\n }\n const [eventAction, eventTime] = atob(selectedId).split('|');\n return events.find(item => item.action === eventAction && item.time === eventTime);\n});\n","// 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.\n// @ts-nocheck\nimport { duplicateFilter, yes } from '@northern.tech/utils/helpers';\n\nimport { ATTRIBUTE_SCOPES, DEVICE_FILTERING_OPTIONS, DEVICE_ISSUE_OPTIONS, DEVICE_LIST_MAXIMUM_LENGTH, emptyUiPermissions } from './commonConstants';\nimport {\n DARK_MODE,\n DEPLOYMENT_STATES,\n defaultStats,\n deploymentDisplayStates,\n deploymentStatesToSubstates,\n deploymentStatesToSubstatesWithSkipped,\n emptyFilter\n} from './constants';\n\n// for some reason these functions can not be stored in the deviceConstants...\nconst filterProcessors = {\n $gt: val => Number(val) || val,\n $gte: val => Number(val) || val,\n $lt: val => Number(val) || val,\n $lte: val => Number(val) || val,\n $in: val => ('' + val).split(',').map(i => i.trim()),\n $nin: val => ('' + val).split(',').map(i => i.trim()),\n $exists: yes,\n $nexists: () => false\n};\nconst filterAliases = {\n $nexists: { alias: DEVICE_FILTERING_OPTIONS.$exists.key, value: false }\n};\nexport const mapFiltersToTerms = filters =>\n filters.map(filter => ({\n scope: filter.scope,\n attribute: filter.key,\n type: filterAliases[filter.operator]?.alias || filter.operator,\n value: filterProcessors.hasOwnProperty(filter.operator) ? filterProcessors[filter.operator](filter.value) : filter.value\n }));\nexport const mapTermsToFilters = terms =>\n terms.map(term => {\n const aliasedFilter = Object.entries(filterAliases).find(\n aliasDefinition => aliasDefinition[1].alias === term.type && aliasDefinition[1].value === term.value\n );\n const operator = aliasedFilter ? aliasedFilter[0] : term.type;\n return { scope: term.scope, key: term.attribute, operator, value: term.value };\n });\n\nconst convertIssueOptionsToFilters = (issuesSelection, filtersState = {}) =>\n issuesSelection.map(item => {\n if (typeof DEVICE_ISSUE_OPTIONS[item].filterRule.value === 'function') {\n return { ...DEVICE_ISSUE_OPTIONS[item].filterRule, value: DEVICE_ISSUE_OPTIONS[item].filterRule.value(filtersState) };\n }\n return DEVICE_ISSUE_OPTIONS[item].filterRule;\n });\n\nexport const convertDeviceListStateToFilters = ({ filters = [], group, groups = { byId: {} }, offlineThreshold, selectedIssues = [], status }) => {\n let applicableFilters = [...filters];\n if (typeof group === 'string' && !(groups.byId[group]?.filters || applicableFilters).length) {\n applicableFilters.push({ key: 'group', value: group, operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: 'system' });\n }\n const nonMonitorFilters = applicableFilters.filter(\n filter =>\n !Object.values(DEVICE_ISSUE_OPTIONS).some(\n ({ filterRule }) => filter.scope !== 'inventory' && filterRule.scope === filter.scope && filterRule.key === filter.key\n )\n );\n const deviceIssueFilters = convertIssueOptionsToFilters(selectedIssues, { offlineThreshold });\n applicableFilters = [...nonMonitorFilters, ...deviceIssueFilters];\n const effectiveFilters = status\n ? [...applicableFilters, { key: 'status', value: status, operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: 'identity' }]\n : applicableFilters;\n return { applicableFilters: nonMonitorFilters, filterTerms: mapFiltersToTerms(effectiveFilters) };\n};\n\nconst filterCompare = (filter, item) => Object.keys(emptyFilter).every(key => item[key].toString() === filter[key].toString());\n\nexport const filtersFilter = (item, index, array) => {\n const firstIndex = array.findIndex(filter => filterCompare(filter, item));\n return firstIndex === index;\n};\n\nexport const listItemMapper = (byId, ids, { defaultObject = {}, cutOffSize = DEVICE_LIST_MAXIMUM_LENGTH }) => {\n return ids.slice(0, cutOffSize).reduce((accu, id) => {\n if (id && byId[id]) {\n accu.push({ ...defaultObject, ...byId[id] });\n }\n return accu;\n }, []);\n};\n\nexport const mergePermissions = (existingPermissions = { ...emptyUiPermissions }, addedPermissions) =>\n Object.entries(existingPermissions).reduce(\n (accu, [key, value]) => {\n let values;\n if (!accu[key]) {\n accu[key] = value;\n return accu;\n }\n if (Array.isArray(value)) {\n values = [...value, ...accu[key]].filter(duplicateFilter);\n } else {\n values = mergePermissions(accu[key], { ...value });\n }\n accu[key] = values;\n return accu;\n },\n { ...addedPermissions }\n );\n\nexport const mapUserRolesToUiPermissions = (userRoles, roles) =>\n userRoles.reduce(\n (accu, roleId) => {\n if (!(roleId && roles[roleId])) {\n return accu;\n }\n return mergePermissions(accu, roles[roleId].uiPermissions);\n },\n { ...emptyUiPermissions }\n );\n\nexport const progress = ({ loaded, total }) => {\n let uploadProgress = (loaded / total) * 100;\n return (uploadProgress = uploadProgress < 50 ? Math.ceil(uploadProgress) : Math.round(uploadProgress));\n};\n\nexport const extractErrorMessage = (err, fallback = '') =>\n err.response?.data?.error?.message || err.response?.data?.error || err.error || err.message || fallback;\n\nexport const preformatWithRequestID = (res, failMsg) => {\n // ellipsis line\n if (failMsg.length > 100) failMsg = `${failMsg.substring(0, 220)}...`;\n\n try {\n if (res?.data && Object.keys(res.data).includes('request_id')) {\n let shortRequestUUID = res.data['request_id'].substring(0, 8);\n return `${failMsg} [Request ID: ${shortRequestUUID}]`;\n }\n } catch (e) {\n console.log('failed to extract request id:', e);\n }\n return failMsg;\n};\n\nexport const getComparisonCompatibleVersion = version => (isNaN(version.charAt(0)) && version !== 'next' ? 'master' : version);\n\nexport const stringToBoolean = content => {\n if (!content) {\n return false;\n }\n const string = content + '';\n switch (string.trim().toLowerCase()) {\n case 'true':\n case 'yes':\n case '1':\n return true;\n case 'false':\n case 'no':\n case '0':\n case null:\n return false;\n default:\n return Boolean(string);\n }\n};\n\nexport const groupDeploymentDevicesStats = deployment => {\n const deviceStatCollector = (deploymentStates, devices) =>\n Object.values(devices).reduce((accu, device) => (deploymentStates.includes(device.status) ? accu + 1 : accu), 0);\n\n const inprogress = deviceStatCollector(deploymentStatesToSubstates.inprogress, deployment.devices);\n const pending = deviceStatCollector(deploymentStatesToSubstates.pending, deployment.devices);\n const successes = deviceStatCollector(deploymentStatesToSubstates.successes, deployment.devices);\n const failures = deviceStatCollector(deploymentStatesToSubstates.failures, deployment.devices);\n const paused = deviceStatCollector(deploymentStatesToSubstates.paused, deployment.devices);\n return { inprogress, paused, pending, successes, failures };\n};\n\nexport const statCollector = (items, statistics) => items.reduce((accu, property) => accu + Number(statistics[property] || 0), 0);\nexport const groupDeploymentStats = (deployment, withSkipped) => {\n const { statistics = {} } = deployment;\n const { status = {} } = statistics;\n const stats = { ...defaultStats, ...status };\n let groupStates = deploymentStatesToSubstates;\n let result = {};\n if (withSkipped) {\n groupStates = deploymentStatesToSubstatesWithSkipped;\n result.skipped = statCollector(groupStates.skipped, stats);\n }\n result = {\n ...result,\n // don't include 'pending' as inprogress, as all remaining devices will be pending - we don't discriminate based on phase membership\n inprogress: statCollector(groupStates.inprogress, stats),\n pending: (deployment.max_devices ? deployment.max_devices - deployment.device_count : 0) + statCollector(groupStates.pending, stats),\n successes: statCollector(groupStates.successes, stats),\n failures: statCollector(groupStates.failures, stats),\n paused: statCollector(groupStates.paused, stats)\n };\n return result;\n};\n\nexport const getDeploymentState = deployment => {\n const { status: deploymentStatus = DEPLOYMENT_STATES.pending } = deployment;\n const { inprogress: currentProgressCount, paused } = groupDeploymentStats(deployment);\n\n let status = deploymentDisplayStates[deploymentStatus];\n if (deploymentStatus === DEPLOYMENT_STATES.pending && currentProgressCount === 0) {\n status = 'queued';\n } else if (paused > 0) {\n status = deploymentDisplayStates.paused;\n }\n return status;\n};\n\nexport const generateDeploymentGroupDetails = (filter, groupName) =>\n filter && filter.terms?.length\n ? `${groupName} (${filter.terms\n .map(filter => `${filter.attribute || filter.key} ${DEVICE_FILTERING_OPTIONS[filter.type || filter.operator].shortform} ${filter.value}`)\n .join(', ')})`\n : groupName;\n\nexport const mapDeviceAttributes = (attributes = []) =>\n attributes.reduce(\n (accu, attribute) => {\n if (!(attribute.value && attribute.name) && attribute.scope === ATTRIBUTE_SCOPES.inventory) {\n return accu;\n }\n accu[attribute.scope || ATTRIBUTE_SCOPES.inventory] = {\n ...accu[attribute.scope || ATTRIBUTE_SCOPES.inventory],\n [attribute.name]: attribute.value\n };\n if (attribute.name === 'device_type' && attribute.scope === ATTRIBUTE_SCOPES.inventory) {\n accu.inventory.device_type = [].concat(attribute.value);\n }\n return accu;\n },\n { inventory: { device_type: [], artifact_name: '' }, identity: {}, monitor: {}, system: {}, tags: {} }\n );\n\nexport const isDarkMode = mode => mode === DARK_MODE;\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { listItemMapper } from '@northern.tech/store/utils';\nimport { createSelector } from '@reduxjs/toolkit';\n\nconst getSelectedReleaseId = state => state.releases.selectedRelease;\nexport const getReleasesById = state => state.releases.byId;\nexport const getReleaseTags = state => state.releases.tags;\nexport const getReleaseListState = state => state.releases.releasesList;\nconst getListedReleases = state => state.releases.releasesList.releaseIds;\nexport const getUpdateTypes = state => state.releases.updateTypes;\n\nconst getReleaseMappingDefaults = () => ({});\nexport const getReleasesList = createSelector([getReleasesById, getListedReleases, getReleaseMappingDefaults], listItemMapper);\n\nexport const getReleaseTagsById = createSelector([getReleaseTags], releaseTags => releaseTags.reduce((accu, key) => ({ ...accu, [key]: key }), {}));\nexport const getHasReleases = createSelector(\n [getReleaseListState, getReleasesById],\n ({ searchTotal, total }, byId) => !!(Object.keys(byId).length || total || searchTotal)\n);\n\nexport const getSelectedRelease = createSelector([getReleasesById, getSelectedReleaseId], (byId, id) => byId[id] ?? {});\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// @ts-nocheck\nimport { DEVICE_ONLINE_CUTOFF, defaultIdAttribute } from '@northern.tech/store/constants';\nimport { isDarkMode } from '@northern.tech/store/utils';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport { READ_STATES, twoFAStates } from './constants';\n\nexport const getRolesById = state => state.users.rolesById;\nexport const getTooltipsById = state => state.users.tooltips.byId;\nexport const getGlobalSettings = state => state.users.globalSettings;\n\nconst getCurrentUserId = state => state.users.currentUser;\nconst getUsersById = state => state.users.byId;\nexport const getCurrentUser = createSelector([getUsersById, getCurrentUserId], (usersById, userId) => usersById[userId] ?? {});\nexport const getUserSettings = state => state.users.userSettings;\n\nexport const getIsDarkMode = createSelector([getUserSettings], ({ mode }) => isDarkMode(mode));\n\nexport const getShowHelptips = createSelector([getTooltipsById], tooltips =>\n Object.values(tooltips).reduce((accu, { readState }) => accu || readState === READ_STATES.unread, false)\n);\n\nexport const getTooltipsState = createSelector([getTooltipsById, getUserSettings], (byId, { tooltips = {} }) =>\n Object.entries(byId).reduce(\n (accu, [id, value]) => {\n accu[id] = { ...accu[id], ...value };\n return accu;\n },\n { ...tooltips }\n )\n);\n\nexport const getHas2FA = createSelector(\n [getCurrentUser],\n currentUser => currentUser.hasOwnProperty('tfa_status') && currentUser.tfa_status === twoFAStates.enabled\n);\n\nexport const getIdAttribute = createSelector([getGlobalSettings], ({ id_attribute = { ...defaultIdAttribute } }) => id_attribute);\n\nexport const getOfflineThresholdSettings = createSelector([getGlobalSettings], ({ offlineThreshold }) => ({\n interval: offlineThreshold?.interval || DEVICE_ONLINE_CUTOFF.interval,\n intervalUnit: offlineThreshold?.intervalUnit || DEVICE_ONLINE_CUTOFF.intervalName\n}));\n\nexport const getRolesList = createSelector([getRolesById], rolesById => Object.entries(rolesById).map(([id, role]) => ({ id, ...role })));\n\nexport const getCurrentSession = state => state.users.currentSession;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA,IAAAA,kBAA6F;AAC7F,IAAAC,kBAA+B;;;ACF/B,4BAA0E;AAE1E,IAAM,sBAAsB;AAAA,EAC1B,IAAI;AAAA,EACJ,cAAc;AAChB;AAEO,IAAM,UAAU;AAChB,IAAM,SAAS;AAAA,EACpB,IAAI,GAAG,OAAO;AAAA,EACd,IAAI,GAAG,OAAO;AAChB;AAQO,IAAM,aAAa;AAAA,EACxB,KAAK,EAAE,KAAK,OAAO,MAAM,sBAAAC,SAAa;AAAA,EACtC,KAAK,EAAE,KAAK,OAAO,MAAM,sBAAAC,gBAAa;AACxC;AACO,IAAM,sBAAsB,EAAE,UAAU,IAAI,OAAO,IAAI,WAAW,WAAW,IAAI,KAAK,WAAW,gBAAgB;AACjH,IAAM,oBAAoB;AAC1B,IAAM,iBAAiB,CAAC,iCAAK,sBAAL,EAA0B,OAAO,MAAM,WAAW,iBAAiB,MAAM,kBAAkB,EAAC;AAMpH,IAAM,QAAQ;AAAA,EAC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ACrC,CAAC,iBAAiB,gBAAgB,mBAAmB,cAAc;AAAA,EACnE,CAAC,EAAE,QAAQ,GAAG,EAAE,IAAI,cAAc,GAAG,gBAAgB,gBAAgB;AACnE,WAAO,WAAW,eAAe,GAAG,aAAa,UAAU,MAAM,OAAO,KAAK,WAAW,EAAE,SAAS,iBAAiB,CAAC;AAAA,EACvH;AACF;AAEA,IAAM,sBAAsB;AAAA,EAC1B,YAAY;AAAA,EACZ,QAAQ;AACV;AACA,IAAM,mBAAmB,EAAE,eAAe,EAAE,WAAW,CAAC,EAAE,GAAG,YAAY,2BAA2B;AACpG,IAAM,2BAA2B,MAAM;AAEhC,IAAM,2BAAuB;AAAA,EAClC,CAAC,gBAAgB,CAAC,OAAO,aAAa,oBAAoB,QAAQ,EAAE,KAAK,GAAG,wBAAwB;AAAA,EACpG;AACF;AAEO,IAAM,wBAAoB,gCAAe,CAAC,kBAAkB,cAAc,GAAG,CAAC,eAAe,gBAAgB;AAClH,MAAI,iBAAiB,CAAC;AACtB,MAAI,eAAe;AACjB,UAAM,EAAE,SAAS,CAAC,EAAE,IAAI;AACxB,UAAM,EAAE,SAAS,CAAC,GAAG,IAAI,KAAK,IAAI;AAClC,qBAAiB,SAAS,WAAW,iBAAE,MAAO,UAAW;AAAA,EAC3D;AACA,SAAO,kCAAK,iBAAmB,YAAY,eAAe,EAAE;AAC9D,CAAC;","names":["import_helpers","import_toolkit","BarChartIcon","PieChartIcon","_b","AWS","React","Azure","import_toolkit","accu","import_helpers","import_toolkit","import_toolkit","import_helpers","import_toolkit","import_toolkit","rolesById","rolesById","_b","getDemoDeviceAddressHelper"]}
1
+ {"version":3,"sources":["../src/commonSelectors.ts","../src/appSlice/constants.ts","../src/appSlice/selectors.ts","../src/commonConstants.tsx","../src/deploymentsSlice/selectors.ts","../src/devicesSlice/constants.ts","../src/monitorSlice/constants.ts","../src/onboardingSlice/constants.ts","../src/organizationSlice/constants.ts","../src/releasesSlice/constants.ts","../src/usersSlice/constants.ts","../src/deploymentsSlice/constants.ts","../src/devicesSlice/selectors.ts","../src/monitorSlice/selectors.ts","../src/onboardingSlice/selectors.ts","../src/organizationSlice/selectors.ts","../src/utils.ts","../src/releasesSlice/selectors.ts","../src/usersSlice/selectors.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.\n// @ts-nocheck\nimport { attributeDuplicateFilter, getDemoDeviceAddress as getDemoDeviceAddressHelper } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport { PLANS, defaultReports } from './appSlice/constants';\nimport { getFeatures, getSearchedDevices } from './appSlice/selectors';\nimport { ALL_DEVICES, ATTRIBUTE_SCOPES, DEVICE_ISSUE_OPTIONS, DEVICE_LIST_MAXIMUM_LENGTH, UNGROUPED_GROUP } from './commonConstants';\nimport { getDeploymentsById, getDeploymentsSelectionState, getSelectedDeploymentDeviceIds } from './deploymentsSlice/selectors';\nimport { inventoryApiUrlV2, reportingApiUrl } from './devicesSlice/constants';\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 { rolesById, rolesByName, serviceProviderRolesById, uiPermissionsById } from './usersSlice/constants';\nimport { getCurrentUser, getGlobalSettings, getRolesById, getRolesList, getUserSettings } 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 getAttrsEndpoint = createSelector([getFeatures], ({ hasReporting }) =>\n hasReporting ? `${reportingApiUrl}/devices/search/attributes` : `${inventoryApiUrlV2}/filters/attributes`\n);\nexport const getSearchEndpoint = createSelector([getFeatures], ({ hasReporting }) =>\n hasReporting ? `${reportingApiUrl}/devices/search` : `${inventoryApiUrlV2}/filters/search`\n);\n\nexport const getUserRoles = createSelector(\n [getCurrentUser, getRolesById, getIsEnterprise, getFeatures, getOrganization],\n (currentUser, rolesById, isEnterprise, { isHosted, hasMultitenancy }, { plan = PLANS.os.id }) => {\n const isAdmin = currentUser.roles?.length\n ? currentUser.roles.some(role => role === rolesByName.admin)\n : !(hasMultitenancy || isEnterprise || (isHosted && plan !== PLANS.os.id));\n const uiPermissions = isAdmin\n ? mapUserRolesToUiPermissions([rolesByName.admin], rolesById)\n : mapUserRolesToUiPermissions(currentUser.roles || [], rolesById);\n return { isAdmin, uiPermissions };\n }\n);\n\nconst hasPermission = (thing, permission) => 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 = uiPermissions.deployments.includes(uiPermissionsById.deploy.value) || hasPermission(uiPermissions.groups, uiPermissionsById.deploy.value);\n const canReadDeployments = uiPermissions.deployments.includes(uiPermissionsById.read.value);\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 { hasAuditlogs: isAuditlogEnabled, hasDeviceConfig: isDeviceConfigEnabled, hasDeviceConnect: isDeviceConnectEnabled, hasMonitor: isMonitorEnabled },\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 = isDeviceConfigEnabled && addons.some(addon => addon.name === 'configure' && Boolean(addon.enabled));\n const hasDeviceConnect = isDeviceConnectEnabled && (!isEnterprise || addons.some(addon => addon.name === 'troubleshoot' && Boolean(addon.enabled)));\n const hasMonitor = isMonitorEnabled && addons.some(addon => addon.name === 'monitor' && Boolean(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;\n return {\n deployment,\n selectedDevices: selectedDeviceIds.map(deviceId => ({ ...devicesById[deviceId], ...devices[deviceId] }))\n };\n }\n);\n\nexport const getAvailableIssueOptionsByType = createSelector(\n [getFeatures, getTenantCapabilities, getIssueCountsByType],\n ({ hasReporting }, { hasFullFiltering, hasMonitor }, issueCounts) =>\n Object.values(DEVICE_ISSUE_OPTIONS).reduce((accu, { isCategory, key, needsFullFiltering, needsMonitor, needsReporting, title }) => {\n if (isCategory || (needsReporting && !hasReporting) || (needsFullFiltering && !hasFullFiltering) || (needsMonitor && !hasMonitor)) {\n return accu;\n }\n accu[key] = { count: issueCounts[key].filtered, key, title };\n return accu;\n }, {})\n);\n\nexport const getGroupNames = createSelector([getGroupsById, getUserRoles, (_, options = {}) => options], (groupsById, { uiPermissions }, { staticOnly }) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [UNGROUPED_GROUP.id]: ungrouped, ...groups } = groupsById;\n if (staticOnly) {\n return Object.keys(uiPermissions.groups).sort();\n }\n return Object.keys(\n Object.entries(groups).reduce((accu, [groupName, group]) => {\n if (group.filterId || uiPermissions.groups[ALL_DEVICES]) {\n accu[groupName] = group;\n }\n return accu;\n }, uiPermissions.groups)\n ).sort();\n});\n\nexport const getDeviceReportsForUser = createSelector(\n [getUserSettings, getCurrentUser, getGlobalSettings, getDevicesById],\n ({ reports }, { id: currentUserId }, globalSettings, devicesById) => {\n return reports || globalSettings[`${currentUserId}-reports`] || (Object.keys(devicesById).length ? defaultReports : []);\n }\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 = {};\n if (auditlogEvent) {\n const { object = {} } = auditlogEvent;\n const { device = {}, id, type } = object;\n auditlogDevice = type === 'device' ? { id, ...device } : auditlogDevice;\n }\n return { ...auditlogDevice, ...devicesById[auditlogDevice.id] };\n});\n\nexport const getRelevantRoles = createSelector([getOrganization, getRolesList], ({ service_provider }, roles) => {\n if (service_provider) {\n return roles.reduce((accu, role) => {\n if (rolesById[role.id]) {\n return accu;\n }\n accu.push(role);\n return accu;\n }, Object.values(serviceProviderRolesById));\n }\n return Object.keys(rolesById)\n .reverse()\n .reduce((accu, key) => {\n const index = accu.findIndex(({ id }) => id === key);\n accu = [accu[index], ...accu.filter((item, itemIndex) => index !== itemIndex)];\n return accu;\n }, roles);\n});\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { BarChart as BarChartIcon, PieChartOutline as PieChartIcon } from '@mui/icons-material';\n\nconst startingDeviceCount = {\n os: 'for first 50 devices',\n professional: 'for first 250 devices'\n};\n\nexport const apiRoot = '/api/management';\nexport const apiUrl = {\n v1: `${apiRoot}/v1`,\n v2: `${apiRoot}/v2`\n};\n\nexport const headerNames = {\n link: 'link',\n location: 'location',\n total: 'x-total-count'\n};\n\nexport const chartTypes = {\n bar: { key: 'bar', Icon: BarChartIcon },\n pie: { key: 'pie', Icon: PieChartIcon }\n};\nexport const emptyChartSelection = { software: '', group: '', chartType: chartTypes.bar.key, attribute: 'artifact_name' };\nexport const defaultReportType = 'distribution';\nexport const defaultReports = [{ ...emptyChartSelection, group: null, attribute: 'artifact_name', type: defaultReportType }];\n\nexport const BEGINNING_OF_TIME = '2016-01-01T00:00:00.000Z';\n\nexport const locations = {};\n\nexport const PLANS = {\n os: {\n id: 'os',\n name: 'Basic',\n offer: true,\n price: '$32/month',\n deviceCount: startingDeviceCount.os,\n offerprice: '$23/month for first 50 devices',\n price2: 'for first 6 months;\\n$29/month thereafter',\n features: ['Basic OTA features']\n },\n professional: {\n id: 'professional',\n name: 'Professional',\n offer: true,\n price: '$269/month',\n deviceCount: startingDeviceCount.professional,\n offerprice: '$200/month for first 50 devices',\n price2: 'for first 6 months;\\n$249/month thereafter',\n features: ['+ Advanced OTA features', '+ Standard support']\n },\n enterprise: {\n id: 'enterprise',\n name: 'Enterprise',\n price: 'Custom pricing',\n deviceCount: 'unlimited devices',\n features: ['+ Enterprise-grade OTA features', '+ Premium support']\n }\n};\n// the needs names need to be aligned with the name of the features in the appReducer, as they will be checked in the addonselection\nexport const ADDONS = {\n configure: {\n id: 'configure',\n title: 'Configure',\n description: 'Expand your plan with device configuration features',\n needs: ['hasDeviceConfig'],\n os: {\n price: '$11/month',\n deviceCount: startingDeviceCount.os\n },\n professional: {\n price: '$65/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['os', 'professional', 'enterprise']\n },\n troubleshoot: {\n id: 'troubleshoot',\n title: 'Troubleshoot',\n description: 'Expand your plan with device troubleshooting features',\n needs: ['hasDeviceConnect'],\n os: {\n price: '$27/month',\n deviceCount: startingDeviceCount.os\n },\n professional: {\n price: '$72/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['os', 'professional', 'enterprise']\n },\n monitor: {\n id: 'monitor',\n title: 'Monitor',\n description: 'Expand your plan with device monitoring features',\n needs: ['hasMonitor'],\n os: {\n price: '-',\n deviceCount: '-'\n },\n professional: {\n price: '$86/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['professional', 'enterprise']\n }\n};\n\nexport const BENEFITS = {\n auditlog: { id: 'auditlog', benefit: 'trace change across your devices and access troubleshooting session replay', requiredPlan: PLANS.professional.id },\n dashboard: { id: 'dashboard', benefit: 'actionable insights into the devices you are updating with Mender', requiredPlan: PLANS.enterprise.id },\n deltaGeneration: {\n id: 'deltaGeneration',\n benefit: 'automatic delta artifacts generation to minimize data transfer and improve the update delivery',\n requiredPlan: PLANS.enterprise.id\n },\n deviceConfiguration: { id: 'deviceConfiguration', benefit: 'device configuration features', requiredAddon: ADDONS.configure.id },\n deviceMonitor: { id: 'deviceMonitor', benefit: 'device monitoring features', requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },\n deviceTroubleshoot: { id: 'deviceTroubleshoot', benefit: 'device troubleshooting features', requiredAddon: ADDONS.troubleshoot.id },\n dynamicGroups: { id: 'dynamicGroups', benefit: 'create dynamic groups to ease device management', requiredPlan: PLANS.enterprise.id },\n fullFiltering: { id: 'fullFiltering', benefit: 'filtering by multiple attributes to improve the device overview', requiredPlan: PLANS.professional.id },\n gateway: { id: 'gateway', benefit: 'see devices connected to your gateway device for easy access', requiredPlans: PLANS.professional.id },\n pausedDeployments: {\n id: 'pausedDeployments',\n benefit: 'granular control about update rollout to allow synchronization across your fleet',\n requiredPlan: PLANS.enterprise.id\n },\n phasedDeployments: { id: 'phasedDeployments', benefit: 'choose to roll out deployments in multiple phases', requiredPlan: PLANS.enterprise.id },\n rbac: { id: 'rbac', benefit: 'granular role based access control', requiredPlan: PLANS.enterprise.id },\n retryDeployments: { id: 'retryDeployments', benefit: 'optional retries for failed rollout attempts', requiredPlan: PLANS.professional.id },\n scheduledDeployments: {\n id: 'scheduledDeployments',\n benefit: 'scheduled deployments to steer the distribution of your updates.',\n requiredPlan: PLANS.professional.id\n },\n webhookEvents: {\n id: 'webhookEvents',\n benefit: 'receive inventory events and select which type(s) of events the webhook will receive',\n requiredPlan: PLANS.professional.id\n },\n\n default: { id: 'default', benefit: 'gain access to this feature', requiredPlan: PLANS.enterprise.id }\n};\n\nexport const yes = () => true;\nexport const canAccess = yes;\n\nexport const DARK_MODE = 'dark';\nexport const LIGHT_MODE = 'light';\n\nexport const APPLICATION_JSON_CONTENT_TYPE = 'application/json';\nexport const APPLICATION_JWT_CONTENT_TYPE = 'application/jwt';\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { versionCompare } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\n\nconst getAppDocsVersion = state => state.app.docsVersion;\nexport const getFeatures = state => state.app.features;\nexport const getFullVersionInformation = state => state.app.versionInformation;\n\nexport const getDocsVersion = createSelector([getAppDocsVersion, getFeatures], (appDocsVersion, { isHosted }) => {\n // if hosted, use latest docs version\n const docsVersion = appDocsVersion ? `${appDocsVersion}/` : 'development/';\n return isHosted ? '' : docsVersion;\n});\n\nexport const getSearchState = state => state.app.searchState;\n\nexport const getSearchedDevices = createSelector([getSearchState], ({ deviceIds }) => deviceIds);\nexport const getVersionInformation = createSelector([getFullVersionInformation, getFeatures], ({ Integration, ...remainder }, { isHosted }) =>\n isHosted && Integration !== 'next' ? remainder : { ...remainder, Integration }\n);\nexport const getIsPreview = createSelector([getFullVersionInformation], ({ Integration }) => versionCompare(Integration, 'next') > -1);\n","// 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.\n// @ts-nocheck\nimport React from 'react';\n\nimport { mdiAws as AWS, mdiMicrosoftAzure as Azure } from '@mdi/js';\n\nexport const DEVICE_LIST_DEFAULTS = {\n page: 1,\n perPage: 20\n};\n\nexport const timeUnits = {\n days: 'days',\n minutes: 'minutes',\n hours: 'hours'\n};\n\nexport const ALL_DEVICES = 'All devices';\nexport const UNGROUPED_GROUP = { id: '*|=ungrouped=|*', name: 'Unassigned' };\n\nexport const DEVICE_LIST_MAXIMUM_LENGTH = 50;\n\nexport const DEVICE_FILTERING_OPTIONS = {\n $eq: { key: '$eq', title: 'equals', shortform: '=' },\n $ne: { key: '$ne', title: 'not equal', shortform: '!=' },\n $gt: {\n key: '$gt',\n title: '>',\n shortform: '>',\n help: 'The \"greater than\" operator can work both on numbers and strings. In the latter case, the operator applies the lexicographical order to the value strings.'\n },\n $gte: {\n title: '>=',\n shortform: '>=',\n help: 'The \"greater than or equal\" operator can work both on numbers and strings. In the latter case, the operator applies the lexicographical order to the value strings.'\n },\n $lt: {\n key: '$lt',\n title: '<',\n shortform: '<',\n help: 'The \"lesser than\" operator can work both on numbers and strings. In the latter case, the operator applies the lexicographical order to the value strings.'\n },\n $lte: {\n title: '<=',\n shortform: '<=',\n help: 'The \"lesser than or equal\" operator can work both on numbers and strings. In the latter case, the operator applies the lexicographical order to the value strings.'\n },\n $ltne: {\n key: '$ltne',\n title: '$ltne',\n shortform: 'ltne',\n help: 'The \"lesser than or does not exist\" operator can work both on numbers and strings. In the latter case, the operator applies the lexicographical order to the value strings.'\n },\n $in: {\n key: '$in',\n title: 'in',\n shortform: 'in',\n help: 'The \"in\" operator accepts a list of comma-separated values. It matches if the selected field is equal to one of the specified values.'\n },\n $nin: {\n key: '$nin',\n title: 'not in',\n shortform: 'not in',\n help: `The \"not in\" operator accepts a list of comma-separated values. It matches if the selected field's value is not equal to any of the specified options.`\n },\n $exists: {\n key: '$exists',\n title: 'exists',\n shortform: 'exists',\n value: true,\n help: `The \"exists\" operator matches if the selected field's value has a value. No value needs to be provided for this operator.`\n },\n $nexists: {\n key: '$nexists',\n title: `doesn't exist`,\n shortform: `doesn't exist`,\n value: true,\n help: `The \"doesn't exist\" operator matches if the selected field's value has no value. No value needs to be provided for this operator.`\n },\n $regex: {\n key: '$regex',\n title: `matches regular expression`,\n shortform: `matches`,\n help: `The \"regular expression\" operator matches the selected field's value with a Perl compatible regular expression (PCRE), automatically anchored by ^. If the regular expression is not valid, the filter will produce no results. If you need to specify options and flags, you can provide the full regex in the format of /regex/flags, for example.`\n }\n};\n\nexport const DEVICE_ISSUE_OPTIONS = {\n issues: {\n isCategory: true,\n key: 'issues',\n title: 'Devices with issues',\n filterRule: {}\n },\n offline: {\n issueCategory: 'issues',\n key: 'offline',\n needsFullFiltering: true,\n needsMonitor: false,\n needsReporting: false,\n filterRule: {\n scope: 'system',\n key: 'check_in_time',\n operator: DEVICE_FILTERING_OPTIONS.$ltne.key,\n value: ({ offlineThreshold }) => offlineThreshold\n },\n title: 'Offline devices'\n },\n failedLastUpdate: {\n issueCategory: 'issues',\n key: 'failedLastUpdate',\n needsFullFiltering: false,\n needsMonitor: false,\n needsReporting: true,\n filterRule: { scope: 'monitor', key: 'failed_last_update', operator: DEVICE_FILTERING_OPTIONS.$eq.key, value: true },\n title: 'Deployment failed'\n },\n monitoring: {\n issueCategory: 'issues',\n key: 'monitoring',\n needsFullFiltering: false,\n needsMonitor: true,\n needsReporting: false,\n filterRule: { scope: 'monitor', key: 'alerts', operator: DEVICE_FILTERING_OPTIONS.$eq.key, value: true },\n title: 'Monitoring alert'\n },\n authRequests: {\n key: 'authRequests',\n needsFullFiltering: false,\n needsMonitor: false,\n needsReporting: true,\n filterRule: { scope: 'monitor', key: 'auth_requests', operator: DEVICE_FILTERING_OPTIONS.$gt.key, value: 1 },\n title: 'Devices with new authentication requests'\n },\n gatewayDevices: {\n key: 'gatewayDevices',\n needsFullFiltering: false,\n needsMonitor: false,\n needsReporting: true,\n filterRule: { scope: 'inventory', key: 'mender_is_gateway', operator: DEVICE_FILTERING_OPTIONS.$eq.key, value: 'true' },\n title: 'Gateway devices'\n }\n};\nconst oneSecond = 1000;\nexport const TIMEOUTS = {\n debounceDefault: 700,\n debounceShort: 300,\n halfASecond: 0.5 * oneSecond,\n oneSecond,\n twoSeconds: 2 * oneSecond,\n threeSeconds: 3 * oneSecond,\n fiveSeconds: 5 * oneSecond,\n refreshDefault: 10 * oneSecond,\n refreshLong: 60 * oneSecond\n};\n\nexport const SORTING_OPTIONS = {\n asc: 'asc',\n desc: 'desc'\n};\n\nexport const DEVICE_ONLINE_CUTOFF = { interval: 1, intervalName: timeUnits.days };\n\nexport const ATTRIBUTE_SCOPES = {\n inventory: 'inventory',\n identity: 'identity',\n monitor: 'monitor',\n system: 'system',\n tags: 'tags'\n};\n\nexport const defaultIdAttribute = Object.freeze({ attribute: 'id', scope: ATTRIBUTE_SCOPES.identity });\n\nconst credentialTypes = {\n aws: 'aws',\n http: 'http',\n sas: 'sas',\n x509: 'x509'\n};\nexport const EXTERNAL_PROVIDER = {\n 'iot-core': {\n credentialsType: credentialTypes.aws,\n icon: AWS,\n title: 'AWS IoT Core',\n twinTitle: 'Device Shadow',\n provider: 'iot-core',\n enabled: true,\n deviceTwin: true,\n configHint: <>For help finding your AWS IoT Core connection string, check the AWS IoT documentation.</>\n },\n 'iot-hub': {\n credentialsType: credentialTypes.sas,\n icon: Azure,\n title: 'Azure IoT Hub',\n twinTitle: 'Device Twin',\n provider: 'iot-hub',\n enabled: true,\n deviceTwin: true,\n configHint: (\n <span>\n For help finding your Azure IoT Hub connection string, look under &apos;Shared access policies&apos; in the Microsoft Azure UI as described{' '}\n {\n <a\n href=\"https://devblogs.microsoft.com/iotdev/understand-different-connection-strings-in-azure-iot-hub/#iothubconn\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n here\n </a>\n }\n .\n </span>\n )\n },\n webhook: {\n credentialsType: credentialTypes.http,\n deviceTwin: false,\n // disable the webhook provider here, since it is treated different than other integrations, with a custom configuration & management view, etc.\n enabled: false,\n provider: 'webhook'\n }\n};\nexport const MAX_PAGE_SIZE = 500;\n\nexport const ALL_RELEASES = 'All releases';\n\nexport type UiPermissionsDefinition = Readonly<{\n auditlog: string[];\n deployments?: string[]; // deployments are so far only covered indirectly through releases + device group permissions\n groups: Record<string, string[]>;\n releases: Record<string, string[]>;\n tenantManagement: string[];\n userManagement: string[];\n}>;\n\nexport type UiRoleDefinition = {\n name: string;\n description: string;\n editable?: boolean;\n isCustom?: boolean;\n permissions?: object[];\n uiPermissions: UiPermissionsDefinition;\n};\n\nexport const emptyUiPermissions: UiPermissionsDefinition = Object.freeze({\n auditlog: [],\n deployments: [],\n groups: Object.freeze({}),\n releases: Object.freeze({}),\n tenantManagement: [],\n userManagement: []\n});\n\nexport const emptyRole: UiRoleDefinition = Object.freeze({\n name: undefined,\n description: '',\n permissions: [],\n uiPermissions: Object.freeze({ ...emptyUiPermissions })\n});\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// @ts-nocheck\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport { DEPLOYMENT_STATES } from './constants';\n\nexport const getDeploymentsById = state => state.deployments.byId;\nexport const getDeploymentsByStatus = state => state.deployments.byStatus;\nexport const getSelectedDeploymentDeviceIds = state => state.deployments.selectedDeviceIds;\nexport const getDeploymentsSelectionState = state => state.deployments.selectionState;\n\nexport const getMappedDeploymentSelection = createSelector(\n [getDeploymentsSelectionState, (_, deploymentsState) => deploymentsState, getDeploymentsById],\n (selectionState, deploymentsState, deploymentsById) => {\n const { selection = [] } = selectionState[deploymentsState] ?? {};\n return selection.reduce((accu, id) => {\n if (deploymentsById[id]) {\n accu.push(deploymentsById[id]);\n }\n return accu;\n }, []);\n }\n);\n\nconst relevantDeploymentStates = [DEPLOYMENT_STATES.pending, DEPLOYMENT_STATES.inprogress, DEPLOYMENT_STATES.finished];\nexport const DEPLOYMENT_CUTOFF = 3;\nexport const getRecentDeployments = createSelector([getDeploymentsById, getDeploymentsByStatus], (deploymentsById, deploymentsByStatus) =>\n Object.entries(deploymentsByStatus).reduce(\n (accu, [state, byStatus]) => {\n if (!relevantDeploymentStates.includes(state) || !byStatus.deploymentIds.length) {\n return accu;\n }\n accu[state] = byStatus.deploymentIds\n .reduce((accu, id) => {\n if (deploymentsById[id]) {\n accu.push(deploymentsById[id]);\n }\n return accu;\n }, [])\n .slice(0, DEPLOYMENT_CUTOFF);\n accu.total += byStatus.total;\n return accu;\n },\n { total: 0 }\n )\n);\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { DEVICE_FILTERING_OPTIONS, apiUrl } from '@northern.tech/store/constants';\n\nexport const emptyFilter = { key: null, value: '', operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: 'inventory' };\n\nexport const deviceAuthV2 = `${apiUrl.v2}/devauth`;\nexport const deviceConnect = `${apiUrl.v1}/deviceconnect`;\nexport const inventoryApiUrl = `${apiUrl.v1}/inventory`;\nexport const inventoryApiUrlV2 = `${apiUrl.v2}/inventory`;\nexport const deviceConfig = `${apiUrl.v1}/deviceconfig/configurations/device`;\nexport const reportingApiUrl = `${apiUrl.v1}/reporting`;\nexport const iotManagerBaseURL = `${apiUrl.v1}/iot-manager`;\n\n// see https://github.com/mendersoftware/go-lib-micro/tree/master/ws\n// for the description of proto_header and the consts\n// *Note*: this needs to be aligned with mender-connect and deviceconnect.\nexport const DEVICE_MESSAGE_PROTOCOLS = {\n Shell: 1\n};\nexport const DEVICE_MESSAGE_TYPES = {\n Delay: 'delay',\n New: 'new',\n Ping: 'ping',\n Pong: 'pong',\n Resize: 'resize',\n Shell: 'shell',\n Stop: 'stop'\n};\n\n// we can't include the dismiss state with the rest since this would include dismissed devices in several queries\nexport const DEVICE_DISMISSAL_STATE = 'dismiss';\nexport const ALL_DEVICE_STATES = 'any';\nexport const DEVICE_STATES = {\n accepted: 'accepted',\n pending: 'pending',\n preauth: 'preauthorized',\n rejected: 'rejected'\n};\nexport const DEVICE_CONNECT_STATES = {\n connected: 'connected',\n disconnected: 'disconnected',\n unknown: 'unknown'\n};\n\nexport const geoAttributes = ['geo-lat', 'geo-lon'].map(attribute => ({ attribute, scope: 'inventory' }));\n","// Copyright 2021 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\nimport { apiUrl } from '@northern.tech/store/constants';\n\n// limitations under the License.\nexport const alertChannels = { email: 'email' };\nexport const monitorApiUrlv1 = `${apiUrl.v1}/devicemonitor`;\n","// Copyright 2020 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.\nexport const onboardingSteps = {\n ONBOARDING_START: 'onboarding-start',\n DEVICES_PENDING_ONBOARDING_START: 'devices-pending-onboarding-start',\n DASHBOARD_ONBOARDING_START: 'dashboard-onboarding-start',\n DASHBOARD_ONBOARDING_PENDINGS: 'dashboard-onboarding-pendings',\n DEVICES_DELAYED_ONBOARDING: 'devices-delayed-onboarding',\n DEVICES_PENDING_ONBOARDING: 'devices-pending-onboarding',\n DEVICES_ACCEPTED_ONBOARDING: 'devices-accepted-onboarding',\n DEVICES_PENDING_ACCEPTING_ONBOARDING: 'devices-pending-accepting-onboarding',\n DEVICES_DEPLOY_RELEASE_ONBOARDING: 'devices-deploy-release-onboarding',\n SCHEDULING_ARTIFACT_SELECTION: 'scheduling-artifact-selection',\n SCHEDULING_ALL_DEVICES_SELECTION: 'scheduling-all-devices-selection',\n SCHEDULING_GROUP_SELECTION: 'scheduling-group-selection',\n SCHEDULING_RELEASE_TO_DEVICES: 'scheduling-release-to-devices',\n DEPLOYMENTS_INPROGRESS: 'deployments-inprogress',\n DEPLOYMENTS_PAST: 'deployments-past',\n DEPLOYMENTS_PAST_COMPLETED: 'deployments-past-completed',\n DEPLOYMENTS_PAST_COMPLETED_FAILURE: 'deployments-past-completed-failure',\n ONBOARDING_CANCELED: 'onboarding-canceled'\n};\n\nexport const orderedOnboardingSteps = [\n onboardingSteps.DASHBOARD_ONBOARDING_START,\n onboardingSteps.DEVICES_PENDING_ONBOARDING_START,\n onboardingSteps.DEVICES_DELAYED_ONBOARDING,\n onboardingSteps.DEVICES_PENDING_ONBOARDING,\n onboardingSteps.DEVICES_PENDING_ACCEPTING_ONBOARDING,\n onboardingSteps.DASHBOARD_ONBOARDING_PENDINGS,\n onboardingSteps.DEVICES_ACCEPTED_ONBOARDING,\n onboardingSteps.DEVICES_DEPLOY_RELEASE_ONBOARDING,\n onboardingSteps.SCHEDULING_ALL_DEVICES_SELECTION,\n onboardingSteps.SCHEDULING_GROUP_SELECTION,\n onboardingSteps.SCHEDULING_ARTIFACT_SELECTION,\n onboardingSteps.SCHEDULING_RELEASE_TO_DEVICES,\n onboardingSteps.DEPLOYMENTS_INPROGRESS,\n onboardingSteps.DEPLOYMENTS_PAST,\n onboardingSteps.DEPLOYMENTS_PAST_COMPLETED,\n onboardingSteps.DEPLOYMENTS_PAST_COMPLETED_FAILURE,\n onboardingSteps.ONBOARDING_CANCELED\n];\n","// Copyright 2020 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.\n// @ts-nocheck\nimport { Integration } from '@northern.tech/store/api/types/MenderTypes';\nimport { EXTERNAL_PROVIDER, apiUrl, useradmApiUrl } from '@northern.tech/store/constants';\n\nexport const auditLogsApiUrl = `${apiUrl.v1}/auditlogs`;\nexport const tenantadmApiUrlv1 = `${apiUrl.v1}/tenantadm`;\nexport const tenantadmApiUrlv2 = `${apiUrl.v2}/tenantadm`;\nexport const ssoIdpApiUrlv1 = `${apiUrl.v1}/useradm/sso/idp/metadata`;\n\nexport const XML_METADATA_FORMAT = 'xml';\nexport const JSON_METADATA_FORMAT = 'json';\n\nexport const getSamlStartUrl = id => `${window.location.origin}${useradmApiUrl}/auth/sso/${id}/login`;\nexport const getOidcStartUrl = id => `${window.location.origin}${useradmApiUrl}/oidc/${id}/start`;\n\nexport const SSO_TYPES = {\n saml: {\n id: 'saml',\n type: 'saml',\n title: 'SAML',\n metadataFormat: XML_METADATA_FORMAT,\n editorLanguage: XML_METADATA_FORMAT,\n contentType: 'application/samlmetadata+xml',\n getStartUrl: getSamlStartUrl,\n configDetails: [\n { key: 'entityID', label: 'Entity ID', getValue: id => `${window.location.origin}${useradmApiUrl}/sso/sp/metadata/${id}` },\n { key: 'acs', label: 'ACS URL', getValue: id => `${window.location.origin}${useradmApiUrl}/auth/sso/${id}/acs` },\n { key: 'startURL', label: 'Start URL', getValue: getSamlStartUrl }\n ]\n },\n oidc: {\n id: 'oidc',\n type: 'oidc',\n title: 'OpenID Connect',\n metadataFormat: JSON_METADATA_FORMAT,\n editorLanguage: JSON_METADATA_FORMAT,\n contentType: 'application/json',\n getStartUrl: getOidcStartUrl,\n configDetails: [{ key: 'startURL', label: 'Start Url', getValue: getOidcStartUrl }]\n }\n};\n\nexport const AUDIT_LOGS_TYPES = [\n { title: 'Artifact', queryParameter: 'object_type', value: 'artifact' },\n { title: 'Deployment', queryParameter: 'object_deployment_name', value: 'deployment' },\n { title: 'Device', queryParameter: 'object_id', value: 'device' },\n { title: 'User', queryParameter: 'object_id', value: 'user' }\n];\nexport const SP_AUDIT_LOGS_TYPES = [AUDIT_LOGS_TYPES[3], { title: 'Tenant', queryParameter: 'object_id', value: 'tenant' }];\n\nexport interface Webhook extends Integration {\n provider: Integration.provider.WEBHOOK;\n scopes?: string[];\n}\n\nexport const emptyWebhook: Webhook = {\n description: '',\n enabled: true,\n credentials: {\n type: EXTERNAL_PROVIDER.webhook.credentialsType,\n [EXTERNAL_PROVIDER.webhook.credentialsType]: {\n secret: '',\n url: ''\n }\n }\n};\nexport const TENANT_LIST_DEFAULT = {\n page: 1,\n perPage: 20\n};\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nexport const ARTIFACT_GENERATION_TYPE = { SINGLE_FILE: 'single_file' };\n\nexport const currentArtifact = 'artifact_name';\nexport const rootfsImageVersion = 'rootfs-image.version';\nexport const softwareTitleMap = { [rootfsImageVersion]: { title: 'Root filesystem', priority: 0, key: rootfsImageVersion } };\n","'use strict';\n\n// Copyright 2015 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 { ALL_DEVICES, ALL_RELEASES, apiUrl, emptyUiPermissions } from '@northern.tech/store/constants';\n\nexport const useradmApiUrlv1 = `${apiUrl.v1}/useradm`;\nexport const useradmApiUrlv2 = `${apiUrl.v2}/useradm`;\nexport { useradmApiUrlv1 as useradmApiUrl };\n\nexport type UiPermission = {\n explanations: object;\n permissionSets: Record<string, string>;\n permissionLevel: number;\n title: string;\n value: string;\n verbs: string[];\n};\n\ntype ExcessiveAccessConfig = {\n selector: string;\n warning: string;\n};\n\ntype EndpointDefinition = {\n path: RegExp;\n types: string[];\n uiPermissions: UiPermission[];\n};\n\nexport type PermissionsArea = {\n endpoints: EndpointDefinition[];\n explanation: string;\n uiPermissions: UiPermission[];\n title: string;\n key: string;\n scope?: string;\n filter?: (object) => string[];\n placeholder?: string;\n excessiveAccessConfig?: ExcessiveAccessConfig;\n};\n\nconst staticRolesByName = {\n admin: 'RBAC_ROLE_PERMIT_ALL',\n readOnly: 'RBAC_ROLE_OBSERVER',\n ci: 'RBAC_ROLE_CI',\n deploymentsManager: 'RBAC_ROLE_DEPLOYMENTS_MANAGER',\n terminalAccess: 'RBAC_ROLE_REMOTE_TERMINAL'\n};\n\nexport const PermissionTypes = {\n Any: 'any',\n Get: 'GET',\n Post: 'POST',\n Put: 'PUT',\n Delete: 'DELETE',\n Patch: 'PATCH',\n DeviceGroup: 'DEVICE_GROUP',\n DeviceId: 'DEVICE_ID'\n};\n\nconst permissionSetIds = {\n Basic: 'Basic',\n ConfigureDevices: 'ConfigureDevices',\n ConnectToDevices: 'ConnectToDevices',\n DeployToDevices: 'DeployToDevices',\n ManageDevices: 'ManageDevices',\n ManageReleases: 'ManageReleases',\n ManageTenants: 'ManageTenants',\n ManageUsers: 'ManageUsers',\n ReadAuditLogs: 'ReadAuditLogs',\n ReadDevices: 'ReadDevices',\n ReadReleases: 'ReadReleases',\n ReadTenants: 'ReadTenants',\n ReadUsers: 'ReadUsers',\n SuperUser: 'SuperUser',\n UploadArtifacts: 'UploadArtifacts'\n};\n\nexport const uiPermissionsById = {\n configure: {\n explanations: { groups: `'Configure' allows the user to use mender-configure features and apply configurations.` },\n permissionLevel: 2,\n permissionSets: { groups: permissionSetIds.ConfigureDevices },\n title: 'Configure',\n value: 'configure',\n verbs: [PermissionTypes.Get, PermissionTypes.Put, PermissionTypes.Post]\n },\n connect: {\n explanations: { groups: `'Connect' allows the user to use mender-connect features and Troubleshoot add-ons.` },\n permissionLevel: 2,\n permissionSets: { groups: permissionSetIds.ConnectToDevices },\n title: 'Connect',\n value: 'connect',\n verbs: [PermissionTypes.Get, PermissionTypes.Put]\n },\n deploy: {\n explanations: { groups: `'Deploy' allows the user to deploy software or configuration updates to devices.` },\n permissionLevel: 2,\n permissionSets: { deployments: permissionSetIds.DeployToDevices, groups: permissionSetIds.DeployToDevices },\n title: 'Deploy',\n value: 'deploy',\n verbs: [PermissionTypes.Post]\n },\n manage: {\n explanations: {\n groups: `'Manage' allows the user to edit device name, notes, and manage authentication status. For 'All devices' it also allows the user to edit and create device groups.`,\n releases: `'Manage' allows the user to upload new artifacts, edit release descriptions and remove artifacts.`\n },\n permissionLevel: 2,\n permissionSets: {\n groups: permissionSetIds.ManageDevices,\n releases: permissionSetIds.ManageReleases,\n tenantManagement: permissionSetIds.ManageTenants,\n userManagement: permissionSetIds.ManageUsers\n },\n title: 'Manage',\n value: 'manage',\n verbs: [PermissionTypes.Post, PermissionTypes.Put, PermissionTypes.Patch]\n },\n read: {\n explanations: { groups: `'Read' allows the user to view devices.` },\n permissionLevel: 1,\n permissionSets: {\n auditlog: permissionSetIds.ReadAuditLogs,\n groups: permissionSetIds.ReadDevices,\n releases: permissionSetIds.ReadReleases,\n tenantManagement: permissionSetIds.ReadTenants,\n userManagement: permissionSetIds.ReadUsers\n },\n title: 'Read',\n value: 'read',\n verbs: [PermissionTypes.Get, PermissionTypes.Post]\n },\n upload: {\n explanations: { groups: `'Upload' allows the user to upload new Artifacts.` },\n unscopedOnly: { releases: true },\n permissionLevel: 1,\n permissionSets: { releases: permissionSetIds.UploadArtifacts },\n title: 'Upload',\n value: 'upload',\n verbs: [PermissionTypes.Post, PermissionTypes.Put, PermissionTypes.Patch]\n }\n};\n\n/**\n * _uiPermissions_ represent the possible permissions/ rights that can be given for the area\n * _endpoints_ represent the possible endpoints this definition might be affecting in the UI and what\n * functionality might be affected\n *\n */\nexport const scopedPermissionAreas = {\n groups: { key: 'groups', excessiveAccessSelector: ALL_DEVICES, scopeType: 'DeviceGroups' },\n releases: { key: 'releases', excessiveAccessSelector: ALL_RELEASES, scopeType: 'Releases' }\n};\n\nexport const uiPermissionsByArea = {\n auditlog: {\n endpoints: [{ path: /\\/(auditlog)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] }],\n explanation:\n 'Granting access to the audit log will allow tracing changes to devices, releases and user accounts, as well as providing information about deployments.',\n key: 'auditlog',\n uiPermissions: [uiPermissionsById.read],\n title: 'System audit log'\n },\n deployments: {\n endpoints: [\n { path: /\\/(deployments\\/deployments)/i, types: [PermissionTypes.Post, PermissionTypes.Put], uiPermissions: [uiPermissionsById.deploy] },\n { path: /\\/(deployments\\/deployments)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] },\n { path: /\\/(deployments\\/config)/i, types: [PermissionTypes.Get, PermissionTypes.Put], uiPermissions: [uiPermissionsById.manage] }\n ],\n explanation: 'Providing deploy permissions will allow deployments to be created using the releases and devices a user has access to.',\n key: 'deployments',\n uiPermissions: [uiPermissionsById.read, uiPermissionsById.deploy],\n title: 'Deployments'\n },\n groups: {\n endpoints: [\n {\n path: /\\/(devauth|inventory|deviceconfig|devicemonitor|deviceconnect\\/devices)/i,\n types: [PermissionTypes.Get],\n uiPermissions: [uiPermissionsById.read]\n },\n { path: /\\/(devauth|inventory)/i, types: [PermissionTypes.Put, PermissionTypes.Post], uiPermissions: [uiPermissionsById.manage] },\n { path: /\\/(deviceconfig)/i, types: [PermissionTypes.Get, PermissionTypes.Put, PermissionTypes.Post], uiPermissions: [uiPermissionsById.configure] },\n { path: /\\/(deviceconnect\\/devices)/i, types: [PermissionTypes.Get, PermissionTypes.Post], uiPermissions: [uiPermissionsById.connect] }\n ],\n explanation: 'Device group management permissions control the degree to which devices in a group can be accessed and moved to other groups.',\n key: 'groups',\n scope: scopedPermissionAreas.groups.scopeType,\n uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage, uiPermissionsById.deploy, uiPermissionsById.configure, uiPermissionsById.connect],\n title: 'Group Management'\n },\n releases: {\n endpoints: [\n { path: /\\/(deployments\\/artifacts|deployments\\/deployments\\/releases)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] },\n {\n path: /\\/(deployments\\/artifacts|deployments\\/deployments\\/releases)/i,\n types: [PermissionTypes.Post, PermissionTypes.Put],\n uiPermissions: [uiPermissionsById.read, uiPermissionsById.upload]\n },\n {\n path: /\\/(deployments\\/artifacts|deployments\\/deployments\\/releases)/i,\n types: [PermissionTypes.Delete],\n uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage]\n }\n ],\n explanation: 'Release permissions can be granted to allow artifact & release modifications, as well as the creation of new releases.',\n key: 'releases',\n scope: 'ReleaseTags',\n uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage, uiPermissionsById.upload],\n title: 'Release Management'\n },\n tenantManagement: {\n endpoints: [\n { path: /\\/(tenantadm\\/tenants)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] },\n { path: /\\/(tenantadm\\/tenants)/i, types: [PermissionTypes.Post, PermissionTypes.Put], uiPermissions: [uiPermissionsById.manage] },\n { path: /\\/(users\\/exists)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.manage] }\n ],\n explanation: 'Tenant management permissions allow listing, creating and modifying child tenants',\n key: 'tenantManagement',\n uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage],\n title: 'Tenant Management'\n },\n userManagement: {\n endpoints: [\n { path: /\\/(useradm)/i, types: [PermissionTypes.Get], uiPermissions: [uiPermissionsById.read] },\n { path: /\\/(useradm)/i, types: [PermissionTypes.Post], uiPermissions: [uiPermissionsById.manage] }\n ],\n explanation:\n 'User management permissions should be granted carefully, as these allow privilege increases for any users managed by a user with user management permissions',\n key: 'userManagement',\n uiPermissions: [uiPermissionsById.read, uiPermissionsById.manage],\n title: 'User Management'\n }\n};\n\nconst permissionMapper = permission => permission.value;\nexport const itemUiPermissionsReducer = (accu, { item, uiPermissions }) => (item ? { ...accu, [item]: uiPermissions } : accu);\n\nconst checkSinglePermission = (permission, requiredPermission) =>\n requiredPermission === permission || uiPermissionsById[permission].permissionLevel > uiPermissionsById[requiredPermission].permissionLevel;\n\nexport const checkPermissionsObject = (permissions, requiredPermission, scopedAccess, superAccess) =>\n permissions[superAccess]?.some(permission => checkSinglePermission(permission, requiredPermission)) ||\n permissions[scopedAccess]?.some(permission => checkSinglePermission(permission, requiredPermission));\n\nexport const rolesById = Object.freeze({\n [staticRolesByName.admin]: {\n name: 'Admin',\n value: staticRolesByName.admin,\n description: 'Full access',\n permissions: [], // permissions refers to the values returned from the backend\n uiPermissions: {\n ...emptyUiPermissions,\n auditlog: uiPermissionsByArea.auditlog.uiPermissions.map(permissionMapper),\n deployments: uiPermissionsByArea.deployments.uiPermissions.map(permissionMapper),\n groups: { [ALL_DEVICES]: uiPermissionsByArea.groups.uiPermissions.map(permissionMapper) },\n releases: { [ALL_RELEASES]: uiPermissionsByArea.releases.uiPermissions.map(permissionMapper) },\n userManagement: uiPermissionsByArea.userManagement.uiPermissions.map(permissionMapper)\n }\n },\n [staticRolesByName.readOnly]: {\n name: 'Read Access',\n value: staticRolesByName.readOnly,\n description: '',\n permissions: [],\n uiPermissions: {\n ...emptyUiPermissions,\n deployments: [uiPermissionsById.read.value],\n groups: { [ALL_DEVICES]: [uiPermissionsById.read.value] },\n releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] },\n userManagement: [uiPermissionsById.read.value]\n }\n },\n [staticRolesByName.ci]: {\n name: 'Releases Manager',\n value: staticRolesByName.ci,\n description: '',\n permissions: [],\n uiPermissions: {\n ...emptyUiPermissions,\n releases: { [ALL_RELEASES]: uiPermissionsByArea.releases.uiPermissions.map(permissionMapper) }\n }\n },\n [staticRolesByName.deploymentsManager]: {\n name: 'Deployments Manager',\n value: staticRolesByName.deploymentsManager,\n description: '',\n permissions: [],\n uiPermissions: {\n ...emptyUiPermissions,\n deployments: uiPermissionsByArea.deployments.uiPermissions.map(permissionMapper),\n groups: { [ALL_DEVICES]: [uiPermissionsById.deploy.value, uiPermissionsById.read.value] },\n releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] }\n }\n },\n [staticRolesByName.terminalAccess]: {\n name: 'Troubleshooting',\n value: staticRolesByName.terminalAccess,\n description: 'Access to the troubleshooting features: Remote Terminal, File Transfer, Port Forwarding',\n permissions: [],\n uiPermissions: {\n ...emptyUiPermissions,\n groups: { [ALL_DEVICES]: [uiPermissionsById.connect.value] }\n }\n }\n});\n\nexport const serviceProviderRolesById = {\n admin: {\n name: 'Admin',\n value: staticRolesByName.admin,\n description: 'Full access',\n permissions: [],\n uiPermissions: {\n ...emptyUiPermissions,\n auditlog: uiPermissionsByArea.auditlog.uiPermissions.map(permissionMapper),\n userManagement: uiPermissionsByArea.userManagement.uiPermissions.map(permissionMapper),\n tenantManagement: uiPermissionsByArea.tenantManagement.uiPermissions.map(permissionMapper)\n }\n },\n readOnly: {\n name: 'Read access',\n value: staticRolesByName.admin,\n description: 'This role can see all linked organizations but cannot make any changes',\n permissions: [],\n uiPermissions: {\n ...emptyUiPermissions,\n auditlog: [uiPermissionsById.read.value],\n userManagement: [uiPermissionsById.read.value],\n tenantManagement: [uiPermissionsById.read.value]\n }\n }\n};\n\nexport const defaultPermissionSets = {\n [permissionSetIds.Basic]: {\n name: permissionSetIds.Basic,\n result: {\n // this is needed to prevent the detailed permissions of the basic permission set from being interpreted as allowing read & management access to user endpoints\n userManagement: [uiPermissionsById.read.value]\n }\n },\n [permissionSetIds.SuperUser]: {\n name: permissionSetIds.SuperUser,\n result: {\n ...rolesById[staticRolesByName.admin].uiPermissions\n }\n },\n [permissionSetIds.ManageUsers]: {\n name: permissionSetIds.ManageUsers,\n result: {\n userManagement: [uiPermissionsById.manage.value]\n }\n },\n [permissionSetIds.ReadAuditLogs]: {\n name: permissionSetIds.ReadAuditLogs,\n result: {\n auditlog: [uiPermissionsById.read.value]\n }\n },\n [permissionSetIds.ReadReleases]: {\n name: permissionSetIds.ReadReleases,\n result: {\n releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] }\n }\n },\n [permissionSetIds.ReadTenants]: {\n name: permissionSetIds.ReadTenants,\n result: {\n tenantManagement: [uiPermissionsById.read.value]\n }\n },\n [permissionSetIds.ManageTenants]: {\n name: permissionSetIds.ManageTenants,\n result: {\n tenantManagement: [uiPermissionsById.manage.value]\n }\n },\n [permissionSetIds.ReadUsers]: {\n name: permissionSetIds.ReadUsers,\n result: {\n userManagement: [uiPermissionsById.read.value]\n }\n },\n [permissionSetIds.UploadArtifacts]: {\n name: permissionSetIds.UploadArtifacts,\n result: {\n releases: { [ALL_RELEASES]: [uiPermissionsById.upload.value] }\n }\n },\n [permissionSetIds.ManageReleases]: {\n name: permissionSetIds.ManageReleases,\n result: {\n releases: { [ALL_RELEASES]: [uiPermissionsById.manage.value] }\n }\n },\n [permissionSetIds.ConfigureDevices]: {\n name: permissionSetIds.ConfigureDevices,\n result: {\n deployments: [uiPermissionsById.read.value, uiPermissionsById.deploy.value],\n groups: { [ALL_DEVICES]: [uiPermissionsById.read.value, uiPermissionsById.configure.value] }\n }\n },\n [permissionSetIds.ConnectToDevices]: {\n name: permissionSetIds.ConnectToDevices,\n result: {\n groups: { [ALL_DEVICES]: [uiPermissionsById.read.value, uiPermissionsById.connect.value] }\n }\n },\n [permissionSetIds.DeployToDevices]: {\n name: permissionSetIds.DeployToDevices,\n result: {\n deployments: [uiPermissionsById.deploy.value, uiPermissionsById.manage.value, uiPermissionsById.read.value],\n groups: { [ALL_DEVICES]: [uiPermissionsById.read.value, uiPermissionsById.deploy.value] }\n }\n },\n [permissionSetIds.ManageDevices]: {\n name: permissionSetIds.ManageDevices,\n result: {\n groups: { [ALL_DEVICES]: [uiPermissionsById.read.value, uiPermissionsById.manage.value] }\n }\n },\n [permissionSetIds.ReadDevices]: {\n name: permissionSetIds.ReadDevices,\n result: {\n groups: { [ALL_DEVICES]: [uiPermissionsById.read.value] }\n }\n }\n};\n\nexport const USER_LOGOUT = 'USER_LOGOUT';\n\nexport const OWN_USER_ID = 'me';\n\nexport const rolesByName = {\n ...staticRolesByName,\n deploymentCreation: { action: 'CREATE_DEPLOYMENT', object: { type: 'DEVICE_GROUP', value: undefined } },\n groupAccess: { action: 'VIEW_DEVICE', object: { type: 'DEVICE_GROUP', value: undefined } },\n userManagement: { action: 'http', object: { type: 'any', value: `${useradmApiUrlv1}/.*` } }\n};\nexport const twoFAStates = {\n enabled: 'enabled',\n disabled: 'disabled',\n unverified: 'unverified'\n};\nexport const settingsKeys = { initialized: 'settings-initialized' };\n\nexport const READ_STATES = {\n read: 'read',\n seen: 'seen',\n unread: 'unread'\n};\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { DEVICE_LIST_DEFAULTS, SORTING_OPTIONS, apiUrl } from '@northern.tech/store/constants';\n\nconst alreadyInstalled = 'already-installed';\n\nexport const deploymentsApiUrl = `${apiUrl.v1}/deployments`;\nexport const deploymentsApiUrlV2 = `${apiUrl.v2}/deployments`;\n\nexport const deploymentSubstates = {\n aborted: 'aborted',\n alreadyInstalled,\n decommissioned: 'decommissioned',\n downloading: 'downloading',\n failure: 'failure',\n installing: 'installing',\n noartifact: 'noartifact',\n pause_before_committing: 'pause_before_committing',\n pause_before_installing: 'pause_before_installing',\n pause_before_rebooting: 'pause_before_rebooting',\n pending: 'pending',\n rebooting: 'rebooting',\n success: 'success'\n};\n\nexport const deploymentStatesToSubstates = {\n failures: [deploymentSubstates.failure, deploymentSubstates.aborted, deploymentSubstates.decommissioned],\n inprogress: [deploymentSubstates.downloading, deploymentSubstates.installing, deploymentSubstates.rebooting],\n paused: [deploymentSubstates.pause_before_installing, deploymentSubstates.pause_before_rebooting, deploymentSubstates.pause_before_committing],\n pending: [deploymentSubstates.pending],\n successes: [deploymentSubstates.success, deploymentSubstates.alreadyInstalled, deploymentSubstates.noartifact]\n};\n\nexport const deploymentStatesToSubstatesWithSkipped = {\n ...deploymentStatesToSubstates,\n failures: [deploymentSubstates.failure],\n skipped: [deploymentSubstates.aborted, deploymentSubstates.noartifact, deploymentSubstates.alreadyInstalled, deploymentSubstates.decommissioned],\n successes: [deploymentSubstates.success]\n};\nexport const installationSubstatesMap = {\n download: {\n title: 'download',\n done: 'downloaded',\n successIndicators: [deploymentSubstates.installing, deploymentSubstates.rebooting, ...deploymentStatesToSubstates.paused, deploymentSubstates.success],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactInstall_Enter'\n },\n install: {\n title: 'install',\n done: 'installed',\n successIndicators: [\n deploymentSubstates.rebooting,\n deploymentSubstates.pause_before_rebooting,\n deploymentSubstates.pause_before_committing,\n deploymentSubstates.success\n ],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactReboot_Enter'\n },\n reboot: {\n title: 'reboot',\n done: 'rebooted',\n successIndicators: [deploymentSubstates.pause_before_committing, deploymentSubstates.success],\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: 'ArtifactCommit_Enter'\n },\n commit: {\n title: 'commit',\n done: 'committed',\n successIndicators: deploymentStatesToSubstates.successes,\n failureIndicators: deploymentStatesToSubstates.failures,\n pauseConfigurationIndicator: undefined\n }\n};\n\nexport const DEPLOYMENT_STATES = {\n finished: 'finished',\n inprogress: 'inprogress',\n pending: 'pending',\n scheduled: 'scheduled'\n};\n\nexport const listDefaultsByState = {\n [DEPLOYMENT_STATES.inprogress]: { page: 1, perPage: 10 },\n [DEPLOYMENT_STATES.pending]: { page: 1, perPage: 10 },\n [DEPLOYMENT_STATES.scheduled]: { ...DEVICE_LIST_DEFAULTS },\n [DEPLOYMENT_STATES.finished]: { ...DEVICE_LIST_DEFAULTS },\n sort: { direction: SORTING_OPTIONS.desc }\n};\n\nexport const DEFAULT_PENDING_INPROGRESS_COUNT = 10;\nexport const DEPLOYMENT_ROUTES = {\n active: {\n key: 'active',\n route: '/deployments/active',\n states: [DEPLOYMENT_STATES.pending, DEPLOYMENT_STATES.inprogress],\n title: 'Active'\n },\n finished: {\n key: 'finished',\n route: '/deployments/finished',\n states: [DEPLOYMENT_STATES.finished],\n title: 'Finished'\n },\n scheduled: {\n key: 'scheduled',\n route: '/deployments/scheduled',\n states: [DEPLOYMENT_STATES.scheduled],\n title: 'Scheduled'\n }\n};\nexport const DEPLOYMENT_TYPES = {\n software: 'software',\n configuration: 'configuration'\n};\nexport const defaultStats = {\n [deploymentSubstates.aborted]: 0,\n [deploymentSubstates.alreadyInstalled]: 0,\n [deploymentSubstates.decommissioned]: 0,\n [deploymentSubstates.downloading]: 0,\n [deploymentSubstates.failure]: 0,\n [deploymentSubstates.installing]: 0,\n [deploymentSubstates.noartifact]: 0,\n [deploymentSubstates.pause_before_committing]: 0,\n [deploymentSubstates.pause_before_installing]: 0,\n [deploymentSubstates.pause_before_rebooting]: 0,\n [deploymentSubstates.pending]: 0,\n [deploymentSubstates.rebooting]: 0,\n [deploymentSubstates.success]: 0\n};\nexport const deploymentDisplayStates = {\n finished: 'Finished',\n scheduled: 'Scheduled',\n skipped: 'Skipped',\n paused: 'Paused',\n pending: 'Pending',\n inprogress: 'In Progress',\n success: 'Success',\n successes: 'Success',\n failure: 'Fail',\n failures: 'Fail'\n};\n\nexport const deploymentPrototype = {\n devices: {},\n name: undefined,\n statistics: { status: {} }\n};\n\nexport const pauseMap = {\n [deploymentSubstates.pause_before_installing]: {\n title: installationSubstatesMap.download.done,\n followUp: installationSubstatesMap.download.pauseConfigurationIndicator\n },\n [deploymentSubstates.pause_before_rebooting]: {\n title: installationSubstatesMap.install.done,\n followUp: installationSubstatesMap.install.pauseConfigurationIndicator\n },\n [deploymentSubstates.pause_before_committing]: {\n title: installationSubstatesMap.reboot.done,\n followUp: installationSubstatesMap.reboot.pauseConfigurationIndicator\n }\n};\nexport const limitDefault = { min: 5, max: 100, default: 10 };\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// @ts-nocheck\nimport { DEVICE_STATES, UNGROUPED_GROUP } from '@northern.tech/store/constants';\nimport { duplicateFilter } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\n\nexport const getAcceptedDevices = state => state.devices.byStatus.accepted;\nexport const getDevicesByStatus = state => state.devices.byStatus;\nexport const getDevicesById = state => state.devices.byId;\nexport const getDeviceReports = state => state.devices.reports;\nexport const getGroupsById = state => state.devices.groups.byId;\nexport const getSelectedGroup = state => state.devices.groups.selectedGroup;\n\nexport const getDeviceListState = state => state.devices.deviceList;\nexport const getListedDevices = state => state.devices.deviceList.deviceIds;\nexport const getFilteringAttributes = state => state.devices.filteringAttributes;\nexport const getDeviceFilters = state => state.devices.filters || [];\nconst getFilteringAttributesFromConfig = state => state.devices.filteringAttributesConfig.attributes;\nexport const getSortedFilteringAttributes = createSelector([getFilteringAttributes], filteringAttributes => ({\n ...filteringAttributes,\n identityAttributes: [...filteringAttributes.identityAttributes, 'id']\n}));\nexport const getDeviceLimit = state => state.devices.limit;\nconst getFilteringAttributesLimit = state => state.devices.filteringAttributesLimit;\n\nexport const getDeviceIdentityAttributes = createSelector(\n [getFilteringAttributes, getFilteringAttributesLimit],\n ({ identityAttributes }, filteringAttributesLimit) => {\n // limit the selection of the available attribute to AVAILABLE_ATTRIBUTE_LIMIT\n const attributes = identityAttributes.slice(0, filteringAttributesLimit);\n return attributes.reduce(\n (accu, value) => {\n accu.push({ value, label: value, scope: 'identity' });\n return accu;\n },\n [\n { value: 'name', label: 'Name', scope: 'tags' },\n { value: 'id', label: 'Device ID', scope: 'identity' }\n ]\n );\n }\n);\n\nexport const getDeviceCountsByStatus = createSelector([getDevicesByStatus], byStatus =>\n Object.values(DEVICE_STATES).reduce((accu, state) => {\n accu[state] = byStatus[state].total || 0;\n return accu;\n }, {})\n);\n\nexport const getDeviceById = createSelector([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = '') => devicesById[deviceId] ?? {});\n\nexport const getSelectedGroupInfo = createSelector(\n [getAcceptedDevices, getGroupsById, getSelectedGroup],\n ({ total: acceptedDeviceTotal }, groupsById, selectedGroup) => {\n let groupCount = acceptedDeviceTotal;\n let groupFilters = [];\n if (selectedGroup && groupsById[selectedGroup]) {\n groupCount = groupsById[selectedGroup].total;\n groupFilters = groupsById[selectedGroup].filters || [];\n }\n return { groupCount, selectedGroup, groupFilters };\n }\n);\n\nexport const getLimitMaxed = createSelector([getAcceptedDevices, getDeviceLimit], ({ total: acceptedDevices = 0 }, deviceLimit) =>\n Boolean(deviceLimit && deviceLimit <= acceptedDevices)\n);\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const getGroupsByIdWithoutUngrouped = createSelector([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);\n\nexport const getGroups = createSelector([getGroupsById], groupsById => {\n const groupNames = Object.keys(groupsById).sort();\n const groupedGroups = Object.entries(groupsById)\n .sort((a, b) => a[0].localeCompare(b[0]))\n .reduce(\n (accu, [groupname, group]) => {\n const name = groupname === UNGROUPED_GROUP.id ? UNGROUPED_GROUP.name : groupname;\n const groupItem = { ...group, groupId: name, name: groupname };\n if (group.filters.length > 0) {\n if (groupname !== UNGROUPED_GROUP.id) {\n accu.dynamic.push(groupItem);\n } else {\n accu.ungrouped.push(groupItem);\n }\n } else {\n accu.static.push(groupItem);\n }\n return accu;\n },\n { dynamic: [], static: [], ungrouped: [] }\n );\n return { groupNames, ...groupedGroups };\n});\nexport const getAttributesList = createSelector(\n [getFilteringAttributes, getFilteringAttributesFromConfig],\n ({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) =>\n [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(duplicateFilter)\n);\n\nexport const getDeviceTypes = createSelector([getAcceptedDevices, getDevicesById], ({ deviceIds = [] }, devicesById) =>\n Object.keys(\n deviceIds.slice(0, 200).reduce((accu, item) => {\n const { device_type: deviceTypes = [] } = devicesById[item] ? devicesById[item].attributes : {};\n accu = deviceTypes.reduce((deviceTypeAccu, deviceType) => {\n if (deviceType.length > 1) {\n deviceTypeAccu[deviceType] = deviceTypeAccu[deviceType] ? deviceTypeAccu[deviceType] + 1 : 1;\n }\n return deviceTypeAccu;\n }, accu);\n return accu;\n }, {})\n )\n);\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport const getIssueCountsByType = state => state.monitor.issueCounts.byType;\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport const getOnboarding = state => state.onboarding;\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { EXTERNAL_PROVIDER } from '@northern.tech/store/constants';\nimport { createSelector } from '@reduxjs/toolkit';\n\nexport const getOrganization = state => state.organization.organization;\nexport const getExternalIntegrations = state => state.organization.externalDeviceIntegrations;\nexport const getAuditlogState = state => state.organization.auditlog.selectionState;\nexport const getAuditLog = state => state.organization.auditlog.events;\nexport const getAuditLogSelectionState = state => state.organization.auditlog.selectionState;\nexport const getSsoConfig = ({ organization: { ssoConfigs = [] } }) => ssoConfigs[0];\nexport const getTenantsList = state => state.organization.tenantList;\nexport const getWebhookEvents = state => state.organization.webhooks.events;\nexport const getWebhookEventTotal = state => state.organization.webhooks.eventTotal;\n\nexport const getDeviceTwinIntegrations = createSelector([getExternalIntegrations], integrations =>\n integrations.filter(integration => integration.id && EXTERNAL_PROVIDER[integration.provider]?.deviceTwin)\n);\nexport const getIsServiceProvider = state => state.organization.organization.service_provider;\n\nexport const getWebhooks = createSelector([getExternalIntegrations], integrations =>\n integrations.filter(integration => integration.id && integration.provider === EXTERNAL_PROVIDER.webhook.provider)\n);\nexport const getWebhookEventInfo = createSelector([getWebhooks, getWebhookEvents, getWebhookEventTotal], (webhooks, events, eventTotal) =>\n webhooks.length ? { events, eventTotal } : { events: [], eventTotal: 0 }\n);\n\nexport const getAuditLogEntry = createSelector([getAuditLog, getAuditLogSelectionState], (events, { selectedId }) => {\n if (!selectedId) {\n return;\n }\n const [eventAction, eventTime] = atob(selectedId).split('|');\n return events.find(item => item.action === eventAction && item.time === eventTime);\n});\n","// 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.\n// @ts-nocheck\nimport { duplicateFilter, yes } from '@northern.tech/utils/helpers';\n\nimport { ATTRIBUTE_SCOPES, DEVICE_FILTERING_OPTIONS, DEVICE_ISSUE_OPTIONS, DEVICE_LIST_MAXIMUM_LENGTH, emptyUiPermissions } from './commonConstants';\nimport {\n DARK_MODE,\n DEPLOYMENT_STATES,\n defaultStats,\n deploymentDisplayStates,\n deploymentStatesToSubstates,\n deploymentStatesToSubstatesWithSkipped,\n emptyFilter\n} from './constants';\n\n// for some reason these functions can not be stored in the deviceConstants...\nconst filterProcessors = {\n $gt: val => Number(val) || val,\n $gte: val => Number(val) || val,\n $lt: val => Number(val) || val,\n $lte: val => Number(val) || val,\n $in: val => ('' + val).split(',').map(i => i.trim()),\n $nin: val => ('' + val).split(',').map(i => i.trim()),\n $exists: yes,\n $nexists: () => false\n};\nconst filterAliases = {\n $nexists: { alias: DEVICE_FILTERING_OPTIONS.$exists.key, value: false }\n};\nexport const mapFiltersToTerms = filters =>\n filters.map(filter => ({\n scope: filter.scope,\n attribute: filter.key,\n type: filterAliases[filter.operator]?.alias || filter.operator,\n value: filterProcessors.hasOwnProperty(filter.operator) ? filterProcessors[filter.operator](filter.value) : filter.value\n }));\nexport const mapTermsToFilters = terms =>\n terms.map(term => {\n const aliasedFilter = Object.entries(filterAliases).find(\n aliasDefinition => aliasDefinition[1].alias === term.type && aliasDefinition[1].value === term.value\n );\n const operator = aliasedFilter ? aliasedFilter[0] : term.type;\n return { scope: term.scope, key: term.attribute, operator, value: term.value };\n });\n\nconst convertIssueOptionsToFilters = (issuesSelection, filtersState = {}) =>\n issuesSelection.map(item => {\n if (typeof DEVICE_ISSUE_OPTIONS[item].filterRule.value === 'function') {\n return { ...DEVICE_ISSUE_OPTIONS[item].filterRule, value: DEVICE_ISSUE_OPTIONS[item].filterRule.value(filtersState) };\n }\n return DEVICE_ISSUE_OPTIONS[item].filterRule;\n });\n\nexport const convertDeviceListStateToFilters = ({ filters = [], group, groups = { byId: {} }, offlineThreshold, selectedIssues = [], status }) => {\n let applicableFilters = [...filters];\n if (typeof group === 'string' && !(groups.byId[group]?.filters || applicableFilters).length) {\n applicableFilters.push({ key: 'group', value: group, operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: 'system' });\n }\n const nonMonitorFilters = applicableFilters.filter(\n filter =>\n !Object.values(DEVICE_ISSUE_OPTIONS).some(\n ({ filterRule }) => filter.scope !== 'inventory' && filterRule.scope === filter.scope && filterRule.key === filter.key\n )\n );\n const deviceIssueFilters = convertIssueOptionsToFilters(selectedIssues, { offlineThreshold });\n applicableFilters = [...nonMonitorFilters, ...deviceIssueFilters];\n const effectiveFilters = status\n ? [...applicableFilters, { key: 'status', value: status, operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: 'identity' }]\n : applicableFilters;\n return { applicableFilters: nonMonitorFilters, filterTerms: mapFiltersToTerms(effectiveFilters) };\n};\n\nconst filterCompare = (filter, item) => Object.keys(emptyFilter).every(key => item[key].toString() === filter[key].toString());\n\nexport const filtersFilter = (item, index, array) => {\n const firstIndex = array.findIndex(filter => filterCompare(filter, item));\n return firstIndex === index;\n};\n\nexport const listItemMapper = (byId, ids, { defaultObject = {}, cutOffSize = DEVICE_LIST_MAXIMUM_LENGTH }) => {\n return ids.slice(0, cutOffSize).reduce((accu, id) => {\n if (id && byId[id]) {\n accu.push({ ...defaultObject, ...byId[id] });\n }\n return accu;\n }, []);\n};\n\nexport const mergePermissions = (existingPermissions = { ...emptyUiPermissions }, addedPermissions) =>\n Object.entries(existingPermissions).reduce(\n (accu, [key, value]) => {\n let values;\n if (!accu[key]) {\n accu[key] = value;\n return accu;\n }\n if (Array.isArray(value)) {\n values = [...value, ...accu[key]].filter(duplicateFilter);\n } else {\n values = mergePermissions(accu[key], { ...value });\n }\n accu[key] = values;\n return accu;\n },\n { ...addedPermissions }\n );\n\nexport const mapUserRolesToUiPermissions = (userRoles, roles) =>\n userRoles.reduce(\n (accu, roleId) => {\n if (!(roleId && roles[roleId])) {\n return accu;\n }\n return mergePermissions(accu, roles[roleId].uiPermissions);\n },\n { ...emptyUiPermissions }\n );\n\nexport const progress = ({ loaded, total }) => {\n let uploadProgress = (loaded / total) * 100;\n return (uploadProgress = uploadProgress < 50 ? Math.ceil(uploadProgress) : Math.round(uploadProgress));\n};\n\nexport const extractErrorMessage = (err, fallback = '') =>\n err.response?.data?.error?.message || err.response?.data?.error || err.error || err.message || fallback;\n\nexport const preformatWithRequestID = (res, failMsg) => {\n // ellipsis line\n if (failMsg.length > 100) failMsg = `${failMsg.substring(0, 220)}...`;\n\n try {\n if (res?.data && Object.keys(res.data).includes('request_id')) {\n let shortRequestUUID = res.data['request_id'].substring(0, 8);\n return `${failMsg} [Request ID: ${shortRequestUUID}]`;\n }\n } catch (e) {\n console.log('failed to extract request id:', e);\n }\n return failMsg;\n};\n\nexport const getComparisonCompatibleVersion = version => (isNaN(version.charAt(0)) && version !== 'next' ? 'master' : version);\n\nexport const stringToBoolean = content => {\n if (!content) {\n return false;\n }\n const string = content + '';\n switch (string.trim().toLowerCase()) {\n case 'true':\n case 'yes':\n case '1':\n return true;\n case 'false':\n case 'no':\n case '0':\n case null:\n return false;\n default:\n return Boolean(string);\n }\n};\n\nexport const groupDeploymentDevicesStats = deployment => {\n const deviceStatCollector = (deploymentStates, devices) =>\n Object.values(devices).reduce((accu, device) => (deploymentStates.includes(device.status) ? accu + 1 : accu), 0);\n\n const inprogress = deviceStatCollector(deploymentStatesToSubstates.inprogress, deployment.devices);\n const pending = deviceStatCollector(deploymentStatesToSubstates.pending, deployment.devices);\n const successes = deviceStatCollector(deploymentStatesToSubstates.successes, deployment.devices);\n const failures = deviceStatCollector(deploymentStatesToSubstates.failures, deployment.devices);\n const paused = deviceStatCollector(deploymentStatesToSubstates.paused, deployment.devices);\n return { inprogress, paused, pending, successes, failures };\n};\n\nexport const statCollector = (items, statistics) => items.reduce((accu, property) => accu + Number(statistics[property] || 0), 0);\nexport const groupDeploymentStats = (deployment, withSkipped) => {\n const { statistics = {} } = deployment;\n const { status = {} } = statistics;\n const stats = { ...defaultStats, ...status };\n let groupStates = deploymentStatesToSubstates;\n let result = {};\n if (withSkipped) {\n groupStates = deploymentStatesToSubstatesWithSkipped;\n result.skipped = statCollector(groupStates.skipped, stats);\n }\n result = {\n ...result,\n // don't include 'pending' as inprogress, as all remaining devices will be pending - we don't discriminate based on phase membership\n inprogress: statCollector(groupStates.inprogress, stats),\n pending: (deployment.max_devices ? deployment.max_devices - deployment.device_count : 0) + statCollector(groupStates.pending, stats),\n successes: statCollector(groupStates.successes, stats),\n failures: statCollector(groupStates.failures, stats),\n paused: statCollector(groupStates.paused, stats)\n };\n return result;\n};\n\nexport const getDeploymentState = deployment => {\n const { status: deploymentStatus = DEPLOYMENT_STATES.pending } = deployment;\n const { inprogress: currentProgressCount, paused } = groupDeploymentStats(deployment);\n\n let status = deploymentDisplayStates[deploymentStatus];\n if (deploymentStatus === DEPLOYMENT_STATES.pending && currentProgressCount === 0) {\n status = 'queued';\n } else if (paused > 0) {\n status = deploymentDisplayStates.paused;\n }\n return status;\n};\n\nexport const generateDeploymentGroupDetails = (filter, groupName) =>\n filter && filter.terms?.length\n ? `${groupName} (${filter.terms\n .map(filter => `${filter.attribute || filter.key} ${DEVICE_FILTERING_OPTIONS[filter.type || filter.operator].shortform} ${filter.value}`)\n .join(', ')})`\n : groupName;\n\nexport const mapDeviceAttributes = (attributes = []) =>\n attributes.reduce(\n (accu, attribute) => {\n if (!(attribute.value && attribute.name) && attribute.scope === ATTRIBUTE_SCOPES.inventory) {\n return accu;\n }\n accu[attribute.scope || ATTRIBUTE_SCOPES.inventory] = {\n ...accu[attribute.scope || ATTRIBUTE_SCOPES.inventory],\n [attribute.name]: attribute.value\n };\n if (attribute.name === 'device_type' && attribute.scope === ATTRIBUTE_SCOPES.inventory) {\n accu.inventory.device_type = [].concat(attribute.value);\n }\n return accu;\n },\n { inventory: { device_type: [], artifact_name: '' }, identity: {}, monitor: {}, system: {}, tags: {} }\n );\n\nexport const isDarkMode = mode => mode === DARK_MODE;\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { listItemMapper } from '@northern.tech/store/utils';\nimport { createSelector } from '@reduxjs/toolkit';\n\nconst getSelectedReleaseId = state => state.releases.selectedRelease;\nexport const getReleasesById = state => state.releases.byId;\nexport const getReleaseTags = state => state.releases.tags;\nexport const getReleaseListState = state => state.releases.releasesList;\nconst getListedReleases = state => state.releases.releasesList.releaseIds;\nexport const getUpdateTypes = state => state.releases.updateTypes;\n\nconst getReleaseMappingDefaults = () => ({});\nexport const getReleasesList = createSelector([getReleasesById, getListedReleases, getReleaseMappingDefaults], listItemMapper);\n\nexport const getReleaseTagsById = createSelector([getReleaseTags], releaseTags => releaseTags.reduce((accu, key) => ({ ...accu, [key]: key }), {}));\nexport const getHasReleases = createSelector(\n [getReleaseListState, getReleasesById],\n ({ searchTotal, total }, byId) => !!(Object.keys(byId).length || total || searchTotal)\n);\n\nexport const getSelectedRelease = createSelector([getReleasesById, getSelectedReleaseId], (byId, id) => byId[id] ?? {});\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// @ts-nocheck\nimport { DEVICE_ONLINE_CUTOFF, defaultIdAttribute } from '@northern.tech/store/constants';\nimport { isDarkMode } from '@northern.tech/store/utils';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport { READ_STATES, twoFAStates } from './constants';\n\nexport const getRolesById = state => state.users.rolesById;\nexport const getTooltipsById = state => state.users.tooltips.byId;\nexport const getGlobalSettings = state => state.users.globalSettings;\n\nconst getCurrentUserId = state => state.users.currentUser;\nconst getUsersById = state => state.users.byId;\nexport const getCurrentUser = createSelector([getUsersById, getCurrentUserId], (usersById, userId) => usersById[userId] ?? {});\nexport const getUserSettings = state => state.users.userSettings;\n\nexport const getIsDarkMode = createSelector([getUserSettings], ({ mode }) => isDarkMode(mode));\n\nexport const getShowHelptips = createSelector([getTooltipsById], tooltips =>\n Object.values(tooltips).reduce((accu, { readState }) => accu || readState === READ_STATES.unread, false)\n);\n\nexport const getTooltipsState = createSelector([getTooltipsById, getUserSettings], (byId, { tooltips = {} }) =>\n Object.entries(byId).reduce(\n (accu, [id, value]) => {\n accu[id] = { ...accu[id], ...value };\n return accu;\n },\n { ...tooltips }\n )\n);\n\nexport const getHas2FA = createSelector(\n [getCurrentUser],\n currentUser => currentUser.hasOwnProperty('tfa_status') && currentUser.tfa_status === twoFAStates.enabled\n);\n\nexport const getIdAttribute = createSelector([getGlobalSettings], ({ id_attribute = { ...defaultIdAttribute } }) => id_attribute);\n\nexport const getOfflineThresholdSettings = createSelector([getGlobalSettings], ({ offlineThreshold }) => ({\n interval: offlineThreshold?.interval || DEVICE_ONLINE_CUTOFF.interval,\n intervalUnit: offlineThreshold?.intervalUnit || DEVICE_ONLINE_CUTOFF.intervalName\n}));\n\nexport const getRolesList = createSelector([getRolesById], rolesById => Object.entries(rolesById).map(([id, role]) => ({ id, ...role })));\n\nexport const getCurrentSession = state => state.users.currentSession;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA,IAAAA,kBAA6F;AAC7F,IAAAC,kBAA+B;;;ACF/B,4BAA0E;AAE1E,IAAM,sBAAsB;AAAA,EAC1B,IAAI;AAAA,EACJ,cAAc;AAChB;AAEO,IAAM,UAAU;AAChB,IAAM,SAAS;AAAA,EACpB,IAAI,GAAG,OAAO;AAAA,EACd,IAAI,GAAG,OAAO;AAChB;AAQO,IAAM,aAAa;AAAA,EACxB,KAAK,EAAE,KAAK,OAAO,MAAM,sBAAAC,SAAa;AAAA,EACtC,KAAK,EAAE,KAAK,OAAO,MAAM,sBAAAC,gBAAa;AACxC;AACO,IAAM,sBAAsB,EAAE,UAAU,IAAI,OAAO,IAAI,WAAW,WAAW,IAAI,KAAK,WAAW,gBAAgB;AACjH,IAAM,oBAAoB;AAC1B,IAAM,iBAAiB,CAAC,EAAE,GAAG,qBAAqB,OAAO,MAAM,WAAW,iBAAiB,MAAM,kBAAkB,CAAC;AAMpH,IAAM,QAAQ;AAAA,EACnB,IAAI;AAAA,IACF,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AA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OAAO,IAAI;AAAA,EAC3D;AACA,SAAO,EAAE,GAAG,gBAAgB,GAAG,YAAY,eAAe,EAAE,EAAE;AAChE,CAAC;AAEM,IAAM,uBAAmB,gCAAe,CAAC,iBAAiB,YAAY,GAAG,CAAC,EAAE,iBAAiB,GAAG,UAAU;AAC/G,MAAI,kBAAkB;AACpB,WAAO,MAAM,OAAO,CAAC,MAAM,SAAS;AAClC,UAAI,UAAU,KAAK,EAAE,GAAG;AACtB,eAAO;AAAA,MACT;AACA,WAAK,KAAK,IAAI;AACd,aAAO;AAAA,IACT,GAAG,OAAO,OAAO,wBAAwB,CAAC;AAAA,EAC5C;AACA,SAAO,OAAO,KAAK,SAAS,EACzB,QAAQ,EACR,OAAO,CAAC,MAAM,QAAQ;AACrB,UAAM,QAAQ,KAAK,UAAU,CAAC,EAAE,GAAG,MAAM,OAAO,GAAG;AACnD,WAAO,CAAC,KAAK,KAAK,GAAG,GAAG,KAAK,OAAO,CAAC,MAAM,cAAc,UAAU,SAAS,CAAC;AAC7E,WAAO;AAAA,EACT,GAAG,KAAK;AACZ,CAAC;","names":["import_helpers","import_toolkit","BarChartIcon","PieChartIcon","AWS","React","Azure","import_toolkit","accu","import_helpers","import_toolkit","import_toolkit","import_helpers","import_toolkit","import_toolkit","rolesById","rolesById","getDemoDeviceAddressHelper"]}