@northern.tech/store 0.19.2 → 0.20.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.cjs +3 -0
- package/dist/actions.cjs.map +1 -1
- package/dist/actions.d.cts +2 -1
- package/dist/actions.d.ts +2 -1
- 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/constants.cjs +3 -45
- package/dist/appSlice/constants.cjs.map +1 -1
- package/dist/appSlice/constants.d.cts +0 -15
- package/dist/appSlice/constants.d.ts +0 -15
- package/dist/appSlice/constants.js +1 -1
- package/dist/appSlice/index.js +1 -1
- package/dist/appSlice/mocks.js +1 -1
- package/dist/appSlice/thunks.cjs +14 -56
- package/dist/appSlice/thunks.cjs.map +1 -1
- package/dist/appSlice/thunks.js +16 -16
- package/dist/auth.js +1 -1
- package/dist/{chunk-RJRZXDVT.js → chunk-3JBVI4UH.js} +7 -7
- package/dist/{chunk-43ZBO3JW.js → chunk-4ZYLGBJU.js} +2 -2
- package/dist/{chunk-B3C6H2PR.js → chunk-7WIISD2N.js} +17 -14
- package/dist/{chunk-B3C6H2PR.js.map → chunk-7WIISD2N.js.map} +1 -1
- package/dist/{chunk-KJ2SUFAU.js → chunk-AY7E7VA6.js} +81 -16
- package/dist/chunk-AY7E7VA6.js.map +1 -0
- package/dist/{chunk-AJ6DIDO4.js → chunk-DBBE6D36.js} +4 -46
- package/dist/chunk-DBBE6D36.js.map +1 -0
- package/dist/{chunk-AV7SRATY.js → chunk-E657OJL4.js} +6 -6
- package/dist/{chunk-XOASGJZU.js → chunk-FXKMYYK5.js} +13 -13
- package/dist/{chunk-ZAZTNDSY.js → chunk-P3N2J3QT.js} +9 -9
- package/dist/{chunk-42GZ6FGV.js → chunk-PL6RIFD5.js} +2 -2
- package/dist/{chunk-VCEFZTWS.js → chunk-TIL2S3JA.js} +4 -1
- package/dist/chunk-TIL2S3JA.js.map +1 -0
- package/dist/{chunk-45BHMNX6.js → chunk-V6BWOIRC.js} +6 -6
- package/dist/{chunk-O7DR57RN.js → chunk-ZGRY42BZ.js} +9 -12
- package/dist/{chunk-O7DR57RN.js.map → chunk-ZGRY42BZ.js.map} +1 -1
- package/dist/{chunk-3NOV7X4M.js → chunk-ZZQJWNQT.js} +3 -1
- package/dist/chunk-ZZQJWNQT.js.map +1 -0
- package/dist/commonConstants.js +1 -1
- package/dist/commonSelectors.cjs +11 -56
- package/dist/commonSelectors.cjs.map +1 -1
- package/dist/commonSelectors.js +8 -8
- package/dist/constants.cjs +3 -45
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.js +1 -1
- 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 +14 -56
- package/dist/deploymentsSlice/thunks.cjs.map +1 -1
- package/dist/deploymentsSlice/thunks.js +16 -16
- 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 +8 -11
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.js +2 -2
- package/dist/devicesSlice/thunks.cjs +14 -56
- package/dist/devicesSlice/thunks.cjs.map +1 -1
- package/dist/devicesSlice/thunks.js +16 -16
- 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 +14 -56
- package/dist/monitorSlice/thunks.cjs.map +1 -1
- package/dist/monitorSlice/thunks.js +14 -14
- package/dist/onboardingSlice/thunks.cjs +14 -56
- package/dist/onboardingSlice/thunks.cjs.map +1 -1
- package/dist/onboardingSlice/thunks.js +16 -16
- package/dist/organizationSlice/constants.js +1 -1
- package/dist/organizationSlice/index.cjs +3 -0
- package/dist/organizationSlice/index.cjs.map +1 -1
- package/dist/organizationSlice/index.d.cts +4 -1
- package/dist/organizationSlice/index.d.ts +4 -1
- package/dist/organizationSlice/index.js +2 -2
- package/dist/organizationSlice/mocks.cjs +175 -0
- package/dist/organizationSlice/mocks.cjs.map +1 -1
- package/dist/organizationSlice/mocks.d.cts +121 -2
- package/dist/organizationSlice/mocks.d.ts +121 -2
- package/dist/organizationSlice/mocks.js +87 -2
- package/dist/organizationSlice/mocks.js.map +1 -1
- package/dist/organizationSlice/selectors.cjs +3 -0
- package/dist/organizationSlice/selectors.cjs.map +1 -1
- package/dist/organizationSlice/selectors.d.cts +3 -2
- package/dist/organizationSlice/selectors.d.ts +3 -2
- package/dist/organizationSlice/selectors.js +4 -2
- package/dist/organizationSlice/thunks.cjs +97 -71
- package/dist/organizationSlice/thunks.cjs.map +1 -1
- package/dist/organizationSlice/thunks.d.cts +17 -3
- package/dist/organizationSlice/thunks.d.ts +17 -3
- package/dist/organizationSlice/thunks.js +22 -18
- package/dist/organizationSlice/types.cjs.map +1 -1
- package/dist/organizationSlice/types.d.cts +30 -7
- package/dist/organizationSlice/types.d.ts +30 -7
- package/dist/releasesSlice/index.js +1 -1
- package/dist/releasesSlice/mocks.js +1 -1
- package/dist/releasesSlice/selectors.cjs.map +1 -1
- package/dist/releasesSlice/selectors.js +3 -3
- package/dist/releasesSlice/thunks.cjs +14 -56
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.js +14 -14
- package/dist/selectors.cjs +14 -56
- 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 +28 -26
- package/dist/sockethook.js +1 -1
- package/dist/store.cjs +3 -0
- package/dist/store.cjs.map +1 -1
- package/dist/store.js +6 -6
- package/dist/storehooks.cjs +93 -70
- package/dist/storehooks.cjs.map +1 -1
- package/dist/storehooks.js +20 -18
- package/dist/storehooks.js.map +1 -1
- package/dist/thunks.cjs +95 -69
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.d.cts +1 -1
- package/dist/thunks.d.ts +1 -1
- package/dist/thunks.js +20 -16
- package/dist/useDeploymentDevice.cjs +14 -56
- package/dist/useDeploymentDevice.cjs.map +1 -1
- package/dist/useDeploymentDevice.js +16 -16
- 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.cjs +3 -45
- package/dist/usersSlice/selectors.cjs.map +1 -1
- package/dist/usersSlice/selectors.js +3 -3
- package/dist/usersSlice/thunks.cjs +14 -56
- package/dist/usersSlice/thunks.cjs.map +1 -1
- package/dist/usersSlice/thunks.js +16 -16
- package/dist/utils.cjs +18 -57
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -3
- package/dist/utils.d.ts +1 -3
- package/dist/utils.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-3NOV7X4M.js.map +0 -1
- package/dist/chunk-AJ6DIDO4.js.map +0 -1
- package/dist/chunk-KJ2SUFAU.js.map +0 -1
- package/dist/chunk-VCEFZTWS.js.map +0 -1
- /package/dist/{chunk-RJRZXDVT.js.map → chunk-3JBVI4UH.js.map} +0 -0
- /package/dist/{chunk-43ZBO3JW.js.map → chunk-4ZYLGBJU.js.map} +0 -0
- /package/dist/{chunk-AV7SRATY.js.map → chunk-E657OJL4.js.map} +0 -0
- /package/dist/{chunk-XOASGJZU.js.map → chunk-FXKMYYK5.js.map} +0 -0
- /package/dist/{chunk-ZAZTNDSY.js.map → chunk-P3N2J3QT.js.map} +0 -0
- /package/dist/{chunk-42GZ6FGV.js.map → chunk-PL6RIFD5.js.map} +0 -0
- /package/dist/{chunk-45BHMNX6.js.map → chunk-V6BWOIRC.js.map} +0 -0
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
// src/appSlice/constants.ts
|
|
2
2
|
import { BarChart as BarChartIcon, PieChartOutline as PieChartIcon } from "@mui/icons-material";
|
|
3
3
|
import { yes as yesUtil } from "@northern.tech/utils";
|
|
4
|
-
var startingDeviceCount = {
|
|
5
|
-
os: "for first 50 devices",
|
|
6
|
-
professional: "for first 250 devices"
|
|
7
|
-
};
|
|
8
4
|
var chartTypes = {
|
|
9
5
|
bar: { key: "bar", Icon: BarChartIcon },
|
|
10
6
|
pie: { key: "pie", Icon: PieChartIcon }
|
|
@@ -22,31 +18,17 @@ var PLANS = {
|
|
|
22
18
|
os: {
|
|
23
19
|
id: "os",
|
|
24
20
|
name: "Basic",
|
|
25
|
-
|
|
26
|
-
offer: true,
|
|
27
|
-
price: "$34 / month",
|
|
28
|
-
deviceCount: startingDeviceCount.os,
|
|
29
|
-
description: "The core features of Mender. To continue using Enterprise Trial features\u2014like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more\u2014please upgrade to a higher plan.",
|
|
30
|
-
features: ["Access to core features of Mender", "Basic support"]
|
|
21
|
+
description: "The core features of Mender. To continue using Enterprise Trial features\u2014like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more\u2014please upgrade to a higher plan."
|
|
31
22
|
},
|
|
32
23
|
professional: {
|
|
33
24
|
id: "professional",
|
|
34
25
|
name: "Professional",
|
|
35
|
-
|
|
36
|
-
offer: true,
|
|
37
|
-
price: "$291 / month",
|
|
38
|
-
deviceCount: startingDeviceCount.professional,
|
|
39
|
-
description: "Everything in Basic, plus enhanced update management and automation features.",
|
|
40
|
-
features: ["Advanced OTA features", "Higher priority support"]
|
|
26
|
+
description: "Everything in Basic, plus enhanced update management and automation features."
|
|
41
27
|
},
|
|
42
28
|
enterprise: {
|
|
43
29
|
id: "enterprise",
|
|
44
30
|
name: "Enterprise",
|
|
45
|
-
|
|
46
|
-
price: "Custom pricing",
|
|
47
|
-
deviceCount: "Unlimited devices",
|
|
48
|
-
description: "Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription \u2014 ask us for a quote.",
|
|
49
|
-
features: ["All Mender features", "Advanced security features", "SLA-backed support"]
|
|
31
|
+
description: "Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription \u2014 ask us for a quote."
|
|
50
32
|
}
|
|
51
33
|
};
|
|
52
34
|
var ADDONS = {
|
|
@@ -55,14 +37,6 @@ var ADDONS = {
|
|
|
55
37
|
title: "Configure",
|
|
56
38
|
description: "Seamlessly configure applications and devices remotely \u2013 configure each device to its environment.",
|
|
57
39
|
needs: ["hasDeviceConfig"],
|
|
58
|
-
os: {
|
|
59
|
-
price: "$11/month",
|
|
60
|
-
deviceCount: startingDeviceCount.os
|
|
61
|
-
},
|
|
62
|
-
professional: {
|
|
63
|
-
price: "$65/month",
|
|
64
|
-
deviceCount: startingDeviceCount.professional
|
|
65
|
-
},
|
|
66
40
|
eligible: ["os", "professional", "enterprise"]
|
|
67
41
|
},
|
|
68
42
|
monitor: {
|
|
@@ -70,14 +44,6 @@ var ADDONS = {
|
|
|
70
44
|
title: "Monitor",
|
|
71
45
|
description: "Detect and analyze health issues of devices, services and applications. Set up alerts so you can act quickly.",
|
|
72
46
|
needs: ["hasMonitor"],
|
|
73
|
-
os: {
|
|
74
|
-
price: "-",
|
|
75
|
-
deviceCount: "-"
|
|
76
|
-
},
|
|
77
|
-
professional: {
|
|
78
|
-
price: "$86/month",
|
|
79
|
-
deviceCount: startingDeviceCount.professional
|
|
80
|
-
},
|
|
81
47
|
eligible: ["professional", "enterprise"]
|
|
82
48
|
},
|
|
83
49
|
troubleshoot: {
|
|
@@ -85,14 +51,6 @@ var ADDONS = {
|
|
|
85
51
|
title: "Troubleshoot",
|
|
86
52
|
description: "Secure, remote access to your devices \u2013 quickly diagnose and fix issues in real time.",
|
|
87
53
|
needs: ["hasDeviceConnect"],
|
|
88
|
-
os: {
|
|
89
|
-
price: "$27/month",
|
|
90
|
-
deviceCount: startingDeviceCount.os
|
|
91
|
-
},
|
|
92
|
-
professional: {
|
|
93
|
-
price: "$72/month",
|
|
94
|
-
deviceCount: startingDeviceCount.professional
|
|
95
|
-
},
|
|
96
54
|
eligible: ["os", "professional", "enterprise"]
|
|
97
55
|
}
|
|
98
56
|
};
|
|
@@ -154,4 +112,4 @@ export {
|
|
|
154
112
|
DARK_MODE,
|
|
155
113
|
LIGHT_MODE
|
|
156
114
|
};
|
|
157
|
-
//# sourceMappingURL=chunk-
|
|
115
|
+
//# sourceMappingURL=chunk-DBBE6D36.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/appSlice/constants.ts"],"sourcesContent":["// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { BarChart as BarChartIcon, PieChartOutline as PieChartIcon } from '@mui/icons-material';\n\nimport { yes as yesUtil } from '@northern.tech/utils';\n\nexport const chartTypes = {\n bar: { key: 'bar', Icon: BarChartIcon },\n pie: { key: 'pie', Icon: PieChartIcon }\n} as const;\nexport const emptyChartSelection = { software: '', group: '', chartType: chartTypes.bar.key, attribute: 'artifact_name' };\nexport const defaultReportType = 'distribution';\nexport const defaultReports = [{ ...emptyChartSelection, group: null, attribute: 'artifact_name', type: defaultReportType }];\n\nexport const BEGINNING_OF_TIME = '2016-01-01T00:00:00.000Z';\n\nexport const locations = {\n cn: { key: 'cn', title: 'China', location: 'hosted.mender.cn' },\n eu: { key: 'eu', title: 'EU', location: 'eu.hosted.mender.io' },\n us: { key: 'us', title: 'US', location: 'hosted.mender.io' }\n} as const;\nexport type AvailablePlans = 'os' | 'professional' | 'enterprise';\n\nexport type Plan = {\n description: string;\n id: AvailablePlans;\n name: string;\n};\n\nexport type AvailableAddon = 'configure' | 'troubleshoot' | 'monitor';\n\nexport const PLANS: { [key in AvailablePlans]: Plan } = {\n os: {\n id: 'os',\n name: 'Basic',\n description:\n 'The core features of Mender. To continue using Enterprise Trial features—like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more—please upgrade to a higher plan.'\n },\n professional: {\n id: 'professional',\n name: 'Professional',\n description: 'Everything in Basic, plus enhanced update management and automation features.'\n },\n enterprise: {\n id: 'enterprise',\n name: 'Enterprise',\n description:\n 'Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription — ask us for a quote.'\n }\n} as const;\nexport type Addon = {\n description: string;\n eligible: AvailablePlans[];\n id: string;\n needs: string[];\n title: string;\n};\n\nexport type AddonId = keyof typeof ADDONS;\n\n// the needs names need to be aligned with the name of the features in the appReducer, as they will be checked in the addonselection\nexport const ADDONS: { [key in AvailableAddon]: Addon } = {\n configure: {\n id: 'configure',\n title: 'Configure',\n description: 'Seamlessly configure applications and devices remotely – configure each device to its environment.',\n needs: ['hasDeviceConfig'],\n eligible: ['os', 'professional', 'enterprise']\n },\n monitor: {\n id: 'monitor',\n title: 'Monitor',\n description: 'Detect and analyze health issues of devices, services and applications. Set up alerts so you can act quickly.',\n needs: ['hasMonitor'],\n eligible: ['professional', 'enterprise']\n },\n troubleshoot: {\n id: 'troubleshoot',\n title: 'Troubleshoot',\n description: 'Secure, remote access to your devices – quickly diagnose and fix issues in real time.',\n needs: ['hasDeviceConnect'],\n eligible: ['os', 'professional', 'enterprise']\n }\n};\n\nexport const BENEFITS = {\n auditlog: {\n id: 'auditlog',\n benefit: 'gain access to logs for important events such as changes to devices, deployments and user management, as well as remote terminal session replays',\n requiredPlan: PLANS.enterprise.id\n },\n dashboard: { id: 'dashboard', benefit: 'actionable insights into the devices you are updating with Mender', requiredPlan: PLANS.enterprise.id },\n deltaGeneration: {\n id: 'deltaGeneration',\n benefit: 'automatic delta artifacts generation to minimize data transfer and improve the update delivery',\n requiredPlan: PLANS.enterprise.id\n },\n deviceConfiguration: { id: 'deviceConfiguration', benefit: 'device configuration features', requiredAddon: ADDONS.configure.id },\n deviceMonitor: { id: 'deviceMonitor', benefit: 'device monitoring features', requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },\n deviceTroubleshoot: { id: 'deviceTroubleshoot', benefit: 'device troubleshooting features', requiredAddon: ADDONS.troubleshoot.id },\n dynamicGroups: { id: 'dynamicGroups', benefit: 'create dynamic groups to ease device management', requiredPlan: PLANS.enterprise.id },\n fullFiltering: { id: 'fullFiltering', benefit: 'filtering by multiple attributes to improve the device overview', requiredPlan: PLANS.professional.id },\n gateway: { id: 'gateway', benefit: 'see devices connected to your gateway device for easy access', requiredPlans: PLANS.professional.id },\n pausedDeployments: {\n id: 'pausedDeployments',\n benefit: 'granular control about update rollout to allow synchronization across your fleet',\n requiredPlan: PLANS.enterprise.id\n },\n phasedDeployments: { id: 'phasedDeployments', benefit: 'choose to roll out deployments in multiple phases', requiredPlan: PLANS.enterprise.id },\n rbac: { id: 'rbac', benefit: 'granular role based access control', requiredPlan: PLANS.enterprise.id },\n retryDeployments: { id: 'retryDeployments', benefit: 'optional retries for failed rollout attempts', requiredPlan: PLANS.professional.id },\n scheduledDeployments: {\n id: 'scheduledDeployments',\n benefit: 'scheduled deployments to steer the distribution of your updates.',\n requiredPlan: PLANS.professional.id\n },\n webhookEvents: {\n id: 'webhookEvents',\n benefit: 'receive inventory events and select which type(s) of events the webhook will receive',\n requiredPlan: PLANS.professional.id\n },\n\n default: { id: 'default', benefit: 'gain access to this feature', requiredPlan: PLANS.enterprise.id }\n} as const;\n\nexport const yes = yesUtil;\nexport const canAccess = yes;\n\nexport const DARK_MODE = 'dark';\nexport const LIGHT_MODE = 'light';\n"],"mappings":";AAaA,SAAS,YAAY,cAAc,mBAAmB,oBAAoB;AAE1E,SAAS,OAAO,eAAe;AAExB,IAAM,aAAa;AAAA,EACxB,KAAK,EAA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aAAa;AAAA,EACnC;AAAA,EACA,eAAe;AAAA,IACb,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,cAAc,MAAM,aAAa;AAAA,EACnC;AAAA,EAEA,SAAS,EAAE,IAAI,WAAW,SAAS,+BAA+B,cAAc,MAAM,WAAW,GAAG;AACtG;AAEO,IAAM,MAAM;AACZ,IAAM,YAAY;AAElB,IAAM,YAAY;AAClB,IAAM,aAAa;","names":[]}
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
commonErrorFallback,
|
|
3
3
|
commonErrorHandler,
|
|
4
4
|
createAppAsyncThunk
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-P3N2J3QT.js";
|
|
6
6
|
import {
|
|
7
7
|
general_api_default
|
|
8
8
|
} from "./chunk-IRQRV552.js";
|
|
9
9
|
import {
|
|
10
10
|
actions_default
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-3JBVI4UH.js";
|
|
12
12
|
import {
|
|
13
13
|
actions,
|
|
14
14
|
sliceName
|
|
@@ -18,14 +18,14 @@ import {
|
|
|
18
18
|
} from "./chunk-53W2NRSL.js";
|
|
19
19
|
import {
|
|
20
20
|
getSearchEndpoint
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-FXKMYYK5.js";
|
|
22
22
|
import {
|
|
23
23
|
getReleasesById
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-PL6RIFD5.js";
|
|
25
25
|
import {
|
|
26
26
|
convertDeviceListStateToFilters,
|
|
27
27
|
progress
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-7WIISD2N.js";
|
|
29
29
|
import {
|
|
30
30
|
DEVICE_LIST_DEFAULTS,
|
|
31
31
|
SORTING_OPTIONS,
|
|
@@ -442,4 +442,4 @@ export {
|
|
|
442
442
|
getDeltaGenerationJobs,
|
|
443
443
|
getDeltaGenerationJobDetails
|
|
444
444
|
};
|
|
445
|
-
//# sourceMappingURL=chunk-
|
|
445
|
+
//# sourceMappingURL=chunk-E657OJL4.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
getOnboarding
|
|
3
|
+
} from "./chunk-JIS4PA3R.js";
|
|
4
4
|
import {
|
|
5
5
|
getCurrentUser,
|
|
6
6
|
getGlobalSettings,
|
|
@@ -10,18 +10,18 @@ import {
|
|
|
10
10
|
getSecurityAlertDismissedTimestamp,
|
|
11
11
|
getUserSettings,
|
|
12
12
|
getUserSettingsInitialized
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-4ZYLGBJU.js";
|
|
14
14
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
getOrganization
|
|
18
|
-
} from "./chunk-3NOV7X4M.js";
|
|
15
|
+
getReleasesById
|
|
16
|
+
} from "./chunk-PL6RIFD5.js";
|
|
19
17
|
import {
|
|
20
18
|
getIssueCountsByType
|
|
21
19
|
} from "./chunk-YO22XLHI.js";
|
|
22
20
|
import {
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
getAuditLogEntry,
|
|
22
|
+
getIsServiceProvider,
|
|
23
|
+
getOrganization
|
|
24
|
+
} from "./chunk-ZZQJWNQT.js";
|
|
25
25
|
import {
|
|
26
26
|
getDeploymentsById,
|
|
27
27
|
getDeploymentsSelectionState,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
getFilteringAttributes,
|
|
34
34
|
getGroupsById,
|
|
35
35
|
getListedDevices
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-ZGRY42BZ.js";
|
|
37
37
|
import {
|
|
38
38
|
getFeatures,
|
|
39
39
|
getSearchedDevices
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
import {
|
|
42
42
|
listItemMapper,
|
|
43
43
|
mapUserRolesToUiPermissions
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-7WIISD2N.js";
|
|
45
45
|
import {
|
|
46
46
|
ALL_DEVICES,
|
|
47
47
|
ATTRIBUTE_SCOPES,
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
ADDONS,
|
|
63
63
|
PLANS,
|
|
64
64
|
defaultReports
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-DBBE6D36.js";
|
|
66
66
|
|
|
67
67
|
// src/commonSelectors.ts
|
|
68
68
|
import { attributeDuplicateFilter, getDemoDeviceAddress as getDemoDeviceAddressHelper } from "@northern.tech/utils/helpers";
|
|
@@ -310,4 +310,4 @@ export {
|
|
|
310
310
|
getRelevantRoles,
|
|
311
311
|
getShowSecurityAlert
|
|
312
312
|
};
|
|
313
|
-
//# sourceMappingURL=chunk-
|
|
313
|
+
//# sourceMappingURL=chunk-FXKMYYK5.js.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
actions_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3JBVI4UH.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
onboardingSlice_default
|
|
6
|
+
} from "./chunk-CQXDAXQF.js";
|
|
7
7
|
import {
|
|
8
8
|
actions as actions2,
|
|
9
9
|
usersSlice_default
|
|
10
10
|
} from "./chunk-YR65C62H.js";
|
|
11
11
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} from "./chunk-VCEFZTWS.js";
|
|
12
|
+
releasesSlice_default
|
|
13
|
+
} from "./chunk-TRKA7XYU.js";
|
|
15
14
|
import {
|
|
16
15
|
monitorSlice_default
|
|
17
16
|
} from "./chunk-PVCHKW35.js";
|
|
18
17
|
import {
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
actions,
|
|
19
|
+
organizationSlice_default
|
|
20
|
+
} from "./chunk-TIL2S3JA.js";
|
|
21
21
|
import {
|
|
22
22
|
devicesSlice_default
|
|
23
23
|
} from "./chunk-VODRLEDP.js";
|
|
@@ -139,4 +139,4 @@ export {
|
|
|
139
139
|
useAppDispatch,
|
|
140
140
|
createAppAsyncThunk
|
|
141
141
|
};
|
|
142
|
-
//# sourceMappingURL=chunk-
|
|
142
|
+
//# sourceMappingURL=chunk-P3N2J3QT.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listItemMapper
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7WIISD2N.js";
|
|
4
4
|
|
|
5
5
|
// src/releasesSlice/selectors.ts
|
|
6
6
|
import { createSelector } from "@reduxjs/toolkit";
|
|
@@ -41,4 +41,4 @@ export {
|
|
|
41
41
|
getDeltaJobById,
|
|
42
42
|
getSelectedJob
|
|
43
43
|
};
|
|
44
|
-
//# sourceMappingURL=chunk-
|
|
44
|
+
//# sourceMappingURL=chunk-PL6RIFD5.js.map
|
|
@@ -80,6 +80,9 @@ var organizationSlice = createSlice({
|
|
|
80
80
|
setSubscription: (state, action) => {
|
|
81
81
|
state.organization.subscription = { ...state.organization.subscription, ...action.payload };
|
|
82
82
|
},
|
|
83
|
+
setProducts: (state, action) => {
|
|
84
|
+
state.products = action.payload;
|
|
85
|
+
},
|
|
83
86
|
setBillingProfile: (state, action) => {
|
|
84
87
|
state.organization.billing_profile = action.payload;
|
|
85
88
|
},
|
|
@@ -109,4 +112,4 @@ export {
|
|
|
109
112
|
actions,
|
|
110
113
|
organizationSlice_default
|
|
111
114
|
};
|
|
112
|
-
//# sourceMappingURL=chunk-
|
|
115
|
+
//# sourceMappingURL=chunk-TIL2S3JA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/organizationSlice/index.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 type { AuditLog as AuditLogEvent, BillingProfile, Integration, Event as WebhookEvent } from '@northern.tech/types/MenderTypes';\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport { DEVICE_LIST_DEFAULTS, SORTING_OPTIONS, TENANT_LIST_DEFAULT } from '../constants';\nimport type { AuditLog, AuditLogSelectionState, Card, Organization, ProductConfig, SSOConfig, TenantList, Webhook } from './types';\n\nexport const sliceName = 'organization';\n\nexport type OrganizationSliceType = {\n auditlog: AuditLog;\n card: Card;\n externalDeviceIntegrations: Integration[];\n intentId: string | null;\n organization: Partial<Organization>;\n products?: ProductConfig;\n ssoConfigs: SSOConfig[];\n tenantList: TenantList;\n webhooks: Webhook;\n};\n\nexport const initialState: OrganizationSliceType = {\n card: {\n last4: '',\n expiration: { month: 1, year: 2020 },\n brand: ''\n },\n intentId: null,\n tenantList: {\n ...TENANT_LIST_DEFAULT,\n total: 0,\n tenants: [],\n selectedTenant: null,\n sort: {\n direction: SORTING_OPTIONS.desc,\n key: 'name'\n }\n },\n organization: {\n // id, name, status, tenant_token, plan\n },\n auditlog: {\n events: [],\n selectionState: {\n ...DEVICE_LIST_DEFAULTS,\n detail: undefined,\n endDate: undefined,\n selectedIssue: undefined,\n sort: { direction: SORTING_OPTIONS.desc },\n startDate: undefined,\n total: 0,\n type: undefined,\n user: undefined,\n isLoading: false\n }\n },\n externalDeviceIntegrations: [\n // { <connection_string|x509|...>, id, provider }\n ],\n ssoConfigs: [],\n webhooks: {\n // [id]: { events: [] }\n // for now:\n events: [],\n eventsTotal: 0\n }\n};\n\nexport const organizationSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n receiveAuditLogs: (state, action: PayloadAction<{ events: AuditLogEvent[]; total: number }>) => {\n const { events, total } = action.payload;\n state.auditlog.events = events;\n state.auditlog.selectionState.total = total;\n },\n setAuditLogState: (state, action: PayloadAction<Partial<AuditLogSelectionState>>) => {\n state.auditlog.selectionState = {\n ...state.auditlog.selectionState,\n ...action.payload\n };\n },\n receiveCurrentCard: (state, action: PayloadAction<Card>) => {\n state.card = action.payload;\n },\n receiveSetupIntent: (state, action: PayloadAction<string | null>) => {\n state.intentId = action.payload;\n },\n setOrganization: (state, action: PayloadAction<Partial<Organization>>) => {\n state.organization = { ...state.organization, ...action.payload };\n },\n setSubscription: (state, action) => {\n state.organization.subscription = { ...state.organization.subscription, ...action.payload };\n },\n setProducts: (state, action: PayloadAction<ProductConfig>) => {\n state.products = action.payload;\n },\n setBillingProfile: (state, action: PayloadAction<BillingProfile>) => {\n state.organization.billing_profile = action.payload;\n },\n setTenantListState: (state, action: PayloadAction<TenantList>) => {\n state.tenantList = action.payload;\n },\n receiveExternalDeviceIntegrations: (state, action: PayloadAction<Integration[]>) => {\n state.externalDeviceIntegrations = action.payload;\n },\n receiveSsoConfigs: (state, action: PayloadAction<SSOConfig[]>) => {\n state.ssoConfigs = action.payload;\n },\n receiveWebhookEvents: (state, action: PayloadAction<{ total: number; value: WebhookEvent[] }>) => {\n const { value, total } = action.payload;\n state.webhooks.events = value;\n state.webhooks.eventsTotal = total;\n }\n }\n});\n\nexport const actions = organizationSlice.actions;\nexport default organizationSlice.reducer;\n"],"mappings":";;;;;;;AAeA,SAAS,mBAAmB;AAKrB,IAAM,YAAY;AAclB,IAAM,eAAsC;AAAA,EACjD,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,YAAY,EAAE,OAAO,GAAG,MAAM,KAAK;AAAA,IACnC,OAAO;AAAA,EACT;AAAA,EACA,UAAU;AAAA,EACV,YAAY;AAAA,IACV,GAAG;AAAA,IACH,OAAO;AAAA,IACP,SAAS,CAAC;AAAA,IACV,gBAAgB;AAAA,IAChB,MAAM;AAAA,MACJ,WAAW,gBAAgB;AAAA,MAC3B,KAAK;AAAA,IACP;AAAA,EACF;AAA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AC,OAAO,WAAyC;AAC5D,YAAM,WAAW,OAAO;AAAA,IAC1B;AAAA,IACA,mBAAmB,CAAC,OAAO,WAA0C;AACnE,YAAM,aAAa,kBAAkB,OAAO;AAAA,IAC9C;AAAA,IACA,oBAAoB,CAAC,OAAO,WAAsC;AAChE,YAAM,aAAa,OAAO;AAAA,IAC5B;AAAA,IACA,mCAAmC,CAAC,OAAO,WAAyC;AAClF,YAAM,6BAA6B,OAAO;AAAA,IAC5C;AAAA,IACA,mBAAmB,CAAC,OAAO,WAAuC;AAChE,YAAM,aAAa,OAAO;AAAA,IAC5B;AAAA,IACA,sBAAsB,CAAC,OAAO,WAAoE;AAChG,YAAM,EAAE,OAAO,MAAM,IAAI,OAAO;AAChC,YAAM,SAAS,SAAS;AACxB,YAAM,SAAS,cAAc;AAAA,IAC/B;AAAA,EACF;AACF,CAAC;AAEM,IAAM,UAAU,kBAAkB;AACzC,IAAO,4BAAQ,kBAAkB;","names":[]}
|
|
@@ -2,26 +2,26 @@ import {
|
|
|
2
2
|
commonErrorFallback,
|
|
3
3
|
commonErrorHandler,
|
|
4
4
|
createAppAsyncThunk
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-P3N2J3QT.js";
|
|
6
6
|
import {
|
|
7
7
|
general_api_default
|
|
8
8
|
} from "./chunk-IRQRV552.js";
|
|
9
9
|
import {
|
|
10
10
|
actions_default
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-3JBVI4UH.js";
|
|
12
12
|
import {
|
|
13
13
|
actions,
|
|
14
14
|
sliceName
|
|
15
15
|
} from "./chunk-PVCHKW35.js";
|
|
16
16
|
import {
|
|
17
17
|
getSearchEndpoint
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-FXKMYYK5.js";
|
|
19
19
|
import {
|
|
20
20
|
getDeviceFilters
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-ZGRY42BZ.js";
|
|
22
22
|
import {
|
|
23
23
|
convertDeviceListStateToFilters
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-7WIISD2N.js";
|
|
25
25
|
import {
|
|
26
26
|
DEVICE_LIST_DEFAULTS,
|
|
27
27
|
TIMEOUTS,
|
|
@@ -107,4 +107,4 @@ export {
|
|
|
107
107
|
getDeviceMonitorConfig,
|
|
108
108
|
changeNotificationSetting
|
|
109
109
|
};
|
|
110
|
-
//# sourceMappingURL=chunk-
|
|
110
|
+
//# sourceMappingURL=chunk-V6BWOIRC.js.map
|
|
@@ -106,17 +106,14 @@ var getAttributesList = createSelector(
|
|
|
106
106
|
[getFilteringAttributes, getFilteringAttributesFromConfig],
|
|
107
107
|
({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) => [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(duplicateFilter)
|
|
108
108
|
);
|
|
109
|
-
var getDeviceLimitStats = createSelector(
|
|
110
|
-
|
|
111
|
-
(limits,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}));
|
|
118
|
-
}
|
|
119
|
-
);
|
|
109
|
+
var getDeviceLimitStats = createSelector([getDeviceLimits, getAcceptedDevices], (limits, accepted) => {
|
|
110
|
+
const { counts } = accepted;
|
|
111
|
+
return Object.entries(limits).filter(([, limit]) => limit !== 0).map(([type, limit]) => ({
|
|
112
|
+
type,
|
|
113
|
+
limit,
|
|
114
|
+
total: counts[type] || 0
|
|
115
|
+
}));
|
|
116
|
+
});
|
|
120
117
|
var getDeviceTypes = createSelector(
|
|
121
118
|
[getAcceptedDevices, getDevicesById],
|
|
122
119
|
({ deviceIds = [] }, devicesById) => Object.keys(
|
|
@@ -159,4 +156,4 @@ export {
|
|
|
159
156
|
getDeviceLimitStats,
|
|
160
157
|
getDeviceTypes
|
|
161
158
|
};
|
|
162
|
-
//# sourceMappingURL=chunk-
|
|
159
|
+
//# sourceMappingURL=chunk-ZGRY42BZ.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(\n [getDeviceLimits, getAcceptedDevices],\n (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);\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,wB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,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);\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 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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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"]}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
// src/organizationSlice/selectors.ts
|
|
6
6
|
import { createSelector } from "@reduxjs/toolkit";
|
|
7
7
|
var getOrganization = (state) => state.organization.organization;
|
|
8
|
+
var getProducts = (state) => state.organization.products;
|
|
8
9
|
var getExternalIntegrations = (state) => state.organization.externalDeviceIntegrations;
|
|
9
10
|
var getAuditlogState = (state) => state.organization.auditlog.selectionState;
|
|
10
11
|
var getAuditLog = (state) => state.organization.auditlog.events;
|
|
@@ -39,6 +40,7 @@ var getAuditLogEntry = createSelector([getAuditLog, getAuditLogSelectionState],
|
|
|
39
40
|
|
|
40
41
|
export {
|
|
41
42
|
getOrganization,
|
|
43
|
+
getProducts,
|
|
42
44
|
getExternalIntegrations,
|
|
43
45
|
getAuditlogState,
|
|
44
46
|
getAuditLog,
|
|
@@ -56,4 +58,4 @@ export {
|
|
|
56
58
|
getWebhookEventInfo,
|
|
57
59
|
getAuditLogEntry
|
|
58
60
|
};
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-ZZQJWNQT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/organizationSlice/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 { createSelector } from '@reduxjs/toolkit';\n\nimport { EXTERNAL_PROVIDER } from '../constants';\nimport type { RootState } from '../store';\n\nexport const getOrganization = (state: RootState) => state.organization.organization;\nexport const getProducts = (state: RootState) => state.organization.products;\nexport const getExternalIntegrations = (state: RootState) => state.organization.externalDeviceIntegrations;\nexport const getAuditlogState = (state: RootState) => state.organization.auditlog.selectionState;\nexport const getAuditLog = (state: RootState) => state.organization.auditlog.events;\nexport const getAuditLogSelectionState = (state: RootState) => state.organization.auditlog.selectionState;\nexport const getBillingProfile = (state: RootState) => state.organization.organization.billing_profile;\nexport const getSubscription = (state: RootState) => state.organization.organization.subscription;\nexport const getCard = (state: RootState) => state.organization.card;\nexport const getSsoConfig = ({ organization: { ssoConfigs = [] } }: RootState) => ssoConfigs[0];\nexport const getTenantsList = (state: RootState) => state.organization.tenantList;\nexport const getWebhookEvents = (state: RootState) => state.organization.webhooks.events;\nexport const getWebhookEventTotal = (state: RootState) => state.organization.webhooks.eventsTotal;\n\nexport const getDeviceTwinIntegrations = createSelector([getExternalIntegrations], integrations =>\n integrations.filter(integration => integration.id && EXTERNAL_PROVIDER[integration.provider]?.deviceTwin)\n);\nexport const getIsServiceProvider = (state: RootState) => state.organization.organization.service_provider;\n\nexport const getWebhooks = createSelector([getExternalIntegrations], integrations =>\n integrations.filter(integration => integration.id && integration.provider === EXTERNAL_PROVIDER.webhook.provider)\n);\nexport const getWebhookEventInfo = createSelector([getWebhooks, getWebhookEvents, getWebhookEventTotal], (webhooks, events, eventTotal) =>\n webhooks.length ? { events, eventTotal } : { events: [], eventTotal: 0 }\n);\n\nexport const getAuditLogEntry = createSelector([getAuditLog, getAuditLogSelectionState], (events, { selectedId }) => {\n if (!selectedId) {\n return;\n }\n const [eventAction, eventTime] = atob(selectedId).split('|');\n return events.find(item => item.action === eventAction && item.time === eventTime);\n});\n"],"mappings":";;;;;AAaA,SAAS,sBAAsB;AAKxB,IAAM,kBAAkB,CAAC,UAAqB,MAAM,aAAa;AACjE,IAAM,cAAc,CAAC,UAAqB,MAAM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,CAAC,aAAa,SAAS,IAAI,KAAK,UAAU,EAAE,MAAM,GAAG;AAC3D,SAAO,OAAO,KAAK,UAAQ,KAAK,WAAW,eAAe,KAAK,SAAS,SAAS;AACnF,CAAC;","names":[]}
|
package/dist/commonConstants.js
CHANGED
package/dist/commonSelectors.cjs
CHANGED
|
@@ -58,10 +58,6 @@ var import_dayjs = __toESM(require("dayjs"), 1);
|
|
|
58
58
|
// src/appSlice/constants.ts
|
|
59
59
|
var import_icons_material = require("@mui/icons-material");
|
|
60
60
|
var import_utils = require("@northern.tech/utils");
|
|
61
|
-
var startingDeviceCount = {
|
|
62
|
-
os: "for first 50 devices",
|
|
63
|
-
professional: "for first 250 devices"
|
|
64
|
-
};
|
|
65
61
|
var chartTypes = {
|
|
66
62
|
bar: { key: "bar", Icon: import_icons_material.BarChart },
|
|
67
63
|
pie: { key: "pie", Icon: import_icons_material.PieChartOutline }
|
|
@@ -73,31 +69,17 @@ var PLANS = {
|
|
|
73
69
|
os: {
|
|
74
70
|
id: "os",
|
|
75
71
|
name: "Basic",
|
|
76
|
-
|
|
77
|
-
offer: true,
|
|
78
|
-
price: "$34 / month",
|
|
79
|
-
deviceCount: startingDeviceCount.os,
|
|
80
|
-
description: "The core features of Mender. To continue using Enterprise Trial features\u2014like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more\u2014please upgrade to a higher plan.",
|
|
81
|
-
features: ["Access to core features of Mender", "Basic support"]
|
|
72
|
+
description: "The core features of Mender. To continue using Enterprise Trial features\u2014like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more\u2014please upgrade to a higher plan."
|
|
82
73
|
},
|
|
83
74
|
professional: {
|
|
84
75
|
id: "professional",
|
|
85
76
|
name: "Professional",
|
|
86
|
-
|
|
87
|
-
offer: true,
|
|
88
|
-
price: "$291 / month",
|
|
89
|
-
deviceCount: startingDeviceCount.professional,
|
|
90
|
-
description: "Everything in Basic, plus enhanced update management and automation features.",
|
|
91
|
-
features: ["Advanced OTA features", "Higher priority support"]
|
|
77
|
+
description: "Everything in Basic, plus enhanced update management and automation features."
|
|
92
78
|
},
|
|
93
79
|
enterprise: {
|
|
94
80
|
id: "enterprise",
|
|
95
81
|
name: "Enterprise",
|
|
96
|
-
|
|
97
|
-
price: "Custom pricing",
|
|
98
|
-
deviceCount: "Unlimited devices",
|
|
99
|
-
description: "Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription \u2014 ask us for a quote.",
|
|
100
|
-
features: ["All Mender features", "Advanced security features", "SLA-backed support"]
|
|
82
|
+
description: "Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription \u2014 ask us for a quote."
|
|
101
83
|
}
|
|
102
84
|
};
|
|
103
85
|
var ADDONS = {
|
|
@@ -106,14 +88,6 @@ var ADDONS = {
|
|
|
106
88
|
title: "Configure",
|
|
107
89
|
description: "Seamlessly configure applications and devices remotely \u2013 configure each device to its environment.",
|
|
108
90
|
needs: ["hasDeviceConfig"],
|
|
109
|
-
os: {
|
|
110
|
-
price: "$11/month",
|
|
111
|
-
deviceCount: startingDeviceCount.os
|
|
112
|
-
},
|
|
113
|
-
professional: {
|
|
114
|
-
price: "$65/month",
|
|
115
|
-
deviceCount: startingDeviceCount.professional
|
|
116
|
-
},
|
|
117
91
|
eligible: ["os", "professional", "enterprise"]
|
|
118
92
|
},
|
|
119
93
|
monitor: {
|
|
@@ -121,14 +95,6 @@ var ADDONS = {
|
|
|
121
95
|
title: "Monitor",
|
|
122
96
|
description: "Detect and analyze health issues of devices, services and applications. Set up alerts so you can act quickly.",
|
|
123
97
|
needs: ["hasMonitor"],
|
|
124
|
-
os: {
|
|
125
|
-
price: "-",
|
|
126
|
-
deviceCount: "-"
|
|
127
|
-
},
|
|
128
|
-
professional: {
|
|
129
|
-
price: "$86/month",
|
|
130
|
-
deviceCount: startingDeviceCount.professional
|
|
131
|
-
},
|
|
132
98
|
eligible: ["professional", "enterprise"]
|
|
133
99
|
},
|
|
134
100
|
troubleshoot: {
|
|
@@ -136,14 +102,6 @@ var ADDONS = {
|
|
|
136
102
|
title: "Troubleshoot",
|
|
137
103
|
description: "Secure, remote access to your devices \u2013 quickly diagnose and fix issues in real time.",
|
|
138
104
|
needs: ["hasDeviceConnect"],
|
|
139
|
-
os: {
|
|
140
|
-
price: "$27/month",
|
|
141
|
-
deviceCount: startingDeviceCount.os
|
|
142
|
-
},
|
|
143
|
-
professional: {
|
|
144
|
-
price: "$72/month",
|
|
145
|
-
deviceCount: startingDeviceCount.professional
|
|
146
|
-
},
|
|
147
105
|
eligible: ["os", "professional", "enterprise"]
|
|
148
106
|
}
|
|
149
107
|
};
|
|
@@ -864,17 +822,14 @@ var getAttributesList = (0, import_toolkit3.createSelector)(
|
|
|
864
822
|
[getFilteringAttributes, getFilteringAttributesFromConfig],
|
|
865
823
|
({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) => [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(import_helpers2.duplicateFilter)
|
|
866
824
|
);
|
|
867
|
-
var getDeviceLimitStats = (0, import_toolkit3.createSelector)(
|
|
868
|
-
|
|
869
|
-
(limits,
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
}));
|
|
876
|
-
}
|
|
877
|
-
);
|
|
825
|
+
var getDeviceLimitStats = (0, import_toolkit3.createSelector)([getDeviceLimits, getAcceptedDevices], (limits, accepted) => {
|
|
826
|
+
const { counts } = accepted;
|
|
827
|
+
return Object.entries(limits).filter(([, limit]) => limit !== 0).map(([type, limit]) => ({
|
|
828
|
+
type,
|
|
829
|
+
limit,
|
|
830
|
+
total: counts[type] || 0
|
|
831
|
+
}));
|
|
832
|
+
});
|
|
878
833
|
var getDeviceTypes = (0, import_toolkit3.createSelector)(
|
|
879
834
|
[getAcceptedDevices, getDevicesById],
|
|
880
835
|
({ deviceIds = [] }, devicesById) => Object.keys(
|