@northern.tech/store 0.46.2 → 0.46.3
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/api/general-api.d.cts +3 -3
- package/dist/api/general-api.d.ts +3 -3
- package/dist/appSlice/mocks.d.cts +1 -2
- package/dist/appSlice/mocks.d.ts +1 -2
- package/dist/appSlice/selectors.d.cts +19 -20
- package/dist/appSlice/selectors.d.ts +19 -20
- package/dist/appSlice/thunks.d.cts +3 -4
- package/dist/appSlice/thunks.d.ts +3 -4
- package/dist/auth.d.cts +5 -6
- package/dist/auth.d.ts +5 -6
- package/dist/commonSelectors.d.cts +21 -22
- package/dist/commonSelectors.d.ts +21 -22
- package/dist/deploymentsSlice/mocks.d.cts +1 -2
- package/dist/deploymentsSlice/mocks.d.ts +1 -2
- package/dist/deploymentsSlice/selectors.d.cts +8 -9
- package/dist/deploymentsSlice/selectors.d.ts +8 -9
- package/dist/deploymentsSlice/thunks.d.cts +16 -17
- package/dist/deploymentsSlice/thunks.d.ts +16 -17
- package/dist/devicesSlice/mocks.d.cts +1 -2
- package/dist/devicesSlice/mocks.d.ts +1 -2
- package/dist/devicesSlice/selectors.cjs +4 -3
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.d.cts +27 -28
- package/dist/devicesSlice/selectors.d.ts +27 -28
- package/dist/devicesSlice/selectors.js +4 -3
- package/dist/devicesSlice/selectors.js.map +1 -1
- package/dist/devicesSlice/thunks.d.cts +48 -49
- package/dist/devicesSlice/thunks.d.ts +48 -49
- package/dist/liststatehook.d.cts +2 -3
- package/dist/liststatehook.d.ts +2 -3
- package/dist/locationutils.d.cts +27 -28
- package/dist/locationutils.d.ts +27 -28
- package/dist/monitorSlice/mocks.d.cts +1 -2
- package/dist/monitorSlice/mocks.d.ts +1 -2
- package/dist/monitorSlice/selectors.d.cts +1 -2
- package/dist/monitorSlice/selectors.d.ts +1 -2
- package/dist/monitorSlice/thunks.d.cts +5 -6
- package/dist/monitorSlice/thunks.d.ts +5 -6
- package/dist/onboardingSlice/mocks.d.cts +1 -2
- package/dist/onboardingSlice/mocks.d.ts +1 -2
- package/dist/onboardingSlice/selectors.d.cts +1 -2
- package/dist/onboardingSlice/selectors.d.ts +1 -2
- package/dist/onboardingSlice/thunks.d.cts +6 -7
- package/dist/onboardingSlice/thunks.d.ts +6 -7
- package/dist/organizationSlice/mocks.d.cts +1 -2
- package/dist/organizationSlice/mocks.d.ts +1 -2
- package/dist/organizationSlice/selectors.d.cts +21 -22
- package/dist/organizationSlice/selectors.d.ts +21 -22
- package/dist/organizationSlice/thunks.d.cts +42 -43
- package/dist/organizationSlice/thunks.d.ts +42 -43
- package/dist/releasesSlice/mocks.d.cts +1 -2
- package/dist/releasesSlice/mocks.d.ts +1 -2
- package/dist/releasesSlice/selectors.d.cts +28 -29
- package/dist/releasesSlice/selectors.d.ts +28 -29
- package/dist/releasesSlice/thunks.d.cts +36 -37
- package/dist/releasesSlice/thunks.d.ts +36 -37
- package/dist/sockethook.d.cts +1 -2
- package/dist/sockethook.d.ts +1 -2
- package/dist/storehooks.d.cts +3 -4
- package/dist/storehooks.d.ts +3 -4
- package/dist/thunks.cjs +10 -9
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.js +10 -9
- package/dist/thunks.js.map +1 -1
- package/dist/useDeploymentDevice.d.cts +1 -2
- package/dist/useDeploymentDevice.d.ts +1 -2
- package/dist/usersSlice/mocks.d.cts +1 -2
- package/dist/usersSlice/mocks.d.ts +1 -2
- package/dist/usersSlice/selectors.d.cts +20 -21
- package/dist/usersSlice/selectors.d.ts +20 -21
- package/dist/usersSlice/thunks.d.cts +44 -45
- package/dist/usersSlice/thunks.d.ts +44 -45
- package/package.json +6 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.cjs","names":["createSelector","DEVICE_STATES","UNGROUPED_GROUP","duplicateFilter"],"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 || [];\nexport const getTestDeviceLimit = (state: RootState) => state.devices.testDeviceLimit;\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;\nexport const getTestDeviceCount = (state: RootState) => state.devices.testDeviceCount;\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":";;;;;;AAqBA,MAAa,sBAAsB,UAAqB,MAAM,QAAQ,SAAS;AAC/E,MAAa,sBAAsB,UAAqB,MAAM,QAAQ;AACtE,MAAa,kBAAkB,UAAqB,MAAM,QAAQ;AAClE,MAAa,oBAAoB,UAAqB,MAAM,QAAQ;AACpE,MAAa,iBAAiB,UAAqB,MAAM,QAAQ,OAAO;AACxE,MAAa,oBAAoB,UAAqB,MAAM,QAAQ,OAAO;AAE3E,MAAa,sBAAsB,UAAqB,MAAM,QAAQ;AACtE,MAAa,oBAAoB,UAAqB,MAAM,QAAQ,WAAW;AAC/E,MAAa,0BAA0B,UAAqB,MAAM,QAAQ;AAC1E,MAAa,oBAAoB,UAAqB,MAAM,QAAQ,WAAW,CAAC;AAChF,MAAa,sBAAsB,UAAqB,MAAM,QAAQ;AACtE,MAAM,oCAAoC,UAAqB,MAAM,QAAQ,0BAA0B;AACvG,MAAa,gCAAA,GAA+BA,iBAAAA,eAAAA,CAAe,CAAC,sBAAsB,IAAG,yBAAwB;CAC3G,GAAG;CACH,oBAAoB,CAAC,GAAG,oBAAoB,oBAAoB,IAAI;AACtE,EAAE;AACF,MAAa,mBAAmB,UAAqB,MAAM,QAAQ;AACnE,MAAa,sBAAsB,UAAqB,MAAM,QAAQ;AACtE,MAAM,+BAA+B,UAAqB,MAAM,QAAQ;AAExE,MAAa,+BAAA,GAA8BA,iBAAAA,eAAAA,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,cAAc,eAAe,cAAc,eAAe,cAAc,IAAI;EAE7F,OAAO;CACT,GAAG,IAAI;CACP,OAAO;AACT,GAAG,CAAC,CAAC,CACP,CACF"}
|
|
1
|
+
{"version":3,"file":"selectors.cjs","names":["createSelector","DEVICE_STATES","UNGROUPED_GROUP","duplicateFilter"],"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 || [];\nexport const getTestDeviceLimit = (state: RootState) => state.devices.testDeviceLimit;\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;\nexport const getTestDeviceCount = (state: RootState) => state.devices.testDeviceCount;\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":";;;;;;AAqBA,MAAa,sBAAsB,UAAqB,MAAM,QAAQ,SAAS;AAC/E,MAAa,sBAAsB,UAAqB,MAAM,QAAQ;AACtE,MAAa,kBAAkB,UAAqB,MAAM,QAAQ;AAClE,MAAa,oBAAoB,UAAqB,MAAM,QAAQ;AACpE,MAAa,iBAAiB,UAAqB,MAAM,QAAQ,OAAO;AACxE,MAAa,oBAAoB,UAAqB,MAAM,QAAQ,OAAO;AAE3E,MAAa,sBAAsB,UAAqB,MAAM,QAAQ;AACtE,MAAa,oBAAoB,UAAqB,MAAM,QAAQ,WAAW;AAC/E,MAAa,0BAA0B,UAAqB,MAAM,QAAQ;AAC1E,MAAa,oBAAoB,UAAqB,MAAM,QAAQ,WAAW,CAAC;AAChF,MAAa,sBAAsB,UAAqB,MAAM,QAAQ;AACtE,MAAM,oCAAoC,UAAqB,MAAM,QAAQ,0BAA0B;AACvG,MAAa,gCAAA,GAA+BA,iBAAAA,eAAAA,CAAe,CAAC,sBAAsB,IAAG,yBAAwB;CA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AAC,KAAK,gBACtG,OAAO,KACL,UAAU,MAAM,GAAG,GAAG,CAAC,CAAC,QAAQ,MAAM,SAAS;CAC7C,MAAM,EAAE,aAAa,cAAc,CAAC,MAAM,YAAY,QAAQ,YAAY,KAAK,CAAC,aAAa,CAAC;CAC9F,OAAO,YAAY,QAAQ,gBAAgB,eAAe;EACxD,IAAI,WAAW,SAAS,GACtB,eAAe,cAAc,eAAe,cAAc,eAAe,cAAc,IAAI;EAE7F,OAAO;CACT,GAAG,IAAI;CACP,OAAO;AACT,GAAG,CAAC,CAAC,CACP,CACF"}
|
|
@@ -8,20 +8,20 @@ import { t as MonitorSliceType } from "../index-BfmRpbiJ.cjs";
|
|
|
8
8
|
import { t as OrganizationSliceType } from "../index-HjOSTTGF.cjs";
|
|
9
9
|
import { r as RootState } from "../store-Dw8Uo_Df.cjs";
|
|
10
10
|
//#region src/devicesSlice/selectors.d.ts
|
|
11
|
-
declare const getAcceptedDevices: (state: RootState) => {
|
|
11
|
+
export declare const getAcceptedDevices: (state: RootState) => {
|
|
12
12
|
counts: DeviceTierLimits & {
|
|
13
13
|
total: number;
|
|
14
14
|
};
|
|
15
15
|
deviceIds: string[];
|
|
16
16
|
};
|
|
17
|
-
declare const getDevicesByStatus: (state: RootState) => Record<string, {
|
|
17
|
+
export declare const getDevicesByStatus: (state: RootState) => Record<string, {
|
|
18
18
|
counts: DeviceTierLimits & {
|
|
19
19
|
total: number;
|
|
20
20
|
};
|
|
21
21
|
deviceIds: string[];
|
|
22
22
|
}>;
|
|
23
|
-
declare const getDevicesById: (state: RootState) => Record<string, Device>;
|
|
24
|
-
declare const getDeviceReports: (state: RootState) => {
|
|
23
|
+
export declare const getDevicesById: (state: RootState) => Record<string, Device>;
|
|
24
|
+
export declare const getDeviceReports: (state: RootState) => {
|
|
25
25
|
items: {
|
|
26
26
|
count: number;
|
|
27
27
|
key: string;
|
|
@@ -29,19 +29,19 @@ declare const getDeviceReports: (state: RootState) => {
|
|
|
29
29
|
otherCount: number;
|
|
30
30
|
total: number;
|
|
31
31
|
}[];
|
|
32
|
-
declare const getGroupsById: (state: RootState) => Record<string, DeviceGroup>;
|
|
33
|
-
declare const getSelectedGroup: (state: RootState) => string | undefined;
|
|
34
|
-
declare const getDeviceListState: (state: RootState) => DeviceListState;
|
|
35
|
-
declare const getListedDevices: (state: RootState) => string[];
|
|
36
|
-
declare const getFilteringAttributes: (state: RootState) => {
|
|
32
|
+
export declare const getGroupsById: (state: RootState) => Record<string, DeviceGroup>;
|
|
33
|
+
export declare const getSelectedGroup: (state: RootState) => string | undefined;
|
|
34
|
+
export declare const getDeviceListState: (state: RootState) => DeviceListState;
|
|
35
|
+
export declare const getListedDevices: (state: RootState) => string[];
|
|
36
|
+
export declare const getFilteringAttributes: (state: RootState) => {
|
|
37
37
|
identityAttributes: string[];
|
|
38
38
|
inventoryAttributes: string[];
|
|
39
39
|
systemAttributes: string[];
|
|
40
40
|
tagAttributes: string[];
|
|
41
41
|
};
|
|
42
|
-
declare const getDeviceFilters: (state: RootState) => DeviceFilter[];
|
|
43
|
-
declare const getTestDeviceLimit: (state: RootState) => number;
|
|
44
|
-
declare const getSortedFilteringAttributes: ((state: {
|
|
42
|
+
export declare const getDeviceFilters: (state: RootState) => DeviceFilter[];
|
|
43
|
+
export declare const getTestDeviceLimit: (state: RootState) => number;
|
|
44
|
+
export declare const getSortedFilteringAttributes: ((state: {
|
|
45
45
|
app: AppSliceType;
|
|
46
46
|
devices: DeviceSliceType;
|
|
47
47
|
deployments: DeploymentsSliceType;
|
|
@@ -106,9 +106,9 @@ declare const getSortedFilteringAttributes: ((state: {
|
|
|
106
106
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
107
107
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
108
108
|
};
|
|
109
|
-
declare const getDeviceLimits: (state: RootState) => DeviceTierLimits;
|
|
110
|
-
declare const getTestDeviceCount: (state: RootState) => number;
|
|
111
|
-
declare const getDeviceIdentityAttributes: ((state: {
|
|
109
|
+
export declare const getDeviceLimits: (state: RootState) => DeviceTierLimits;
|
|
110
|
+
export declare const getTestDeviceCount: (state: RootState) => number;
|
|
111
|
+
export declare const getDeviceIdentityAttributes: ((state: {
|
|
112
112
|
app: AppSliceType;
|
|
113
113
|
devices: DeviceSliceType;
|
|
114
114
|
deployments: DeploymentsSliceType;
|
|
@@ -169,7 +169,7 @@ declare const getDeviceIdentityAttributes: ((state: {
|
|
|
169
169
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
170
170
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
171
171
|
};
|
|
172
|
-
declare const getDeviceCountsByStatus: ((state: {
|
|
172
|
+
export declare const getDeviceCountsByStatus: ((state: {
|
|
173
173
|
app: AppSliceType;
|
|
174
174
|
devices: DeviceSliceType;
|
|
175
175
|
deployments: DeploymentsSliceType;
|
|
@@ -214,7 +214,7 @@ declare const getDeviceCountsByStatus: ((state: {
|
|
|
214
214
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
215
215
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
216
216
|
};
|
|
217
|
-
declare const getDeviceById: ((state: any, deviceId: any) => Device) & {
|
|
217
|
+
export declare const getDeviceById: ((state: any, deviceId: any) => Device) & {
|
|
218
218
|
clearCache: () => void;
|
|
219
219
|
resultsCount: () => number;
|
|
220
220
|
resetResultsCount: () => void;
|
|
@@ -235,7 +235,7 @@ declare const getDeviceById: ((state: any, deviceId: any) => Device) & {
|
|
|
235
235
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
236
236
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
237
237
|
};
|
|
238
|
-
declare const getSelectedGroupInfo: ((state: {
|
|
238
|
+
export declare const getSelectedGroupInfo: ((state: {
|
|
239
239
|
app: AppSliceType;
|
|
240
240
|
devices: DeviceSliceType;
|
|
241
241
|
deployments: DeploymentsSliceType;
|
|
@@ -325,7 +325,7 @@ declare const getSelectedGroupInfo: ((state: {
|
|
|
325
325
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
326
326
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
327
327
|
};
|
|
328
|
-
declare const getCombinedLimit: ((state: {
|
|
328
|
+
export declare const getCombinedLimit: ((state: {
|
|
329
329
|
app: AppSliceType;
|
|
330
330
|
devices: DeviceSliceType;
|
|
331
331
|
deployments: DeploymentsSliceType;
|
|
@@ -355,7 +355,7 @@ declare const getCombinedLimit: ((state: {
|
|
|
355
355
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
356
356
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
357
357
|
};
|
|
358
|
-
declare const getLimitMaxed: ((state: {
|
|
358
|
+
export declare const getLimitMaxed: ((state: {
|
|
359
359
|
app: AppSliceType;
|
|
360
360
|
devices: DeviceSliceType;
|
|
361
361
|
deployments: DeploymentsSliceType;
|
|
@@ -458,7 +458,7 @@ declare const getLimitMaxed: ((state: {
|
|
|
458
458
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
459
459
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
460
460
|
};
|
|
461
|
-
declare const getGroupsByIdWithoutUngrouped: ((state: {
|
|
461
|
+
export declare const getGroupsByIdWithoutUngrouped: ((state: {
|
|
462
462
|
app: AppSliceType;
|
|
463
463
|
devices: DeviceSliceType;
|
|
464
464
|
deployments: DeploymentsSliceType;
|
|
@@ -496,7 +496,7 @@ declare const getGroupsByIdWithoutUngrouped: ((state: {
|
|
|
496
496
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
497
497
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
498
498
|
};
|
|
499
|
-
declare const getGroupData: ((state: {
|
|
499
|
+
export declare const getGroupData: ((state: {
|
|
500
500
|
app: AppSliceType;
|
|
501
501
|
devices: DeviceSliceType;
|
|
502
502
|
deployments: DeploymentsSliceType;
|
|
@@ -594,7 +594,7 @@ declare const getGroupData: ((state: {
|
|
|
594
594
|
type SelectorGroup = DeviceGroup & {
|
|
595
595
|
groupId: string;
|
|
596
596
|
};
|
|
597
|
-
declare const getGroups: ((state: {
|
|
597
|
+
export declare const getGroups: ((state: {
|
|
598
598
|
app: AppSliceType;
|
|
599
599
|
devices: DeviceSliceType;
|
|
600
600
|
deployments: DeploymentsSliceType;
|
|
@@ -644,7 +644,7 @@ declare const getGroups: ((state: {
|
|
|
644
644
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
645
645
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
646
646
|
};
|
|
647
|
-
declare const getAttributesList: ((state: {
|
|
647
|
+
export declare const getAttributesList: ((state: {
|
|
648
648
|
app: AppSliceType;
|
|
649
649
|
devices: DeviceSliceType;
|
|
650
650
|
deployments: DeploymentsSliceType;
|
|
@@ -689,7 +689,7 @@ declare const getAttributesList: ((state: {
|
|
|
689
689
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
690
690
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
691
691
|
};
|
|
692
|
-
declare const getEnabledTiers: ((state: {
|
|
692
|
+
export declare const getEnabledTiers: ((state: {
|
|
693
693
|
app: AppSliceType;
|
|
694
694
|
devices: DeviceSliceType;
|
|
695
695
|
deployments: DeploymentsSliceType;
|
|
@@ -748,7 +748,7 @@ declare const getEnabledTiers: ((state: {
|
|
|
748
748
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
749
749
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
750
750
|
};
|
|
751
|
-
declare const getDeviceLimitStats: ((state: {
|
|
751
|
+
export declare const getDeviceLimitStats: ((state: {
|
|
752
752
|
app: AppSliceType;
|
|
753
753
|
devices: DeviceSliceType;
|
|
754
754
|
deployments: DeploymentsSliceType;
|
|
@@ -838,7 +838,7 @@ declare const getDeviceLimitStats: ((state: {
|
|
|
838
838
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
839
839
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
840
840
|
};
|
|
841
|
-
declare const getDeviceTypes: ((state: {
|
|
841
|
+
export declare const getDeviceTypes: ((state: {
|
|
842
842
|
app: AppSliceType;
|
|
843
843
|
devices: DeviceSliceType;
|
|
844
844
|
deployments: DeploymentsSliceType;
|
|
@@ -884,5 +884,4 @@ declare const getDeviceTypes: ((state: {
|
|
|
884
884
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
885
885
|
};
|
|
886
886
|
//#endregion
|
|
887
|
-
export { getAcceptedDevices, getAttributesList, getCombinedLimit, getDeviceById, getDeviceCountsByStatus, getDeviceFilters, getDeviceIdentityAttributes, getDeviceLimitStats, getDeviceLimits, getDeviceListState, getDeviceReports, getDeviceTypes, getDevicesById, getDevicesByStatus, getEnabledTiers, getFilteringAttributes, getGroupData, getGroups, getGroupsById, getGroupsByIdWithoutUngrouped, getLimitMaxed, getListedDevices, getSelectedGroup, getSelectedGroupInfo, getSortedFilteringAttributes, getTestDeviceCount, getTestDeviceLimit };
|
|
888
887
|
//# sourceMappingURL=selectors.d.cts.map
|
|
@@ -8,20 +8,20 @@ import { t as MonitorSliceType } from "../index-CRqnH_go.js";
|
|
|
8
8
|
import { t as OrganizationSliceType } from "../index-BVNS-Aut.js";
|
|
9
9
|
import { r as RootState } from "../store-DLp6ajT8.js";
|
|
10
10
|
//#region src/devicesSlice/selectors.d.ts
|
|
11
|
-
declare const getAcceptedDevices: (state: RootState) => {
|
|
11
|
+
export declare const getAcceptedDevices: (state: RootState) => {
|
|
12
12
|
counts: DeviceTierLimits & {
|
|
13
13
|
total: number;
|
|
14
14
|
};
|
|
15
15
|
deviceIds: string[];
|
|
16
16
|
};
|
|
17
|
-
declare const getDevicesByStatus: (state: RootState) => Record<string, {
|
|
17
|
+
export declare const getDevicesByStatus: (state: RootState) => Record<string, {
|
|
18
18
|
counts: DeviceTierLimits & {
|
|
19
19
|
total: number;
|
|
20
20
|
};
|
|
21
21
|
deviceIds: string[];
|
|
22
22
|
}>;
|
|
23
|
-
declare const getDevicesById: (state: RootState) => Record<string, Device>;
|
|
24
|
-
declare const getDeviceReports: (state: RootState) => {
|
|
23
|
+
export declare const getDevicesById: (state: RootState) => Record<string, Device>;
|
|
24
|
+
export declare const getDeviceReports: (state: RootState) => {
|
|
25
25
|
items: {
|
|
26
26
|
count: number;
|
|
27
27
|
key: string;
|
|
@@ -29,19 +29,19 @@ declare const getDeviceReports: (state: RootState) => {
|
|
|
29
29
|
otherCount: number;
|
|
30
30
|
total: number;
|
|
31
31
|
}[];
|
|
32
|
-
declare const getGroupsById: (state: RootState) => Record<string, DeviceGroup>;
|
|
33
|
-
declare const getSelectedGroup: (state: RootState) => string | undefined;
|
|
34
|
-
declare const getDeviceListState: (state: RootState) => DeviceListState;
|
|
35
|
-
declare const getListedDevices: (state: RootState) => string[];
|
|
36
|
-
declare const getFilteringAttributes: (state: RootState) => {
|
|
32
|
+
export declare const getGroupsById: (state: RootState) => Record<string, DeviceGroup>;
|
|
33
|
+
export declare const getSelectedGroup: (state: RootState) => string | undefined;
|
|
34
|
+
export declare const getDeviceListState: (state: RootState) => DeviceListState;
|
|
35
|
+
export declare const getListedDevices: (state: RootState) => string[];
|
|
36
|
+
export declare const getFilteringAttributes: (state: RootState) => {
|
|
37
37
|
identityAttributes: string[];
|
|
38
38
|
inventoryAttributes: string[];
|
|
39
39
|
systemAttributes: string[];
|
|
40
40
|
tagAttributes: string[];
|
|
41
41
|
};
|
|
42
|
-
declare const getDeviceFilters: (state: RootState) => DeviceFilter[];
|
|
43
|
-
declare const getTestDeviceLimit: (state: RootState) => number;
|
|
44
|
-
declare const getSortedFilteringAttributes: ((state: {
|
|
42
|
+
export declare const getDeviceFilters: (state: RootState) => DeviceFilter[];
|
|
43
|
+
export declare const getTestDeviceLimit: (state: RootState) => number;
|
|
44
|
+
export declare const getSortedFilteringAttributes: ((state: {
|
|
45
45
|
app: AppSliceType;
|
|
46
46
|
devices: DeviceSliceType;
|
|
47
47
|
deployments: DeploymentsSliceType;
|
|
@@ -106,9 +106,9 @@ declare const getSortedFilteringAttributes: ((state: {
|
|
|
106
106
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
107
107
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
108
108
|
};
|
|
109
|
-
declare const getDeviceLimits: (state: RootState) => DeviceTierLimits;
|
|
110
|
-
declare const getTestDeviceCount: (state: RootState) => number;
|
|
111
|
-
declare const getDeviceIdentityAttributes: ((state: {
|
|
109
|
+
export declare const getDeviceLimits: (state: RootState) => DeviceTierLimits;
|
|
110
|
+
export declare const getTestDeviceCount: (state: RootState) => number;
|
|
111
|
+
export declare const getDeviceIdentityAttributes: ((state: {
|
|
112
112
|
app: AppSliceType;
|
|
113
113
|
devices: DeviceSliceType;
|
|
114
114
|
deployments: DeploymentsSliceType;
|
|
@@ -169,7 +169,7 @@ declare const getDeviceIdentityAttributes: ((state: {
|
|
|
169
169
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
170
170
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
171
171
|
};
|
|
172
|
-
declare const getDeviceCountsByStatus: ((state: {
|
|
172
|
+
export declare const getDeviceCountsByStatus: ((state: {
|
|
173
173
|
app: AppSliceType;
|
|
174
174
|
devices: DeviceSliceType;
|
|
175
175
|
deployments: DeploymentsSliceType;
|
|
@@ -214,7 +214,7 @@ declare const getDeviceCountsByStatus: ((state: {
|
|
|
214
214
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
215
215
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
216
216
|
};
|
|
217
|
-
declare const getDeviceById: ((state: any, deviceId: any) => Device) & {
|
|
217
|
+
export declare const getDeviceById: ((state: any, deviceId: any) => Device) & {
|
|
218
218
|
clearCache: () => void;
|
|
219
219
|
resultsCount: () => number;
|
|
220
220
|
resetResultsCount: () => void;
|
|
@@ -235,7 +235,7 @@ declare const getDeviceById: ((state: any, deviceId: any) => Device) & {
|
|
|
235
235
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
236
236
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
237
237
|
};
|
|
238
|
-
declare const getSelectedGroupInfo: ((state: {
|
|
238
|
+
export declare const getSelectedGroupInfo: ((state: {
|
|
239
239
|
app: AppSliceType;
|
|
240
240
|
devices: DeviceSliceType;
|
|
241
241
|
deployments: DeploymentsSliceType;
|
|
@@ -325,7 +325,7 @@ declare const getSelectedGroupInfo: ((state: {
|
|
|
325
325
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
326
326
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
327
327
|
};
|
|
328
|
-
declare const getCombinedLimit: ((state: {
|
|
328
|
+
export declare const getCombinedLimit: ((state: {
|
|
329
329
|
app: AppSliceType;
|
|
330
330
|
devices: DeviceSliceType;
|
|
331
331
|
deployments: DeploymentsSliceType;
|
|
@@ -355,7 +355,7 @@ declare const getCombinedLimit: ((state: {
|
|
|
355
355
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
356
356
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
357
357
|
};
|
|
358
|
-
declare const getLimitMaxed: ((state: {
|
|
358
|
+
export declare const getLimitMaxed: ((state: {
|
|
359
359
|
app: AppSliceType;
|
|
360
360
|
devices: DeviceSliceType;
|
|
361
361
|
deployments: DeploymentsSliceType;
|
|
@@ -458,7 +458,7 @@ declare const getLimitMaxed: ((state: {
|
|
|
458
458
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
459
459
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
460
460
|
};
|
|
461
|
-
declare const getGroupsByIdWithoutUngrouped: ((state: {
|
|
461
|
+
export declare const getGroupsByIdWithoutUngrouped: ((state: {
|
|
462
462
|
app: AppSliceType;
|
|
463
463
|
devices: DeviceSliceType;
|
|
464
464
|
deployments: DeploymentsSliceType;
|
|
@@ -496,7 +496,7 @@ declare const getGroupsByIdWithoutUngrouped: ((state: {
|
|
|
496
496
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
497
497
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
498
498
|
};
|
|
499
|
-
declare const getGroupData: ((state: {
|
|
499
|
+
export declare const getGroupData: ((state: {
|
|
500
500
|
app: AppSliceType;
|
|
501
501
|
devices: DeviceSliceType;
|
|
502
502
|
deployments: DeploymentsSliceType;
|
|
@@ -594,7 +594,7 @@ declare const getGroupData: ((state: {
|
|
|
594
594
|
type SelectorGroup = DeviceGroup & {
|
|
595
595
|
groupId: string;
|
|
596
596
|
};
|
|
597
|
-
declare const getGroups: ((state: {
|
|
597
|
+
export declare const getGroups: ((state: {
|
|
598
598
|
app: AppSliceType;
|
|
599
599
|
devices: DeviceSliceType;
|
|
600
600
|
deployments: DeploymentsSliceType;
|
|
@@ -644,7 +644,7 @@ declare const getGroups: ((state: {
|
|
|
644
644
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
645
645
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
646
646
|
};
|
|
647
|
-
declare const getAttributesList: ((state: {
|
|
647
|
+
export declare const getAttributesList: ((state: {
|
|
648
648
|
app: AppSliceType;
|
|
649
649
|
devices: DeviceSliceType;
|
|
650
650
|
deployments: DeploymentsSliceType;
|
|
@@ -689,7 +689,7 @@ declare const getAttributesList: ((state: {
|
|
|
689
689
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
690
690
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
691
691
|
};
|
|
692
|
-
declare const getEnabledTiers: ((state: {
|
|
692
|
+
export declare const getEnabledTiers: ((state: {
|
|
693
693
|
app: AppSliceType;
|
|
694
694
|
devices: DeviceSliceType;
|
|
695
695
|
deployments: DeploymentsSliceType;
|
|
@@ -748,7 +748,7 @@ declare const getEnabledTiers: ((state: {
|
|
|
748
748
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
749
749
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
750
750
|
};
|
|
751
|
-
declare const getDeviceLimitStats: ((state: {
|
|
751
|
+
export declare const getDeviceLimitStats: ((state: {
|
|
752
752
|
app: AppSliceType;
|
|
753
753
|
devices: DeviceSliceType;
|
|
754
754
|
deployments: DeploymentsSliceType;
|
|
@@ -838,7 +838,7 @@ declare const getDeviceLimitStats: ((state: {
|
|
|
838
838
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
839
839
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
840
840
|
};
|
|
841
|
-
declare const getDeviceTypes: ((state: {
|
|
841
|
+
export declare const getDeviceTypes: ((state: {
|
|
842
842
|
app: AppSliceType;
|
|
843
843
|
devices: DeviceSliceType;
|
|
844
844
|
deployments: DeploymentsSliceType;
|
|
@@ -884,5 +884,4 @@ declare const getDeviceTypes: ((state: {
|
|
|
884
884
|
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
885
885
|
};
|
|
886
886
|
//#endregion
|
|
887
|
-
export { getAcceptedDevices, getAttributesList, getCombinedLimit, getDeviceById, getDeviceCountsByStatus, getDeviceFilters, getDeviceIdentityAttributes, getDeviceLimitStats, getDeviceLimits, getDeviceListState, getDeviceReports, getDeviceTypes, getDevicesById, getDevicesByStatus, getEnabledTiers, getFilteringAttributes, getGroupData, getGroups, getGroupsById, getGroupsByIdWithoutUngrouped, getLimitMaxed, getListedDevices, getSelectedGroup, getSelectedGroupInfo, getSortedFilteringAttributes, getTestDeviceCount, getTestDeviceLimit };
|
|
888
887
|
//# sourceMappingURL=selectors.d.ts.map
|
|
@@ -85,9 +85,10 @@ const getGroups = createSelector([getGroupsById], (groupsById) => {
|
|
|
85
85
|
groupId: name,
|
|
86
86
|
name: groupname
|
|
87
87
|
};
|
|
88
|
-
if ((group.filters ?? []).length > 0)
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
if ((group.filters ?? []).length > 0) {
|
|
89
|
+
if (groupname !== UNGROUPED_GROUP.id) accu.dynamic.push(groupItem);
|
|
90
|
+
else accu.ungrouped.push(groupItem);
|
|
91
|
+
} else accu.static.push(groupItem);
|
|
91
92
|
return accu;
|
|
92
93
|
}, {
|
|
93
94
|
dynamic: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.js","names":[],"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 || [];\nexport const getTestDeviceLimit = (state: RootState) => state.devices.testDeviceLimit;\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;\nexport const getTestDeviceCount = (state: RootState) => state.devices.testDeviceCount;\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":";;;;AAqBA,MAAa,sBAAsB,UAAqB,MAAM,QAAQ,SAAS;AAC/E,MAAa,sBAAsB,UAAqB,MAAM,QAAQ;AACtE,MAAa,kBAAkB,UAAqB,MAAM,QAAQ;AAClE,MAAa,oBAAoB,UAAqB,MAAM,QAAQ;AACpE,MAAa,iBAAiB,UAAqB,MAAM,QAAQ,OAAO;AACxE,MAAa,oBAAoB,UAAqB,MAAM,QAAQ,OAAO;AAE3E,MAAa,sBAAsB,UAAqB,MAAM,QAAQ;AACtE,MAAa,oBAAoB,UAAqB,MAAM,QAAQ,WAAW;AAC/E,MAAa,0BAA0B,UAAqB,MAAM,QAAQ;AAC1E,MAAa,oBAAoB,UAAqB,MAAM,QAAQ,WAAW,CAAC;AAChF,MAAa,sBAAsB,UAAqB,MAAM,QAAQ;AACtE,MAAM,oCAAoC,UAAqB,MAAM,QAAQ,0BAA0B;AACvG,MAAa,+BAA+B,eAAe,CAAC,sBAAsB,IAAG,yBAAwB;CAC3G,GAAG;CACH,oBAAoB,CAAC,GAAG,oBAAoB,oBAAoB,IAAI;AACtE,EAAE;AACF,MAAa,mBAAmB,UAAqB,MAAM,QAAQ;AACnE,MAAa,sBAAsB,UAAqB,MAAM,QAAQ;A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B,eAC/B,CAAC,wBAAwB,gCAAgC,IACxD,EAAE,qBAAqB,CAAC,GAAG,sBAAsB,CAAC,KAAK,EAAE,WAAW,CAAC,GAAG,YAAY,CAAC,QACpF;CAAC,GAAG;CAAoB,GAAG;CAAqB,GAAG;CAAU,GAAG;AAAS,CAAC,CAAC,OAAO,eAAe,CACrG;AACA,MAAM,uBAAuB,eAAe,CAAC,eAAe,IAAG,WAAU,OAAO,QAAQ,MAAM,CAAC,CAAC,QAAQ,GAAG,WAAW,UAAU,CAAC,CAAC;AAElI,MAAa,kBAAkB,eAAe,CAAC,oBAAoB,IAAG,sBAAqB,kBAAkB,KAAK,CAAC,UAAU,IAAI,CAAC;AAElI,MAAa,sBAAsB,eAAe,CAAC,sBAAsB,kBAAkB,IAAI,mBAAmB,aAAa;CAC7H,MAAM,EAAE,WAAW;CACnB,OAAO,kBAAkB,KAAK,CAAC,MAAM,YAAY;EAC/C;EACA;EACA,OAAO,OAAO,SAAS;CACzB,EAAE;AACJ,CAAC;AAED,MAAa,iBAAiB,eAAe,CAAC,oBAAoB,cAAc,IAAI,EAAE,YAAY,CAAC,KAAK,gBACtG,OAAO,KACL,UAAU,MAAM,GAAG,GAAG,CAAC,CAAC,QAAQ,MAAM,SAAS;CAC7C,MAAM,EAAE,aAAa,cAAc,CAAC,MAAM,YAAY,QAAQ,YAAY,KAAK,CAAC,aAAa,CAAC;CAC9F,OAAO,YAAY,QAAQ,gBAAgB,eAAe;EACxD,IAAI,WAAW,SAAS,GACtB,eAAe,cAAc,eAAe,cAAc,eAAe,cAAc,IAAI;EAE7F,OAAO;CACT,GAAG,IAAI;CACP,OAAO;AACT,GAAG,CAAC,CAAC,CACP,CACF"}
|
|
1
|
+
{"version":3,"file":"selectors.js","names":[],"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 || [];\nexport const getTestDeviceLimit = (state: RootState) => state.devices.testDeviceLimit;\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;\nexport const getTestDeviceCount = (state: RootState) => state.devices.testDeviceCount;\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":";;;;AAqBA,MAAa,sBAAsB,UAAqB,MAAM,QAAQ,SAAS;AAC/E,MAAa,sBAAsB,UAAqB,MAAM,QAAQ;AACtE,MAAa,kBAAkB,UAAqB,MAAM,QAAQ;AAClE,MAAa,oBAAoB,UAAqB,MAAM,QAAQ;AACpE,MAAa,iBAAiB,UAAqB,MAAM,QAAQ,OAAO;AACxE,MAAa,oBAAoB,UAAqB,MAAM,QAAQ,OAAO;AAE3E,MAAa,sBAAsB,UAAqB,MAAM,QAAQ;AACtE,MAAa,oBAAoB,UAAqB,MAAM,QAAQ,WAAW;AAC/E,MAAa,0BAA0B,UAAqB,MAAM,QAAQ;AAC1E,MAAa,oBAAoB,UAAqB,MAAM,QAAQ,WAAW,CAAC;AAChF,MAAa,sBAAsB,UAAqB,MAAM,QAAQ;AACtE,MAAM,oCAAoC,UAAqB,MAAM,QAAQ,0BAA0B;AACvG,MAAa,+BAA+B,eAAe,CAAC,sBAAsB,IAAG,yBAAwB;CAC3G,GAAG;CACH,oBAAoB,CAAC,GAAG,oBAAoB,oBAAoB,IAAI;AACtE,EAAE;AACF,MAAa,mBAAmB,UAAqB,MAAM,QAAQ;AACnE,MAAa,sBAAsB,UAAqB,MAAM,QAAQ;AACtE,MAAM,+BAA+B,UAAqB,MAAM,QAAQ;AAExE,MAAa,8BAA8B,eACzC,CAAC,wBAAwB,2BAA2B,IACnD,EAAE,sBAAsB,6BAA6B;CAGpD,OADmB,mBAAmB,MAAM,GAAG,wBAC/B,CAAC,CAAC,QACf,MAAM,UAAU;EACf,KAAK,KAAK;GAAE;GA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