@northern.tech/store 0.3.3 → 0.3.4

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 (207) hide show
  1. package/dist/BillingProfile-ChP2_Sqw.d.cts +45 -0
  2. package/dist/BillingProfile-ChP2_Sqw.d.ts +45 -0
  3. package/dist/actions.cjs +2 -6
  4. package/dist/actions.cjs.map +1 -1
  5. package/dist/actions.js +12 -12
  6. package/dist/api/general-api.cjs.map +1 -1
  7. package/dist/api/general-api.js +5 -5
  8. package/dist/api/users-api.cjs.map +1 -1
  9. package/dist/api/users-api.js +6 -6
  10. package/dist/appSlice/constants.cjs.map +1 -1
  11. package/dist/appSlice/constants.d.cts +7 -7
  12. package/dist/appSlice/constants.d.ts +7 -7
  13. package/dist/appSlice/constants.js +1 -1
  14. package/dist/appSlice/index.cjs +1 -3
  15. package/dist/appSlice/index.cjs.map +1 -1
  16. package/dist/appSlice/index.js +4 -4
  17. package/dist/appSlice/thunks.cjs +16 -26
  18. package/dist/appSlice/thunks.cjs.map +1 -1
  19. package/dist/appSlice/thunks.js +28 -27
  20. package/dist/auth.cjs.map +1 -1
  21. package/dist/auth.js +4 -4
  22. package/dist/{chunk-LGNOTPUG.js → chunk-4RWZR3BN.js} +23 -25
  23. package/dist/{chunk-LGNOTPUG.js.map → chunk-4RWZR3BN.js.map} +1 -1
  24. package/dist/{chunk-TUACATJA.js → chunk-7YZCUAXZ.js} +2 -2
  25. package/dist/{chunk-7PVGDMNM.js → chunk-AFICTIVU.js} +3 -5
  26. package/dist/{chunk-7PVGDMNM.js.map → chunk-AFICTIVU.js.map} +1 -1
  27. package/dist/{chunk-YT73QWCN.js → chunk-AUBJUUP3.js} +3 -3
  28. package/dist/{chunk-VMNMD6KF.js → chunk-AVX7VVOK.js} +3 -3
  29. package/dist/{chunk-4B3IMP4I.js → chunk-BSN2TOQC.js} +1 -1
  30. package/dist/{chunk-4B3IMP4I.js.map → chunk-BSN2TOQC.js.map} +1 -1
  31. package/dist/{chunk-X7IEZBM4.js → chunk-DCEKU6UV.js} +2 -2
  32. package/dist/{chunk-HPBE6KYY.js → chunk-DGQKXSRI.js} +3 -3
  33. package/dist/{chunk-2JHFUQ6B.js → chunk-EQLHIPPR.js} +88 -85
  34. package/dist/chunk-EQLHIPPR.js.map +1 -0
  35. package/dist/{chunk-LTKOV26W.js → chunk-EYCORLYU.js} +30 -28
  36. package/dist/chunk-EYCORLYU.js.map +1 -0
  37. package/dist/{chunk-WXL7PVI5.js → chunk-FQDSV3NK.js} +4 -4
  38. package/dist/{chunk-TI2RL5P2.js → chunk-FRSA2YB5.js} +3 -3
  39. package/dist/{chunk-DCK2DBOA.js → chunk-FVCYB5OP.js} +22 -24
  40. package/dist/{chunk-DCK2DBOA.js.map → chunk-FVCYB5OP.js.map} +1 -1
  41. package/dist/{chunk-AMGWP7A4.js → chunk-GAI4VYRZ.js} +2 -2
  42. package/dist/{chunk-4XJMRVFI.js → chunk-GWJIY56H.js} +10 -12
  43. package/dist/chunk-GWJIY56H.js.map +1 -0
  44. package/dist/{chunk-2CYOM4BK.js → chunk-JO33IORF.js} +2 -2
  45. package/dist/chunk-K4MMUDYT.js +391 -0
  46. package/dist/chunk-K4MMUDYT.js.map +1 -0
  47. package/dist/{chunk-YDS36ALB.js → chunk-L3SY3J5M.js} +3 -3
  48. package/dist/{chunk-JAROCU6M.js → chunk-NCSKCF2S.js} +3 -3
  49. package/dist/{chunk-CYV6632F.js → chunk-NOQR3TE7.js} +2 -2
  50. package/dist/{chunk-C5NEDBJI.js → chunk-OEP2D6QL.js} +3 -3
  51. package/dist/{chunk-C5NEDBJI.js.map → chunk-OEP2D6QL.js.map} +1 -1
  52. package/dist/{chunk-LEMVXAYP.js → chunk-PAIB5V27.js} +15 -15
  53. package/dist/{chunk-FGKMJS3B.js → chunk-RX32WLVJ.js} +2 -4
  54. package/dist/chunk-RX32WLVJ.js.map +1 -0
  55. package/dist/{chunk-QRGTG4YB.js → chunk-X3GZILYD.js} +3 -3
  56. package/dist/{chunk-UWMYZNUB.js → chunk-Y575RZHR.js} +1 -1
  57. package/dist/{chunk-UWMYZNUB.js.map → chunk-Y575RZHR.js.map} +1 -1
  58. package/dist/{chunk-7JKWI5FK.js → chunk-ZWOAFHAR.js} +2 -2
  59. package/dist/{chunk-DAPAXWA5.js → chunk-ZZMFXRQK.js} +12 -12
  60. package/dist/commonConstants.cjs.map +1 -1
  61. package/dist/commonConstants.d.cts +1 -1
  62. package/dist/commonConstants.d.ts +1 -1
  63. package/dist/commonConstants.js +1 -1
  64. package/dist/commonSelectors.cjs +7 -11
  65. package/dist/commonSelectors.cjs.map +1 -1
  66. package/dist/commonSelectors.d.cts +12 -11
  67. package/dist/commonSelectors.d.ts +12 -11
  68. package/dist/commonSelectors.js +11 -11
  69. package/dist/constants.cjs.map +1 -1
  70. package/dist/constants.js +3 -3
  71. package/dist/deploymentdevicehook.cjs +16 -26
  72. package/dist/deploymentdevicehook.cjs.map +1 -1
  73. package/dist/deploymentdevicehook.js +30 -29
  74. package/dist/deploymentdevicehook.js.map +1 -1
  75. package/dist/deploymentsSlice/constants.cjs.map +1 -1
  76. package/dist/deploymentsSlice/constants.js +3 -3
  77. package/dist/deploymentsSlice/index.cjs.map +1 -1
  78. package/dist/deploymentsSlice/index.js +4 -4
  79. package/dist/deploymentsSlice/selectors.cjs.map +1 -1
  80. package/dist/deploymentsSlice/selectors.js +4 -4
  81. package/dist/deploymentsSlice/thunks.cjs +16 -26
  82. package/dist/deploymentsSlice/thunks.cjs.map +1 -1
  83. package/dist/deploymentsSlice/thunks.js +28 -27
  84. package/dist/devicesSlice/constants.cjs.map +1 -1
  85. package/dist/devicesSlice/constants.js +3 -3
  86. package/dist/devicesSlice/index.cjs.map +1 -1
  87. package/dist/devicesSlice/index.js +4 -4
  88. package/dist/devicesSlice/selectors.cjs.map +1 -1
  89. package/dist/devicesSlice/selectors.js +4 -4
  90. package/dist/devicesSlice/thunks.cjs +16 -26
  91. package/dist/devicesSlice/thunks.cjs.map +1 -1
  92. package/dist/devicesSlice/thunks.js +28 -27
  93. package/dist/liststatehook.cjs +971 -0
  94. package/dist/liststatehook.cjs.map +1 -0
  95. package/dist/liststatehook.d.cts +246 -0
  96. package/dist/liststatehook.d.ts +246 -0
  97. package/dist/liststatehook.js +88 -0
  98. package/dist/liststatehook.js.map +1 -0
  99. package/dist/locationutils.cjs +942 -0
  100. package/dist/locationutils.cjs.map +1 -0
  101. package/dist/locationutils.d.cts +113 -0
  102. package/dist/locationutils.d.ts +113 -0
  103. package/dist/locationutils.js +46 -0
  104. package/dist/locationutils.js.map +1 -0
  105. package/dist/monitorSlice/constants.cjs.map +1 -1
  106. package/dist/monitorSlice/constants.js +3 -3
  107. package/dist/monitorSlice/index.cjs.map +1 -1
  108. package/dist/monitorSlice/index.js +4 -4
  109. package/dist/monitorSlice/thunks.cjs +15 -25
  110. package/dist/monitorSlice/thunks.cjs.map +1 -1
  111. package/dist/monitorSlice/thunks.js +24 -24
  112. package/dist/onboardingSlice/index.cjs +1 -3
  113. package/dist/onboardingSlice/index.cjs.map +1 -1
  114. package/dist/onboardingSlice/index.js +1 -1
  115. package/dist/onboardingSlice/thunks.cjs +22 -35
  116. package/dist/onboardingSlice/thunks.cjs.map +1 -1
  117. package/dist/onboardingSlice/thunks.d.cts +1 -2
  118. package/dist/onboardingSlice/thunks.d.ts +1 -2
  119. package/dist/onboardingSlice/thunks.js +28 -29
  120. package/dist/organizationSlice/constants.cjs.map +1 -1
  121. package/dist/organizationSlice/constants.js +3 -3
  122. package/dist/organizationSlice/index.cjs.map +1 -1
  123. package/dist/organizationSlice/index.d.cts +2 -1
  124. package/dist/organizationSlice/index.d.ts +2 -1
  125. package/dist/organizationSlice/index.js +4 -4
  126. package/dist/organizationSlice/selectors.cjs.map +1 -1
  127. package/dist/organizationSlice/selectors.d.cts +2 -1
  128. package/dist/organizationSlice/selectors.d.ts +2 -1
  129. package/dist/organizationSlice/selectors.js +4 -4
  130. package/dist/organizationSlice/thunks.cjs +38 -44
  131. package/dist/organizationSlice/thunks.cjs.map +1 -1
  132. package/dist/organizationSlice/thunks.d.cts +5 -5
  133. package/dist/organizationSlice/thunks.d.ts +5 -5
  134. package/dist/organizationSlice/thunks.js +28 -27
  135. package/dist/organizationSlice/types.cjs.map +1 -1
  136. package/dist/organizationSlice/types.d.cts +3 -112
  137. package/dist/organizationSlice/types.d.ts +3 -112
  138. package/dist/releasesSlice/index.cjs.map +1 -1
  139. package/dist/releasesSlice/index.js +4 -4
  140. package/dist/releasesSlice/selectors.cjs +6 -8
  141. package/dist/releasesSlice/selectors.cjs.map +1 -1
  142. package/dist/releasesSlice/selectors.js +5 -5
  143. package/dist/releasesSlice/thunks.cjs +51 -46
  144. package/dist/releasesSlice/thunks.cjs.map +1 -1
  145. package/dist/releasesSlice/thunks.js +25 -24
  146. package/dist/selectors.cjs +7 -11
  147. package/dist/selectors.cjs.map +1 -1
  148. package/dist/selectors.d.cts +2 -1
  149. package/dist/selectors.d.ts +2 -1
  150. package/dist/selectors.js +37 -37
  151. package/dist/sockethook.cjs +529 -0
  152. package/dist/sockethook.cjs.map +1 -0
  153. package/dist/sockethook.d.cts +10 -0
  154. package/dist/sockethook.d.ts +10 -0
  155. package/dist/sockethook.js +141 -0
  156. package/dist/sockethook.js.map +1 -0
  157. package/dist/store.cjs +2 -6
  158. package/dist/store.cjs.map +1 -1
  159. package/dist/store.d.cts +2 -1
  160. package/dist/store.d.ts +2 -1
  161. package/dist/store.js +14 -14
  162. package/dist/storehooks.cjs +86 -90
  163. package/dist/storehooks.cjs.map +1 -1
  164. package/dist/storehooks.js +37 -48
  165. package/dist/storehooks.js.map +1 -1
  166. package/dist/thunks.cjs +83 -79
  167. package/dist/thunks.cjs.map +1 -1
  168. package/dist/thunks.d.cts +2 -2
  169. package/dist/thunks.d.ts +2 -2
  170. package/dist/thunks.js +28 -29
  171. package/dist/types-DBj17FZO.d.cts +135 -0
  172. package/dist/types-DnfZa6xd.d.ts +135 -0
  173. package/dist/usersSlice/constants.cjs.map +1 -1
  174. package/dist/usersSlice/constants.d.cts +6 -6
  175. package/dist/usersSlice/constants.d.ts +6 -6
  176. package/dist/usersSlice/constants.js +3 -3
  177. package/dist/usersSlice/index.cjs.map +1 -1
  178. package/dist/usersSlice/index.js +4 -4
  179. package/dist/usersSlice/selectors.cjs.map +1 -1
  180. package/dist/usersSlice/selectors.js +5 -5
  181. package/dist/usersSlice/thunks.cjs +16 -26
  182. package/dist/usersSlice/thunks.cjs.map +1 -1
  183. package/dist/usersSlice/thunks.js +28 -27
  184. package/dist/utils.cjs +6 -8
  185. package/dist/utils.cjs.map +1 -1
  186. package/dist/utils.js +4 -4
  187. package/package.json +6 -5
  188. package/dist/chunk-2JHFUQ6B.js.map +0 -1
  189. package/dist/chunk-4XJMRVFI.js.map +0 -1
  190. package/dist/chunk-FGKMJS3B.js.map +0 -1
  191. package/dist/chunk-LTKOV26W.js.map +0 -1
  192. /package/dist/{chunk-TUACATJA.js.map → chunk-7YZCUAXZ.js.map} +0 -0
  193. /package/dist/{chunk-YT73QWCN.js.map → chunk-AUBJUUP3.js.map} +0 -0
  194. /package/dist/{chunk-VMNMD6KF.js.map → chunk-AVX7VVOK.js.map} +0 -0
  195. /package/dist/{chunk-X7IEZBM4.js.map → chunk-DCEKU6UV.js.map} +0 -0
  196. /package/dist/{chunk-HPBE6KYY.js.map → chunk-DGQKXSRI.js.map} +0 -0
  197. /package/dist/{chunk-WXL7PVI5.js.map → chunk-FQDSV3NK.js.map} +0 -0
  198. /package/dist/{chunk-TI2RL5P2.js.map → chunk-FRSA2YB5.js.map} +0 -0
  199. /package/dist/{chunk-AMGWP7A4.js.map → chunk-GAI4VYRZ.js.map} +0 -0
  200. /package/dist/{chunk-2CYOM4BK.js.map → chunk-JO33IORF.js.map} +0 -0
  201. /package/dist/{chunk-YDS36ALB.js.map → chunk-L3SY3J5M.js.map} +0 -0
  202. /package/dist/{chunk-JAROCU6M.js.map → chunk-NCSKCF2S.js.map} +0 -0
  203. /package/dist/{chunk-CYV6632F.js.map → chunk-NOQR3TE7.js.map} +0 -0
  204. /package/dist/{chunk-LEMVXAYP.js.map → chunk-PAIB5V27.js.map} +0 -0
  205. /package/dist/{chunk-QRGTG4YB.js.map → chunk-X3GZILYD.js.map} +0 -0
  206. /package/dist/{chunk-7JKWI5FK.js.map → chunk-ZWOAFHAR.js.map} +0 -0
  207. /package/dist/{chunk-DAPAXWA5.js.map → chunk-ZZMFXRQK.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/releasesSlice/selectors.ts","../../src/utils.ts","../../src/commonConstants.tsx"],"sourcesContent":["// 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 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 [DEVICE_FILTERING_OPTIONS.$gt.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$gte.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$lt.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$lte.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$ltne.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$in.key]: val => ('' + val).split(',').map(i => i.trim()),\n [DEVICE_FILTERING_OPTIONS.$nin.key]: val => ('' + val).split(',').map(i => i.trim()),\n [DEVICE_FILTERING_OPTIONS.$exists.key]: yes,\n [DEVICE_FILTERING_OPTIONS.$nexists.key]: () => 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 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 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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;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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 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 [DEVICE_FILTERING_OPTIONS.$gt.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$gte.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$lt.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$lte.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$ltne.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$in.key]: val => ('' + val).split(',').map(i => i.trim()),\n [DEVICE_FILTERING_OPTIONS.$nin.key]: val => ('' + val).split(',').map(i => i.trim()),\n [DEVICE_FILTERING_OPTIONS.$exists.key]: yes,\n [DEVICE_FILTERING_OPTIONS.$nexists.key]: () => 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 ids.slice(0, cutOffSize).reduce((accu, id) => {\n if (id && byId[id]) {\n accu.push({ ...defaultObject, ...byId[id] });\n }\n return accu;\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 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 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 description: string;\n editable?: boolean;\n isCustom?: boolean;\n name: string;\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACcA,qBAAqC;;;ACErC,gBAA0D;AAwL1C;AAjLT,IAAM,YAAY;AAAA,EACvB,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AACT;AAKO,IAAM,6BAA6B;AAEnC,IAAM,2BAA2B;AAAA,EACtC,KAAK,EAAE,KAAK,OAAO,OAAO,UAAU,WAAW,IAAI;AAAA,EACnD,KAAK,EAAE,KAAK,OAAO,OAAO,aAAa,WAAW,KAAK;AAAA,EACvD,KAAK;AAAA,IACH,KAAK;AAAA,IACL,OAAO;AAAA,IACP,WAAW;AAAA,IACX,MAAM;AAAA,EACR;AAAA,EACA,MAAM;AAAA,IACJ,OAAO;AAAA,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AS;AAChD,IAAM,iBAAiB,WAAS,MAAM,SAAS;AAC/C,IAAM,sBAAsB,WAAS,MAAM,SAAS;AAC3D,IAAM,oBAAoB,WAAS,MAAM,SAAS,aAAa;AACxD,IAAM,iBAAiB,WAAS,MAAM,SAAS;AAEtD,IAAM,4BAA4B,OAAO,CAAC;AACnC,IAAM,sBAAkB,+BAAe,CAAC,iBAAiB,mBAAmB,yBAAyB,GAAG,cAAc;AAEtH,IAAM,yBAAqB,+BAAe,CAAC,cAAc,GAAG,iBAAe,YAAY,OAAO,CAAC,MAAM,SAAS,EAAE,GAAG,MAAM,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC;AAC3I,IAAM,qBAAiB;AAAA,EAC5B,CAAC,qBAAqB,eAAe;AAAA,EACrC,CAAC,EAAE,aAAa,MAAM,GAAG,SAAS,CAAC,EAAE,OAAO,KAAK,IAAI,EAAE,UAAU,SAAS;AAC5E;AAEO,IAAM,yBAAqB,+BAAe,CAAC,iBAAiB,oBAAoB,GAAG,CAAC,MAAM,OAAO,KAAK,EAAE,KAAK,CAAC,CAAC;","names":["AWS","Azure"]}
@@ -7,13 +7,13 @@ import {
7
7
  getReleasesList,
8
8
  getSelectedRelease,
9
9
  getUpdateTypes
10
- } from "../chunk-X7IEZBM4.js";
11
- import "../chunk-4XJMRVFI.js";
12
- import "../chunk-C5NEDBJI.js";
10
+ } from "../chunk-DCEKU6UV.js";
11
+ import "../chunk-GWJIY56H.js";
12
+ import "../chunk-OEP2D6QL.js";
13
13
  import "../chunk-CK6YE6AN.js";
14
14
  import "../chunk-MRCFLG45.js";
15
- import "../chunk-UWMYZNUB.js";
16
- import "../chunk-4B3IMP4I.js";
15
+ import "../chunk-Y575RZHR.js";
16
+ import "../chunk-BSN2TOQC.js";
17
17
  export {
18
18
  getHasReleases,
19
19
  getReleaseListState,
@@ -1162,9 +1162,7 @@ var appSlice = (0, import_toolkit.createSlice)({
1162
1162
  ...action.payload
1163
1163
  };
1164
1164
  },
1165
- setEnvironmentData: (state, action) => {
1166
- return { ...state, ...action.payload };
1167
- }
1165
+ setEnvironmentData: (state, action) => ({ ...state, ...action.payload })
1168
1166
  }
1169
1167
  });
1170
1168
  var actions = appSlice.actions;
@@ -1539,9 +1537,7 @@ var onboardingSlice = (0, import_toolkit5.createSlice)({
1539
1537
  name: sliceName5,
1540
1538
  initialState: initialState5,
1541
1539
  reducers: {
1542
- setOnboardingState: (state, action) => {
1543
- return { ...state, ...action.payload };
1544
- },
1540
+ setOnboardingState: (state, action) => ({ ...state, ...action.payload }),
1545
1541
  setDemoArtifactPort: (state, action) => {
1546
1542
  state.demoArtifactPort = action.payload;
1547
1543
  },
@@ -1980,8 +1976,22 @@ var Api = {
1980
1976
  };
1981
1977
  var general_api_default = Api;
1982
1978
 
1983
- // src/appSlice/selectors.ts
1979
+ // src/locationutils.ts
1984
1980
  var import_helpers2 = require("@northern.tech/utils/helpers");
1981
+ var defaultSelector = (result) => result[0];
1982
+ var commonFields = {
1983
+ ...Object.keys(DEVICE_LIST_DEFAULTS).reduce((accu, key) => ({ ...accu, [key]: { parse: Number, select: defaultSelector, target: key } }), {}),
1984
+ id: { parse: String, select: (i) => i, target: "id" },
1985
+ issues: { parse: void 0, select: defaultSelector, target: "selectedIssues" },
1986
+ open: { parse: Boolean, select: defaultSelector, target: "open" }
1987
+ };
1988
+ var formatReleases = ({ pageState: { searchTerm, selectedTags = [], tab, type } }) => Object.entries({ name: searchTerm, tab, type }).reduce(
1989
+ (accu, [key, value]) => value ? [...accu, `${key}=${value}`] : accu,
1990
+ selectedTags.map((tag) => `tag=${tag}`)
1991
+ ).join("&");
1992
+
1993
+ // src/appSlice/selectors.ts
1994
+ var import_helpers3 = require("@northern.tech/utils/helpers");
1985
1995
  var import_toolkit9 = require("@reduxjs/toolkit");
1986
1996
  var getAppDocsVersion = (state) => state.app.docsVersion;
1987
1997
  var getFeatures = (state) => state.app.features;
@@ -1996,10 +2006,10 @@ var getVersionInformation = (0, import_toolkit9.createSelector)(
1996
2006
  [getFullVersionInformation, getFeatures],
1997
2007
  ({ Integration, ...remainder }, { isHosted }) => isHosted && Integration !== "next" ? remainder : { ...remainder, Integration }
1998
2008
  );
1999
- var getIsPreview = (0, import_toolkit9.createSelector)([getFullVersionInformation], ({ Integration }) => (0, import_helpers2.versionCompare)(Integration, "next") > -1);
2009
+ var getIsPreview = (0, import_toolkit9.createSelector)([getFullVersionInformation], ({ Integration }) => (0, import_helpers3.versionCompare)(Integration, "next") > -1);
2000
2010
 
2001
2011
  // src/commonSelectors.ts
2002
- var import_helpers5 = require("@northern.tech/utils/helpers");
2012
+ var import_helpers6 = require("@northern.tech/utils/helpers");
2003
2013
  var import_toolkit15 = require("@reduxjs/toolkit");
2004
2014
 
2005
2015
  // src/deploymentsSlice/selectors.ts
@@ -2043,7 +2053,7 @@ var getRecentDeployments = (0, import_toolkit10.createSelector)(
2043
2053
  );
2044
2054
 
2045
2055
  // src/devicesSlice/selectors.ts
2046
- var import_helpers3 = require("@northern.tech/utils/helpers");
2056
+ var import_helpers4 = require("@northern.tech/utils/helpers");
2047
2057
  var import_toolkit11 = require("@reduxjs/toolkit");
2048
2058
  var getAcceptedDevices = (state) => state.devices.byStatus.accepted;
2049
2059
  var getDevicesByStatus = (state) => state.devices.byStatus;
@@ -2123,7 +2133,7 @@ var getGroups = (0, import_toolkit11.createSelector)([getGroupsById], (groupsByI
2123
2133
  });
2124
2134
  var getAttributesList = (0, import_toolkit11.createSelector)(
2125
2135
  [getFilteringAttributes, getFilteringAttributesFromConfig],
2126
- ({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) => [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(import_helpers3.duplicateFilter)
2136
+ ({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) => [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(import_helpers4.duplicateFilter)
2127
2137
  );
2128
2138
  var getDeviceTypes = (0, import_toolkit11.createSelector)(
2129
2139
  [getAcceptedDevices, getDevicesById],
@@ -2177,7 +2187,7 @@ var getAuditLogEntry = (0, import_toolkit12.createSelector)([getAuditLog, getAud
2177
2187
  });
2178
2188
 
2179
2189
  // src/utils.ts
2180
- var import_helpers4 = require("@northern.tech/utils/helpers");
2190
+ var import_helpers5 = require("@northern.tech/utils/helpers");
2181
2191
  var filterProcessors = {
2182
2192
  [DEVICE_FILTERING_OPTIONS.$gt.key]: (val) => Number(val) || val,
2183
2193
  [DEVICE_FILTERING_OPTIONS.$gte.key]: (val) => Number(val) || val,
@@ -2186,7 +2196,7 @@ var filterProcessors = {
2186
2196
  [DEVICE_FILTERING_OPTIONS.$ltne.key]: (val) => Number(val) || val,
2187
2197
  [DEVICE_FILTERING_OPTIONS.$in.key]: (val) => ("" + val).split(",").map((i) => i.trim()),
2188
2198
  [DEVICE_FILTERING_OPTIONS.$nin.key]: (val) => ("" + val).split(",").map((i) => i.trim()),
2189
- [DEVICE_FILTERING_OPTIONS.$exists.key]: import_helpers4.yes,
2199
+ [DEVICE_FILTERING_OPTIONS.$exists.key]: import_helpers5.yes,
2190
2200
  [DEVICE_FILTERING_OPTIONS.$nexists.key]: () => false
2191
2201
  };
2192
2202
  var filterAliases = {
@@ -2219,14 +2229,12 @@ var convertDeviceListStateToFilters = ({ filters = [], group, groups = { byId: {
2219
2229
  const effectiveFilters = status ? [...applicableFilters, { key: "status", value: status, operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: "identity" }] : applicableFilters;
2220
2230
  return { applicableFilters: nonMonitorFilters, filterTerms: mapFiltersToTerms(effectiveFilters) };
2221
2231
  };
2222
- var listItemMapper = (byId, ids, { defaultObject = {}, cutOffSize = DEVICE_LIST_MAXIMUM_LENGTH }) => {
2223
- return ids.slice(0, cutOffSize).reduce((accu, id) => {
2224
- if (id && byId[id]) {
2225
- accu.push({ ...defaultObject, ...byId[id] });
2226
- }
2227
- return accu;
2228
- }, []);
2229
- };
2232
+ var listItemMapper = (byId, ids, { defaultObject = {}, cutOffSize = DEVICE_LIST_MAXIMUM_LENGTH }) => ids.slice(0, cutOffSize).reduce((accu, id) => {
2233
+ if (id && byId[id]) {
2234
+ accu.push({ ...defaultObject, ...byId[id] });
2235
+ }
2236
+ return accu;
2237
+ }, []);
2230
2238
  var mergePermissions = (existingPermissions = { ...emptyUiPermissions }, addedPermissions) => Object.entries(existingPermissions).reduce(
2231
2239
  (accu, [key, value]) => {
2232
2240
  let values;
@@ -2235,7 +2243,7 @@ var mergePermissions = (existingPermissions = { ...emptyUiPermissions }, addedPe
2235
2243
  return accu;
2236
2244
  }
2237
2245
  if (Array.isArray(value)) {
2238
- values = [...value, ...accu[key]].filter(import_helpers4.duplicateFilter);
2246
+ values = [...value, ...accu[key]].filter(import_helpers5.duplicateFilter);
2239
2247
  } else {
2240
2248
  values = mergePermissions(accu[key], { ...value });
2241
2249
  }
@@ -2425,7 +2433,7 @@ var getFilterAttributes = (0, import_toolkit15.createSelector)(
2425
2433
  firstRequestAttribute,
2426
2434
  ...systemAttributes.map((item) => ({ key: item, value: item, scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 }))
2427
2435
  ];
2428
- return (0, import_helpers5.attributeDuplicateFilter)(attributes, "key");
2436
+ return (0, import_helpers6.attributeDuplicateFilter)(attributes, "key");
2429
2437
  }
2430
2438
  );
2431
2439
  var getOnboardingState = (0, import_toolkit15.createSelector)([getOnboarding, getUserSettings], ({ complete, progress: progress2, showTips, ...remainder }, { onboarding = {} }) => ({
@@ -2436,7 +2444,7 @@ var getOnboardingState = (0, import_toolkit15.createSelector)([getOnboarding, ge
2436
2444
  showTips: !onboarding.showTips ? onboarding.showTips : showTips
2437
2445
  }));
2438
2446
  var getDemoDeviceAddress = (0, import_toolkit15.createSelector)([getDevicesById, getOnboarding], (devicesById, { approach, demoArtifactPort }) => {
2439
- const demoDeviceAddress = `http://${(0, import_helpers5.getDemoDeviceAddress)(Object.values(devicesById), approach)}`;
2447
+ const demoDeviceAddress = `http://${(0, import_helpers6.getDemoDeviceAddress)(Object.values(devicesById), approach)}`;
2440
2448
  return demoArtifactPort ? `${demoDeviceAddress}:${demoArtifactPort}` : demoDeviceAddress;
2441
2449
  });
2442
2450
  var getDeviceConfigDeployment = (0, import_toolkit15.createSelector)([getDeviceById, getDeploymentsById], (device, deploymentsById) => {
@@ -2489,9 +2497,7 @@ var getGroupNames = (0, import_toolkit15.createSelector)([getGroupsById, getUser
2489
2497
  });
2490
2498
  var getDeviceReportsForUser = (0, import_toolkit15.createSelector)(
2491
2499
  [getUserSettings, getCurrentUser, getGlobalSettings, getDevicesById],
2492
- ({ reports }, { id: currentUserId }, globalSettings, devicesById) => {
2493
- return reports || globalSettings[`${currentUserId}-reports`] || (Object.keys(devicesById).length ? defaultReports : []);
2494
- }
2500
+ ({ reports }, { id: currentUserId }, globalSettings, devicesById) => reports || globalSettings[`${currentUserId}-reports`] || (Object.keys(devicesById).length ? defaultReports : [])
2495
2501
  );
2496
2502
  var listTypeDeviceIdMap = {
2497
2503
  deviceList: getListedDevices,
@@ -2531,7 +2537,7 @@ var getRelevantRoles = (0, import_toolkit15.createSelector)([getOrganization, ge
2531
2537
 
2532
2538
  // src/store.ts
2533
2539
  var import_react_redux = require("react-redux");
2534
- var import_helpers6 = require("@northern.tech/utils/helpers");
2540
+ var import_helpers7 = require("@northern.tech/utils/helpers");
2535
2541
  var import_toolkit16 = require("@reduxjs/toolkit");
2536
2542
  var { setSnackbar, uploadProgress } = actions_default;
2537
2543
  var keys = ["sessionDeploymentChecker", settingsKeys.initialized];
@@ -2539,9 +2545,9 @@ var resetEnvironment = () => keys.forEach((key) => window.sessionStorage.removeI
2539
2545
  resetEnvironment();
2540
2546
  var commonErrorFallback = "Please check your connection.";
2541
2547
  var commonErrorHandler = (err, errorContext, dispatch, fallback, mightBeAuthRelated = false) => {
2542
- const errMsg = (0, import_helpers6.extractErrorMessage)(err, fallback);
2548
+ const errMsg = (0, import_helpers7.extractErrorMessage)(err, fallback);
2543
2549
  if (mightBeAuthRelated || getToken()) {
2544
- dispatch(setSnackbar({ message: (0, import_helpers6.preformatWithRequestID)(err.response, `${errorContext} ${errMsg}`), action: "Copy to clipboard" }));
2550
+ dispatch(setSnackbar({ message: (0, import_helpers7.preformatWithRequestID)(err.response, `${errorContext} ${errMsg}`), action: "Copy to clipboard" }));
2545
2551
  }
2546
2552
  return Promise.reject(err);
2547
2553
  };
@@ -2592,8 +2598,7 @@ var store = getConfiguredStore({
2592
2598
  });
2593
2599
 
2594
2600
  // src/releasesSlice/thunks.ts
2595
- var import_helpers7 = require("@northern.tech/utils/helpers");
2596
- var import_locationutils = require("@northern.tech/utils/locationutils");
2601
+ var import_helpers8 = require("@northern.tech/utils/helpers");
2597
2602
  var import_toolkit17 = require("@reduxjs/toolkit");
2598
2603
  var import_axios2 = require("axios");
2599
2604
  var import_uuid = require("uuid");
@@ -2601,7 +2606,7 @@ var { setSnackbar: setSnackbar2, initUpload, uploadProgress: uploadProgress2, cl
2601
2606
  var { page: defaultPage, perPage: defaultPerPage } = DEVICE_LIST_DEFAULTS;
2602
2607
  var sortingDefaults = { direction: SORTING_OPTIONS.desc, key: "modified" };
2603
2608
  var flattenRelease = (release, stateRelease) => {
2604
- const updatedArtifacts = release.artifacts?.sort((0, import_helpers7.customSort)(1, "modified")) || [];
2609
+ const updatedArtifacts = release.artifacts?.sort((0, import_helpers8.customSort)(true, "modified")) || [];
2605
2610
  const { artifacts, deviceTypes, modified } = updatedArtifacts.reduce(
2606
2611
  (accu, item) => {
2607
2612
  accu.deviceTypes.push(...item.device_types_compatible);
@@ -2615,7 +2620,7 @@ var flattenRelease = (release, stateRelease) => {
2615
2620
  },
2616
2621
  { artifacts: [], deviceTypes: [], modified: void 0 }
2617
2622
  );
2618
- return { ...stateRelease, ...release, artifacts, device_types_compatible: deviceTypes.filter(import_helpers7.duplicateFilter), modified };
2623
+ return { ...stateRelease, ...release, artifacts, device_types_compatible: deviceTypes.filter(import_helpers8.duplicateFilter), modified };
2619
2624
  };
2620
2625
  var reduceReceivedReleases = (releases, stateReleasesById) => releases.reduce((accu, release) => {
2621
2626
  const stateRelease = stateReleasesById[release.name] || {};
@@ -2639,7 +2644,7 @@ var getArtifactInstallCount = (0, import_toolkit17.createAsyncThunk)(`${sliceNam
2639
2644
  }
2640
2645
  const releaseArtifacts = [...release.artifacts];
2641
2646
  const artifact = releaseArtifacts[index];
2642
- const { key, name, version } = (0, import_helpers7.extractSoftwareItem)(artifact.artifact_provides) ?? {};
2647
+ const { key, name, version } = (0, import_helpers8.extractSoftwareItem)(artifact.artifact_provides) ?? {};
2643
2648
  const attribute = `${key}${name ? `.${name}` : ""}.version`;
2644
2649
  const { filterTerms } = convertDeviceListStateToFilters({
2645
2650
  filters: [{ ...emptyFilter, key: attribute, value: version, scope: "inventory" }]
@@ -2815,7 +2820,7 @@ var setReleasesListState = (0, import_toolkit17.createAsyncThunk)(`${sliceName7}
2815
2820
  let tasks = [];
2816
2821
  const { isLoading: currentLoading, ...currentRequestState } = currentState;
2817
2822
  const { isLoading: selectionLoading, ...selectionRequestState } = nextState;
2818
- if (!(0, import_helpers7.deepCompare)(currentRequestState, selectionRequestState)) {
2823
+ if (!(0, import_helpers8.deepCompare)(currentRequestState, selectionRequestState)) {
2819
2824
  nextState.isLoading = true;
2820
2825
  tasks.push(dispatch(getReleases(nextState)).finally(() => dispatch(setReleasesListState({ isLoading: false }))));
2821
2826
  }
@@ -2825,7 +2830,7 @@ var setReleasesListState = (0, import_toolkit17.createAsyncThunk)(`${sliceName7}
2825
2830
  var releaseListRetrieval = (config) => {
2826
2831
  const { searchTerm = "", page = defaultPage, perPage = defaultPerPage, sort = sortingDefaults, selectedTags = [], type = "" } = config;
2827
2832
  const { key: attribute, direction } = sort;
2828
- const filterQuery = (0, import_locationutils.formatReleases)({ pageState: { searchTerm, selectedTags } });
2833
+ const filterQuery = formatReleases({ pageState: { searchTerm, selectedTags } });
2829
2834
  const updateType = type ? `update_type=${type}` : "";
2830
2835
  const sorting = attribute ? `sort=${attribute}:${direction}`.toLowerCase() : "";
2831
2836
  return general_api_default.get(
@@ -2835,7 +2840,7 @@ var releaseListRetrieval = (config) => {
2835
2840
  var deductSearchState = (receivedReleases, config, total, state) => {
2836
2841
  let releaseListState = { ...state.releasesList };
2837
2842
  const { searchTerm, searchOnly, sort = {}, selectedTags = [], type } = config;
2838
- const flattenedReleases = Object.values(receivedReleases).sort((0, import_helpers7.customSort)(sort.direction === SORTING_OPTIONS.desc, sort.key));
2843
+ const flattenedReleases = Object.values(receivedReleases).sort((0, import_helpers8.customSort)(sort.direction === SORTING_OPTIONS.desc, sort.key));
2839
2844
  const releaseIds = flattenedReleases.map((item) => item.name);
2840
2845
  const isFiltering = !!(selectedTags.length || type || searchTerm);
2841
2846
  if (searchOnly) {
@@ -2874,21 +2879,21 @@ var getRelease = (0, import_toolkit17.createAsyncThunk)(`${sliceName7}/getReleas
2874
2879
  });
2875
2880
  var updateReleaseInfo = (0, import_toolkit17.createAsyncThunk)(
2876
2881
  `${sliceName7}/updateReleaseInfo`,
2877
- ({ name, info }, { dispatch, getState }) => general_api_default.patch(`${deploymentsApiUrlV2}/deployments/releases/${name}`, info).catch((err) => commonErrorHandler(err, `Release details couldn't be updated.`, dispatch)).then(() => {
2878
- return Promise.all([
2882
+ ({ name, info }, { dispatch, getState }) => general_api_default.patch(`${deploymentsApiUrlV2}/deployments/releases/${name}`, info).catch((err) => commonErrorHandler(err, `Release details couldn't be updated.`, dispatch)).then(
2883
+ () => Promise.all([
2879
2884
  dispatch(actions7.receiveRelease({ ...getReleasesById(getState())[name], ...info, name })),
2880
2885
  dispatch(setSnackbar2("Release details were updated successfully.", TIMEOUTS.fiveSeconds, ""))
2881
- ]);
2882
- })
2886
+ ])
2887
+ )
2883
2888
  );
2884
2889
  var setReleaseTags = (0, import_toolkit17.createAsyncThunk)(
2885
2890
  `${sliceName7}/setReleaseTags`,
2886
- ({ name, tags = [] }, { dispatch, getState }) => general_api_default.put(`${deploymentsApiUrlV2}/deployments/releases/${name}/tags`, tags).catch((err) => commonErrorHandler(err, `Release tags couldn't be set.`, dispatch)).then(() => {
2887
- return Promise.all([
2891
+ ({ name, tags = [] }, { dispatch, getState }) => general_api_default.put(`${deploymentsApiUrlV2}/deployments/releases/${name}/tags`, tags).catch((err) => commonErrorHandler(err, `Release tags couldn't be set.`, dispatch)).then(
2892
+ () => Promise.all([
2888
2893
  dispatch(actions7.receiveRelease({ ...getReleasesById(getState())[name], name, tags })),
2889
2894
  dispatch(setSnackbar2("Release tags were set successfully.", TIMEOUTS.fiveSeconds, ""))
2890
- ]);
2891
- })
2895
+ ])
2896
+ )
2892
2897
  );
2893
2898
  var getExistingReleaseTags = (0, import_toolkit17.createAsyncThunk)(
2894
2899
  `${sliceName7}/getReleaseTags`,