@northern.tech/store 0.29.0 → 0.30.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 +0 -1
- package/dist/actions.cjs.map +1 -1
- package/dist/actions.js +9 -9
- package/dist/api/general-api.cjs.map +1 -1
- package/dist/api/general-api.js +3 -3
- package/dist/api/users-api.cjs.map +1 -1
- package/dist/api/users-api.js +4 -4
- package/dist/appSlice/index.cjs +0 -1
- package/dist/appSlice/index.cjs.map +1 -1
- package/dist/appSlice/index.js +2 -2
- package/dist/appSlice/mocks.cjs +0 -1
- package/dist/appSlice/mocks.cjs.map +1 -1
- package/dist/appSlice/mocks.js +2 -2
- package/dist/appSlice/thunks.cjs +25 -31
- package/dist/appSlice/thunks.cjs.map +1 -1
- package/dist/appSlice/thunks.js +24 -24
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.js +2 -2
- package/dist/{chunk-2QIGK5IU.js → chunk-4UNLEL5A.js} +2 -2
- package/dist/{chunk-4573DUCR.js → chunk-6V5IIIF7.js} +2 -2
- package/dist/{chunk-Z4QLZNAN.js → chunk-ARMI6SZS.js} +13 -15
- package/dist/chunk-ARMI6SZS.js.map +1 -0
- package/dist/{chunk-KEQAPMP6.js → chunk-AZF4YY3P.js} +10 -12
- package/dist/chunk-AZF4YY3P.js.map +1 -0
- package/dist/{chunk-GX3X2E57.js → chunk-B5AI2YPV.js} +2 -3
- package/dist/chunk-B5AI2YPV.js.map +1 -0
- package/dist/{chunk-WXRYJOL3.js → chunk-ECVQVQEL.js} +2 -2
- package/dist/{chunk-FXPRG4WH.js → chunk-FCY7BUGK.js} +40 -39
- package/dist/chunk-FCY7BUGK.js.map +1 -0
- package/dist/{chunk-525LX7VL.js → chunk-FG37HJLC.js} +2 -2
- package/dist/{chunk-SDHCQ62K.js → chunk-FQAUVV6C.js} +2 -2
- package/dist/{chunk-5OLM3HEG.js → chunk-HKN3RN2Z.js} +8 -8
- package/dist/{chunk-XHLNGIAP.js → chunk-HPKXWNEF.js} +2 -2
- package/dist/{chunk-QX67O5A2.js → chunk-JXBTIFMS.js} +3 -3
- package/dist/{chunk-VK6FVQ5K.js → chunk-JYPSCCT4.js} +3 -3
- package/dist/{chunk-CMXRPUOF.js → chunk-L53CPHJU.js} +1 -3
- package/dist/chunk-L53CPHJU.js.map +1 -0
- package/dist/{chunk-4BUO44SS.js → chunk-MNJXEB7S.js} +11 -23
- package/dist/chunk-MNJXEB7S.js.map +1 -0
- package/dist/{chunk-UE2EPKRU.js → chunk-NXLXPRYW.js} +11 -11
- package/dist/{chunk-FAKWYYOB.js → chunk-O6VCSLNE.js} +2 -2
- package/dist/{chunk-LSAJE3IU.js → chunk-PQADM3M3.js} +2 -2
- package/dist/{chunk-VLII64V6.js → chunk-SJ75YKOA.js} +2 -2
- package/dist/{chunk-66LI4BJO.js → chunk-TUPBZ6MQ.js} +2 -2
- package/dist/{chunk-SDWPOLHM.js → chunk-XF3TZSZS.js} +3 -3
- package/dist/{chunk-HVZ5BOM6.js → chunk-YB3US6OT.js} +2 -2
- package/dist/{chunk-UBFFGYQ4.js → chunk-YDDE5TIH.js} +2 -2
- package/dist/{chunk-4YLOOOZH.js → chunk-Z2O6LYVP.js} +2 -2
- package/dist/commonConstants.cjs.map +1 -1
- package/dist/commonConstants.js +1 -1
- package/dist/commonSelectors.cjs +3 -15
- package/dist/commonSelectors.cjs.map +1 -1
- package/dist/commonSelectors.d.cts +6 -66
- package/dist/commonSelectors.d.ts +6 -66
- package/dist/commonSelectors.js +8 -12
- package/dist/constants.cjs +0 -2
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -3
- package/dist/deploymentsSlice/constants.cjs.map +1 -1
- package/dist/deploymentsSlice/constants.js +1 -1
- package/dist/deploymentsSlice/index.cjs.map +1 -1
- package/dist/deploymentsSlice/index.js +2 -2
- package/dist/deploymentsSlice/mocks.cjs.map +1 -1
- package/dist/deploymentsSlice/mocks.js +2 -2
- package/dist/deploymentsSlice/selectors.cjs.map +1 -1
- package/dist/deploymentsSlice/selectors.js +2 -2
- package/dist/deploymentsSlice/thunks.cjs +25 -31
- package/dist/deploymentsSlice/thunks.cjs.map +1 -1
- package/dist/deploymentsSlice/thunks.js +24 -24
- package/dist/devicesSlice/constants.cjs.map +1 -1
- package/dist/devicesSlice/constants.js +1 -1
- package/dist/devicesSlice/index.cjs.map +1 -1
- package/dist/devicesSlice/index.js +2 -2
- package/dist/devicesSlice/mocks.cjs.map +1 -1
- package/dist/devicesSlice/mocks.js +2 -2
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.js +2 -2
- package/dist/devicesSlice/thunks.cjs +25 -31
- package/dist/devicesSlice/thunks.cjs.map +1 -1
- package/dist/devicesSlice/thunks.js +24 -24
- package/dist/liststatehook.cjs.map +1 -1
- package/dist/liststatehook.js +2 -2
- package/dist/locationutils.cjs.map +1 -1
- package/dist/locationutils.js +2 -2
- package/dist/monitorSlice/index.cjs.map +1 -1
- package/dist/monitorSlice/index.js +2 -2
- package/dist/monitorSlice/mocks.cjs +0 -1
- package/dist/monitorSlice/mocks.cjs.map +1 -1
- package/dist/monitorSlice/mocks.d.cts +0 -4
- package/dist/monitorSlice/mocks.d.ts +0 -4
- package/dist/monitorSlice/mocks.js +2 -3
- package/dist/monitorSlice/mocks.js.map +1 -1
- package/dist/monitorSlice/thunks.cjs +29 -628
- package/dist/monitorSlice/thunks.cjs.map +1 -1
- package/dist/monitorSlice/thunks.js +20 -20
- package/dist/onboardingSlice/thunks.cjs +25 -31
- package/dist/onboardingSlice/thunks.cjs.map +1 -1
- package/dist/onboardingSlice/thunks.js +24 -24
- package/dist/organizationSlice/constants.cjs.map +1 -1
- package/dist/organizationSlice/constants.js +1 -1
- package/dist/organizationSlice/index.cjs.map +1 -1
- package/dist/organizationSlice/index.js +2 -2
- package/dist/organizationSlice/mocks.cjs.map +1 -1
- package/dist/organizationSlice/mocks.js +2 -2
- package/dist/organizationSlice/selectors.cjs.map +1 -1
- package/dist/organizationSlice/selectors.js +2 -2
- package/dist/organizationSlice/thunks.cjs +25 -31
- package/dist/organizationSlice/thunks.cjs.map +1 -1
- package/dist/organizationSlice/thunks.js +24 -24
- package/dist/releasesSlice/index.cjs.map +1 -1
- package/dist/releasesSlice/index.js +2 -2
- package/dist/releasesSlice/mocks.cjs.map +1 -1
- package/dist/releasesSlice/mocks.js +2 -2
- package/dist/releasesSlice/selectors.cjs.map +1 -1
- package/dist/releasesSlice/selectors.js +3 -3
- package/dist/releasesSlice/thunks.cjs +99 -795
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.js +16 -25
- package/dist/selectors.cjs +3 -15
- 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 +8 -12
- package/dist/sockethook.cjs.map +1 -1
- package/dist/sockethook.js +1 -1
- package/dist/store.cjs +0 -1
- package/dist/store.cjs.map +1 -1
- package/dist/store.js +11 -11
- package/dist/storehooks.cjs +27 -34
- package/dist/storehooks.cjs.map +1 -1
- package/dist/storehooks.js +24 -25
- package/dist/storehooks.js.map +1 -1
- package/dist/thunks.cjs +27 -33
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.js +24 -24
- package/dist/useDeploymentDevice.cjs +25 -31
- package/dist/useDeploymentDevice.cjs.map +1 -1
- package/dist/useDeploymentDevice.js +24 -24
- package/dist/usersSlice/constants.cjs.map +1 -1
- package/dist/usersSlice/constants.js +1 -1
- package/dist/usersSlice/index.cjs.map +1 -1
- package/dist/usersSlice/index.js +2 -2
- package/dist/usersSlice/mocks.cjs.map +1 -1
- package/dist/usersSlice/mocks.js +2 -2
- package/dist/usersSlice/selectors.cjs.map +1 -1
- package/dist/usersSlice/selectors.js +3 -3
- package/dist/usersSlice/thunks.cjs +25 -31
- package/dist/usersSlice/thunks.cjs.map +1 -1
- package/dist/usersSlice/thunks.js +24 -24
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-4BUO44SS.js.map +0 -1
- package/dist/chunk-CMXRPUOF.js.map +0 -1
- package/dist/chunk-FXPRG4WH.js.map +0 -1
- package/dist/chunk-GX3X2E57.js.map +0 -1
- package/dist/chunk-KEQAPMP6.js.map +0 -1
- package/dist/chunk-Z4QLZNAN.js.map +0 -1
- /package/dist/{chunk-2QIGK5IU.js.map → chunk-4UNLEL5A.js.map} +0 -0
- /package/dist/{chunk-4573DUCR.js.map → chunk-6V5IIIF7.js.map} +0 -0
- /package/dist/{chunk-WXRYJOL3.js.map → chunk-ECVQVQEL.js.map} +0 -0
- /package/dist/{chunk-525LX7VL.js.map → chunk-FG37HJLC.js.map} +0 -0
- /package/dist/{chunk-SDHCQ62K.js.map → chunk-FQAUVV6C.js.map} +0 -0
- /package/dist/{chunk-5OLM3HEG.js.map → chunk-HKN3RN2Z.js.map} +0 -0
- /package/dist/{chunk-XHLNGIAP.js.map → chunk-HPKXWNEF.js.map} +0 -0
- /package/dist/{chunk-QX67O5A2.js.map → chunk-JXBTIFMS.js.map} +0 -0
- /package/dist/{chunk-VK6FVQ5K.js.map → chunk-JYPSCCT4.js.map} +0 -0
- /package/dist/{chunk-UE2EPKRU.js.map → chunk-NXLXPRYW.js.map} +0 -0
- /package/dist/{chunk-FAKWYYOB.js.map → chunk-O6VCSLNE.js.map} +0 -0
- /package/dist/{chunk-LSAJE3IU.js.map → chunk-PQADM3M3.js.map} +0 -0
- /package/dist/{chunk-VLII64V6.js.map → chunk-SJ75YKOA.js.map} +0 -0
- /package/dist/{chunk-66LI4BJO.js.map → chunk-TUPBZ6MQ.js.map} +0 -0
- /package/dist/{chunk-SDWPOLHM.js.map → chunk-XF3TZSZS.js.map} +0 -0
- /package/dist/{chunk-HVZ5BOM6.js.map → chunk-YB3US6OT.js.map} +0 -0
- /package/dist/{chunk-UBFFGYQ4.js.map → chunk-YDDE5TIH.js.map} +0 -0
- /package/dist/{chunk-4YLOOOZH.js.map → chunk-Z2O6LYVP.js.map} +0 -0
|
@@ -53,7 +53,7 @@ __export(thunks_exports, {
|
|
|
53
53
|
uploadArtifact: () => uploadArtifact
|
|
54
54
|
});
|
|
55
55
|
module.exports = __toCommonJS(thunks_exports);
|
|
56
|
-
var
|
|
56
|
+
var import_helpers5 = require("@northern.tech/utils/helpers");
|
|
57
57
|
var import_axios2 = require("axios");
|
|
58
58
|
var import_uuid = require("uuid");
|
|
59
59
|
|
|
@@ -63,96 +63,6 @@ var import_toolkit = require("@reduxjs/toolkit");
|
|
|
63
63
|
// src/constants.ts
|
|
64
64
|
var import_constants4 = require("@northern.tech/utils/constants");
|
|
65
65
|
|
|
66
|
-
// src/appSlice/constants.ts
|
|
67
|
-
var import_icons_material = require("@mui/icons-material");
|
|
68
|
-
var import_utils = require("@northern.tech/utils");
|
|
69
|
-
var chartTypes = {
|
|
70
|
-
bar: { key: "bar", Icon: import_icons_material.BarChart },
|
|
71
|
-
pie: { key: "pie", Icon: import_icons_material.PieChartOutline }
|
|
72
|
-
};
|
|
73
|
-
var emptyChartSelection = { software: "", group: "", chartType: chartTypes.bar.key, attribute: "artifact_name" };
|
|
74
|
-
var defaultReportType = "distribution";
|
|
75
|
-
var defaultReports = [{ ...emptyChartSelection, group: null, attribute: "artifact_name", type: defaultReportType }];
|
|
76
|
-
var PLANS = {
|
|
77
|
-
os: {
|
|
78
|
-
id: "os",
|
|
79
|
-
name: "Basic",
|
|
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
|
-
},
|
|
82
|
-
professional: {
|
|
83
|
-
id: "professional",
|
|
84
|
-
name: "Professional",
|
|
85
|
-
description: "Everything in Basic, plus enhanced update management and automation features."
|
|
86
|
-
},
|
|
87
|
-
enterprise: {
|
|
88
|
-
id: "enterprise",
|
|
89
|
-
name: "Enterprise",
|
|
90
|
-
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."
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
var ADDONS = {
|
|
94
|
-
configure: {
|
|
95
|
-
id: "configure",
|
|
96
|
-
title: "Configure",
|
|
97
|
-
description: "Seamlessly configure applications and devices remotely \u2013 configure each device to its environment.",
|
|
98
|
-
needs: ["hasDeviceConfig"],
|
|
99
|
-
eligible: ["os", "professional", "enterprise"]
|
|
100
|
-
},
|
|
101
|
-
monitor: {
|
|
102
|
-
id: "monitor",
|
|
103
|
-
title: "Monitor",
|
|
104
|
-
description: "Detect and analyze health issues of devices, services and applications. Set up alerts so you can act quickly.",
|
|
105
|
-
needs: ["hasMonitor"],
|
|
106
|
-
eligible: ["professional", "enterprise"]
|
|
107
|
-
},
|
|
108
|
-
troubleshoot: {
|
|
109
|
-
id: "troubleshoot",
|
|
110
|
-
title: "Troubleshoot",
|
|
111
|
-
description: "Secure, remote access to your devices \u2013 quickly diagnose and fix issues in real time.",
|
|
112
|
-
needs: ["hasDeviceConnect"],
|
|
113
|
-
eligible: ["os", "professional", "enterprise"]
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
var BENEFITS = {
|
|
117
|
-
auditlog: {
|
|
118
|
-
id: "auditlog",
|
|
119
|
-
benefit: "gain access to logs for important events such as changes to devices, deployments and user management, as well as remote terminal session replays",
|
|
120
|
-
requiredPlan: PLANS.enterprise.id
|
|
121
|
-
},
|
|
122
|
-
dashboard: { id: "dashboard", benefit: "actionable insights into the devices you are updating with Mender", requiredPlan: PLANS.enterprise.id },
|
|
123
|
-
deltaGeneration: {
|
|
124
|
-
id: "deltaGeneration",
|
|
125
|
-
benefit: "automatic delta artifacts generation to minimize data transfer and improve the update delivery",
|
|
126
|
-
requiredPlan: PLANS.enterprise.id
|
|
127
|
-
},
|
|
128
|
-
deviceConfiguration: { id: "deviceConfiguration", benefit: "device configuration features", requiredAddon: ADDONS.configure.id },
|
|
129
|
-
deviceMonitor: { id: "deviceMonitor", benefit: "device monitoring features", requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },
|
|
130
|
-
deviceTroubleshoot: { id: "deviceTroubleshoot", benefit: "device troubleshooting features", requiredAddon: ADDONS.troubleshoot.id },
|
|
131
|
-
dynamicGroups: { id: "dynamicGroups", benefit: "create dynamic groups to ease device management", requiredPlan: PLANS.enterprise.id },
|
|
132
|
-
fullFiltering: { id: "fullFiltering", benefit: "filtering by multiple attributes to improve the device overview", requiredPlan: PLANS.professional.id },
|
|
133
|
-
gateway: { id: "gateway", benefit: "see devices connected to your gateway device for easy access", requiredPlans: PLANS.professional.id },
|
|
134
|
-
pausedDeployments: {
|
|
135
|
-
id: "pausedDeployments",
|
|
136
|
-
benefit: "granular control about update rollout to allow synchronization across your fleet",
|
|
137
|
-
requiredPlan: PLANS.enterprise.id
|
|
138
|
-
},
|
|
139
|
-
phasedDeployments: { id: "phasedDeployments", benefit: "choose to roll out deployments in multiple phases", requiredPlan: PLANS.enterprise.id },
|
|
140
|
-
rbac: { id: "rbac", benefit: "granular role based access control", requiredPlan: PLANS.enterprise.id },
|
|
141
|
-
retryDeployments: { id: "retryDeployments", benefit: "optional retries for failed rollout attempts", requiredPlan: PLANS.professional.id },
|
|
142
|
-
scheduledDeployments: {
|
|
143
|
-
id: "scheduledDeployments",
|
|
144
|
-
benefit: "scheduled deployments to steer the distribution of your updates.",
|
|
145
|
-
requiredPlan: PLANS.professional.id
|
|
146
|
-
},
|
|
147
|
-
webhookEvents: {
|
|
148
|
-
id: "webhookEvents",
|
|
149
|
-
benefit: "receive inventory events and select which type(s) of events the webhook will receive",
|
|
150
|
-
requiredPlan: PLANS.professional.id
|
|
151
|
-
},
|
|
152
|
-
default: { id: "default", benefit: "gain access to this feature", requiredPlan: PLANS.enterprise.id }
|
|
153
|
-
};
|
|
154
|
-
var DARK_MODE = "dark";
|
|
155
|
-
|
|
156
66
|
// src/commonConstants.tsx
|
|
157
67
|
var import_js = require("@mdi/js");
|
|
158
68
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -161,7 +71,6 @@ var timeUnits = {
|
|
|
161
71
|
minutes: "minutes",
|
|
162
72
|
hours: "hours"
|
|
163
73
|
};
|
|
164
|
-
var UNGROUPED_GROUP = { id: "*|=ungrouped=|*", name: "Unassigned" };
|
|
165
74
|
var DEVICE_LIST_MAXIMUM_LENGTH = 50;
|
|
166
75
|
var oneSecond = 1e3;
|
|
167
76
|
var TIMEOUTS = {
|
|
@@ -177,7 +86,6 @@ var TIMEOUTS = {
|
|
|
177
86
|
};
|
|
178
87
|
var DEVICE_ONLINE_CUTOFF = { interval: 1, intervalName: timeUnits.days };
|
|
179
88
|
var defaultIdAttribute = Object.freeze({ attribute: "id", scope: import_constants4.ATTRIBUTE_SCOPES.identity });
|
|
180
|
-
var productOrder = ["micro", "standard", "system"];
|
|
181
89
|
var credentialTypes = {
|
|
182
90
|
aws: "aws",
|
|
183
91
|
http: "http",
|
|
@@ -635,48 +543,6 @@ var pauseMap = {
|
|
|
635
543
|
var emptyFilter = { key: null, value: "", operator: import_constants4.DEVICE_FILTERING_OPTIONS.$eq.key, scope: "inventory" };
|
|
636
544
|
var geoAttributes = ["geo-lat", "geo-lon"].map((attribute) => ({ attribute, scope: "inventory" }));
|
|
637
545
|
|
|
638
|
-
// src/onboardingSlice/constants.ts
|
|
639
|
-
var onboardingSteps = {
|
|
640
|
-
ONBOARDING_START: "onboarding-start",
|
|
641
|
-
DEVICES_PENDING_ONBOARDING_START: "devices-pending-onboarding-start",
|
|
642
|
-
DASHBOARD_ONBOARDING_START: "dashboard-onboarding-start",
|
|
643
|
-
DASHBOARD_ONBOARDING_PENDINGS: "dashboard-onboarding-pendings",
|
|
644
|
-
DEVICES_DELAYED_ONBOARDING: "devices-delayed-onboarding",
|
|
645
|
-
DEVICES_PENDING_ONBOARDING: "devices-pending-onboarding",
|
|
646
|
-
DEVICES_ACCEPTED_ONBOARDING: "devices-accepted-onboarding",
|
|
647
|
-
DEVICES_PENDING_ACCEPTING_ONBOARDING: "devices-pending-accepting-onboarding",
|
|
648
|
-
DEVICES_DEPLOY_RELEASE_ONBOARDING: "devices-deploy-release-onboarding",
|
|
649
|
-
SCHEDULING_ARTIFACT_SELECTION: "scheduling-artifact-selection",
|
|
650
|
-
SCHEDULING_ALL_DEVICES_SELECTION: "scheduling-all-devices-selection",
|
|
651
|
-
SCHEDULING_GROUP_SELECTION: "scheduling-group-selection",
|
|
652
|
-
SCHEDULING_RELEASE_TO_DEVICES: "scheduling-release-to-devices",
|
|
653
|
-
DEPLOYMENTS_INPROGRESS: "deployments-inprogress",
|
|
654
|
-
DEPLOYMENTS_COMPLETED: "deployments-completed",
|
|
655
|
-
DEPLOYMENTS_PAST: "deployments-past",
|
|
656
|
-
DEPLOYMENTS_PAST_COMPLETED: "deployments-past-completed",
|
|
657
|
-
DEPLOYMENTS_PAST_COMPLETED_FAILURE: "deployments-past-completed-failure",
|
|
658
|
-
ONBOARDING_CANCELED: "onboarding-canceled"
|
|
659
|
-
};
|
|
660
|
-
var orderedOnboardingSteps = [
|
|
661
|
-
onboardingSteps.DASHBOARD_ONBOARDING_START,
|
|
662
|
-
onboardingSteps.DEVICES_PENDING_ONBOARDING_START,
|
|
663
|
-
onboardingSteps.DEVICES_DELAYED_ONBOARDING,
|
|
664
|
-
onboardingSteps.DEVICES_PENDING_ONBOARDING,
|
|
665
|
-
onboardingSteps.DEVICES_PENDING_ACCEPTING_ONBOARDING,
|
|
666
|
-
onboardingSteps.DASHBOARD_ONBOARDING_PENDINGS,
|
|
667
|
-
onboardingSteps.DEVICES_ACCEPTED_ONBOARDING,
|
|
668
|
-
onboardingSteps.DEVICES_DEPLOY_RELEASE_ONBOARDING,
|
|
669
|
-
onboardingSteps.SCHEDULING_ALL_DEVICES_SELECTION,
|
|
670
|
-
onboardingSteps.SCHEDULING_GROUP_SELECTION,
|
|
671
|
-
onboardingSteps.SCHEDULING_ARTIFACT_SELECTION,
|
|
672
|
-
onboardingSteps.SCHEDULING_RELEASE_TO_DEVICES,
|
|
673
|
-
onboardingSteps.DEPLOYMENTS_INPROGRESS,
|
|
674
|
-
onboardingSteps.DEPLOYMENTS_PAST,
|
|
675
|
-
onboardingSteps.DEPLOYMENTS_PAST_COMPLETED,
|
|
676
|
-
onboardingSteps.DEPLOYMENTS_PAST_COMPLETED_FAILURE,
|
|
677
|
-
onboardingSteps.ONBOARDING_CANCELED
|
|
678
|
-
];
|
|
679
|
-
|
|
680
546
|
// src/organizationSlice/constants.ts
|
|
681
547
|
var auditlogTypes = {
|
|
682
548
|
artifact: { title: "Artifact", queryParameter: "object_type", value: "artifact" },
|
|
@@ -883,7 +749,6 @@ var initialState2 = {
|
|
|
883
749
|
hasManifestsEnabled: false,
|
|
884
750
|
hasMonitor: false,
|
|
885
751
|
hasMCUEnabled: false,
|
|
886
|
-
hasReporting: false,
|
|
887
752
|
isHosted: true,
|
|
888
753
|
isEnterprise: false
|
|
889
754
|
},
|
|
@@ -1743,654 +1608,10 @@ var formatReleases = ({ pageState: { id, searchTerm, selectedTags = [], tab, typ
|
|
|
1743
1608
|
selectedTags.map((tag) => `tag=${tag}`)
|
|
1744
1609
|
).join("&");
|
|
1745
1610
|
|
|
1746
|
-
// src/appSlice/selectors.ts
|
|
1747
|
-
var import_helpers3 = require("@northern.tech/utils/helpers");
|
|
1748
|
-
var import_toolkit9 = require("@reduxjs/toolkit");
|
|
1749
|
-
var getFeatures = (state) => state.app.features;
|
|
1750
|
-
var getFullVersionInformation = (state) => state.app.versionInformation;
|
|
1751
|
-
var getSearchState = (state) => state.app.searchState;
|
|
1752
|
-
var getUploads = (state) => state.app.uploadsById;
|
|
1753
|
-
var getIsUploading = (0, import_toolkit9.createSelector)([getUploads], (uploadsById) => !!Object.keys(uploadsById).length);
|
|
1754
|
-
var getSearchedDevices = (0, import_toolkit9.createSelector)([getSearchState], ({ deviceIds }) => deviceIds);
|
|
1755
|
-
var getVersionInformation = (0, import_toolkit9.createSelector)(
|
|
1756
|
-
[getFullVersionInformation, getFeatures],
|
|
1757
|
-
({ Integration, ...remainder }, { isHosted }) => isHosted && Integration !== "next" ? remainder : { ...remainder, Integration }
|
|
1758
|
-
);
|
|
1759
|
-
var getIsPreview = (0, import_toolkit9.createSelector)([getFullVersionInformation], ({ Integration }) => (0, import_helpers3.versionCompare)(Integration, "next") > -1);
|
|
1760
|
-
|
|
1761
|
-
// src/commonSelectors.ts
|
|
1762
|
-
var import_helpers6 = require("@northern.tech/utils/helpers");
|
|
1763
|
-
var import_toolkit15 = require("@reduxjs/toolkit");
|
|
1764
|
-
var import_dayjs = __toESM(require("dayjs"), 1);
|
|
1765
|
-
|
|
1766
|
-
// src/deploymentsSlice/selectors.ts
|
|
1767
|
-
var import_toolkit10 = require("@reduxjs/toolkit");
|
|
1768
|
-
var getDeploymentsById = (state) => state.deployments.byId;
|
|
1769
|
-
var getDeploymentsByStatus = (state) => state.deployments.byStatus;
|
|
1770
|
-
var getSelectedDeploymentDeviceIds = (state) => state.deployments.selectedDeviceIds;
|
|
1771
|
-
var getDeploymentsSelectionState = (state) => state.deployments.selectionState;
|
|
1772
|
-
var getDeploymentById = (0, import_toolkit10.createSelector)(
|
|
1773
|
-
[getDeploymentsById, (_, deploymentId) => deploymentId],
|
|
1774
|
-
(deploymentsById, deploymentId = "") => deploymentsById[deploymentId]
|
|
1775
|
-
);
|
|
1776
|
-
var getMappedDeploymentSelection = (0, import_toolkit10.createSelector)(
|
|
1777
|
-
[getDeploymentsSelectionState, (_, deploymentsState) => deploymentsState, getDeploymentsById],
|
|
1778
|
-
(selectionState, deploymentsState, deploymentsById) => {
|
|
1779
|
-
const { selection = [] } = selectionState[deploymentsState] ?? {};
|
|
1780
|
-
return selection.reduce((accu, id) => {
|
|
1781
|
-
if (deploymentsById[id]) {
|
|
1782
|
-
accu.push(deploymentsById[id]);
|
|
1783
|
-
}
|
|
1784
|
-
return accu;
|
|
1785
|
-
}, []);
|
|
1786
|
-
}
|
|
1787
|
-
);
|
|
1788
|
-
var relevantDeploymentStates = [DEPLOYMENT_STATES.pending, DEPLOYMENT_STATES.inprogress, DEPLOYMENT_STATES.finished];
|
|
1789
|
-
var DEPLOYMENT_CUTOFF = 3;
|
|
1790
|
-
var getRecentDeployments = (0, import_toolkit10.createSelector)(
|
|
1791
|
-
[getDeploymentsById, getDeploymentsByStatus],
|
|
1792
|
-
(deploymentsById, deploymentsByStatus) => Object.entries(deploymentsByStatus).reduce(
|
|
1793
|
-
(accu, [state, byStatus]) => {
|
|
1794
|
-
if (!relevantDeploymentStates.includes(state) || !byStatus.deploymentIds.length) {
|
|
1795
|
-
return accu;
|
|
1796
|
-
}
|
|
1797
|
-
accu[state] = byStatus.deploymentIds.reduce((accu2, id) => {
|
|
1798
|
-
if (deploymentsById[id]) {
|
|
1799
|
-
accu2.push(deploymentsById[id]);
|
|
1800
|
-
}
|
|
1801
|
-
return accu2;
|
|
1802
|
-
}, []).slice(0, DEPLOYMENT_CUTOFF);
|
|
1803
|
-
accu.total += byStatus.total;
|
|
1804
|
-
return accu;
|
|
1805
|
-
},
|
|
1806
|
-
{ total: 0 }
|
|
1807
|
-
)
|
|
1808
|
-
);
|
|
1809
|
-
|
|
1810
|
-
// src/devicesSlice/selectors.ts
|
|
1811
|
-
var import_helpers4 = require("@northern.tech/utils/helpers");
|
|
1812
|
-
var import_toolkit11 = require("@reduxjs/toolkit");
|
|
1813
|
-
var getAcceptedDevices = (state) => state.devices.byStatus.accepted;
|
|
1814
|
-
var getDevicesByStatus = (state) => state.devices.byStatus;
|
|
1815
|
-
var getDevicesById = (state) => state.devices.byId;
|
|
1816
|
-
var getGroupsById = (state) => state.devices.groups.byId;
|
|
1817
|
-
var getSelectedGroup = (state) => state.devices.groups.selectedGroup;
|
|
1818
|
-
var getListedDevices = (state) => state.devices.deviceList.deviceIds;
|
|
1819
|
-
var getFilteringAttributes = (state) => state.devices.filteringAttributes;
|
|
1820
|
-
var getFilteringAttributesFromConfig = (state) => state.devices.filteringAttributesConfig.attributes;
|
|
1821
|
-
var getSortedFilteringAttributes = (0, import_toolkit11.createSelector)([getFilteringAttributes], (filteringAttributes) => ({
|
|
1822
|
-
...filteringAttributes,
|
|
1823
|
-
identityAttributes: [...filteringAttributes.identityAttributes, "id"]
|
|
1824
|
-
}));
|
|
1825
|
-
var getDeviceLimits = (state) => state.devices.limits;
|
|
1826
|
-
var getFilteringAttributesLimit = (state) => state.devices.filteringAttributesLimit;
|
|
1827
|
-
var getDeviceIdentityAttributes = (0, import_toolkit11.createSelector)(
|
|
1828
|
-
[getFilteringAttributes, getFilteringAttributesLimit],
|
|
1829
|
-
({ identityAttributes }, filteringAttributesLimit) => {
|
|
1830
|
-
const attributes = identityAttributes.slice(0, filteringAttributesLimit);
|
|
1831
|
-
return attributes.reduce(
|
|
1832
|
-
(accu, value) => {
|
|
1833
|
-
accu.push({ value, label: value, scope: "identity" });
|
|
1834
|
-
return accu;
|
|
1835
|
-
},
|
|
1836
|
-
[
|
|
1837
|
-
{ value: "name", label: "Name", scope: "tags" },
|
|
1838
|
-
{ value: "id", label: "Device ID", scope: "identity" }
|
|
1839
|
-
]
|
|
1840
|
-
);
|
|
1841
|
-
}
|
|
1842
|
-
);
|
|
1843
|
-
var getDeviceCountsByStatus = (0, import_toolkit11.createSelector)(
|
|
1844
|
-
[getDevicesByStatus],
|
|
1845
|
-
(byStatus) => Object.values(import_constants4.DEVICE_STATES).reduce(
|
|
1846
|
-
(accu, deviceState) => {
|
|
1847
|
-
const { counts } = byStatus[deviceState];
|
|
1848
|
-
const { total, ...tieredCounts } = counts;
|
|
1849
|
-
const count = Object.values(tieredCounts).reduce((accu2, countPerTier) => accu2 + countPerTier, 0);
|
|
1850
|
-
accu[deviceState] = count;
|
|
1851
|
-
accu.total = accu.total + count;
|
|
1852
|
-
return accu;
|
|
1853
|
-
},
|
|
1854
|
-
{ total: 0 }
|
|
1855
|
-
)
|
|
1856
|
-
);
|
|
1857
|
-
var getDeviceById = (0, import_toolkit11.createSelector)([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = "") => devicesById[deviceId] ?? {});
|
|
1858
|
-
var getSelectedGroupInfo = (0, import_toolkit11.createSelector)(
|
|
1859
|
-
[getDeviceCountsByStatus, getGroupsById, getSelectedGroup],
|
|
1860
|
-
({ accepted: acceptedDeviceTotal }, groupsById, selectedGroup) => {
|
|
1861
|
-
let groupCount = acceptedDeviceTotal;
|
|
1862
|
-
let groupFilters = [];
|
|
1863
|
-
if (selectedGroup && groupsById[selectedGroup]) {
|
|
1864
|
-
groupCount = groupsById[selectedGroup].total || 0;
|
|
1865
|
-
groupFilters = groupsById[selectedGroup].filters || [];
|
|
1866
|
-
}
|
|
1867
|
-
return { groupCount, selectedGroup, groupFilters };
|
|
1868
|
-
}
|
|
1869
|
-
);
|
|
1870
|
-
var getCombinedLimit = (0, import_toolkit11.createSelector)(
|
|
1871
|
-
[getDeviceLimits],
|
|
1872
|
-
(deviceLimits) => Object.values(deviceLimits).reduce((accu, limit) => accu + Math.max(limit ?? 0, 0), 0)
|
|
1873
|
-
// limit might be -1 for unlimited devices
|
|
1874
|
-
);
|
|
1875
|
-
var getLimitMaxed = (0, import_toolkit11.createSelector)(
|
|
1876
|
-
[getDeviceCountsByStatus, getCombinedLimit],
|
|
1877
|
-
({ accepted: acceptedDevices }, combinedLimit) => !!combinedLimit && combinedLimit <= acceptedDevices
|
|
1878
|
-
);
|
|
1879
|
-
var getGroupsByIdWithoutUngrouped = (0, import_toolkit11.createSelector)([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);
|
|
1880
|
-
var getGroupData = (0, import_toolkit11.createSelector)([getGroupsByIdWithoutUngrouped], (groups) => {
|
|
1881
|
-
const createdGroup = Object.keys(groups).length ? Object.keys(groups)[0] : void 0;
|
|
1882
|
-
const hasDynamicGroups = Object.values(groups).some((group) => !!group.id);
|
|
1883
|
-
return { createdGroup, hasDynamicGroups, groups };
|
|
1884
|
-
});
|
|
1885
|
-
var getGroups = (0, import_toolkit11.createSelector)([getGroupsById], (groupsById) => {
|
|
1886
|
-
const groupNames = Object.keys(groupsById).sort();
|
|
1887
|
-
const groupedGroups = Object.entries(groupsById).sort((a, b) => a[0].localeCompare(b[0])).reduce(
|
|
1888
|
-
(accu, [groupname, group]) => {
|
|
1889
|
-
const name = groupname === UNGROUPED_GROUP.id ? UNGROUPED_GROUP.name : groupname;
|
|
1890
|
-
const groupItem = { ...group, groupId: name, name: groupname };
|
|
1891
|
-
if ((group.filters ?? []).length > 0) {
|
|
1892
|
-
if (groupname !== UNGROUPED_GROUP.id) {
|
|
1893
|
-
accu.dynamic.push(groupItem);
|
|
1894
|
-
} else {
|
|
1895
|
-
accu.ungrouped.push(groupItem);
|
|
1896
|
-
}
|
|
1897
|
-
} else {
|
|
1898
|
-
accu.static.push(groupItem);
|
|
1899
|
-
}
|
|
1900
|
-
return accu;
|
|
1901
|
-
},
|
|
1902
|
-
{ dynamic: [], static: [], ungrouped: [] }
|
|
1903
|
-
);
|
|
1904
|
-
return { groupNames, ...groupedGroups };
|
|
1905
|
-
});
|
|
1906
|
-
var getAttributesList = (0, import_toolkit11.createSelector)(
|
|
1907
|
-
[getFilteringAttributes, getFilteringAttributesFromConfig],
|
|
1908
|
-
({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) => [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(import_helpers4.duplicateFilter)
|
|
1909
|
-
);
|
|
1910
|
-
var getEnabledTierLimits = (0, import_toolkit11.createSelector)([getDeviceLimits], (limits) => Object.entries(limits).filter(([, limit]) => limit !== 0));
|
|
1911
|
-
var getEnabledTiers = (0, import_toolkit11.createSelector)([getEnabledTierLimits], (enabledTierLimits) => enabledTierLimits.map(([type]) => type));
|
|
1912
|
-
var getDeviceLimitStats = (0, import_toolkit11.createSelector)([getEnabledTierLimits, getAcceptedDevices], (enabledTierLimits, accepted) => {
|
|
1913
|
-
const { counts } = accepted;
|
|
1914
|
-
return enabledTierLimits.map(([type, limit]) => ({
|
|
1915
|
-
type,
|
|
1916
|
-
limit,
|
|
1917
|
-
total: counts[type] || 0
|
|
1918
|
-
}));
|
|
1919
|
-
});
|
|
1920
|
-
var getDeviceTypes = (0, import_toolkit11.createSelector)(
|
|
1921
|
-
[getAcceptedDevices, getDevicesById],
|
|
1922
|
-
({ deviceIds = [] }, devicesById) => Object.keys(
|
|
1923
|
-
deviceIds.slice(0, 200).reduce((accu, item) => {
|
|
1924
|
-
const { device_type: deviceTypes = [] } = devicesById[item] ? devicesById[item].attributes : {};
|
|
1925
|
-
accu = deviceTypes.reduce((deviceTypeAccu, deviceType) => {
|
|
1926
|
-
if (deviceType.length > 1) {
|
|
1927
|
-
deviceTypeAccu[deviceType] = deviceTypeAccu[deviceType] ? deviceTypeAccu[deviceType] + 1 : 1;
|
|
1928
|
-
}
|
|
1929
|
-
return deviceTypeAccu;
|
|
1930
|
-
}, accu);
|
|
1931
|
-
return accu;
|
|
1932
|
-
}, {})
|
|
1933
|
-
)
|
|
1934
|
-
);
|
|
1935
|
-
|
|
1936
|
-
// src/monitorSlice/selectors.ts
|
|
1937
|
-
var getIssueCountsByType = (state) => state.monitor.issueCounts.byType;
|
|
1938
|
-
|
|
1939
|
-
// src/onboardingSlice/selectors.ts
|
|
1940
|
-
var getOnboarding = (state) => state.onboarding;
|
|
1941
|
-
|
|
1942
|
-
// src/organizationSlice/selectors.ts
|
|
1943
|
-
var import_toolkit12 = require("@reduxjs/toolkit");
|
|
1944
|
-
var getOrganization = (state) => state.organization.organization;
|
|
1945
|
-
var getExternalIntegrations = (state) => state.organization.externalDeviceIntegrations;
|
|
1946
|
-
var getAuditLog = (state) => state.organization.auditlog.events;
|
|
1947
|
-
var getAuditLogSelectionState = (state) => state.organization.auditlog.selectionState;
|
|
1948
|
-
var getTenantsList = (state) => state.organization.tenantList;
|
|
1949
|
-
var getWebhookEvents = (state) => state.organization.webhooks.events;
|
|
1950
|
-
var getWebhookEventTotal = (state) => state.organization.webhooks.eventsTotal;
|
|
1951
|
-
var getDeviceTwinIntegrations = (0, import_toolkit12.createSelector)(
|
|
1952
|
-
[getExternalIntegrations],
|
|
1953
|
-
(integrations) => integrations.filter((integration) => integration.id && EXTERNAL_PROVIDER[integration.provider]?.deviceTwin)
|
|
1954
|
-
);
|
|
1955
|
-
var getIsServiceProvider = (state) => state.organization.organization.service_provider;
|
|
1956
|
-
var getWebhooks = (0, import_toolkit12.createSelector)(
|
|
1957
|
-
[getExternalIntegrations],
|
|
1958
|
-
(integrations) => integrations.filter((integration) => integration.id && integration.provider === EXTERNAL_PROVIDER.webhook.provider)
|
|
1959
|
-
);
|
|
1960
|
-
var getWebhookEventInfo = (0, import_toolkit12.createSelector)(
|
|
1961
|
-
[getWebhooks, getWebhookEvents, getWebhookEventTotal],
|
|
1962
|
-
(webhooks, events, eventTotal) => webhooks.length ? { events, eventTotal } : { events: [], eventTotal: 0 }
|
|
1963
|
-
);
|
|
1964
|
-
var getAuditLogEntry = (0, import_toolkit12.createSelector)([getAuditLog, getAuditLogSelectionState], (events, { selectedId }) => {
|
|
1965
|
-
if (!selectedId) {
|
|
1966
|
-
return;
|
|
1967
|
-
}
|
|
1968
|
-
const [eventAction, eventTime] = atob(selectedId).split("|");
|
|
1969
|
-
return events.find((item) => item.action === eventAction && item.time === eventTime);
|
|
1970
|
-
});
|
|
1971
|
-
var toTierName = (key) => key.replace(/max_|_?devices/g, "") || "standard";
|
|
1972
|
-
var processDeviceLimits = (deviceLimits, skipFilter = false) => {
|
|
1973
|
-
const result = { limits: {}, disabled: [] };
|
|
1974
|
-
if (!deviceLimits) return result;
|
|
1975
|
-
const tiersByName = Object.fromEntries(Object.entries(deviceLimits).map(([key, limit]) => [toTierName(key), { key, limit }]));
|
|
1976
|
-
return productOrder.reduce((accu, tierName) => {
|
|
1977
|
-
const entry = tiersByName[tierName];
|
|
1978
|
-
if (!entry) return accu;
|
|
1979
|
-
const { key, limit } = entry;
|
|
1980
|
-
if (limit.value === 0) {
|
|
1981
|
-
accu.disabled.push(tierName);
|
|
1982
|
-
if (!skipFilter) return accu;
|
|
1983
|
-
}
|
|
1984
|
-
accu.limits[tierName] = {
|
|
1985
|
-
id: tierName,
|
|
1986
|
-
backendId: key,
|
|
1987
|
-
limit: limit.value,
|
|
1988
|
-
current: limit.current_value,
|
|
1989
|
-
name: tierName,
|
|
1990
|
-
quotaLeft: Math.max(limit.value - limit.current_value, 0),
|
|
1991
|
-
limitReached: limit.value !== -1 && limit.value <= limit.current_value
|
|
1992
|
-
};
|
|
1993
|
-
return accu;
|
|
1994
|
-
}, result);
|
|
1995
|
-
};
|
|
1996
|
-
var getDeviceLimitsInfo = (0, import_toolkit12.createSelector)([getOrganization], ({ device_limits }) => processDeviceLimits(device_limits));
|
|
1997
|
-
var getDisabledTiers = (0, import_toolkit12.createSelector)([getDeviceLimitsInfo], ({ disabled }) => disabled);
|
|
1998
|
-
var getSpLimits = (0, import_toolkit12.createSelector)([getDeviceLimitsInfo], ({ limits }) => limits);
|
|
1999
|
-
var getTenantListWithLimits = (0, import_toolkit12.createSelector)([getTenantsList], (tenantList) => ({
|
|
2000
|
-
...tenantList,
|
|
2001
|
-
tenants: tenantList.tenants.map((tenant) => ({
|
|
2002
|
-
...tenant,
|
|
2003
|
-
device_limits: processDeviceLimits(tenant.device_limits, true).limits
|
|
2004
|
-
}))
|
|
2005
|
-
}));
|
|
2006
|
-
|
|
2007
|
-
// src/releasesSlice/selectors.ts
|
|
2008
|
-
var import_toolkit13 = require("@reduxjs/toolkit");
|
|
2009
|
-
|
|
2010
|
-
// src/utils.ts
|
|
2011
|
-
var import_helpers5 = require("@northern.tech/utils/helpers");
|
|
2012
|
-
var filterProcessors = {
|
|
2013
|
-
[import_constants4.DEVICE_FILTERING_OPTIONS.$gt.key]: (val) => Number(val) || val,
|
|
2014
|
-
[import_constants4.DEVICE_FILTERING_OPTIONS.$gte.key]: (val) => Number(val) || val,
|
|
2015
|
-
[import_constants4.DEVICE_FILTERING_OPTIONS.$lt.key]: (val) => Number(val) || val,
|
|
2016
|
-
[import_constants4.DEVICE_FILTERING_OPTIONS.$lte.key]: (val) => Number(val) || val,
|
|
2017
|
-
[import_constants4.DEVICE_FILTERING_OPTIONS.$ltne.key]: (val) => Number(val) || val,
|
|
2018
|
-
[import_constants4.DEVICE_FILTERING_OPTIONS.$in.key]: (val) => ("" + val).split(",").map((i) => i.trim()),
|
|
2019
|
-
[import_constants4.DEVICE_FILTERING_OPTIONS.$nin.key]: (val) => ("" + val).split(",").map((i) => i.trim()),
|
|
2020
|
-
[import_constants4.DEVICE_FILTERING_OPTIONS.$exists.key]: import_helpers5.yes,
|
|
2021
|
-
[import_constants4.DEVICE_FILTERING_OPTIONS.$nexists.key]: () => false
|
|
2022
|
-
};
|
|
2023
|
-
var filterAliases = {
|
|
2024
|
-
$nexists: { alias: import_constants4.DEVICE_FILTERING_OPTIONS.$exists.key, value: false }
|
|
2025
|
-
};
|
|
2026
|
-
var mapFiltersToTerms = (filters) => filters.map((filter) => ({
|
|
2027
|
-
scope: filter.scope,
|
|
2028
|
-
attribute: filter.key,
|
|
2029
|
-
type: filterAliases[filter.operator]?.alias || filter.operator,
|
|
2030
|
-
value: filterProcessors.hasOwnProperty(filter.operator) ? filterProcessors[filter.operator](filter.value) : filter.value
|
|
2031
|
-
}));
|
|
2032
|
-
var convertIssueOptionsToFilters = (issuesSelection, filtersState = {}) => issuesSelection.map((item) => {
|
|
2033
|
-
if (typeof import_constants4.DEVICE_ISSUE_OPTIONS[item].filterRule.value === "function") {
|
|
2034
|
-
return { ...import_constants4.DEVICE_ISSUE_OPTIONS[item].filterRule, value: import_constants4.DEVICE_ISSUE_OPTIONS[item].filterRule.value(filtersState) };
|
|
2035
|
-
}
|
|
2036
|
-
return import_constants4.DEVICE_ISSUE_OPTIONS[item].filterRule;
|
|
2037
|
-
});
|
|
2038
|
-
var convertDeviceListStateToFilters = ({
|
|
2039
|
-
filters = [],
|
|
2040
|
-
group,
|
|
2041
|
-
groups = { byId: {} },
|
|
2042
|
-
offlineThreshold,
|
|
2043
|
-
selectedIssues = [],
|
|
2044
|
-
status
|
|
2045
|
-
}) => {
|
|
2046
|
-
let applicableFilters = [...filters];
|
|
2047
|
-
if (typeof group === "string" && !(groups.byId[group]?.filters || applicableFilters).length) {
|
|
2048
|
-
applicableFilters.push({ key: "group", value: group, operator: import_constants4.DEVICE_FILTERING_OPTIONS.$eq.key, scope: "system" });
|
|
2049
|
-
}
|
|
2050
|
-
const nonMonitorFilters = applicableFilters.filter(
|
|
2051
|
-
(filter) => !Object.values(import_constants4.DEVICE_ISSUE_OPTIONS).some(
|
|
2052
|
-
({ filterRule }) => filter.scope !== "inventory" && filterRule.scope === filter.scope && filterRule.key === filter.key
|
|
2053
|
-
)
|
|
2054
|
-
);
|
|
2055
|
-
const deviceIssueFilters = convertIssueOptionsToFilters(selectedIssues, { offlineThreshold });
|
|
2056
|
-
applicableFilters = [...nonMonitorFilters, ...deviceIssueFilters];
|
|
2057
|
-
const effectiveFilters = status ? [...applicableFilters, { key: "status", value: status, operator: import_constants4.DEVICE_FILTERING_OPTIONS.$eq.key, scope: "identity" }] : applicableFilters;
|
|
2058
|
-
return { applicableFilters: nonMonitorFilters, filterTerms: mapFiltersToTerms(effectiveFilters) };
|
|
2059
|
-
};
|
|
2060
|
-
var listItemMapper = (byId, ids, { cutOffSize = DEVICE_LIST_MAXIMUM_LENGTH, defaultObject = {} }) => ids.slice(0, cutOffSize).reduce((accu, id) => {
|
|
2061
|
-
if (id && byId[id]) {
|
|
2062
|
-
accu.push({ ...defaultObject, ...byId[id] });
|
|
2063
|
-
}
|
|
2064
|
-
return accu;
|
|
2065
|
-
}, []);
|
|
2066
|
-
var mergePermissions = (existingPermissions = { ...import_constants4.emptyUiPermissions }, addedPermissions) => Object.entries(existingPermissions).reduce(
|
|
2067
|
-
(accu, [key, value]) => {
|
|
2068
|
-
let values;
|
|
2069
|
-
if (!accu[key]) {
|
|
2070
|
-
accu[key] = value;
|
|
2071
|
-
return accu;
|
|
2072
|
-
}
|
|
2073
|
-
if (Array.isArray(value)) {
|
|
2074
|
-
values = [...value, ...accu[key]].filter(import_helpers5.duplicateFilter);
|
|
2075
|
-
} else {
|
|
2076
|
-
values = mergePermissions(accu[key], { ...value });
|
|
2077
|
-
}
|
|
2078
|
-
accu[key] = values;
|
|
2079
|
-
return accu;
|
|
2080
|
-
},
|
|
2081
|
-
{ ...addedPermissions }
|
|
2082
|
-
);
|
|
2083
|
-
var mapUserRolesToUiPermissions = (userRoles, roles) => userRoles.reduce(
|
|
2084
|
-
(accu, roleId) => {
|
|
2085
|
-
if (!(roleId && roles[roleId])) {
|
|
2086
|
-
return accu;
|
|
2087
|
-
}
|
|
2088
|
-
return mergePermissions(accu, roles[roleId].uiPermissions);
|
|
2089
|
-
},
|
|
2090
|
-
{ ...import_constants4.emptyUiPermissions }
|
|
2091
|
-
);
|
|
2092
|
-
var progress = ({ loaded, total }) => {
|
|
2093
|
-
let uploadProgress3 = loaded / total * 100;
|
|
2094
|
-
return uploadProgress3 = uploadProgress3 < 50 ? Math.ceil(uploadProgress3) : Math.round(uploadProgress3);
|
|
2095
|
-
};
|
|
2096
|
-
var isDarkMode = (mode) => mode === DARK_MODE;
|
|
2097
|
-
|
|
2098
|
-
// src/releasesSlice/selectors.ts
|
|
2099
|
-
var getSelectedReleaseId = (state) => state.releases.selectedRelease;
|
|
2100
|
-
var getReleasesById = (state) => state.releases.byId;
|
|
2101
|
-
var getReleaseTags = (state) => state.releases.tags;
|
|
2102
|
-
var getReleaseListState = (state) => state.releases.releasesList;
|
|
2103
|
-
var getListedReleases = (state) => state.releases.releasesList.releaseIds;
|
|
2104
|
-
var releaseDefaults = {};
|
|
2105
|
-
var getReleaseMappingDefaults = () => releaseDefaults;
|
|
2106
|
-
var getReleasesList = (0, import_toolkit13.createSelector)([getReleasesById, getListedReleases, getReleaseMappingDefaults], listItemMapper);
|
|
2107
|
-
var getReleaseTagsById = (0, import_toolkit13.createSelector)([getReleaseTags], (releaseTags) => releaseTags.reduce((accu, key) => ({ ...accu, [key]: key }), {}));
|
|
2108
|
-
var getHasReleases = (0, import_toolkit13.createSelector)(
|
|
2109
|
-
[getReleaseListState, getReleasesById],
|
|
2110
|
-
({ searchTotal, total }, byId) => !!(Object.keys(byId).length || total || searchTotal)
|
|
2111
|
-
);
|
|
2112
|
-
var getSelectedRelease = (0, import_toolkit13.createSelector)([getReleasesById, getSelectedReleaseId], (byId, id) => byId[id || ""] ?? {});
|
|
2113
|
-
var getSelectedReleases = (0, import_toolkit13.createSelector)([getReleaseListState, getReleasesList], ({ selection }, releases) => selection.map((index) => releases[index]));
|
|
2114
|
-
var getDeltaJobsById = (state) => state.releases.deltaJobs;
|
|
2115
|
-
var getDeltaJobById = (0, import_toolkit13.createSelector)([getDeltaJobsById, (_, jobId) => jobId], (byId, jobId) => byId[jobId]);
|
|
2116
|
-
var getSelectedJobId = (state) => state.releases.selectedJob;
|
|
2117
|
-
var getSelectedJob = (0, import_toolkit13.createSelector)([getDeltaJobsById, getSelectedJobId], (byId, jobId) => byId[jobId || ""]);
|
|
2118
|
-
|
|
2119
|
-
// src/usersSlice/selectors.ts
|
|
2120
|
-
var import_toolkit14 = require("@reduxjs/toolkit");
|
|
2121
|
-
var emptyObject = {};
|
|
2122
|
-
var getRolesById = (state) => state.users.rolesById;
|
|
2123
|
-
var getTooltipsById = (state) => state.users.tooltips.byId;
|
|
2124
|
-
var getGlobalSettings = (state) => state.users.globalSettings;
|
|
2125
|
-
var getUserSettingsInitialized = (state) => state.users.userSettingsInitialized;
|
|
2126
|
-
var getCurrentUserId = (state) => state.users.currentUser;
|
|
2127
|
-
var getUsersById = (state) => state.users.byId;
|
|
2128
|
-
var getUsersList = (0, import_toolkit14.createSelector)([getUsersById], (usersById) => Object.values(usersById));
|
|
2129
|
-
var getCurrentUser = (0, import_toolkit14.createSelector)(
|
|
2130
|
-
[getUsersById, getCurrentUserId],
|
|
2131
|
-
(usersById, userId) => userId ? usersById[userId] ?? emptyObject : emptyObject
|
|
2132
|
-
);
|
|
2133
|
-
var getUserSettings = (state) => state.users.userSettings;
|
|
2134
|
-
var getSelectedDeviceAttribute = (0, import_toolkit14.createSelector)(
|
|
2135
|
-
[getUserSettings],
|
|
2136
|
-
({ columnSelection }) => columnSelection.map((attribute) => ({ attribute: attribute.key, scope: attribute.scope }))
|
|
2137
|
-
);
|
|
2138
|
-
var getIsDarkMode = (0, import_toolkit14.createSelector)([getUserSettings], ({ mode }) => isDarkMode(mode));
|
|
2139
|
-
var getReadAllHelptips = (0, import_toolkit14.createSelector)(
|
|
2140
|
-
[getTooltipsById],
|
|
2141
|
-
(tooltips) => Object.values(tooltips).every(({ readState }) => readState === READ_STATES.read)
|
|
2142
|
-
);
|
|
2143
|
-
var getTooltipsState = (0, import_toolkit14.createSelector)(
|
|
2144
|
-
[getTooltipsById, getUserSettings],
|
|
2145
|
-
(byId, { tooltips = {} }) => Object.entries(byId).reduce(
|
|
2146
|
-
(accu, [id, value]) => {
|
|
2147
|
-
accu[id] = { ...accu[id], ...value };
|
|
2148
|
-
return accu;
|
|
2149
|
-
},
|
|
2150
|
-
{ ...tooltips }
|
|
2151
|
-
)
|
|
2152
|
-
);
|
|
2153
|
-
var getHas2FA = (0, import_toolkit14.createSelector)(
|
|
2154
|
-
[getCurrentUser],
|
|
2155
|
-
(currentUser) => currentUser.hasOwnProperty("tfa_status") && currentUser.tfa_status === import_constants4.twoFAStates.enabled
|
|
2156
|
-
);
|
|
2157
|
-
var getIdAttribute = (0, import_toolkit14.createSelector)([getGlobalSettings], ({ id_attribute = { ...defaultIdAttribute } }) => id_attribute);
|
|
2158
|
-
var getOfflineThresholdSettings = (0, import_toolkit14.createSelector)([getGlobalSettings], ({ offlineThreshold }) => ({
|
|
2159
|
-
interval: offlineThreshold?.interval || DEVICE_ONLINE_CUTOFF.interval,
|
|
2160
|
-
intervalUnit: offlineThreshold?.intervalUnit || DEVICE_ONLINE_CUTOFF.intervalName
|
|
2161
|
-
}));
|
|
2162
|
-
var getRolesList = (0, import_toolkit14.createSelector)([getRolesById], (rolesById2) => Object.entries(rolesById2).map(([value, role]) => ({ value, ...role })));
|
|
2163
|
-
var getSecurityAlertDismissedTimestamp = (state) => state.users.userSettings.securityAlertDismissedTimestamp;
|
|
2164
|
-
|
|
2165
|
-
// src/commonSelectors.ts
|
|
2166
|
-
var getIsEnterprise = (0, import_toolkit15.createSelector)(
|
|
2167
|
-
[getOrganization, getFeatures],
|
|
2168
|
-
({ plan = PLANS.os.id }, { isEnterprise, isHosted }) => isEnterprise || isHosted && plan === PLANS.enterprise.id
|
|
2169
|
-
);
|
|
2170
|
-
var getAttrsEndpoint = (0, import_toolkit15.createSelector)(
|
|
2171
|
-
[getFeatures],
|
|
2172
|
-
({ hasReporting }) => hasReporting ? `${import_constants4.reportingApiUrl}/devices/search/attributes` : `${import_constants4.inventoryApiUrlV2}/filters/attributes`
|
|
2173
|
-
);
|
|
2174
|
-
var getSearchEndpoint = (0, import_toolkit15.createSelector)(
|
|
2175
|
-
[getFeatures],
|
|
2176
|
-
({ hasReporting }) => hasReporting ? `${import_constants4.reportingApiUrl}/devices/search` : `${import_constants4.inventoryApiUrlV2}/filters/search`
|
|
2177
|
-
);
|
|
2178
|
-
var getUserRoles = (0, import_toolkit15.createSelector)([getCurrentUser, getRolesById, getIsEnterprise], (currentUser, rolesById2, isEnterprise) => {
|
|
2179
|
-
const isAdmin = currentUser.roles?.length ? currentUser.roles.some((role) => role === import_constants4.rolesByName.admin) : !isEnterprise;
|
|
2180
|
-
const uiPermissions = isAdmin ? mapUserRolesToUiPermissions([import_constants4.rolesByName.admin], rolesById2) : mapUserRolesToUiPermissions(currentUser.roles || [], rolesById2);
|
|
2181
|
-
return { isAdmin, uiPermissions };
|
|
2182
|
-
});
|
|
2183
|
-
var hasPermission = (thing, permission) => Object.values(thing).some((permissions) => permissions.includes(permission));
|
|
2184
|
-
var getUserCapabilities = (0, import_toolkit15.createSelector)([getUserRoles, getIsServiceProvider], ({ uiPermissions }, isServiceProvider) => {
|
|
2185
|
-
const canManageReleases = hasPermission(uiPermissions.releases, import_constants4.uiPermissionsById.manage.value);
|
|
2186
|
-
const canReadReleases = canManageReleases || hasPermission(uiPermissions.releases, import_constants4.uiPermissionsById.read.value);
|
|
2187
|
-
const canUploadReleases = canManageReleases || hasPermission(uiPermissions.releases, import_constants4.uiPermissionsById.upload.value);
|
|
2188
|
-
const canAuditlog = uiPermissions.auditlog.includes(import_constants4.uiPermissionsById.read.value);
|
|
2189
|
-
const canReadUsers = uiPermissions.userManagement.includes(import_constants4.uiPermissionsById.read.value);
|
|
2190
|
-
const canManageUsers = uiPermissions.userManagement.includes(import_constants4.uiPermissionsById.manage.value);
|
|
2191
|
-
const canReadDevices = hasPermission(uiPermissions.groups, import_constants4.uiPermissionsById.read.value);
|
|
2192
|
-
const canWriteDevices = Object.values(uiPermissions.groups).some(
|
|
2193
|
-
(groupPermissions) => groupPermissions.includes(import_constants4.uiPermissionsById.read.value) && groupPermissions.length > 1
|
|
2194
|
-
);
|
|
2195
|
-
const canTroubleshoot = hasPermission(uiPermissions.groups, import_constants4.uiPermissionsById.connect.value);
|
|
2196
|
-
const canManageDevices = hasPermission(uiPermissions.groups, import_constants4.uiPermissionsById.manage.value);
|
|
2197
|
-
const canConfigure = hasPermission(uiPermissions.groups, import_constants4.uiPermissionsById.configure.value);
|
|
2198
|
-
const canDeploy = uiPermissions.deployments.includes(import_constants4.uiPermissionsById.deploy.value) || hasPermission(uiPermissions.groups, import_constants4.uiPermissionsById.deploy.value);
|
|
2199
|
-
const canReadDeployments = uiPermissions.deployments.includes(import_constants4.uiPermissionsById.read.value);
|
|
2200
|
-
return {
|
|
2201
|
-
canAuditlog,
|
|
2202
|
-
canConfigure,
|
|
2203
|
-
canDeploy,
|
|
2204
|
-
canManageDevices,
|
|
2205
|
-
canManageReleases,
|
|
2206
|
-
canManageUsers,
|
|
2207
|
-
canReadDeployments,
|
|
2208
|
-
canReadDevices,
|
|
2209
|
-
canReadReleases,
|
|
2210
|
-
canReadUsers,
|
|
2211
|
-
canTroubleshoot,
|
|
2212
|
-
canUploadReleases,
|
|
2213
|
-
canWriteDevices,
|
|
2214
|
-
groupsPermissions: uiPermissions.groups,
|
|
2215
|
-
releasesPermissions: uiPermissions.releases,
|
|
2216
|
-
SPTenant: isServiceProvider
|
|
2217
|
-
};
|
|
2218
|
-
});
|
|
2219
|
-
var getTenantCapabilities = (0, import_toolkit15.createSelector)(
|
|
2220
|
-
[getFeatures, getOrganization, getIsEnterprise],
|
|
2221
|
-
({
|
|
2222
|
-
hasAuditlogs: isAuditlogEnabled,
|
|
2223
|
-
hasDeviceConfig: isDeviceConfigEnabled,
|
|
2224
|
-
hasDeviceConnect: isDeviceConnectEnabled,
|
|
2225
|
-
hasMonitor: isMonitorEnabled,
|
|
2226
|
-
isHosted
|
|
2227
|
-
}, { addons = [], plan = PLANS.os.id }, isEnterprise) => {
|
|
2228
|
-
const canDelta = isEnterprise || plan === PLANS.professional.id;
|
|
2229
|
-
const hasAuditlogs = isAuditlogEnabled && isEnterprise;
|
|
2230
|
-
const hasDeviceConfig = addons.some((addon) => addon.name === ADDONS.configure.id && addon.enabled) || isDeviceConfigEnabled && !isHosted;
|
|
2231
|
-
const hasDeviceConnect = addons.some((addon) => addon.name === ADDONS.troubleshoot.id && addon.enabled) || isDeviceConnectEnabled && !isHosted;
|
|
2232
|
-
const hasMonitor = isMonitorEnabled && addons.some((addon) => addon.name === ADDONS.monitor.id && addon.enabled);
|
|
2233
|
-
return {
|
|
2234
|
-
canDelta,
|
|
2235
|
-
canRetry: canDelta,
|
|
2236
|
-
canSchedule: canDelta,
|
|
2237
|
-
hasAuditlogs,
|
|
2238
|
-
hasDeviceConfig,
|
|
2239
|
-
hasDeviceConnect,
|
|
2240
|
-
hasFullFiltering: canDelta,
|
|
2241
|
-
hasMonitor,
|
|
2242
|
-
isEnterprise,
|
|
2243
|
-
plan
|
|
2244
|
-
};
|
|
2245
|
-
}
|
|
2246
|
-
);
|
|
2247
|
-
var getFilterAttributes = (0, import_toolkit15.createSelector)(
|
|
2248
|
-
[getGlobalSettings, getFilteringAttributes],
|
|
2249
|
-
({ previousFilters }, { identityAttributes, inventoryAttributes, systemAttributes, tagAttributes }) => {
|
|
2250
|
-
const deviceNameAttribute = { key: "name", value: "Name", scope: import_constants4.ATTRIBUTE_SCOPES.tags, category: import_constants4.ATTRIBUTE_SCOPES.tags, priority: 1 };
|
|
2251
|
-
const deviceIdAttribute = { key: "id", value: "Device ID", scope: import_constants4.ATTRIBUTE_SCOPES.identity, category: import_constants4.ATTRIBUTE_SCOPES.identity, priority: 1 };
|
|
2252
|
-
const checkInAttribute = { key: "check_in_time", value: "Latest activity", scope: import_constants4.ATTRIBUTE_SCOPES.system, category: import_constants4.ATTRIBUTE_SCOPES.system, priority: 4 };
|
|
2253
|
-
const updateAttribute = { ...checkInAttribute, key: "updated_ts", value: "Last inventory update" };
|
|
2254
|
-
const firstRequestAttribute = { key: "created_ts", value: "First request", scope: import_constants4.ATTRIBUTE_SCOPES.system, category: import_constants4.ATTRIBUTE_SCOPES.system, priority: 4 };
|
|
2255
|
-
const attributes = [
|
|
2256
|
-
...previousFilters.map((item) => ({
|
|
2257
|
-
...item,
|
|
2258
|
-
value: deviceIdAttribute.key === item.key ? deviceIdAttribute.value : item.key,
|
|
2259
|
-
category: "recently used",
|
|
2260
|
-
priority: 0
|
|
2261
|
-
})),
|
|
2262
|
-
deviceNameAttribute,
|
|
2263
|
-
deviceIdAttribute,
|
|
2264
|
-
...identityAttributes.map((item) => ({ key: item, value: item, scope: import_constants4.ATTRIBUTE_SCOPES.identity, category: import_constants4.ATTRIBUTE_SCOPES.identity, priority: 1 })),
|
|
2265
|
-
...inventoryAttributes.map((item) => ({ key: item, value: item, scope: import_constants4.ATTRIBUTE_SCOPES.inventory, category: import_constants4.ATTRIBUTE_SCOPES.inventory, priority: 2 })),
|
|
2266
|
-
...tagAttributes.map((item) => ({ key: item, value: item, scope: import_constants4.ATTRIBUTE_SCOPES.tags, category: import_constants4.ATTRIBUTE_SCOPES.tags, priority: 3 })),
|
|
2267
|
-
checkInAttribute,
|
|
2268
|
-
updateAttribute,
|
|
2269
|
-
firstRequestAttribute,
|
|
2270
|
-
...systemAttributes.map((item) => ({ key: item, value: item, scope: import_constants4.ATTRIBUTE_SCOPES.system, category: import_constants4.ATTRIBUTE_SCOPES.system, priority: 4 }))
|
|
2271
|
-
];
|
|
2272
|
-
return (0, import_helpers6.attributeDuplicateFilter)(attributes, "key");
|
|
2273
|
-
}
|
|
2274
|
-
);
|
|
2275
|
-
var getOnboardingState = (0, import_toolkit15.createSelector)([getOnboarding, getUserSettings], ({ complete, progress: progress2, showTips, ...remainder }, { onboarding = {} }) => ({
|
|
2276
|
-
...remainder,
|
|
2277
|
-
...onboarding,
|
|
2278
|
-
complete: onboarding.complete || complete,
|
|
2279
|
-
progress: Object.keys(onboardingSteps).findIndex((step) => step === progress2) > Object.keys(onboardingSteps).findIndex((step) => step === onboarding.progress) ? progress2 : onboarding.progress,
|
|
2280
|
-
showTips: !onboarding.showTips ? onboarding.showTips : showTips
|
|
2281
|
-
}));
|
|
2282
|
-
var getDemoDeviceAddress = (0, import_toolkit15.createSelector)([getDevicesById, getOnboarding], (devicesById, { approach, demoArtifactPort }) => {
|
|
2283
|
-
const demoDeviceAddress = `http://${(0, import_helpers6.getDemoDeviceAddress)(Object.values(devicesById), approach)}`;
|
|
2284
|
-
return demoArtifactPort ? `${demoDeviceAddress}:${demoArtifactPort}` : demoDeviceAddress;
|
|
2285
|
-
});
|
|
2286
|
-
var getDeviceConfigDeployment = (0, import_toolkit15.createSelector)([getDeviceById, getDeploymentsById], (device, deploymentsById) => {
|
|
2287
|
-
const { config = {} } = device;
|
|
2288
|
-
const { deployment_id: configDeploymentId } = config;
|
|
2289
|
-
const deviceConfigDeployment = deploymentsById[configDeploymentId] || {};
|
|
2290
|
-
return { device, deviceConfigDeployment };
|
|
2291
|
-
});
|
|
2292
|
-
var getDeploymentRelease = (0, import_toolkit15.createSelector)(
|
|
2293
|
-
[getDeploymentsById, getDeploymentsSelectionState, getReleasesById],
|
|
2294
|
-
(deploymentsById, { selectedId }, releasesById) => {
|
|
2295
|
-
const deployment = deploymentsById[selectedId] || {};
|
|
2296
|
-
return deployment.artifact_name && releasesById[deployment.artifact_name] ? releasesById[deployment.artifact_name] : { device_types_compatible: [] };
|
|
2297
|
-
}
|
|
2298
|
-
);
|
|
2299
|
-
var getSelectedDeploymentData = (0, import_toolkit15.createSelector)(
|
|
2300
|
-
[getDeploymentsById, getDeploymentsSelectionState, getDevicesById, getSelectedDeploymentDeviceIds],
|
|
2301
|
-
(deploymentsById, { selectedId }, devicesById, selectedDeviceIds) => {
|
|
2302
|
-
const deployment = deploymentsById[selectedId] ?? {};
|
|
2303
|
-
const { devices = {} } = deployment;
|
|
2304
|
-
return {
|
|
2305
|
-
deployment,
|
|
2306
|
-
selectedDevices: selectedDeviceIds.map((deviceId) => ({ ...devicesById[deviceId], ...devices[deviceId] }))
|
|
2307
|
-
};
|
|
2308
|
-
}
|
|
2309
|
-
);
|
|
2310
|
-
var getAvailableIssueOptionsByType = (0, import_toolkit15.createSelector)(
|
|
2311
|
-
[getFeatures, getTenantCapabilities, getIssueCountsByType],
|
|
2312
|
-
({ hasReporting }, { hasFullFiltering, hasMonitor }, issueCounts) => Object.values(import_constants4.DEVICE_ISSUE_OPTIONS).reduce((accu, { isCategory, key, needsFullFiltering, needsMonitor, needsReporting, title }) => {
|
|
2313
|
-
if (isCategory || needsReporting && !hasReporting || needsFullFiltering && !hasFullFiltering || needsMonitor && !hasMonitor) {
|
|
2314
|
-
return accu;
|
|
2315
|
-
}
|
|
2316
|
-
accu[key] = { count: issueCounts[key].filtered, key, title };
|
|
2317
|
-
return accu;
|
|
2318
|
-
}, {})
|
|
2319
|
-
);
|
|
2320
|
-
var getGroupNames = (0, import_toolkit15.createSelector)([getGroupsById, getUserRoles], (groupsById, { uiPermissions }) => {
|
|
2321
|
-
const { [UNGROUPED_GROUP.id]: ungrouped, ...groups } = groupsById;
|
|
2322
|
-
return Object.keys(
|
|
2323
|
-
Object.entries(groups).reduce((accu, [groupName, group]) => {
|
|
2324
|
-
if (group.filterId || uiPermissions.groups[import_constants4.ALL_DEVICES]) {
|
|
2325
|
-
accu[groupName] = group;
|
|
2326
|
-
}
|
|
2327
|
-
return accu;
|
|
2328
|
-
}, uiPermissions.groups)
|
|
2329
|
-
).sort();
|
|
2330
|
-
});
|
|
2331
|
-
var getDeviceReportsForUser = (0, import_toolkit15.createSelector)(
|
|
2332
|
-
[getUserSettings, getCurrentUser, getGlobalSettings, getDevicesById],
|
|
2333
|
-
({ reports }, { id: currentUserId }, globalSettings, devicesById) => reports || globalSettings[`${currentUserId}-reports`] || (Object.keys(devicesById).length ? defaultReports : [])
|
|
2334
|
-
);
|
|
2335
|
-
var listTypeDeviceIdMap = {
|
|
2336
|
-
deviceList: getListedDevices,
|
|
2337
|
-
search: getSearchedDevices
|
|
2338
|
-
};
|
|
2339
|
-
var deviceMapDefault = { defaultObject: { auth_sets: [] }, cutOffSize: DEVICE_LIST_MAXIMUM_LENGTH };
|
|
2340
|
-
var getDeviceMappingDefaults = () => deviceMapDefault;
|
|
2341
|
-
var getMappedDevicesList = (0, import_toolkit15.createSelector)(
|
|
2342
|
-
[getDevicesById, (state, listType) => listTypeDeviceIdMap[listType](state), getDeviceMappingDefaults],
|
|
2343
|
-
listItemMapper
|
|
2344
|
-
);
|
|
2345
|
-
var getAuditlogDevice = (0, import_toolkit15.createSelector)([getAuditLogEntry, getDevicesById], (auditlogEvent, devicesById) => {
|
|
2346
|
-
let auditlogDevice = {};
|
|
2347
|
-
if (auditlogEvent) {
|
|
2348
|
-
const { object = {} } = auditlogEvent;
|
|
2349
|
-
const { device = {}, id, type } = object;
|
|
2350
|
-
auditlogDevice = type === "device" ? { id, ...device } : auditlogDevice;
|
|
2351
|
-
}
|
|
2352
|
-
return { ...auditlogDevice, ...devicesById[auditlogDevice.id] };
|
|
2353
|
-
});
|
|
2354
|
-
var getRelevantRoles = (0, import_toolkit15.createSelector)([getOrganization, getRolesList], ({ service_provider }, roles) => {
|
|
2355
|
-
if (service_provider) {
|
|
2356
|
-
return roles.reduce((accu, role) => {
|
|
2357
|
-
if (import_constants4.rolesById[role.value]) {
|
|
2358
|
-
return accu;
|
|
2359
|
-
}
|
|
2360
|
-
accu.push(role);
|
|
2361
|
-
return accu;
|
|
2362
|
-
}, Object.values(import_constants4.serviceProviderRolesById));
|
|
2363
|
-
}
|
|
2364
|
-
return Object.keys(import_constants4.rolesById).reverse().reduce((accu, key) => {
|
|
2365
|
-
const index = accu.findIndex(({ value }) => value === key);
|
|
2366
|
-
accu = [accu[index], ...accu.filter((item, itemIndex) => index !== itemIndex)];
|
|
2367
|
-
return accu;
|
|
2368
|
-
}, roles);
|
|
2369
|
-
});
|
|
2370
|
-
var getShowSecurityAlert = (0, import_toolkit15.createSelector)(
|
|
2371
|
-
[getCurrentUser, getHas2FA, getFeatures, getIsEnterprise, getUserSettingsInitialized, getSecurityAlertDismissedTimestamp],
|
|
2372
|
-
(currentUser, has2FA, features, isEnterprise, settingsInitialized, dismissedTimestamp) => {
|
|
2373
|
-
const isOAuth2 = !!currentUser?.sso?.length;
|
|
2374
|
-
const userVerified = !!currentUser.verified;
|
|
2375
|
-
const isHosted = features?.isHosted;
|
|
2376
|
-
const canHave2FA = isEnterprise || isHosted;
|
|
2377
|
-
const secureOAuthUser = isOAuth2 && userVerified;
|
|
2378
|
-
if (!currentUser || !settingsInitialized || has2FA || !canHave2FA || secureOAuthUser) {
|
|
2379
|
-
return false;
|
|
2380
|
-
}
|
|
2381
|
-
if (dismissedTimestamp === null) {
|
|
2382
|
-
return true;
|
|
2383
|
-
}
|
|
2384
|
-
const today = (0, import_dayjs.default)();
|
|
2385
|
-
const dismissedMonthAgo = today.diff(dismissedTimestamp, "months");
|
|
2386
|
-
return dismissedMonthAgo > 0;
|
|
2387
|
-
}
|
|
2388
|
-
);
|
|
2389
|
-
|
|
2390
1611
|
// src/store.ts
|
|
2391
1612
|
var import_react_redux = require("react-redux");
|
|
2392
|
-
var
|
|
2393
|
-
var
|
|
1613
|
+
var import_helpers3 = require("@northern.tech/utils/helpers");
|
|
1614
|
+
var import_toolkit9 = require("@reduxjs/toolkit");
|
|
2394
1615
|
var import_react = require("@sentry/react");
|
|
2395
1616
|
var { setSnackbar, uploadProgress } = actions_default;
|
|
2396
1617
|
var keys = ["sessionDeploymentChecker", settingsKeys.initialized];
|
|
@@ -2398,13 +1619,13 @@ var resetEnvironment = () => keys.forEach((key) => window.sessionStorage.removeI
|
|
|
2398
1619
|
resetEnvironment();
|
|
2399
1620
|
var commonErrorFallback = "Please check your connection.";
|
|
2400
1621
|
var commonErrorHandler = (err, errorContext, dispatch, fallback, mightBeAuthRelated = false) => {
|
|
2401
|
-
const errMsg = (0,
|
|
1622
|
+
const errMsg = (0, import_helpers3.extractErrorMessage)(err, fallback);
|
|
2402
1623
|
if (mightBeAuthRelated || getToken()) {
|
|
2403
|
-
dispatch(setSnackbar({ message: (0,
|
|
1624
|
+
dispatch(setSnackbar({ message: (0, import_helpers3.preformatWithRequestID)(err.response, `${errorContext} ${errMsg}`), action: "Copy to clipboard" }));
|
|
2404
1625
|
}
|
|
2405
1626
|
return Promise.reject(err);
|
|
2406
1627
|
};
|
|
2407
|
-
var rootReducer = (0,
|
|
1628
|
+
var rootReducer = (0, import_toolkit9.combineReducers)({
|
|
2408
1629
|
app: appSlice_default,
|
|
2409
1630
|
devices: devicesSlice_default,
|
|
2410
1631
|
deployments: deploymentsSlice_default,
|
|
@@ -2454,7 +1675,7 @@ var sentryReduxEnhancer = (0, import_react.createReduxEnhancer)({
|
|
|
2454
1675
|
});
|
|
2455
1676
|
var getConfiguredStore = (options = {}) => {
|
|
2456
1677
|
const { preloadedState = {}, ...config } = options;
|
|
2457
|
-
return (0,
|
|
1678
|
+
return (0, import_toolkit9.configureStore)({
|
|
2458
1679
|
...config,
|
|
2459
1680
|
preloadedState,
|
|
2460
1681
|
enhancers: (getDefaultEnhancers) => {
|
|
@@ -2479,14 +1700,97 @@ var getConfiguredStore = (options = {}) => {
|
|
|
2479
1700
|
var store = getConfiguredStore({
|
|
2480
1701
|
preloadedState: {}
|
|
2481
1702
|
});
|
|
2482
|
-
var createAppAsyncThunk =
|
|
1703
|
+
var createAppAsyncThunk = import_toolkit9.createAsyncThunk.withTypes();
|
|
1704
|
+
|
|
1705
|
+
// src/utils.ts
|
|
1706
|
+
var import_helpers4 = require("@northern.tech/utils/helpers");
|
|
1707
|
+
var filterProcessors = {
|
|
1708
|
+
[import_constants4.DEVICE_FILTERING_OPTIONS.$gt.key]: (val) => Number(val) || val,
|
|
1709
|
+
[import_constants4.DEVICE_FILTERING_OPTIONS.$gte.key]: (val) => Number(val) || val,
|
|
1710
|
+
[import_constants4.DEVICE_FILTERING_OPTIONS.$lt.key]: (val) => Number(val) || val,
|
|
1711
|
+
[import_constants4.DEVICE_FILTERING_OPTIONS.$lte.key]: (val) => Number(val) || val,
|
|
1712
|
+
[import_constants4.DEVICE_FILTERING_OPTIONS.$ltne.key]: (val) => Number(val) || val,
|
|
1713
|
+
[import_constants4.DEVICE_FILTERING_OPTIONS.$in.key]: (val) => ("" + val).split(",").map((i) => i.trim()),
|
|
1714
|
+
[import_constants4.DEVICE_FILTERING_OPTIONS.$nin.key]: (val) => ("" + val).split(",").map((i) => i.trim()),
|
|
1715
|
+
[import_constants4.DEVICE_FILTERING_OPTIONS.$exists.key]: import_helpers4.yes,
|
|
1716
|
+
[import_constants4.DEVICE_FILTERING_OPTIONS.$nexists.key]: () => false
|
|
1717
|
+
};
|
|
1718
|
+
var filterAliases = {
|
|
1719
|
+
$nexists: { alias: import_constants4.DEVICE_FILTERING_OPTIONS.$exists.key, value: false }
|
|
1720
|
+
};
|
|
1721
|
+
var mapFiltersToTerms = (filters) => filters.map((filter) => ({
|
|
1722
|
+
scope: filter.scope,
|
|
1723
|
+
attribute: filter.key,
|
|
1724
|
+
type: filterAliases[filter.operator]?.alias || filter.operator,
|
|
1725
|
+
value: filterProcessors.hasOwnProperty(filter.operator) ? filterProcessors[filter.operator](filter.value) : filter.value
|
|
1726
|
+
}));
|
|
1727
|
+
var convertIssueOptionsToFilters = (issuesSelection, filtersState = {}) => issuesSelection.map((item) => {
|
|
1728
|
+
if (typeof import_constants4.DEVICE_ISSUE_OPTIONS[item].filterRule.value === "function") {
|
|
1729
|
+
return { ...import_constants4.DEVICE_ISSUE_OPTIONS[item].filterRule, value: import_constants4.DEVICE_ISSUE_OPTIONS[item].filterRule.value(filtersState) };
|
|
1730
|
+
}
|
|
1731
|
+
return import_constants4.DEVICE_ISSUE_OPTIONS[item].filterRule;
|
|
1732
|
+
});
|
|
1733
|
+
var convertDeviceListStateToFilters = ({
|
|
1734
|
+
filters = [],
|
|
1735
|
+
group,
|
|
1736
|
+
groups = { byId: {} },
|
|
1737
|
+
offlineThreshold,
|
|
1738
|
+
selectedIssues = [],
|
|
1739
|
+
status
|
|
1740
|
+
}) => {
|
|
1741
|
+
let applicableFilters = [...filters];
|
|
1742
|
+
if (typeof group === "string" && !(groups.byId[group]?.filters || applicableFilters).length) {
|
|
1743
|
+
applicableFilters.push({ key: "group", value: group, operator: import_constants4.DEVICE_FILTERING_OPTIONS.$eq.key, scope: "system" });
|
|
1744
|
+
}
|
|
1745
|
+
const nonMonitorFilters = applicableFilters.filter(
|
|
1746
|
+
(filter) => !Object.values(import_constants4.DEVICE_ISSUE_OPTIONS).some(
|
|
1747
|
+
({ filterRule }) => filter.scope !== "inventory" && filterRule.scope === filter.scope && filterRule.key === filter.key
|
|
1748
|
+
)
|
|
1749
|
+
);
|
|
1750
|
+
const deviceIssueFilters = convertIssueOptionsToFilters(selectedIssues, { offlineThreshold });
|
|
1751
|
+
applicableFilters = [...nonMonitorFilters, ...deviceIssueFilters];
|
|
1752
|
+
const effectiveFilters = status ? [...applicableFilters, { key: "status", value: status, operator: import_constants4.DEVICE_FILTERING_OPTIONS.$eq.key, scope: "identity" }] : applicableFilters;
|
|
1753
|
+
return { applicableFilters: nonMonitorFilters, filterTerms: mapFiltersToTerms(effectiveFilters) };
|
|
1754
|
+
};
|
|
1755
|
+
var listItemMapper = (byId, ids, { cutOffSize = DEVICE_LIST_MAXIMUM_LENGTH, defaultObject = {} }) => ids.slice(0, cutOffSize).reduce((accu, id) => {
|
|
1756
|
+
if (id && byId[id]) {
|
|
1757
|
+
accu.push({ ...defaultObject, ...byId[id] });
|
|
1758
|
+
}
|
|
1759
|
+
return accu;
|
|
1760
|
+
}, []);
|
|
1761
|
+
var progress = ({ loaded, total }) => {
|
|
1762
|
+
let uploadProgress3 = loaded / total * 100;
|
|
1763
|
+
return uploadProgress3 = uploadProgress3 < 50 ? Math.ceil(uploadProgress3) : Math.round(uploadProgress3);
|
|
1764
|
+
};
|
|
1765
|
+
|
|
1766
|
+
// src/releasesSlice/selectors.ts
|
|
1767
|
+
var import_toolkit10 = require("@reduxjs/toolkit");
|
|
1768
|
+
var getSelectedReleaseId = (state) => state.releases.selectedRelease;
|
|
1769
|
+
var getReleasesById = (state) => state.releases.byId;
|
|
1770
|
+
var getReleaseTags = (state) => state.releases.tags;
|
|
1771
|
+
var getReleaseListState = (state) => state.releases.releasesList;
|
|
1772
|
+
var getListedReleases = (state) => state.releases.releasesList.releaseIds;
|
|
1773
|
+
var releaseDefaults = {};
|
|
1774
|
+
var getReleaseMappingDefaults = () => releaseDefaults;
|
|
1775
|
+
var getReleasesList = (0, import_toolkit10.createSelector)([getReleasesById, getListedReleases, getReleaseMappingDefaults], listItemMapper);
|
|
1776
|
+
var getReleaseTagsById = (0, import_toolkit10.createSelector)([getReleaseTags], (releaseTags) => releaseTags.reduce((accu, key) => ({ ...accu, [key]: key }), {}));
|
|
1777
|
+
var getHasReleases = (0, import_toolkit10.createSelector)(
|
|
1778
|
+
[getReleaseListState, getReleasesById],
|
|
1779
|
+
({ searchTotal, total }, byId) => !!(Object.keys(byId).length || total || searchTotal)
|
|
1780
|
+
);
|
|
1781
|
+
var getSelectedRelease = (0, import_toolkit10.createSelector)([getReleasesById, getSelectedReleaseId], (byId, id) => byId[id || ""] ?? {});
|
|
1782
|
+
var getSelectedReleases = (0, import_toolkit10.createSelector)([getReleaseListState, getReleasesList], ({ selection }, releases) => selection.map((index) => releases[index]));
|
|
1783
|
+
var getDeltaJobsById = (state) => state.releases.deltaJobs;
|
|
1784
|
+
var getDeltaJobById = (0, import_toolkit10.createSelector)([getDeltaJobsById, (_, jobId) => jobId], (byId, jobId) => byId[jobId]);
|
|
1785
|
+
var getSelectedJobId = (state) => state.releases.selectedJob;
|
|
1786
|
+
var getSelectedJob = (0, import_toolkit10.createSelector)([getDeltaJobsById, getSelectedJobId], (byId, jobId) => byId[jobId || ""]);
|
|
2483
1787
|
|
|
2484
1788
|
// src/releasesSlice/thunks.ts
|
|
2485
1789
|
var { setSnackbar: setSnackbar2, initUpload, uploadProgress: uploadProgress2, cleanUpUpload } = actions_default;
|
|
2486
1790
|
var { page: defaultPage, perPage: defaultPerPage } = import_constants4.DEVICE_LIST_DEFAULTS;
|
|
2487
1791
|
var sortingDefaults = { direction: import_constants4.SORTING_OPTIONS.desc, key: "modified" };
|
|
2488
1792
|
var flattenRelease = (release, stateRelease) => {
|
|
2489
|
-
const updatedArtifacts = release.artifacts?.sort((0,
|
|
1793
|
+
const updatedArtifacts = release.artifacts?.sort((0, import_helpers5.customSort)(true, "modified")) || [];
|
|
2490
1794
|
const { artifacts, deviceTypes, modified } = updatedArtifacts.reduce(
|
|
2491
1795
|
(accu, item) => {
|
|
2492
1796
|
accu.deviceTypes.push(...item.device_types_compatible);
|
|
@@ -2500,7 +1804,7 @@ var flattenRelease = (release, stateRelease) => {
|
|
|
2500
1804
|
},
|
|
2501
1805
|
{ artifacts: [], deviceTypes: [], modified: void 0 }
|
|
2502
1806
|
);
|
|
2503
|
-
return { ...stateRelease, ...release, artifacts, device_types_compatible: deviceTypes.filter(
|
|
1807
|
+
return { ...stateRelease, ...release, artifacts, device_types_compatible: deviceTypes.filter(import_helpers5.duplicateFilter), modified };
|
|
2504
1808
|
};
|
|
2505
1809
|
var reduceReceivedReleases = (releases, stateReleasesById) => releases.reduce((accu, release) => {
|
|
2506
1810
|
const name = release.name ?? release.Name;
|
|
@@ -2525,12 +1829,12 @@ var getArtifactInstallCount = createAppAsyncThunk(`${sliceName}/getArtifactInsta
|
|
|
2525
1829
|
}
|
|
2526
1830
|
const releaseArtifacts = [...release.artifacts];
|
|
2527
1831
|
const artifact = releaseArtifacts[index];
|
|
2528
|
-
const { key, name, version } = (0,
|
|
1832
|
+
const { key, name, version } = (0, import_helpers5.extractSoftwareItem)(artifact.artifact_provides) ?? {};
|
|
2529
1833
|
const attribute = `${key}${name ? `.${name}` : ""}.version`;
|
|
2530
1834
|
const { filterTerms } = convertDeviceListStateToFilters({
|
|
2531
1835
|
filters: [{ ...emptyFilter, key: attribute, value: version, scope: "inventory" }]
|
|
2532
1836
|
});
|
|
2533
|
-
return general_api_default.post(
|
|
1837
|
+
return general_api_default.post(`${import_constants4.inventoryApiUrlV2}/filters/search`, {
|
|
2534
1838
|
page: 1,
|
|
2535
1839
|
per_page: 1,
|
|
2536
1840
|
filters: filterTerms,
|
|
@@ -2570,7 +1874,7 @@ var getArtifactUrl = createAppAsyncThunk(
|
|
|
2570
1874
|
...release,
|
|
2571
1875
|
artifacts: releaseArtifacts
|
|
2572
1876
|
};
|
|
2573
|
-
return dispatch(actions.receiveRelease(release));
|
|
1877
|
+
return Promise.all([Promise.resolve(dispatch(actions.receiveRelease(release))), Promise.resolve(response.data.uri)]);
|
|
2574
1878
|
})
|
|
2575
1879
|
);
|
|
2576
1880
|
var pollLocation = async (location, attempt = 1, maxAttempts = 5, delay = TIMEOUTS.oneSecond) => {
|
|
@@ -2746,11 +2050,11 @@ var setReleasesListState = createAppAsyncThunk(
|
|
|
2746
2050
|
const tasks = [];
|
|
2747
2051
|
const { isLoading: currentLoading, ...currentRequestState } = currentState;
|
|
2748
2052
|
const { isLoading: selectionLoading, ...selectionRequestState } = nextState;
|
|
2749
|
-
if (!(0,
|
|
2053
|
+
if (!(0, import_helpers5.deepCompare)(currentRequestState, selectionRequestState)) {
|
|
2750
2054
|
nextState.isLoading = true;
|
|
2751
2055
|
tasks.push(dispatch(getReleases(nextState)).finally(() => dispatch(setReleasesListState({ isLoading: false }))));
|
|
2752
2056
|
}
|
|
2753
|
-
if (!nextState.searchOnly && (currentState.page !== nextState.page || currentState.perPage > nextState.perPage || !(0,
|
|
2057
|
+
if (!nextState.searchOnly && (currentState.page !== nextState.page || currentState.perPage > nextState.perPage || !(0, import_helpers5.deepCompare)(currentState.sort, nextState.sort))) {
|
|
2754
2058
|
nextState.selection = [];
|
|
2755
2059
|
}
|
|
2756
2060
|
tasks.push(dispatch(actions.setReleaseListState(nextState)));
|
|
@@ -2770,7 +2074,7 @@ var releaseListRetrieval = (config) => {
|
|
|
2770
2074
|
var deductSearchState = (receivedReleases, config, total, state) => {
|
|
2771
2075
|
let releaseListState = { ...state.releasesList };
|
|
2772
2076
|
const { searchTerm, searchOnly, sort = {}, selectedTags = [], type } = config;
|
|
2773
|
-
const flattenedReleases = Object.values(receivedReleases).sort((0,
|
|
2077
|
+
const flattenedReleases = Object.values(receivedReleases).sort((0, import_helpers5.customSort)(sort.direction === import_constants4.SORTING_OPTIONS.desc, sort.key));
|
|
2774
2078
|
const releaseIds = flattenedReleases.map((item) => item.name);
|
|
2775
2079
|
const isFiltering = !!(selectedTags.length || type || searchTerm);
|
|
2776
2080
|
if (searchOnly) {
|