@northern.tech/store 0.28.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 +10 -10
- package/dist/api/general-api.cjs.map +1 -1
- package/dist/api/general-api.js +4 -4
- package/dist/api/users-api.cjs.map +1 -1
- package/dist/api/users-api.js +5 -5
- package/dist/appSlice/index.cjs +0 -1
- package/dist/appSlice/index.cjs.map +1 -1
- package/dist/appSlice/index.js +3 -3
- package/dist/appSlice/mocks.cjs +0 -1
- package/dist/appSlice/mocks.cjs.map +1 -1
- package/dist/appSlice/mocks.js +3 -3
- package/dist/appSlice/thunks.cjs +29 -33
- package/dist/appSlice/thunks.cjs.map +1 -1
- package/dist/appSlice/thunks.js +26 -26
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.js +3 -3
- package/dist/{chunk-2QIGK5IU.js → chunk-4UNLEL5A.js} +2 -2
- package/dist/{chunk-KR5IU7TA.js → chunk-6V5IIIF7.js} +3 -3
- package/dist/{chunk-KR5IU7TA.js.map → chunk-6V5IIIF7.js.map} +1 -1
- package/dist/{chunk-GDB5IZMC.js → chunk-ARMI6SZS.js} +15 -17
- package/dist/chunk-ARMI6SZS.js.map +1 -0
- package/dist/{chunk-GEJDA2ZF.js → chunk-AZF4YY3P.js} +12 -14
- 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-2S5F4CQS.js → chunk-FCY7BUGK.js} +62 -62
- 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-G2OECV4D.js → chunk-HKN3RN2Z.js} +13 -13
- 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-CQT3GJNR.js → chunk-MNJXEB7S.js} +16 -28
- package/dist/chunk-MNJXEB7S.js.map +1 -0
- package/dist/{chunk-ILSHXLJ3.js → chunk-NXLXPRYW.js} +17 -17
- 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 +2 -2
- 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 +10 -14
- 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 +5 -7
- package/dist/deploymentsSlice/constants.cjs.map +1 -1
- package/dist/deploymentsSlice/constants.js +2 -2
- package/dist/deploymentsSlice/index.cjs.map +1 -1
- package/dist/deploymentsSlice/index.js +3 -3
- package/dist/deploymentsSlice/mocks.cjs.map +1 -1
- package/dist/deploymentsSlice/mocks.js +3 -3
- package/dist/deploymentsSlice/selectors.cjs.map +1 -1
- package/dist/deploymentsSlice/selectors.js +3 -3
- package/dist/deploymentsSlice/thunks.cjs +29 -33
- package/dist/deploymentsSlice/thunks.cjs.map +1 -1
- package/dist/deploymentsSlice/thunks.js +26 -26
- package/dist/devicesSlice/constants.cjs.map +1 -1
- package/dist/devicesSlice/constants.js +2 -2
- package/dist/devicesSlice/index.cjs.map +1 -1
- package/dist/devicesSlice/index.js +3 -3
- package/dist/devicesSlice/mocks.cjs.map +1 -1
- package/dist/devicesSlice/mocks.js +3 -3
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.js +3 -3
- package/dist/devicesSlice/thunks.cjs +29 -33
- package/dist/devicesSlice/thunks.cjs.map +1 -1
- package/dist/devicesSlice/thunks.js +26 -26
- package/dist/liststatehook.cjs +1 -1
- package/dist/liststatehook.cjs.map +1 -1
- package/dist/liststatehook.js +3 -3
- package/dist/locationutils.cjs +1 -1
- package/dist/locationutils.cjs.map +1 -1
- package/dist/locationutils.js +3 -3
- package/dist/monitorSlice/index.cjs.map +1 -1
- package/dist/monitorSlice/index.js +3 -3
- 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 +3 -4
- 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 +22 -22
- package/dist/onboardingSlice/thunks.cjs +29 -33
- package/dist/onboardingSlice/thunks.cjs.map +1 -1
- package/dist/onboardingSlice/thunks.js +26 -26
- package/dist/organizationSlice/constants.cjs.map +1 -1
- package/dist/organizationSlice/constants.js +2 -2
- package/dist/organizationSlice/index.cjs.map +1 -1
- package/dist/organizationSlice/index.js +3 -3
- package/dist/organizationSlice/mocks.cjs.map +1 -1
- package/dist/organizationSlice/mocks.js +3 -3
- package/dist/organizationSlice/selectors.cjs.map +1 -1
- package/dist/organizationSlice/selectors.js +3 -3
- package/dist/organizationSlice/thunks.cjs +34 -41
- package/dist/organizationSlice/thunks.cjs.map +1 -1
- package/dist/organizationSlice/thunks.js +26 -26
- package/dist/releasesSlice/index.cjs.map +1 -1
- package/dist/releasesSlice/index.js +3 -3
- package/dist/releasesSlice/mocks.cjs.map +1 -1
- package/dist/releasesSlice/mocks.js +3 -3
- package/dist/releasesSlice/selectors.cjs.map +1 -1
- package/dist/releasesSlice/selectors.js +4 -4
- package/dist/releasesSlice/thunks.cjs +99 -795
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.js +17 -26
- 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 +15 -19
- package/dist/sockethook.cjs.map +1 -1
- package/dist/sockethook.js +2 -2
- package/dist/store.cjs +0 -1
- package/dist/store.cjs.map +1 -1
- package/dist/store.js +12 -12
- package/dist/storehooks.cjs +36 -44
- package/dist/storehooks.cjs.map +1 -1
- package/dist/storehooks.js +27 -28
- package/dist/storehooks.js.map +1 -1
- package/dist/thunks.cjs +36 -43
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.js +26 -26
- package/dist/useDeploymentDevice.cjs +29 -33
- package/dist/useDeploymentDevice.cjs.map +1 -1
- package/dist/useDeploymentDevice.js +26 -26
- package/dist/usersSlice/constants.cjs.map +1 -1
- package/dist/usersSlice/constants.js +2 -2
- package/dist/usersSlice/index.cjs.map +1 -1
- package/dist/usersSlice/index.js +3 -3
- package/dist/usersSlice/mocks.cjs.map +1 -1
- package/dist/usersSlice/mocks.js +3 -3
- package/dist/usersSlice/selectors.cjs.map +1 -1
- package/dist/usersSlice/selectors.js +4 -4
- package/dist/usersSlice/thunks.cjs +29 -33
- package/dist/usersSlice/thunks.cjs.map +1 -1
- package/dist/usersSlice/thunks.js +26 -26
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +3 -3
- package/package.json +1 -2
- package/dist/chunk-2S5F4CQS.js.map +0 -1
- package/dist/chunk-CMXRPUOF.js.map +0 -1
- package/dist/chunk-CQT3GJNR.js.map +0 -1
- package/dist/chunk-GDB5IZMC.js.map +0 -1
- package/dist/chunk-GEJDA2ZF.js.map +0 -1
- package/dist/chunk-GX3X2E57.js.map +0 -1
- /package/dist/{chunk-2QIGK5IU.js.map → chunk-4UNLEL5A.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-G2OECV4D.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-ILSHXLJ3.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
|
@@ -33,7 +33,7 @@ __export(thunks_exports, {
|
|
|
33
33
|
changeNotificationSetting: () => changeNotificationSetting,
|
|
34
34
|
getDeviceAlerts: () => getDeviceAlerts,
|
|
35
35
|
getDeviceMonitorConfig: () => getDeviceMonitorConfig,
|
|
36
|
-
getIssueCountsByType: () =>
|
|
36
|
+
getIssueCountsByType: () => getIssueCountsByType,
|
|
37
37
|
getLatestDeviceAlerts: () => getLatestDeviceAlerts
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(thunks_exports);
|
|
@@ -44,96 +44,6 @@ var import_toolkit = require("@reduxjs/toolkit");
|
|
|
44
44
|
// src/constants.ts
|
|
45
45
|
var import_constants3 = require("@northern.tech/utils/constants");
|
|
46
46
|
|
|
47
|
-
// src/appSlice/constants.ts
|
|
48
|
-
var import_icons_material = require("@mui/icons-material");
|
|
49
|
-
var import_utils = require("@northern.tech/utils");
|
|
50
|
-
var chartTypes = {
|
|
51
|
-
bar: { key: "bar", Icon: import_icons_material.BarChart },
|
|
52
|
-
pie: { key: "pie", Icon: import_icons_material.PieChartOutline }
|
|
53
|
-
};
|
|
54
|
-
var emptyChartSelection = { software: "", group: "", chartType: chartTypes.bar.key, attribute: "artifact_name" };
|
|
55
|
-
var defaultReportType = "distribution";
|
|
56
|
-
var defaultReports = [{ ...emptyChartSelection, group: null, attribute: "artifact_name", type: defaultReportType }];
|
|
57
|
-
var PLANS = {
|
|
58
|
-
os: {
|
|
59
|
-
id: "os",
|
|
60
|
-
name: "Basic",
|
|
61
|
-
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."
|
|
62
|
-
},
|
|
63
|
-
professional: {
|
|
64
|
-
id: "professional",
|
|
65
|
-
name: "Professional",
|
|
66
|
-
description: "Everything in Basic, plus enhanced update management and automation features."
|
|
67
|
-
},
|
|
68
|
-
enterprise: {
|
|
69
|
-
id: "enterprise",
|
|
70
|
-
name: "Enterprise",
|
|
71
|
-
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."
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
var ADDONS = {
|
|
75
|
-
configure: {
|
|
76
|
-
id: "configure",
|
|
77
|
-
title: "Configure",
|
|
78
|
-
description: "Seamlessly configure applications and devices remotely \u2013 configure each device to its environment.",
|
|
79
|
-
needs: ["hasDeviceConfig"],
|
|
80
|
-
eligible: ["os", "professional", "enterprise"]
|
|
81
|
-
},
|
|
82
|
-
monitor: {
|
|
83
|
-
id: "monitor",
|
|
84
|
-
title: "Monitor",
|
|
85
|
-
description: "Detect and analyze health issues of devices, services and applications. Set up alerts so you can act quickly.",
|
|
86
|
-
needs: ["hasMonitor"],
|
|
87
|
-
eligible: ["professional", "enterprise"]
|
|
88
|
-
},
|
|
89
|
-
troubleshoot: {
|
|
90
|
-
id: "troubleshoot",
|
|
91
|
-
title: "Troubleshoot",
|
|
92
|
-
description: "Secure, remote access to your devices \u2013 quickly diagnose and fix issues in real time.",
|
|
93
|
-
needs: ["hasDeviceConnect"],
|
|
94
|
-
eligible: ["os", "professional", "enterprise"]
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
var BENEFITS = {
|
|
98
|
-
auditlog: {
|
|
99
|
-
id: "auditlog",
|
|
100
|
-
benefit: "gain access to logs for important events such as changes to devices, deployments and user management, as well as remote terminal session replays",
|
|
101
|
-
requiredPlan: PLANS.enterprise.id
|
|
102
|
-
},
|
|
103
|
-
dashboard: { id: "dashboard", benefit: "actionable insights into the devices you are updating with Mender", requiredPlan: PLANS.enterprise.id },
|
|
104
|
-
deltaGeneration: {
|
|
105
|
-
id: "deltaGeneration",
|
|
106
|
-
benefit: "automatic delta artifacts generation to minimize data transfer and improve the update delivery",
|
|
107
|
-
requiredPlan: PLANS.enterprise.id
|
|
108
|
-
},
|
|
109
|
-
deviceConfiguration: { id: "deviceConfiguration", benefit: "device configuration features", requiredAddon: ADDONS.configure.id },
|
|
110
|
-
deviceMonitor: { id: "deviceMonitor", benefit: "device monitoring features", requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },
|
|
111
|
-
deviceTroubleshoot: { id: "deviceTroubleshoot", benefit: "device troubleshooting features", requiredAddon: ADDONS.troubleshoot.id },
|
|
112
|
-
dynamicGroups: { id: "dynamicGroups", benefit: "create dynamic groups to ease device management", requiredPlan: PLANS.enterprise.id },
|
|
113
|
-
fullFiltering: { id: "fullFiltering", benefit: "filtering by multiple attributes to improve the device overview", requiredPlan: PLANS.professional.id },
|
|
114
|
-
gateway: { id: "gateway", benefit: "see devices connected to your gateway device for easy access", requiredPlans: PLANS.professional.id },
|
|
115
|
-
pausedDeployments: {
|
|
116
|
-
id: "pausedDeployments",
|
|
117
|
-
benefit: "granular control about update rollout to allow synchronization across your fleet",
|
|
118
|
-
requiredPlan: PLANS.enterprise.id
|
|
119
|
-
},
|
|
120
|
-
phasedDeployments: { id: "phasedDeployments", benefit: "choose to roll out deployments in multiple phases", requiredPlan: PLANS.enterprise.id },
|
|
121
|
-
rbac: { id: "rbac", benefit: "granular role based access control", requiredPlan: PLANS.enterprise.id },
|
|
122
|
-
retryDeployments: { id: "retryDeployments", benefit: "optional retries for failed rollout attempts", requiredPlan: PLANS.professional.id },
|
|
123
|
-
scheduledDeployments: {
|
|
124
|
-
id: "scheduledDeployments",
|
|
125
|
-
benefit: "scheduled deployments to steer the distribution of your updates.",
|
|
126
|
-
requiredPlan: PLANS.professional.id
|
|
127
|
-
},
|
|
128
|
-
webhookEvents: {
|
|
129
|
-
id: "webhookEvents",
|
|
130
|
-
benefit: "receive inventory events and select which type(s) of events the webhook will receive",
|
|
131
|
-
requiredPlan: PLANS.professional.id
|
|
132
|
-
},
|
|
133
|
-
default: { id: "default", benefit: "gain access to this feature", requiredPlan: PLANS.enterprise.id }
|
|
134
|
-
};
|
|
135
|
-
var DARK_MODE = "dark";
|
|
136
|
-
|
|
137
47
|
// src/commonConstants.tsx
|
|
138
48
|
var import_js = require("@mdi/js");
|
|
139
49
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -143,7 +53,6 @@ var timeUnits = {
|
|
|
143
53
|
hours: "hours"
|
|
144
54
|
};
|
|
145
55
|
var UNGROUPED_GROUP = { id: "*|=ungrouped=|*", name: "Unassigned" };
|
|
146
|
-
var DEVICE_LIST_MAXIMUM_LENGTH = 50;
|
|
147
56
|
var oneSecond = 1e3;
|
|
148
57
|
var TIMEOUTS = {
|
|
149
58
|
debounceDefault: 700,
|
|
@@ -158,7 +67,6 @@ var TIMEOUTS = {
|
|
|
158
67
|
};
|
|
159
68
|
var DEVICE_ONLINE_CUTOFF = { interval: 1, intervalName: timeUnits.days };
|
|
160
69
|
var defaultIdAttribute = Object.freeze({ attribute: "id", scope: import_constants3.ATTRIBUTE_SCOPES.identity });
|
|
161
|
-
var productOrder = ["micro", "standard", "system"];
|
|
162
70
|
var credentialTypes = {
|
|
163
71
|
aws: "aws",
|
|
164
72
|
http: "http",
|
|
@@ -612,48 +520,6 @@ var pauseMap = {
|
|
|
612
520
|
}
|
|
613
521
|
};
|
|
614
522
|
|
|
615
|
-
// src/onboardingSlice/constants.ts
|
|
616
|
-
var onboardingSteps = {
|
|
617
|
-
ONBOARDING_START: "onboarding-start",
|
|
618
|
-
DEVICES_PENDING_ONBOARDING_START: "devices-pending-onboarding-start",
|
|
619
|
-
DASHBOARD_ONBOARDING_START: "dashboard-onboarding-start",
|
|
620
|
-
DASHBOARD_ONBOARDING_PENDINGS: "dashboard-onboarding-pendings",
|
|
621
|
-
DEVICES_DELAYED_ONBOARDING: "devices-delayed-onboarding",
|
|
622
|
-
DEVICES_PENDING_ONBOARDING: "devices-pending-onboarding",
|
|
623
|
-
DEVICES_ACCEPTED_ONBOARDING: "devices-accepted-onboarding",
|
|
624
|
-
DEVICES_PENDING_ACCEPTING_ONBOARDING: "devices-pending-accepting-onboarding",
|
|
625
|
-
DEVICES_DEPLOY_RELEASE_ONBOARDING: "devices-deploy-release-onboarding",
|
|
626
|
-
SCHEDULING_ARTIFACT_SELECTION: "scheduling-artifact-selection",
|
|
627
|
-
SCHEDULING_ALL_DEVICES_SELECTION: "scheduling-all-devices-selection",
|
|
628
|
-
SCHEDULING_GROUP_SELECTION: "scheduling-group-selection",
|
|
629
|
-
SCHEDULING_RELEASE_TO_DEVICES: "scheduling-release-to-devices",
|
|
630
|
-
DEPLOYMENTS_INPROGRESS: "deployments-inprogress",
|
|
631
|
-
DEPLOYMENTS_COMPLETED: "deployments-completed",
|
|
632
|
-
DEPLOYMENTS_PAST: "deployments-past",
|
|
633
|
-
DEPLOYMENTS_PAST_COMPLETED: "deployments-past-completed",
|
|
634
|
-
DEPLOYMENTS_PAST_COMPLETED_FAILURE: "deployments-past-completed-failure",
|
|
635
|
-
ONBOARDING_CANCELED: "onboarding-canceled"
|
|
636
|
-
};
|
|
637
|
-
var orderedOnboardingSteps = [
|
|
638
|
-
onboardingSteps.DASHBOARD_ONBOARDING_START,
|
|
639
|
-
onboardingSteps.DEVICES_PENDING_ONBOARDING_START,
|
|
640
|
-
onboardingSteps.DEVICES_DELAYED_ONBOARDING,
|
|
641
|
-
onboardingSteps.DEVICES_PENDING_ONBOARDING,
|
|
642
|
-
onboardingSteps.DEVICES_PENDING_ACCEPTING_ONBOARDING,
|
|
643
|
-
onboardingSteps.DASHBOARD_ONBOARDING_PENDINGS,
|
|
644
|
-
onboardingSteps.DEVICES_ACCEPTED_ONBOARDING,
|
|
645
|
-
onboardingSteps.DEVICES_DEPLOY_RELEASE_ONBOARDING,
|
|
646
|
-
onboardingSteps.SCHEDULING_ALL_DEVICES_SELECTION,
|
|
647
|
-
onboardingSteps.SCHEDULING_GROUP_SELECTION,
|
|
648
|
-
onboardingSteps.SCHEDULING_ARTIFACT_SELECTION,
|
|
649
|
-
onboardingSteps.SCHEDULING_RELEASE_TO_DEVICES,
|
|
650
|
-
onboardingSteps.DEPLOYMENTS_INPROGRESS,
|
|
651
|
-
onboardingSteps.DEPLOYMENTS_PAST,
|
|
652
|
-
onboardingSteps.DEPLOYMENTS_PAST_COMPLETED,
|
|
653
|
-
onboardingSteps.DEPLOYMENTS_PAST_COMPLETED_FAILURE,
|
|
654
|
-
onboardingSteps.ONBOARDING_CANCELED
|
|
655
|
-
];
|
|
656
|
-
|
|
657
523
|
// src/organizationSlice/constants.ts
|
|
658
524
|
var auditlogTypes = {
|
|
659
525
|
artifact: { title: "Artifact", queryParameter: "object_type", value: "artifact" },
|
|
@@ -758,7 +624,6 @@ var initialState2 = {
|
|
|
758
624
|
hasManifestsEnabled: false,
|
|
759
625
|
hasMonitor: false,
|
|
760
626
|
hasMCUEnabled: false,
|
|
761
|
-
hasReporting: false,
|
|
762
627
|
isHosted: true,
|
|
763
628
|
isEnterprise: false
|
|
764
629
|
},
|
|
@@ -1701,89 +1566,24 @@ var Api = {
|
|
|
1701
1566
|
};
|
|
1702
1567
|
var general_api_default = Api;
|
|
1703
1568
|
|
|
1704
|
-
// src/
|
|
1569
|
+
// src/devicesSlice/selectors.ts
|
|
1705
1570
|
var import_helpers2 = require("@northern.tech/utils/helpers");
|
|
1706
1571
|
var import_toolkit9 = require("@reduxjs/toolkit");
|
|
1707
|
-
var getFeatures = (state) => state.app.features;
|
|
1708
|
-
var getFullVersionInformation = (state) => state.app.versionInformation;
|
|
1709
|
-
var getSearchState = (state) => state.app.searchState;
|
|
1710
|
-
var getUploads = (state) => state.app.uploadsById;
|
|
1711
|
-
var getIsUploading = (0, import_toolkit9.createSelector)([getUploads], (uploadsById) => !!Object.keys(uploadsById).length);
|
|
1712
|
-
var getSearchedDevices = (0, import_toolkit9.createSelector)([getSearchState], ({ deviceIds }) => deviceIds);
|
|
1713
|
-
var getVersionInformation = (0, import_toolkit9.createSelector)(
|
|
1714
|
-
[getFullVersionInformation, getFeatures],
|
|
1715
|
-
({ Integration, ...remainder }, { isHosted }) => isHosted && Integration !== "next" ? remainder : { ...remainder, Integration }
|
|
1716
|
-
);
|
|
1717
|
-
var getIsPreview = (0, import_toolkit9.createSelector)([getFullVersionInformation], ({ Integration }) => (0, import_helpers2.versionCompare)(Integration, "next") > -1);
|
|
1718
|
-
|
|
1719
|
-
// src/commonSelectors.ts
|
|
1720
|
-
var import_helpers5 = require("@northern.tech/utils/helpers");
|
|
1721
|
-
var import_toolkit15 = require("@reduxjs/toolkit");
|
|
1722
|
-
var import_dayjs = __toESM(require("dayjs"), 1);
|
|
1723
|
-
|
|
1724
|
-
// src/deploymentsSlice/selectors.ts
|
|
1725
|
-
var import_toolkit10 = require("@reduxjs/toolkit");
|
|
1726
|
-
var getDeploymentsById = (state) => state.deployments.byId;
|
|
1727
|
-
var getDeploymentsByStatus = (state) => state.deployments.byStatus;
|
|
1728
|
-
var getSelectedDeploymentDeviceIds = (state) => state.deployments.selectedDeviceIds;
|
|
1729
|
-
var getDeploymentsSelectionState = (state) => state.deployments.selectionState;
|
|
1730
|
-
var getDeploymentById = (0, import_toolkit10.createSelector)(
|
|
1731
|
-
[getDeploymentsById, (_, deploymentId) => deploymentId],
|
|
1732
|
-
(deploymentsById, deploymentId = "") => deploymentsById[deploymentId]
|
|
1733
|
-
);
|
|
1734
|
-
var getMappedDeploymentSelection = (0, import_toolkit10.createSelector)(
|
|
1735
|
-
[getDeploymentsSelectionState, (_, deploymentsState) => deploymentsState, getDeploymentsById],
|
|
1736
|
-
(selectionState, deploymentsState, deploymentsById) => {
|
|
1737
|
-
const { selection = [] } = selectionState[deploymentsState] ?? {};
|
|
1738
|
-
return selection.reduce((accu, id) => {
|
|
1739
|
-
if (deploymentsById[id]) {
|
|
1740
|
-
accu.push(deploymentsById[id]);
|
|
1741
|
-
}
|
|
1742
|
-
return accu;
|
|
1743
|
-
}, []);
|
|
1744
|
-
}
|
|
1745
|
-
);
|
|
1746
|
-
var relevantDeploymentStates = [DEPLOYMENT_STATES.pending, DEPLOYMENT_STATES.inprogress, DEPLOYMENT_STATES.finished];
|
|
1747
|
-
var DEPLOYMENT_CUTOFF = 3;
|
|
1748
|
-
var getRecentDeployments = (0, import_toolkit10.createSelector)(
|
|
1749
|
-
[getDeploymentsById, getDeploymentsByStatus],
|
|
1750
|
-
(deploymentsById, deploymentsByStatus) => Object.entries(deploymentsByStatus).reduce(
|
|
1751
|
-
(accu, [state, byStatus]) => {
|
|
1752
|
-
if (!relevantDeploymentStates.includes(state) || !byStatus.deploymentIds.length) {
|
|
1753
|
-
return accu;
|
|
1754
|
-
}
|
|
1755
|
-
accu[state] = byStatus.deploymentIds.reduce((accu2, id) => {
|
|
1756
|
-
if (deploymentsById[id]) {
|
|
1757
|
-
accu2.push(deploymentsById[id]);
|
|
1758
|
-
}
|
|
1759
|
-
return accu2;
|
|
1760
|
-
}, []).slice(0, DEPLOYMENT_CUTOFF);
|
|
1761
|
-
accu.total += byStatus.total;
|
|
1762
|
-
return accu;
|
|
1763
|
-
},
|
|
1764
|
-
{ total: 0 }
|
|
1765
|
-
)
|
|
1766
|
-
);
|
|
1767
|
-
|
|
1768
|
-
// src/devicesSlice/selectors.ts
|
|
1769
|
-
var import_helpers3 = require("@northern.tech/utils/helpers");
|
|
1770
|
-
var import_toolkit11 = require("@reduxjs/toolkit");
|
|
1771
1572
|
var getAcceptedDevices = (state) => state.devices.byStatus.accepted;
|
|
1772
1573
|
var getDevicesByStatus = (state) => state.devices.byStatus;
|
|
1773
1574
|
var getDevicesById = (state) => state.devices.byId;
|
|
1774
1575
|
var getGroupsById = (state) => state.devices.groups.byId;
|
|
1775
1576
|
var getSelectedGroup = (state) => state.devices.groups.selectedGroup;
|
|
1776
|
-
var getListedDevices = (state) => state.devices.deviceList.deviceIds;
|
|
1777
1577
|
var getFilteringAttributes = (state) => state.devices.filteringAttributes;
|
|
1778
1578
|
var getDeviceFilters = (state) => state.devices.filters || [];
|
|
1779
1579
|
var getFilteringAttributesFromConfig = (state) => state.devices.filteringAttributesConfig.attributes;
|
|
1780
|
-
var getSortedFilteringAttributes = (0,
|
|
1580
|
+
var getSortedFilteringAttributes = (0, import_toolkit9.createSelector)([getFilteringAttributes], (filteringAttributes) => ({
|
|
1781
1581
|
...filteringAttributes,
|
|
1782
1582
|
identityAttributes: [...filteringAttributes.identityAttributes, "id"]
|
|
1783
1583
|
}));
|
|
1784
1584
|
var getDeviceLimits = (state) => state.devices.limits;
|
|
1785
1585
|
var getFilteringAttributesLimit = (state) => state.devices.filteringAttributesLimit;
|
|
1786
|
-
var getDeviceIdentityAttributes = (0,
|
|
1586
|
+
var getDeviceIdentityAttributes = (0, import_toolkit9.createSelector)(
|
|
1787
1587
|
[getFilteringAttributes, getFilteringAttributesLimit],
|
|
1788
1588
|
({ identityAttributes }, filteringAttributesLimit) => {
|
|
1789
1589
|
const attributes = identityAttributes.slice(0, filteringAttributesLimit);
|
|
@@ -1799,7 +1599,7 @@ var getDeviceIdentityAttributes = (0, import_toolkit11.createSelector)(
|
|
|
1799
1599
|
);
|
|
1800
1600
|
}
|
|
1801
1601
|
);
|
|
1802
|
-
var getDeviceCountsByStatus = (0,
|
|
1602
|
+
var getDeviceCountsByStatus = (0, import_toolkit9.createSelector)(
|
|
1803
1603
|
[getDevicesByStatus],
|
|
1804
1604
|
(byStatus) => Object.values(import_constants3.DEVICE_STATES).reduce(
|
|
1805
1605
|
(accu, deviceState) => {
|
|
@@ -1813,8 +1613,8 @@ var getDeviceCountsByStatus = (0, import_toolkit11.createSelector)(
|
|
|
1813
1613
|
{ total: 0 }
|
|
1814
1614
|
)
|
|
1815
1615
|
);
|
|
1816
|
-
var getDeviceById = (0,
|
|
1817
|
-
var getSelectedGroupInfo = (0,
|
|
1616
|
+
var getDeviceById = (0, import_toolkit9.createSelector)([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = "") => devicesById[deviceId] ?? {});
|
|
1617
|
+
var getSelectedGroupInfo = (0, import_toolkit9.createSelector)(
|
|
1818
1618
|
[getDeviceCountsByStatus, getGroupsById, getSelectedGroup],
|
|
1819
1619
|
({ accepted: acceptedDeviceTotal }, groupsById, selectedGroup) => {
|
|
1820
1620
|
let groupCount = acceptedDeviceTotal;
|
|
@@ -1826,22 +1626,22 @@ var getSelectedGroupInfo = (0, import_toolkit11.createSelector)(
|
|
|
1826
1626
|
return { groupCount, selectedGroup, groupFilters };
|
|
1827
1627
|
}
|
|
1828
1628
|
);
|
|
1829
|
-
var getCombinedLimit = (0,
|
|
1629
|
+
var getCombinedLimit = (0, import_toolkit9.createSelector)(
|
|
1830
1630
|
[getDeviceLimits],
|
|
1831
1631
|
(deviceLimits) => Object.values(deviceLimits).reduce((accu, limit) => accu + Math.max(limit ?? 0, 0), 0)
|
|
1832
1632
|
// limit might be -1 for unlimited devices
|
|
1833
1633
|
);
|
|
1834
|
-
var getLimitMaxed = (0,
|
|
1634
|
+
var getLimitMaxed = (0, import_toolkit9.createSelector)(
|
|
1835
1635
|
[getDeviceCountsByStatus, getCombinedLimit],
|
|
1836
1636
|
({ accepted: acceptedDevices }, combinedLimit) => !!combinedLimit && combinedLimit <= acceptedDevices
|
|
1837
1637
|
);
|
|
1838
|
-
var getGroupsByIdWithoutUngrouped = (0,
|
|
1839
|
-
var getGroupData = (0,
|
|
1638
|
+
var getGroupsByIdWithoutUngrouped = (0, import_toolkit9.createSelector)([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);
|
|
1639
|
+
var getGroupData = (0, import_toolkit9.createSelector)([getGroupsByIdWithoutUngrouped], (groups) => {
|
|
1840
1640
|
const createdGroup = Object.keys(groups).length ? Object.keys(groups)[0] : void 0;
|
|
1841
1641
|
const hasDynamicGroups = Object.values(groups).some((group) => !!group.id);
|
|
1842
1642
|
return { createdGroup, hasDynamicGroups, groups };
|
|
1843
1643
|
});
|
|
1844
|
-
var getGroups = (0,
|
|
1644
|
+
var getGroups = (0, import_toolkit9.createSelector)([getGroupsById], (groupsById) => {
|
|
1845
1645
|
const groupNames = Object.keys(groupsById).sort();
|
|
1846
1646
|
const groupedGroups = Object.entries(groupsById).sort((a, b) => a[0].localeCompare(b[0])).reduce(
|
|
1847
1647
|
(accu, [groupname, group]) => {
|
|
@@ -1862,13 +1662,13 @@ var getGroups = (0, import_toolkit11.createSelector)([getGroupsById], (groupsByI
|
|
|
1862
1662
|
);
|
|
1863
1663
|
return { groupNames, ...groupedGroups };
|
|
1864
1664
|
});
|
|
1865
|
-
var getAttributesList = (0,
|
|
1665
|
+
var getAttributesList = (0, import_toolkit9.createSelector)(
|
|
1866
1666
|
[getFilteringAttributes, getFilteringAttributesFromConfig],
|
|
1867
|
-
({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) => [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(
|
|
1667
|
+
({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) => [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(import_helpers2.duplicateFilter)
|
|
1868
1668
|
);
|
|
1869
|
-
var getEnabledTierLimits = (0,
|
|
1870
|
-
var getEnabledTiers = (0,
|
|
1871
|
-
var getDeviceLimitStats = (0,
|
|
1669
|
+
var getEnabledTierLimits = (0, import_toolkit9.createSelector)([getDeviceLimits], (limits) => Object.entries(limits).filter(([, limit]) => limit !== 0));
|
|
1670
|
+
var getEnabledTiers = (0, import_toolkit9.createSelector)([getEnabledTierLimits], (enabledTierLimits) => enabledTierLimits.map(([type]) => type));
|
|
1671
|
+
var getDeviceLimitStats = (0, import_toolkit9.createSelector)([getEnabledTierLimits, getAcceptedDevices], (enabledTierLimits, accepted) => {
|
|
1872
1672
|
const { counts } = accepted;
|
|
1873
1673
|
return enabledTierLimits.map(([type, limit]) => ({
|
|
1874
1674
|
type,
|
|
@@ -1876,7 +1676,7 @@ var getDeviceLimitStats = (0, import_toolkit11.createSelector)([getEnabledTierLi
|
|
|
1876
1676
|
total: counts[type] || 0
|
|
1877
1677
|
}));
|
|
1878
1678
|
});
|
|
1879
|
-
var getDeviceTypes = (0,
|
|
1679
|
+
var getDeviceTypes = (0, import_toolkit9.createSelector)(
|
|
1880
1680
|
[getAcceptedDevices, getDevicesById],
|
|
1881
1681
|
({ deviceIds = [] }, devicesById) => Object.keys(
|
|
1882
1682
|
deviceIds.slice(0, 200).reduce((accu, item) => {
|
|
@@ -1892,82 +1692,8 @@ var getDeviceTypes = (0, import_toolkit11.createSelector)(
|
|
|
1892
1692
|
)
|
|
1893
1693
|
);
|
|
1894
1694
|
|
|
1895
|
-
// src/monitorSlice/selectors.ts
|
|
1896
|
-
var getIssueCountsByType = (state) => state.monitor.issueCounts.byType;
|
|
1897
|
-
|
|
1898
|
-
// src/onboardingSlice/selectors.ts
|
|
1899
|
-
var getOnboarding = (state) => state.onboarding;
|
|
1900
|
-
|
|
1901
|
-
// src/organizationSlice/selectors.ts
|
|
1902
|
-
var import_toolkit12 = require("@reduxjs/toolkit");
|
|
1903
|
-
var getOrganization = (state) => state.organization.organization;
|
|
1904
|
-
var getExternalIntegrations = (state) => state.organization.externalDeviceIntegrations;
|
|
1905
|
-
var getAuditLog = (state) => state.organization.auditlog.events;
|
|
1906
|
-
var getAuditLogSelectionState = (state) => state.organization.auditlog.selectionState;
|
|
1907
|
-
var getTenantsList = (state) => state.organization.tenantList;
|
|
1908
|
-
var getWebhookEvents = (state) => state.organization.webhooks.events;
|
|
1909
|
-
var getWebhookEventTotal = (state) => state.organization.webhooks.eventsTotal;
|
|
1910
|
-
var getDeviceTwinIntegrations = (0, import_toolkit12.createSelector)(
|
|
1911
|
-
[getExternalIntegrations],
|
|
1912
|
-
(integrations) => integrations.filter((integration) => integration.id && EXTERNAL_PROVIDER[integration.provider]?.deviceTwin)
|
|
1913
|
-
);
|
|
1914
|
-
var getIsServiceProvider = (state) => state.organization.organization.service_provider;
|
|
1915
|
-
var getWebhooks = (0, import_toolkit12.createSelector)(
|
|
1916
|
-
[getExternalIntegrations],
|
|
1917
|
-
(integrations) => integrations.filter((integration) => integration.id && integration.provider === EXTERNAL_PROVIDER.webhook.provider)
|
|
1918
|
-
);
|
|
1919
|
-
var getWebhookEventInfo = (0, import_toolkit12.createSelector)(
|
|
1920
|
-
[getWebhooks, getWebhookEvents, getWebhookEventTotal],
|
|
1921
|
-
(webhooks, events, eventTotal) => webhooks.length ? { events, eventTotal } : { events: [], eventTotal: 0 }
|
|
1922
|
-
);
|
|
1923
|
-
var getAuditLogEntry = (0, import_toolkit12.createSelector)([getAuditLog, getAuditLogSelectionState], (events, { selectedId }) => {
|
|
1924
|
-
if (!selectedId) {
|
|
1925
|
-
return;
|
|
1926
|
-
}
|
|
1927
|
-
const [eventAction, eventTime] = atob(selectedId).split("|");
|
|
1928
|
-
return events.find((item) => item.action === eventAction && item.time === eventTime);
|
|
1929
|
-
});
|
|
1930
|
-
var toTierName = (key) => key.replace(/max_|_?devices/g, "") || "standard";
|
|
1931
|
-
var processDeviceLimits = (deviceLimits, skipFilter = false) => {
|
|
1932
|
-
const result = { limits: {}, disabled: [] };
|
|
1933
|
-
if (!deviceLimits) return result;
|
|
1934
|
-
const tiersByName = Object.fromEntries(Object.entries(deviceLimits).map(([key, limit]) => [toTierName(key), { key, limit }]));
|
|
1935
|
-
return productOrder.reduce((accu, tierName) => {
|
|
1936
|
-
const entry = tiersByName[tierName];
|
|
1937
|
-
if (!entry) return accu;
|
|
1938
|
-
const { key, limit } = entry;
|
|
1939
|
-
if (limit.value === 0) {
|
|
1940
|
-
accu.disabled.push(tierName);
|
|
1941
|
-
if (!skipFilter) return accu;
|
|
1942
|
-
}
|
|
1943
|
-
accu.limits[tierName] = {
|
|
1944
|
-
id: tierName,
|
|
1945
|
-
backendId: key,
|
|
1946
|
-
limit: limit.value,
|
|
1947
|
-
current: limit.current_value,
|
|
1948
|
-
name: tierName,
|
|
1949
|
-
quotaLeft: Math.max(limit.value - limit.current_value, 0),
|
|
1950
|
-
limitReached: limit.value !== -1 && limit.value <= limit.current_value
|
|
1951
|
-
};
|
|
1952
|
-
return accu;
|
|
1953
|
-
}, result);
|
|
1954
|
-
};
|
|
1955
|
-
var getDeviceLimitsInfo = (0, import_toolkit12.createSelector)([getOrganization], ({ device_limits }) => processDeviceLimits(device_limits));
|
|
1956
|
-
var getDisabledTiers = (0, import_toolkit12.createSelector)([getDeviceLimitsInfo], ({ disabled }) => disabled);
|
|
1957
|
-
var getSpLimits = (0, import_toolkit12.createSelector)([getDeviceLimitsInfo], ({ limits }) => limits);
|
|
1958
|
-
var getTenantListWithLimits = (0, import_toolkit12.createSelector)([getTenantsList], (tenantList) => ({
|
|
1959
|
-
...tenantList,
|
|
1960
|
-
tenants: tenantList.tenants.map((tenant) => ({
|
|
1961
|
-
...tenant,
|
|
1962
|
-
device_limits: processDeviceLimits(tenant.device_limits, true).limits
|
|
1963
|
-
}))
|
|
1964
|
-
}));
|
|
1965
|
-
|
|
1966
|
-
// src/releasesSlice/selectors.ts
|
|
1967
|
-
var import_toolkit13 = require("@reduxjs/toolkit");
|
|
1968
|
-
|
|
1969
1695
|
// src/utils.ts
|
|
1970
|
-
var
|
|
1696
|
+
var import_helpers3 = require("@northern.tech/utils/helpers");
|
|
1971
1697
|
var filterProcessors = {
|
|
1972
1698
|
[import_constants3.DEVICE_FILTERING_OPTIONS.$gt.key]: (val) => Number(val) || val,
|
|
1973
1699
|
[import_constants3.DEVICE_FILTERING_OPTIONS.$gte.key]: (val) => Number(val) || val,
|
|
@@ -1976,7 +1702,7 @@ var filterProcessors = {
|
|
|
1976
1702
|
[import_constants3.DEVICE_FILTERING_OPTIONS.$ltne.key]: (val) => Number(val) || val,
|
|
1977
1703
|
[import_constants3.DEVICE_FILTERING_OPTIONS.$in.key]: (val) => ("" + val).split(",").map((i) => i.trim()),
|
|
1978
1704
|
[import_constants3.DEVICE_FILTERING_OPTIONS.$nin.key]: (val) => ("" + val).split(",").map((i) => i.trim()),
|
|
1979
|
-
[import_constants3.DEVICE_FILTERING_OPTIONS.$exists.key]:
|
|
1705
|
+
[import_constants3.DEVICE_FILTERING_OPTIONS.$exists.key]: import_helpers3.yes,
|
|
1980
1706
|
[import_constants3.DEVICE_FILTERING_OPTIONS.$nexists.key]: () => false
|
|
1981
1707
|
};
|
|
1982
1708
|
var filterAliases = {
|
|
@@ -2016,336 +1742,11 @@ var convertDeviceListStateToFilters = ({
|
|
|
2016
1742
|
const effectiveFilters = status ? [...applicableFilters, { key: "status", value: status, operator: import_constants3.DEVICE_FILTERING_OPTIONS.$eq.key, scope: "identity" }] : applicableFilters;
|
|
2017
1743
|
return { applicableFilters: nonMonitorFilters, filterTerms: mapFiltersToTerms(effectiveFilters) };
|
|
2018
1744
|
};
|
|
2019
|
-
var listItemMapper = (byId, ids, { cutOffSize = DEVICE_LIST_MAXIMUM_LENGTH, defaultObject = {} }) => ids.slice(0, cutOffSize).reduce((accu, id) => {
|
|
2020
|
-
if (id && byId[id]) {
|
|
2021
|
-
accu.push({ ...defaultObject, ...byId[id] });
|
|
2022
|
-
}
|
|
2023
|
-
return accu;
|
|
2024
|
-
}, []);
|
|
2025
|
-
var mergePermissions = (existingPermissions = { ...import_constants3.emptyUiPermissions }, addedPermissions) => Object.entries(existingPermissions).reduce(
|
|
2026
|
-
(accu, [key, value]) => {
|
|
2027
|
-
let values;
|
|
2028
|
-
if (!accu[key]) {
|
|
2029
|
-
accu[key] = value;
|
|
2030
|
-
return accu;
|
|
2031
|
-
}
|
|
2032
|
-
if (Array.isArray(value)) {
|
|
2033
|
-
values = [...value, ...accu[key]].filter(import_helpers4.duplicateFilter);
|
|
2034
|
-
} else {
|
|
2035
|
-
values = mergePermissions(accu[key], { ...value });
|
|
2036
|
-
}
|
|
2037
|
-
accu[key] = values;
|
|
2038
|
-
return accu;
|
|
2039
|
-
},
|
|
2040
|
-
{ ...addedPermissions }
|
|
2041
|
-
);
|
|
2042
|
-
var mapUserRolesToUiPermissions = (userRoles, roles) => userRoles.reduce(
|
|
2043
|
-
(accu, roleId) => {
|
|
2044
|
-
if (!(roleId && roles[roleId])) {
|
|
2045
|
-
return accu;
|
|
2046
|
-
}
|
|
2047
|
-
return mergePermissions(accu, roles[roleId].uiPermissions);
|
|
2048
|
-
},
|
|
2049
|
-
{ ...import_constants3.emptyUiPermissions }
|
|
2050
|
-
);
|
|
2051
|
-
var isDarkMode = (mode) => mode === DARK_MODE;
|
|
2052
|
-
|
|
2053
|
-
// src/releasesSlice/selectors.ts
|
|
2054
|
-
var getSelectedReleaseId = (state) => state.releases.selectedRelease;
|
|
2055
|
-
var getReleasesById = (state) => state.releases.byId;
|
|
2056
|
-
var getReleaseTags = (state) => state.releases.tags;
|
|
2057
|
-
var getReleaseListState = (state) => state.releases.releasesList;
|
|
2058
|
-
var getListedReleases = (state) => state.releases.releasesList.releaseIds;
|
|
2059
|
-
var releaseDefaults = {};
|
|
2060
|
-
var getReleaseMappingDefaults = () => releaseDefaults;
|
|
2061
|
-
var getReleasesList = (0, import_toolkit13.createSelector)([getReleasesById, getListedReleases, getReleaseMappingDefaults], listItemMapper);
|
|
2062
|
-
var getReleaseTagsById = (0, import_toolkit13.createSelector)([getReleaseTags], (releaseTags) => releaseTags.reduce((accu, key) => ({ ...accu, [key]: key }), {}));
|
|
2063
|
-
var getHasReleases = (0, import_toolkit13.createSelector)(
|
|
2064
|
-
[getReleaseListState, getReleasesById],
|
|
2065
|
-
({ searchTotal, total }, byId) => !!(Object.keys(byId).length || total || searchTotal)
|
|
2066
|
-
);
|
|
2067
|
-
var getSelectedRelease = (0, import_toolkit13.createSelector)([getReleasesById, getSelectedReleaseId], (byId, id) => byId[id || ""] ?? {});
|
|
2068
|
-
var getSelectedReleases = (0, import_toolkit13.createSelector)([getReleaseListState, getReleasesList], ({ selection }, releases) => selection.map((index) => releases[index]));
|
|
2069
|
-
var getDeltaJobsById = (state) => state.releases.deltaJobs;
|
|
2070
|
-
var getDeltaJobById = (0, import_toolkit13.createSelector)([getDeltaJobsById, (_, jobId) => jobId], (byId, jobId) => byId[jobId]);
|
|
2071
|
-
var getSelectedJobId = (state) => state.releases.selectedJob;
|
|
2072
|
-
var getSelectedJob = (0, import_toolkit13.createSelector)([getDeltaJobsById, getSelectedJobId], (byId, jobId) => byId[jobId || ""]);
|
|
2073
|
-
|
|
2074
|
-
// src/usersSlice/selectors.ts
|
|
2075
|
-
var import_toolkit14 = require("@reduxjs/toolkit");
|
|
2076
|
-
var emptyObject = {};
|
|
2077
|
-
var getRolesById = (state) => state.users.rolesById;
|
|
2078
|
-
var getTooltipsById = (state) => state.users.tooltips.byId;
|
|
2079
|
-
var getGlobalSettings = (state) => state.users.globalSettings;
|
|
2080
|
-
var getUserSettingsInitialized = (state) => state.users.userSettingsInitialized;
|
|
2081
|
-
var getCurrentUserId = (state) => state.users.currentUser;
|
|
2082
|
-
var getUsersById = (state) => state.users.byId;
|
|
2083
|
-
var getUsersList = (0, import_toolkit14.createSelector)([getUsersById], (usersById) => Object.values(usersById));
|
|
2084
|
-
var getCurrentUser = (0, import_toolkit14.createSelector)(
|
|
2085
|
-
[getUsersById, getCurrentUserId],
|
|
2086
|
-
(usersById, userId) => userId ? usersById[userId] ?? emptyObject : emptyObject
|
|
2087
|
-
);
|
|
2088
|
-
var getUserSettings = (state) => state.users.userSettings;
|
|
2089
|
-
var getSelectedDeviceAttribute = (0, import_toolkit14.createSelector)(
|
|
2090
|
-
[getUserSettings],
|
|
2091
|
-
({ columnSelection }) => columnSelection.map((attribute) => ({ attribute: attribute.key, scope: attribute.scope }))
|
|
2092
|
-
);
|
|
2093
|
-
var getIsDarkMode = (0, import_toolkit14.createSelector)([getUserSettings], ({ mode }) => isDarkMode(mode));
|
|
2094
|
-
var getReadAllHelptips = (0, import_toolkit14.createSelector)(
|
|
2095
|
-
[getTooltipsById],
|
|
2096
|
-
(tooltips) => Object.values(tooltips).every(({ readState }) => readState === READ_STATES.read)
|
|
2097
|
-
);
|
|
2098
|
-
var getTooltipsState = (0, import_toolkit14.createSelector)(
|
|
2099
|
-
[getTooltipsById, getUserSettings],
|
|
2100
|
-
(byId, { tooltips = {} }) => Object.entries(byId).reduce(
|
|
2101
|
-
(accu, [id, value]) => {
|
|
2102
|
-
accu[id] = { ...accu[id], ...value };
|
|
2103
|
-
return accu;
|
|
2104
|
-
},
|
|
2105
|
-
{ ...tooltips }
|
|
2106
|
-
)
|
|
2107
|
-
);
|
|
2108
|
-
var getHas2FA = (0, import_toolkit14.createSelector)(
|
|
2109
|
-
[getCurrentUser],
|
|
2110
|
-
(currentUser) => currentUser.hasOwnProperty("tfa_status") && currentUser.tfa_status === import_constants3.twoFAStates.enabled
|
|
2111
|
-
);
|
|
2112
|
-
var getIdAttribute = (0, import_toolkit14.createSelector)([getGlobalSettings], ({ id_attribute = { ...defaultIdAttribute } }) => id_attribute);
|
|
2113
|
-
var getOfflineThresholdSettings = (0, import_toolkit14.createSelector)([getGlobalSettings], ({ offlineThreshold }) => ({
|
|
2114
|
-
interval: offlineThreshold?.interval || DEVICE_ONLINE_CUTOFF.interval,
|
|
2115
|
-
intervalUnit: offlineThreshold?.intervalUnit || DEVICE_ONLINE_CUTOFF.intervalName
|
|
2116
|
-
}));
|
|
2117
|
-
var getRolesList = (0, import_toolkit14.createSelector)([getRolesById], (rolesById2) => Object.entries(rolesById2).map(([value, role]) => ({ value, ...role })));
|
|
2118
|
-
var getSecurityAlertDismissedTimestamp = (state) => state.users.userSettings.securityAlertDismissedTimestamp;
|
|
2119
|
-
|
|
2120
|
-
// src/commonSelectors.ts
|
|
2121
|
-
var getIsEnterprise = (0, import_toolkit15.createSelector)(
|
|
2122
|
-
[getOrganization, getFeatures],
|
|
2123
|
-
({ plan = PLANS.os.id }, { isEnterprise, isHosted }) => isEnterprise || isHosted && plan === PLANS.enterprise.id
|
|
2124
|
-
);
|
|
2125
|
-
var getAttrsEndpoint = (0, import_toolkit15.createSelector)(
|
|
2126
|
-
[getFeatures],
|
|
2127
|
-
({ hasReporting }) => hasReporting ? `${import_constants3.reportingApiUrl}/devices/search/attributes` : `${import_constants3.inventoryApiUrlV2}/filters/attributes`
|
|
2128
|
-
);
|
|
2129
|
-
var getSearchEndpoint = (0, import_toolkit15.createSelector)(
|
|
2130
|
-
[getFeatures],
|
|
2131
|
-
({ hasReporting }) => hasReporting ? `${import_constants3.reportingApiUrl}/devices/search` : `${import_constants3.inventoryApiUrlV2}/filters/search`
|
|
2132
|
-
);
|
|
2133
|
-
var getUserRoles = (0, import_toolkit15.createSelector)([getCurrentUser, getRolesById, getIsEnterprise], (currentUser, rolesById2, isEnterprise) => {
|
|
2134
|
-
const isAdmin = currentUser.roles?.length ? currentUser.roles.some((role) => role === import_constants3.rolesByName.admin) : !isEnterprise;
|
|
2135
|
-
const uiPermissions = isAdmin ? mapUserRolesToUiPermissions([import_constants3.rolesByName.admin], rolesById2) : mapUserRolesToUiPermissions(currentUser.roles || [], rolesById2);
|
|
2136
|
-
return { isAdmin, uiPermissions };
|
|
2137
|
-
});
|
|
2138
|
-
var hasPermission = (thing, permission) => Object.values(thing).some((permissions) => permissions.includes(permission));
|
|
2139
|
-
var getUserCapabilities = (0, import_toolkit15.createSelector)([getUserRoles, getIsServiceProvider], ({ uiPermissions }, isServiceProvider) => {
|
|
2140
|
-
const canManageReleases = hasPermission(uiPermissions.releases, import_constants3.uiPermissionsById.manage.value);
|
|
2141
|
-
const canReadReleases = canManageReleases || hasPermission(uiPermissions.releases, import_constants3.uiPermissionsById.read.value);
|
|
2142
|
-
const canUploadReleases = canManageReleases || hasPermission(uiPermissions.releases, import_constants3.uiPermissionsById.upload.value);
|
|
2143
|
-
const canAuditlog = uiPermissions.auditlog.includes(import_constants3.uiPermissionsById.read.value);
|
|
2144
|
-
const canReadUsers = uiPermissions.userManagement.includes(import_constants3.uiPermissionsById.read.value);
|
|
2145
|
-
const canManageUsers = uiPermissions.userManagement.includes(import_constants3.uiPermissionsById.manage.value);
|
|
2146
|
-
const canReadDevices = hasPermission(uiPermissions.groups, import_constants3.uiPermissionsById.read.value);
|
|
2147
|
-
const canWriteDevices = Object.values(uiPermissions.groups).some(
|
|
2148
|
-
(groupPermissions) => groupPermissions.includes(import_constants3.uiPermissionsById.read.value) && groupPermissions.length > 1
|
|
2149
|
-
);
|
|
2150
|
-
const canTroubleshoot = hasPermission(uiPermissions.groups, import_constants3.uiPermissionsById.connect.value);
|
|
2151
|
-
const canManageDevices = hasPermission(uiPermissions.groups, import_constants3.uiPermissionsById.manage.value);
|
|
2152
|
-
const canConfigure = hasPermission(uiPermissions.groups, import_constants3.uiPermissionsById.configure.value);
|
|
2153
|
-
const canDeploy = uiPermissions.deployments.includes(import_constants3.uiPermissionsById.deploy.value) || hasPermission(uiPermissions.groups, import_constants3.uiPermissionsById.deploy.value);
|
|
2154
|
-
const canReadDeployments = uiPermissions.deployments.includes(import_constants3.uiPermissionsById.read.value);
|
|
2155
|
-
return {
|
|
2156
|
-
canAuditlog,
|
|
2157
|
-
canConfigure,
|
|
2158
|
-
canDeploy,
|
|
2159
|
-
canManageDevices,
|
|
2160
|
-
canManageReleases,
|
|
2161
|
-
canManageUsers,
|
|
2162
|
-
canReadDeployments,
|
|
2163
|
-
canReadDevices,
|
|
2164
|
-
canReadReleases,
|
|
2165
|
-
canReadUsers,
|
|
2166
|
-
canTroubleshoot,
|
|
2167
|
-
canUploadReleases,
|
|
2168
|
-
canWriteDevices,
|
|
2169
|
-
groupsPermissions: uiPermissions.groups,
|
|
2170
|
-
releasesPermissions: uiPermissions.releases,
|
|
2171
|
-
SPTenant: isServiceProvider
|
|
2172
|
-
};
|
|
2173
|
-
});
|
|
2174
|
-
var getTenantCapabilities = (0, import_toolkit15.createSelector)(
|
|
2175
|
-
[getFeatures, getOrganization, getIsEnterprise],
|
|
2176
|
-
({
|
|
2177
|
-
hasAuditlogs: isAuditlogEnabled,
|
|
2178
|
-
hasDeviceConfig: isDeviceConfigEnabled,
|
|
2179
|
-
hasDeviceConnect: isDeviceConnectEnabled,
|
|
2180
|
-
hasMonitor: isMonitorEnabled,
|
|
2181
|
-
isHosted
|
|
2182
|
-
}, { addons = [], plan = PLANS.os.id }, isEnterprise) => {
|
|
2183
|
-
const canDelta = isEnterprise || plan === PLANS.professional.id;
|
|
2184
|
-
const hasAuditlogs = isAuditlogEnabled && isEnterprise;
|
|
2185
|
-
const hasDeviceConfig = addons.some((addon) => addon.name === ADDONS.configure.id && addon.enabled) || isDeviceConfigEnabled && !isHosted;
|
|
2186
|
-
const hasDeviceConnect = addons.some((addon) => addon.name === ADDONS.troubleshoot.id && addon.enabled) || isDeviceConnectEnabled && !isHosted;
|
|
2187
|
-
const hasMonitor = isMonitorEnabled && addons.some((addon) => addon.name === ADDONS.monitor.id && addon.enabled);
|
|
2188
|
-
return {
|
|
2189
|
-
canDelta,
|
|
2190
|
-
canRetry: canDelta,
|
|
2191
|
-
canSchedule: canDelta,
|
|
2192
|
-
hasAuditlogs,
|
|
2193
|
-
hasDeviceConfig,
|
|
2194
|
-
hasDeviceConnect,
|
|
2195
|
-
hasFullFiltering: canDelta,
|
|
2196
|
-
hasMonitor,
|
|
2197
|
-
isEnterprise,
|
|
2198
|
-
plan
|
|
2199
|
-
};
|
|
2200
|
-
}
|
|
2201
|
-
);
|
|
2202
|
-
var getFilterAttributes = (0, import_toolkit15.createSelector)(
|
|
2203
|
-
[getGlobalSettings, getFilteringAttributes],
|
|
2204
|
-
({ previousFilters }, { identityAttributes, inventoryAttributes, systemAttributes, tagAttributes }) => {
|
|
2205
|
-
const deviceNameAttribute = { key: "name", value: "Name", scope: import_constants3.ATTRIBUTE_SCOPES.tags, category: import_constants3.ATTRIBUTE_SCOPES.tags, priority: 1 };
|
|
2206
|
-
const deviceIdAttribute = { key: "id", value: "Device ID", scope: import_constants3.ATTRIBUTE_SCOPES.identity, category: import_constants3.ATTRIBUTE_SCOPES.identity, priority: 1 };
|
|
2207
|
-
const checkInAttribute = { key: "check_in_time", value: "Latest activity", scope: import_constants3.ATTRIBUTE_SCOPES.system, category: import_constants3.ATTRIBUTE_SCOPES.system, priority: 4 };
|
|
2208
|
-
const updateAttribute = { ...checkInAttribute, key: "updated_ts", value: "Last inventory update" };
|
|
2209
|
-
const firstRequestAttribute = { key: "created_ts", value: "First request", scope: import_constants3.ATTRIBUTE_SCOPES.system, category: import_constants3.ATTRIBUTE_SCOPES.system, priority: 4 };
|
|
2210
|
-
const attributes = [
|
|
2211
|
-
...previousFilters.map((item) => ({
|
|
2212
|
-
...item,
|
|
2213
|
-
value: deviceIdAttribute.key === item.key ? deviceIdAttribute.value : item.key,
|
|
2214
|
-
category: "recently used",
|
|
2215
|
-
priority: 0
|
|
2216
|
-
})),
|
|
2217
|
-
deviceNameAttribute,
|
|
2218
|
-
deviceIdAttribute,
|
|
2219
|
-
...identityAttributes.map((item) => ({ key: item, value: item, scope: import_constants3.ATTRIBUTE_SCOPES.identity, category: import_constants3.ATTRIBUTE_SCOPES.identity, priority: 1 })),
|
|
2220
|
-
...inventoryAttributes.map((item) => ({ key: item, value: item, scope: import_constants3.ATTRIBUTE_SCOPES.inventory, category: import_constants3.ATTRIBUTE_SCOPES.inventory, priority: 2 })),
|
|
2221
|
-
...tagAttributes.map((item) => ({ key: item, value: item, scope: import_constants3.ATTRIBUTE_SCOPES.tags, category: import_constants3.ATTRIBUTE_SCOPES.tags, priority: 3 })),
|
|
2222
|
-
checkInAttribute,
|
|
2223
|
-
updateAttribute,
|
|
2224
|
-
firstRequestAttribute,
|
|
2225
|
-
...systemAttributes.map((item) => ({ key: item, value: item, scope: import_constants3.ATTRIBUTE_SCOPES.system, category: import_constants3.ATTRIBUTE_SCOPES.system, priority: 4 }))
|
|
2226
|
-
];
|
|
2227
|
-
return (0, import_helpers5.attributeDuplicateFilter)(attributes, "key");
|
|
2228
|
-
}
|
|
2229
|
-
);
|
|
2230
|
-
var getOnboardingState = (0, import_toolkit15.createSelector)([getOnboarding, getUserSettings], ({ complete, progress, showTips, ...remainder }, { onboarding = {} }) => ({
|
|
2231
|
-
...remainder,
|
|
2232
|
-
...onboarding,
|
|
2233
|
-
complete: onboarding.complete || complete,
|
|
2234
|
-
progress: Object.keys(onboardingSteps).findIndex((step) => step === progress) > Object.keys(onboardingSteps).findIndex((step) => step === onboarding.progress) ? progress : onboarding.progress,
|
|
2235
|
-
showTips: !onboarding.showTips ? onboarding.showTips : showTips
|
|
2236
|
-
}));
|
|
2237
|
-
var getDemoDeviceAddress = (0, import_toolkit15.createSelector)([getDevicesById, getOnboarding], (devicesById, { approach, demoArtifactPort }) => {
|
|
2238
|
-
const demoDeviceAddress = `http://${(0, import_helpers5.getDemoDeviceAddress)(Object.values(devicesById), approach)}`;
|
|
2239
|
-
return demoArtifactPort ? `${demoDeviceAddress}:${demoArtifactPort}` : demoDeviceAddress;
|
|
2240
|
-
});
|
|
2241
|
-
var getDeviceConfigDeployment = (0, import_toolkit15.createSelector)([getDeviceById, getDeploymentsById], (device, deploymentsById) => {
|
|
2242
|
-
const { config = {} } = device;
|
|
2243
|
-
const { deployment_id: configDeploymentId } = config;
|
|
2244
|
-
const deviceConfigDeployment = deploymentsById[configDeploymentId] || {};
|
|
2245
|
-
return { device, deviceConfigDeployment };
|
|
2246
|
-
});
|
|
2247
|
-
var getDeploymentRelease = (0, import_toolkit15.createSelector)(
|
|
2248
|
-
[getDeploymentsById, getDeploymentsSelectionState, getReleasesById],
|
|
2249
|
-
(deploymentsById, { selectedId }, releasesById) => {
|
|
2250
|
-
const deployment = deploymentsById[selectedId] || {};
|
|
2251
|
-
return deployment.artifact_name && releasesById[deployment.artifact_name] ? releasesById[deployment.artifact_name] : { device_types_compatible: [] };
|
|
2252
|
-
}
|
|
2253
|
-
);
|
|
2254
|
-
var getSelectedDeploymentData = (0, import_toolkit15.createSelector)(
|
|
2255
|
-
[getDeploymentsById, getDeploymentsSelectionState, getDevicesById, getSelectedDeploymentDeviceIds],
|
|
2256
|
-
(deploymentsById, { selectedId }, devicesById, selectedDeviceIds) => {
|
|
2257
|
-
const deployment = deploymentsById[selectedId] ?? {};
|
|
2258
|
-
const { devices = {} } = deployment;
|
|
2259
|
-
return {
|
|
2260
|
-
deployment,
|
|
2261
|
-
selectedDevices: selectedDeviceIds.map((deviceId) => ({ ...devicesById[deviceId], ...devices[deviceId] }))
|
|
2262
|
-
};
|
|
2263
|
-
}
|
|
2264
|
-
);
|
|
2265
|
-
var getAvailableIssueOptionsByType = (0, import_toolkit15.createSelector)(
|
|
2266
|
-
[getFeatures, getTenantCapabilities, getIssueCountsByType],
|
|
2267
|
-
({ hasReporting }, { hasFullFiltering, hasMonitor }, issueCounts) => Object.values(import_constants3.DEVICE_ISSUE_OPTIONS).reduce((accu, { isCategory, key, needsFullFiltering, needsMonitor, needsReporting, title }) => {
|
|
2268
|
-
if (isCategory || needsReporting && !hasReporting || needsFullFiltering && !hasFullFiltering || needsMonitor && !hasMonitor) {
|
|
2269
|
-
return accu;
|
|
2270
|
-
}
|
|
2271
|
-
accu[key] = { count: issueCounts[key].filtered, key, title };
|
|
2272
|
-
return accu;
|
|
2273
|
-
}, {})
|
|
2274
|
-
);
|
|
2275
|
-
var getGroupNames = (0, import_toolkit15.createSelector)([getGroupsById, getUserRoles], (groupsById, { uiPermissions }) => {
|
|
2276
|
-
const { [UNGROUPED_GROUP.id]: ungrouped, ...groups } = groupsById;
|
|
2277
|
-
return Object.keys(
|
|
2278
|
-
Object.entries(groups).reduce((accu, [groupName, group]) => {
|
|
2279
|
-
if (group.filterId || uiPermissions.groups[import_constants3.ALL_DEVICES]) {
|
|
2280
|
-
accu[groupName] = group;
|
|
2281
|
-
}
|
|
2282
|
-
return accu;
|
|
2283
|
-
}, uiPermissions.groups)
|
|
2284
|
-
).sort();
|
|
2285
|
-
});
|
|
2286
|
-
var getDeviceReportsForUser = (0, import_toolkit15.createSelector)(
|
|
2287
|
-
[getUserSettings, getCurrentUser, getGlobalSettings, getDevicesById],
|
|
2288
|
-
({ reports }, { id: currentUserId }, globalSettings, devicesById) => reports || globalSettings[`${currentUserId}-reports`] || (Object.keys(devicesById).length ? defaultReports : [])
|
|
2289
|
-
);
|
|
2290
|
-
var listTypeDeviceIdMap = {
|
|
2291
|
-
deviceList: getListedDevices,
|
|
2292
|
-
search: getSearchedDevices
|
|
2293
|
-
};
|
|
2294
|
-
var deviceMapDefault = { defaultObject: { auth_sets: [] }, cutOffSize: DEVICE_LIST_MAXIMUM_LENGTH };
|
|
2295
|
-
var getDeviceMappingDefaults = () => deviceMapDefault;
|
|
2296
|
-
var getMappedDevicesList = (0, import_toolkit15.createSelector)(
|
|
2297
|
-
[getDevicesById, (state, listType) => listTypeDeviceIdMap[listType](state), getDeviceMappingDefaults],
|
|
2298
|
-
listItemMapper
|
|
2299
|
-
);
|
|
2300
|
-
var getAuditlogDevice = (0, import_toolkit15.createSelector)([getAuditLogEntry, getDevicesById], (auditlogEvent, devicesById) => {
|
|
2301
|
-
let auditlogDevice = {};
|
|
2302
|
-
if (auditlogEvent) {
|
|
2303
|
-
const { object = {} } = auditlogEvent;
|
|
2304
|
-
const { device = {}, id, type } = object;
|
|
2305
|
-
auditlogDevice = type === "device" ? { id, ...device } : auditlogDevice;
|
|
2306
|
-
}
|
|
2307
|
-
return { ...auditlogDevice, ...devicesById[auditlogDevice.id] };
|
|
2308
|
-
});
|
|
2309
|
-
var getRelevantRoles = (0, import_toolkit15.createSelector)([getOrganization, getRolesList], ({ service_provider }, roles) => {
|
|
2310
|
-
if (service_provider) {
|
|
2311
|
-
return roles.reduce((accu, role) => {
|
|
2312
|
-
if (import_constants3.rolesById[role.value]) {
|
|
2313
|
-
return accu;
|
|
2314
|
-
}
|
|
2315
|
-
accu.push(role);
|
|
2316
|
-
return accu;
|
|
2317
|
-
}, Object.values(import_constants3.serviceProviderRolesById));
|
|
2318
|
-
}
|
|
2319
|
-
return Object.keys(import_constants3.rolesById).reverse().reduce((accu, key) => {
|
|
2320
|
-
const index = accu.findIndex(({ value }) => value === key);
|
|
2321
|
-
accu = [accu[index], ...accu.filter((item, itemIndex) => index !== itemIndex)];
|
|
2322
|
-
return accu;
|
|
2323
|
-
}, roles);
|
|
2324
|
-
});
|
|
2325
|
-
var getShowSecurityAlert = (0, import_toolkit15.createSelector)(
|
|
2326
|
-
[getCurrentUser, getHas2FA, getFeatures, getIsEnterprise, getUserSettingsInitialized, getSecurityAlertDismissedTimestamp],
|
|
2327
|
-
(currentUser, has2FA, features, isEnterprise, settingsInitialized, dismissedTimestamp) => {
|
|
2328
|
-
const isOAuth2 = !!currentUser?.sso?.length;
|
|
2329
|
-
const userVerified = !!currentUser.verified;
|
|
2330
|
-
const isHosted = features?.isHosted;
|
|
2331
|
-
const canHave2FA = isEnterprise || isHosted;
|
|
2332
|
-
const secureOAuthUser = isOAuth2 && userVerified;
|
|
2333
|
-
if (!currentUser || !settingsInitialized || has2FA || !canHave2FA || secureOAuthUser) {
|
|
2334
|
-
return false;
|
|
2335
|
-
}
|
|
2336
|
-
if (dismissedTimestamp === null) {
|
|
2337
|
-
return true;
|
|
2338
|
-
}
|
|
2339
|
-
const today = (0, import_dayjs.default)();
|
|
2340
|
-
const dismissedMonthAgo = today.diff(dismissedTimestamp, "months");
|
|
2341
|
-
return dismissedMonthAgo > 0;
|
|
2342
|
-
}
|
|
2343
|
-
);
|
|
2344
1745
|
|
|
2345
1746
|
// src/store.ts
|
|
2346
1747
|
var import_react_redux = require("react-redux");
|
|
2347
|
-
var
|
|
2348
|
-
var
|
|
1748
|
+
var import_helpers4 = require("@northern.tech/utils/helpers");
|
|
1749
|
+
var import_toolkit10 = require("@reduxjs/toolkit");
|
|
2349
1750
|
var import_react = require("@sentry/react");
|
|
2350
1751
|
var { setSnackbar, uploadProgress } = actions_default;
|
|
2351
1752
|
var keys = ["sessionDeploymentChecker", settingsKeys.initialized];
|
|
@@ -2353,13 +1754,13 @@ var resetEnvironment = () => keys.forEach((key) => window.sessionStorage.removeI
|
|
|
2353
1754
|
resetEnvironment();
|
|
2354
1755
|
var commonErrorFallback = "Please check your connection.";
|
|
2355
1756
|
var commonErrorHandler = (err, errorContext, dispatch, fallback, mightBeAuthRelated = false) => {
|
|
2356
|
-
const errMsg = (0,
|
|
1757
|
+
const errMsg = (0, import_helpers4.extractErrorMessage)(err, fallback);
|
|
2357
1758
|
if (mightBeAuthRelated || getToken()) {
|
|
2358
|
-
dispatch(setSnackbar({ message: (0,
|
|
1759
|
+
dispatch(setSnackbar({ message: (0, import_helpers4.preformatWithRequestID)(err.response, `${errorContext} ${errMsg}`), action: "Copy to clipboard" }));
|
|
2359
1760
|
}
|
|
2360
1761
|
return Promise.reject(err);
|
|
2361
1762
|
};
|
|
2362
|
-
var rootReducer = (0,
|
|
1763
|
+
var rootReducer = (0, import_toolkit10.combineReducers)({
|
|
2363
1764
|
app: appSlice_default,
|
|
2364
1765
|
devices: devicesSlice_default,
|
|
2365
1766
|
deployments: deploymentsSlice_default,
|
|
@@ -2409,7 +1810,7 @@ var sentryReduxEnhancer = (0, import_react.createReduxEnhancer)({
|
|
|
2409
1810
|
});
|
|
2410
1811
|
var getConfiguredStore = (options = {}) => {
|
|
2411
1812
|
const { preloadedState = {}, ...config } = options;
|
|
2412
|
-
return (0,
|
|
1813
|
+
return (0, import_toolkit10.configureStore)({
|
|
2413
1814
|
...config,
|
|
2414
1815
|
preloadedState,
|
|
2415
1816
|
enhancers: (getDefaultEnhancers) => {
|
|
@@ -2434,7 +1835,7 @@ var getConfiguredStore = (options = {}) => {
|
|
|
2434
1835
|
var store = getConfiguredStore({
|
|
2435
1836
|
preloadedState: {}
|
|
2436
1837
|
});
|
|
2437
|
-
var createAppAsyncThunk =
|
|
1838
|
+
var createAppAsyncThunk = import_toolkit10.createAsyncThunk.withTypes();
|
|
2438
1839
|
|
|
2439
1840
|
// src/monitorSlice/thunks.ts
|
|
2440
1841
|
var { page: defaultPage, perPage: defaultPerPage } = import_constants3.DEVICE_LIST_DEFAULTS;
|
|
@@ -2462,7 +1863,7 @@ var getLatestDeviceAlerts = createAppAsyncThunk(
|
|
|
2462
1863
|
return general_api_default.get(`${import_constants3.monitorApiUrlv1}/devices/${id}/alerts/latest?page=${page}&per_page=${perPage}`).catch((err) => commonErrorHandler(err, `Retrieving device alerts for device ${id} failed:`, dispatch)).then((res) => Promise.resolve(dispatch(actions.receiveLatestDeviceAlerts({ deviceId: id, alerts: sanitizeDeviceAlerts(res.data) }))));
|
|
2463
1864
|
}
|
|
2464
1865
|
);
|
|
2465
|
-
var
|
|
1866
|
+
var getIssueCountsByType = createAppAsyncThunk(
|
|
2466
1867
|
`${sliceName}/getIssueCountsByType`,
|
|
2467
1868
|
({ type, options = {} }, { dispatch, getState }) => {
|
|
2468
1869
|
const state = getState();
|
|
@@ -2475,7 +1876,7 @@ var getIssueCountsByType2 = createAppAsyncThunk(
|
|
|
2475
1876
|
selectedIssues: [type],
|
|
2476
1877
|
status
|
|
2477
1878
|
});
|
|
2478
|
-
return general_api_default.post(
|
|
1879
|
+
return general_api_default.post(`${import_constants3.inventoryApiUrlV2}/filters/search`, {
|
|
2479
1880
|
page: 1,
|
|
2480
1881
|
per_page: 1,
|
|
2481
1882
|
filters: filterTerms,
|