@northern.tech/store 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions.js +5 -5
- package/dist/api/general-api.js +1 -1
- package/dist/api/users-api.js +1 -1
- package/dist/appSlice/index.js +1 -1
- package/dist/appSlice/mocks.js +1 -1
- package/dist/appSlice/thunks.cjs +4 -2
- package/dist/appSlice/thunks.cjs.map +1 -1
- package/dist/appSlice/thunks.js +13 -13
- package/dist/auth.js +1 -1
- package/dist/{chunk-3JFB22RN.js → chunk-2S5F4CQS.js} +21 -21
- package/dist/{chunk-WIGVDU4L.js → chunk-66LI4BJO.js} +6 -3
- package/dist/{chunk-WIGVDU4L.js.map → chunk-66LI4BJO.js.map} +1 -1
- package/dist/{chunk-DWK4R74O.js → chunk-CQT3GJNR.js} +8 -8
- package/dist/{chunk-GDJES5SY.js → chunk-G2OECV4D.js} +9 -9
- package/dist/{chunk-GEJJVRND.js → chunk-GDB5IZMC.js} +7 -7
- package/dist/{chunk-MTY2ODOS.js → chunk-GEJDA2ZF.js} +8 -8
- package/dist/{chunk-DXMRQEP6.js → chunk-ILSHXLJ3.js} +11 -11
- package/dist/commonConstants.js +1 -1
- package/dist/commonSelectors.cjs +4 -2
- package/dist/commonSelectors.cjs.map +1 -1
- package/dist/commonSelectors.js +5 -5
- package/dist/constants.js +4 -4
- package/dist/deploymentsSlice/constants.js +1 -1
- package/dist/deploymentsSlice/index.js +1 -1
- package/dist/deploymentsSlice/mocks.js +1 -1
- package/dist/deploymentsSlice/selectors.js +1 -1
- package/dist/deploymentsSlice/thunks.cjs +4 -2
- package/dist/deploymentsSlice/thunks.cjs.map +1 -1
- package/dist/deploymentsSlice/thunks.js +13 -13
- package/dist/devicesSlice/constants.js +1 -1
- package/dist/devicesSlice/index.js +1 -1
- package/dist/devicesSlice/mocks.js +1 -1
- package/dist/devicesSlice/selectors.cjs +6 -2
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.d.cts +92 -4
- package/dist/devicesSlice/selectors.d.ts +92 -4
- package/dist/devicesSlice/selectors.js +4 -2
- package/dist/devicesSlice/thunks.cjs +4 -2
- package/dist/devicesSlice/thunks.cjs.map +1 -1
- package/dist/devicesSlice/thunks.js +13 -13
- package/dist/liststatehook.js +1 -1
- package/dist/locationutils.js +1 -1
- package/dist/monitorSlice/index.js +1 -1
- package/dist/monitorSlice/mocks.js +1 -1
- package/dist/monitorSlice/thunks.cjs +4 -2
- package/dist/monitorSlice/thunks.cjs.map +1 -1
- package/dist/monitorSlice/thunks.js +11 -11
- package/dist/onboardingSlice/thunks.cjs +4 -2
- package/dist/onboardingSlice/thunks.cjs.map +1 -1
- package/dist/onboardingSlice/thunks.js +13 -13
- package/dist/organizationSlice/constants.js +1 -1
- package/dist/organizationSlice/index.js +1 -1
- package/dist/organizationSlice/mocks.js +1 -1
- package/dist/organizationSlice/selectors.js +1 -1
- package/dist/organizationSlice/thunks.cjs +4 -2
- package/dist/organizationSlice/thunks.cjs.map +1 -1
- package/dist/organizationSlice/thunks.js +13 -13
- package/dist/releasesSlice/index.js +1 -1
- package/dist/releasesSlice/mocks.js +1 -1
- package/dist/releasesSlice/selectors.js +1 -1
- package/dist/releasesSlice/thunks.cjs +4 -2
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.js +11 -11
- package/dist/selectors.cjs +6 -2
- package/dist/selectors.cjs.map +1 -1
- package/dist/selectors.d.cts +1 -1
- package/dist/selectors.d.ts +1 -1
- package/dist/selectors.js +11 -9
- package/dist/sockethook.js +1 -1
- package/dist/store.js +6 -6
- package/dist/storehooks.cjs +4 -2
- package/dist/storehooks.cjs.map +1 -1
- package/dist/storehooks.js +13 -13
- package/dist/thunks.cjs +4 -2
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.js +13 -13
- package/dist/useDeploymentDevice.cjs +4 -2
- package/dist/useDeploymentDevice.cjs.map +1 -1
- package/dist/useDeploymentDevice.js +15 -15
- package/dist/usersSlice/constants.js +1 -1
- package/dist/usersSlice/index.js +1 -1
- package/dist/usersSlice/mocks.js +1 -1
- package/dist/usersSlice/selectors.js +1 -1
- package/dist/usersSlice/thunks.cjs +4 -2
- package/dist/usersSlice/thunks.cjs.map +1 -1
- package/dist/usersSlice/thunks.js +13 -13
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-3JFB22RN.js.map → chunk-2S5F4CQS.js.map} +0 -0
- /package/dist/{chunk-DWK4R74O.js.map → chunk-CQT3GJNR.js.map} +0 -0
- /package/dist/{chunk-GDJES5SY.js.map → chunk-G2OECV4D.js.map} +0 -0
- /package/dist/{chunk-GEJJVRND.js.map → chunk-GDB5IZMC.js.map} +0 -0
- /package/dist/{chunk-MTY2ODOS.js.map → chunk-GEJDA2ZF.js.map} +0 -0
- /package/dist/{chunk-DXMRQEP6.js.map → chunk-ILSHXLJ3.js.map} +0 -0
package/dist/appSlice/thunks.js
CHANGED
|
@@ -3,37 +3,37 @@ import {
|
|
|
3
3
|
setFirstLoginAfterSignup,
|
|
4
4
|
setOfflineThreshold,
|
|
5
5
|
setSearchState
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-DXMRQEP6.js";
|
|
6
|
+
} from "../chunk-2S5F4CQS.js";
|
|
7
|
+
import "../chunk-GDB5IZMC.js";
|
|
8
|
+
import "../chunk-GEJDA2ZF.js";
|
|
10
9
|
import "../chunk-SDWPOLHM.js";
|
|
11
10
|
import "../chunk-VK6FVQ5K.js";
|
|
12
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-ILSHXLJ3.js";
|
|
12
|
+
import "../chunk-G2OECV4D.js";
|
|
13
13
|
import "../chunk-525LX7VL.js";
|
|
14
14
|
import "../chunk-4YLOOOZH.js";
|
|
15
|
-
import "../chunk-LSAJE3IU.js";
|
|
16
|
-
import "../chunk-2QIGK5IU.js";
|
|
17
15
|
import "../chunk-CQXDAXQF.js";
|
|
18
16
|
import "../chunk-HVZ5BOM6.js";
|
|
19
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-LSAJE3IU.js";
|
|
20
18
|
import "../chunk-UBFFGYQ4.js";
|
|
19
|
+
import "../chunk-2QIGK5IU.js";
|
|
20
|
+
import "../chunk-GX3X2E57.js";
|
|
21
21
|
import "../chunk-WXRYJOL3.js";
|
|
22
22
|
import "../chunk-KR5IU7TA.js";
|
|
23
23
|
import "../chunk-NMAXZ3ZY.js";
|
|
24
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-CQT3GJNR.js";
|
|
25
25
|
import "../chunk-VLII64V6.js";
|
|
26
26
|
import "../chunk-QX67O5A2.js";
|
|
27
|
-
import "../chunk-XHLNGIAP.js";
|
|
28
|
-
import "../chunk-FAKWYYOB.js";
|
|
29
27
|
import "../chunk-JIS4PA3R.js";
|
|
30
|
-
import "../chunk-WIGVDU4L.js";
|
|
31
28
|
import "../chunk-YO22XLHI.js";
|
|
29
|
+
import "../chunk-XHLNGIAP.js";
|
|
30
|
+
import "../chunk-FAKWYYOB.js";
|
|
31
|
+
import "../chunk-66LI4BJO.js";
|
|
32
32
|
import "../chunk-4BHM6WVX.js";
|
|
33
33
|
import "../chunk-SDHCQ62K.js";
|
|
34
34
|
import "../chunk-CMXRPUOF.js";
|
|
35
|
-
import "../chunk-2DYA3X77.js";
|
|
36
35
|
import "../chunk-FAJ3I2UQ.js";
|
|
36
|
+
import "../chunk-2DYA3X77.js";
|
|
37
37
|
import "../chunk-ZKAH3APE.js";
|
|
38
38
|
import "../chunk-DBBE6D36.js";
|
|
39
39
|
export {
|
package/dist/auth.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
updateMaxAge
|
|
7
7
|
} from "./chunk-WXRYJOL3.js";
|
|
8
8
|
import "./chunk-CMXRPUOF.js";
|
|
9
|
-
import "./chunk-2DYA3X77.js";
|
|
10
9
|
import "./chunk-FAJ3I2UQ.js";
|
|
10
|
+
import "./chunk-2DYA3X77.js";
|
|
11
11
|
import "./chunk-ZKAH3APE.js";
|
|
12
12
|
import "./chunk-DBBE6D36.js";
|
|
13
13
|
export {
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDeviceMonitorConfig,
|
|
3
3
|
getLatestDeviceAlerts
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
commonErrorFallback,
|
|
7
|
-
commonErrorHandler,
|
|
8
|
-
createAppAsyncThunk
|
|
9
|
-
} from "./chunk-DXMRQEP6.js";
|
|
4
|
+
} from "./chunk-GEJDA2ZF.js";
|
|
10
5
|
import {
|
|
11
6
|
users_api_default
|
|
12
7
|
} from "./chunk-SDWPOLHM.js";
|
|
13
8
|
import {
|
|
14
9
|
general_api_default
|
|
15
10
|
} from "./chunk-VK6FVQ5K.js";
|
|
11
|
+
import {
|
|
12
|
+
commonErrorFallback,
|
|
13
|
+
commonErrorHandler,
|
|
14
|
+
createAppAsyncThunk
|
|
15
|
+
} from "./chunk-ILSHXLJ3.js";
|
|
16
16
|
import {
|
|
17
17
|
actions_default
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-G2OECV4D.js";
|
|
19
19
|
import {
|
|
20
20
|
actions as actions6,
|
|
21
21
|
sliceName as sliceName6
|
|
22
22
|
} from "./chunk-4YLOOOZH.js";
|
|
23
|
+
import {
|
|
24
|
+
actions as actions4,
|
|
25
|
+
sliceName as sliceName4
|
|
26
|
+
} from "./chunk-CQXDAXQF.js";
|
|
23
27
|
import {
|
|
24
28
|
actions as actions5,
|
|
25
29
|
sliceName as sliceName5
|
|
26
30
|
} from "./chunk-LSAJE3IU.js";
|
|
31
|
+
import {
|
|
32
|
+
actions as actions3,
|
|
33
|
+
sliceName as sliceName3
|
|
34
|
+
} from "./chunk-UBFFGYQ4.js";
|
|
27
35
|
import {
|
|
28
36
|
actions as actions2,
|
|
29
37
|
sliceName as sliceName2
|
|
30
38
|
} from "./chunk-2QIGK5IU.js";
|
|
31
|
-
import {
|
|
32
|
-
actions as actions4,
|
|
33
|
-
sliceName as sliceName4
|
|
34
|
-
} from "./chunk-CQXDAXQF.js";
|
|
35
39
|
import {
|
|
36
40
|
actions,
|
|
37
41
|
sliceName
|
|
38
42
|
} from "./chunk-GX3X2E57.js";
|
|
39
|
-
import {
|
|
40
|
-
actions as actions3,
|
|
41
|
-
sliceName as sliceName3
|
|
42
|
-
} from "./chunk-UBFFGYQ4.js";
|
|
43
43
|
import {
|
|
44
44
|
cleanUp,
|
|
45
45
|
getSessionInfo,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
getSearchEndpoint,
|
|
53
53
|
getTenantCapabilities,
|
|
54
54
|
getUserCapabilities
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-CQT3GJNR.js";
|
|
56
56
|
import {
|
|
57
57
|
getCurrentSession,
|
|
58
58
|
getCurrentUser,
|
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
getDevicesById,
|
|
87
87
|
getGroupsById,
|
|
88
88
|
getSelectedGroup
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-66LI4BJO.js";
|
|
90
90
|
import {
|
|
91
91
|
getFeatures,
|
|
92
92
|
getSearchState
|
|
@@ -156,13 +156,13 @@ import {
|
|
|
156
156
|
useradmApiUrl,
|
|
157
157
|
useradmApiUrlv2
|
|
158
158
|
} from "./chunk-CMXRPUOF.js";
|
|
159
|
-
import {
|
|
160
|
-
rootfsImageVersion
|
|
161
|
-
} from "./chunk-2DYA3X77.js";
|
|
162
159
|
import {
|
|
163
160
|
onboardingSteps,
|
|
164
161
|
orderedOnboardingSteps
|
|
165
162
|
} from "./chunk-FAJ3I2UQ.js";
|
|
163
|
+
import {
|
|
164
|
+
rootfsImageVersion
|
|
165
|
+
} from "./chunk-2DYA3X77.js";
|
|
166
166
|
import {
|
|
167
167
|
ADDONS,
|
|
168
168
|
PLANS,
|
|
@@ -2873,4 +2873,4 @@ export {
|
|
|
2873
2873
|
setAllTooltipsReadState,
|
|
2874
2874
|
submitUserFeedback
|
|
2875
2875
|
};
|
|
2876
|
-
//# sourceMappingURL=chunk-
|
|
2876
|
+
//# sourceMappingURL=chunk-2S5F4CQS.js.map
|
|
@@ -106,9 +106,11 @@ var getAttributesList = createSelector(
|
|
|
106
106
|
[getFilteringAttributes, getFilteringAttributesFromConfig],
|
|
107
107
|
({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) => [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(duplicateFilter)
|
|
108
108
|
);
|
|
109
|
-
var
|
|
109
|
+
var getEnabledTierLimits = createSelector([getDeviceLimits], (limits) => Object.entries(limits).filter(([, limit]) => limit !== 0));
|
|
110
|
+
var getEnabledTiers = createSelector([getEnabledTierLimits], (enabledTierLimits) => enabledTierLimits.map(([type]) => type));
|
|
111
|
+
var getDeviceLimitStats = createSelector([getEnabledTierLimits, getAcceptedDevices], (enabledTierLimits, accepted) => {
|
|
110
112
|
const { counts } = accepted;
|
|
111
|
-
return
|
|
113
|
+
return enabledTierLimits.map(([type, limit]) => ({
|
|
112
114
|
type,
|
|
113
115
|
limit,
|
|
114
116
|
total: counts[type] || 0
|
|
@@ -153,7 +155,8 @@ export {
|
|
|
153
155
|
getGroupData,
|
|
154
156
|
getGroups,
|
|
155
157
|
getAttributesList,
|
|
158
|
+
getEnabledTiers,
|
|
156
159
|
getDeviceLimitStats,
|
|
157
160
|
getDeviceTypes
|
|
158
161
|
};
|
|
159
|
-
//# sourceMappingURL=chunk-
|
|
162
|
+
//# sourceMappingURL=chunk-66LI4BJO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/devicesSlice/selectors.ts"],"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 { duplicateFilter } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport type { DeviceFilter, DeviceGroup } from '.';\nimport type { DeviceAuthState } from '../constants';\nimport { DEVICE_STATES, UNGROUPED_GROUP } from '../constants';\nimport type { RootState } from '../store';\n\nexport const getAcceptedDevices = (state: RootState) => state.devices.byStatus.accepted;\nexport const getDevicesByStatus = (state: RootState) => state.devices.byStatus;\nexport const getDevicesById = (state: RootState) => state.devices.byId;\nexport const getDeviceReports = (state: RootState) => state.devices.reports;\nexport const getGroupsById = (state: RootState) => state.devices.groups.byId;\nexport const getSelectedGroup = (state: RootState) => state.devices.groups.selectedGroup;\n\nexport const getDeviceListState = (state: RootState) => state.devices.deviceList;\nexport const getListedDevices = (state: RootState) => state.devices.deviceList.deviceIds;\nexport const getFilteringAttributes = (state: RootState) => state.devices.filteringAttributes;\nexport const getDeviceFilters = (state: RootState) => state.devices.filters || [];\nconst getFilteringAttributesFromConfig = (state: RootState) => state.devices.filteringAttributesConfig.attributes;\nexport const getSortedFilteringAttributes = createSelector([getFilteringAttributes], filteringAttributes => ({\n ...filteringAttributes,\n identityAttributes: [...filteringAttributes.identityAttributes, 'id']\n}));\nexport const getDeviceLimits = (state: RootState) => state.devices.limits;\nconst getFilteringAttributesLimit = (state: RootState) => 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<Record<DeviceAuthState, number>>(\n (accu, deviceState) => {\n const { counts } = byStatus[deviceState];\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { total, ...tieredCounts } = counts;\n const count = Object.values(tieredCounts).reduce((accu, countPerTier) => accu + countPerTier, 0);\n accu[deviceState] = count;\n accu.total = accu.total + count;\n return accu;\n },\n { total: 0 }\n )\n);\n\nexport const getDeviceById = createSelector([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = '') => devicesById[deviceId] ?? {});\n\nexport const getSelectedGroupInfo = createSelector(\n [getDeviceCountsByStatus, getGroupsById, getSelectedGroup],\n ({ accepted: acceptedDeviceTotal }, groupsById, selectedGroup) => {\n let groupCount = acceptedDeviceTotal;\n let groupFilters: DeviceFilter[] = [];\n if (selectedGroup && groupsById[selectedGroup]) {\n groupCount = groupsById[selectedGroup].total || 0;\n groupFilters = groupsById[selectedGroup].filters || [];\n }\n return { groupCount, selectedGroup, groupFilters };\n }\n);\n\nexport const getCombinedLimit = createSelector(\n [getDeviceLimits],\n deviceLimits => Object.values(deviceLimits).reduce((accu, limit) => accu + Math.max(limit ?? 0, 0), 0) // limit might be -1 for unlimited devices\n);\n\nexport const getLimitMaxed = createSelector(\n [getDeviceCountsByStatus, getCombinedLimit],\n ({ accepted: acceptedDevices }, combinedLimit) => !!combinedLimit && combinedLimit <= 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 getGroupData = createSelector([getGroupsByIdWithoutUngrouped], groups => {\n const createdGroup = Object.keys(groups).length ? Object.keys(groups)[0] : undefined;\n const hasDynamicGroups = Object.values(groups).some(group => !!group.id);\n return { createdGroup, hasDynamicGroups, groups };\n});\n\ntype SelectorGroup = DeviceGroup & { groupId: string };\ntype SelectorGroups = { dynamic: SelectorGroup[]; static: SelectorGroup[]; ungrouped: SelectorGroup[] };\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<SelectorGroups>(\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);\nexport const getDeviceLimitStats = createSelector([getDeviceLimits, getAcceptedDevices], (limits, accepted) => {\n const { counts } = accepted;\n return Object.entries(limits)\n .filter(([, limit]) => limit !== 0)\n .map(([type, limit]) => ({\n type,\n limit,\n total: counts[type] || 0\n }));\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 de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c;AACxC,CAAC;AACM,IAAM,oBAAoB;AAAA,EAC/B,CAAC,wBAAwB,gCAAgC;AAAA,EACzD,CAAC,EAAE,qBAAqB,CAAC,GAAG,sBAAsB,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,YAAY,CAAC,EAAE,MACtF,CAAC,GAAG,oBAAoB,GAAG,qBAAqB,GAAG,UAAU,GAAG,SAAS,EAAE,OAAO,eAAe;AACrG;AACO,IAAM,sBAAsB,eAAe,CAAC,iBAAiB,kBAAkB,GAAG,CAAC,QAAQ,aAAa;AAC7G,QAAM,EAAE,OAAO,IAAI;AACnB,SAAO,OAAO,QAAQ,MAAM,EACzB,OAAO,CAAC,CAAC,EAAE,KAAK,MAAM,UAAU,CAAC,EACjC,IAAI,CAAC,CAAC,MAAM,KAAK,OAAO;AAAA,IACvB;AAAA,IACA;AAAA,IACA,OAAO,OAAO,IAAI,KAAK;AAAA,EACzB,EAAE;AACN,CAAC;AAEM,IAAM,iBAAiB;AAAA,EAAe,CAAC,oBAAoB,cAAc;AAAA,EAAG,CAAC,EAAE,YAAY,CAAC,EAAE,GAAG,gBACtG,OAAO;AAAA,IACL,UAAU,MAAM,GAAG,GAAG,EAAE,OAAO,CAAC,MAAM,SAAS;AAC7C,YAAM,EAAE,aAAa,cAAc,CAAC,EAAE,IAAI,YAAY,IAAI,IAAI,YAAY,IAAI,EAAE,aAAa,CAAC;AAC9F,aAAO,YAAY,OAAO,CAAC,gBAAgB,eAAe;AACxD,YAAI,WAAW,SAAS,GAAG;AACzB,yBAAe,UAAU,IAAI,eAAe,UAAU,IAAI,eAAe,UAAU,IAAI,IAAI;AAAA,QAC7F;AACA,eAAO;AAAA,MACT,GAAG,IAAI;AACP,aAAO;AAAA,IACT,GAAG,CAAC,CAAC;AAAA,EACP;AACF;","names":["accu"]}
|
|
1
|
+
{"version":3,"sources":["../src/devicesSlice/selectors.ts"],"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 { duplicateFilter } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport type { DeviceFilter, DeviceGroup } from '.';\nimport type { DeviceAuthState } from '../constants';\nimport { DEVICE_STATES, UNGROUPED_GROUP } from '../constants';\nimport type { RootState } from '../store';\n\nexport const getAcceptedDevices = (state: RootState) => state.devices.byStatus.accepted;\nexport const getDevicesByStatus = (state: RootState) => state.devices.byStatus;\nexport const getDevicesById = (state: RootState) => state.devices.byId;\nexport const getDeviceReports = (state: RootState) => state.devices.reports;\nexport const getGroupsById = (state: RootState) => state.devices.groups.byId;\nexport const getSelectedGroup = (state: RootState) => state.devices.groups.selectedGroup;\n\nexport const getDeviceListState = (state: RootState) => state.devices.deviceList;\nexport const getListedDevices = (state: RootState) => state.devices.deviceList.deviceIds;\nexport const getFilteringAttributes = (state: RootState) => state.devices.filteringAttributes;\nexport const getDeviceFilters = (state: RootState) => state.devices.filters || [];\nconst getFilteringAttributesFromConfig = (state: RootState) => state.devices.filteringAttributesConfig.attributes;\nexport const getSortedFilteringAttributes = createSelector([getFilteringAttributes], filteringAttributes => ({\n ...filteringAttributes,\n identityAttributes: [...filteringAttributes.identityAttributes, 'id']\n}));\nexport const getDeviceLimits = (state: RootState) => state.devices.limits;\nconst getFilteringAttributesLimit = (state: RootState) => 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<Record<DeviceAuthState, number>>(\n (accu, deviceState) => {\n const { counts } = byStatus[deviceState];\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { total, ...tieredCounts } = counts;\n const count = Object.values(tieredCounts).reduce((accu, countPerTier) => accu + countPerTier, 0);\n accu[deviceState] = count;\n accu.total = accu.total + count;\n return accu;\n },\n { total: 0 }\n )\n);\n\nexport const getDeviceById = createSelector([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = '') => devicesById[deviceId] ?? {});\n\nexport const getSelectedGroupInfo = createSelector(\n [getDeviceCountsByStatus, getGroupsById, getSelectedGroup],\n ({ accepted: acceptedDeviceTotal }, groupsById, selectedGroup) => {\n let groupCount = acceptedDeviceTotal;\n let groupFilters: DeviceFilter[] = [];\n if (selectedGroup && groupsById[selectedGroup]) {\n groupCount = groupsById[selectedGroup].total || 0;\n groupFilters = groupsById[selectedGroup].filters || [];\n }\n return { groupCount, selectedGroup, groupFilters };\n }\n);\n\nexport const getCombinedLimit = createSelector(\n [getDeviceLimits],\n deviceLimits => Object.values(deviceLimits).reduce((accu, limit) => accu + Math.max(limit ?? 0, 0), 0) // limit might be -1 for unlimited devices\n);\n\nexport const getLimitMaxed = createSelector(\n [getDeviceCountsByStatus, getCombinedLimit],\n ({ accepted: acceptedDevices }, combinedLimit) => !!combinedLimit && combinedLimit <= 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 getGroupData = createSelector([getGroupsByIdWithoutUngrouped], groups => {\n const createdGroup = Object.keys(groups).length ? Object.keys(groups)[0] : undefined;\n const hasDynamicGroups = Object.values(groups).some(group => !!group.id);\n return { createdGroup, hasDynamicGroups, groups };\n});\n\ntype SelectorGroup = DeviceGroup & { groupId: string };\ntype SelectorGroups = { dynamic: SelectorGroup[]; static: SelectorGroup[]; ungrouped: SelectorGroup[] };\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<SelectorGroups>(\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);\nconst getEnabledTierLimits = createSelector([getDeviceLimits], limits => Object.entries(limits).filter(([, limit]) => limit !== 0));\n\nexport const getEnabledTiers = createSelector([getEnabledTierLimits], enabledTierLimits => enabledTierLimits.map(([type]) => type));\n\nexport const getDeviceLimitStats = createSelector([getEnabledTierLimits, getAcceptedDevices], (enabledTierLimits, accepted) => {\n const { counts } = accepted;\n return enabledTierLimits.map(([type, limit]) => ({\n type,\n limit,\n total: counts[type] || 0\n }));\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"],"mappings":";;;;;;AAaA,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAOxB,IAAM,qBAAqB,CAAC,UAAqB,MAAM,QAAQ,SAAS;AACxE,IAAM,qBAAqB,CAAC,UAAqB,MAAM,QAAQ;AAC/D,IAAM,iBAAiB,CAAC,UAAqB,MAAM,QAAQ;AAC3D,IAAM,mBAAmB,CAAC,UAAqB,MAAM,QAAQ;AAC7D,IAAM,gBAAgB,CAAC,UAAqB,MAAM,QAAQ,OAAO;AACjE,IAAM,mBAAmB,CAAC,UAAqB,MAAM,QAAQ,OAAO;AAEpE,IAAM,qBAAqB,CAAC,UAAqB,MAAM,QAAQ;AAC/D,IAAM,mBAAmB,CAAC,UAAqB,MAAM,QAAQ,WAAW;AACxE,IAAM,yBAAyB,CAAC,UAAqB,MAAM,QAAQ;AACnE,IAAM,mBAAmB,CAAC,UAAqB,MAAM,QAAQ,WAAW,CAAC;AAChF,IAAM,mCAAmC,CAAC,UAAqB,MAAM,QAAQ,0BAA0B;AAChG,IAAM,+BAA+B,eAAe,CAAC,sBAAsB,GAAG,0BAAwB;AAAA,EAC3G,GAAG;AAAA,EACH,oBAAoB,CAAC,GAAG,oBAAoB,oBAAoB,IAAI;AACtE,EAAE;AACK,IAAM,kBAAkB,CAAC,UAAqB,MAAM,QAAQ;AACnE,IAAM,8BAA8B,CAAC,UAAqB,MAAM,QAAQ;AAEjE,IAAM,8BAA8B;AAAA,EACzC,CAAC,wBAAwB,2BAA2B;AAAA,EACpD,CAAC,EAAE,mBAAmB,GAAG,6BAA6B;AAEpD,UAAM,aAAa,mBAAmB,MAAM,GAAG,wBAAwB;A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AY,OAAO,CAAC,gBAAgB,eAAe;AACxD,YAAI,WAAW,SAAS,GAAG;AACzB,yBAAe,UAAU,IAAI,eAAe,UAAU,IAAI,eAAe,UAAU,IAAI,IAAI;AAAA,QAC7F;AACA,eAAO;AAAA,MACT,GAAG,IAAI;AACP,aAAO;AAAA,IACT,GAAG,CAAC,CAAC;AAAA,EACP;AACF;","names":["accu"]}
|
|
@@ -11,6 +11,12 @@ import {
|
|
|
11
11
|
getUserSettings,
|
|
12
12
|
getUserSettingsInitialized
|
|
13
13
|
} from "./chunk-QX67O5A2.js";
|
|
14
|
+
import {
|
|
15
|
+
getOnboarding
|
|
16
|
+
} from "./chunk-JIS4PA3R.js";
|
|
17
|
+
import {
|
|
18
|
+
getIssueCountsByType
|
|
19
|
+
} from "./chunk-YO22XLHI.js";
|
|
14
20
|
import {
|
|
15
21
|
getAuditLogEntry,
|
|
16
22
|
getIsServiceProvider,
|
|
@@ -21,19 +27,13 @@ import {
|
|
|
21
27
|
getDeploymentsSelectionState,
|
|
22
28
|
getSelectedDeploymentDeviceIds
|
|
23
29
|
} from "./chunk-FAKWYYOB.js";
|
|
24
|
-
import {
|
|
25
|
-
getOnboarding
|
|
26
|
-
} from "./chunk-JIS4PA3R.js";
|
|
27
30
|
import {
|
|
28
31
|
getDeviceById,
|
|
29
32
|
getDevicesById,
|
|
30
33
|
getFilteringAttributes,
|
|
31
34
|
getGroupsById,
|
|
32
35
|
getListedDevices
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import {
|
|
35
|
-
getIssueCountsByType
|
|
36
|
-
} from "./chunk-YO22XLHI.js";
|
|
36
|
+
} from "./chunk-66LI4BJO.js";
|
|
37
37
|
import {
|
|
38
38
|
getFeatures,
|
|
39
39
|
getSearchedDevices
|
|
@@ -313,4 +313,4 @@ export {
|
|
|
313
313
|
getRelevantRoles,
|
|
314
314
|
getShowSecurityAlert
|
|
315
315
|
};
|
|
316
|
-
//# sourceMappingURL=chunk-
|
|
316
|
+
//# sourceMappingURL=chunk-CQT3GJNR.js.map
|
|
@@ -4,12 +4,6 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
actions as actions8
|
|
6
6
|
} from "./chunk-4YLOOOZH.js";
|
|
7
|
-
import {
|
|
8
|
-
actions as actions6
|
|
9
|
-
} from "./chunk-LSAJE3IU.js";
|
|
10
|
-
import {
|
|
11
|
-
actions as actions2
|
|
12
|
-
} from "./chunk-2QIGK5IU.js";
|
|
13
7
|
import {
|
|
14
8
|
actions as actions5
|
|
15
9
|
} from "./chunk-CQXDAXQF.js";
|
|
@@ -17,11 +11,17 @@ import {
|
|
|
17
11
|
actions as actions4
|
|
18
12
|
} from "./chunk-HVZ5BOM6.js";
|
|
19
13
|
import {
|
|
20
|
-
actions
|
|
21
|
-
} from "./chunk-
|
|
14
|
+
actions as actions6
|
|
15
|
+
} from "./chunk-LSAJE3IU.js";
|
|
22
16
|
import {
|
|
23
17
|
actions as actions3
|
|
24
18
|
} from "./chunk-UBFFGYQ4.js";
|
|
19
|
+
import {
|
|
20
|
+
actions as actions2
|
|
21
|
+
} from "./chunk-2QIGK5IU.js";
|
|
22
|
+
import {
|
|
23
|
+
actions
|
|
24
|
+
} from "./chunk-GX3X2E57.js";
|
|
25
25
|
|
|
26
26
|
// src/actions.ts
|
|
27
27
|
var actions_default = {
|
|
@@ -38,4 +38,4 @@ var actions_default = {
|
|
|
38
38
|
export {
|
|
39
39
|
actions_default
|
|
40
40
|
};
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
41
|
+
//# sourceMappingURL=chunk-G2OECV4D.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
general_api_default
|
|
3
|
+
} from "./chunk-VK6FVQ5K.js";
|
|
1
4
|
import {
|
|
2
5
|
commonErrorFallback,
|
|
3
6
|
commonErrorHandler,
|
|
4
7
|
createAppAsyncThunk
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import {
|
|
7
|
-
general_api_default
|
|
8
|
-
} from "./chunk-VK6FVQ5K.js";
|
|
8
|
+
} from "./chunk-ILSHXLJ3.js";
|
|
9
9
|
import {
|
|
10
10
|
actions_default
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-G2OECV4D.js";
|
|
12
12
|
import {
|
|
13
13
|
actions,
|
|
14
14
|
sliceName
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "./chunk-KR5IU7TA.js";
|
|
19
19
|
import {
|
|
20
20
|
getSearchEndpoint
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-CQT3GJNR.js";
|
|
22
22
|
import {
|
|
23
23
|
getReleasesById
|
|
24
24
|
} from "./chunk-VLII64V6.js";
|
|
@@ -445,4 +445,4 @@ export {
|
|
|
445
445
|
getDeltaGenerationJobs,
|
|
446
446
|
getDeltaGenerationJobDetails
|
|
447
447
|
};
|
|
448
|
-
//# sourceMappingURL=chunk-
|
|
448
|
+
//# sourceMappingURL=chunk-GDB5IZMC.js.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
general_api_default
|
|
3
|
+
} from "./chunk-VK6FVQ5K.js";
|
|
1
4
|
import {
|
|
2
5
|
commonErrorFallback,
|
|
3
6
|
commonErrorHandler,
|
|
4
7
|
createAppAsyncThunk
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import {
|
|
7
|
-
general_api_default
|
|
8
|
-
} from "./chunk-VK6FVQ5K.js";
|
|
8
|
+
} from "./chunk-ILSHXLJ3.js";
|
|
9
9
|
import {
|
|
10
10
|
actions_default
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-G2OECV4D.js";
|
|
12
12
|
import {
|
|
13
13
|
actions,
|
|
14
14
|
sliceName
|
|
15
15
|
} from "./chunk-HVZ5BOM6.js";
|
|
16
16
|
import {
|
|
17
17
|
getSearchEndpoint
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-CQT3GJNR.js";
|
|
19
19
|
import {
|
|
20
20
|
getDeviceFilters
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-66LI4BJO.js";
|
|
22
22
|
import {
|
|
23
23
|
convertDeviceListStateToFilters
|
|
24
24
|
} from "./chunk-SDHCQ62K.js";
|
|
@@ -107,4 +107,4 @@ export {
|
|
|
107
107
|
getDeviceMonitorConfig,
|
|
108
108
|
changeNotificationSetting
|
|
109
109
|
};
|
|
110
|
-
//# sourceMappingURL=chunk-
|
|
110
|
+
//# sourceMappingURL=chunk-GEJDA2ZF.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
actions_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-G2OECV4D.js";
|
|
4
4
|
import {
|
|
5
5
|
releasesSlice_default
|
|
6
6
|
} from "./chunk-525LX7VL.js";
|
|
@@ -8,13 +8,6 @@ import {
|
|
|
8
8
|
actions as actions2,
|
|
9
9
|
usersSlice_default
|
|
10
10
|
} from "./chunk-4YLOOOZH.js";
|
|
11
|
-
import {
|
|
12
|
-
actions,
|
|
13
|
-
organizationSlice_default
|
|
14
|
-
} from "./chunk-LSAJE3IU.js";
|
|
15
|
-
import {
|
|
16
|
-
deploymentsSlice_default
|
|
17
|
-
} from "./chunk-2QIGK5IU.js";
|
|
18
11
|
import {
|
|
19
12
|
onboardingSlice_default
|
|
20
13
|
} from "./chunk-CQXDAXQF.js";
|
|
@@ -22,11 +15,18 @@ import {
|
|
|
22
15
|
monitorSlice_default
|
|
23
16
|
} from "./chunk-HVZ5BOM6.js";
|
|
24
17
|
import {
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
actions,
|
|
19
|
+
organizationSlice_default
|
|
20
|
+
} from "./chunk-LSAJE3IU.js";
|
|
27
21
|
import {
|
|
28
22
|
devicesSlice_default
|
|
29
23
|
} from "./chunk-UBFFGYQ4.js";
|
|
24
|
+
import {
|
|
25
|
+
deploymentsSlice_default
|
|
26
|
+
} from "./chunk-2QIGK5IU.js";
|
|
27
|
+
import {
|
|
28
|
+
appSlice_default
|
|
29
|
+
} from "./chunk-GX3X2E57.js";
|
|
30
30
|
import {
|
|
31
31
|
getToken
|
|
32
32
|
} from "./chunk-WXRYJOL3.js";
|
|
@@ -139,4 +139,4 @@ export {
|
|
|
139
139
|
useAppDispatch,
|
|
140
140
|
createAppAsyncThunk
|
|
141
141
|
};
|
|
142
|
-
//# sourceMappingURL=chunk-
|
|
142
|
+
//# sourceMappingURL=chunk-ILSHXLJ3.js.map
|
package/dist/commonConstants.js
CHANGED
package/dist/commonSelectors.cjs
CHANGED
|
@@ -830,9 +830,11 @@ var getAttributesList = (0, import_toolkit3.createSelector)(
|
|
|
830
830
|
[getFilteringAttributes, getFilteringAttributesFromConfig],
|
|
831
831
|
({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) => [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(import_helpers2.duplicateFilter)
|
|
832
832
|
);
|
|
833
|
-
var
|
|
833
|
+
var getEnabledTierLimits = (0, import_toolkit3.createSelector)([getDeviceLimits], (limits) => Object.entries(limits).filter(([, limit]) => limit !== 0));
|
|
834
|
+
var getEnabledTiers = (0, import_toolkit3.createSelector)([getEnabledTierLimits], (enabledTierLimits) => enabledTierLimits.map(([type]) => type));
|
|
835
|
+
var getDeviceLimitStats = (0, import_toolkit3.createSelector)([getEnabledTierLimits, getAcceptedDevices], (enabledTierLimits, accepted) => {
|
|
834
836
|
const { counts } = accepted;
|
|
835
|
-
return
|
|
837
|
+
return enabledTierLimits.map(([type, limit]) => ({
|
|
836
838
|
type,
|
|
837
839
|
limit,
|
|
838
840
|
total: counts[type] || 0
|