@northern.tech/store 0.12.0 → 0.14.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 +21 -16
- package/dist/actions.cjs.map +1 -1
- package/dist/actions.d.cts +7 -22
- package/dist/actions.d.ts +7 -22
- package/dist/actions.js +8 -8
- package/dist/appSlice/index.cjs +1 -0
- package/dist/appSlice/index.cjs.map +1 -1
- package/dist/appSlice/index.d.cts +1 -1
- package/dist/appSlice/index.d.ts +1 -1
- package/dist/appSlice/index.js +1 -1
- package/dist/appSlice/mocks.cjs +1 -0
- package/dist/appSlice/mocks.cjs.map +1 -1
- package/dist/appSlice/mocks.js +1 -1
- package/dist/appSlice/selectors.d.cts +34 -528
- package/dist/appSlice/selectors.d.ts +34 -528
- package/dist/appSlice/thunks.cjs +46 -41
- package/dist/appSlice/thunks.cjs.map +1 -1
- package/dist/appSlice/thunks.d.cts +5 -3
- package/dist/appSlice/thunks.d.ts +5 -3
- package/dist/appSlice/thunks.js +15 -15
- package/dist/{chunk-C5NXNZ7F.js → chunk-2SAH2AN2.js} +23 -30
- package/dist/chunk-2SAH2AN2.js.map +1 -0
- package/dist/{chunk-QOFVCPRW.js → chunk-5PUF4LA5.js} +1 -1
- package/dist/chunk-5PUF4LA5.js.map +1 -0
- package/dist/{chunk-ZRMB4U7Z.js → chunk-5XUPXMYV.js} +4 -4
- package/dist/{chunk-ZNAJKEP2.js → chunk-CQXDAXQF.js} +1 -1
- package/dist/chunk-CQXDAXQF.js.map +1 -0
- package/dist/{chunk-OFGCC3GM.js → chunk-IUGHRJV2.js} +2 -1
- package/dist/chunk-IUGHRJV2.js.map +1 -0
- package/dist/{chunk-WCBHYLUK.js → chunk-KJ4BPXMB.js} +1 -1
- package/dist/chunk-KJ4BPXMB.js.map +1 -0
- package/dist/{chunk-OGUVURJ5.js → chunk-KVZEKHVC.js} +12 -12
- package/dist/{chunk-5ZCZTTYX.js → chunk-LX4YRTYY.js} +5 -5
- package/dist/{chunk-C2LGE3P6.js → chunk-OLKM53RL.js} +1 -1
- package/dist/chunk-OLKM53RL.js.map +1 -0
- package/dist/{chunk-4HSH7RH3.js → chunk-PIFXECFW.js} +10 -10
- package/dist/{chunk-HLX5L3IM.js → chunk-PVCHKW35.js} +1 -1
- package/dist/chunk-PVCHKW35.js.map +1 -0
- package/dist/{chunk-REZWSU22.js → chunk-VODRLEDP.js} +21 -17
- package/dist/chunk-VODRLEDP.js.map +1 -0
- package/dist/{chunk-MH5WPYQI.js → chunk-X7NEALMI.js} +16 -9
- package/dist/chunk-X7NEALMI.js.map +1 -0
- package/dist/{chunk-TKIOEF3B.js → chunk-ZWLCUOQN.js} +6 -6
- package/dist/commonSelectors.cjs +15 -8
- package/dist/commonSelectors.cjs.map +1 -1
- package/dist/commonSelectors.d.cts +178 -3523
- package/dist/commonSelectors.d.ts +178 -3523
- package/dist/commonSelectors.js +3 -3
- package/dist/deploymentsSlice/index.cjs.map +1 -1
- package/dist/deploymentsSlice/index.d.cts +1 -1
- package/dist/deploymentsSlice/index.d.ts +1 -1
- package/dist/deploymentsSlice/index.js +1 -1
- package/dist/deploymentsSlice/mocks.cjs.map +1 -1
- package/dist/deploymentsSlice/mocks.js +1 -1
- package/dist/deploymentsSlice/selectors.d.cts +16 -138
- package/dist/deploymentsSlice/selectors.d.ts +16 -138
- package/dist/deploymentsSlice/thunks.cjs +46 -41
- package/dist/deploymentsSlice/thunks.cjs.map +1 -1
- package/dist/deploymentsSlice/thunks.d.cts +4 -2
- package/dist/deploymentsSlice/thunks.d.ts +4 -2
- package/dist/deploymentsSlice/thunks.js +15 -15
- package/dist/devicesSlice/index.cjs +20 -16
- package/dist/devicesSlice/index.cjs.map +1 -1
- package/dist/devicesSlice/index.d.cts +11 -20
- package/dist/devicesSlice/index.d.ts +11 -20
- package/dist/devicesSlice/index.js +1 -1
- package/dist/devicesSlice/mocks.cjs +24 -22
- package/dist/devicesSlice/mocks.cjs.map +1 -1
- package/dist/devicesSlice/mocks.d.cts +20 -12
- package/dist/devicesSlice/mocks.d.ts +20 -12
- package/dist/devicesSlice/mocks.js +5 -7
- package/dist/devicesSlice/mocks.js.map +1 -1
- package/dist/devicesSlice/selectors.cjs +15 -8
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.d.cts +207 -1730
- package/dist/devicesSlice/selectors.d.ts +207 -1730
- package/dist/devicesSlice/selectors.js +1 -1
- package/dist/devicesSlice/thunks.cjs +46 -43
- package/dist/devicesSlice/thunks.cjs.map +1 -1
- package/dist/devicesSlice/thunks.d.cts +12 -46
- package/dist/devicesSlice/thunks.d.ts +12 -46
- package/dist/devicesSlice/thunks.js +15 -17
- package/dist/monitorSlice/index.cjs.map +1 -1
- package/dist/monitorSlice/index.d.cts +1 -1
- package/dist/monitorSlice/index.d.ts +1 -1
- package/dist/monitorSlice/index.js +1 -1
- package/dist/monitorSlice/mocks.cjs.map +1 -1
- package/dist/monitorSlice/mocks.js +1 -1
- package/dist/monitorSlice/thunks.cjs +36 -24
- package/dist/monitorSlice/thunks.cjs.map +1 -1
- package/dist/monitorSlice/thunks.d.cts +3 -2
- package/dist/monitorSlice/thunks.d.ts +3 -2
- package/dist/monitorSlice/thunks.js +13 -13
- package/dist/onboardingSlice/index.cjs.map +1 -1
- package/dist/onboardingSlice/index.d.cts +1 -1
- package/dist/onboardingSlice/index.d.ts +1 -1
- package/dist/onboardingSlice/index.js +1 -1
- package/dist/onboardingSlice/mocks.cjs.map +1 -1
- package/dist/onboardingSlice/mocks.js +1 -1
- package/dist/onboardingSlice/thunks.cjs +46 -41
- package/dist/onboardingSlice/thunks.cjs.map +1 -1
- package/dist/onboardingSlice/thunks.d.cts +7 -15
- package/dist/onboardingSlice/thunks.d.ts +7 -15
- package/dist/onboardingSlice/thunks.js +15 -15
- package/dist/organizationSlice/index.cjs.map +1 -1
- package/dist/organizationSlice/index.d.cts +41 -31
- package/dist/organizationSlice/index.d.ts +41 -31
- package/dist/organizationSlice/index.js +1 -1
- package/dist/organizationSlice/mocks.cjs.map +1 -1
- package/dist/organizationSlice/mocks.js +1 -1
- package/dist/organizationSlice/selectors.d.cts +42 -659
- package/dist/organizationSlice/selectors.d.ts +42 -659
- package/dist/organizationSlice/thunks.cjs +46 -41
- package/dist/organizationSlice/thunks.cjs.map +1 -1
- package/dist/organizationSlice/thunks.d.cts +4 -1
- package/dist/organizationSlice/thunks.d.ts +4 -1
- package/dist/organizationSlice/thunks.js +15 -15
- package/dist/organizationSlice/types.cjs.map +1 -1
- package/dist/organizationSlice/types.d.cts +2 -12
- package/dist/organizationSlice/types.d.ts +2 -12
- package/dist/releasesSlice/mocks.d.cts +7 -1
- package/dist/releasesSlice/mocks.d.ts +7 -1
- package/dist/releasesSlice/selectors.d.cts +155 -930
- package/dist/releasesSlice/selectors.d.ts +155 -930
- package/dist/releasesSlice/thunks.cjs +36 -24
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.d.cts +4 -2
- package/dist/releasesSlice/thunks.d.ts +4 -2
- package/dist/releasesSlice/thunks.js +13 -13
- package/dist/selectors.cjs +15 -8
- package/dist/selectors.cjs.map +1 -1
- package/dist/selectors.d.cts +6 -3
- package/dist/selectors.d.ts +6 -3
- package/dist/selectors.js +17 -17
- package/dist/store.cjs +21 -16
- package/dist/store.cjs.map +1 -1
- package/dist/store.d.cts +40 -658
- package/dist/store.d.ts +40 -658
- package/dist/store.js +9 -9
- package/dist/storehooks.cjs +47 -41
- package/dist/storehooks.cjs.map +1 -1
- package/dist/storehooks.js +16 -15
- package/dist/storehooks.js.map +1 -1
- package/dist/thunks.cjs +46 -43
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.d.cts +7 -5
- package/dist/thunks.d.ts +7 -5
- package/dist/thunks.js +15 -17
- package/dist/useDeploymentDevice.cjs +46 -41
- package/dist/useDeploymentDevice.cjs.map +1 -1
- package/dist/useDeploymentDevice.js +15 -15
- package/dist/usersSlice/index.cjs.map +1 -1
- package/dist/usersSlice/index.d.cts +46 -46
- package/dist/usersSlice/index.d.ts +46 -46
- package/dist/usersSlice/index.js +1 -1
- package/dist/usersSlice/mocks.cjs.map +1 -1
- package/dist/usersSlice/mocks.js +1 -1
- package/dist/usersSlice/selectors.d.cts +75 -1436
- package/dist/usersSlice/selectors.d.ts +75 -1436
- package/dist/usersSlice/thunks.cjs +46 -41
- package/dist/usersSlice/thunks.cjs.map +1 -1
- package/dist/usersSlice/thunks.d.cts +3 -1
- package/dist/usersSlice/thunks.d.ts +3 -1
- package/dist/usersSlice/thunks.js +15 -15
- package/package.json +7 -7
- package/dist/chunk-C2LGE3P6.js.map +0 -1
- package/dist/chunk-C5NXNZ7F.js.map +0 -1
- package/dist/chunk-HLX5L3IM.js.map +0 -1
- package/dist/chunk-MH5WPYQI.js.map +0 -1
- package/dist/chunk-OFGCC3GM.js.map +0 -1
- package/dist/chunk-QOFVCPRW.js.map +0 -1
- package/dist/chunk-REZWSU22.js.map +0 -1
- package/dist/chunk-WCBHYLUK.js.map +0 -1
- package/dist/chunk-ZNAJKEP2.js.map +0 -1
- /package/dist/{chunk-ZRMB4U7Z.js.map → chunk-5XUPXMYV.js.map} +0 -0
- /package/dist/{chunk-OGUVURJ5.js.map → chunk-KVZEKHVC.js.map} +0 -0
- /package/dist/{chunk-5ZCZTTYX.js.map → chunk-LX4YRTYY.js.map} +0 -0
- /package/dist/{chunk-4HSH7RH3.js.map → chunk-PIFXECFW.js.map} +0 -0
- /package/dist/{chunk-TKIOEF3B.js.map → chunk-ZWLCUOQN.js.map} +0 -0
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import * as _northern_tech_types_types_gen from '@northern.tech/types/types.gen';
|
|
2
1
|
import { SnackbarContent, SearchState } from '../appSlice/index.cjs';
|
|
3
2
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
4
|
-
import { SortCriteria, Status, PreAuthSet, DeviceConfiguration, ManagementApiConfiguration, NewConfigurationDeployment, Integration } from '@northern.tech/types/MenderTypes';
|
|
5
|
-
import { DeviceListState, Device, DeviceGroup, DeviceFilter,
|
|
3
|
+
import { DeviceTierLimits, SortCriteria, Status, PreAuthSet, DeviceConfiguration, ManagementApiConfiguration, NewConfigurationDeployment, Integration } from '@northern.tech/types/MenderTypes';
|
|
4
|
+
import { DeviceListState, Device, DeviceGroup, DeviceFilter, DeviceSelectedAttribute } from './index.cjs';
|
|
6
5
|
import { DeviceIssueOptionKey } from '@northern.tech/utils/constants';
|
|
6
|
+
import { DeviceAuthState } from './constants.cjs';
|
|
7
7
|
import { AppDispatch, RootState } from '../store.cjs';
|
|
8
8
|
import 'redux';
|
|
9
9
|
import 'immer';
|
|
10
10
|
import '@mui/material';
|
|
11
11
|
import '../commonConstants.cjs';
|
|
12
12
|
import 'react/jsx-runtime';
|
|
13
|
-
import './constants.cjs';
|
|
14
13
|
import '../deploymentsSlice/index.cjs';
|
|
15
14
|
import 'redux-thunk';
|
|
16
|
-
import '../usersSlice/constants.cjs';
|
|
17
15
|
import '../usersSlice/index.cjs';
|
|
16
|
+
import '../usersSlice/constants.cjs';
|
|
18
17
|
import '../releasesSlice/index.cjs';
|
|
18
|
+
import '../organizationSlice/index.cjs';
|
|
19
19
|
import '../organizationSlice/types.cjs';
|
|
20
20
|
import '../appSlice/constants.cjs';
|
|
21
21
|
import '@mui/material/OverridableComponent';
|
|
22
22
|
import '../organizationSlice/constants.cjs';
|
|
23
23
|
import '../onboardingSlice/index.cjs';
|
|
24
|
+
import '../monitorSlice/index.cjs';
|
|
25
|
+
import '../monitorSlice/constants.cjs';
|
|
24
26
|
|
|
25
27
|
declare const getGroups: _reduxjs_toolkit.AsyncThunk<any, void, {
|
|
26
28
|
dispatch: AppDispatch;
|
|
@@ -301,43 +303,7 @@ declare const getDeviceInfo: _reduxjs_toolkit.AsyncThunk<any[], string, {
|
|
|
301
303
|
fulfilledMeta?: unknown;
|
|
302
304
|
rejectedMeta?: unknown;
|
|
303
305
|
}>;
|
|
304
|
-
declare const
|
|
305
|
-
payload: {
|
|
306
|
-
count: number;
|
|
307
|
-
status: DeviceStatus;
|
|
308
|
-
};
|
|
309
|
-
type: "devices/setDevicesCountByStatus";
|
|
310
|
-
}, string, {
|
|
311
|
-
dispatch: AppDispatch;
|
|
312
|
-
state: RootState;
|
|
313
|
-
extra?: unknown;
|
|
314
|
-
rejectValue?: unknown;
|
|
315
|
-
serializedErrorType?: unknown;
|
|
316
|
-
pendingMeta?: unknown;
|
|
317
|
-
fulfilledMeta?: unknown;
|
|
318
|
-
rejectedMeta?: unknown;
|
|
319
|
-
}>;
|
|
320
|
-
declare const getAllDeviceCounts: _reduxjs_toolkit.AsyncThunk<(_reduxjs_toolkit.PayloadAction<unknown, string, {
|
|
321
|
-
arg: string;
|
|
322
|
-
requestId: string;
|
|
323
|
-
requestStatus: "rejected";
|
|
324
|
-
aborted: boolean;
|
|
325
|
-
condition: boolean;
|
|
326
|
-
} & ({
|
|
327
|
-
rejectedWithValue: true;
|
|
328
|
-
} | ({
|
|
329
|
-
rejectedWithValue: false;
|
|
330
|
-
} & {})), _reduxjs_toolkit.SerializedError> | _reduxjs_toolkit.PayloadAction<{
|
|
331
|
-
payload: {
|
|
332
|
-
count: number;
|
|
333
|
-
status: DeviceStatus;
|
|
334
|
-
};
|
|
335
|
-
type: "devices/setDevicesCountByStatus";
|
|
336
|
-
}, string, {
|
|
337
|
-
arg: string;
|
|
338
|
-
requestId: string;
|
|
339
|
-
requestStatus: "fulfilled";
|
|
340
|
-
}, never>)[], void, {
|
|
306
|
+
declare const getAllDeviceCounts: _reduxjs_toolkit.AsyncThunk<void, void, {
|
|
341
307
|
dispatch: AppDispatch;
|
|
342
308
|
state: RootState;
|
|
343
309
|
extra?: unknown;
|
|
@@ -348,7 +314,7 @@ declare const getAllDeviceCounts: _reduxjs_toolkit.AsyncThunk<(_reduxjs_toolkit.
|
|
|
348
314
|
rejectedMeta?: unknown;
|
|
349
315
|
}>;
|
|
350
316
|
declare const getDeviceLimits: _reduxjs_toolkit.AsyncThunk<{
|
|
351
|
-
payload:
|
|
317
|
+
payload: DeviceTierLimits;
|
|
352
318
|
type: "devices/setDeviceLimits";
|
|
353
319
|
}, void, {
|
|
354
320
|
dispatch: AppDispatch;
|
|
@@ -384,7 +350,7 @@ type GetDevicesByStatusPayload = {
|
|
|
384
350
|
selectedAttributes: DeviceSelectedAttribute[];
|
|
385
351
|
selectedIssues: DeviceIssueOptionKey[];
|
|
386
352
|
sortOptions: SortCriteria[];
|
|
387
|
-
status:
|
|
353
|
+
status: DeviceAuthState;
|
|
388
354
|
};
|
|
389
355
|
declare const getDevicesByStatus: _reduxjs_toolkit.AsyncThunk<any[], Partial<GetDevicesByStatusPayload>, {
|
|
390
356
|
dispatch: AppDispatch;
|
|
@@ -398,7 +364,7 @@ declare const getDevicesByStatus: _reduxjs_toolkit.AsyncThunk<any[], Partial<Get
|
|
|
398
364
|
}>;
|
|
399
365
|
declare const getAllDevicesByStatus: _reduxjs_toolkit.AsyncThunk<any, {
|
|
400
366
|
attribute: string;
|
|
401
|
-
status:
|
|
367
|
+
status: DeviceAuthState;
|
|
402
368
|
}, {
|
|
403
369
|
dispatch: AppDispatch;
|
|
404
370
|
state: RootState;
|
|
@@ -832,4 +798,4 @@ declare const getGatewayDevices: _reduxjs_toolkit.AsyncThunk<any[], string, {
|
|
|
832
798
|
rejectedMeta?: unknown;
|
|
833
799
|
}>;
|
|
834
800
|
|
|
835
|
-
export { addDevicesToGroup, addDynamicGroup, addStaticGroup, applyDeviceConfig, decommissionDevice, deleteAuthset, deviceFileUpload, getAllDeviceCounts, getAllDevicesByStatus, getAllDynamicGroupDevices, getAllGroupDevices, getDeviceAttributes, getDeviceAuth, getDeviceById, getDeviceConfig, getDeviceConnect,
|
|
801
|
+
export { addDevicesToGroup, addDynamicGroup, addStaticGroup, applyDeviceConfig, decommissionDevice, deleteAuthset, deviceFileUpload, getAllDeviceCounts, getAllDevicesByStatus, getAllDynamicGroupDevices, getAllGroupDevices, getDeviceAttributes, getDeviceAuth, getDeviceById, getDeviceConfig, getDeviceConnect, getDeviceFileDownloadLink, getDeviceInfo, getDeviceLimits, getDeviceTwin, getDevicesByStatus, getDevicesWithAuth, getDynamicGroups, getGatewayDevices, getGroupDevices, getGroups, getReportDataWithoutBackendSupport, getSessionDetails, getSystemDevices, preauthDevice, removeDevicesFromGroup, removeDynamicGroup, removeStaticGroup, searchDevices, selectGroup, setDeviceConfig, setDeviceListState, setDeviceTags, setDeviceTwin, triggerDeviceUpdate, updateDeviceAuth, updateDevicesAuth, updateDynamicGroup, updateReportData };
|
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import * as _northern_tech_types_types_gen from '@northern.tech/types/types.gen';
|
|
2
1
|
import { SnackbarContent, SearchState } from '../appSlice/index.js';
|
|
3
2
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
4
|
-
import { SortCriteria, Status, PreAuthSet, DeviceConfiguration, ManagementApiConfiguration, NewConfigurationDeployment, Integration } from '@northern.tech/types/MenderTypes';
|
|
5
|
-
import { DeviceListState, Device, DeviceGroup, DeviceFilter,
|
|
3
|
+
import { DeviceTierLimits, SortCriteria, Status, PreAuthSet, DeviceConfiguration, ManagementApiConfiguration, NewConfigurationDeployment, Integration } from '@northern.tech/types/MenderTypes';
|
|
4
|
+
import { DeviceListState, Device, DeviceGroup, DeviceFilter, DeviceSelectedAttribute } from './index.js';
|
|
6
5
|
import { DeviceIssueOptionKey } from '@northern.tech/utils/constants';
|
|
6
|
+
import { DeviceAuthState } from './constants.js';
|
|
7
7
|
import { AppDispatch, RootState } from '../store.js';
|
|
8
8
|
import 'redux';
|
|
9
9
|
import 'immer';
|
|
10
10
|
import '@mui/material';
|
|
11
11
|
import '../commonConstants.js';
|
|
12
12
|
import 'react/jsx-runtime';
|
|
13
|
-
import './constants.js';
|
|
14
13
|
import '../deploymentsSlice/index.js';
|
|
15
14
|
import 'redux-thunk';
|
|
16
|
-
import '../usersSlice/constants.js';
|
|
17
15
|
import '../usersSlice/index.js';
|
|
16
|
+
import '../usersSlice/constants.js';
|
|
18
17
|
import '../releasesSlice/index.js';
|
|
18
|
+
import '../organizationSlice/index.js';
|
|
19
19
|
import '../organizationSlice/types.js';
|
|
20
20
|
import '../appSlice/constants.js';
|
|
21
21
|
import '@mui/material/OverridableComponent';
|
|
22
22
|
import '../organizationSlice/constants.js';
|
|
23
23
|
import '../onboardingSlice/index.js';
|
|
24
|
+
import '../monitorSlice/index.js';
|
|
25
|
+
import '../monitorSlice/constants.js';
|
|
24
26
|
|
|
25
27
|
declare const getGroups: _reduxjs_toolkit.AsyncThunk<any, void, {
|
|
26
28
|
dispatch: AppDispatch;
|
|
@@ -301,43 +303,7 @@ declare const getDeviceInfo: _reduxjs_toolkit.AsyncThunk<any[], string, {
|
|
|
301
303
|
fulfilledMeta?: unknown;
|
|
302
304
|
rejectedMeta?: unknown;
|
|
303
305
|
}>;
|
|
304
|
-
declare const
|
|
305
|
-
payload: {
|
|
306
|
-
count: number;
|
|
307
|
-
status: DeviceStatus;
|
|
308
|
-
};
|
|
309
|
-
type: "devices/setDevicesCountByStatus";
|
|
310
|
-
}, string, {
|
|
311
|
-
dispatch: AppDispatch;
|
|
312
|
-
state: RootState;
|
|
313
|
-
extra?: unknown;
|
|
314
|
-
rejectValue?: unknown;
|
|
315
|
-
serializedErrorType?: unknown;
|
|
316
|
-
pendingMeta?: unknown;
|
|
317
|
-
fulfilledMeta?: unknown;
|
|
318
|
-
rejectedMeta?: unknown;
|
|
319
|
-
}>;
|
|
320
|
-
declare const getAllDeviceCounts: _reduxjs_toolkit.AsyncThunk<(_reduxjs_toolkit.PayloadAction<unknown, string, {
|
|
321
|
-
arg: string;
|
|
322
|
-
requestId: string;
|
|
323
|
-
requestStatus: "rejected";
|
|
324
|
-
aborted: boolean;
|
|
325
|
-
condition: boolean;
|
|
326
|
-
} & ({
|
|
327
|
-
rejectedWithValue: true;
|
|
328
|
-
} | ({
|
|
329
|
-
rejectedWithValue: false;
|
|
330
|
-
} & {})), _reduxjs_toolkit.SerializedError> | _reduxjs_toolkit.PayloadAction<{
|
|
331
|
-
payload: {
|
|
332
|
-
count: number;
|
|
333
|
-
status: DeviceStatus;
|
|
334
|
-
};
|
|
335
|
-
type: "devices/setDevicesCountByStatus";
|
|
336
|
-
}, string, {
|
|
337
|
-
arg: string;
|
|
338
|
-
requestId: string;
|
|
339
|
-
requestStatus: "fulfilled";
|
|
340
|
-
}, never>)[], void, {
|
|
306
|
+
declare const getAllDeviceCounts: _reduxjs_toolkit.AsyncThunk<void, void, {
|
|
341
307
|
dispatch: AppDispatch;
|
|
342
308
|
state: RootState;
|
|
343
309
|
extra?: unknown;
|
|
@@ -348,7 +314,7 @@ declare const getAllDeviceCounts: _reduxjs_toolkit.AsyncThunk<(_reduxjs_toolkit.
|
|
|
348
314
|
rejectedMeta?: unknown;
|
|
349
315
|
}>;
|
|
350
316
|
declare const getDeviceLimits: _reduxjs_toolkit.AsyncThunk<{
|
|
351
|
-
payload:
|
|
317
|
+
payload: DeviceTierLimits;
|
|
352
318
|
type: "devices/setDeviceLimits";
|
|
353
319
|
}, void, {
|
|
354
320
|
dispatch: AppDispatch;
|
|
@@ -384,7 +350,7 @@ type GetDevicesByStatusPayload = {
|
|
|
384
350
|
selectedAttributes: DeviceSelectedAttribute[];
|
|
385
351
|
selectedIssues: DeviceIssueOptionKey[];
|
|
386
352
|
sortOptions: SortCriteria[];
|
|
387
|
-
status:
|
|
353
|
+
status: DeviceAuthState;
|
|
388
354
|
};
|
|
389
355
|
declare const getDevicesByStatus: _reduxjs_toolkit.AsyncThunk<any[], Partial<GetDevicesByStatusPayload>, {
|
|
390
356
|
dispatch: AppDispatch;
|
|
@@ -398,7 +364,7 @@ declare const getDevicesByStatus: _reduxjs_toolkit.AsyncThunk<any[], Partial<Get
|
|
|
398
364
|
}>;
|
|
399
365
|
declare const getAllDevicesByStatus: _reduxjs_toolkit.AsyncThunk<any, {
|
|
400
366
|
attribute: string;
|
|
401
|
-
status:
|
|
367
|
+
status: DeviceAuthState;
|
|
402
368
|
}, {
|
|
403
369
|
dispatch: AppDispatch;
|
|
404
370
|
state: RootState;
|
|
@@ -832,4 +798,4 @@ declare const getGatewayDevices: _reduxjs_toolkit.AsyncThunk<any[], string, {
|
|
|
832
798
|
rejectedMeta?: unknown;
|
|
833
799
|
}>;
|
|
834
800
|
|
|
835
|
-
export { addDevicesToGroup, addDynamicGroup, addStaticGroup, applyDeviceConfig, decommissionDevice, deleteAuthset, deviceFileUpload, getAllDeviceCounts, getAllDevicesByStatus, getAllDynamicGroupDevices, getAllGroupDevices, getDeviceAttributes, getDeviceAuth, getDeviceById, getDeviceConfig, getDeviceConnect,
|
|
801
|
+
export { addDevicesToGroup, addDynamicGroup, addStaticGroup, applyDeviceConfig, decommissionDevice, deleteAuthset, deviceFileUpload, getAllDeviceCounts, getAllDevicesByStatus, getAllDynamicGroupDevices, getAllGroupDevices, getDeviceAttributes, getDeviceAuth, getDeviceById, getDeviceConfig, getDeviceConnect, getDeviceFileDownloadLink, getDeviceInfo, getDeviceLimits, getDeviceTwin, getDevicesByStatus, getDevicesWithAuth, getDynamicGroups, getGatewayDevices, getGroupDevices, getGroups, getReportDataWithoutBackendSupport, getSessionDetails, getSystemDevices, preauthDevice, removeDevicesFromGroup, removeDynamicGroup, removeStaticGroup, searchDevices, selectGroup, setDeviceConfig, setDeviceListState, setDeviceTags, setDeviceTwin, triggerDeviceUpdate, updateDeviceAuth, updateDevicesAuth, updateDynamicGroup, updateReportData };
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
getDeviceById,
|
|
16
16
|
getDeviceConfig,
|
|
17
17
|
getDeviceConnect,
|
|
18
|
-
getDeviceCount,
|
|
19
18
|
getDeviceFileDownloadLink,
|
|
20
19
|
getDeviceInfo,
|
|
21
20
|
getDeviceLimits,
|
|
@@ -44,32 +43,32 @@ import {
|
|
|
44
43
|
updateDevicesAuth,
|
|
45
44
|
updateDynamicGroup,
|
|
46
45
|
updateReportData
|
|
47
|
-
} from "../chunk-
|
|
48
|
-
import "../chunk-
|
|
49
|
-
import "../chunk-
|
|
50
|
-
import "../chunk-
|
|
46
|
+
} from "../chunk-2SAH2AN2.js";
|
|
47
|
+
import "../chunk-5XUPXMYV.js";
|
|
48
|
+
import "../chunk-ZWLCUOQN.js";
|
|
49
|
+
import "../chunk-KVZEKHVC.js";
|
|
51
50
|
import "../chunk-Y3DJIMEN.js";
|
|
52
51
|
import "../chunk-5M6EUVNO.js";
|
|
53
|
-
import "../chunk-
|
|
52
|
+
import "../chunk-PIFXECFW.js";
|
|
53
|
+
import "../chunk-KJ4BPXMB.js";
|
|
54
54
|
import "../chunk-TRKA7XYU.js";
|
|
55
|
-
import "../chunk-
|
|
56
|
-
import "../chunk-
|
|
57
|
-
import "../chunk-
|
|
58
|
-
import "../chunk-
|
|
59
|
-
import "../chunk-
|
|
60
|
-
import "../chunk-
|
|
61
|
-
import "../chunk-C2LGE3P6.js";
|
|
55
|
+
import "../chunk-5PUF4LA5.js";
|
|
56
|
+
import "../chunk-PVCHKW35.js";
|
|
57
|
+
import "../chunk-CQXDAXQF.js";
|
|
58
|
+
import "../chunk-VODRLEDP.js";
|
|
59
|
+
import "../chunk-IUGHRJV2.js";
|
|
60
|
+
import "../chunk-OLKM53RL.js";
|
|
62
61
|
import "../chunk-FDSMCFV5.js";
|
|
63
62
|
import "../chunk-53W2NRSL.js";
|
|
64
63
|
import "../chunk-NMAXZ3ZY.js";
|
|
65
|
-
import "../chunk-
|
|
66
|
-
import "../chunk-GGBE6KJV.js";
|
|
64
|
+
import "../chunk-LX4YRTYY.js";
|
|
67
65
|
import "../chunk-7QKCBSFU.js";
|
|
66
|
+
import "../chunk-GGBE6KJV.js";
|
|
68
67
|
import "../chunk-3NOV7X4M.js";
|
|
69
68
|
import "../chunk-YO22XLHI.js";
|
|
70
69
|
import "../chunk-JIS4PA3R.js";
|
|
71
70
|
import "../chunk-WR6RQKF5.js";
|
|
72
|
-
import "../chunk-
|
|
71
|
+
import "../chunk-X7NEALMI.js";
|
|
73
72
|
import "../chunk-BYUPW7RA.js";
|
|
74
73
|
import "../chunk-GX2TWNLC.js";
|
|
75
74
|
import "../chunk-WWED74SG.js";
|
|
@@ -94,7 +93,6 @@ export {
|
|
|
94
93
|
getDeviceById,
|
|
95
94
|
getDeviceConfig,
|
|
96
95
|
getDeviceConnect,
|
|
97
|
-
getDeviceCount,
|
|
98
96
|
getDeviceFileDownloadLink,
|
|
99
97
|
getDeviceInfo,
|
|
100
98
|
getDeviceLimits,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/monitorSlice/index.ts","../../src/constants.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { Alert } from '@northern.tech/types/MenderTypes';\nimport { createSlice } from '@reduxjs/toolkit';\nimport type { PayloadAction } from '@reduxjs/toolkit';\n\nimport type { DeviceIssueOptionKey } from '../constants';\nimport { DEVICE_ISSUE_OPTIONS, DEVICE_LIST_DEFAULTS, alertChannels } from '../constants';\nimport type { AlertChannelKey } from './constants';\n\nexport const sliceName = 'monitor';\ntype IssueCounts = Record<DeviceIssueOptionKey, { filtered: number; total: number }>;\ntype ChannelSettings = Record<AlertChannelKey, { enabled: boolean }>;\ntype SanitizedAlert = Alert & { fullName?: string };\n\
|
|
1
|
+
{"version":3,"sources":["../../src/monitorSlice/index.ts","../../src/constants.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { Alert } from '@northern.tech/types/MenderTypes';\nimport { createSlice } from '@reduxjs/toolkit';\nimport type { PayloadAction } from '@reduxjs/toolkit';\n\nimport type { DeviceIssueOptionKey } from '../constants';\nimport { DEVICE_ISSUE_OPTIONS, DEVICE_LIST_DEFAULTS, alertChannels } from '../constants';\nimport type { AlertChannelKey } from './constants';\n\nexport const sliceName = 'monitor';\ntype IssueCounts = Record<DeviceIssueOptionKey, { filtered: number; total: number }>;\ntype ChannelSettings = Record<AlertChannelKey, { enabled: boolean }>;\ntype SanitizedAlert = Alert & { fullName?: string };\n\nexport type MonitorSliceType = {\n alerts: {\n alertList: {\n page: number;\n perPage: number;\n total: number;\n };\n byDeviceId: { alerts?: Record<string, SanitizedAlert>; latest?: Record<string, SanitizedAlert> };\n };\n issueCounts: { byType: IssueCounts };\n settings: {\n global: {\n channels: ChannelSettings;\n };\n };\n};\nexport const initialState: MonitorSliceType = {\n alerts: {\n alertList: { ...DEVICE_LIST_DEFAULTS, total: 0 },\n byDeviceId: {}\n },\n issueCounts: {\n byType: Object.keys(DEVICE_ISSUE_OPTIONS).reduce<IssueCounts>((accu, key) => ({ ...accu, [key]: { filtered: 0, total: 0 } }), {} as IssueCounts)\n },\n settings: {\n global: {\n channels: {\n ...Object.keys(alertChannels).reduce((accu, item) => ({ ...accu, [item]: { enabled: true } }), {} as ChannelSettings)\n }\n }\n }\n};\n\nexport const monitorSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n changeAlertChannel: (state, action: PayloadAction<{ channel: AlertChannelKey; enabled: boolean }>) => {\n const { channel, enabled } = action.payload;\n state.settings.global.channels[channel] = { enabled };\n },\n receiveDeviceAlerts: (state, action: PayloadAction<{ alerts: SanitizedAlert[]; deviceId: string }>) => {\n const { deviceId, alerts } = action.payload;\n state.alerts.byDeviceId[deviceId] = { alerts };\n },\n receiveLatestDeviceAlerts: (state, action: PayloadAction<{ alerts: SanitizedAlert[]; deviceId: string }>) => {\n const { deviceId, alerts } = action.payload;\n state.alerts.byDeviceId[deviceId] = { ...state.alerts.byDeviceId[deviceId], latest: alerts };\n },\n receiveDeviceIssueCounts: (state, action: PayloadAction<{ counts: { filtered: number; total: number }; issueType: DeviceIssueOptionKey }>) => {\n const { issueType, counts } = action.payload;\n state.issueCounts.byType[issueType] = counts;\n },\n setAlertListState: (state, action) => {\n state.alerts.alertList = { ...state.alerts.alertList, ...action.payload };\n }\n }\n});\n\nexport const actions = monitorSlice.actions;\nexport default monitorSlice.reducer;\n","// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport {\n ALL_DEVICES,\n ALL_DEVICE_STATES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n PermissionTypes,\n SORTING_OPTIONS,\n alertChannels,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n limitDefault,\n maxSessionAge,\n monitorApiUrlv1,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n} from '@northern.tech/utils/constants';\nimport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n} from '@northern.tech/utils/constants';\n\nexport {\n alertChannels,\n ALL_DEVICE_STATES,\n ALL_DEVICES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n monitorApiUrlv1,\n limitDefault,\n maxSessionAge,\n PermissionTypes,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n SORTING_OPTIONS,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n};\n\nexport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n};\n\nexport * from './appSlice/constants';\nexport * from './commonConstants';\nexport * from './deploymentsSlice/constants';\nexport * from './devicesSlice/constants';\nexport * from './monitorSlice/constants';\nexport * from './onboardingSlice/constants';\nexport * from './organizationSlice/constants';\nexport * from './releasesSlice/constants';\nexport * from './usersSlice/constants';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA,qBAA4B;;;ACA5B,uBA8CO;;;ADvCA,IAAM,YAAY;AAqBlB,IAAM,eAAiC;AAAA,EAC5C,QAAQ;AAAA,IACN,WAAW,EAAE,GAAG,uCAAsB,OAAO,EAAE;AAAA,IAC/C,YAAY,CAAC;AAAA,EACf;AAAA,EACA,aAAa;AAAA,IACX,QAAQ,OAAO,KAAK,qCAAoB,EAAE,OAAoB,CAAC,MAAM,SAAS,EAAE,GAAG,MAAM,CAAC,GAAG,GAAG,EAAE,UAAU,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,CAAgB;AAAA,EACjJ;AAAA,EACA,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,UAAU;AAAA,QACR,GAAG,OAAO,KAAK,8BAAa,EAAE,OAAO,CAAC,MAAM,UAAU,EAAE,GAAG,MAAM,CAAC,IAAI,GAAG,EAAE,SAAS,KAAK,EAAE,IAAI,CAAC,CAAoB;AAAA,MACtH;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,mBAAe,4BAAY;AAAA,EACtC,MAAM;AAAA,EACN;AAAA,EACA,UAAU;AAAA,IACR,oBAAoB,CAAC,OAAO,WAA0E;AACpG,YAAM,EAAE,SAAS,QAAQ,IAAI,OAAO;AACpC,YAAM,SAAS,OAAO,SAAS,OAAO,IAAI,EAAE,QAAQ;AAAA,IACtD;AAAA,IACA,qBAAqB,CAAC,OAAO,WAA0E;AACrG,YAAM,EAAE,UAAU,OAAO,IAAI,OAAO;AACpC,YAAM,OAAO,WAAW,QAAQ,IAAI,EAAE,OAAO;AAAA,IAC/C;AAAA,IACA,2BAA2B,CAAC,OAAO,WAA0E;AAC3G,YAAM,EAAE,UAAU,OAAO,IAAI,OAAO;AACpC,YAAM,OAAO,WAAW,QAAQ,IAAI,EAAE,GAAG,MAAM,OAAO,WAAW,QAAQ,GAAG,QAAQ,OAAO;AAAA,IAC7F;AAAA,IACA,0BAA0B,CAAC,OAAO,WAA4G;AAC5I,YAAM,EAAE,WAAW,OAAO,IAAI,OAAO;AACrC,YAAM,YAAY,OAAO,SAAS,IAAI;AAAA,IACxC;AAAA,IACA,mBAAmB,CAAC,OAAO,WAAW;AACpC,YAAM,OAAO,YAAY,EAAE,GAAG,MAAM,OAAO,WAAW,GAAG,OAAO,QAAQ;AAAA,IAC1E;AAAA,EACF;AACF,CAAC;AAEM,IAAM,UAAU,aAAa;AACpC,IAAO,uBAAQ,aAAa;","names":[]}
|
|
@@ -91,4 +91,4 @@ declare const actions: _reduxjs_toolkit.CaseReducerActions<{
|
|
|
91
91
|
}, "monitor">;
|
|
92
92
|
declare const _default: redux.Reducer<MonitorSliceType>;
|
|
93
93
|
|
|
94
|
-
export { actions, _default as default, initialState, monitorSlice, sliceName };
|
|
94
|
+
export { type MonitorSliceType, actions, _default as default, initialState, monitorSlice, sliceName };
|
|
@@ -91,4 +91,4 @@ declare const actions: _reduxjs_toolkit.CaseReducerActions<{
|
|
|
91
91
|
}, "monitor">;
|
|
92
92
|
declare const _default: redux.Reducer<MonitorSliceType>;
|
|
93
93
|
|
|
94
|
-
export { actions, _default as default, initialState, monitorSlice, sliceName };
|
|
94
|
+
export { type MonitorSliceType, actions, _default as default, initialState, monitorSlice, sliceName };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/monitorSlice/mocks.ts","../../src/constants.ts","../../src/monitorSlice/index.ts"],"sourcesContent":["// Copyright 2025 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { DeviceIssueOption } from '@northern.tech/utils/constants';\n\nimport { DEVICE_ISSUE_OPTIONS, DEVICE_LIST_DEFAULTS } from '../constants';\nimport { initialState } from './index';\n\nexport const mockState = {\n ...initialState,\n alerts: {\n alertList: { ...DEVICE_LIST_DEFAULTS, total: 0 },\n byDeviceId: {\n a1: {\n alerts: [\n {\n description: 'something',\n id: '31346239-3839-6262-2d63-3365622d3437',\n name: 'SSH Daemon is not running',\n device_id: 'a1',\n level: 'CRITICAL',\n subject: {\n name: 'sshd',\n type: 'systemd',\n status: 'not-running',\n details: { description: 'Jul 22 10:40:56 raspberrypi sshd[32031]: pam_unix(sshd:session): session closed for user root' }\n },\n timestamp: '2021-07-23T12:22:36Z'\n }\n ],\n latest: []\n }\n }\n },\n issueCounts: {\n byType: Object.values<DeviceIssueOption>(DEVICE_ISSUE_OPTIONS).reduce(\n (accu, { isCategory, key }) => {\n if (isCategory) {\n return accu;\n }\n accu[key] = accu[key] ?? { filtered: 0, total: 0 };\n return accu;\n },\n {\n [DEVICE_ISSUE_OPTIONS.authRequests.key]: { filtered: 0, total: 0 },\n [DEVICE_ISSUE_OPTIONS.monitoring.key]: { filtered: 3, total: 0 },\n [DEVICE_ISSUE_OPTIONS.offline.key]: { filtered: 0, total: 0 }\n }\n )\n },\n settings: {\n global: {\n channels: { email: { enabled: true } }\n }\n }\n};\n","// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport {\n ALL_DEVICES,\n ALL_DEVICE_STATES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n PermissionTypes,\n SORTING_OPTIONS,\n alertChannels,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n limitDefault,\n maxSessionAge,\n monitorApiUrlv1,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n} from '@northern.tech/utils/constants';\nimport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n} from '@northern.tech/utils/constants';\n\nexport {\n alertChannels,\n ALL_DEVICE_STATES,\n ALL_DEVICES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n monitorApiUrlv1,\n limitDefault,\n maxSessionAge,\n PermissionTypes,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n SORTING_OPTIONS,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n};\n\nexport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n};\n\nexport * from './appSlice/constants';\nexport * from './commonConstants';\nexport * from './deploymentsSlice/constants';\nexport * from './devicesSlice/constants';\nexport * from './monitorSlice/constants';\nexport * from './onboardingSlice/constants';\nexport * from './organizationSlice/constants';\nexport * from './releasesSlice/constants';\nexport * from './usersSlice/constants';\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { Alert } from '@northern.tech/types/MenderTypes';\nimport { createSlice } from '@reduxjs/toolkit';\nimport type { PayloadAction } from '@reduxjs/toolkit';\n\nimport type { DeviceIssueOptionKey } from '../constants';\nimport { DEVICE_ISSUE_OPTIONS, DEVICE_LIST_DEFAULTS, alertChannels } from '../constants';\nimport type { AlertChannelKey } from './constants';\n\nexport const sliceName = 'monitor';\ntype IssueCounts = Record<DeviceIssueOptionKey, { filtered: number; total: number }>;\ntype ChannelSettings = Record<AlertChannelKey, { enabled: boolean }>;\ntype SanitizedAlert = Alert & { fullName?: string };\n\ntype MonitorSliceType = {\n alerts: {\n alertList: {\n page: number;\n perPage: number;\n total: number;\n };\n byDeviceId: { alerts?: Record<string, SanitizedAlert>; latest?: Record<string, SanitizedAlert> };\n };\n issueCounts: { byType: IssueCounts };\n settings: {\n global: {\n channels: ChannelSettings;\n };\n };\n};\nexport const initialState: MonitorSliceType = {\n alerts: {\n alertList: { ...DEVICE_LIST_DEFAULTS, total: 0 },\n byDeviceId: {}\n },\n issueCounts: {\n byType: Object.keys(DEVICE_ISSUE_OPTIONS).reduce<IssueCounts>((accu, key) => ({ ...accu, [key]: { filtered: 0, total: 0 } }), {} as IssueCounts)\n },\n settings: {\n global: {\n channels: {\n ...Object.keys(alertChannels).reduce((accu, item) => ({ ...accu, [item]: { enabled: true } }), {} as ChannelSettings)\n }\n }\n }\n};\n\nexport const monitorSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n changeAlertChannel: (state, action: PayloadAction<{ channel: AlertChannelKey; enabled: boolean }>) => {\n const { channel, enabled } = action.payload;\n state.settings.global.channels[channel] = { enabled };\n },\n receiveDeviceAlerts: (state, action: PayloadAction<{ alerts: SanitizedAlert[]; deviceId: string }>) => {\n const { deviceId, alerts } = action.payload;\n state.alerts.byDeviceId[deviceId] = { alerts };\n },\n receiveLatestDeviceAlerts: (state, action: PayloadAction<{ alerts: SanitizedAlert[]; deviceId: string }>) => {\n const { deviceId, alerts } = action.payload;\n state.alerts.byDeviceId[deviceId] = { ...state.alerts.byDeviceId[deviceId], latest: alerts };\n },\n receiveDeviceIssueCounts: (state, action: PayloadAction<{ counts: { filtered: number; total: number }; issueType: DeviceIssueOptionKey }>) => {\n const { issueType, counts } = action.payload;\n state.issueCounts.byType[issueType] = counts;\n },\n setAlertListState: (state, action) => {\n state.alerts.alertList = { ...state.alerts.alertList, ...action.payload };\n }\n }\n});\n\nexport const actions = monitorSlice.actions;\nexport default monitorSlice.reducer;\n"],"mappings":"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","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/monitorSlice/mocks.ts","../../src/constants.ts","../../src/monitorSlice/index.ts"],"sourcesContent":["// Copyright 2025 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { DeviceIssueOption } from '@northern.tech/utils/constants';\n\nimport { DEVICE_ISSUE_OPTIONS, DEVICE_LIST_DEFAULTS } from '../constants';\nimport { initialState } from './index';\n\nexport const mockState = {\n ...initialState,\n alerts: {\n alertList: { ...DEVICE_LIST_DEFAULTS, total: 0 },\n byDeviceId: {\n a1: {\n alerts: [\n {\n description: 'something',\n id: '31346239-3839-6262-2d63-3365622d3437',\n name: 'SSH Daemon is not running',\n device_id: 'a1',\n level: 'CRITICAL',\n subject: {\n name: 'sshd',\n type: 'systemd',\n status: 'not-running',\n details: { description: 'Jul 22 10:40:56 raspberrypi sshd[32031]: pam_unix(sshd:session): session closed for user root' }\n },\n timestamp: '2021-07-23T12:22:36Z'\n }\n ],\n latest: []\n }\n }\n },\n issueCounts: {\n byType: Object.values<DeviceIssueOption>(DEVICE_ISSUE_OPTIONS).reduce(\n (accu, { isCategory, key }) => {\n if (isCategory) {\n return accu;\n }\n accu[key] = accu[key] ?? { filtered: 0, total: 0 };\n return accu;\n },\n {\n [DEVICE_ISSUE_OPTIONS.authRequests.key]: { filtered: 0, total: 0 },\n [DEVICE_ISSUE_OPTIONS.monitoring.key]: { filtered: 3, total: 0 },\n [DEVICE_ISSUE_OPTIONS.offline.key]: { filtered: 0, total: 0 }\n }\n )\n },\n settings: {\n global: {\n channels: { email: { enabled: true } }\n }\n }\n};\n","// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport {\n ALL_DEVICES,\n ALL_DEVICE_STATES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n PermissionTypes,\n SORTING_OPTIONS,\n alertChannels,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n limitDefault,\n maxSessionAge,\n monitorApiUrlv1,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n} from '@northern.tech/utils/constants';\nimport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n} from '@northern.tech/utils/constants';\n\nexport {\n alertChannels,\n ALL_DEVICE_STATES,\n ALL_DEVICES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n monitorApiUrlv1,\n limitDefault,\n maxSessionAge,\n PermissionTypes,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n SORTING_OPTIONS,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n};\n\nexport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n};\n\nexport * from './appSlice/constants';\nexport * from './commonConstants';\nexport * from './deploymentsSlice/constants';\nexport * from './devicesSlice/constants';\nexport * from './monitorSlice/constants';\nexport * from './onboardingSlice/constants';\nexport * from './organizationSlice/constants';\nexport * from './releasesSlice/constants';\nexport * from './usersSlice/constants';\n","// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport type { Alert } from '@northern.tech/types/MenderTypes';\nimport { createSlice } from '@reduxjs/toolkit';\nimport type { PayloadAction } from '@reduxjs/toolkit';\n\nimport type { DeviceIssueOptionKey } from '../constants';\nimport { DEVICE_ISSUE_OPTIONS, DEVICE_LIST_DEFAULTS, alertChannels } from '../constants';\nimport type { AlertChannelKey } from './constants';\n\nexport const sliceName = 'monitor';\ntype IssueCounts = Record<DeviceIssueOptionKey, { filtered: number; total: number }>;\ntype ChannelSettings = Record<AlertChannelKey, { enabled: boolean }>;\ntype SanitizedAlert = Alert & { fullName?: string };\n\nexport type MonitorSliceType = {\n alerts: {\n alertList: {\n page: number;\n perPage: number;\n total: number;\n };\n byDeviceId: { alerts?: Record<string, SanitizedAlert>; latest?: Record<string, SanitizedAlert> };\n };\n issueCounts: { byType: IssueCounts };\n settings: {\n global: {\n channels: ChannelSettings;\n };\n };\n};\nexport const initialState: MonitorSliceType = {\n alerts: {\n alertList: { ...DEVICE_LIST_DEFAULTS, total: 0 },\n byDeviceId: {}\n },\n issueCounts: {\n byType: Object.keys(DEVICE_ISSUE_OPTIONS).reduce<IssueCounts>((accu, key) => ({ ...accu, [key]: { filtered: 0, total: 0 } }), {} as IssueCounts)\n },\n settings: {\n global: {\n channels: {\n ...Object.keys(alertChannels).reduce((accu, item) => ({ ...accu, [item]: { enabled: true } }), {} as ChannelSettings)\n }\n }\n }\n};\n\nexport const monitorSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n changeAlertChannel: (state, action: PayloadAction<{ channel: AlertChannelKey; enabled: boolean }>) => {\n const { channel, enabled } = action.payload;\n state.settings.global.channels[channel] = { enabled };\n },\n receiveDeviceAlerts: (state, action: PayloadAction<{ alerts: SanitizedAlert[]; deviceId: string }>) => {\n const { deviceId, alerts } = action.payload;\n state.alerts.byDeviceId[deviceId] = { alerts };\n },\n receiveLatestDeviceAlerts: (state, action: PayloadAction<{ alerts: SanitizedAlert[]; deviceId: string }>) => {\n const { deviceId, alerts } = action.payload;\n state.alerts.byDeviceId[deviceId] = { ...state.alerts.byDeviceId[deviceId], latest: alerts };\n },\n receiveDeviceIssueCounts: (state, action: PayloadAction<{ counts: { filtered: number; total: number }; issueType: DeviceIssueOptionKey }>) => {\n const { issueType, counts } = action.payload;\n state.issueCounts.byType[issueType] = counts;\n },\n setAlertListState: (state, action) => {\n state.alerts.alertList = { ...state.alerts.alertList, ...action.payload };\n }\n }\n});\n\nexport const actions = monitorSlice.actions;\nexport default monitorSlice.reducer;\n"],"mappings":"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","names":[]}
|
|
@@ -785,6 +785,7 @@ var initialState2 = {
|
|
|
785
785
|
hasDeviceConnect: false,
|
|
786
786
|
hasFeedbackEnabled: false,
|
|
787
787
|
hasMonitor: false,
|
|
788
|
+
hasMCUEnabled: false,
|
|
788
789
|
hasReporting: false,
|
|
789
790
|
isHosted: true,
|
|
790
791
|
isEnterprise: false
|
|
@@ -1033,12 +1034,10 @@ var initialState4 = {
|
|
|
1033
1034
|
// }
|
|
1034
1035
|
},
|
|
1035
1036
|
byStatus: {
|
|
1036
|
-
[import_constants3.DEVICE_STATES.accepted]: { deviceIds: [], total: 0 },
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
[import_constants3.DEVICE_STATES.
|
|
1040
|
-
[import_constants3.DEVICE_STATES.preauth]: { deviceIds: [], total: 0 },
|
|
1041
|
-
[import_constants3.DEVICE_STATES.rejected]: { deviceIds: [], total: 0 }
|
|
1037
|
+
[import_constants3.DEVICE_STATES.accepted]: { deviceIds: [], counts: { standard: 0, micro: 0, system: 0, total: 0 } },
|
|
1038
|
+
[import_constants3.DEVICE_STATES.pending]: { deviceIds: [], counts: { standard: 0, micro: 0, system: 0, total: 0 } },
|
|
1039
|
+
[import_constants3.DEVICE_STATES.preauth]: { deviceIds: [], counts: { standard: 0, micro: 0, system: 0, total: 0 } },
|
|
1040
|
+
[import_constants3.DEVICE_STATES.rejected]: { deviceIds: [], counts: { standard: 0, micro: 0, system: 0, total: 0 } }
|
|
1042
1041
|
},
|
|
1043
1042
|
deviceList: {
|
|
1044
1043
|
deviceIds: [],
|
|
@@ -1168,21 +1167,19 @@ var devicesSlice = (0, import_toolkit4.createSlice)({
|
|
|
1168
1167
|
}
|
|
1169
1168
|
state.filters = action.payload.filter((filter) => filter.key && filter.operator && filter.scope && typeof filter.value !== "undefined");
|
|
1170
1169
|
},
|
|
1171
|
-
setInactiveDevices: (state, action) => {
|
|
1172
|
-
const { activeDeviceTotal, inactiveDeviceTotal } = action.payload;
|
|
1173
|
-
state.byStatus.active.total = activeDeviceTotal;
|
|
1174
|
-
state.byStatus.inactive.total = inactiveDeviceTotal;
|
|
1175
|
-
},
|
|
1176
1170
|
setDeviceReports: (state, action) => {
|
|
1177
1171
|
state.reports = action.payload;
|
|
1178
1172
|
},
|
|
1179
1173
|
setDevicesByStatus: (state, action) => {
|
|
1180
|
-
const {
|
|
1181
|
-
|
|
1174
|
+
const { status, total, deviceIds } = action.payload;
|
|
1175
|
+
if (total) {
|
|
1176
|
+
state.byStatus[status].deviceIds = deviceIds;
|
|
1177
|
+
state.byStatus[status].counts.total = total;
|
|
1178
|
+
}
|
|
1182
1179
|
},
|
|
1183
1180
|
setDevicesCountByStatus: (state, action) => {
|
|
1184
|
-
const {
|
|
1185
|
-
state.byStatus[status].
|
|
1181
|
+
const { countsPerTier, status } = action.payload;
|
|
1182
|
+
state.byStatus[status].counts = { ...countsPerTier, total: Object.values(countsPerTier).reduce((accu, tieredCount) => accu += tieredCount, 0) };
|
|
1186
1183
|
},
|
|
1187
1184
|
setDeviceLimits: (state, action) => {
|
|
1188
1185
|
state.limits = action.payload;
|
|
@@ -1199,7 +1196,15 @@ var devicesSlice = (0, import_toolkit4.createSlice)({
|
|
|
1199
1196
|
const hasMultipleAuthSets = authId && device.auth_sets ? device.auth_sets.filter((authset) => authset.id !== authId).length > 0 : false;
|
|
1200
1197
|
if (!hasMultipleAuthSets && Object.values(import_constants3.DEVICE_STATES).includes(device.status)) {
|
|
1201
1198
|
const deviceIds = state.byStatus[device.status].deviceIds.filter((id) => id !== deviceId);
|
|
1202
|
-
|
|
1199
|
+
const deviceTier = device.attributes.tier || "standard";
|
|
1200
|
+
state.byStatus[device.status] = {
|
|
1201
|
+
deviceIds,
|
|
1202
|
+
counts: {
|
|
1203
|
+
...state.byStatus[device.status].counts,
|
|
1204
|
+
[deviceTier]: Math.max(0, state.byStatus[device.status].counts[deviceTier] - 1),
|
|
1205
|
+
total: Math.max(0, state.byStatus[device.status].counts.total - 1)
|
|
1206
|
+
}
|
|
1207
|
+
};
|
|
1203
1208
|
}
|
|
1204
1209
|
}
|
|
1205
1210
|
}
|
|
@@ -1817,15 +1822,22 @@ var getDeviceIdentityAttributes = (0, import_toolkit11.createSelector)(
|
|
|
1817
1822
|
);
|
|
1818
1823
|
var getDeviceCountsByStatus = (0, import_toolkit11.createSelector)(
|
|
1819
1824
|
[getDevicesByStatus],
|
|
1820
|
-
(byStatus) => Object.values(import_constants3.DEVICE_STATES).reduce(
|
|
1821
|
-
accu
|
|
1822
|
-
|
|
1823
|
-
|
|
1825
|
+
(byStatus) => Object.values(import_constants3.DEVICE_STATES).reduce(
|
|
1826
|
+
(accu, deviceState) => {
|
|
1827
|
+
const { counts } = byStatus[deviceState];
|
|
1828
|
+
const { total, ...tieredCounts } = counts;
|
|
1829
|
+
const count = Object.values(tieredCounts).reduce((accu2, countPerTier) => accu2 + countPerTier, 0);
|
|
1830
|
+
accu[deviceState] = count;
|
|
1831
|
+
accu.total = accu.total + count;
|
|
1832
|
+
return accu;
|
|
1833
|
+
},
|
|
1834
|
+
{ total: 0 }
|
|
1835
|
+
)
|
|
1824
1836
|
);
|
|
1825
1837
|
var getDeviceById = (0, import_toolkit11.createSelector)([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = "") => devicesById[deviceId] ?? {});
|
|
1826
1838
|
var getSelectedGroupInfo = (0, import_toolkit11.createSelector)(
|
|
1827
|
-
[
|
|
1828
|
-
({
|
|
1839
|
+
[getDeviceCountsByStatus, getGroupsById, getSelectedGroup],
|
|
1840
|
+
({ accepted: acceptedDeviceTotal }, groupsById, selectedGroup) => {
|
|
1829
1841
|
let groupCount = acceptedDeviceTotal;
|
|
1830
1842
|
let groupFilters = [];
|
|
1831
1843
|
if (selectedGroup && groupsById[selectedGroup]) {
|
|
@@ -1841,8 +1853,8 @@ var getCombinedLimit = (0, import_toolkit11.createSelector)(
|
|
|
1841
1853
|
// limit might be -1 for unlimited devices
|
|
1842
1854
|
);
|
|
1843
1855
|
var getLimitMaxed = (0, import_toolkit11.createSelector)(
|
|
1844
|
-
[
|
|
1845
|
-
({
|
|
1856
|
+
[getDeviceCountsByStatus, getCombinedLimit],
|
|
1857
|
+
({ accepted: acceptedDevices }, combinedLimit) => !!combinedLimit && combinedLimit <= acceptedDevices
|
|
1846
1858
|
);
|
|
1847
1859
|
var getGroupsByIdWithoutUngrouped = (0, import_toolkit11.createSelector)([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);
|
|
1848
1860
|
var getGroupData = (0, import_toolkit11.createSelector)([getGroupsByIdWithoutUngrouped], (groups) => {
|