@northern.tech/store 0.12.0 → 0.13.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 +20 -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.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.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 +45 -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 +14 -14
- package/dist/{chunk-QOFVCPRW.js → chunk-5PUF4LA5.js} +1 -1
- package/dist/chunk-5PUF4LA5.js.map +1 -0
- package/dist/{chunk-TKIOEF3B.js → chunk-6KAV62BW.js} +6 -6
- package/dist/{chunk-OFGCC3GM.js → chunk-7MTM3BDT.js} +1 -1
- package/dist/chunk-7MTM3BDT.js.map +1 -0
- package/dist/{chunk-4HSH7RH3.js → chunk-AR4FTKSL.js} +8 -8
- package/dist/{chunk-ZRMB4U7Z.js → chunk-BZAXFAGT.js} +4 -4
- package/dist/{chunk-ZNAJKEP2.js → chunk-CQXDAXQF.js} +1 -1
- package/dist/chunk-CQXDAXQF.js.map +1 -0
- package/dist/{chunk-5ZCZTTYX.js → chunk-EOZ665GA.js} +2 -2
- package/dist/{chunk-C5NXNZ7F.js → chunk-ETZVJXPD.js} +23 -30
- package/dist/chunk-ETZVJXPD.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-C2LGE3P6.js → chunk-OLKM53RL.js} +1 -1
- package/dist/chunk-OLKM53RL.js.map +1 -0
- 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-OGUVURJ5.js → chunk-YFAIYNQG.js} +9 -9
- 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 +2 -2
- 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 +45 -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 +14 -14
- 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 +45 -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 +14 -16
- 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 +35 -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 +12 -12
- 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 +45 -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 +14 -14
- 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 +45 -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 +14 -14
- 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 +35 -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 +12 -12
- 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 +2 -2
- package/dist/store.cjs +20 -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 +45 -41
- package/dist/storehooks.cjs.map +1 -1
- package/dist/storehooks.js +14 -14
- package/dist/thunks.cjs +45 -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 +14 -16
- package/dist/useDeploymentDevice.cjs +45 -41
- package/dist/useDeploymentDevice.cjs.map +1 -1
- package/dist/useDeploymentDevice.js +14 -14
- 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 +45 -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 +14 -14
- package/package.json +1 -1
- 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-TKIOEF3B.js.map → chunk-6KAV62BW.js.map} +0 -0
- /package/dist/{chunk-4HSH7RH3.js.map → chunk-AR4FTKSL.js.map} +0 -0
- /package/dist/{chunk-ZRMB4U7Z.js.map → chunk-BZAXFAGT.js.map} +0 -0
- /package/dist/{chunk-5ZCZTTYX.js.map → chunk-EOZ665GA.js.map} +0 -0
- /package/dist/{chunk-OGUVURJ5.js.map → chunk-YFAIYNQG.js.map} +0 -0
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDeviceById
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-ETZVJXPD.js";
|
|
4
|
+
import "./chunk-BZAXFAGT.js";
|
|
5
|
+
import "./chunk-6KAV62BW.js";
|
|
6
6
|
import {
|
|
7
7
|
useAppDispatch
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YFAIYNQG.js";
|
|
9
9
|
import "./chunk-Y3DJIMEN.js";
|
|
10
10
|
import "./chunk-5M6EUVNO.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-AR4FTKSL.js";
|
|
12
12
|
import "./chunk-TRKA7XYU.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-KJ4BPXMB.js";
|
|
14
|
+
import "./chunk-5PUF4LA5.js";
|
|
15
|
+
import "./chunk-PVCHKW35.js";
|
|
16
|
+
import "./chunk-CQXDAXQF.js";
|
|
17
|
+
import "./chunk-VODRLEDP.js";
|
|
18
|
+
import "./chunk-7MTM3BDT.js";
|
|
19
|
+
import "./chunk-OLKM53RL.js";
|
|
20
20
|
import "./chunk-FDSMCFV5.js";
|
|
21
21
|
import "./chunk-53W2NRSL.js";
|
|
22
22
|
import "./chunk-NMAXZ3ZY.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-EOZ665GA.js";
|
|
24
24
|
import "./chunk-GGBE6KJV.js";
|
|
25
25
|
import "./chunk-7QKCBSFU.js";
|
|
26
26
|
import "./chunk-3NOV7X4M.js";
|
|
@@ -29,7 +29,7 @@ import "./chunk-JIS4PA3R.js";
|
|
|
29
29
|
import "./chunk-WR6RQKF5.js";
|
|
30
30
|
import {
|
|
31
31
|
getDevicesById
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-X7NEALMI.js";
|
|
33
33
|
import "./chunk-BYUPW7RA.js";
|
|
34
34
|
import "./chunk-GX2TWNLC.js";
|
|
35
35
|
import "./chunk-WWED74SG.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/usersSlice/index.ts","../../src/constants.ts","../../src/usersSlice/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 { User as BackendUser, DeploymentPhase, TenantInfo, TenantsIdName } from '@northern.tech/types/MenderTypes';\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { FilterOperator, PermissionSet, Role } from '../constants';\nimport { defaultPermissionSets, rolesById } from '../constants';\nimport type { ReadState } from './constants';\nimport { READ_STATES } from './constants';\n\nexport const sliceName = 'users';\nexport type User = BackendUser & TenantInfo & { tenants?: TenantsIdName };\nexport type UserSession = {\n expiresAt?: string;\n token: string;\n};\nexport type CustomColumn = {\n attribute: {\n name: string;\n scope: string;\n };\n size: number;\n};\n\ntype FilterOption = {\n key: string;\n operator: FilterOperator;\n scope: string;\n value: string;\n};\nexport type GlobalSettings = {\n [x: string]: any;\n id_attribute?: {\n attribute: string;\n scope: string;\n };\n previousFilters: FilterOption[];\n previousPhases: DeploymentPhase[][];\n retries: number;\n};\ntype Column = {\n id: string;\n key: string;\n name: string;\n scope: string;\n title: string;\n};\nexport type UserSettings = {\n [x: string]: any;\n columnSelection: Column[];\n feedbackCollectedAt?: string;\n firstLoginTimestamp: null | string;\n mode?: 'light' | 'dark';\n onboarding: Partial<{\n address: string;\n approach: 'physical' | 'virtual' | 'mcu' | null;\n complete: boolean;\n demoArtifactPort: number;\n deviceType: string[] | string;\n progress: string;\n showTips: null | boolean;\n showTipsDialog: boolean;\n }>;\n tooltips?: object;\n trackingConsentGiven?: boolean;\n};\ntype UserSliceState = {\n activationCode?: string;\n byId: Record<string, User>;\n currentSession?: UserSession | object;\n currentUser: string | null;\n customColumns: CustomColumn[];\n globalSettings: GlobalSettings;\n permissionSetsById: Record<string, PermissionSet>;\n qrCode: string | null;\n rolesById: Record<string, Role>;\n rolesInitialized: boolean;\n settingsInitialized: boolean;\n showConnectDeviceDialog: boolean;\n showFeedbackDialog: boolean;\n showStartupNotification: boolean;\n tooltips: {\n byId: Record<string, { readState: ReadState }>;\n };\n userSettings: UserSettings;\n userSettingsInitialized: boolean;\n};\nexport const initialState: UserSliceState = {\n activationCode: undefined,\n byId: {},\n currentUser: null,\n currentSession: {\n // { token: window.localStorage.getItem('JWT'), expiresAt: '2023-01-01T00:15:00.000Z' | undefined }, // expiresAt depending on the stay logged in setting\n },\n customColumns: [],\n qrCode: null,\n globalSettings: {\n id_attribute: undefined,\n previousFilters: [],\n previousPhases: [],\n retries: 0\n },\n permissionSetsById: {\n ...defaultPermissionSets\n },\n rolesById: {\n ...rolesById\n },\n rolesInitialized: false,\n settingsInitialized: false,\n showConnectDeviceDialog: false,\n showFeedbackDialog: false,\n showStartupNotification: false,\n tooltips: {\n byId: {\n // <id>: { readState: <read|unread> } // this object is getting enhanced by the tooltip texts in the app constants\n }\n },\n userSettings: {\n columnSelection: [],\n onboarding: {},\n firstLoginTimestamp: null\n },\n userSettingsInitialized: false\n};\n\nexport const usersSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n receivedQrCode: (state, action: PayloadAction<string | null>) => {\n state.qrCode = action.payload;\n },\n successfullyLoggedIn: (state, action: PayloadAction<UserSession>) => {\n state.currentSession = action.payload;\n },\n receivedUserList: (state, action: PayloadAction<Record<string, User>>) => {\n state.byId = action.payload;\n },\n receivedActivationCode: (state, action: PayloadAction<string>) => {\n state.activationCode = action.payload;\n },\n receivedUser: (state, action: PayloadAction<User>) => {\n state.byId[action.payload.id] = action.payload;\n state.currentUser = action.payload.id;\n },\n removedUser: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: removedUser, ...byId } = state.byId;\n state.byId = byId;\n state.currentUser = state.currentUser === action.payload ? null : state.currentUser;\n },\n updatedUser: (state, action: PayloadAction<Partial<User> & { id: string }>) => {\n state.byId[action.payload.id] = {\n ...state.byId[action.payload.id],\n ...action.payload\n };\n },\n receivedPermissionSets: (state, action: PayloadAction<Record<string, PermissionSet>>) => {\n state.permissionSetsById = action.payload;\n },\n receivedRoles: (state, action: PayloadAction<Record<string, Role>>) => {\n state.rolesById = action.payload;\n state.rolesInitialized = true;\n },\n finishedRoleInitialization: (state, action) => {\n state.rolesInitialized = action.payload;\n },\n createdRole: (state, action: PayloadAction<Role>) => {\n state.rolesById[action.payload.name] = {\n ...state.rolesById[action.payload.name],\n ...action.payload\n };\n },\n removedRole: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: toBeRemoved, ...rolesById } = state.rolesById;\n state.rolesById = rolesById;\n },\n setCustomColumns: (state, action: PayloadAction<CustomColumn[]>) => {\n state.customColumns = action.payload;\n },\n setGlobalSettings: (state, action: PayloadAction<GlobalSettings>) => {\n state.settingsInitialized = true;\n state.globalSettings = {\n ...state.globalSettings,\n ...action.payload\n };\n },\n setUserSettings: (state, action: PayloadAction<UserSettings>) => {\n state.userSettingsInitialized = true;\n state.userSettings = {\n ...state.userSettings,\n ...action.payload\n };\n },\n setTooltipState: (state, action: PayloadAction<{ id: string; readState: ReadState }>) => {\n const { id, readState = READ_STATES.read } = action.payload;\n state.tooltips.byId[id] = { ...state.tooltips.byId[id], readState };\n },\n setTooltipsState: (state, action: PayloadAction<UserSliceState['tooltips']['byId']>) => {\n state.tooltips.byId = {\n ...state.tooltips.byId,\n ...action.payload\n };\n },\n setShowFeedbackDialog: (state, action: PayloadAction<boolean>) => {\n state.showFeedbackDialog = action.payload;\n },\n setShowConnectingDialog: (state, action: PayloadAction<boolean>) => {\n state.showConnectDeviceDialog = action.payload;\n },\n setShowStartupNotification: (state, action: PayloadAction<boolean>) => {\n state.showStartupNotification = action.payload;\n }\n }\n});\n\nexport const actions = usersSlice.actions;\nexport default usersSlice.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","'use strict';\n\n// Copyright 2015 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 { uiPermissionsById } from '../constants';\n\nexport type UiPermission = {\n explanations: object;\n permissionLevel: number;\n permissionSets: Record<string, string>;\n title: string;\n value: string;\n verbs: string[];\n};\n\ntype ExcessiveAccessConfig = {\n selector: string;\n warning: string;\n};\n\ntype EndpointDefinition = {\n path: RegExp;\n types: string[];\n uiPermissions: UiPermission[];\n};\n\n/**\n * _uiPermissions_ represent the possible permissions/ rights that can be given for the area\n * _endpoints_ represent the possible endpoints this definition might be affecting in the UI and what\n * functionality might be affected\n *\n */\nexport type PermissionsArea = {\n endpoints: EndpointDefinition[];\n excessiveAccessConfig?: ExcessiveAccessConfig;\n explanation: string;\n filter?: (object) => string[];\n key: string;\n placeholder?: string;\n scope?: string;\n title: string;\n uiPermissions: UiPermission[];\n};\n\nexport const itemUiPermissionsReducer = (accu, { item, uiPermissions }) => (item ? { ...accu, [item]: uiPermissions } : accu);\n\nconst checkSinglePermission = (permission, requiredPermission) =>\n requiredPermission === permission || uiPermissionsById[permission].permissionLevel > uiPermissionsById[requiredPermission].permissionLevel;\n\nexport const checkPermissionsObject = (permissions, requiredPermission, scopedAccess, superAccess) =>\n permissions[superAccess]?.some(permission => checkSinglePermission(permission, requiredPermission)) ||\n permissions[scopedAccess]?.some(permission => checkSinglePermission(permission, requiredPermission));\n\nexport const USER_LOGOUT = 'USER_LOGOUT';\n\nexport const OWN_USER_ID = 'me';\n\nexport const settingsKeys = { initialized: 'settings-initialized' };\n\nexport const READ_STATES = {\n read: 'read',\n seen: 'seen',\n unread: 'unread'\n} as const;\nexport type ReadState = keyof typeof READ_STATES;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;A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,GAAG,MAAM;AAAA,QACT,GAAG,OAAO;AAAA,MACZ;AAAA,IACF;AAAA,IACA,iBAAiB,CAAC,OAAO,WAAwC;AAC/D,YAAM,0BAA0B;AAChC,YAAM,eAAe;AAAA,QACnB,GAAG,MAAM;AAAA,QACT,GAAG,OAAO;AAAA,MACZ;AAAA,IACF;AAAA,IACA,iBAAiB,CAAC,OAAO,WAAgE;AACvF,YAAM,EAAE,IAAI,YAAY,YAAY,KAAK,IAAI,OAAO;AACpD,YAAM,SAAS,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,SAAS,KAAK,EAAE,GAAG,UAAU;AAAA,IACpE;AAAA,IACA,kBAAkB,CAAC,OAAO,WAA8D;AACtF,YAAM,SAAS,OAAO;AAAA,QACpB,GAAG,MAAM,SAAS;AAAA,QAClB,GAAG,OAAO;AAAA,MACZ;AAAA,IACF;AAAA,IACA,uBAAuB,CAAC,OAAO,WAAmC;AAChE,YAAM,qBAAqB,OAAO;AAAA,IACpC;AAAA,IACA,yBAAyB,CAAC,OAAO,WAAmC;AAClE,YAAM,0BAA0B,OAAO;AAAA,IACzC;AAAA,IACA,4BAA4B,CAAC,OAAO,WAAmC;AACrE,YAAM,0BAA0B,OAAO;AAAA,IACzC;AAAA,EACF;AACF,CAAC;AAEM,IAAM,UAAU,WAAW;AAClC,IAAO,qBAAQ,WAAW;","names":["rolesById"]}
|
|
1
|
+
{"version":3,"sources":["../../src/usersSlice/index.ts","../../src/constants.ts","../../src/usersSlice/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 { User as BackendUser, DeploymentPhase, TenantInfo, TenantsIdName } from '@northern.tech/types/MenderTypes';\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { FilterOperator, PermissionSet, Role } from '../constants';\nimport { defaultPermissionSets, rolesById } from '../constants';\nimport type { ReadState } from './constants';\nimport { READ_STATES } from './constants';\n\nexport const sliceName = 'users';\nexport type User = BackendUser & TenantInfo & { tenants?: TenantsIdName };\nexport type UserSession = {\n expiresAt?: string;\n token: string;\n};\nexport type CustomColumn = {\n attribute: {\n name: string;\n scope: string;\n };\n size: number;\n};\n\ntype FilterOption = {\n key: string;\n operator: FilterOperator;\n scope: string;\n value: string;\n};\nexport type GlobalSettings = {\n [x: string]: any;\n id_attribute?: {\n attribute: string;\n scope: string;\n };\n previousFilters: FilterOption[];\n previousPhases: DeploymentPhase[][];\n retries: number;\n};\ntype Column = {\n id: string;\n key: string;\n name: string;\n scope: string;\n title: string;\n};\nexport type UserSettings = {\n [x: string]: any;\n columnSelection: Column[];\n feedbackCollectedAt?: string;\n firstLoginTimestamp: null | string;\n mode?: 'light' | 'dark';\n onboarding: Partial<{\n address: string;\n approach: 'physical' | 'virtual' | 'mcu' | null;\n complete: boolean;\n demoArtifactPort: number;\n deviceType: string[] | string;\n progress: string;\n showTips: null | boolean;\n showTipsDialog: boolean;\n }>;\n tooltips?: object;\n trackingConsentGiven?: boolean;\n};\n\nexport type UserSliceType = {\n activationCode?: string;\n byId: Record<string, User>;\n currentSession?: UserSession | object;\n currentUser: string | null;\n customColumns: CustomColumn[];\n globalSettings: GlobalSettings;\n permissionSetsById: Record<string, PermissionSet>;\n qrCode: string | null;\n rolesById: Record<string, Role>;\n rolesInitialized: boolean;\n settingsInitialized: boolean;\n showConnectDeviceDialog: boolean;\n showFeedbackDialog: boolean;\n showStartupNotification: boolean;\n tooltips: {\n byId: Record<string, { readState: ReadState }>;\n };\n userSettings: UserSettings;\n userSettingsInitialized: boolean;\n};\n\nexport const initialState: UserSliceType = {\n activationCode: undefined,\n byId: {},\n currentUser: null,\n currentSession: {\n // { token: window.localStorage.getItem('JWT'), expiresAt: '2023-01-01T00:15:00.000Z' | undefined }, // expiresAt depending on the stay logged in setting\n },\n customColumns: [],\n qrCode: null,\n globalSettings: {\n id_attribute: undefined,\n previousFilters: [],\n previousPhases: [],\n retries: 0\n },\n permissionSetsById: {\n ...defaultPermissionSets\n },\n rolesById: {\n ...rolesById\n },\n rolesInitialized: false,\n settingsInitialized: false,\n showConnectDeviceDialog: false,\n showFeedbackDialog: false,\n showStartupNotification: false,\n tooltips: {\n byId: {\n // <id>: { readState: <read|unread> } // this object is getting enhanced by the tooltip texts in the app constants\n }\n },\n userSettings: {\n columnSelection: [],\n onboarding: {},\n firstLoginTimestamp: null\n },\n userSettingsInitialized: false\n};\n\nexport const usersSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n receivedQrCode: (state, action: PayloadAction<string | null>) => {\n state.qrCode = action.payload;\n },\n successfullyLoggedIn: (state, action: PayloadAction<UserSession>) => {\n state.currentSession = action.payload;\n },\n receivedUserList: (state, action: PayloadAction<Record<string, User>>) => {\n state.byId = action.payload;\n },\n receivedActivationCode: (state, action: PayloadAction<string>) => {\n state.activationCode = action.payload;\n },\n receivedUser: (state, action: PayloadAction<User>) => {\n state.byId[action.payload.id] = action.payload;\n state.currentUser = action.payload.id;\n },\n removedUser: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: removedUser, ...byId } = state.byId;\n state.byId = byId;\n state.currentUser = state.currentUser === action.payload ? null : state.currentUser;\n },\n updatedUser: (state, action: PayloadAction<Partial<User> & { id: string }>) => {\n state.byId[action.payload.id] = {\n ...state.byId[action.payload.id],\n ...action.payload\n };\n },\n receivedPermissionSets: (state, action: PayloadAction<Record<string, PermissionSet>>) => {\n state.permissionSetsById = action.payload;\n },\n receivedRoles: (state, action: PayloadAction<Record<string, Role>>) => {\n state.rolesById = action.payload;\n state.rolesInitialized = true;\n },\n finishedRoleInitialization: (state, action) => {\n state.rolesInitialized = action.payload;\n },\n createdRole: (state, action: PayloadAction<Role>) => {\n state.rolesById[action.payload.name] = {\n ...state.rolesById[action.payload.name],\n ...action.payload\n };\n },\n removedRole: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: toBeRemoved, ...rolesById } = state.rolesById;\n state.rolesById = rolesById;\n },\n setCustomColumns: (state, action: PayloadAction<CustomColumn[]>) => {\n state.customColumns = action.payload;\n },\n setGlobalSettings: (state, action: PayloadAction<GlobalSettings>) => {\n state.settingsInitialized = true;\n state.globalSettings = {\n ...state.globalSettings,\n ...action.payload\n };\n },\n setUserSettings: (state, action: PayloadAction<UserSettings>) => {\n state.userSettingsInitialized = true;\n state.userSettings = {\n ...state.userSettings,\n ...action.payload\n };\n },\n setTooltipState: (state, action: PayloadAction<{ id: string; readState: ReadState }>) => {\n const { id, readState = READ_STATES.read } = action.payload;\n state.tooltips.byId[id] = { ...state.tooltips.byId[id], readState };\n },\n setTooltipsState: (state, action: PayloadAction<UserSliceType['tooltips']['byId']>) => {\n state.tooltips.byId = {\n ...state.tooltips.byId,\n ...action.payload\n };\n },\n setShowFeedbackDialog: (state, action: PayloadAction<boolean>) => {\n state.showFeedbackDialog = action.payload;\n },\n setShowConnectingDialog: (state, action: PayloadAction<boolean>) => {\n state.showConnectDeviceDialog = action.payload;\n },\n setShowStartupNotification: (state, action: PayloadAction<boolean>) => {\n state.showStartupNotification = action.payload;\n }\n }\n});\n\nexport const actions = usersSlice.actions;\nexport default usersSlice.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","'use strict';\n\n// Copyright 2015 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 { uiPermissionsById } from '../constants';\n\nexport type UiPermission = {\n explanations: object;\n permissionLevel: number;\n permissionSets: Record<string, string>;\n title: string;\n value: string;\n verbs: string[];\n};\n\ntype ExcessiveAccessConfig = {\n selector: string;\n warning: string;\n};\n\ntype EndpointDefinition = {\n path: RegExp;\n types: string[];\n uiPermissions: UiPermission[];\n};\n\n/**\n * _uiPermissions_ represent the possible permissions/ rights that can be given for the area\n * _endpoints_ represent the possible endpoints this definition might be affecting in the UI and what\n * functionality might be affected\n *\n */\nexport type PermissionsArea = {\n endpoints: EndpointDefinition[];\n excessiveAccessConfig?: ExcessiveAccessConfig;\n explanation: string;\n filter?: (object) => string[];\n key: string;\n placeholder?: string;\n scope?: string;\n title: string;\n uiPermissions: UiPermission[];\n};\n\nexport const itemUiPermissionsReducer = (accu, { item, uiPermissions }) => (item ? { ...accu, [item]: uiPermissions } : accu);\n\nconst checkSinglePermission = (permission, requiredPermission) =>\n requiredPermission === permission || uiPermissionsById[permission].permissionLevel > uiPermissionsById[requiredPermission].permissionLevel;\n\nexport const checkPermissionsObject = (permissions, requiredPermission, scopedAccess, superAccess) =>\n permissions[superAccess]?.some(permission => checkSinglePermission(permission, requiredPermission)) ||\n permissions[scopedAccess]?.some(permission => checkSinglePermission(permission, requiredPermission));\n\nexport const USER_LOGOUT = 'USER_LOGOUT';\n\nexport const OWN_USER_ID = 'me';\n\nexport const settingsKeys = { initialized: 'settings-initialized' };\n\nexport const READ_STATES = {\n read: 'read',\n seen: 'seen',\n unread: 'unread'\n} as const;\nexport type ReadState = keyof typeof READ_STATES;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,qBAA4B;;;ACD5B,uBA8CO;;;ACUA,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AACV;;;AFpDO,IAAM,YAAY;AA+ElB,IAAM,eAA8B;AAAA,EACzC,gBAAgB;AAAA,EAChB,MAAM,CAAC;A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AM,EAAE,IAAI,YAAY,YAAY,KAAK,IAAI,OAAO;AACpD,YAAM,SAAS,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,SAAS,KAAK,EAAE,GAAG,UAAU;AAAA,IACpE;AAAA,IACA,kBAAkB,CAAC,OAAO,WAA6D;AACrF,YAAM,SAAS,OAAO;AAAA,QACpB,GAAG,MAAM,SAAS;AAAA,QAClB,GAAG,OAAO;AAAA,MACZ;AAAA,IACF;AAAA,IACA,uBAAuB,CAAC,OAAO,WAAmC;AAChE,YAAM,qBAAqB,OAAO;AAAA,IACpC;AAAA,IACA,yBAAyB,CAAC,OAAO,WAAmC;AAClE,YAAM,0BAA0B,OAAO;AAAA,IACzC;AAAA,IACA,4BAA4B,CAAC,OAAO,WAAmC;AACrE,YAAM,0BAA0B,OAAO;AAAA,IACzC;AAAA,EACF;AACF,CAAC;AAEM,IAAM,UAAU,WAAW;AAClC,IAAO,qBAAQ,WAAW;","names":["rolesById"]}
|
|
@@ -65,7 +65,7 @@ type UserSettings = {
|
|
|
65
65
|
tooltips?: object;
|
|
66
66
|
trackingConsentGiven?: boolean;
|
|
67
67
|
};
|
|
68
|
-
type
|
|
68
|
+
type UserSliceType = {
|
|
69
69
|
activationCode?: string;
|
|
70
70
|
byId: Record<string, User>;
|
|
71
71
|
currentSession?: UserSession | object;
|
|
@@ -88,67 +88,67 @@ type UserSliceState = {
|
|
|
88
88
|
userSettings: UserSettings;
|
|
89
89
|
userSettingsInitialized: boolean;
|
|
90
90
|
};
|
|
91
|
-
declare const initialState:
|
|
92
|
-
declare const usersSlice: _reduxjs_toolkit.Slice<
|
|
93
|
-
receivedQrCode: (state: immer.WritableDraft<
|
|
94
|
-
successfullyLoggedIn: (state: immer.WritableDraft<
|
|
95
|
-
receivedUserList: (state: immer.WritableDraft<
|
|
96
|
-
receivedActivationCode: (state: immer.WritableDraft<
|
|
97
|
-
receivedUser: (state: immer.WritableDraft<
|
|
98
|
-
removedUser: (state: immer.WritableDraft<
|
|
99
|
-
updatedUser: (state: immer.WritableDraft<
|
|
91
|
+
declare const initialState: UserSliceType;
|
|
92
|
+
declare const usersSlice: _reduxjs_toolkit.Slice<UserSliceType, {
|
|
93
|
+
receivedQrCode: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<string | null>) => void;
|
|
94
|
+
successfullyLoggedIn: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<UserSession>) => void;
|
|
95
|
+
receivedUserList: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Record<string, User>>) => void;
|
|
96
|
+
receivedActivationCode: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<string>) => void;
|
|
97
|
+
receivedUser: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<User>) => void;
|
|
98
|
+
removedUser: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<string>) => void;
|
|
99
|
+
updatedUser: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Partial<User> & {
|
|
100
100
|
id: string;
|
|
101
101
|
}>) => void;
|
|
102
|
-
receivedPermissionSets: (state: immer.WritableDraft<
|
|
103
|
-
receivedRoles: (state: immer.WritableDraft<
|
|
104
|
-
finishedRoleInitialization: (state: immer.WritableDraft<
|
|
102
|
+
receivedPermissionSets: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Record<string, PermissionSet>>) => void;
|
|
103
|
+
receivedRoles: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Record<string, Role>>) => void;
|
|
104
|
+
finishedRoleInitialization: (state: immer.WritableDraft<UserSliceType>, action: {
|
|
105
105
|
payload: any;
|
|
106
106
|
type: string;
|
|
107
107
|
}) => void;
|
|
108
|
-
createdRole: (state: immer.WritableDraft<
|
|
109
|
-
removedRole: (state: immer.WritableDraft<
|
|
110
|
-
setCustomColumns: (state: immer.WritableDraft<
|
|
111
|
-
setGlobalSettings: (state: immer.WritableDraft<
|
|
112
|
-
setUserSettings: (state: immer.WritableDraft<
|
|
113
|
-
setTooltipState: (state: immer.WritableDraft<
|
|
108
|
+
createdRole: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Role>) => void;
|
|
109
|
+
removedRole: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<string>) => void;
|
|
110
|
+
setCustomColumns: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<CustomColumn[]>) => void;
|
|
111
|
+
setGlobalSettings: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<GlobalSettings>) => void;
|
|
112
|
+
setUserSettings: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<UserSettings>) => void;
|
|
113
|
+
setTooltipState: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<{
|
|
114
114
|
id: string;
|
|
115
115
|
readState: ReadState;
|
|
116
116
|
}>) => void;
|
|
117
|
-
setTooltipsState: (state: immer.WritableDraft<
|
|
118
|
-
setShowFeedbackDialog: (state: immer.WritableDraft<
|
|
119
|
-
setShowConnectingDialog: (state: immer.WritableDraft<
|
|
120
|
-
setShowStartupNotification: (state: immer.WritableDraft<
|
|
121
|
-
}, "users", "users", _reduxjs_toolkit.SliceSelectors<
|
|
117
|
+
setTooltipsState: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<UserSliceType["tooltips"]["byId"]>) => void;
|
|
118
|
+
setShowFeedbackDialog: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<boolean>) => void;
|
|
119
|
+
setShowConnectingDialog: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<boolean>) => void;
|
|
120
|
+
setShowStartupNotification: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<boolean>) => void;
|
|
121
|
+
}, "users", "users", _reduxjs_toolkit.SliceSelectors<UserSliceType>>;
|
|
122
122
|
declare const actions: _reduxjs_toolkit.CaseReducerActions<{
|
|
123
|
-
receivedQrCode: (state: immer.WritableDraft<
|
|
124
|
-
successfullyLoggedIn: (state: immer.WritableDraft<
|
|
125
|
-
receivedUserList: (state: immer.WritableDraft<
|
|
126
|
-
receivedActivationCode: (state: immer.WritableDraft<
|
|
127
|
-
receivedUser: (state: immer.WritableDraft<
|
|
128
|
-
removedUser: (state: immer.WritableDraft<
|
|
129
|
-
updatedUser: (state: immer.WritableDraft<
|
|
123
|
+
receivedQrCode: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<string | null>) => void;
|
|
124
|
+
successfullyLoggedIn: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<UserSession>) => void;
|
|
125
|
+
receivedUserList: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Record<string, User>>) => void;
|
|
126
|
+
receivedActivationCode: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<string>) => void;
|
|
127
|
+
receivedUser: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<User>) => void;
|
|
128
|
+
removedUser: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<string>) => void;
|
|
129
|
+
updatedUser: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Partial<User> & {
|
|
130
130
|
id: string;
|
|
131
131
|
}>) => void;
|
|
132
|
-
receivedPermissionSets: (state: immer.WritableDraft<
|
|
133
|
-
receivedRoles: (state: immer.WritableDraft<
|
|
134
|
-
finishedRoleInitialization: (state: immer.WritableDraft<
|
|
132
|
+
receivedPermissionSets: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Record<string, PermissionSet>>) => void;
|
|
133
|
+
receivedRoles: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Record<string, Role>>) => void;
|
|
134
|
+
finishedRoleInitialization: (state: immer.WritableDraft<UserSliceType>, action: {
|
|
135
135
|
payload: any;
|
|
136
136
|
type: string;
|
|
137
137
|
}) => void;
|
|
138
|
-
createdRole: (state: immer.WritableDraft<
|
|
139
|
-
removedRole: (state: immer.WritableDraft<
|
|
140
|
-
setCustomColumns: (state: immer.WritableDraft<
|
|
141
|
-
setGlobalSettings: (state: immer.WritableDraft<
|
|
142
|
-
setUserSettings: (state: immer.WritableDraft<
|
|
143
|
-
setTooltipState: (state: immer.WritableDraft<
|
|
138
|
+
createdRole: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Role>) => void;
|
|
139
|
+
removedRole: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<string>) => void;
|
|
140
|
+
setCustomColumns: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<CustomColumn[]>) => void;
|
|
141
|
+
setGlobalSettings: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<GlobalSettings>) => void;
|
|
142
|
+
setUserSettings: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<UserSettings>) => void;
|
|
143
|
+
setTooltipState: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<{
|
|
144
144
|
id: string;
|
|
145
145
|
readState: ReadState;
|
|
146
146
|
}>) => void;
|
|
147
|
-
setTooltipsState: (state: immer.WritableDraft<
|
|
148
|
-
setShowFeedbackDialog: (state: immer.WritableDraft<
|
|
149
|
-
setShowConnectingDialog: (state: immer.WritableDraft<
|
|
150
|
-
setShowStartupNotification: (state: immer.WritableDraft<
|
|
147
|
+
setTooltipsState: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<UserSliceType["tooltips"]["byId"]>) => void;
|
|
148
|
+
setShowFeedbackDialog: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<boolean>) => void;
|
|
149
|
+
setShowConnectingDialog: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<boolean>) => void;
|
|
150
|
+
setShowStartupNotification: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<boolean>) => void;
|
|
151
151
|
}, "users">;
|
|
152
|
-
declare const _default: redux.Reducer<
|
|
152
|
+
declare const _default: redux.Reducer<UserSliceType>;
|
|
153
153
|
|
|
154
|
-
export { type CustomColumn, type GlobalSettings, type User, type UserSession, type UserSettings, actions, _default as default, initialState, sliceName, usersSlice };
|
|
154
|
+
export { type CustomColumn, type GlobalSettings, type User, type UserSession, type UserSettings, type UserSliceType, actions, _default as default, initialState, sliceName, usersSlice };
|
|
@@ -65,7 +65,7 @@ type UserSettings = {
|
|
|
65
65
|
tooltips?: object;
|
|
66
66
|
trackingConsentGiven?: boolean;
|
|
67
67
|
};
|
|
68
|
-
type
|
|
68
|
+
type UserSliceType = {
|
|
69
69
|
activationCode?: string;
|
|
70
70
|
byId: Record<string, User>;
|
|
71
71
|
currentSession?: UserSession | object;
|
|
@@ -88,67 +88,67 @@ type UserSliceState = {
|
|
|
88
88
|
userSettings: UserSettings;
|
|
89
89
|
userSettingsInitialized: boolean;
|
|
90
90
|
};
|
|
91
|
-
declare const initialState:
|
|
92
|
-
declare const usersSlice: _reduxjs_toolkit.Slice<
|
|
93
|
-
receivedQrCode: (state: immer.WritableDraft<
|
|
94
|
-
successfullyLoggedIn: (state: immer.WritableDraft<
|
|
95
|
-
receivedUserList: (state: immer.WritableDraft<
|
|
96
|
-
receivedActivationCode: (state: immer.WritableDraft<
|
|
97
|
-
receivedUser: (state: immer.WritableDraft<
|
|
98
|
-
removedUser: (state: immer.WritableDraft<
|
|
99
|
-
updatedUser: (state: immer.WritableDraft<
|
|
91
|
+
declare const initialState: UserSliceType;
|
|
92
|
+
declare const usersSlice: _reduxjs_toolkit.Slice<UserSliceType, {
|
|
93
|
+
receivedQrCode: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<string | null>) => void;
|
|
94
|
+
successfullyLoggedIn: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<UserSession>) => void;
|
|
95
|
+
receivedUserList: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Record<string, User>>) => void;
|
|
96
|
+
receivedActivationCode: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<string>) => void;
|
|
97
|
+
receivedUser: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<User>) => void;
|
|
98
|
+
removedUser: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<string>) => void;
|
|
99
|
+
updatedUser: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Partial<User> & {
|
|
100
100
|
id: string;
|
|
101
101
|
}>) => void;
|
|
102
|
-
receivedPermissionSets: (state: immer.WritableDraft<
|
|
103
|
-
receivedRoles: (state: immer.WritableDraft<
|
|
104
|
-
finishedRoleInitialization: (state: immer.WritableDraft<
|
|
102
|
+
receivedPermissionSets: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Record<string, PermissionSet>>) => void;
|
|
103
|
+
receivedRoles: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Record<string, Role>>) => void;
|
|
104
|
+
finishedRoleInitialization: (state: immer.WritableDraft<UserSliceType>, action: {
|
|
105
105
|
payload: any;
|
|
106
106
|
type: string;
|
|
107
107
|
}) => void;
|
|
108
|
-
createdRole: (state: immer.WritableDraft<
|
|
109
|
-
removedRole: (state: immer.WritableDraft<
|
|
110
|
-
setCustomColumns: (state: immer.WritableDraft<
|
|
111
|
-
setGlobalSettings: (state: immer.WritableDraft<
|
|
112
|
-
setUserSettings: (state: immer.WritableDraft<
|
|
113
|
-
setTooltipState: (state: immer.WritableDraft<
|
|
108
|
+
createdRole: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Role>) => void;
|
|
109
|
+
removedRole: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<string>) => void;
|
|
110
|
+
setCustomColumns: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<CustomColumn[]>) => void;
|
|
111
|
+
setGlobalSettings: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<GlobalSettings>) => void;
|
|
112
|
+
setUserSettings: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<UserSettings>) => void;
|
|
113
|
+
setTooltipState: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<{
|
|
114
114
|
id: string;
|
|
115
115
|
readState: ReadState;
|
|
116
116
|
}>) => void;
|
|
117
|
-
setTooltipsState: (state: immer.WritableDraft<
|
|
118
|
-
setShowFeedbackDialog: (state: immer.WritableDraft<
|
|
119
|
-
setShowConnectingDialog: (state: immer.WritableDraft<
|
|
120
|
-
setShowStartupNotification: (state: immer.WritableDraft<
|
|
121
|
-
}, "users", "users", _reduxjs_toolkit.SliceSelectors<
|
|
117
|
+
setTooltipsState: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<UserSliceType["tooltips"]["byId"]>) => void;
|
|
118
|
+
setShowFeedbackDialog: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<boolean>) => void;
|
|
119
|
+
setShowConnectingDialog: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<boolean>) => void;
|
|
120
|
+
setShowStartupNotification: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<boolean>) => void;
|
|
121
|
+
}, "users", "users", _reduxjs_toolkit.SliceSelectors<UserSliceType>>;
|
|
122
122
|
declare const actions: _reduxjs_toolkit.CaseReducerActions<{
|
|
123
|
-
receivedQrCode: (state: immer.WritableDraft<
|
|
124
|
-
successfullyLoggedIn: (state: immer.WritableDraft<
|
|
125
|
-
receivedUserList: (state: immer.WritableDraft<
|
|
126
|
-
receivedActivationCode: (state: immer.WritableDraft<
|
|
127
|
-
receivedUser: (state: immer.WritableDraft<
|
|
128
|
-
removedUser: (state: immer.WritableDraft<
|
|
129
|
-
updatedUser: (state: immer.WritableDraft<
|
|
123
|
+
receivedQrCode: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<string | null>) => void;
|
|
124
|
+
successfullyLoggedIn: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<UserSession>) => void;
|
|
125
|
+
receivedUserList: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Record<string, User>>) => void;
|
|
126
|
+
receivedActivationCode: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<string>) => void;
|
|
127
|
+
receivedUser: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<User>) => void;
|
|
128
|
+
removedUser: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<string>) => void;
|
|
129
|
+
updatedUser: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Partial<User> & {
|
|
130
130
|
id: string;
|
|
131
131
|
}>) => void;
|
|
132
|
-
receivedPermissionSets: (state: immer.WritableDraft<
|
|
133
|
-
receivedRoles: (state: immer.WritableDraft<
|
|
134
|
-
finishedRoleInitialization: (state: immer.WritableDraft<
|
|
132
|
+
receivedPermissionSets: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Record<string, PermissionSet>>) => void;
|
|
133
|
+
receivedRoles: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Record<string, Role>>) => void;
|
|
134
|
+
finishedRoleInitialization: (state: immer.WritableDraft<UserSliceType>, action: {
|
|
135
135
|
payload: any;
|
|
136
136
|
type: string;
|
|
137
137
|
}) => void;
|
|
138
|
-
createdRole: (state: immer.WritableDraft<
|
|
139
|
-
removedRole: (state: immer.WritableDraft<
|
|
140
|
-
setCustomColumns: (state: immer.WritableDraft<
|
|
141
|
-
setGlobalSettings: (state: immer.WritableDraft<
|
|
142
|
-
setUserSettings: (state: immer.WritableDraft<
|
|
143
|
-
setTooltipState: (state: immer.WritableDraft<
|
|
138
|
+
createdRole: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<Role>) => void;
|
|
139
|
+
removedRole: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<string>) => void;
|
|
140
|
+
setCustomColumns: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<CustomColumn[]>) => void;
|
|
141
|
+
setGlobalSettings: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<GlobalSettings>) => void;
|
|
142
|
+
setUserSettings: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<UserSettings>) => void;
|
|
143
|
+
setTooltipState: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<{
|
|
144
144
|
id: string;
|
|
145
145
|
readState: ReadState;
|
|
146
146
|
}>) => void;
|
|
147
|
-
setTooltipsState: (state: immer.WritableDraft<
|
|
148
|
-
setShowFeedbackDialog: (state: immer.WritableDraft<
|
|
149
|
-
setShowConnectingDialog: (state: immer.WritableDraft<
|
|
150
|
-
setShowStartupNotification: (state: immer.WritableDraft<
|
|
147
|
+
setTooltipsState: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<UserSliceType["tooltips"]["byId"]>) => void;
|
|
148
|
+
setShowFeedbackDialog: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<boolean>) => void;
|
|
149
|
+
setShowConnectingDialog: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<boolean>) => void;
|
|
150
|
+
setShowStartupNotification: (state: immer.WritableDraft<UserSliceType>, action: PayloadAction<boolean>) => void;
|
|
151
151
|
}, "users">;
|
|
152
|
-
declare const _default: redux.Reducer<
|
|
152
|
+
declare const _default: redux.Reducer<UserSliceType>;
|
|
153
153
|
|
|
154
|
-
export { type CustomColumn, type GlobalSettings, type User, type UserSession, type UserSettings, actions, _default as default, initialState, sliceName, usersSlice };
|
|
154
|
+
export { type CustomColumn, type GlobalSettings, type User, type UserSession, type UserSettings, type UserSliceType, actions, _default as default, initialState, sliceName, usersSlice };
|
package/dist/usersSlice/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/usersSlice/mocks.ts","../../src/constants.ts","../../src/usersSlice/constants.ts","../../src/usersSlice/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 { emptyRole, emptyUiPermissions, rolesById, rolesByName, twoFAStates, uiPermissionsById } from '../constants';\nimport { initialState } from './index';\n\nconst userId = 'a30a780b-b843-5344-80e3-0fd95a4f6fc3';\n\nexport const mockState = {\n ...initialState,\n byId: {\n a1: { email: 'a@b.com', id: 'a1', created_ts: '2019-01-01T10:30:00.000Z', roles: [rolesByName.admin], verified: true },\n [userId]: { email: 'a2@b.com', id: userId, created_ts: '2019-01-01T12:30:00.000Z', roles: [rolesByName.admin], tfa_status: twoFAStates.enabled }\n },\n currentUser: 'a1',\n globalSettings: { '2fa': 'enabled', id_attribute: undefined, previousFilters: [] },\n rolesById: {\n ...rolesById,\n test: {\n ...emptyRole,\n name: 'test',\n description: 'test description',\n editable: true,\n uiPermissions: {\n ...emptyUiPermissions,\n groups: { testGroup: [uiPermissionsById.read.value] },\n releases: { bar: [uiPermissionsById.read.value] }\n }\n }\n },\n settingsInitialized: true,\n userSettingsInitialized: true,\n userSettings: { '2fa': 'disabled', previousFilters: [], columnSelection: [], onboarding: { something: 'here' }, tooltips: {} }\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","'use strict';\n\n// Copyright 2015 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 { uiPermissionsById } from '../constants';\n\nexport type UiPermission = {\n explanations: object;\n permissionLevel: number;\n permissionSets: Record<string, string>;\n title: string;\n value: string;\n verbs: string[];\n};\n\ntype ExcessiveAccessConfig = {\n selector: string;\n warning: string;\n};\n\ntype EndpointDefinition = {\n path: RegExp;\n types: string[];\n uiPermissions: UiPermission[];\n};\n\n/**\n * _uiPermissions_ represent the possible permissions/ rights that can be given for the area\n * _endpoints_ represent the possible endpoints this definition might be affecting in the UI and what\n * functionality might be affected\n *\n */\nexport type PermissionsArea = {\n endpoints: EndpointDefinition[];\n excessiveAccessConfig?: ExcessiveAccessConfig;\n explanation: string;\n filter?: (object) => string[];\n key: string;\n placeholder?: string;\n scope?: string;\n title: string;\n uiPermissions: UiPermission[];\n};\n\nexport const itemUiPermissionsReducer = (accu, { item, uiPermissions }) => (item ? { ...accu, [item]: uiPermissions } : accu);\n\nconst checkSinglePermission = (permission, requiredPermission) =>\n requiredPermission === permission || uiPermissionsById[permission].permissionLevel > uiPermissionsById[requiredPermission].permissionLevel;\n\nexport const checkPermissionsObject = (permissions, requiredPermission, scopedAccess, superAccess) =>\n permissions[superAccess]?.some(permission => checkSinglePermission(permission, requiredPermission)) ||\n permissions[scopedAccess]?.some(permission => checkSinglePermission(permission, requiredPermission));\n\nexport const USER_LOGOUT = 'USER_LOGOUT';\n\nexport const OWN_USER_ID = 'me';\n\nexport const settingsKeys = { initialized: 'settings-initialized' };\n\nexport const READ_STATES = {\n read: 'read',\n seen: 'seen',\n unread: 'unread'\n} as const;\nexport type ReadState = keyof typeof READ_STATES;\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 { User as BackendUser, DeploymentPhase, TenantInfo, TenantsIdName } from '@northern.tech/types/MenderTypes';\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { FilterOperator, PermissionSet, Role } from '../constants';\nimport { defaultPermissionSets, rolesById } from '../constants';\nimport type { ReadState } from './constants';\nimport { READ_STATES } from './constants';\n\nexport const sliceName = 'users';\nexport type User = BackendUser & TenantInfo & { tenants?: TenantsIdName };\nexport type UserSession = {\n expiresAt?: string;\n token: string;\n};\nexport type CustomColumn = {\n attribute: {\n name: string;\n scope: string;\n };\n size: number;\n};\n\ntype FilterOption = {\n key: string;\n operator: FilterOperator;\n scope: string;\n value: string;\n};\nexport type GlobalSettings = {\n [x: string]: any;\n id_attribute?: {\n attribute: string;\n scope: string;\n };\n previousFilters: FilterOption[];\n previousPhases: DeploymentPhase[][];\n retries: number;\n};\ntype Column = {\n id: string;\n key: string;\n name: string;\n scope: string;\n title: string;\n};\nexport type UserSettings = {\n [x: string]: any;\n columnSelection: Column[];\n feedbackCollectedAt?: string;\n firstLoginTimestamp: null | string;\n mode?: 'light' | 'dark';\n onboarding: Partial<{\n address: string;\n approach: 'physical' | 'virtual' | 'mcu' | null;\n complete: boolean;\n demoArtifactPort: number;\n deviceType: string[] | string;\n progress: string;\n showTips: null | boolean;\n showTipsDialog: boolean;\n }>;\n tooltips?: object;\n trackingConsentGiven?: boolean;\n};\ntype UserSliceState = {\n activationCode?: string;\n byId: Record<string, User>;\n currentSession?: UserSession | object;\n currentUser: string | null;\n customColumns: CustomColumn[];\n globalSettings: GlobalSettings;\n permissionSetsById: Record<string, PermissionSet>;\n qrCode: string | null;\n rolesById: Record<string, Role>;\n rolesInitialized: boolean;\n settingsInitialized: boolean;\n showConnectDeviceDialog: boolean;\n showFeedbackDialog: boolean;\n showStartupNotification: boolean;\n tooltips: {\n byId: Record<string, { readState: ReadState }>;\n };\n userSettings: UserSettings;\n userSettingsInitialized: boolean;\n};\nexport const initialState: UserSliceState = {\n activationCode: undefined,\n byId: {},\n currentUser: null,\n currentSession: {\n // { token: window.localStorage.getItem('JWT'), expiresAt: '2023-01-01T00:15:00.000Z' | undefined }, // expiresAt depending on the stay logged in setting\n },\n customColumns: [],\n qrCode: null,\n globalSettings: {\n id_attribute: undefined,\n previousFilters: [],\n previousPhases: [],\n retries: 0\n },\n permissionSetsById: {\n ...defaultPermissionSets\n },\n rolesById: {\n ...rolesById\n },\n rolesInitialized: false,\n settingsInitialized: false,\n showConnectDeviceDialog: false,\n showFeedbackDialog: false,\n showStartupNotification: false,\n tooltips: {\n byId: {\n // <id>: { readState: <read|unread> } // this object is getting enhanced by the tooltip texts in the app constants\n }\n },\n userSettings: {\n columnSelection: [],\n onboarding: {},\n firstLoginTimestamp: null\n },\n userSettingsInitialized: false\n};\n\nexport const usersSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n receivedQrCode: (state, action: PayloadAction<string | null>) => {\n state.qrCode = action.payload;\n },\n successfullyLoggedIn: (state, action: PayloadAction<UserSession>) => {\n state.currentSession = action.payload;\n },\n receivedUserList: (state, action: PayloadAction<Record<string, User>>) => {\n state.byId = action.payload;\n },\n receivedActivationCode: (state, action: PayloadAction<string>) => {\n state.activationCode = action.payload;\n },\n receivedUser: (state, action: PayloadAction<User>) => {\n state.byId[action.payload.id] = action.payload;\n state.currentUser = action.payload.id;\n },\n removedUser: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: removedUser, ...byId } = state.byId;\n state.byId = byId;\n state.currentUser = state.currentUser === action.payload ? null : state.currentUser;\n },\n updatedUser: (state, action: PayloadAction<Partial<User> & { id: string }>) => {\n state.byId[action.payload.id] = {\n ...state.byId[action.payload.id],\n ...action.payload\n };\n },\n receivedPermissionSets: (state, action: PayloadAction<Record<string, PermissionSet>>) => {\n state.permissionSetsById = action.payload;\n },\n receivedRoles: (state, action: PayloadAction<Record<string, Role>>) => {\n state.rolesById = action.payload;\n state.rolesInitialized = true;\n },\n finishedRoleInitialization: (state, action) => {\n state.rolesInitialized = action.payload;\n },\n createdRole: (state, action: PayloadAction<Role>) => {\n state.rolesById[action.payload.name] = {\n ...state.rolesById[action.payload.name],\n ...action.payload\n };\n },\n removedRole: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: toBeRemoved, ...rolesById } = state.rolesById;\n state.rolesById = rolesById;\n },\n setCustomColumns: (state, action: PayloadAction<CustomColumn[]>) => {\n state.customColumns = action.payload;\n },\n setGlobalSettings: (state, action: PayloadAction<GlobalSettings>) => {\n state.settingsInitialized = true;\n state.globalSettings = {\n ...state.globalSettings,\n ...action.payload\n };\n },\n setUserSettings: (state, action: PayloadAction<UserSettings>) => {\n state.userSettingsInitialized = true;\n state.userSettings = {\n ...state.userSettings,\n ...action.payload\n };\n },\n setTooltipState: (state, action: PayloadAction<{ id: string; readState: ReadState }>) => {\n const { id, readState = READ_STATES.read } = action.payload;\n state.tooltips.byId[id] = { ...state.tooltips.byId[id], readState };\n },\n setTooltipsState: (state, action: PayloadAction<UserSliceState['tooltips']['byId']>) => {\n state.tooltips.byId = {\n ...state.tooltips.byId,\n ...action.payload\n };\n },\n setShowFeedbackDialog: (state, action: PayloadAction<boolean>) => {\n state.showFeedbackDialog = action.payload;\n },\n setShowConnectingDialog: (state, action: PayloadAction<boolean>) => {\n state.showConnectDeviceDialog = action.payload;\n },\n setShowStartupNotification: (state, action: PayloadAction<boolean>) => {\n state.showStartupNotification = action.payload;\n }\n }\n});\n\nexport const actions = usersSlice.actions;\nexport default usersSlice.reducer;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACcA,uBA8CO;;;ACUA,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AACV;;;AC3DA,qBAA4B;AAOrB,IAAM,YAAY;AA6ElB,IAAM,eAA+B;AAAA,EAC1C,gBAAgB;AAAA,EAChB,MAAM,CAAC;AAAA,EACP,aAAa;AAAA,EACb,gBAAgB;AAAA;AAAA,EAEhB;AAAA,EACA,eAAe,CAAC;AAAA,EAChB,QAAQ;AAAA,EACR,gBAAgB;AAAA,IACd,cAAc;AAAA,IACd,iBAAiB,CAAC;AAAA,IAClB,gBAAgB,CAAC;AAAA,IACjB,SAAS;AAAA,EACX;AAAA,EACA,oBAAoB;AAAA,IAClB,GAAG;AAAA,EACL;AAAA,EACA,WAAW;AAAA,IACT,GAAG;AAAA,EACL;AAAA,EACA,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,yBAAyB;AAAA,EACzB,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,UAAU;AAAA,IACR,MAAM;AAAA;AAAA,IAEN;AAAA,EACF;AAAA,EACA,cAAc;AA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A0B,OAAO;AAAA,IACzC;AAAA,EACF;AACF,CAAC;AAEM,IAAM,UAAU,WAAW;AAClC,IAAO,qBAAQ,WAAW;;;AHvN1B,IAAM,SAAS;AAER,IAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,MAAM;AAAA,IACJ,IAAI,EAAE,OAAO,WAAW,IAAI,MAAM,YAAY,4BAA4B,OAAO,CAAC,6BAAY,KAAK,GAAG,UAAU,KAAK;AAAA,IACrH,CAAC,MAAM,GAAG,EAAE,OAAO,YAAY,IAAI,QAAQ,YAAY,4BAA4B,OAAO,CAAC,6BAAY,KAAK,GAAG,YAAY,6BAAY,QAAQ;AAAA,EACjJ;AAAA,EACA,aAAa;AAAA,EACb,gBAAgB,EAAE,OAAO,WAAW,cAAc,QAAW,iBAAiB,CAAC,EAAE;AAAA,EACjF,WAAW;AAAA,IACT,GAAG;AAAA,IACH,MAAM;AAAA,MACJ,GAAG;AAAA,MACH,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,MACV,eAAe;AAAA,QACb,GAAG;AAAA,QACH,QAAQ,EAAE,WAAW,CAAC,mCAAkB,KAAK,KAAK,EAAE;AAAA,QACpD,UAAU,EAAE,KAAK,CAAC,mCAAkB,KAAK,KAAK,EAAE;AAAA,MAClD;AAAA,IACF;AAAA,EACF;AAAA,EACA,qBAAqB;AAAA,EACrB,yBAAyB;AAAA,EACzB,cAAc,EAAE,OAAO,YAAY,iBAAiB,CAAC,GAAG,iBAAiB,CAAC,GAAG,YAAY,EAAE,WAAW,OAAO,GAAG,UAAU,CAAC,EAAE;AAC/H;","names":["rolesById"]}
|
|
1
|
+
{"version":3,"sources":["../../src/usersSlice/mocks.ts","../../src/constants.ts","../../src/usersSlice/constants.ts","../../src/usersSlice/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 { emptyRole, emptyUiPermissions, rolesById, rolesByName, twoFAStates, uiPermissionsById } from '../constants';\nimport { initialState } from './index';\n\nconst userId = 'a30a780b-b843-5344-80e3-0fd95a4f6fc3';\n\nexport const mockState = {\n ...initialState,\n byId: {\n a1: { email: 'a@b.com', id: 'a1', created_ts: '2019-01-01T10:30:00.000Z', roles: [rolesByName.admin], verified: true },\n [userId]: { email: 'a2@b.com', id: userId, created_ts: '2019-01-01T12:30:00.000Z', roles: [rolesByName.admin], tfa_status: twoFAStates.enabled }\n },\n currentUser: 'a1',\n globalSettings: { '2fa': 'enabled', id_attribute: undefined, previousFilters: [] },\n rolesById: {\n ...rolesById,\n test: {\n ...emptyRole,\n name: 'test',\n description: 'test description',\n editable: true,\n uiPermissions: {\n ...emptyUiPermissions,\n groups: { testGroup: [uiPermissionsById.read.value] },\n releases: { bar: [uiPermissionsById.read.value] }\n }\n }\n },\n settingsInitialized: true,\n userSettingsInitialized: true,\n userSettings: { '2fa': 'disabled', previousFilters: [], columnSelection: [], onboarding: { something: 'here' }, tooltips: {} }\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","'use strict';\n\n// Copyright 2015 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 { uiPermissionsById } from '../constants';\n\nexport type UiPermission = {\n explanations: object;\n permissionLevel: number;\n permissionSets: Record<string, string>;\n title: string;\n value: string;\n verbs: string[];\n};\n\ntype ExcessiveAccessConfig = {\n selector: string;\n warning: string;\n};\n\ntype EndpointDefinition = {\n path: RegExp;\n types: string[];\n uiPermissions: UiPermission[];\n};\n\n/**\n * _uiPermissions_ represent the possible permissions/ rights that can be given for the area\n * _endpoints_ represent the possible endpoints this definition might be affecting in the UI and what\n * functionality might be affected\n *\n */\nexport type PermissionsArea = {\n endpoints: EndpointDefinition[];\n excessiveAccessConfig?: ExcessiveAccessConfig;\n explanation: string;\n filter?: (object) => string[];\n key: string;\n placeholder?: string;\n scope?: string;\n title: string;\n uiPermissions: UiPermission[];\n};\n\nexport const itemUiPermissionsReducer = (accu, { item, uiPermissions }) => (item ? { ...accu, [item]: uiPermissions } : accu);\n\nconst checkSinglePermission = (permission, requiredPermission) =>\n requiredPermission === permission || uiPermissionsById[permission].permissionLevel > uiPermissionsById[requiredPermission].permissionLevel;\n\nexport const checkPermissionsObject = (permissions, requiredPermission, scopedAccess, superAccess) =>\n permissions[superAccess]?.some(permission => checkSinglePermission(permission, requiredPermission)) ||\n permissions[scopedAccess]?.some(permission => checkSinglePermission(permission, requiredPermission));\n\nexport const USER_LOGOUT = 'USER_LOGOUT';\n\nexport const OWN_USER_ID = 'me';\n\nexport const settingsKeys = { initialized: 'settings-initialized' };\n\nexport const READ_STATES = {\n read: 'read',\n seen: 'seen',\n unread: 'unread'\n} as const;\nexport type ReadState = keyof typeof READ_STATES;\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 { User as BackendUser, DeploymentPhase, TenantInfo, TenantsIdName } from '@northern.tech/types/MenderTypes';\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { FilterOperator, PermissionSet, Role } from '../constants';\nimport { defaultPermissionSets, rolesById } from '../constants';\nimport type { ReadState } from './constants';\nimport { READ_STATES } from './constants';\n\nexport const sliceName = 'users';\nexport type User = BackendUser & TenantInfo & { tenants?: TenantsIdName };\nexport type UserSession = {\n expiresAt?: string;\n token: string;\n};\nexport type CustomColumn = {\n attribute: {\n name: string;\n scope: string;\n };\n size: number;\n};\n\ntype FilterOption = {\n key: string;\n operator: FilterOperator;\n scope: string;\n value: string;\n};\nexport type GlobalSettings = {\n [x: string]: any;\n id_attribute?: {\n attribute: string;\n scope: string;\n };\n previousFilters: FilterOption[];\n previousPhases: DeploymentPhase[][];\n retries: number;\n};\ntype Column = {\n id: string;\n key: string;\n name: string;\n scope: string;\n title: string;\n};\nexport type UserSettings = {\n [x: string]: any;\n columnSelection: Column[];\n feedbackCollectedAt?: string;\n firstLoginTimestamp: null | string;\n mode?: 'light' | 'dark';\n onboarding: Partial<{\n address: string;\n approach: 'physical' | 'virtual' | 'mcu' | null;\n complete: boolean;\n demoArtifactPort: number;\n deviceType: string[] | string;\n progress: string;\n showTips: null | boolean;\n showTipsDialog: boolean;\n }>;\n tooltips?: object;\n trackingConsentGiven?: boolean;\n};\n\nexport type UserSliceType = {\n activationCode?: string;\n byId: Record<string, User>;\n currentSession?: UserSession | object;\n currentUser: string | null;\n customColumns: CustomColumn[];\n globalSettings: GlobalSettings;\n permissionSetsById: Record<string, PermissionSet>;\n qrCode: string | null;\n rolesById: Record<string, Role>;\n rolesInitialized: boolean;\n settingsInitialized: boolean;\n showConnectDeviceDialog: boolean;\n showFeedbackDialog: boolean;\n showStartupNotification: boolean;\n tooltips: {\n byId: Record<string, { readState: ReadState }>;\n };\n userSettings: UserSettings;\n userSettingsInitialized: boolean;\n};\n\nexport const initialState: UserSliceType = {\n activationCode: undefined,\n byId: {},\n currentUser: null,\n currentSession: {\n // { token: window.localStorage.getItem('JWT'), expiresAt: '2023-01-01T00:15:00.000Z' | undefined }, // expiresAt depending on the stay logged in setting\n },\n customColumns: [],\n qrCode: null,\n globalSettings: {\n id_attribute: undefined,\n previousFilters: [],\n previousPhases: [],\n retries: 0\n },\n permissionSetsById: {\n ...defaultPermissionSets\n },\n rolesById: {\n ...rolesById\n },\n rolesInitialized: false,\n settingsInitialized: false,\n showConnectDeviceDialog: false,\n showFeedbackDialog: false,\n showStartupNotification: false,\n tooltips: {\n byId: {\n // <id>: { readState: <read|unread> } // this object is getting enhanced by the tooltip texts in the app constants\n }\n },\n userSettings: {\n columnSelection: [],\n onboarding: {},\n firstLoginTimestamp: null\n },\n userSettingsInitialized: false\n};\n\nexport const usersSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n receivedQrCode: (state, action: PayloadAction<string | null>) => {\n state.qrCode = action.payload;\n },\n successfullyLoggedIn: (state, action: PayloadAction<UserSession>) => {\n state.currentSession = action.payload;\n },\n receivedUserList: (state, action: PayloadAction<Record<string, User>>) => {\n state.byId = action.payload;\n },\n receivedActivationCode: (state, action: PayloadAction<string>) => {\n state.activationCode = action.payload;\n },\n receivedUser: (state, action: PayloadAction<User>) => {\n state.byId[action.payload.id] = action.payload;\n state.currentUser = action.payload.id;\n },\n removedUser: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: removedUser, ...byId } = state.byId;\n state.byId = byId;\n state.currentUser = state.currentUser === action.payload ? null : state.currentUser;\n },\n updatedUser: (state, action: PayloadAction<Partial<User> & { id: string }>) => {\n state.byId[action.payload.id] = {\n ...state.byId[action.payload.id],\n ...action.payload\n };\n },\n receivedPermissionSets: (state, action: PayloadAction<Record<string, PermissionSet>>) => {\n state.permissionSetsById = action.payload;\n },\n receivedRoles: (state, action: PayloadAction<Record<string, Role>>) => {\n state.rolesById = action.payload;\n state.rolesInitialized = true;\n },\n finishedRoleInitialization: (state, action) => {\n state.rolesInitialized = action.payload;\n },\n createdRole: (state, action: PayloadAction<Role>) => {\n state.rolesById[action.payload.name] = {\n ...state.rolesById[action.payload.name],\n ...action.payload\n };\n },\n removedRole: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: toBeRemoved, ...rolesById } = state.rolesById;\n state.rolesById = rolesById;\n },\n setCustomColumns: (state, action: PayloadAction<CustomColumn[]>) => {\n state.customColumns = action.payload;\n },\n setGlobalSettings: (state, action: PayloadAction<GlobalSettings>) => {\n state.settingsInitialized = true;\n state.globalSettings = {\n ...state.globalSettings,\n ...action.payload\n };\n },\n setUserSettings: (state, action: PayloadAction<UserSettings>) => {\n state.userSettingsInitialized = true;\n state.userSettings = {\n ...state.userSettings,\n ...action.payload\n };\n },\n setTooltipState: (state, action: PayloadAction<{ id: string; readState: ReadState }>) => {\n const { id, readState = READ_STATES.read } = action.payload;\n state.tooltips.byId[id] = { ...state.tooltips.byId[id], readState };\n },\n setTooltipsState: (state, action: PayloadAction<UserSliceType['tooltips']['byId']>) => {\n state.tooltips.byId = {\n ...state.tooltips.byId,\n ...action.payload\n };\n },\n setShowFeedbackDialog: (state, action: PayloadAction<boolean>) => {\n state.showFeedbackDialog = action.payload;\n },\n setShowConnectingDialog: (state, action: PayloadAction<boolean>) => {\n state.showConnectDeviceDialog = action.payload;\n },\n setShowStartupNotification: (state, action: PayloadAction<boolean>) => {\n state.showStartupNotification = action.payload;\n }\n }\n});\n\nexport const actions = usersSlice.actions;\nexport default usersSlice.reducer;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACcA,uBA8CO;;;ACUA,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AACV;;;AC3DA,qBAA4B;AAOrB,IAAM,YAAY;AA+ElB,IAAM,eAA8B;AAAA,EACzC,gBAAgB;AAAA,EAChB,MAAM,CAAC;AAAA,EACP,aAAa;AAAA,EACb,gBAAgB;AAAA;AAAA,EAEhB;AAAA,EACA,eAAe,CAAC;AAAA,EAChB,QAAQ;AAAA,EACR,gBAAgB;AAAA,IACd,cAAc;AAAA,IACd,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